git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Kernel - Move debug hooks to common handler
[tpg/acess2.git]
/
KernelLand
/
Kernel
/
drv
/
serial.c
diff --git
a/KernelLand/Kernel/drv/serial.c
b/KernelLand/Kernel/drv/serial.c
index
2792df9
..
bc7597e
100644
(file)
--- a/
KernelLand/Kernel/drv/serial.c
+++ b/
KernelLand/Kernel/drv/serial.c
@@
-12,6
+12,8
@@
#include <drv_pty.h>
#include <debug_hooks.h>
#include <drv_pty.h>
#include <debug_hooks.h>
+extern void Validate_VirtualMemoryUsage(void);
+
// === TYPES ===
struct sSerialPort
{
// === TYPES ===
struct sSerialPort
{
@@
-67,23
+69,32
@@
void Serial_ByteReceived(tSerialPort *Port, char Ch)
return ;
if( Port == gSerial_KernelDebugPort )
{
return ;
if( Port == gSerial_KernelDebugPort )
{
+ static tDebugHook info;
static int serial_debug_mode = 0;
// Kernel serial debug hooks.
static int serial_debug_mode = 0;
// Kernel serial debug hooks.
- if( serial_debug_mode )
+ if( serial_debug_mode == 2 )
+ {
+ // Leave latched mode
+ if( Ch == '.' )
+ serial_debug_mode = 0;
+ else
+ DebugHook_HandleInput(&info, 1, &Ch);
+ return ;
+ }
+ else if( serial_debug_mode )
{
{
- switch(Ch)
- {
- case 'p':
- Threads_Dump();
- break;
- case 'h':
- Heap_Dump();
- break;
- case 'X'-'A'+1:
+ if( Ch == 'X'-'A'+1 ) {
PTY_SendInput(Port->PTY, &Ch, 1);
PTY_SendInput(Port->PTY, &Ch, 1);
- break;
+ serial_debug_mode = 0;
+ }
+ else if( Ch == '~' ) {
+ // Enter latched mode
+ serial_debug_mode = 2;
+ }
+ else {
+ DebugHook_HandleInput(&info, 1, &Ch);
+ serial_debug_mode = 0;
}
}
- serial_debug_mode = 0;
return ;
}
else if( Ch == 'X'-'A'+1 )
return ;
}
else if( Ch == 'X'-'A'+1 )
UCC
git Repository :: git.ucc.asn.au