www.pudn.com > r&s1.10°æ±¾£«Îĵµ.rar > trace.h


/* 
=============================================================================== 
| Copyright (C) 2004 RuanHaiShen, All rights reserved. 
| SUMMARY:  
|   Macros and prototypes for the tracing system. 
| 
| DESCRIPTION: 
|   See http://www.01s.org for documentation, latest information, license  
|   and contact details. 
|   email:ruanhaishen@01s.org 
=============================================================================*/ 
#ifndef __trace_h__ 
#define __trace_h__ 
/*===========================================================================*/ 
 
#if CFG_DUMP_BUFSZ > 0 
void printk(const char *fmt, ...); 
#else 
# define printk 
#endif 
 
void x86_vga_write(unsigned char *s, int count); 
void hardware_init(void); 
void halt(void); 
 
#define arch_serial_write(s, count)    x86_vga_write(s, count) 
/*#define arch_serial_write(s, count)*/ 
 
#define __DO_ASSERT(file, line, msg)    printk("%s %s (%d)", msg, file, line) 
 
#if CFG_DEBUG > 0 
# define __TRACE(x) 
# define __ASSERT(x) \ 
do { \ 
    if (!(x)) { \ 
        __DO_ASSERT(__FILE__, __LINE__, "!! ASSERT FAIL:"); \ 
        task_lock(); \ 
        while(1); \ 
    } \ 
} while (0) 
 
#else 
# define __TRACE(x)         __MPT 
# define __ASSERT(x)        __MPT 
#endif 
 
/*===========================================================================*/ 
#endif