/* Temporaries used for block I/O */
blkno_t u_block; /* Block number */
uint16_t u_blkoff; /* Offset in block */
- uint16_t u_nblock; /* Number of blocks */
+ usize_t u_nblock; /* Number of blocks */
uint8_t *u_dptr; /* Address for I/O */
#ifdef CONFIG_LEVEL_2
extern int uget(const void *userspace_source, void *dest, usize_t count);
extern int16_t ugetc(const void *userspace_source);
extern uint16_t ugetw(const void *userspace_source);
+extern uint32_t _ugetl(void *uaddr);
extern int ugets(const void *userspace_source, void *dest, usize_t maxlen);
extern int uput (const void *source, void *userspace_dest, usize_t count);
extern int uputc(uint16_t value, void *userspace_dest); /* u16_t so we don't get wacky 8bit stack games */
extern int uputw(uint16_t value, void *userspace_dest);
+extern int _uputl(uint32_t val, void *uaddr);
extern int uzero(void *userspace_dest, usize_t count);
/* usermem.c or usermem_std.s */
/* swap.c */
extern uint16_t swappage;
-extern int swapread(uint16_t dev, blkno_t blkno, unsigned int nbytes,
- uint16_t buf, uint16_t page);
-extern int swapwrite(uint16_t dev, blkno_t blkno, unsigned int nbytes,
- uint16_t buf, uint16_t page);
+extern int swapread(uint16_t dev, blkno_t blkno, usize_t nbytes,
+ uaddr_t buf, uint16_t page);
+extern int swapwrite(uint16_t dev, blkno_t blkno, usize_t nbytes,
+ uaddr_t buf, uint16_t page);
extern void swapmap_add(uint8_t swap);
extern int swapmap_alloc(void);
extern void platform_idle(void);
extern uint8_t rtc_secs(void);
extern void trap_reboot(void);
-extern uint8_t platform_param(unsigned char *p);
+extern uint8_t platform_param(char *p);
/* Will need a uptr_t eventually */
extern uaddr_t ramtop; /* Note: ramtop must be in common in some cases */
#define BOOTDEVICENAMES "" /* numeric parsing only */
#endif
-static uint8_t system_param(unsigned char *p)
+static uint8_t system_param(char *p)
{
if (*p == 'r' && p[2] == 0) {
if (p[1] == 'o') {
}
/* Parse other arguments */
-void parse_args(unsigned char *p)
+void parse_args(char *p)
{
- unsigned char *s;
+ char *s;
while(*p) {
while(*p == ' ' || *p == '\n')
p++;
}
}
-uint16_t bootdevice(uint8_t *devname)
+uint16_t bootdevice(char *devname)
{
bool match = true;
unsigned int b = 0, n = 0;
- uint8_t *p;
+ char *p;
const uint8_t *bdn = (const uint8_t *)BOOTDEVICENAMES;
uint8_t c, pc;
}
/* So its in discard and thrown not on stack */
-static uint8_t bootline[64];
+static char bootline[64];
uint16_t get_root_dev(void)
{
while(rd == BAD_ROOT_DEV){
kputs("bootdev: ");
- udata.u_base = bootline;
+ udata.u_base = (uint8_t *)bootline;
udata.u_sysio = 1;
udata.u_count = sizeof(bootline)-1;
udata.u_euid = 0; /* Always begin as superuser */
inint = false;
udata.u_insys = true;
- ramtop = PROGTOP;
+#ifdef PROGTOP /* FIXME */
+ ramtop = (uaddr_t)PROGTOP;
+#endif
tty_init();