From 2d6646029bb34e8d76b22eebf1fa75e4853debc6 Mon Sep 17 00:00:00 2001 From: "Sergey Semyonov (Serge)" Date: Sun, 6 Sep 2015 08:56:26 +0000 Subject: [PATCH] newlib: update git-svn-id: svn://kolibrios.org@5808 a494cfbc-eb01-0410-851d-a64ba20cac60 --- .../sdk/sources/newlib/libc/include/kos32sys.h | 11 +++++++++++ .../sdk/sources/newlib/libc/include/stdio.h | 2 +- .../sources/newlib/libc/include/sys/kos_io.h | 18 +++++++----------- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/contrib/sdk/sources/newlib/libc/include/kos32sys.h b/contrib/sdk/sources/newlib/libc/include/kos32sys.h index cfaeda819a..e669898549 100644 --- a/contrib/sdk/sources/newlib/libc/include/kos32sys.h +++ b/contrib/sdk/sources/newlib/libc/include/kos32sys.h @@ -193,6 +193,17 @@ uint32_t get_tick_count(void) return val; }; +static inline +uint64_t get_ns_count(void) +{ + uint64_t val; + __asm__ __volatile__( + "int $0x40" + :"=A"(val) + :"a"(26), "b"(10)); + return val; +}; + static inline oskey_t get_key(void) { diff --git a/contrib/sdk/sources/newlib/libc/include/stdio.h b/contrib/sdk/sources/newlib/libc/include/stdio.h index c8125e9fa3..9dd8ba75f3 100644 --- a/contrib/sdk/sources/newlib/libc/include/stdio.h +++ b/contrib/sdk/sources/newlib/libc/include/stdio.h @@ -102,7 +102,7 @@ typedef _fpos64_t fpos64_t; #ifdef __BUFSIZ__ #define BUFSIZ __BUFSIZ__ #else -#define BUFSIZ 1024 +#define BUFSIZ 4096 #endif #ifdef __FOPEN_MAX__ diff --git a/contrib/sdk/sources/newlib/libc/include/sys/kos_io.h b/contrib/sdk/sources/newlib/libc/include/sys/kos_io.h index 21c75f74a2..6ece4a1bb0 100644 --- a/contrib/sdk/sources/newlib/libc/include/sys/kos_io.h +++ b/contrib/sdk/sources/newlib/libc/include/sys/kos_io.h @@ -2,6 +2,10 @@ #ifndef __KOS_IO_H__ #define __KOS_IO_H__ +#ifdef __cplusplus +extern "C" { +#endif + #pragma pack(push, 1) typedef struct { @@ -65,19 +69,8 @@ int read_file(const char *path, void *buff, int write_file(const char *path,const void *buff, size_t offset, size_t count, size_t *writes); int set_file_size(const char *path, unsigned size); -void *load_file(const char *path, size_t *len); void unpack(void* packed_data, void* unpacked_data) __attribute__((stdcall)) ; -static inline int user_free(void *mem) -{ - int val; - __asm__ __volatile__( - "int $0x40" - :"=a"(val) - :"a"(68),"b"(12),"c"(mem)); - return val; -} - static inline void set_cwd(const char* cwd) { __asm__ __volatile__( @@ -85,4 +78,7 @@ static inline void set_cwd(const char* cwd) ::"a"(30),"b"(1),"c"(cwd)); }; +#ifdef __cplusplus +} +#endif #endif