/* * Copyright (C) 2016 YunOS Project. All rights reserved. * * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef PORT_H #define PORT_H #include #include #ifdef CONFIG_OS_TRACE #include #include #include #endif cpu_cpsr_t cpu_intrpt_save(void); void cpu_intrpt_restore(cpu_cpsr_t cpsr); void cpu_intrpt_switch(void); void cpu_task_switch(void); void cpu_first_task_start(void); void *cpu_task_stack_init(cpu_stack_t *base, size_t size, void *arg, task_entry_t entry); RHINO_INLINE uint8_t cpu_cur_get(void) { return 0; } #define CPSR_ALLOC() cpu_cpsr_t cpsr #define RHINO_CPU_INTRPT_DISABLE() do{cpsr = cpu_intrpt_save();}while(0) #define RHINO_CPU_INTRPT_ENABLE() do{cpu_intrpt_restore(cpsr);}while(0) #endif /* PORT_H */