aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/sunxi-tools-remove-sys-io.patch
blob: fc1e5ea28da677cbb628344d7dff4023910917e1 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
From 783cbd59fcf086a9aaf603271823fb4ca71f0c55 Mon Sep 17 00:00:00 2001
From: Danny Milosavljevic <dannym@scratchpost.org>
Date: Thu, 8 Oct 2020 23:01:05 +0200
Subject: [PATCH] meminfo: Replace sys/io.h by direct register accesses.
See: https://github.com/linux-sunxi/sunxi-tools/pull/144

Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
---
 meminfo.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/meminfo.c b/meminfo.c
index 0b0ff23..3b3a5df 100644
--- a/meminfo.c
+++ b/meminfo.c
@@ -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);
 }
 
 
..As explained in bug 45252, this is the right way to invoke it. * gnu/packages/libffi.scm (arguments): Change the invocation of the "patch" tool in the case where the %current-target-system or %current-system begins with "powerpc64le", so that we invoke it using --force instead of --batch. Chris Marusich 2020-12-21Merge branch 'ungrafting' into stagingMarius Bakke 2020-12-20Revert "gnu: libffi: Add unreleased patch to fix float128 on powerpc64le."...This reverts commit 4fff5ab24126a152b50c036b9bf8dc6f2740f094. In <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=45252> we decided to apply a patch to master instead, so this change is no longer needed on core-updates. Chris Marusich 2020-12-20gnu: libffi: Add unreleased patch to fix float128 on powerpc64le....Fixes <https://bugs.gnu.org/45252>. * gnu/packages/patches/libffi-float128-powerpc64le.patch: Import patch file from <https://github.com/libffi/libffi/pull/561.patch>. * gnu/packages/libffi.scm (libffi)[arguments]: Apply patch conditionally for powerpc64le-* systems in a phase. [inputs]: Add patch as input conditionally for powerpc64le-* systems. * gnu/local.mk (dist_patch_DATA): Add patch file to build system. Signed-off-by: Chris Marusich <cmmarusich@gmail.com> John Doe 2020-12-13gnu: python-cffi: Update to 1.14.4....* gnu/packages/libffi.scm (python-cffi): Update to 1.14.4. Marius Bakke