Add "src/arch/i386/paging.c"

This commit is contained in:
Alex Kotov 2021-12-19 08:37:12 +05:00
parent c04365845a
commit f659e2af97
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
2 changed files with 28 additions and 0 deletions

View File

@ -25,13 +25,18 @@ libkernaux_a_SOURCES = \
src/libc.c \
src/printf.c
if WITH_ARCH_I386
if ARCH_I386
libkernaux_a_SOURCES += src/arch/i386/asm.S
endif
libkernaux_a_SOURCES += src/arch/i386/paging.c
endif
if WITH_ARCH_X86_64
if ARCH_X86_64
libkernaux_a_SOURCES += src/arch/x86_64/asm.S
endif
endif
if WITH_CMDLINE
libkernaux_a_SOURCES += src/cmdline.c

23
src/arch/i386/paging.c Normal file
View File

@ -0,0 +1,23 @@
#include <kernaux/arch/i386.h>
// TODO: There are some static asserts just for example.
__attribute__((unused))
static const int assert0[
sizeof(struct KernAux_Arch_I386_PDE) == sizeof(uint32_t) ? 1 : -1
];
__attribute__((unused))
static const int assert1[
sizeof(struct KernAux_Arch_I386_PTE) == sizeof(uint32_t) ? 1 : -1
];
__attribute__((unused))
static const int assert1[
sizeof(struct KernAux_Arch_I386_PageDir) == 1024 * sizeof(uint32_t) ? 1 : -1
];
__attribute__((unused))
static const int assert1[
sizeof(struct KernAux_Arch_I386_PageTable) == 1024 * sizeof(uint32_t) ? 1 : -1
];