中斷註冊函式整理
archipcint_interruptregister (obj->remoteprocid,
obj->params.localintid,
_notifydrivershm_isr,
(ptr) obj);
int32 archipcint_interruptregister (uint16 procid,
uint32 intid,
archipcint_callbackfxn fxn,
ptr fxnargs)
archipcint_object.fxntable->interruptregister (procid, intid, fxn, fxnargs);
int32 dm8168ipcint_interruptregister (uint16 procid,
uint32 intid,
archipcint_callbackfxn fxn,
ptr fxnargs)
osalisr_params isrparams;
isrparams.sharedint = false;
isrparams.checkandclearfxn = &_dm8168ipcint_checkandclearfunc;
isrparams.fxnargs = null;
isrparams.intid = intid;
dm8168ipcint_state.isrhandle = osalisr_create (&_dm8168ipcint_isr, null, &isrparams);
osalisr_install (dm8168ipcint_state.isrhandle);
dm8168ipcint_state.isrobjects [procid].fxn = fxn;
dm8168ipcint_state.isrobjects [procid].fxnargs = fxnargs;
dm8168ipcint_state.isrobjects [procid].recvintid = intid;
dm8168ipcint_interruptenable (procid, intid);
osalisr_handle osalisr_create (osalisr_callbackfxn fxn,
ptr fxnargs,
osalisr_params * params)
osalisr_object * isrobj = null;
osalthread_params threadparams;
isrobj = memory_alloc (null, sizeof (osalisr_object), 0, null);
threadparams.priority = osalthread_priority_high;
threadparams.prioritytype = osalthread_prioritytype_generic;
threadparams.once = false;
isrobj->bottomhalf = osalthread_create ((osalthread_callbackfxn)fxn,
fxnargs,
&threadparams);
isrobj->irq = params->intid;
isrobj->issharedint = params->sharedint;
isrobj->checkfunc = params->checkandclearfxn;
isrobj->checkfuncarg = params->fxnargs;
isrobj->isrstate = osalisr_state_uninstalled;
return (osalisr_handle) isrobj;
osalthread_handle osalthread_create (osalthread_callbackfxn fxn,
ptr fxnargs,
osalthread_params * params)
osalthread_object * obj = null;
obj = (osalthread_object*) memory_alloc (null,
sizeof (osalthread_object),
0,null);
obj->cbckfxn = fxn;
obj->cbckdata = fxnargs;
init_completion (&obj->sem);
obj->task = kthread_create (thread_callback,
(ptr) obj,
"kernelthread_%d",
(tid - 1));
wake_up_process (obj->task);
return (osalthread_handle) obj;
int thread_callback (void * arg)
osalthread_object * obj = (osalthread_object *) arg;
if (obj != null)
for (;!kthread_should_stop ();)
wait_for_completion (&obj->sem);
while (atomic_read (&obj->count))
obj->cbckfxn (obj->cbckdata) ;
atomic_dec (&obj->count) ;
static bool _dm8168ipcint_isr (ptr ref)
for (i = 0 ; i < dm8168ipcint_state.maxprocessors ; i++)
dm8168ipcint_state.isrobjects [i].fxn (dm8168ipcint_state.isrobjects [i].fxnargs);
int osalisr_install (osalisr_handle isrhandle)
osalisr_object * isrobj = (osalisr_object *) isrhandle;
request_irq (isrobj->irq,
(void*) &osalisr_callback,
0,"syslink",
(void *) isrobj);
irqreturn_t osalisr_callback (int irq, ptr arg, struct pt_regs * regs)
osalisr_object * isrobj = (osalisr_object *) arg;
isasserted = (*isrobj->checkfunc) (isrobj->checkfuncarg);
osalthread_activate (isrobj->bottomhalf);
void osalthread_activate (osalthread_handle threadhandle)
osalthread_object * obj = (osalthread_object*) threadhandle;
atomic_inc (&obj->count);
complete (&obj->sem);
中斷註冊函式分析總結
include 函式原型如下 int request irq unsigned int irq,void handler int,void struct pt regs unsigned long frags,const char device,void dev id request irq uns...
KW36 註冊中斷處理函式
以註冊 2.4g radio irq 為例 鏈結檔案定義 標號 vector table ram vector table size vector ram icf 鏈結檔案 define exported symbol vector table m interrupts start define e...
linux GPIO讀取以及中斷註冊
home uart ring gpx1 1 back sim det gpx1 2 switch3 ap sleep gpc0 3 switch4 xeint6 gpx0 6 步驟 申請gpio gpio request exynos4 gpx1 1 home 設定模式,輸入模式 s3c gpio ...