From ec51a30cf7fb6e26cd828236b499f07bd618afc8 Mon Sep 17 00:00:00 2001 From: Palmer Dabbelt Date: Sat, 23 Feb 2019 00:30:44 -0800 Subject: [PATCH 1/4] Add support for HTIF interfaces This just supports HTIF console (always via the write syscall) and shutdown (without an exit code). With this I can run code on Spike. Signed-off-by: Palmer Dabbelt --- Makefile.am | 2 + Makefile.in | 21 +++++++ metal/drivers/sifive,htif0.h | 55 ++++++++++++++++++ src/drivers/sifive,htif0.c | 106 +++++++++++++++++++++++++++++++++++ 4 files changed, 184 insertions(+) create mode 100644 metal/drivers/sifive,htif0.h create mode 100644 src/drivers/sifive,htif0.c diff --git a/Makefile.am b/Makefile.am index eb470749..b2dfe43f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -72,6 +72,7 @@ nobase_include_HEADERS = \ metal/drivers/sifive_gpio-leds.h \ metal/drivers/sifive_gpio-switches.h \ metal/drivers/sifive_gpio0.h \ + metal/drivers/sifive,htif0.h \ metal/drivers/sifive_local-external-interrupts0.h \ metal/drivers/sifive_rtc0.h \ metal/drivers/sifive_spi0.h \ @@ -178,6 +179,7 @@ libriscv__mmachine__@MACHINE_NAME@_a_SOURCES = \ src/drivers/sifive_gpio-leds.c \ src/drivers/sifive_gpio-switches.c \ src/drivers/sifive_gpio0.c \ + src/drivers/sifive,htif0.c \ src/drivers/sifive_local-external-interrupts0.c \ src/drivers/sifive_rtc0.c \ src/drivers/sifive_spi0.c \ diff --git a/Makefile.in b/Makefile.in index 0dac443b..f10617ab 100644 --- a/Makefile.in +++ b/Makefile.in @@ -218,6 +218,7 @@ am_libriscv__mmachine__@MACHINE_NAME@_a_OBJECTS = src/drivers/libriscv__mmachine src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive_gpio-leds.$(OBJEXT) \ src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive_gpio-switches.$(OBJEXT) \ src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive_gpio0.$(OBJEXT) \ + src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive,htif0.$(OBJEXT) \ src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive_local-external-interrupts0.$(OBJEXT) \ src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive_rtc0.$(OBJEXT) \ src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive_spi0.$(OBJEXT) \ @@ -498,6 +499,7 @@ nobase_include_HEADERS = \ metal/drivers/sifive_gpio-leds.h \ metal/drivers/sifive_gpio-switches.h \ metal/drivers/sifive_gpio0.h \ + metal/drivers/sifive,htif0.h \ metal/drivers/sifive_local-external-interrupts0.h \ metal/drivers/sifive_rtc0.h \ metal/drivers/sifive_spi0.h \ @@ -571,6 +573,7 @@ libriscv__mmachine__@MACHINE_NAME@_a_SOURCES = \ src/drivers/sifive_gpio-leds.c \ src/drivers/sifive_gpio-switches.c \ src/drivers/sifive_gpio0.c \ + src/drivers/sifive,htif0.c \ src/drivers/sifive_local-external-interrupts0.c \ src/drivers/sifive_rtc0.c \ src/drivers/sifive_spi0.c \ @@ -858,6 +861,9 @@ src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive_gpio-switches.$(OBJEXT): src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive_gpio0.$(OBJEXT): \ src/drivers/$(am__dirstamp) \ src/drivers/$(DEPDIR)/$(am__dirstamp) +src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive,htif0.$(OBJEXT): \ + src/drivers/$(am__dirstamp) \ + src/drivers/$(DEPDIR)/$(am__dirstamp) src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive_local-external-interrupts0.$(OBJEXT): \ src/drivers/$(am__dirstamp) \ src/drivers/$(DEPDIR)/$(am__dirstamp) @@ -1042,6 +1048,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@src/drivers/$(DEPDIR)/libriscv__mmachine__@MACHINE_NAME@_a-riscv_clint0.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/drivers/$(DEPDIR)/libriscv__mmachine__@MACHINE_NAME@_a-riscv_cpu.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/drivers/$(DEPDIR)/libriscv__mmachine__@MACHINE_NAME@_a-riscv_plic0.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/drivers/$(DEPDIR)/libriscv__mmachine__@MACHINE_NAME@_a-sifive,htif0.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/drivers/$(DEPDIR)/libriscv__mmachine__@MACHINE_NAME@_a-sifive_ccache0.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/drivers/$(DEPDIR)/libriscv__mmachine__@MACHINE_NAME@_a-sifive_clic0.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/drivers/$(DEPDIR)/libriscv__mmachine__@MACHINE_NAME@_a-sifive_fe310-g000_hfrosc.Po@am__quote@ @@ -1406,6 +1413,20 @@ src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive_gpio0.obj: src/drivers/s @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libriscv__mmachine__@MACHINE_NAME@_a_CFLAGS) $(CFLAGS) -c -o src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive_gpio0.obj `if test -f 'src/drivers/sifive_gpio0.c'; then $(CYGPATH_W) 'src/drivers/sifive_gpio0.c'; else $(CYGPATH_W) '$(srcdir)/src/drivers/sifive_gpio0.c'; fi` +src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive,htif0.o: src/drivers/sifive,htif0.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libriscv__mmachine__@MACHINE_NAME@_a_CFLAGS) $(CFLAGS) -MT src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive,htif0.o -MD -MP -MF src/drivers/$(DEPDIR)/libriscv__mmachine__@MACHINE_NAME@_a-sifive,htif0.Tpo -c -o src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive,htif0.o `test -f 'src/drivers/sifive,htif0.c' || echo '$(srcdir)/'`src/drivers/sifive,htif0.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/drivers/$(DEPDIR)/libriscv__mmachine__@MACHINE_NAME@_a-sifive,htif0.Tpo src/drivers/$(DEPDIR)/libriscv__mmachine__@MACHINE_NAME@_a-sifive,htif0.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/drivers/sifive,htif0.c' object='src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive,htif0.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libriscv__mmachine__@MACHINE_NAME@_a_CFLAGS) $(CFLAGS) -c -o src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive,htif0.o `test -f 'src/drivers/sifive,htif0.c' || echo '$(srcdir)/'`src/drivers/sifive,htif0.c + +src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive,htif0.obj: src/drivers/sifive,htif0.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libriscv__mmachine__@MACHINE_NAME@_a_CFLAGS) $(CFLAGS) -MT src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive,htif0.obj -MD -MP -MF src/drivers/$(DEPDIR)/libriscv__mmachine__@MACHINE_NAME@_a-sifive,htif0.Tpo -c -o src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive,htif0.obj `if test -f 'src/drivers/sifive,htif0.c'; then $(CYGPATH_W) 'src/drivers/sifive,htif0.c'; else $(CYGPATH_W) '$(srcdir)/src/drivers/sifive,htif0.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/drivers/$(DEPDIR)/libriscv__mmachine__@MACHINE_NAME@_a-sifive,htif0.Tpo src/drivers/$(DEPDIR)/libriscv__mmachine__@MACHINE_NAME@_a-sifive,htif0.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/drivers/sifive,htif0.c' object='src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive,htif0.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libriscv__mmachine__@MACHINE_NAME@_a_CFLAGS) $(CFLAGS) -c -o src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive,htif0.obj `if test -f 'src/drivers/sifive,htif0.c'; then $(CYGPATH_W) 'src/drivers/sifive,htif0.c'; else $(CYGPATH_W) '$(srcdir)/src/drivers/sifive,htif0.c'; fi` + src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive_local-external-interrupts0.o: src/drivers/sifive_local-external-interrupts0.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libriscv__mmachine__@MACHINE_NAME@_a_CFLAGS) $(CFLAGS) -MT src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive_local-external-interrupts0.o -MD -MP -MF src/drivers/$(DEPDIR)/libriscv__mmachine__@MACHINE_NAME@_a-sifive_local-external-interrupts0.Tpo -c -o src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive_local-external-interrupts0.o `test -f 'src/drivers/sifive_local-external-interrupts0.c' || echo '$(srcdir)/'`src/drivers/sifive_local-external-interrupts0.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/drivers/$(DEPDIR)/libriscv__mmachine__@MACHINE_NAME@_a-sifive_local-external-interrupts0.Tpo src/drivers/$(DEPDIR)/libriscv__mmachine__@MACHINE_NAME@_a-sifive_local-external-interrupts0.Po diff --git a/metal/drivers/sifive,htif0.h b/metal/drivers/sifive,htif0.h new file mode 100644 index 00000000..a43ea822 --- /dev/null +++ b/metal/drivers/sifive,htif0.h @@ -0,0 +1,55 @@ +/* Copyright 2018 SiFive, Inc */ +/* SPDX-License-Identifier: Apache-2.0 */ + +#ifndef METAL__DRIVERS__SIFIVE_HTIF0_H +#define METAL__DRIVERS__SIFIVE_HTIF0_H + +#include +#include +#include + +struct __metal_driver_vtable_sifive_htif0_shutdown { + const struct __metal_shutdown_vtable shutdown; +}; + +struct __metal_driver_vtable_sifive_htif0_uart { + const struct metal_uart_vtable uart; +}; + +struct __metal_driver_sifive_htif0; + +void __metal_driver_sifive_htif0_exit(const struct __metal_shutdown *test, int code) __attribute__((noreturn)); + +void __metal_driver_sifive_htif0_init(struct metal_uart *uart, int baud_rate); +int __metal_driver_sifive_htif0_putc(struct metal_uart *uart, unsigned char c); +int __metal_driver_sifive_htif0_getc(struct metal_uart *uart, unsigned char *c); +int __metal_driver_sifive_htif0_get_baud_rate(struct metal_uart *guart); +int __metal_driver_sifive_htif0_set_baud_rate(struct metal_uart *guart, int baud_rate); +struct metal_interrupt* __metal_driver_sifive_htif0_interrupt_controller(struct metal_uart *uart); +int __metal_driver_sifive_htif0_get_interrupt_id(struct metal_uart *uart); + +__METAL_DECLARE_VTABLE(__metal_driver_vtable_sifive_htif0_shutdown) = { + .shutdown.exit = &__metal_driver_sifive_htif0_exit, +}; + +__METAL_DECLARE_VTABLE(__metal_driver_vtable_sifive_htif0_uart) = { + .uart.init = __metal_driver_sifive_htif0_init, + .uart.putc = __metal_driver_sifive_htif0_putc, + .uart.getc = __metal_driver_sifive_htif0_getc, + .uart.get_baud_rate = __metal_driver_sifive_htif0_get_baud_rate, + .uart.set_baud_rate = __metal_driver_sifive_htif0_set_baud_rate, + .uart.controller_interrupt = __metal_driver_sifive_htif0_interrupt_controller, + .uart.get_interrupt_id = __metal_driver_sifive_htif0_get_interrupt_id, +}; + +struct __metal_driver_sifive_htif0_shutdown { + struct __metal_shutdown shutdown; + const struct __metal_driver_vtable_sifive_htif0_shutdown *vtable; +}; + +struct __metal_driver_sifive_htif0_uart { + struct metal_uart uart; + const struct __metal_driver_vtable_sifive_htif0_uart *vtable; +}; + +#endif diff --git a/src/drivers/sifive,htif0.c b/src/drivers/sifive,htif0.c new file mode 100644 index 00000000..f06d6438 --- /dev/null +++ b/src/drivers/sifive,htif0.c @@ -0,0 +1,106 @@ +/* Copyright 2018 SiFive, Inc */ +/* SPDX-License-Identifier: Apache-2.0 */ + +#include +#include +#include +#include + +#define FINISHER_OFFSET 0 + +volatile uint64_t fromhost __attribute__((aligned(4096))); +volatile uint64_t tohost __attribute__((aligned(4096))); + +#if __riscv_xlen == 64 +# define TOHOST_CMD(dev, cmd, payload) \ + (((uint64_t)(dev) << 56) | ((uint64_t)(cmd) << 48) | (uint64_t)(payload)) +#else +# define TOHOST_CMD(dev, cmd, payload) ({ \ + if ((dev) || (cmd)) __builtin_trap(); \ + (payload); }) +#endif +#define FROMHOST_DEV(fromhost_value) ((uint64_t)(fromhost_value) >> 56) +#define FROMHOST_CMD(fromhost_value) ((uint64_t)(fromhost_value) << 8 >> 56) +#define FROMHOST_DATA(fromhost_value) ((uint64_t)(fromhost_value) << 16 >> 16) + + +static void __check_fromhost() +{ + uint64_t fh = fromhost; + if (!fh) + return; + fromhost = 0; +} + +static void __set_tohost(uintptr_t dev, uintptr_t cmd, uintptr_t data) +{ + while (tohost) + __check_fromhost(); + tohost = TOHOST_CMD(dev, cmd, data); +} + +static void do_tohost_fromhost(uintptr_t dev, uintptr_t cmd, uintptr_t data) +{ + __set_tohost(dev, cmd, data); + + while (1) { + uint64_t fh = fromhost; + if (fh) { + if (FROMHOST_DEV(fh) == dev && FROMHOST_CMD(fh) == cmd) { + fromhost = 0; + break; + } + __check_fromhost(); + } + } +} + +void __metal_driver_sifive_htif0_init(struct metal_uart *uart, int baud_rate) +{ +} + +void __metal_driver_sifive_htif0_exit(const struct __metal_shutdown *sd, int code) +{ + while (1) { + fromhost = 0; + tohost = 1; + }; +} + +int __metal_driver_sifive_htif0_putc(struct metal_uart *htif, unsigned char c) +{ + volatile uint64_t magic_mem[8]; + magic_mem[0] = 64; // SYS_write + magic_mem[1] = 1; + magic_mem[2] = (uintptr_t)&c; + magic_mem[3] = 1; + + do_tohost_fromhost(0, 0, (uintptr_t)magic_mem); + + return 0; +} + +int __metal_driver_sifive_htif0_getc(struct metal_uart *htif, unsigned char *c) +{ + return -1; +} + +int __metal_driver_sifive_htif0_get_baud_rate(struct metal_uart *guart) +{ + return 0; +} + +int __metal_driver_sifive_htif0_set_baud_rate(struct metal_uart *guart, int baud_rate) +{ + return 0; +} + +struct metal_interrupt* __metal_driver_sifive_htif0_interrupt_controller(struct metal_uart *uart) +{ + return NULL; +} + +int __metal_driver_sifive_htif0_get_interrupt_id(struct metal_uart *uart) +{ + return -1; +} From 87de32bc96283954663108384eb4217732dfa25f Mon Sep 17 00:00:00 2001 From: Jerry Shih Date: Thu, 22 Aug 2019 14:59:37 +0800 Subject: [PATCH 2/4] Update HTIF shutdown func. Return the exit code to spike. --- src/drivers/sifive,htif0.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/drivers/sifive,htif0.c b/src/drivers/sifive,htif0.c index f06d6438..d950eeb7 100644 --- a/src/drivers/sifive,htif0.c +++ b/src/drivers/sifive,htif0.c @@ -61,10 +61,17 @@ void __metal_driver_sifive_htif0_init(struct metal_uart *uart, int baud_rate) void __metal_driver_sifive_htif0_exit(const struct __metal_shutdown *sd, int code) { - while (1) { - fromhost = 0; - tohost = 1; - }; + volatile uint64_t magic_mem[8]; + magic_mem[0] = 93; // SYS_exit + magic_mem[1] = code; + magic_mem[2] = 0; + magic_mem[3] = 0; + + do_tohost_fromhost(0, 0, (uintptr_t)magic_mem); + + while(1) { + // loop forever + } } int __metal_driver_sifive_htif0_putc(struct metal_uart *htif, unsigned char c) From 8c19169bef0838564dc3355dce34d7becb3f854e Mon Sep 17 00:00:00 2001 From: Nathaniel Graff Date: Thu, 3 Oct 2019 15:47:20 -0700 Subject: [PATCH 3/4] Update HTIF driver to match drivers on master - formatting - require METAL_UCB_HTIF0 to be defined by metal/machine/platform.h - name the file with an understore instead of a comma - change getc and putc to accept ints instead of chars Signed-off-by: Nathaniel Graff --- Makefile.am | 4 +- metal/drivers/sifive,htif0.h | 55 --------------- metal/drivers/ucb_htif0.h | 48 +++++++++++++ src/drivers/sifive,htif0.c | 113 ------------------------------- src/drivers/ucb_htif0.c | 128 +++++++++++++++++++++++++++++++++++ 5 files changed, 178 insertions(+), 170 deletions(-) delete mode 100644 metal/drivers/sifive,htif0.h create mode 100644 metal/drivers/ucb_htif0.h delete mode 100644 src/drivers/sifive,htif0.c create mode 100644 src/drivers/ucb_htif0.c diff --git a/Makefile.am b/Makefile.am index b2dfe43f..39554eab 100644 --- a/Makefile.am +++ b/Makefile.am @@ -72,7 +72,6 @@ nobase_include_HEADERS = \ metal/drivers/sifive_gpio-leds.h \ metal/drivers/sifive_gpio-switches.h \ metal/drivers/sifive_gpio0.h \ - metal/drivers/sifive,htif0.h \ metal/drivers/sifive_local-external-interrupts0.h \ metal/drivers/sifive_rtc0.h \ metal/drivers/sifive_spi0.h \ @@ -80,6 +79,7 @@ nobase_include_HEADERS = \ metal/drivers/sifive_trace.h \ metal/drivers/sifive_uart0.h \ metal/drivers/sifive_wdog0.h \ + metal/drivers/ucb_htif0.h \ metal/machine/inline.h \ metal/machine/platform.h \ metal/button.h \ @@ -179,7 +179,6 @@ libriscv__mmachine__@MACHINE_NAME@_a_SOURCES = \ src/drivers/sifive_gpio-leds.c \ src/drivers/sifive_gpio-switches.c \ src/drivers/sifive_gpio0.c \ - src/drivers/sifive,htif0.c \ src/drivers/sifive_local-external-interrupts0.c \ src/drivers/sifive_rtc0.c \ src/drivers/sifive_spi0.c \ @@ -187,6 +186,7 @@ libriscv__mmachine__@MACHINE_NAME@_a_SOURCES = \ src/drivers/sifive_trace.c \ src/drivers/sifive_uart0.c \ src/drivers/sifive_wdog0.c \ + src/drivers/ucb_htif0.c \ src/button.c \ src/cache.c \ src/clock.c \ diff --git a/metal/drivers/sifive,htif0.h b/metal/drivers/sifive,htif0.h deleted file mode 100644 index a43ea822..00000000 --- a/metal/drivers/sifive,htif0.h +++ /dev/null @@ -1,55 +0,0 @@ -/* Copyright 2018 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ - -#ifndef METAL__DRIVERS__SIFIVE_HTIF0_H -#define METAL__DRIVERS__SIFIVE_HTIF0_H - -#include -#include -#include - -struct __metal_driver_vtable_sifive_htif0_shutdown { - const struct __metal_shutdown_vtable shutdown; -}; - -struct __metal_driver_vtable_sifive_htif0_uart { - const struct metal_uart_vtable uart; -}; - -struct __metal_driver_sifive_htif0; - -void __metal_driver_sifive_htif0_exit(const struct __metal_shutdown *test, int code) __attribute__((noreturn)); - -void __metal_driver_sifive_htif0_init(struct metal_uart *uart, int baud_rate); -int __metal_driver_sifive_htif0_putc(struct metal_uart *uart, unsigned char c); -int __metal_driver_sifive_htif0_getc(struct metal_uart *uart, unsigned char *c); -int __metal_driver_sifive_htif0_get_baud_rate(struct metal_uart *guart); -int __metal_driver_sifive_htif0_set_baud_rate(struct metal_uart *guart, int baud_rate); -struct metal_interrupt* __metal_driver_sifive_htif0_interrupt_controller(struct metal_uart *uart); -int __metal_driver_sifive_htif0_get_interrupt_id(struct metal_uart *uart); - -__METAL_DECLARE_VTABLE(__metal_driver_vtable_sifive_htif0_shutdown) = { - .shutdown.exit = &__metal_driver_sifive_htif0_exit, -}; - -__METAL_DECLARE_VTABLE(__metal_driver_vtable_sifive_htif0_uart) = { - .uart.init = __metal_driver_sifive_htif0_init, - .uart.putc = __metal_driver_sifive_htif0_putc, - .uart.getc = __metal_driver_sifive_htif0_getc, - .uart.get_baud_rate = __metal_driver_sifive_htif0_get_baud_rate, - .uart.set_baud_rate = __metal_driver_sifive_htif0_set_baud_rate, - .uart.controller_interrupt = __metal_driver_sifive_htif0_interrupt_controller, - .uart.get_interrupt_id = __metal_driver_sifive_htif0_get_interrupt_id, -}; - -struct __metal_driver_sifive_htif0_shutdown { - struct __metal_shutdown shutdown; - const struct __metal_driver_vtable_sifive_htif0_shutdown *vtable; -}; - -struct __metal_driver_sifive_htif0_uart { - struct metal_uart uart; - const struct __metal_driver_vtable_sifive_htif0_uart *vtable; -}; - -#endif diff --git a/metal/drivers/ucb_htif0.h b/metal/drivers/ucb_htif0.h new file mode 100644 index 00000000..210d0819 --- /dev/null +++ b/metal/drivers/ucb_htif0.h @@ -0,0 +1,48 @@ +/* Copyright 2018 SiFive, Inc */ +/* SPDX-License-Identifier: Apache-2.0 */ + +#ifndef METAL__DRIVERS__UCB_HTIF0_H +#define METAL__DRIVERS__UCB_HTIF0_H + +#include +#include +#include + +struct __metal_driver_vtable_ucb_htif0_shutdown { + const struct __metal_shutdown_vtable shutdown; +}; + +struct __metal_driver_vtable_ucb_htif0_uart { + const struct metal_uart_vtable uart; +}; + +struct __metal_driver_ucb_htif0; + +void __metal_driver_ucb_htif0_exit(const struct __metal_shutdown *test, + int code) __attribute__((noreturn)); + +void __metal_driver_ucb_htif0_init(struct metal_uart *uart, int baud_rate); +int __metal_driver_ucb_htif0_putc(struct metal_uart *uart, int c); +int __metal_driver_ucb_htif0_getc(struct metal_uart *uart, int *c); +int __metal_driver_ucb_htif0_get_baud_rate(struct metal_uart *guart); +int __metal_driver_ucb_htif0_set_baud_rate(struct metal_uart *guart, + int baud_rate); +struct metal_interrupt * +__metal_driver_ucb_htif0_interrupt_controller(struct metal_uart *uart); +int __metal_driver_ucb_htif0_get_interrupt_id(struct metal_uart *uart); + +__METAL_DECLARE_VTABLE(__metal_driver_vtable_ucb_htif0_shutdown) + +__METAL_DECLARE_VTABLE(__metal_driver_vtable_ucb_htif0_uart) + +struct __metal_driver_ucb_htif0_shutdown { + struct __metal_shutdown shutdown; + const struct __metal_driver_vtable_ucb_htif0_shutdown *vtable; +}; + +struct __metal_driver_ucb_htif0_uart { + struct metal_uart uart; + const struct __metal_driver_vtable_ucb_htif0_uart *vtable; +}; + +#endif diff --git a/src/drivers/sifive,htif0.c b/src/drivers/sifive,htif0.c deleted file mode 100644 index d950eeb7..00000000 --- a/src/drivers/sifive,htif0.c +++ /dev/null @@ -1,113 +0,0 @@ -/* Copyright 2018 SiFive, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ - -#include -#include -#include -#include - -#define FINISHER_OFFSET 0 - -volatile uint64_t fromhost __attribute__((aligned(4096))); -volatile uint64_t tohost __attribute__((aligned(4096))); - -#if __riscv_xlen == 64 -# define TOHOST_CMD(dev, cmd, payload) \ - (((uint64_t)(dev) << 56) | ((uint64_t)(cmd) << 48) | (uint64_t)(payload)) -#else -# define TOHOST_CMD(dev, cmd, payload) ({ \ - if ((dev) || (cmd)) __builtin_trap(); \ - (payload); }) -#endif -#define FROMHOST_DEV(fromhost_value) ((uint64_t)(fromhost_value) >> 56) -#define FROMHOST_CMD(fromhost_value) ((uint64_t)(fromhost_value) << 8 >> 56) -#define FROMHOST_DATA(fromhost_value) ((uint64_t)(fromhost_value) << 16 >> 16) - - -static void __check_fromhost() -{ - uint64_t fh = fromhost; - if (!fh) - return; - fromhost = 0; -} - -static void __set_tohost(uintptr_t dev, uintptr_t cmd, uintptr_t data) -{ - while (tohost) - __check_fromhost(); - tohost = TOHOST_CMD(dev, cmd, data); -} - -static void do_tohost_fromhost(uintptr_t dev, uintptr_t cmd, uintptr_t data) -{ - __set_tohost(dev, cmd, data); - - while (1) { - uint64_t fh = fromhost; - if (fh) { - if (FROMHOST_DEV(fh) == dev && FROMHOST_CMD(fh) == cmd) { - fromhost = 0; - break; - } - __check_fromhost(); - } - } -} - -void __metal_driver_sifive_htif0_init(struct metal_uart *uart, int baud_rate) -{ -} - -void __metal_driver_sifive_htif0_exit(const struct __metal_shutdown *sd, int code) -{ - volatile uint64_t magic_mem[8]; - magic_mem[0] = 93; // SYS_exit - magic_mem[1] = code; - magic_mem[2] = 0; - magic_mem[3] = 0; - - do_tohost_fromhost(0, 0, (uintptr_t)magic_mem); - - while(1) { - // loop forever - } -} - -int __metal_driver_sifive_htif0_putc(struct metal_uart *htif, unsigned char c) -{ - volatile uint64_t magic_mem[8]; - magic_mem[0] = 64; // SYS_write - magic_mem[1] = 1; - magic_mem[2] = (uintptr_t)&c; - magic_mem[3] = 1; - - do_tohost_fromhost(0, 0, (uintptr_t)magic_mem); - - return 0; -} - -int __metal_driver_sifive_htif0_getc(struct metal_uart *htif, unsigned char *c) -{ - return -1; -} - -int __metal_driver_sifive_htif0_get_baud_rate(struct metal_uart *guart) -{ - return 0; -} - -int __metal_driver_sifive_htif0_set_baud_rate(struct metal_uart *guart, int baud_rate) -{ - return 0; -} - -struct metal_interrupt* __metal_driver_sifive_htif0_interrupt_controller(struct metal_uart *uart) -{ - return NULL; -} - -int __metal_driver_sifive_htif0_get_interrupt_id(struct metal_uart *uart) -{ - return -1; -} diff --git a/src/drivers/ucb_htif0.c b/src/drivers/ucb_htif0.c new file mode 100644 index 00000000..417acbf0 --- /dev/null +++ b/src/drivers/ucb_htif0.c @@ -0,0 +1,128 @@ +/* Copyright 2018 SiFive, Inc */ +/* SPDX-License-Identifier: Apache-2.0 */ + +#include + +#ifdef METAL_UCB_HTIF0 + +#include +#include +#include +#include + +#define FINISHER_OFFSET 0 + +volatile uint64_t fromhost __attribute__((aligned(4096))); +volatile uint64_t tohost __attribute__((aligned(4096))); + +#if __riscv_xlen == 64 +#define TOHOST_CMD(dev, cmd, payload) \ + (((uint64_t)(dev) << 56) | ((uint64_t)(cmd) << 48) | (uint64_t)(payload)) +#else +#define TOHOST_CMD(dev, cmd, payload) \ + ({ \ + if ((dev) || (cmd)) \ + __builtin_trap(); \ + (payload); \ + }) +#endif +#define FROMHOST_DEV(fromhost_value) ((uint64_t)(fromhost_value) >> 56) +#define FROMHOST_CMD(fromhost_value) ((uint64_t)(fromhost_value) << 8 >> 56) +#define FROMHOST_DATA(fromhost_value) ((uint64_t)(fromhost_value) << 16 >> 16) + +static void __check_fromhost() { + uint64_t fh = fromhost; + if (!fh) + return; + fromhost = 0; +} + +static void __set_tohost(uintptr_t dev, uintptr_t cmd, uintptr_t data) { + while (tohost) + __check_fromhost(); + tohost = TOHOST_CMD(dev, cmd, data); +} + +static void do_tohost_fromhost(uintptr_t dev, uintptr_t cmd, uintptr_t data) { + __set_tohost(dev, cmd, data); + + while (1) { + uint64_t fh = fromhost; + if (fh) { + if (FROMHOST_DEV(fh) == dev && FROMHOST_CMD(fh) == cmd) { + fromhost = 0; + break; + } + __check_fromhost(); + } + } +} + +void __metal_driver_ucb_htif0_init(struct metal_uart *uart, int baud_rate) {} + +void __metal_driver_ucb_htif0_exit(const struct __metal_shutdown *sd, + int code) { + volatile uint64_t magic_mem[8]; + magic_mem[0] = 93; // SYS_exit + magic_mem[1] = code; + magic_mem[2] = 0; + magic_mem[3] = 0; + + do_tohost_fromhost(0, 0, (uintptr_t)magic_mem); + + while (1) { + // loop forever + } +} + +int __metal_driver_ucb_htif0_putc(struct metal_uart *htif, int c) { + volatile uint64_t magic_mem[8]; + magic_mem[0] = 64; // SYS_write + magic_mem[1] = 1; + magic_mem[2] = (uintptr_t)&c; + magic_mem[3] = 1; + + do_tohost_fromhost(0, 0, (uintptr_t)magic_mem); + + return 0; +} + +int __metal_driver_ucb_htif0_getc(struct metal_uart *htif, int *c) { + return -1; +} + +int __metal_driver_ucb_htif0_get_baud_rate(struct metal_uart *guart) { + return 0; +} + +int __metal_driver_ucb_htif0_set_baud_rate(struct metal_uart *guart, + int baud_rate) { + return 0; +} + +struct metal_interrupt * +__metal_driver_ucb_htif0_interrupt_controller(struct metal_uart *uart) { + return NULL; +} + +int __metal_driver_ucb_htif0_get_interrupt_id(struct metal_uart *uart) { + return -1; +} + +__METAL_DEFINE_VTABLE(__metal_driver_vtable_ucb_htif0_shutdown) = { + .shutdown.exit = &__metal_driver_ucb_htif0_exit, +}; + +__METAL_DEFINE_VTABLE(__metal_driver_vtable_ucb_htif0_uart) = { + .uart.init = __metal_driver_ucb_htif0_init, + .uart.putc = __metal_driver_ucb_htif0_putc, + .uart.getc = __metal_driver_ucb_htif0_getc, + .uart.get_baud_rate = __metal_driver_ucb_htif0_get_baud_rate, + .uart.set_baud_rate = __metal_driver_ucb_htif0_set_baud_rate, + .uart.controller_interrupt = __metal_driver_ucb_htif0_interrupt_controller, + .uart.get_interrupt_id = __metal_driver_ucb_htif0_get_interrupt_id, +}; + +#endif /* METAL_UCB_HTIF0 */ + +typedef int no_empty_translation_units; From bb7edca39122097d5afff65349d19518edfe92c9 Mon Sep 17 00:00:00 2001 From: Nathaniel Graff Date: Thu, 3 Oct 2019 15:49:36 -0700 Subject: [PATCH 4/4] Rerun autoreconf Signed-off-by: Nathaniel Graff --- Makefile.in | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/Makefile.in b/Makefile.in index f10617ab..ee91f0a6 100644 --- a/Makefile.in +++ b/Makefile.in @@ -218,7 +218,6 @@ am_libriscv__mmachine__@MACHINE_NAME@_a_OBJECTS = src/drivers/libriscv__mmachine src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive_gpio-leds.$(OBJEXT) \ src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive_gpio-switches.$(OBJEXT) \ src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive_gpio0.$(OBJEXT) \ - src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive,htif0.$(OBJEXT) \ src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive_local-external-interrupts0.$(OBJEXT) \ src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive_rtc0.$(OBJEXT) \ src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive_spi0.$(OBJEXT) \ @@ -226,6 +225,7 @@ am_libriscv__mmachine__@MACHINE_NAME@_a_OBJECTS = src/drivers/libriscv__mmachine src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive_trace.$(OBJEXT) \ src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive_uart0.$(OBJEXT) \ src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive_wdog0.$(OBJEXT) \ + src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-ucb_htif0.$(OBJEXT) \ src/libriscv__mmachine__@MACHINE_NAME@_a-button.$(OBJEXT) \ src/libriscv__mmachine__@MACHINE_NAME@_a-cache.$(OBJEXT) \ src/libriscv__mmachine__@MACHINE_NAME@_a-clock.$(OBJEXT) \ @@ -499,7 +499,6 @@ nobase_include_HEADERS = \ metal/drivers/sifive_gpio-leds.h \ metal/drivers/sifive_gpio-switches.h \ metal/drivers/sifive_gpio0.h \ - metal/drivers/sifive,htif0.h \ metal/drivers/sifive_local-external-interrupts0.h \ metal/drivers/sifive_rtc0.h \ metal/drivers/sifive_spi0.h \ @@ -507,6 +506,7 @@ nobase_include_HEADERS = \ metal/drivers/sifive_trace.h \ metal/drivers/sifive_uart0.h \ metal/drivers/sifive_wdog0.h \ + metal/drivers/ucb_htif0.h \ metal/machine/inline.h \ metal/machine/platform.h \ metal/button.h \ @@ -573,7 +573,6 @@ libriscv__mmachine__@MACHINE_NAME@_a_SOURCES = \ src/drivers/sifive_gpio-leds.c \ src/drivers/sifive_gpio-switches.c \ src/drivers/sifive_gpio0.c \ - src/drivers/sifive,htif0.c \ src/drivers/sifive_local-external-interrupts0.c \ src/drivers/sifive_rtc0.c \ src/drivers/sifive_spi0.c \ @@ -581,6 +580,7 @@ libriscv__mmachine__@MACHINE_NAME@_a_SOURCES = \ src/drivers/sifive_trace.c \ src/drivers/sifive_uart0.c \ src/drivers/sifive_wdog0.c \ + src/drivers/ucb_htif0.c \ src/button.c \ src/cache.c \ src/clock.c \ @@ -861,9 +861,6 @@ src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive_gpio-switches.$(OBJEXT): src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive_gpio0.$(OBJEXT): \ src/drivers/$(am__dirstamp) \ src/drivers/$(DEPDIR)/$(am__dirstamp) -src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive,htif0.$(OBJEXT): \ - src/drivers/$(am__dirstamp) \ - src/drivers/$(DEPDIR)/$(am__dirstamp) src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive_local-external-interrupts0.$(OBJEXT): \ src/drivers/$(am__dirstamp) \ src/drivers/$(DEPDIR)/$(am__dirstamp) @@ -885,6 +882,9 @@ src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive_uart0.$(OBJEXT): \ src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive_wdog0.$(OBJEXT): \ src/drivers/$(am__dirstamp) \ src/drivers/$(DEPDIR)/$(am__dirstamp) +src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-ucb_htif0.$(OBJEXT): \ + src/drivers/$(am__dirstamp) \ + src/drivers/$(DEPDIR)/$(am__dirstamp) src/$(am__dirstamp): @$(MKDIR_P) src @: > src/$(am__dirstamp) @@ -1048,7 +1048,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@src/drivers/$(DEPDIR)/libriscv__mmachine__@MACHINE_NAME@_a-riscv_clint0.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/drivers/$(DEPDIR)/libriscv__mmachine__@MACHINE_NAME@_a-riscv_cpu.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/drivers/$(DEPDIR)/libriscv__mmachine__@MACHINE_NAME@_a-riscv_plic0.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/drivers/$(DEPDIR)/libriscv__mmachine__@MACHINE_NAME@_a-sifive,htif0.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/drivers/$(DEPDIR)/libriscv__mmachine__@MACHINE_NAME@_a-sifive_ccache0.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/drivers/$(DEPDIR)/libriscv__mmachine__@MACHINE_NAME@_a-sifive_clic0.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/drivers/$(DEPDIR)/libriscv__mmachine__@MACHINE_NAME@_a-sifive_fe310-g000_hfrosc.Po@am__quote@ @@ -1069,6 +1068,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@src/drivers/$(DEPDIR)/libriscv__mmachine__@MACHINE_NAME@_a-sifive_trace.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/drivers/$(DEPDIR)/libriscv__mmachine__@MACHINE_NAME@_a-sifive_uart0.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/drivers/$(DEPDIR)/libriscv__mmachine__@MACHINE_NAME@_a-sifive_wdog0.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/drivers/$(DEPDIR)/libriscv__mmachine__@MACHINE_NAME@_a-ucb_htif0.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/hello-hello.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/return_fail-return_fail.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/return_pass-return_pass.Po@am__quote@ @@ -1413,20 +1413,6 @@ src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive_gpio0.obj: src/drivers/s @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libriscv__mmachine__@MACHINE_NAME@_a_CFLAGS) $(CFLAGS) -c -o src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive_gpio0.obj `if test -f 'src/drivers/sifive_gpio0.c'; then $(CYGPATH_W) 'src/drivers/sifive_gpio0.c'; else $(CYGPATH_W) '$(srcdir)/src/drivers/sifive_gpio0.c'; fi` -src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive,htif0.o: src/drivers/sifive,htif0.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libriscv__mmachine__@MACHINE_NAME@_a_CFLAGS) $(CFLAGS) -MT src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive,htif0.o -MD -MP -MF src/drivers/$(DEPDIR)/libriscv__mmachine__@MACHINE_NAME@_a-sifive,htif0.Tpo -c -o src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive,htif0.o `test -f 'src/drivers/sifive,htif0.c' || echo '$(srcdir)/'`src/drivers/sifive,htif0.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/drivers/$(DEPDIR)/libriscv__mmachine__@MACHINE_NAME@_a-sifive,htif0.Tpo src/drivers/$(DEPDIR)/libriscv__mmachine__@MACHINE_NAME@_a-sifive,htif0.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/drivers/sifive,htif0.c' object='src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive,htif0.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libriscv__mmachine__@MACHINE_NAME@_a_CFLAGS) $(CFLAGS) -c -o src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive,htif0.o `test -f 'src/drivers/sifive,htif0.c' || echo '$(srcdir)/'`src/drivers/sifive,htif0.c - -src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive,htif0.obj: src/drivers/sifive,htif0.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libriscv__mmachine__@MACHINE_NAME@_a_CFLAGS) $(CFLAGS) -MT src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive,htif0.obj -MD -MP -MF src/drivers/$(DEPDIR)/libriscv__mmachine__@MACHINE_NAME@_a-sifive,htif0.Tpo -c -o src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive,htif0.obj `if test -f 'src/drivers/sifive,htif0.c'; then $(CYGPATH_W) 'src/drivers/sifive,htif0.c'; else $(CYGPATH_W) '$(srcdir)/src/drivers/sifive,htif0.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/drivers/$(DEPDIR)/libriscv__mmachine__@MACHINE_NAME@_a-sifive,htif0.Tpo src/drivers/$(DEPDIR)/libriscv__mmachine__@MACHINE_NAME@_a-sifive,htif0.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/drivers/sifive,htif0.c' object='src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive,htif0.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libriscv__mmachine__@MACHINE_NAME@_a_CFLAGS) $(CFLAGS) -c -o src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive,htif0.obj `if test -f 'src/drivers/sifive,htif0.c'; then $(CYGPATH_W) 'src/drivers/sifive,htif0.c'; else $(CYGPATH_W) '$(srcdir)/src/drivers/sifive,htif0.c'; fi` - src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive_local-external-interrupts0.o: src/drivers/sifive_local-external-interrupts0.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libriscv__mmachine__@MACHINE_NAME@_a_CFLAGS) $(CFLAGS) -MT src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive_local-external-interrupts0.o -MD -MP -MF src/drivers/$(DEPDIR)/libriscv__mmachine__@MACHINE_NAME@_a-sifive_local-external-interrupts0.Tpo -c -o src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive_local-external-interrupts0.o `test -f 'src/drivers/sifive_local-external-interrupts0.c' || echo '$(srcdir)/'`src/drivers/sifive_local-external-interrupts0.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/drivers/$(DEPDIR)/libriscv__mmachine__@MACHINE_NAME@_a-sifive_local-external-interrupts0.Tpo src/drivers/$(DEPDIR)/libriscv__mmachine__@MACHINE_NAME@_a-sifive_local-external-interrupts0.Po @@ -1525,6 +1511,20 @@ src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive_wdog0.obj: src/drivers/s @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libriscv__mmachine__@MACHINE_NAME@_a_CFLAGS) $(CFLAGS) -c -o src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-sifive_wdog0.obj `if test -f 'src/drivers/sifive_wdog0.c'; then $(CYGPATH_W) 'src/drivers/sifive_wdog0.c'; else $(CYGPATH_W) '$(srcdir)/src/drivers/sifive_wdog0.c'; fi` +src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-ucb_htif0.o: src/drivers/ucb_htif0.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libriscv__mmachine__@MACHINE_NAME@_a_CFLAGS) $(CFLAGS) -MT src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-ucb_htif0.o -MD -MP -MF src/drivers/$(DEPDIR)/libriscv__mmachine__@MACHINE_NAME@_a-ucb_htif0.Tpo -c -o src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-ucb_htif0.o `test -f 'src/drivers/ucb_htif0.c' || echo '$(srcdir)/'`src/drivers/ucb_htif0.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/drivers/$(DEPDIR)/libriscv__mmachine__@MACHINE_NAME@_a-ucb_htif0.Tpo src/drivers/$(DEPDIR)/libriscv__mmachine__@MACHINE_NAME@_a-ucb_htif0.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/drivers/ucb_htif0.c' object='src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-ucb_htif0.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libriscv__mmachine__@MACHINE_NAME@_a_CFLAGS) $(CFLAGS) -c -o src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-ucb_htif0.o `test -f 'src/drivers/ucb_htif0.c' || echo '$(srcdir)/'`src/drivers/ucb_htif0.c + +src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-ucb_htif0.obj: src/drivers/ucb_htif0.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libriscv__mmachine__@MACHINE_NAME@_a_CFLAGS) $(CFLAGS) -MT src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-ucb_htif0.obj -MD -MP -MF src/drivers/$(DEPDIR)/libriscv__mmachine__@MACHINE_NAME@_a-ucb_htif0.Tpo -c -o src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-ucb_htif0.obj `if test -f 'src/drivers/ucb_htif0.c'; then $(CYGPATH_W) 'src/drivers/ucb_htif0.c'; else $(CYGPATH_W) '$(srcdir)/src/drivers/ucb_htif0.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/drivers/$(DEPDIR)/libriscv__mmachine__@MACHINE_NAME@_a-ucb_htif0.Tpo src/drivers/$(DEPDIR)/libriscv__mmachine__@MACHINE_NAME@_a-ucb_htif0.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/drivers/ucb_htif0.c' object='src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-ucb_htif0.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libriscv__mmachine__@MACHINE_NAME@_a_CFLAGS) $(CFLAGS) -c -o src/drivers/libriscv__mmachine__@MACHINE_NAME@_a-ucb_htif0.obj `if test -f 'src/drivers/ucb_htif0.c'; then $(CYGPATH_W) 'src/drivers/ucb_htif0.c'; else $(CYGPATH_W) '$(srcdir)/src/drivers/ucb_htif0.c'; fi` + src/libriscv__mmachine__@MACHINE_NAME@_a-button.o: src/button.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libriscv__mmachine__@MACHINE_NAME@_a_CFLAGS) $(CFLAGS) -MT src/libriscv__mmachine__@MACHINE_NAME@_a-button.o -MD -MP -MF src/$(DEPDIR)/libriscv__mmachine__@MACHINE_NAME@_a-button.Tpo -c -o src/libriscv__mmachine__@MACHINE_NAME@_a-button.o `test -f 'src/button.c' || echo '$(srcdir)/'`src/button.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/libriscv__mmachine__@MACHINE_NAME@_a-button.Tpo src/$(DEPDIR)/libriscv__mmachine__@MACHINE_NAME@_a-button.Po