From aaefc6f8386e095ca4f047436e2c434c9b48d96d Mon Sep 17 00:00:00 2001 From: Arun Thomas Date: Tue, 2 Aug 2011 13:57:31 +0200 Subject: [PATCH] Add MKMCONTEXT option --- kernel/Makefile | 6 ++++++ kernel/config.h | 1 - kernel/system/Makefile.inc | 1 - servers/pm/Makefile | 9 ++++++++- servers/pm/proto.h | 4 ++++ share/mk/bsd.own.mk | 5 +++-- 6 files changed, 21 insertions(+), 5 deletions(-) diff --git a/kernel/Makefile b/kernel/Makefile index 6cae964ce..cae155cd8 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -59,6 +59,12 @@ SRCS+= apic.c apic_asm.S CPPFLAGS+= -DUSE_APIC .endif +.if ${USE_MCONTEXT} != "no" +SRCS+= do_mcontext.c +CPPFLAGS+= -DUSE_MCONTEXT +.endif + + # These come last, so the profiling buffer is at the end of the data segment SRCS+= profile.c do_sprofile.c diff --git a/kernel/config.h b/kernel/config.h index f235944e3..b688f4769 100644 --- a/kernel/config.h +++ b/kernel/config.h @@ -43,7 +43,6 @@ #define USE_MEMSET 1 /* write char to a given memory area */ #define USE_RUNCTL 1 /* control stop flags of a process */ #define USE_UPDATE 1 /* update a process into another */ -#define USE_MCONTEXT 1 /* enable getting and setting of mach context*/ #define USE_STATECTL 1 /* let a process control its state */ /* Length of program names stored in the process table. This is only used diff --git a/kernel/system/Makefile.inc b/kernel/system/Makefile.inc index 34cf87f5a..ff8a25613 100644 --- a/kernel/system/Makefile.inc +++ b/kernel/system/Makefile.inc @@ -37,7 +37,6 @@ SRCS+= \ do_cprofile.c \ do_profbuf.c \ do_vmctl.c \ - do_mcontext.c \ do_schedule.c \ do_schedctl.c \ do_statectl.c diff --git a/servers/pm/Makefile b/servers/pm/Makefile index 43f53c976..183d752af 100644 --- a/servers/pm/Makefile +++ b/servers/pm/Makefile @@ -1,8 +1,15 @@ +.include + # Makefile for Process Manager (PM) PROG= pm SRCS= main.c forkexit.c break.c exec.c time.c alarm.c \ signal.c utility.c table.c trace.c getset.c misc.c \ - profile.c dma.c mcontext.c schedule.c + profile.c dma.c schedule.c + +.if ${USE_MCONTEXT} != "no" +SRCS+= mcontext.c +CPPFLAGS+= -DUSE_MCONTEXT +.endif DPADD+= ${LIBSYS} ${LIBTIMERS} LDADD+= -lsys -ltimers diff --git a/servers/pm/proto.h b/servers/pm/proto.h index 76d0ef318..9eb2bd429 100644 --- a/servers/pm/proto.h +++ b/servers/pm/proto.h @@ -49,6 +49,10 @@ _PROTOTYPE( void setreply, (int proc_nr, int result) ); /* mcontext.c */ _PROTOTYPE( int do_getmcontext, (void) ); _PROTOTYPE( int do_setmcontext, (void) ); +#if ! USE_MCONTEXT +#define do_getmcontext no_sys +#define do_setmcontext no_sys +#endif /* misc.c */ _PROTOTYPE( int do_reboot, (void) ); diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk index 3143a0817..2c9deb90c 100644 --- a/share/mk/bsd.own.mk +++ b/share/mk/bsd.own.mk @@ -758,7 +758,7 @@ _MKVARS.yes= \ MKYP #MINIX-specific vars _MKVARS.yes+= \ - MKWATCHDOG MKACPI MKAPIC + MKWATCHDOG MKACPI MKAPIC MKMCONTEXT .for var in ${_MKVARS.yes} ${var}?= yes .endfor @@ -821,6 +821,7 @@ MKNLS:= no MKWATCHDOG:= no MKACPI:= no MKAPIC:= no +MKMCONTEXT:= no .endif # @@ -882,7 +883,7 @@ ${var}?= no # variable is set to "no". # .for var in USE_HESIOD USE_INET6 USE_KERBEROS USE_LDAP USE_PAM USE_YP \ -USE_WATCHDOG USE_ACPI USE_APIC +USE_WATCHDOG USE_ACPI USE_APIC USE_MCONTEXT .if (${${var:S/USE_/MK/}} == "no") ${var}:= no .else -- 2.44.0