Add mmap module to bank various memory in and out.

This commit is contained in:
giomba 2024-12-14 19:35:15 +01:00
parent b461731f45
commit d270985dba
2 changed files with 23 additions and 0 deletions

11
src/mmap.c Normal file
View 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
View 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