diff options
Diffstat (limited to 'sys/arch/loongson/stand/boot')
-rw-r--r-- | sys/arch/loongson/stand/boot/conf.c | 4 | ||||
-rw-r--r-- | sys/arch/loongson/stand/boot/exec.c | 3 | ||||
-rw-r--r-- | sys/arch/loongson/stand/boot/libsa.h | 5 | ||||
-rw-r--r-- | sys/arch/loongson/stand/boot/machdep.c | 4 | ||||
-rw-r--r-- | sys/arch/loongson/stand/boot/rd.c | 21 |
5 files changed, 25 insertions, 12 deletions
diff --git a/sys/arch/loongson/stand/boot/conf.c b/sys/arch/loongson/stand/boot/conf.c index 32d41b78545..0797d24b9f8 100644 --- a/sys/arch/loongson/stand/boot/conf.c +++ b/sys/arch/loongson/stand/boot/conf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf.c,v 1.3 2010/02/17 21:25:49 miod Exp $ */ +/* $OpenBSD: conf.c,v 1.4 2010/04/03 19:13:27 miod Exp $ */ /* * Copyright (c) 1982, 1986, 1990, 1993 @@ -39,7 +39,7 @@ #include <lib/libsa/ufs.h> #include <lib/libsa/cd9660.h> -const char version[] = "0.2"; +const char version[] = "0.3"; #if 0 /* network code not compiled in */ int debug = 0; #endif diff --git a/sys/arch/loongson/stand/boot/exec.c b/sys/arch/loongson/stand/boot/exec.c index 37bd6488279..3a66a224119 100644 --- a/sys/arch/loongson/stand/boot/exec.c +++ b/sys/arch/loongson/stand/boot/exec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exec.c,v 1.1 2010/02/14 22:39:33 miod Exp $ */ +/* $OpenBSD: exec.c,v 1.2 2010/04/03 19:13:27 miod Exp $ */ /* * Copyright (c) 2010 Miodrag Vallat. @@ -71,5 +71,6 @@ run_loadfile(u_long *marks, int howto) pmon_envp, pmon_callvec, (uint64_t *)PHYS_TO_CKSEG0(marks[MARK_END])); + rd_invalidate(); _rtt(); } diff --git a/sys/arch/loongson/stand/boot/libsa.h b/sys/arch/loongson/stand/boot/libsa.h index c727d7985e4..8ba7fc90391 100644 --- a/sys/arch/loongson/stand/boot/libsa.h +++ b/sys/arch/loongson/stand/boot/libsa.h @@ -1,4 +1,4 @@ -/* $OpenBSD: libsa.h,v 1.3 2010/02/17 21:25:49 miod Exp $ */ +/* $OpenBSD: libsa.h,v 1.4 2010/04/03 19:13:27 miod Exp $ */ /* * Copyright (c) 2010 Miodrag Vallat. @@ -52,6 +52,7 @@ int rd_iostrategy(void *, int, daddr_t, size_t, void *, size_t *); int rd_ioopen(struct open_file *, ...); int rd_ioclose(struct open_file *); int rd_isvalid(void); +void rd_invalidate(void); /* * INITRD ``filesystem'' @@ -70,3 +71,5 @@ extern int32_t *pmon_envp; extern int32_t pmon_callvec; extern char pmon_bootdev[]; + +extern char *kernelfile; diff --git a/sys/arch/loongson/stand/boot/machdep.c b/sys/arch/loongson/stand/boot/machdep.c index 05c74f5c0c2..dfda371a583 100644 --- a/sys/arch/loongson/stand/boot/machdep.c +++ b/sys/arch/loongson/stand/boot/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.3 2010/02/17 21:25:49 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.4 2010/04/03 19:13:27 miod Exp $ */ /* * Copyright (c) 2010 Miodrag Vallat. @@ -53,7 +53,6 @@ int is_gdium; int boot_rd; extern int bootprompt; -extern char *kernelfile; /* * Console @@ -297,5 +296,6 @@ gdium_abort() "will need to power cycle.\n" "We would apologize for this incovenience, but we have " "no control about the firmware of your machine.\n\n"); + rd_invalidate(); _rtt(); } diff --git a/sys/arch/loongson/stand/boot/rd.c b/sys/arch/loongson/stand/boot/rd.c index 5a00bfd4b76..87c045a4464 100644 --- a/sys/arch/loongson/stand/boot/rd.c +++ b/sys/arch/loongson/stand/boot/rd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rd.c,v 1.1 2010/02/17 21:25:49 miod Exp $ */ +/* $OpenBSD: rd.c,v 1.2 2010/04/03 19:13:27 miod Exp $ */ /* * Copyright (c) 2010 Miodrag Vallat. @@ -62,6 +62,12 @@ rd_isvalid() return 1; } +void +rd_invalidate() +{ + bzero((void *)INITRD_BASE, sizeof(Elf64_Ehdr)); +} + /* * INITRD filesystem */ @@ -69,8 +75,11 @@ int rdfs_open(char *path, struct open_file *f) { if (f->f_dev->dv_open == rd_ioopen) { - rdoffs = 0; - return 0; + if (strcmp(path, kernelfile) == 0) { + rdoffs = 0; + return 0; + } else + return ENOENT; } return EINVAL; @@ -97,13 +106,13 @@ rdfs_read(struct open_file *f, void *buf, size_t size, size_t *resid) int rdfs_write(struct open_file *f, void *buf, size_t size, size_t *resid) { - return EIO; + return EROFS; } off_t -rdfs_seek(struct open_file *f, off_t offset, int where) +rdfs_seek(struct open_file *f, off_t offset, int whence) { - switch (where) { + switch (whence) { case 0: /* SEEK_SET */ rdoffs = offset; break; |