--- Gnu-Mach/kern/syscall_subr.c 2020/09/02 04:42:47 1.1.1.2 +++ Gnu-Mach/kern/syscall_subr.c 2020/09/02 04:45:18 1.1.1.3 @@ -27,22 +27,21 @@ * the rights to redistribute these changes. */ -#include -#include - #include #include #include #include #include #include +#include +#include #include #include #include +#include #include #include #include -#include #include /* for splsched */ #if MACH_FIXPRI @@ -65,11 +64,9 @@ * lock and then be a good citizen and really suspend. */ -extern void thread_depress_priority(); -extern kern_return_t thread_depress_abort(); +void thread_depress_priority(thread_t, mach_msg_timeout_t); -#ifdef CONTINUATIONS -void swtch_continue() +void swtch_continue(void) { register processor_t myprocessor; @@ -78,11 +75,8 @@ void swtch_continue() myprocessor->processor_set->runq.count > 0); /*NOTREACHED*/ } -#else /* not CONTINUATIONS */ -#define swtch_continue 0 -#endif /* not CONTINUATIONS */ -boolean_t swtch() +boolean_t swtch(void) { register processor_t myprocessor; @@ -100,8 +94,7 @@ boolean_t swtch() myprocessor->processor_set->runq.count > 0); } -#ifdef CONTINUATIONS -void swtch_pri_continue() +void swtch_pri_continue(void) { register thread_t thread = current_thread(); register processor_t myprocessor; @@ -113,9 +106,6 @@ void swtch_pri_continue() myprocessor->processor_set->runq.count > 0); /*NOTREACHED*/ } -#else /* not CONTINUATIONS */ -#define swtch_pri_continue 0 -#endif /* not CONTINUATIONS */ boolean_t swtch_pri(pri) int pri; @@ -150,10 +140,7 @@ boolean_t swtch_pri(pri) myprocessor->processor_set->runq.count > 0); } -extern int hz; - -#ifdef CONTINUATIONS -void thread_switch_continue() +void thread_switch_continue(void) { register thread_t cur_thread = current_thread(); @@ -165,9 +152,6 @@ void thread_switch_continue() thread_syscall_return(KERN_SUCCESS); /*NOTREACHED*/ } -#else /* not CONTINUATIONS */ -#define thread_switch_continue 0 -#endif /* not CONTINUATIONS */ /* * thread_switch: @@ -397,3 +381,18 @@ register thread_t thread; (void) splx(s); return(KERN_SUCCESS); } + +/* + * mach_print + * + * Display a null-terminated character string on the Mach console. + * This system call is meant as a debugging tool useful to circumvent + * messaging altogether. + */ +#ifdef MACH_KDB +void +mach_print(const char *s) +{ + printf("%s", s); +} +#endif /* MACH_KDB */