1 /* 2 * Copyright (C) 2015-2020 Alibaba Group Holding Limited 3 */ 4 #ifndef __OSIF_H__ 5 #define __OSIF_H__ 6 #include <stdint.h> 7 8 typedef uint32_t osif_timer_t; 9 10 typedef void (*osif_timer_callback)(void); 11 12 #if defined(__cplusplus) 13 extern "C" { 14 #endif 15 16 bool osif_init(void); 17 18 uint32_t osif_get_sys_time(void); 19 20 uint16_t osif_rand(void); 21 22 void osif_stop_hardware(void); 23 24 void osif_resume_hardware(void); 25 26 void osif_memcopy(uint8_t *dest, const uint8_t *source, uint32_t numBytes); 27 28 bool osif_memcmp(const uint8_t *buffer1, uint16_t len1, const uint8_t *buffer2, uint16_t len2); 29 30 void osif_memset(uint8_t *dest, uint8_t byte, uint32_t len); 31 32 uint8_t osif_strcmp(const char *Str1, const char *Str2); 33 34 uint16_t osif_strlen(const char *Str); 35 36 void osif_assert(const char *expression, const char *file, uint16_t line); 37 38 void osif_lock_stack(void); 39 40 void osif_unlock_stack(void); 41 42 void osif_notify_evm(void); 43 44 void osif_start_timer(osif_timer_t t, osif_timer_callback func); 45 46 void osif_cancel_timer(void); 47 48 uint8_t osif_lock_is_exist(void); 49 50 #if defined(__cplusplus) 51 } 52 #endif 53 54 #endif /*__OSIF_H__*/ 55 56