mirror of
https://github.com/ZeroOSProject/ZeroOS.git
synced 2026-09-13 01:24:42 +08:00
内存缓存和ext4完整支持
This commit is contained in:
+1
Submodule third_party/lwext4 added at 58bcf89a12
+6
@@ -0,0 +1,6 @@
|
||||
#ifndef ZEROOS_ASSERT_H_
|
||||
#define ZEROOS_ASSERT_H_
|
||||
|
||||
#define assert(x) ((void)(x))
|
||||
|
||||
#endif
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
#ifndef ZEROOS_ERRNO_H_
|
||||
#define ZEROOS_ERRNO_H_
|
||||
|
||||
#include <ext4_errno.h>
|
||||
|
||||
#endif
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
#ifndef ZEROOS_FCNTL_H_
|
||||
#define ZEROOS_FCNTL_H_
|
||||
|
||||
#include <ext4_oflags.h>
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,23 @@
|
||||
#ifndef ZEROOS_LWEXT4_GENERATED_CONFIG_H_
|
||||
#define ZEROOS_LWEXT4_GENERATED_CONFIG_H_
|
||||
|
||||
#define CONFIG_EXT_FEATURE_SET_LVL F_SET_EXT4
|
||||
#define CONFIG_JOURNALING_ENABLE 0
|
||||
#define CONFIG_XATTR_ENABLE 1
|
||||
#define CONFIG_EXTENTS_ENABLE 1
|
||||
#define CONFIG_HAVE_OWN_ERRNO 1
|
||||
#define CONFIG_DEBUG_PRINTF 0
|
||||
#define CONFIG_DEBUG_ASSERT 0
|
||||
#define CONFIG_HAVE_OWN_ASSERT 1
|
||||
#define CONFIG_BLOCK_DEV_ENABLE_STATS 0
|
||||
#define CONFIG_BLOCK_DEV_CACHE_SIZE 16
|
||||
#define CONFIG_EXT4_MAX_BLOCKDEV_NAME 32
|
||||
#define CONFIG_EXT4_BLOCKDEVS_COUNT 2
|
||||
#define CONFIG_EXT4_MAX_MP_NAME 32
|
||||
#define CONFIG_EXT4_MOUNTPOINTS_COUNT 2
|
||||
#define CONFIG_HAVE_OWN_OFLAGS 1
|
||||
#define CONFIG_MAX_TRUNCATE_SIZE (16ul * 1024ul * 1024ul)
|
||||
#define CONFIG_UNALIGNED_ACCESS 0
|
||||
#define CONFIG_USE_USER_MALLOC 1
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,9 @@
|
||||
#ifndef ZEROOS_INTTYPES_H_
|
||||
#define ZEROOS_INTTYPES_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define PRIu64 "llu"
|
||||
#define PRId64 "lld"
|
||||
|
||||
#endif
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
#ifndef ZEROOS_STDARG_H_
|
||||
#define ZEROOS_STDARG_H_
|
||||
|
||||
typedef __builtin_va_list va_list;
|
||||
#define va_start(ap, last) __builtin_va_start(ap, last)
|
||||
#define va_end(ap) __builtin_va_end(ap)
|
||||
#define va_arg(ap, type) __builtin_va_arg(ap, type)
|
||||
#define va_copy(dest, src) __builtin_va_copy(dest, src)
|
||||
|
||||
#endif
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
#ifndef ZEROOS_STDBOOL_H_
|
||||
#define ZEROOS_STDBOOL_H_
|
||||
|
||||
#define bool _Bool
|
||||
#define true 1
|
||||
#define false 0
|
||||
|
||||
#endif
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
#ifndef ZEROOS_STDDEF_H_
|
||||
#define ZEROOS_STDDEF_H_
|
||||
|
||||
#define NULL ((void *)0)
|
||||
typedef __SIZE_TYPE__ size_t;
|
||||
typedef __PTRDIFF_TYPE__ ptrdiff_t;
|
||||
|
||||
#endif
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
#ifndef ZEROOS_STDINT_H_
|
||||
#define ZEROOS_STDINT_H_
|
||||
|
||||
typedef signed char int8_t;
|
||||
typedef unsigned char uint8_t;
|
||||
typedef short int16_t;
|
||||
typedef unsigned short uint16_t;
|
||||
typedef int int32_t;
|
||||
typedef unsigned int uint32_t;
|
||||
typedef long long int64_t;
|
||||
typedef unsigned long long uint64_t;
|
||||
typedef __INTPTR_TYPE__ intptr_t;
|
||||
typedef __UINTPTR_TYPE__ uintptr_t;
|
||||
|
||||
#define UINT32_MAX 0xffffffffu
|
||||
#define UINT64_MAX 0xffffffffffffffffull
|
||||
|
||||
#endif
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
#ifndef ZEROOS_STDIO_H_
|
||||
#define ZEROOS_STDIO_H_
|
||||
|
||||
#define stdout ((void *)0)
|
||||
int printf(const char *fmt, ...);
|
||||
int fflush(void *stream);
|
||||
|
||||
#endif
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
#ifndef ZEROOS_STDLIB_H_
|
||||
#define ZEROOS_STDLIB_H_
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
void *ext4_user_malloc(size_t size);
|
||||
void *ext4_user_calloc(size_t count, size_t size);
|
||||
void ext4_user_free(void *ptr);
|
||||
void qsort(
|
||||
void *base,
|
||||
size_t nmemb,
|
||||
size_t size,
|
||||
int (*compar)(const void *, const void *)
|
||||
);
|
||||
|
||||
#endif
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
#ifndef ZEROOS_STRING_H_
|
||||
#define ZEROOS_STRING_H_
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
void *memcpy(void *dest, const void *src, size_t n);
|
||||
void *memmove(void *dest, const void *src, size_t n);
|
||||
void *memset(void *dest, int c, size_t n);
|
||||
int memcmp(const void *a, const void *b, size_t n);
|
||||
size_t strlen(const char *s);
|
||||
int strcmp(const char *a, const char *b);
|
||||
int strncmp(const char *a, const char *b, size_t n);
|
||||
char *strcpy(char *dest, const char *src);
|
||||
|
||||
#endif
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
#ifndef ZEROOS_UNISTD_H_
|
||||
#define ZEROOS_UNISTD_H_
|
||||
|
||||
#include <ext4_oflags.h>
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user