Changeset 112 for trunk/src/os2ahci/libc.c
- Timestamp:
- Jul 6, 2011, 10:02:47 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/os2ahci/libc.c
r111 r112 58 58 ULONG parm2); 59 59 static int mdelay_cal_end (void); 60 static int trace_enabled (void);61 60 62 61 /* ------------------------ global/static variables ------------------------ */ … … 67 66 static char hex_digits[] = "0123456789abcdef"; 68 67 static ULONG mem_lock; 69 staticULONG com_lock;68 ULONG com_lock; 70 69 71 70 /* message table for DosHelp_Save_Message() which prints the first string */ … … 283 282 284 283 if (com_base == 0) { 285 /* write debug message to trace buffer, not COM port */286 trace(debug, len, buf);287 spin_unlock(com_lock);288 return;289 }284 /* write debug message to trace buffer, not COM port */ 285 trace_write(buf, len); 286 spin_unlock(com_lock); 287 return; 288 } 290 289 291 290 /* write debug message to serial port */ … … 367 366 * Print hex buffer to COM port. 368 367 */ 369 void phex(const void _far *p, int len, u16 trace_minor_code,const char *fmt, ...)368 void phex(const void _far *p, int len, const char *fmt, ...) 370 369 { 371 370 va_list va; … … 374 373 375 374 if (!debug) { 376 return;377 }378 379 if (!com_base) {380 /* dump to kernel trace buffer, not serial port;381 * just dump the buffer, it is formatted by TRACEFMT382 *383 * NOTE: writing the header to the trace buffer causes384 * the trace facility to hick up and swallow the385 * binary data that follows...386 */387 trace(trace_minor_code, len, buf);388 375 return; 389 376 } … … 866 853 } 867 854 868 /******************************************************************************869 * is_trace_enabled - checks if kernel tracing is enabled870 */871 int is_trace_enabled(void)872 {873 int ret = 1; /* if global info seg is not present/known,874 * we enable tracing for now */875 876 /* check global info segment's trace enabled bitmap if our877 * major trace code is enabled878 */879 if (gis) {880 u8 trace_bitmap = gis->amecRAS[AHCI_TRACE_MAJOR / 8];881 if (trace_bitmap & (0x80 >> (AHCI_TRACE_MAJOR % 8))) {882 ret = 1;883 } else {884 ret = 0;885 }886 }887 888 return ret;889 }890 891 /******************************************************************************892 * trace - write a buffer to the kernel trace buffer893 */894 void trace(u16 minor_code, u16 cb_buf, const char _far *buf)895 {896 if (!is_trace_enabled()) {897 return;898 }899 900 DevHelp_RAS(AHCI_TRACE_MAJOR, minor_code, cb_buf, (PBYTE) buf);901 }902
Note:
See TracChangeset
for help on using the changeset viewer.