aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/kgdb_stub.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/kernel/kgdb_stub.c')
-rw-r--r--arch/sh/kernel/kgdb_stub.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/arch/sh/kernel/kgdb_stub.c b/arch/sh/kernel/kgdb_stub.c
index d453c3a1c79f..bf8ac4c71640 100644
--- a/arch/sh/kernel/kgdb_stub.c
+++ b/arch/sh/kernel/kgdb_stub.c
@@ -274,8 +274,7 @@ static char *mem_to_hex(const char *mem, char *buf, const int count)
274 } 274 }
275 for (i = 0; i < count; i++) { 275 for (i = 0; i < count; i++) {
276 ch = *mem++; 276 ch = *mem++;
277 *buf++ = highhex(ch); 277 buf = pack_hex_byte(buf, ch);
278 *buf++ = lowhex(ch);
279 } 278 }
280 *buf = 0; 279 *buf = 0;
281 return (buf); 280 return (buf);
@@ -330,14 +329,6 @@ static char *ebin_to_mem(const char *buf, char *mem, int count)
330 return mem; 329 return mem;
331} 330}
332 331
333/* Pack a hex byte */
334static char *pack_hex_byte(char *pkt, int byte)
335{
336 *pkt++ = hexchars[(byte >> 4) & 0xf];
337 *pkt++ = hexchars[(byte & 0xf)];
338 return pkt;
339}
340
341/* Scan for the start char '$', read the packet and check the checksum */ 332/* Scan for the start char '$', read the packet and check the checksum */
342static void get_packet(char *buffer, int buflen) 333static void get_packet(char *buffer, int buflen)
343{ 334{
@@ -435,8 +426,8 @@ static void put_packet(char *buffer)
435 426
436 /* '#' Separator, put high and low components of checksum */ 427 /* '#' Separator, put high and low components of checksum */
437 put_debug_char('#'); 428 put_debug_char('#');
438 put_debug_char(highhex(checksum)); 429 put_debug_char(hex_asc_hi(checksum));
439 put_debug_char(lowhex(checksum)); 430 put_debug_char(hex_asc_lo(checksum));
440 } 431 }
441 while ((get_debug_char()) != '+'); /* While no ack */ 432 while ((get_debug_char()) != '+'); /* While no ack */
442} 433}
@@ -658,8 +649,8 @@ static void undo_single_step(void)
658static void send_signal_msg(const int signum) 649static void send_signal_msg(const int signum)
659{ 650{
660 out_buffer[0] = 'S'; 651 out_buffer[0] = 'S';
661 out_buffer[1] = highhex(signum); 652 out_buffer[1] = hex_asc_hi(signum);
662 out_buffer[2] = lowhex(signum); 653 out_buffer[2] = hex_asc_lo(signum);
663 out_buffer[3] = 0; 654 out_buffer[3] = 0;
664 put_packet(out_buffer); 655 put_packet(out_buffer);
665} 656}