summaryrefslogtreecommitdiff
path: root/i386
diff options
context:
space:
mode:
Diffstat (limited to 'i386')
-rw-r--r--i386/i386/fpu.h17
-rw-r--r--i386/i386/gdt.h2
-rw-r--r--i386/i386/io_map.c1
-rw-r--r--i386/i386/ktss.h2
-rw-r--r--i386/i386/ldt.h2
-rw-r--r--i386/i386/loose_ends.c1
-rw-r--r--i386/i386/loose_ends.h33
-rw-r--r--i386/i386/model_dep.h2
-rw-r--r--i386/i386/pcb.h11
-rw-r--r--i386/i386/pic.h5
-rw-r--r--i386/i386/pit.c1
-rw-r--r--i386/i386/pit.h2
-rw-r--r--i386/i386/trap.c3
-rw-r--r--i386/i386/trap.h2
-rw-r--r--i386/i386/user_ldt.c1
-rw-r--r--i386/i386at/autoconf.h42
-rw-r--r--i386/i386at/com.c2
-rw-r--r--i386/i386at/com.h45
-rw-r--r--i386/i386at/idt.h4
-rw-r--r--i386/i386at/int_init.h34
-rw-r--r--i386/i386at/kd.c1
-rw-r--r--i386/i386at/kd_event.c1
-rw-r--r--i386/i386at/kd_mouse.c4
-rw-r--r--i386/i386at/lpr.c1
-rw-r--r--i386/i386at/model_dep.c13
-rw-r--r--i386/i386at/rtc.h3
-rw-r--r--i386/intel/pmap.h28
-rw-r--r--i386/intel/read_fault.h35
28 files changed, 295 insertions, 3 deletions
diff --git a/i386/i386/fpu.h b/i386/i386/fpu.h
index 3e92de7..4237bea 100644
--- a/i386/i386/fpu.h
+++ b/i386/i386/fpu.h
@@ -32,8 +32,9 @@
* floating-point processor.
*/
+#include <sys/types.h>
#include <i386/proc_reg.h>
-#include <i386/thread.h>
+#include <kern/thread.h>
/*
* 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 558bd15..6513eda 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 7ed0e26..5b77552 100644
--- a/i386/i386/io_map.c
+++ b/i386/i386/io_map.c
@@ -26,6 +26,7 @@
#include <kern/printf.h>
#include <mach/vm_param.h>
+#include <vm/pmap.h>
#include <vm/vm_kern.h>
#include <vm/vm_map.h>
diff --git a/i386/i386/ktss.h b/i386/i386/ktss.h
index 3522e86..304a877 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 3c38109..f196c74 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 825303f..d3108fd 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 0000000..c085527
--- /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 <mach/std_types.h>
+
+extern void delay (int n);
+
+#endif /* _LOOSE_ENDS_H_ */
diff --git a/i386/i386/model_dep.h b/i386/i386/model_dep.h
index c0cc5a7..c6685d0 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 e7d3363..dc9cbd7 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 c6f8a4b..7a177d8 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 8dc1233..4f156d8 100644
--- a/i386/i386/pit.c
+++ b/i386/i386/pit.c
@@ -51,6 +51,7 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <kern/mach_clock.h>
#include <i386/ipl.h>
+#include <i386/pic.h>
#include <i386/pit.h>
#include <i386/pio.h>
diff --git a/i386/i386/pit.h b/i386/i386/pit.h
index b59d8c5..e65aae9 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 faee218..dd6c23c 100644
--- a/i386/i386/trap.c
+++ b/i386/i386/trap.c
@@ -32,6 +32,8 @@
#include <mach/machine/eflags.h>
#include <i386/trap.h>
+#include <i386/fpu.h>
+#include <intel/read_fault.h>
#include <machine/machspl.h> /* for spl_t */
#include <mach/exception.h>
@@ -39,6 +41,7 @@
#include "vm_param.h"
#include <mach/machine/thread_status.h>
+#include <vm/vm_fault.h>
#include <vm/vm_kern.h>
#include <vm/vm_map.h>
diff --git a/i386/i386/trap.h b/i386/i386/trap.h
index 8cee9e8..dfb57a1 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 7646c35..e6bfc95 100644
--- a/i386/i386/user_ldt.c
+++ b/i386/i386/user_ldt.c
@@ -35,6 +35,7 @@
#include <vm/vm_kern.h>
+#include <i386/pcb.h>
#include <i386/seg.h>
#include <i386/thread.h>
#include <i386/user_ldt.h>
diff --git a/i386/i386at/autoconf.h b/i386/i386at/autoconf.h
new file mode 100644
index 0000000..4916d3e
--- /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 <mach/std_types.h>
+
+/*
+ * 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 300a60b..6e7dcbf 100644
--- a/i386/i386at/com.c
+++ b/i386/i386at/com.c
@@ -39,6 +39,8 @@
#include <i386/pio.h>
#include <i386/machspl.h>
#include <chips/busses.h>
+#include <i386at/autoconf.h>
+#include <i386at/com.h>
#include <i386at/comreg.h>
#include <device/cons.h>
diff --git a/i386/i386at/com.h b/i386/i386at/com.h
new file mode 100644
index 0000000..dca26a5
--- /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 <mach/std_types.h>
+
+/*
+ * 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 840bad1..1b3284f 100644
--- a/i386/i386at/idt.h
+++ b/i386/i386at/idt.h
@@ -34,4 +34,8 @@
#include <i386/idt-gen.h>
+#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 0000000..f4abef0
--- /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 <mach/std_types.h>
+
+#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 75b56eb..6723752 100644
--- a/i386/i386at/kd.c
+++ b/i386/i386at/kd.c
@@ -85,6 +85,7 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <device/io_req.h>
#include <device/buf.h> /* for struct uio (!) */
#include <vm/vm_kern.h>
+#include <i386/loose_ends.h>
#include <i386/vm_param.h>
#include <i386/machspl.h>
#include <i386/pio.h>
diff --git a/i386/i386at/kd_event.c b/i386/i386at/kd_event.c
index 7688412..5d8d563 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 <string.h>
#ifdef MACH_KERNEL
+#include <device/ds_routines.h>
#include <device/errno.h>
#include <device/io_req.h>
#else /* MACH_KERNEL */
diff --git a/i386/i386at/kd_mouse.c b/i386/i386at/kd_mouse.c
index 2ad3be2..9487c54 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 <sys/types.h>
#include <kern/printf.h>
#ifdef MACH_KERNEL
+#include <device/ds_routines.h>
#include <device/errno.h>
#include <device/io_req.h>
+#include <device/subrs.h>
#else /* MACH_KERNEL */
#include <sys/file.h>
#include <sys/errno.h>
@@ -81,8 +83,10 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <sys/tty.h>
#endif /* MACH_KERNEL */
#include <i386/ipl.h>
+#include <i386/pic.h>
#include <i386/pio.h>
#include <chips/busses.h>
+#include <i386at/com.h>
#include <i386at/kd.h>
#include <i386at/kd_queue.h>
#include <i386at/i8250.h>
diff --git a/i386/i386at/lpr.c b/i386/i386at/lpr.c
index 348159e..05edc7b 100644
--- a/i386/i386at/lpr.c
+++ b/i386/i386at/lpr.c
@@ -55,6 +55,7 @@
#include <i386/ipl.h>
#include <i386/pio.h>
#include <chips/busses.h>
+#include <i386at/autoconf.h>
#include <i386at/lprreg.h>
extern void timeout();
diff --git a/i386/i386at/model_dep.c b/i386/i386at/model_dep.c
index d67f709..d020c92 100644
--- a/i386/i386at/model_dep.c
+++ b/i386/i386at/model_dep.c
@@ -49,11 +49,22 @@
#include <kern/printf.h>
#include <sys/time.h>
#include <vm/vm_page.h>
+#include <i386/fpu.h>
+#include <i386/gdt.h>
+#include <i386/ktss.h>
+#include <i386/ldt.h>
#include <i386/machspl.h>
+#include <i386/pic.h>
+#include <i386/pit.h>
#include <i386/pmap.h>
#include <i386/proc_reg.h>
#include <i386/locore.h>
#include <i386/model_dep.h>
+#include <i386at/autoconf.h>
+#include <i386at/idt.h>
+#include <i386at/int_init.h>
+#include <i386at/kd.h>
+#include <i386at/rtc.h>
/* 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 e8d1967..ced39b9 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 0255f5a..b16d984 100644
--- a/i386/intel/pmap.h
+++ b/i386/intel/pmap.h
@@ -42,6 +42,7 @@
#include <mach/machine/vm_param.h>
#include <mach/vm_statistics.h>
#include <mach/kern_return.h>
+#include <mach/vm_prot.h>
#include <i386/proc_reg.h>
/*
@@ -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 0000000..8aa3f03
--- /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 <mach/std_types.h>
+
+extern kern_return_t intel_read_fault(
+ vm_map_t map,
+ vm_offset_t vaddr);
+
+#endif /* _READ_FAULT_H_ */