📄 toklibioslib.h
字号:
/* * dspapps/dsp/tokliBIOS/supertask.h * * Header for OMAP DSP bridge DSP-side core library * * Copyright (C) 2002,2003 Nokia Corporation * * Written by Toshihiro Kobayashi <toshihiro.kobayashi@nokia.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id: tokliBIOSlib.h * $Revision: 2.0 * $Date: 2003/11/11 * */#ifndef __TOKLIBIOSLIB_H#define __TOKLIBIOSLIB_H#define TQ_USE_MALLOC // FIXME: delete!#undef BKYLD_IN_INTHANDLER#include <std.h>#include <sem.h>#include <tsk.h>#include "omap1510.h"#include "mailbox.h"#include "list.h"#include "tokliBIOS.h"struct ipbuf { Uns c; // count Uns next; // link Uns la; // lock owner (ARM side) Uns sa; // sync word (ARM->DSP) Uns ld; // lock owner (DSP side) Uns sd; // sync word (DSP->ARM) Uns d[1]; // data};struct ipbuf_p { Uns c; // count Uns s; // sync word Uns al; // data address lower Uns ah; // data address upper};struct mailboxq { Uns cmd_h; Uns data;};struct procq { struct list_head list_head; Uns (*func)(struct dsptask *task); Uns tid;};#define MBQ_MAX 8#ifndef TQ_USE_MALLOC#define TQ_MAX 8#endif/* * task private properties */#define TASK_STAT_RUNNING 1#define TASK_STAT_STOP 2struct task_prop { struct ipbuf_p ipbuf_p_snd, ipbuf_p_req; TSK_Handle tsk; SEM_Handle sem; Int stat; Uns mbq_wp, mbq_rp; struct mailboxq mbq[MBQ_MAX];};#define N_TASK_MAX 32 // FIXME!!!extern Int _n_task;extern struct dsptask *task_user[];extern struct dsptask *dsptask[];extern struct task_prop *task_prop[];extern struct dsptask task_anon;extern struct ipbuf **ipbuf;extern Uns _ipbuf_sz;extern Uns _ipbuf_lines;extern Uns _ipbuf_keep;extern Int _ipbuf_body[];extern struct ipbuf_p ipbuf_sys;struct ipblink { Uns top; Uns tail;};#define INIT_IPBLINK(link) \ do { \ (link)->top = MBCMD_BID_NULL; \ (link)->tail = MBCMD_BID_NULL; \ } while(0)#define ipblink_empty(link) ((link)->top == MBCMD_BID_NULL)static inline Void ipblink_del_top(struct ipblink *link, struct ipbuf **ipbuf){ struct ipbuf *bufp = ipbuf[link->top]; if((link->top = bufp->next) == MBCMD_BID_NULL) link->tail = MBCMD_BID_NULL; else bufp->next = MBCMD_BID_NULL;}static inline Void ipblink_add_tail(struct ipblink *link, Uns bid, struct ipbuf **ipbuf){ if(ipblink_empty(link)) link->top = bid; else ipbuf[link->tail]->next = bid; link->tail = bid;}#define is_external(adr) \ ((((LgUns)(adr) >= DARAM_BASE) && \ ((LgUns)(adr) < SARAM_TOP)) ? FALSE : TRUE)#define mbcmd(cmd,tid) ((Uns)cmd<<8 | tid)#define sys_cmderr(eid,dat) mbsend(mbcmd(MBCMD_ERR,eid),dat)static inline Void busywait(Uns cnt){ Uns i; for(i=0; i<cnt; i++);}extern Void mbsend(Uns cmd, Uns data);extern Uns release_ipbuf(Uns bid);extern Void balance_ipbuf(Void);extern Uns sync_ipbuf(Uns tid, Uns bid);extern Uns sync_ipbuf_anon(Uns bid);extern Void init_ipbuf(Void);extern Void task_config(struct dsptask *task, struct task_prop *prop, Uns tid);extern Void task_unconfig(Uns tid);extern Int register_mbq(Uns tid, Uns cmd_h, Uns data);extern Void init_tasks(Void);extern Void init_super(Void);extern Void supertask(Void);extern Void register_super_mbq(Uns cmd_h, Uns cmd_l, Uns data);extern Void init_icr(Void);extern Uns get_icr_mask(Void);extern Void set_icr_mask(Uns val);#ifdef DEBUG_WAKEUP_CNTextern LgUns get_wakeup_cnt();extern Void clear_wakeup_cnt();#endif /* DEBUG_WAKEUP_CNT */extern Void init_wdt(Void);extern Void wdt_reflesh(Void);extern Void wdt_start(Void);extern Void wdt_stop(Void);extern Void init_timer(Void);extern Void timer1_start(Void);extern Void timer1_stop(Void);extern Void init_tq(Void);extern Void *register_tq_1s(struct dsptask *task, Uns (*f)(struct dsptask *task));extern Void unregister_tq_1s(struct dsptask *task, Void *id);#endif /* __TOKLIBIOSLIB_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -