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

📄 ucosppcc.h

📁 ppc860平台上移植uc OS的实例
💻 H
字号:
/* file: ucosppcc.h */


/*
************************************************************
*                      UCOSPPCC.H
*                 Power PC Specific Code
************************************************************
*                      CONSTANTS
************************************************************
*/


/*
************************************************************
*                        MACROS
************************************************************
*/

#define  OS_TASK_SW()   OSCtxSw()



asm void OS_ENTER_CRITICAL (void)
{
    mfmsr   r12             # get the MSR (Machine Status Register)
    xor     r11,r11,r11     # Clear R11
	ori		r11,r11,0x8000  # set the EE Bit (External Interrupt Enable) in r11
    andc    r12,r12,r11     # and r11 with r12 (Clearing the EE Bit)
    mtmsr   r12             # Save the MSR
}

asm void OS_EXIT_CRITICAL (void)
{
    mfmsr   r12               # get the MSR (Machine Status Register)
    ori     r12,r12,0x8000    # set the EE Bit in r12
    mtmsr   r12               # save the MSR
}

typedef unsigned char  BOOLEAN;
typedef unsigned char  UBYTE;                    /* Unsigned  8 bit quantity                           */
typedef signed   char  BYTE;                     /* Signed    8 bit quantity                           */
typedef unsigned short UWORD;                    /* Unsigned 16 bit quantity                           */
typedef signed   short WORD;                     /* Signed   16 bit quantity                           */
typedef unsigned long  ULONG;                    /* Unsigned 32 bit quantity                           */
typedef signed   long  LONG;                     /* Signed   32 bit quantity                           */



/*
*********************************************************************************************************
*                                              CONSTANTS
*********************************************************************************************************
*/

#ifndef  FALSE
#define  FALSE    0
#endif

#ifndef  TRUE
#define  TRUE     1
#endif

#define OS_FAR
#define OS_STK_TYPE          UBYTE
#define OS_MAX_TASKS             63    /* Maximum number of tasks in your application                  */
#define OS_MAX_EVENTS            20    /* Maximum number of event control blocks in your application   */
#define OS_MAX_QS                 5    /* Maximum number of queue control blocks in your application   */

#define OS_IDLE_TASK_STK_SIZE  1024    /* Idle task stack size (WORDs)                                 */
#define OS_IDLE_TASK_STK_TOP   1023    /* Index into idle task top of stack                            */

#define OS_TASK_CHANGE_PRIO_EN    1    /* Include code for OSTaskChangePrio()                          */
#define OS_TASK_DEL_EN            1    /* Include code for OSTaskDel()                                 */
#define OS_SEM_EN                 1    /* Include code for SEMAPHORES                                  */
#define OS_MBOX_EN                1    /* Include code for MAILBOXES                                   */
#define OS_Q_EN                   1    /* Include code for QUEUES                                      */
#define OS_TASK_SUSPEND_EN        1    /* Include code for OSTaskSuspend() and OSTaskResume()          */

⌨️ 快捷键说明

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