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. --- i386/i386/fpu.h | 17 ++++++++++++++++- i386/i386/gdt.h | 2 ++ i386/i386/io_map.c | 1 + i386/i386/ktss.h | 2 ++ i386/i386/ldt.h | 2 ++ i386/i386/loose_ends.c | 1 + i386/i386/loose_ends.h | 33 +++++++++++++++++++++++++++++++++ i386/i386/model_dep.h | 2 ++ i386/i386/pcb.h | 11 +++++++++++ i386/i386/pic.h | 5 +++++ i386/i386/pit.c | 1 + i386/i386/pit.h | 2 ++ i386/i386/trap.c | 3 +++ i386/i386/trap.h | 2 ++ i386/i386/user_ldt.c | 1 + i386/i386at/autoconf.h | 42 ++++++++++++++++++++++++++++++++++++++++++ i386/i386at/com.c | 2 ++ i386/i386at/com.h | 45 +++++++++++++++++++++++++++++++++++++++++++++ i386/i386at/idt.h | 4 ++++ i386/i386at/int_init.h | 34 ++++++++++++++++++++++++++++++++++ i386/i386at/kd.c | 1 + i386/i386at/kd_event.c | 1 + i386/i386at/kd_mouse.c | 4 ++++ i386/i386at/lpr.c | 1 + i386/i386at/model_dep.c | 13 ++++++++++++- i386/i386at/rtc.h | 3 ++- i386/intel/pmap.h | 28 ++++++++++++++++++++++++++++ i386/intel/read_fault.h | 35 +++++++++++++++++++++++++++++++++++ 28 files changed, 295 insertions(+), 3 deletions(-) create mode 100644 i386/i386/loose_ends.h create mode 100644 i386/i386at/autoconf.h create mode 100644 i386/i386at/com.h create mode 100644 i386/i386at/int_init.h create mode 100644 i386/intel/read_fault.h (limited to 'i386') diff --git a/i386/i386/fpu.h b/i386/i386/fpu.h index 3e92de73..4237bea9 100644 --- a/i386/i386/fpu.h +++ b/i386/i386/fpu.h @@ -32,8 +32,9 @@ * floating-point processor. */ +#include #include -#include +#include /* * FPU instructions. @@ -99,5 +100,19 @@ #endif /* NCPUS == 1 */ extern int fp_kind; +extern void fp_save(thread_t thread); +extern void fp_load(thread_t thread); +extern void fp_free(struct i386_fpsave_state *fps); +extern void fpu_module_init(void); +extern kern_return_t fpu_set_state( + thread_t thread, + struct i386_float_state *state); +extern kern_return_t fpu_get_state( + thread_t thread, + struct i386_float_state *state); +extern void fpnoextflt(void); +extern void fpextovrflt(void); +extern void fpexterrflt(void); +extern void init_fpu(void); #endif /* _I386_FPU_H_ */ diff --git a/i386/i386/gdt.h b/i386/i386/gdt.h index 558bd15f..6513eda9 100644 --- a/i386/i386/gdt.h +++ b/i386/i386/gdt.h @@ -59,4 +59,6 @@ extern struct real_descriptor gdt[GDTSZ]; #define fill_gdt_descriptor(segment, base, limit, access, sizebits) \ fill_descriptor(&gdt[segment/8], base, limit, access, sizebits) +extern void gdt_init(void); + #endif /* _I386_GDT_ */ diff --git a/i386/i386/io_map.c b/i386/i386/io_map.c index 7ed0e263..5b77552d 100644 --- a/i386/i386/io_map.c +++ b/i386/i386/io_map.c @@ -26,6 +26,7 @@ #include #include +#include #include #include diff --git a/i386/i386/ktss.h b/i386/i386/ktss.h index 3522e866..304a877a 100644 --- a/i386/i386/ktss.h +++ b/i386/i386/ktss.h @@ -27,4 +27,6 @@ extern struct task_tss ktss; +extern void ktss_init(void); + #endif /* _I386_KTSS_ */ diff --git a/i386/i386/ldt.h b/i386/i386/ldt.h index 3c38109e..f196c74b 100644 --- a/i386/i386/ldt.h +++ b/i386/i386/ldt.h @@ -61,6 +61,8 @@ extern struct real_descriptor ldt[LDTSZ]; fill_gate((struct real_gate*)&ldt[selector/8], \ offset, dest_selector, access, word_count) +void ldt_init(void); + #endif /* !__ASSEMBLER__ */ #endif /* _I386_LDT_ */ diff --git a/i386/i386/loose_ends.c b/i386/i386/loose_ends.c index 825303f1..d3108fdb 100644 --- a/i386/i386/loose_ends.c +++ b/i386/i386/loose_ends.c @@ -43,6 +43,7 @@ int cpuspeed = 4; #define DELAY(n) { volatile int N = cpuspeed * (n); while (--N > 0); } void delay(n) + int n; { DELAY(n); } diff --git a/i386/i386/loose_ends.h b/i386/i386/loose_ends.h new file mode 100644 index 00000000..c0855279 --- /dev/null +++ b/i386/i386/loose_ends.h @@ -0,0 +1,33 @@ +/* + * Other useful 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. + */ +/* + * Other useful functions? + * + */ + +#ifndef _LOOSE_ENDS_H_ +#define _LOOSE_ENDS_H_ + +#include + +extern void delay (int n); + +#endif /* _LOOSE_ENDS_H_ */ diff --git a/i386/i386/model_dep.h b/i386/i386/model_dep.h index c0cc5a70..c6685d09 100644 --- a/i386/i386/model_dep.h +++ b/i386/i386/model_dep.h @@ -48,4 +48,6 @@ extern void halt_all_cpus (boolean_t reboot) __attribute__ ((noreturn)); extern void resettodr (void); +extern void startrtclock (void); + #endif /* _I386AT_MODEL_DEP_H_ */ diff --git a/i386/i386/pcb.h b/i386/i386/pcb.h index e7d33635..dc9cbd7f 100644 --- a/i386/i386/pcb.h +++ b/i386/i386/pcb.h @@ -58,4 +58,15 @@ extern vm_offset_t set_user_regs ( struct exec_info *exec_info, vm_size_t arg_size); +extern void load_context (thread_t new); + +extern void stack_attach ( + thread_t thread, + vm_offset_t stack, + void (*continuation)()); + +extern vm_offset_t stack_detach (thread_t thread); + +extern void switch_ktss (pcb_t pcb); + #endif /* _I386_PCB_H_ */ diff --git a/i386/i386/pic.h b/i386/i386/pic.h index c6f8a4b6..7a177d86 100644 --- a/i386/i386/pic.h +++ b/i386/i386/pic.h @@ -176,4 +176,9 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #define READ_IR_ONRD 0x00 #define READ_IS_ONRD 0x01 +#ifndef __ASSEMBLER__ +extern void form_pic_mask (void); +extern void picinit (void); +#endif + #endif /* _I386_PIC_H_ */ diff --git a/i386/i386/pit.c b/i386/i386/pit.c index 8dc12335..4f156d87 100644 --- a/i386/i386/pit.c +++ b/i386/i386/pit.c @@ -51,6 +51,7 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include +#include #include #include diff --git a/i386/i386/pit.h b/i386/i386/pit.h index b59d8c5c..e65aae97 100644 --- a/i386/i386/pit.h +++ b/i386/i386/pit.h @@ -77,3 +77,5 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #if AT386 #define CLKNUM 1193167 #endif /* AT386 */ + +extern void clkstart(void); diff --git a/i386/i386/trap.c b/i386/i386/trap.c index faee2186..dd6c23ca 100644 --- a/i386/i386/trap.c +++ b/i386/i386/trap.c @@ -32,6 +32,8 @@ #include #include +#include +#include #include /* for spl_t */ #include @@ -39,6 +41,7 @@ #include "vm_param.h" #include +#include #include #include diff --git a/i386/i386/trap.h b/i386/i386/trap.h index 8cee9e88..dfb57a1c 100644 --- a/i386/i386/trap.h +++ b/i386/i386/trap.h @@ -33,6 +33,8 @@ char *trap_name(unsigned int trapnum); +unsigned int interrupted_pc(thread_t); + #endif /* !__ASSEMBLER__ */ #endif /* _I386_TRAP_H_ */ diff --git a/i386/i386/user_ldt.c b/i386/i386/user_ldt.c index 7646c351..e6bfc958 100644 --- a/i386/i386/user_ldt.c +++ b/i386/i386/user_ldt.c @@ -35,6 +35,7 @@ #include +#include #include #include #include diff --git a/i386/i386at/autoconf.h b/i386/i386at/autoconf.h new file mode 100644 index 00000000..4916d3e5 --- /dev/null +++ b/i386/i386at/autoconf.h @@ -0,0 +1,42 @@ +/* + * 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. + */ +/* + * Device auto configuration. + * + */ + +#ifndef _AUTOCONF_H_ +#define _AUTOCONF_H_ + +#include + +/* + * probeio: + * + * Probe and subsequently attach devices out on the AT bus. + * + * + */ +void probeio(void); + +extern void take_dev_irq ( + struct bus_device *dev); + +#endif /* _AUTOCONF_H_ */ diff --git a/i386/i386at/com.c b/i386/i386at/com.c index 300a60be..6e7dcbf9 100644 --- a/i386/i386at/com.c +++ b/i386/i386at/com.c @@ -39,6 +39,8 @@ #include #include #include +#include +#include #include #include diff --git a/i386/i386at/com.h b/i386/i386at/com.h new file mode 100644 index 00000000..dca26a58 --- /dev/null +++ b/i386/i386at/com.h @@ -0,0 +1,45 @@ +/* + * Communication 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. + */ +/* + * Communication functions. + * + */ + +#ifndef _COM_H_ +#define _COM_H_ + +#include + +/* + * Set receive modem state from modem status register. + */ +extern void fix_modem_state(int unit, int modem_stat); + +extern void comtimer(void); + +/* + * Modem change (input signals) + */ +extern void commodem_intr(int unit, int stat); + +extern int comgetc(int unit); + +#endif /* _COM_H_ */ diff --git a/i386/i386at/idt.h b/i386/i386at/idt.h index 840bad11..1b3284fa 100644 --- a/i386/i386at/idt.h +++ b/i386/i386at/idt.h @@ -34,4 +34,8 @@ #include +#ifndef __ASSEMBLER__ +extern void idt_init (void); +#endif + #endif /* _I386AT_IDT_ */ diff --git a/i386/i386at/int_init.h b/i386/i386at/int_init.h new file mode 100644 index 00000000..f4abef0b --- /dev/null +++ b/i386/i386at/int_init.h @@ -0,0 +1,34 @@ +/* + * 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. + */ +/* + * Initialization functions. + * + */ + +#ifndef _INT_INIT_H_ +#define _INT_INIT_H_ + +#include + +#ifndef __ASSEMBLER__ +extern void int_init (void); +#endif + +#endif /* _INT_INIT_H_ */ diff --git a/i386/i386at/kd.c b/i386/i386at/kd.c index 75b56eb3..67237525 100644 --- a/i386/i386at/kd.c +++ b/i386/i386at/kd.c @@ -85,6 +85,7 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include /* for struct uio (!) */ #include +#include #include #include #include diff --git a/i386/i386at/kd_event.c b/i386/i386at/kd_event.c index 76884129..5d8d5637 100644 --- a/i386/i386at/kd_event.c +++ b/i386/i386at/kd_event.c @@ -60,6 +60,7 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #ifdef MACH_KERNEL +#include #include #include #else /* MACH_KERNEL */ diff --git a/i386/i386at/kd_mouse.c b/i386/i386at/kd_mouse.c index 2ad3be22..9487c540 100644 --- a/i386/i386at/kd_mouse.c +++ b/i386/i386at/kd_mouse.c @@ -68,8 +68,10 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #ifdef MACH_KERNEL +#include #include #include +#include #else /* MACH_KERNEL */ #include #include @@ -81,8 +83,10 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #endif /* MACH_KERNEL */ #include +#include #include #include +#include #include #include #include diff --git a/i386/i386at/lpr.c b/i386/i386at/lpr.c index 348159e9..05edc7b7 100644 --- a/i386/i386at/lpr.c +++ b/i386/i386at/lpr.c @@ -55,6 +55,7 @@ #include #include #include +#include #include extern void timeout(); diff --git a/i386/i386at/model_dep.c b/i386/i386at/model_dep.c index d67f7098..d020c92b 100644 --- a/i386/i386at/model_dep.c +++ b/i386/i386at/model_dep.c @@ -49,11 +49,22 @@ #include #include #include +#include +#include +#include +#include #include +#include +#include #include #include #include #include +#include +#include +#include +#include +#include /* Location of the kernel's symbol table. Both of these are 0 if none is available. */ @@ -369,7 +380,7 @@ void c_boot_entry(vm_offset_t bi) */ if (strstr(kernel_cmdline, "-d ")) { cninit(); /* need console for debugger */ - Debugger(); + Debugger("init"); } #endif /* MACH_KDB */ diff --git a/i386/i386at/rtc.h b/i386/i386at/rtc.h index e8d19670..ced39b98 100644 --- a/i386/i386at/rtc.h +++ b/i386/i386at/rtc.h @@ -134,4 +134,5 @@ struct rtc_st { } \ } - +extern int readtodc(u_int *tp); +extern int writetodc(void); diff --git a/i386/intel/pmap.h b/i386/intel/pmap.h index 0255f5a0..b16d9846 100644 --- a/i386/intel/pmap.h +++ b/i386/intel/pmap.h @@ -42,6 +42,7 @@ #include #include #include +#include #include /* @@ -363,6 +364,33 @@ pt_entry_t *pmap_pte(pmap_t pmap, vm_offset_t addr); #define pmap_attribute(pmap,addr,size,attr,value) \ (KERN_INVALID_ADDRESS) +/* + * Bootstrap the system enough to run with virtual memory. + * Allocate the kernel page directory and page tables, + * and direct-map all physical memory. + * Called with mapping off. + */ +extern void pmap_bootstrap(void); + +extern void pmap_unmap_page_zero (void); + +/* + * pmap_zero_page zeros the specified (machine independent) page. + */ +extern void pmap_zero_page (vm_offset_t); + +/* + * pmap_copy_page copies the specified (machine independent) pages. + */ +extern void pmap_copy_page (vm_offset_t, vm_offset_t); + +/* + * kvtophys(addr) + * + * Convert a kernel virtual address to a physical address + */ +extern vm_offset_t kvtophys (vm_offset_t); + #endif /* __ASSEMBLER__ */ #endif /* _PMAP_MACHINE_ */ diff --git a/i386/intel/read_fault.h b/i386/intel/read_fault.h new file mode 100644 index 00000000..8aa3f035 --- /dev/null +++ b/i386/intel/read_fault.h @@ -0,0 +1,35 @@ +/* + * Kernel read_fault on i386 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. + */ +/* + * Kernel read_fault on i386 functions. + * + */ + +#ifndef _READ_FAULT_H_ +#define _READ_FAULT_H_ + +#include + +extern kern_return_t intel_read_fault( + vm_map_t map, + vm_offset_t vaddr); + +#endif /* _READ_FAULT_H_ */ -- cgit v1.2.3