Skip to content

Commit

Permalink
kgdb: follow rename pack_hex_byte() to hex_byte_pack()
Browse files Browse the repository at this point in the history
There is no functional change.

Signed-off-by: Andy Shevchenko <[email protected]>
Acked-by: Jesper Nilsson <[email protected]>
Cc: David Howells <[email protected]>
Cc: Koichi Yasutake <[email protected]>
Cc: Jason Wessel <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
andy-shev authored and torvalds committed Nov 1, 2011
1 parent 55036ba commit 50e1499
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 64 deletions.
6 changes: 3 additions & 3 deletions arch/cris/arch-v10/kernel/kgdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ mem2hex(char *buf, unsigned char *mem, int count)
/* Valid mem address. */
for (i = 0; i < count; i++) {
ch = *mem++;
buf = pack_hex_byte(buf, ch);
buf = hex_byte_pack(buf, ch);
}
}

Expand Down Expand Up @@ -868,7 +868,7 @@ stub_is_stopped(int sigval)
/* Send trap type (converted to signal) */

*ptr++ = 'T';
ptr = pack_hex_byte(ptr, sigval);
ptr = hex_byte_pack(ptr, sigval);

/* Send register contents. We probably only need to send the
* PC, frame pointer and stack pointer here. Other registers will be
Expand All @@ -881,7 +881,7 @@ stub_is_stopped(int sigval)
status = read_register (regno, &reg_cont);

if (status == SUCCESS) {
ptr = pack_hex_byte(ptr, regno);
ptr = hex_byte_pack(ptr, regno);
*ptr++ = ':';

ptr = mem2hex(ptr, (unsigned char *)&reg_cont,
Expand Down
14 changes: 7 additions & 7 deletions arch/cris/arch-v32/kernel/kgdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ mem2hex(char *buf, unsigned char *mem, int count)
/* Valid mem address. */
for (i = 0; i < count; i++) {
ch = *mem++;
buf = pack_hex_byte(buf, ch);
buf = hex_byte_pack(buf, ch);
}
}
/* Terminate properly. */
Expand All @@ -695,7 +695,7 @@ mem2hex_nbo(char *buf, unsigned char *mem, int count)
mem += count - 1;
for (i = 0; i < count; i++) {
ch = *mem--;
buf = pack_hex_byte(buf, ch);
buf = hex_byte_pack(buf, ch);
}

/* Terminate properly. */
Expand Down Expand Up @@ -880,7 +880,7 @@ stub_is_stopped(int sigval)
/* Send trap type (converted to signal) */

*ptr++ = 'T';
ptr = pack_hex_byte(ptr, sigval);
ptr = hex_byte_pack(ptr, sigval);

if (((reg.exs & 0xff00) >> 8) == 0xc) {

Expand Down Expand Up @@ -988,26 +988,26 @@ stub_is_stopped(int sigval)
}
/* Only send PC, frame and stack pointer. */
read_register(PC, &reg_cont);
ptr = pack_hex_byte(ptr, PC);
ptr = hex_byte_pack(ptr, PC);
*ptr++ = ':';
ptr = mem2hex(ptr, (unsigned char *)&reg_cont, register_size[PC]);
*ptr++ = ';';

read_register(R8, &reg_cont);
ptr = pack_hex_byte(ptr, R8);
ptr = hex_byte_pack(ptr, R8);
*ptr++ = ':';
ptr = mem2hex(ptr, (unsigned char *)&reg_cont, register_size[R8]);
*ptr++ = ';';

read_register(SP, &reg_cont);
ptr = pack_hex_byte(ptr, SP);
ptr = hex_byte_pack(ptr, SP);
*ptr++ = ':';
ptr = mem2hex(ptr, (unsigned char *)&reg_cont, register_size[SP]);
*ptr++ = ';';

/* Send ERP as well; this will save us an entire register fetch in some cases. */
read_register(ERP, &reg_cont);
ptr = pack_hex_byte(ptr, ERP);
ptr = hex_byte_pack(ptr, ERP);
*ptr++ = ':';
ptr = mem2hex(ptr, (unsigned char *)&reg_cont, register_size[ERP]);
*ptr++ = ';';
Expand Down
44 changes: 22 additions & 22 deletions arch/frv/kernel/gdb-stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -672,44 +672,44 @@ static unsigned char *mem2hex(const void *_mem, char *buf, int count, int may_fa
if ((uint32_t)mem&1 && count>=1) {
if (!gdbstub_read_byte(mem,ch))
return NULL;
buf = pack_hex_byte(buf, ch[0]);
buf = hex_byte_pack(buf, ch[0]);
mem++;
count--;
}

if ((uint32_t)mem&3 && count>=2) {
if (!gdbstub_read_word(mem,(uint16_t *)ch))
return NULL;
buf = pack_hex_byte(buf, ch[0]);
buf = pack_hex_byte(buf, ch[1]);
buf = hex_byte_pack(buf, ch[0]);
buf = hex_byte_pack(buf, ch[1]);
mem += 2;
count -= 2;
}

while (count>=4) {
if (!gdbstub_read_dword(mem,(uint32_t *)ch))
return NULL;
buf = pack_hex_byte(buf, ch[0]);
buf = pack_hex_byte(buf, ch[1]);
buf = pack_hex_byte(buf, ch[2]);
buf = pack_hex_byte(buf, ch[3]);
buf = hex_byte_pack(buf, ch[0]);
buf = hex_byte_pack(buf, ch[1]);
buf = hex_byte_pack(buf, ch[2]);
buf = hex_byte_pack(buf, ch[3]);
mem += 4;
count -= 4;
}

if (count>=2) {
if (!gdbstub_read_word(mem,(uint16_t *)ch))
return NULL;
buf = pack_hex_byte(buf, ch[0]);
buf = pack_hex_byte(buf, ch[1]);
buf = hex_byte_pack(buf, ch[0]);
buf = hex_byte_pack(buf, ch[1]);
mem += 2;
count -= 2;
}

if (count>=1) {
if (!gdbstub_read_byte(mem,ch))
return NULL;
buf = pack_hex_byte(buf, ch[0]);
buf = hex_byte_pack(buf, ch[0]);
}

*buf = 0;
Expand Down Expand Up @@ -1498,21 +1498,21 @@ void gdbstub(int sigval)
ptr = mem2hex(title, ptr, sizeof(title) - 1,0);

hx = hex_asc_hi(brr >> 24);
ptr = pack_hex_byte(ptr, hx);
ptr = hex_byte_pack(ptr, hx);
hx = hex_asc_lo(brr >> 24);
ptr = pack_hex_byte(ptr, hx);
ptr = hex_byte_pack(ptr, hx);
hx = hex_asc_hi(brr >> 16);
ptr = pack_hex_byte(ptr, hx);
ptr = hex_byte_pack(ptr, hx);
hx = hex_asc_lo(brr >> 16);
ptr = pack_hex_byte(ptr, hx);
ptr = hex_byte_pack(ptr, hx);
hx = hex_asc_hi(brr >> 8);
ptr = pack_hex_byte(ptr, hx);
ptr = hex_byte_pack(ptr, hx);
hx = hex_asc_lo(brr >> 8);
ptr = pack_hex_byte(ptr, hx);
ptr = hex_byte_pack(ptr, hx);
hx = hex_asc_hi(brr);
ptr = pack_hex_byte(ptr, hx);
ptr = hex_byte_pack(ptr, hx);
hx = hex_asc_lo(brr);
ptr = pack_hex_byte(ptr, hx);
ptr = hex_byte_pack(ptr, hx);

ptr = mem2hex(crlf, ptr, sizeof(crlf) - 1, 0);
*ptr = 0;
Expand All @@ -1526,26 +1526,26 @@ void gdbstub(int sigval)

/* Send trap type (converted to signal) */
*ptr++ = 'T';
ptr = pack_hex_byte(ptr, sigval);
ptr = hex_byte_pack(ptr, sigval);

/* Send Error PC */
ptr = pack_hex_byte(ptr, GDB_REG_PC);
ptr = hex_byte_pack(ptr, GDB_REG_PC);
*ptr++ = ':';
ptr = mem2hex(&__debug_frame->pc, ptr, 4, 0);
*ptr++ = ';';

/*
* Send frame pointer
*/
ptr = pack_hex_byte(ptr, GDB_REG_FP);
ptr = hex_byte_pack(ptr, GDB_REG_FP);
*ptr++ = ':';
ptr = mem2hex(&__debug_frame->fp, ptr, 4, 0);
*ptr++ = ';';

/*
* Send stack pointer
*/
ptr = pack_hex_byte(ptr, GDB_REG_SP);
ptr = hex_byte_pack(ptr, GDB_REG_SP);
*ptr++ = ':';
ptr = mem2hex(&__debug_frame->sp, ptr, 4, 0);
*ptr++ = ';';
Expand Down
52 changes: 26 additions & 26 deletions arch/mn10300/kernel/gdb-stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -798,44 +798,44 @@ unsigned char *mem2hex(const void *_mem, char *buf, int count, int may_fault)
if ((u32) mem & 1 && count >= 1) {
if (gdbstub_read_byte(mem, ch) != 0)
return 0;
buf = pack_hex_byte(buf, ch[0]);
buf = hex_byte_pack(buf, ch[0]);
mem++;
count--;
}

if ((u32) mem & 3 && count >= 2) {
if (gdbstub_read_word(mem, ch) != 0)
return 0;
buf = pack_hex_byte(buf, ch[0]);
buf = pack_hex_byte(buf, ch[1]);
buf = hex_byte_pack(buf, ch[0]);
buf = hex_byte_pack(buf, ch[1]);
mem += 2;
count -= 2;
}

while (count >= 4) {
if (gdbstub_read_dword(mem, ch) != 0)
return 0;
buf = pack_hex_byte(buf, ch[0]);
buf = pack_hex_byte(buf, ch[1]);
buf = pack_hex_byte(buf, ch[2]);
buf = pack_hex_byte(buf, ch[3]);
buf = hex_byte_pack(buf, ch[0]);
buf = hex_byte_pack(buf, ch[1]);
buf = hex_byte_pack(buf, ch[2]);
buf = hex_byte_pack(buf, ch[3]);
mem += 4;
count -= 4;
}

if (count >= 2) {
if (gdbstub_read_word(mem, ch) != 0)
return 0;
buf = pack_hex_byte(buf, ch[0]);
buf = pack_hex_byte(buf, ch[1]);
buf = hex_byte_pack(buf, ch[0]);
buf = hex_byte_pack(buf, ch[1]);
mem += 2;
count -= 2;
}

if (count >= 1) {
if (gdbstub_read_byte(mem, ch) != 0)
return 0;
buf = pack_hex_byte(buf, ch[0]);
buf = hex_byte_pack(buf, ch[0]);
}

*buf = 0;
Expand Down Expand Up @@ -1273,13 +1273,13 @@ static int gdbstub(struct pt_regs *regs, enum exception_code excep)
ptr = mem2hex(title, ptr, sizeof(title) - 1, 0);

hx = hex_asc_hi(excep >> 8);
ptr = pack_hex_byte(ptr, hx);
ptr = hex_byte_pack(ptr, hx);
hx = hex_asc_lo(excep >> 8);
ptr = pack_hex_byte(ptr, hx);
ptr = hex_byte_pack(ptr, hx);
hx = hex_asc_hi(excep);
ptr = pack_hex_byte(ptr, hx);
ptr = hex_byte_pack(ptr, hx);
hx = hex_asc_lo(excep);
ptr = pack_hex_byte(ptr, hx);
ptr = hex_byte_pack(ptr, hx);

ptr = mem2hex(crlf, ptr, sizeof(crlf) - 1, 0);
*ptr = 0;
Expand All @@ -1291,21 +1291,21 @@ static int gdbstub(struct pt_regs *regs, enum exception_code excep)
ptr = mem2hex(tbcberr, ptr, sizeof(tbcberr) - 1, 0);

hx = hex_asc_hi(bcberr >> 24);
ptr = pack_hex_byte(ptr, hx);
ptr = hex_byte_pack(ptr, hx);
hx = hex_asc_lo(bcberr >> 24);
ptr = pack_hex_byte(ptr, hx);
ptr = hex_byte_pack(ptr, hx);
hx = hex_asc_hi(bcberr >> 16);
ptr = pack_hex_byte(ptr, hx);
ptr = hex_byte_pack(ptr, hx);
hx = hex_asc_lo(bcberr >> 16);
ptr = pack_hex_byte(ptr, hx);
ptr = hex_byte_pack(ptr, hx);
hx = hex_asc_hi(bcberr >> 8);
ptr = pack_hex_byte(ptr, hx);
ptr = hex_byte_pack(ptr, hx);
hx = hex_asc_lo(bcberr >> 8);
ptr = pack_hex_byte(ptr, hx);
ptr = hex_byte_pack(ptr, hx);
hx = hex_asc_hi(bcberr);
ptr = pack_hex_byte(ptr, hx);
ptr = hex_byte_pack(ptr, hx);
hx = hex_asc_lo(bcberr);
ptr = pack_hex_byte(ptr, hx);
ptr = hex_byte_pack(ptr, hx);

ptr = mem2hex(crlf, ptr, sizeof(crlf) - 1, 0);
*ptr = 0;
Expand All @@ -1321,20 +1321,20 @@ static int gdbstub(struct pt_regs *regs, enum exception_code excep)
* Send trap type (converted to signal)
*/
*ptr++ = 'T';
ptr = pack_hex_byte(ptr, sigval);
ptr = hex_byte_pack(ptr, sigval);

/*
* Send Error PC
*/
ptr = pack_hex_byte(ptr, GDB_REGID_PC);
ptr = hex_byte_pack(ptr, GDB_REGID_PC);
*ptr++ = ':';
ptr = mem2hex(&regs->pc, ptr, 4, 0);
*ptr++ = ';';

/*
* Send frame pointer
*/
ptr = pack_hex_byte(ptr, GDB_REGID_FP);
ptr = hex_byte_pack(ptr, GDB_REGID_FP);
*ptr++ = ':';
ptr = mem2hex(&regs->a3, ptr, 4, 0);
*ptr++ = ';';
Expand All @@ -1343,7 +1343,7 @@ static int gdbstub(struct pt_regs *regs, enum exception_code excep)
* Send stack pointer
*/
ssp = (unsigned long) (regs + 1);
ptr = pack_hex_byte(ptr, GDB_REGID_SP);
ptr = hex_byte_pack(ptr, GDB_REGID_SP);
*ptr++ = ':';
ptr = mem2hex(&ssp, ptr, 4, 0);
*ptr++ = ';';
Expand Down
12 changes: 6 additions & 6 deletions kernel/debug/gdbstub.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ void gdbstub_msg_write(const char *s, int len)

/* Pack in hex chars */
for (i = 0; i < wcount; i++)
bufptr = pack_hex_byte(bufptr, s[i]);
bufptr = hex_byte_pack(bufptr, s[i]);
*bufptr = '\0';

/* Move up */
Expand Down Expand Up @@ -249,7 +249,7 @@ char *kgdb_mem2hex(char *mem, char *buf, int count)
if (err)
return NULL;
while (count > 0) {
buf = pack_hex_byte(buf, *tmp);
buf = hex_byte_pack(buf, *tmp);
tmp++;
count--;
}
Expand Down Expand Up @@ -411,14 +411,14 @@ static char *pack_threadid(char *pkt, unsigned char *id)
limit = id + (BUF_THREAD_ID_SIZE / 2);
while (id < limit) {
if (!lzero || *id != 0) {
pkt = pack_hex_byte(pkt, *id);
pkt = hex_byte_pack(pkt, *id);
lzero = 0;
}
id++;
}

if (lzero)
pkt = pack_hex_byte(pkt, 0);
pkt = hex_byte_pack(pkt, 0);

return pkt;
}
Expand Down Expand Up @@ -486,7 +486,7 @@ static void gdb_cmd_status(struct kgdb_state *ks)
dbg_remove_all_break();

remcom_out_buffer[0] = 'S';
pack_hex_byte(&remcom_out_buffer[1], ks->signo);
hex_byte_pack(&remcom_out_buffer[1], ks->signo);
}

static void gdb_get_regs_helper(struct kgdb_state *ks)
Expand Down Expand Up @@ -954,7 +954,7 @@ int gdb_serial_stub(struct kgdb_state *ks)
/* Reply to host that an exception has occurred */
ptr = remcom_out_buffer;
*ptr++ = 'T';
ptr = pack_hex_byte(ptr, ks->signo);
ptr = hex_byte_pack(ptr, ks->signo);
ptr += strlen(strcpy(ptr, "thread:"));
int_to_threadref(thref, shadow_pid(current->pid));
ptr = pack_threadid(ptr, thref);
Expand Down

0 comments on commit 50e1499

Please sign in to comment.