Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/riscv/include Add loadfile_machdep.h for riscv



details:   https://anonhg.NetBSD.org/src/rev/26dca1f107fa
branches:  trunk
changeset: 1021064:26dca1f107fa
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Wed May 05 12:47:02 2021 +0000

description:
Add loadfile_machdep.h for riscv

diffstat:

 sys/arch/riscv/include/loadfile_machdep.h |  33 +++++++++++++++++++++++++++++++
 1 files changed, 33 insertions(+), 0 deletions(-)

diffs (37 lines):

diff -r bf1c133b0f2d -r 26dca1f107fa sys/arch/riscv/include/loadfile_machdep.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/riscv/include/loadfile_machdep.h Wed May 05 12:47:02 2021 +0000
@@ -0,0 +1,33 @@
+/*     $NetBSD: loadfile_machdep.h,v 1.1 2021/05/05 12:47:02 jmcneill Exp $    */
+
+#ifdef _LP64
+#define BOOT_ELF64
+#else
+#define BOOT_ELF32
+#endif
+
+#define LOAD_KERNEL    (LOAD_ALL & ~LOAD_TEXTA)
+#define COUNT_KERNEL   (COUNT_ALL & ~COUNT_TEXTA)
+
+#define LOADADDR(a)            (((u_long)(a)))
+#define ALIGNENTRY(a)          ((u_long)(a))
+#define READ(f, b, c)          read((f), (void*)LOADADDR(b), (c))
+#define BCOPY(s, d, c)         memmove((void*)LOADADDR(d), (void*)(s), (c))
+#define BZERO(d, c)            memset((void*)LOADADDR(d), 0, (c))
+#define        WARN(a)                 do { \
+                                       (void)printf a; \
+                                       if (errno) \
+                                               (void)printf(": %s\n", \
+                                                            strerror(errno)); \
+                                       else \
+                                               (void)printf("\n"); \
+                               } while(/* CONSTCOND */0)
+#ifdef PROGRESS_FN
+void PROGRESS_FN(const char *, ...) __printflike(1, 2);
+#define PROGRESS(a)            PROGRESS_FN a
+#else
+#define PROGRESS(a)            (void)printf a
+#endif
+#define ALLOC(a)               alloc(a)
+#define DEALLOC(a, b)          dealloc(a, b)
+#define OKMAGIC(a)             ((a) == ZMAGIC)



Home | Main Index | Thread Index | Old Index