retire PUBLIC, PRIVATE and FORWARD
This commit is contained in:
@@ -9,23 +9,23 @@ typedef int ((* acpi_read_t)(phys_bytes addr, void * buff, size_t size));
|
||||
|
||||
struct acpi_rsdp acpi_rsdp;
|
||||
|
||||
PRIVATE acpi_read_t read_func;
|
||||
static acpi_read_t read_func;
|
||||
|
||||
#define MAX_RSDT 35 /* ACPI defines 35 signatures */
|
||||
|
||||
PRIVATE struct acpi_rsdt {
|
||||
static struct acpi_rsdt {
|
||||
struct acpi_sdt_header hdr;
|
||||
u32_t data[MAX_RSDT];
|
||||
} rsdt;
|
||||
|
||||
PRIVATE struct {
|
||||
static struct {
|
||||
char signature [ACPI_SDT_SIGNATURE_LEN + 1];
|
||||
size_t length;
|
||||
} sdt_trans[MAX_RSDT];
|
||||
|
||||
PRIVATE int sdt_count;
|
||||
static int sdt_count;
|
||||
|
||||
PRIVATE int acpi_check_csum(struct acpi_sdt_header * tb, size_t size)
|
||||
static int acpi_check_csum(struct acpi_sdt_header * tb, size_t size)
|
||||
{
|
||||
u8_t total = 0;
|
||||
int i;
|
||||
@@ -34,12 +34,12 @@ PRIVATE int acpi_check_csum(struct acpi_sdt_header * tb, size_t size)
|
||||
return total == 0 ? 0 : -1;
|
||||
}
|
||||
|
||||
PRIVATE int acpi_check_signature(const char * orig, const char * match)
|
||||
static int acpi_check_signature(const char * orig, const char * match)
|
||||
{
|
||||
return strncmp(orig, match, ACPI_SDT_SIGNATURE_LEN);
|
||||
}
|
||||
|
||||
PRIVATE int acpi_read_sdt_at(phys_bytes addr,
|
||||
static int acpi_read_sdt_at(phys_bytes addr,
|
||||
struct acpi_sdt_header * tb,
|
||||
size_t size,
|
||||
const char * name)
|
||||
@@ -84,7 +84,7 @@ PRIVATE int acpi_read_sdt_at(phys_bytes addr,
|
||||
return tb->length;
|
||||
}
|
||||
|
||||
PUBLIC phys_bytes acpi_get_table_base(const char * name)
|
||||
phys_bytes acpi_get_table_base(const char * name)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -97,7 +97,7 @@ PUBLIC phys_bytes acpi_get_table_base(const char * name)
|
||||
return (phys_bytes) NULL;
|
||||
}
|
||||
|
||||
PUBLIC size_t acpi_get_table_length(const char * name)
|
||||
size_t acpi_get_table_length(const char * name)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -110,7 +110,7 @@ PUBLIC size_t acpi_get_table_length(const char * name)
|
||||
return 0;
|
||||
}
|
||||
|
||||
PRIVATE void * acpi_madt_get_typed_item(struct acpi_madt_hdr * hdr,
|
||||
static void * acpi_madt_get_typed_item(struct acpi_madt_hdr * hdr,
|
||||
unsigned char type,
|
||||
unsigned idx)
|
||||
{
|
||||
@@ -135,7 +135,7 @@ PRIVATE void * acpi_madt_get_typed_item(struct acpi_madt_hdr * hdr,
|
||||
}
|
||||
|
||||
#if 0
|
||||
PRIVATE void * acpi_madt_get_item(struct acpi_madt_hdr * hdr,
|
||||
static void * acpi_madt_get_item(struct acpi_madt_hdr * hdr,
|
||||
unsigned idx)
|
||||
{
|
||||
u8_t * t, * end;
|
||||
@@ -154,7 +154,7 @@ PRIVATE void * acpi_madt_get_item(struct acpi_madt_hdr * hdr,
|
||||
}
|
||||
#endif
|
||||
|
||||
PRIVATE int acpi_rsdp_test(void * buff)
|
||||
static int acpi_rsdp_test(void * buff)
|
||||
{
|
||||
struct acpi_rsdp * rsdp = (struct acpi_rsdp *) buff;
|
||||
|
||||
@@ -166,7 +166,7 @@ PRIVATE int acpi_rsdp_test(void * buff)
|
||||
return 1;
|
||||
}
|
||||
|
||||
PRIVATE int get_acpi_rsdp(void)
|
||||
static int get_acpi_rsdp(void)
|
||||
{
|
||||
u16_t ebda;
|
||||
/*
|
||||
@@ -192,13 +192,13 @@ PRIVATE int get_acpi_rsdp(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
PRIVATE int acpi_read_kernel(phys_bytes addr, void * buff, size_t size)
|
||||
static int acpi_read_kernel(phys_bytes addr, void * buff, size_t size)
|
||||
{
|
||||
phys_copy(addr, vir2phys(buff), size);
|
||||
return 0;
|
||||
}
|
||||
|
||||
PUBLIC void acpi_init(void)
|
||||
void acpi_init(void)
|
||||
{
|
||||
int s, i;
|
||||
read_func = acpi_read_kernel;
|
||||
@@ -229,7 +229,7 @@ PUBLIC void acpi_init(void)
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC struct acpi_madt_ioapic * acpi_get_ioapic_next(void)
|
||||
struct acpi_madt_ioapic * acpi_get_ioapic_next(void)
|
||||
{
|
||||
static unsigned idx = 0;
|
||||
static struct acpi_madt_hdr * madt_hdr;
|
||||
@@ -251,7 +251,7 @@ PUBLIC struct acpi_madt_ioapic * acpi_get_ioapic_next(void)
|
||||
return ret;
|
||||
}
|
||||
|
||||
PUBLIC struct acpi_madt_lapic * acpi_get_lapic_next(void)
|
||||
struct acpi_madt_lapic * acpi_get_lapic_next(void)
|
||||
{
|
||||
static unsigned idx = 0;
|
||||
static struct acpi_madt_hdr * madt_hdr;
|
||||
|
||||
@@ -107,8 +107,8 @@
|
||||
#define SPLHI 0xF
|
||||
|
||||
|
||||
PUBLIC struct io_apic io_apic[MAX_NR_IOAPICS];
|
||||
PUBLIC unsigned nioapics;
|
||||
struct io_apic io_apic[MAX_NR_IOAPICS];
|
||||
unsigned nioapics;
|
||||
|
||||
struct irq;
|
||||
typedef void (* eoi_method_t)(struct irq *);
|
||||
@@ -121,7 +121,7 @@ struct irq {
|
||||
unsigned state;
|
||||
};
|
||||
|
||||
PRIVATE struct irq io_apic_irq[NR_IRQ_VECTORS];
|
||||
static struct irq io_apic_irq[NR_IRQ_VECTORS];
|
||||
|
||||
/*
|
||||
* to make APIC work if SMP is not configured, we need to set the maximal number
|
||||
@@ -146,20 +146,20 @@ PRIVATE struct irq io_apic_irq[NR_IRQ_VECTORS];
|
||||
|
||||
#define VERBOSE_APIC(x) x
|
||||
|
||||
PUBLIC int ioapic_enabled;
|
||||
PUBLIC u32_t lapic_addr_vaddr;
|
||||
PUBLIC vir_bytes lapic_addr;
|
||||
PUBLIC vir_bytes lapic_eoi_addr;
|
||||
PUBLIC int bsp_lapic_id;
|
||||
int ioapic_enabled;
|
||||
u32_t lapic_addr_vaddr;
|
||||
vir_bytes lapic_addr;
|
||||
vir_bytes lapic_eoi_addr;
|
||||
int bsp_lapic_id;
|
||||
|
||||
PRIVATE volatile unsigned probe_ticks;
|
||||
PRIVATE u64_t tsc0, tsc1;
|
||||
PRIVATE u32_t lapic_tctr0, lapic_tctr1;
|
||||
static volatile unsigned probe_ticks;
|
||||
static u64_t tsc0, tsc1;
|
||||
static u32_t lapic_tctr0, lapic_tctr1;
|
||||
|
||||
PRIVATE unsigned apic_imcrp;
|
||||
PRIVATE const unsigned nlints = 0;
|
||||
static unsigned apic_imcrp;
|
||||
static const unsigned nlints = 0;
|
||||
|
||||
PUBLIC void arch_eoi(void)
|
||||
void arch_eoi(void)
|
||||
{
|
||||
apic_eoi();
|
||||
}
|
||||
@@ -169,20 +169,20 @@ PUBLIC void arch_eoi(void)
|
||||
* arch specific cpulocals. As this variable is write-once-read-only it is ok to
|
||||
* have at as an array until we resolve the cpulocals properly
|
||||
*/
|
||||
PRIVATE u32_t lapic_bus_freq[CONFIG_MAX_CPUS];
|
||||
static u32_t lapic_bus_freq[CONFIG_MAX_CPUS];
|
||||
/* the probe period will be roughly 100ms */
|
||||
#define PROBE_TICKS (system_hz / 10)
|
||||
|
||||
#define IOAPIC_IOREGSEL 0x0
|
||||
#define IOAPIC_IOWIN 0x10
|
||||
|
||||
PRIVATE u32_t ioapic_read(u32_t ioa_base, u32_t reg)
|
||||
static u32_t ioapic_read(u32_t ioa_base, u32_t reg)
|
||||
{
|
||||
*((u32_t *)(ioa_base + IOAPIC_IOREGSEL)) = (reg & 0xff);
|
||||
return *(u32_t *)(ioa_base + IOAPIC_IOWIN);
|
||||
}
|
||||
|
||||
PRIVATE void ioapic_write(u32_t ioa_base, u8_t reg, u32_t val)
|
||||
static void ioapic_write(u32_t ioa_base, u8_t reg, u32_t val)
|
||||
{
|
||||
*((u32_t *)(ioa_base + IOAPIC_IOREGSEL)) = reg;
|
||||
*((u32_t *)(ioa_base + IOAPIC_IOWIN)) = val;
|
||||
@@ -191,7 +191,7 @@ PRIVATE void ioapic_write(u32_t ioa_base, u8_t reg, u32_t val)
|
||||
void lapic_microsec_sleep(unsigned count);
|
||||
void apic_idt_init(const int reset);
|
||||
|
||||
PRIVATE void ioapic_enable_pin(vir_bytes ioapic_addr, int pin)
|
||||
static void ioapic_enable_pin(vir_bytes ioapic_addr, int pin)
|
||||
{
|
||||
u32_t lo = ioapic_read(ioapic_addr, IOAPIC_REDIR_TABLE + pin * 2);
|
||||
|
||||
@@ -199,7 +199,7 @@ PRIVATE void ioapic_enable_pin(vir_bytes ioapic_addr, int pin)
|
||||
ioapic_write(ioapic_addr, IOAPIC_REDIR_TABLE + pin * 2, lo);
|
||||
}
|
||||
|
||||
PRIVATE void ioapic_disable_pin(vir_bytes ioapic_addr, int pin)
|
||||
static void ioapic_disable_pin(vir_bytes ioapic_addr, int pin)
|
||||
{
|
||||
u32_t lo = ioapic_read(ioapic_addr, IOAPIC_REDIR_TABLE + pin * 2);
|
||||
|
||||
@@ -208,7 +208,7 @@ PRIVATE void ioapic_disable_pin(vir_bytes ioapic_addr, int pin)
|
||||
}
|
||||
|
||||
#if 0
|
||||
PRIVATE void ioapic_redirt_entry_read(void * ioapic_addr,
|
||||
static void ioapic_redirt_entry_read(void * ioapic_addr,
|
||||
int entry,
|
||||
u32_t *hi,
|
||||
u32_t *lo)
|
||||
@@ -219,7 +219,7 @@ PRIVATE void ioapic_redirt_entry_read(void * ioapic_addr,
|
||||
}
|
||||
#endif
|
||||
|
||||
PRIVATE void ioapic_redirt_entry_write(void * ioapic_addr,
|
||||
static void ioapic_redirt_entry_write(void * ioapic_addr,
|
||||
int entry,
|
||||
u32_t hi,
|
||||
u32_t lo)
|
||||
@@ -243,7 +243,7 @@ PRIVATE void ioapic_redirt_entry_write(void * ioapic_addr,
|
||||
|
||||
#define lapic_test_delivery_val(val, vector) ((val) & (1 << ((vector) & 0x1f)))
|
||||
|
||||
PRIVATE void ioapic_eoi_level(struct irq * irq)
|
||||
static void ioapic_eoi_level(struct irq * irq)
|
||||
{
|
||||
reg_t tmr;
|
||||
|
||||
@@ -285,12 +285,12 @@ PRIVATE void ioapic_eoi_level(struct irq * irq)
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE void ioapic_eoi_edge(__unused struct irq * irq)
|
||||
static void ioapic_eoi_edge(__unused struct irq * irq)
|
||||
{
|
||||
apic_eoi();
|
||||
}
|
||||
|
||||
PUBLIC void ioapic_eoi(int irq)
|
||||
void ioapic_eoi(int irq)
|
||||
{
|
||||
if (ioapic_enabled) {
|
||||
io_apic_irq[irq].eoi(&io_apic_irq[irq]);
|
||||
@@ -299,12 +299,12 @@ PUBLIC void ioapic_eoi(int irq)
|
||||
irq_8259_eoi(irq);
|
||||
}
|
||||
|
||||
PUBLIC void ioapic_set_id(u32_t addr, unsigned int id)
|
||||
void ioapic_set_id(u32_t addr, unsigned int id)
|
||||
{
|
||||
ioapic_write(addr, IOAPIC_ID, id << 24);
|
||||
}
|
||||
|
||||
PUBLIC int ioapic_enable_all(void)
|
||||
int ioapic_enable_all(void)
|
||||
{
|
||||
i8259_disable();
|
||||
|
||||
@@ -318,7 +318,7 @@ PUBLIC int ioapic_enable_all(void)
|
||||
}
|
||||
|
||||
/* disables a single IO APIC */
|
||||
PRIVATE void ioapic_disable(struct io_apic * ioapic)
|
||||
static void ioapic_disable(struct io_apic * ioapic)
|
||||
{
|
||||
unsigned p;
|
||||
|
||||
@@ -340,7 +340,7 @@ PRIVATE void ioapic_disable(struct io_apic * ioapic)
|
||||
}
|
||||
|
||||
/* disables all IO APICs */
|
||||
PUBLIC void ioapic_disable_all(void)
|
||||
void ioapic_disable_all(void)
|
||||
{
|
||||
unsigned ioa;
|
||||
if (!ioapic_enabled)
|
||||
@@ -365,7 +365,7 @@ PUBLIC void ioapic_disable_all(void)
|
||||
intr_init(INTS_ORIG, 0); /* no auto eoi */
|
||||
}
|
||||
|
||||
PRIVATE void ioapic_disable_irq(unsigned irq)
|
||||
static void ioapic_disable_irq(unsigned irq)
|
||||
{
|
||||
assert(io_apic_irq[irq].ioa);
|
||||
|
||||
@@ -373,7 +373,7 @@ PRIVATE void ioapic_disable_irq(unsigned irq)
|
||||
io_apic_irq[irq].state |= IOAPIC_IRQ_STATE_MASKED;
|
||||
}
|
||||
|
||||
PRIVATE void ioapic_enable_irq(unsigned irq)
|
||||
static void ioapic_enable_irq(unsigned irq)
|
||||
{
|
||||
assert(io_apic_irq[irq].ioa);
|
||||
|
||||
@@ -381,7 +381,7 @@ PRIVATE void ioapic_enable_irq(unsigned irq)
|
||||
io_apic_irq[irq].state &= ~IOAPIC_IRQ_STATE_MASKED;
|
||||
}
|
||||
|
||||
PUBLIC void ioapic_unmask_irq(unsigned irq)
|
||||
void ioapic_unmask_irq(unsigned irq)
|
||||
{
|
||||
if (ioapic_enabled)
|
||||
ioapic_enable_irq(irq);
|
||||
@@ -390,7 +390,7 @@ PUBLIC void ioapic_unmask_irq(unsigned irq)
|
||||
irq_8259_unmask(irq);
|
||||
}
|
||||
|
||||
PUBLIC void ioapic_mask_irq(unsigned irq)
|
||||
void ioapic_mask_irq(unsigned irq)
|
||||
{
|
||||
if (ioapic_enabled)
|
||||
ioapic_disable_irq(irq);
|
||||
@@ -399,12 +399,12 @@ PUBLIC void ioapic_mask_irq(unsigned irq)
|
||||
irq_8259_mask(irq);
|
||||
}
|
||||
|
||||
PUBLIC unsigned int apicid(void)
|
||||
unsigned int apicid(void)
|
||||
{
|
||||
return lapic_read(LAPIC_ID) >> 24;
|
||||
}
|
||||
|
||||
PRIVATE int calib_clk_handler(irq_hook_t * UNUSED(hook))
|
||||
static int calib_clk_handler(irq_hook_t * UNUSED(hook))
|
||||
{
|
||||
u32_t tcrt;
|
||||
u64_t tsc;
|
||||
@@ -428,7 +428,7 @@ PRIVATE int calib_clk_handler(irq_hook_t * UNUSED(hook))
|
||||
return 1;
|
||||
}
|
||||
|
||||
PRIVATE int spurious_irq_handler(irq_hook_t * UNUSED(hook))
|
||||
static int spurious_irq_handler(irq_hook_t * UNUSED(hook))
|
||||
{
|
||||
/*
|
||||
* Do nothing, only unlock the kernel so we do not deadlock!
|
||||
@@ -437,7 +437,7 @@ PRIVATE int spurious_irq_handler(irq_hook_t * UNUSED(hook))
|
||||
return 1;
|
||||
}
|
||||
|
||||
PRIVATE void apic_calibrate_clocks(unsigned cpu)
|
||||
static void apic_calibrate_clocks(unsigned cpu)
|
||||
{
|
||||
u32_t lvtt, val, lapic_delta;
|
||||
u64_t tsc_delta;
|
||||
@@ -520,7 +520,7 @@ PRIVATE void apic_calibrate_clocks(unsigned cpu)
|
||||
BOOT_VERBOSE(cpu_print_freq(cpuid));
|
||||
}
|
||||
|
||||
PUBLIC void lapic_set_timer_one_shot(const u32_t usec)
|
||||
void lapic_set_timer_one_shot(const u32_t usec)
|
||||
{
|
||||
/* sleep in micro seconds */
|
||||
u32_t lvtt;
|
||||
@@ -539,7 +539,7 @@ PUBLIC void lapic_set_timer_one_shot(const u32_t usec)
|
||||
lapic_write(LAPIC_LVTTR, lvtt);
|
||||
}
|
||||
|
||||
PUBLIC void lapic_set_timer_periodic(const unsigned freq)
|
||||
void lapic_set_timer_periodic(const unsigned freq)
|
||||
{
|
||||
/* sleep in micro seconds */
|
||||
u32_t lvtt;
|
||||
@@ -558,7 +558,7 @@ PUBLIC void lapic_set_timer_periodic(const unsigned freq)
|
||||
lapic_write(LAPIC_TIMER_ICR, lapic_ticks_per_clock_tick);
|
||||
}
|
||||
|
||||
PUBLIC void lapic_stop_timer(void)
|
||||
void lapic_stop_timer(void)
|
||||
{
|
||||
u32_t lvtt;
|
||||
lvtt = lapic_read(LAPIC_LVTTR);
|
||||
@@ -568,27 +568,27 @@ PUBLIC void lapic_stop_timer(void)
|
||||
lapic_write(LAPIC_TIMER_CCR, 0);
|
||||
}
|
||||
|
||||
PUBLIC void lapic_restart_timer(void)
|
||||
void lapic_restart_timer(void)
|
||||
{
|
||||
/* restart the timer only if the counter reached zero, i.e. expired */
|
||||
if (lapic_read(LAPIC_TIMER_CCR) == 0)
|
||||
lapic_set_timer_one_shot(1000000/system_hz);
|
||||
}
|
||||
|
||||
PUBLIC void lapic_microsec_sleep(unsigned count)
|
||||
void lapic_microsec_sleep(unsigned count)
|
||||
{
|
||||
lapic_set_timer_one_shot(count);
|
||||
while (lapic_read(LAPIC_TIMER_CCR))
|
||||
arch_pause();
|
||||
}
|
||||
|
||||
PRIVATE u32_t lapic_errstatus(void)
|
||||
static u32_t lapic_errstatus(void)
|
||||
{
|
||||
lapic_write(LAPIC_ESR, 0);
|
||||
return lapic_read(LAPIC_ESR);
|
||||
}
|
||||
|
||||
PRIVATE int lapic_disable_in_msr(void)
|
||||
static int lapic_disable_in_msr(void)
|
||||
{
|
||||
u32_t msr_hi, msr_lo;
|
||||
|
||||
@@ -600,7 +600,7 @@ PRIVATE int lapic_disable_in_msr(void)
|
||||
return 1;
|
||||
}
|
||||
|
||||
PUBLIC void lapic_disable(void)
|
||||
void lapic_disable(void)
|
||||
{
|
||||
/* Disable current APIC and close interrupts from PIC */
|
||||
u32_t val;
|
||||
@@ -635,7 +635,7 @@ PUBLIC void lapic_disable(void)
|
||||
lapic_disable_in_msr();
|
||||
}
|
||||
|
||||
PRIVATE int lapic_enable_in_msr(void)
|
||||
static int lapic_enable_in_msr(void)
|
||||
{
|
||||
u32_t msr_hi, msr_lo;
|
||||
|
||||
@@ -664,7 +664,7 @@ PRIVATE int lapic_enable_in_msr(void)
|
||||
return 1;
|
||||
}
|
||||
|
||||
PUBLIC int lapic_enable(unsigned cpu)
|
||||
int lapic_enable(unsigned cpu)
|
||||
{
|
||||
u32_t val, nlvt;
|
||||
|
||||
@@ -735,7 +735,7 @@ PUBLIC int lapic_enable(unsigned cpu)
|
||||
return 1;
|
||||
}
|
||||
|
||||
PUBLIC void apic_spurios_intr_handler(void)
|
||||
void apic_spurios_intr_handler(void)
|
||||
{
|
||||
static unsigned x;
|
||||
|
||||
@@ -744,7 +744,7 @@ PUBLIC void apic_spurios_intr_handler(void)
|
||||
printf("WARNING spurious interrupt(s) %d on cpu %d\n", x, cpuid);
|
||||
}
|
||||
|
||||
PUBLIC void apic_error_intr_handler(void)
|
||||
void apic_error_intr_handler(void)
|
||||
{
|
||||
static unsigned x;
|
||||
|
||||
@@ -754,7 +754,7 @@ PUBLIC void apic_error_intr_handler(void)
|
||||
lapic_errstatus(), x, cpuid);
|
||||
}
|
||||
|
||||
PRIVATE struct gate_table_s gate_table_ioapic[] = {
|
||||
static struct gate_table_s gate_table_ioapic[] = {
|
||||
{ apic_hwint0, LAPIC_VECTOR( 0), INTR_PRIVILEGE },
|
||||
{ apic_hwint1, LAPIC_VECTOR( 1), INTR_PRIVILEGE },
|
||||
{ apic_hwint2, LAPIC_VECTOR( 2), INTR_PRIVILEGE },
|
||||
@@ -824,14 +824,14 @@ PRIVATE struct gate_table_s gate_table_ioapic[] = {
|
||||
{ NULL, 0, 0}
|
||||
};
|
||||
|
||||
PRIVATE struct gate_table_s gate_table_common[] = {
|
||||
static struct gate_table_s gate_table_common[] = {
|
||||
{ ipc_entry, IPC_VECTOR, USER_PRIVILEGE },
|
||||
{ kernel_call_entry, KERN_CALL_VECTOR, USER_PRIVILEGE },
|
||||
{ NULL, 0, 0}
|
||||
};
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
PRIVATE struct gate_table_s gate_table_smp[] = {
|
||||
static struct gate_table_s gate_table_smp[] = {
|
||||
{ apic_ipi_sched_intr, APIC_SMP_SCHED_PROC_VECTOR, INTR_PRIVILEGE },
|
||||
{ apic_ipi_halt_intr, APIC_SMP_CPU_HALT_VECTOR, INTR_PRIVILEGE },
|
||||
{ NULL, 0, 0}
|
||||
@@ -839,7 +839,7 @@ PRIVATE struct gate_table_s gate_table_smp[] = {
|
||||
#endif
|
||||
|
||||
#ifdef APIC_DEBUG
|
||||
PRIVATE void lapic_set_dummy_handlers(void)
|
||||
static void lapic_set_dummy_handlers(void)
|
||||
{
|
||||
char * handler;
|
||||
int vect = 32; /* skip the reserved vectors */
|
||||
@@ -856,7 +856,7 @@ PRIVATE void lapic_set_dummy_handlers(void)
|
||||
#endif
|
||||
|
||||
/* Build descriptors for interrupt gates in IDT. */
|
||||
PUBLIC void apic_idt_init(const int reset)
|
||||
void apic_idt_init(const int reset)
|
||||
{
|
||||
u32_t val;
|
||||
|
||||
@@ -905,7 +905,7 @@ PUBLIC void apic_idt_init(const int reset)
|
||||
|
||||
}
|
||||
|
||||
PRIVATE int acpi_get_ioapics(struct io_apic * ioa, unsigned * nioa, unsigned max)
|
||||
static int acpi_get_ioapics(struct io_apic * ioa, unsigned * nioa, unsigned max)
|
||||
{
|
||||
unsigned n = 0;
|
||||
struct acpi_madt_ioapic * acpi_ioa;
|
||||
@@ -932,7 +932,7 @@ PRIVATE int acpi_get_ioapics(struct io_apic * ioa, unsigned * nioa, unsigned max
|
||||
return n;
|
||||
}
|
||||
|
||||
PUBLIC int detect_ioapics(void)
|
||||
int detect_ioapics(void)
|
||||
{
|
||||
int status;
|
||||
|
||||
@@ -948,7 +948,7 @@ PUBLIC int detect_ioapics(void)
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
|
||||
PUBLIC void apic_send_ipi(unsigned vector, unsigned cpu, int type)
|
||||
void apic_send_ipi(unsigned vector, unsigned cpu, int type)
|
||||
{
|
||||
u32_t icr1, icr2;
|
||||
|
||||
@@ -987,7 +987,7 @@ PUBLIC void apic_send_ipi(unsigned vector, unsigned cpu, int type)
|
||||
|
||||
}
|
||||
|
||||
PUBLIC int apic_send_startup_ipi(unsigned cpu, phys_bytes trampoline)
|
||||
int apic_send_startup_ipi(unsigned cpu, phys_bytes trampoline)
|
||||
{
|
||||
int timeout;
|
||||
u32_t errstatus = 0;
|
||||
@@ -1033,7 +1033,7 @@ PUBLIC int apic_send_startup_ipi(unsigned cpu, phys_bytes trampoline)
|
||||
return 0;
|
||||
}
|
||||
|
||||
PUBLIC int apic_send_init_ipi(unsigned cpu, phys_bytes trampoline)
|
||||
int apic_send_init_ipi(unsigned cpu, phys_bytes trampoline)
|
||||
{
|
||||
u32_t ptr, errstatus = 0;
|
||||
int timeout;
|
||||
@@ -1108,7 +1108,7 @@ PUBLIC int apic_send_init_ipi(unsigned cpu, phys_bytes trampoline)
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_SMP
|
||||
PUBLIC int apic_single_cpu_init(void)
|
||||
int apic_single_cpu_init(void)
|
||||
{
|
||||
if (!cpu_feature_apic_on_chip())
|
||||
return 0;
|
||||
@@ -1143,7 +1143,7 @@ PUBLIC int apic_single_cpu_init(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
PRIVATE eoi_method_t set_eoi_method(unsigned irq)
|
||||
static eoi_method_t set_eoi_method(unsigned irq)
|
||||
{
|
||||
/*
|
||||
* in APIC mode the lowest 16 IRQs are reserved for legacy (E)ISA edge
|
||||
@@ -1156,7 +1156,7 @@ PRIVATE eoi_method_t set_eoi_method(unsigned irq)
|
||||
return ioapic_eoi_level;
|
||||
}
|
||||
|
||||
PUBLIC void set_irq_redir_low(unsigned irq, u32_t * low)
|
||||
void set_irq_redir_low(unsigned irq, u32_t * low)
|
||||
{
|
||||
u32_t val = 0;
|
||||
|
||||
@@ -1182,7 +1182,7 @@ PUBLIC void set_irq_redir_low(unsigned irq, u32_t * low)
|
||||
*low = val;
|
||||
}
|
||||
|
||||
PUBLIC void ioapic_set_irq(unsigned irq)
|
||||
void ioapic_set_irq(unsigned irq)
|
||||
{
|
||||
unsigned ioa;
|
||||
|
||||
@@ -1216,7 +1216,7 @@ PUBLIC void ioapic_set_irq(unsigned irq)
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC void ioapic_unset_irq(unsigned irq)
|
||||
void ioapic_unset_irq(unsigned irq)
|
||||
{
|
||||
assert(irq < NR_IRQ_VECTORS);
|
||||
|
||||
@@ -1225,7 +1225,7 @@ PUBLIC void ioapic_unset_irq(unsigned irq)
|
||||
io_apic_irq[irq].eoi = NULL;
|
||||
}
|
||||
|
||||
PUBLIC void ioapic_reset_pic(void)
|
||||
void ioapic_reset_pic(void)
|
||||
{
|
||||
apic_idt_init(TRUE); /* reset */
|
||||
idt_reload();
|
||||
@@ -1238,7 +1238,7 @@ PUBLIC void ioapic_reset_pic(void)
|
||||
intr_init(INTS_ORIG, 0); /* no auto eoi */
|
||||
}
|
||||
|
||||
PRIVATE void irq_lapic_status(int irq)
|
||||
static void irq_lapic_status(int irq)
|
||||
{
|
||||
u32_t lo;
|
||||
reg_t tmr, irr, isr;
|
||||
@@ -1280,7 +1280,7 @@ PRIVATE void irq_lapic_status(int irq)
|
||||
"masked" : "unmasked");
|
||||
}
|
||||
|
||||
PUBLIC void dump_apic_irq_state(void)
|
||||
void dump_apic_irq_state(void)
|
||||
{
|
||||
int irq;
|
||||
|
||||
|
||||
@@ -34,18 +34,18 @@
|
||||
#define TIMER_FREQ 1193182 /* clock frequency for timer in PC and AT */
|
||||
#define TIMER_COUNT(freq) (TIMER_FREQ/(freq)) /* initial value for counter*/
|
||||
|
||||
PRIVATE irq_hook_t pic_timer_hook; /* interrupt handler hook */
|
||||
static irq_hook_t pic_timer_hook; /* interrupt handler hook */
|
||||
|
||||
PRIVATE unsigned probe_ticks;
|
||||
PRIVATE u64_t tsc0, tsc1;
|
||||
static unsigned probe_ticks;
|
||||
static u64_t tsc0, tsc1;
|
||||
#define PROBE_TICKS (system_hz / 10)
|
||||
|
||||
PRIVATE unsigned tsc_per_ms[CONFIG_MAX_CPUS];
|
||||
static unsigned tsc_per_ms[CONFIG_MAX_CPUS];
|
||||
|
||||
/*===========================================================================*
|
||||
* init_8235A_timer *
|
||||
*===========================================================================*/
|
||||
PUBLIC int init_8253A_timer(const unsigned freq)
|
||||
int init_8253A_timer(const unsigned freq)
|
||||
{
|
||||
/* Initialize channel 0 of the 8253A timer to, e.g., 60 Hz,
|
||||
* and register the CLOCK task's interrupt handler to be run
|
||||
@@ -61,7 +61,7 @@ PUBLIC int init_8253A_timer(const unsigned freq)
|
||||
/*===========================================================================*
|
||||
* stop_8235A_timer *
|
||||
*===========================================================================*/
|
||||
PUBLIC void stop_8253A_timer(void)
|
||||
void stop_8253A_timer(void)
|
||||
{
|
||||
/* Reset the clock to the BIOS rate. (For rebooting.) */
|
||||
outb(TIMER_MODE, 0x36);
|
||||
@@ -69,7 +69,7 @@ PUBLIC void stop_8253A_timer(void)
|
||||
outb(TIMER0, 0);
|
||||
}
|
||||
|
||||
PRIVATE int calib_cpu_handler(irq_hook_t * UNUSED(hook))
|
||||
static int calib_cpu_handler(irq_hook_t * UNUSED(hook))
|
||||
{
|
||||
u64_t tsc;
|
||||
|
||||
@@ -89,7 +89,7 @@ PRIVATE int calib_cpu_handler(irq_hook_t * UNUSED(hook))
|
||||
return 1;
|
||||
}
|
||||
|
||||
PRIVATE void estimate_cpu_freq(void)
|
||||
static void estimate_cpu_freq(void)
|
||||
{
|
||||
u64_t tsc_delta;
|
||||
u64_t cpu_freq;
|
||||
@@ -124,7 +124,7 @@ PRIVATE void estimate_cpu_freq(void)
|
||||
BOOT_VERBOSE(cpu_print_freq(cpuid));
|
||||
}
|
||||
|
||||
PUBLIC int init_local_timer(unsigned freq)
|
||||
int init_local_timer(unsigned freq)
|
||||
{
|
||||
#ifdef USE_APIC
|
||||
/* if we know the address, lapic is enabled and we should use it */
|
||||
@@ -147,7 +147,7 @@ PUBLIC int init_local_timer(unsigned freq)
|
||||
return 0;
|
||||
}
|
||||
|
||||
PUBLIC void stop_local_timer(void)
|
||||
void stop_local_timer(void)
|
||||
{
|
||||
#ifdef USE_APIC
|
||||
if (lapic_addr) {
|
||||
@@ -160,7 +160,7 @@ PUBLIC void stop_local_timer(void)
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC void restart_local_timer(void)
|
||||
void restart_local_timer(void)
|
||||
{
|
||||
#ifdef USE_APIC
|
||||
if (lapic_addr) {
|
||||
@@ -169,7 +169,7 @@ PUBLIC void restart_local_timer(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
PUBLIC int register_local_timer_handler(const irq_handler_t handler)
|
||||
int register_local_timer_handler(const irq_handler_t handler)
|
||||
{
|
||||
#ifdef USE_APIC
|
||||
if (lapic_addr) {
|
||||
@@ -188,7 +188,7 @@ PUBLIC int register_local_timer_handler(const irq_handler_t handler)
|
||||
return 0;
|
||||
}
|
||||
|
||||
PUBLIC void cycles_accounting_init(void)
|
||||
void cycles_accounting_init(void)
|
||||
{
|
||||
#ifdef CONFIG_SMP
|
||||
unsigned cpu = cpuid;
|
||||
@@ -200,7 +200,7 @@ PUBLIC void cycles_accounting_init(void)
|
||||
make_zero64(get_cpu_var(cpu, cpu_last_idle));
|
||||
}
|
||||
|
||||
PUBLIC void context_stop(struct proc * p)
|
||||
void context_stop(struct proc * p)
|
||||
{
|
||||
u64_t tsc, tsc_delta;
|
||||
u64_t * __tsc_ctr_switch = get_cpulocal_var_ptr(tsc_ctr_switch);
|
||||
@@ -297,7 +297,7 @@ PUBLIC void context_stop(struct proc * p)
|
||||
*__tsc_ctr_switch = tsc;
|
||||
}
|
||||
|
||||
PUBLIC void context_stop_idle(void)
|
||||
void context_stop_idle(void)
|
||||
{
|
||||
int is_idle;
|
||||
#ifdef CONFIG_SMP
|
||||
@@ -317,17 +317,17 @@ PUBLIC void context_stop_idle(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
PUBLIC u64_t ms_2_cpu_time(unsigned ms)
|
||||
u64_t ms_2_cpu_time(unsigned ms)
|
||||
{
|
||||
return mul64u(tsc_per_ms[cpuid], ms);
|
||||
}
|
||||
|
||||
PUBLIC unsigned cpu_time_2_ms(u64_t cpu_time)
|
||||
unsigned cpu_time_2_ms(u64_t cpu_time)
|
||||
{
|
||||
return div64u(cpu_time, tsc_per_ms[cpuid]);
|
||||
}
|
||||
|
||||
PUBLIC short cpu_load(void)
|
||||
short cpu_load(void)
|
||||
{
|
||||
u64_t current_tsc, *current_idle;
|
||||
u64_t tsc_delta, idle_delta, busy;
|
||||
@@ -365,7 +365,7 @@ PUBLIC short cpu_load(void)
|
||||
return load;
|
||||
}
|
||||
|
||||
PUBLIC void busy_delay_ms(int ms)
|
||||
void busy_delay_ms(int ms)
|
||||
{
|
||||
u64_t cycles = ms_2_cpu_time(ms), tsc0, tsc, tsc1;
|
||||
read_tsc_64(&tsc0);
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
/*===========================================================================*
|
||||
* arch_do_vmctl *
|
||||
*===========================================================================*/
|
||||
PUBLIC int arch_do_vmctl(m_ptr, p)
|
||||
int arch_do_vmctl(m_ptr, p)
|
||||
register message *m_ptr; /* pointer to request message */
|
||||
struct proc *p;
|
||||
{
|
||||
|
||||
@@ -42,18 +42,18 @@ static int volatile ap_cpu_ready;
|
||||
static int volatile cpu_down;
|
||||
|
||||
/* there can be at most 255 local APIC ids, each fits in 8 bits */
|
||||
PRIVATE unsigned char apicid2cpuid[255];
|
||||
PUBLIC unsigned char cpuid2apicid[CONFIG_MAX_CPUS];
|
||||
static unsigned char apicid2cpuid[255];
|
||||
unsigned char cpuid2apicid[CONFIG_MAX_CPUS];
|
||||
|
||||
SPINLOCK_DEFINE(smp_cpu_lock)
|
||||
SPINLOCK_DEFINE(dispq_lock)
|
||||
|
||||
FORWARD void smp_reinit_vars(void);
|
||||
static void smp_reinit_vars(void);
|
||||
|
||||
/*
|
||||
* copies the 16-bit AP trampoline code to the first 1M of memory
|
||||
*/
|
||||
PRIVATE phys_bytes copy_trampoline(void)
|
||||
static phys_bytes copy_trampoline(void)
|
||||
{
|
||||
char * s, *end;
|
||||
phys_bytes tramp_base = 0;
|
||||
@@ -93,7 +93,7 @@ PRIVATE phys_bytes copy_trampoline(void)
|
||||
return tramp_base;
|
||||
}
|
||||
|
||||
PRIVATE void smp_start_aps(void)
|
||||
static void smp_start_aps(void)
|
||||
{
|
||||
/*
|
||||
* Find an address and align it to a 4k boundary.
|
||||
@@ -167,12 +167,12 @@ PRIVATE void smp_start_aps(void)
|
||||
NOT_REACHABLE;
|
||||
}
|
||||
|
||||
PUBLIC void smp_halt_cpu (void)
|
||||
void smp_halt_cpu (void)
|
||||
{
|
||||
NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
PUBLIC void smp_shutdown_aps(void)
|
||||
void smp_shutdown_aps(void)
|
||||
{
|
||||
unsigned cpu;
|
||||
|
||||
@@ -209,7 +209,7 @@ exit_shutdown_aps:
|
||||
return;
|
||||
}
|
||||
|
||||
PRIVATE void ap_finish_booting(void)
|
||||
static void ap_finish_booting(void)
|
||||
{
|
||||
unsigned cpu = cpuid;
|
||||
|
||||
@@ -257,13 +257,13 @@ PRIVATE void ap_finish_booting(void)
|
||||
NOT_REACHABLE;
|
||||
}
|
||||
|
||||
PUBLIC void smp_ap_boot(void)
|
||||
void smp_ap_boot(void)
|
||||
{
|
||||
switch_k_stack((char *)get_k_stack_top(__ap_id) -
|
||||
X86_STACK_TOP_RESERVED, ap_finish_booting);
|
||||
}
|
||||
|
||||
PRIVATE void smp_reinit_vars(void)
|
||||
static void smp_reinit_vars(void)
|
||||
{
|
||||
lapic_addr = lapic_eoi_addr = 0;
|
||||
ioapic_enabled = 0;
|
||||
@@ -271,7 +271,7 @@ PRIVATE void smp_reinit_vars(void)
|
||||
ncpus = 1;
|
||||
}
|
||||
|
||||
PRIVATE void tss_init_all(void)
|
||||
static void tss_init_all(void)
|
||||
{
|
||||
unsigned cpu;
|
||||
|
||||
@@ -279,7 +279,7 @@ PRIVATE void tss_init_all(void)
|
||||
tss_init(cpu, get_k_stack_top(cpu));
|
||||
}
|
||||
|
||||
PRIVATE int discover_cpus(void)
|
||||
static int discover_cpus(void)
|
||||
{
|
||||
struct acpi_madt_lapic * cpu;
|
||||
|
||||
@@ -293,7 +293,7 @@ PRIVATE int discover_cpus(void)
|
||||
return ncpus;
|
||||
}
|
||||
|
||||
PUBLIC void smp_init (void)
|
||||
void smp_init (void)
|
||||
{
|
||||
/* read the MP configuration */
|
||||
if (!discover_cpus()) {
|
||||
@@ -351,7 +351,7 @@ uniproc_fallback:
|
||||
printf("WARNING : SMP initialization failed\n");
|
||||
}
|
||||
|
||||
PUBLIC void arch_smp_halt_cpu(void)
|
||||
void arch_smp_halt_cpu(void)
|
||||
{
|
||||
/* say that we are down */
|
||||
cpu_down = cpuid;
|
||||
@@ -361,7 +361,7 @@ PUBLIC void arch_smp_halt_cpu(void)
|
||||
for(;;);
|
||||
}
|
||||
|
||||
PUBLIC void arch_send_smp_schedule_ipi(unsigned cpu)
|
||||
void arch_send_smp_schedule_ipi(unsigned cpu)
|
||||
{
|
||||
apic_send_ipi(APIC_SMP_SCHED_PROC_VECTOR, cpu, APIC_IPI_DEST);
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include "acpi.h"
|
||||
#endif
|
||||
|
||||
PRIVATE int osfxsr_feature; /* FXSAVE/FXRSTOR instructions support (SSEx) */
|
||||
static int osfxsr_feature; /* FXSAVE/FXRSTOR instructions support (SSEx) */
|
||||
|
||||
extern __dead void poweroff_jmp();
|
||||
extern void poweroff16();
|
||||
@@ -47,17 +47,17 @@ extern void poweroff16_end();
|
||||
/* set OSXMMEXCPT[bit 10] if we provide #XM handler. */
|
||||
#define CR4_OSXMMEXCPT (1L<<10)
|
||||
|
||||
PUBLIC void * k_stacks;
|
||||
void * k_stacks;
|
||||
|
||||
FORWARD void ser_debug(int c);
|
||||
static void ser_debug(int c);
|
||||
#ifdef CONFIG_SMP
|
||||
FORWARD void ser_dump_proc_cpu(void);
|
||||
static void ser_dump_proc_cpu(void);
|
||||
#endif
|
||||
#if !CONFIG_OXPCIE
|
||||
FORWARD void ser_init(void);
|
||||
static void ser_init(void);
|
||||
#endif
|
||||
|
||||
PUBLIC __dead void arch_monitor(void)
|
||||
__dead void arch_monitor(void)
|
||||
{
|
||||
monitor();
|
||||
}
|
||||
@@ -118,7 +118,7 @@ reset(void)
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE __dead void arch_bios_poweroff(void)
|
||||
static __dead void arch_bios_poweroff(void)
|
||||
{
|
||||
u32_t cr0;
|
||||
|
||||
@@ -134,9 +134,9 @@ PRIVATE __dead void arch_bios_poweroff(void)
|
||||
poweroff_jmp();
|
||||
}
|
||||
|
||||
PUBLIC int cpu_has_tsc;
|
||||
int cpu_has_tsc;
|
||||
|
||||
PUBLIC __dead void arch_shutdown(int how)
|
||||
__dead void arch_shutdown(int how)
|
||||
{
|
||||
u16_t magic;
|
||||
vm_stop();
|
||||
@@ -236,7 +236,7 @@ PUBLIC __dead void arch_shutdown(int how)
|
||||
NOT_REACHABLE;
|
||||
}
|
||||
|
||||
PUBLIC void fpu_init(void)
|
||||
void fpu_init(void)
|
||||
{
|
||||
unsigned short cw, sw;
|
||||
|
||||
@@ -273,7 +273,7 @@ PUBLIC void fpu_init(void)
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC void save_local_fpu(struct proc *pr, int retain)
|
||||
void save_local_fpu(struct proc *pr, int retain)
|
||||
{
|
||||
/* Save process FPU context. If the 'retain' flag is set, keep the FPU
|
||||
* state as is. If the flag is not set, the state is undefined upon
|
||||
@@ -292,7 +292,7 @@ PUBLIC void save_local_fpu(struct proc *pr, int retain)
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC void save_fpu(struct proc *pr)
|
||||
void save_fpu(struct proc *pr)
|
||||
{
|
||||
#ifdef CONFIG_SMP
|
||||
if (cpuid != pr->p_cpu) {
|
||||
@@ -322,7 +322,7 @@ PUBLIC void save_fpu(struct proc *pr)
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC int restore_fpu(struct proc *pr)
|
||||
int restore_fpu(struct proc *pr)
|
||||
{
|
||||
int failed;
|
||||
|
||||
@@ -342,7 +342,7 @@ PUBLIC int restore_fpu(struct proc *pr)
|
||||
return OK;
|
||||
}
|
||||
|
||||
PUBLIC void cpu_identify(void)
|
||||
void cpu_identify(void)
|
||||
{
|
||||
u32_t eax, ebx, ecx, edx;
|
||||
unsigned cpu = cpuid;
|
||||
@@ -376,7 +376,7 @@ PUBLIC void cpu_identify(void)
|
||||
cpu_info[cpu].flags[1] = edx;
|
||||
}
|
||||
|
||||
PUBLIC void arch_init(void)
|
||||
void arch_init(void)
|
||||
{
|
||||
#ifdef USE_APIC
|
||||
/*
|
||||
@@ -424,7 +424,7 @@ PUBLIC void arch_init(void)
|
||||
}
|
||||
|
||||
#ifdef DEBUG_SERIAL
|
||||
PUBLIC void ser_putc(char c)
|
||||
void ser_putc(char c)
|
||||
{
|
||||
int i;
|
||||
int lsr, thr;
|
||||
@@ -447,7 +447,7 @@ PUBLIC void ser_putc(char c)
|
||||
/*===========================================================================*
|
||||
* do_ser_debug *
|
||||
*===========================================================================*/
|
||||
PUBLIC void do_ser_debug()
|
||||
void do_ser_debug()
|
||||
{
|
||||
u8_t c, lsr;
|
||||
|
||||
@@ -466,7 +466,7 @@ PUBLIC void do_ser_debug()
|
||||
ser_debug(c);
|
||||
}
|
||||
|
||||
PRIVATE void ser_dump_queue_cpu(unsigned cpu)
|
||||
static void ser_dump_queue_cpu(unsigned cpu)
|
||||
{
|
||||
int q;
|
||||
struct proc ** rdy_head;
|
||||
@@ -485,7 +485,7 @@ PRIVATE void ser_dump_queue_cpu(unsigned cpu)
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE void ser_dump_queues(void)
|
||||
static void ser_dump_queues(void)
|
||||
{
|
||||
#ifdef CONFIG_SMP
|
||||
unsigned cpu;
|
||||
@@ -500,7 +500,7 @@ PRIVATE void ser_dump_queues(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
PRIVATE void ser_dump_segs(void)
|
||||
static void ser_dump_segs(void)
|
||||
{
|
||||
struct proc *pp;
|
||||
for (pp= BEG_PROC_ADDR; pp < END_PROC_ADDR; pp++)
|
||||
@@ -517,7 +517,7 @@ PRIVATE void ser_dump_segs(void)
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
PRIVATE void dump_bkl_usage(void)
|
||||
static void dump_bkl_usage(void)
|
||||
{
|
||||
unsigned cpu;
|
||||
|
||||
@@ -532,7 +532,7 @@ PRIVATE void dump_bkl_usage(void)
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE void reset_bkl_usage(void)
|
||||
static void reset_bkl_usage(void)
|
||||
{
|
||||
memset(kernel_ticks, 0, sizeof(kernel_ticks));
|
||||
memset(bkl_ticks, 0, sizeof(bkl_ticks));
|
||||
@@ -541,7 +541,7 @@ PRIVATE void reset_bkl_usage(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
PRIVATE void ser_debug(const int c)
|
||||
static void ser_debug(const int c)
|
||||
{
|
||||
serial_debug_active = 1;
|
||||
|
||||
@@ -596,7 +596,7 @@ PRIVATE void ser_debug(const int c)
|
||||
serial_debug_active = 0;
|
||||
}
|
||||
|
||||
PUBLIC void ser_dump_proc()
|
||||
void ser_dump_proc()
|
||||
{
|
||||
struct proc *pp;
|
||||
|
||||
@@ -609,7 +609,7 @@ PUBLIC void ser_dump_proc()
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
PRIVATE void ser_dump_proc_cpu(void)
|
||||
static void ser_dump_proc_cpu(void)
|
||||
{
|
||||
struct proc *pp;
|
||||
unsigned cpu;
|
||||
@@ -629,7 +629,7 @@ PRIVATE void ser_dump_proc_cpu(void)
|
||||
|
||||
#if SPROFILE
|
||||
|
||||
PUBLIC int arch_init_profile_clock(const u32_t freq)
|
||||
int arch_init_profile_clock(const u32_t freq)
|
||||
{
|
||||
int r;
|
||||
/* Set CMOS timer frequency. */
|
||||
@@ -647,7 +647,7 @@ PUBLIC int arch_init_profile_clock(const u32_t freq)
|
||||
return CMOS_CLOCK_IRQ;
|
||||
}
|
||||
|
||||
PUBLIC void arch_stop_profile_clock(void)
|
||||
void arch_stop_profile_clock(void)
|
||||
{
|
||||
int r;
|
||||
/* Disable CMOS timer interrupts. */
|
||||
@@ -657,7 +657,7 @@ PUBLIC void arch_stop_profile_clock(void)
|
||||
outb(RTC_IO, r & ~RTC_B_PIE);
|
||||
}
|
||||
|
||||
PUBLIC void arch_ack_profile_clock(void)
|
||||
void arch_ack_profile_clock(void)
|
||||
{
|
||||
/* Mandatory read of CMOS register to re-enable timer interrupts. */
|
||||
outb(RTC_INDEX, RTC_REG_C);
|
||||
@@ -669,7 +669,7 @@ PUBLIC void arch_ack_profile_clock(void)
|
||||
/* Saved by mpx386.s into these variables. */
|
||||
u32_t params_size, params_offset, mon_ds;
|
||||
|
||||
PUBLIC int arch_get_params(char *params, int maxsize)
|
||||
int arch_get_params(char *params, int maxsize)
|
||||
{
|
||||
phys_copy(seg2phys(mon_ds) + params_offset, vir2phys(params),
|
||||
MIN(maxsize, params_size));
|
||||
@@ -677,7 +677,7 @@ PUBLIC int arch_get_params(char *params, int maxsize)
|
||||
return OK;
|
||||
}
|
||||
|
||||
PUBLIC int arch_set_params(char *params, int size)
|
||||
int arch_set_params(char *params, int size)
|
||||
{
|
||||
if(size > params_size)
|
||||
return E2BIG;
|
||||
@@ -685,7 +685,7 @@ PUBLIC int arch_set_params(char *params, int size)
|
||||
return OK;
|
||||
}
|
||||
|
||||
PUBLIC void arch_do_syscall(struct proc *proc)
|
||||
void arch_do_syscall(struct proc *proc)
|
||||
{
|
||||
/* do_ipc assumes that it's running because of the current process */
|
||||
assert(proc == get_cpulocal_var(proc_ptr));
|
||||
@@ -694,7 +694,7 @@ PUBLIC void arch_do_syscall(struct proc *proc)
|
||||
do_ipc(proc->p_reg.cx, proc->p_reg.retreg, proc->p_reg.bx);
|
||||
}
|
||||
|
||||
PUBLIC struct proc * arch_finish_switch_to_user(void)
|
||||
struct proc * arch_finish_switch_to_user(void)
|
||||
{
|
||||
char * stk;
|
||||
struct proc * p;
|
||||
@@ -710,7 +710,7 @@ PUBLIC struct proc * arch_finish_switch_to_user(void)
|
||||
return p;
|
||||
}
|
||||
|
||||
PUBLIC void fpu_sigcontext(struct proc *pr, struct sigframe *fr, struct sigcontext *sc)
|
||||
void fpu_sigcontext(struct proc *pr, struct sigframe *fr, struct sigcontext *sc)
|
||||
{
|
||||
int fp_error;
|
||||
|
||||
@@ -744,7 +744,7 @@ PUBLIC void fpu_sigcontext(struct proc *pr, struct sigframe *fr, struct sigconte
|
||||
}
|
||||
|
||||
#if !CONFIG_OXPCIE
|
||||
PRIVATE void ser_init(void)
|
||||
static void ser_init(void)
|
||||
{
|
||||
unsigned char lcr;
|
||||
unsigned divisor;
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
* Intel architecture performance counters watchdog
|
||||
*/
|
||||
|
||||
PRIVATE struct arch_watchdog intel_arch_watchdog;
|
||||
PRIVATE struct arch_watchdog amd_watchdog;
|
||||
static struct arch_watchdog intel_arch_watchdog;
|
||||
static struct arch_watchdog amd_watchdog;
|
||||
|
||||
PRIVATE void intel_arch_watchdog_init(const unsigned cpu)
|
||||
static void intel_arch_watchdog_init(const unsigned cpu)
|
||||
{
|
||||
u64_t cpuf;
|
||||
u32_t val;
|
||||
@@ -51,13 +51,13 @@ PRIVATE void intel_arch_watchdog_init(const unsigned cpu)
|
||||
lapic_write(LAPIC_LVTPCR, APIC_ICR_DM_NMI);
|
||||
}
|
||||
|
||||
PRIVATE void intel_arch_watchdog_reinit(const unsigned cpu)
|
||||
static void intel_arch_watchdog_reinit(const unsigned cpu)
|
||||
{
|
||||
lapic_write(LAPIC_LVTPCR, APIC_ICR_DM_NMI);
|
||||
ia32_msr_write(INTEL_MSR_PERFMON_CRT0, 0, ex64lo(watchdog->resetval));
|
||||
}
|
||||
|
||||
PUBLIC int arch_watchdog_init(void)
|
||||
int arch_watchdog_init(void)
|
||||
{
|
||||
u32_t eax, ebx, ecx, edx;
|
||||
unsigned cpu = cpuid;
|
||||
@@ -105,11 +105,11 @@ PUBLIC int arch_watchdog_init(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
PUBLIC void arch_watchdog_stop(void)
|
||||
void arch_watchdog_stop(void)
|
||||
{
|
||||
}
|
||||
|
||||
PUBLIC void arch_watchdog_lockup(const struct nmi_frame * frame)
|
||||
void arch_watchdog_lockup(const struct nmi_frame * frame)
|
||||
{
|
||||
printf("KERNEL LOCK UP\n"
|
||||
"eax 0x%08x\n"
|
||||
@@ -144,7 +144,7 @@ PUBLIC void arch_watchdog_lockup(const struct nmi_frame * frame)
|
||||
panic("Kernel lockup");
|
||||
}
|
||||
|
||||
PUBLIC int i386_watchdog_start(void)
|
||||
int i386_watchdog_start(void)
|
||||
{
|
||||
if (arch_watchdog_init()) {
|
||||
printf("WARNING watchdog initialization "
|
||||
@@ -158,7 +158,7 @@ PUBLIC int i386_watchdog_start(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
PRIVATE int intel_arch_watchdog_profile_init(const unsigned freq)
|
||||
static int intel_arch_watchdog_profile_init(const unsigned freq)
|
||||
{
|
||||
u64_t cpuf;
|
||||
|
||||
@@ -181,7 +181,7 @@ PRIVATE int intel_arch_watchdog_profile_init(const unsigned freq)
|
||||
return OK;
|
||||
}
|
||||
|
||||
PRIVATE struct arch_watchdog intel_arch_watchdog = {
|
||||
static struct arch_watchdog intel_arch_watchdog = {
|
||||
/*.init = */ intel_arch_watchdog_init,
|
||||
/*.reinit = */ intel_arch_watchdog_reinit,
|
||||
/*.profile_init = */ intel_arch_watchdog_profile_init
|
||||
@@ -191,7 +191,7 @@ PRIVATE struct arch_watchdog intel_arch_watchdog = {
|
||||
#define AMD_MSR_EVENT_CTR0 0xc0010004
|
||||
#define AMD_MSR_EVENT_SEL0_ENABLE (1 << 22)
|
||||
|
||||
PRIVATE void amd_watchdog_init(const unsigned cpu)
|
||||
static void amd_watchdog_init(const unsigned cpu)
|
||||
{
|
||||
u64_t cpuf;
|
||||
u32_t val;
|
||||
@@ -216,14 +216,14 @@ PRIVATE void amd_watchdog_init(const unsigned cpu)
|
||||
lapic_write(LAPIC_LVTPCR, APIC_ICR_DM_NMI);
|
||||
}
|
||||
|
||||
PRIVATE void amd_watchdog_reinit(const unsigned cpu)
|
||||
static void amd_watchdog_reinit(const unsigned cpu)
|
||||
{
|
||||
lapic_write(LAPIC_LVTPCR, APIC_ICR_DM_NMI);
|
||||
ia32_msr_write(AMD_MSR_EVENT_CTR0,
|
||||
ex64hi(watchdog->resetval), ex64lo(watchdog->resetval));
|
||||
}
|
||||
|
||||
PRIVATE int amd_watchdog_profile_init(const unsigned freq)
|
||||
static int amd_watchdog_profile_init(const unsigned freq)
|
||||
{
|
||||
u64_t cpuf;
|
||||
|
||||
@@ -237,7 +237,7 @@ PRIVATE int amd_watchdog_profile_init(const unsigned freq)
|
||||
return OK;
|
||||
}
|
||||
|
||||
PRIVATE struct arch_watchdog amd_watchdog = {
|
||||
static struct arch_watchdog amd_watchdog = {
|
||||
/*.init = */ amd_watchdog_init,
|
||||
/*.reinit = */ amd_watchdog_reinit,
|
||||
/*.profile_init = */ amd_watchdog_profile_init
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "debugreg.h"
|
||||
|
||||
PUBLIC int breakpoint_set(phys_bytes linaddr, int bp, const int flags)
|
||||
int breakpoint_set(phys_bytes linaddr, int bp, const int flags)
|
||||
{
|
||||
unsigned long dr7, dr7flags;
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ struct reg86u reg86;
|
||||
/*===========================================================================*
|
||||
* do_int86 *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_int86(struct proc * caller, message * m_ptr)
|
||||
int do_int86(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
data_copy(caller->p_endpoint, (vir_bytes) m_ptr->INT86_REG86,
|
||||
KERNEL, (vir_bytes) ®86, sizeof(reg86));
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
/*===========================================================================*
|
||||
* do_iopenable *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_iopenable(struct proc * caller, message * m_ptr)
|
||||
int do_iopenable(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
int proc_nr;
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
/*===========================================================================*
|
||||
* do_readbios *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_readbios(struct proc * caller, message * m_ptr)
|
||||
int do_readbios(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
struct vir_addr src, dst;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
/*===========================================================================*
|
||||
* do_sdevio *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_sdevio(struct proc * caller, message *m_ptr)
|
||||
int do_sdevio(struct proc * caller, message *m_ptr)
|
||||
{
|
||||
vir_bytes newoffset;
|
||||
endpoint_t newep;
|
||||
|
||||
@@ -41,14 +41,14 @@ static struct ex_s ex_data[] = {
|
||||
{ "SIMD exception", SIGFPE, 386 },
|
||||
};
|
||||
|
||||
PRIVATE void inkernel_disaster(struct proc *saved_proc,
|
||||
static void inkernel_disaster(struct proc *saved_proc,
|
||||
struct exception_frame *frame, struct ex_s *ep, int is_nested);
|
||||
|
||||
extern int catch_pagefaults;
|
||||
|
||||
PRIVATE void proc_stacktrace_execute(struct proc *whichproc, reg_t v_bp, reg_t pc);
|
||||
static void proc_stacktrace_execute(struct proc *whichproc, reg_t v_bp, reg_t pc);
|
||||
|
||||
PRIVATE void pagefault( struct proc *pr,
|
||||
static void pagefault( struct proc *pr,
|
||||
struct exception_frame * frame,
|
||||
int is_nested)
|
||||
{
|
||||
@@ -132,7 +132,7 @@ PRIVATE void pagefault( struct proc *pr,
|
||||
return;
|
||||
}
|
||||
|
||||
PRIVATE void inkernel_disaster(struct proc *saved_proc,
|
||||
static void inkernel_disaster(struct proc *saved_proc,
|
||||
struct exception_frame * frame, struct ex_s *ep,
|
||||
int is_nested)
|
||||
{
|
||||
@@ -184,7 +184,7 @@ PRIVATE void inkernel_disaster(struct proc *saved_proc,
|
||||
/*===========================================================================*
|
||||
* exception *
|
||||
*===========================================================================*/
|
||||
PUBLIC void exception_handler(int is_nested, struct exception_frame * frame)
|
||||
void exception_handler(int is_nested, struct exception_frame * frame)
|
||||
{
|
||||
/* An exception or unexpected interrupt has occurred. */
|
||||
register struct ex_s *ep;
|
||||
@@ -278,7 +278,7 @@ PUBLIC void exception_handler(int is_nested, struct exception_frame * frame)
|
||||
/*===========================================================================*
|
||||
* proc_stacktrace_execute *
|
||||
*===========================================================================*/
|
||||
PRIVATE void proc_stacktrace_execute(struct proc *whichproc, reg_t v_bp, reg_t pc)
|
||||
static void proc_stacktrace_execute(struct proc *whichproc, reg_t v_bp, reg_t pc)
|
||||
{
|
||||
reg_t v_hbp;
|
||||
int iskernel;
|
||||
@@ -322,21 +322,21 @@ PRIVATE void proc_stacktrace_execute(struct proc *whichproc, reg_t v_bp, reg_t p
|
||||
/*===========================================================================*
|
||||
* proc_stacktrace *
|
||||
*===========================================================================*/
|
||||
PUBLIC void proc_stacktrace(struct proc *whichproc)
|
||||
void proc_stacktrace(struct proc *whichproc)
|
||||
{
|
||||
#if USE_SYSDEBUG
|
||||
proc_stacktrace_execute(whichproc, whichproc->p_reg.fp, whichproc->p_reg.pc);
|
||||
#endif /* USE_SYSDEBUG */
|
||||
}
|
||||
|
||||
PUBLIC void enable_fpu_exception(void)
|
||||
void enable_fpu_exception(void)
|
||||
{
|
||||
u32_t cr0 = read_cr0();
|
||||
if(!(cr0 & I386_CR0_TS))
|
||||
write_cr0(cr0 | I386_CR0_TS);
|
||||
}
|
||||
|
||||
PUBLIC void disable_fpu_exception(void)
|
||||
void disable_fpu_exception(void)
|
||||
{
|
||||
clts();
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
/*===========================================================================*
|
||||
* intr_init *
|
||||
*===========================================================================*/
|
||||
PUBLIC int intr_init(const int mine, const int auto_eoi)
|
||||
int intr_init(const int mine, const int auto_eoi)
|
||||
{
|
||||
/* Initialize the 8259s, finishing with all interrupts disabled. This is
|
||||
* only done in protected mode, in real mode we don't touch the 8259s, but
|
||||
@@ -72,27 +72,27 @@ PUBLIC int intr_init(const int mine, const int auto_eoi)
|
||||
return OK;
|
||||
}
|
||||
|
||||
PUBLIC void irq_8259_unmask(const int irq)
|
||||
void irq_8259_unmask(const int irq)
|
||||
{
|
||||
const unsigned ctl_mask = irq < 8 ? INT_CTLMASK : INT2_CTLMASK;
|
||||
outb(ctl_mask, inb(ctl_mask) & ~(1 << (irq & 0x7)));
|
||||
}
|
||||
|
||||
PUBLIC void irq_8259_mask(const int irq)
|
||||
void irq_8259_mask(const int irq)
|
||||
{
|
||||
const unsigned ctl_mask = irq < 8 ? INT_CTLMASK : INT2_CTLMASK;
|
||||
outb(ctl_mask, inb(ctl_mask) | (1 << (irq & 0x7)));
|
||||
}
|
||||
|
||||
/* Disable 8259 - write 0xFF in OCW1 master and slave. */
|
||||
PUBLIC void i8259_disable(void)
|
||||
void i8259_disable(void)
|
||||
{
|
||||
outb(INT2_CTLMASK, 0xFF);
|
||||
outb(INT_CTLMASK, 0xFF);
|
||||
inb(INT_CTLMASK);
|
||||
}
|
||||
|
||||
PUBLIC void irq_8259_eoi(int irq)
|
||||
void irq_8259_eoi(int irq)
|
||||
{
|
||||
if (irq < 8)
|
||||
eoi_8259_master();
|
||||
|
||||
@@ -27,20 +27,20 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
PUBLIC int i386_paging_enabled = 0;
|
||||
int i386_paging_enabled = 0;
|
||||
|
||||
PRIVATE int psok = 0;
|
||||
static int psok = 0;
|
||||
|
||||
#define MAX_FREEPDES 2
|
||||
PRIVATE int nfreepdes = 0, freepdes[MAX_FREEPDES];
|
||||
static int nfreepdes = 0, freepdes[MAX_FREEPDES];
|
||||
|
||||
#define HASPT(procptr) ((procptr)->p_seg.p_cr3 != 0)
|
||||
|
||||
FORWARD u32_t phys_get32(phys_bytes v);
|
||||
FORWARD void vm_enable_paging(void);
|
||||
static u32_t phys_get32(phys_bytes v);
|
||||
static void vm_enable_paging(void);
|
||||
|
||||
|
||||
PUBLIC void segmentation2paging(struct proc * current)
|
||||
void segmentation2paging(struct proc * current)
|
||||
{
|
||||
/* switch to the current process page tables before turning paging on */
|
||||
switch_address_space(current);
|
||||
@@ -67,7 +67,7 @@ PUBLIC void segmentation2paging(struct proc * current)
|
||||
* pde number to be used, and a pointer to it (linear address) is returned
|
||||
* for actual use by phys_copy or phys_memset.
|
||||
*/
|
||||
PRIVATE phys_bytes createpde(
|
||||
static phys_bytes createpde(
|
||||
const struct proc *pr, /* Requested process, NULL for physical. */
|
||||
const phys_bytes linaddr,/* Address after segment translation. */
|
||||
phys_bytes *bytes, /* Size of chunk, function may truncate it. */
|
||||
@@ -132,7 +132,7 @@ PRIVATE phys_bytes createpde(
|
||||
/*===========================================================================*
|
||||
* lin_lin_copy *
|
||||
*===========================================================================*/
|
||||
PRIVATE int lin_lin_copy(struct proc *srcproc, vir_bytes srclinaddr,
|
||||
static int lin_lin_copy(struct proc *srcproc, vir_bytes srclinaddr,
|
||||
struct proc *dstproc, vir_bytes dstlinaddr, vir_bytes bytes)
|
||||
{
|
||||
u32_t addr;
|
||||
@@ -214,7 +214,7 @@ PRIVATE int lin_lin_copy(struct proc *srcproc, vir_bytes srclinaddr,
|
||||
}
|
||||
|
||||
|
||||
PRIVATE u32_t phys_get32(phys_bytes addr)
|
||||
static u32_t phys_get32(phys_bytes addr)
|
||||
{
|
||||
const u32_t v;
|
||||
int r;
|
||||
@@ -233,7 +233,7 @@ PRIVATE u32_t phys_get32(phys_bytes addr)
|
||||
}
|
||||
|
||||
#if 0
|
||||
PRIVATE char *cr0_str(u32_t e)
|
||||
static char *cr0_str(u32_t e)
|
||||
{
|
||||
static char str[80];
|
||||
strcpy(str, "");
|
||||
@@ -249,7 +249,7 @@ PRIVATE char *cr0_str(u32_t e)
|
||||
return str;
|
||||
}
|
||||
|
||||
PRIVATE char *cr4_str(u32_t e)
|
||||
static char *cr4_str(u32_t e)
|
||||
{
|
||||
static char str[80];
|
||||
strcpy(str, "");
|
||||
@@ -266,12 +266,12 @@ PRIVATE char *cr4_str(u32_t e)
|
||||
}
|
||||
#endif
|
||||
|
||||
PUBLIC void vm_stop(void)
|
||||
void vm_stop(void)
|
||||
{
|
||||
write_cr0(read_cr0() & ~I386_CR0_PG);
|
||||
}
|
||||
|
||||
PRIVATE void vm_enable_paging(void)
|
||||
static void vm_enable_paging(void)
|
||||
{
|
||||
u32_t cr0, cr4;
|
||||
int pgeok;
|
||||
@@ -311,7 +311,7 @@ PRIVATE void vm_enable_paging(void)
|
||||
/*===========================================================================*
|
||||
* umap_local *
|
||||
*===========================================================================*/
|
||||
PUBLIC phys_bytes umap_local(rp, seg, vir_addr, bytes)
|
||||
phys_bytes umap_local(rp, seg, vir_addr, bytes)
|
||||
register struct proc *rp; /* pointer to proc table entry for process */
|
||||
int seg; /* T, D, or S segment */
|
||||
vir_bytes vir_addr; /* virtual address in bytes within the seg */
|
||||
@@ -350,7 +350,7 @@ vir_bytes bytes; /* # of bytes to be copied */
|
||||
/*===========================================================================*
|
||||
* umap_virtual *
|
||||
*===========================================================================*/
|
||||
PUBLIC phys_bytes umap_virtual(rp, seg, vir_addr, bytes)
|
||||
phys_bytes umap_virtual(rp, seg, vir_addr, bytes)
|
||||
register struct proc *rp; /* pointer to proc table entry for process */
|
||||
int seg; /* T, D, or S segment */
|
||||
vir_bytes vir_addr; /* virtual address in bytes within the seg */
|
||||
@@ -399,7 +399,7 @@ vir_bytes bytes; /* # of bytes to be copied */
|
||||
/*===========================================================================*
|
||||
* vm_lookup *
|
||||
*===========================================================================*/
|
||||
PUBLIC int vm_lookup(const struct proc *proc, const vir_bytes virtual,
|
||||
int vm_lookup(const struct proc *proc, const vir_bytes virtual,
|
||||
phys_bytes *physical, u32_t *ptent)
|
||||
{
|
||||
u32_t *root, *pt;
|
||||
@@ -455,7 +455,7 @@ PUBLIC int vm_lookup(const struct proc *proc, const vir_bytes virtual,
|
||||
/*===========================================================================*
|
||||
* vm_lookup_range *
|
||||
*===========================================================================*/
|
||||
PUBLIC size_t vm_lookup_range(const struct proc *proc, vir_bytes vir_addr,
|
||||
size_t vm_lookup_range(const struct proc *proc, vir_bytes vir_addr,
|
||||
phys_bytes *phys_addr, size_t bytes)
|
||||
{
|
||||
/* Look up the physical address corresponding to linear virtual address
|
||||
@@ -507,7 +507,7 @@ PUBLIC size_t vm_lookup_range(const struct proc *proc, vir_bytes vir_addr,
|
||||
/*===========================================================================*
|
||||
* vm_suspend *
|
||||
*===========================================================================*/
|
||||
PRIVATE void vm_suspend(struct proc *caller, const struct proc *target,
|
||||
static void vm_suspend(struct proc *caller, const struct proc *target,
|
||||
const vir_bytes linaddr, const vir_bytes len, const int type)
|
||||
{
|
||||
/* This range is not OK for this process. Set parameters
|
||||
@@ -534,7 +534,7 @@ PRIVATE void vm_suspend(struct proc *caller, const struct proc *target,
|
||||
/*===========================================================================*
|
||||
* vm_check_range *
|
||||
*===========================================================================*/
|
||||
PUBLIC int vm_check_range(struct proc *caller, struct proc *target,
|
||||
int vm_check_range(struct proc *caller, struct proc *target,
|
||||
vir_bytes vir_addr, size_t bytes)
|
||||
{
|
||||
/* Public interface to vm_suspend(), for use by kernel calls. On behalf
|
||||
@@ -562,7 +562,7 @@ PUBLIC int vm_check_range(struct proc *caller, struct proc *target,
|
||||
/*===========================================================================*
|
||||
* delivermsg *
|
||||
*===========================================================================*/
|
||||
PUBLIC void delivermsg(struct proc *rp)
|
||||
void delivermsg(struct proc *rp)
|
||||
{
|
||||
int r = OK;
|
||||
|
||||
@@ -589,7 +589,7 @@ PUBLIC void delivermsg(struct proc *rp)
|
||||
}
|
||||
|
||||
#if 0
|
||||
PRIVATE char *flagstr(u32_t e, const int dir)
|
||||
static char *flagstr(u32_t e, const int dir)
|
||||
{
|
||||
static char str[80];
|
||||
strcpy(str, "");
|
||||
@@ -606,7 +606,7 @@ PRIVATE char *flagstr(u32_t e, const int dir)
|
||||
return str;
|
||||
}
|
||||
|
||||
PRIVATE void vm_pt_print(u32_t *pagetable, const u32_t v)
|
||||
static void vm_pt_print(u32_t *pagetable, const u32_t v)
|
||||
{
|
||||
int pte;
|
||||
int col = 0;
|
||||
@@ -630,7 +630,7 @@ PRIVATE void vm_pt_print(u32_t *pagetable, const u32_t v)
|
||||
return;
|
||||
}
|
||||
|
||||
PRIVATE void vm_print(u32_t *root)
|
||||
static void vm_print(u32_t *root)
|
||||
{
|
||||
int pde;
|
||||
|
||||
@@ -705,7 +705,7 @@ int vm_phys_memset(phys_bytes ph, const u8_t c, phys_bytes bytes)
|
||||
/*===========================================================================*
|
||||
* virtual_copy_f *
|
||||
*===========================================================================*/
|
||||
PUBLIC int virtual_copy_f(caller, src_addr, dst_addr, bytes, vmcheck)
|
||||
int virtual_copy_f(caller, src_addr, dst_addr, bytes, vmcheck)
|
||||
struct proc * caller;
|
||||
struct vir_addr *src_addr; /* source virtual address */
|
||||
struct vir_addr *dst_addr; /* destination virtual address */
|
||||
@@ -848,7 +848,7 @@ int vmcheck; /* if nonzero, can return VMSUSPEND */
|
||||
/*===========================================================================*
|
||||
* data_copy *
|
||||
*===========================================================================*/
|
||||
PUBLIC int data_copy(const endpoint_t from_proc, const vir_bytes from_addr,
|
||||
int data_copy(const endpoint_t from_proc, const vir_bytes from_addr,
|
||||
const endpoint_t to_proc, const vir_bytes to_addr,
|
||||
size_t bytes)
|
||||
{
|
||||
@@ -866,7 +866,7 @@ PUBLIC int data_copy(const endpoint_t from_proc, const vir_bytes from_addr,
|
||||
/*===========================================================================*
|
||||
* data_copy_vmcheck *
|
||||
*===========================================================================*/
|
||||
PUBLIC int data_copy_vmcheck(struct proc * caller,
|
||||
int data_copy_vmcheck(struct proc * caller,
|
||||
const endpoint_t from_proc, const vir_bytes from_addr,
|
||||
const endpoint_t to_proc, const vir_bytes to_addr,
|
||||
size_t bytes)
|
||||
@@ -885,7 +885,7 @@ PUBLIC int data_copy_vmcheck(struct proc * caller,
|
||||
/*===========================================================================*
|
||||
* arch_pre_exec *
|
||||
*===========================================================================*/
|
||||
PUBLIC void arch_pre_exec(struct proc *pr, const u32_t ip, const u32_t sp)
|
||||
void arch_pre_exec(struct proc *pr, const u32_t ip, const u32_t sp)
|
||||
{
|
||||
/* set program counter and stack pointer. */
|
||||
pr->p_reg.pc = ip;
|
||||
@@ -895,7 +895,7 @@ PUBLIC void arch_pre_exec(struct proc *pr, const u32_t ip, const u32_t sp)
|
||||
/*===========================================================================*
|
||||
* arch_umap *
|
||||
*===========================================================================*/
|
||||
PUBLIC int arch_umap(const struct proc *pr, vir_bytes offset, vir_bytes count,
|
||||
int arch_umap(const struct proc *pr, vir_bytes offset, vir_bytes count,
|
||||
int seg, phys_bytes *addr)
|
||||
{
|
||||
switch(seg) {
|
||||
@@ -919,12 +919,12 @@ void i386_freepde(const int pde)
|
||||
freepdes[nfreepdes++] = pde;
|
||||
}
|
||||
|
||||
PRIVATE int oxpcie_mapping_index = -1,
|
||||
static int oxpcie_mapping_index = -1,
|
||||
lapic_mapping_index = -1,
|
||||
ioapic_first_index = -1,
|
||||
ioapic_last_index = -1;
|
||||
|
||||
PUBLIC int arch_phys_map(const int index,
|
||||
int arch_phys_map(const int index,
|
||||
phys_bytes *addr,
|
||||
phys_bytes *len,
|
||||
int *flags)
|
||||
@@ -988,7 +988,7 @@ PUBLIC int arch_phys_map(const int index,
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
PUBLIC int arch_phys_map_reply(const int index, const vir_bytes addr)
|
||||
int arch_phys_map_reply(const int index, const vir_bytes addr)
|
||||
{
|
||||
#ifdef USE_APIC
|
||||
/* if local APIC is enabled */
|
||||
@@ -1013,7 +1013,7 @@ PUBLIC int arch_phys_map_reply(const int index, const vir_bytes addr)
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
PUBLIC int arch_enable_paging(struct proc * caller, const message * m_ptr)
|
||||
int arch_enable_paging(struct proc * caller, const message * m_ptr)
|
||||
{
|
||||
struct vm_ep_data ep_data;
|
||||
int r;
|
||||
@@ -1099,13 +1099,13 @@ PUBLIC int arch_enable_paging(struct proc * caller, const message * m_ptr)
|
||||
return OK;
|
||||
}
|
||||
|
||||
PUBLIC void release_address_space(struct proc *pr)
|
||||
void release_address_space(struct proc *pr)
|
||||
{
|
||||
pr->p_seg.p_cr3_v = NULL;
|
||||
}
|
||||
|
||||
/* computes a checksum of a buffer of a given length. The byte sum must be zero */
|
||||
PUBLIC int platform_tbl_checksum_ok(void *ptr, unsigned int length)
|
||||
int platform_tbl_checksum_ok(void *ptr, unsigned int length)
|
||||
{
|
||||
u8_t total = 0;
|
||||
unsigned int i;
|
||||
@@ -1114,7 +1114,7 @@ PUBLIC int platform_tbl_checksum_ok(void *ptr, unsigned int length)
|
||||
return !total;
|
||||
}
|
||||
|
||||
PUBLIC int platform_tbl_ptr(phys_bytes start,
|
||||
int platform_tbl_ptr(phys_bytes start,
|
||||
phys_bytes end,
|
||||
unsigned increment,
|
||||
void * buff,
|
||||
|
||||
@@ -8,14 +8,14 @@
|
||||
#include "oxpcie.h"
|
||||
#include "serial.h"
|
||||
|
||||
PRIVATE unsigned char *oxpcie_vaddr = NULL;
|
||||
static unsigned char *oxpcie_vaddr = NULL;
|
||||
|
||||
PUBLIC void oxpcie_set_vaddr(unsigned char *vaddr)
|
||||
void oxpcie_set_vaddr(unsigned char *vaddr)
|
||||
{
|
||||
oxpcie_vaddr = vaddr;
|
||||
}
|
||||
|
||||
PRIVATE void oxpcie_init(void)
|
||||
static void oxpcie_init(void)
|
||||
{
|
||||
printf("oxpcie_init\n");
|
||||
/* Enable access to EFR and DLM+DLL */
|
||||
@@ -45,7 +45,7 @@ PRIVATE void oxpcie_init(void)
|
||||
OXPCIE_CPR2 = 0;
|
||||
}
|
||||
|
||||
PUBLIC void oxpcie_putc(char c)
|
||||
void oxpcie_putc(char c)
|
||||
{
|
||||
static int inuse = 0;
|
||||
|
||||
@@ -68,7 +68,7 @@ PUBLIC void oxpcie_putc(char c)
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC int oxpcie_in(void)
|
||||
int oxpcie_in(void)
|
||||
{
|
||||
if(vm_running && oxpcie_vaddr) {
|
||||
int lsr;
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
#define mb_clear_memrange(start, end) \
|
||||
phys_memset((start), 0, (end)-(start))
|
||||
|
||||
PRIVATE void mb_itoa(u32_t val, char * out)
|
||||
static void mb_itoa(u32_t val, char * out)
|
||||
{
|
||||
char ret[ITOA_BUFFER_SIZE];
|
||||
int i = ITOA_BUFFER_SIZE - 2;
|
||||
@@ -67,7 +67,7 @@ PRIVATE void mb_itoa(u32_t val, char * out)
|
||||
strcpy(out, ret + i + 1);
|
||||
}
|
||||
|
||||
PRIVATE void mb_itox(u32_t val, char *out)
|
||||
static void mb_itox(u32_t val, char *out)
|
||||
{
|
||||
char ret[9];
|
||||
int i = 7;
|
||||
@@ -92,7 +92,7 @@ PRIVATE void mb_itox(u32_t val, char *out)
|
||||
strcpy(out, ret + i + 1);
|
||||
}
|
||||
|
||||
PRIVATE void mb_put_char(char c, int line, int col)
|
||||
static void mb_put_char(char c, int line, int col)
|
||||
{
|
||||
/* Write a char to vga display buffer. */
|
||||
if (line<MULTIBOOT_CONSOLE_LINES&&col<MULTIBOOT_CONSOLE_COLS)
|
||||
@@ -104,7 +104,7 @@ PRIVATE void mb_put_char(char c, int line, int col)
|
||||
1);
|
||||
}
|
||||
|
||||
PRIVATE char mb_get_char(int line, int col)
|
||||
static char mb_get_char(int line, int col)
|
||||
{
|
||||
char c;
|
||||
/* Read a char to from display buffer. */
|
||||
@@ -119,11 +119,11 @@ PRIVATE char mb_get_char(int line, int col)
|
||||
}
|
||||
|
||||
/* Give non-zero values to avoid them in BSS */
|
||||
PRIVATE int print_line = 1, print_col = 1;
|
||||
static int print_line = 1, print_col = 1;
|
||||
|
||||
#include <sys/video.h>
|
||||
|
||||
PUBLIC void mb_cls(void)
|
||||
void mb_cls(void)
|
||||
{
|
||||
int i, j;
|
||||
/* Clear screen */
|
||||
@@ -139,7 +139,7 @@ PUBLIC void mb_cls(void)
|
||||
outb(C_6845+DATA, 0);
|
||||
}
|
||||
|
||||
PRIVATE void mb_scroll_up(int lines)
|
||||
static void mb_scroll_up(int lines)
|
||||
{
|
||||
int i, j;
|
||||
for (i = 0; i < MULTIBOOT_CONSOLE_LINES; i++ ) {
|
||||
@@ -153,7 +153,7 @@ PRIVATE void mb_scroll_up(int lines)
|
||||
print_line-= lines;
|
||||
}
|
||||
|
||||
PUBLIC void mb_print_char(char c)
|
||||
void mb_print_char(char c)
|
||||
{
|
||||
while (print_line >= MULTIBOOT_CONSOLE_LINES)
|
||||
mb_scroll_up(1);
|
||||
@@ -177,7 +177,7 @@ PUBLIC void mb_print_char(char c)
|
||||
mb_scroll_up(1);
|
||||
}
|
||||
|
||||
PUBLIC void mb_print(char *str)
|
||||
void mb_print(char *str)
|
||||
{
|
||||
while (*str) {
|
||||
mb_print_char(*str);
|
||||
@@ -191,7 +191,7 @@ PUBLIC void mb_print(char *str)
|
||||
#define KB_OUT_FULL 0x01 /* status bit set when keypress char pending */
|
||||
#define KB_AUX_BYTE 0x20 /* Auxiliary Device Output Buffer Full */
|
||||
|
||||
PUBLIC int mb_read_char(unsigned char *ch)
|
||||
int mb_read_char(unsigned char *ch)
|
||||
{
|
||||
unsigned long b, sb;
|
||||
#ifdef DEBUG_SERIAL
|
||||
@@ -220,7 +220,7 @@ PUBLIC int mb_read_char(unsigned char *ch)
|
||||
return 0;
|
||||
}
|
||||
|
||||
PRIVATE void mb_print_hex(u32_t value)
|
||||
static void mb_print_hex(u32_t value)
|
||||
{
|
||||
int i;
|
||||
char c;
|
||||
@@ -238,7 +238,7 @@ PRIVATE void mb_print_hex(u32_t value)
|
||||
mb_print(out);
|
||||
}
|
||||
|
||||
PRIVATE int mb_set_param(char *name, char *value)
|
||||
static int mb_set_param(char *name, char *value)
|
||||
{
|
||||
char *p = multiboot_param_buf;
|
||||
char *q;
|
||||
@@ -281,7 +281,7 @@ PRIVATE int mb_set_param(char *name, char *value)
|
||||
return 0;
|
||||
}
|
||||
|
||||
PRIVATE void get_parameters(multiboot_info_t *mbi)
|
||||
static void get_parameters(multiboot_info_t *mbi)
|
||||
{
|
||||
char mem_value[40], temp[ITOA_BUFFER_SIZE];
|
||||
int i;
|
||||
@@ -354,7 +354,7 @@ PRIVATE void get_parameters(multiboot_info_t *mbi)
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE void mb_extract_image(multiboot_info_t mbi)
|
||||
static void mb_extract_image(multiboot_info_t mbi)
|
||||
{
|
||||
multiboot_module_t *mb_module_info;
|
||||
multiboot_module_t *module;
|
||||
@@ -458,7 +458,7 @@ PRIVATE void mb_extract_image(multiboot_info_t mbi)
|
||||
return;
|
||||
}
|
||||
|
||||
PUBLIC phys_bytes pre_init(u32_t ebx)
|
||||
phys_bytes pre_init(u32_t ebx)
|
||||
{
|
||||
multiboot_info_t mbi;
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ struct gatedesc_s {
|
||||
u16_t offset_high;
|
||||
};
|
||||
|
||||
PUBLIC struct segdesc_s gdt[GDT_SIZE]= /* used in klib.s and mpx.s */
|
||||
struct segdesc_s gdt[GDT_SIZE]= /* used in klib.s and mpx.s */
|
||||
{ {0},
|
||||
{0,0,0,0}, /* GDT descriptor */
|
||||
{0,0,0,0}, /* IDT descriptor */
|
||||
@@ -35,16 +35,16 @@ PUBLIC struct segdesc_s gdt[GDT_SIZE]= /* used in klib.s and mpx.s */
|
||||
{0xffff,0,0,0x9b,0xcf,0}, /* kernel CS */
|
||||
{0xffff,0,0,0x9b,0xcf,0}, /* temp for BIOS (386: monitor CS at startup) */
|
||||
};
|
||||
PRIVATE struct gatedesc_s idt[IDT_SIZE]; /* zero-init so none present */
|
||||
PUBLIC struct tss_s tss[CONFIG_MAX_CPUS]; /* zero init */
|
||||
static struct gatedesc_s idt[IDT_SIZE]; /* zero-init so none present */
|
||||
struct tss_s tss[CONFIG_MAX_CPUS]; /* zero init */
|
||||
|
||||
FORWARD void sdesc(struct segdesc_s *segdp, phys_bytes base, vir_bytes
|
||||
static void sdesc(struct segdesc_s *segdp, phys_bytes base, vir_bytes
|
||||
size);
|
||||
|
||||
/*===========================================================================*
|
||||
* enable_iop *
|
||||
*===========================================================================*/
|
||||
PUBLIC void enable_iop(struct proc *pp)
|
||||
void enable_iop(struct proc *pp)
|
||||
{
|
||||
/* Allow a user process to use I/O instructions. Change the I/O Permission
|
||||
* Level bits in the psw. These specify least-privileged Current Permission
|
||||
@@ -57,7 +57,7 @@ PUBLIC void enable_iop(struct proc *pp)
|
||||
/*===========================================================================*
|
||||
* seg2phys *
|
||||
*===========================================================================*/
|
||||
PUBLIC phys_bytes seg2phys(const u16_t seg)
|
||||
phys_bytes seg2phys(const u16_t seg)
|
||||
{
|
||||
/* Return the base address of a segment, with seg being a
|
||||
* register, or a 286/386 segment selector.
|
||||
@@ -75,7 +75,7 @@ PUBLIC phys_bytes seg2phys(const u16_t seg)
|
||||
/*===========================================================================*
|
||||
* init_dataseg *
|
||||
*===========================================================================*/
|
||||
PUBLIC void init_dataseg(register struct segdesc_s *segdp,
|
||||
void init_dataseg(register struct segdesc_s *segdp,
|
||||
phys_bytes base, vir_bytes size, const int privilege)
|
||||
{
|
||||
/* Build descriptor for a data segment. */
|
||||
@@ -88,7 +88,7 @@ PUBLIC void init_dataseg(register struct segdesc_s *segdp,
|
||||
/*===========================================================================*
|
||||
* init_codeseg *
|
||||
*===========================================================================*/
|
||||
PRIVATE void init_codeseg(register struct segdesc_s *segdp, phys_bytes base,
|
||||
static void init_codeseg(register struct segdesc_s *segdp, phys_bytes base,
|
||||
vir_bytes size, int privilege)
|
||||
{
|
||||
/* Build descriptor for a code segment. */
|
||||
@@ -98,7 +98,7 @@ PRIVATE void init_codeseg(register struct segdesc_s *segdp, phys_bytes base,
|
||||
/* CONFORMING = 0, ACCESSED = 0 */
|
||||
}
|
||||
|
||||
PUBLIC struct gate_table_s gate_table_pic[] = {
|
||||
struct gate_table_s gate_table_pic[] = {
|
||||
{ hwint00, VECTOR( 0), INTR_PRIVILEGE },
|
||||
{ hwint01, VECTOR( 1), INTR_PRIVILEGE },
|
||||
{ hwint02, VECTOR( 2), INTR_PRIVILEGE },
|
||||
@@ -118,7 +118,7 @@ PUBLIC struct gate_table_s gate_table_pic[] = {
|
||||
{ NULL, 0, 0}
|
||||
};
|
||||
|
||||
PUBLIC void tss_init(unsigned cpu, void * kernel_stack)
|
||||
void tss_init(unsigned cpu, void * kernel_stack)
|
||||
{
|
||||
struct tss_s * t = &tss[cpu];
|
||||
|
||||
@@ -146,7 +146,7 @@ PUBLIC void tss_init(unsigned cpu, void * kernel_stack)
|
||||
/*===========================================================================*
|
||||
* prot_init *
|
||||
*===========================================================================*/
|
||||
PUBLIC void prot_init(void)
|
||||
void prot_init(void)
|
||||
{
|
||||
/* Set up tables for protected mode.
|
||||
* All GDT slots are allocated at compile time.
|
||||
@@ -192,7 +192,7 @@ PUBLIC void prot_init(void)
|
||||
tss_init(0, &k_boot_stktop);
|
||||
}
|
||||
|
||||
PUBLIC void idt_copy_vectors(struct gate_table_s * first)
|
||||
void idt_copy_vectors(struct gate_table_s * first)
|
||||
{
|
||||
struct gate_table_s *gtp;
|
||||
for (gtp = first; gtp->gate; gtp++) {
|
||||
@@ -203,7 +203,7 @@ PUBLIC void idt_copy_vectors(struct gate_table_s * first)
|
||||
}
|
||||
|
||||
/* Build descriptors for interrupt gates in IDT. */
|
||||
PUBLIC void idt_init(void)
|
||||
void idt_init(void)
|
||||
{
|
||||
struct gate_table_s gate_table[] = {
|
||||
{ divide_error, DIVIDE_VECTOR, INTR_PRIVILEGE },
|
||||
@@ -238,7 +238,7 @@ PUBLIC void idt_init(void)
|
||||
/*===========================================================================*
|
||||
* sdesc *
|
||||
*===========================================================================*/
|
||||
PRIVATE void sdesc(segdp, base, size)
|
||||
static void sdesc(segdp, base, size)
|
||||
register struct segdesc_s *segdp;
|
||||
phys_bytes base;
|
||||
vir_bytes size;
|
||||
@@ -263,7 +263,7 @@ vir_bytes size;
|
||||
/*===========================================================================*
|
||||
* int_gate *
|
||||
*===========================================================================*/
|
||||
PUBLIC void int_gate(unsigned vec_nr, vir_bytes offset, unsigned dpl_type)
|
||||
void int_gate(unsigned vec_nr, vir_bytes offset, unsigned dpl_type)
|
||||
{
|
||||
/* Build descriptor for an interrupt gate. */
|
||||
register struct gatedesc_s *idp;
|
||||
@@ -278,7 +278,7 @@ PUBLIC void int_gate(unsigned vec_nr, vir_bytes offset, unsigned dpl_type)
|
||||
/*===========================================================================*
|
||||
* alloc_segments *
|
||||
*===========================================================================*/
|
||||
PUBLIC void alloc_segments(register struct proc *rp)
|
||||
void alloc_segments(register struct proc *rp)
|
||||
{
|
||||
/* This is called at system initialization from main() and by do_newmap().
|
||||
* The code has a separate function because of all hardware-dependencies.
|
||||
@@ -322,7 +322,7 @@ PUBLIC void alloc_segments(register struct proc *rp)
|
||||
/*===========================================================================*
|
||||
* check_segments *
|
||||
*===========================================================================*/
|
||||
PRIVATE void check_segments(char *File, int line)
|
||||
static void check_segments(char *File, int line)
|
||||
{
|
||||
int checked = 0;
|
||||
int fail = 0;
|
||||
@@ -363,7 +363,7 @@ for (rp = BEG_PROC_ADDR; rp < END_PROC_ADDR; ++rp) {
|
||||
/*===========================================================================*
|
||||
* printseg *
|
||||
*===========================================================================*/
|
||||
PUBLIC void printseg(char *banner, const int iscs, struct proc *pr,
|
||||
void printseg(char *banner, const int iscs, struct proc *pr,
|
||||
const u32_t selector)
|
||||
{
|
||||
#if USE_SYSDEBUG
|
||||
@@ -453,7 +453,7 @@ PUBLIC void printseg(char *banner, const int iscs, struct proc *pr,
|
||||
/*===========================================================================*
|
||||
* prot_set_kern_seg_limit *
|
||||
*===========================================================================*/
|
||||
PUBLIC int prot_set_kern_seg_limit(const vir_bytes limit)
|
||||
int prot_set_kern_seg_limit(const vir_bytes limit)
|
||||
{
|
||||
struct proc *rp;
|
||||
int orig_click;
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
/* Function prototype for PRIVATE functions.
|
||||
*/
|
||||
FORWARD void load_update(void);
|
||||
static void load_update(void);
|
||||
|
||||
/* The CLOCK's timers queue. The functions in <timers.h> operate on this.
|
||||
* Each system process possesses a single synchronous alarm timer. If other
|
||||
@@ -51,18 +51,18 @@ FORWARD void load_update(void);
|
||||
* via (re)set_timer().
|
||||
* When a timer expires its watchdog function is run by the CLOCK task.
|
||||
*/
|
||||
PRIVATE timer_t *clock_timers; /* queue of CLOCK timers */
|
||||
PRIVATE clock_t next_timeout; /* realtime that next timer expires */
|
||||
static timer_t *clock_timers; /* queue of CLOCK timers */
|
||||
static clock_t next_timeout; /* realtime that next timer expires */
|
||||
|
||||
/* The time is incremented by the interrupt handler on each clock tick.
|
||||
*/
|
||||
PRIVATE clock_t realtime = 0; /* real time clock */
|
||||
static clock_t realtime = 0; /* real time clock */
|
||||
|
||||
/*
|
||||
* The boot processos timer interrupt handler. In addition to non-boot cpus it
|
||||
* keeps real time and notifies the clock task if need be
|
||||
*/
|
||||
PUBLIC int timer_int_handler(void)
|
||||
int timer_int_handler(void)
|
||||
{
|
||||
/* Update user and system accounting times. Charge the current process
|
||||
* for user time. If the current process is not billable, that is, if a
|
||||
@@ -153,7 +153,7 @@ PUBLIC int timer_int_handler(void)
|
||||
/*===========================================================================*
|
||||
* get_uptime *
|
||||
*===========================================================================*/
|
||||
PUBLIC clock_t get_uptime(void)
|
||||
clock_t get_uptime(void)
|
||||
{
|
||||
/* Get and return the current clock uptime in ticks. */
|
||||
return(realtime);
|
||||
@@ -162,7 +162,7 @@ PUBLIC clock_t get_uptime(void)
|
||||
/*===========================================================================*
|
||||
* set_timer *
|
||||
*===========================================================================*/
|
||||
PUBLIC void set_timer(tp, exp_time, watchdog)
|
||||
void set_timer(tp, exp_time, watchdog)
|
||||
struct timer *tp; /* pointer to timer structure */
|
||||
clock_t exp_time; /* expiration realtime */
|
||||
tmr_func_t watchdog; /* watchdog to be called */
|
||||
@@ -177,7 +177,7 @@ tmr_func_t watchdog; /* watchdog to be called */
|
||||
/*===========================================================================*
|
||||
* reset_timer *
|
||||
*===========================================================================*/
|
||||
PUBLIC void reset_timer(tp)
|
||||
void reset_timer(tp)
|
||||
struct timer *tp; /* pointer to timer structure */
|
||||
{
|
||||
/* The timer pointed to by 'tp' is no longer needed. Remove it from both the
|
||||
@@ -192,7 +192,7 @@ struct timer *tp; /* pointer to timer structure */
|
||||
/*===========================================================================*
|
||||
* load_update *
|
||||
*===========================================================================*/
|
||||
PRIVATE void load_update(void)
|
||||
static void load_update(void)
|
||||
{
|
||||
u16_t slot;
|
||||
int enqueued = 0, q;
|
||||
@@ -225,7 +225,7 @@ PRIVATE void load_update(void)
|
||||
kloadinfo.last_clock = realtime;
|
||||
}
|
||||
|
||||
PUBLIC int boot_cpu_init_timer(unsigned freq)
|
||||
int boot_cpu_init_timer(unsigned freq)
|
||||
{
|
||||
if (init_local_timer(freq))
|
||||
return -1;
|
||||
@@ -237,7 +237,7 @@ PUBLIC int boot_cpu_init_timer(unsigned freq)
|
||||
return 0;
|
||||
}
|
||||
|
||||
PUBLIC int app_cpu_init_timer(unsigned freq)
|
||||
int app_cpu_init_timer(unsigned freq)
|
||||
{
|
||||
if (init_local_timer(freq))
|
||||
return -1;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
#define MAX_LOOP (NR_PROCS + NR_TASKS)
|
||||
|
||||
PUBLIC int runqueues_ok_cpu(unsigned cpu)
|
||||
int runqueues_ok_cpu(unsigned cpu)
|
||||
{
|
||||
int q, l = 0;
|
||||
register struct proc *xp;
|
||||
@@ -115,7 +115,7 @@ PUBLIC int runqueues_ok_cpu(unsigned cpu)
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
PRIVATE int runqueues_ok_all(void)
|
||||
static int runqueues_ok_all(void)
|
||||
{
|
||||
unsigned c;
|
||||
|
||||
@@ -126,14 +126,14 @@ PRIVATE int runqueues_ok_all(void)
|
||||
return 1;
|
||||
}
|
||||
|
||||
PUBLIC int runqueues_ok(void)
|
||||
int runqueues_ok(void)
|
||||
{
|
||||
return runqueues_ok_all();
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
PUBLIC int runqueues_ok(void)
|
||||
int runqueues_ok(void)
|
||||
{
|
||||
return runqueues_ok_cpu(0);
|
||||
}
|
||||
@@ -141,7 +141,7 @@ PUBLIC int runqueues_ok(void)
|
||||
|
||||
#endif
|
||||
|
||||
PUBLIC char *
|
||||
char *
|
||||
rtsflagstr(const u32_t flags)
|
||||
{
|
||||
static char str[100];
|
||||
@@ -168,7 +168,7 @@ rtsflagstr(const u32_t flags)
|
||||
return str;
|
||||
}
|
||||
|
||||
PUBLIC char *
|
||||
char *
|
||||
miscflagstr(const u32_t flags)
|
||||
{
|
||||
static char str[100];
|
||||
@@ -182,7 +182,7 @@ miscflagstr(const u32_t flags)
|
||||
return str;
|
||||
}
|
||||
|
||||
PUBLIC char *
|
||||
char *
|
||||
schedulerstr(struct proc *scheduler)
|
||||
{
|
||||
if (scheduler != NULL)
|
||||
@@ -193,7 +193,7 @@ schedulerstr(struct proc *scheduler)
|
||||
return "KERNEL";
|
||||
}
|
||||
|
||||
PRIVATE void
|
||||
static void
|
||||
print_proc_name(struct proc *pp)
|
||||
{
|
||||
char *name = pp->p_name;
|
||||
@@ -207,7 +207,7 @@ print_proc_name(struct proc *pp)
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE void
|
||||
static void
|
||||
print_endpoint(endpoint_t ep)
|
||||
{
|
||||
int proc_nr;
|
||||
@@ -240,7 +240,7 @@ print_endpoint(endpoint_t ep)
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE void
|
||||
static void
|
||||
print_sigmgr(struct proc *pp)
|
||||
{
|
||||
endpoint_t sig_mgr, bak_sig_mgr;
|
||||
@@ -254,7 +254,7 @@ print_sigmgr(struct proc *pp)
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC void print_proc(struct proc *pp)
|
||||
void print_proc(struct proc *pp)
|
||||
{
|
||||
endpoint_t dep;
|
||||
|
||||
@@ -278,7 +278,7 @@ PUBLIC void print_proc(struct proc *pp)
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
PRIVATE void print_proc_depends(struct proc *pp, const int level)
|
||||
static void print_proc_depends(struct proc *pp, const int level)
|
||||
{
|
||||
struct proc *depproc = NULL;
|
||||
endpoint_t dep;
|
||||
@@ -310,13 +310,13 @@ PRIVATE void print_proc_depends(struct proc *pp, const int level)
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC void print_proc_recursive(struct proc *pp)
|
||||
void print_proc_recursive(struct proc *pp)
|
||||
{
|
||||
print_proc_depends(pp, 0);
|
||||
}
|
||||
|
||||
#if DEBUG_DUMPIPC
|
||||
PRIVATE const char *mtypename(int mtype, int iscall)
|
||||
static const char *mtypename(int mtype, int iscall)
|
||||
{
|
||||
/* use generated file to recognize message types */
|
||||
if (iscall) {
|
||||
@@ -337,7 +337,7 @@ PRIVATE const char *mtypename(int mtype, int iscall)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PRIVATE void printproc(struct proc *rp)
|
||||
static void printproc(struct proc *rp)
|
||||
{
|
||||
if (rp)
|
||||
printf(" %s(%d)", rp->p_name, rp - proc);
|
||||
@@ -345,7 +345,7 @@ PRIVATE void printproc(struct proc *rp)
|
||||
printf(" kernel");
|
||||
}
|
||||
|
||||
PRIVATE void printparam(const char *name, const void *data, size_t size)
|
||||
static void printparam(const char *name, const void *data, size_t size)
|
||||
{
|
||||
printf(" %s=", name);
|
||||
switch (size) {
|
||||
@@ -356,7 +356,7 @@ PRIVATE void printparam(const char *name, const void *data, size_t size)
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE void printmsg(message *msg, struct proc *src, struct proc *dst,
|
||||
static void printmsg(message *msg, struct proc *src, struct proc *dst,
|
||||
char operation, int iscall, int printparams)
|
||||
{
|
||||
const char *name;
|
||||
@@ -385,15 +385,15 @@ PRIVATE void printmsg(message *msg, struct proc *src, struct proc *dst,
|
||||
#if DEBUG_IPCSTATS
|
||||
#define IPCPROCS (NR_PROCS+1) /* number of slots we need */
|
||||
#define KERNELIPC NR_PROCS /* slot number to use for kernel calls */
|
||||
PRIVATE int messages[IPCPROCS][IPCPROCS];
|
||||
static int messages[IPCPROCS][IPCPROCS];
|
||||
|
||||
#define PRINTSLOTS 20
|
||||
PRIVATE struct {
|
||||
static struct {
|
||||
int src, dst, messages;
|
||||
} winners[PRINTSLOTS];
|
||||
PRIVATE int total, goodslots;
|
||||
static int total, goodslots;
|
||||
|
||||
PRIVATE void printstats(int ticks)
|
||||
static void printstats(int ticks)
|
||||
{
|
||||
int i;
|
||||
for(i = 0; i < goodslots; i++) {
|
||||
@@ -407,7 +407,7 @@ PRIVATE void printstats(int ticks)
|
||||
printf("total %d/s\n", persec(total));
|
||||
}
|
||||
|
||||
PRIVATE void sortstats(void)
|
||||
static void sortstats(void)
|
||||
{
|
||||
/* Print top message senders/receivers. */
|
||||
int src_slot, dst_slot;
|
||||
@@ -447,7 +447,7 @@ PRIVATE void sortstats(void)
|
||||
assert(s >= 0 && s < IPCPROCS); \
|
||||
}
|
||||
|
||||
PRIVATE void statmsg(message *msg, struct proc *srcp, struct proc *dstp)
|
||||
static void statmsg(message *msg, struct proc *srcp, struct proc *dstp)
|
||||
{
|
||||
int src, dst, now, secs, dt;
|
||||
static int lastprint;
|
||||
@@ -473,14 +473,14 @@ PRIVATE void statmsg(message *msg, struct proc *srcp, struct proc *dstp)
|
||||
#endif
|
||||
|
||||
#if DEBUG_IPC_HOOK
|
||||
PUBLIC void hook_ipc_msgkcall(message *msg, struct proc *proc)
|
||||
void hook_ipc_msgkcall(message *msg, struct proc *proc)
|
||||
{
|
||||
#if DEBUG_DUMPIPC
|
||||
printmsg(msg, proc, NULL, 'k', 1, 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
PUBLIC void hook_ipc_msgkresult(message *msg, struct proc *proc)
|
||||
void hook_ipc_msgkresult(message *msg, struct proc *proc)
|
||||
{
|
||||
#if DEBUG_DUMPIPC
|
||||
printmsg(msg, NULL, proc, 'k', 0, 0);
|
||||
@@ -490,7 +490,7 @@ PUBLIC void hook_ipc_msgkresult(message *msg, struct proc *proc)
|
||||
#endif
|
||||
}
|
||||
|
||||
PUBLIC void hook_ipc_msgrecv(message *msg, struct proc *src, struct proc *dst)
|
||||
void hook_ipc_msgrecv(message *msg, struct proc *src, struct proc *dst)
|
||||
{
|
||||
#if DEBUG_DUMPIPC
|
||||
printmsg(msg, src, dst, 'r', src->p_misc_flags & MF_REPLY_PEND, 0);
|
||||
@@ -500,14 +500,14 @@ PUBLIC void hook_ipc_msgrecv(message *msg, struct proc *src, struct proc *dst)
|
||||
#endif
|
||||
}
|
||||
|
||||
PUBLIC void hook_ipc_msgsend(message *msg, struct proc *src, struct proc *dst)
|
||||
void hook_ipc_msgsend(message *msg, struct proc *src, struct proc *dst)
|
||||
{
|
||||
#if DEBUG_DUMPIPC
|
||||
printmsg(msg, src, dst, 's', src->p_misc_flags & MF_REPLY_PEND, 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
PUBLIC void hook_ipc_clear(struct proc *p)
|
||||
void hook_ipc_clear(struct proc *p)
|
||||
{
|
||||
#if DEBUG_IPCSTATS
|
||||
int slot, i;
|
||||
|
||||
@@ -22,13 +22,13 @@
|
||||
|
||||
|
||||
/* number of lists of IRQ hooks, one list per supported line. */
|
||||
PRIVATE irq_hook_t* irq_handlers[NR_IRQ_VECTORS] = {0};
|
||||
static irq_hook_t* irq_handlers[NR_IRQ_VECTORS] = {0};
|
||||
|
||||
/*===========================================================================*
|
||||
* put_irq_handler *
|
||||
*===========================================================================*/
|
||||
/* Register an interrupt handler. */
|
||||
PUBLIC void put_irq_handler( irq_hook_t* hook, int irq,
|
||||
void put_irq_handler( irq_hook_t* hook, int irq,
|
||||
const irq_handler_t handler)
|
||||
{
|
||||
int id;
|
||||
@@ -74,7 +74,7 @@ PUBLIC void put_irq_handler( irq_hook_t* hook, int irq,
|
||||
* rm_irq_handler *
|
||||
*===========================================================================*/
|
||||
/* Unregister an interrupt handler. */
|
||||
PUBLIC void rm_irq_handler( const irq_hook_t* hook ) {
|
||||
void rm_irq_handler( const irq_hook_t* hook ) {
|
||||
const int irq = hook->irq;
|
||||
const int id = hook->id;
|
||||
irq_hook_t **line;
|
||||
@@ -115,7 +115,7 @@ PUBLIC void rm_irq_handler( const irq_hook_t* hook ) {
|
||||
* the end. Before returning, it unmasks the IRQ if and only if all active ID
|
||||
* bits are cleared, and restart a process.
|
||||
*/
|
||||
PUBLIC void irq_handle(int irq)
|
||||
void irq_handle(int irq)
|
||||
{
|
||||
irq_hook_t * hook;
|
||||
|
||||
@@ -160,7 +160,7 @@ PUBLIC void irq_handle(int irq)
|
||||
}
|
||||
|
||||
/* Enable/Disable a interrupt line. */
|
||||
PUBLIC void enable_irq(const irq_hook_t *hook)
|
||||
void enable_irq(const irq_hook_t *hook)
|
||||
{
|
||||
if((irq_actids[hook->irq] &= ~hook->id) == 0) {
|
||||
hw_intr_unmask(hook->irq);
|
||||
@@ -168,7 +168,7 @@ PUBLIC void enable_irq(const irq_hook_t *hook)
|
||||
}
|
||||
|
||||
/* Return true if the interrupt was enabled before call. */
|
||||
PUBLIC int disable_irq(const irq_hook_t *hook)
|
||||
int disable_irq(const irq_hook_t *hook)
|
||||
{
|
||||
if(irq_actids[hook->irq] & hook->id) /* already disabled */
|
||||
return 0;
|
||||
|
||||
@@ -34,9 +34,9 @@
|
||||
char *** _penviron;
|
||||
|
||||
/* Prototype declarations for PRIVATE functions. */
|
||||
FORWARD void announce(void);
|
||||
static void announce(void);
|
||||
|
||||
PUBLIC void bsp_finish_booting(void)
|
||||
void bsp_finish_booting(void)
|
||||
{
|
||||
int i;
|
||||
#if SPROFILE
|
||||
@@ -110,7 +110,7 @@ PUBLIC void bsp_finish_booting(void)
|
||||
/*===========================================================================*
|
||||
* main *
|
||||
*===========================================================================*/
|
||||
PUBLIC int main(void)
|
||||
int main(void)
|
||||
{
|
||||
/* Start the ball rolling. */
|
||||
struct boot_image *ip; /* boot image pointer */
|
||||
@@ -309,7 +309,7 @@ PUBLIC int main(void)
|
||||
/*===========================================================================*
|
||||
* announce *
|
||||
*===========================================================================*/
|
||||
PRIVATE void announce(void)
|
||||
static void announce(void)
|
||||
{
|
||||
/* Display the MINIX startup banner. */
|
||||
printf("\nMINIX %s.%s. "
|
||||
@@ -324,7 +324,7 @@ PRIVATE void announce(void)
|
||||
/*===========================================================================*
|
||||
* prepare_shutdown *
|
||||
*===========================================================================*/
|
||||
PUBLIC void prepare_shutdown(const int how)
|
||||
void prepare_shutdown(const int how)
|
||||
{
|
||||
/* This function prepares to shutdown MINIX. */
|
||||
static timer_t shutdown_timer;
|
||||
@@ -341,7 +341,7 @@ PUBLIC void prepare_shutdown(const int how)
|
||||
/*===========================================================================*
|
||||
* shutdown *
|
||||
*===========================================================================*/
|
||||
PUBLIC void minix_shutdown(timer_t *tp)
|
||||
void minix_shutdown(timer_t *tp)
|
||||
{
|
||||
/* This function is called from prepare_shutdown or stop_sequence to bring
|
||||
* down MINIX. How to shutdown is in the argument: RBT_HALT (return to the
|
||||
|
||||
@@ -48,27 +48,27 @@
|
||||
#include "arch_proto.h"
|
||||
|
||||
/* Scheduling and message passing functions */
|
||||
FORWARD void idle(void);
|
||||
static void idle(void);
|
||||
/**
|
||||
* Made public for use in clock.c (for user-space scheduling)
|
||||
FORWARD int mini_send(struct proc *caller_ptr, endpoint_t dst_e, message
|
||||
static int mini_send(struct proc *caller_ptr, endpoint_t dst_e, message
|
||||
*m_ptr, int flags);
|
||||
*/
|
||||
FORWARD int mini_receive(struct proc *caller_ptr, endpoint_t src,
|
||||
static int mini_receive(struct proc *caller_ptr, endpoint_t src,
|
||||
message *m_ptr, int flags);
|
||||
FORWARD int mini_senda(struct proc *caller_ptr, asynmsg_t *table, size_t
|
||||
static int mini_senda(struct proc *caller_ptr, asynmsg_t *table, size_t
|
||||
size);
|
||||
FORWARD int deadlock(int function, register struct proc *caller,
|
||||
static int deadlock(int function, register struct proc *caller,
|
||||
endpoint_t src_dst_e);
|
||||
FORWARD int try_async(struct proc *caller_ptr);
|
||||
FORWARD int try_one(struct proc *src_ptr, struct proc *dst_ptr);
|
||||
FORWARD struct proc * pick_proc(void);
|
||||
FORWARD void enqueue_head(struct proc *rp);
|
||||
static int try_async(struct proc *caller_ptr);
|
||||
static int try_one(struct proc *src_ptr, struct proc *dst_ptr);
|
||||
static struct proc * pick_proc(void);
|
||||
static void enqueue_head(struct proc *rp);
|
||||
|
||||
/* all idles share the same idle_priv structure */
|
||||
PRIVATE struct priv idle_priv;
|
||||
static struct priv idle_priv;
|
||||
|
||||
PRIVATE void set_idle_name(char * name, int n)
|
||||
static void set_idle_name(char * name, int n)
|
||||
{
|
||||
int i, c;
|
||||
int p_z = 0;
|
||||
@@ -118,7 +118,7 @@ PRIVATE void set_idle_name(char * name, int n)
|
||||
break; \
|
||||
}
|
||||
|
||||
PUBLIC void proc_init(void)
|
||||
void proc_init(void)
|
||||
{
|
||||
struct proc * rp;
|
||||
struct priv *sp;
|
||||
@@ -174,7 +174,7 @@ PUBLIC void proc_init(void)
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE void switch_address_space_idle(void)
|
||||
static void switch_address_space_idle(void)
|
||||
{
|
||||
#ifdef CONFIG_SMP
|
||||
/*
|
||||
@@ -189,7 +189,7 @@ PRIVATE void switch_address_space_idle(void)
|
||||
/*===========================================================================*
|
||||
* idle *
|
||||
*===========================================================================*/
|
||||
PRIVATE void idle(void)
|
||||
static void idle(void)
|
||||
{
|
||||
struct proc * p;
|
||||
|
||||
@@ -247,7 +247,7 @@ PRIVATE void idle(void)
|
||||
/*===========================================================================*
|
||||
* switch_to_user *
|
||||
*===========================================================================*/
|
||||
PUBLIC void switch_to_user(void)
|
||||
void switch_to_user(void)
|
||||
{
|
||||
/* This function is called an instant before proc_ptr is
|
||||
* to be scheduled again.
|
||||
@@ -423,7 +423,7 @@ check_misc_flags:
|
||||
/*
|
||||
* handler for all synchronous IPC calls
|
||||
*/
|
||||
PRIVATE int do_sync_ipc(struct proc * caller_ptr, /* who made the call */
|
||||
static int do_sync_ipc(struct proc * caller_ptr, /* who made the call */
|
||||
int call_nr, /* system call number and flags */
|
||||
endpoint_t src_dst_e, /* src or dst of the call */
|
||||
message *m_ptr) /* users pointer to a message */
|
||||
@@ -543,7 +543,7 @@ PRIVATE int do_sync_ipc(struct proc * caller_ptr, /* who made the call */
|
||||
return(result);
|
||||
}
|
||||
|
||||
PUBLIC int do_ipc(reg_t r1, reg_t r2, reg_t r3)
|
||||
int do_ipc(reg_t r1, reg_t r2, reg_t r3)
|
||||
{
|
||||
struct proc *const caller_ptr = get_cpulocal_var(proc_ptr); /* get pointer to caller */
|
||||
int call_nr = (int) r1;
|
||||
@@ -633,7 +633,7 @@ PUBLIC int do_ipc(reg_t r1, reg_t r2, reg_t r3)
|
||||
/*===========================================================================*
|
||||
* deadlock *
|
||||
*===========================================================================*/
|
||||
PRIVATE int deadlock(function, cp, src_dst_e)
|
||||
static int deadlock(function, cp, src_dst_e)
|
||||
int function; /* trap number */
|
||||
register struct proc *cp; /* pointer to caller */
|
||||
endpoint_t src_dst_e; /* src or dst process */
|
||||
@@ -702,7 +702,7 @@ endpoint_t src_dst_e; /* src or dst process */
|
||||
/*===========================================================================*
|
||||
* has_pending *
|
||||
*===========================================================================*/
|
||||
PRIVATE int has_pending(sys_map_t *map, int src_p, int asynm)
|
||||
static int has_pending(sys_map_t *map, int src_p, int asynm)
|
||||
{
|
||||
/* Check to see if there is a pending message from the desired source
|
||||
* available.
|
||||
@@ -772,7 +772,7 @@ quit_search:
|
||||
/*===========================================================================*
|
||||
* has_pending_notify *
|
||||
*===========================================================================*/
|
||||
PUBLIC int has_pending_notify(struct proc * caller, int src_p)
|
||||
int has_pending_notify(struct proc * caller, int src_p)
|
||||
{
|
||||
sys_map_t * map = &priv(caller)->s_notify_pending;
|
||||
return has_pending(map, src_p, 0);
|
||||
@@ -781,7 +781,7 @@ PUBLIC int has_pending_notify(struct proc * caller, int src_p)
|
||||
/*===========================================================================*
|
||||
* has_pending_asend *
|
||||
*===========================================================================*/
|
||||
PUBLIC int has_pending_asend(struct proc * caller, int src_p)
|
||||
int has_pending_asend(struct proc * caller, int src_p)
|
||||
{
|
||||
sys_map_t * map = &priv(caller)->s_asyn_pending;
|
||||
return has_pending(map, src_p, 1);
|
||||
@@ -790,7 +790,7 @@ PUBLIC int has_pending_asend(struct proc * caller, int src_p)
|
||||
/*===========================================================================*
|
||||
* unset_notify_pending *
|
||||
*===========================================================================*/
|
||||
PUBLIC void unset_notify_pending(struct proc * caller, int src_p)
|
||||
void unset_notify_pending(struct proc * caller, int src_p)
|
||||
{
|
||||
sys_map_t * map = &priv(caller)->s_notify_pending;
|
||||
unset_sys_bit(*map, src_p);
|
||||
@@ -799,7 +799,7 @@ PUBLIC void unset_notify_pending(struct proc * caller, int src_p)
|
||||
/*===========================================================================*
|
||||
* mini_send *
|
||||
*===========================================================================*/
|
||||
PUBLIC int mini_send(
|
||||
int mini_send(
|
||||
register struct proc *caller_ptr, /* who is trying to send a message? */
|
||||
endpoint_t dst_e, /* to whom is message being sent? */
|
||||
message *m_ptr, /* pointer to message buffer */
|
||||
@@ -896,7 +896,7 @@ PUBLIC int mini_send(
|
||||
/*===========================================================================*
|
||||
* mini_receive *
|
||||
*===========================================================================*/
|
||||
PRIVATE int mini_receive(struct proc * caller_ptr,
|
||||
static int mini_receive(struct proc * caller_ptr,
|
||||
endpoint_t src_e, /* which message source is wanted */
|
||||
message * m_buff_usr, /* pointer to message buffer */
|
||||
const int flags)
|
||||
@@ -1043,7 +1043,7 @@ receive_done:
|
||||
/*===========================================================================*
|
||||
* mini_notify *
|
||||
*===========================================================================*/
|
||||
PUBLIC int mini_notify(
|
||||
int mini_notify(
|
||||
const struct proc *caller_ptr, /* sender of the notification */
|
||||
endpoint_t dst_e /* which process to notify */
|
||||
)
|
||||
@@ -1139,7 +1139,7 @@ field, caller->p_name, entry, priv(caller)->s_asynsize, priv(caller)->s_asyntab)
|
||||
/*===========================================================================*
|
||||
* try_deliver_senda *
|
||||
*===========================================================================*/
|
||||
PUBLIC int try_deliver_senda(struct proc *caller_ptr,
|
||||
int try_deliver_senda(struct proc *caller_ptr,
|
||||
asynmsg_t *table,
|
||||
size_t size)
|
||||
{
|
||||
@@ -1268,7 +1268,7 @@ asyn_error:
|
||||
/*===========================================================================*
|
||||
* mini_senda *
|
||||
*===========================================================================*/
|
||||
PRIVATE int mini_senda(struct proc *caller_ptr, asynmsg_t *table, size_t size)
|
||||
static int mini_senda(struct proc *caller_ptr, asynmsg_t *table, size_t size)
|
||||
{
|
||||
struct priv *privp;
|
||||
|
||||
@@ -1285,7 +1285,7 @@ PRIVATE int mini_senda(struct proc *caller_ptr, asynmsg_t *table, size_t size)
|
||||
/*===========================================================================*
|
||||
* try_async *
|
||||
*===========================================================================*/
|
||||
PRIVATE int try_async(caller_ptr)
|
||||
static int try_async(caller_ptr)
|
||||
struct proc *caller_ptr;
|
||||
{
|
||||
int r;
|
||||
@@ -1328,7 +1328,7 @@ struct proc *caller_ptr;
|
||||
/*===========================================================================*
|
||||
* try_one *
|
||||
*===========================================================================*/
|
||||
PRIVATE int try_one(struct proc *src_ptr, struct proc *dst_ptr)
|
||||
static int try_one(struct proc *src_ptr, struct proc *dst_ptr)
|
||||
{
|
||||
/* Try to receive an asynchronous message from 'src_ptr' */
|
||||
int r = EAGAIN, done, do_notify;
|
||||
@@ -1433,7 +1433,7 @@ asyn_error:
|
||||
/*===========================================================================*
|
||||
* cancel_async *
|
||||
*===========================================================================*/
|
||||
PUBLIC int cancel_async(struct proc *src_ptr, struct proc *dst_ptr)
|
||||
int cancel_async(struct proc *src_ptr, struct proc *dst_ptr)
|
||||
{
|
||||
/* Cancel asynchronous messages from src to dst, because dst is not interested
|
||||
* in them (e.g., dst has been restarted) */
|
||||
@@ -1518,7 +1518,7 @@ asyn_error:
|
||||
/*===========================================================================*
|
||||
* enqueue *
|
||||
*===========================================================================*/
|
||||
PUBLIC void enqueue(
|
||||
void enqueue(
|
||||
register struct proc *rp /* this process is now runnable */
|
||||
)
|
||||
{
|
||||
@@ -1593,7 +1593,7 @@ PUBLIC void enqueue(
|
||||
* process on a run queue. We have to put this process back at the fron to be
|
||||
* fair
|
||||
*/
|
||||
PRIVATE void enqueue_head(struct proc *rp)
|
||||
static void enqueue_head(struct proc *rp)
|
||||
{
|
||||
const int q = rp->p_priority; /* scheduling queue to use */
|
||||
|
||||
@@ -1639,7 +1639,7 @@ PRIVATE void enqueue_head(struct proc *rp)
|
||||
/*===========================================================================*
|
||||
* dequeue *
|
||||
*===========================================================================*/
|
||||
PUBLIC void dequeue(struct proc *rp)
|
||||
void dequeue(struct proc *rp)
|
||||
/* this process is no longer runnable */
|
||||
{
|
||||
/* A process must be removed from the scheduling queues, for example, because
|
||||
@@ -1706,7 +1706,7 @@ PUBLIC void dequeue(struct proc *rp)
|
||||
/*===========================================================================*
|
||||
* pick_proc *
|
||||
*===========================================================================*/
|
||||
PRIVATE struct proc * pick_proc(void)
|
||||
static struct proc * pick_proc(void)
|
||||
{
|
||||
/* Decide who to run now. A new process is selected an returned.
|
||||
* When a billable process is selected, record it in 'bill_ptr', so that the
|
||||
@@ -1739,7 +1739,7 @@ PRIVATE struct proc * pick_proc(void)
|
||||
/*===========================================================================*
|
||||
* endpoint_lookup *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct proc *endpoint_lookup(endpoint_t e)
|
||||
struct proc *endpoint_lookup(endpoint_t e)
|
||||
{
|
||||
int n;
|
||||
|
||||
@@ -1752,11 +1752,11 @@ PUBLIC struct proc *endpoint_lookup(endpoint_t e)
|
||||
* isokendpt_f *
|
||||
*===========================================================================*/
|
||||
#if DEBUG_ENABLE_IPC_WARNINGS
|
||||
PUBLIC int isokendpt_f(file, line, e, p, fatalflag)
|
||||
int isokendpt_f(file, line, e, p, fatalflag)
|
||||
const char *file;
|
||||
int line;
|
||||
#else
|
||||
PUBLIC int isokendpt_f(e, p, fatalflag)
|
||||
int isokendpt_f(e, p, fatalflag)
|
||||
#endif
|
||||
endpoint_t e;
|
||||
int *p;
|
||||
@@ -1799,7 +1799,7 @@ const int fatalflag;
|
||||
return ok;
|
||||
}
|
||||
|
||||
PRIVATE void notify_scheduler(struct proc *p)
|
||||
static void notify_scheduler(struct proc *p)
|
||||
{
|
||||
message m_no_quantum;
|
||||
int err;
|
||||
@@ -1832,7 +1832,7 @@ PRIVATE void notify_scheduler(struct proc *p)
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC void proc_no_time(struct proc * p)
|
||||
void proc_no_time(struct proc * p)
|
||||
{
|
||||
if (!proc_kernel_scheduler(p) && priv(p)->s_flags & PREEMPTIBLE) {
|
||||
/* this dequeues the process */
|
||||
@@ -1851,7 +1851,7 @@ PUBLIC void proc_no_time(struct proc * p)
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC void reset_proc_accounting(struct proc *p)
|
||||
void reset_proc_accounting(struct proc *p)
|
||||
{
|
||||
p->p_accounting.preempted = 0;
|
||||
p->p_accounting.ipc_sync = 0;
|
||||
@@ -1861,7 +1861,7 @@ PUBLIC void reset_proc_accounting(struct proc *p)
|
||||
make_zero64(p->p_accounting.enter_queue);
|
||||
}
|
||||
|
||||
PUBLIC void copr_not_available_handler(void)
|
||||
void copr_not_available_handler(void)
|
||||
{
|
||||
struct proc * p;
|
||||
struct proc ** local_fpu_owner;
|
||||
@@ -1900,7 +1900,7 @@ PUBLIC void copr_not_available_handler(void)
|
||||
NOT_REACHABLE;
|
||||
}
|
||||
|
||||
PUBLIC void release_fpu(struct proc * p) {
|
||||
void release_fpu(struct proc * p) {
|
||||
struct proc ** fpu_owner_ptr;
|
||||
|
||||
fpu_owner_ptr = get_cpu_var_ptr(p->p_cpu, fpu_owner);
|
||||
|
||||
@@ -31,15 +31,15 @@
|
||||
char sprof_sample_buffer[SAMPLE_BUFFER_SIZE];
|
||||
|
||||
/* Function prototype for the profiling clock handler. */
|
||||
FORWARD int profile_clock_handler(irq_hook_t *hook);
|
||||
static int profile_clock_handler(irq_hook_t *hook);
|
||||
|
||||
/* A hook for the profiling clock interrupt handler. */
|
||||
PRIVATE irq_hook_t profile_clock_hook;
|
||||
static irq_hook_t profile_clock_hook;
|
||||
|
||||
/*===========================================================================*
|
||||
* init_profile_clock *
|
||||
*===========================================================================*/
|
||||
PUBLIC void init_profile_clock(u32_t freq)
|
||||
void init_profile_clock(u32_t freq)
|
||||
{
|
||||
int irq;
|
||||
|
||||
@@ -54,7 +54,7 @@ PUBLIC void init_profile_clock(u32_t freq)
|
||||
/*===========================================================================*
|
||||
* profile_clock_stop *
|
||||
*===========================================================================*/
|
||||
PUBLIC void stop_profile_clock()
|
||||
void stop_profile_clock()
|
||||
{
|
||||
arch_stop_profile_clock();
|
||||
|
||||
@@ -63,7 +63,7 @@ PUBLIC void stop_profile_clock()
|
||||
rm_irq_handler(&profile_clock_hook);
|
||||
}
|
||||
|
||||
PRIVATE void sprof_save_sample(struct proc * p, void * pc)
|
||||
static void sprof_save_sample(struct proc * p, void * pc)
|
||||
{
|
||||
struct sprof_sample *s;
|
||||
|
||||
@@ -75,7 +75,7 @@ PRIVATE void sprof_save_sample(struct proc * p, void * pc)
|
||||
sprof_info.mem_used += sizeof(struct sprof_sample);
|
||||
}
|
||||
|
||||
PRIVATE void sprof_save_proc(struct proc * p)
|
||||
static void sprof_save_proc(struct proc * p)
|
||||
{
|
||||
struct sprof_proc * s;
|
||||
|
||||
@@ -87,7 +87,7 @@ PRIVATE void sprof_save_proc(struct proc * p)
|
||||
sprof_info.mem_used += sizeof(struct sprof_proc);
|
||||
}
|
||||
|
||||
PRIVATE void profile_sample(struct proc * p, void * pc)
|
||||
static void profile_sample(struct proc * p, void * pc)
|
||||
{
|
||||
/* This executes on every tick of the CMOS timer. */
|
||||
|
||||
@@ -127,7 +127,7 @@ PRIVATE void profile_sample(struct proc * p, void * pc)
|
||||
/*===========================================================================*
|
||||
* profile_clock_handler *
|
||||
*===========================================================================*/
|
||||
PRIVATE int profile_clock_handler(irq_hook_t *hook)
|
||||
static int profile_clock_handler(irq_hook_t *hook)
|
||||
{
|
||||
struct proc * p;
|
||||
p = get_cpulocal_var(proc_ptr);
|
||||
@@ -140,7 +140,7 @@ PRIVATE int profile_clock_handler(irq_hook_t *hook)
|
||||
return(1); /* reenable interrupts */
|
||||
}
|
||||
|
||||
PUBLIC void nmi_sprofile_handler(struct nmi_frame * frame)
|
||||
void nmi_sprofile_handler(struct nmi_frame * frame)
|
||||
{
|
||||
struct proc * p = get_cpulocal_var(proc_ptr);
|
||||
/*
|
||||
@@ -184,13 +184,13 @@ PUBLIC void nmi_sprofile_handler(struct nmi_frame * frame)
|
||||
struct cprof_tbl_s cprof_tbl[CPROF_TABLE_SIZE_KERNEL];
|
||||
|
||||
/* Function that returns table size. */
|
||||
PUBLIC int profile_get_tbl_size(void)
|
||||
int profile_get_tbl_size(void)
|
||||
{
|
||||
return CPROF_TABLE_SIZE_KERNEL;
|
||||
}
|
||||
|
||||
/* Function that returns on which execution of procentry to announce. */
|
||||
PUBLIC int profile_get_announce(void)
|
||||
int profile_get_announce(void)
|
||||
{
|
||||
return CPROF_ACCOUNCE_KERNEL;
|
||||
}
|
||||
@@ -199,7 +199,7 @@ PUBLIC int profile_get_announce(void)
|
||||
* The kernel "announces" its control struct and table locations
|
||||
* to itself through this function.
|
||||
*/
|
||||
PUBLIC void profile_register(ctl_ptr, tbl_ptr)
|
||||
void profile_register(ctl_ptr, tbl_ptr)
|
||||
void *ctl_ptr;
|
||||
void *tbl_ptr;
|
||||
{
|
||||
|
||||
26
kernel/smp.c
26
kernel/smp.c
@@ -8,7 +8,7 @@ unsigned ncpus;
|
||||
unsigned ht_per_core;
|
||||
unsigned bsp_cpu_id;
|
||||
|
||||
PUBLIC struct cpu cpus[CONFIG_MAX_CPUS];
|
||||
struct cpu cpus[CONFIG_MAX_CPUS];
|
||||
|
||||
/* info passed to another cpu along with a sched ipi */
|
||||
struct sched_ipi_data {
|
||||
@@ -16,7 +16,7 @@ struct sched_ipi_data {
|
||||
volatile u32_t data;
|
||||
};
|
||||
|
||||
PRIVATE struct sched_ipi_data sched_ipi_data[CONFIG_MAX_CPUS];
|
||||
static struct sched_ipi_data sched_ipi_data[CONFIG_MAX_CPUS];
|
||||
|
||||
#define SCHED_IPI_STOP_PROC 1
|
||||
#define SCHED_IPI_VM_INHIBIT 2
|
||||
@@ -27,7 +27,7 @@ static volatile unsigned ap_cpus_booted;
|
||||
SPINLOCK_DEFINE(big_kernel_lock)
|
||||
SPINLOCK_DEFINE(boot_lock)
|
||||
|
||||
PUBLIC void wait_for_APs_to_finish_booting(void)
|
||||
void wait_for_APs_to_finish_booting(void)
|
||||
{
|
||||
unsigned n = 0;
|
||||
int i;
|
||||
@@ -48,19 +48,19 @@ PUBLIC void wait_for_APs_to_finish_booting(void)
|
||||
BKL_LOCK();
|
||||
}
|
||||
|
||||
PUBLIC void ap_boot_finished(unsigned cpu)
|
||||
void ap_boot_finished(unsigned cpu)
|
||||
{
|
||||
ap_cpus_booted++;
|
||||
}
|
||||
|
||||
PUBLIC void smp_ipi_halt_handler(void)
|
||||
void smp_ipi_halt_handler(void)
|
||||
{
|
||||
ipi_ack();
|
||||
stop_local_timer();
|
||||
arch_smp_halt_cpu();
|
||||
}
|
||||
|
||||
PUBLIC void smp_schedule(unsigned cpu)
|
||||
void smp_schedule(unsigned cpu)
|
||||
{
|
||||
arch_send_smp_schedule_ipi(cpu);
|
||||
}
|
||||
@@ -72,7 +72,7 @@ void smp_sched_handler(void);
|
||||
* the task is finished. Also wait before it finishes task sent by another cpu
|
||||
* to the same one.
|
||||
*/
|
||||
PRIVATE void smp_schedule_sync(struct proc * p, unsigned task)
|
||||
static void smp_schedule_sync(struct proc * p, unsigned task)
|
||||
{
|
||||
unsigned cpu = p->p_cpu;
|
||||
unsigned mycpu = cpuid;
|
||||
@@ -111,7 +111,7 @@ PRIVATE void smp_schedule_sync(struct proc * p, unsigned task)
|
||||
BKL_LOCK();
|
||||
}
|
||||
|
||||
PUBLIC void smp_schedule_stop_proc(struct proc * p)
|
||||
void smp_schedule_stop_proc(struct proc * p)
|
||||
{
|
||||
if (proc_is_runnable(p))
|
||||
smp_schedule_sync(p, SCHED_IPI_STOP_PROC);
|
||||
@@ -120,7 +120,7 @@ PUBLIC void smp_schedule_stop_proc(struct proc * p)
|
||||
assert(RTS_ISSET(p, RTS_PROC_STOP));
|
||||
}
|
||||
|
||||
PUBLIC void smp_schedule_vminhibit(struct proc * p)
|
||||
void smp_schedule_vminhibit(struct proc * p)
|
||||
{
|
||||
if (proc_is_runnable(p))
|
||||
smp_schedule_sync(p, SCHED_IPI_VM_INHIBIT);
|
||||
@@ -129,7 +129,7 @@ PUBLIC void smp_schedule_vminhibit(struct proc * p)
|
||||
assert(RTS_ISSET(p, RTS_VMINHIBIT));
|
||||
}
|
||||
|
||||
PUBLIC void smp_schedule_stop_proc_save_ctx(struct proc * p)
|
||||
void smp_schedule_stop_proc_save_ctx(struct proc * p)
|
||||
{
|
||||
/*
|
||||
* stop the processes and force the complete context of the process to
|
||||
@@ -139,7 +139,7 @@ PUBLIC void smp_schedule_stop_proc_save_ctx(struct proc * p)
|
||||
assert(RTS_ISSET(p, RTS_PROC_STOP));
|
||||
}
|
||||
|
||||
PUBLIC void smp_schedule_migrate_proc(struct proc * p, unsigned dest_cpu)
|
||||
void smp_schedule_migrate_proc(struct proc * p, unsigned dest_cpu)
|
||||
{
|
||||
/*
|
||||
* stop the processes and force the complete context of the process to
|
||||
@@ -153,7 +153,7 @@ PUBLIC void smp_schedule_migrate_proc(struct proc * p, unsigned dest_cpu)
|
||||
RTS_UNSET(p, RTS_PROC_STOP);
|
||||
}
|
||||
|
||||
PUBLIC void smp_sched_handler(void)
|
||||
void smp_sched_handler(void)
|
||||
{
|
||||
unsigned flgs;
|
||||
unsigned cpu = cpuid;
|
||||
@@ -191,7 +191,7 @@ PUBLIC void smp_sched_handler(void)
|
||||
* already called. It only serves the purpose of acknowledging the IPI and
|
||||
* preempting the current process if the CPU was not idle.
|
||||
*/
|
||||
PUBLIC void smp_ipi_sched_handler(void)
|
||||
void smp_ipi_sched_handler(void)
|
||||
{
|
||||
struct proc * curr;
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
/*===========================================================================*
|
||||
* cstart *
|
||||
*===========================================================================*/
|
||||
PUBLIC void cstart(
|
||||
void cstart(
|
||||
u16_t cs, /* kernel code segment */
|
||||
u16_t ds, /* kernel data segment */
|
||||
u16_t mds, /* monitor data segment */
|
||||
@@ -124,7 +124,7 @@ PUBLIC void cstart(
|
||||
* get_value *
|
||||
*===========================================================================*/
|
||||
|
||||
PUBLIC char *get_value(
|
||||
char *get_value(
|
||||
const char *params, /* boot monitor parameters */
|
||||
const char *name /* key to look up */
|
||||
)
|
||||
@@ -148,7 +148,7 @@ PUBLIC char *get_value(
|
||||
/*===========================================================================*
|
||||
* env_get *
|
||||
*===========================================================================*/
|
||||
PUBLIC char *env_get(const char *name)
|
||||
char *env_get(const char *name)
|
||||
{
|
||||
return get_value(params_buffer, name);
|
||||
}
|
||||
|
||||
@@ -51,14 +51,14 @@
|
||||
* because the dummy is declared extern. If an illegal call is given, the
|
||||
* array size will be negative and this won't compile.
|
||||
*/
|
||||
PRIVATE int (*call_vec[NR_SYS_CALLS])(struct proc * caller, message *m_ptr);
|
||||
static int (*call_vec[NR_SYS_CALLS])(struct proc * caller, message *m_ptr);
|
||||
|
||||
#define map(call_nr, handler) \
|
||||
{ int call_index = call_nr-KERNEL_CALL; \
|
||||
assert(call_index >= 0 && call_index < NR_SYS_CALLS); \
|
||||
call_vec[call_index] = (handler) ; }
|
||||
|
||||
PRIVATE void kernel_call_finish(struct proc * caller, message *msg, int result)
|
||||
static void kernel_call_finish(struct proc * caller, message *msg, int result)
|
||||
{
|
||||
if(result == VMSUSPEND) {
|
||||
/* Special case: message has to be saved for handling
|
||||
@@ -95,7 +95,7 @@ PRIVATE void kernel_call_finish(struct proc * caller, message *msg, int result)
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE int kernel_call_dispatch(struct proc * caller, message *msg)
|
||||
static int kernel_call_dispatch(struct proc * caller, message *msg)
|
||||
{
|
||||
int result = OK;
|
||||
int call_nr;
|
||||
@@ -136,7 +136,7 @@ PRIVATE int kernel_call_dispatch(struct proc * caller, message *msg)
|
||||
* this function checks the basic syscall parameters and if accepted it
|
||||
* dispatches its handling to the right handler
|
||||
*/
|
||||
PUBLIC void kernel_call(message *m_user, struct proc * caller)
|
||||
void kernel_call(message *m_user, struct proc * caller)
|
||||
{
|
||||
int result = OK;
|
||||
message msg;
|
||||
@@ -168,7 +168,7 @@ PUBLIC void kernel_call(message *m_user, struct proc * caller)
|
||||
/*===========================================================================*
|
||||
* initialize *
|
||||
*===========================================================================*/
|
||||
PUBLIC void system_init(void)
|
||||
void system_init(void)
|
||||
{
|
||||
register struct priv *sp;
|
||||
int i;
|
||||
@@ -272,7 +272,7 @@ PUBLIC void system_init(void)
|
||||
/*===========================================================================*
|
||||
* get_priv *
|
||||
*===========================================================================*/
|
||||
PUBLIC int get_priv(rc, priv_id)
|
||||
int get_priv(rc, priv_id)
|
||||
register struct proc *rc; /* new (child) process pointer */
|
||||
int priv_id; /* privilege id */
|
||||
{
|
||||
@@ -304,7 +304,7 @@ int priv_id; /* privilege id */
|
||||
/*===========================================================================*
|
||||
* set_sendto_bit *
|
||||
*===========================================================================*/
|
||||
PUBLIC void set_sendto_bit(const struct proc *rp, int id)
|
||||
void set_sendto_bit(const struct proc *rp, int id)
|
||||
{
|
||||
/* Allow a process to send messages to the process(es) associated with the
|
||||
* system privilege structure with the given ID.
|
||||
@@ -332,7 +332,7 @@ PUBLIC void set_sendto_bit(const struct proc *rp, int id)
|
||||
/*===========================================================================*
|
||||
* unset_sendto_bit *
|
||||
*===========================================================================*/
|
||||
PUBLIC void unset_sendto_bit(const struct proc *rp, int id)
|
||||
void unset_sendto_bit(const struct proc *rp, int id)
|
||||
{
|
||||
/* Prevent a process from sending to another process. Retain the send mask
|
||||
* symmetry by also unsetting the bit for the other direction.
|
||||
@@ -346,7 +346,7 @@ PUBLIC void unset_sendto_bit(const struct proc *rp, int id)
|
||||
/*===========================================================================*
|
||||
* fill_sendto_mask *
|
||||
*===========================================================================*/
|
||||
PUBLIC void fill_sendto_mask(const struct proc *rp, sys_map_t *map)
|
||||
void fill_sendto_mask(const struct proc *rp, sys_map_t *map)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -361,7 +361,7 @@ PUBLIC void fill_sendto_mask(const struct proc *rp, sys_map_t *map)
|
||||
/*===========================================================================*
|
||||
* send_sig *
|
||||
*===========================================================================*/
|
||||
PUBLIC void send_sig(endpoint_t ep, int sig_nr)
|
||||
void send_sig(endpoint_t ep, int sig_nr)
|
||||
{
|
||||
/* Notify a system process about a signal. This is straightforward. Simply
|
||||
* set the signal that is to be delivered in the pending signals map and
|
||||
@@ -381,7 +381,7 @@ PUBLIC void send_sig(endpoint_t ep, int sig_nr)
|
||||
/*===========================================================================*
|
||||
* cause_sig *
|
||||
*===========================================================================*/
|
||||
PUBLIC void cause_sig(proc_nr, sig_nr)
|
||||
void cause_sig(proc_nr, sig_nr)
|
||||
proc_nr_t proc_nr; /* process to be signalled */
|
||||
int sig_nr; /* signal to be sent */
|
||||
{
|
||||
@@ -443,7 +443,7 @@ int sig_nr; /* signal to be sent */
|
||||
/*===========================================================================*
|
||||
* sig_delay_done *
|
||||
*===========================================================================*/
|
||||
PUBLIC void sig_delay_done(struct proc *rp)
|
||||
void sig_delay_done(struct proc *rp)
|
||||
{
|
||||
/* A process is now known not to send any direct messages.
|
||||
* Tell PM that the stop delay has ended, by sending a signal to the process.
|
||||
@@ -460,7 +460,7 @@ PUBLIC void sig_delay_done(struct proc *rp)
|
||||
/*===========================================================================*
|
||||
* umap_bios *
|
||||
*===========================================================================*/
|
||||
PUBLIC phys_bytes umap_bios(vir_addr, bytes)
|
||||
phys_bytes umap_bios(vir_addr, bytes)
|
||||
vir_bytes vir_addr; /* virtual address in BIOS segment */
|
||||
vir_bytes bytes; /* # of bytes to be copied */
|
||||
{
|
||||
@@ -485,7 +485,7 @@ vir_bytes bytes; /* # of bytes to be copied */
|
||||
/*===========================================================================*
|
||||
* clear_ipc *
|
||||
*===========================================================================*/
|
||||
PRIVATE void clear_ipc(
|
||||
static void clear_ipc(
|
||||
register struct proc *rc /* slot of process to clean up */
|
||||
)
|
||||
{
|
||||
@@ -516,7 +516,7 @@ PRIVATE void clear_ipc(
|
||||
/*===========================================================================*
|
||||
* clear_endpoint *
|
||||
*===========================================================================*/
|
||||
PUBLIC void clear_endpoint(rc)
|
||||
void clear_endpoint(rc)
|
||||
register struct proc *rc; /* slot of process to clean up */
|
||||
{
|
||||
if(isemptyp(rc)) panic("clear_proc: empty process: %d", rc->p_endpoint);
|
||||
@@ -549,7 +549,7 @@ register struct proc *rc; /* slot of process to clean up */
|
||||
/*===========================================================================*
|
||||
* clear_ipc_refs *
|
||||
*===========================================================================*/
|
||||
PUBLIC void clear_ipc_refs(rc, caller_ret)
|
||||
void clear_ipc_refs(rc, caller_ret)
|
||||
register struct proc *rc; /* slot of process to clean up */
|
||||
int caller_ret; /* code to return on callers */
|
||||
{
|
||||
@@ -583,7 +583,7 @@ int caller_ret; /* code to return on callers */
|
||||
/*===========================================================================*
|
||||
* kernel_call_resume *
|
||||
*===========================================================================*/
|
||||
PUBLIC void kernel_call_resume(struct proc *caller)
|
||||
void kernel_call_resume(struct proc *caller)
|
||||
{
|
||||
int result;
|
||||
|
||||
@@ -613,7 +613,7 @@ PUBLIC void kernel_call_resume(struct proc *caller)
|
||||
/*===========================================================================*
|
||||
* sched_proc *
|
||||
*===========================================================================*/
|
||||
PUBLIC int sched_proc(struct proc *p,
|
||||
int sched_proc(struct proc *p,
|
||||
int priority,
|
||||
int quantum,
|
||||
int cpu)
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
/*===========================================================================*
|
||||
* do_abort *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_abort(struct proc * caller, message * m_ptr)
|
||||
int do_abort(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
/* Handle sys_abort. MINIX is unable to continue. This can originate e.g.
|
||||
* in the PM (normal abort) or TTY (after CTRL-ALT-DEL).
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
/*===========================================================================*
|
||||
* do_clear *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_clear(struct proc * caller, message * m_ptr)
|
||||
int do_clear(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
/* Handle sys_clear. Only the PM can request other process slots to be cleared
|
||||
* when a process has exited.
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
/*===========================================================================*
|
||||
* do_copy *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_copy(struct proc * caller, message * m_ptr)
|
||||
int do_copy(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
/* Handle sys_vircopy() and sys_physcopy(). Copy data using virtual or
|
||||
* physical addressing. Although a single handler function is used, there
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
/*===========================================================================*
|
||||
* do_cprofile *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_cprofile(struct proc * caller, message * m_ptr)
|
||||
int do_cprofile(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
int proc_nr, i;
|
||||
phys_bytes len;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
/*===========================================================================*
|
||||
* do_devio *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_devio(struct proc * caller, message * m_ptr)
|
||||
int do_devio(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
struct priv *privp;
|
||||
port_t port;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
/*===========================================================================*
|
||||
* do_endksig *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_endksig(struct proc * caller, message * m_ptr)
|
||||
int do_endksig(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
/* Finish up after a kernel type signal, caused by a SYS_KILL message or a
|
||||
* call to cause_sig by a task. This is called by a signal manager after
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
/*===========================================================================*
|
||||
* do_exec *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_exec(struct proc * caller, message * m_ptr)
|
||||
int do_exec(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
/* Handle sys_exec(). A process has done a successful EXEC. Patch it up. */
|
||||
register struct proc *rp;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
/*===========================================================================*
|
||||
* do_exit *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_exit(struct proc * caller, message * m_ptr)
|
||||
int do_exit(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
/* Handle sys_exit. A system process has requested to exit. Generate a
|
||||
* self-termination signal.
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
/*===========================================================================*
|
||||
* do_fork *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_fork(struct proc * caller, message * m_ptr)
|
||||
int do_fork(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
/* Handle sys_fork(). PR_ENDPT has forked. The child is PR_SLOT. */
|
||||
#if (_MINIX_CHIP == _CHIP_INTEL)
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
/*===========================================================================*
|
||||
* update_idle_time *
|
||||
*===========================================================================*/
|
||||
PRIVATE void update_idle_time(void)
|
||||
static void update_idle_time(void)
|
||||
{
|
||||
int i;
|
||||
struct proc * idl = proc_addr(IDLE);
|
||||
@@ -38,7 +38,7 @@ PRIVATE void update_idle_time(void)
|
||||
/*===========================================================================*
|
||||
* do_getinfo *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_getinfo(struct proc * caller, message * m_ptr)
|
||||
int do_getinfo(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
/* Request system information to be copied to caller's address space. This
|
||||
* call simply copies entire data structures to the caller.
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
/*===========================================================================*
|
||||
* do_getksig *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_getksig(struct proc * caller, message * m_ptr)
|
||||
int do_getksig(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
/* The signal manager is ready to accept signals and repeatedly does a kernel
|
||||
* call to get one. Find a process with pending signals. If no signals are
|
||||
|
||||
@@ -16,12 +16,12 @@
|
||||
|
||||
#if USE_IRQCTL
|
||||
|
||||
FORWARD int generic_handler(irq_hook_t *hook);
|
||||
static int generic_handler(irq_hook_t *hook);
|
||||
|
||||
/*===========================================================================*
|
||||
* do_irqctl *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_irqctl(struct proc * caller, message * m_ptr)
|
||||
int do_irqctl(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
/* Dismember the request message. */
|
||||
int irq_vec;
|
||||
@@ -141,7 +141,7 @@ PUBLIC int do_irqctl(struct proc * caller, message * m_ptr)
|
||||
/*===========================================================================*
|
||||
* generic_handler *
|
||||
*===========================================================================*/
|
||||
PRIVATE int generic_handler(hook)
|
||||
static int generic_handler(hook)
|
||||
irq_hook_t *hook;
|
||||
{
|
||||
/* This function handles hardware interrupt in a simple and generic way. All
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
/*===========================================================================*
|
||||
* do_kill *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_kill(struct proc * caller, message * m_ptr)
|
||||
int do_kill(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
/* Handle sys_kill(). Cause a signal to be sent to a process. Any request
|
||||
* is added to the map of pending signals and the signal manager
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
/*===========================================================================*
|
||||
* do_getmcontext *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_getmcontext(struct proc * caller, message * m_ptr)
|
||||
int do_getmcontext(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
/* Retrieve machine context of a process */
|
||||
|
||||
@@ -64,7 +64,7 @@ PUBLIC int do_getmcontext(struct proc * caller, message * m_ptr)
|
||||
/*===========================================================================*
|
||||
* do_setmcontext *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_setmcontext(struct proc * caller, message * m_ptr)
|
||||
int do_setmcontext(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
/* Set machine context of a process */
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
/*===========================================================================*
|
||||
* do_memset *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_memset(struct proc * caller, message * m_ptr)
|
||||
int do_memset(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
/* Handle sys_memset(). This writes a pattern into the specified memory. */
|
||||
unsigned char c = m_ptr->MEM_PATTERN;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
/*===========================================================================*
|
||||
* do_newmap *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_newmap(struct proc * caller, message * m_ptr)
|
||||
int do_newmap(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
/* Handle sys_newmap(). Fetch the memory map. */
|
||||
struct proc *rp; /* process whose map is to be loaded */
|
||||
@@ -32,7 +32,7 @@ PUBLIC int do_newmap(struct proc * caller, message * m_ptr)
|
||||
/*===========================================================================*
|
||||
* newmap *
|
||||
*===========================================================================*/
|
||||
PUBLIC int newmap(struct proc *caller, struct proc *rp, struct mem_map *map_ptr)
|
||||
int newmap(struct proc *caller, struct proc *rp, struct mem_map *map_ptr)
|
||||
{
|
||||
int r;
|
||||
/* Fetch the memory map. */
|
||||
|
||||
@@ -17,12 +17,12 @@
|
||||
|
||||
#define PRIV_DEBUG 0
|
||||
|
||||
FORWARD int update_priv(struct proc *rp, struct priv *priv);
|
||||
static int update_priv(struct proc *rp, struct priv *priv);
|
||||
|
||||
/*===========================================================================*
|
||||
* do_privctl *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_privctl(struct proc * caller, message * m_ptr)
|
||||
int do_privctl(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
/* Handle sys_privctl(). Update a process' privileges. If the process is not
|
||||
* yet a system process, make sure it gets its own privilege structure.
|
||||
@@ -317,7 +317,7 @@ PUBLIC int do_privctl(struct proc * caller, message * m_ptr)
|
||||
/*===========================================================================*
|
||||
* update_priv *
|
||||
*===========================================================================*/
|
||||
PRIVATE int update_priv(struct proc *rp, struct priv *priv)
|
||||
static int update_priv(struct proc *rp, struct priv *priv)
|
||||
{
|
||||
/* Update the privilege structure of a given process. */
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
/*===========================================================================*
|
||||
* do_profbuf *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_profbuf(struct proc * caller, message * m_ptr)
|
||||
int do_profbuf(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
/* This kernel call is used by profiled system processes when Call
|
||||
* Profiling is enabled. It is called on the first execution of procentry.
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
/*===========================================================================*
|
||||
* do_runctl *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_runctl(struct proc * caller, message * m_ptr)
|
||||
int do_runctl(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
/* Control a process's RTS_PROC_STOP flag. Used for process management.
|
||||
* If the process is queued sending a message or stopped for system call
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
#define MEM_TOP 0xFFFFFFFFUL
|
||||
|
||||
FORWARD int safecopy(struct proc *, endpoint_t, endpoint_t,
|
||||
static int safecopy(struct proc *, endpoint_t, endpoint_t,
|
||||
cp_grant_id_t, int, int, size_t, vir_bytes, vir_bytes, int);
|
||||
|
||||
#define HASGRANTTABLE(gr) \
|
||||
@@ -32,7 +32,7 @@ FORWARD int safecopy(struct proc *, endpoint_t, endpoint_t,
|
||||
/*===========================================================================*
|
||||
* verify_grant *
|
||||
*===========================================================================*/
|
||||
PUBLIC int verify_grant(granter, grantee, grant, bytes, access,
|
||||
int verify_grant(granter, grantee, grant, bytes, access,
|
||||
offset_in, offset_result, e_granter)
|
||||
endpoint_t granter, grantee; /* copyee, copyer */
|
||||
cp_grant_id_t grant; /* grant id */
|
||||
@@ -226,7 +226,7 @@ endpoint_t *e_granter; /* new granter (magic grants) */
|
||||
/*===========================================================================*
|
||||
* safecopy *
|
||||
*===========================================================================*/
|
||||
PRIVATE int safecopy(caller, granter, grantee, grantid, src_seg, dst_seg, bytes,
|
||||
static int safecopy(caller, granter, grantee, grantid, src_seg, dst_seg, bytes,
|
||||
g_offset, addr, access)
|
||||
struct proc * caller;
|
||||
endpoint_t granter, grantee;
|
||||
@@ -344,7 +344,7 @@ int access; /* CPF_READ for a copy from granter to grantee, CPF_WRITE
|
||||
/*===========================================================================*
|
||||
* do_safecopy_to *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_safecopy_to(struct proc * caller, message * m_ptr)
|
||||
int do_safecopy_to(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
return safecopy(caller, m_ptr->SCP_FROM_TO, caller->p_endpoint,
|
||||
(cp_grant_id_t) m_ptr->SCP_GID, m_ptr->SCP_SEG, D,
|
||||
@@ -355,7 +355,7 @@ PUBLIC int do_safecopy_to(struct proc * caller, message * m_ptr)
|
||||
/*===========================================================================*
|
||||
* do_safecopy_from *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_safecopy_from(struct proc * caller, message * m_ptr)
|
||||
int do_safecopy_from(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
return safecopy(caller, m_ptr->SCP_FROM_TO, caller->p_endpoint,
|
||||
(cp_grant_id_t) m_ptr->SCP_GID, D, m_ptr->SCP_SEG,
|
||||
@@ -366,7 +366,7 @@ PUBLIC int do_safecopy_from(struct proc * caller, message * m_ptr)
|
||||
/*===========================================================================*
|
||||
* do_vsafecopy *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_vsafecopy(struct proc * caller, message * m_ptr)
|
||||
int do_vsafecopy(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
static struct vscp_vec vec[SCPVEC_NR];
|
||||
static struct vir_addr src, dst;
|
||||
|
||||
@@ -117,7 +117,7 @@ static void clear_info(struct map_info_s *p)
|
||||
/*===========================================================================*
|
||||
* map_invoke_vm *
|
||||
*===========================================================================*/
|
||||
PUBLIC int map_invoke_vm(struct proc * caller,
|
||||
int map_invoke_vm(struct proc * caller,
|
||||
int req_type, /* VMPTYPE_... COWMAP, SMAP, SUNMAP */
|
||||
endpoint_t end_d, int seg_d, vir_bytes off_d,
|
||||
endpoint_t end_s, int seg_s, vir_bytes off_s,
|
||||
@@ -172,7 +172,7 @@ PUBLIC int map_invoke_vm(struct proc * caller,
|
||||
/*===========================================================================*
|
||||
* do_safemap *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_safemap(struct proc * caller, message * m_ptr)
|
||||
int do_safemap(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
endpoint_t grantor = m_ptr->SMAP_EP;
|
||||
cp_grant_id_t gid = (cp_grant_id_t) m_ptr->SMAP_GID;
|
||||
@@ -222,7 +222,7 @@ PUBLIC int do_safemap(struct proc * caller, message * m_ptr)
|
||||
/*===========================================================================*
|
||||
* safeunmap *
|
||||
*===========================================================================*/
|
||||
PRIVATE int safeunmap(struct proc * caller, struct map_info_s *p)
|
||||
static int safeunmap(struct proc * caller, struct map_info_s *p)
|
||||
{
|
||||
vir_bytes offset_result;
|
||||
endpoint_t new_grantor;
|
||||
@@ -250,7 +250,7 @@ PRIVATE int safeunmap(struct proc * caller, struct map_info_s *p)
|
||||
/*===========================================================================*
|
||||
* do_saferevmap *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_saferevmap(struct proc * caller, message * m_ptr)
|
||||
int do_saferevmap(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
struct map_info_s *p;
|
||||
int flag = m_ptr->SMAP_FLAG;
|
||||
@@ -267,7 +267,7 @@ PUBLIC int do_saferevmap(struct proc * caller, message * m_ptr)
|
||||
/*===========================================================================*
|
||||
* do_safeunmap *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_safeunmap(struct proc * caller, message * m_ptr)
|
||||
int do_safeunmap(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
vir_bytes address = (vir_bytes) m_ptr->SMAP_ADDRESS;
|
||||
int seg = (int)m_ptr->SMAP_SEG;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/*===========================================================================*
|
||||
* do_schedctl *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_schedctl(struct proc * caller, message * m_ptr)
|
||||
int do_schedctl(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
struct proc *p;
|
||||
unsigned flags;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/*===========================================================================*
|
||||
* do_schedule *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_schedule(struct proc * caller, message * m_ptr)
|
||||
int do_schedule(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
struct proc *p;
|
||||
int proc_nr;
|
||||
|
||||
@@ -14,12 +14,12 @@
|
||||
|
||||
#if USE_SETALARM
|
||||
|
||||
FORWARD void cause_alarm(timer_t *tp);
|
||||
static void cause_alarm(timer_t *tp);
|
||||
|
||||
/*===========================================================================*
|
||||
* do_setalarm *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_setalarm(struct proc * caller, message * m_ptr)
|
||||
int do_setalarm(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
/* A process requests a synchronous alarm, or wants to cancel its alarm. */
|
||||
long exp_time; /* expiration time for this alarm */
|
||||
@@ -58,7 +58,7 @@ PUBLIC int do_setalarm(struct proc * caller, message * m_ptr)
|
||||
/*===========================================================================*
|
||||
* cause_alarm *
|
||||
*===========================================================================*/
|
||||
PRIVATE void cause_alarm(timer_t *tp)
|
||||
static void cause_alarm(timer_t *tp)
|
||||
{
|
||||
/* Routine called if a timer goes off and the process requested a synchronous
|
||||
* alarm. The process number is stored in timer argument 'ta_int'. Notify that
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
/*===========================================================================*
|
||||
* do_setgrant *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_setgrant(struct proc * caller, message * m_ptr)
|
||||
int do_setgrant(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
int r;
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
/*===========================================================================*
|
||||
* do_sigreturn *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_sigreturn(struct proc * caller, message * m_ptr)
|
||||
int do_sigreturn(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
/* POSIX style signals require sys_sigreturn to put things in order before
|
||||
* the signalled process can resume execution
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
/*===========================================================================*
|
||||
* do_sigsend *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_sigsend(struct proc * caller, message * m_ptr)
|
||||
int do_sigsend(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
/* Handle sys_sigsend, POSIX-style signal handling. */
|
||||
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
#if SPROFILE
|
||||
|
||||
/* user address to write info struct */
|
||||
PRIVATE vir_bytes sprof_info_addr_vir;
|
||||
static vir_bytes sprof_info_addr_vir;
|
||||
|
||||
PRIVATE void clean_seen_flag(void)
|
||||
static void clean_seen_flag(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -32,7 +32,7 @@ PRIVATE void clean_seen_flag(void)
|
||||
/*===========================================================================*
|
||||
* do_sprofile *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_sprofile(struct proc * caller, message * m_ptr)
|
||||
int do_sprofile(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
int proc_nr;
|
||||
int err;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
/*===========================================================================*
|
||||
* do_statectl *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_statectl(struct proc * caller, message * m_ptr)
|
||||
int do_statectl(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
/* Handle sys_statectl(). A process has issued a state control request. */
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
/*===========================================================================*
|
||||
* do_stime *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_stime(struct proc * caller, message * m_ptr)
|
||||
int do_stime(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
boottime= m_ptr->T_BOOTTIME;
|
||||
return(OK);
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
/*===========================================================================*
|
||||
* do_sysctl *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_sysctl(struct proc * caller, message * m_ptr)
|
||||
int do_sysctl(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
vir_bytes len, buf;
|
||||
static char mybuf[DIAG_BUFSIZE];
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
/*===========================================================================*
|
||||
* do_times *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_times(struct proc * caller, message * m_ptr)
|
||||
int do_times(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
/* Handle sys_times(). Retrieve the accounting information. */
|
||||
register const struct proc *rp;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
/*==========================================================================*
|
||||
* do_trace *
|
||||
*==========================================================================*/
|
||||
PUBLIC int do_trace(struct proc * caller, message * m_ptr)
|
||||
int do_trace(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
/* Handle the debugging commands supported by the ptrace system call
|
||||
* The commands are:
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
/*==========================================================================*
|
||||
* do_umap *
|
||||
*==========================================================================*/
|
||||
PUBLIC int do_umap(struct proc * caller, message * m_ptr)
|
||||
int do_umap(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
int seg_index = m_ptr->CP_SRC_SPACE & SEGMENT_INDEX;
|
||||
int endpt = (int) m_ptr->CP_SRC_ENDPT;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
/*==========================================================================*
|
||||
* do_umap_remote *
|
||||
*==========================================================================*/
|
||||
PUBLIC int do_umap_remote(struct proc * caller, message * m_ptr)
|
||||
int do_umap_remote(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
/* Map virtual address to physical, for non-kernel processes. */
|
||||
int seg_type = m_ptr->CP_SRC_SPACE & SEGMENT_TYPE;
|
||||
|
||||
@@ -19,18 +19,18 @@
|
||||
(RTS_ISSET(p, RTS_NO_PRIV) || RTS_ISSET(p, RTS_SIG_PENDING) \
|
||||
|| (RTS_ISSET(p, RTS_RECEIVING) && !RTS_ISSET(p, RTS_SENDING)))
|
||||
|
||||
FORWARD void adjust_proc_slot(struct proc *rp, struct proc *from_rp);
|
||||
FORWARD void adjust_priv_slot(struct priv *privp, struct priv
|
||||
static void adjust_proc_slot(struct proc *rp, struct proc *from_rp);
|
||||
static void adjust_priv_slot(struct priv *privp, struct priv
|
||||
*from_privp);
|
||||
FORWARD void swap_fpu_state(struct proc *a_rp, struct proc *b_orig_rp,
|
||||
static void swap_fpu_state(struct proc *a_rp, struct proc *b_orig_rp,
|
||||
struct proc *b_copy_rp);
|
||||
FORWARD void swap_proc_slot_pointer(struct proc **rpp, struct proc
|
||||
static void swap_proc_slot_pointer(struct proc **rpp, struct proc
|
||||
*src_rp, struct proc *dst_rp);
|
||||
|
||||
/*===========================================================================*
|
||||
* do_update *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_update(struct proc * caller, message * m_ptr)
|
||||
int do_update(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
/* Handle sys_update(). Update a process into another by swapping their process
|
||||
* slots.
|
||||
@@ -143,7 +143,7 @@ PUBLIC int do_update(struct proc * caller, message * m_ptr)
|
||||
/*===========================================================================*
|
||||
* adjust_proc_slot *
|
||||
*===========================================================================*/
|
||||
PRIVATE void adjust_proc_slot(struct proc *rp, struct proc *from_rp)
|
||||
static void adjust_proc_slot(struct proc *rp, struct proc *from_rp)
|
||||
{
|
||||
/* Preserve endpoints, slot numbers, priv structure, IPC, FPU pointer. */
|
||||
rp->p_endpoint = from_rp->p_endpoint;
|
||||
@@ -165,7 +165,7 @@ PRIVATE void adjust_proc_slot(struct proc *rp, struct proc *from_rp)
|
||||
/*===========================================================================*
|
||||
* adjust_priv_slot *
|
||||
*===========================================================================*/
|
||||
PRIVATE void adjust_priv_slot(struct priv *privp, struct priv *from_privp)
|
||||
static void adjust_priv_slot(struct priv *privp, struct priv *from_privp)
|
||||
{
|
||||
/* Preserve privilege ids and non-privilege stuff in the priv structure. */
|
||||
privp->s_id = from_privp->s_id;
|
||||
@@ -178,7 +178,7 @@ PRIVATE void adjust_priv_slot(struct priv *privp, struct priv *from_privp)
|
||||
/*===========================================================================*
|
||||
* swap_fpu_state *
|
||||
*===========================================================================*/
|
||||
PRIVATE void swap_fpu_state(struct proc *a_rp, struct proc *b_orig_rp,
|
||||
static void swap_fpu_state(struct proc *a_rp, struct proc *b_orig_rp,
|
||||
struct proc *b_copy_rp)
|
||||
{
|
||||
/* Copy the FPU state from process B's copied slot, using B's original FPU
|
||||
@@ -196,7 +196,7 @@ PRIVATE void swap_fpu_state(struct proc *a_rp, struct proc *b_orig_rp,
|
||||
/*===========================================================================*
|
||||
* swap_proc_slot_pointer *
|
||||
*===========================================================================*/
|
||||
PRIVATE void swap_proc_slot_pointer(struct proc **rpp, struct proc *src_rp,
|
||||
static void swap_proc_slot_pointer(struct proc **rpp, struct proc *src_rp,
|
||||
struct proc *dst_rp)
|
||||
{
|
||||
if(*rpp == src_rp) {
|
||||
|
||||
@@ -15,15 +15,15 @@
|
||||
#if USE_VDEVIO
|
||||
|
||||
/* Buffer for SYS_VDEVIO to copy (port,value)-pairs from/ to user. */
|
||||
PRIVATE char vdevio_buf[VDEVIO_BUF_SIZE];
|
||||
PRIVATE pvb_pair_t * const pvb = (pvb_pair_t *) vdevio_buf;
|
||||
PRIVATE pvw_pair_t * const pvw = (pvw_pair_t *) vdevio_buf;
|
||||
PRIVATE pvl_pair_t * const pvl = (pvl_pair_t *) vdevio_buf;
|
||||
static char vdevio_buf[VDEVIO_BUF_SIZE];
|
||||
static pvb_pair_t * const pvb = (pvb_pair_t *) vdevio_buf;
|
||||
static pvw_pair_t * const pvw = (pvw_pair_t *) vdevio_buf;
|
||||
static pvl_pair_t * const pvl = (pvl_pair_t *) vdevio_buf;
|
||||
|
||||
/*===========================================================================*
|
||||
* do_vdevio *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_vdevio(struct proc * caller, message * m_ptr)
|
||||
int do_vdevio(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
/* Perform a series of device I/O on behalf of a non-kernel process. The
|
||||
* I/O addresses and I/O values are fetched from and returned to some buffer
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
/*===========================================================================*
|
||||
* do_vmctl *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_vmctl(struct proc * caller, message * m_ptr)
|
||||
int do_vmctl(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
int proc_nr;
|
||||
endpoint_t ep = m_ptr->SVMCTL_WHO;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
/*===========================================================================*
|
||||
* do_vtimer *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_vtimer(struct proc * caller, message * m_ptr)
|
||||
int do_vtimer(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
/* Set and/or retrieve the value of one of a process' virtual timers. */
|
||||
struct proc *rp; /* pointer to process the timer belongs to */
|
||||
@@ -80,7 +80,7 @@ PUBLIC int do_vtimer(struct proc * caller, message * m_ptr)
|
||||
/*===========================================================================*
|
||||
* vtimer_check *
|
||||
*===========================================================================*/
|
||||
PUBLIC void vtimer_check(rp)
|
||||
void vtimer_check(rp)
|
||||
struct proc *rp; /* pointer to the process */
|
||||
{
|
||||
/* This is called from the clock task, so we can be interrupted by the clock
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
/*===========================================================================*
|
||||
* do_vumap *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_vumap(struct proc *caller, message *m_ptr)
|
||||
int do_vumap(struct proc *caller, message *m_ptr)
|
||||
{
|
||||
/* Map a vector of grants or local virtual addresses to physical addresses.
|
||||
* Designed to be used by drivers to perform an efficient lookup of physical
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
* to prioritize ping messages periodically delivered to system processes.
|
||||
*/
|
||||
|
||||
PUBLIC struct boot_image image[] = {
|
||||
struct boot_image image[] = {
|
||||
/* process nr, flags, stack size, name */
|
||||
{ASYNCM, 0, 0, "asyncm"},
|
||||
{IDLE, 0, 0, "idle" },
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
/*===========================================================================*
|
||||
* panic *
|
||||
*===========================================================================*/
|
||||
PUBLIC void panic(const char *fmt, ...)
|
||||
void panic(const char *fmt, ...)
|
||||
{
|
||||
va_list arg;
|
||||
/* The system has run aground of a fatal kernel error. Terminate execution. */
|
||||
@@ -48,7 +48,7 @@ PUBLIC void panic(const char *fmt, ...)
|
||||
/*===========================================================================*
|
||||
* kputc *
|
||||
*===========================================================================*/
|
||||
PUBLIC void kputc(c)
|
||||
void kputc(c)
|
||||
int c; /* character to append */
|
||||
{
|
||||
/* Accumulate a single character for a kernel message. Send a notification
|
||||
@@ -86,7 +86,7 @@ int c; /* character to append */
|
||||
return;
|
||||
}
|
||||
|
||||
PUBLIC void cpu_print_freq(unsigned cpu)
|
||||
void cpu_print_freq(unsigned cpu)
|
||||
{
|
||||
u64_t freq;
|
||||
|
||||
@@ -94,7 +94,7 @@ PUBLIC void cpu_print_freq(unsigned cpu)
|
||||
printf("CPU %d freq %lu MHz\n", cpu, div64u(freq, 1000000));
|
||||
}
|
||||
|
||||
PUBLIC int is_fpu(void)
|
||||
int is_fpu(void)
|
||||
{
|
||||
return get_cpulocal_var(fpu_presence);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ unsigned watchdog_local_timer_ticks = 0U;
|
||||
struct arch_watchdog *watchdog;
|
||||
int watchdog_enabled;
|
||||
|
||||
PRIVATE void lockup_check(struct nmi_frame * frame)
|
||||
static void lockup_check(struct nmi_frame * frame)
|
||||
{
|
||||
/* FIXME this should be CPU local */
|
||||
static unsigned no_ticks;
|
||||
@@ -50,7 +50,7 @@ PRIVATE void lockup_check(struct nmi_frame * frame)
|
||||
arch_watchdog_lockup(frame);
|
||||
}
|
||||
|
||||
PUBLIC void nmi_watchdog_handler(struct nmi_frame * frame)
|
||||
void nmi_watchdog_handler(struct nmi_frame * frame)
|
||||
{
|
||||
#if SPROFILE
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user