~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to kernel/debug/gdbstub.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1093
1093
        put_packet(remcom_out_buffer);
1094
1094
        return 0;
1095
1095
}
 
1096
 
 
1097
/**
 
1098
 * gdbstub_exit - Send an exit message to GDB
 
1099
 * @status: The exit code to report.
 
1100
 */
 
1101
void gdbstub_exit(int status)
 
1102
{
 
1103
        unsigned char checksum, ch, buffer[3];
 
1104
        int loop;
 
1105
 
 
1106
        buffer[0] = 'W';
 
1107
        buffer[1] = hex_asc_hi(status);
 
1108
        buffer[2] = hex_asc_lo(status);
 
1109
 
 
1110
        dbg_io_ops->write_char('$');
 
1111
        checksum = 0;
 
1112
 
 
1113
        for (loop = 0; loop < 3; loop++) {
 
1114
                ch = buffer[loop];
 
1115
                checksum += ch;
 
1116
                dbg_io_ops->write_char(ch);
 
1117
        }
 
1118
 
 
1119
        dbg_io_ops->write_char('#');
 
1120
        dbg_io_ops->write_char(hex_asc_hi(checksum));
 
1121
        dbg_io_ops->write_char(hex_asc_lo(checksum));
 
1122
 
 
1123
        /* make sure the output is flushed, lest the bootloader clobber it */
 
1124
        dbg_io_ops->flush();
 
1125
}