diff options
author | Danny Milosavljevic <dannym@scratchpost.org> | 2020-10-09 00:01:05 +0300 |
---|---|---|
committer | Danny Milosavljevic <dannym@scratchpost.org> | 2020-10-09 00:01:31 +0300 |
commit | 783cbd59fcf086a9aaf603271823fb4ca71f0c55 (patch) | |
tree | 3e77019b93c3957fde0ef555714e094d03779675 /meminfo.c | |
parent | 3fb85399e281a0c3546a41fbf7fbb53a918a9ae9 (diff) |
meminfo: Replace sys/io.h by direct register accesses.
Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
Diffstat (limited to 'meminfo.c')
-rw-r--r-- | meminfo.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -22,7 +22,6 @@ #include <sys/mman.h> #include <stdint.h> #include <errno.h> -#include <sys/io.h> #include <stdbool.h> #include "common.h" @@ -74,24 +73,24 @@ static enum sunxi_soc_version soc_version; unsigned int sunxi_io_read(void *base, int offset) { - return inl((unsigned long) (base + offset)); + return *(volatile unsigned int*) (base + offset); } void sunxi_io_write(void *base, int offset, unsigned int value) { - outl(value, (unsigned long) (base + offset)); + *(volatile unsigned int*) (base + offset) = value; } void sunxi_io_mask(void *base, int offset, unsigned int value, unsigned int mask) { - unsigned int tmp = inl((unsigned long) (base + offset)); + unsigned int tmp = sunxi_io_read(base, offset); tmp &= ~mask; tmp |= value & mask; - outl(tmp, (unsigned long) (base + offset)); + sunxi_io_write(base, offset, tmp); } |