📄 endiantest.c
字号:
/* * dspapps/dsp/task_testB/endiantest.c * * Test task for endian conversion between ARM and DSP * * 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: endiantest.c * $Revision: 2.0 * $Date: 2003/11/11 * */#include <std.h>#include "omap1510.h"#include "mailbox.h"#include "tokliBIOS.h"#define is_external(adr) \ ((((LgUns)(adr) >= DARAM_BASE) && \ ((LgUns)(adr) < SARAM_TOP)) ? FALSE : TRUE)static Uns et_rcv_bksnd(struct dsptask *task, Uns bid, Uns cnt);static Uns et_rcv_bkreq(struct dsptask *task, Uns cnt);struct task_et { struct dsptask task_head; LgUns rcvdata;};struct task_et task_endiantest = { { TID_MAGIC, // tid "endiantest", // name MBCMD_TTYP_BKDM | MBCMD_TTYP_BKMD, // ttyp: passive block snd, passive block rcv et_rcv_bksnd, // rcv_snd et_rcv_bkreq, // rcv_req NULL, // rcv_tctl NULL // tsk_attrs },};static Uns et_rcv_bksnd(struct dsptask *task, Uns bid, Uns cnt){ if(is_external(ipbuf_d)) ((struct task_et*)task)->rcvdata = *((LgUns*)&ipbuf_d[bid][1]); else ((struct task_et*)task)->rcvdata = ((LgUns)ipbuf_d[bid][1] << 16) | ipbuf_d[bid][0]; unuse_ipbuf(task, bid); return 0;}static Uns et_rcv_bkreq(struct dsptask *task, Uns cnt){ Uns bid; LgUns dat_inc = ((struct task_et*)task)->rcvdata+1; bid = get_free_ipbuf(task); if(bid == MBCMD_BID_NULL) return MBCMD_EID_STVBUF; if(is_external(ipbuf_d)) *((LgUns*)&ipbuf_d[bid][1]) = dat_inc; else { ipbuf_d[bid][0] = dat_inc & 0xffff; ipbuf_d[bid][1] = dat_inc >> 16; } bksnd(task, bid, 2); return 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -