Skip to content

Commit

Permalink
ddb: ANSI-fy function declarations.
Browse files Browse the repository at this point in the history
MFC after:	5 days
  • Loading branch information
pgiffuni committed Oct 12, 2014
1 parent 403a3c8 commit a41dd03
Show file tree
Hide file tree
Showing 11 changed files with 89 additions and 227 deletions.
10 changes: 2 additions & 8 deletions sys/ddb/db_access.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,7 @@ static unsigned db_extend[] = { /* table for sign-extending */
#endif

db_expr_t
db_get_value(addr, size, is_signed)
db_addr_t addr;
register int size;
boolean_t is_signed;
db_get_value(db_addr_t addr, int size, boolean_t is_signed)
{
char data[sizeof(u_int64_t)];
register db_expr_t value;
Expand Down Expand Up @@ -87,10 +84,7 @@ db_get_value(addr, size, is_signed)
}

void
db_put_value(addr, size, value)
db_addr_t addr;
register int size;
register db_expr_t value;
db_put_value(db_addr_t addr, int size, db_expr_t value)
{
char data[sizeof(int)];
register int i;
Expand Down
62 changes: 19 additions & 43 deletions sys/ddb/db_break.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ static void db_list_breakpoints(void);
static void db_set_breakpoint(vm_map_t map, db_addr_t addr, int count);

static db_breakpoint_t
db_breakpoint_alloc()
db_breakpoint_alloc(void)
{
register db_breakpoint_t bkpt;

Expand All @@ -78,18 +78,14 @@ db_breakpoint_alloc()
}

static void
db_breakpoint_free(bkpt)
register db_breakpoint_t bkpt;
db_breakpoint_free(db_breakpoint_t bkpt)
{
bkpt->link = db_free_breakpoints;
db_free_breakpoints = bkpt;
}

static void
db_set_breakpoint(map, addr, count)
vm_map_t map;
db_addr_t addr;
int count;
db_set_breakpoint(vm_map_t map, db_addr_t addr, int count)
{
register db_breakpoint_t bkpt;

Expand All @@ -115,9 +111,7 @@ db_set_breakpoint(map, addr, count)
}

static void
db_delete_breakpoint(map, addr)
vm_map_t map;
db_addr_t addr;
db_delete_breakpoint(vm_map_t map, db_addr_t addr)
{
register db_breakpoint_t bkpt;
register db_breakpoint_t *prev;
Expand All @@ -140,9 +134,7 @@ db_delete_breakpoint(map, addr)
}

static db_breakpoint_t
db_find_breakpoint(map, addr)
vm_map_t map;
db_addr_t addr;
db_find_breakpoint(vm_map_t map, db_addr_t addr)
{
register db_breakpoint_t bkpt;

Expand All @@ -158,8 +150,7 @@ db_find_breakpoint(map, addr)
}

db_breakpoint_t
db_find_breakpoint_here(addr)
db_addr_t addr;
db_find_breakpoint_here(db_addr_t addr)
{
return db_find_breakpoint(db_map_addr(addr), addr);
}
Expand All @@ -180,7 +171,7 @@ do { \
#endif

void
db_set_breakpoints()
db_set_breakpoints(void)
{
register db_breakpoint_t bkpt;

Expand All @@ -197,7 +188,7 @@ db_set_breakpoints()
}

void
db_clear_breakpoints()
db_clear_breakpoints(void)
{
register db_breakpoint_t bkpt;

Expand All @@ -220,8 +211,7 @@ db_clear_breakpoints()
* so the breakpoint does not have to be on the breakpoint list.
*/
db_breakpoint_t
db_set_temp_breakpoint(addr)
db_addr_t addr;
db_set_temp_breakpoint(db_addr_t addr)
{
register db_breakpoint_t bkpt;

Expand All @@ -242,8 +232,7 @@ db_set_temp_breakpoint(addr)
}

void
db_delete_temp_breakpoint(bkpt)
db_breakpoint_t bkpt;
db_delete_temp_breakpoint(db_breakpoint_t bkpt)
{
BKPT_CLEAR(bkpt->address, &bkpt->bkpt_inst);
db_breakpoint_free(bkpt);
Expand All @@ -254,7 +243,7 @@ db_delete_temp_breakpoint(bkpt)
* List breakpoints.
*/
static void
db_list_breakpoints()
db_list_breakpoints(void)
{
register db_breakpoint_t bkpt;

Expand All @@ -278,23 +267,16 @@ db_list_breakpoints()
/* Delete breakpoint */
/*ARGSUSED*/
void
db_delete_cmd(addr, have_addr, count, modif)
db_expr_t addr;
boolean_t have_addr;
db_expr_t count;
char * modif;
db_delete_cmd(db_expr_t addr, boolean_t have_addr, db_expr_t count, char *modif)
{
db_delete_breakpoint(db_map_addr(addr), (db_addr_t)addr);
}

/* Set breakpoint with skip count */
/*ARGSUSED*/
void
db_breakpoint_cmd(addr, have_addr, count, modif)
db_expr_t addr;
boolean_t have_addr;
db_expr_t count;
char * modif;
db_breakpoint_cmd(db_expr_t addr, boolean_t have_addr, db_expr_t count,
char *modif)
{
if (count == -1)
count = 1;
Expand All @@ -304,11 +286,8 @@ db_breakpoint_cmd(addr, have_addr, count, modif)

/* list breakpoints */
void
db_listbreak_cmd(dummy1, dummy2, dummy3, dummy4)
db_expr_t dummy1;
boolean_t dummy2;
db_expr_t dummy3;
char * dummy4;
db_listbreak_cmd(db_expr_t dummy1, boolean_t dummy2, db_expr_t dummy3,
char *dummy4)
{
db_list_breakpoints();
}
Expand All @@ -320,17 +299,15 @@ db_listbreak_cmd(dummy1, dummy2, dummy3, dummy4)
*/

boolean_t
db_map_equal(map1, map2)
vm_map_t map1, map2;
db_map_equal(vm_map_t map1, vm_map_t map2)
{
return ((map1 == map2) ||
((map1 == NULL) && (map2 == kernel_map)) ||
((map1 == kernel_map) && (map2 == NULL)));
}

boolean_t
db_map_current(map)
vm_map_t map;
db_map_current(vm_map_t map)
{
#if 0
thread_t thread;
Expand All @@ -345,8 +322,7 @@ db_map_current(map)
}

vm_map_t
db_map_addr(addr)
vm_offset_t addr;
db_map_addr(vm_offset_t addr)
{
#if 0
thread_t thread;
Expand Down
46 changes: 12 additions & 34 deletions sys/ddb/db_command.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ static boolean_t db_ed_style = TRUE;
* Utility routine - discard tokens through end-of-line.
*/
void
db_skip_to_eol()
db_skip_to_eol(void)
{
int t;
do {
Expand Down Expand Up @@ -252,11 +252,8 @@ db_command_unregister(struct command_table *list, struct command *cmd)
* Helper function to match a single command.
*/
static void
db_cmd_match(name, cmd, cmdp, resultp)
char * name;
struct command *cmd;
struct command **cmdp; /* out */
int * resultp;
db_cmd_match(char *name, struct command *cmd, struct command **cmdp,
int *resultp)
{
char *lp, *rp;
int c;
Expand Down Expand Up @@ -291,10 +288,7 @@ db_cmd_match(name, cmd, cmdp, resultp)
* Search for command prefix.
*/
static int
db_cmd_search(name, table, cmdp)
char * name;
struct command_table *table;
struct command **cmdp; /* out */
db_cmd_search(char *name, struct command_table *table, struct command **cmdp)
{
struct command *cmd;
int result = CMD_NONE;
Expand All @@ -315,8 +309,7 @@ db_cmd_search(name, table, cmdp)
}

static void
db_cmd_list(table)
struct command_table *table;
db_cmd_list(struct command_table *table)
{
register struct command *cmd;

Expand All @@ -327,10 +320,8 @@ db_cmd_list(table)
}

static void
db_command(last_cmdp, cmd_table, dopager)
struct command **last_cmdp; /* IN_OUT */
struct command_table *cmd_table;
int dopager;
db_command(struct command **last_cmdp, struct command_table *cmd_table,
int dopager)
{
struct command *cmd = NULL;
int t;
Expand Down Expand Up @@ -483,7 +474,7 @@ DB_COMMAND(panic, db_panic)
}

void
db_command_loop()
db_command_loop(void)
{
/*
* Initialize 'prev' and 'next' to dot.
Expand Down Expand Up @@ -521,8 +512,7 @@ db_command_script(const char *command)
}

void
db_error(s)
const char *s;
db_error(const char *s)
{
if (s)
db_printf("%s", s);
Expand Down Expand Up @@ -581,11 +571,7 @@ db_fncall_generic(db_expr_t addr, db_expr_t *rv, int nargs, db_expr_t args[])
}

static void
db_fncall(dummy1, dummy2, dummy3, dummy4)
db_expr_t dummy1;
boolean_t dummy2;
db_expr_t dummy3;
char * dummy4;
db_fncall(db_expr_t dummy1, boolean_t dummy2, db_expr_t dummy3, char *dummy4)
{
db_expr_t fn_addr;
db_expr_t args[DB_MAXARGS];
Expand Down Expand Up @@ -639,11 +625,7 @@ db_halt(db_expr_t dummy, boolean_t dummy2, db_expr_t dummy3, char *dummy4)
}

static void
db_kill(dummy1, dummy2, dummy3, dummy4)
db_expr_t dummy1;
boolean_t dummy2;
db_expr_t dummy3;
char * dummy4;
db_kill(db_expr_t dummy1, boolean_t dummy2, db_expr_t dummy3, char *dummy4)
{
db_expr_t old_radix, pid, sig;
struct proc *p;
Expand Down Expand Up @@ -732,11 +714,7 @@ db_reset(db_expr_t addr, boolean_t have_addr, db_expr_t count __unused,
}

static void
db_watchdog(dummy1, dummy2, dummy3, dummy4)
db_expr_t dummy1;
boolean_t dummy2;
db_expr_t dummy3;
char * dummy4;
db_watchdog(db_expr_t dummy1, boolean_t dummy2, db_expr_t dummy3, char *dummy4)
{
db_expr_t old_radix, tout;
int err, i;
Expand Down
Loading

0 comments on commit a41dd03

Please sign in to comment.