PERFORCE change 115222 for review
Jung-uk Kim
jkim at FreeBSD.org
Thu Mar 1 22:39:07 UTC 2007
http://perforce.freebsd.org/chv.cgi?CH=115222
Change 115222 by jkim at jkim_hammer on 2007/03/01 22:38:25
Prefix Linuxulator macros with LINUX_ to prevent future collision.
Affected files ...
.. //depot/projects/linuxolator/src/sys/amd64/linux32/linux.h#23 edit
.. //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_machdep.c#45 edit
.. //depot/projects/linuxolator/src/sys/compat/linux/linux_emul.c#40 edit
.. //depot/projects/linuxolator/src/sys/i386/linux/linux.h#19 edit
.. //depot/projects/linuxolator/src/sys/i386/linux/linux_machdep.c#36 edit
Differences ...
==== //depot/projects/linuxolator/src/sys/amd64/linux32/linux.h#23 (text+ko) ====
@@ -30,8 +30,8 @@
* $FreeBSD: src/sys/amd64/linux32/linux.h,v 1.13 2007/02/24 16:49:24 netchild Exp $
*/
-#ifndef _AMD64_LINUX_LINUX_H_
-#define _AMD64_LINUX_LINUX_H_
+#ifndef _AMD64_LINUX_H_
+#define _AMD64_LINUX_H_
#include <amd64/linux32/linux32_syscall.h>
@@ -782,30 +782,30 @@
* Macros which does the same thing as those in Linux include/asm-um/ldt-i386.h.
* These convert Linux user space descriptor to machine one.
*/
-#define LDT_entry_a(info) \
+#define LINUX_LDT_entry_a(info) \
((((info)->base_addr & LINUX_LOWERWORD) << 16) | \
((info)->limit & LINUX_LOWERWORD))
-#define ENTRY_B_READ_EXEC_ONLY 9
-#define ENTRY_B_CONTENTS 10
-#define ENTRY_B_SEG_NOT_PRESENT 15
-#define ENTRY_B_BASE_ADDR 16
-#define ENTRY_B_USEABLE 20
-#define ENTRY_B_SEG32BIT 22
-#define ENTRY_B_LIMIT 23
+#define LINUX_ENTRY_B_READ_EXEC_ONLY 9
+#define LINUX_ENTRY_B_CONTENTS 10
+#define LINUX_ENTRY_B_SEG_NOT_PRESENT 15
+#define LINUX_ENTRY_B_BASE_ADDR 16
+#define LINUX_ENTRY_B_USEABLE 20
+#define LINUX_ENTRY_B_SEG32BIT 22
+#define LINUX_ENTRY_B_LIMIT 23
-#define LDT_entry_b(info) \
- (((info)->base_addr & 0xff000000) | \
- ((info)->limit & 0xf0000) | \
- ((info)->contents << ENTRY_B_CONTENTS) | \
- (((info)->seg_not_present == 0) << ENTRY_B_SEG_NOT_PRESENT) | \
- (((info)->base_addr & 0x00ff0000) >> ENTRY_B_BASE_ADDR) | \
- (((info)->read_exec_only == 0) << ENTRY_B_READ_EXEC_ONLY) | \
- ((info)->seg_32bit << ENTRY_B_SEG32BIT) | \
- ((info)->useable << ENTRY_B_USEABLE) | \
- ((info)->limit_in_pages << ENTRY_B_LIMIT) | 0x7000)
+#define LINUX_LDT_entry_b(info) \
+ (((info)->base_addr & 0xff000000) | \
+ ((info)->limit & 0xf0000) | \
+ ((info)->contents << LINUX_ENTRY_B_CONTENTS) | \
+ (((info)->seg_not_present == 0) << LINUX_ENTRY_B_SEG_NOT_PRESENT) | \
+ (((info)->base_addr & 0x00ff0000) >> LINUX_ENTRY_B_BASE_ADDR) | \
+ (((info)->read_exec_only == 0) << LINUX_ENTRY_B_READ_EXEC_ONLY) | \
+ ((info)->seg_32bit << LINUX_ENTRY_B_SEG32BIT) | \
+ ((info)->useable << LINUX_ENTRY_B_USEABLE) | \
+ ((info)->limit_in_pages << LINUX_ENTRY_B_LIMIT) | 0x7000)
-#define LDT_empty(info) \
+#define LINUX_LDT_empty(info) \
((info)->base_addr == 0 && \
(info)->limit == 0 && \
(info)->contents == 0 && \
@@ -819,21 +819,27 @@
* Macros for converting segments.
* They do the same as those in arch/i386/kernel/process.c in Linux.
*/
-#define GET_BASE(desc) \
+#define LINUX_GET_BASE(desc) \
((((desc)->a >> 16) & LINUX_LOWERWORD) | \
(((desc)->b << 16) & 0x00ff0000) | \
((desc)->b & 0xff000000))
-#define GET_LIMIT(desc) \
+#define LINUX_GET_LIMIT(desc) \
(((desc)->a & LINUX_LOWERWORD) | \
((desc)->b & 0xf0000))
-#define GET_32BIT(desc) (((desc)->b >> ENTRY_B_SEG32BIT) & 1)
-#define GET_CONTENTS(desc) (((desc)->b >> ENTRY_B_CONTENTS) & 3)
-#define GET_WRITABLE(desc) (((desc)->b >> ENTRY_B_READ_EXEC_ONLY) & 1)
-#define GET_LIMIT_PAGES(desc) (((desc)->b >> ENTRY_B_LIMIT) & 1)
-#define GET_PRESENT(desc) (((desc)->b >> ENTRY_B_SEG_NOT_PRESENT) & 1)
-#define GET_USEABLE(desc) (((desc)->b >> ENTRY_B_USEABLE) & 1)
+#define LINUX_GET_32BIT(desc) \
+ (((desc)->b >> LINUX_ENTRY_B_SEG32BIT) & 1)
+#define LINUX_GET_CONTENTS(desc) \
+ (((desc)->b >> LINUX_ENTRY_B_CONTENTS) & 3)
+#define LINUX_GET_WRITABLE(desc) \
+ (((desc)->b >> LINUX_ENTRY_B_READ_EXEC_ONLY) & 1)
+#define LINUX_GET_LIMIT_PAGES(desc) \
+ (((desc)->b >> LINUX_ENTRY_B_LIMIT) & 1)
+#define LINUX_GET_PRESENT(desc) \
+ (((desc)->b >> LINUX_ENTRY_B_SEG_NOT_PRESENT) & 1)
+#define LINUX_GET_USEABLE(desc) \
+ (((desc)->b >> LINUX_ENTRY_B_USEABLE) & 1)
#define LINUX_CLOCK_REALTIME 0
#define LINUX_CLOCK_MONOTONIC 1
@@ -845,22 +851,23 @@
typedef int l_timer_t;
typedef int l_mqd_t;
-#define CLONE_VM 0x00000100
-#define CLONE_FS 0x00000200
-#define CLONE_FILES 0x00000400
-#define CLONE_SIGHAND 0x00000800
-#define CLONE_PID 0x00001000 /* No longer exist in Linux */
-#define CLONE_VFORK 0x00004000
-#define CLONE_PARENT 0x00008000
-#define CLONE_THREAD 0x00010000
-#define CLONE_SETTLS 0x00080000
-#define CLONE_PARENT_SETTID 0x00100000
-#define CLONE_CHILD_CLEARTID 0x00200000
-#define CLONE_CHILD_SETTID 0x01000000
+#define LINUX_CLONE_VM 0x00000100
+#define LINUX_CLONE_FS 0x00000200
+#define LINUX_CLONE_FILES 0x00000400
+#define LINUX_CLONE_SIGHAND 0x00000800
+#define LINUX_CLONE_PID 0x00001000 /* No longer exist in Linux */
+#define LINUX_CLONE_VFORK 0x00004000
+#define LINUX_CLONE_PARENT 0x00008000
+#define LINUX_CLONE_THREAD 0x00010000
+#define LINUX_CLONE_SETTLS 0x00080000
+#define LINUX_CLONE_PARENT_SETTID 0x00100000
+#define LINUX_CLONE_CHILD_CLEARTID 0x00200000
+#define LINUX_CLONE_CHILD_SETTID 0x01000000
-#define THREADING_FLAGS \
- (CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_THREAD)
+#define LINUX_THREADING_FLAGS \
+ (LINUX_CLONE_VM | LINUX_CLONE_FS | LINUX_CLONE_FILES | \
+ LINUX_CLONE_SIGHAND | LINUX_CLONE_THREAD)
#include <compat/linux/linux_aio.h>
-#endif /* !_AMD64_LINUX_LINUX_H_ */
+#endif /* !_AMD64_LINUX_H_ */
==== //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_machdep.c#45 (text+ko) ====
@@ -565,9 +565,9 @@
if (exit_signal <= LINUX_SIGTBLSZ)
exit_signal = linux_to_bsd_signal[_SIG_IDX(exit_signal)];
- if (args->flags & CLONE_VM)
+ if (args->flags & LINUX_CLONE_VM)
ff |= RFMEM;
- if (args->flags & CLONE_SIGHAND)
+ if (args->flags & LINUX_CLONE_SIGHAND)
ff |= RFSIGSHARE;
/*
* XXX: In Linux, sharing of fs info (chroot/cwd/umask)
@@ -575,7 +575,7 @@
* structure but in reality it does not make any problems
* because both of these flags are set at once usually.
*/
- if (!(args->flags & (CLONE_FILES | CLONE_FS)))
+ if (!(args->flags & (LINUX_CLONE_FILES | LINUX_CLONE_FS)))
ff |= RFFDG;
/*
@@ -591,10 +591,10 @@
* that special treatment is necessary for signal delivery
* between those processes and fd locking.
*/
- if ((args->flags & 0xffffff00) == THREADING_FLAGS)
+ if ((args->flags & 0xffffff00) == LINUX_THREADING_FLAGS)
ff |= RFTHREAD;
- if (args->flags & CLONE_PARENT_SETTID)
+ if (args->flags & LINUX_CLONE_PARENT_SETTID)
if (args->parent_tidptr == NULL)
return (EINVAL);
@@ -602,7 +602,7 @@
if (error)
return (error);
- if (args->flags & (CLONE_PARENT|CLONE_THREAD)) {
+ if (args->flags & (LINUX_CLONE_PARENT|LINUX_CLONE_THREAD)) {
sx_xlock(&proctree_lock);
PROC_LOCK(p2);
proc_reparent(p2, td->td_proc->p_pptr);
@@ -617,7 +617,7 @@
KASSERT(em != NULL, ("clone: emuldata not found.\n"));
/* and adjust it */
- if (args->flags & CLONE_THREAD) {
+ if (args->flags & LINUX_CLONE_THREAD) {
#ifdef notyet
PROC_LOCK(p2);
p2->p_pgrp = td->td_proc->p_pgrp;
@@ -626,19 +626,19 @@
exit_signal = 0;
}
- if (args->flags & CLONE_CHILD_SETTID)
+ if (args->flags & LINUX_CLONE_CHILD_SETTID)
em->child_set_tid = args->child_tidptr;
else
em->child_set_tid = NULL;
- if (args->flags & CLONE_CHILD_CLEARTID)
+ if (args->flags & LINUX_CLONE_CHILD_CLEARTID)
em->child_clear_tid = args->child_tidptr;
else
em->child_clear_tid = NULL;
EMUL_UNLOCK(&emul_lock);
- if (args->flags & CLONE_PARENT_SETTID) {
+ if (args->flags & LINUX_CLONE_PARENT_SETTID) {
error = copyout(&p2->p_pid, args->parent_tidptr,
sizeof(p2->p_pid));
if (error)
@@ -657,7 +657,7 @@
if (args->stack)
td2->td_frame->tf_rsp = PTROUT(args->stack);
- if (args->flags & CLONE_SETTLS) {
+ if (args->flags & LINUX_CLONE_SETTLS) {
struct user_segment_descriptor sd;
struct l_user_desc info;
int a[2];
@@ -674,8 +674,8 @@
if (error)
printf(LMSG("copyout failed!"));
- a[0] = LDT_entry_a(&info);
- a[1] = LDT_entry_b(&info);
+ a[0] = LINUX_LDT_entry_a(&info);
+ a[1] = LINUX_LDT_entry_b(&info);
memcpy(&sd, &a, sizeof(a));
#ifdef DEBUG
@@ -703,7 +703,7 @@
"stack %p sig = %d"), (int)p2->p_pid, args->stack,
exit_signal);
#endif
- if (args->flags & CLONE_VFORK) {
+ if (args->flags & LINUX_CLONE_VFORK) {
PROC_LOCK(p2);
p2->p_flag |= P_PPWAIT;
PROC_UNLOCK(p2);
@@ -720,7 +720,7 @@
td->td_retval[0] = p2->p_pid;
td->td_retval[1] = 0;
- if (args->flags & CLONE_VFORK) {
+ if (args->flags & LINUX_CLONE_VFORK) {
/* wait for the children to exit, ie. emulate vfork */
PROC_LOCK(p2);
while (p2->p_flag & P_PPWAIT)
@@ -1291,12 +1291,12 @@
if (error)
return (error);
- if (LDT_empty(&info)) {
+ if (LINUX_LDT_empty(&info)) {
a[0] = 0;
a[1] = 0;
} else {
- a[0] = LDT_entry_a(&info);
- a[1] = LDT_entry_b(&info);
+ a[0] = LINUX_LDT_entry_a(&info);
+ a[1] = LINUX_LDT_entry_b(&info);
}
memcpy(&sd, &a, sizeof(a));
==== //depot/projects/linuxolator/src/sys/compat/linux/linux_emul.c#40 (text+ko) ====
@@ -86,7 +86,7 @@
em = malloc(sizeof *em, M_LINUX, M_WAITOK | M_ZERO);
em->pid = child;
em->pdeath_signal = 0;
- if (flags & CLONE_THREAD) {
+ if (flags & LINUX_CLONE_THREAD) {
/* handled later in the code */
} else {
struct linux_emuldata_shared *s;
@@ -113,7 +113,7 @@
* proc
*/
if (child != 0) {
- if (flags & CLONE_THREAD) {
+ if (flags & LINUX_CLONE_THREAD) {
/* lookup the parent */
/*
* we dont have to lock the p_em because
==== //depot/projects/linuxolator/src/sys/i386/linux/linux.h#19 (text+ko) ====
@@ -28,8 +28,8 @@
* $FreeBSD: src/sys/i386/linux/linux.h,v 1.75 2007/02/24 16:49:24 netchild Exp $
*/
-#ifndef _I386_LINUX_LINUX_H_
-#define _I386_LINUX_LINUX_H_
+#ifndef _I386_LINUX_H_
+#define _I386_LINUX_H_
#include <sys/signal.h> /* for sigval union */
@@ -747,30 +747,30 @@
* Macros which does the same thing as those in Linux include/asm-um/ldt-i386.h.
* These convert Linux user space descriptor to machine one.
*/
-#define LDT_entry_a(info) \
+#define LINUX_LDT_entry_a(info) \
((((info)->base_addr & LINUX_LOWERWORD) << 16) | \
((info)->limit & LINUX_LOWERWORD))
-#define ENTRY_B_READ_EXEC_ONLY 9
-#define ENTRY_B_CONTENTS 10
-#define ENTRY_B_SEG_NOT_PRESENT 15
-#define ENTRY_B_BASE_ADDR 16
-#define ENTRY_B_USEABLE 20
-#define ENTRY_B_SEG32BIT 22
-#define ENTRY_B_LIMIT 23
+#define LINUX_ENTRY_B_READ_EXEC_ONLY 9
+#define LINUX_ENTRY_B_CONTENTS 10
+#define LINUX_ENTRY_B_SEG_NOT_PRESENT 15
+#define LINUX_ENTRY_B_BASE_ADDR 16
+#define LINUX_ENTRY_B_USEABLE 20
+#define LINUX_ENTRY_B_SEG32BIT 22
+#define LINUX_ENTRY_B_LIMIT 23
-#define LDT_entry_b(info) \
- (((info)->base_addr & 0xff000000) | \
- ((info)->limit & 0xf0000) | \
- ((info)->contents << ENTRY_B_CONTENTS) | \
- (((info)->seg_not_present == 0) << ENTRY_B_SEG_NOT_PRESENT) | \
- (((info)->base_addr & 0x00ff0000) >> ENTRY_B_BASE_ADDR) | \
- (((info)->read_exec_only == 0) << ENTRY_B_READ_EXEC_ONLY) | \
- ((info)->seg_32bit << ENTRY_B_SEG32BIT) | \
- ((info)->useable << ENTRY_B_USEABLE) | \
- ((info)->limit_in_pages << ENTRY_B_LIMIT) | 0x7000)
+#define LINUX_LDT_entry_b(info) \
+ (((info)->base_addr & 0xff000000) | \
+ ((info)->limit & 0xf0000) | \
+ ((info)->contents << LINUX_ENTRY_B_CONTENTS) | \
+ (((info)->seg_not_present == 0) << LINUX_ENTRY_B_SEG_NOT_PRESENT) | \
+ (((info)->base_addr & 0x00ff0000) >> LINUX_ENTRY_B_BASE_ADDR) | \
+ (((info)->read_exec_only == 0) << LINUX_ENTRY_B_READ_EXEC_ONLY) | \
+ ((info)->seg_32bit << LINUX_ENTRY_B_SEG32BIT) | \
+ ((info)->useable << LINUX_ENTRY_B_USEABLE) | \
+ ((info)->limit_in_pages << LINUX_ENTRY_B_LIMIT) | 0x7000)
-#define LDT_empty(info) \
+#define LINUX_LDT_empty(info) \
((info)->base_addr == 0 && \
(info)->limit == 0 && \
(info)->contents == 0 && \
@@ -784,21 +784,27 @@
* Macros for converting segments.
* They do the same as those in arch/i386/kernel/process.c in Linux.
*/
-#define GET_BASE(desc) \
+#define LINUX_GET_BASE(desc) \
((((desc)->a >> 16) & LINUX_LOWERWORD) | \
(((desc)->b << 16) & 0x00ff0000) | \
((desc)->b & 0xff000000))
-#define GET_LIMIT(desc) \
+#define LINUX_GET_LIMIT(desc) \
(((desc)->a & LINUX_LOWERWORD) | \
((desc)->b & 0xf0000))
-#define GET_32BIT(desc) (((desc)->b >> ENTRY_B_SEG32BIT) & 1)
-#define GET_CONTENTS(desc) (((desc)->b >> ENTRY_B_CONTENTS) & 3)
-#define GET_WRITABLE(desc) (((desc)->b >> ENTRY_B_READ_EXEC_ONLY) & 1)
-#define GET_LIMIT_PAGES(desc) (((desc)->b >> ENTRY_B_LIMIT) & 1)
-#define GET_PRESENT(desc) (((desc)->b >> ENTRY_B_SEG_NOT_PRESENT) & 1)
-#define GET_USEABLE(desc) (((desc)->b >> ENTRY_B_USEABLE) & 1)
+#define LINUX_GET_32BIT(desc) \
+ (((desc)->b >> LINUX_ENTRY_B_SEG32BIT) & 1)
+#define LINUX_GET_CONTENTS(desc) \
+ (((desc)->b >> LINUX_ENTRY_B_CONTENTS) & 3)
+#define LINUX_GET_WRITABLE(desc) \
+ (((desc)->b >> LINUX_ENTRY_B_READ_EXEC_ONLY) & 1)
+#define LINUX_GET_LIMIT_PAGES(desc) \
+ (((desc)->b >> LINUX_ENTRY_B_LIMIT) & 1)
+#define LINUX_GET_PRESENT(desc) \
+ (((desc)->b >> LINUX_ENTRY_B_SEG_NOT_PRESENT) & 1)
+#define LINUX_GET_USEABLE(desc) \
+ (((desc)->b >> LINUX_ENTRY_B_USEABLE) & 1)
#define LINUX_CLOCK_REALTIME 0
#define LINUX_CLOCK_MONOTONIC 1
@@ -810,22 +816,23 @@
typedef int l_timer_t;
typedef int l_mqd_t;
-#define CLONE_VM 0x00000100
-#define CLONE_FS 0x00000200
-#define CLONE_FILES 0x00000400
-#define CLONE_SIGHAND 0x00000800
-#define CLONE_PID 0x00001000 /* No longer exist in Linux */
-#define CLONE_VFORK 0x00004000
-#define CLONE_PARENT 0x00008000
-#define CLONE_THREAD 0x00010000
-#define CLONE_SETTLS 0x00080000
-#define CLONE_PARENT_SETTID 0x00100000
-#define CLONE_CHILD_CLEARTID 0x00200000
-#define CLONE_CHILD_SETTID 0x01000000
+#define LINUX_CLONE_VM 0x00000100
+#define LINUX_CLONE_FS 0x00000200
+#define LINUX_CLONE_FILES 0x00000400
+#define LINUX_CLONE_SIGHAND 0x00000800
+#define LINUX_CLONE_PID 0x00001000 /* No longer exist in Linux */
+#define LINUX_CLONE_VFORK 0x00004000
+#define LINUX_CLONE_PARENT 0x00008000
+#define LINUX_CLONE_THREAD 0x00010000
+#define LINUX_CLONE_SETTLS 0x00080000
+#define LINUX_CLONE_PARENT_SETTID 0x00100000
+#define LINUX_CLONE_CHILD_CLEARTID 0x00200000
+#define LINUX_CLONE_CHILD_SETTID 0x01000000
-#define THREADING_FLAGS \
- (CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_THREAD)
+#define LINUX_THREADING_FLAGS \
+ (LINUX_CLONE_VM | LINUX_CLONE_FS | LINUX_CLONE_FILES | \
+ LINUX_CLONE_SIGHAND | LINUX_CLONE_THREAD)
#include <compat/linux/linux_aio.h>
-#endif /* !_I386_LINUX_LINUX_H_ */
+#endif /* !_I386_LINUX_H_ */
==== //depot/projects/linuxolator/src/sys/i386/linux/linux_machdep.c#36 (text+ko) ====
@@ -394,9 +394,9 @@
if (exit_signal <= LINUX_SIGTBLSZ)
exit_signal = linux_to_bsd_signal[_SIG_IDX(exit_signal)];
- if (args->flags & CLONE_VM)
+ if (args->flags & LINUX_CLONE_VM)
ff |= RFMEM;
- if (args->flags & CLONE_SIGHAND)
+ if (args->flags & LINUX_CLONE_SIGHAND)
ff |= RFSIGSHARE;
/*
* XXX: in linux sharing of fs info (chroot/cwd/umask)
@@ -404,7 +404,7 @@
* structure but in reality it doesn't cause any problems
* because both of these flags are usually set together.
*/
- if (!(args->flags & (CLONE_FILES | CLONE_FS)))
+ if (!(args->flags & (LINUX_CLONE_FILES | LINUX_CLONE_FS)))
ff |= RFFDG;
/*
@@ -420,10 +420,10 @@
* that special treatment is necessary for signal delivery
* between those processes and fd locking.
*/
- if ((args->flags & 0xffffff00) == THREADING_FLAGS)
+ if ((args->flags & 0xffffff00) == LINUX_THREADING_FLAGS)
ff |= RFTHREAD;
- if (args->flags & CLONE_PARENT_SETTID)
+ if (args->flags & LINUX_CLONE_PARENT_SETTID)
if (args->parent_tidptr == NULL)
return (EINVAL);
@@ -431,7 +431,7 @@
if (error)
return (error);
- if (args->flags & (CLONE_PARENT|CLONE_THREAD)) {
+ if (args->flags & (LINUX_CLONE_PARENT|LINUX_CLONE_THREAD)) {
sx_xlock(&proctree_lock);
PROC_LOCK(p2);
proc_reparent(p2, td->td_proc->p_pptr);
@@ -446,7 +446,7 @@
KASSERT(em != NULL, ("clone: emuldata not found.\n"));
/* and adjust it */
- if (args->flags & CLONE_THREAD) {
+ if (args->flags & LINUX_CLONE_THREAD) {
#ifdef notyet
PROC_LOCK(p2);
p2->p_pgrp = td->td_proc->p_pgrp;
@@ -455,19 +455,19 @@
exit_signal = 0;
}
- if (args->flags & CLONE_CHILD_SETTID)
+ if (args->flags & LINUX_CLONE_CHILD_SETTID)
em->child_set_tid = args->child_tidptr;
else
em->child_set_tid = NULL;
- if (args->flags & CLONE_CHILD_CLEARTID)
+ if (args->flags & LINUX_CLONE_CHILD_CLEARTID)
em->child_clear_tid = args->child_tidptr;
else
em->child_clear_tid = NULL;
EMUL_UNLOCK(&emul_lock);
- if (args->flags & CLONE_PARENT_SETTID) {
+ if (args->flags & LINUX_CLONE_PARENT_SETTID) {
error = copyout(&p2->p_pid, args->parent_tidptr, sizeof(p2->p_pid));
if (error)
printf(LMSG("copyout failed!"));
@@ -484,7 +484,7 @@
if (args->stack)
td2->td_frame->tf_esp = (unsigned int)args->stack;
- if (args->flags & CLONE_SETTLS) {
+ if (args->flags & LINUX_CLONE_SETTLS) {
struct l_user_desc info;
int idx;
int a[2];
@@ -515,8 +515,8 @@
printf(LMSG("copyout failed!"));
}
- a[0] = LDT_entry_a(&info);
- a[1] = LDT_entry_b(&info);
+ a[0] = LINUX_LDT_entry_a(&info);
+ a[1] = LINUX_LDT_entry_b(&info);
memcpy(&sd, &a, sizeof(a));
#ifdef DEBUG
@@ -544,7 +544,7 @@
printf(LMSG("clone: successful rfork to %ld, stack %p sig = %d"),
(long)p2->p_pid, args->stack, exit_signal);
#endif
- if (args->flags & CLONE_VFORK) {
+ if (args->flags & LINUX_CLONE_VFORK) {
PROC_LOCK(p2);
p2->p_flag |= P_PPWAIT;
PROC_UNLOCK(p2);
@@ -561,7 +561,7 @@
td->td_retval[0] = p2->p_pid;
td->td_retval[1] = 0;
- if (args->flags & CLONE_VFORK) {
+ if (args->flags & LINUX_CLONE_VFORK) {
/* wait for the children to exit, ie. emulate vfork */
PROC_LOCK(p2);
while (p2->p_flag & P_PPWAIT)
@@ -1131,12 +1131,12 @@
if (error)
return (error);
- if (LDT_empty(&info)) {
+ if (LINUX_LDT_empty(&info)) {
a[0] = 0;
a[1] = 0;
} else {
- a[0] = LDT_entry_a(&info);
- a[1] = LDT_entry_b(&info);
+ a[0] = LINUX_LDT_entry_a(&info);
+ a[1] = LINUX_LDT_entry_b(&info);
}
memcpy(&sd, &a, sizeof(a));
@@ -1198,14 +1198,14 @@
memcpy(&desc, &sd, sizeof(desc));
info.entry_number = idx;
- info.base_addr = GET_BASE(&desc);
- info.limit = GET_LIMIT(&desc);
- info.seg_32bit = GET_32BIT(&desc);
- info.contents = GET_CONTENTS(&desc);
- info.read_exec_only = !GET_WRITABLE(&desc);
- info.limit_in_pages = GET_LIMIT_PAGES(&desc);
- info.seg_not_present = !GET_PRESENT(&desc);
- info.useable = GET_USEABLE(&desc);
+ info.base_addr = LINUX_GET_BASE(&desc);
+ info.limit = LINUX_GET_LIMIT(&desc);
+ info.seg_32bit = LINUX_GET_32BIT(&desc);
+ info.contents = LINUX_GET_CONTENTS(&desc);
+ info.read_exec_only = !LINUX_GET_WRITABLE(&desc);
+ info.limit_in_pages = LINUX_GET_LIMIT_PAGES(&desc);
+ info.seg_not_present = !LINUX_GET_PRESENT(&desc);
+ info.useable = LINUX_GET_USEABLE(&desc);
error = copyout(&info, args->desc, sizeof(struct l_user_desc));
if (error)
More information about the p4-projects
mailing list