From 1fac2f5107e94102ca643ab9b031030bbcb1daa1 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sun, 20 Jul 2008 17:05:43 +0000 Subject: 2008-07-20 Samuel Thibault * linux/pcmcia-cs/glue/wireless_glue.h (schedule_task): Add parameter to Debugger() call. * kern/lock_mon.c (retry_simple_lock, retry_bit_lock): Likewise. * kern/machine.c (Debugger): Remove declaration. 2008-07-19 Barry deFreese * device/dev_hdr.h (dev_name_lookup, dev_set_indirection): Add prototypes. * device/dev_pager.c: Include . * device/ds_routines.c: Likewise. * device/subrs.c: Likewise. * device/device_init.c: Include . * device/ds_routines.h (iowait): Add prototype. * device/net_io.h (net_kmsg_collect): Add prototype. * device/net_io.c (hash_ent_remove, net_free_dead_infp, net_free_dead_entp, bpf_validate, bpf_eq, net_add_q_info, bpf_match): Add forward declarations. * device/subrs.h: New header. * i386/i386/fpu.h: Include . Change include to . (fp_save, fp_load, fp_free, fpu_module_init, fpu_set_state, fpu_get_state, fpnoextflt, fpextovrflt, fpexterrflt, init_fpu): Add prototypes. * i386/i386/gdt.h (gdt_init): Add prototype. * i386/i386/io_map.c: Include . * vm/vm_kern.c: Likewise. * i386/i386/ktss.h (ktss_init): Add prototype. * i386/i386/ldt.h (ldt_init): Add prototype. * i386/i386/loose_ends.h: New header. * i386/i386/loose_ends.c (delay): Complete prototype. * i386/i386/model_dep.h (startrtclock): Add prototype. * i386/i386/pcb.h (load_context, stack_attach, stack_detach, switch_ktss): Add prototypes. * i386/i386/pic.h (form_pic_mask, picinit): Add prototypes. * i386/i386/pit.c: Include . * i386/i386at/kd_mouse.c: Likewise. * i386/i386/pit.h (clkstart): Add prototype. * i386/i386/trap.c: Include , , . * i386/i386/trap.h (interrupted_pc): Add prototype. * i386/i386/user_ldt.c: Include . * i386/i386at/autoconf.h: New header. * i386/i386at/com.h: New header. * i386/i386at/com.c: Include , . * i386/i386at/idt.h (idt_init): Add prototype. * i386/i386at/int_init.h: New header. * i386/i386at/kd.c: Include . * kern/debug.c: Likewise. * i386/i386at/kd_event.c: Include . * i386/i386at/kd_mouse.c: Likewise. * i386/i386at/kd_mouse.c: Include , . * i386/i386at/lpr.c: Include * i386/i386at/model_dep.c: Include: , , , , , , , , , , . * i386/i386at/rtc.h (readtodc, writetodc): Add prototypes. * i386/intel/pmap.h: Include . (pmap_bootstrap, pmap_unmap_page_zero, pmap_zero_page, pmap_copy_page, kvtophys): Add prototypes. * i386/intel/read_fault.h: New header. * kern/ast.h (ast_init, ast_check): Add prototypes. * kern/debug.c (Debugger): Move prototype to... * kern/debug.h (Debugger): ... here. * kern/eventcount.h (evc_notify_abort): Add prototype. * kern/ipc_mig.c: Include , , * kern/ipc_mig.h: New header. * kern/ipc_tt.h (mach_reply_port): Add prototype. * kern/machine.h: New header. * kern/processor.h (pset_sys_bootstrap): Move prototype outside of MACH_HOST check. * kern/sched_prim.h (thread_bind, compute_priority, thread_timeout_setup): Add prototypes. * kern/startup.c: Include , . * kern/syscall_subr.c: Include . (thread_depress_abort): Remove prototype. * kern/syscall_subr.h: Include , (thread_depress_abort): Add prototype. * kern/syscall_sw.c: Include: . * kern/task.h (consider_task_collect): Add prototype. * kern/thread.c: Include , , . * kern/thread.h (stack_collect): Add prototype. * linux/pcmcia-cs/glue/pcmcia_glue.h (Debugger): Remove prototype. * util/putchar.c: Include . * util/putchar.h: New header. * util/puts.c: Include , . * vm/memory_object.c: Include . (memory_object_data_provided): Move function below memory_object_data_supply definition. * vm/vm_init.c: Include . * vm/vm_kern.h (projected_buffer_in_range): Add prototype. * vm/vm_map.c: Include , . (vm_map_delete, vm_map_copyout_page_list, vm_map_copy_page_discard): Add forward declaration. * vm/vm_map.h (vm_map_copyin_object, vm_map_submap, _vm_map_clip_start, _vm_map_clip_end): Add prototypes. * vm/vm_pageout.c: Include , , . * vm/vm_resident.h: New header. * vm/vm_user.c: Include . * vm/pmap.h (pmap_pageable, pmap_map_bd): Add prototype. --- kern/ast.h | 4 ++++ kern/debug.c | 2 +- kern/debug.h | 2 ++ kern/eventcount.h | 2 ++ kern/ipc_mig.c | 4 +++- kern/ipc_mig.h | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++ kern/ipc_tt.h | 3 +++ kern/lock_mon.c | 4 ++-- kern/machine.c | 1 - kern/machine.h | 58 +++++++++++++++++++++++++++++++++++++++++++++++ kern/processor.h | 2 +- kern/sched_prim.h | 9 +++++++- kern/startup.c | 2 ++ kern/syscall_subr.c | 4 ++-- kern/syscall_subr.h | 3 +++ kern/syscall_sw.c | 1 + kern/task.h | 1 + kern/thread.c | 3 +++ kern/thread.h | 1 + 19 files changed, 162 insertions(+), 9 deletions(-) create mode 100644 kern/ipc_mig.h create mode 100644 kern/machine.h (limited to 'kern') diff --git a/kern/ast.h b/kern/ast.h index 6fd509c0..695eaac0 100644 --- a/kern/ast.h +++ b/kern/ast.h @@ -127,4 +127,8 @@ MACRO_END * be followed by ast_propagate(). */ +extern void ast_init (void); + +extern void ast_check (void); + #endif /* _KERN_AST_H_ */ diff --git a/kern/debug.c b/kern/debug.c index 2c9e7612..66443407 100644 --- a/kern/debug.c +++ b/kern/debug.c @@ -33,10 +33,10 @@ #include +#include #include extern void cnputc(); -void Debugger() __attribute__ ((noreturn)); #if MACH_KDB extern int db_breakpoints_inserted; diff --git a/kern/debug.h b/kern/debug.h index 64fbf8ab..287b152f 100644 --- a/kern/debug.h +++ b/kern/debug.h @@ -60,4 +60,6 @@ extern void panic_init(void); extern void panic (const char *s, ...) __attribute__ ((noreturn)); +extern void Debugger (char *message) __attribute__ ((noreturn)); + #endif /* _mach_debug__debug_ */ diff --git a/kern/eventcount.h b/kern/eventcount.h index e2001de1..6872a347 100644 --- a/kern/eventcount.h +++ b/kern/eventcount.h @@ -54,4 +54,6 @@ extern void evc_init(evc_t ev), extern kern_return_t evc_wait(natural_t ev_id); +extern void evc_notify_abort (thread_t thread); + #endif /* _KERN_EVENTCOUNT_H_ */ diff --git a/kern/ipc_mig.c b/kern/ipc_mig.c index 3bf2c77d..3f55da7c 100644 --- a/kern/ipc_mig.c +++ b/kern/ipc_mig.c @@ -32,9 +32,11 @@ #include #include #include +#include #include #include #include +#include #include #include #include @@ -49,7 +51,7 @@ #include #include #include - +#include /* * Routine: mach_msg_send_from_kernel diff --git a/kern/ipc_mig.h b/kern/ipc_mig.h new file mode 100644 index 00000000..f352bdc6 --- /dev/null +++ b/kern/ipc_mig.h @@ -0,0 +1,65 @@ +/* + * MIG IPC functions + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * + * Author: Barry deFreese. + */ +/* + * MIG IPC functions. + * + */ + +#ifndef _IPC_MIG_H_ +#define _IPC_MIG_H_ + +#include + +/* + * Routine: mach_msg_send_from_kernel + * Purpose: + * Send a message from the kernel. + * + * This is used by the client side of KernelUser interfaces + * to implement SimpleRoutines. Currently, this includes + * device_reply and memory_object messages. + * Conditions: + * Nothing locked. + * Returns: + * MACH_MSG_SUCCESS Sent the message. + * MACH_SEND_INVALID_DATA Bad destination port. + */ +extern mach_msg_return_t mach_msg_send_from_kernel( + mach_msg_header_t *msg, + mach_msg_size_t send_size); + +/* + * Routine: mach_msg_abort_rpc + * Purpose: + * Destroy the thread's ith_rpc_reply port. + * This will interrupt a mach_msg_rpc_from_kernel + * with a MACH_RCV_PORT_DIED return code. + * Conditions: + * Nothing locked. + */ +extern void mach_msg_abort_rpc (ipc_thread_t); + +extern mach_msg_return_t mach_msg_rpc_from_kernel( + mach_msg_header_t *msg, + mach_msg_size_t send_size, + mach_msg_size_t reply_size); + +#endif /* _IPC_MIG_H_ */ diff --git a/kern/ipc_tt.h b/kern/ipc_tt.h index e2009b94..78cb43ad 100644 --- a/kern/ipc_tt.h +++ b/kern/ipc_tt.h @@ -86,4 +86,7 @@ convert_port_to_space(struct ipc_port *); extern void space_deallocate(ipc_space_t); +mach_port_t +mach_reply_port (void); + #endif /* _KERN_IPC_TT_H_ */ diff --git a/kern/lock_mon.c b/kern/lock_mon.c index 0d69ac16..7ffaeb68 100644 --- a/kern/lock_mon.c +++ b/kern/lock_mon.c @@ -348,7 +348,7 @@ decl_simple_lock_data(, *lock) return; db_printf("cpu %d looping on simple_lock(%x) called by %x\n", cpu_number(), lock, *(((int *)&lock) -1)); - Debugger(); + Debugger("simple_lock timeout"); count = 0; } } @@ -362,7 +362,7 @@ retry_bit_lock(index, addr) if (count++ > 1000000) { db_printf("cpu %d looping on bit_lock(%x, %x) called by %x\n", cpu_number(), index, addr, *(((int *)&index) -1)); - Debugger(); + Debugger("bit_lock timeout"); count = 0; } } diff --git a/kern/machine.c b/kern/machine.c index 97181a84..bcf394c3 100644 --- a/kern/machine.c +++ b/kern/machine.c @@ -187,7 +187,6 @@ host_reboot(host, options) return (KERN_INVALID_HOST); if (options & RB_DEBUGGER) { - extern void Debugger(); Debugger("Debugger"); } else { #ifdef parisc diff --git a/kern/machine.h b/kern/machine.h new file mode 100644 index 00000000..af2b7e91 --- /dev/null +++ b/kern/machine.h @@ -0,0 +1,58 @@ +/* + * Machine abstraction functions + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * + * Author: Barry deFreese. + */ +/* + * Machine abstraction functions. + * + */ + +#ifndef _MACHINE_H_ +#define _MACHINE_H_ + +#include + +/* + * cpu_up: + * + * Flag specified cpu as up and running. Called when a processor comes + * online. + */ +extern void cpu_up (int); + +/* + * processor_assign() changes the processor set that a processor is + * assigned to. Any previous assignment in progress is overridden. + * Synchronizes with assignment completion if wait is TRUE. + */ +extern kern_return_t processor_assign (processor_t, processor_set_t, boolean_t); + +/* + * processor_shutdown() queues a processor up for shutdown. + * Any assignment in progress is overriden. It does not synchronize + * with the shutdown (can be called from interrupt level). + */ +extern kern_return_t processor_shutdown (processor_t); + +/* + * action_thread() shuts down processors or changes their assignment. + */ +extern void action_thread_continue (void); + +#endif /* _MACHINE_H_ */ diff --git a/kern/processor.h b/kern/processor.h index 7ff7124e..9a6c944b 100644 --- a/kern/processor.h +++ b/kern/processor.h @@ -237,12 +237,12 @@ typedef mach_port_t *processor_set_name_array_t; #ifdef KERNEL #if MACH_HOST -extern void pset_sys_bootstrap(void); extern void pset_sys_init(void); #endif /* MACH_HOST */ /* Pset internal functions */ +extern void pset_sys_bootstrap(void); extern void pset_reference(processor_set_t); extern void pset_deallocate(processor_set_t); extern void pset_remove_processor(processor_set_t, processor_t); diff --git a/kern/sched_prim.h b/kern/sched_prim.h index a5416a53..5311d160 100644 --- a/kern/sched_prim.h +++ b/kern/sched_prim.h @@ -108,7 +108,14 @@ extern void update_priority( thread_t thread); extern void compute_my_priority( thread_t thread); - +extern void thread_bind( + thread_t thread, + processor_t processor); +extern void compute_priority( + thread_t thread, + boolean_t resched); +extern void thread_timeout_setup( + register thread_t thread); /* * Routines defined as macros diff --git a/kern/startup.c b/kern/startup.c index 5eea5bcd..e057e8f2 100644 --- a/kern/startup.c +++ b/kern/startup.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -51,6 +52,7 @@ #include #include #include +#include #include #include #include diff --git a/kern/syscall_subr.c b/kern/syscall_subr.c index 4db1f168..395b9b8f 100644 --- a/kern/syscall_subr.c +++ b/kern/syscall_subr.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -62,8 +63,7 @@ * lock and then be a good citizen and really suspend. */ -extern void thread_depress_priority(thread_t, mach_msg_timeout_t); -extern kern_return_t thread_depress_abort(thread_t); +void thread_depress_priority(thread_t, mach_msg_timeout_t); void swtch_continue(void) { diff --git a/kern/syscall_subr.h b/kern/syscall_subr.h index 2d2da14a..2b8bcd36 100644 --- a/kern/syscall_subr.h +++ b/kern/syscall_subr.h @@ -24,6 +24,8 @@ * the rights to redistribute these changes. */ +#include +#include #include #ifndef _KERN_SYSCALL_SUBR_H_ @@ -33,5 +35,6 @@ extern int swtch(void); extern int swtch_pri(int); extern int thread_switch(mach_port_t, int, mach_msg_timeout_t); extern void thread_depress_timeout(thread_t); +extern kern_return_t thread_depress_abort(thread_t); #endif /* _KERN_SYSCALL_SUBR_H_ */ diff --git a/kern/syscall_sw.c b/kern/syscall_sw.c index 42109ee8..bd3b8742 100644 --- a/kern/syscall_sw.c +++ b/kern/syscall_sw.c @@ -29,6 +29,7 @@ #include #include +#include #include /* Include declarations of the trap functions. */ diff --git a/kern/task.h b/kern/task.h index 1337a98d..9d902435 100644 --- a/kern/task.h +++ b/kern/task.h @@ -149,6 +149,7 @@ extern kern_return_t task_assign( extern kern_return_t task_assign_default( task_t task, boolean_t assign_threads); +extern void consider_task_collect(void); /* * Internal only routines diff --git a/kern/thread.c b/kern/thread.c index 71f222ce..f6b442ab 100644 --- a/kern/thread.c +++ b/kern/thread.c @@ -42,12 +42,15 @@ #include #include #include +#include +#include #include #include #include #include #include #include +#include #include #include #include diff --git a/kern/thread.h b/kern/thread.h index 03522da9..3959dfce 100644 --- a/kern/thread.h +++ b/kern/thread.h @@ -318,6 +318,7 @@ extern kern_return_t thread_assign( processor_set_t new_pset); extern kern_return_t thread_assign_default( thread_t thread); +extern void stack_collect(void); #endif /* -- cgit v1.2.3