diff options
author | Jiri Gaisler <jiri@gaisler.se> | 2019-01-18 18:00:47 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2019-01-22 12:50:08 +0100 |
commit | 9b2b389e8d6c9a871a3d5de882fc48b13bc9f1ac (patch) | |
tree | 813132b05c576d8327ae012439feb7207289f8c6 /bsps/include | |
parent | grlib: use rtems_interrupt_handler_install() (diff) | |
download | rtems-9b2b389e8d6c9a871a3d5de882fc48b13bc9f1ac.tar.bz2 |
grlib: use cpu-independent routines for uncached access
Update #3678.
Diffstat (limited to 'bsps/include')
-rw-r--r-- | bsps/include/grlib/grlib_impl.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/bsps/include/grlib/grlib_impl.h b/bsps/include/grlib/grlib_impl.h index 9a7fa15a5e..dd6bcc64b7 100644 --- a/bsps/include/grlib/grlib_impl.h +++ b/bsps/include/grlib/grlib_impl.h @@ -90,6 +90,58 @@ RTEMS_INLINE_ROUTINE void *grlib_calloc(size_t nelem, size_t elsize) #endif +#ifdef __sparc__ + +RTEMS_INLINE_ROUTINE unsigned char grlib_read_uncached8(unsigned int address) +{ + unsigned char tmp; + __asm__ (" lduba [%1]1, %0 " + : "=r"(tmp) + : "r"(address) + ); + return tmp; +} + +RTEMS_INLINE_ROUTINE unsigned short grlib_read_uncached16(unsigned int addr) { + unsigned short tmp; + __asm__ (" lduha [%1]1, %0 " + : "=r"(tmp) + : "r"(addr) + ); + return tmp; +} + + +RTEMS_INLINE_ROUTINE unsigned int grlib_read_uncached32(unsigned int address) +{ + unsigned int tmp; + __asm__ (" lda [%1]1, %0 " + : "=r"(tmp) + : "r"(address) + ); + return tmp; +} +#else + +static unsigned char __inline__ grlib_read_uncached8(unsigned int address) +{ + unsigned char tmp = (*(volatile unsigned char *)(address)); + return tmp; +} + +static __inline__ unsigned short grlib_read_uncached16(unsigned int address) { + unsigned short tmp = (*(volatile unsigned short *)(address)); + return tmp; +} + +RTEMS_INLINE_ROUTINE unsigned int grlib_read_uncached32(unsigned int address) +{ + unsigned int tmp = (*(volatile unsigned int *)(address)); + return tmp; +} + +#endif + extern struct ambapp_bus ambapp_plb; #ifdef __cplusplus |