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

📄 kernel.h

📁 日本著名的的嵌入式实时操作系统T-Kernel的源码及用户手册。
💻 H
字号:
/* *---------------------------------------------------------------------- *    T-Kernel * *    Copyright (C) 2004 by Ken Sakamura. All rights reserved. *    T-Kernel is distributed under the T-License. *---------------------------------------------------------------------- * *    Version:   1.01.00 *    Released by T-Engine Forum(http://www.t-engine.org) at 2004/6/28. * *---------------------------------------------------------------------- *//* *	kernel.h (T-Kernel/OS) *	T-Kernel Common Definition */#ifndef _KERNEL_#define _KERNEL_#include <basic.h>#include <tk/typedef.h>#include <tk/errno.h>#include <tk/syscall.h>#include <tk/dbgspt.h>#include <sys/imalloc.h>#include <sys/queue.h>#include <libstr.h>#include "isyscall.h"#define SYSCALL		EXPORT		/* Definition of system call *//* * Kernel configuration file */#include "config.h"#include "cpu_conf.h"#include "tkdev_conf.h"#include "isysconf.h"#ifndef __tcb__#define __tcb__typedef struct task_control_block	TCB;#endif/* * Object lock *	Locked task is the highest run priority. *	Unable to nest lock. */typedef struct objlock {	QUEUE		wtskq;		/* Wait task queue */} OBJLOCK;Inline void InitOBJLOCK( OBJLOCK *loc ){	loc->wtskq.next = NULL;}IMPORT void LockOBJ( OBJLOCK* );IMPORT void UnlockOBJ( OBJLOCK* );Inline BOOL isLockedOBJ( OBJLOCK *loc ){	return ( loc->wtskq.next != NULL )? TRUE: FALSE;}/* * Extended SVC lock *	The priority does not change during lock. *	Able to nest lock. */typedef struct svclock {	QUEUE		wtskq;		/* Wait task queue */	struct svclock	*locklist;	/* List during lock */} SVCLOCK;Inline void InitSVCLOCK( SVCLOCK *loc ){	loc->wtskq.next = NULL;}IMPORT void LockSVC( SVCLOCK* );IMPORT void UnlockSVC( void );IMPORT void AllUnlockSVC( TCB *tcb );/* * Maximum ID number of each object *	1 - max_??? is valid ID. */IMPORT ID	max_tskid;IMPORT ID	max_semid;IMPORT ID	max_flgid;IMPORT ID	max_mbxid;IMPORT ID	max_mbfid;IMPORT ID	max_porid;IMPORT ID	max_mtxid;IMPORT ID	max_mplid;IMPORT ID	max_mpfid;IMPORT ID	max_cycid;IMPORT ID	max_almid;IMPORT ID	max_ssyid;IMPORT ID	max_resid;#define	SYS_RESID	MIN_RESID	/* System resource ID *//* * Other system information */IMPORT INT	default_sstksz;		/* Default system stack size */IMPORT PRI	max_ssypri;		/* Maximum subsystem priority *//* * CPU-dependent include file */#include "cpu_status.h"/* * System initialization (each module) */IMPORT ER task_initialize( void );IMPORT ER semaphore_initialize( void );IMPORT ER eventflag_initialize( void );IMPORT ER mailbox_initialize( void );IMPORT ER messagebuffer_initialize( void );IMPORT ER rendezvous_initialize( void );IMPORT ER mutex_initialize( void );IMPORT ER memorypool_initialize( void );IMPORT ER fix_memorypool_initialize( void );IMPORT ER cyclichandler_initialize( void );IMPORT ER alarmhandler_initialize( void );IMPORT ER subsystem_initialize( void );IMPORT ER resource_group_initialize( void );/* * Start/Exit system (tkstart.c) */IMPORT void t_kernel_main( T_CTSK* );IMPORT void t_kernel_exit( void );/* * Target system-dependent routine (cpu_init.c tkdev_init.c) */IMPORT ER   cpu_initialize( void );IMPORT void cpu_shutdown( void );IMPORT ER   tkdev_initialize( void );IMPORT void tkdev_exit( void );/* * Mutex */IMPORT void signal_all_mutex( TCB *tcb );IMPORT INT chg_pri_mutex( TCB *tcb, INT priority );#endif /* _KERNEL_ */

⌨️ 快捷键说明

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