⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 module.h

📁 嵌入式操作系统内核
💻 H
📖 第 1 页 / 共 2 页
字号:
/* -*- Mode: C; tab-width:4 -*- *//* ex: set ts=4: *//* * Copyright (c) 2003 The Regents of the University of California. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright *    notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above *    copyright notice, this list of conditions and the following *    disclaimer in the documentation and/or other materials provided *    with the distribution. * 3. All advertising materials mentioning features or use of this *    software must display the following acknowledgement: *       This product includes software developed by Networked & *       Embedded Systems Lab at UCLA * 4. Neither the name of the University nor that of the Laboratory *    may be used to endorse or promote products derived from this *    software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * *//**  * @brief Header file for modules *  * This is the only file that module writer should include. * Currently, we do not support PC emulation on this. */#ifndef _MODULE_H#define _MODULE_H#ifndef _MODULE_#include <sos.h>#include <sos_sched.h>// Ram - I am including the following file here because the configuration// needs to know what sensor board it is being compiled to#include <sensor.h>#include <sos_error_types.h>#include <random.h>#endif#include <sos_info.h>#include <sos_types.h>#include <sos_module_types.h>#include <sos_timer.h>#include <monitor.h>#include <message_types.h>#include <codemem.h>#include <systime.h>#include <sos_cam.h>#include <pid.h>#include <stddef.h>#include <kertable_conf.h>#include <fntable_types.h>#include <sos_error_types.h>#ifdef SOS_SFI#include <memmap.h>#endif// Ram - I have removed the following include file// Module writers interacting with sensorboards// should specify the header file for that board// explicitly in their files//#include <sensor.h>#ifdef _MODULE_#include <module_proc.h>#include <module_plat.h>/* 10 */  typedef uint16_t (* ker_hw_type_ker_func_t)( void);static inline uint16_t ker_hw_type( void){	ker_hw_type_ker_func_t func = 		(ker_hw_type_ker_func_t)get_kertable_entry(10);	return func( );}/* 11 */  typedef uint16_t (* ker_id_ker_func_t)( void);static inline uint16_t ker_id( void){	ker_id_ker_func_t func = 		(ker_id_ker_func_t)get_kertable_entry(11);	return func( );}/* 12 */  typedef uint16_t (* ker_rand_ker_func_t)( void);static inline uint16_t ker_rand( void){	ker_rand_ker_func_t func = 		(ker_rand_ker_func_t)get_kertable_entry(12);	return func( );}/* 13 */  typedef uint32_t (* ker_systime32_ker_func_t)( void);static inline uint32_t ker_systime32( void){	ker_systime32_ker_func_t func = 		(ker_systime32_ker_func_t)get_kertable_entry(13);	return func( );}// sos_blk_mem_alloc/* 14 */  typedef void (* dummy14_ker_func_t)( void);static inline void dummy14( void){	dummy14_ker_func_t func = 		(dummy14_ker_func_t)get_kertable_entry(14);	func( );}// sos_blk_mem_free/* 15 */  typedef void (* dummy15_ker_func_t)( void);static inline void dummy15( void){	dummy15_ker_func_t func = 		(dummy15_ker_func_t)get_kertable_entry(15);	func( );}// sos_blk_mem_realloc/* 16 */  typedef void (* dummy16_ker_func_t)( void);static inline void dummy16( void){	dummy16_ker_func_t func = 		(dummy16_ker_func_t)get_kertable_entry(16);	func( );}// sos_blk_mem_change_own/* 17 */  typedef void (* dummy17_ker_func_t)( void);static inline void dummy17( void){	dummy17_ker_func_t func = 		(dummy17_ker_func_t)get_kertable_entry(17);	func( );}/* 18 */     typedef uint8_t *  (* ker_msg_take_data_ker_func_t)( sos_pid_t pid, Message *  msg );static inline uint8_t *  ker_msg_take_data( sos_pid_t pid, Message *  msg ){	ker_msg_take_data_ker_func_t func = 		(ker_msg_take_data_ker_func_t)get_kertable_entry(18);	return func( pid, msg );}/* 19 */     typedef int8_t (* ker_msg_change_rules_ker_func_t)( sos_pid_t sid, uint8_t rules );static inline int8_t ker_msg_change_rules( sos_pid_t sid, uint8_t rules ){	ker_msg_change_rules_ker_func_t func = 		(ker_msg_change_rules_ker_func_t)get_kertable_entry(19);	return func( sid, rules );}/* 20 */        typedef int8_t (* ker_timer_init_ker_func_t)( sos_pid_t pid, uint8_t tid, uint8_t type );static inline int8_t ker_timer_init( sos_pid_t pid, uint8_t tid, uint8_t type ){	ker_timer_init_ker_func_t func = 		(ker_timer_init_ker_func_t)get_kertable_entry(20);	return func( pid, tid, type );}/* 21 */       typedef int8_t (* ker_timer_start_ker_func_t)( sos_pid_t pid, uint8_t tid, int32_t interval );static inline int8_t ker_timer_start( sos_pid_t pid, uint8_t tid, int32_t interval ){	ker_timer_start_ker_func_t func = 		(ker_timer_start_ker_func_t)get_kertable_entry(21);	return func( pid, tid, interval );}/* 22 */        typedef int8_t (* ker_timer_restart_ker_func_t)( sos_pid_t pid, uint8_t tid, int32_t interval );static inline int8_t ker_timer_restart( sos_pid_t pid, uint8_t tid, int32_t interval ){	ker_timer_restart_ker_func_t func = 		(ker_timer_restart_ker_func_t)get_kertable_entry(22);	return func( pid, tid, interval );}/* 23 */      typedef int8_t (* ker_timer_stop_ker_func_t)( sos_pid_t pid, uint8_t tid );static inline int8_t ker_timer_stop( sos_pid_t pid, uint8_t tid ){	ker_timer_stop_ker_func_t func = 		(ker_timer_stop_ker_func_t)get_kertable_entry(23);	return func( pid, tid );}/* 24 */      typedef int8_t (* ker_timer_release_ker_func_t)( sos_pid_t pid, uint8_t tid );static inline int8_t ker_timer_release( sos_pid_t pid, uint8_t tid ){	ker_timer_release_ker_func_t func = 		(ker_timer_release_ker_func_t)get_kertable_entry(24);	return func( pid, tid );}/* 25 */               typedef int8_t (* post_link_ker_func_t)( sos_pid_t did, sos_pid_t sid, uint8_t type, uint8_t arg, void *  larg, uint16_t flag, uint16_t daddr );static inline int8_t post_link( sos_pid_t did, sos_pid_t sid, uint8_t type, uint8_t arg, void *  larg, uint16_t flag, uint16_t daddr ){	post_link_ker_func_t func = 		(post_link_ker_func_t)get_kertable_entry(25);	return func( did, sid, type, arg, larg, flag, daddr );}/* 26 */   typedef int8_t (* post_ker_func_t)( Message *  m );static inline int8_t post( Message *  m ){	post_ker_func_t func = 		(post_ker_func_t)get_kertable_entry(26);	return func( m );}/* 27 */             typedef int8_t (* post_short_ker_func_t)( sos_pid_t did, sos_pid_t sid, uint8_t type, uint8_t byte, uint16_t word, uint16_t flag );static inline int8_t post_short( sos_pid_t did, sos_pid_t sid, uint8_t type, uint8_t byte, uint16_t word, uint16_t flag ){	post_short_ker_func_t func = 		(post_short_ker_func_t)get_kertable_entry(27);	return func( did, sid, type, byte, word, flag );}/* 28 */             typedef int8_t (* post_long_ker_func_t)( sos_pid_t did, sos_pid_t sid, uint8_t type, uint8_t arg, void *  larg, uint16_t flag );static inline int8_t post_long( sos_pid_t did, sos_pid_t sid, uint8_t type, uint8_t arg, void *  larg, uint16_t flag ){	post_long_ker_func_t func = 		(post_long_ker_func_t)get_kertable_entry(28);	return func( did, sid, type, arg, larg, flag );}/* 29 */               typedef int8_t (* post_longer_ker_func_t)( sos_pid_t did, sos_pid_t sid, uint8_t type, uint8_t arg, void *  larg, uint16_t flag, uint16_t saddr );static inline int8_t post_longer( sos_pid_t did, sos_pid_t sid, uint8_t type, uint8_t arg, void *  larg, uint16_t flag, uint16_t saddr ){	post_longer_ker_func_t func = 		(post_longer_ker_func_t)get_kertable_entry(29);	return func( did, sid, type, arg, larg, flag, saddr );}/* 30 */  typedef node_loc_t (* ker_loc_ker_func_t)( void);static inline node_loc_t ker_loc( void){	ker_loc_ker_func_t func = 		(ker_loc_ker_func_t)get_kertable_entry(30);	return func( );}/* 31 */  typedef gps_t (* ker_gps_ker_func_t)( void);static inline gps_t ker_gps( void){	ker_gps_ker_func_t func = 		(ker_gps_ker_func_t)get_kertable_entry(31);	return func( );}/* 32 */     typedef uint32_t (* ker_loc_r2_ker_func_t)( node_loc_t *  loc1, node_loc_t *  loc2 );static inline uint32_t ker_loc_r2( node_loc_t *  loc1, node_loc_t *  loc2 ){	ker_loc_r2_ker_func_t func = 		(ker_loc_r2_ker_func_t)get_kertable_entry(32);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -