Skip to content

Commit 3476043

Browse files
committed
1.0.0
modified: .gitignore modified: LICENSE new file: Makefile modified: README.md new file: include/end.h new file: include/lparchs.h new file: include/lpcomps.h new file: include/lpplat.h new file: include/lpstds.h new file: include/title.h new file: src/lpcomps_make.py new file: src/make.py
1 parent 4018374 commit 3476043

File tree

12 files changed

+1192
-78
lines changed

12 files changed

+1192
-78
lines changed

.gitignore

Lines changed: 4 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,4 @@
1-
# Prerequisites
2-
*.d
3-
4-
# Object files
5-
*.o
6-
*.ko
7-
*.obj
8-
*.elf
9-
10-
# Linker output
11-
*.ilk
12-
*.map
13-
*.exp
14-
15-
# Precompiled Headers
16-
*.gch
17-
*.pch
18-
19-
# Libraries
20-
*.lib
21-
*.a
22-
*.la
23-
*.lo
24-
25-
# Shared objects (inc. Windows DLLs)
26-
*.dll
27-
*.so
28-
*.so.*
29-
*.dylib
30-
31-
# Executables
32-
*.exe
33-
*.out
34-
*.app
35-
*.i*86
36-
*.x86_64
37-
*.hex
38-
39-
# Debug files
40-
*.dSYM/
41-
*.su
42-
*.idb
43-
*.pdb
44-
45-
# Kernel Module Compile Results
46-
*.mod*
47-
*.cmd
48-
.tmp_versions/
49-
modules.order
50-
Module.symvers
51-
Mkfile.old
52-
dkms.conf
1+
# Build output dir
2+
build/
3+
# Editor config
4+
.vscode/

LICENSE

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
This is free and unencumbered software released into the public domain.
2-
3-
Anyone is free to copy, modify, publish, use, compile, sell, or
4-
distribute this software, either in source code form or as a compiled
5-
binary, for any purpose, commercial or non-commercial, and by any
6-
means.
7-
8-
In jurisdictions that recognize copyright laws, the author or authors
9-
of this software dedicate any and all copyright interest in the
10-
software to the public domain. We make this dedication for the benefit
11-
of the public at large and to the detriment of our heirs and
12-
successors. We intend this dedication to be an overt act of
13-
relinquishment in perpetuity of all present and future rights to this
14-
software under copyright law.
15-
16-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19-
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20-
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21-
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22-
OTHER DEALINGS IN THE SOFTWARE.
23-
24-
For more information, please refer to <https://unlicense.org>
1+
This is free and unencumbered software released into the public domain.
2+
3+
Anyone is free to copy, modify, publish, use, compile, sell, or
4+
distribute this software, either in source code form or as a compiled
5+
binary, for any purpose, commercial or non-commercial, and by any
6+
means.
7+
8+
In jurisdictions that recognize copyright laws, the author or authors
9+
of this software dedicate any and all copyright interest in the
10+
software to the public domain. We make this dedication for the benefit
11+
of the public at large and to the detriment of our heirs and
12+
successors. We intend this dedication to be an overt act of
13+
relinquishment in perpetuity of all present and future rights to this
14+
software under copyright law.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19+
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22+
OTHER DEALINGS IN THE SOFTWARE.
23+
24+
For more information, please refer to <https://unlicense.org>

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
all:
2+
cd src && python make.py
3+
clean:
4+
rm -r build

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
# libplatform
2-
libplatform is a platform check library
1+
# libplatform
2+
libplatform is a platform check library

include/end.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#endif

include/lparchs.h

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
/*=============================================================================================*/
2+
/*libplatform archs*/
3+
4+
/*Alpha*/
5+
#define __arch_alpha__ "Alpha"
6+
/*x86*/
7+
#define __arch_x86__ "x86"
8+
/*ARM*/
9+
#define __arch_arm__ "ARM"
10+
/*Blackfin*/
11+
#define __arch_blackfin__ "Blackfin"
12+
/*Convex*/
13+
#define __arch_convex__ "Convex"
14+
/*Epiphany*/
15+
#define __arch_epiphany__ "Epiphany"
16+
/*HP/PA RISC*/
17+
#define __arch_hppa__ "HP/PA RISC"
18+
/*Itanium*/
19+
#define __arch_itanium__ "Itanium"
20+
/*Motorola 68k*/
21+
#define __arch_motorola68k__ "Motorola 68k"
22+
/*MIPS*/
23+
#define __arch_mips__ "MIPS"
24+
/*PowerPC*/
25+
#define __arch_ppc__ "PowerPC"
26+
/*Pyramid 9810*/
27+
#define __arch_pyramid9810__ "Pyramid 9810"
28+
/*RS/6000*/
29+
#define __arch_rs6000__ "RS/6000"
30+
/*SPARC*/
31+
#define __arch_sparc__ "SPARC"
32+
/*SuperH*/
33+
#define __arch_superh__ "SuperH"
34+
/*SystemZ*/
35+
#define __arch_systemz__ "SystemZ"
36+
/*TMS320*/
37+
#define __arch_tms320__ "TMS320"
38+
/*TMS470*/
39+
#define __arch_tms470__ "TMS470"
40+
/*unknown arch*/
41+
#define __arch_unknown__ "unknown"
42+
43+
#if defined(__alpha__) || defined(__alpha) || defined(_M_ALPHA)
44+
#define __arch__ __arch_alpha__
45+
#define __arch_name__ "Alpha"
46+
#elif defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64) || defined(_M_X64) || defined(_M_AMD64)
47+
#define __arch__ __arch_x86__
48+
#define __arch_name__ "AMD64"
49+
#elif defined(__aarch64__)
50+
#define __arch__ __arch_arm__
51+
#define __arch_name__ "aarch64"
52+
#elif defined(__arm__) || defined(__thumb__) || defined(_ARM) || defined(_M_ARMT) || defined(__arm)
53+
#define __arch__ __arch_arm__
54+
#define __arch_name__ "ARM"
55+
#elif defined(__bfin) || defined(__BFIN__)
56+
#define __arch__ __arch_blackfin__
57+
#define __arch_name__ "Blackfin"
58+
#elif defined(__convex__)
59+
#define __arch__ __arch_convex__
60+
#define __arch_name__ "Convex"
61+
#elif defined(__epiphany__)
62+
#define __arch__ __arch_epiphany__
63+
#define __arch_name__ "Epiphany"
64+
#elif defined(__hppa__) || defined(__HPPA__) || defined(__hppa)
65+
#define __arch__ __arch_hppa__
66+
#define __arch_name__ "HP/PA RISC"
67+
#elif defined(i386) || defined(__i386) || defined(__i386__) || defined(__i486__) || defined(__i586__) || defined(__i686__) || defined(__i386) || defined(__IA32__) || defined(_M_I86) || defined(_M_IX86) || defined(__X86__) || defined(_X86_) || defined(__THW_INTEL__) || defined(__I86__) || defined(__INTEL__) || defined(__386)
68+
#define __arch__ __arch_x86__
69+
#define __arch_name__ "Intel x86"
70+
#elif defined(__ia64__) || defined(_IA64) || defined(__IA64__) || defined(__ia64) || defined(_M_IA64) || defined(__itanium__)
71+
#define __arch__ __arch_itanium__
72+
#define __arch_name__ "Intel Itanium"
73+
#elif defined(__m68k__) || defined(M68000) || defined(__MC68K__)
74+
#define __arch__ __arch_motorola68k__
75+
#define __arch_name__ "Motorola 68k"
76+
#elif defined(__mips__) || defined(mips) || defined(_MIPS_ISA) || defined(__mips) || defined(__MIPS__)
77+
#define __arch__ __arch_mips__
78+
#define __arch_name__ "MIPS"
79+
#elif defined(__powerpc) || defined(__powerpc__) || defined(__powerpc64__) || defined(__POWERPC__) || defined(__ppc__) || defined(__ppc64__) || defined(__PPC__) || defined(__PPC64__) || defined(_ARCH_PPC) || defined(_ARCH_PPC64) || defined(_M_PPC) || defined(__ppc)
80+
#define __arch__ __arch_ppc__
81+
#define __arch_name__ "PowerPC"
82+
#elif defined(pyr)
83+
#define __arch__ __arch_pyramid9810__
84+
#define __arch_name__ "Pyramid 9810"
85+
#elif defined(__THW_RS6000) || defined(_IBMR2) || defined(_POWER) || defined(_ARCH_PWR) || defined(_ARCH_PWR2) || defined(_ARCH_PWR3) || defined(_ARCH_PWR4)
86+
#define __arch__ __arch_rs6000__
87+
#define __arch__ "RS/6000"
88+
#elif defined(__sparc__) || defined(__sparc)
89+
#define __arch__ __arch_sparc__
90+
#define __arch_name__ "SPARC"
91+
#elif defined(__sh__)
92+
#define __arch__ __arch_superh__
93+
#define __arch_name__ "SuperH"
94+
#elif defined(__370__) || defined(__THW_370__) || defined(__s390__) || defined(__s390x__) || defined(__zarch__) || defined(__zarch__) || defined(__SYSC_ZARCH__)
95+
#define __arch__ __arch_systemz__
96+
#define __arch__ "SystemZ"
97+
#elif defined(_TMS320C2XX) || defined(__TMS320C2000__) || defined(_TMS320C5X) || defined(__TMS320C55X__) || defined(_TMS320C6X) || defined(__TMS320C6X__)
98+
#define __arch__ __arch_tms320__
99+
#define __arch_name__ "TMS320"
100+
#elif defined(__TMS470__)
101+
#define __arch__ __arch_tms470__
102+
#define __arch_name__ "TMS470"
103+
#else
104+
#define __arch__ __arch_unknown__
105+
#define __arch_name__ __arch_unknown__
106+
#endif
107+
/*pointer width 64/32/16...*/
108+
#define __POINTER_WIDTH__ (sizeof(void*) * 8)

0 commit comments

Comments
 (0)