📄 bspfuncs.h
字号:
/***********************************************************************//* *//* MODULE: bspfuncs.h 1.9 *//* DATE: 10:10:05 - 98/12/08 *//* PURPOSE: Function prototypes for pSOSystem Board Support Packages *//* *//*---------------------------------------------------------------------*//* *//* Copyright 1991 - 1996, Integrated Systems, Inc. *//* ALL RIGHTS RESERVED *//* *//* Permission is hereby granted to licensees of Integrated Systems, *//* Inc. products to use or abstract this computer program for the *//* sole purpose of implementing a product based on Integrated *//* Systems, Inc. products. No other rights to reproduce, use, *//* or disseminate this computer program, whether in part or in *//* whole, are granted. *//* *//* Integrated Systems, Inc. makes no representation or warranties *//* with respect to the performance of this computer program, and *//* specifically disclaims any responsibility for any damages, *//* special or consequential, connected with the use of this program. *//* *//***********************************************************************/#if defined(__cplusplus) extern "C" {#endif/*---------------------------------------------------------------------*//* Don't allow this file to be included more than once. *//*---------------------------------------------------------------------*/#ifndef _BSPFUNCS_H#define _BSPFUNCS_H#include "bsp.h"#include <psos.h>#include <pna.h>/*---------------------------------------------------------------------*//* General Definitions *//*---------------------------------------------------------------------*/#include <types.h>#define MAX_ILEV 6ULONG splx(ULONG mask);/***********************************************************************//* *//* CPU-Related Functions *//* *//***********************************************************************/ typedef enum vector_type { VT_DIRECT = 0, VT_STACK = 1, VT_REG = 2, VT_SC = 3, VT_SC604 = 4, VT_SC403 = 5, VT_C = 6, VT_OLD = 7, VT_STACK3 = 8, VT_CRITICAL = 9, VT_INTR = 10, VT_INTR403 = 11 } VECTOR_TYPE; void SysSetVector(unsigned long offset, void (*handler)(), VECTOR_TYPE vt, unsigned long enable_mask); /*----------------------------------------------------------------------*/ /* Vector offsets - these vary somewhat among members of the */ /* processor family: */ /* */ /* Processors */ /* 601 603 403GA 821 */ /* Label Offset Explanation 604 860 */ /* ========= ====== ================= === === === === */# define V_RESET 0x0100 /* System reset x x x */# define V_CRITINT 0x0100 /* Critical interrupt x */# define V_MACH_CK 0x0200 /* Machine check x x x x */# define V_DA 0x0300 /* Data access x x */# define V_PROTECT 0x0300 /* Prot. violation x */# define V_IA 0x0400 /* Instruction access x x */# define V_INTRPT 0x0500 /* External interrupt x x x x */# define V_ALIGN 0x0600 /* Alignment x x x x */# define V_PROGRAM 0x0700 /* Program x x x x */# define V_FLOAT 0x0800 /* Fltg-pt unavail x x */# define V_DCRMNTR 0x0900 /* Decrementer x x x */# define V_IOERROR 0x0A00 /* I/O ctrlr intfc err x */# define V_SYSCALL 0x0C00 /* System call x x x x */# define V_TRACE 0x0D00 /* Trace exception x x */# define V_TIMERS 0x1000 /* On-chip timers x */# define V_WATCHDG 0x1020 /* watch dog timer x */# define V_IA_BP 0x1300 /* Instr addr bkpt x */# define V_ITLB 0x1000 /* Instruction TLB Miss x x */# define V_DLTLB 0x1100 /* Data Load TLB miss x x */# define V_DSTLB 0x1200 /* Data Store TLB miss x x */# define V_RUNMODE 0x2000 /* Run mode exception x */# define V_DEBUG 0x2000 /* 403 debug exception x */# define V_SEI821 0x1000 /* 821 Ileagle Instr x */# define V_IA_BP821 0x1D00 /* 821 Instruction access breakpoint x */# define V_DA_BP821 0x1C00 /* 821 memory access breakpoint x */ /*------------------------------------------*/ /*-----------------------------------------------------------------*/ /* MMU Related Defines */ /*-----------------------------------------------------------------*/#if BSP_MMU UCHAR *BspMmuInit(ULONG); void BspMmuTransOn(void); void BspMmuTransOff(void);#endif /*-----------------------------------------------------------------*/ /* Cache Support */ /*-----------------------------------------------------------------*/ extern void SysDcacheFlush(void *offset, ULONG length); extern void SysIcacheInv(void *offset, ULONG length); extern ULONG SysDcacheInhibit(void); extern void SysIcacheInhibit(void);#define SYS_DCACHE_FLUSH_DISABLE \ { \ unsigned long oldlev,i; \ oldlev = splx(MAX_ILEV); \ i = SysDcacheInhibit(); \ splx(oldlev); \ }#define SYS_ICACHE_DISABLE \ { \ unsigned long oldlev; \ oldlev = splx(MAX_ILEV); \ SysIcacheInhibit(); \ splx(oldlev); \ } /*-----------------------------------------------------------------*/ /* Interrupt handling */ /*-----------------------------------------------------------------*/ void SysSetInterrupt(unsigned long IntNr, void (*handler)()); void IntWrapper(void); void pSOSIntWrapper(void); void pSOSpMontIntWrapper(void); /*-----------------------------------------------------------------*/ /* BspCpuType returns the processor type as follows: */ /* Bits 24-31: PPC601, PPC603, PPC604, PPC620, or PPC403GA. */ /* Bit 23: 1 if FPU is present, 0 if not. */ /* Bit 22: 1 if MMU is present, 0 if not. */ /* BspRamBase returns the starting address of local RAM as seen */ /* by the processor. */ /*-----------------------------------------------------------------*/ unsigned long BspCpuType(void); # define PROC_MASK 0xFF /* "processor type" portion of ret val */# define PPC601 0# define PPC603 1# define PPC604 2# define PPC620 3# define PPC403GA 4# define PPC821 5 unsigned long BspRamBase(void);/***********************************************************************//* *//* Startup Routines *//* *//***********************************************************************/void HdwInit(void);#if BSP_VME void SetVmeAddress(ULONG BaseAddress);#endifULONG RamSize(void);void SysInitFail(const char *string);/***********************************************************************//* *//* Miscellaneous Routines *//* *//***********************************************************************/void StorageRead(UINT nbytes, void *StartOffset, void *buff);void StorageWrite(UINT nbytes, void *StartOffset, void *buff);void root(void);#if BSP_PARMS #include <apdialog.h> void BspGetdefaults(void *ParmStruct); void BspPrint(void *ParmStruct, void(*PrintRoutine)(char *format, ...)); void BspModify(void *ParmStruct, void(*PrintRoutine)(char *format, ...), void(*PromptRoutine)(char *prompt, PARM_TYPE ptype, void *paramptr)); void BspUse(void *ParmStruct);#endif#if BSP_ABORTSWunsigned long ClrAbortInt(void);#endif/***********************************************************************//* *//* Serial Driver Routines *//* *//***********************************************************************/ #if BSP_NEW_SERIAL void ProbeIOInit (void); ULONG ProbeConsts (unsigned long); UCHAR ProbeConin (void); void ProbeConout (unsigned char); ULONG ProbeHststs (void); UCHAR ProbeHstin (void); void ProbeHstout (unsigned char); void ProbeEntry (void); void ProbeExit (void); void ProbeIOClose (void); #else void SerialPollOn(void); void SerialPollOff(void); void SerialPollInit(void); ULONG SerialPollConsts(ULONG typecode); UCHAR SerialPollConin(void); void SerialPollConout(UCHAR c); ULONG SerialPollHststs(ULONG typecode); UCHAR SerialPollHstin(void); void SerialPollHstout(UCHAR c); void *SerialIntInit(ULONG channel, void (*rx_isr)(ULONG channel),
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -