⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sim_error.h

📁 一个用在mips体系结构中的操作系统
💻 H
字号:
/* * Copyright (C) 1996-1998 by the Board of Trustees *    of Leland Stanford Junior University. *  * This file is part of the SimOS distribution.  * See LICENSE file for terms of the license.  * *//***************************************************************** * error.h * * Error handling headers for SimOS. * * Author: $Author: bosch $ * Date:   $Date: 1998/02/10 00:28:40 $ ****************************************************************/#ifndef _CPU_SHARED_ERROR_H#define _CPU_SHARED_ERROR_H#ifndef _LANGUAGE_ASSEMBLY#include <stdarg.h>#include <stdio.h>#include "simtypes.h"extern FILE *cpulogF;/* #define ASSERTS_DISABLED*/#ifndef ASSERTS_DISABLED#define ASSUME(x)  {if (!(x)) \{CPUWarning("%s:%d: assumption failed: %s\n",\ __FILE__, __LINE__, # x);} }#define VASSUME(x,s)  {if (!(x)) \{CPUPut s; CPUWarning("%s:%d: assumption failed: %s\n",\ __FILE__, __LINE__, # x);} }#define ASSERT(x)  {if (!(x)) \{CPUError("%s:%d: assertion failed (looping): %s\n",\ __FILE__, __LINE__, # x);} }#define VASSERT(x,s)  {if (!(x)) \{CPUPut s; CPUError("%s:%d: assertion failed (looping): %s\n",\ __FILE__, __LINE__, # x);} }#else#define ASSUME(x)#define VASSUME(x,s)#define ASSERT(x)#define VASSERT(x,s)#endif#define NOTREACHED() \{CPUError("%s:%d: NOTREACHED() error\n",\ __FILE__, __LINE__);} extern void SimErrorInit(char* log_file);extern void CPUError(char *,...);extern void CPUWarning(char *,...);extern void vCPUPrint(char *,va_list);extern void CPUPrint(char *,...);extern void CPUPrintFlush(void);extern void CPUPut(char *, ...);extern void lCPUPut(char *, ...);extern void CPU_nop(void);extern void CPURestartLog(void);extern void DebugInit(char* flags);/* Don't call these directly... use the macros below. */extern void Debug (char flag, char* format, ...); /* Print debug message if enabled */extern void DebugDetail(char flag, char *symbol, int cpuNum, char *text,...);extern void LogEntry(char *symbol, int cpuNum, char *text,...);#if 0#define DEBUGGING_DISABLED #endif#ifndef DEBUGGING_DISABLED#define SIM_DEBUG(arg1) Debug arg1#define SIM_DEBUG_DETAIL(arg1) DebugDetail arg1#else#define SIM_DEBUG(arg1)#define SIM_DEBUG_DETAIL(arg1) #endif/***************************************************************** Seems like a good place to track which letters are used for what:   b - backdoor/registry   i - interrupt debugging -> console, ethernet   d - dma   e - ethernet   f - fpu (mipsy/embra/whatever)   g - general -> memory allocation, checkpoints, gdb, etc.    o - solo-specific debugging (syscalls, etc.)   t - tcl (including timing)   v - visual   *****************************************************************/#endif#endif /* _LANGUAGE_ASSEMBY */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -