Browse Source

update include hierarchy

pull/2/head
Lephenixnoir 1 year ago
parent
commit
e719af2f63
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
  1. 7
      CMakeLists.txt
  2. 0
      include/fcntl.h
  3. 1
      include/fxlibc/sys/signal.h
  4. 0
      include/setjmp.h
  5. 0
      include/signal.h
  6. 0
      include/stdio.h
  7. 0
      include/stdlib.h
  8. 0
      include/string.h
  9. 0
      include/sys/mman.h
  10. 1
      include/sys/signal.h
  11. 0
      include/sys/stat.h
  12. 4
      include/sys/syscall.h
  13. 0
      include/sys/types.h
  14. 4
      include/sys/wait.h
  15. 0
      include/syscall.h
  16. 0
      include/target/casiowin-cg/bits/__trapa.h
  17. 7
      include/target/casiowin-cg/bits/confname.h
  18. 0
      include/target/casiowin-cg/bits/unistd_32.h
  19. 7
      include/target/casiowin-fx/bits/confname.h
  20. 0
      include/target/casiowin-fx/bits/trapa.h
  21. 0
      include/target/casiowin-fx/bits/unistd_32.h
  22. 7
      include/target/gint/bits/confname.h
  23. 0
      include/target/vhex-generic/bits/asm/unistd_32.h
  24. 0
      include/target/vhex-generic/bits/confname.h
  25. 0
      include/target/vhex-generic/bits/fcntl.h
  26. 0
      include/target/vhex-generic/bits/setjmp.h
  27. 0
      include/target/vhex-generic/bits/sigaction.h
  28. 0
      include/target/vhex-generic/bits/signum.h
  29. 0
      include/target/vhex-generic/bits/types/FILE.h
  30. 0
      include/target/vhex-generic/bits/types/__FILE.h
  31. 2
      include/target/vhex-generic/bits/types/struct_FILE.h
  32. 0
      include/target/vhex-generic/bits/waitflags.h
  33. 0
      include/target/vhex-generic/bits/waitstatus.h
  34. 0
      include/threads.h
  35. 0
      include/unistd.h
  36. 2
      src/libc/signal/target/vhex-sh/kill.S
  37. 2
      src/libc/signal/target/vhex-sh/signal.S
  38. 2
      src/libc/stdio/dprintf.c
  39. 2
      src/libc/stdio/internal/printf_actions.c
  40. 2
      src/libc/stdio/internal/printf_common.c
  41. 2
      src/libc/stdio/internal/printf_options.c
  42. 4
      src/libc/stdio/printf.c
  43. 4
      src/libc/stdio/putc.c
  44. 6
      src/libc/stdio/puts.c
  45. 2
      src/libc/stdio/snprintf.c
  46. 2
      src/libc/stdio/sprintf.c
  47. 4
      src/libc/stdio/vdprintf.c
  48. 2
      src/libc/stdio/vsnprintf.c
  49. 2
      src/libc/stdio/vsprintf.c
  50. 6
      src/libc/stdlib/calloc.c
  51. 2
      src/libc/stdlib/reallocarray.c
  52. 2
      src/libc/stdlib/target/vhex-sh/free.S
  53. 2
      src/libc/stdlib/target/vhex-sh/malloc.S
  54. 2
      src/libc/stdlib/target/vhex-sh/realloc.S
  55. 3
      src/libc/string/memcpy.c
  56. 3
      src/libc/string/memset.c
  57. 2
      src/libc/string/strcat.c
  58. 2
      src/libc/string/strchr.c
  59. 2
      src/libc/string/strcmp.c
  60. 2
      src/libc/string/strcpy.c
  61. 4
      src/libc/string/strdup.c
  62. 2
      src/libc/string/strlen.c
  63. 4
      src/libc/threads/mutex.c
  64. 2
      src/posix/fcntl/target/vhex-sh/open.S
  65. 2
      src/posix/sys/wait/target/vhex-sh/wait.S
  66. 2
      src/posix/sys/wait/target/vhex-sh/waitpid.S
  67. 4
      src/posix/unistd/target/casiowin-fx/close.S
  68. 2
      src/posix/unistd/target/vhex-sh/close.S
  69. 2
      src/posix/unistd/target/vhex-sh/fork_execve.S
  70. 2
      src/posix/unistd/target/vhex-sh/getpgid.S
  71. 2
      src/posix/unistd/target/vhex-sh/getpid.S
  72. 2
      src/posix/unistd/target/vhex-sh/getppid.S
  73. 2
      src/posix/unistd/target/vhex-sh/lseek.S
  74. 2
      src/posix/unistd/target/vhex-sh/read.S
  75. 2
      src/posix/unistd/target/vhex-sh/setpgid.S
  76. 2
      src/posix/unistd/target/vhex-sh/write.S

7
CMakeLists.txt

@ -122,6 +122,9 @@ endif()
add_library(fxlibc ${SOURCES})
target_include_directories(fxlibc PRIVATE include/)
foreach(FOLDER IN LISTS TARGET_FOLDERS)
target_include_directories(fxlibc PRIVATE include/target/${FOLDER}/)
endforeach()
set_target_properties(fxlibc PROPERTIES
OUTPUT_NAME "c") # libc.a
@ -132,5 +135,7 @@ install(TARGETS fxlibc DESTINATION lib/)
install(DIRECTORY include/ DESTINATION include/ PATTERN "target" EXCLUDE)
foreach(FOLDER IN LISTS TARGET_FOLDERS)
install(DIRECTORY include/target/${FOLDER}/ DESTINATION include/)
if(EXISTS include/target/${FOLDER}/)
install(DIRECTORY include/target/${FOLDER}/ DESTINATION include/)
endif()
endforeach()

0
include/fxlibc/fcntl.h → include/fcntl.h

1
include/fxlibc/sys/signal.h

@ -1 +0,0 @@
#include <fxlibc/signal.h>

0
include/fxlibc/setjmp.h → include/setjmp.h

0
include/fxlibc/signal.h → include/signal.h

0
include/fxlibc/stdio.h → include/stdio.h

0
include/fxlibc/stdlib.h → include/stdlib.h

0
include/fxlibc/string.h → include/string.h

0
include/fxlibc/sys/mman.h → include/sys/mman.h

1
include/sys/signal.h

@ -0,0 +1 @@
#include <signal.h>

0
include/fxlibc/sys/stat.h → include/sys/stat.h

4
include/fxlibc/sys/syscall.h → include/sys/syscall.h

@ -6,13 +6,13 @@
** But instead of duplicating this we use the information available
** from the kernel sources.
*/
#include <fxlibc/asm/unistd.h>
#include <bits/unistd.h>
/*
** The Linux kernel header file defines macros __NR_*, but some
** programs expect the traditional form SYS_*. <bits/syscall.h>
** defines SYS_* macros for __NR_* macros of known names.
*/
#include <fxlibc/bits/syscall.h>
#include <bits/syscall.h>
#endif

0
include/fxlibc/sys/types.h → include/sys/types.h

4
include/fxlibc/sys/wait.h → include/sys/wait.h

@ -9,10 +9,10 @@
** This will define the `W*' macros for the flag bits to `waitpid', `wait3',
** and `wait4'.
*/
#include <fxlibc/bits/waitflags.h>
#include <bits/waitflags.h>
/* This will define all the `__W*' macros.*/
#include <fxlibc/bits/waitstatus.h>
#include <bits/waitstatus.h>
/* Macros for the `waitpid`'s wstatus argument. */
#define WEXITSTATUS(status) __WEXITSTATUS(status)

0
include/fxlibc/syscall.h → include/syscall.h

0
include/fxlibc/target/casiowin-cg/__trapa.h → include/target/casiowin-cg/bits/__trapa.h

7
include/target/casiowin-cg/bits/confname.h

@ -0,0 +1,7 @@
#ifndef __BITS_CONFNAME_H__
# define __BITS_CONFNAME_H__
#define _SC_PAGE_SIZE 0
#define _SC_PAGESIZE _SC_PAGE_SIZE
#endif /*__BITS_CONFNAME_H__*/

0
include/fxlibc/target/casiowin-cg/unistd_32.h → include/target/casiowin-cg/bits/unistd_32.h

7
include/target/casiowin-fx/bits/confname.h

@ -0,0 +1,7 @@
#ifndef __BITS_CONFNAME_H__
# define __BITS_CONFNAME_H__
#define _SC_PAGE_SIZE 0
#define _SC_PAGESIZE _SC_PAGE_SIZE
#endif /*__BITS_CONFNAME_H__*/

0
include/fxlibc/target/casiowin-fx/trapa.h → include/target/casiowin-fx/bits/trapa.h

0
include/fxlibc/target/casiowin-fx/unistd_32.h → include/target/casiowin-fx/bits/unistd_32.h

7
include/target/gint/bits/confname.h

@ -0,0 +1,7 @@
#ifndef __BITS_CONFNAME_H__
# define __BITS_CONFNAME_H__
#define _SC_PAGE_SIZE 0
#define _SC_PAGESIZE _SC_PAGE_SIZE
#endif /*__BITS_CONFNAME_H__*/

0
include/fxlibc/target/vhex-generic/asm/unistd_32.h → include/target/vhex-generic/bits/asm/unistd_32.h

0
include/fxlibc/target/vhex-generic/confname.h → include/target/vhex-generic/bits/confname.h

0
include/fxlibc/target/vhex-generic/fcntl.h → include/target/vhex-generic/bits/fcntl.h

0
include/fxlibc/target/vhex-generic/setjmp.h → include/target/vhex-generic/bits/setjmp.h

0
include/fxlibc/target/vhex-generic/sigaction.h → include/target/vhex-generic/bits/sigaction.h

0
include/fxlibc/target/vhex-generic/signum.h → include/target/vhex-generic/bits/signum.h

0
include/fxlibc/target/vhex-generic/types/FILE.h → include/target/vhex-generic/bits/types/FILE.h

0
include/fxlibc/target/vhex-generic/types/__FILE.h → include/target/vhex-generic/bits/types/__FILE.h

2
include/fxlibc/target/vhex-generic/types/struct_FILE.h → include/target/vhex-generic/bits/types/struct_FILE.h

@ -4,7 +4,7 @@
#include <stdint.h>
#include <stddef.h>
#include <fxlibc/sys/types.h>
#include <sys/types.h>
//---
// TODO: VFS abstraction ? or ABI-spesific abstraction ?

0
include/fxlibc/target/vhex-generic/waitflags.h → include/target/vhex-generic/bits/waitflags.h

0
include/fxlibc/target/vhex-generic/waitstatus.h → include/target/vhex-generic/bits/waitstatus.h

0
include/fxlibc/threads.h → include/threads.h

0
include/fxlibc/unistd.h → include/unistd.h

2
src/libc/signal/target/vhex-sh/kill.S

@ -1,5 +1,5 @@
#ifdef __SUPPORT_VHEX_KERNEL
#include <fxlibc/asm/unistd_32.h>
#include <bits/asm/unistd_32.h>
.text
.global _kill
.type _kill, @function

2
src/libc/signal/target/vhex-sh/signal.S

@ -1,5 +1,5 @@
#ifdef __SUPPORT_VHEX_KERNEL
#include <fxlibc/asm/unistd_32.h>
#include <bits/asm/unistd_32.h>
.text
.global _signal
.type _signal, @function

2
src/libc/stdio/dprintf.c

@ -1,4 +1,4 @@
#include <fxlibc/stdio.h>
#include <stdio.h>
/*
** The function dprintf() is the same as fprintf() except that it outputs to a

2
src/libc/stdio/internal/printf_actions.c

@ -1,4 +1,4 @@
#include <fxlibc/stdio.h>
#include <stdio.h>
// internal depency
#include "printf.h"

2
src/libc/stdio/internal/printf_common.c

@ -1,4 +1,4 @@
#include <fxlibc/stdio.h>
#include <stdio.h>
// internal depency
#include "printf.h"

2
src/libc/stdio/internal/printf_options.c

@ -1,4 +1,4 @@
#include <fxlibc/stdio.h>
#include <stdio.h>
// internal depency
#include "printf.h"

4
src/libc/stdio/printf.c

@ -1,5 +1,5 @@
#include <fxlibc/stdio.h>
#include <fxlibc/unistd.h>
#include <stdio.h>
#include <unistd.h>
/*
** printf() write the output under the control of a format string that specifies

4
src/libc/stdio/putc.c

@ -1,5 +1,5 @@
#include <fxlibc/stdio.h>
#include <fxlibc/unistd.h>
#include <stdio.h>
#include <unistd.h>
int putchar(int c)
{

6
src/libc/stdio/puts.c

@ -1,6 +1,6 @@
#include <fxlibc/stdio.h>
#include <fxlibc/string.h>
#include <fxlibc/unistd.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
/*
** puts() writes the string s and a trailing newline to stdout.

2
src/libc/stdio/snprintf.c

@ -1,4 +1,4 @@
#include <fxlibc/stdio.h>
#include <stdio.h>
/*
** sprintf(), snprintf(), vsprintf() and vsnprintf() write the output under the

2
src/libc/stdio/sprintf.c

@ -1,4 +1,4 @@
#include <fxlibc/stdio.h>
#include <stdio.h>
/*
** sprintf(), snprintf(), vsprintf() and vsnprintf() write the output under the

4
src/libc/stdio/vdprintf.c

@ -1,5 +1,5 @@
#include <fxlibc/stdio.h>
#include <fxlibc/unistd.h>
#include <stdio.h>
#include <unistd.h>
// internal depency
#include "internal/printf.h"

2
src/libc/stdio/vsnprintf.c

@ -1,4 +1,4 @@
#include <fxlibc/stdio.h>
#include <stdio.h>
// internal depency
#include "internal/printf.h"

2
src/libc/stdio/vsprintf.c

@ -1,4 +1,4 @@
#include <fxlibc/stdio.h>
#include <stdio.h>
/*
** The functions vsprintf() are equivalent to the sprintf() except that they

6
src/libc/stdlib/calloc.c

@ -1,6 +1,6 @@
#include <fxlibc/stdlib.h>
#include <fxlibc/string.h>
#include <fxlibc/unistd.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
/*
** The calloc() function allocates memory for an array of nmemb elements of size

2
src/libc/stdlib/reallocarray.c

@ -1,4 +1,4 @@
#include <fxlibc/stdlib.h>
#include <stdlib.h>
/*
** The reallocarray() function changes the size of the memory block pointed to

2
src/libc/stdlib/target/vhex-sh/free.S

@ -1,5 +1,5 @@
#ifdef __SUPPORT_VHEX_KERNEL
#include <fxlibc/asm/unistd_32.h>
#include <bits/asm/unistd_32.h>
.text
.global _free
.type _free, @function

2
src/libc/stdlib/target/vhex-sh/malloc.S

@ -1,5 +1,5 @@
#ifdef __SUPPORT_VHEX_KERNEL
#include <fxlibc/asm/unistd_32.h>
#include <bits/asm/unistd_32.h>
.text
.global _malloc
.type _malloc, @function

2
src/libc/stdlib/target/vhex-sh/realloc.S

@ -1,5 +1,5 @@
#ifdef __SUPPORT_VHEX_KERNEL
#include <fxlibc/asm/unistd_32.h>
#include <bits/asm/unistd_32.h>
.text
.global _realloc
.type _realloc, @function

3
src/libc/string/memcpy.c

@ -1,4 +1,5 @@
#include <fxlibc/string.h>
#include <string.h>
#include <stdint.h>
/*
** The memcpy() function copies n bytes from memory area src to memory area dest.

3
src/libc/string/memset.c

@ -1,4 +1,5 @@
#include <fxlibc/string.h>
#include <string.h>
#include <stdint.h>
/*
** The memset() function fills the first n bytes of the memory area pointed to

2
src/libc/string/strcat.c

@ -1,4 +1,4 @@
#include <fxlibc/string.h>
#include <string.h>
/*
** The strcat() function appends the src string to the dest string,

2
src/libc/string/strchr.c

@ -1,4 +1,4 @@
#include <fxlibc/string.h>
#include <string.h>
/*
** The strchr() function returns a pointer to the first occurrence of the

2
src/libc/string/strcmp.c

@ -1,4 +1,4 @@
#include <fxlibc/string.h>
#include <string.h>
/*
** The strcmp() function compares the two strings s1 and s2. The locale is not

2
src/libc/string/strcpy.c

@ -1,4 +1,4 @@
#include <fxlibc/string.h>
#include <string.h>
/*
** The strcpy() function copies the string pointed to by src, including the

4
src/libc/string/strdup.c

@ -1,5 +1,5 @@
#include <fxlibc/string.h>
#include <fxlibc/stdlib.h>
#include <string.h>
#include <stdlib.h>
/*
** The strdup() function returns a pointer to a new string which is a

2
src/libc/string/strlen.c

@ -1,4 +1,4 @@
#include <fxlibc/string.h>
#include <string.h>
/*
** The strlen() function calculates the length of the string pointed to by s,

4
src/libc/threads/mutex.c

@ -1,5 +1,5 @@
#include <fxlibc/threads.h>
#include <fxlibc/unistd.h>
#include <threads.h>
#include <unistd.h>
// Creates a new mutex object with type __TYPE.
// @note: If successful the new object is pointed by __MUTEX.

2
src/posix/fcntl/target/vhex-sh/open.S

@ -1,5 +1,5 @@
#ifdef __SUPPORT_VHEX_KERNEL
#include <fxlibc/asm/unistd_32.h>
#include <bits/asm/unistd_32.h>
.text
.global _open
.type _open, @function

2
src/posix/sys/wait/target/vhex-sh/wait.S

@ -1,5 +1,5 @@
#ifdef __SUPPORT_VHEX_KERNEL
#include <fxlibc/asm/unistd.h>
#include <bits/asm/unistd_32.h>
.text
.global _wait
.type _wait, @function

2
src/posix/sys/wait/target/vhex-sh/waitpid.S

@ -1,5 +1,5 @@
#ifdef __SUPPORT_VHEX_KERNEL
#include <fxlibc/asm/unistd.h>
#include <bits/asm/unistd_32.h>
.text
.global _waitpid
.type _waitpid, @function

4
src/posix/unistd/target/casiowin-fx/close.S

@ -1,6 +1,6 @@
#ifdef __SUPPORT_CASIO_ABI_FX9860G
#include <fxlibc/asm/unistd_32.h>
#include <fxlibc/asm-casio/__trapa.h>
#include <bits/unistd_32.h>
#include <bits/__trapa.h>
.text
.global _close
.type _close, @function

2
src/posix/unistd/target/vhex-sh/close.S

@ -1,5 +1,5 @@
#ifdef __SUPPORT_VHEX_KERNEL
#include <fxlibc/asm/unistd.h>
#include <bits/asm/unistd_32.h>
.text
.global _close
.type _close, @function

2
src/posix/unistd/target/vhex-sh/fork_execve.S

@ -1,5 +1,5 @@
#ifdef __SUPPORT_VHEX_KERNEL
#include <fxlibc/asm/unistd.h>
#include <bits/asm/unistd_32.h>
.text
.global _fork_execve
.type _fork_execve, @function

2
src/posix/unistd/target/vhex-sh/getpgid.S

@ -1,5 +1,5 @@
#ifdef __SUPPORT_VHEX_KERNEL
#include <fxlibc/asm/unistd.h>
#include <bits/asm/unistd_32.h>
.text
.global _getpgid
.type _getpgid, @function

2
src/posix/unistd/target/vhex-sh/getpid.S

@ -1,5 +1,5 @@
#ifdef __SUPPORT_VHEX_KERNEL
#include <fxlibc/asm/unistd.h>
#include <bits/asm/unistd_32.h>
.text
.global _getpid
.type _getpid, @function

2
src/posix/unistd/target/vhex-sh/getppid.S

@ -1,5 +1,5 @@
#ifdef __SUPPORT_VHEX_KERNEL
#include <fxlibc/asm/unistd.h>
#include <bits/asm/unistd_32.h>
.text
.global _getppid
.type _getppid, @function

2
src/posix/unistd/target/vhex-sh/lseek.S

@ -1,5 +1,5 @@
#ifdef __SUPPORT_VHEX_KERNEL
#include <fxlibc/asm/unistd.h>
#include <bits/asm/unistd_32.h>
.text
.global _lseek
.type _lseek, @function

2
src/posix/unistd/target/vhex-sh/read.S

@ -1,5 +1,5 @@
#ifdef __SUPPORT_VHEX_KERNEL
#include <fxlibc/asm/unistd.h>
#include <bits/asm/unistd_32.h>
.text
.global _read
.type _read, @function

2
src/posix/unistd/target/vhex-sh/setpgid.S

@ -1,5 +1,5 @@
#ifdef __SUPPORT_VHEX_KERNEL
#include <fxlibc/asm/unistd.h>
#include <bits/asm/unistd_32.h>
.text
.global _setpgid
.type _setpgid, @function

2
src/posix/unistd/target/vhex-sh/write.S

@ -1,5 +1,5 @@
#ifdef __SUPPORT_VHEX_KERNEL
#include <fxlibc/asm/unistd.h>
#include <bits/asm/unistd_32.h>
.text
.global _write
.type _write, @function

Loading…
Cancel
Save