summaryrefslogtreecommitdiffstats
path: root/data/sysrom/sysrom.h
blob: 7c44d664217516fd20781657719530221f8f5509 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef SYSROM_H
#define SYSROM_H

#include <klibc/compiler.h>
#include <stddef.h>
#include <stdint.h>

#define ELEMENTS(x) (sizeof(x)/sizeof((x)[0]))

typedef void (*ivt_t)(void);
extern ivt_t ivt[256];

extern unsigned int vsync_ctr;
extern unsigned int timer_ctr;

void sys_start(void);		/* Primary C entry point */
__noreturn __unknown_trap(uint32_t trap_status, uint32_t pc);
void monitor(void);
__noreturn die(void);
void __spurious_irq(void);

void sdcard_timer_tick(void);
int sdcard_read_sectors(void *buf, uint32_t lba, int count);
int sdcard_write_sectors(const void *buf, uint32_t lba, int count);

int exec_file(const char *filename, void *addr);
void disk_boot(void);

ssize_t syscon_write(int fd, const void *buf, size_t count);
void syscon_init(void);

void keyboard_init(void);

#endif /* SYSROM_H */