Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Sunxi Tools
Commits
47f0bfc8
Unverified
Commit
47f0bfc8
authored
Nov 10, 2020
by
Chen-Yu Tsai
Committed by
GitHub
Nov 10, 2020
Browse files
Merge pull request #144 from daym/meminfo
meminfo: Replace sys/io.h by direct register accesses.
parents
14ff3e36
783cbd59
Changes
1
Hide whitespace changes
Inline
Side-by-side
meminfo.c
View file @
47f0bfc8
...
...
@@ -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
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment