Add arch "riscv64"

This commit is contained in:
Alex Kotov 2022-01-15 15:09:45 +05:00
parent 536c1f44f7
commit 00345258e9
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
7 changed files with 40 additions and 0 deletions

View File

@ -30,6 +30,10 @@ if ASM_I386
libkernaux_a_SOURCES += src/asm/i386.S
endif
if ASM_RISCV64
libkernaux_a_SOURCES += src/asm/riscv64.S
endif
if ASM_X86_64
libkernaux_a_SOURCES += src/asm/x86_64.S
endif

View File

@ -54,6 +54,7 @@ AS_IF([test "$with_libc" = yes], do_with_libc)
dnl Architecture
AM_CONDITIONAL([ASM_I386], [test "$host_cpu" = i386])
AM_CONDITIONAL([ASM_RISCV64], [test "$host_cpu" = riscv64])
AM_CONDITIONAL([ASM_X86_64], [test "$host_cpu" = x86_64])
dnl Features (disabled by default)
@ -79,6 +80,7 @@ AM_CONDITIONAL([WITH_LIBC_STRLEN], [test "$with_libc_strlen" = yes])
dnl Architecture
AS_IF([test "$host_cpu" = i386], [AC_DEFINE([ASM_I386], [1], [architecture is i386])])
AS_IF([test "$host_cpu" = riscv64], [AC_DEFINE([ASM_RISCV64], [1], [architecture is RISC-V 64-bit])])
AS_IF([test "$host_cpu" = x86_64], [AC_DEFINE([ASM_X86_64], [1], [architecture is x86_64])])
dnl Features (disabled by default)

View File

@ -1,8 +1,10 @@
nobase_include_HEADERS = \
kernaux.h \
kernaux/arch/i386.h \
kernaux/arch/riscv64.h \
kernaux/arch/x86_64.h \
kernaux/asm/i386.h \
kernaux/asm/riscv64.h \
kernaux/asm/x86_64.h \
kernaux/assert.h \
kernaux/cmdline.h \

View File

@ -18,4 +18,5 @@
#include <kernaux/units.h>
#include <kernaux/arch/i386.h>
#include <kernaux/arch/riscv64.h>
#include <kernaux/arch/x86_64.h>

View File

@ -0,0 +1,14 @@
#ifndef KERNAUX_INCLUDED_ARCH_RISCV64
#define KERNAUX_INCLUDED_ARCH_RISCV64
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,14 @@
#ifndef KERNAUX_INCLUDED_ASM_RISCV64
#define KERNAUX_INCLUDED_ASM_RISCV64
#ifdef __cplusplus
extern "C" {
#endif
#include <kernaux/arch/riscv64.h>
#ifdef __cplusplus
}
#endif
#endif

3
src/asm/riscv64.S Normal file
View File

@ -0,0 +1,3 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif