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

📄 bseppc.h

📁 ppc860的ucos part
💻 H
字号:
/* 
 * file: bseppc.h 
 *
 * Barnett Systems Engineering Power PC Specific 'C' Code include file
 *
 * Author: Harry E. Barnett  11/11/99
 * harryb@hbbse.com http://www.hbbse.com
 *
 * Version V1.00
 *
 */

#ifndef BSEPPC_H
#define BSEPPC_H

/* Macros */ 

/* OS_TASK_SW() is MPC8xx specific. */ 
#define	OS_TASK_SW()		asm("	sc");

/* OS_ENTER_CRITICAL() is MPC8xx specific. */ 
#define	OS_ENTER_CRITICAL()	asm("	mtspr	EID,r0");

/* OS_EXIT_CRITICAL() is MPC8xx specific. */ 
#define OS_EXIT_CRITICAL()	asm("	mtspr	EIE,r0");

#define	OS_STK_GROWTH       1 	/* Stack grows from HIGH to LOW memory on PPC  */

#define	OS_TICKS_PER_SEC	30 	/* Set the number of ticks in one second */

/*
 * TMBCLKS_PER_SEC is MPC8xx specific.
 * Used by 'ticker_start' to initialize dec_init.
 * A value of 1000000 for TMBCLKS_PER_SEC assumes EXTCLK of 4MHz,
 * and the TBS field in SCCR set to '0', i.e., that TMBCLK is OSCCLK/4.
 */ 
#define TMBCLKS_PER_SEC		1000000

/* The SMAC_set_decrementer() macro is Diab Compiler Suite specific */ 
/* Can be moved inline for another environment, e.g., GNU */ 

asm void SMAC_set_decrementer (void)
{
! "r4"
	.global	dec_init
	lis		r4,dec_init@h
	ori		r4,r4,dec_init@l
	lwz		r4,0(r4)
	mtspr	DEC,r4
}

/* Global for time tick */ 
EXTERN signed long	dec_init;

#ifndef  FALSE
#define  FALSE    0
#endif

#ifndef  TRUE
#define  TRUE     1
#endif

/* Typedefs */ 

/* 
 * The following #define's are the UCOS-II typedefs
 */ 

typedef unsigned char  BOOLEAN;
typedef unsigned char  INT8U;                    /* Unsigned  8 bit quantity                           */
typedef signed   char  INT8S;                    /* Signed    8 bit quantity                           */
typedef unsigned int   INT16U;                   /* Unsigned 16 bit quantity                           */
typedef signed   int   INT16S;                   /* Signed   16 bit quantity                           */
typedef unsigned long  INT32U;                   /* Unsigned 32 bit quantity                           */
typedef signed   long  INT32S;                   /* Signed   32 bit quantity                           */
typedef float          FP32;                     /* Single precision floating point                    */
typedef double         FP64;                     /* Double precision floating point                    */
typedef unsigned int   OS_STK;                   /* Each stack entry is 16-bit wide                    */

/* Constants */

/*
 * The following #define's are the UCOS-II configuration constants
 */

#define OS_MAX_EVENTS            20	/* Max. number of event control blocks in your application ...  */
                                   	/* ... MUST be >= 2                                             */
#define OS_MAX_MEM_PART          20	/* Max. number of memory partitions ...                         */
                                   	/* ... MUST be >= 2                                             */
#define OS_MAX_QS                20	/* Max. number of queue control blocks in your application ...  */
                                   	/* ... MUST be >= 2                                             */
#define OS_MAX_TASKS             56	/* Max. number of tasks in your application ...                 */
                                   	/* ... MUST be >= 2                                             */

#define OS_LOWEST_PRIO           63	/* Defines the lowest priority that can be assigned ...         */
                                   	/* ... MUST NEVER be higher than 63!                            */

#define OS_TASK_IDLE_STK_SIZE   512	/* Idle task stack size (# of 32-bit wide entries)              */

#define OS_TASK_STAT_EN           1	/* Enable (1) or Disable(0) the statistics task                 */
#define OS_TASK_STAT_STK_SIZE   512	/* Statistics task stack size (# of 32-bit wide entries)        */

#define OS_CPU_HOOKS_EN           1	/* uC/OS-II hooks are found in the processor port files         */
#define OS_MBOX_EN                1	/* Include code for MAILBOXES                                   */
#define OS_MEM_EN                 1	/* Include code for MEMORY MANAGER (fixed sized memory blocks)  */
#define OS_Q_EN                   1	/* Include code for QUEUES                                      */
#define OS_SEM_EN                 1	/* Include code for SEMAPHORES                                  */
#define OS_TASK_CHANGE_PRIO_EN    1	/* Include code for OSTaskChangePrio()                          */
#define OS_TASK_CREATE_EN         1	/* Include code for OSTaskCreate()                              */
#define OS_TASK_CREATE_EXT_EN     1	/* Include code for OSTaskCreateExt()                           */
#define OS_TASK_DEL_EN            1	/* Include code for OSTaskDel()                                 */
#define OS_TASK_SUSPEND_EN        1	/* Include code for OSTaskSuspend() and OSTaskResume()          */

#endif /* BSEPPC_H */ 

⌨️ 快捷键说明

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