12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- #ifndef FW_H
- #define FW_H
- #include <stdarg.h>
- #include <stddef.h>
- #include <stdint.h>
- #include <stdbool.h>
- #include "picorv32.h"
- #include "irq.h"
- /* Use builtin memcpy and memset optimizations */
- #define memset(s,c,n) __builtin_memset(s,c,n)
- #define memcpy(d,s,n) __builtin_memcpy(d,s,n)
- #define memmove(d,s,n) __builtin_memmove(d,s,n)
- #define likely(x) __builtin_expect(!!(x), 1)
- #define unlikely(x) __builtin_expect(!!(x), 0)
- /* Handy composite pointer types */
- typedef union xptr {
- uint32_t *l;
- uint16_t *w;
- uint8_t *b;
- void *v;
- size_t a;
- } xptr_t;
- typedef union xcptr {
- const uint32_t *l;
- const uint16_t *w;
- const uint8_t *b;
- const void *v;
- size_t a;
- } xcptr_t;
- extern void __attribute__((noreturn)) _die(void);
- extern void __attribute__((noreturn)) exit(int);
- extern void __attribute__((noreturn)) _exit(int);
- extern const uint8_t _end[];
- extern void *_sbrk(size_t);
- extern int disk_init(void);
- extern void read_rtc(void);
- #endif /* FW_H */
|