diff options
author | julian <julian@FreeBSD.org> | 2001-09-12 08:38:13 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 2001-09-12 08:38:13 +0000 |
commit | 5596676e6c6c1e81e899cd0531f9b1c28a292669 (patch) | |
tree | b1a19fcdf05759281fab0d89efb13f0fdf42102e /sys/kern/link_elf.c | |
parent | 83e00d4274950d2b531c24692cd123538ffbddb9 (diff) | |
download | FreeBSD-src-5596676e6c6c1e81e899cd0531f9b1c28a292669.zip FreeBSD-src-5596676e6c6c1e81e899cd0531f9b1c28a292669.tar.gz |
KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED
make the kernel aware that there are smaller units of scheduling than the
process. (but only allow one thread per process at this time).
This is functionally equivalent to teh previousl -current except
that there is a thread associated with each process.
Sorry john! (your next MFC will be a doosie!)
Reviewed by: peter@freebsd.org, dillon@freebsd.org
X-MFC after: ha ha ha ha
Diffstat (limited to 'sys/kern/link_elf.c')
-rw-r--r-- | sys/kern/link_elf.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c index 0abf96c..db29c37 100644 --- a/sys/kern/link_elf.c +++ b/sys/kern/link_elf.c @@ -513,7 +513,8 @@ static int link_elf_load_file(linker_class_t cls, const char* filename, linker_file_t* result) { struct nameidata nd; - struct proc* p = curproc; /* XXX */ + struct thread* td = curthread; /* XXX */ + struct proc* p = td->td_proc; /* XXX */ Elf_Ehdr *hdr; caddr_t firstpage; int nbytes, i; @@ -546,7 +547,7 @@ link_elf_load_file(linker_class_t cls, const char* filename, linker_file_t* resu shdr = NULL; lf = NULL; - NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, filename, p); + NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, filename, td); flags = FREAD; error = vn_open(&nd, &flags, 0); if (error) @@ -563,7 +564,7 @@ link_elf_load_file(linker_class_t cls, const char* filename, linker_file_t* resu } hdr = (Elf_Ehdr *)firstpage; error = vn_rdwr(UIO_READ, nd.ni_vp, firstpage, PAGE_SIZE, 0, - UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred, &resid, p); + UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred, &resid, td); nbytes = PAGE_SIZE - resid; if (error) goto out; @@ -702,7 +703,7 @@ link_elf_load_file(linker_class_t cls, const char* filename, linker_file_t* resu caddr_t segbase = mapbase + segs[i]->p_vaddr - base_vaddr; error = vn_rdwr(UIO_READ, nd.ni_vp, segbase, segs[i]->p_filesz, segs[i]->p_offset, - UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred, &resid, p); + UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred, &resid, td); if (error) { goto out; } @@ -756,7 +757,7 @@ link_elf_load_file(linker_class_t cls, const char* filename, linker_file_t* resu } error = vn_rdwr(UIO_READ, nd.ni_vp, (caddr_t)shdr, nbytes, hdr->e_shoff, - UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred, &resid, p); + UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred, &resid, td); if (error) goto out; symtabindex = -1; @@ -781,12 +782,12 @@ link_elf_load_file(linker_class_t cls, const char* filename, linker_file_t* resu } error = vn_rdwr(UIO_READ, nd.ni_vp, ef->symbase, symcnt, shdr[symtabindex].sh_offset, - UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred, &resid, p); + UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred, &resid, td); if (error) goto out; error = vn_rdwr(UIO_READ, nd.ni_vp, ef->strbase, strcnt, shdr[symstrindex].sh_offset, - UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred, &resid, p); + UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred, &resid, td); if (error) goto out; @@ -817,8 +818,8 @@ out: free(shdr, M_LINKER); if (firstpage) free(firstpage, M_LINKER); - VOP_UNLOCK(nd.ni_vp, 0, p); - vn_close(nd.ni_vp, FREAD, p->p_ucred, p); + VOP_UNLOCK(nd.ni_vp, 0, td); + vn_close(nd.ni_vp, FREAD, p->p_ucred, td); return error; } |