diff --git a/src/mmap.c b/src/mmap.c new file mode 100644 index 0000000..2632a5c --- /dev/null +++ b/src/mmap.c @@ -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)); +} \ No newline at end of file diff --git a/src/mmap.h b/src/mmap.h new file mode 100644 index 0000000..edd8bbf --- /dev/null +++ b/src/mmap.h @@ -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