Init basesystem source codes.
[staging/basesystem.git] / nsframework / framework_unified / client / NS_Logger / include / frameworkunified_stub.h
1 /*
2  * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef FRAMEWORK_UNIFIED_CLIENT_NS_LOGGER_INCLUDE_FRAMEWORKUNIFIED_STUB_H_
18 #define FRAMEWORK_UNIFIED_CLIENT_NS_LOGGER_INCLUDE_FRAMEWORKUNIFIED_STUB_H_
19
20 /*#include <PosixBasedOS001legacy_types.h>*/  // for _UintXXt
21
22 #define _NTO_TRACE_USERFIRST        (0x00000000)
23
24 // from types.h
25 typedef char *__NTO_va_list;
26
27 // from sys/platform.h
28 #define __CLOCKADJUST \
29     { \
30       unsigned long       tick_count; /*NOLINT  (readability/nolint)*/\
31       long            tick_nsec_inc;  /*NOLINT  (readability/nolint)*/\
32     }
33
34 // from syspage.h
35 struct _clockadjust __CLOCKADJUST;
36 struct qtime_entry {
37   _Uint64t          cycles_per_sec; /* for ClockCycle */
38   _Uint64t volatile     nsec_tod_adjust;
39   _Uint64t volatile     nsec;
40   unsigned long       nsec_inc;  // NOLINT  (readability/nolint)
41   unsigned long       boot_time; /* UTC seconds when machine booted */  // NOLINT  (readability/nolint)
42
43   struct _clockadjust     adjust;
44   unsigned long       timer_rate; /* times 10^timer_scale */  // NOLINT  (readability/nolint)
45   long            timer_scale;  // NOLINT  (readability/nolint)
46   unsigned long       timer_load;  // NOLINT  (readability/nolint)
47   long            intr;  // NOLINT  (readability/nolint)
48   unsigned long       epoch;  // NOLINT  (readability/nolint)
49   unsigned long       flags;  // NOLINT  (readability/nolint)
50   unsigned int        rr_interval_mul;
51   unsigned long       spare0;  // NOLINT  (readability/nolint)
52   _Uint64t volatile     nsec_stable;
53   unsigned long       spare[4];  // NOLINT  (readability/nolint)
54 };
55
56 struct syspage_entry        *_syspage_ptr;
57
58 typedef struct {
59   _Uint16t    entry_off;
60   _Uint16t    entry_size;
61 } syspage_entry_info;
62
63 struct syspage_entry {
64   _Uint16t      size;   /* size of syspage_entry */
65   _Uint16t      total_size; /* size of system page */
66   _Uint16t      type;
67   _Uint16t      num_cpu;
68   syspage_entry_info  system_private;
69   syspage_entry_info  asinfo;
70   syspage_entry_info  meminfo;
71   syspage_entry_info  hwinfo;
72   syspage_entry_info  cpuinfo;
73   syspage_entry_info  cacheattr;
74   syspage_entry_info  qtime;
75   syspage_entry_info  callout;
76   syspage_entry_info  callin;
77   syspage_entry_info  typed_strings;
78   syspage_entry_info  strings;
79   syspage_entry_info  intrinfo;
80   syspage_entry_info  smp;
81   syspage_entry_info  pminfo;
82   syspage_entry_info  mdriver;
83   long        spare[2];  // NOLINT  (readability/nolint)
84   union {
85 #if defined(SYSPAGE_TARGET_ALL) || defined(SYSPAGE_TARGET_X86)
86     struct x86_syspage_entry  x86;
87 #endif
88 #if defined(SYSPAGE_TARGET_ALL) || defined(SYSPAGE_TARGET_PPC)
89     struct ppc_syspage_entry  ppc;
90 #endif
91 #if defined(SYSPAGE_TARGET_ALL) || defined(SYSPAGE_TARGET_MIPS)
92     struct mips_syspage_entry mips;
93 #endif
94 #if defined(SYSPAGE_TARGET_ALL) || defined(SYSPAGE_TARGET_ARM)
95     struct arm_syspage_entry  arm;
96 #endif
97 #if defined(SYSPAGE_TARGET_ALL) || defined(SYSPAGE_TARGET_SH)
98     struct sh_syspage_entry sh;
99 #endif
100     struct {
101       long            filler[20];  // NOLINT  (readability/nolint)
102     } filler;
103   } un;
104 };
105
106 #define _SYSPAGE_ENTRY( __base, __field )  /*NOLINT  (readability/nolint)*/\
107   ((struct __field##_entry *)reinterpret_cast<void *>(reinterpret_cast<char *>(__base)\
108   + (__base)->__field.entry_off))
109 #define SYSPAGE_ENTRY(__field)      _SYSPAGE_ENTRY(_syspage_ptr, __field)
110
111 #endif  // FRAMEWORK_UNIFIED_CLIENT_NS_LOGGER_INCLUDE_FRAMEWORKUNIFIED_STUB_H_