summaryrefslogtreecommitdiff
path: root/i386/i386
diff options
context:
space:
mode:
authorMarin Ramesa <mpr@hi.t-com.hr>2014-04-04 22:32:14 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2014-04-04 22:32:52 +0200
commitfe0231ba14d8597b0d78bf6121dd15a82bbab34a (patch)
tree0a2c3e1db9d4aa148248c5a8cb3277cc41cd2c11 /i386/i386
parent2aa14940b85cd3a38eff6ad4471ebf40a0074cb2 (diff)
Convert from K&R to ANSI
Convert from K&R style function definitions to ANSI style function definitions. * ddb/db_access.c: Convert function prototypes from K&R to ANSI. * ddb/db_aout.c: Likewise. * ddb/db_break.c: Likewise. * ddb/db_command.c: Likewise. * ddb/db_cond.c: Likewise. * ddb/db_examine.c: Likewise. * ddb/db_expr.c: Likewise. * ddb/db_ext_symtab.c: Likewise. * ddb/db_input.c: Likewise. * ddb/db_lex.c: Likewise. * ddb/db_macro.c: Likewise. * ddb/db_mp.c: Likewise. * ddb/db_output.c: Likewise. * ddb/db_print.c: Likewise. * ddb/db_run.c: Likewise. * ddb/db_sym.c: Likewise. * ddb/db_task_thread.c: Likewise. * ddb/db_trap.c: Likewise. * ddb/db_variables.c: Likewise. * ddb/db_watch.c: Likewise. * device/blkio.c: Likewise. * device/chario.c: Likewise. * device/dev_lookup.c: Likewise. * device/dev_name.c: Likewise. * device/dev_pager.c: Likewise. * device/ds_routines.c: Likewise. * device/net_io.c: Likewise. * device/subrs.c: Likewise. * i386/i386/db_interface.c: Likewise. * i386/i386/fpu.c: Likewise. * i386/i386/io_map.c: Likewise. * i386/i386/loose_ends.c: Likewise. * i386/i386/mp_desc.c: Likewise. * i386/i386/pcb.c: Likewise. * i386/i386/phys.c: Likewise. * i386/i386/trap.c: Likewise. * i386/i386/user_ldt.c: Likewise. * i386/i386at/com.c: Likewise. * i386/i386at/kd.c: Likewise. * i386/i386at/kd_event.c: Likewise. * i386/i386at/kd_mouse.c: Likewise. * i386/i386at/kd_queue.c: Likewise. * i386/i386at/lpr.c: Likewise. * i386/i386at/model_dep.c: Likewise. * i386/i386at/rtc.c: Likewise. * i386/intel/pmap.c: Likewise. * i386/intel/read_fault.c: Likewise. * ipc/ipc_entry.c: Likewise. * ipc/ipc_hash.c: Likewise. * ipc/ipc_kmsg.c: Likewise. * ipc/ipc_marequest.c: Likewise. * ipc/ipc_mqueue.c: Likewise. * ipc/ipc_notify.c: Likewise. * ipc/ipc_port.c: Likewise. * ipc/ipc_right.c: Likewise. * ipc/mach_debug.c: Likewise. * ipc/mach_msg.c: Likewise. * ipc/mach_port.c: Likewise. * ipc/mach_rpc.c: Likewise. * kern/act.c: Likewise. * kern/exception.c: Likewise. * kern/ipc_mig.c: Likewise. * kern/ipc_tt.c: Likewise. * kern/lock_mon.c: Likewise. * kern/mach_clock.c: Likewise. * kern/machine.c: Likewise. * kern/printf.c: Likewise. * kern/priority.c: Likewise. * kern/startup.c: Likewise. * kern/syscall_emulation.c: Likewise. * kern/syscall_subr.c: Likewise. * kern/thread_swap.c: Likewise. * kern/time_stamp.c: Likewise. * kern/timer.c: Likewise. * kern/xpr.c: Likewise. * vm/memory_object.c: Likewise. * vm/vm_debug.c: Likewise. * vm/vm_external.c: Likewise. * vm/vm_fault.c: Likewise. * vm/vm_kern.c: Likewise. * vm/vm_map.c: Likewise. * vm/vm_pageout.c: Likewise. * vm/vm_user.c: Likewise.
Diffstat (limited to 'i386/i386')
-rw-r--r--i386/i386/db_interface.c5
-rw-r--r--i386/i386/fpu.c9
-rw-r--r--i386/i386/io_map.c6
-rw-r--r--i386/i386/loose_ends.c3
-rw-r--r--i386/i386/mp_desc.c3
-rw-r--r--i386/i386/pcb.c67
-rw-r--r--i386/i386/phys.c25
-rw-r--r--i386/i386/trap.c17
-rw-r--r--i386/i386/user_ldt.c15
9 files changed, 68 insertions, 82 deletions
diff --git a/i386/i386/db_interface.c b/i386/i386/db_interface.c
index ca58ff3..1337685 100644
--- a/i386/i386/db_interface.c
+++ b/i386/i386/db_interface.c
@@ -216,8 +216,9 @@ db_clear_hw_watchpoint(
* Print trap reason.
*/
void
-kdbprinttrap(type, code)
- int type, code;
+kdbprinttrap(
+ int type,
+ int code)
{
printf("kernel: %s (%d), code=%x\n",
trap_name(type), type, code);
diff --git a/i386/i386/fpu.c b/i386/i386/fpu.c
index cd90ee9..0f34833 100644
--- a/i386/i386/fpu.c
+++ b/i386/i386/fpu.c
@@ -197,8 +197,7 @@ fpu_module_init(void)
* Called only when thread terminating - no locking necessary.
*/
void
-fp_free(fps)
- struct i386_fpsave_state *fps;
+fp_free(struct i386_fpsave_state *fps)
{
ASSERT_IPL(SPL0);
#if NCPUS == 1
@@ -747,8 +746,7 @@ ASSERT_IPL(SPL0);
* . otherwise, thread is running.
*/
void
-fp_save(thread)
- thread_t thread;
+fp_save(thread_t thread)
{
pcb_t pcb = thread->pcb;
struct i386_fpsave_state *ifps = pcb->ims.ifps;
@@ -769,8 +767,7 @@ fp_save(thread)
* Locking not needed; always called on the current thread.
*/
void
-fp_load(thread)
- thread_t thread;
+fp_load(thread_t thread)
{
pcb_t pcb = thread->pcb;
struct i386_fpsave_state *ifps;
diff --git a/i386/i386/io_map.c b/i386/i386/io_map.c
index b095f22..74e0b47 100644
--- a/i386/i386/io_map.c
+++ b/i386/i386/io_map.c
@@ -37,9 +37,9 @@ extern vm_offset_t kernel_virtual_start;
* Mach VM is running.
*/
vm_offset_t
-io_map(phys_addr, size)
- vm_offset_t phys_addr;
- vm_size_t size;
+io_map(
+ vm_offset_t phys_addr,
+ vm_size_t size)
{
vm_offset_t start;
diff --git a/i386/i386/loose_ends.c b/i386/i386/loose_ends.c
index bb2e5b6..64b53b7 100644
--- a/i386/i386/loose_ends.c
+++ b/i386/i386/loose_ends.c
@@ -41,8 +41,7 @@
int cpuspeed = 4;
#define DELAY(n) { volatile int N = cpuspeed * (n); while (--N > 0); }
void
-delay(n)
- int n;
+delay(int n)
{
DELAY(n);
}
diff --git a/i386/i386/mp_desc.c b/i386/i386/mp_desc.c
index 2ffe8ac..6aa8e66 100644
--- a/i386/i386/mp_desc.c
+++ b/i386/i386/mp_desc.c
@@ -100,8 +100,7 @@ extern struct real_descriptor ldt[LDTSZ];
*/
struct mp_desc_table *
-mp_desc_init(mycpu)
- int mycpu;
+mp_desc_init(int mycpu)
{
struct mp_desc_table *mpt;
diff --git a/i386/i386/pcb.c b/i386/i386/pcb.c
index a0578d1..5866cac 100644
--- a/i386/i386/pcb.c
+++ b/i386/i386/pcb.c
@@ -70,10 +70,10 @@ vm_offset_t kernel_stack[NCPUS]; /* top of active_stack */
* Attach a kernel stack to a thread.
*/
-void stack_attach(thread, stack, continuation)
- thread_t thread;
- vm_offset_t stack;
- void (*continuation)(thread_t);
+void stack_attach(
+ thread_t thread,
+ vm_offset_t stack,
+ void (*continuation)(thread_t))
{
counter(if (++c_stacks_current > c_stacks_max)
c_stacks_max = c_stacks_current);
@@ -105,8 +105,7 @@ void stack_attach(thread, stack, continuation)
* Detaches a kernel stack from a thread, returning the old stack.
*/
-vm_offset_t stack_detach(thread)
- thread_t thread;
+vm_offset_t stack_detach(thread_t thread)
{
vm_offset_t stack;
@@ -130,8 +129,7 @@ vm_offset_t stack_detach(thread)
#define gdt_desc_p(mycpu,sel) \
((struct real_descriptor *)&curr_gdt(mycpu)[sel_idx(sel)])
-void switch_ktss(pcb)
- pcb_t pcb;
+void switch_ktss(pcb_t pcb)
{
int mycpu = cpu_number();
{
@@ -243,9 +241,9 @@ update_ktss_iopb (unsigned char *new_iopb, io_port_t size)
* Move the current thread's kernel stack to the new thread.
*/
-void stack_handoff(old, new)
- thread_t old;
- thread_t new;
+void stack_handoff(
+ thread_t old,
+ thread_t new)
{
int mycpu = cpu_number();
vm_offset_t stack;
@@ -307,8 +305,7 @@ void stack_handoff(old, new)
/*
* Switch to the first thread on a CPU.
*/
-void load_context(new)
- thread_t new;
+void load_context(thread_t new)
{
switch_ktss(new->pcb);
Load_context(new);
@@ -319,10 +316,10 @@ void load_context(new)
* Save the old thread`s kernel state or continuation,
* and return it.
*/
-thread_t switch_context(old, continuation, new)
- thread_t old;
- void (*continuation)();
- thread_t new;
+thread_t switch_context(
+ thread_t old,
+ void (*continuation)(),
+ thread_t new)
{
/*
* Save FP registers if in use.
@@ -373,8 +370,7 @@ void pcb_module_init(void)
fpu_module_init();
}
-void pcb_init(thread)
- thread_t thread;
+void pcb_init(thread_t thread)
{
pcb_t pcb;
@@ -406,8 +402,7 @@ void pcb_init(thread)
thread->pcb = pcb;
}
-void pcb_terminate(thread)
- thread_t thread;
+void pcb_terminate(thread_t thread)
{
pcb_t pcb = thread->pcb;
@@ -440,11 +435,11 @@ void pcb_collect(thread)
* Set the status of the specified thread.
*/
-kern_return_t thread_setstatus(thread, flavor, tstate, count)
- thread_t thread;
- int flavor;
- thread_state_t tstate;
- unsigned int count;
+kern_return_t thread_setstatus(
+ thread_t thread,
+ int flavor,
+ thread_state_t tstate,
+ unsigned int count)
{
switch (flavor) {
case i386_THREAD_STATE:
@@ -646,11 +641,11 @@ kern_return_t thread_setstatus(thread, flavor, tstate, count)
* Get the status of the specified thread.
*/
-kern_return_t thread_getstatus(thread, flavor, tstate, count)
- thread_t thread;
- int flavor;
- thread_state_t tstate; /* pointer to OUT array */
- unsigned int *count; /* IN/OUT */
+kern_return_t thread_getstatus(
+ thread_t thread,
+ int flavor,
+ thread_state_t tstate, /* pointer to OUT array */
+ unsigned int *count) /* IN/OUT */
{
switch (flavor) {
case THREAD_STATE_FLAVOR_LIST:
@@ -798,14 +793,13 @@ kern_return_t thread_getstatus(thread, flavor, tstate, count)
* will make the thread return 'retval' from a syscall.
*/
void
-thread_set_syscall_return(thread, retval)
- thread_t thread;
- kern_return_t retval;
+thread_set_syscall_return(
+ thread_t thread,
+ kern_return_t retval)
{
thread->pcb->iss.eax = retval;
}
-
/*
* Return prefered address of user stack.
* Always returns low address. If stack grows up,
@@ -814,8 +808,7 @@ thread_set_syscall_return(thread, retval)
* address.
*/
vm_offset_t
-user_stack_low(stack_size)
- vm_size_t stack_size;
+user_stack_low(vm_size_t stack_size)
{
return (VM_MAX_ADDRESS - stack_size);
}
diff --git a/i386/i386/phys.c b/i386/i386/phys.c
index d4bd6c3..3af508f 100644
--- a/i386/i386/phys.c
+++ b/i386/i386/phys.c
@@ -47,8 +47,7 @@
* pmap_zero_page zeros the specified (machine independent) page.
*/
void
-pmap_zero_page(p)
- vm_offset_t p;
+pmap_zero_page(vm_offset_t p)
{
assert(p != vm_page_fictitious_addr);
vm_offset_t v;
@@ -72,8 +71,9 @@ pmap_zero_page(p)
* pmap_copy_page copies the specified (machine independent) pages.
*/
void
-pmap_copy_page(src, dst)
- vm_offset_t src, dst;
+pmap_copy_page(
+ vm_offset_t src,
+ vm_offset_t dst)
{
vm_offset_t src_addr_v, dst_addr_v;
pmap_mapwindow_t *src_map, *dst_map;
@@ -110,9 +110,10 @@ pmap_copy_page(src, dst)
* Copy virtual memory to physical memory
*/
void
-copy_to_phys(src_addr_v, dst_addr_p, count)
- vm_offset_t src_addr_v, dst_addr_p;
- int count;
+copy_to_phys(
+ vm_offset_t src_addr_v,
+ vm_offset_t dst_addr_p,
+ int count)
{
vm_offset_t dst_addr_v;
pmap_mapwindow_t *dst_map;
@@ -140,9 +141,10 @@ copy_to_phys(src_addr_v, dst_addr_p, count)
* is assumed to be present (e.g. the buffer pool).
*/
void
-copy_from_phys(src_addr_p, dst_addr_v, count)
- vm_offset_t src_addr_p, dst_addr_v;
- int count;
+copy_from_phys(
+ vm_offset_t src_addr_p,
+ vm_offset_t dst_addr_v,
+ int count)
{
vm_offset_t src_addr_v;
pmap_mapwindow_t *src_map;
@@ -169,8 +171,7 @@ copy_from_phys(src_addr_p, dst_addr_v, count)
* Convert a kernel virtual address to a physical address
*/
vm_offset_t
-kvtophys(addr)
-vm_offset_t addr;
+kvtophys(vm_offset_t addr)
{
pt_entry_t *pte;
diff --git a/i386/i386/trap.c b/i386/i386/trap.c
index 391b600..200cbcc 100644
--- a/i386/i386/trap.c
+++ b/i386/i386/trap.c
@@ -88,8 +88,7 @@ boolean_t debug_all_traps_with_kttd = TRUE;
#endif /* MACH_TTD */
void
-user_page_fault_continue(kr)
- kern_return_t kr;
+user_page_fault_continue(kern_return_t kr)
{
thread_t thread = current_thread();
struct i386_saved_state *regs = USER_REGS(thread);
@@ -152,8 +151,7 @@ char *trap_name(unsigned int trapnum)
* and then only in special circumstances. All other errors are
* fatal.
*/
-void kernel_trap(regs)
- struct i386_saved_state *regs;
+void kernel_trap(struct i386_saved_state *regs)
{
int code;
int subcode;
@@ -345,8 +343,7 @@ dump_ss(regs);
* Trap from user mode.
* Return TRUE if from emulated system call.
*/
-int user_trap(regs)
- struct i386_saved_state *regs;
+int user_trap(struct i386_saved_state *regs)
{
int exc = 0; /* Suppress gcc warning */
int code;
@@ -602,10 +599,10 @@ i386_astintr(void)
* emulator.
*/
void
-i386_exception(exc, code, subcode)
- int exc;
- int code;
- int subcode;
+i386_exception(
+ int exc,
+ int code,
+ int subcode)
{
spl_t s;
diff --git a/i386/i386/user_ldt.c b/i386/i386/user_ldt.c
index 3a2c1cc..d8bdb90 100644
--- a/i386/i386/user_ldt.c
+++ b/i386/i386/user_ldt.c
@@ -48,12 +48,12 @@
* the descriptor for 'first_selector'.
*/
kern_return_t
-i386_set_ldt(thread, first_selector, desc_list, count, desc_list_inline)
- thread_t thread;
- int first_selector;
- struct real_descriptor *desc_list;
- unsigned int count;
- boolean_t desc_list_inline;
+i386_set_ldt(
+ thread_t thread,
+ int first_selector,
+ struct real_descriptor *desc_list,
+ unsigned int count,
+ boolean_t desc_list_inline)
{
user_ldt_t new_ldt, old_ldt, temp;
struct real_descriptor *dp;
@@ -367,8 +367,7 @@ i386_get_ldt(thread, first_selector, selector_count, desc_list, count)
}
void
-user_ldt_free(user_ldt)
- user_ldt_t user_ldt;
+user_ldt_free(user_ldt_t user_ldt)
{
#ifdef MACH_PV_DESCRIPTORS
int i;