mirror of
https://github.com/tailix/libkernaux.git
synced 2024-12-04 11:25:18 -05:00
Add funcs to work with i386 cr* registers
This commit is contained in:
parent
e09447168d
commit
13a2306622
5 changed files with 39 additions and 2 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -1,5 +1,7 @@
|
|||
*.a
|
||||
*.o
|
||||
.deps/
|
||||
.dirstamp
|
||||
|
||||
/Makefile
|
||||
/Makefile.in
|
||||
|
@ -17,5 +19,3 @@
|
|||
/include/Makefile.in
|
||||
/install-sh
|
||||
/missing
|
||||
/src/.deps/
|
||||
/src/.dirstamp
|
||||
|
|
|
@ -5,4 +5,5 @@ AM_CFLAGS = -I$(top_srcdir)/include
|
|||
lib_LIBRARIES = libkernaux.a
|
||||
|
||||
libkernaux_a_SOURCES = \
|
||||
src/arch/i386.S \
|
||||
src/pfa.c
|
||||
|
|
|
@ -17,6 +17,7 @@ AC_CONFIG_FILES([
|
|||
AC_LANG([C])
|
||||
|
||||
AM_PROG_AR
|
||||
AM_PROG_AS
|
||||
AC_PROG_CC
|
||||
AC_PROG_RANLIB
|
||||
|
||||
|
|
|
@ -5,6 +5,13 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
unsigned long kernaux_arch_i386_read_cr0();
|
||||
unsigned long kernaux_arch_i386_read_cr4();
|
||||
|
||||
void kernaux_arch_i386_write_cr0(volatile unsigned long value);
|
||||
void kernaux_arch_i386_write_cr3(volatile unsigned long value);
|
||||
void kernaux_arch_i386_write_cr4(volatile unsigned long value);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
28
src/arch/i386.S
Normal file
28
src/arch/i386.S
Normal file
|
@ -0,0 +1,28 @@
|
|||
.global kernaux_arch_i386_read_cr0
|
||||
.global kernaux_arch_i386_read_cr4
|
||||
.global kernaux_arch_i386_write_cr0
|
||||
.global kernaux_arch_i386_write_cr3
|
||||
.global kernaux_arch_i386_write_cr4
|
||||
|
||||
kernaux_arch_i386_read_cr0:
|
||||
mov %cr0, %eax
|
||||
ret
|
||||
|
||||
kernaux_arch_i386_read_cr4:
|
||||
mov %cr4, %eax
|
||||
ret
|
||||
|
||||
kernaux_arch_i386_write_cr0:
|
||||
mov 4(%esp), %eax
|
||||
mov %eax, %cr0
|
||||
ret
|
||||
|
||||
kernaux_arch_i386_write_cr3:
|
||||
mov 4(%esp), %eax
|
||||
mov %eax, %cr3
|
||||
ret
|
||||
|
||||
kernaux_arch_i386_write_cr4:
|
||||
mov 4(%esp), %eax
|
||||
mov %eax, %cr4
|
||||
ret
|
Loading…
Reference in a new issue