fix clang warnings -R in kernel/ and servers/

This commit is contained in:
Ben Gras 2011-06-09 16:09:13 +02:00
parent d34ab6de9f
commit a77c2973b3
32 changed files with 71 additions and 119 deletions

View File

@ -1,5 +1,9 @@
#include <string.h>
#include "kernel/kernel.h" #include "kernel/kernel.h"
#include "acpi.h" #include "acpi.h"
#include "arch_proto.h"
typedef int ((* acpi_read_t)(phys_bytes addr, void * buff, size_t size)); typedef int ((* acpi_read_t)(phys_bytes addr, void * buff, size_t size));
@ -80,7 +84,7 @@ PRIVATE int acpi_read_sdt_at(phys_bytes addr,
return tb->length; return tb->length;
} }
PRIVATE phys_bytes acpi_get_table_base(const char * name) PUBLIC phys_bytes acpi_get_table_base(const char * name)
{ {
int i; int i;
@ -93,7 +97,7 @@ PRIVATE phys_bytes acpi_get_table_base(const char * name)
return (phys_bytes) NULL; return (phys_bytes) NULL;
} }
PRIVATE size_t acpi_get_table_length(const char * name) PUBLIC size_t acpi_get_table_length(const char * name)
{ {
int i; int i;
@ -130,6 +134,7 @@ PRIVATE void * acpi_madt_get_typed_item(struct acpi_madt_hdr * hdr,
return NULL; return NULL;
} }
#if 0
PRIVATE void * acpi_madt_get_item(struct acpi_madt_hdr * hdr, PRIVATE void * acpi_madt_get_item(struct acpi_madt_hdr * hdr,
unsigned idx) unsigned idx)
{ {
@ -147,6 +152,8 @@ PRIVATE void * acpi_madt_get_item(struct acpi_madt_hdr * hdr,
return NULL; return NULL;
} }
#endif
PRIVATE int acpi_rsdp_test(void * buff) PRIVATE int acpi_rsdp_test(void * buff)
{ {
struct acpi_rsdp * rsdp = (struct acpi_rsdp *) buff; struct acpi_rsdp * rsdp = (struct acpi_rsdp *) buff;

View File

@ -176,7 +176,7 @@ PRIVATE u32_t lapic_bus_freq[CONFIG_MAX_CPUS];
#define IOAPIC_IOREGSEL 0x0 #define IOAPIC_IOREGSEL 0x0
#define IOAPIC_IOWIN 0x10 #define IOAPIC_IOWIN 0x10
PUBLIC u32_t ioapic_read(u32_t ioa_base, u32_t reg) PRIVATE u32_t ioapic_read(u32_t ioa_base, u32_t reg)
{ {
*((u32_t *)(ioa_base + IOAPIC_IOREGSEL)) = (reg & 0xff); *((u32_t *)(ioa_base + IOAPIC_IOREGSEL)) = (reg & 0xff);
return *(u32_t *)(ioa_base + IOAPIC_IOWIN); return *(u32_t *)(ioa_base + IOAPIC_IOWIN);
@ -207,6 +207,7 @@ PRIVATE void ioapic_disable_pin(vir_bytes ioapic_addr, int pin)
ioapic_write(ioapic_addr, IOAPIC_REDIR_TABLE + pin * 2, lo); ioapic_write(ioapic_addr, IOAPIC_REDIR_TABLE + pin * 2, lo);
} }
#if 0
PRIVATE void ioapic_redirt_entry_read(void * ioapic_addr, PRIVATE void ioapic_redirt_entry_read(void * ioapic_addr,
int entry, int entry,
u32_t *hi, u32_t *hi,
@ -216,6 +217,7 @@ PRIVATE void ioapic_redirt_entry_read(void * ioapic_addr,
*hi = ioapic_read((u32_t)ioapic_addr, (u8_t) (IOAPIC_REDIR_TABLE + entry * 2 + 1)); *hi = ioapic_read((u32_t)ioapic_addr, (u8_t) (IOAPIC_REDIR_TABLE + entry * 2 + 1));
} }
#endif
PRIVATE void ioapic_redirt_entry_write(void * ioapic_addr, PRIVATE void ioapic_redirt_entry_write(void * ioapic_addr,
int entry, int entry,
@ -570,7 +572,7 @@ PRIVATE u32_t lapic_errstatus(void)
PRIVATE int lapic_disable_in_msr(void) PRIVATE int lapic_disable_in_msr(void)
{ {
u32_t addr, msr_hi, msr_lo; u32_t msr_hi, msr_lo;
ia32_msr_read(IA32_APIC_BASE, &msr_hi, &msr_lo); ia32_msr_read(IA32_APIC_BASE, &msr_hi, &msr_lo);
@ -617,11 +619,12 @@ PUBLIC void lapic_disable(void)
PRIVATE int lapic_enable_in_msr(void) PRIVATE int lapic_enable_in_msr(void)
{ {
u32_t addr, msr_hi, msr_lo; u32_t msr_hi, msr_lo;
ia32_msr_read(IA32_APIC_BASE, &msr_hi, &msr_lo); ia32_msr_read(IA32_APIC_BASE, &msr_hi, &msr_lo);
#if 0 #if 0
u32_t addr;
/*FIXME this is a problem on AP */ /*FIXME this is a problem on AP */
/* /*
* FIXME if the location is different (unlikely) then the one we expect, * FIXME if the location is different (unlikely) then the one we expect,

View File

@ -123,6 +123,9 @@ EXTERN u32_t lapic_addr_vaddr; /* we remember the virtual address here until we
switch to paging */ switch to paging */
_PROTOTYPE (int lapic_enable, (unsigned cpu)); _PROTOTYPE (int lapic_enable, (unsigned cpu));
_PROTOTYPE (void ioapic_unmask_irq, (unsigned irq));
_PROTOTYPE (void ioapic_mask_irq, (unsigned irq));
_PROTOTYPE (void ioapic_reset_pic, (void));
EXTERN int ioapic_enabled; EXTERN int ioapic_enabled;
EXTERN unsigned nioapics; EXTERN unsigned nioapics;

View File

@ -185,8 +185,6 @@ PUBLIC int register_local_timer_handler(const irq_handler_t handler)
PUBLIC void cycles_accounting_init(void) PUBLIC void cycles_accounting_init(void)
{ {
unsigned cpu = cpuid;
read_tsc_64(get_cpu_var_ptr(cpu, tsc_ctr_switch)); read_tsc_64(get_cpu_var_ptr(cpu, tsc_ctr_switch));
make_zero64(get_cpu_var(cpu, cpu_last_tsc)); make_zero64(get_cpu_var(cpu, cpu_last_tsc));
@ -195,11 +193,11 @@ PUBLIC void cycles_accounting_init(void)
PUBLIC void context_stop(struct proc * p) PUBLIC void context_stop(struct proc * p)
{ {
unsigned cpu = cpuid;
u64_t tsc, tsc_delta; u64_t tsc, tsc_delta;
u64_t * __tsc_ctr_switch = get_cpulocal_var_ptr(tsc_ctr_switch); u64_t * __tsc_ctr_switch = get_cpulocal_var_ptr(tsc_ctr_switch);
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
unsigned cpu = cpuid;
/* /*
* This function is called only if we switch from kernel to user or idle * This function is called only if we switch from kernel to user or idle
* or back. Therefore this is a perfect location to place the big kernel * or back. Therefore this is a perfect location to place the big kernel
@ -279,7 +277,9 @@ PUBLIC void context_stop(struct proc * p)
PUBLIC void context_stop_idle(void) PUBLIC void context_stop_idle(void)
{ {
int is_idle; int is_idle;
#ifdef CONFIG_SMP
unsigned cpu = cpuid; unsigned cpu = cpuid;
#endif
is_idle = get_cpu_var(cpu, cpu_is_idle); is_idle = get_cpu_var(cpu, cpu_is_idle);
get_cpu_var(cpu, cpu_is_idle) = 0; get_cpu_var(cpu, cpu_is_idle) = 0;
@ -310,7 +310,9 @@ PUBLIC short cpu_load(void)
u64_t tsc_delta, idle_delta, busy; u64_t tsc_delta, idle_delta, busy;
struct proc *idle; struct proc *idle;
short load; short load;
#ifdef CONFIG_SMP
unsigned cpu = cpuid; unsigned cpu = cpuid;
#endif
u64_t *last_tsc, *last_idle; u64_t *last_tsc, *last_idle;

View File

@ -634,23 +634,6 @@ PUBLIC void arch_ack_profile_clock(void)
#define COLOR_BASE 0xB8000L #define COLOR_BASE 0xB8000L
PRIVATE void cons_setc(const int pos, const int c)
{
char ch;
ch= c;
phys_copy(vir2phys((vir_bytes)&ch), COLOR_BASE+(20*80+pos)*2, 1);
}
PRIVATE void cons_seth(int pos, int n)
{
n &= 0xf;
if (n < 10)
cons_setc(pos, '0'+n);
else
cons_setc(pos, 'A'+(n-10));
}
/* Saved by mpx386.s into these variables. */ /* Saved by mpx386.s into these variables. */
u32_t params_size, params_offset, mon_ds; u32_t params_size, params_offset, mon_ds;

View File

@ -3,7 +3,7 @@
#include "debugreg.h" #include "debugreg.h"
PRIVATE int breakpoint_set(phys_bytes linaddr, int bp, const int flags) PUBLIC int breakpoint_set(phys_bytes linaddr, int bp, const int flags)
{ {
unsigned long dr7, dr7flags; unsigned long dr7, dr7flags;

View File

@ -8,6 +8,7 @@
#include "kernel/kernel.h" #include "kernel/kernel.h"
#include "kernel/proc.h" #include "kernel/proc.h"
#include "arch_proto.h" #include "arch_proto.h"
#include "hw_intr.h"
#include <minix/portio.h> #include <minix/portio.h>
#include <machine/cpu.h> #include <machine/cpu.h>

View File

@ -2,11 +2,13 @@
#define __HW_INTR_X86_H__ #define __HW_INTR_X86_H__
#include "kernel/kernel.h" #include "kernel/kernel.h"
_PROTOTYPE(int irq_8259_unmask,(int irq)); _PROTOTYPE(void irq_8259_unmask,(int irq));
_PROTOTYPE(int irq_8259_mask,(int irq)); _PROTOTYPE(void irq_8259_mask,(int irq));
_PROTOTYPE(int irq_8259_eoi, (int irq)); _PROTOTYPE(void irq_8259_eoi, (int irq));
_PROTOTYPE(void irq_handle,(int irq)); _PROTOTYPE(void irq_handle,(int irq));
_PROTOTYPE(void i8259_disable,(void)); _PROTOTYPE(void i8259_disable,(void));
_PROTOTYPE(void eoi_8259_master,(void));
_PROTOTYPE(void eoi_8259_slave,(void));
/* /*
* we don't use IO APIC if not configured for SMP as we cannot read any info * we don't use IO APIC if not configured for SMP as we cannot read any info

View File

@ -225,6 +225,7 @@ PRIVATE u32_t phys_get32(phys_bytes addr)
return v; return v;
} }
#if 0
PRIVATE char *cr0_str(u32_t e) PRIVATE char *cr0_str(u32_t e)
{ {
static char str[80]; static char str[80];
@ -256,6 +257,7 @@ PRIVATE char *cr4_str(u32_t e)
if(e) { strcat(str, " (++)"); } if(e) { strcat(str, " (++)"); }
return str; return str;
} }
#endif
PUBLIC void vm_stop(void) PUBLIC void vm_stop(void)
{ {
@ -531,7 +533,6 @@ PRIVATE void vm_suspend(struct proc *caller, const struct proc *target,
*===========================================================================*/ *===========================================================================*/
PUBLIC void delivermsg(struct proc *rp) PUBLIC void delivermsg(struct proc *rp)
{ {
phys_bytes addr;
int r; int r;
assert(rp->p_misc_flags & MF_DELIVERMSG); assert(rp->p_misc_flags & MF_DELIVERMSG);
@ -557,6 +558,7 @@ PUBLIC void delivermsg(struct proc *rp)
} }
} }
#if 0
PRIVATE char *flagstr(u32_t e, const int dir) PRIVATE char *flagstr(u32_t e, const int dir)
{ {
static char str[80]; static char str[80];
@ -627,6 +629,7 @@ PRIVATE void vm_print(u32_t *root)
return; return;
} }
#endif
/*===========================================================================* /*===========================================================================*
* lin_memset * * lin_memset *

View File

@ -42,27 +42,6 @@ phys_bytes mulitboot_modules_addr;
FORWARD _PROTOTYPE(void mb_print, (char *str)); FORWARD _PROTOTYPE(void mb_print, (char *str));
PRIVATE void mb_phys_move(u32_t src, u32_t dest, u32_t len)
{
char data[GRAN + 1];
int i;
/* Move upward (start moving from tail), block by block
* len should be aligned to GRAN
*/
if (len % GRAN) {
mb_print("fatal: not aligned phys move");
/* Spin here */
while (1)
;
}
len /= GRAN;
for (i = len - 1; i >= 0; i--) {
mb_load_phymem(data, src + i * GRAN, GRAN);
mb_save_phymem(data, dest + i * GRAN, GRAN);
}
}
PRIVATE void mb_itoa(u32_t val, char * out) PRIVATE void mb_itoa(u32_t val, char * out)
{ {
char ret[ITOA_BUFFER_SIZE]; char ret[ITOA_BUFFER_SIZE];
@ -244,7 +223,7 @@ PRIVATE int mb_set_param(char *name, char *value)
PRIVATE void get_parameters(multiboot_info_t *mbi) PRIVATE void get_parameters(multiboot_info_t *mbi)
{ {
char mem_value[40], temp[ITOA_BUFFER_SIZE]; char mem_value[40], temp[ITOA_BUFFER_SIZE];
int i, r, processor; int i, processor;
int dev; int dev;
int ctrlr; int ctrlr;
int disk, prim, sub; int disk, prim, sub;
@ -386,8 +365,6 @@ PRIVATE void mb_extract_image(multiboot_info_t mbi)
/* Load boot image services into memory and save memory map */ /* Load boot image services into memory and save memory map */
for (i = 0; module < &mb_module_info[mods_count]; ++module, ++i) { for (i = 0; module < &mb_module_info[mods_count]; ++module, ++i) {
char zero = 0;
r = read_header_elf((const char *)module->mod_start, r = read_header_elf((const char *)module->mod_start,
&text_vaddr, &text_paddr, &text_vaddr, &text_paddr,
&text_filebytes, &text_membytes, &text_filebytes, &text_membytes,

View File

@ -72,18 +72,6 @@ PUBLIC phys_bytes seg2phys(const u16_t seg)
return base; return base;
} }
/*===========================================================================*
* phys2seg *
*===========================================================================*/
PRIVATE void phys2seg(u16_t *seg, vir_bytes *off, phys_bytes phys)
{
/* Return a segment selector and offset that can be used to reach a physical
* address, for use by a driver doing memory I/O in the A0000 - DFFFF range.
*/
*seg = FLAT_DS_SELECTOR;
*off = (vir_bytes) phys;
}
/*===========================================================================* /*===========================================================================*
* init_dataseg * * init_dataseg *
*===========================================================================*/ *===========================================================================*/
@ -330,6 +318,7 @@ PUBLIC void alloc_segments(register struct proc *rp)
rp->p_reg.ds = (DS_LDT_INDEX*DESC_SIZE) | TI | privilege; rp->p_reg.ds = (DS_LDT_INDEX*DESC_SIZE) | TI | privilege;
} }
#if 0
/*===========================================================================* /*===========================================================================*
* check_segments * * check_segments *
*===========================================================================*/ *===========================================================================*/
@ -369,6 +358,7 @@ for (rp = BEG_PROC_ADDR; rp < END_PROC_ADDR; ++rp) {
panic("wrong: %d", fail); panic("wrong: %d", fail);
} }
} }
#endif
/*===========================================================================* /*===========================================================================*
* printseg * * printseg *

View File

@ -238,4 +238,6 @@ PUBLIC int app_cpu_init_timer(unsigned freq)
{ {
if (init_local_timer(freq)) if (init_local_timer(freq))
return -1; return -1;
return 0;
} }

View File

@ -257,7 +257,6 @@ print_sigmgr(struct proc *pp)
PUBLIC void print_proc(struct proc *pp) PUBLIC void print_proc(struct proc *pp)
{ {
struct proc *depproc = NULL;
endpoint_t dep; endpoint_t dep;
printf("%d: %s %d prio %d time %d/%d cycles 0x%x%08x cpu %2d " printf("%d: %s %d prio %d time %d/%d cycles 0x%x%08x cpu %2d "

View File

@ -20,6 +20,7 @@
#include "debug.h" #include "debug.h"
#include "clock.h" #include "clock.h"
#include "hw_intr.h" #include "hw_intr.h"
#include "arch_proto.h"
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
#include "smp.h" #include "smp.h"
@ -126,10 +127,10 @@ PUBLIC int main(void)
struct boot_image *ip; /* boot image pointer */ struct boot_image *ip; /* boot image pointer */
register struct proc *rp; /* process pointer */ register struct proc *rp; /* process pointer */
register int i, j; register int i, j;
phys_clicks text_base;
vir_clicks text_clicks, data_clicks, st_clicks;
size_t argsz; /* size of arguments passed to crtso on stack */ size_t argsz; /* size of arguments passed to crtso on stack */
#if !defined(__ELF__) #if !defined(__ELF__)
vir_clicks text_clicks, data_clicks, st_clicks;
phys_clicks text_base;
int hdrindex; /* index to array of a.out headers */ int hdrindex; /* index to array of a.out headers */
struct exec e_hdr; /* for a copy of an a.out header */ struct exec e_hdr; /* for a copy of an a.out header */
#endif #endif

View File

@ -845,7 +845,7 @@ PRIVATE int mini_receive(struct proc * caller_ptr,
*/ */
register struct proc **xpp; register struct proc **xpp;
sys_map_t *map; sys_map_t *map;
int i, r, src_id, src_proc_nr, src_p; int r, src_id, src_proc_nr, src_p;
assert(!(caller_ptr->p_misc_flags & MF_DELIVERMSG)); assert(!(caller_ptr->p_misc_flags & MF_DELIVERMSG));
@ -1227,7 +1227,7 @@ struct proc *caller_ptr;
PRIVATE int try_one(struct proc *src_ptr, struct proc *dst_ptr) PRIVATE int try_one(struct proc *src_ptr, struct proc *dst_ptr)
{ {
/* Try to receive an asynchronous message from 'src_ptr' */ /* Try to receive an asynchronous message from 'src_ptr' */
int r = EAGAIN, done, do_notify, pending_recv = FALSE; int r = EAGAIN, done, do_notify;
unsigned int flags, i; unsigned int flags, i;
size_t size; size_t size;
endpoint_t dst; endpoint_t dst;
@ -1331,7 +1331,7 @@ PUBLIC int cancel_async(struct proc *src_ptr, struct proc *dst_ptr)
{ {
/* Cancel asynchronous messages from src to dst, because dst is not interested /* Cancel asynchronous messages from src to dst, because dst is not interested
* in them (e.g., dst has been restarted) */ * in them (e.g., dst has been restarted) */
int done, do_notify, pending_recv = FALSE; int done, do_notify;
unsigned int flags, i; unsigned int flags, i;
size_t size; size_t size;
endpoint_t dst; endpoint_t dst;

View File

@ -63,7 +63,7 @@ PUBLIC void stop_profile_clock()
rm_irq_handler(&profile_clock_hook); rm_irq_handler(&profile_clock_hook);
} }
PRIVATE sprof_save_sample(struct proc * p, void * pc) PRIVATE void sprof_save_sample(struct proc * p, void * pc)
{ {
struct sprof_sample *s; struct sprof_sample *s;
@ -75,7 +75,7 @@ PRIVATE sprof_save_sample(struct proc * p, void * pc)
sprof_info.mem_used += sizeof(struct sprof_sample); sprof_info.mem_used += sizeof(struct sprof_sample);
} }
PRIVATE sprof_save_proc(struct proc * p) PRIVATE void sprof_save_proc(struct proc * p)
{ {
struct sprof_proc * s; struct sprof_proc * s;

View File

@ -226,6 +226,8 @@ _PROTOTYPE(void release_address_space, (struct proc *pr));
_PROTOTYPE(void enable_fpu_exception, (void)); _PROTOTYPE(void enable_fpu_exception, (void));
_PROTOTYPE(void disable_fpu_exception, (void)); _PROTOTYPE(void disable_fpu_exception, (void));
_PROTOTYPE(void release_fpu, (struct proc * p)); _PROTOTYPE(void release_fpu, (struct proc * p));
_PROTOTYPE(void arch_pause,(void));
_PROTOTYPE(short cpu_load, (void));
/* utility.c */ /* utility.c */
_PROTOTYPE( void cpu_print_freq, (unsigned cpu)); _PROTOTYPE( void cpu_print_freq, (unsigned cpu));

View File

@ -54,9 +54,10 @@
*/ */
PRIVATE int (*call_vec[NR_SYS_CALLS])(struct proc * caller, message *m_ptr); PRIVATE int (*call_vec[NR_SYS_CALLS])(struct proc * caller, message *m_ptr);
#define map(call_nr, handler) \ #define map(call_nr, handler) \
{extern int dummy[NR_SYS_CALLS>(unsigned)(call_nr-KERNEL_CALL) ? 1:-1];} \ { int call_index = call_nr-KERNEL_CALL; \
call_vec[(call_nr-KERNEL_CALL)] = (handler) 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) PRIVATE void kernel_call_finish(struct proc * caller, message *msg, int result)
{ {

View File

@ -44,7 +44,9 @@ PUBLIC int do_getinfo(struct proc * caller, message * m_ptr)
vir_bytes src_vir; vir_bytes src_vir;
int nr_e, nr, r; int nr_e, nr, r;
int wipe_rnd_bin = -1; int wipe_rnd_bin = -1;
#if !defined(__ELF__)
struct exec e_hdr; struct exec e_hdr;
#endif
/* Set source address and length based on request type. */ /* Set source address and length based on request type. */
switch (m_ptr->I_REQUEST) { switch (m_ptr->I_REQUEST) {

View File

@ -14,13 +14,14 @@
*/ */
#include "kernel/system.h" #include "kernel/system.h"
#include "watchdog.h"
#if SPROFILE #if SPROFILE
/* user address to write info struct */ /* user address to write info struct */
PRIVATE vir_bytes sprof_info_addr_vir; PRIVATE vir_bytes sprof_info_addr_vir;
PRIVATE clean_seen_flag(void) PRIVATE void clean_seen_flag(void)
{ {
int i; int i;

View File

@ -16,7 +16,6 @@
/* Declare some local functions. */ /* Declare some local functions. */
FORWARD _PROTOTYPE(void get_work, (message *m_in) ); FORWARD _PROTOTYPE(void get_work, (message *m_in) );
FORWARD _PROTOTYPE(void cch_check, (void) );
FORWARD _PROTOTYPE( void reply, (endpoint_t who, message *m_out) ); FORWARD _PROTOTYPE( void reply, (endpoint_t who, message *m_out) );
/* SEF functions and variables. */ /* SEF functions and variables. */
@ -83,7 +82,6 @@ PUBLIC int main(int argc, char *argv[])
error = EINVAL; error = EINVAL;
} else { } else {
error = (*fs_call_vec[ind])(); error = (*fs_call_vec[ind])();
/*cch_check();*/
} }
fs_m_out.m_type = error; fs_m_out.m_type = error;
@ -209,23 +207,3 @@ PRIVATE void reply(
if (OK != send(who, m_out)) /* send the message */ if (OK != send(who, m_out)) /* send the message */
printf("ext2(%d) was unable to send reply\n", SELF_E); printf("ext2(%d) was unable to send reply\n", SELF_E);
} }
/*===========================================================================*
* cch_check *
*===========================================================================*/
PRIVATE void cch_check(void)
{
int i;
for (i = 0; i < NR_INODES; ++i) {
if (inode[i].i_count != cch[i] && req_nr != REQ_GETNODE &&
req_nr != REQ_PUTNODE && req_nr != REQ_READSUPER &&
req_nr != REQ_MOUNTPOINT && req_nr != REQ_UNMOUNT &&
req_nr != REQ_SYNC && req_nr != REQ_LOOKUP) {
printf("ext2(%d) inode(%ul) cc: %d req_nr: %d\n", SELF_E,
inode[i].i_num, inode[i].i_count - cch[i], req_nr);
}
cch[i] = inode[i].i_count;
}
}

View File

@ -20,7 +20,6 @@ PUBLIC int fs_sync()
*/ */
struct inode *rip; struct inode *rip;
struct buf *bp; struct buf *bp;
int r;
assert(nr_bufs > 0); assert(nr_bufs > 0);
assert(buf); assert(buf);

View File

@ -551,7 +551,6 @@ PUBLIC int fs_getdents(void)
struct buf *bp; struct buf *bp;
struct ext2_disk_dir_desc *d_desc; struct ext2_disk_dir_desc *d_desc;
struct dirent *dep; struct dirent *dep;
char *cp;
ino = (ino_t) fs_m_in.REQ_INODE_NR; ino = (ino_t) fs_m_in.REQ_INODE_NR;
gid = (gid_t) fs_m_in.REQ_GRANT; gid = (gid_t) fs_m_in.REQ_GRANT;

View File

@ -43,7 +43,6 @@ sef_init_info_t *info;
{ {
/* Initialize this file server. Called at startup time. /* Initialize this file server. Called at startup time.
*/ */
message m;
int i, r; int i, r;
/* Defaults */ /* Defaults */

View File

@ -128,6 +128,7 @@ PRIVATE void remove_semaphore(struct sem_struct *sem)
sem_list[i] = sem_list[sem_list_nr]; sem_list[i] = sem_list[sem_list_nr];
} }
#if 0
PRIVATE void show_semaphore(void) PRIVATE void show_semaphore(void)
{ {
int i, j, k; int i, j, k;
@ -161,6 +162,7 @@ PRIVATE void show_semaphore(void)
} }
printf("\n"); printf("\n");
} }
#endif
PRIVATE void remove_process(endpoint_t pt) PRIVATE void remove_process(endpoint_t pt)
{ {

View File

@ -327,6 +327,7 @@ PUBLIC int do_shmctl(message *m)
return OK; return OK;
} }
#if 0
PRIVATE void list_shm_ds(void) PRIVATE void list_shm_ds(void)
{ {
int i; int i;
@ -337,6 +338,7 @@ PRIVATE void list_shm_ds(void)
shm_list[i].id, shm_list[i].id,
shm_list[i].page); shm_list[i].page);
} }
#endif
/*===========================================================================* /*===========================================================================*
* is_shm_nil * * is_shm_nil *

View File

@ -1,8 +1,6 @@
#include "inc.h" #include "inc.h"
#include <minix/vfsif.h> #include <minix/vfsif.h>
PRIVATE int dummyproc;
FORWARD _PROTOTYPE( int safe_io_conversion, (endpoint_t, cp_grant_id_t *, FORWARD _PROTOTYPE( int safe_io_conversion, (endpoint_t, cp_grant_id_t *,
int *, cp_grant_id_t *, int, int *, cp_grant_id_t *, int,
endpoint_t *, void **, int *, endpoint_t *, void **, int *,

View File

@ -546,7 +546,6 @@ PRIVATE void cache_resize(unsigned int blocksize, unsigned int bufs)
{ {
struct buf *bp; struct buf *bp;
struct inode *rip; struct inode *rip;
int scale, r;
#define MINBUFS 10 #define MINBUFS 10
assert(blocksize > 0); assert(blocksize > 0);
@ -569,7 +568,7 @@ PRIVATE void cache_resize(unsigned int blocksize, unsigned int bufs)
PRIVATE int bufs_heuristic(struct super_block *sp) PRIVATE int bufs_heuristic(struct super_block *sp)
{ {
struct vm_stats_info vsi; struct vm_stats_info vsi;
int r, bufs; int bufs;
u32_t btotal, bfree, bused, kbytes_used_fs, u32_t btotal, bfree, bused, kbytes_used_fs,
kbytes_total_fs, kbcache, kb_fsmax; kbytes_total_fs, kbcache, kb_fsmax;
u32_t kbytes_remain_mem; u32_t kbytes_remain_mem;

View File

@ -14,7 +14,6 @@
/* Declare some local functions. */ /* Declare some local functions. */
FORWARD _PROTOTYPE(void get_work, (message *m_in) ); FORWARD _PROTOTYPE(void get_work, (message *m_in) );
FORWARD _PROTOTYPE(void cch_check, (void) );
FORWARD _PROTOTYPE( void reply, (endpoint_t who, message *m_out) ); FORWARD _PROTOTYPE( void reply, (endpoint_t who, message *m_out) );
/* SEF functions and variables. */ /* SEF functions and variables. */
@ -178,6 +177,7 @@ PRIVATE void reply(
} }
#if 0
/*===========================================================================* /*===========================================================================*
* cch_check * * cch_check *
*===========================================================================*/ *===========================================================================*/
@ -197,4 +197,5 @@ PRIVATE void cch_check(void)
cch[i] = inode[i].i_count; cch[i] = inode[i].i_count;
} }
} }
#endif

View File

@ -154,13 +154,10 @@ PUBLIC int do_sysuname()
*===========================================================================*/ *===========================================================================*/
PUBLIC int do_getsysinfo() PUBLIC int do_getsysinfo()
{ {
struct mproc *proc_addr;
vir_bytes src_addr, dst_addr; vir_bytes src_addr, dst_addr;
struct kinfo kinfo;
struct loadinfo loadinfo; struct loadinfo loadinfo;
static struct proc proctab[NR_PROCS+NR_TASKS];
size_t len; size_t len;
int s, r; int s;
/* This call leaks important information (the contents of registers). */ /* This call leaks important information (the contents of registers). */
if (mp->mp_effuid != 0) if (mp->mp_effuid != 0)

View File

@ -116,7 +116,7 @@ PUBLIC int do_noquantum(message *m_ptr)
PUBLIC int do_stop_scheduling(message *m_ptr) PUBLIC int do_stop_scheduling(message *m_ptr)
{ {
register struct schedproc *rmp; register struct schedproc *rmp;
int rv, proc_nr_n; int proc_nr_n;
/* check who can send you requests */ /* check who can send you requests */
if (!accept_message(m_ptr)) if (!accept_message(m_ptr))
@ -143,7 +143,7 @@ PUBLIC int do_stop_scheduling(message *m_ptr)
PUBLIC int do_start_scheduling(message *m_ptr) PUBLIC int do_start_scheduling(message *m_ptr)
{ {
register struct schedproc *rmp; register struct schedproc *rmp;
int rv, proc_nr_n, parent_nr_n, nice; int rv, proc_nr_n, parent_nr_n;
/* we can handle two kinds of messages here */ /* we can handle two kinds of messages here */
assert(m_ptr->m_type == SCHEDULING_START || assert(m_ptr->m_type == SCHEDULING_START ||
@ -353,7 +353,6 @@ PRIVATE void balance_queues(struct timer *tp)
{ {
struct schedproc *rmp; struct schedproc *rmp;
int proc_nr; int proc_nr;
int rv;
for (proc_nr=0, rmp=schedproc; proc_nr < NR_PROCS; proc_nr++, rmp++) { for (proc_nr=0, rmp=schedproc; proc_nr < NR_PROCS; proc_nr++, rmp++) {
if (rmp->flags & IN_USE) { if (rmp->flags & IN_USE) {

View File

@ -200,7 +200,7 @@ PUBLIC int do_select(void)
/* Check all file descriptors in the set whether one is 'ready' now */ /* Check all file descriptors in the set whether one is 'ready' now */
for (fd = 0; fd < nfds; fd++) { for (fd = 0; fd < nfds; fd++) {
int type, ops, r; int ops, r;
struct filp *f; struct filp *f;
/* Again, check for involuntarily selected fd's */ /* Again, check for involuntarily selected fd's */
@ -211,7 +211,7 @@ PUBLIC int do_select(void)
* processes sharing a filp and both doing a select on that filp. */ * processes sharing a filp and both doing a select on that filp. */
f = se->filps[fd]; f = se->filps[fd];
if ((f->filp_select_ops & ops) != ops) { if ((f->filp_select_ops & ops) != ops) {
int wantops, type, block; int wantops;
wantops = (f->filp_select_ops |= ops); wantops = (f->filp_select_ops |= ops);
r = do_select_request(se, fd, &wantops); r = do_select_request(se, fd, &wantops);
@ -911,7 +911,7 @@ PRIVATE void select_restart_filps()
* select request to be sent again). * select request to be sent again).
*/ */
for (fd = 0; fd < se->nfds; fd++) { for (fd = 0; fd < se->nfds; fd++) {
int r, type, wantops, ops, block; int r, wantops, ops;
if ((f = se->filps[fd]) == NULL) continue; if ((f = se->filps[fd]) == NULL) continue;
if (f->filp_select_flags & FSF_BUSY) /* Still waiting for */ if (f->filp_select_flags & FSF_BUSY) /* Still waiting for */
continue; /* initial reply */ continue; /* initial reply */