📄 swi.h
字号:
/*
* Copyright 2003 by Texas Instruments Incorporated.
* All rights reserved. Property of Texas Instruments Incorporated.
* Restricted rights to use, duplicate or disclose this code are
* granted through contract.
*
*/
/* "@(#) DSP/BIOS 4.90.270 12-18-03 (barracuda-o04)" */
/*
* ======== swi.h ========
*
*/
#ifndef SWI_
#define SWI_
#include <fxn.h>
#include <sts.h>
#ifdef __cplusplus
extern "C" {
#endif
#define SWI_MINPRI 1
#define SWI_MAXPRI 14
#define SWI_getpri(swi) ( (swi)->mask )
typedef Void (*SWI_Fxn) (Arg,Arg);
typedef struct SWI_Obj {
Int lock;
Ptr ready;
Uns mask;
Ptr link;
Uns initkey;
Uns mailbox;
FXN_Obj fxnobj;
Int stslock;
STS_Obj *sts; /* pointer to STS_Obj */
} SWI_Obj;
typedef struct SWI_Obj *SWI_Handle;
typedef struct SWI_Attrs {
SWI_Fxn fxn;
Arg arg0;
Arg arg1;
#if defined(_54_)
Bool iscfxn;
#endif
Int priority;
Uns mailbox;
} SWI_Attrs;
extern SWI_Attrs SWI_ATTRS; /* declared in swi_recr.c */
extern Uns SWI_D_curmask;
extern Int SWI_D_lock;
extern Void SWI_andn(SWI_Handle swi, Uns key);
extern Void SWI_dec(SWI_Handle swi);
extern Void SWI_disable(Void);
extern Void SWI_enable(Void);
extern Void SWI_inc(SWI_Handle swi);
extern Void SWI_or(SWI_Handle swi, Uns key);
extern Void SWI_post(SWI_Handle swi);
extern Uns SWI_getmbox(Void);
extern SWI_Handle SWI_self(Void);
extern Uns SWI_raisepri(Uns mask);
extern Void SWI_restorepri(Uns key);
extern SWI_Handle SWI_create(SWI_Attrs *attrs);
extern Void SWI_delete(SWI_Handle swihandle);
extern Void SWI_getattrs(SWI_Handle swihandle, SWI_Attrs *attrs);
extern Void SWI_setattrs(SWI_Handle swihandle, SWI_Attrs *attrs);
/*
* Below two SWI hook functions are primarily needed to hide
* the Argument/register type nuances arising from C55xx codegen
* conventions (Pointers use [X]ARs while Integers go on T0/T1).
* However, to keep the generality, we have added these two
* distinct function prototypes for use in calling user specified
* C functions in association w/ Bios objects - like say the
* PIP notifier functions.
*
* For C54x and C6xx, the below two prototypes simply alias with
* their corresponding vanilla version viz., SWI_andn() and SWI_or()
*
*/
extern Void SWI_andnHook(Arg swi, Arg key);
extern Void SWI_orHook(Arg swi, Arg key);
#ifdef __cplusplus
}
#endif /* extern "C" */
#endif /* SWI_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -