]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/sh/kernel/kgdb_stub.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm
[linux-2.6-omap-h63xx.git] / arch / sh / kernel / kgdb_stub.c
index d453c3a1c79f485377a870456cef74488d601e27..bf8ac4c716402c2b37178a8df448d318dd60af1c 100644 (file)
@@ -274,8 +274,7 @@ static char *mem_to_hex(const char *mem, char *buf, const int count)
        }
        for (i = 0; i < count; i++) {
                ch = *mem++;
-               *buf++ = highhex(ch);
-               *buf++ = lowhex(ch);
+               buf = pack_hex_byte(buf, ch);
        }
        *buf = 0;
        return (buf);
@@ -330,14 +329,6 @@ static char *ebin_to_mem(const char *buf, char *mem, int count)
        return mem;
 }
 
-/* Pack a hex byte */
-static char *pack_hex_byte(char *pkt, int byte)
-{
-       *pkt++ = hexchars[(byte >> 4) & 0xf];
-       *pkt++ = hexchars[(byte & 0xf)];
-       return pkt;
-}
-
 /* Scan for the start char '$', read the packet and check the checksum */
 static void get_packet(char *buffer, int buflen)
 {
@@ -435,8 +426,8 @@ static void put_packet(char *buffer)
 
                /* '#' Separator, put high and low components of checksum */
                put_debug_char('#');
-               put_debug_char(highhex(checksum));
-               put_debug_char(lowhex(checksum));
+               put_debug_char(hex_asc_hi(checksum));
+               put_debug_char(hex_asc_lo(checksum));
        }
        while ((get_debug_char()) != '+');      /* While no ack */
 }
@@ -658,8 +649,8 @@ static void undo_single_step(void)
 static void send_signal_msg(const int signum)
 {
        out_buffer[0] = 'S';
-       out_buffer[1] = highhex(signum);
-       out_buffer[2] = lowhex(signum);
+       out_buffer[1] = hex_asc_hi(signum);
+       out_buffer[2] = hex_asc_lo(signum);
        out_buffer[3] = 0;
        put_packet(out_buffer);
 }