Date: Wed, 21 Jun 2006 11:29:31 GMT From: Roman Divacky <rdivacky@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 99747 for review Message-ID: <200606211129.k5LBTVZr067851@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=99747 Change 99747 by rdivacky@rdivacky_witten on 2006/06/21 11:29:20 Back-out revisions 99144 and 99406. Affected files ... .. //depot/projects/soc2006/rdivacky_linuxolator/amd64/linux32/linux32_sysvec.c#4 edit .. //depot/projects/soc2006/rdivacky_linuxolator/compat/linprocfs/linprocfs.c#3 edit .. //depot/projects/soc2006/rdivacky_linuxolator/compat/linux/linux_mib.c#4 edit .. //depot/projects/soc2006/rdivacky_linuxolator/compat/linux/linux_util.c#4 edit .. //depot/projects/soc2006/rdivacky_linuxolator/compat/linux/linux_util.h#3 edit .. //depot/projects/soc2006/rdivacky_linuxolator/i386/linux/linux_sysvec.c#4 edit Differences ... ==== //depot/projects/soc2006/rdivacky_linuxolator/amd64/linux32/linux32_sysvec.c#4 (text+ko) ==== @@ -1018,7 +1018,7 @@ ELFOSABI_LINUX, EM_386, "Linux", - "/compat/linux/", + "/compat/linux", "/lib/ld-linux.so.1", &elf_linux_sysvec, NULL, @@ -1029,7 +1029,7 @@ ELFOSABI_LINUX, EM_386, "Linux", - "/compat/linux/", + "/compat/linux", "/lib/ld-linux.so.2", &elf_linux_sysvec, NULL, ==== //depot/projects/soc2006/rdivacky_linuxolator/compat/linprocfs/linprocfs.c#3 (text+ko) ==== @@ -281,9 +281,7 @@ char *dlep, *flep, *mntto, *mntfrom, *fstype; size_t lep_len; int error; - char linux_emul_path[LINUX_NAME_MAX]; - linux_get_emul_path(td, linux_emul_path); /* resolve symlinks etc. in the emulation tree prefix */ NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, linux_emul_path, td); flep = NULL; ==== //depot/projects/soc2006/rdivacky_linuxolator/compat/linux/linux_mib.c#4 (text+ko) ==== @@ -38,10 +38,7 @@ #include <sys/jail.h> #include <sys/lock.h> #include <sys/mutex.h> -#include <sys/imgact.h> -#include <sys/imgact_elf.h> -extern Elf32_Brandinfo *linux_brandlist[]; #include "opt_compat.h" #ifdef COMPAT_LINUX32 @@ -55,7 +52,6 @@ char pr_osname[LINUX_MAX_UTSNAME]; char pr_osrelease[LINUX_MAX_UTSNAME]; int pr_oss_version; - char pr_emul_path[LINUX_NAME_MAX]; }; SYSCTL_NODE(_compat, OID_AUTO, linux, CTLFLAG_RW, 0, @@ -85,61 +81,6 @@ 0, 0, linux_sysctl_osname, "A", "Linux kernel OS name"); -char linux_emul_path[LINUX_NAME_MAX] = "/compat/linux/"; - -static int -linux_sysctl_linux_emul_path(SYSCTL_HANDLER_ARGS) -{ - static char emul_path[LINUX_NAME_MAX]; - int error; - Elf32_Brandinfo **brandinfo; - - linux_get_emul_path(req->td, emul_path); - error = sysctl_handle_string(oidp, emul_path, LINUX_NAME_MAX, req); - if (error || req->newptr == NULL) - return (error); - error = linux_set_emul_path(req->td, emul_path); - { - static Elf32_Brandinfo linux_brand = { - ELFOSABI_LINUX, - EM_386, - "Linux", - emul_path, - "/lib/ld-linux.so.1", - &elf_linux_sysvec, - NULL, - BI_CAN_EXEC_DYN, - }; - static Elf32_Brandinfo linux_glibc2brand = { - ELFOSABI_LINUX, - EM_386, - "Linux", - emul_path, - "/lib/ld-linux.so.2", - &elf_linux_sysvec, - NULL, - BI_CAN_EXEC_DYN, - }; - - Elf32_Brandinfo *local_linux_brandlist[] = { - &linux_brand, - &linux_glibc2brand, - NULL - }; - - for (brandinfo = &local_linux_brandlist[0]; *brandinfo != NULL; - ++brandinfo) - if (elf32_insert_brand_entry(*brandinfo) < 0) - error = EINVAL; - } - return (error); -} - -SYSCTL_PROC(_compat_linux, OID_AUTO, emulpath, - CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_PRISON, - 0, 0, linux_sysctl_linux_emul_path, "A", - "Linux kernel OS emulation path"); - static char linux_osrelease[LINUX_MAX_UTSNAME] = "2.4.2"; static int @@ -305,51 +246,6 @@ return (0); } -void -linux_get_emul_path(struct thread *td, char *dst) -{ - register struct prison *pr; - register struct linux_prison *lpr; - - pr = td->td_ucred->cr_prison; - if (pr != NULL) { - mtx_lock(&pr->pr_mtx); - if (pr->pr_linux != NULL) { - lpr = (struct linux_prison *)pr->pr_linux; - if (lpr->pr_emul_path[0]) { - bcopy(lpr->pr_emul_path, dst, LINUX_NAME_MAX); - mtx_unlock(&pr->pr_mtx); - return; - } - } - mtx_unlock(&pr->pr_mtx); - } - - mtx_lock(&osname_lock); - bcopy(linux_emul_path, dst, LINUX_NAME_MAX); - mtx_unlock(&osname_lock); -} - -int -linux_set_emul_path(struct thread *td, char *emul_path) -{ - struct prison *pr; - struct linux_prison *lpr; - - pr = linux_get_prison(td); - if (pr != NULL) { - lpr = (struct linux_prison *)pr->pr_linux; - strcpy(lpr->pr_emul_path, emul_path); - mtx_unlock(&pr->pr_mtx); - } else { - mtx_lock(&osname_lock); - strcpy(linux_emul_path, emul_path); - mtx_unlock(&osname_lock); - } - - return (0); -} - int linux_get_oss_version(struct thread *td) { ==== //depot/projects/soc2006/rdivacky_linuxolator/compat/linux/linux_util.c#4 (text+ko) ==== @@ -47,12 +47,6 @@ #include <machine/stdarg.h> #include <compat/linux/linux_util.h> -#ifdef COMPAT_LINUX32 -#include <machine/../linux32/linux.h> -#else -#include <machine/../linux/linux.h> -#endif -#include <compat/linux/linux_mib.h> /* * Search an alternate path before passing pathname arguments on @@ -70,9 +64,6 @@ char **pbuf; int cflag; { - char linux_emul_path[LINUX_NAME_MAX]; - - linux_get_emul_path(td, linux_emul_path); return (kern_alternate_path(td, linux_emul_path, path, pathseg, pbuf, cflag)); @@ -92,6 +83,8 @@ printf("\n"); } +MALLOC_DECLARE(M_LINUX); + struct device_element { TAILQ_ENTRY(device_element) list; ==== //depot/projects/soc2006/rdivacky_linuxolator/compat/linux/linux_util.h#3 (text+ko) ==== @@ -75,6 +75,8 @@ return p; } +extern const char linux_emul_path[]; + int linux_emul_convpath(struct thread *, char *, enum uio_seg, char **, int); #define LCONVPATH(td, upath, pathp, i) \ ==== //depot/projects/soc2006/rdivacky_linuxolator/i386/linux/linux_sysvec.c#4 (text+ko) ==== @@ -858,7 +858,7 @@ ELFOSABI_LINUX, EM_386, "Linux", - "/compat/linux/", + "/compat/linux", "/lib/ld-linux.so.1", &elf_linux_sysvec, NULL, @@ -869,7 +869,7 @@ ELFOSABI_LINUX, EM_386, "Linux", - "/compat/linux/", + "/compat/linux", "/lib/ld-linux.so.2", &elf_linux_sysvec, NULL,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200606211129.k5LBTVZr067851>