MAJOR MILESTONE: Successfully imported complete PikeOS 5.0 ecosystem from Virtual Machine 100 (devvm-arch) on gigabyte Proxmox server. Import Summary: - Source Code: 4.3GB, 63,441 files, 14,829 C/C++/H files - Documentation: 78MB, 37+ PDF manuals covering all PikeOS aspects - XSD Schemas: 1.8MB, 158 schema files for configuration/code generation - Test Framework: Complete TFW infrastructure in src/tfw/ Key Components: ✅ Multi-architecture kernels (ARM v7/v8, PowerPC e500/e500mc/e5500, x86_64) ✅ Core source libraries (libstand, ssw, p4ext) ✅ Complete test framework with executables, includes, libraries ✅ 37+ comprehensive PDF documentation (installation, development, platform manuals) ✅ 158 XSD schemas for Eclipse-based code generation and configuration ✅ AUTOSAR/MISRA safety-critical compliance foundation ✅ Hardware virtualization support ✅ Eclipse IDE project configuration (.project, .cproject) Documentation Categories: - Installation & User Guides (pikeos-installation-guide.pdf, user manuals) - Development References (kernel, driver, test framework manuals) - API & Programming (C/C++ environments, native API extensions) - Platform Manuals (ARM, PowerPC, x86 specific guides) - CDK Documentation (gcc, binutils, ld, cpp internals) - Release Notes (all components for 5.0.3) - Specialized Topics (hardware virtualization, POSIX compliance) Technical Achievements: ✅ Complete PikeOS 5.0 codebase across multiple processor architectures ✅ Safety-critical foundation with AUTOSAR/MISRA compliance ✅ Eclipse IDE integration with XSD-driven code generation pipeline ✅ Comprehensive test framework for validation and verification ✅ Complete documentation covering development, deployment, and optimization Extraction Method: - Source: VM 100 (devvm-arch) on gigabyte server (192.168.0.104) - Method: Direct LVM disk mount via losetup, rsync transfer - Size: Total 4.4GB extracted and organized Next Phases: - Phase 3: XSD Workflow Analysis (Day 8-10) - Phase 4: Safety Standards Compliance Documentation (Day 11-12) - Phase 5: Component Categorization (Day 13-14) - Phase 6: Aurelio Brain Test (Day 15) Co-Authored-By: Claude <noreply@anthropic.com>
85 lines
16 KiB
HTML
85 lines
16 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
|
<meta name="generator" content="Doxygen 1.8.13"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>util.h Source File</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="resize.js"></script>
|
|
<script type="text/javascript" src="navtreedata.js"></script>
|
|
<script type="text/javascript" src="navtree.js"></script>
|
|
<script type="text/javascript">
|
|
$(document).ready(initResizable);
|
|
</script>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.8.13 -->
|
|
<script type="text/javascript">
|
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
|
</script>
|
|
<script type="text/javascript" src="menudata.js"></script>
|
|
<script type="text/javascript" src="menu.js"></script>
|
|
<script type="text/javascript">
|
|
$(function() {
|
|
initMenu('',true,false,'search.php','Search');
|
|
$(document).ready(function() { init_search(); });
|
|
});
|
|
</script>
|
|
<div id="main-nav"></div>
|
|
</div><!-- top -->
|
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
|
<div id="nav-tree">
|
|
<div id="nav-tree-contents">
|
|
<div id="nav-sync" class="sync"></div>
|
|
</div>
|
|
</div>
|
|
<div id="splitbar" style="-moz-user-select:none;"
|
|
class="ui-resizable-handle">
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
$(document).ready(function(){initNavTree('util_8h_source.html','');});
|
|
</script>
|
|
<div id="doc-content">
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<iframe src="javascript:void(0)" frameborder="0"
|
|
name="MSearchResults" id="MSearchResults">
|
|
</iframe>
|
|
</div>
|
|
|
|
<div class="header">
|
|
<div class="headertitle">
|
|
<div class="title">util.h</div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/* -------------------------- FILE PROLOGUE -------------------------------- */</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment"></span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment">/**</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"> * @if INCLUDE_HEADER</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"> * @copyright</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"> * (C) Copyright SYSGO AG.</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"> * Klein-Winternheim, Germany</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> * All rights reserved.</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"> * @endif</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment"> *</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment"> * @purpose</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment"> * Utility definitions for all .c files</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment"> *</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment"> * @if INCLUDE_HEADER</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment"> * @cfg_management</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="comment"> * $Id: include/stand/internal/util.h 2019-04-12 16:00:36 +0200 28f174509f3b2599ab0e3facbd13520edf91a801 $</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="comment"> * $Author$</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="comment"> * $Date$</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="comment"> * $Revision$</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="comment"> * $State$</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="comment"> * @endif</span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="comment"> */</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> </div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="preprocessor">#ifndef P4X_LIBSTAND_INTERNAL_UTIL_H</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#define P4X_LIBSTAND_INTERNAL_UTIL_H</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> </div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="comment">/* ------------------------- FILE INCLUSION -------------------------------- */</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> </div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="preprocessor">#include <adt/compiler.h></span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span> </div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="comment">/* ------------------- MACRO / CONSTANT DEFINITIONS ------------------------ */</span></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="comment"></span></div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="comment">/**</span></div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="comment"> * Non-false iff \p x is aligned on a "size_t" boundary. */</span></div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="preprocessor">#define ALIGNED(Type, x) (((size_t)(x) & (sizeof(Type) - 1)) == 0)</span></div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="comment"></span></div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="comment">/**</span></div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <span class="comment"> * Non-false iff \p x and \p y are aligned on a "size_t" boundary. */</span></div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <span class="preprocessor">#define ALIGNED2(Type, x,y) ALIGNED(Type, (size_t)(x) | (size_t)(y))</span></div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span> </div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span> <span class="comment">/* ----------------------- FUNCTION DECLARATIONS --------------------------- */</span></div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span> <span class="comment"></span></div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span> <span class="comment">/**</span></div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span> <span class="comment"> * Whether \p x contains a 0 byte */</span></div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span> <span class="keyword">static</span> <span class="keyword">inline</span> __forceinline adt_bool_t has_null_byte(</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  <span class="keywordtype">size_t</span> x)</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span> {</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span> <span class="preprocessor">#if __SIZEOF_POINTER__ == 4</span></div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">size_t</span> bit_lo = 0x01010101;</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">size_t</span> bit_hi = 0x80808080;</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span> <span class="preprocessor">#elif __SIZEOF_POINTER__ == 8</span></div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">size_t</span> bit_lo = 0x0101010101010101;</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">size_t</span> bit_hi = 0x8080808080808080;</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span> <span class="preprocessor">#else</span></div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span> <span class="preprocessor"># error "unrecognised architecture"</span></div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span> </div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  <span class="keywordflow">return</span> ((x - bit_lo) & (~x) & bit_hi) != 0;</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span> }</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span> </div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span> <span class="preprocessor">#if defined P4_KERNEL && !defined NDEBUG</span></div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span> <span class="preprocessor"># include <kernel/p4const.h></span></div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span> <span class="preprocessor"># include <<a class="code" href="assert_8h.html">stand/assert.h</a>></span></div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span> <span class="comment">/* Helper macro to check whether a pointer actually points to</span></div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span> <span class="comment"> * kernel space, because there must be no direct accesses to user</span></div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span> <span class="comment"> * space in the kernel. The second parameter is a bool that</span></div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span> <span class="comment"> * specifies whether the ptr will actually be dereferenced. It is used</span></div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span> <span class="comment"> * e.g. to allow memset(NULL,0,0), where formally, NULL is in</span></div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span> <span class="comment"> * user space, but there is no actual dereference of the pointer,</span></div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span> <span class="comment"> * because the size is 0.</span></div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span> <span class="comment"> * To allow NULL, pass 'p != NULL' or just 'p' as 'will_access' parameter.</span></div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span> <span class="comment"> */</span></div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span> <span class="preprocessor">#if (P4_MEM_KERN_BASE > 0)</span></div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span> <span class="preprocessor"># define P4X_STAND_CHECK_PTR(p,will_access) \</span></div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span> <span class="preprocessor"> assert(!(will_access) || \</span></div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span> <span class="preprocessor"> ((((size_t)(p)) >= (size_t)P4_MEM_KERN_BASE) && \</span></div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span> <span class="preprocessor"> (((size_t)(p)) <= (size_t)P4_MEM_KERN_END)))</span></div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span> <span class="preprocessor">#else</span></div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span> <span class="preprocessor"># define P4X_STAND_CHECK_PTR(p,will_access) \</span></div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span> <span class="preprocessor"> assert(!(will_access) || \</span></div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span> <span class="preprocessor"> ((((size_t)(p)) <= (size_t)P4_MEM_KERN_END)))</span></div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span> <span class="preprocessor">#else</span></div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span> <span class="preprocessor"># define P4X_STAND_CHECK_PTR(p,will_access) ((void)0)</span></div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span> </div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span> <span class="preprocessor">#endif </span><span class="comment">/* P4X_LIBSTAND_INTERNAL_UTIL_H */</span><span class="preprocessor"></span></div><div class="ttc" id="assert_8h_html"><div class="ttname"><a href="assert_8h.html">assert.h</a></div><div class="ttdoc">libstand ANSI C assert function </div></div>
|
|
</div><!-- fragment --></div><!-- contents -->
|
|
</div><!-- doc-content -->
|
|
<!-- start footer part -->
|
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
|
<ul>
|
|
<li class="navelem"><a class="el" href="dir_a5c23e4d4d2f2652fc21caa9afd4c5c7.html">opt</a></li><li class="navelem"><a class="el" href="dir_435533676c28ab3bbada0316da160146.html">pikeos-D5.0</a></li><li class="navelem"><a class="el" href="dir_48b8b87fe66c38ce4d22fbc9231439a9.html">build</a></li><li class="navelem"><a class="el" href="dir_4090a5462cff037c2a1aae8e8de3b5f7.html">doc</a></li><li class="navelem"><a class="el" href="dir_8b75505d31a61e38f88d1ca4f4b0d255.html">libstand</a></li><li class="navelem"><a class="el" href="dir_3253d4c6a353eff5adb5aeb949e5a27d.html">include</a></li><li class="navelem"><a class="el" href="dir_aaf8613036f4e96cc302b7ae8d665925.html">stand</a></li><li class="navelem"><a class="el" href="dir_6f62f4aa3b61dfd254b04525e308846e.html">internal</a></li><li class="navelem"><b>util.h</b></li>
|
|
<li class="footer">(C) Copyright SYSGO AG</li>
|
|
</ul>
|
|
</div>
|
|
</body>
|
|
</html>
|