1 /*
2  * Copyright (C) 2016 YunOS Project. All rights reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *   http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef PORT_H
18 #define PORT_H
19 
20 #include <k_types.h>
21 #include <k_task.h>
22 
23 #ifdef CONFIG_OS_TRACE
24 #include <trcTrig.h>
25 #include <trcUser.h>
26 #include <trcKernelPort.h>
27 #endif
28 
29 cpu_cpsr_t cpu_intrpt_save(void);
30 void   cpu_intrpt_restore(cpu_cpsr_t cpsr);
31 void   cpu_intrpt_switch(void);
32 void   cpu_task_switch(void);
33 void   cpu_first_task_start(void);
34 
35 void  *cpu_task_stack_init(cpu_stack_t *base, size_t size, void *arg, task_entry_t entry);
36 
cpu_cur_get(void)37 RHINO_INLINE uint8_t cpu_cur_get(void)
38 {
39     return 0;
40 }
41 
42 #define CPSR_ALLOC()                cpu_cpsr_t cpsr
43 
44 #define RHINO_CPU_INTRPT_DISABLE()  do{cpsr = cpu_intrpt_save();}while(0)
45 #define RHINO_CPU_INTRPT_ENABLE()   do{cpu_intrpt_restore(cpsr);}while(0)
46 
47 #endif /* PORT_H */
48 
49