| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- /******************************************************************************
- 版权所有:
- 文件名称: rt.h
- 文件版本: 01.01
- 创建作者: sunxi
- 创建日期: 2020-06-18
- 功能说明: 实时微系统头文件
- 其它说明:
- 修改记录:
- */
- #ifndef _RT_H
- #define _RT_H
- /*------------------------------- 头文件 --------------------------------------
- */
- //#include "my_include/watchdog_os.h"
- #include <unistd.h>
- #include <stdio.h>
- #include <string.h>
- #include <stdlib.h>
- #include <time.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <fcntl.h>
- #include <sys/types.h> /* See NOTES */
- #include <sys/socket.h>
- #include <netinet/in.h>
- #include <net/if.h>
- #include <arpa/inet.h>
- #include <linux/sockios.h>
- #include <sys/ioctl.h>
- #include <linux/types.h>
- #include <asm-generic/errno.h>
- #include "rt_types.h"
- #include "rt_fifo.h"
- #include "rt_printf.h"
- #include "rt_console.h"
- #include "rt_stat.h"
- #include "rt_clib.h"
- #include "rt_file.h"
- #include "rt_socket.h"
- #include "rt_error.h"
- #include "rt_log.h"
- #include "rt_env.h"
- /*------------------------------- 宏定义 --------------------------------------
- */
- static inline int is_power_of_2(unsigned long n)
- {
- return (n != 0 && ((n & (n - 1)) == 0));
- }
- static inline void msleep(unsigned int ms)
- {
- usleep(ms * 1000);
- }
- extern int g_clock_mode;
- extern int g_clock_mode_gps;
- /*------------------------------ 类型结构 -------------------------------------
- */
- /*------------------------------ 函数声明 -------------------------------------
- */
- int rt_init(void);
- int rt_exit(void);
- #define rt_malloc malloc
- #define rt_free free
- #define min(a,b) (a>b?b:a)
- //#define rt_printf printf
- #define sys_newstat stat
- #define clk_time_get(ts) clock_gettime(CLOCK_REALTIME, ts); ((struct timespec*)(ts))->tv_sec += 8*60*60;
- #define rt_save_flags(x) do{}while(0)//asm volatile ("movew %%sr,%0":"=d" (x) : : "memory")
- #define rt_irq_disable() do{}while(0) \
- /*asm volatile ( "move %/sr,%%d0\n\t" \
- "ori.l #0x0700,%%d0\n\t" \
- "move %%d0,%/sr\n" \
- : : : "cc", "%d0", "memory")
- */
- #define rt_irq_restore(x) do{}while(0)//asm volatile ("movew %0,%%sr": :"d" (x) : "memory")
- #define rt_irq_save(x) do{}while(0)//({ rt_save_flags(x); rt_irq_disable(); })
- #define rt_free_irq(x) do{}while(0)
- #define rt_request_irq(...) do{}while(0)//(113, 6, fec2_enet_interrupt, "fec2(TXF)");
- #define rt_irq_level(x); do{}while(0)
- #define simple_strtoul strtoul
- #endif //_RT_H
- /*------------------------------ 文件结束 -------------------------------------
- */
|