diff options
author | Marin Ramesa <mpr@hi.t-com.hr> | 2014-04-04 22:32:14 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2014-04-04 22:32:52 +0200 |
commit | fe0231ba14d8597b0d78bf6121dd15a82bbab34a (patch) | |
tree | 0a2c3e1db9d4aa148248c5a8cb3277cc41cd2c11 | |
parent | 2aa14940b85cd3a38eff6ad4471ebf40a0074cb2 (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.
83 files changed, 1527 insertions, 1722 deletions
diff --git a/ddb/db_access.c b/ddb/db_access.c index 4df9831..16d4d3e 100644 --- a/ddb/db_access.c +++ b/ddb/db_access.c @@ -62,11 +62,11 @@ static int db_extend[sizeof(int)+1] = { /* table for sign-extending */ }; db_expr_t -db_get_task_value(addr, size, is_signed, task) - db_addr_t addr; - int size; - boolean_t is_signed; - task_t task; +db_get_task_value( + db_addr_t addr, + int size, + boolean_t is_signed, + task_t task) { char data[sizeof(db_expr_t)]; db_expr_t value; @@ -92,11 +92,11 @@ db_get_task_value(addr, size, is_signed, task) } void -db_put_task_value(addr, size, value, task) - db_addr_t addr; - int size; - db_expr_t value; - task_t task; +db_put_task_value( + db_addr_t addr, + int size, + db_expr_t value, + task_t task) { char data[sizeof(db_expr_t)]; int i; @@ -115,19 +115,19 @@ db_put_task_value(addr, size, value, task) } db_expr_t -db_get_value(addr, size, is_signed) - db_addr_t addr; - int size; - boolean_t is_signed; +db_get_value( + db_addr_t addr, + int size, + boolean_t is_signed) { return(db_get_task_value(addr, size, is_signed, TASK_NULL)); } void -db_put_value(addr, size, value) - db_addr_t addr; - int size; - db_expr_t value; +db_put_value( + db_addr_t addr, + int size, + db_expr_t value) { db_put_task_value(addr, size, value, TASK_NULL); } diff --git a/ddb/db_aout.c b/ddb/db_aout.c index 87ba975..d3f2e31 100644 --- a/ddb/db_aout.c +++ b/ddb/db_aout.c @@ -70,13 +70,13 @@ ep = (struct nlist *)((char *)sp + *((int*)symtab))) boolean_t -aout_db_sym_init(symtab, esymtab, name, task_addr) - char * symtab; /* pointer to start of symbol table */ - char * esymtab; /* pointer to end of string table, +aout_db_sym_init( + char * symtab, /* pointer to start of symbol table */ + char * esymtab, /* pointer to end of string table, for checking - may be rounded up to integer boundary */ - char * name; - char * task_addr; /* use for this task only */ + char * name, + char * task_addr) /* use for this task only */ { struct nlist *sym_start, *sym_end; struct nlist *sp; @@ -313,19 +313,19 @@ aout_db_qualified_search(stab, file, sym, line) * lookup symbol by name */ db_sym_t -aout_db_lookup(stab, symstr) - db_symtab_t *stab; - char * symstr; +aout_db_lookup( + db_symtab_t *stab, + char * symstr) { return(db_sym_parse_and_lookup(aout_db_qualified_search, stab, symstr)); } db_sym_t -aout_db_search_symbol(symtab, off, strategy, diffp) - db_symtab_t * symtab; - db_addr_t off; - db_strategy_t strategy; - db_expr_t *diffp; /* in/out */ +aout_db_search_symbol( + db_symtab_t * symtab, + db_addr_t off, + db_strategy_t strategy, + db_expr_t *diffp) /* in/out */ { unsigned long diff = *diffp; struct nlist *symp = 0; @@ -374,11 +374,11 @@ aout_db_search_symbol(symtab, off, strategy, diffp) * Return the name and value for a symbol. */ void -aout_db_symbol_values(stab, sym, namep, valuep) - db_symtab_t *stab; - db_sym_t sym; - char **namep; - db_expr_t *valuep; +aout_db_symbol_values( + db_symtab_t *stab, + db_sym_t sym, + char **namep, + db_expr_t *valuep) { struct nlist *sp; diff --git a/ddb/db_break.c b/ddb/db_break.c index 0534f68..c3a9e18 100644 --- a/ddb/db_break.c +++ b/ddb/db_break.c @@ -121,9 +121,9 @@ db_add_thread_breakpoint(bkpt, task_thd, count, task_bpt) } static int -db_delete_thread_breakpoint(bkpt, task_thd) - db_breakpoint_t bkpt; - vm_offset_t task_thd; +db_delete_thread_breakpoint( + db_breakpoint_t bkpt, + vm_offset_t task_thd) { db_thread_breakpoint_t tp; db_thread_breakpoint_t *tpp; @@ -188,9 +188,9 @@ db_find_thread_breakpoint_here(task, addr) } db_thread_breakpoint_t -db_find_breakpoint_number(num, bkptp) - int num; - db_breakpoint_t *bkptp; +db_find_breakpoint_number( + int num, + db_breakpoint_t *bkptp) { db_thread_breakpoint_t tp; db_breakpoint_t bkpt; @@ -208,10 +208,10 @@ db_find_breakpoint_number(num, bkptp) } static void -db_force_delete_breakpoint(bkpt, task_thd, is_task) - db_breakpoint_t bkpt; - vm_offset_t task_thd; - boolean_t is_task; +db_force_delete_breakpoint( + db_breakpoint_t bkpt, + vm_offset_t task_thd, + boolean_t is_task) { db_printf("deleted a stale breakpoint at "); if (bkpt->task == TASK_NULL || db_lookup_task(bkpt->task) >= 0) @@ -482,9 +482,9 @@ db_clear_breakpoints(void) * so the breakpoint does not have to be on the breakpoint list. */ db_breakpoint_t -db_set_temp_breakpoint(task, addr) - task_t task; - db_addr_t addr; +db_set_temp_breakpoint( + task_t task, + db_addr_t addr) { db_breakpoint_t bkpt; @@ -511,9 +511,9 @@ db_set_temp_breakpoint(task, addr) } void -db_delete_temp_breakpoint(task, bkpt) - task_t task; - db_breakpoint_t bkpt; +db_delete_temp_breakpoint( + task_t task, + db_breakpoint_t bkpt) { db_put_task_value(bkpt->address, BKPT_SIZE, bkpt->bkpt_inst, task); db_delete_thread_breakpoint(bkpt, 0); diff --git a/ddb/db_command.c b/ddb/db_command.c index 3879ec5..ebb13df 100644 --- a/ddb/db_command.c +++ b/ddb/db_command.c @@ -153,9 +153,9 @@ db_cmd_list(table) } void -db_command(last_cmdp, cmd_table) - struct db_command **last_cmdp; /* IN_OUT */ - struct db_command *cmd_table; +db_command( + struct db_command **last_cmdp, /* IN_OUT */ + struct db_command *cmd_table) { struct db_command *cmd; int t; @@ -293,9 +293,9 @@ db_command(last_cmdp, cmd_table) } void -db_command_list(last_cmdp, cmd_table) - struct db_command **last_cmdp; /* IN_OUT */ - struct db_command *cmd_table; +db_command_list( + struct db_command **last_cmdp, /* IN_OUT */ + struct db_command *cmd_table) { do { db_command(last_cmdp, cmd_table); @@ -370,8 +370,7 @@ struct db_command db_command_table[] = { /* this function should be called to install the machine dependent commands. It should be called before the debugger is enabled */ -void db_machine_commands_install(ptr) -struct db_command *ptr; +void db_machine_commands_install(struct db_command *ptr) { db_command_table[0].more = ptr; return; @@ -429,9 +428,9 @@ db_command_loop(void) } boolean_t -db_exec_cmd_nest(cmd, size) - char *cmd; - int size; +db_exec_cmd_nest( + char *cmd, + int size) { struct db_lex_context lex_context; diff --git a/ddb/db_cond.c b/ddb/db_cond.c index 2c923b4..31e1d24 100644 --- a/ddb/db_cond.c +++ b/ddb/db_cond.c @@ -48,8 +48,7 @@ struct db_cond { } db_cond[DB_MAX_COND]; void -db_cond_free(bkpt) - db_thread_breakpoint_t bkpt; +db_cond_free(db_thread_breakpoint_t bkpt) { if (bkpt->tb_cond > 0) { db_cond[bkpt->tb_cond-1].c_size = 0; @@ -59,8 +58,7 @@ db_cond_free(bkpt) } boolean_t -db_cond_check(bkpt) - db_thread_breakpoint_t bkpt; +db_cond_check(db_thread_breakpoint_t bkpt) { struct db_cond *cp; db_expr_t value; diff --git a/ddb/db_examine.c b/ddb/db_examine.c index cb103ae..836b0e8 100644 --- a/ddb/db_examine.c +++ b/ddb/db_examine.c @@ -321,9 +321,9 @@ db_print_cmd(void) } void -db_print_loc_and_inst(loc, task) - db_addr_t loc; - task_t task; +db_print_loc_and_inst( + db_addr_t loc, + task_t task) { db_task_printsym(loc, DB_STGY_PROC, task); db_printf(":\t"); @@ -425,13 +425,13 @@ db_search_cmd(void) } void -db_search(addr, size, value, mask, count, task) - db_addr_t addr; - int size; - db_expr_t value; - db_expr_t mask; - unsigned int count; - task_t task; +db_search( + db_addr_t addr, + int size, + db_expr_t value, + db_expr_t mask, + unsigned int count, + task_t task) { while (count-- != 0) { db_prev = addr; @@ -445,11 +445,11 @@ db_search(addr, size, value, mask, count, task) #define DB_XCDUMP_NC 16 int -db_xcdump(addr, size, count, task) - db_addr_t addr; - int size; - int count; - task_t task; +db_xcdump( + db_addr_t addr, + int size, + int count, + task_t task) { int i, n; db_expr_t value; diff --git a/ddb/db_expr.c b/ddb/db_expr.c index dad09e5..c9e6752 100644 --- a/ddb/db_expr.c +++ b/ddb/db_expr.c @@ -41,10 +41,8 @@ #include <ddb/db_variables.h> #include <kern/task.h> - boolean_t -db_term(valuep) - db_expr_t *valuep; +db_term(db_expr_t *valuep) { int t; @@ -127,8 +125,7 @@ db_size_option(modif, u_option, t_option) } boolean_t -db_unary(valuep) - db_expr_t *valuep; +db_unary(db_expr_t *valuep) { int t; int size; @@ -177,8 +174,7 @@ db_unary(valuep) } boolean_t -db_mult_expr(valuep) - db_expr_t *valuep; +db_mult_expr(db_expr_t *valuep) { db_expr_t lhs = 0, rhs; int t; @@ -223,8 +219,7 @@ db_mult_expr(valuep) } boolean_t -db_add_expr(valuep) - db_expr_t *valuep; +db_add_expr(db_expr_t *valuep) { db_expr_t lhs, rhs; int t; @@ -255,8 +250,7 @@ db_add_expr(valuep) } boolean_t -db_shift_expr(valuep) - db_expr_t *valuep; +db_shift_expr(db_expr_t *valuep) { db_expr_t lhs, rhs; int t; @@ -290,8 +284,7 @@ db_shift_expr(valuep) } boolean_t -db_logical_relation_expr(valuep) - db_expr_t *valuep; +db_logical_relation_expr(db_expr_t *valuep) { db_expr_t lhs, rhs; int t; @@ -340,8 +333,7 @@ db_logical_relation_expr(valuep) } boolean_t -db_logical_and_expr(valuep) - db_expr_t *valuep; +db_logical_and_expr(db_expr_t *valuep) { db_expr_t lhs, rhs; int t; @@ -363,8 +355,7 @@ db_logical_and_expr(valuep) } boolean_t -db_logical_or_expr(valuep) - db_expr_t *valuep; +db_logical_or_expr(db_expr_t *valuep) { db_expr_t lhs, rhs; int t; @@ -386,8 +377,7 @@ db_logical_or_expr(valuep) } int -db_expression(valuep) - db_expr_t *valuep; +db_expression(db_expr_t *valuep) { return (db_logical_or_expr(valuep)); } diff --git a/ddb/db_ext_symtab.c b/ddb/db_ext_symtab.c index 9831a01..cafb0c4 100644 --- a/ddb/db_ext_symtab.c +++ b/ddb/db_ext_symtab.c @@ -46,12 +46,12 @@ * the caller and the kernel debugger agree on its format. */ kern_return_t -host_load_symbol_table(host, task, name, symtab, symtab_count) - host_t host; - task_t task; - char * name; - pointer_t symtab; - unsigned int symtab_count; +host_load_symbol_table( + host_t host, + task_t task, + char * name, + pointer_t symtab, + unsigned int symtab_count) { kern_return_t result; vm_offset_t symtab_start; diff --git a/ddb/db_input.c b/ddb/db_input.c index f908705..6b6db76 100644 --- a/ddb/db_input.c +++ b/ddb/db_input.c @@ -91,9 +91,9 @@ db_putnchars(c, count) #define DEL_FWD 0 #define DEL_BWD 1 void -db_delete(n, bwd) - int n; - int bwd; +db_delete( + int n, + int bwd) { char *p; @@ -137,8 +137,7 @@ db_delete_line(void) /* returns TRUE at end-of-line */ boolean_t -db_inputchar(c) - int c; +db_inputchar(int c) { switch (c) { case CTRL('b'): @@ -328,9 +327,9 @@ db_inputchar(c) } int -db_readline(lstart, lsize) - char * lstart; - int lsize; +db_readline( + char * lstart, + int lsize) { db_force_whitespace(); /* synch output position */ diff --git a/ddb/db_lex.c b/ddb/db_lex.c index e7f67d2..8ab6910 100644 --- a/ddb/db_lex.c +++ b/ddb/db_lex.c @@ -82,9 +82,9 @@ db_flush_line(void) } void -db_switch_input(buffer, size) - char *buffer; - int size; +db_switch_input( + char *buffer, + int size) { db_lp = buffer; db_last_lp = db_lp; @@ -94,8 +94,7 @@ db_switch_input(buffer, size) } void -db_save_lex_context(lp) - struct db_lex_context *lp; +db_save_lex_context(struct db_lex_context *lp) { lp->l_ptr = db_lp; lp->l_eptr = db_endlp; @@ -131,15 +130,13 @@ db_read_char(void) } void -db_unread_char(c) - int c; +db_unread_char(int c) { db_look_char = c; } void -db_unread_token(t) - int t; +db_unread_token(int t) { db_look_token = t; } diff --git a/ddb/db_macro.c b/ddb/db_macro.c index e22f6bf..307b7c5 100644 --- a/ddb/db_macro.c +++ b/ddb/db_macro.c @@ -167,11 +167,11 @@ db_exec_macro(name) void /* ARGSUSED */ -db_arg_variable(vp, valuep, flag, ap) - struct db_variable *vp; - db_expr_t *valuep; - int flag; - db_var_aux_param_t ap; +db_arg_variable( + struct db_variable *vp, + db_expr_t *valuep, + int flag, + db_var_aux_param_t ap) { if (ap->level != 1 || ap->suffix[0] < 1 || ap->suffix[0] > DB_NARGS) { db_error("Bad $arg variable\n"); diff --git a/ddb/db_mp.c b/ddb/db_mp.c index ae82c27..8d1a560 100644 --- a/ddb/db_mp.c +++ b/ddb/db_mp.c @@ -210,8 +210,7 @@ remote_db(void) { * switch to another cpu */ void -db_on(cpu) - int cpu; +db_on(int cpu) { /* * Save ddb global variables diff --git a/ddb/db_output.c b/ddb/db_output.c index f2829cc..be5319d 100644 --- a/ddb/db_output.c +++ b/ddb/db_output.c @@ -132,8 +132,7 @@ db_more(void) * Output character. Buffer whitespace. */ void -db_putchar(c) - int c; /* character to output */ +db_putchar(int c) /* character to output */ { if (db_max_line >= DB_MIN_MAX_LINE && db_output_line >= db_max_line-1) db_more(); diff --git a/ddb/db_print.c b/ddb/db_print.c index 17ca2cc..c015d84 100644 --- a/ddb/db_print.c +++ b/ddb/db_print.c @@ -57,11 +57,11 @@ extern unsigned long db_maxoff; /* ARGSUSED */ void -db_show_regs(addr, have_addr, count, modif) - db_expr_t addr; - boolean_t have_addr; - db_expr_t count; - char *modif; +db_show_regs( + db_expr_t addr, + boolean_t have_addr, + db_expr_t count, + char *modif) { struct db_variable *regp; db_expr_t value; @@ -144,10 +144,10 @@ db_thread_stat(thread, status) } void -db_print_thread(thread, thread_id, flag) - thread_t thread; - int thread_id; - int flag; +db_print_thread( + thread_t thread, + int thread_id, + int flag) { if (flag & OPTION_USER) { char status[8]; @@ -220,10 +220,10 @@ db_print_thread(thread, thread_id, flag) } void -db_print_task(task, task_id, flag) - task_t task; - int task_id; - int flag; +db_print_task( + task_t task, + int task_id, + int flag) { thread_t thread; int thread_id; @@ -431,9 +431,9 @@ db_port_iterate(thread, func) } ipc_port_t -db_lookup_port(thread, id) - thread_t thread; - int id; +db_lookup_port( + thread_t thread, + int id) { ipc_space_t space; ipc_entry_t entry; diff --git a/ddb/db_run.c b/ddb/db_run.c index 6e409ff..9b467fc 100644 --- a/ddb/db_run.c +++ b/ddb/db_run.c @@ -60,9 +60,9 @@ int db_load_count; int db_store_count; boolean_t -db_stop_at_pc(is_breakpoint, task) - boolean_t *is_breakpoint; - task_t task; +db_stop_at_pc( + boolean_t *is_breakpoint, + task_t task) { db_addr_t pc; db_thread_breakpoint_t bkpt; @@ -156,9 +156,9 @@ db_stop_at_pc(is_breakpoint, task) } void -db_restart_at_pc(watchpt, task) - boolean_t watchpt; - task_t task; +db_restart_at_pc( + boolean_t watchpt, + task_t task) { db_addr_t pc = PC_REGS(DDB_REGS); @@ -206,9 +206,9 @@ db_restart_at_pc(watchpt, task) } void -db_single_step(regs, task) - db_regs_t *regs; - task_t task; +db_single_step( + db_regs_t *regs, + task_t task) { if (db_run_mode == STEP_CONTINUE) { db_run_mode = STEP_INVISIBLE; @@ -264,9 +264,9 @@ db_find_temp_breakpoint(task, addr) } void -db_set_task_single_step(regs, task) - db_regs_t *regs; - task_t task; +db_set_task_single_step( + db_regs_t *regs, + task_t task) { db_addr_t pc = PC_REGS(regs), brpc; unsigned int inst; diff --git a/ddb/db_sym.c b/ddb/db_sym.c index 3c8caf4..7d97d15 100644 --- a/ddb/db_sym.c +++ b/ddb/db_sym.c @@ -55,13 +55,13 @@ db_symtab_t *db_last_symtab; * Add symbol table, with given name, to list of symbol tables. */ boolean_t -db_add_symbol_table(type, start, end, name, ref, map_pointer) - int type; - char *start; - char *end; - char *name; - char *ref; - char *map_pointer; +db_add_symbol_table( + int type, + char *start, + char *end, + char *name, + char *ref, + char *map_pointer) { db_symtab_t *st; extern vm_map_t kernel_map; @@ -119,9 +119,9 @@ db_eqname( const char* src, const char* dst, char c ) } boolean_t -db_value_of_name(name, valuep) - char *name; - db_expr_t *valuep; +db_value_of_name( + char *name, + db_expr_t *valuep) { db_sym_t sym; @@ -141,8 +141,7 @@ db_value_of_name(name, valuep) * otherwise, all symbol tables will be searched. */ db_sym_t -db_lookup(symstr) - char *symstr; +db_lookup(char *symstr) { db_sym_t sp; int i; @@ -193,10 +192,10 @@ db_lookup(symstr) * with parsed file name, symbol name and line number. */ db_sym_t -db_sym_parse_and_lookup(func, symtab, symstr) - db_sym_t (*func)(); - db_symtab_t *symtab; - char *symstr; +db_sym_parse_and_lookup( + db_sym_t (*func)(), + db_symtab_t *symtab, + char *symstr) { char *p; int n; @@ -265,8 +264,7 @@ out: boolean_t db_qualify_ambiguous_names = FALSE; boolean_t -db_name_is_ambiguous(sym_name) - char *sym_name; +db_name_is_ambiguous(char *sym_name) { int i; boolean_t found_once = FALSE; @@ -301,11 +299,11 @@ db_name_is_ambiguous(sym_name) * */ db_sym_t -db_search_task_symbol(val, strategy, offp, task) - db_addr_t val; - db_strategy_t strategy; - db_addr_t *offp; /* better be unsigned */ - task_t task; +db_search_task_symbol( + db_addr_t val, + db_strategy_t strategy, + db_addr_t *offp, /* better be unsigned */ + task_t task) { db_sym_t ret; @@ -330,11 +328,11 @@ db_search_task_symbol(val, strategy, offp, task) } db_sym_t -db_search_in_task_symbol(val, strategy, offp, task) - db_addr_t val; - db_strategy_t strategy; - db_addr_t *offp; - task_t task; +db_search_in_task_symbol( + db_addr_t val, + db_strategy_t strategy, + db_addr_t *offp, + task_t task) { vm_size_t diff; vm_size_t newdiff; @@ -398,11 +396,11 @@ db_search_in_task_symbol(val, strategy, offp, task) * Return name and value of a symbol */ void -db_symbol_values(stab, sym, namep, valuep) - db_symtab_t *stab; - db_sym_t sym; - char **namep; - db_expr_t *valuep; +db_symbol_values( + db_symtab_t *stab, + db_sym_t sym, + char **namep, + db_expr_t *valuep) { db_expr_t value; char *name; diff --git a/ddb/db_task_thread.c b/ddb/db_task_thread.c index 266b1ea..edab17e 100644 --- a/ddb/db_task_thread.c +++ b/ddb/db_task_thread.c @@ -153,8 +153,7 @@ db_check_thread_address_valid(thread) * convert task_id(queue postion) to task address */ task_t -db_lookup_task_id(task_id) - int task_id; +db_lookup_task_id(int task_id) { task_t task; processor_set_t pset; @@ -181,9 +180,9 @@ db_lookup_task_id(task_id) * convert (task_id, thread_id) pair to thread address */ static thread_t -db_lookup_thread_id(task, thread_id) - task_t task; - int thread_id; +db_lookup_thread_id( + task_t task, + int thread_id) { thread_t thread; @@ -204,9 +203,9 @@ db_lookup_thread_id(task, thread_id) * thread address */ boolean_t -db_get_next_thread(threadp, position) - thread_t *threadp; - int position; +db_get_next_thread( + thread_t *threadp, + int position) { db_expr_t value; thread_t thread; @@ -272,11 +271,11 @@ db_set_default_thread(vp, valuep, flag, ap) * convert $taskXXX[.YYY] type DDB variable to task or thread address */ void -db_get_task_thread(vp, valuep, flag, ap) - struct db_variable *vp; - db_expr_t *valuep; - int flag; - db_var_aux_param_t ap; +db_get_task_thread( + struct db_variable *vp, + db_expr_t *valuep, + int flag, + db_var_aux_param_t ap) { task_t task; thread_t thread; diff --git a/ddb/db_trap.c b/ddb/db_trap.c index 28f64d1..b56ffdc 100644 --- a/ddb/db_trap.c +++ b/ddb/db_trap.c @@ -53,9 +53,10 @@ extern int db_load_count; extern int db_store_count; void -db_task_trap(type, code, user_space) - int type, code; - boolean_t user_space; +db_task_trap( + int type, + int code, + boolean_t user_space) { jmp_buf_t db_jmpbuf; jmp_buf_t *prev; @@ -96,8 +97,9 @@ db_task_trap(type, code, user_space) } void -db_trap(type, code) - int type, code; +db_trap( + int type, + int code) { db_task_trap(type, code, !DB_VALID_KERN_ADDR(PC_REGS(DDB_REGS))); } diff --git a/ddb/db_variables.c b/ddb/db_variables.c index 7f5a2c9..4442ccb 100644 --- a/ddb/db_variables.c +++ b/ddb/db_variables.c @@ -115,9 +115,9 @@ db_cmp_variable_name(vp, name, ap) } int -db_find_variable(varp, ap) - struct db_variable **varp; - db_var_aux_param_t ap; +db_find_variable( + struct db_variable **varp, + db_var_aux_param_t ap) { int t; struct db_variable *vp; @@ -143,8 +143,7 @@ db_find_variable(varp, ap) } int -db_get_variable(valuep) - db_expr_t *valuep; +db_get_variable(db_expr_t *valuep) { struct db_variable *vp; struct db_var_aux_param aux_param; @@ -160,8 +159,7 @@ db_get_variable(valuep) } int -db_set_variable(value) - db_expr_t value; +db_set_variable(db_expr_t value) { struct db_variable *vp; struct db_var_aux_param aux_param; @@ -177,11 +175,11 @@ db_set_variable(value) } void -db_read_write_variable(vp, valuep, rw_flag, ap) - struct db_variable *vp; - db_expr_t *valuep; - int rw_flag; - db_var_aux_param_t ap; +db_read_write_variable( + struct db_variable *vp, + db_expr_t *valuep, + int rw_flag, + db_var_aux_param_t ap) { void (*func)() = vp->fcn; struct db_var_aux_param aux_param; diff --git a/ddb/db_watch.c b/ddb/db_watch.c index dbb4aea..f0d0443 100644 --- a/ddb/db_watch.c +++ b/ddb/db_watch.c @@ -294,10 +294,10 @@ db_clear_watchpoints(void) } boolean_t -db_find_watchpoint(map, addr, regs) - vm_map_t map; - db_addr_t addr; - db_regs_t *regs; +db_find_watchpoint( + vm_map_t map, + db_addr_t addr, + db_regs_t *regs) { db_watchpoint_t watch; db_watchpoint_t found = 0; diff --git a/device/blkio.c b/device/blkio.c index 52d8c00..ee86634 100644 --- a/device/blkio.c +++ b/device/blkio.c @@ -38,10 +38,10 @@ -io_return_t block_io(strat, max_count, ior) - void (*strat)(); - void (*max_count)(); - io_req_t ior; +io_return_t block_io( + void (*strat)(), + void (*max_count)(), + io_req_t ior) { kern_return_t rc; boolean_t wait = FALSE; @@ -88,8 +88,7 @@ io_return_t block_io(strat, max_count, ior) */ #define MAX_PHYS (256 * 1024) -void minphys(ior) - io_req_t ior; +void minphys(io_req_t ior) { if ((ior->io_op & (IO_WRITE | IO_READ | IO_OPEN)) == IO_WRITE) return; diff --git a/device/chario.c b/device/chario.c index 0d9f803..0e9dd70 100644 --- a/device/chario.c +++ b/device/chario.c @@ -839,8 +839,7 @@ void ttrstrt( * Called at spltty, tty already locked. * Must be on master CPU if device runs on master. */ -void ttstart(tp) - struct tty *tp; +void ttstart(struct tty *tp) { if ((tp->t_state & (TS_TIMEOUT|TS_TTSTOP|TS_BUSY)) == 0) { /* diff --git a/device/dev_lookup.c b/device/dev_lookup.c index d371b60..a80830c 100644 --- a/device/dev_lookup.c +++ b/device/dev_lookup.c @@ -120,8 +120,7 @@ dev_number_lookup(ops, devnum) * table. */ mach_device_t -device_lookup(name) - char * name; +device_lookup(char *name) { dev_ops_t dev_ops; int dev_minor; @@ -198,8 +197,7 @@ device_lookup(name) * Add a reference to the device. */ void -mach_device_reference(device) - mach_device_t device; +mach_device_reference(mach_device_t device) { simple_lock(&device->ref_lock); device->ref_count++; @@ -211,8 +209,7 @@ mach_device_reference(device) * structure if no references are left. */ void -mach_device_deallocate(device) - mach_device_t device; +mach_device_deallocate(mach_device_t device) { simple_lock(&device->ref_lock); if (--device->ref_count > 0) { @@ -248,8 +245,7 @@ mach_device_deallocate(device) * Enter a port-to-device mapping. */ void -dev_port_enter(device) - mach_device_t device; +dev_port_enter(mach_device_t device) { mach_device_reference(device); @@ -267,8 +263,7 @@ dev_port_enter(device) * Remove a port-to-device mapping. */ void -dev_port_remove(device) - mach_device_t device; +dev_port_remove(mach_device_t device) { ipc_kobject_set(device->port, IKO_NULL, IKOT_NONE); mach_device_deallocate(device); @@ -279,8 +274,7 @@ dev_port_remove(device) * Doesn't consume the naked send right; produces a device reference. */ device_t -dev_port_lookup(port) - ipc_port_t port; +dev_port_lookup(ipc_port_t port) { device_t device; @@ -321,9 +315,9 @@ convert_device_to_port(device) * return FALSE. */ boolean_t -dev_map(routine, port) - boolean_t (*routine)(); - mach_port_t port; +dev_map( + boolean_t (*routine)(), + mach_port_t port) { int i; queue_t q; diff --git a/device/dev_name.c b/device/dev_name.c index cd3a28a..5bf62a0 100644 --- a/device/dev_name.c +++ b/device/dev_name.c @@ -112,10 +112,10 @@ name_equal(src, len, target) /* * device name lookup */ -boolean_t dev_name_lookup(name, ops, unit) - char *name; - dev_ops_t *ops; /* out */ - int *unit; /* out */ +boolean_t dev_name_lookup( + char *name, + dev_ops_t *ops, /* out */ + int *unit) /* out */ { /* * Assume that block device names are of the form diff --git a/device/dev_pager.c b/device/dev_pager.c index 3fe47c7..815473a 100644 --- a/device/dev_pager.c +++ b/device/dev_pager.c @@ -513,8 +513,7 @@ kern_return_t device_pager_data_write( return (KERN_SUCCESS); } -boolean_t device_pager_data_write_done(ior) - io_req_t ior; +boolean_t device_pager_data_write_done(io_req_t ior) { device_write_dealloc(ior); mach_device_deallocate(ior->io_device); diff --git a/device/ds_routines.c b/device/ds_routines.c index 4e04445..38d773c 100644 --- a/device/ds_routines.c +++ b/device/ds_routines.c @@ -597,8 +597,7 @@ ds_open_done(ior) } static io_return_t -device_close(device) - mach_device_t device; +device_close(mach_device_t device) { device_lock(device); @@ -824,9 +823,9 @@ device_write_inband(device, reply_port, reply_port_type, mode, recnum, * Wire down incoming memory to give to device. */ kern_return_t -device_write_get(ior, wait) - io_req_t ior; - boolean_t *wait; +device_write_get( + io_req_t ior, + boolean_t *wait) { vm_map_copy_t io_copy; vm_offset_t new_addr; @@ -919,8 +918,7 @@ device_write_get(ior, wait) * Clean up memory allocated for IO. */ boolean_t -device_write_dealloc(ior) - io_req_t ior; +device_write_dealloc(io_req_t ior) { vm_map_copy_t new_copy = VM_MAP_COPY_NULL; vm_map_copy_t io_copy; @@ -1221,9 +1219,9 @@ device_read_inband(device, reply_port, reply_port_type, mode, recnum, /* * Allocate wired-down memory for device read. */ -kern_return_t device_read_alloc(ior, size) - io_req_t ior; - vm_size_t size; +kern_return_t device_read_alloc( + io_req_t ior, + vm_size_t size) { vm_offset_t addr; kern_return_t kr; @@ -1346,11 +1344,11 @@ boolean_t ds_read_done(ior) } static io_return_t -device_set_status(device, flavor, status, status_count) - mach_device_t device; - dev_flavor_t flavor; - dev_status_t status; - mach_msg_type_number_t status_count; +device_set_status( + mach_device_t device, + dev_flavor_t flavor, + dev_status_t status, + mach_msg_type_number_t status_count) { if (device->state != DEV_STATE_OPEN) return (D_NO_SUCH_DEVICE); @@ -1364,11 +1362,11 @@ device_set_status(device, flavor, status, status_count) } io_return_t -mach_device_get_status(device, flavor, status, status_count) - mach_device_t device; - dev_flavor_t flavor; - dev_status_t status; /* pointer to OUT array */ - mach_msg_type_number_t *status_count; /* out */ +mach_device_get_status( + mach_device_t device, + dev_flavor_t flavor, + dev_status_t status, /* pointer to OUT array */ + mach_msg_type_number_t *status_count) /* out */ { if (device->state != DEV_STATE_OPEN) return (D_NO_SUCH_DEVICE); @@ -1408,13 +1406,13 @@ device_set_filter(device, receive_port, priority, filter, filter_count) } static io_return_t -device_map(device, protection, offset, size, pager, unmap) - mach_device_t device; - vm_prot_t protection; - vm_offset_t offset; - vm_size_t size; - ipc_port_t *pager; /* out */ - boolean_t unmap; /* ? */ +device_map( + mach_device_t device, + vm_prot_t protection, + vm_offset_t offset, + vm_size_t size, + ipc_port_t *pager, /* out */ + boolean_t unmap) /* ? */ { if (protection & ~VM_PROT_ALL) return (KERN_INVALID_ARGUMENT); @@ -1445,8 +1443,7 @@ decl_simple_lock_data(, io_done_list_lock) #define splio splsched /* XXX must block ALL io devices */ -void iodone(ior) - io_req_t ior; +void iodone(io_req_t ior) { spl_t s; @@ -1566,8 +1563,7 @@ void mach_device_init(void) mach_device_trap_init(); } -void iowait(ior) - io_req_t ior; +void iowait(io_req_t ior) { spl_t s; diff --git a/device/net_io.c b/device/net_io.c index e758f2d..82b6fb9 100644 --- a/device/net_io.c +++ b/device/net_io.c @@ -412,8 +412,7 @@ mach_msg_type_t packet_type = { * Dequeues a message and delivers it at spl0. * Returns FALSE if no messages. */ -boolean_t net_deliver(nonblocking) - boolean_t nonblocking; +boolean_t net_deliver(boolean_t nonblocking) { ipc_kmsg_t kmsg; boolean_t high_priority; @@ -603,8 +602,9 @@ void net_thread(void) } void -reorder_queue(first, last) - queue_t first, last; +reorder_queue( + queue_t first, + queue_t last) { queue_entry_t prev, next; @@ -626,11 +626,11 @@ reorder_queue(first, last) * We are already at splimp. */ void -net_packet(ifp, kmsg, count, priority) - struct ifnet *ifp; - ipc_kmsg_t kmsg; - unsigned int count; - boolean_t priority; +net_packet( + struct ifnet *ifp, + ipc_kmsg_t kmsg, + unsigned int count, + boolean_t priority) { boolean_t awake; @@ -1010,9 +1010,9 @@ net_do_filter(infp, data, data_count, header) * Check filter for invalid operations or stack over/under-flow. */ boolean_t -parse_net_filter(filter, count) - filter_t *filter; - unsigned int count; +parse_net_filter( + filter_t *filter, + unsigned int count) { int sp; filter_t *fpe = &filter[count]; @@ -1104,12 +1104,12 @@ parse_net_filter(filter, count) * If we are successful, we must consume that right. */ io_return_t -net_set_filter(ifp, rcv_port, priority, filter, filter_count) - struct ifnet *ifp; - ipc_port_t rcv_port; - int priority; - filter_t *filter; - unsigned int filter_count; +net_set_filter( + struct ifnet *ifp, + ipc_port_t rcv_port, + int priority, + filter_t *filter, + unsigned int filter_count) { int filter_bytes; bpf_insn_t match; @@ -1369,11 +1369,11 @@ clean_and_return: * Other network operations */ io_return_t -net_getstat(ifp, flavor, status, count) - struct ifnet *ifp; - dev_flavor_t flavor; - dev_status_t status; /* pointer to OUT array */ - natural_t *count; /* OUT */ +net_getstat( + struct ifnet *ifp, + dev_flavor_t flavor, + dev_status_t status, /* pointer to OUT array */ + natural_t *count) /* OUT */ { switch (flavor) { case NET_STATUS: @@ -1434,10 +1434,10 @@ printf ("net_getstat: count: %d, addr_int_count: %d\n", } io_return_t -net_write(ifp, start, ior) - struct ifnet *ifp; - int (*start)(); - io_req_t ior; +net_write( + struct ifnet *ifp, + int (*start)(), + io_req_t ior) { spl_t s; kern_return_t rc; @@ -1590,13 +1590,14 @@ net_io_init(void) */ int -bpf_do_filter(infp, p, wirelen, header, hlen, hash_headpp, entpp) - net_rcv_port_t infp; - char * p; /* packet data */ - unsigned int wirelen; /* data_count (in bytes) */ - char * header; - unsigned int hlen; /* header len (in bytes) */ - net_hash_entry_t **hash_headpp, *entpp; /* out */ +bpf_do_filter( + net_rcv_port_t infp, + char * p, /* packet data */ + unsigned int wirelen, /* data_count (in bytes) */ + char * header, + unsigned int hlen, /* header len (in bytes) */ + net_hash_entry_t **hash_headpp, + net_hash_entry_t *entpp) /* out */ { bpf_insn_t pc, pc_end; unsigned int buflen; @@ -1889,10 +1890,10 @@ bpf_do_filter(infp, p, wirelen, header, hlen, hash_headpp, entpp) * Otherwise, a bogus program could easily crash the system. */ int -bpf_validate(f, bytes, match) - bpf_insn_t f; - int bytes; - bpf_insn_t *match; +bpf_validate( + bpf_insn_t f, + int bytes, + bpf_insn_t *match) { int i, j, len; bpf_insn_t p; @@ -1961,9 +1962,10 @@ bpf_validate(f, bytes, match) } int -bpf_eq (f1, f2, bytes) - bpf_insn_t f1, f2; - int bytes; +bpf_eq( + bpf_insn_t f1, + bpf_insn_t f2, + int bytes) { int count; @@ -2035,12 +2037,13 @@ bpf_match (hash, n_keys, keys, hash_headpp, entpp) */ int -hash_ent_remove (ifp, hp, used, head, entp, dead_p) - struct ifnet *ifp; - net_hash_header_t hp; - int used; - net_hash_entry_t *head, entp; - queue_entry_t *dead_p; +hash_ent_remove( + struct ifnet *ifp, + net_hash_header_t hp, + int used, + net_hash_entry_t *head, + net_hash_entry_t entp, + queue_entry_t *dead_p) { hp->ref_count--; @@ -2072,8 +2075,7 @@ hash_ent_remove (ifp, hp, used, head, entp, dead_p) } int -net_add_q_info (rcv_port) - ipc_port_t rcv_port; +net_add_q_info(ipc_port_t rcv_port) { mach_port_msgcount_t qlimit = 0; @@ -2098,8 +2100,7 @@ net_add_q_info (rcv_port) } void -net_del_q_info (qlimit) - int qlimit; +net_del_q_info(int qlimit) { simple_lock(&net_kmsg_total_lock); net_queue_free_min--; @@ -2116,8 +2117,7 @@ net_del_q_info (qlimit) * No locks should be held when called. */ void -net_free_dead_infp (dead_infp) - queue_entry_t dead_infp; +net_free_dead_infp(queue_entry_t dead_infp) { net_rcv_port_t infp, nextfp; @@ -2138,8 +2138,7 @@ net_free_dead_infp (dead_infp) * No locks should be held when called. */ void -net_free_dead_entp (dead_entp) - queue_entry_t dead_entp; +net_free_dead_entp(queue_entry_t dead_entp) { net_hash_entry_t entp, nextentp; diff --git a/device/subrs.c b/device/subrs.c index 7e6e30d..a10b72d 100644 --- a/device/subrs.c +++ b/device/subrs.c @@ -75,8 +75,7 @@ ether_sprintf(ap) /* * Initialize send and receive queues on an interface. */ -void if_init_queues(ifp) - struct ifnet *ifp; +void if_init_queues(struct ifnet *ifp) { IFQ_INIT(&ifp->if_snd); queue_init(&ifp->if_rcv_port_list); 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; diff --git a/i386/i386at/com.c b/i386/i386at/com.c index 07521f9..5e65ad8 100644 --- a/i386/i386at/com.c +++ b/i386/i386at/com.c @@ -464,11 +464,11 @@ natural_t *count; /* out */ } io_return_t -comsetstat(dev, flavor, data, count) -dev_t dev; -int flavor; -int * data; -natural_t count; +comsetstat( + dev_t dev, + int flavor, + int * data, + natural_t count) { io_return_t result = D_SUCCESS; int unit = minor(dev); @@ -494,8 +494,7 @@ natural_t count; } void -comintr(unit) -int unit; +comintr(int unit) { struct tty *tp = &com_tty[unit]; u_short addr = cominfo[unit]->address; @@ -545,8 +544,7 @@ int unit; } static void -comparam(unit) -int unit; +comparam(int unit) { struct tty *tp = &com_tty[unit]; u_short addr = (int)tp->t_addr; @@ -615,8 +613,7 @@ comparm(int unit, int baud, int intr, int mode, int modem) int comst_1, comst_2, comst_3, comst_4, comst_5 = 14; void -comstart(tp) -struct tty *tp; +comstart(struct tty *tp) { int nch; #if 0 @@ -698,8 +695,9 @@ printf("Tty %p was stuck\n", tp); * Set receive modem state from modem status register. */ void -fix_modem_state(unit, modem_stat) -int unit, modem_stat; +fix_modem_state( + int unit, + int modem_stat) { int stat = 0; @@ -817,9 +815,9 @@ commctl( } void -comstop(tp, flags) -struct tty *tp; -int flags; +comstop( + struct tty *tp, + int flags) { if ((tp->t_state & TS_BUSY) && (tp->t_state & TS_TTSTOP) == 0) tp->t_state |= TS_FLUSH; diff --git a/i386/i386at/kd.c b/i386/i386at/kd.c index 0de1e50..9f9faf4 100644 --- a/i386/i386at/kd.c +++ b/i386/i386at/kd.c @@ -383,9 +383,9 @@ pause(void) * one column to the left, etc. */ void -kd_debug_put(loc, c) -int loc; -char c; +kd_debug_put( + int loc, + char c) { csrpos_t pos = ONE_PAGE - (loc+1) * ONE_SPACE; @@ -398,8 +398,7 @@ extern boolean_t mouse_in_use; int old_kb_mode; void -cnpollc(on) -boolean_t on; +cnpollc(boolean_t on) { if (mouse_in_use) { if (on) { @@ -440,10 +439,10 @@ boolean_t on; * */ int -kdopen(dev, flag, ior) - dev_t dev; - int flag; - io_req_t ior; +kdopen( + dev_t dev, + int flag, + io_req_t ior) { struct tty *tp; spl_t o_pri; @@ -569,19 +568,19 @@ kdmmap(dev, off, prot) } int -kdportdeath(dev, port) - dev_t dev; - mach_port_t port; +kdportdeath( + dev_t dev, + mach_port_t port) { return (tty_portdeath(&kd_tty, (ipc_port_t)port)); } /*ARGSUSED*/ -io_return_t kdgetstat(dev, flavor, data, count) - dev_t dev; - int flavor; - int * data; /* pointer to OUT array */ - natural_t *count; /* OUT */ +io_return_t kdgetstat( + dev_t dev, + int flavor, + int * data, /* pointer to OUT array */ + natural_t *count) /* OUT */ { io_return_t result; @@ -607,11 +606,11 @@ io_return_t kdgetstat(dev, flavor, data, count) } /*ARGSUSED*/ -io_return_t kdsetstat(dev, flavor, data, count) - dev_t dev; - int flavor; - int * data; - natural_t count; +io_return_t kdsetstat( + dev_t dev, + int flavor, + int * data, + natural_t count) { io_return_t result; @@ -644,13 +643,12 @@ io_return_t kdsetstat(dev, flavor, data, count) * on/off value. */ int -kdsetbell(val, flags) -int val; /* on or off */ -int flags; /* flags set for console */ +kdsetbell( + int val, /* on or off */ + int flags) /* flags set for console */ { int err = 0; - if (val == KD_BELLON) kd_bellon(); else if (val == KD_BELLOFF) @@ -661,15 +659,13 @@ int flags; /* flags set for console */ return(err); } - /* * kdgetkbent: * * Get entry from key mapping table. Returns error code, if any. */ int -kdgetkbent(kbent) -struct kbentry * kbent; +kdgetkbent(struct kbentry *kbent) { u_char *cp; spl_t o_pri = SPLKD(); /* probably superfluous */ @@ -689,9 +685,9 @@ struct kbentry * kbent; * Set entry in key mapping table. Return error code, if any. */ int -kdsetkbent(kbent, flags) -struct kbentry * kbent; -int flags; /* flags set for console */ +kdsetkbent( + struct kbentry *kbent, + int flags) /* flags set for console */ { u_char *cp; spl_t o_pri; @@ -721,8 +717,7 @@ int flags; /* flags set for console */ */ /*ARGSUSED*/ void -kdintr(vec) -int vec; +kdintr(int vec) { struct tty *tp; unsigned char c; @@ -909,10 +904,10 @@ kd_resend(void) * output: the new state */ int -do_modifier(state, c, up) -int state; -Scancode c; -boolean_t up; +do_modifier( + int state, + Scancode c, + boolean_t up) { switch (c) { case (K_ALTSC): @@ -974,8 +969,7 @@ boolean_t up; * are still held down. */ boolean_t -kdcheckmagic(scancode) -Scancode scancode; +kdcheckmagic(Scancode scancode) { static int magic_state = KS_NORMAL; /* like kd_state */ boolean_t up = FALSE; @@ -1070,8 +1064,7 @@ boolean_t extended; * ASSUMES that it is never called from interrupt-driven code. */ void -kdstart(tp) -struct tty *tp; +kdstart(struct tty *tp) { spl_t o_pri; int ch; @@ -1121,9 +1114,9 @@ struct tty *tp; /*ARGSUSED*/ void -kdstop(tp, flags) - struct tty *tp; - int flags; +kdstop( + struct tty *tp, + int flags) { /* * do nothing - all characters are output by one call to @@ -1266,8 +1259,7 @@ kd_bellon(void) int sit_for_0 = 1; void -kd_putc(ch) -u_char ch; +kd_putc(u_char ch) { if ((!ch) && sit_for_0) return; @@ -1320,8 +1312,7 @@ u_char ch; * */ void -kd_setpos(newpos) -csrpos_t newpos; +kd_setpos(csrpos_t newpos) { if (newpos > ONE_PAGE) { kd_scrollup(); @@ -1483,8 +1474,7 @@ unsigned char color_table[] = { 0, 4, 2, 6, 1, 5, 3, 7, * */ void -kd_parserest(cp) -u_char *cp; +kd_parserest(u_char *cp) { int number[16], npar = 0, i; csrpos_t newpos; @@ -1990,8 +1980,7 @@ kd_clfrbcur(void) * */ void -kd_delln(number) -int number; +kd_delln(int number) { csrpos_t to; csrpos_t from; @@ -2029,8 +2018,7 @@ int number; * */ void -kd_insln(number) -int number; +kd_insln(int number) { csrpos_t to; csrpos_t from; @@ -2069,8 +2057,7 @@ int number; * */ void -kd_delch(number) -int number; +kd_delch(int number) { int count; /* num words moved/filled */ int delbytes; /* bytes to delete */ @@ -2111,8 +2098,7 @@ int number; * */ void -kd_erase(number) -int number; +kd_erase(int number) { csrpos_t i; csrpos_t stop; @@ -2161,8 +2147,7 @@ kd_eraseln(void) * */ void -kd_insch(number) -int number; +kd_insch(int number) { csrpos_t to; csrpos_t from; @@ -2203,8 +2188,7 @@ int number; * */ boolean_t -kd_isupper(c) -u_char c; +kd_isupper(u_char c) { if (('A' <= c) && (c <= 'Z')) return(TRUE); @@ -2212,8 +2196,7 @@ u_char c; } boolean_t -kd_islower(c) -u_char c; +kd_islower(u_char c) { if (('a' <= c) && (c <= 'z')) return(TRUE); @@ -2230,8 +2213,7 @@ u_char c; * */ void -kd_senddata(ch) -unsigned char ch; +kd_senddata(unsigned char ch) { while (inb(K_STATUS) & K_IBUF_FUL) ; @@ -2249,8 +2231,7 @@ unsigned char ch; * */ void -kd_sendcmd(ch) -unsigned char ch; +kd_sendcmd(unsigned char ch) { while (inb(K_STATUS) & K_IBUF_FUL) ; @@ -2318,8 +2299,7 @@ kd_mouse_drain(void) * Set kd_state and update the keyboard status LEDs. */ void -set_kd_state(newstate) -int newstate; +set_kd_state(int newstate) { kd_state = newstate; kd_setleds1(state2leds(newstate)); @@ -2332,8 +2312,7 @@ int newstate; * a state vector. */ u_char -state2leds(state) -int state; +state2leds(int state) { u_char result = 0; @@ -2350,8 +2329,7 @@ int state; * Set the keyboard LEDs according to the given byte. */ void -kd_setleds1(val) -u_char val; +kd_setleds1(u_char val) { if (kd_ack != NOT_WAITING) { #ifdef MACH_KBD @@ -2380,8 +2358,7 @@ kd_setleds2(void) * lock anyway. */ void -cnsetleds(val) -u_char val; +cnsetleds(u_char val) { kd_senddata(K_CMD_LEDS); (void)kd_getdata(); /* XXX - assume is ACK */ @@ -2712,9 +2689,10 @@ kd_noopreset(void) */ void -bmpput(pos, ch, chattr) -csrpos_t pos; -char ch, chattr; +bmpput( + csrpos_t pos, + char ch, + char chattr) { short xbit, ybit; /* u/l corner of char pos */ u_char *to, *from; @@ -2740,8 +2718,9 @@ char ch, chattr; * another. */ void -bmpcp1char(from, to) -csrpos_t from, to; +bmpcp1char( + csrpos_t from, + csrpos_t to) { short from_xbit, from_ybit; short to_xbit, to_ybit; @@ -2766,9 +2745,10 @@ csrpos_t from, to; * bmpvmup: Copy a block of character positions upwards. */ void -bmpmvup(from, to, count) -csrpos_t from, to; -int count; +bmpmvup( + csrpos_t from, + csrpos_t to, + int count) { short from_xbit, from_ybit; short to_xbit, to_ybit; @@ -2801,9 +2781,10 @@ int count; * bmpmvdown: copy a block of characters down. */ void -bmpmvdown(from, to, count) -csrpos_t from, to; -int count; +bmpmvdown( + csrpos_t from, + csrpos_t to, + int count) { short from_xbit, from_ybit; short to_xbit, to_ybit; @@ -2839,10 +2820,10 @@ int count; * bmpclear: clear one or more character positions. */ void -bmpclear(to, count, chattr) -csrpos_t to; /* 1st char */ -int count; /* num chars */ -char chattr; /* reverse or normal */ +bmpclear( + csrpos_t to, /* 1st char */ + int count, /* num chars */ + char chattr) /* reverse or normal */ { short i; u_short clearval; @@ -2865,8 +2846,7 @@ char chattr; /* reverse or normal */ * bmpsetcursor: update the display and set the logical cursor. */ void -bmpsetcursor(pos) -csrpos_t pos; +bmpsetcursor(csrpos_t pos) { /* erase old cursor & paint new one */ bmppaintcsr(kd_curpos, char_black); @@ -2878,9 +2858,9 @@ csrpos_t pos; * bmppaintcsr: paint cursor bits. */ void -bmppaintcsr(pos, val) -csrpos_t pos; -u_char val; +bmppaintcsr( + csrpos_t pos, + u_char val) { short xbit, ybit; u_char *cp; @@ -2901,9 +2881,10 @@ u_char val; * (0, 0) is the upper left corner. */ void -bmpch2bit(pos, xb, yb) -csrpos_t pos; -short *xb, *yb; /* x, y bit positions, u/l corner */ +bmpch2bit( + csrpos_t pos, + short *xb, + short *yb) /* x, y bit positions, u/l corner */ { short xch, ych; @@ -2920,8 +2901,9 @@ short *xb, *yb; /* x, y bit positions, u/l corner */ * byte. */ u_char * -bit2fbptr(xb, yb) -short xb, yb; +bit2fbptr( + short xb, + short yb) { return(vid_start + yb * fb_byte_width + xb/8); } diff --git a/i386/i386at/kd_event.c b/i386/i386at/kd_event.c index 2a75f95..b60118e 100644 --- a/i386/i386at/kd_event.c +++ b/i386/i386at/kd_event.c @@ -131,9 +131,9 @@ kbdopen(dev, flags, ior) /*ARGSUSED*/ void -kbdclose(dev, flags) - dev_t dev; - int flags; +kbdclose( + dev_t dev, + int flags) { spl_t s = SPLKD(); @@ -143,11 +143,11 @@ kbdclose(dev, flags) } -io_return_t kbdgetstat(dev, flavor, data, count) - dev_t dev; - int flavor; - int * data; /* pointer to OUT array */ - unsigned int *count; /* OUT */ +io_return_t kbdgetstat( + dev_t dev, + int flavor, + int * data, /* pointer to OUT array */ + unsigned int *count) /* OUT */ { switch (flavor) { case KDGKBDTYPE: @@ -165,11 +165,11 @@ io_return_t kbdgetstat(dev, flavor, data, count) return (D_SUCCESS); } -io_return_t kbdsetstat(dev, flavor, data, count) - dev_t dev; - int flavor; - int * data; - unsigned int count; +io_return_t kbdsetstat( + dev_t dev, + int flavor, + int * data, + unsigned int count) { switch (flavor) { case KDSKBDMODE: @@ -198,9 +198,9 @@ io_return_t kbdsetstat(dev, flavor, data, count) * kbdread - dequeue and return any queued events. */ int -kbdread(dev, ior) - dev_t dev; - io_req_t ior; +kbdread( + dev_t dev, + io_req_t ior) { int err, count; spl_t s; @@ -237,8 +237,7 @@ kbdread(dev, ior) return (D_SUCCESS); } -boolean_t kbd_read_done(ior) - io_req_t ior; +boolean_t kbd_read_done(io_req_t ior) { int count; spl_t s; @@ -274,8 +273,7 @@ boolean_t kbd_read_done(ior) */ void -kd_enqsc(sc) - Scancode sc; +kd_enqsc(Scancode sc) { kd_event ev; @@ -292,8 +290,7 @@ kd_enqsc(sc) */ void -kbd_enqueue(ev) - kd_event *ev; +kbd_enqueue(kd_event *ev) { if (kdq_full(&kbd_queue)) printf("kbd: queue full\n"); @@ -366,9 +363,9 @@ X_kdb_exit(void) } io_return_t -X_kdb_enter_init(data, count) - u_int *data; - u_int count; +X_kdb_enter_init( + u_int *data, + u_int count) { if (count * sizeof X_kdb_enter_str[0] > sizeof X_kdb_enter_str) return D_INVALID_OPERATION; @@ -379,9 +376,9 @@ X_kdb_enter_init(data, count) } io_return_t -X_kdb_exit_init(data, count) - u_int *data; - u_int count; +X_kdb_exit_init( + u_int *data, + u_int count) { if (count * sizeof X_kdb_exit_str[0] > sizeof X_kdb_exit_str) return D_INVALID_OPERATION; diff --git a/i386/i386at/kd_mouse.c b/i386/i386at/kd_mouse.c index 8b1222d..16241ef 100644 --- a/i386/i386at/kd_mouse.c +++ b/i386/i386at/kd_mouse.c @@ -198,8 +198,7 @@ mouseopen(dev, flags, ior) } void -serial_mouse_open(dev) - dev_t dev; +serial_mouse_open(dev_t dev) { int unit = minor(dev) & 0x7; int mouse_pic = cominfo[unit]->sysdep1; @@ -219,9 +218,9 @@ serial_mouse_open(dev) int mouse_packets = 0; void -kd_mouse_open(dev, mouse_pic) - dev_t dev; - int mouse_pic; +kd_mouse_open( + dev_t dev, + int mouse_pic) { spl_t s = splhi(); /* disable interrupts */ @@ -238,9 +237,9 @@ kd_mouse_open(dev, mouse_pic) * and restore the serial port interrupt vector. */ void -mouseclose(dev, flags) - dev_t dev; - int flags; +mouseclose( + dev_t dev, + int flags) { switch (mouse_type) { case MICROSOFT_MOUSE: @@ -265,9 +264,9 @@ mouseclose(dev, flags) /*ARGSUSED*/ void -serial_mouse_close(dev, flags) - dev_t dev; - int flags; +serial_mouse_close( + dev_t dev, + int flags) { spl_t o_pri = splhi(); /* mutex with open() */ int unit = minor(dev) & 0x7; @@ -284,9 +283,9 @@ serial_mouse_close(dev, flags) } void -kd_mouse_close(dev, mouse_pic) - dev_t dev; - int mouse_pic; +kd_mouse_close( + dev_t dev, + int mouse_pic) { spl_t s = splhi(); @@ -296,11 +295,11 @@ kd_mouse_close(dev, mouse_pic) splx(s); } -io_return_t mousegetstat(dev, flavor, data, count) - dev_t dev; - int flavor; - int * data; /* pointer to OUT array */ - unsigned int *count; /* OUT */ +io_return_t mousegetstat( + dev_t dev, + int flavor, + int * data, /* pointer to OUT array */ + unsigned int *count) /* OUT */ { switch (flavor) { case DEV_GET_SIZE: @@ -319,9 +318,9 @@ io_return_t mousegetstat(dev, flavor, data, count) * mouseread - dequeue and return any queued events. */ int -mouseread(dev, ior) - dev_t dev; - io_req_t ior; +mouseread( + dev_t dev, + io_req_t ior) { int err, count; spl_t s; @@ -358,8 +357,7 @@ mouseread(dev, ior) return (D_SUCCESS); } -boolean_t mouse_read_done(ior) - io_req_t ior; +boolean_t mouse_read_done(io_req_t ior) { int count; spl_t s; @@ -442,8 +440,7 @@ int middlegitech = 0; /* what should the middle button be */ static u_char mousebuf[MOUSEBUFSIZE]; /* 5-byte packet from mouse */ void -mouse_handle_byte(ch) - u_char ch; +mouse_handle_byte(u_char ch) { if (show_mouse_byte) { printf("%x(%c) ", ch, ch); @@ -524,8 +521,7 @@ mouse_handle_byte(ch) } void -mouse_packet_mouse_system_mouse(mousebuf) -u_char mousebuf[MOUSEBUFSIZE]; +mouse_packet_mouse_system_mouse(u_char mousebuf[MOUSEBUFSIZE]) { u_char buttons, buttonchanges; struct mouse_motion moved; @@ -560,8 +556,7 @@ u_char mousebuf[MOUSEBUFSIZE]; * */ void -mouse_packet_microsoft_mouse(mousebuf) -u_char mousebuf[MOUSEBUFSIZE]; +mouse_packet_microsoft_mouse(u_char mousebuf[MOUSEBUFSIZE]) { u_char buttons, buttonchanges; struct mouse_motion moved; @@ -653,8 +648,7 @@ void kd_mouse_read_reset(void) } void -ibm_ps2_mouse_open(dev) - dev_t dev; +ibm_ps2_mouse_open(dev_t dev) { spl_t s = spltty(); @@ -697,8 +691,7 @@ ibm_ps2_mouse_open(dev) } void -ibm_ps2_mouse_close(dev) - dev_t dev; +ibm_ps2_mouse_close(dev_t dev) { spl_t s = spltty(); @@ -729,8 +722,7 @@ ibm_ps2_mouse_close(dev) * */ void -mouse_packet_ibm_ps2_mouse(mousebuf) -u_char mousebuf[MOUSEBUFSIZE]; +mouse_packet_ibm_ps2_mouse(u_char mousebuf[MOUSEBUFSIZE]) { u_char buttons, buttonchanges; struct mouse_motion moved; @@ -762,8 +754,7 @@ u_char mousebuf[MOUSEBUFSIZE]; * Enqueue a mouse-motion event. Called at SPLKD. */ void -mouse_moved(where) - struct mouse_motion where; +mouse_moved(struct mouse_motion where) { kd_event ev; @@ -773,14 +764,13 @@ mouse_moved(where) mouse_enqueue(&ev); } - /* * Enqueue an event for mouse button press or release. Called at SPLKD. */ void -mouse_button(which, direction) - kev_type which; - u_char direction; +mouse_button( + kev_type which, + u_char direction) { kd_event ev; @@ -790,15 +780,13 @@ mouse_button(which, direction) mouse_enqueue(&ev); } - /* * mouse_enqueue - enqueue an event and wake up selecting processes, if * any. Called at SPLKD. */ void -mouse_enqueue(ev) - kd_event *ev; +mouse_enqueue(kd_event *ev) { if (kdq_full(&mouse_queue)) printf("mouse: queue full\n"); diff --git a/i386/i386at/kd_queue.c b/i386/i386at/kd_queue.c index 2086eb1..57d6fbf 100644 --- a/i386/i386at/kd_queue.c +++ b/i386/i386at/kd_queue.c @@ -98,8 +98,7 @@ kdq_put(q, ev) } kd_event * -kdq_get(q) - kd_event_queue *q; +kdq_get(kd_event_queue *q) { kd_event *result = q->events + q->firstout; @@ -108,8 +107,7 @@ kdq_get(q) } void -kdq_reset(q) - kd_event_queue *q; +kdq_reset(kd_event_queue *q) { q->firstout = q->firstfree = 0; } diff --git a/i386/i386at/lpr.c b/i386/i386at/lpr.c index 1f95a3f..5c16b15 100644 --- a/i386/i386at/lpr.c +++ b/i386/i386at/lpr.c @@ -192,11 +192,11 @@ natural_t *count; /* out */ } io_return_t -lprsetstat(dev, flavor, data, count) -dev_t dev; -int flavor; -int * data; -natural_t count; +lprsetstat( + dev_t dev, + int flavor, + int * data, + natural_t count) { io_return_t result = D_SUCCESS; int unit = minor(dev); @@ -211,8 +211,7 @@ natural_t count; return (D_SUCCESS); } -void lprintr(unit) -int unit; +void lprintr(int unit) { struct tty *tp = &lpr_tty[unit]; @@ -226,8 +225,7 @@ int unit; lprstart(tp); } -void lprstart(tp) -struct tty *tp; +void lprstart(struct tty *tp) { spl_t s = spltty(); u_short addr = (natural_t) tp->t_addr; @@ -267,9 +265,9 @@ struct tty *tp; } void -lprstop(tp, flags) -struct tty *tp; -int flags; +lprstop( + struct tty *tp, + int flags) { if ((tp->t_state & TS_BUSY) && (tp->t_state & TS_TTSTOP) == 0) tp->t_state |= TS_FLUSH; diff --git a/i386/i386at/model_dep.c b/i386/i386at/model_dep.c index 128f250..7d138be 100644 --- a/i386/i386at/model_dep.c +++ b/i386/i386at/model_dep.c @@ -218,8 +218,7 @@ void halt_cpu(void) /* * Halt the system or reboot. */ -void halt_all_cpus(reboot) - boolean_t reboot; +void halt_all_cpus(boolean_t reboot) { if (reboot) { #ifdef MACH_HYP @@ -834,8 +833,7 @@ init_alloc_aligned(vm_size_t size, vm_offset_t *addrp) return TRUE; } -boolean_t pmap_next_page(addrp) - vm_offset_t *addrp; +boolean_t pmap_next_page(vm_offset_t *addrp) { return init_alloc_aligned(PAGE_SIZE, addrp); } @@ -852,8 +850,7 @@ pmap_grab_page(void) return addr; } -boolean_t pmap_valid_page(x) - vm_offset_t x; +boolean_t pmap_valid_page(vm_offset_t x) { /* XXX is this OK? What does it matter for? */ return (((phys_first_addr <= x) && (x < phys_last_addr)) diff --git a/i386/i386at/rtc.c b/i386/i386at/rtc.c index ff4309b..946f08f 100644 --- a/i386/i386at/rtc.c +++ b/i386/i386at/rtc.c @@ -66,8 +66,7 @@ rtcinit(void) int -rtcget(regs) -unsigned char *regs; +rtcget(unsigned char *regs) { if (first_rtcopen_ever) { rtcinit(); @@ -83,8 +82,7 @@ unsigned char *regs; } void -rtcput(regs) -unsigned char *regs; +rtcput(unsigned char *regs) { unsigned char x; @@ -107,29 +105,25 @@ extern struct timeval time; static int month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; int -yeartoday(year) -int year; +yeartoday(int year) { return((year%4) ? 365 : 366); } int -hexdectodec(n) -char n; +hexdectodec(char n) { return(((n>>4)&0x0F)*10 + (n&0x0F)); } char -dectohexdec(n) -int n; +dectohexdec(int n) { return((char)(((n/10)<<4)&0xF0) | ((n%10)&0x0F)); } int -readtodc(tp) - u_int *tp; +readtodc(u_int *tp) { struct rtc_st rtclk; time_t n; diff --git a/i386/intel/pmap.c b/i386/intel/pmap.c index 4b2892a..8a23a44 100644 --- a/i386/intel/pmap.c +++ b/i386/intel/pmap.c @@ -458,8 +458,7 @@ pmap_pte(const pmap_t pmap, vm_offset_t addr) #define DEBUG_PTE_PAGE 0 #if DEBUG_PTE_PAGE -void ptep_check(ptep) - ptep_t ptep; +void ptep_check(ptep_t ptep) { pt_entry_t *pte, *epte; int ctu, ctw; @@ -495,11 +494,11 @@ void ptep_check(ptep) * For now, VM is already on, we only need to map the * specified memory. */ -vm_offset_t pmap_map(virt, start, end, prot) - vm_offset_t virt; - vm_offset_t start; - vm_offset_t end; - int prot; +vm_offset_t pmap_map( + vm_offset_t virt, + vm_offset_t start, + vm_offset_t end, + int prot) { int ps; @@ -518,11 +517,11 @@ vm_offset_t pmap_map(virt, start, end, prot) * [phys_first_addr, phys_last_addr) (i.e., devices). * Otherwise like pmap_map. */ -vm_offset_t pmap_map_bd(virt, start, end, prot) - vm_offset_t virt; - vm_offset_t start; - vm_offset_t end; - vm_prot_t prot; +vm_offset_t pmap_map_bd( + vm_offset_t virt, + vm_offset_t start, + vm_offset_t end, + vm_prot_t prot) { pt_entry_t template; pt_entry_t *pte; @@ -925,9 +924,9 @@ void pmap_put_mapwindow(pmap_mapwindow_t *map) PMAP_UPDATE_TLBS(kernel_pmap, map->vaddr, map->vaddr + PAGE_SIZE); } -void pmap_virtual_space(startp, endp) - vm_offset_t *startp; - vm_offset_t *endp; +void pmap_virtual_space( + vm_offset_t *startp, + vm_offset_t *endp) { *startp = kernel_virtual_start; *endp = kernel_virtual_end - PMAP_NMAPWINDOWS * PAGE_SIZE; @@ -1002,8 +1001,7 @@ void pmap_init(void) #define valid_page(x) (pmap_initialized && pmap_valid_page(x)) -boolean_t pmap_verify_free(phys) - vm_offset_t phys; +boolean_t pmap_verify_free(vm_offset_t phys) { pv_entry_t pv_h; int pai; @@ -1126,8 +1124,7 @@ void pmap_map_mfn(void *_addr, unsigned long mfn) { * and be removed from its page directory. */ void -pmap_page_table_page_dealloc(pa) - vm_offset_t pa; +pmap_page_table_page_dealloc(vm_offset_t pa) { vm_page_t m; @@ -1152,8 +1149,7 @@ pmap_page_table_page_dealloc(pa) * the map will be used in software only, and * is bounded by that size. */ -pmap_t pmap_create(size) - vm_size_t size; +pmap_t pmap_create(vm_size_t size) { pmap_t p; pmap_statistics_t stats; @@ -1232,8 +1228,7 @@ pmap_t pmap_create(size) * no valid mappings. */ -void pmap_destroy(p) - pmap_t p; +void pmap_destroy(pmap_t p) { pt_entry_t *pdep; vm_offset_t pa; @@ -1299,8 +1294,7 @@ void pmap_destroy(p) * Add a reference to the specified pmap. */ -void pmap_reference(p) - pmap_t p; +void pmap_reference(pmap_t p) { int s; if (p != PMAP_NULL) { @@ -1325,11 +1319,11 @@ void pmap_reference(p) */ /* static */ -void pmap_remove_range(pmap, va, spte, epte) - pmap_t pmap; - vm_offset_t va; - pt_entry_t *spte; - pt_entry_t *epte; +void pmap_remove_range( + pmap_t pmap, + vm_offset_t va, + pt_entry_t *spte, + pt_entry_t *epte) { pt_entry_t *cpte; int num_removed, num_unwired; @@ -1481,9 +1475,10 @@ void pmap_remove_range(pmap, va, spte, epte) * rounded to the hardware page size. */ -void pmap_remove(map, s, e) - pmap_t map; - vm_offset_t s, e; +void pmap_remove( + pmap_t map, + vm_offset_t s, + vm_offset_t e) { int spl; pt_entry_t *pde; @@ -1522,9 +1517,9 @@ void pmap_remove(map, s, e) * Lower the permission for all mappings to a given * page. */ -void pmap_page_protect(phys, prot) - vm_offset_t phys; - vm_prot_t prot; +void pmap_page_protect( + vm_offset_t phys, + vm_prot_t prot) { pv_entry_t pv_h, prev; pv_entry_t pv_e; @@ -1685,10 +1680,11 @@ void pmap_page_protect(phys, prot) * specified range of this map as requested. * Will not increase permissions. */ -void pmap_protect(map, s, e, prot) - pmap_t map; - vm_offset_t s, e; - vm_prot_t prot; +void pmap_protect( + pmap_t map, + vm_offset_t s, + vm_offset_t e, + vm_prot_t prot) { pt_entry_t *pde; pt_entry_t *spte, *epte; @@ -1791,12 +1787,12 @@ void pmap_protect(map, s, e, prot) * or lose information. That is, this routine must actually * insert this page into the given map NOW. */ -void pmap_enter(pmap, v, pa, prot, wired) - pmap_t pmap; - vm_offset_t v; - vm_offset_t pa; - vm_prot_t prot; - boolean_t wired; +void pmap_enter( + pmap_t pmap, + vm_offset_t v, + vm_offset_t pa, + vm_prot_t prot, + boolean_t wired) { pt_entry_t *pte; pv_entry_t pv_h; @@ -2093,10 +2089,10 @@ Retry: * In/out conditions: * The mapping must already exist in the pmap. */ -void pmap_change_wiring(map, v, wired) - pmap_t map; - vm_offset_t v; - boolean_t wired; +void pmap_change_wiring( + pmap_t map, + vm_offset_t v, + boolean_t wired) { pt_entry_t *pte; int i; @@ -2148,9 +2144,9 @@ void pmap_change_wiring(map, v, wired) * with the given map/virtual_address pair. */ -vm_offset_t pmap_extract(pmap, va) - pmap_t pmap; - vm_offset_t va; +vm_offset_t pmap_extract( + pmap_t pmap, + vm_offset_t va) { pt_entry_t *pte; vm_offset_t pa; @@ -2198,8 +2194,7 @@ void pmap_copy(dst_pmap, src_pmap, dst_addr, len, src_addr) * Usage: * Called by the pageout daemon when pages are scarce. */ -void pmap_collect(p) - pmap_t p; +void pmap_collect(pmap_t p) { pt_entry_t *pdp, *ptp; pt_entry_t *eptp; @@ -2406,11 +2401,11 @@ pmap_copy_page(src, dst) * down (or not) as appropriate. */ void -pmap_pageable(pmap, start, end, pageable) - pmap_t pmap; - vm_offset_t start; - vm_offset_t end; - boolean_t pageable; +pmap_pageable( + pmap_t pmap, + vm_offset_t start, + vm_offset_t end, + boolean_t pageable) { } @@ -2418,9 +2413,9 @@ pmap_pageable(pmap, start, end, pageable) * Clear specified attribute bits. */ void -phys_attribute_clear(phys, bits) - vm_offset_t phys; - int bits; +phys_attribute_clear( + vm_offset_t phys, + int bits) { pv_entry_t pv_h; pv_entry_t pv_e; @@ -2504,9 +2499,9 @@ phys_attribute_clear(phys, bits) * Check specified attribute bits. */ boolean_t -phys_attribute_test(phys, bits) - vm_offset_t phys; - int bits; +phys_attribute_test( + vm_offset_t phys, + int bits) { pv_entry_t pv_h; pv_entry_t pv_e; @@ -2595,8 +2590,7 @@ phys_attribute_test(phys, bits) * Clear the modify bits on the specified physical page. */ -void pmap_clear_modify(phys) - vm_offset_t phys; +void pmap_clear_modify(vm_offset_t phys) { phys_attribute_clear(phys, PHYS_MODIFIED); } @@ -2608,8 +2602,7 @@ void pmap_clear_modify(phys) * by any physical maps. */ -boolean_t pmap_is_modified(phys) - vm_offset_t phys; +boolean_t pmap_is_modified(vm_offset_t phys) { return (phys_attribute_test(phys, PHYS_MODIFIED)); } @@ -2620,8 +2613,7 @@ boolean_t pmap_is_modified(phys) * Clear the reference bit on the specified physical page. */ -void pmap_clear_reference(phys) - vm_offset_t phys; +void pmap_clear_reference(vm_offset_t phys) { phys_attribute_clear(phys, PHYS_REFERENCED); } @@ -2633,8 +2625,7 @@ void pmap_clear_reference(phys) * by any physical maps. */ -boolean_t pmap_is_referenced(phys) - vm_offset_t phys; +boolean_t pmap_is_referenced(vm_offset_t phys) { return (phys_attribute_test(phys, PHYS_REFERENCED)); } @@ -2703,10 +2694,11 @@ boolean_t pmap_is_referenced(phys) /* * Signal another CPU that it must flush its TLB */ -void signal_cpus(use_list, pmap, start, end) - cpu_set use_list; - pmap_t pmap; - vm_offset_t start, end; +void signal_cpus( + cpu_set use_list, + pmap_t pmap, + vm_offset_t start, + vm_offset_t end) { int which_cpu, j; pmap_update_list_t update_list_p; @@ -2742,8 +2734,7 @@ void signal_cpus(use_list, pmap, start, end) } } -void process_pmap_updates(my_pmap) - pmap_t my_pmap; +void process_pmap_updates(pmap_t my_pmap) { int my_cpu = cpu_number(); pmap_update_list_t update_list_p; diff --git a/i386/intel/read_fault.c b/i386/intel/read_fault.c index 036d7ae..29f4439 100644 --- a/i386/intel/read_fault.c +++ b/i386/intel/read_fault.c @@ -39,9 +39,9 @@ * ignores write protection in kernel mode. */ kern_return_t -intel_read_fault(map, vaddr) - vm_map_t map; - vm_offset_t vaddr; +intel_read_fault( + vm_map_t map, + vm_offset_t vaddr) { vm_map_version_t version; /* Map version for verification */ diff --git a/ipc/ipc_entry.c b/ipc/ipc_entry.c index f1d763c..e78f74e 100644 --- a/ipc/ipc_entry.c +++ b/ipc/ipc_entry.c @@ -96,9 +96,9 @@ ipc_entry_tree_collision( */ ipc_entry_t -ipc_entry_lookup(space, name) - ipc_space_t space; - mach_port_t name; +ipc_entry_lookup( + ipc_space_t space, + mach_port_t name) { mach_port_index_t index; ipc_entry_t entry; @@ -140,10 +140,10 @@ ipc_entry_lookup(space, name) */ kern_return_t -ipc_entry_get(space, namep, entryp) - ipc_space_t space; - mach_port_t *namep; - ipc_entry_t *entryp; +ipc_entry_get( + ipc_space_t space, + mach_port_t *namep, + ipc_entry_t *entryp) { ipc_entry_t table; mach_port_index_t first_free; @@ -542,8 +542,7 @@ ipc_entry_dealloc( */ kern_return_t -ipc_entry_grow_table(space) - ipc_space_t space; +ipc_entry_grow_table(ipc_space_t space) { ipc_entry_num_t osize, size, nsize; diff --git a/ipc/ipc_hash.c b/ipc/ipc_hash.c index 5eec58c..8285717 100644 --- a/ipc/ipc_hash.c +++ b/ipc/ipc_hash.c @@ -64,11 +64,11 @@ */ boolean_t -ipc_hash_lookup(space, obj, namep, entryp) - ipc_space_t space; - ipc_object_t obj; - mach_port_t *namep; - ipc_entry_t *entryp; +ipc_hash_lookup( + ipc_space_t space, + ipc_object_t obj, + mach_port_t *namep, + ipc_entry_t *entryp) { return (ipc_hash_local_lookup(space, obj, namep, entryp) || ((space->is_tree_hash > 0) && diff --git a/ipc/ipc_kmsg.c b/ipc/ipc_kmsg.c index 0e43410..06cec72 100644 --- a/ipc/ipc_kmsg.c +++ b/ipc/ipc_kmsg.c @@ -218,9 +218,9 @@ ipc_kmsg_destroy( */ void -ipc_kmsg_clean_body(saddr, eaddr) - vm_offset_t saddr; - vm_offset_t eaddr; +ipc_kmsg_clean_body( + vm_offset_t saddr, + vm_offset_t eaddr) { while (saddr < eaddr) { mach_msg_type_long_t *type; @@ -317,8 +317,7 @@ ipc_kmsg_clean_body(saddr, eaddr) */ void -ipc_kmsg_clean(kmsg) - ipc_kmsg_t kmsg; +ipc_kmsg_clean(ipc_kmsg_t kmsg) { ipc_marequest_t marequest; ipc_object_t object; @@ -361,11 +360,11 @@ ipc_kmsg_clean(kmsg) */ void -ipc_kmsg_clean_partial(kmsg, eaddr, dolast, number) - ipc_kmsg_t kmsg; - vm_offset_t eaddr; - boolean_t dolast; - mach_msg_type_number_t number; +ipc_kmsg_clean_partial( + ipc_kmsg_t kmsg, + vm_offset_t eaddr, + boolean_t dolast, + mach_msg_type_number_t number) { ipc_object_t object; mach_msg_bits_t mbits = kmsg->ikm_header.msgh_bits; @@ -466,8 +465,7 @@ xxx: type = (mach_msg_type_long_t *) eaddr; */ void -ipc_kmsg_free(kmsg) - ipc_kmsg_t kmsg; +ipc_kmsg_free(ipc_kmsg_t kmsg) { vm_size_t size = kmsg->ikm_size; @@ -500,10 +498,10 @@ ipc_kmsg_free(kmsg) */ mach_msg_return_t -ipc_kmsg_get(msg, size, kmsgp) - mach_msg_header_t *msg; - mach_msg_size_t size; - ipc_kmsg_t *kmsgp; +ipc_kmsg_get( + mach_msg_header_t *msg, + mach_msg_size_t size, + ipc_kmsg_t *kmsgp) { ipc_kmsg_t kmsg; @@ -552,10 +550,10 @@ ipc_kmsg_get(msg, size, kmsgp) */ extern mach_msg_return_t -ipc_kmsg_get_from_kernel(msg, size, kmsgp) - mach_msg_header_t *msg; - mach_msg_size_t size; - ipc_kmsg_t *kmsgp; +ipc_kmsg_get_from_kernel( + mach_msg_header_t *msg, + mach_msg_size_t size, + ipc_kmsg_t *kmsgp) { ipc_kmsg_t kmsg; @@ -589,10 +587,10 @@ ipc_kmsg_get_from_kernel(msg, size, kmsgp) */ mach_msg_return_t -ipc_kmsg_put(msg, kmsg, size) - mach_msg_header_t *msg; - ipc_kmsg_t kmsg; - mach_msg_size_t size; +ipc_kmsg_put( + mach_msg_header_t *msg, + ipc_kmsg_t kmsg, + mach_msg_size_t size) { mach_msg_return_t mr; @@ -674,10 +672,10 @@ ipc_kmsg_put_to_kernel( */ mach_msg_return_t -ipc_kmsg_copyin_header(msg, space, notify) - mach_msg_header_t *msg; - ipc_space_t space; - mach_port_t notify; +ipc_kmsg_copyin_header( + mach_msg_header_t *msg, + ipc_space_t space, + mach_port_t notify) { mach_msg_bits_t mbits = msg->msgh_bits &~ MACH_MSGH_BITS_CIRCULAR; mach_port_t dest_name = msg->msgh_remote_port; @@ -1339,10 +1337,10 @@ ipc_kmsg_copyin_header(msg, space, notify) } mach_msg_return_t -ipc_kmsg_copyin_body(kmsg, space, map) - ipc_kmsg_t kmsg; - ipc_space_t space; - vm_map_t map; +ipc_kmsg_copyin_body( + ipc_kmsg_t kmsg, + ipc_space_t space, + vm_map_t map) { ipc_object_t dest; vm_offset_t saddr, eaddr; @@ -1559,11 +1557,11 @@ ipc_kmsg_copyin_body(kmsg, space, map) */ mach_msg_return_t -ipc_kmsg_copyin(kmsg, space, map, notify) - ipc_kmsg_t kmsg; - ipc_space_t space; - vm_map_t map; - mach_port_t notify; +ipc_kmsg_copyin( + ipc_kmsg_t kmsg, + ipc_space_t space, + vm_map_t map, + mach_port_t notify) { mach_msg_return_t mr; @@ -1594,8 +1592,7 @@ ipc_kmsg_copyin(kmsg, space, map, notify) */ void -ipc_kmsg_copyin_from_kernel( - ipc_kmsg_t kmsg) +ipc_kmsg_copyin_from_kernel(ipc_kmsg_t kmsg) { mach_msg_bits_t bits = kmsg->ikm_header.msgh_bits; mach_msg_type_name_t rname = MACH_MSGH_BITS_REMOTE(bits); @@ -1754,10 +1751,10 @@ ipc_kmsg_copyin_from_kernel( */ mach_msg_return_t -ipc_kmsg_copyout_header(msg, space, notify) - mach_msg_header_t *msg; - ipc_space_t space; - mach_port_t notify; +ipc_kmsg_copyout_header( + mach_msg_header_t *msg, + ipc_space_t space, + mach_port_t notify) { mach_msg_bits_t mbits = msg->msgh_bits; ipc_port_t dest = (ipc_port_t) msg->msgh_remote_port; @@ -2254,11 +2251,11 @@ ipc_kmsg_copyout_header(msg, space, notify) */ mach_msg_return_t -ipc_kmsg_copyout_object(space, object, msgt_name, namep) - ipc_space_t space; - ipc_object_t object; - mach_msg_type_name_t msgt_name; - mach_port_t *namep; +ipc_kmsg_copyout_object( + ipc_space_t space, + ipc_object_t object, + mach_msg_type_name_t msgt_name, + mach_port_t *namep) { if (!IO_VALID(object)) { *namep = (mach_port_t) object; @@ -2364,10 +2361,11 @@ ipc_kmsg_copyout_object(space, object, msgt_name, namep) */ mach_msg_return_t -ipc_kmsg_copyout_body(saddr, eaddr, space, map) - vm_offset_t saddr, eaddr; - ipc_space_t space; - vm_map_t map; +ipc_kmsg_copyout_body( + vm_offset_t saddr, + vm_offset_t eaddr, + ipc_space_t space, + vm_map_t map) { mach_msg_return_t mr = MACH_MSG_SUCCESS; kern_return_t kr; @@ -2516,11 +2514,11 @@ ipc_kmsg_copyout_body(saddr, eaddr, space, map) */ mach_msg_return_t -ipc_kmsg_copyout(kmsg, space, map, notify) - ipc_kmsg_t kmsg; - ipc_space_t space; - vm_map_t map; - mach_port_t notify; +ipc_kmsg_copyout( + ipc_kmsg_t kmsg, + ipc_space_t space, + vm_map_t map, + mach_port_t notify) { mach_msg_bits_t mbits = kmsg->ikm_header.msgh_bits; mach_msg_return_t mr; @@ -2610,9 +2608,9 @@ ipc_kmsg_copyout_pseudo( */ void -ipc_kmsg_copyout_dest(kmsg, space) - ipc_kmsg_t kmsg; - ipc_space_t space; +ipc_kmsg_copyout_dest( + ipc_kmsg_t kmsg, + ipc_space_t space) { mach_msg_bits_t mbits = kmsg->ikm_header.msgh_bits; ipc_object_t dest = (ipc_object_t) kmsg->ikm_header.msgh_remote_port; @@ -2658,9 +2656,9 @@ ipc_kmsg_copyout_dest(kmsg, space) #if MACH_KDB char * -ipc_type_name(type_name, received) - int type_name; - boolean_t received; +ipc_type_name( + int type_name, + boolean_t received) { switch (type_name) { case MACH_MSG_TYPE_BOOLEAN: @@ -2741,8 +2739,7 @@ ipc_print_type_name( * ipc_kmsg_print [ debug ] */ void -ipc_kmsg_print(kmsg) - ipc_kmsg_t kmsg; +ipc_kmsg_print(ipc_kmsg_t kmsg) { db_printf("kmsg=0x%x\n", kmsg); db_printf("ikm_next=0x%x,prev=0x%x,size=%d,marequest=0x%x", @@ -2758,8 +2755,7 @@ ipc_kmsg_print(kmsg) * ipc_msg_print [ debug ] */ void -ipc_msg_print(msgh) - mach_msg_header_t *msgh; +ipc_msg_print(mach_msg_header_t *msgh) { vm_offset_t saddr, eaddr; diff --git a/ipc/ipc_marequest.c b/ipc/ipc_marequest.c index 06c53eb..ded1711 100644 --- a/ipc/ipc_marequest.c +++ b/ipc/ipc_marequest.c @@ -160,11 +160,11 @@ ipc_marequest_init(void) */ mach_msg_return_t -ipc_marequest_create(space, port, notify, marequestp) - ipc_space_t space; - ipc_port_t port; - mach_port_t notify; - ipc_marequest_t *marequestp; +ipc_marequest_create( + ipc_space_t space, + ipc_port_t port, + mach_port_t notify, + ipc_marequest_t *marequestp) { mach_port_t name; ipc_entry_t entry; @@ -256,9 +256,9 @@ ipc_marequest_create(space, port, notify, marequestp) */ void -ipc_marequest_cancel(space, name) - ipc_space_t space; - mach_port_t name; +ipc_marequest_cancel( + ipc_space_t space, + mach_port_t name) { ipc_marequest_bucket_t bucket; ipc_marequest_t marequest, *last; @@ -292,9 +292,10 @@ ipc_marequest_cancel(space, name) */ void -ipc_marequest_rename(space, old, new) - ipc_space_t space; - mach_port_t old, new; +ipc_marequest_rename( + ipc_space_t space, + mach_port_t old, + mach_port_t new) { ipc_marequest_bucket_t bucket; ipc_marequest_t marequest, *last; @@ -336,8 +337,7 @@ ipc_marequest_rename(space, old, new) */ void -ipc_marequest_destroy(marequest) - ipc_marequest_t marequest; +ipc_marequest_destroy(ipc_marequest_t marequest) { ipc_space_t space = marequest->imar_space; mach_port_t name; @@ -404,10 +404,10 @@ ipc_marequest_destroy(marequest) */ unsigned int -ipc_marequest_info(maxp, info, count) - unsigned int *maxp; - hash_info_bucket_t *info; - unsigned int count; +ipc_marequest_info( + unsigned int *maxp, + hash_info_bucket_t *info, + unsigned int count) { ipc_marequest_index_t i; diff --git a/ipc/ipc_mqueue.c b/ipc/ipc_mqueue.c index 72eca76..9138aec 100644 --- a/ipc/ipc_mqueue.c +++ b/ipc/ipc_mqueue.c @@ -171,10 +171,10 @@ ipc_mqueue_changed( */ mach_msg_return_t -ipc_mqueue_send(kmsg, option, time_out) - ipc_kmsg_t kmsg; - mach_msg_option_t option; - mach_msg_timeout_t time_out; +ipc_mqueue_send( + ipc_kmsg_t kmsg, + mach_msg_option_t option, + mach_msg_timeout_t time_out) { ipc_port_t port; diff --git a/ipc/ipc_notify.c b/ipc/ipc_notify.c index 25fa421..df5f68b 100644 --- a/ipc/ipc_notify.c +++ b/ipc/ipc_notify.c @@ -59,8 +59,7 @@ mach_dead_name_notification_t ipc_notify_dead_name_template; */ void -ipc_notify_init_port_deleted(n) - mach_port_deleted_notification_t *n; +ipc_notify_init_port_deleted(mach_port_deleted_notification_t *n) { mach_msg_header_t *m = &n->not_header; mach_msg_type_t *t = &n->not_type; @@ -90,8 +89,7 @@ ipc_notify_init_port_deleted(n) */ void -ipc_notify_init_msg_accepted(n) - mach_msg_accepted_notification_t *n; +ipc_notify_init_msg_accepted(mach_msg_accepted_notification_t *n) { mach_msg_header_t *m = &n->not_header; mach_msg_type_t *t = &n->not_type; @@ -121,8 +119,7 @@ ipc_notify_init_msg_accepted(n) */ void -ipc_notify_init_port_destroyed( - mach_port_destroyed_notification_t *n) +ipc_notify_init_port_destroyed(mach_port_destroyed_notification_t *n) { mach_msg_header_t *m = &n->not_header; mach_msg_type_t *t = &n->not_type; @@ -255,9 +252,9 @@ ipc_notify_init(void) */ void -ipc_notify_port_deleted(port, name) - ipc_port_t port; - mach_port_t name; +ipc_notify_port_deleted( + ipc_port_t port, + mach_port_t name) { ipc_kmsg_t kmsg; mach_port_deleted_notification_t *n; @@ -289,9 +286,9 @@ ipc_notify_port_deleted(port, name) */ void -ipc_notify_msg_accepted(port, name) - ipc_port_t port; - mach_port_t name; +ipc_notify_msg_accepted( + ipc_port_t port, + mach_port_t name) { ipc_kmsg_t kmsg; mach_msg_accepted_notification_t *n; @@ -326,9 +323,9 @@ ipc_notify_msg_accepted(port, name) */ void -ipc_notify_port_destroyed(port, right) - ipc_port_t port; - ipc_port_t right; +ipc_notify_port_destroyed( + ipc_port_t port, + ipc_port_t right) { ipc_kmsg_t kmsg; mach_port_destroyed_notification_t *n; @@ -362,9 +359,9 @@ ipc_notify_port_destroyed(port, right) */ void -ipc_notify_no_senders(port, mscount) - ipc_port_t port; - mach_port_mscount_t mscount; +ipc_notify_no_senders( + ipc_port_t port, + mach_port_mscount_t mscount) { ipc_kmsg_t kmsg; mach_no_senders_notification_t *n; @@ -396,8 +393,7 @@ ipc_notify_no_senders(port, mscount) */ void -ipc_notify_send_once(port) - ipc_port_t port; +ipc_notify_send_once(ipc_port_t port) { ipc_kmsg_t kmsg; mach_send_once_notification_t *n; @@ -428,9 +424,9 @@ ipc_notify_send_once(port) */ void -ipc_notify_dead_name(port, name) - ipc_port_t port; - mach_port_t name; +ipc_notify_dead_name( + ipc_port_t port, + mach_port_t name) { ipc_kmsg_t kmsg; mach_dead_name_notification_t *n; diff --git a/ipc/ipc_port.c b/ipc/ipc_port.c index d4ade8e..78211e6 100644 --- a/ipc/ipc_port.c +++ b/ipc/ipc_port.c @@ -94,11 +94,11 @@ ipc_port_timestamp(void) */ kern_return_t -ipc_port_dnrequest(port, name, soright, indexp) - ipc_port_t port; - mach_port_t name; - ipc_port_t soright; - ipc_port_request_index_t *indexp; +ipc_port_dnrequest( + ipc_port_t port, + mach_port_t name, + ipc_port_t soright, + ipc_port_request_index_t *indexp) { ipc_port_request_t ipr, table; ipc_port_request_index_t index; @@ -142,8 +142,7 @@ ipc_port_dnrequest(port, name, soright, indexp) */ kern_return_t -ipc_port_dngrow(port) - ipc_port_t port; +ipc_port_dngrow(ipc_port_t port) { ipc_table_size_t its; ipc_port_request_t otable, ntable; @@ -382,8 +381,7 @@ ipc_port_set_qlimit( */ ipc_mqueue_t -ipc_port_lock_mqueue(port) - ipc_port_t port; +ipc_port_lock_mqueue(ipc_port_t port) { if (port->ip_pset != IPS_NULL) { ipc_pset_t pset = port->ip_pset; @@ -413,9 +411,9 @@ ipc_port_lock_mqueue(port) */ void -ipc_port_set_seqno(port, seqno) - ipc_port_t port; - mach_port_seqno_t seqno; +ipc_port_set_seqno( + ipc_port_t port, + mach_port_seqno_t seqno) { ipc_mqueue_t mqueue; @@ -1135,8 +1133,7 @@ ipc_port_release_receive( */ ipc_port_t -ipc_port_alloc_special(space) - ipc_space_t space; +ipc_port_alloc_special(ipc_space_t space) { ipc_port_t port; diff --git a/ipc/ipc_right.c b/ipc/ipc_right.c index 41fe3de..77a68ce 100644 --- a/ipc/ipc_right.c +++ b/ipc/ipc_right.c @@ -331,10 +331,10 @@ ipc_right_dncancel( */ boolean_t -ipc_right_inuse(space, name, entry) - ipc_space_t space; - mach_port_t name; - ipc_entry_t entry; +ipc_right_inuse( + ipc_space_t space, + mach_port_t name, + ipc_entry_t entry) { ipc_entry_bits_t bits = entry->ie_bits; @@ -359,11 +359,11 @@ ipc_right_inuse(space, name, entry) */ boolean_t -ipc_right_check(space, port, name, entry) - ipc_space_t space; - ipc_port_t port; - mach_port_t name; - ipc_entry_t entry; +ipc_right_check( + ipc_space_t space, + ipc_port_t port, + mach_port_t name, + ipc_entry_t entry) { ipc_entry_bits_t bits; @@ -697,10 +697,10 @@ ipc_right_destroy( */ kern_return_t -ipc_right_dealloc(space, name, entry) - ipc_space_t space; - mach_port_t name; - ipc_entry_t entry; +ipc_right_dealloc( + ipc_space_t space, + mach_port_t name, + ipc_entry_t entry) { ipc_entry_bits_t bits = entry->ie_bits; mach_port_type_t type = IE_BITS_TYPE(bits); @@ -874,12 +874,12 @@ ipc_right_dealloc(space, name, entry) */ kern_return_t -ipc_right_delta(space, name, entry, right, delta) - ipc_space_t space; - mach_port_t name; - ipc_entry_t entry; - mach_port_right_t right; - mach_port_delta_t delta; +ipc_right_delta( + ipc_space_t space, + mach_port_t name, + ipc_entry_t entry, + mach_port_right_t right, + mach_port_delta_t delta) { ipc_entry_bits_t bits = entry->ie_bits; diff --git a/ipc/mach_debug.c b/ipc/mach_debug.c index dd9057a..eb52e1c 100644 --- a/ipc/mach_debug.c +++ b/ipc/mach_debug.c @@ -185,11 +185,11 @@ host_ipc_hash_info( */ kern_return_t -host_ipc_marequest_info(host, maxp, infop, countp) - host_t host; - unsigned int *maxp; - hash_info_bucket_array_t *infop; - unsigned int *countp; +host_ipc_marequest_info( + host_t host, + unsigned int *maxp, + hash_info_bucket_array_t *infop, + unsigned int *countp) { vm_offset_t addr; vm_size_t size = 0; /* '=0' to shut up lint */ diff --git a/ipc/mach_msg.c b/ipc/mach_msg.c index 78247a4..01d974b 100644 --- a/ipc/mach_msg.c +++ b/ipc/mach_msg.c @@ -88,12 +88,12 @@ */ mach_msg_return_t -mach_msg_send(msg, option, send_size, time_out, notify) - mach_msg_header_t *msg; - mach_msg_option_t option; - mach_msg_size_t send_size; - mach_msg_timeout_t time_out; - mach_port_t notify; +mach_msg_send( + mach_msg_header_t *msg, + mach_msg_option_t option, + mach_msg_size_t send_size, + mach_msg_timeout_t time_out, + mach_port_t notify) { ipc_space_t space = current_space(); vm_map_t map = current_map(); @@ -170,13 +170,13 @@ mach_msg_send(msg, option, send_size, time_out, notify) */ mach_msg_return_t -mach_msg_receive(msg, option, rcv_size, rcv_name, time_out, notify) - mach_msg_header_t *msg; - mach_msg_option_t option; - mach_msg_size_t rcv_size; - mach_port_t rcv_name; - mach_msg_timeout_t time_out; - mach_port_t notify; +mach_msg_receive( + mach_msg_header_t *msg, + mach_msg_option_t option, + mach_msg_size_t rcv_size, + mach_port_t rcv_name, + mach_msg_timeout_t time_out, + mach_port_t notify) { ipc_thread_t self = current_thread(); ipc_space_t space = current_space(); @@ -379,14 +379,14 @@ mach_msg_receive_continue(void) */ mach_msg_return_t -mach_msg_trap(msg, option, send_size, rcv_size, rcv_name, time_out, notify) - mach_msg_header_t *msg; - mach_msg_option_t option; - mach_msg_size_t send_size; - mach_msg_size_t rcv_size; - mach_port_t rcv_name; - mach_msg_timeout_t time_out; - mach_port_t notify; +mach_msg_trap( + mach_msg_header_t *msg, + mach_msg_option_t option, + mach_msg_size_t send_size, + mach_msg_size_t rcv_size, + mach_port_t rcv_name, + mach_msg_timeout_t time_out, + mach_port_t notify) { mach_msg_return_t mr; @@ -1733,8 +1733,7 @@ mach_msg_continue(void) */ boolean_t -mach_msg_interrupt(thread) - thread_t thread; +mach_msg_interrupt(thread_t thread) { ipc_mqueue_t mqueue; diff --git a/ipc/mach_port.c b/ipc/mach_port.c index 13572a1..4a4efcc 100644 --- a/ipc/mach_port.c +++ b/ipc/mach_port.c @@ -434,10 +434,10 @@ mach_port_rename( */ kern_return_t -mach_port_allocate_name(space, right, name) - ipc_space_t space; - mach_port_right_t right; - mach_port_t name; +mach_port_allocate_name( + ipc_space_t space, + mach_port_right_t right, + mach_port_t name) { kern_return_t kr; @@ -497,10 +497,10 @@ mach_port_allocate_name(space, right, name) */ kern_return_t -mach_port_allocate(space, right, namep) - ipc_space_t space; - mach_port_right_t right; - mach_port_t *namep; +mach_port_allocate( + ipc_space_t space, + mach_port_right_t right, + mach_port_t *namep) { kern_return_t kr; @@ -759,10 +759,10 @@ mach_port_mod_refs( */ kern_return_t -old_mach_port_get_receive_status(space, name, statusp) - ipc_space_t space; - mach_port_t name; - old_mach_port_status_t *statusp; +old_mach_port_get_receive_status( + ipc_space_t space, + mach_port_t name, + old_mach_port_status_t *statusp) { mach_port_status_t status; kern_return_t kr; @@ -801,10 +801,10 @@ old_mach_port_get_receive_status(space, name, statusp) */ kern_return_t -mach_port_set_qlimit(space, name, qlimit) - ipc_space_t space; - mach_port_t name; - mach_port_msgcount_t qlimit; +mach_port_set_qlimit( + ipc_space_t space, + mach_port_t name, + mach_port_msgcount_t qlimit) { ipc_port_t port; kern_return_t kr; @@ -1365,10 +1365,10 @@ mach_port_extract_right( */ kern_return_t -mach_port_get_receive_status(space, name, statusp) - ipc_space_t space; - mach_port_t name; - mach_port_status_t *statusp; +mach_port_get_receive_status( + ipc_space_t space, + mach_port_t name, + mach_port_status_t *statusp) { ipc_port_t port; kern_return_t kr; @@ -1419,11 +1419,11 @@ mach_port_get_receive_status(space, name, statusp) #ifdef MIGRATING_THREADS kern_return_t -mach_port_set_rpcinfo(space, name, rpc_info, rpc_info_count) - ipc_space_t space; - mach_port_t name; - void *rpc_info; - unsigned int rpc_info_count; +mach_port_set_rpcinfo( + ipc_space_t space, + mach_port_t name, + void *rpc_info, + unsigned int rpc_info_count) { ipc_target_t target; ipc_object_t object; @@ -1463,13 +1463,13 @@ void sact_count(void) } kern_return_t -mach_port_create_act(task, name, user_stack, user_rbuf, user_rbuf_size, out_act) - task_t task; - mach_port_t name; - vm_offset_t user_stack; - vm_offset_t user_rbuf; - vm_size_t user_rbuf_size; - Act **out_act; +mach_port_create_act( + task_t task, + mach_port_t name, + vm_offset_t user_stack, + vm_offset_t user_rbuf, + vm_size_t user_rbuf_size, + Act **out_act) { ipc_target_t target; ipc_space_t space; @@ -1536,9 +1536,9 @@ mach_port_create_act(task, name, user_stack, user_rbuf, user_rbuf_size, out_act) #ifdef RPCKERNELSIG kern_return_t -mach_port_set_syscall_right(task, name) - task_t task; - mach_port_t name; +mach_port_set_syscall_right( + task_t task, + mach_port_t name) { ipc_entry_t entry; kern_return_t kr; diff --git a/ipc/mach_rpc.c b/ipc/mach_rpc.c index e056a7f..6ca46cc 100644 --- a/ipc/mach_rpc.c +++ b/ipc/mach_rpc.c @@ -58,9 +58,10 @@ * info to the other side. */ kern_return_t -mach_port_rpc_copy(portp, sact, dact) - struct rpc_port_desc *portp; - struct Act *sact, *dact; +mach_port_rpc_copy( + struct rpc_port_desc *portp, + struct Act *sact, + struct Act *dact) { ipc_space_t sspace, dspace; mach_msg_type_name_t tname; @@ -1013,11 +1013,11 @@ act_set_special_port(Act *act, int which, ipc_port_t port) * Return thread's machine-dependent state. */ kern_return_t -act_get_state_immediate(act, flavor, old_state, old_state_count) - Act *act; - int flavor; - void *old_state; /* pointer to OUT array */ - unsigned int *old_state_count; /*IN/OUT*/ +act_get_state_immediate( + Act *act, + int flavor, + void *old_state, /* pointer to OUT array */ + unsigned int *old_state_count) /*IN/OUT*/ { kern_return_t ret; @@ -1039,11 +1039,11 @@ act_get_state_immediate(act, flavor, old_state, old_state_count) * Change thread's machine-dependent state. */ kern_return_t -act_set_state_immediate(act, flavor, new_state, new_state_count) - Act *act; - int flavor; - void *new_state; - unsigned int new_state_count; +act_set_state_immediate( + Act *act, + int flavor, + void *new_state, + unsigned int new_state_count) { kern_return_t ret; @@ -1097,8 +1097,7 @@ void dump_act(act) #ifdef ACTWATCH Act * -get_next_act(sp) - int sp; +get_next_act(int sp) { static int i; Act *act; diff --git a/kern/exception.c b/kern/exception.c index 2ca404d..7954fba 100644 --- a/kern/exception.c +++ b/kern/exception.c @@ -82,8 +82,10 @@ boolean_t debug_user_with_kdb = FALSE; */ void -exception(_exception, code, subcode) - integer_t _exception, code, subcode; +exception( + integer_t _exception, + integer_t code, + integer_t subcode) { ipc_thread_t self = current_thread(); ipc_port_t exc_port; @@ -152,8 +154,10 @@ exception(_exception, code, subcode) */ void -exception_try_task(_exception, code, subcode) - integer_t _exception, code, subcode; +exception_try_task( + integer_t _exception, + integer_t code, + integer_t subcode) { ipc_thread_t self = current_thread(); task_t task = self->task; @@ -319,12 +323,13 @@ mach_msg_type_t exc_code_proto = { int exception_raise_misses = 0; void -exception_raise(dest_port, thread_port, task_port, - _exception, code, subcode) - ipc_port_t dest_port; - ipc_port_t thread_port; - ipc_port_t task_port; - integer_t _exception, code, subcode; +exception_raise( + ipc_port_t dest_port, + ipc_port_t thread_port, + ipc_port_t task_port, + integer_t _exception, + integer_t code, + integer_t subcode) { ipc_thread_t self = current_thread(); ipc_thread_t receiver; @@ -783,8 +788,7 @@ mach_msg_type_t exc_RetCode_proto = { */ kern_return_t -exception_parse_reply(kmsg) - ipc_kmsg_t kmsg; +exception_parse_reply(ipc_kmsg_t kmsg) { mig_reply_header_t *msg = (mig_reply_header_t *) &kmsg->ikm_header; @@ -860,10 +864,10 @@ exception_raise_continue(void) */ void -exception_raise_continue_slow(mr, kmsg, seqno) - mach_msg_return_t mr; - ipc_kmsg_t kmsg; - mach_port_seqno_t seqno; +exception_raise_continue_slow( + mach_msg_return_t mr, + ipc_kmsg_t kmsg, + mach_port_seqno_t seqno) { ipc_thread_t self = current_thread(); ipc_port_t reply_port = self->ith_port; @@ -943,9 +947,9 @@ exception_raise_continue_slow(mr, kmsg, seqno) */ void -exception_raise_continue_fast(reply_port, kmsg) - ipc_port_t reply_port; - ipc_kmsg_t kmsg; +exception_raise_continue_fast( + ipc_port_t reply_port, + ipc_kmsg_t kmsg) { ipc_thread_t self = current_thread(); kern_return_t kr; diff --git a/kern/ipc_mig.c b/kern/ipc_mig.c index f2c3f45..41ebc94 100644 --- a/kern/ipc_mig.c +++ b/kern/ipc_mig.c @@ -110,8 +110,7 @@ mach_msg_rpc_from_kernel(msg, send_size, reply_size) */ void -mach_msg_abort_rpc(thread) - ipc_thread_t thread; +mach_msg_abort_rpc(ipc_thread_t thread) { ipc_port_t reply = IP_NULL; @@ -141,14 +140,14 @@ mach_msg_abort_rpc(thread) */ mach_msg_return_t -mach_msg(msg, option, send_size, rcv_size, rcv_name, time_out, notify) - mach_msg_header_t *msg; - mach_msg_option_t option; - mach_msg_size_t send_size; - mach_msg_size_t rcv_size; - mach_port_t rcv_name; - mach_msg_timeout_t time_out; - mach_port_t notify; +mach_msg( + mach_msg_header_t *msg, + mach_msg_option_t option, + mach_msg_size_t send_size, + mach_msg_size_t rcv_size, + mach_port_t rcv_name, + mach_msg_timeout_t time_out, + mach_port_t notify) { ipc_space_t space = current_space(); vm_map_t map = current_map(); @@ -333,8 +332,7 @@ MACRO_BEGIN \ MACRO_END device_t -port_name_to_device(name) - mach_port_t name; +port_name_to_device(mach_port_t name) { ipc_port_t port; device_t device; @@ -377,8 +375,7 @@ port_name_to_device(name) } thread_t -port_name_to_thread(name) - mach_port_t name; +port_name_to_thread(mach_port_t name) { ipc_port_t port; @@ -423,8 +420,7 @@ port_name_to_thread(name) } task_t -port_name_to_task(name) - mach_port_t name; +port_name_to_task(mach_port_t name) { ipc_port_t port; @@ -519,8 +515,7 @@ port_name_to_map( } ipc_space_t -port_name_to_space(name) - mach_port_t name; +port_name_to_space(mach_port_t name) { ipc_port_t port; @@ -575,12 +570,11 @@ port_name_to_space(name) * AARGH! */ -kern_return_t thread_get_state_KERNEL(thread_port, flavor, - old_state, old_state_count) - mach_port_t thread_port; /* port right for thread */ - int flavor; - thread_state_t old_state; /* pointer to OUT array */ - natural_t *old_state_count; /* IN/OUT */ +kern_return_t thread_get_state_KERNEL( + mach_port_t thread_port, /* port right for thread */ + int flavor, + thread_state_t old_state, /* pointer to OUT array */ + natural_t *old_state_count) /* IN/OUT */ { thread_t thread; kern_return_t result; @@ -592,12 +586,11 @@ kern_return_t thread_get_state_KERNEL(thread_port, flavor, return result; } -kern_return_t thread_set_state_KERNEL(thread_port, flavor, - new_state, new_state_count) - mach_port_t thread_port; /* port right for thread */ - int flavor; - thread_state_t new_state; - natural_t new_state_count; +kern_return_t thread_set_state_KERNEL( + mach_port_t thread_port, /* port right for thread */ + int flavor, + thread_state_t new_state, + natural_t new_state_count) { thread_t thread; kern_return_t result; @@ -669,11 +662,11 @@ syscall_vm_map( return result; } -kern_return_t syscall_vm_allocate(target_map, address, size, anywhere) - mach_port_t target_map; - vm_offset_t *address; - vm_size_t size; - boolean_t anywhere; +kern_return_t syscall_vm_allocate( + mach_port_t target_map, + vm_offset_t *address, + vm_size_t size, + boolean_t anywhere) { vm_map_t map; vm_offset_t addr; @@ -692,10 +685,10 @@ kern_return_t syscall_vm_allocate(target_map, address, size, anywhere) return result; } -kern_return_t syscall_vm_deallocate(target_map, start, size) - mach_port_t target_map; - vm_offset_t start; - vm_size_t size; +kern_return_t syscall_vm_deallocate( + mach_port_t target_map, + vm_offset_t start, + vm_size_t size) { vm_map_t map; kern_return_t result; @@ -710,10 +703,10 @@ kern_return_t syscall_vm_deallocate(target_map, start, size) return result; } -kern_return_t syscall_task_create(parent_task, inherit_memory, child_task) - mach_port_t parent_task; - boolean_t inherit_memory; - mach_port_t *child_task; /* OUT */ +kern_return_t syscall_task_create( + mach_port_t parent_task, + boolean_t inherit_memory, + mach_port_t *child_task) /* OUT */ { task_t t, c; ipc_port_t port; @@ -739,8 +732,7 @@ kern_return_t syscall_task_create(parent_task, inherit_memory, child_task) return result; } -kern_return_t syscall_task_terminate(task) - mach_port_t task; +kern_return_t syscall_task_terminate(mach_port_t task) { task_t t; kern_return_t result; @@ -755,8 +747,7 @@ kern_return_t syscall_task_terminate(task) return result; } -kern_return_t syscall_task_suspend(task) - mach_port_t task; +kern_return_t syscall_task_suspend(mach_port_t task) { task_t t; kern_return_t result; @@ -771,10 +762,10 @@ kern_return_t syscall_task_suspend(task) return result; } -kern_return_t syscall_task_set_special_port(task, which_port, port_name) - mach_port_t task; - int which_port; - mach_port_t port_name; +kern_return_t syscall_task_set_special_port( + mach_port_t task, + int which_port, + mach_port_t port_name) { task_t t; ipc_port_t port; @@ -804,10 +795,10 @@ kern_return_t syscall_task_set_special_port(task, which_port, port_name) } kern_return_t -syscall_mach_port_allocate(task, right, namep) - mach_port_t task; - mach_port_right_t right; - mach_port_t *namep; +syscall_mach_port_allocate( + mach_port_t task, + mach_port_right_t right, + mach_port_t *namep) { ipc_space_t space; mach_port_t name; @@ -826,10 +817,10 @@ syscall_mach_port_allocate(task, right, namep) } kern_return_t -syscall_mach_port_allocate_name(task, right, name) - mach_port_t task; - mach_port_right_t right; - mach_port_t name; +syscall_mach_port_allocate_name( + mach_port_t task, + mach_port_right_t right, + mach_port_t name) { ipc_space_t space; kern_return_t kr; @@ -845,9 +836,9 @@ syscall_mach_port_allocate_name(task, right, name) } kern_return_t -syscall_mach_port_deallocate(task, name) - mach_port_t task; - mach_port_t name; +syscall_mach_port_deallocate( + mach_port_t task, + mach_port_t name) { ipc_space_t space; kern_return_t kr; @@ -863,11 +854,11 @@ syscall_mach_port_deallocate(task, name) } kern_return_t -syscall_mach_port_insert_right(task, name, right, rightType) - mach_port_t task; - mach_port_t name; - mach_port_t right; - mach_msg_type_name_t rightType; +syscall_mach_port_insert_right( + mach_port_t task, + mach_port_t name, + mach_port_t right, + mach_msg_type_name_t rightType) { ipc_space_t space; ipc_object_t object; @@ -902,8 +893,7 @@ syscall_mach_port_insert_right(task, name, right, rightType) return kr; } -kern_return_t syscall_thread_depress_abort(thread) - mach_port_t thread; +kern_return_t syscall_thread_depress_abort(mach_port_t thread) { thread_t t; kern_return_t result; diff --git a/kern/ipc_tt.c b/kern/ipc_tt.c index f8d0f63..96737be 100644 --- a/kern/ipc_tt.c +++ b/kern/ipc_tt.c @@ -213,8 +213,7 @@ ipc_task_terminate( */ void -ipc_thread_init(thread) - thread_t thread; +ipc_thread_init(thread_t thread) { ipc_port_t kport; @@ -243,8 +242,7 @@ ipc_thread_init(thread) */ void -ipc_thread_enable(thread) - thread_t thread; +ipc_thread_enable(thread_t thread) { ipc_port_t kport; @@ -264,8 +262,7 @@ ipc_thread_enable(thread) */ void -ipc_thread_disable(thread) - thread_t thread; +ipc_thread_disable(thread_t thread) { ipc_port_t kport; @@ -286,8 +283,7 @@ ipc_thread_disable(thread) */ void -ipc_thread_terminate(thread) - thread_t thread; +ipc_thread_terminate(thread_t thread) { ipc_port_t kport; @@ -424,8 +420,7 @@ retrieve_task_self_fast( */ ipc_port_t -retrieve_thread_self_fast(thread) - thread_t thread; +retrieve_thread_self_fast(thread_t thread) { ipc_port_t port; @@ -705,10 +700,10 @@ task_set_special_port( */ kern_return_t -thread_get_special_port(thread, which, portp) - thread_t thread; - int which; - ipc_port_t *portp; +thread_get_special_port( + thread_t thread, + int which, + ipc_port_t *portp) { ipc_port_t *whichp; ipc_port_t port; @@ -758,10 +753,10 @@ thread_get_special_port(thread, which, portp) */ kern_return_t -thread_set_special_port(thread, which, port) - thread_t thread; - int which; - ipc_port_t port; +thread_set_special_port( + thread_t thread, + int which, + ipc_port_t port) { ipc_port_t *whichp; ipc_port_t old; @@ -890,10 +885,10 @@ mach_ports_register( */ kern_return_t -mach_ports_lookup(task, portsp, portsCnt) - task_t task; - ipc_port_t **portsp; - mach_msg_type_number_t *portsCnt; +mach_ports_lookup( + task_t task, + ipc_port_t **portsp, + mach_msg_type_number_t *portsCnt) { vm_offset_t memory; vm_size_t size; @@ -1003,8 +998,7 @@ convert_port_to_space( */ vm_map_t -convert_port_to_map(port) - ipc_port_t port; +convert_port_to_map(ipc_port_t port) { vm_map_t map = VM_MAP_NULL; @@ -1032,8 +1026,7 @@ convert_port_to_map(port) */ thread_t -convert_port_to_thread(port) - ipc_port_t port; +convert_port_to_thread(ipc_port_t port) { thread_t thread = THREAD_NULL; @@ -1061,8 +1054,7 @@ convert_port_to_thread(port) */ ipc_port_t -convert_task_to_port(task) - task_t task; +convert_task_to_port(task_t task) { ipc_port_t port; @@ -1088,8 +1080,7 @@ convert_task_to_port(task) */ ipc_port_t -convert_thread_to_port(thread) - thread_t thread; +convert_thread_to_port(thread_t thread) { ipc_port_t port; @@ -1113,8 +1104,7 @@ convert_thread_to_port(thread) */ void -space_deallocate(space) - ipc_space_t space; +space_deallocate(ipc_space_t space) { if (space != IS_NULL) is_release(space); diff --git a/kern/lock_mon.c b/kern/lock_mon.c index 33ce70f..f6bbd5d 100644 --- a/kern/lock_mon.c +++ b/kern/lock_mon.c @@ -64,7 +64,6 @@ typedef unsigned int time_stamp_t; #define LOCK_INFO_HASH_COUNT 1024 #define LOCK_INFO_PER_BUCKET (LOCK_INFO_MAX/LOCK_INFO_HASH_COUNT) - #define HASH_LOCK(lock) ((long)lock>>5 & (LOCK_INFO_HASH_COUNT-1)) struct lock_info { diff --git a/kern/mach_clock.c b/kern/mach_clock.c index f4a7714..0a7458b 100644 --- a/kern/mach_clock.c +++ b/kern/mach_clock.c @@ -120,10 +120,10 @@ timer_elt_data_t timer_head; /* ordered list of timeouts */ * the accuracy of the hardware clock. * */ -void clock_interrupt(usec, usermode, basepri) - int usec; /* microseconds per tick */ - boolean_t usermode; /* executing user code */ - boolean_t basepri; /* at base priority */ +void clock_interrupt( + int usec, /* microseconds per tick */ + boolean_t usermode, /* executing user code */ + boolean_t basepri) /* at base priority */ { int my_cpu = cpu_number(); thread_t thread = current_thread(); @@ -309,9 +309,9 @@ void softclock(void) * telt timer element. Function and param are already set. * interval time-out interval, in hz. */ -void set_timeout(telt, interval) - timer_elt_t telt; /* already loaded */ - unsigned int interval; +void set_timeout( + timer_elt_t telt, /* already loaded */ + unsigned int interval) { spl_t s; timer_elt_t next; @@ -339,8 +339,7 @@ void set_timeout(telt, interval) splx(s); } -boolean_t reset_timeout(telt) - timer_elt_t telt; +boolean_t reset_timeout(timer_elt_t telt) { spl_t s; @@ -526,10 +525,10 @@ timer_elt_data_t timeout_timers[NTIMERS]; * param: parameter to pass to function * interval: timeout interval, in hz. */ -void timeout(fcn, param, interval) - void (*fcn)( void * param ); - void * param; - int interval; +void timeout( + void (*fcn)(void *param), + void * param, + int interval) { spl_t s; timer_elt_t elt; diff --git a/kern/machine.c b/kern/machine.c index 52133cb..eced768 100644 --- a/kern/machine.c +++ b/kern/machine.c @@ -72,8 +72,7 @@ decl_simple_lock_data(,action_lock); * Flag specified cpu as up and running. Called when a processor comes * online. */ -void cpu_up(cpu) - int cpu; +void cpu_up(int cpu) { struct machine_slot *ms; processor_t processor; @@ -102,8 +101,7 @@ void cpu_up(cpu) * Flag specified cpu as down. Called when a processor is about to * go offline. */ -void cpu_down(cpu) - int cpu; +void cpu_down(int cpu) { struct machine_slot *ms; processor_t processor; @@ -153,9 +151,9 @@ host_reboot(host, options) * a reference. */ void -processor_request_action(processor, new_pset) -processor_t processor; -processor_set_t new_pset; +processor_request_action( + processor_t processor, + processor_set_t new_pset) { processor_set_t pset; @@ -228,10 +226,10 @@ processor_set_t new_pset; * Synchronizes with assignment completion if wait is TRUE. */ kern_return_t -processor_assign(processor, new_pset, wait) -processor_t processor; -processor_set_t new_pset; -boolean_t wait; +processor_assign( + processor_t processor, + processor_set_t new_pset, + boolean_t wait) { spl_t s; @@ -315,10 +313,10 @@ Retry: #else /* MACH_HOST */ kern_return_t -processor_assign(processor, new_pset, wait) -processor_t processor; -processor_set_t new_pset; -boolean_t wait; +processor_assign( + processor_t processor, + processor_set_t new_pset, + boolean_t wait) { return KERN_FAILURE; } @@ -331,8 +329,7 @@ boolean_t wait; * with the shutdown (can be called from interrupt level). */ kern_return_t -processor_shutdown(processor) -processor_t processor; +processor_shutdown(processor_t processor) { spl_t s; @@ -401,8 +398,7 @@ void __attribute__((noreturn)) action_thread(void) * is to schedule ourselves onto a cpu and then save our * context back into the runqs before taking out the cpu. */ -void processor_doaction(processor) -processor_t processor; +void processor_doaction(processor_t processor) { thread_t this_thread; spl_t s; @@ -650,10 +646,10 @@ processor_t processor; #else /* NCPUS > 1 */ kern_return_t -processor_assign(processor, new_pset, wait) -processor_t processor; -processor_set_t new_pset; -boolean_t wait; +processor_assign( + processor_t processor, + processor_set_t new_pset, + boolean_t wait) { return(KERN_FAILURE); } @@ -661,9 +657,9 @@ boolean_t wait; #endif /* NCPUS > 1 */ kern_return_t -host_get_boot_info(priv_host, boot_info) - host_t priv_host; - kernel_boot_info_t boot_info; +host_get_boot_info( + host_t priv_host, + kernel_boot_info_t boot_info) { char *src = ""; diff --git a/kern/printf.c b/kern/printf.c index ea78d48..1db0d08 100644 --- a/kern/printf.c +++ b/kern/printf.c @@ -626,9 +626,9 @@ snprintf(char *buf, size_t size, const char *fmt, ...) return written; } -void safe_gets(str, maxlen) - char *str; - int maxlen; +void safe_gets( + char *str, + int maxlen) { char *lp; int c; diff --git a/kern/priority.c b/kern/priority.c index d9ded85..587ea2f 100644 --- a/kern/priority.c +++ b/kern/priority.c @@ -74,11 +74,11 @@ * Called only from clock_interrupt(). */ -void thread_quantum_update(mycpu, thread, nticks, state) - int mycpu; - thread_t thread; - int nticks; - int state; +void thread_quantum_update( + int mycpu, + thread_t thread, + int nticks, + int state) { int quantum; processor_t myprocessor; diff --git a/kern/startup.c b/kern/startup.c index 12f5123..71cd04d 100644 --- a/kern/startup.c +++ b/kern/startup.c @@ -276,8 +276,7 @@ void slave_main(void) * Start up the first thread on a CPU. * First thread is specified for the master CPU. */ -void cpu_launch_first_thread(th) - thread_t th; +void cpu_launch_first_thread(thread_t th) { int mycpu; diff --git a/kern/syscall_emulation.c b/kern/syscall_emulation.c index da0a6cf..95e91d5 100644 --- a/kern/syscall_emulation.c +++ b/kern/syscall_emulation.c @@ -68,8 +68,9 @@ void eml_init(void) * vector. */ -void eml_task_reference(task, parent) - task_t task, parent; +void eml_task_reference( + task_t task, + task_t parent) { eml_dispatch_t eml; @@ -116,12 +117,11 @@ void eml_task_deallocate(task) * set a list of emulated system calls for this task. */ kern_return_t -task_set_emulation_vector_internal(task, vector_start, emulation_vector, - emulation_vector_count) - task_t task; - int vector_start; - emulation_vector_t emulation_vector; - unsigned int emulation_vector_count; +task_set_emulation_vector_internal( + task_t task, + int vector_start, + emulation_vector_t emulation_vector, + unsigned int emulation_vector_count) { eml_dispatch_t cur_eml, new_eml, old_eml; vm_size_t new_size; @@ -295,12 +295,11 @@ task_set_emulation_vector_internal(task, vector_start, emulation_vector, * The list is out-of-line. */ kern_return_t -task_set_emulation_vector(task, vector_start, emulation_vector, - emulation_vector_count) - task_t task; - int vector_start; - emulation_vector_t emulation_vector; - unsigned int emulation_vector_count; +task_set_emulation_vector( + task_t task, + int vector_start, + emulation_vector_t emulation_vector, + unsigned int emulation_vector_count) { kern_return_t kr; vm_offset_t emul_vector_addr; @@ -342,12 +341,11 @@ task_set_emulation_vector(task, vector_start, emulation_vector, * List is returned out-of-line. */ kern_return_t -task_get_emulation_vector(task, vector_start, emulation_vector, - emulation_vector_count) - task_t task; - int *vector_start; /* out */ - emulation_vector_t *emulation_vector; /* out */ - unsigned int *emulation_vector_count; /* out */ +task_get_emulation_vector( + task_t task, + int *vector_start, /* out */ + emulation_vector_t *emulation_vector, /* out */ + unsigned int *emulation_vector_count) /* out */ { eml_dispatch_t eml; vm_size_t vector_size, size; @@ -445,10 +443,10 @@ task_get_emulation_vector(task, vector_start, emulation_vector, * task_set_emulation: [Server Entry] * set up for user space emulation of syscalls within this task. */ -kern_return_t task_set_emulation(task, routine_entry_pt, routine_number) - task_t task; - vm_offset_t routine_entry_pt; - int routine_number; +kern_return_t task_set_emulation( + task_t task, + vm_offset_t routine_entry_pt, + int routine_number) { return task_set_emulation_vector_internal(task, routine_number, &routine_entry_pt, 1); diff --git a/kern/syscall_subr.c b/kern/syscall_subr.c index ed153ad..3c369ef 100644 --- a/kern/syscall_subr.c +++ b/kern/syscall_subr.c @@ -48,8 +48,6 @@ #include <mach/policy.h> #endif /* MACH_FIXPRI */ - - /* * swtch and swtch_pri both attempt to context switch (logic in * thread_block no-ops the context switch if nothing would happen). @@ -104,8 +102,7 @@ void swtch_pri_continue(void) /*NOTREACHED*/ } -boolean_t swtch_pri(pri) - int pri; +boolean_t swtch_pri(int pri) { thread_t thread = current_thread(); processor_t myprocessor; @@ -154,10 +151,10 @@ void thread_switch_continue(void) * Fixed priority threads that call this get what they asked for * even if that violates priority order. */ -kern_return_t thread_switch(thread_name, option, option_time) -mach_port_t thread_name; -int option; -mach_msg_timeout_t option_time; +kern_return_t thread_switch( + mach_port_t thread_name, + int option, + mach_msg_timeout_t option_time) { thread_t cur_thread = current_thread(); processor_t myprocessor; @@ -282,9 +279,9 @@ mach_msg_timeout_t option_time; * of zero will result in no timeout being scheduled. */ void -thread_depress_priority(thread, depress_time) -thread_t thread; -mach_msg_timeout_t depress_time; +thread_depress_priority( + thread_t thread, + mach_msg_timeout_t depress_time) { unsigned int ticks; spl_t s; @@ -320,8 +317,7 @@ mach_msg_timeout_t depress_time; * Timeout routine for priority depression. */ void -thread_depress_timeout(thread) -thread_t thread; +thread_depress_timeout(thread_t thread) { spl_t s; @@ -349,8 +345,7 @@ thread_t thread; * Prematurely abort priority depression if there is one. */ kern_return_t -thread_depress_abort(thread) -thread_t thread; +thread_depress_abort(thread_t thread) { spl_t s; diff --git a/kern/thread_swap.c b/kern/thread_swap.c index 087c8bc..dc2924a 100644 --- a/kern/thread_swap.c +++ b/kern/thread_swap.c @@ -86,8 +86,7 @@ void swapper_init(void) * our callers have already tried that route. */ -void thread_swapin(thread) - thread_t thread; +void thread_swapin(thread_t thread) { switch (thread->state & TH_SWAP_STATE) { case TH_SWAPPED: @@ -124,8 +123,7 @@ void thread_swapin(thread) * it on a run queue. No locks should be held on entry, as it is * likely that this routine will sleep (waiting for stack allocation). */ -void thread_doswapin(thread) - thread_t thread; +void thread_doswapin(thread_t thread) { spl_t s; diff --git a/kern/time_stamp.c b/kern/time_stamp.c index 7f4c0f6..ee141a0 100644 --- a/kern/time_stamp.c +++ b/kern/time_stamp.c @@ -33,8 +33,7 @@ * ts.c - kern_timestamp system call. */ kern_return_t -kern_timestamp(tsp) -struct tsval *tsp; +kern_timestamp(struct tsval *tsp) { /* temp.low_val = 0; diff --git a/kern/timer.c b/kern/timer.c index 47b834c..6d6517e 100644 --- a/kern/timer.c +++ b/kern/timer.c @@ -66,8 +66,7 @@ void init_timers(void) /* * timer_init initializes a single timer. */ -void timer_init(this_timer) -timer_t this_timer; +void timer_init(timer_t this_timer) { this_timer->low_bits = 0; this_timer->high_bits = 0; @@ -91,8 +90,7 @@ timer_t this_timer; * exactly once for each cpu during the boot sequence. */ void -start_timer(timer) -timer_t timer; +start_timer(timer_t timer) { timer->tstamp = get_timestamp(); current_timer[cpu_number()] = timer; @@ -105,8 +103,7 @@ timer_t timer; * from user mode. */ void -time_trap_uentry(ts) -unsigned ts; +time_trap_uentry(unsigned ts) { int elapsed; int mycpu; @@ -191,9 +188,9 @@ time_trap_uexit(int ts) * saved for time_int_exit. */ timer_t -time_int_entry(ts,new_timer) -unsigned ts; -timer_t new_timer; +time_int_entry( + unsigned ts, + timer_t new_timer) { int elapsed; int mycpu; @@ -232,9 +229,9 @@ timer_t new_timer; * it. */ void -time_int_exit(ts, old_timer) -unsigned ts; -timer_t old_timer; +time_int_exit( + unsigned ts, + timer_t old_timer) { int elapsed; int mycpu; @@ -279,8 +276,7 @@ timer_t old_timer; * Caller must lock out interrupts. */ void -timer_switch(new_timer) -timer_t new_timer; +timer_switch(timer_t new_timer) { int elapsed; int mycpu; @@ -325,8 +321,7 @@ timer_t new_timer; * timer_normalize normalizes the value of a timer. It is * called only rarely, to make sure low_bits never overflows. */ -void timer_normalize(timer) -timer_t timer; +void timer_normalize(timer_t timer) { unsigned int high_increment; @@ -352,9 +347,9 @@ timer_t timer; * Keep coherent with db_time_grab below. */ -static void timer_grab(timer, save) -timer_t timer; -timer_save_t save; +static void timer_grab( + timer_t timer, + timer_save_t save) { #if MACH_ASSERT unsigned int passes=0; @@ -386,9 +381,9 @@ timer_save_t save; * above. * */ -void db_timer_grab(timer, save) -timer_t timer; -timer_save_t save; +void db_timer_grab( + timer_t timer, + timer_save_t save) { /* Don't worry about coherency */ @@ -405,9 +400,9 @@ timer_save_t save; */ void -timer_read(timer, tv) -timer_t timer; -time_value_t *tv; +timer_read( + timer_t timer, + time_value_t *tv) { timer_save_data_t temp; @@ -431,10 +426,10 @@ time_value_t *tv; * * Needs to be kept coherent with thread_read_times ahead. */ -void thread_read_times(thread, user_time_p, system_time_p) - thread_t thread; - time_value_t *user_time_p; - time_value_t *system_time_p; +void thread_read_times( + thread_t thread, + time_value_t *user_time_p, + time_value_t *system_time_p) { timer_save_data_t temp; timer_t timer; @@ -465,10 +460,10 @@ void thread_read_times(thread, user_time_p, system_time_p) * thread_read_times above. * */ -void db_thread_read_times(thread, user_time_p, system_time_p) - thread_t thread; - time_value_t *user_time_p; - time_value_t *system_time_p; +void db_thread_read_times( + thread_t thread, + time_value_t *user_time_p, + time_value_t *system_time_p) { timer_save_data_t temp; timer_t timer; @@ -500,9 +495,9 @@ void db_thread_read_times(thread, user_time_p, system_time_p) */ unsigned -timer_delta(timer, save) -timer_t timer; -timer_save_t save; +timer_delta( + timer_t timer, + timer_save_t save) { timer_save_data_t new_save; unsigned result; @@ -56,9 +56,13 @@ struct xprbuf *xprptr; /* Currently allocated xprbuf */ struct xprbuf *xprlast; /* Pointer to end of circular buffer */ /*VARARGS1*/ -void xpr(msg, arg1, arg2, arg3, arg4, arg5) -char *msg; -int arg1, arg2, arg3, arg4, arg5; +void xpr( + char *msg, + int arg1, + int arg2, + int arg3, + int arg4, + int arg5) { spl_t s; struct xprbuf *x; @@ -144,9 +148,9 @@ extern jmp_buf_t *db_recover; * Called with arguments, it can dump xpr buffers in user tasks, * assuming they use the same format as the kernel. */ -void xpr_dump(base, nbufs) - struct xprbuf *base; - int nbufs; +void xpr_dump( + struct xprbuf *base, + int nbufs) { jmp_buf_t db_jmpbuf; jmp_buf_t *prev; diff --git a/vm/memory_object.c b/vm/memory_object.c index 024856d..097ed23 100644 --- a/vm/memory_object.c +++ b/vm/memory_object.c @@ -82,16 +82,15 @@ decl_simple_lock_data(,memory_manager_default_lock) * argument conversion. Explicit deallocation is necessary. */ -kern_return_t memory_object_data_supply(object, offset, data_copy, data_cnt, - lock_value, precious, reply_to, reply_to_type) - vm_object_t object; - vm_offset_t offset; - vm_map_copy_t data_copy; - unsigned int data_cnt; - vm_prot_t lock_value; - boolean_t precious; - ipc_port_t reply_to; - mach_msg_type_name_t reply_to_type; +kern_return_t memory_object_data_supply( + vm_object_t object, + vm_offset_t offset, + vm_map_copy_t data_copy, + unsigned int data_cnt, + vm_prot_t lock_value, + boolean_t precious, + ipc_port_t reply_to, + mach_msg_type_name_t reply_to_type) { kern_return_t result = KERN_SUCCESS; vm_offset_t error_offset = 0; @@ -303,29 +302,26 @@ retry_lookup: return(result); } - /* * If successful, destroys the map copy object. */ -kern_return_t memory_object_data_provided(object, offset, data, data_cnt, - lock_value) - vm_object_t object; - vm_offset_t offset; - pointer_t data; - unsigned int data_cnt; - vm_prot_t lock_value; +kern_return_t memory_object_data_provided( + vm_object_t object, + vm_offset_t offset, + pointer_t data, + unsigned int data_cnt, + vm_prot_t lock_value) { return memory_object_data_supply(object, offset, (vm_map_copy_t) data, data_cnt, lock_value, FALSE, IP_NULL, 0); } - -kern_return_t memory_object_data_error(object, offset, size, error_value) - vm_object_t object; - vm_offset_t offset; - vm_size_t size; - kern_return_t error_value; +kern_return_t memory_object_data_error( + vm_object_t object, + vm_offset_t offset, + vm_size_t size, + kern_return_t error_value) { if (object == VM_OBJECT_NULL) return(KERN_INVALID_ARGUMENT); @@ -361,10 +357,10 @@ kern_return_t memory_object_data_error(object, offset, size, error_value) return(KERN_SUCCESS); } -kern_return_t memory_object_data_unavailable(object, offset, size) - vm_object_t object; - vm_offset_t offset; - vm_size_t size; +kern_return_t memory_object_data_unavailable( + vm_object_t object, + vm_offset_t offset, + vm_size_t size) { #if MACH_PAGEMAP vm_external_t existence_info = VM_EXTERNAL_NULL; @@ -444,12 +440,11 @@ kern_return_t memory_object_data_unavailable(object, offset, size) #define MEMORY_OBJECT_LOCK_RESULT_MUST_CLEAN 2 #define MEMORY_OBJECT_LOCK_RESULT_MUST_RETURN 3 -memory_object_lock_result_t memory_object_lock_page(m, should_return, - should_flush, prot) - vm_page_t m; - memory_object_return_t should_return; - boolean_t should_flush; - vm_prot_t prot; +memory_object_lock_result_t memory_object_lock_page( + vm_page_t m, + memory_object_return_t should_return, + boolean_t should_flush, + vm_prot_t prot) { /* * Don't worry about pages for which the kernel @@ -647,17 +642,15 @@ memory_object_lock_result_t memory_object_lock_page(m, should_return, */ kern_return_t -memory_object_lock_request(object, offset, size, - should_return, should_flush, prot, - reply_to, reply_to_type) - vm_object_t object; - vm_offset_t offset; - vm_size_t size; - memory_object_return_t should_return; - boolean_t should_flush; - vm_prot_t prot; - ipc_port_t reply_to; - mach_msg_type_name_t reply_to_type; +memory_object_lock_request( + vm_object_t object, + vm_offset_t offset, + vm_size_t size, + memory_object_return_t should_return, + boolean_t should_flush, + vm_prot_t prot, + ipc_port_t reply_to, + mach_msg_type_name_t reply_to_type) { vm_page_t m; vm_offset_t original_offset = offset; @@ -883,13 +876,12 @@ MACRO_END } kern_return_t -memory_object_set_attributes_common(object, object_ready, may_cache, - copy_strategy, use_old_pageout) - vm_object_t object; - boolean_t object_ready; - boolean_t may_cache; - memory_object_copy_strategy_t copy_strategy; - boolean_t use_old_pageout; +memory_object_set_attributes_common( + vm_object_t object, + boolean_t object_ready, + boolean_t may_cache, + memory_object_copy_strategy_t copy_strategy, + boolean_t use_old_pageout) { if (object == VM_OBJECT_NULL) return(KERN_INVALID_ARGUMENT); @@ -950,13 +942,12 @@ memory_object_set_attributes_common(object, object_ready, may_cache, * XXX stub that made change_attributes an RPC. Need investigation. */ -kern_return_t memory_object_change_attributes(object, may_cache, - copy_strategy, reply_to, reply_to_type) - vm_object_t object; - boolean_t may_cache; - memory_object_copy_strategy_t copy_strategy; - ipc_port_t reply_to; - mach_msg_type_name_t reply_to_type; +kern_return_t memory_object_change_attributes( + vm_object_t object, + boolean_t may_cache, + memory_object_copy_strategy_t copy_strategy, + ipc_port_t reply_to, + mach_msg_type_name_t reply_to_type) { kern_return_t result; @@ -986,33 +977,32 @@ kern_return_t memory_object_change_attributes(object, may_cache, } kern_return_t -memory_object_set_attributes(object, object_ready, may_cache, copy_strategy) - vm_object_t object; - boolean_t object_ready; - boolean_t may_cache; - memory_object_copy_strategy_t copy_strategy; +memory_object_set_attributes( + vm_object_t object, + boolean_t object_ready, + boolean_t may_cache, + memory_object_copy_strategy_t copy_strategy) { return memory_object_set_attributes_common(object, object_ready, may_cache, copy_strategy, TRUE); } -kern_return_t memory_object_ready(object, may_cache, copy_strategy) - vm_object_t object; - boolean_t may_cache; - memory_object_copy_strategy_t copy_strategy; +kern_return_t memory_object_ready( + vm_object_t object, + boolean_t may_cache, + memory_object_copy_strategy_t copy_strategy) { return memory_object_set_attributes_common(object, TRUE, may_cache, copy_strategy, FALSE); } -kern_return_t memory_object_get_attributes(object, object_ready, - may_cache, copy_strategy) - vm_object_t object; - boolean_t *object_ready; - boolean_t *may_cache; - memory_object_copy_strategy_t *copy_strategy; +kern_return_t memory_object_get_attributes( + vm_object_t object, + boolean_t *object_ready, + boolean_t *may_cache, + memory_object_copy_strategy_t *copy_strategy) { if (object == VM_OBJECT_NULL) return(KERN_INVALID_ARGUMENT); diff --git a/vm/vm_debug.c b/vm/vm_debug.c index e4a4b8b..227090e 100644 --- a/vm/vm_debug.c +++ b/vm/vm_debug.c @@ -65,8 +65,7 @@ */ ipc_port_t -vm_object_real_name(object) - vm_object_t object; +vm_object_real_name(vm_object_t object) { ipc_port_t port = IP_NULL; @@ -94,11 +93,11 @@ vm_object_real_name(object) */ kern_return_t -mach_vm_region_info(map, address, regionp, portp) - vm_map_t map; - vm_offset_t address; - vm_region_info_t *regionp; - ipc_port_t *portp; +mach_vm_region_info( + vm_map_t map, + vm_offset_t address, + vm_region_info_t *regionp, + ipc_port_t *portp) { vm_map_t cmap; /* current map in traversal */ vm_map_t nmap; /* next map to look at */ @@ -184,11 +183,11 @@ mach_vm_region_info(map, address, regionp, portp) */ kern_return_t -mach_vm_object_info(object, infop, shadowp, copyp) - vm_object_t object; - vm_object_info_t *infop; - ipc_port_t *shadowp; - ipc_port_t *copyp; +mach_vm_object_info( + vm_object_t object, + vm_object_info_t *infop, + ipc_port_t *shadowp, + ipc_port_t *copyp) { vm_object_info_t info; vm_object_info_state_t state; @@ -278,10 +277,10 @@ mach_vm_object_info(object, infop, shadowp, copyp) */ kern_return_t -mach_vm_object_pages(object, pagesp, countp) - vm_object_t object; - vm_page_info_array_t *pagesp; - natural_t *countp; +mach_vm_object_pages( + vm_object_t object, + vm_page_info_array_t *pagesp, + natural_t *countp) { vm_size_t size; vm_offset_t addr; diff --git a/vm/vm_external.c b/vm/vm_external.c index 77bd44b..2e2593b 100644 --- a/vm/vm_external.c +++ b/vm/vm_external.c @@ -56,8 +56,7 @@ struct kmem_cache vm_object_small_existence_map_cache; struct kmem_cache vm_object_large_existence_map_cache; -vm_external_t vm_external_create(size) - vm_offset_t size; +vm_external_t vm_external_create(vm_offset_t size) { vm_external_t result; vm_size_t bytes; @@ -78,8 +77,7 @@ vm_external_t vm_external_create(size) return(result); } -void vm_external_destroy(e) - vm_external_t e; +void vm_external_destroy(vm_external_t e) { if (e == VM_EXTERNAL_NULL) return; @@ -115,10 +113,10 @@ vm_external_state_t _vm_external_state_get(e, offset) VM_EXTERNAL_STATE_EXISTS : VM_EXTERNAL_STATE_ABSENT ); } -void vm_external_state_set(e, offset, state) - vm_external_t e; - vm_offset_t offset; - vm_external_state_t state; +void vm_external_state_set( + vm_external_t e, + vm_offset_t offset, + vm_external_state_t state) { unsigned int bit, byte; diff --git a/vm/vm_fault.c b/vm/vm_fault.c index d9c3d7b..686156c 100644 --- a/vm/vm_fault.c +++ b/vm/vm_fault.c @@ -123,9 +123,9 @@ void vm_fault_init(void) * "object" must be locked. */ void -vm_fault_cleanup(object, top_page) - vm_object_t object; - vm_page_t top_page; +vm_fault_cleanup( + vm_object_t object, + vm_page_t top_page) { vm_object_paging_end(object); vm_object_unlock(object); @@ -202,27 +202,23 @@ vm_fault_cleanup(object, top_page) * The "result_page" is also left busy. It is not removed * from the pageout queues. */ -vm_fault_return_t vm_fault_page(first_object, first_offset, - fault_type, must_be_resident, interruptible, - protection, - result_page, top_page, - resume, continuation) +vm_fault_return_t vm_fault_page( /* Arguments: */ - vm_object_t first_object; /* Object to begin search */ - vm_offset_t first_offset; /* Offset into object */ - vm_prot_t fault_type; /* What access is requested */ - boolean_t must_be_resident;/* Must page be resident? */ - boolean_t interruptible; /* May fault be interrupted? */ + vm_object_t first_object, /* Object to begin search */ + vm_offset_t first_offset, /* Offset into object */ + vm_prot_t fault_type, /* What access is requested */ + boolean_t must_be_resident,/* Must page be resident? */ + boolean_t interruptible, /* May fault be interrupted? */ /* Modifies in place: */ - vm_prot_t *protection; /* Protection for mapping */ + vm_prot_t *protection, /* Protection for mapping */ /* Returns: */ - vm_page_t *result_page; /* Page found, if successful */ - vm_page_t *top_page; /* Page in top object, if + vm_page_t *result_page, /* Page found, if successful */ + vm_page_t *top_page, /* Page in top object, if * not result_page. */ /* More arguments: */ - boolean_t resume; /* We are restarting. */ - void (*continuation)(); /* Continuation for blocking. */ + boolean_t resume, /* We are restarting. */ + void (*continuation)()) /* Continuation for blocking. */ { vm_page_t m; vm_object_t object; @@ -1149,14 +1145,13 @@ vm_fault_continue(void) /*NOTREACHED*/ } -kern_return_t vm_fault(map, vaddr, fault_type, change_wiring, - resume, continuation) - vm_map_t map; - vm_offset_t vaddr; - vm_prot_t fault_type; - boolean_t change_wiring; - boolean_t resume; - void (*continuation)(); +kern_return_t vm_fault( + vm_map_t map, + vm_offset_t vaddr, + vm_prot_t fault_type, + boolean_t change_wiring, + boolean_t resume, + void (*continuation)()) { vm_map_version_t version; /* Map version for verificiation */ boolean_t wired; /* Should mapping be wired down? */ @@ -1500,9 +1495,9 @@ kern_return_t vm_fault(map, vaddr, fault_type, change_wiring, * * Wire down a range of virtual addresses in a map. */ -void vm_fault_wire(map, entry) - vm_map_t map; - vm_map_entry_t entry; +void vm_fault_wire( + vm_map_t map, + vm_map_entry_t entry) { vm_offset_t va; @@ -1536,9 +1531,9 @@ void vm_fault_wire(map, entry) * * Unwire a range of virtual addresses in a map. */ -void vm_fault_unwire(map, entry) - vm_map_t map; - vm_map_entry_t entry; +void vm_fault_unwire( + vm_map_t map, + vm_map_entry_t entry) { vm_offset_t va; pmap_t pmap; @@ -1625,10 +1620,10 @@ void vm_fault_unwire(map, entry) * other than the common case will return KERN_FAILURE, and the caller * is expected to call vm_fault(). */ -kern_return_t vm_fault_wire_fast(map, va, entry) - vm_map_t map; - vm_offset_t va; - vm_map_entry_t entry; +kern_return_t vm_fault_wire_fast( + vm_map_t map, + vm_offset_t va, + vm_map_entry_t entry) { vm_object_t object; vm_offset_t offset; @@ -1774,9 +1769,9 @@ kern_return_t vm_fault_wire_fast(map, va, entry) * Release a page used by vm_fault_copy. */ -void vm_fault_copy_cleanup(page, top_page) - vm_page_t page; - vm_page_t top_page; +void vm_fault_copy_cleanup( + vm_page_t page, + vm_page_t top_page) { vm_object_t object = page->object; @@ -1817,23 +1812,14 @@ void vm_fault_copy_cleanup(page, top_page) * requested. */ kern_return_t vm_fault_copy( - src_object, - src_offset, - src_size, - dst_object, - dst_offset, - dst_map, - dst_version, - interruptible - ) - vm_object_t src_object; - vm_offset_t src_offset; - vm_size_t *src_size; /* INOUT */ - vm_object_t dst_object; - vm_offset_t dst_offset; - vm_map_t dst_map; - vm_map_version_t *dst_version; - boolean_t interruptible; + vm_object_t src_object, + vm_offset_t src_offset, + vm_size_t *src_size, /* INOUT */ + vm_object_t dst_object, + vm_offset_t dst_offset, + vm_map_t dst_map, + vm_map_version_t *dst_version, + boolean_t interruptible) { vm_page_t result_page; vm_prot_t prot; @@ -2014,10 +2000,10 @@ kern_return_t vm_fault_copy( * XXX Untested. Also unused. Eventually, this technology * could be used in vm_fault_copy() to advantage. */ -vm_fault_return_t vm_fault_page_overwrite(dst_object, dst_offset, result_page) - vm_object_t dst_object; - vm_offset_t dst_offset; - vm_page_t *result_page; /* OUT */ +vm_fault_return_t vm_fault_page_overwrite( + vm_object_t dst_object, + vm_offset_t dst_offset, + vm_page_t *result_page) /* OUT */ { vm_page_t dst_page; diff --git a/vm/vm_kern.c b/vm/vm_kern.c index 3eaf0a8..b997cb5 100644 --- a/vm/vm_kern.c +++ b/vm/vm_kern.c @@ -80,15 +80,14 @@ vm_map_t kernel_pageable_map; */ kern_return_t -projected_buffer_allocate(map, size, persistence, kernel_p, - user_p, protection, inheritance) - vm_map_t map; - vm_size_t size; - int persistence; - vm_offset_t *kernel_p; - vm_offset_t *user_p; - vm_prot_t protection; - vm_inherit_t inheritance; /*Currently only VM_INHERIT_NONE supported*/ +projected_buffer_allocate( + vm_map_t map, + vm_size_t size, + int persistence, + vm_offset_t *kernel_p, + vm_offset_t *user_p, + vm_prot_t protection, + vm_inherit_t inheritance) /*Currently only VM_INHERIT_NONE supported*/ { vm_object_t object; vm_map_entry_t u_entry, k_entry; @@ -178,13 +177,13 @@ projected_buffer_allocate(map, size, persistence, kernel_p, */ kern_return_t -projected_buffer_map(map, kernel_addr, size, user_p, protection, inheritance) - vm_map_t map; - vm_offset_t kernel_addr; - vm_size_t size; - vm_offset_t *user_p; - vm_prot_t protection; - vm_inherit_t inheritance; /*Currently only VM_INHERIT_NONE supported*/ +projected_buffer_map( + vm_map_t map, + vm_offset_t kernel_addr, + vm_size_t size, + vm_offset_t *user_p, + vm_prot_t protection, + vm_inherit_t inheritance) /*Currently only VM_INHERIT_NONE supported*/ { vm_map_entry_t u_entry, k_entry; vm_offset_t physical_addr, user_addr; @@ -251,9 +250,10 @@ projected_buffer_map(map, kernel_addr, size, user_p, protection, inheritance) */ kern_return_t -projected_buffer_deallocate(map, start, end) - vm_map_t map; - vm_offset_t start, end; +projected_buffer_deallocate( + vm_map_t map, + vm_offset_t start, + vm_offset_t end) { vm_map_entry_t entry, k_entry; @@ -303,8 +303,7 @@ projected_buffer_deallocate(map, start, end) */ kern_return_t -projected_buffer_collect(map) - vm_map_t map; +projected_buffer_collect(vm_map_t map) { vm_map_entry_t entry, next; @@ -330,9 +329,10 @@ projected_buffer_collect(map) */ boolean_t -projected_buffer_in_range(map, start, end) - vm_map_t map; - vm_offset_t start, end; +projected_buffer_in_range( + vm_map_t map, + vm_offset_t start, + vm_offset_t end) { vm_map_entry_t entry; @@ -359,10 +359,10 @@ projected_buffer_in_range(map, start, end) */ kern_return_t -kmem_alloc(map, addrp, size) - vm_map_t map; - vm_offset_t *addrp; - vm_size_t size; +kmem_alloc( + vm_map_t map, + vm_offset_t *addrp, + vm_size_t size) { vm_object_t object; vm_map_entry_t entry; @@ -440,12 +440,12 @@ retry: * If successful, the pages in the old region are mapped twice. * The old region is unchanged. Use kmem_free to get rid of it. */ -kern_return_t kmem_realloc(map, oldaddr, oldsize, newaddrp, newsize) - vm_map_t map; - vm_offset_t oldaddr; - vm_size_t oldsize; - vm_offset_t *newaddrp; - vm_size_t newsize; +kern_return_t kmem_realloc( + vm_map_t map, + vm_offset_t oldaddr, + vm_size_t oldsize, + vm_offset_t *newaddrp, + vm_size_t newsize) { vm_offset_t oldmin, oldmax; vm_offset_t newaddr; @@ -541,10 +541,10 @@ retry: */ kern_return_t -kmem_alloc_wired(map, addrp, size) - vm_map_t map; - vm_offset_t *addrp; - vm_size_t size; +kmem_alloc_wired( + vm_map_t map, + vm_offset_t *addrp, + vm_size_t size) { vm_map_entry_t entry; vm_offset_t offset; @@ -624,10 +624,10 @@ retry: */ kern_return_t -kmem_alloc_aligned(map, addrp, size) - vm_map_t map; - vm_offset_t *addrp; - vm_size_t size; +kmem_alloc_aligned( + vm_map_t map, + vm_offset_t *addrp, + vm_size_t size) { vm_map_entry_t entry; vm_offset_t offset; @@ -709,10 +709,10 @@ retry: */ kern_return_t -kmem_alloc_pageable(map, addrp, size) - vm_map_t map; - vm_offset_t *addrp; - vm_size_t size; +kmem_alloc_pageable( + vm_map_t map, + vm_offset_t *addrp, + vm_size_t size) { vm_offset_t addr; kern_return_t kr; @@ -740,10 +740,10 @@ kmem_alloc_pageable(map, addrp, size) */ void -kmem_free(map, addr, size) - vm_map_t map; - vm_offset_t addr; - vm_size_t size; +kmem_free( + vm_map_t map, + vm_offset_t addr, + vm_size_t size) { kern_return_t kr; @@ -758,11 +758,12 @@ kmem_free(map, addr, size) * a submap. */ void -kmem_alloc_pages(object, offset, start, end, protection) - vm_object_t object; - vm_offset_t offset; - vm_offset_t start, end; - vm_prot_t protection; +kmem_alloc_pages( + vm_object_t object, + vm_offset_t offset, + vm_offset_t start, + vm_offset_t end, + vm_prot_t protection) { /* * Mark the pmap region as not pageable. @@ -813,11 +814,12 @@ kmem_alloc_pages(object, offset, start, end, protection) * a submap. */ void -kmem_remap_pages(object, offset, start, end, protection) - vm_object_t object; - vm_offset_t offset; - vm_offset_t start, end; - vm_prot_t protection; +kmem_remap_pages( + vm_object_t object, + vm_offset_t offset, + vm_offset_t start, + vm_offset_t end, + vm_prot_t protection) { /* * Mark the pmap region as not pageable. @@ -871,11 +873,13 @@ kmem_remap_pages(object, offset, start, end, protection) */ void -kmem_submap(map, parent, min, max, size, pageable) - vm_map_t map, parent; - vm_offset_t *min, *max; - vm_size_t size; - boolean_t pageable; +kmem_submap( + vm_map_t map, + vm_map_t parent, + vm_offset_t *min, + vm_offset_t *max, + vm_size_t size, + boolean_t pageable) { vm_offset_t addr; kern_return_t kr; @@ -913,9 +917,9 @@ kmem_submap(map, parent, min, max, size, pageable) * Initialize the kernel's virtual memory map, taking * into account all memory allocated up to this time. */ -void kmem_init(start, end) - vm_offset_t start; - vm_offset_t end; +void kmem_init( + vm_offset_t start, + vm_offset_t end) { vm_map_setup(kernel_map, pmap_kernel(), VM_MIN_KERNEL_ADDRESS, end, FALSE); @@ -951,13 +955,13 @@ void kmem_init(start, end) */ kern_return_t -kmem_io_map_copyout(map, addr, alloc_addr, alloc_size, copy, min_size) - vm_map_t map; - vm_offset_t *addr; /* actual addr of data */ - vm_offset_t *alloc_addr; /* page aligned addr */ - vm_size_t *alloc_size; /* size allocated */ - vm_map_copy_t copy; - vm_size_t min_size; /* Do at least this much */ +kmem_io_map_copyout( + vm_map_t map, + vm_offset_t *addr, /* actual addr of data */ + vm_offset_t *alloc_addr, /* page aligned addr */ + vm_size_t *alloc_size, /* size allocated */ + vm_map_copy_t copy, + vm_size_t min_size) /* Do at least this much */ { vm_offset_t myaddr, offset; vm_size_t mysize, copy_size; @@ -1055,10 +1059,10 @@ kmem_io_map_copyout(map, addr, alloc_addr, alloc_size, copy, min_size) */ void -kmem_io_map_deallocate(map, addr, size) - vm_map_t map; - vm_offset_t addr; - vm_size_t size; +kmem_io_map_deallocate( + vm_map_t map, + vm_offset_t addr, + vm_size_t size) { /* * Remove the mappings. The pmap_remove is needed. @@ -1077,10 +1081,11 @@ kmem_io_map_deallocate(map, addr, size) * and the kernel map/submaps. */ -int copyinmap(map, fromaddr, toaddr, length) - vm_map_t map; - char *fromaddr, *toaddr; - int length; +int copyinmap( + vm_map_t map, + char *fromaddr, + char *toaddr, + int length) { if (vm_map_pmap(map) == kernel_pmap) { /* assume a correct copy */ @@ -1103,10 +1108,11 @@ int copyinmap(map, fromaddr, toaddr, length) * and the kernel map/submaps. */ -int copyoutmap(map, fromaddr, toaddr, length) - vm_map_t map; - char *fromaddr, *toaddr; - int length; +int copyoutmap( + vm_map_t map, + char *fromaddr, + char *toaddr, + int length) { if (vm_map_pmap(map) == kernel_pmap) { /* assume a correct copy */ diff --git a/vm/vm_map.c b/vm/vm_map.c index e6eabdb..6b13724 100644 --- a/vm/vm_map.c +++ b/vm/vm_map.c @@ -194,11 +194,12 @@ void vm_map_init(void) */ } -void vm_map_setup(map, pmap, min, max, pageable) - vm_map_t map; - pmap_t pmap; - vm_offset_t min, max; - boolean_t pageable; +void vm_map_setup( + vm_map_t map, + pmap_t pmap, + vm_offset_t min, + vm_offset_t max, + boolean_t pageable) { vm_map_first_entry(map) = vm_map_to_entry(map); vm_map_last_entry(map) = vm_map_to_entry(map); @@ -227,10 +228,11 @@ void vm_map_setup(map, pmap, min, max, pageable) * the given physical map structure, and having * the given lower and upper address bounds. */ -vm_map_t vm_map_create(pmap, min, max, pageable) - pmap_t pmap; - vm_offset_t min, max; - boolean_t pageable; +vm_map_t vm_map_create( + pmap_t pmap, + vm_offset_t min, + vm_offset_t max, + boolean_t pageable) { vm_map_t result; @@ -370,8 +372,7 @@ static inline int vm_map_entry_cmp_insert(const struct rbtree_node *a, * Creates another valid reference to the given map. * */ -void vm_map_reference(map) - vm_map_t map; +void vm_map_reference(vm_map_t map) { if (map == VM_MAP_NULL) return; @@ -388,8 +389,7 @@ void vm_map_reference(map) * destroying it if no references remain. * The map should not be locked. */ -void vm_map_deallocate(map) - vm_map_t map; +void vm_map_deallocate(vm_map_t map) { int c; @@ -433,10 +433,10 @@ void vm_map_deallocate(map) * result indicates whether the address is * actually contained in the map. */ -boolean_t vm_map_lookup_entry(map, address, entry) - vm_map_t map; - vm_offset_t address; - vm_map_entry_t *entry; /* OUT */ +boolean_t vm_map_lookup_entry( + vm_map_t map, + vm_offset_t address, + vm_map_entry_t *entry) /* OUT */ { struct rbtree_node *node; vm_map_entry_t hint; @@ -490,10 +490,11 @@ boolean_t vm_map_lookup_entry(map, address, entry) */ boolean_t -invalid_user_access(map, start, end, prot) - vm_map_t map; - vm_offset_t start, end; - vm_prot_t prot; +invalid_user_access( + vm_map_t map, + vm_offset_t start, + vm_offset_t end, + vm_prot_t prot) { vm_map_entry_t entry; @@ -517,13 +518,13 @@ invalid_user_access(map, start, end, prot) * are initialized to zero. If an object is supplied, * then an existing entry may be extended. */ -kern_return_t vm_map_find_entry(map, address, size, mask, object, o_entry) - vm_map_t map; - vm_offset_t *address; /* OUT */ - vm_size_t size; - vm_offset_t mask; - vm_object_t object; - vm_map_entry_t *o_entry; /* OUT */ +kern_return_t vm_map_find_entry( + vm_map_t map, + vm_offset_t *address, /* OUT */ + vm_size_t size, + vm_offset_t mask, + vm_object_t object, + vm_map_entry_t *o_entry) /* OUT */ { vm_map_entry_t entry, new_entry; vm_offset_t start; @@ -689,13 +690,13 @@ boolean_t vm_map_pmap_enter_enable = FALSE; * The source map should not be locked on entry. */ void -vm_map_pmap_enter(map, addr, end_addr, object, offset, protection) - vm_map_t map; - vm_offset_t addr; - vm_offset_t end_addr; - vm_object_t object; - vm_offset_t offset; - vm_prot_t protection; +vm_map_pmap_enter( + vm_map_t map, + vm_offset_t addr, + vm_offset_t end_addr, + vm_object_t object, + vm_offset_t offset, + vm_prot_t protection) { while (addr < end_addr) { vm_page_t m; @@ -747,21 +748,17 @@ vm_map_pmap_enter(map, addr, end_addr, object, offset, protection) * Arguments are as defined in the vm_map call. */ kern_return_t vm_map_enter( - map, - address, size, mask, anywhere, - object, offset, needs_copy, - cur_protection, max_protection, inheritance) - vm_map_t map; - vm_offset_t *address; /* IN/OUT */ - vm_size_t size; - vm_offset_t mask; - boolean_t anywhere; - vm_object_t object; - vm_offset_t offset; - boolean_t needs_copy; - vm_prot_t cur_protection; - vm_prot_t max_protection; - vm_inherit_t inheritance; + vm_map_t map, + vm_offset_t *address, /* IN/OUT */ + vm_size_t size, + vm_offset_t mask, + boolean_t anywhere, + vm_object_t object, + vm_offset_t offset, + boolean_t needs_copy, + vm_prot_t cur_protection, + vm_prot_t max_protection, + vm_inherit_t inheritance) { vm_map_entry_t entry; vm_offset_t start; @@ -1047,10 +1044,10 @@ kern_return_t vm_map_enter( * This routine is called only when it is known that * the entry must be split. */ -void _vm_map_clip_start(map_header, entry, start) - struct vm_map_header *map_header; - vm_map_entry_t entry; - vm_offset_t start; +void _vm_map_clip_start( + struct vm_map_header *map_header, + vm_map_entry_t entry, + vm_offset_t start) { vm_map_entry_t new_entry; @@ -1100,10 +1097,10 @@ void _vm_map_clip_start(map_header, entry, start) * This routine is called only when it is known that * the entry must be split. */ -void _vm_map_clip_end(map_header, entry, end) - struct vm_map_header *map_header; - vm_map_entry_t entry; - vm_offset_t end; +void _vm_map_clip_end( + struct vm_map_header *map_header, + vm_map_entry_t entry, + vm_offset_t end) { vm_map_entry_t new_entry; @@ -1160,11 +1157,11 @@ void _vm_map_clip_end(map_header, entry, end) * range from the superior map, and then destroy the * submap (if desired). [Better yet, don't try it.] */ -kern_return_t vm_map_submap(map, start, end, submap) - vm_map_t map; - vm_offset_t start; - vm_offset_t end; - vm_map_t submap; +kern_return_t vm_map_submap( + vm_map_t map, + vm_offset_t start, + vm_offset_t end, + vm_map_t submap) { vm_map_entry_t entry; kern_return_t result = KERN_INVALID_ARGUMENT; @@ -1208,12 +1205,12 @@ kern_return_t vm_map_submap(map, start, end, submap) * specified, the maximum protection is to be set; * otherwise, only the current protection is affected. */ -kern_return_t vm_map_protect(map, start, end, new_prot, set_max) - vm_map_t map; - vm_offset_t start; - vm_offset_t end; - vm_prot_t new_prot; - boolean_t set_max; +kern_return_t vm_map_protect( + vm_map_t map, + vm_offset_t start, + vm_offset_t end, + vm_prot_t new_prot, + boolean_t set_max) { vm_map_entry_t current; vm_map_entry_t entry; @@ -1296,11 +1293,11 @@ kern_return_t vm_map_protect(map, start, end, new_prot, set_max) * affects how the map will be shared with * child maps at the time of vm_map_fork. */ -kern_return_t vm_map_inherit(map, start, end, new_inheritance) - vm_map_t map; - vm_offset_t start; - vm_offset_t end; - vm_inherit_t new_inheritance; +kern_return_t vm_map_inherit( + vm_map_t map, + vm_offset_t start, + vm_offset_t end, + vm_inherit_t new_inheritance) { vm_map_entry_t entry; vm_map_entry_t temp_entry; @@ -1345,12 +1342,12 @@ kern_return_t vm_map_inherit(map, start, end, new_inheritance) * Callers should use macros in vm/vm_map.h (i.e. vm_map_pageable, * or vm_map_pageable_user); don't call vm_map_pageable directly. */ -kern_return_t vm_map_pageable_common(map, start, end, access_type, user_wire) - vm_map_t map; - vm_offset_t start; - vm_offset_t end; - vm_prot_t access_type; - boolean_t user_wire; +kern_return_t vm_map_pageable_common( + vm_map_t map, + vm_offset_t start, + vm_offset_t end, + vm_prot_t access_type, + boolean_t user_wire) { vm_map_entry_t entry; vm_map_entry_t start_entry; @@ -1594,9 +1591,9 @@ kern_return_t vm_map_pageable_common(map, start, end, access_type, user_wire) * * Deallocate the given entry from the target map. */ -void vm_map_entry_delete(map, entry) - vm_map_t map; - vm_map_entry_t entry; +void vm_map_entry_delete( + vm_map_t map, + vm_map_entry_t entry) { vm_offset_t s, e; vm_object_t object; @@ -1678,10 +1675,10 @@ void vm_map_entry_delete(map, entry) * map. */ -kern_return_t vm_map_delete(map, start, end) - vm_map_t map; - vm_offset_t start; - vm_offset_t end; +kern_return_t vm_map_delete( + vm_map_t map, + vm_offset_t start, + vm_offset_t end) { vm_map_entry_t entry; vm_map_entry_t first_entry; @@ -1761,10 +1758,10 @@ kern_return_t vm_map_delete(map, start, end) * Remove the given address range from the target map. * This is the exported form of vm_map_delete. */ -kern_return_t vm_map_remove(map, start, end) - vm_map_t map; - vm_offset_t start; - vm_offset_t end; +kern_return_t vm_map_remove( + vm_map_t map, + vm_offset_t start, + vm_offset_t end) { kern_return_t result; @@ -1784,8 +1781,7 @@ kern_return_t vm_map_remove(map, start, end) * that have not already been stolen. */ void -vm_map_copy_steal_pages(copy) -vm_map_copy_t copy; +vm_map_copy_steal_pages(vm_map_copy_t copy) { vm_page_t m, new_m; int i; @@ -1831,8 +1827,7 @@ vm_map_copy_t copy; * stolen, they are freed. If the pages are not stolen, they * are unbusied, and associated state is cleaned up. */ -void vm_map_copy_page_discard(copy) -vm_map_copy_t copy; +void vm_map_copy_page_discard(vm_map_copy_t copy) { while (copy->cpy_npages > 0) { vm_page_t m; @@ -1877,8 +1872,7 @@ vm_map_copy_t copy; * vm_map_copyin). */ void -vm_map_copy_discard(copy) - vm_map_copy_t copy; +vm_map_copy_discard(vm_map_copy_t copy) { free_next_copy: if (copy == VM_MAP_COPY_NULL) @@ -1954,8 +1948,7 @@ free_next_copy: * deallocation will not fail. */ vm_map_copy_t -vm_map_copy_copy(copy) - vm_map_copy_t copy; +vm_map_copy_copy(vm_map_copy_t copy) { vm_map_copy_t new_copy; @@ -2001,9 +1994,9 @@ vm_map_copy_copy(copy) * A version of vm_map_copy_discard that can be called * as a continuation from a vm_map_copy page list. */ -kern_return_t vm_map_copy_discard_cont(cont_args, copy_result) -vm_map_copyin_args_t cont_args; -vm_map_copy_t *copy_result; /* OUT */ +kern_return_t vm_map_copy_discard_cont( +vm_map_copyin_args_t cont_args, +vm_map_copy_t *copy_result) /* OUT */ { vm_map_copy_discard((vm_map_copy_t) cont_args); if (copy_result != (vm_map_copy_t *)0) @@ -2058,11 +2051,11 @@ vm_map_copy_t *copy_result; /* OUT */ * atomically and interruptibly, an error indication is * returned. */ -kern_return_t vm_map_copy_overwrite(dst_map, dst_addr, copy, interruptible) - vm_map_t dst_map; - vm_offset_t dst_addr; - vm_map_copy_t copy; - boolean_t interruptible; +kern_return_t vm_map_copy_overwrite( + vm_map_t dst_map, + vm_offset_t dst_addr, + vm_map_copy_t copy, + boolean_t interruptible) { vm_size_t size; vm_offset_t start; @@ -2435,10 +2428,10 @@ start_pass_1: * If successful, consumes the copy object. * Otherwise, the caller is responsible for it. */ -kern_return_t vm_map_copyout(dst_map, dst_addr, copy) - vm_map_t dst_map; - vm_offset_t *dst_addr; /* OUT */ - vm_map_copy_t copy; +kern_return_t vm_map_copyout( + vm_map_t dst_map, + vm_offset_t *dst_addr, /* OUT */ + vm_map_copy_t copy) { vm_size_t size; vm_size_t adjustment; @@ -2689,10 +2682,10 @@ kern_return_t vm_map_copyout(dst_map, dst_addr, copy) * Version of vm_map_copyout() for page list vm map copies. * */ -kern_return_t vm_map_copyout_page_list(dst_map, dst_addr, copy) - vm_map_t dst_map; - vm_offset_t *dst_addr; /* OUT */ - vm_map_copy_t copy; +kern_return_t vm_map_copyout_page_list( + vm_map_t dst_map, + vm_offset_t *dst_addr, /* OUT */ + vm_map_copy_t copy) { vm_size_t size; vm_offset_t start; @@ -3076,12 +3069,12 @@ error: * In/out conditions: * The source map should not be locked on entry. */ -kern_return_t vm_map_copyin(src_map, src_addr, len, src_destroy, copy_result) - vm_map_t src_map; - vm_offset_t src_addr; - vm_size_t len; - boolean_t src_destroy; - vm_map_copy_t *copy_result; /* OUT */ +kern_return_t vm_map_copyin( + vm_map_t src_map, + vm_offset_t src_addr, + vm_size_t len, + boolean_t src_destroy, + vm_map_copy_t *copy_result) /* OUT */ { vm_map_entry_t tmp_entry; /* Result of last map lookup -- * in multi-level lookup, this @@ -3438,11 +3431,11 @@ kern_return_t vm_map_copyin(src_map, src_addr, len, src_destroy, copy_result) * Our caller donates an object reference. */ -kern_return_t vm_map_copyin_object(object, offset, size, copy_result) - vm_object_t object; - vm_offset_t offset; /* offset of region in object */ - vm_size_t size; /* size of region in object */ - vm_map_copy_t *copy_result; /* OUT */ +kern_return_t vm_map_copyin_object( + vm_object_t object, + vm_offset_t offset, /* offset of region in object */ + vm_size_t size, /* size of region in object */ + vm_map_copy_t *copy_result) /* OUT */ { vm_map_copy_t copy; /* Resulting copy */ @@ -3483,9 +3476,9 @@ kern_return_t vm_map_copyin_object(object, offset, size, copy_result) * the scheduler. */ -kern_return_t vm_map_copyin_page_list_cont(cont_args, copy_result) -vm_map_copyin_args_t cont_args; -vm_map_copy_t *copy_result; /* OUT */ +kern_return_t vm_map_copyin_page_list_cont( + vm_map_copyin_args_t cont_args, + vm_map_copy_t *copy_result) /* OUT */ { kern_return_t result = 0; /* '=0' to quiet gcc warnings */ boolean_t do_abort, src_destroy, src_destroy_only; @@ -3539,15 +3532,14 @@ vm_map_copy_t *copy_result; /* OUT */ * the recipient of this copy_result must be prepared to deal with it. */ -kern_return_t vm_map_copyin_page_list(src_map, src_addr, len, src_destroy, - steal_pages, copy_result, is_cont) - vm_map_t src_map; - vm_offset_t src_addr; - vm_size_t len; - boolean_t src_destroy; - boolean_t steal_pages; - vm_map_copy_t *copy_result; /* OUT */ - boolean_t is_cont; +kern_return_t vm_map_copyin_page_list( + vm_map_t src_map, + vm_offset_t src_addr, + vm_size_t len, + boolean_t src_destroy, + boolean_t steal_pages, + vm_map_copy_t *copy_result, /* OUT */ + boolean_t is_cont) { vm_map_entry_t src_entry; vm_page_t m; @@ -4067,8 +4059,7 @@ error: * * The source map must not be locked. */ -vm_map_t vm_map_fork(old_map) - vm_map_t old_map; +vm_map_t vm_map_fork(vm_map_t old_map) { vm_map_t new_map; vm_map_entry_t old_entry; @@ -4338,17 +4329,16 @@ vm_map_t vm_map_fork(old_map) * copying operations, although the data referenced will * remain the same. */ -kern_return_t vm_map_lookup(var_map, vaddr, fault_type, out_version, - object, offset, out_prot, wired) - vm_map_t *var_map; /* IN/OUT */ - vm_offset_t vaddr; - vm_prot_t fault_type; - - vm_map_version_t *out_version; /* OUT */ - vm_object_t *object; /* OUT */ - vm_offset_t *offset; /* OUT */ - vm_prot_t *out_prot; /* OUT */ - boolean_t *wired; /* OUT */ +kern_return_t vm_map_lookup( + vm_map_t *var_map, /* IN/OUT */ + vm_offset_t vaddr, + vm_prot_t fault_type, + + vm_map_version_t *out_version, /* OUT */ + vm_object_t *object, /* OUT */ + vm_offset_t *offset, /* OUT */ + vm_prot_t *out_prot, /* OUT */ + boolean_t *wired) /* OUT */ { vm_map_entry_t entry; vm_map_t map = *var_map; @@ -4520,9 +4510,9 @@ kern_return_t vm_map_lookup(var_map, vaddr, fault_type, out_version, * since the given version. If successful, the map * will not change until vm_map_verify_done() is called. */ -boolean_t vm_map_verify(map, version) - vm_map_t map; - vm_map_version_t *version; /* REF */ +boolean_t vm_map_verify( + vm_map_t map, + vm_map_version_t *version) /* REF */ { boolean_t result; @@ -4551,19 +4541,16 @@ boolean_t vm_map_verify(map, version) * a task's address map. */ -kern_return_t vm_region(map, address, size, - protection, max_protection, - inheritance, is_shared, - object_name, offset_in_object) - vm_map_t map; - vm_offset_t *address; /* IN/OUT */ - vm_size_t *size; /* OUT */ - vm_prot_t *protection; /* OUT */ - vm_prot_t *max_protection; /* OUT */ - vm_inherit_t *inheritance; /* OUT */ - boolean_t *is_shared; /* OUT */ - ipc_port_t *object_name; /* OUT */ - vm_offset_t *offset_in_object; /* OUT */ +kern_return_t vm_region( + vm_map_t map, + vm_offset_t *address, /* IN/OUT */ + vm_size_t *size, /* OUT */ + vm_prot_t *protection, /* OUT */ + vm_prot_t *max_protection, /* OUT */ + vm_inherit_t *inheritance, /* OUT */ + boolean_t *is_shared, /* OUT */ + ipc_port_t *object_name, /* OUT */ + vm_offset_t *offset_in_object) /* OUT */ { vm_map_entry_t tmp_entry; vm_map_entry_t entry; @@ -4623,9 +4610,9 @@ kern_return_t vm_region(map, address, size, * at allocation time because the adjacent entry * is often wired down. */ -void vm_map_simplify(map, start) - vm_map_t map; - vm_offset_t start; +void vm_map_simplify( + vm_map_t map, + vm_offset_t start) { vm_map_entry_t this_entry; vm_map_entry_t prev_entry; @@ -4684,12 +4671,12 @@ void vm_map_simplify(map, start) * it itself. [This assumes that attributes do not * need to be inherited, which seems ok to me] */ -kern_return_t vm_map_machine_attribute(map, address, size, attribute, value) - vm_map_t map; - vm_offset_t address; - vm_size_t size; - vm_machine_attribute_t attribute; - vm_machine_attribute_val_t* value; /* IN/OUT */ +kern_return_t vm_map_machine_attribute( + vm_map_t map, + vm_offset_t address, + vm_size_t size, + vm_machine_attribute_t attribute, + vm_machine_attribute_val_t* value) /* IN/OUT */ { kern_return_t ret; @@ -4714,8 +4701,7 @@ kern_return_t vm_map_machine_attribute(map, address, size, attribute, value) /* * vm_map_print: [ debug ] */ -void vm_map_print(map) - vm_map_t map; +void vm_map_print(vm_map_t map) { vm_map_entry_t entry; diff --git a/vm/vm_pageout.c b/vm/vm_pageout.c index f4f1fef..7ac43d6 100644 --- a/vm/vm_pageout.c +++ b/vm/vm_pageout.c @@ -226,12 +226,12 @@ unsigned int vm_pageout_inactive_cleaned_external = 0; * not busy on exit. */ vm_page_t -vm_pageout_setup(m, paging_offset, new_object, new_offset, flush) - vm_page_t m; - vm_offset_t paging_offset; - vm_object_t new_object; - vm_offset_t new_offset; - boolean_t flush; +vm_pageout_setup( + vm_page_t m, + vm_offset_t paging_offset, + vm_object_t new_object, + vm_offset_t new_offset, + boolean_t flush) { vm_object_t old_object = m->object; vm_page_t holding_page = 0; /*'=0'to quiet gcc warnings*/ @@ -413,10 +413,10 @@ vm_pageout_setup(m, paging_offset, new_object, new_offset, flush) * copy to a new page in a new object, if not. */ void -vm_pageout_page(m, initial, flush) - vm_page_t m; - boolean_t initial; - boolean_t flush; +vm_pageout_page( + vm_page_t m, + boolean_t initial, + boolean_t flush) { vm_map_copy_t copy; vm_object_t old_object; diff --git a/vm/vm_user.c b/vm/vm_user.c index 9ba5e1c..f7c87cc 100644 --- a/vm/vm_user.c +++ b/vm/vm_user.c @@ -56,11 +56,11 @@ vm_statistics_data_t vm_stat; * vm_allocate allocates "zero fill" memory in the specfied * map. */ -kern_return_t vm_allocate(map, addr, size, anywhere) - vm_map_t map; - vm_offset_t *addr; - vm_size_t size; - boolean_t anywhere; +kern_return_t vm_allocate( + vm_map_t map, + vm_offset_t *addr, + vm_size_t size, + boolean_t anywhere) { kern_return_t result; @@ -97,10 +97,10 @@ kern_return_t vm_allocate(map, addr, size, anywhere) * vm_deallocate deallocates the specified range of addresses in the * specified address map. */ -kern_return_t vm_deallocate(map, start, size) - vm_map_t map; - vm_offset_t start; - vm_size_t size; +kern_return_t vm_deallocate( + vm_map_t map, + vm_offset_t start, + vm_size_t size) { if (map == VM_MAP_NULL) return(KERN_INVALID_ARGUMENT); @@ -115,11 +115,11 @@ kern_return_t vm_deallocate(map, start, size) * vm_inherit sets the inheritance of the specified range in the * specified map. */ -kern_return_t vm_inherit(map, start, size, new_inheritance) - vm_map_t map; - vm_offset_t start; - vm_size_t size; - vm_inherit_t new_inheritance; +kern_return_t vm_inherit( + vm_map_t map, + vm_offset_t start, + vm_size_t size, + vm_inherit_t new_inheritance) { if (map == VM_MAP_NULL) return(KERN_INVALID_ARGUMENT); @@ -149,12 +149,12 @@ kern_return_t vm_inherit(map, start, size, new_inheritance) * specified map. */ -kern_return_t vm_protect(map, start, size, set_maximum, new_protection) - vm_map_t map; - vm_offset_t start; - vm_size_t size; - boolean_t set_maximum; - vm_prot_t new_protection; +kern_return_t vm_protect( + vm_map_t map, + vm_offset_t start, + vm_size_t size, + boolean_t set_maximum, + vm_prot_t new_protection) { if ((map == VM_MAP_NULL) || (new_protection & ~(VM_PROT_ALL|VM_PROT_NOTIFY))) @@ -172,9 +172,9 @@ kern_return_t vm_protect(map, start, size, set_maximum, new_protection) set_maximum)); } -kern_return_t vm_statistics(map, stat) - vm_map_t map; - vm_statistics_data_t *stat; +kern_return_t vm_statistics( + vm_map_t map, + vm_statistics_data_t *stat) { if (map == VM_MAP_NULL) return(KERN_INVALID_ARGUMENT); @@ -217,12 +217,12 @@ kern_return_t vm_cache_statistics( * Handle machine-specific attributes for a mapping, such * as cachability, migrability, etc. */ -kern_return_t vm_machine_attribute(map, address, size, attribute, value) - vm_map_t map; - vm_address_t address; - vm_size_t size; - vm_machine_attribute_t attribute; - vm_machine_attribute_val_t* value; /* IN/OUT */ +kern_return_t vm_machine_attribute( + vm_map_t map, + vm_address_t address, + vm_size_t size, + vm_machine_attribute_t attribute, + vm_machine_attribute_val_t* value) /* IN/OUT */ { if (map == VM_MAP_NULL) return(KERN_INVALID_ARGUMENT); @@ -235,12 +235,12 @@ kern_return_t vm_machine_attribute(map, address, size, attribute, value) return vm_map_machine_attribute(map, address, size, attribute, value); } -kern_return_t vm_read(map, address, size, data, data_size) - vm_map_t map; - vm_address_t address; - vm_size_t size; - pointer_t *data; - vm_size_t *data_size; +kern_return_t vm_read( + vm_map_t map, + vm_address_t address, + vm_size_t size, + pointer_t *data, + vm_size_t *data_size) { kern_return_t error; vm_map_copy_t ipc_address; @@ -259,11 +259,11 @@ kern_return_t vm_read(map, address, size, data, data_size) return(error); } -kern_return_t vm_write(map, address, data, size) - vm_map_t map; - vm_address_t address; - pointer_t data; - vm_size_t size; +kern_return_t vm_write( + vm_map_t map, + vm_address_t address, + pointer_t data, + vm_size_t size) { if (map == VM_MAP_NULL) return KERN_INVALID_ARGUMENT; @@ -272,11 +272,11 @@ kern_return_t vm_write(map, address, data, size) FALSE /* interruptible XXX */); } -kern_return_t vm_copy(map, source_address, size, dest_address) - vm_map_t map; - vm_address_t source_address; - vm_size_t size; - vm_address_t dest_address; +kern_return_t vm_copy( + vm_map_t map, + vm_address_t source_address, + vm_size_t size, + vm_address_t dest_address) { vm_map_copy_t copy; kern_return_t kr; @@ -304,22 +304,17 @@ kern_return_t vm_copy(map, source_address, size, dest_address) * Routine: vm_map */ kern_return_t vm_map( - target_map, - address, size, mask, anywhere, - memory_object, offset, - copy, - cur_protection, max_protection, inheritance) - vm_map_t target_map; - vm_offset_t *address; - vm_size_t size; - vm_offset_t mask; - boolean_t anywhere; - ipc_port_t memory_object; - vm_offset_t offset; - boolean_t copy; - vm_prot_t cur_protection; - vm_prot_t max_protection; - vm_inherit_t inheritance; + vm_map_t target_map, + vm_offset_t *address, + vm_size_t size, + vm_offset_t mask, + boolean_t anywhere, + ipc_port_t memory_object, + vm_offset_t offset, + boolean_t copy, + vm_prot_t cur_protection, + vm_prot_t max_protection, + vm_inherit_t inheritance) { vm_object_t object; kern_return_t result; |