From 8746f5abe553169e7510040607c64063bbbfb10b Mon Sep 17 00:00:00 2001 From: xiexg-dc Date: Wed, 13 Apr 2022 15:05:51 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9C=A8riscv32=5Fvirt=E4=B8=AD?= =?UTF-8?q?=E6=96=B0=E5=A2=9Egraphic=E9=80=82=E9=85=8D=EF=BC=8C=E5=B0=86mu?= =?UTF-8?q?sl=E8=B0=83=E6=95=B4=E4=B8=BAnewlib?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在riscv32_virt中新增graphic适配,将riscv32_virt编译从musl调整为newlib。 fix #I52IID Signed-off-by: xiexg-dc Change-Id: I1a774666609172c5de6310fe43b33185f86ac872 --- kal/libc/newlib/porting/include/sys/fcntl.h | 6 ++++ kal/libc/newlib/porting/include/time.h | 34 +++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/kal/libc/newlib/porting/include/sys/fcntl.h b/kal/libc/newlib/porting/include/sys/fcntl.h index 8ecae833..3a823619 100644 --- a/kal/libc/newlib/porting/include/sys/fcntl.h +++ b/kal/libc/newlib/porting/include/sys/fcntl.h @@ -35,4 +35,10 @@ #define O_NDELAY _FNDELAY +#ifdef __riscv +#ifndef O_CLOEXEC +#define O_CLOEXEC 02000000 +#endif +#endif /* __riscv */ + #endif /* !_ADAPT_SYS_FCNTL_H */ diff --git a/kal/libc/newlib/porting/include/time.h b/kal/libc/newlib/porting/include/time.h index b1659482..9632d6c8 100644 --- a/kal/libc/newlib/porting/include/time.h +++ b/kal/libc/newlib/porting/include/time.h @@ -37,4 +37,38 @@ #include_next +#ifdef __riscv +#ifndef CLOCK_MONOTONIC_RAW +#define CLOCK_MONOTONIC_RAW 12 +#endif + +#ifndef CLOCK_REALTIME_COARSE +#define CLOCK_REALTIME_COARSE 5 +#endif + +#ifndef CLOCK_MONOTONIC_COARSE +#define CLOCK_MONOTONIC_COARSE 6 +#endif + +#ifndef CLOCK_BOOTTIME +#define CLOCK_BOOTTIME 7 +#endif + +#ifndef CLOCK_REALTIME_ALARM +#define CLOCK_REALTIME_ALARM 8 +#endif + +#ifndef CLOCK_BOOTTIME_ALARM +#define CLOCK_BOOTTIME_ALARM 9 +#endif + +#ifndef CLOCK_SGI_CYCLE +#define CLOCK_SGI_CYCLE 10 +#endif + +#ifndef CLOCK_TAI +#define CLOCK_TAI 11 +#endif +#endif /* __riscv */ + #endif /* !_ADAPT_TIME_H */