|
| 1 | +/* |
| 2 | +********************************************************************************************************* |
| 3 | +* uC/OS-III |
| 4 | +* The Real-Time Kernel |
| 5 | +* |
| 6 | +* Copyright 2009-2022 Silicon Laboratories Inc. www.silabs.com |
| 7 | +* |
| 8 | +* SPDX-License-Identifier: APACHE-2.0 |
| 9 | +* |
| 10 | +* This software is subject to an open source license and is distributed by |
| 11 | +* Silicon Laboratories Inc. pursuant to the terms of the Apache License, |
| 12 | +* Version 2.0 available at www.apache.org/licenses/LICENSE-2.0. |
| 13 | +* |
| 14 | +********************************************************************************************************* |
| 15 | +*/ |
| 16 | + |
| 17 | +/* |
| 18 | +********************************************************************************************************* |
| 19 | +* |
| 20 | +* ARC |
| 21 | +* MetaWare |
| 22 | +* |
| 23 | +* Filename : os_cpu.h |
| 24 | +* Version : V3.08.02 |
| 25 | +********************************************************************************************************* |
| 26 | +*/ |
| 27 | + |
| 28 | +#ifndef _OS_CPU_H |
| 29 | +#define _OS_CPU_H |
| 30 | + |
| 31 | +#ifdef OS_CPU_GLOBALS |
| 32 | +#define OS_CPU_EXT |
| 33 | +#else |
| 34 | +#define OS_CPU_EXT extern |
| 35 | +#endif |
| 36 | + |
| 37 | +#include "embARC.h" |
| 38 | +#ifdef __cplusplus |
| 39 | +extern "C" { |
| 40 | +#endif |
| 41 | + |
| 42 | +/* |
| 43 | +********************************************************************************************************* |
| 44 | +* MACROS |
| 45 | +* |
| 46 | +* Note(s): OS_TASK_SW() invokes the task level context switch. |
| 47 | +* |
| 48 | +* (1) On some processors, this corresponds to a call to OSCtxSw() which is an assemply language |
| 49 | +* function that performs the context switch. |
| 50 | +* |
| 51 | +* (2) On some processors, you need to simulate an interrupt using a 'sowfate interrupt' or a |
| 52 | +* TRAP instruction. Some compilers allow you to add in-line assembly language as shown. |
| 53 | +********************************************************************************************************* |
| 54 | +*/ |
| 55 | + |
| 56 | +#define OS_TASK_SW() OSCtxSw() /* Simulate interrupt */ |
| 57 | + |
| 58 | +/* |
| 59 | +********************************************************************************************************* |
| 60 | +* TIMESTAMP CONFIGURATION |
| 61 | +* |
| 62 | +* Note(s) : (1) OS_TS_GET() is generally defined as CPU_TS_Get32() to allow CPU timestamp timer to be of |
| 63 | +* any data type size. |
| 64 | +* |
| 65 | +* (2) For architectures that provide 32-bit or higher precision free running counters |
| 66 | +* (i.e. cycle count registers): |
| 67 | +* |
| 68 | +* (a) OS_TS_GET() may be defined as CPU_TS_TmrRd() to improve performance when retrieving |
| 69 | +* the timestamp. You would use CPU_TS_TmrRd() if this function returned the value of |
| 70 | +* a 32-bit free running timer 0x00000000 to 0xFFFFFFFF then roll over to 0x00000000. |
| 71 | +* |
| 72 | +* (b) CPU_TS_TmrRd() MUST be configured to be greater or equal to 32-bits to avoid |
| 73 | +* truncation of TS. |
| 74 | +* |
| 75 | +* (c) The Timer must be an up counter. |
| 76 | +********************************************************************************************************* |
| 77 | +*/ |
| 78 | + |
| 79 | +#if OS_CFG_TS_EN == 1u |
| 80 | +#define OS_TS_GET() (CPU_TS)CPU_TS_Get32() /* See Note #2a. CPU_TS_TmrRd() */ |
| 81 | +#else |
| 82 | +#define OS_TS_GET() (CPU_TS)0u |
| 83 | +#endif |
| 84 | + |
| 85 | + |
| 86 | +/* |
| 87 | +********************************************************************************************************* |
| 88 | +* FUNCTION PROTOTYPES |
| 89 | +********************************************************************************************************* |
| 90 | +*/ |
| 91 | + |
| 92 | +void OSCtxSw (void); |
| 93 | +void OSIntCtxSw (void); |
| 94 | +void OSStartHighRdy (void); |
| 95 | +int OS_SysTickInit (void); |
| 96 | + |
| 97 | +#ifdef __cplusplus |
| 98 | +} |
| 99 | +#endif |
| 100 | + |
| 101 | +#endif |
0 commit comments