Add mmap module to bank various memory in and out.
This commit is contained in:
parent
b461731f45
commit
d270985dba
11
src/mmap.c
Normal file
11
src/mmap.c
Normal file
@ -0,0 +1,11 @@
|
||||
#include "mmap.h"
|
||||
|
||||
#include "io.h"
|
||||
|
||||
#define MMAP_VALID_BITS 0x81
|
||||
#define MMAP_PORT_ADDR 0x81
|
||||
|
||||
void mmap_set(enum mmap_mode_t mode) {
|
||||
io_out(MMAP_PORT_ADDR, (io_in(MMAP_PORT_ADDR) & ~MMAP_VALID_BITS) |
|
||||
(mode & MMAP_VALID_BITS));
|
||||
}
|
12
src/mmap.h
Normal file
12
src/mmap.h
Normal file
@ -0,0 +1,12 @@
|
||||
#ifndef CEDA_DEMO_MMAP
|
||||
#define CEDA_DEMO_MMAP
|
||||
|
||||
enum mmap_mode_t {
|
||||
MMAP_MODE_LINEAR = 0x01,
|
||||
MMAP_MODE_CEDA_VIDEO = 0x00,
|
||||
MMAP_MODE_CEDA_ATTR = 0x80,
|
||||
};
|
||||
|
||||
void mmap_set(enum mmap_mode_t mode);
|
||||
|
||||
#endif // CEDA_DEMO_MMAP
|
Loading…
Reference in New Issue
Block a user