1From 82dce13ea7b5b31c63851bd67f66072413917e73 Mon Sep 17 00:00:00 2001
2From: Chenxi Mao <maochenxi@eswin.com>
3Date: Mon, 20 Apr 2020 15:32:40 +0800
4Subject: [PATCH 1/1] Riscv: Add risc-v Android config header
5
6---
7Upstream-Status: Pending
8
9 .../arch/linux-riscv64/AndroidConfig.h        | 340 ++++++++++++++++++
10 1 file changed, 340 insertions(+)
11 create mode 100644 core/combo/include/arch/linux-riscv64/AndroidConfig.h
12
13diff --git a/core/combo/include/arch/linux-riscv64/AndroidConfig.h b/core/combo/include/arch/linux-riscv64/AndroidConfig.h
14new file mode 100644
15index 0000000000..bcbda8f87f
16--- /dev/null
17+++ b/core/combo/include/arch/linux-riscv64/AndroidConfig.h
18@@ -0,0 +1,340 @@
19+/*
20+ * Copyright (C) 2013 The Android Open Source Project
21+ *
22+ * Licensed under the Apache License, Version 2.0 (the "License");
23+ * you may not use this file except in compliance with the License.
24+ * You may obtain a copy of the License at
25+ *
26+ *      http://www.apache.org/licenses/LICENSE-2.0
27+ *
28+ * Unless required by applicable law or agreed to in writing, software
29+ * distributed under the License is distributed on an "AS IS" BASIS,
30+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31+ * See the License for the specific language governing permissions and
32+ * limitations under the License.
33+ */
34+
35+/*
36+ * Android config -- "android-aarch64".  Used for ARM aarch64 device builds.
37+ */
38+#ifndef _ANDROID_CONFIG_H
39+#define _ANDROID_CONFIG_H
40+
41+/*
42+ * ===========================================================================
43+ *                              !!! IMPORTANT !!!
44+ * ===========================================================================
45+ *
46+ * This file is included by ALL C/C++ source files.  Don't put anything in
47+ * here unless you are absolutely certain it can't go anywhere else.
48+ *
49+ * Any C++ stuff must be wrapped with "#ifdef __cplusplus".  Do not use "//"
50+ * comments.
51+ */
52+
53+/*
54+ * Threading model.  Choose one:
55+ *
56+ * HAVE_PTHREADS - use the pthreads library.
57+ * HAVE_WIN32_THREADS - use Win32 thread primitives.
58+ *  -- combine HAVE_CREATETHREAD, HAVE_CREATEMUTEX, and HAVE__BEGINTHREADEX
59+ */
60+#define HAVE_PTHREADS
61+
62+/*
63+ * Do we have pthread_setname_np()?
64+ *
65+ * (HAVE_PTHREAD_SETNAME_NP is used by WebKit to enable a function with
66+ * the same name but different parameters, so we can't use that here.)
67+ */
68+#define HAVE_ANDROID_PTHREAD_SETNAME_NP
69+
70+/*
71+ * Do we have the futex syscall?
72+ */
73+#define HAVE_FUTEX
74+
75+/*
76+ * Process creation model.  Choose one:
77+ *
78+ * HAVE_FORKEXEC - use fork() and exec()
79+ * HAVE_WIN32_PROC - use CreateProcess()
80+ */
81+#define HAVE_FORKEXEC
82+
83+/*
84+ * Process out-of-memory adjustment.  Set if running on Linux,
85+ * where we can write to /proc/<pid>/oom_adj to modify the out-of-memory
86+ * badness adjustment.
87+ */
88+#define HAVE_OOM_ADJ
89+
90+/*
91+ * IPC model.  Choose one:
92+ *
93+ * HAVE_SYSV_IPC - use the classic SysV IPC mechanisms (semget, shmget).
94+ * HAVE_MACOSX_IPC - use Macintosh IPC mechanisms (sem_open, mmap).
95+ * HAVE_WIN32_IPC - use Win32 IPC (CreateSemaphore, CreateFileMapping).
96+ * HAVE_ANDROID_IPC - use Android versions (?, mmap).
97+ */
98+#define HAVE_ANDROID_IPC
99+
100+/*
101+ * Memory-mapping model. Choose one:
102+ *
103+ * HAVE_POSIX_FILEMAP - use the Posix sys/mmap.h
104+ * HAVE_WIN32_FILEMAP - use Win32 filemaps
105+ */
106+#define  HAVE_POSIX_FILEMAP
107+
108+/*
109+ * Define this if you have <termio.h>
110+ */
111+#define  HAVE_TERMIO_H 1
112+
113+/*
114+ * Define this if you have <sys/sendfile.h>
115+ */
116+#define  HAVE_SYS_SENDFILE_H 1
117+
118+/*
119+ * Define this if you build against MSVCRT.DLL
120+ */
121+/* #define HAVE_MS_C_RUNTIME */
122+
123+/*
124+ * Define this if you have sys/uio.h
125+ */
126+#define  HAVE_SYS_UIO_H 1
127+
128+/*
129+ * Define this if your platforms implements symbolic links
130+ * in its filesystems
131+ */
132+#define HAVE_SYMLINKS
133+
134+/*
135+ * Define this if we have localtime_r().
136+ */
137+/* #define HAVE_LOCALTIME_R 1 */
138+
139+/*
140+ * Define this if we have gethostbyname_r().
141+ */
142+/* #define HAVE_GETHOSTBYNAME_R */
143+
144+/*
145+ * Define this if we have ioctl().
146+ */
147+#define HAVE_IOCTL
148+
149+/*
150+ * Define this if we want to use WinSock.
151+ */
152+/* #define HAVE_WINSOCK */
153+
154+/*
155+ * Define this if have clock_gettime() and friends
156+ */
157+#define HAVE_POSIX_CLOCKS
158+
159+/*
160+ * Define this if we have linux style epoll()
161+ */
162+#define HAVE_EPOLL
163+
164+/*
165+ * Endianness of the target machine.  Choose one:
166+ *
167+ * HAVE_ENDIAN_H -- have endian.h header we can include.
168+ * HAVE_LITTLE_ENDIAN -- we are little endian.
169+ * HAVE_BIG_ENDIAN -- we are big endian.
170+ */
171+#define HAVE_ENDIAN_H
172+#define HAVE_LITTLE_ENDIAN
173+
174+#define _FILE_OFFSET_BITS 64
175+/* #define _LARGEFILE_SOURCE 1 */
176+
177+/*
178+ * Define if platform has off64_t (and lseek64 and other xxx64 functions)
179+ */
180+#define HAVE_OFF64_T
181+
182+/*
183+ * Defined if we have the backtrace() call for retrieving a stack trace.
184+ * Needed for CallStack to operate; if not defined, CallStack is
185+ * non-functional.
186+ */
187+#define HAVE_BACKTRACE 0
188+
189+/*
190+ * Defined if we have the cxxabi.h header for demangling C++ symbols.  If
191+ * not defined, stack crawls will be displayed with raw mangled symbols
192+ */
193+#define HAVE_CXXABI 0
194+
195+/*
196+ * Defined if we have the gettid() system call.
197+ */
198+#define HAVE_GETTID
199+
200+/*
201+ * Defined if we have the sched_setscheduler() call
202+ */
203+#define HAVE_SCHED_SETSCHEDULER
204+
205+/*
206+ * Add any extra platform-specific defines here.
207+ */
208+#ifndef __linux__
209+#define __linux__
210+#endif
211+
212+/*
213+ * Define if we have <malloc.h> header
214+ */
215+#define HAVE_MALLOC_H
216+
217+/*
218+ * Define if we're running on *our* linux on device or emulator.
219+ */
220+#define HAVE_ANDROID_OS 1
221+
222+/*
223+ * Define if we have Linux-style non-filesystem Unix Domain Sockets
224+ */
225+#define HAVE_LINUX_LOCAL_SOCKET_NAMESPACE 1
226+
227+/*
228+ * Define if we have Linux's inotify in <sys/inotify.h>.
229+ */
230+#define HAVE_INOTIFY 1
231+
232+/*
233+ * Define if we have madvise() in <sys/mman.h>
234+ */
235+#define HAVE_MADVISE 1
236+
237+/*
238+ * Define if tm struct has tm_gmtoff field
239+ */
240+#define HAVE_TM_GMTOFF 1
241+
242+/*
243+ * Define if dirent struct has d_type field
244+ */
245+#define HAVE_DIRENT_D_TYPE 1
246+
247+/*
248+ * Define if libc includes Android system properties implementation.
249+ */
250+#define HAVE_LIBC_SYSTEM_PROPERTIES 1
251+
252+/*
253+ * Define if system provides a system property server (should be
254+ * mutually exclusive with HAVE_LIBC_SYSTEM_PROPERTIES).
255+ */
256+/* #define HAVE_SYSTEM_PROPERTY_SERVER */
257+
258+/*
259+ * What CPU architecture does this platform use?
260+ */
261+#define ARCH_AARCH64
262+
263+/*
264+ * Define if the size of enums is as short as possible,
265+ */
266+/* #define HAVE_SHORT_ENUMS */
267+
268+/*
269+ * sprintf() format string for shared library naming.
270+ */
271+#define OS_SHARED_LIB_FORMAT_STR    "lib%s.so"
272+
273+/*
274+ * type for the third argument to mincore().
275+ */
276+#define MINCORE_POINTER_TYPE unsigned char *
277+
278+/*
279+ * The default path separator for the platform
280+ */
281+#define OS_PATH_SEPARATOR '/'
282+
283+/*
284+ * Is the filesystem case sensitive?
285+ */
286+#define OS_CASE_SENSITIVE
287+
288+/*
289+ * Define if <sys/socket.h> exists.
290+ */
291+#define HAVE_SYS_SOCKET_H 1
292+
293+/*
294+ * Define if the strlcpy() function exists on the system.
295+ */
296+#define HAVE_STRLCPY 1
297+
298+/*
299+ * Define if the open_memstream() function exists on the system.
300+ */
301+/* #define HAVE_OPEN_MEMSTREAM 1 */
302+
303+/*
304+ * Define if the BSD funopen() function exists on the system.
305+ */
306+#define HAVE_FUNOPEN 1
307+
308+/*
309+ * Define if prctl() exists
310+ */
311+#define HAVE_PRCTL 1
312+
313+/*
314+ * Define if writev() exists
315+ */
316+#define HAVE_WRITEV 1
317+
318+/*
319+ * Define if <stdint.h> exists.
320+ */
321+#define HAVE_STDINT_H 1
322+
323+/*
324+ * Define if <stdbool.h> exists.
325+ */
326+#define HAVE_STDBOOL_H 1
327+
328+/*
329+ * Define if <sched.h> exists.
330+ */
331+#define HAVE_SCHED_H 1
332+
333+/*
334+ * Define if pread() exists
335+ */
336+#define HAVE_PREAD 1
337+
338+/*
339+ * Define if we have st_mtim in struct stat
340+ */
341+#define HAVE_STAT_ST_MTIM 1
342+
343+/*
344+ * Define if printf() supports %zd for size_t arguments
345+ */
346+#define HAVE_PRINTF_ZD 1
347+
348+/*
349+ * Define to 1 if <stdlib.h> provides qsort_r() with a BSD style function prototype.
350+ */
351+#define HAVE_BSD_QSORT_R 0
352+
353+/*
354+ * Define to 1 if <stdlib.h> provides qsort_r() with a GNU style function prototype.
355+ */
356+#define HAVE_GNU_QSORT_R 0
357+
358+#endif /* _ANDROID_CONFIG_H */
359--
3602.17.1
361
362