retire _PROTOTYPE
. only good for obsolete K&R support . also remove a stray ansi.h and the proto cmd
This commit is contained in:
@@ -82,15 +82,15 @@ struct acpi_madt_nmi {
|
||||
u32_t global_int;
|
||||
};
|
||||
|
||||
_PROTOTYPE(void acpi_init, (void));
|
||||
void acpi_init(void);
|
||||
|
||||
/*
|
||||
* Returns a pointer to the io acpi structure in the MADT table in ACPI. The
|
||||
* pointer is valid only until paging is turned off. No memory is allocated in
|
||||
* this function thus no memory needs to be freed
|
||||
*/
|
||||
_PROTOTYPE(struct acpi_madt_ioapic * acpi_get_ioapic_next, (void));
|
||||
struct acpi_madt_ioapic * acpi_get_ioapic_next(void);
|
||||
/* same as above for local APICs */
|
||||
_PROTOTYPE(struct acpi_madt_lapic * acpi_get_lapic_next, (void));
|
||||
struct acpi_madt_lapic * acpi_get_lapic_next(void);
|
||||
|
||||
#endif /* __ACPI_H__ */
|
||||
|
||||
@@ -188,8 +188,8 @@ PRIVATE void ioapic_write(u32_t ioa_base, u8_t reg, u32_t val)
|
||||
*((u32_t *)(ioa_base + IOAPIC_IOWIN)) = val;
|
||||
}
|
||||
|
||||
_PROTOTYPE(void lapic_microsec_sleep, (unsigned count));
|
||||
_PROTOTYPE(void apic_idt_init, (const int reset));
|
||||
void lapic_microsec_sleep(unsigned count);
|
||||
void apic_idt_init(const int reset);
|
||||
|
||||
PRIVATE void ioapic_enable_pin(vir_bytes ioapic_addr, int pin)
|
||||
{
|
||||
|
||||
@@ -122,55 +122,55 @@ EXTERN unsigned nioapics;
|
||||
EXTERN u32_t lapic_addr_vaddr; /* we remember the virtual address here until we
|
||||
switch to paging */
|
||||
|
||||
_PROTOTYPE (int lapic_enable, (unsigned cpu));
|
||||
_PROTOTYPE (void ioapic_unmask_irq, (unsigned irq));
|
||||
_PROTOTYPE (void ioapic_mask_irq, (unsigned irq));
|
||||
_PROTOTYPE (void ioapic_reset_pic, (void));
|
||||
int lapic_enable(unsigned cpu);
|
||||
void ioapic_unmask_irq(unsigned irq);
|
||||
void ioapic_mask_irq(unsigned irq);
|
||||
void ioapic_reset_pic(void);
|
||||
|
||||
EXTERN int ioapic_enabled;
|
||||
EXTERN unsigned nioapics;
|
||||
|
||||
_PROTOTYPE (void lapic_microsec_sleep, (unsigned count));
|
||||
_PROTOTYPE (void ioapic_disable_irqs, (u32_t irqs));
|
||||
_PROTOTYPE (void ioapic_enable_irqs, (u32_t irqs));
|
||||
void lapic_microsec_sleep(unsigned count);
|
||||
void ioapic_disable_irqs(u32_t irqs);
|
||||
void ioapic_enable_irqs(u32_t irqs);
|
||||
|
||||
_PROTOTYPE (int lapic_enable, (unsigned cpu));
|
||||
_PROTOTYPE (void lapic_disable, (void));
|
||||
int lapic_enable(unsigned cpu);
|
||||
void lapic_disable(void);
|
||||
|
||||
_PROTOTYPE (void ioapic_disable_all, (void));
|
||||
_PROTOTYPE (int ioapic_enable_all, (void));
|
||||
void ioapic_disable_all(void);
|
||||
int ioapic_enable_all(void);
|
||||
|
||||
_PROTOTYPE(int detect_ioapics, (void));
|
||||
_PROTOTYPE(void apic_idt_init, (int reset));
|
||||
int detect_ioapics(void);
|
||||
void apic_idt_init(int reset);
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
_PROTOTYPE(int apic_send_startup_ipi, (unsigned cpu, phys_bytes trampoline));
|
||||
_PROTOTYPE(int apic_send_init_ipi, (unsigned cpu, phys_bytes trampoline));
|
||||
_PROTOTYPE(unsigned int apicid, (void));
|
||||
_PROTOTYPE(void ioapic_set_id, (u32_t addr, unsigned int id));
|
||||
int apic_send_startup_ipi(unsigned cpu, phys_bytes trampoline);
|
||||
int apic_send_init_ipi(unsigned cpu, phys_bytes trampoline);
|
||||
unsigned int apicid(void);
|
||||
void ioapic_set_id(u32_t addr, unsigned int id);
|
||||
#else
|
||||
_PROTOTYPE(int apic_single_cpu_init, (void));
|
||||
int apic_single_cpu_init(void);
|
||||
#endif
|
||||
|
||||
_PROTOTYPE(void lapic_set_timer_periodic, (const unsigned freq));
|
||||
_PROTOTYPE(void lapic_set_timer_one_shot, (const u32_t value));
|
||||
_PROTOTYPE(void lapic_stop_timer, (void));
|
||||
_PROTOTYPE(void lapic_restart_timer, (void));
|
||||
void lapic_set_timer_periodic(const unsigned freq);
|
||||
void lapic_set_timer_one_shot(const u32_t value);
|
||||
void lapic_stop_timer(void);
|
||||
void lapic_restart_timer(void);
|
||||
|
||||
_PROTOTYPE(void ioapic_set_irq, (unsigned irq));
|
||||
_PROTOTYPE(void ioapic_unset_irq, (unsigned irq));
|
||||
void ioapic_set_irq(unsigned irq);
|
||||
void ioapic_unset_irq(unsigned irq);
|
||||
|
||||
/* signal the end of interrupt handler to apic */
|
||||
#define apic_eoi() do { *((volatile u32_t *) lapic_eoi_addr) = 0; } while(0)
|
||||
|
||||
_PROTOTYPE(void ioapic_eoi, (int irq));
|
||||
void ioapic_eoi(int irq);
|
||||
|
||||
_PROTOTYPE(void dump_apic_irq_state, (void));
|
||||
void dump_apic_irq_state(void);
|
||||
|
||||
_PROTOTYPE(void apic_send_ipi, (unsigned vector, unsigned cpu, int type));
|
||||
void apic_send_ipi(unsigned vector, unsigned cpu, int type);
|
||||
|
||||
_PROTOTYPE(void apic_ipi_sched_intr, (void));
|
||||
_PROTOTYPE(void apic_ipi_halt_intr, (void));
|
||||
void apic_ipi_sched_intr(void);
|
||||
void apic_ipi_halt_intr(void);
|
||||
|
||||
#define APIC_IPI_DEST 0
|
||||
#define APIC_IPI_SELF 1
|
||||
|
||||
@@ -5,75 +5,75 @@
|
||||
#ifndef __ASSEMBLY__
|
||||
#include "kernel/kernel.h"
|
||||
|
||||
_PROTOTYPE( void apic_hwint0, (void) );
|
||||
_PROTOTYPE( void apic_hwint1, (void) );
|
||||
_PROTOTYPE( void apic_hwint2, (void) );
|
||||
_PROTOTYPE( void apic_hwint3, (void) );
|
||||
_PROTOTYPE( void apic_hwint4, (void) );
|
||||
_PROTOTYPE( void apic_hwint5, (void) );
|
||||
_PROTOTYPE( void apic_hwint6, (void) );
|
||||
_PROTOTYPE( void apic_hwint7, (void) );
|
||||
_PROTOTYPE( void apic_hwint8, (void) );
|
||||
_PROTOTYPE( void apic_hwint9, (void) );
|
||||
_PROTOTYPE( void apic_hwint10, (void) );
|
||||
_PROTOTYPE( void apic_hwint11, (void) );
|
||||
_PROTOTYPE( void apic_hwint12, (void) );
|
||||
_PROTOTYPE( void apic_hwint13, (void) );
|
||||
_PROTOTYPE( void apic_hwint14, (void) );
|
||||
_PROTOTYPE( void apic_hwint15, (void) );
|
||||
_PROTOTYPE( void apic_hwint16, (void) );
|
||||
_PROTOTYPE( void apic_hwint17, (void) );
|
||||
_PROTOTYPE( void apic_hwint18, (void) );
|
||||
_PROTOTYPE( void apic_hwint19, (void) );
|
||||
_PROTOTYPE( void apic_hwint20, (void) );
|
||||
_PROTOTYPE( void apic_hwint21, (void) );
|
||||
_PROTOTYPE( void apic_hwint22, (void) );
|
||||
_PROTOTYPE( void apic_hwint23, (void) );
|
||||
_PROTOTYPE( void apic_hwint24, (void) );
|
||||
_PROTOTYPE( void apic_hwint25, (void) );
|
||||
_PROTOTYPE( void apic_hwint26, (void) );
|
||||
_PROTOTYPE( void apic_hwint27, (void) );
|
||||
_PROTOTYPE( void apic_hwint28, (void) );
|
||||
_PROTOTYPE( void apic_hwint29, (void) );
|
||||
_PROTOTYPE( void apic_hwint30, (void) );
|
||||
_PROTOTYPE( void apic_hwint31, (void) );
|
||||
_PROTOTYPE( void apic_hwint32, (void) );
|
||||
_PROTOTYPE( void apic_hwint33, (void) );
|
||||
_PROTOTYPE( void apic_hwint34, (void) );
|
||||
_PROTOTYPE( void apic_hwint35, (void) );
|
||||
_PROTOTYPE( void apic_hwint36, (void) );
|
||||
_PROTOTYPE( void apic_hwint37, (void) );
|
||||
_PROTOTYPE( void apic_hwint38, (void) );
|
||||
_PROTOTYPE( void apic_hwint39, (void) );
|
||||
_PROTOTYPE( void apic_hwint40, (void) );
|
||||
_PROTOTYPE( void apic_hwint41, (void) );
|
||||
_PROTOTYPE( void apic_hwint42, (void) );
|
||||
_PROTOTYPE( void apic_hwint43, (void) );
|
||||
_PROTOTYPE( void apic_hwint44, (void) );
|
||||
_PROTOTYPE( void apic_hwint45, (void) );
|
||||
_PROTOTYPE( void apic_hwint46, (void) );
|
||||
_PROTOTYPE( void apic_hwint47, (void) );
|
||||
_PROTOTYPE( void apic_hwint48, (void) );
|
||||
_PROTOTYPE( void apic_hwint49, (void) );
|
||||
_PROTOTYPE( void apic_hwint50, (void) );
|
||||
_PROTOTYPE( void apic_hwint51, (void) );
|
||||
_PROTOTYPE( void apic_hwint52, (void) );
|
||||
_PROTOTYPE( void apic_hwint53, (void) );
|
||||
_PROTOTYPE( void apic_hwint54, (void) );
|
||||
_PROTOTYPE( void apic_hwint55, (void) );
|
||||
_PROTOTYPE( void apic_hwint56, (void) );
|
||||
_PROTOTYPE( void apic_hwint57, (void) );
|
||||
_PROTOTYPE( void apic_hwint58, (void) );
|
||||
_PROTOTYPE( void apic_hwint59, (void) );
|
||||
_PROTOTYPE( void apic_hwint60, (void) );
|
||||
_PROTOTYPE( void apic_hwint61, (void) );
|
||||
_PROTOTYPE( void apic_hwint62, (void) );
|
||||
_PROTOTYPE( void apic_hwint63, (void) );
|
||||
void apic_hwint0(void);
|
||||
void apic_hwint1(void);
|
||||
void apic_hwint2(void);
|
||||
void apic_hwint3(void);
|
||||
void apic_hwint4(void);
|
||||
void apic_hwint5(void);
|
||||
void apic_hwint6(void);
|
||||
void apic_hwint7(void);
|
||||
void apic_hwint8(void);
|
||||
void apic_hwint9(void);
|
||||
void apic_hwint10(void);
|
||||
void apic_hwint11(void);
|
||||
void apic_hwint12(void);
|
||||
void apic_hwint13(void);
|
||||
void apic_hwint14(void);
|
||||
void apic_hwint15(void);
|
||||
void apic_hwint16(void);
|
||||
void apic_hwint17(void);
|
||||
void apic_hwint18(void);
|
||||
void apic_hwint19(void);
|
||||
void apic_hwint20(void);
|
||||
void apic_hwint21(void);
|
||||
void apic_hwint22(void);
|
||||
void apic_hwint23(void);
|
||||
void apic_hwint24(void);
|
||||
void apic_hwint25(void);
|
||||
void apic_hwint26(void);
|
||||
void apic_hwint27(void);
|
||||
void apic_hwint28(void);
|
||||
void apic_hwint29(void);
|
||||
void apic_hwint30(void);
|
||||
void apic_hwint31(void);
|
||||
void apic_hwint32(void);
|
||||
void apic_hwint33(void);
|
||||
void apic_hwint34(void);
|
||||
void apic_hwint35(void);
|
||||
void apic_hwint36(void);
|
||||
void apic_hwint37(void);
|
||||
void apic_hwint38(void);
|
||||
void apic_hwint39(void);
|
||||
void apic_hwint40(void);
|
||||
void apic_hwint41(void);
|
||||
void apic_hwint42(void);
|
||||
void apic_hwint43(void);
|
||||
void apic_hwint44(void);
|
||||
void apic_hwint45(void);
|
||||
void apic_hwint46(void);
|
||||
void apic_hwint47(void);
|
||||
void apic_hwint48(void);
|
||||
void apic_hwint49(void);
|
||||
void apic_hwint50(void);
|
||||
void apic_hwint51(void);
|
||||
void apic_hwint52(void);
|
||||
void apic_hwint53(void);
|
||||
void apic_hwint54(void);
|
||||
void apic_hwint55(void);
|
||||
void apic_hwint56(void);
|
||||
void apic_hwint57(void);
|
||||
void apic_hwint58(void);
|
||||
void apic_hwint59(void);
|
||||
void apic_hwint60(void);
|
||||
void apic_hwint61(void);
|
||||
void apic_hwint62(void);
|
||||
void apic_hwint63(void);
|
||||
|
||||
/* The local APIC timer tick handlers */
|
||||
_PROTOTYPE(void lapic_timer_int_handler, (void));
|
||||
_PROTOTYPE(void apic_spurios_intr, (void));
|
||||
_PROTOTYPE(void apic_error_intr, (void));
|
||||
void lapic_timer_int_handler(void);
|
||||
void apic_spurios_intr(void);
|
||||
void apic_error_intr(void);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#include "glo.h"
|
||||
|
||||
_PROTOTYPE(void trampoline, (void));
|
||||
void trampoline(void);
|
||||
|
||||
/*
|
||||
* arguments for trampoline. We need to pass the logical cpu id, gdt and idt.
|
||||
@@ -48,7 +48,7 @@ PUBLIC unsigned char cpuid2apicid[CONFIG_MAX_CPUS];
|
||||
SPINLOCK_DEFINE(smp_cpu_lock)
|
||||
SPINLOCK_DEFINE(dispq_lock)
|
||||
|
||||
FORWARD _PROTOTYPE(void smp_reinit_vars, (void));
|
||||
FORWARD void smp_reinit_vars(void);
|
||||
|
||||
/*
|
||||
* copies the 16-bit AP trampoline code to the first 1M of memory
|
||||
|
||||
@@ -49,12 +49,12 @@ extern void poweroff16_end();
|
||||
|
||||
PUBLIC void * k_stacks;
|
||||
|
||||
FORWARD _PROTOTYPE( void ser_debug, (int c));
|
||||
FORWARD void ser_debug(int c);
|
||||
#ifdef CONFIG_SMP
|
||||
FORWARD _PROTOTYPE( void ser_dump_proc_cpu, (void));
|
||||
FORWARD void ser_dump_proc_cpu(void);
|
||||
#endif
|
||||
#if !CONFIG_OXPCIE
|
||||
FORWARD _PROTOTYPE( void ser_init, (void));
|
||||
FORWARD void ser_init(void);
|
||||
#endif
|
||||
|
||||
PUBLIC __dead void arch_monitor(void)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "../apic_asm.h"
|
||||
|
||||
_PROTOTYPE(int init_8253A_timer, (unsigned freq));
|
||||
_PROTOTYPE(void stop_8253A_timer, (void));
|
||||
int init_8253A_timer(unsigned freq);
|
||||
void stop_8253A_timer(void);
|
||||
|
||||
#endif /* __CLOCK_X86_H__ */
|
||||
|
||||
@@ -9,54 +9,54 @@
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/* Hardware interrupt handlers. */
|
||||
_PROTOTYPE( void hwint00, (void) );
|
||||
_PROTOTYPE( void hwint01, (void) );
|
||||
_PROTOTYPE( void hwint02, (void) );
|
||||
_PROTOTYPE( void hwint03, (void) );
|
||||
_PROTOTYPE( void hwint04, (void) );
|
||||
_PROTOTYPE( void hwint05, (void) );
|
||||
_PROTOTYPE( void hwint06, (void) );
|
||||
_PROTOTYPE( void hwint07, (void) );
|
||||
_PROTOTYPE( void hwint08, (void) );
|
||||
_PROTOTYPE( void hwint09, (void) );
|
||||
_PROTOTYPE( void hwint10, (void) );
|
||||
_PROTOTYPE( void hwint11, (void) );
|
||||
_PROTOTYPE( void hwint12, (void) );
|
||||
_PROTOTYPE( void hwint13, (void) );
|
||||
_PROTOTYPE( void hwint14, (void) );
|
||||
_PROTOTYPE( void hwint15, (void) );
|
||||
void hwint00(void);
|
||||
void hwint01(void);
|
||||
void hwint02(void);
|
||||
void hwint03(void);
|
||||
void hwint04(void);
|
||||
void hwint05(void);
|
||||
void hwint06(void);
|
||||
void hwint07(void);
|
||||
void hwint08(void);
|
||||
void hwint09(void);
|
||||
void hwint10(void);
|
||||
void hwint11(void);
|
||||
void hwint12(void);
|
||||
void hwint13(void);
|
||||
void hwint14(void);
|
||||
void hwint15(void);
|
||||
|
||||
/* Exception handlers (real or protected mode), in numerical order. */
|
||||
void _PROTOTYPE( int00, (void) ), _PROTOTYPE( divide_error, (void) );
|
||||
void _PROTOTYPE( int01, (void) ), _PROTOTYPE( single_step_exception, (void) );
|
||||
void _PROTOTYPE( int02, (void) ), _PROTOTYPE( nmi, (void) );
|
||||
void _PROTOTYPE( int03, (void) ), _PROTOTYPE( breakpoint_exception, (void) );
|
||||
void _PROTOTYPE( int04, (void) ), _PROTOTYPE( overflow, (void) );
|
||||
void _PROTOTYPE( int05, (void) ), _PROTOTYPE( bounds_check, (void) );
|
||||
void _PROTOTYPE( int06, (void) ), _PROTOTYPE( inval_opcode, (void) );
|
||||
void _PROTOTYPE( int07, (void) ), _PROTOTYPE( copr_not_available, (void) );
|
||||
void _PROTOTYPE( double_fault, (void) );
|
||||
void _PROTOTYPE( copr_seg_overrun, (void) );
|
||||
void _PROTOTYPE( inval_tss, (void) );
|
||||
void _PROTOTYPE( segment_not_present, (void) );
|
||||
void _PROTOTYPE( stack_exception, (void) );
|
||||
void _PROTOTYPE( general_protection, (void) );
|
||||
void _PROTOTYPE( page_fault, (void) );
|
||||
void _PROTOTYPE( copr_error, (void) );
|
||||
void _PROTOTYPE( alignment_check, (void) );
|
||||
void _PROTOTYPE( machine_check, (void) );
|
||||
void _PROTOTYPE( simd_exception, (void) );
|
||||
void int00(void), divide_error (void);
|
||||
void int01(void), single_step_exception (void);
|
||||
void int02(void), nmi (void);
|
||||
void int03(void), breakpoint_exception (void);
|
||||
void int04(void), overflow (void);
|
||||
void int05(void), bounds_check (void);
|
||||
void int06(void), inval_opcode (void);
|
||||
void int07(void), copr_not_available (void);
|
||||
void double_fault(void);
|
||||
void copr_seg_overrun(void);
|
||||
void inval_tss(void);
|
||||
void segment_not_present(void);
|
||||
void stack_exception(void);
|
||||
void general_protection(void);
|
||||
void page_fault(void);
|
||||
void copr_error(void);
|
||||
void alignment_check(void);
|
||||
void machine_check(void);
|
||||
void simd_exception(void);
|
||||
|
||||
/* Software interrupt handlers, in numerical order. */
|
||||
_PROTOTYPE( void trp, (void) );
|
||||
_PROTOTYPE( void ipc_entry, (void) );
|
||||
_PROTOTYPE( void kernel_call_entry, (void) );
|
||||
_PROTOTYPE( void level0_call, (void) );
|
||||
void trp(void);
|
||||
void ipc_entry(void);
|
||||
void kernel_call_entry(void);
|
||||
void level0_call(void);
|
||||
|
||||
/* memory.c */
|
||||
_PROTOTYPE( void segmentation2paging, (struct proc * current));
|
||||
_PROTOTYPE( void i386_freepde, (int pde));
|
||||
_PROTOTYPE( void getcr3val, (void));
|
||||
void segmentation2paging(struct proc * current);
|
||||
void i386_freepde(int pde);
|
||||
void getcr3val(void);
|
||||
|
||||
|
||||
/* exception.c */
|
||||
@@ -70,54 +70,53 @@ struct exception_frame {
|
||||
reg_t ss; /* undefined if trap is nested */
|
||||
};
|
||||
|
||||
_PROTOTYPE( void exception, (struct exception_frame * frame));
|
||||
void exception(struct exception_frame * frame);
|
||||
|
||||
/* klib386.s */
|
||||
_PROTOTYPE( __dead void monitor, (void) );
|
||||
_PROTOTYPE( __dead void reset, (void) );
|
||||
_PROTOTYPE( __dead void x86_triplefault, (void) );
|
||||
_PROTOTYPE( void int86, (void) );
|
||||
_PROTOTYPE( reg_t read_cr0, (void) );
|
||||
_PROTOTYPE( reg_t read_cr2, (void) );
|
||||
_PROTOTYPE( void write_cr0, (unsigned long value) );
|
||||
_PROTOTYPE( unsigned long read_cr4, (void) );
|
||||
_PROTOTYPE( void write_cr4, (unsigned long value) );
|
||||
_PROTOTYPE( void write_cr3, (unsigned long value) );
|
||||
_PROTOTYPE( unsigned long read_cpu_flags, (void) );
|
||||
_PROTOTYPE( void phys_insb, (u16_t port, phys_bytes buf, size_t count) );
|
||||
_PROTOTYPE( void phys_insw, (u16_t port, phys_bytes buf, size_t count) );
|
||||
_PROTOTYPE( void phys_outsb, (u16_t port, phys_bytes buf, size_t count) );
|
||||
_PROTOTYPE( void phys_outsw, (u16_t port, phys_bytes buf, size_t count) );
|
||||
_PROTOTYPE( u32_t read_cr3, (void) );
|
||||
_PROTOTYPE( void reload_cr3, (void) );
|
||||
_PROTOTYPE( void i386_invlpg, (phys_bytes linaddr) );
|
||||
_PROTOTYPE( void phys_memset, (phys_bytes ph, u32_t c, phys_bytes bytes));
|
||||
_PROTOTYPE( void reload_ds, (void) );
|
||||
_PROTOTYPE( void ia32_msr_read, (u32_t reg, u32_t * hi, u32_t * lo) );
|
||||
_PROTOTYPE( void ia32_msr_write, (u32_t reg, u32_t hi, u32_t lo) );
|
||||
_PROTOTYPE( void fninit, (void));
|
||||
_PROTOTYPE( void clts, (void));
|
||||
_PROTOTYPE( void fxsave, (void *));
|
||||
_PROTOTYPE( void fnsave, (void *));
|
||||
_PROTOTYPE( int fxrstor, (void *));
|
||||
_PROTOTYPE( int __fxrstor_end, (void *));
|
||||
_PROTOTYPE( int frstor, (void *));
|
||||
_PROTOTYPE( int __frstor_end, (void *));
|
||||
_PROTOTYPE( int __frstor_failure, (void *));
|
||||
_PROTOTYPE( unsigned short fnstsw, (void));
|
||||
_PROTOTYPE( void fnstcw, (unsigned short* cw));
|
||||
__dead void monitor(void);
|
||||
__dead void reset(void);
|
||||
__dead void x86_triplefault(void);
|
||||
void int86(void);
|
||||
reg_t read_cr0(void);
|
||||
reg_t read_cr2(void);
|
||||
void write_cr0(unsigned long value);
|
||||
unsigned long read_cr4(void);
|
||||
void write_cr4(unsigned long value);
|
||||
void write_cr3(unsigned long value);
|
||||
unsigned long read_cpu_flags(void);
|
||||
void phys_insb(u16_t port, phys_bytes buf, size_t count);
|
||||
void phys_insw(u16_t port, phys_bytes buf, size_t count);
|
||||
void phys_outsb(u16_t port, phys_bytes buf, size_t count);
|
||||
void phys_outsw(u16_t port, phys_bytes buf, size_t count);
|
||||
u32_t read_cr3(void);
|
||||
void reload_cr3(void);
|
||||
void i386_invlpg(phys_bytes linaddr);
|
||||
void phys_memset(phys_bytes ph, u32_t c, phys_bytes bytes);
|
||||
void reload_ds(void);
|
||||
void ia32_msr_read(u32_t reg, u32_t * hi, u32_t * lo);
|
||||
void ia32_msr_write(u32_t reg, u32_t hi, u32_t lo);
|
||||
void fninit(void);
|
||||
void clts(void);
|
||||
void fxsave(void *);
|
||||
void fnsave(void *);
|
||||
int fxrstor(void *);
|
||||
int __fxrstor_end(void *);
|
||||
int frstor(void *);
|
||||
int __frstor_end(void *);
|
||||
int __frstor_failure(void *);
|
||||
unsigned short fnstsw(void);
|
||||
void fnstcw(unsigned short* cw);
|
||||
|
||||
_PROTOTYPE( void switch_k_stack, (void * esp, void (* continuation)(void)));
|
||||
void switch_k_stack(void * esp, void (* continuation)(void));
|
||||
|
||||
_PROTOTYPE(void __switch_address_space, (struct proc * p,
|
||||
struct proc ** __ptproc));
|
||||
void __switch_address_space(struct proc * p, struct proc ** __ptproc);
|
||||
#define switch_address_space(proc) \
|
||||
__switch_address_space(proc, get_cpulocal_var_ptr(ptproc))
|
||||
|
||||
_PROTOTYPE(void refresh_tlb, (void));
|
||||
void refresh_tlb(void);
|
||||
|
||||
/* multiboot.c */
|
||||
_PROTOTYPE( void multiboot_init, (void) );
|
||||
void multiboot_init(void);
|
||||
|
||||
/* protect.c */
|
||||
struct tss_s {
|
||||
@@ -151,20 +150,20 @@ struct tss_s {
|
||||
/* u8_t iomap[0]; */
|
||||
};
|
||||
|
||||
_PROTOTYPE( void prot_init, (void) );
|
||||
_PROTOTYPE( void idt_init, (void) );
|
||||
_PROTOTYPE( void init_dataseg, (struct segdesc_s *segdp, phys_bytes base,
|
||||
vir_bytes size, int privilege) );
|
||||
_PROTOTYPE( void enable_iop, (struct proc *pp) );
|
||||
_PROTOTYPE( int prot_set_kern_seg_limit, (vir_bytes limit) );
|
||||
_PROTOTYPE( void printseg, (char *banner, int iscs, struct proc *pr, u32_t selector) );
|
||||
_PROTOTYPE( u32_t read_cs, (void));
|
||||
_PROTOTYPE( u32_t read_ds, (void));
|
||||
_PROTOTYPE( u32_t read_ss, (void));
|
||||
void prot_init(void);
|
||||
void idt_init(void);
|
||||
void init_dataseg(struct segdesc_s *segdp, phys_bytes base, vir_bytes
|
||||
size, int privilege);
|
||||
void enable_iop(struct proc *pp);
|
||||
int prot_set_kern_seg_limit(vir_bytes limit);
|
||||
void printseg(char *banner, int iscs, struct proc *pr, u32_t selector);
|
||||
u32_t read_cs(void);
|
||||
u32_t read_ds(void);
|
||||
u32_t read_ss(void);
|
||||
|
||||
/* prototype of an interrupt vector table entry */
|
||||
struct gate_table_s {
|
||||
_PROTOTYPE( void (*gate), (void) );
|
||||
void(*gate) (void);
|
||||
unsigned char vec_nr;
|
||||
unsigned char privilege;
|
||||
};
|
||||
@@ -172,8 +171,8 @@ struct gate_table_s {
|
||||
extern struct gate_table_s gate_table_pic[];
|
||||
|
||||
/* copies an array of vectors to the IDT. The last vector must be zero filled */
|
||||
_PROTOTYPE(void idt_copy_vectors, (struct gate_table_s * first));
|
||||
_PROTOTYPE(void idt_reload,(void));
|
||||
void idt_copy_vectors(struct gate_table_s * first);
|
||||
void idt_reload(void);
|
||||
|
||||
EXTERN void * k_boot_stktop;
|
||||
EXTERN void * k_stacks_start;
|
||||
@@ -182,13 +181,13 @@ extern void * k_stacks;
|
||||
#define get_k_stack_top(cpu) ((void *)(((char*)(k_stacks)) \
|
||||
+ 2 * ((cpu) + 1) * K_STACK_SIZE))
|
||||
|
||||
_PROTOTYPE( void, mfence(void));
|
||||
void mfence(void);
|
||||
#define barrier() do { mfence(); } while(0)
|
||||
|
||||
|
||||
#ifndef __GNUC__
|
||||
/* call a function to read the stack fram pointer (%ebp) */
|
||||
_PROTOTYPE(reg_t read_ebp, (void));
|
||||
reg_t read_ebp(void);
|
||||
#define get_stack_frame(__X) ((reg_t)read_ebp())
|
||||
#else
|
||||
/* read %ebp directly */
|
||||
@@ -198,23 +197,18 @@ _PROTOTYPE(reg_t read_ebp, (void));
|
||||
/*
|
||||
* sets up TSS for a cpu and assigns kernel stack and cpu id
|
||||
*/
|
||||
_PROTOTYPE(void tss_init, (unsigned cpu, void * kernel_stack));
|
||||
void tss_init(unsigned cpu, void * kernel_stack);
|
||||
|
||||
_PROTOTYPE( void int_gate, (unsigned vec_nr, vir_bytes offset,
|
||||
unsigned dpl_type) );
|
||||
void int_gate(unsigned vec_nr, vir_bytes offset, unsigned dpl_type);
|
||||
|
||||
_PROTOTYPE(void __copy_msg_from_user_end, (void));
|
||||
_PROTOTYPE(void __copy_msg_to_user_end, (void));
|
||||
_PROTOTYPE(void __user_copy_msg_pointer_failure, (void));
|
||||
void __copy_msg_from_user_end(void);
|
||||
void __copy_msg_to_user_end(void);
|
||||
void __user_copy_msg_pointer_failure(void);
|
||||
|
||||
_PROTOTYPE(int platform_tbl_checksum_ok, (void *ptr, unsigned int length));
|
||||
_PROTOTYPE(int platform_tbl_ptr, (phys_bytes start,
|
||||
phys_bytes end,
|
||||
unsigned increment,
|
||||
void * buff,
|
||||
unsigned size,
|
||||
phys_bytes * phys_addr,
|
||||
int ((* cmp_f)(void *))));
|
||||
int platform_tbl_checksum_ok(void *ptr, unsigned int length);
|
||||
int platform_tbl_ptr(phys_bytes start, phys_bytes end, unsigned
|
||||
increment, void * buff, unsigned size, phys_bytes * phys_addr, int ((*
|
||||
cmp_f)(void *)));
|
||||
|
||||
/* breakpoints.c */
|
||||
#define BREAKPOINT_COUNT 4
|
||||
|
||||
@@ -21,7 +21,7 @@ struct nmi_frame {
|
||||
reg_t eflags;
|
||||
};
|
||||
|
||||
_PROTOTYPE(int i386_watchdog_start, (void));
|
||||
int i386_watchdog_start(void);
|
||||
|
||||
#define nmi_in_kernel(f) ((f)->cs == CS_SELECTOR)
|
||||
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
#define __HW_INTR_X86_H__
|
||||
|
||||
#include "kernel/kernel.h"
|
||||
_PROTOTYPE(void irq_8259_unmask,(int irq));
|
||||
_PROTOTYPE(void irq_8259_mask,(int irq));
|
||||
_PROTOTYPE(void irq_8259_eoi, (int irq));
|
||||
_PROTOTYPE(void irq_handle,(int irq));
|
||||
_PROTOTYPE(void i8259_disable,(void));
|
||||
_PROTOTYPE(void eoi_8259_master,(void));
|
||||
_PROTOTYPE(void eoi_8259_slave,(void));
|
||||
void irq_8259_unmask(int irq);
|
||||
void irq_8259_mask(int irq);
|
||||
void irq_8259_eoi(int irq);
|
||||
void irq_handle(int irq);
|
||||
void i8259_disable(void);
|
||||
void eoi_8259_master(void);
|
||||
void eoi_8259_slave(void);
|
||||
|
||||
/*
|
||||
* we don't use IO APIC if not configured for SMP as we cannot read any info
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
|
||||
#include "kernel/kernel.h"
|
||||
|
||||
_PROTOTYPE(void mb_cls, (void));
|
||||
_PROTOTYPE(void mb_print, (char*));
|
||||
_PROTOTYPE(void mb_print_char, (char));
|
||||
_PROTOTYPE(int mb_read_char, (unsigned char*));
|
||||
void mb_cls(void);
|
||||
void mb_print(char*);
|
||||
void mb_print_char(char);
|
||||
int mb_read_char(unsigned char*);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -36,8 +36,8 @@ PRIVATE int nfreepdes = 0, freepdes[MAX_FREEPDES];
|
||||
|
||||
#define HASPT(procptr) ((procptr)->p_seg.p_cr3 != 0)
|
||||
|
||||
FORWARD _PROTOTYPE( u32_t phys_get32, (phys_bytes v) );
|
||||
FORWARD _PROTOTYPE( void vm_enable_paging, (void) );
|
||||
FORWARD u32_t phys_get32(phys_bytes v);
|
||||
FORWARD void vm_enable_paging(void);
|
||||
|
||||
|
||||
PUBLIC void segmentation2paging(struct proc * current)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
_PROTOTYPE( void oxpcie_set_vaddr, (unsigned char *vaddr));
|
||||
_PROTOTYPE( void oxpcie_putc, (char c));
|
||||
_PROTOTYPE( int oxpcie_in, (void));
|
||||
void oxpcie_set_vaddr(unsigned char *vaddr);
|
||||
void oxpcie_putc(char c);
|
||||
int oxpcie_in(void);
|
||||
|
||||
#include "serial.h"
|
||||
|
||||
|
||||
@@ -38,8 +38,8 @@ PUBLIC struct segdesc_s gdt[GDT_SIZE]= /* used in klib.s and mpx.s */
|
||||
PRIVATE struct gatedesc_s idt[IDT_SIZE]; /* zero-init so none present */
|
||||
PUBLIC struct tss_s tss[CONFIG_MAX_CPUS]; /* zero init */
|
||||
|
||||
FORWARD _PROTOTYPE( void sdesc, (struct segdesc_s *segdp, phys_bytes base,
|
||||
vir_bytes size) );
|
||||
FORWARD void sdesc(struct segdesc_s *segdp, phys_bytes base, vir_bytes
|
||||
size);
|
||||
|
||||
/*===========================================================================*
|
||||
* enable_iop *
|
||||
|
||||
Reference in New Issue
Block a user