📄 sec2drvtest.h
字号:
/**************************************************************************** * sec2drvTest.h - master include file for for SEC2 device driver test suite **************************************************************************** * Copyright (c) 2004-2005 Freescale Semiconductor * All Rights Reserved. Proprietary and Confidential. * * NOTICE: The information contained in this file is proprietary * to Freescale Semiconductor, and is being made available to * Freescale's customers under strict license agreements. * Use or disclosure of this information is permissible only * under the terms of the existing license agreement. ***************************************************************************//* Revision History: * 1.1.0 Dec 05,2004 sec - prep for linux-compatible driver release * 1.2 02-Feb-2005 */#ifdef VXWORKS#include <stdlib.h>#include <string.h>#include <errno.h>#include "iosLib.h"#include "semLib.h"#include "cacheLib.h"#include "signal.h"#define getpid taskIdSelf#define usleep taskDelay#endif#ifdef _LINUX_USERMODE_#include <stdio.h>#include <fcntl.h>#include <sys/types.h>#include <unistd.h>#include <signal.h>#include <errno.h>#endif#ifdef __KERNEL__#include <linux/compatmac.h>#include <linux/mm.h>#undef malloc#undef free#define free kfree#define malloc(a) kmalloc(a, GFP_KERNEL)#undef semGive#undef semTake#define semDelete(x)#define semGive(a) up(&a)#define semTake(a, b) down_interruptible_timeout(&a, b)#undef printf#define printf printk#define ioctl subIoctlextern long __down_interruptible_timeout(struct semaphore *sem, long timeout);extern inline int down_interruptible_timeout(struct semaphore *sem, long timeout){ int ret = 0;#if WAITQUEUE_DEBUG CHECK_MAGIC(sem->__magic);#endif if (atomic_dec_return(&sem->count) < 0) ret = __down_interruptible_timeout(sem, timeout); smp_wmb(); return ret;}#define taskIdSelf() current->pid#endif#define SEC2_DEVNAME "/dev/sec2"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -