summaryrefslogtreecommitdiffstats
path: root/sys/amd64/include/smp.h
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2003-05-01 01:05:25 +0000
committerpeter <peter@FreeBSD.org>2003-05-01 01:05:25 +0000
commit45949ccde13fb04ed597a5aef80b678ba16bcab7 (patch)
treedd665cefeba0e426ad2b212b76851de96f1ad18b /sys/amd64/include/smp.h
parent1fd7bc609e9a5249f7b7b558405e1c39aca79796 (diff)
downloadFreeBSD-src-45949ccde13fb04ed597a5aef80b678ba16bcab7.zip
FreeBSD-src-45949ccde13fb04ed597a5aef80b678ba16bcab7.tar.gz
Commit MD parts of a loosely functional AMD64 port. This is based on
a heavily stripped down FreeBSD/i386 (brutally stripped down actually) to attempt to get a stable base to start from. There is a lot missing still. Worth noting: - The kernel runs at 1GB in order to cheat with the pmap code. pmap uses a variation of the PAE code in order to avoid having to worry about 4 levels of page tables yet. - It boots in 64 bit "long mode" with a tiny trampoline embedded in the i386 loader. This simplifies locore.s greatly. - There are still quite a few fragments of i386-specific code that have not been translated yet, and some that I cheated and wrote dumb C versions of (bcopy etc). - It has both int 0x80 for syscalls (but using registers for argument passing, as is native on the amd64 ABI), and the 'syscall' instruction for syscalls. int 0x80 preserves all registers, 'syscall' does not. - I have tried to minimize looking at the NetBSD code, except in a couple of places (eg: to find which register they use to replace the trashed %rcx register in the syscall instruction). As a result, there is not a lot of similarity. I did look at NetBSD a few times while debugging to get some ideas about what I might have done wrong in my first attempt.
Diffstat (limited to 'sys/amd64/include/smp.h')
-rw-r--r--sys/amd64/include/smp.h146
1 files changed, 0 insertions, 146 deletions
diff --git a/sys/amd64/include/smp.h b/sys/amd64/include/smp.h
index 6467365..3d8d117 100644
--- a/sys/amd64/include/smp.h
+++ b/sys/amd64/include/smp.h
@@ -13,150 +13,4 @@
#ifndef _MACHINE_SMP_H_
#define _MACHINE_SMP_H_
-#ifdef _KERNEL
-
-#if defined(SMP) && defined(I386_CPU) && !defined(COMPILING_LINT)
-#error SMP not supported with I386_CPU
-#endif
-#if defined(SMP) && !defined(APIC_IO)
-# error APIC_IO required for SMP, add "options APIC_IO" to your config file.
-#endif /* SMP && !APIC_IO */
-#if defined(SMP) && defined(CPU_DISABLE_CMPXCHG) && !defined(COMPILING_LINT)
-#error SMP not supported with CPU_DISABLE_CMPXCHG
-#endif
-
-#if defined(SMP) || defined(APIC_IO)
-
-#ifndef LOCORE
-
-/*
- * For sending values to POST displays.
- * XXX FIXME: where does this really belong, isa.h/isa.c perhaps?
- */
-extern int current_postcode; /** XXX currently in mp_machdep.c */
-#define POSTCODE(X) current_postcode = (X), \
- outb(0x80, current_postcode)
-#define POSTCODE_LO(X) current_postcode &= 0xf0, \
- current_postcode |= ((X) & 0x0f), \
- outb(0x80, current_postcode)
-#define POSTCODE_HI(X) current_postcode &= 0x0f, \
- current_postcode |= (((X) << 4) & 0xf0), \
- outb(0x80, current_postcode)
-
-
-#include <sys/bus.h> /* XXX */
-#include <machine/apic.h>
-#include <machine/frame.h>
-#include <i386/isa/icu.h>
-#include <i386/isa/intr_machdep.h>
-
-/*
- * Interprocessor interrupts for SMP.
- */
-#define IPI_INVLTLB XINVLTLB_OFFSET
-#define IPI_INVLPG XINVLPG_OFFSET
-#define IPI_INVLRNG XINVLRNG_OFFSET
-#define IPI_LAZYPMAP XLAZYPMAP_OFFSET
-#define IPI_RENDEZVOUS XRENDEZVOUS_OFFSET
-#define IPI_AST XCPUAST_OFFSET
-#define IPI_STOP XCPUSTOP_OFFSET
-#define IPI_HARDCLOCK XHARDCLOCK_OFFSET
-#define IPI_STATCLOCK XSTATCLOCK_OFFSET
-
-/* global data in mpboot.s */
-extern int bootMP_size;
-
-/* functions in mpboot.s */
-void bootMP(void);
-
-/* global data in mp_machdep.c */
-extern int bsp_apic_ready;
-extern int mp_naps;
-extern int mp_nbusses;
-extern int mp_napics;
-extern int mp_picmode;
-extern int boot_cpu_id;
-extern vm_offset_t cpu_apic_address;
-extern vm_offset_t io_apic_address[];
-extern u_int32_t cpu_apic_versions[];
-extern u_int32_t *io_apic_versions;
-extern int cpu_num_to_apic_id[];
-extern int io_num_to_apic_id[];
-extern int apic_id_to_logical[];
-#define APIC_INTMAPSIZE 32
-struct apic_intmapinfo {
- int ioapic;
- int int_pin;
- volatile void *apic_address;
- int redirindex;
-};
-extern struct apic_intmapinfo int_to_apicintpin[];
-extern struct pcb stoppcbs[];
-
-/* functions in mp_machdep.c */
-void i386_mp_probe(void);
-u_int mp_bootaddress(u_int);
-u_int isa_apic_mask(u_int);
-int isa_apic_irq(int);
-int pci_apic_irq(int, int, int);
-int apic_irq(int, int);
-int next_apic_irq(int);
-int undirect_isa_irq(int);
-int undirect_pci_irq(int);
-int apic_bus_type(int);
-int apic_src_bus_id(int, int);
-int apic_src_bus_irq(int, int);
-int apic_int_type(int, int);
-int apic_trigger(int, int);
-int apic_polarity(int, int);
-int mp_grab_cpu_hlt(void);
-void assign_apic_irq(int apic, int intpin, int irq);
-void revoke_apic_irq(int irq);
-void bsp_apic_configure(void);
-void init_secondary(void);
-void forward_statclock(void);
-void forwarded_statclock(struct clockframe frame);
-void forward_hardclock(void);
-void forwarded_hardclock(struct clockframe frame);
-void ipi_selected(u_int cpus, u_int ipi);
-void ipi_all(u_int ipi);
-void ipi_all_but_self(u_int ipi);
-void ipi_self(u_int ipi);
-#ifdef APIC_INTR_REORDER
-void set_lapic_isrloc(int, int);
-#endif /* APIC_INTR_REORDER */
-void smp_invlpg(vm_offset_t addr);
-void smp_masked_invlpg(u_int mask, vm_offset_t addr);
-void smp_invlpg_range(vm_offset_t startva, vm_offset_t endva);
-void smp_masked_invlpg_range(u_int mask, vm_offset_t startva,
- vm_offset_t endva);
-void smp_invltlb(void);
-void smp_masked_invltlb(u_int mask);
-
-/* global data in mpapic.c */
-extern volatile lapic_t lapic;
-extern volatile ioapic_t **ioapic;
-
-/* functions in mpapic.c */
-void apic_dump(char*);
-void apic_initialize(void);
-void imen_dump(void);
-int apic_ipi(int, int, int);
-int selected_apic_ipi(u_int, int, int);
-int io_apic_setup(int);
-void io_apic_setup_intpin(int, int);
-void io_apic_set_id(int, int);
-int io_apic_get_id(int);
-int ext_int_setup(int, int);
-
-void set_apic_timer(int);
-int read_apic_timer(void);
-void u_sleep(int);
-u_int io_apic_read(int, int);
-void io_apic_write(int, int, u_int);
-
-#endif /* !LOCORE */
-#endif /* SMP && !APIC_IO */
-
-#endif /* _KERNEL */
#endif /* _MACHINE_SMP_H_ */
OpenPOWER on IntegriCloud