Changes in boot/arch/riscv64/src/ucb.c [ae8d7b0:8b6aa39] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/arch/riscv64/src/ucb.c
rae8d7b0 r8b6aa39 31 31 #include <macros.h> 32 32 33 volatile uint64_t tohost __attribute__((section(".htif")));34 volatile uint64_t fromhost __attribute__((section(".htif")));35 36 static void poll_fromhost()37 {38 uint64_t val = fromhost;39 if (!val)40 return;41 42 fromhost = 0;43 }44 45 33 void htif_cmd(uint8_t device, uint8_t cmd, uint64_t payload) 46 34 { … … 48 36 (((uint64_t) cmd) << 48) | 49 37 (payload & UINT64_C(0xffffffffffff)); 38 uint64_t retval; 50 39 51 while (tohost) 52 poll_fromhost(); 53 54 tohost = val; 40 do { 41 asm volatile ( 42 "csrrw %[retval], " STRING(CSR_MTOHOST) ", %[val]\n" 43 : [retval] "=r" (retval) 44 : [val] "r" (val) 45 ); 46 } while (retval != 0); 55 47 }
Note:
See TracChangeset
for help on using the changeset viewer.