1
0
Fork 0
mirror of https://github.com/tailix/libkernaux.git synced 2024-11-27 11:14:42 -05:00

Fix conditional compilation

This commit is contained in:
Alex Kotov 2020-11-30 16:40:33 +05:00
parent 8e7bdf9d16
commit 07e914f938
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08
8 changed files with 20 additions and 6 deletions

View file

@ -30,21 +30,21 @@ void kernaux_arch_x86_write_cr4(volatile unsigned long value);
unsigned char kernaux_arch_x86_inportb(const unsigned short port)
{
register unsigned char result;
asm volatile("inb %1, %0" : "=a" (result) : "dN" (port));
__asm__ volatile("inb %1, %0" : "=a" (result) : "dN" (port));
return result;
}
unsigned short kernaux_arch_x86_inportw(const unsigned short port)
{
register unsigned short result;
asm volatile("inw %1, %0" : "=a" (result) : "dN" (port));
__asm__ volatile("inw %1, %0" : "=a" (result) : "dN" (port));
return result;
}
unsigned int kernaux_arch_x86_inportd(const unsigned short port)
{
register unsigned int result;
asm volatile("ind %1, %0" : "=a" (result) : "dN" (port));
__asm__ volatile("ind %1, %0" : "=a" (result) : "dN" (port));
return result;
}
@ -52,21 +52,21 @@ void kernaux_arch_x86_outportb(
const unsigned short port,
const unsigned char value
) {
asm volatile("outb %1, %0" : : "dN" (port), "a" (value));
__asm__ volatile("outb %1, %0" : : "dN" (port), "a" (value));
}
void kernaux_arch_x86_outportw(
const unsigned short port,
const unsigned short value
) {
asm volatile("outw %1, %0" : : "dN" (port), "a" (value));
__asm__ volatile("outw %1, %0" : : "dN" (port), "a" (value));
}
void kernaux_arch_x86_outportd(
const unsigned short port,
const unsigned int value
) {
asm volatile("outd %1, %0" : : "dN" (port), "a" (value));
__asm__ volatile("outd %1, %0" : : "dN" (port), "a" (value));
}
#ifdef __cplusplus

View file

@ -1,3 +1,5 @@
#include "../config.h"
.global kernaux_arch_x86_hang
.global kernaux_arch_x86_read_cr0
.global kernaux_arch_x86_read_cr4

View file

@ -1,3 +1,5 @@
#include "config.h"
#ifdef ARCH_X86
#include <kernaux/arch/x86.h>
#endif

View file

@ -1,3 +1,5 @@
#include "../config.h"
#include <kernaux/multiboot2.h>
const struct KernAux_Multiboot2_TagBase *KernAux_Multiboot2_first_tag_with_type(

View file

@ -1,3 +1,5 @@
#include "../config.h"
#include <kernaux/multiboot2.h>
kernaux_bool KernAux_Multiboot2_is_valid(

View file

@ -1,3 +1,5 @@
#include "../config.h"
#include <kernaux/multiboot2.h>
static const char *KernAux_Multiboot2_TagType_to_str(

View file

@ -1,3 +1,5 @@
#include "config.h"
#include <kernaux/pfa.h>
kernaux_bool KernAux_PFA_initialize_start(

View file

@ -1,3 +1,5 @@
#include "config.h"
#include <kernaux/stdlib.h>
void kernaux_memset(