gnu: lrzip: Update to 0.640.
[jackhill/guix/guix.git] / gnu / packages / patches / sunxi-tools-remove-sys-io.patch
CommitLineData
7e917283
DM
1From 783cbd59fcf086a9aaf603271823fb4ca71f0c55 Mon Sep 17 00:00:00 2001
2From: Danny Milosavljevic <dannym@scratchpost.org>
3Date: Thu, 8 Oct 2020 23:01:05 +0200
4Subject: [PATCH] meminfo: Replace sys/io.h by direct register accesses.
5See: https://github.com/linux-sunxi/sunxi-tools/pull/144
6
7Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
8---
9 meminfo.c | 9 ++++-----
10 1 file changed, 4 insertions(+), 5 deletions(-)
11
12diff --git a/meminfo.c b/meminfo.c
13index 0b0ff23..3b3a5df 100644
14--- a/meminfo.c
15+++ b/meminfo.c
16@@ -22,7 +22,6 @@
17 #include <sys/mman.h>
18 #include <stdint.h>
19 #include <errno.h>
20-#include <sys/io.h>
21 #include <stdbool.h>
22
23 #include "common.h"
24@@ -74,24 +73,24 @@ static enum sunxi_soc_version soc_version;
25 unsigned int
26 sunxi_io_read(void *base, int offset)
27 {
28- return inl((unsigned long) (base + offset));
29+ return *(volatile unsigned int*) (base + offset);
30 }
31
32 void
33 sunxi_io_write(void *base, int offset, unsigned int value)
34 {
35- outl(value, (unsigned long) (base + offset));
36+ *(volatile unsigned int*) (base + offset) = value;
37 }
38
39 void
40 sunxi_io_mask(void *base, int offset, unsigned int value, unsigned int mask)
41 {
42- unsigned int tmp = inl((unsigned long) (base + offset));
43+ unsigned int tmp = sunxi_io_read(base, offset);
44
45 tmp &= ~mask;
46 tmp |= value & mask;
47
48- outl(tmp, (unsigned long) (base + offset));
49+ sunxi_io_write(base, offset, tmp);
50 }
51
52