INOS
inosdefine.h
Go to the documentation of this file.
1//******************************************************************************
26//******************************************************************************
27
28#if !defined( INC_INOSDEFINE_H )
29#define INC_INOSDEFINE_H
30
31//------------------------------------------------------------------------------
32// defines
33//------------------------------------------------------------------------------
34
38#define INOS_LITTLE_ENDIAN 1234
39
43#define INOS_BIG_ENDIAN 4321
44
48#if (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
49#define INOS_BYTE_ORDER INOS_LITTLE_ENDIAN
50#else
51#define INOS_BYTE_ORDER INOS_BIG_ENDIAN
52// Define 'WORDS_BIGENDIAN', which seems to be a standard by GNU autotools and
53// is therefore widely used by open source software
54#define WORDS_BIGENDIAN 1
55#endif
56
60#define INOS_INLINE inline __attribute__((always_inline))
61
65#define INOS_NOEXCEPT noexcept
66
67//------------------------------------------------------------------------------
68// 32/64 bit related
69//------------------------------------------------------------------------------
70
71#if !defined(__ASSEMBLER__)
72#if defined(INOS_64)
73#if defined(INOS_WINDOWS)
74typedef signed long long intptr;
75typedef unsigned long long uintptr;
76#else
77typedef signed long intptr;
78typedef unsigned long uintptr;
79#endif
80#else // end of 64 bit
81typedef signed long intptr;
82typedef unsigned long uintptr;
83#endif
84#endif
85
86//------------------------------------------------------------------------------
87// CPU defines
88//------------------------------------------------------------------------------
89
94#define DF_INOS_CPU_CACHE_LINE_SIZE 32
95
100#define DF_INOS_CPU_CACHE_LINE_MASK 0xffffffe0
101
105#define DF_INOS_MEMORY_ALLOC_ALIGNMENT 16
106
107//------------------------------------------------------------------------------
108// TARGET offsets
109//------------------------------------------------------------------------------
110
114#define DF_INOS_TARGET_OFFSET_OPTIONS 0x00000040
115
119#define DF_INOS_TARGET_OFFSET_VERSION 0x00000080
120
121//------------------------------------------------------------------------------
122// TARGET defines
123//------------------------------------------------------------------------------
124
128#define DF_INOS_TARGET_CHAR_FLOATING 0x00000001
129
133#define DF_INOS_TARGET_CHAR_LITTLE_ENDIAN 0x00000002
134
138#define DF_INOS_TARGET_CHAR_64BIT 0x00000004
139
143#define DF_INOS_TARGET_CHAR_RES0 0x00000010
144#define DF_INOS_TARGET_CHAR_RES1 0x00001000
145#define DF_INOS_TARGET_CHAR_RES2 0x00100000
146#define DF_INOS_TARGET_CHAR_RES3 0x10000000
147
148//------------------------------------------------------------------------------
149// SAFETY defines
150//------------------------------------------------------------------------------
151
155#define DF_INOS_SAFETY_INVALID_UID 0xffffffff
156
157//------------------------------------------------------------------------------
158// KERNEL defines
159//------------------------------------------------------------------------------
160
164#define DF_INOS_MAX_CORES 4
165#define DF_INOS_MAX_CORES_MASK ((1<<DF_INOS_MAX_CORES)-1)
166
170#define DF_INOS_MAX_IRQS 1024
171
175#define DF_INOS_CORE_DEFAULT 0xFF
176
180#define DF_INOS_MAX_WATCHPOINTS 1
181
182//--- CINOSKernel --------------------------------------------------------------
183
187#define DF_INOS_TASK_PRIO_HIGHEST 0
188
192#define DF_INOS_TASK_PRIO_LOWEST 31
193
197#define DF_INOS_TASK_PRIO_REALTIME_HIGHEST 0
198
199#if defined(INOS_CPU_ARMV8)
203#define DF_INOS_TASK_PRIO_ICC 0
204#else
212#define DF_INOS_TASK_PRIO_ICC 3
213#endif
214
218#define DF_INOS_TASK_PRIO_REALTIME 8
219
223#define DF_INOS_TASK_PRIO_REALTIME_LOWEST 15
224
228#define DF_INOS_TASK_PRIO_COMMUNICATION_HIGHEST 16
229
233#define DF_INOS_TASK_PRIO_COMMUNICATION 20
234
238#define DF_INOS_TASK_PRIO_COMMUNICATION_DISPATCHER 20
239
243#define DF_INOS_TASK_PRIO_COMMUNICATION_LOWEST 23
244
248#define DF_INOS_TASK_PRIO_USER_HIGHEST 24
249
253#define DF_INOS_TASK_PRIO_USER 28
254
258#define DF_INOS_TASK_PRIO_USER_LOWEST 30
259
263#define DF_INOS_TASK_PRIO_BACKGROUND 31
264
268#if defined(INOS_MULTICORE)
269#define INOS_MULTICORE_KERNEL 1
270#else
271#undef INOS_MULTICORE_KERNEL
272#endif
273
274//------------------------------------------------------------------------------
275// INCO defines
276//------------------------------------------------------------------------------
277
278//--- INCO protocol numbers ----------------------------------------------------
279
283#define DF_INCO_PROTOCOL_CLASSIC 0
284
288#define DF_INCO_PROTOCOL_STRIPPED 1
289
293#define DF_INCO_PROTOCOL_SPLITTED 2
294
298#define DF_INCO_PROTOCOL_RESERVED 16
299
300//--- INCO device numbers ------------------------------------------------------
301
305#define DF_INCO_DEVICE_NUMBER_COM0 0
306
310#define DF_INCO_DEVICE_NUMBER_INFOLINK 1
311
315#define DF_INCO_DEVICE_NUMBER_COM1 2
316
320#define DF_INCO_DEVICE_NUMBER_ETH0 3
321
325#define DF_INCO_DEVICE_NUMBER_GINLINK 4
326
330#define DF_INCO_DEVICE_NUMBER_PDP 5
331
335#define DF_INCO_DEVICE_NUMBER_COP 6
336
340#define DF_INCO_DEVICE_NUMBER_ETH1 7
341
345#define DF_INCO_DEVICE_NUMBER_GIN_COP 8
346
350#define DF_INCO_DEVICE_NUMBER_ETH2 10
351
355#define DF_INCO_DEVICE_NUMBER_ETH3 11
356
360#define DF_INCO_DEVICE_NUMBER_ETH4 12
361
365#define DF_INCO_DEVICE_NUMBER_GINLINK1 13
366
370#define DF_INCO_DEVICE_NUMBER_GINLINK2 14
371
375#define DF_INCO_DEVICE_NUMBER_GINLINK3 15
376
380#define DF_INCO_DEVICE_NUMBER_CORE0X 0x10
381
385#define DF_INCO_DEVICE_NUMBER_CORE10 0x11
386
390#define DF_INCO_DEVICE_NUMBER_CORE20 0x12
391
395#define DF_INCO_DEVICE_NUMBER_CORE30 0x13
396
400#define DF_INCO_DEVICE_NUMBER_CORE40 0x14
401
405#define DF_INCO_DEVICE_NUMBER_CORE50 0x15
406
410#define DF_INCO_DEVICE_NUMBER_CORE60 0x16
411
415#define DF_INCO_DEVICE_NUMBER_CORE70 0x17
416
420#define DF_INCO_DEVICE_NUMBER_CORE80 0x18
421
425#define DF_INCO_DEVICE_NUMBER_CORE90 0x19
426
430#define DF_INCO_DEVICE_NUMBER_COREA0 0x1A
431
435#define DF_INCO_DEVICE_NUMBER_COREB0 0x1B
436
440#define DF_INCO_DEVICE_NUMBER_COREC0 0x1C
441
445#define DF_INCO_DEVICE_NUMBER_CORED0 0x1D
446
450#define DF_INCO_DEVICE_NUMBER_COREE0 0x1E
451
455#define DF_INCO_DEVICE_NUMBER_COREF0 0x1F
456
460#define DF_INCO_DEVICE_NUMBER_ETHERCAT 0x20
461
465#define DF_INCO_DEVICE_NUMBER_ETHERCAT1 0x21
466
470#define DF_INCO_DEVICE_NUMBER_ETHERCAT2 0x22
471
475#define DF_INCO_DEVICE_NUMBER_ETHERCAT3 0x23
476
480#define DF_INCO_DEVICE_NUMBER_LOOPBACK 0xFF
481
482//------------------------------------------------------------------------------
483// Axis param extension id's
484//------------------------------------------------------------------------------
485
489#define DF_INOS_PARAM_EXTENSION_NAME "extension"
493#define DF_INOS_PARAM_EXTENSION_ID_INPUT_SHAPING 1
497#define DF_INOS_PARAM_EXTENSION_NAME_INPUT_SHAPING "shaping"
498
499 //------------------------------------------------------------------------------
500 // misc
501 //------------------------------------------------------------------------------
502
506#define DF_INOS_ETHERNET_SHUTDOWN (-2)
507
511#ifndef MDNS_MAX_SERVICES
512#define MDNS_MAX_SERVICES 3
513#endif
514
515//------------------------------------------------------------------------------
516// singleton's
517//------------------------------------------------------------------------------
518
522#define INCO (*pINCOItems)
523
527#define DISPATCHER (*CINCODispatcher::m_pInstance[GetCoreId()])
528
532#define DISPATCHER_EMG (*CINCODispatcher::m_pInstanceEmg[GetCoreId()])
533
537#if defined(INOS_CPU_CORTEXA9)
538#define ICC (*CINOSHwIcc::m_pInstance[GetCoreId(true)])
539#else
540#define ICC (*CINOSHwIcc::m_pInstance[GetCoreId()])
541#endif
542
543//------------------------------------------------------------------------------
544// target resource singleton's
545//------------------------------------------------------------------------------
546
550#define ENVIRONMENT CINOSMcTargetEnvironment::Instance()
551
555#define SYSTEM CINOSMcTargetSystem::Instance()
556
560#define DTB CINOSMcTargetDtb::Instance()
561
565#define DT2 CINOSMcTargetDt2::Instance()
566
570#define DATA CINOSMcTargetData::Instance()
571
575#define NVRAM CINOSMcTargetNvRam::Instance()
576
580#define IMAGE CINOSMcTargetImage::Instance()
581
585#define IMAGETRANSFER CINOSMcTargetImageTransfer::Instance()
586
590#define COMM CINOSMcTargetComm::Instance()
591
595#define MCTARGET CINOSMcTarget::Instance()
596
600#define SLAVE CINOSMcTargetFieldbusSlave::Instance()
601
605#define KRNLOG CINOSMcTargetKernelLogger::Instance()
606
610#define MS CINOS1ms::Instance()
611
615#define LVDT CINOSLVDT::Instance()
616
620#define MOTION CINOSMcTargetMotionController::Instance()
621
625#define SAFETY CINOSMcTargetSafety::Instance()
626
630#define SYNC CINOSMcTargetTimeSync::Instance()
631
635#define ASYNC (*CINCOAsyncResultMgr::Instance())
636
640#define MOVEPATH CINOSMcTargetMovePath::Instance()
641
645#if defined(INOS_CPU_ARMV8) || defined(INOS_CPU_P50XX) || defined(INOS_CPU_P2020) || defined(INOS_CPU_PPC750) || defined(INOS_DESKTOP)
646#define DBG CINOSHwDbg::Instance()
647#define DBG_CLASS CINOSHwDbg
648#else
649#define DBG (*g_pBreakpoints)
650#define DBG_CLASS CINOSBreakpoints
651#endif
652
656#if defined(FEATURE_INOS_CANBUS)
657#define CAN CINOSMcTargetCanbus::Instance()
658#endif
659
663#define IRQ CINOSHwIrq::Instance()
664
668#if defined(FEATURE_INOS_ONNX)
669#define ONNX CINOSMcTargetOnnx::Instance()
670#endif
671
672//------------------------------------------------------------------------------
673// target related includes
674//------------------------------------------------------------------------------
675
676#if defined(INOS_CPU_CORTEXA9)
677#include <inosdefine_cortexa9.h>
678#elif defined(INOS_CPU_ARMV8)
679#include <inosdefine_armv8.h>
680#if defined(INOS_CPU_AGILEX5)
681#include <inosdefine_agilex5.h>
682#endif
683#elif defined(INOS_CPU_P50XX)
684#include <inosdefine_p50xx.h>
685#elif defined(INOS_CPU_P2020)
686#include <inosdefine_p2020.h>
687#elif defined(INOS_CPU_PPC750)
688#include <inosdefine_ppc750.h>
689#elif defined(INOS_WINDOWS)
690#include <inosdefine_windows.h>
691#elif defined(INOS_LINUX)
692#include <inosdefine_linux.h>
693#endif
694#include <inosdefine_deprecated.h>
695
696//------------------------------------------------------------------------------
697// end of file
698//------------------------------------------------------------------------------
699
700#endif // INC_INOSDEFINE_H