portkc51.h
来自「嵌入式操作系统Salvo 在单片机C8051F350上的移植」· C头文件 代码 · 共 121 行
H
121 行
/************************************************************
The contents of this file are subject to the Pumpkin Salvo
License (the "License"). You may not use this file except
in compliance with the License. You may obtain a copy of
the License at http://www.pumpkininc.com, or from
warranty@pumpkininc.com.
Software distributed under the License is distributed on an
"AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
or implied. See the License for specific language governing
the warranty and the rights and limitations under the
License.
The Original Code is Salvo - The RTOS that runs in tiny
places(TM). Copyright (C) 1995-2002 Pumpkin, Inc. and its
Licensor(s). All Rights Reserved.
$Source: C:\\RCS\\d\\salvo\\inc\\portkc51.h,v $
$Author: aek $
$Revision: 3.6 $
$Date: 2002-12-06 17:42:31-08 $
Porting file for 8051-type micros and Keil C51.
************************************************************/
#if OSMAKE_LIBRARY
//#include <reg51.h>
#include <C8051F350.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <stdarg.h>
/* OSDi() and OSEi() are the usual. */
#if !defined(OSDi)
#define OSDi() EA = 0
#endif
#if !defined(OSEi)
#define OSEi() EA = 1
#endif
/* makes for small code. */
#define OSLOC_DEFAULT idata
/* default for messages. */
#if !defined(OSMESSAGE_TYPE)
#define OSMESSAGE_TYPE idata
#endif
/* OSEnterCritical() and OSLeaveCritical() preserve */
/* interrupt status. Cannot be used with optimizer */
/* level 9 (common block subroutine packing) */
/* because it operates unilaterally on the stack. */
#if OSPRESERVE_INTERRUPT_MASK
#pragma OT(8, SIZE)
#if !defined(OSEnterCritical)
#define OSEnterCritical() do { \
SP++; \
*(unsigned char idata *)SP = IE; \
EA = 0; \
OSDiHook(); \
} while (0)
#endif /* # ifndef */
#if !defined(OSLeaveCritical)
#define OSLeaveCritical() do { \
OSEiHook(); \
IE = *(unsigned char idata *)SP; \
SP--; \
} while (0)
#endif /* # ifndef */
#endif /* #if OSPRESERVE_INTERRUPT_MASK */
/* code pointers must be qualified. */
#define OSTASK_POINTER_TYPE code
/* supported. */
#define OSUSE_CHAR_SIZED_BITFIELDS TRUE
/* should work fine. */
#define OSUSE_MEMSET TRUE
/* printf() supports p (pointer) format. */
#define OSUSE_PRINTF_P_FORMAT TRUE
/************************************************************
**** ****
** **
Notes
1. Default is for Salvo vars to be anywhere in 256-byte
RAM.
2. Void pointers for messages are very big. xdata pointers
don't work 12/2001.
3. Multiple callgraphs are handled by making the relevant
functions reentrant. Therefore protection is not required.
4. OSCtxSw() is in port8051.c.
** **
**** ****
************************************************************/
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?