]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/pdk.git/blob - packages/ti/drv/sciclient/soc/sysfw/binaries/system-firmware-public-documentation/6_topic_user_guides/firewall_faq.html
Migrating to SYSFW version v2020.08a
[processor-sdk/pdk.git] / packages / ti / drv / sciclient / soc / sysfw / binaries / system-firmware-public-documentation / 6_topic_user_guides / firewall_faq.html
3 <!DOCTYPE html>
4 <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
5 <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
6 <head>
7   <meta charset="utf-8">
8   
9   <meta name="viewport" content="width=device-width, initial-scale=1.0">
10   
11   <title>Firewall FAQ &mdash; TISCI User Guide</title>
12   
14   
15   
16     <link rel="shortcut icon" href="../_static/favicon.ico"/>
17   
19   
21   
22   
23     
25   
27   
28   
29     <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
30   
32   
33     <link rel="stylesheet" href="../_static/theme_overrides.css" type="text/css" />
34   
36   
37         <link rel="index" title="Index"
38               href="../genindex.html"/>
39         <link rel="search" title="Search" href="../search.html"/>
40     <link rel="top" title="TISCI User Guide" href="../index.html"/>
41         <link rel="up" title="Chapter 6: Topic User Guides" href="index.html"/>
42         <link rel="next" title="SA2UL Access Outside of SYSFW" href="sa2ul_access.html"/>
43         <link rel="prev" title="Using Derived KEK on HS devices" href="dkek_management.html"/> 
45   
46   <script src="../_static/js/modernizr.min.js"></script>
48 </head>
50 <body class="wy-body-for-nav" role="document">
51   <header id="tiHeader">
52     <div class="top">
53       <ul>
54         <li id="top_logo">
55           <a href="http://www.ti.com">
56             <img src="../_static/img/ti_logo.png"/>
57           </a>
58         </li>
59       </ul>
60     </div>
61     <div class="nav"></div>
62   </header>
63   <div class="wy-grid-for-nav">
65     
66     <nav data-toggle="wy-nav-shift" class="wy-nav-side">
67       <div class="wy-side-scroll">
68         <div class="wy-side-nav-search">
69           
71           
72             <a href="../index.html" class="icon icon-home"> TISCI
73           
75           
76           </a>
78           
79             
80             
81           
83           
84 <div role="search">
85   <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
86     <input type="text" name="q" placeholder="Search docs" />
87     <input type="hidden" name="check_keywords" value="yes" />
88     <input type="hidden" name="area" value="default" />
89   </form>
90 </div>
92           
93         </div>
95         <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
96           
97             
98             
99                 <ul class="current">
100 <li class="toctree-l1"><a class="reference internal" href="../1_intro/index.html">Chapter 1: Introduction</a></li>
101 <li class="toctree-l1"><a class="reference internal" href="../2_tisci_msgs/index.html">Chapter 2: TISCI Message Documentation</a></li>
102 <li class="toctree-l1"><a class="reference internal" href="../3_boardcfg/index.html">Chapter 3: Board Configuration</a></li>
103 <li class="toctree-l1"><a class="reference internal" href="../4_trace/index.html">Chapter 4: Interpreting Trace Data</a></li>
104 <li class="toctree-l1"><a class="reference internal" href="../5_soc_doc/index.html">Chapter 5: SoC Family Specific Documentation</a></li>
105 <li class="toctree-l1 current"><a class="reference internal" href="index.html">Chapter 6: Topic User Guides</a><ul class="current">
106 <li class="toctree-l2"><a class="reference internal" href="devgrp_usage.html">Device Group Primer</a></li>
107 <li class="toctree-l2"><a class="reference internal" href="domgrp_usage.html">Domain Group Primer</a></li>
108 <li class="toctree-l2"><a class="reference internal" href="secure_boot_signing.html">Signing binaries for Secure Boot on HS Devices</a></li>
109 <li class="toctree-l2"><a class="reference internal" href="hs_boardcfg_signing.html">Signing Board Configuration on HS devices</a></li>
110 <li class="toctree-l2"><a class="reference internal" href="extended_otp.html">Using Extended OTP on HS devices</a></li>
111 <li class="toctree-l2"><a class="reference internal" href="dkek_management.html">Using Derived KEK on HS devices</a></li>
112 <li class="toctree-l2 current"><a class="current reference internal" href="#">Firewall FAQ</a><ul>
113 <li class="toctree-l3"><a class="reference internal" href="#can-i-directly-write-to-firewall-configuration-registers">Can I directly write to firewall configuration registers ?</a></li>
114 <li class="toctree-l3"><a class="reference internal" href="#how-do-i-configure-a-firewall">How do I configure a firewall ?</a></li>
115 <li class="toctree-l3"><a class="reference internal" href="#how-do-i-specify-which-firewall-to-program">How do I specify which firewall to program ?</a></li>
116 <li class="toctree-l3"><a class="reference internal" href="#how-do-i-know-what-permissions-to-program-in-the-firewall">How do I know what permissions to program in the firewall ?</a></li>
117 <li class="toctree-l3"><a class="reference internal" href="#are-all-firewalls-user-programmable">Are all firewalls user programmable ?</a></li>
118 <li class="toctree-l3"><a class="reference internal" href="#what-is-firewall-ownership">What is firewall ownership ?</a></li>
119 <li class="toctree-l3"><a class="reference internal" href="#is-there-any-relationship-between-ownership-and-firewall-permissions">Is there any relationship between ownership and firewall permissions ?</a></li>
120 <li class="toctree-l3"><a class="reference internal" href="#is-host-id-the-same-as-priv-id">Is host ID the same as priv ID ?</a></li>
121 <li class="toctree-l3"><a class="reference internal" href="#is-programming-overlapping-firewalls-supported">Is programming overlapping firewalls supported ?</a></li>
122 <li class="toctree-l3"><a class="reference internal" href="#what-are-background-and-foreground-regions">What are background and foreground regions ?</a></li>
123 <li class="toctree-l3"><a class="reference internal" href="#how-do-i-debug-firewall-issues">How do I debug firewall issues ?</a></li>
124 <li class="toctree-l3"><a class="reference internal" href="#how-are-dmsc-managed-resources-firewalled">How are DMSC-managed resources firewalled ?</a></li>
125 </ul>
126 </li>
127 <li class="toctree-l2"><a class="reference internal" href="sa2ul_access.html">SA2UL Access Outside of SYSFW</a></li>
128 <li class="toctree-l2"><a class="reference internal" href="security_handover.html">Performing Security Handover</a></li>
129 <li class="toctree-l2"><a class="reference internal" href="secure_debug.html">Secure Debug User Guide</a></li>
130 </ul>
131 </li>
132 </ul>
134             
135           
136         </div>
137       </div>
138     </nav>
140     <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
142       
143       <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
144         <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
145         <a href="../index.html">TISCI</a>
146       </nav>
149       
150       <div class="wy-nav-content">
151         <div class="rst-content">
152           
154  
158 <div role="navigation" aria-label="breadcrumbs navigation">
159   <ul class="wy-breadcrumbs">
160     <li><a href="../index.html">Docs</a> &raquo;</li>
161       
162           <li><a href="index.html">Chapter 6: Topic User Guides</a> &raquo;</li>
163       
164     <li>Firewall FAQ</li>
165       <li class="wy-breadcrumbs-aside">
166         
167           
168         
169       </li>
170   </ul>
171   <hr/>
172 </div>
173           <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
174            <div itemprop="articleBody">
175             
176   <div class="section" id="firewall-faq">
177 <h1>Firewall FAQ<a class="headerlink" href="#firewall-faq" title="Permalink to this headline">¶</a></h1>
178 <div class="contents local topic" id="contents">
179 <ul class="simple">
180 <li><a class="reference internal" href="#can-i-directly-write-to-firewall-configuration-registers" id="id1">Can I directly write to firewall configuration registers ?</a></li>
181 <li><a class="reference internal" href="#how-do-i-configure-a-firewall" id="id2">How do I configure a firewall ?</a></li>
182 <li><a class="reference internal" href="#how-do-i-specify-which-firewall-to-program" id="id3">How do I specify which firewall to program ?</a></li>
183 <li><a class="reference internal" href="#how-do-i-know-what-permissions-to-program-in-the-firewall" id="id4">How do I know what permissions to program in the firewall ?</a></li>
184 <li><a class="reference internal" href="#are-all-firewalls-user-programmable" id="id5">Are all firewalls user programmable ?</a></li>
185 <li><a class="reference internal" href="#what-is-firewall-ownership" id="id6">What is firewall ownership ?</a></li>
186 <li><a class="reference internal" href="#is-there-any-relationship-between-ownership-and-firewall-permissions" id="id7">Is there any relationship between ownership and firewall permissions ?</a></li>
187 <li><a class="reference internal" href="#is-host-id-the-same-as-priv-id" id="id8">Is host ID the same as priv ID ?</a></li>
188 <li><a class="reference internal" href="#is-programming-overlapping-firewalls-supported" id="id9">Is programming overlapping firewalls supported ?</a></li>
189 <li><a class="reference internal" href="#what-are-background-and-foreground-regions" id="id10">What are background and foreground regions ?</a></li>
190 <li><a class="reference internal" href="#how-do-i-debug-firewall-issues" id="id11">How do I debug firewall issues ?</a></li>
191 <li><a class="reference internal" href="#how-are-dmsc-managed-resources-firewalled" id="id12">How are DMSC-managed resources firewalled ?</a></li>
192 </ul>
193 </div>
194 <div class="admonition note">
195 <p class="first admonition-title">Note</p>
196 <p class="last">System Firmware supports multiple SOC’s.
197 When providing links to SOC-specific documentation, this document provides
198 the example of AM65x SR1 SOC.
199 Documentation for other SOC’s can be found by traversing similar path from
200 the root of <a class="reference internal" href="../5_soc_doc/index.html"><span class="doc">Chapter 5: SoC Family Specific Documentation</span></a>.</p>
201 </div>
202 <div class="section" id="can-i-directly-write-to-firewall-configuration-registers">
203 <h2><a class="toc-backref" href="#id1">Can I directly write to firewall configuration registers ?</a><a class="headerlink" href="#can-i-directly-write-to-firewall-configuration-registers" title="Permalink to this headline">¶</a></h2>
204 <p>No. Firewall configuration registers are only writable by System Firmware.
205 They cannot be programmed by direct register writes.</p>
206 </div>
207 <div class="section" id="how-do-i-configure-a-firewall">
208 <h2><a class="toc-backref" href="#id2">How do I configure a firewall ?</a><a class="headerlink" href="#how-do-i-configure-a-firewall" title="Permalink to this headline">¶</a></h2>
209 <p>Firewalls are configured using the <a class="reference internal" href="../2_tisci_msgs/security/firewall_api.html#set-firewall-region"><span class="std std-ref">TISCI_MSG_SET_FWL_REGION</span></a> TISCI message.</p>
210 <p>Disabling a firewall is also done using the same API using the control word.</p>
211 <p>All the registers of a firewall can be configured using the above TISCI message.</p>
212 </div>
213 <div class="section" id="how-do-i-specify-which-firewall-to-program">
214 <h2><a class="toc-backref" href="#id3">How do I specify which firewall to program ?</a><a class="headerlink" href="#how-do-i-specify-which-firewall-to-program" title="Permalink to this headline">¶</a></h2>
215 <p>Firewalls are identified to System Firmware by their ID.
216 The ID of a firewall can be obtained from the Technical Reference Manual(TRM) of the SOC.
217 Information on firewalls is provided in the chapter “System Interconnect” and the subsection
218 “Interconnect Firewalls”.</p>
219 <p><a class="reference internal" href="../2_tisci_msgs/security/firewall_api.html#set-firewall-region"><span class="std std-ref">TISCI_MSG_SET_FWL_REGION</span></a> TISCI message takes firewall id as one of the arguments.</p>
220 </div>
221 <div class="section" id="how-do-i-know-what-permissions-to-program-in-the-firewall">
222 <h2><a class="toc-backref" href="#id4">How do I know what permissions to program in the firewall ?</a><a class="headerlink" href="#how-do-i-know-what-permissions-to-program-in-the-firewall" title="Permalink to this headline">¶</a></h2>
223 <p>Privilege ID’s of the various initiators are described in the public SOC documentation
224 <a class="reference internal" href="../5_soc_doc/index.html"><span class="doc">Chapter 5: SoC Family Specific Documentation</span></a> under “&lt;SOC&gt; Firewall Descriptions”.
225 As an example for AM65X devices, this is listed under
226 <a class="reference internal" href="../5_soc_doc/am6x/firewalls.html#soc-doc-am6-public-fwl-desc-priv-id-list"><span class="std std-ref">AM65x List of priv ids</span></a>.</p>
227 <p>The values to program in the permission bits and the control registers
228 can be found from the below section in the TRM.</p>
229 <p>“System Interconnect” -&gt; “System Interconnect Registers” -&gt; “Firewall Region Registers”</p>
230 </div>
231 <div class="section" id="are-all-firewalls-user-programmable">
232 <h2><a class="toc-backref" href="#id5">Are all firewalls user programmable ?</a><a class="headerlink" href="#are-all-firewalls-user-programmable" title="Permalink to this headline">¶</a></h2>
233 <p>No. System Firmware maintains ownership of the following categories of firewalls.</p>
234 <ol class="arabic simple">
235 <li>Firewalls protecting DMSC-owned resources - e.g. secure proxies,
236 firewall configuration port etc.
237 These firewalls are marked as owned by <code class="docutils literal"><span class="pre">dmsc</span></code> in the firewall SOC data.</li>
238 <li>Firewalls protecting DMSC-managed resources i.e. NAVSS resources managed by RM.
239 These firewalls are marked as owned by <code class="docutils literal"><span class="pre">rm</span></code> in the firewall SOC data.</li>
240 </ol>
241 <p>The remaining firewalls are user programmable through the TISCI interface only.</p>
242 <p>The list of firewalls owned/initialized by System Firmware are listed for AM65X SR1
243 devices at</p>
244 <ul class="simple">
245 <li><a class="reference internal" href="../5_soc_doc/am6x/firewalls.html#soc-doc-am6-public-fwl-desc-region-fwl-list"><span class="std std-ref">AM65x Standard region-based slave firewall configuration</span></a></li>
246 <li><a class="reference internal" href="../5_soc_doc/am6x/firewalls.html#soc-doc-am6-public-fwl-desc-channel-fwl-list"><span class="std std-ref">AM65x Channelized slave firewall configuration</span></a></li>
247 </ul>
248 </div>
249 <div class="section" id="what-is-firewall-ownership">
250 <h2><a class="toc-backref" href="#id6">What is firewall ownership ?</a><a class="headerlink" href="#what-is-firewall-ownership" title="Permalink to this headline">¶</a></h2>
251 <p>Firewall ownership is a software concept implemented by System Firmware.
252 A firewall region can be marked as owned by a specific host.
253 This prevents the firewall region from being programmed/reprogrammed
254 by another host and helps in firewall overlap checks.</p>
255 <p>By default, only firewalls required from System Firmware use are marked as owned by <code class="docutils literal"><span class="pre">dmsc</span></code> or <code class="docutils literal"><span class="pre">rm</span></code>.
256 Rest of the firewalls have ownership set to <code class="docutils literal"><span class="pre">none</span></code>.
257 Firewalls with owner set as <code class="docutils literal"><span class="pre">none</span></code> can be programmed by any host.</p>
258 <p>A host can claim ownership of a firewall region with owner set to <code class="docutils literal"><span class="pre">none</span></code> by using the
259 <a class="reference internal" href="../2_tisci_msgs/security/firewall_api.html#change-firewall-owner"><span class="std std-ref">TISCI_MSG_CHANGE_FWL_OWNER</span></a> message. A host
260 can use the same message to transfer a firewall region it owns to another host.</p>
261 </div>
262 <div class="section" id="is-there-any-relationship-between-ownership-and-firewall-permissions">
263 <h2><a class="toc-backref" href="#id7">Is there any relationship between ownership and firewall permissions ?</a><a class="headerlink" href="#is-there-any-relationship-between-ownership-and-firewall-permissions" title="Permalink to this headline">¶</a></h2>
264 <p>The concept of firewall ownership is unrelated to firewall permissions.
265 Firewall ownership is a software concept.
266 Firewall permissions directly map to the underlying hardware registers.
267 The owner of a firewall can configure firewall permissions as desired.
268 System Firmware does not perform any checks on the firewall permissions supplied
269 in the TISCI message arguments.</p>
270 </div>
271 <div class="section" id="is-host-id-the-same-as-priv-id">
272 <h2><a class="toc-backref" href="#id8">Is host ID the same as priv ID ?</a><a class="headerlink" href="#is-host-id-the-same-as-priv-id" title="Permalink to this headline">¶</a></h2>
273 <p>No. Host ID is a software concept introduced by System Firmware to be differentiate
274 between different entities on the device.
275 Some of the entities can be on the same core.
276 e.g. privileged software and unprivileged software running on the same core.
277 See <a class="reference internal" href="../5_soc_doc/am6x/hosts.html#soc-doc-am6-public-host-desc-intro"><span class="std std-ref">AM65X Host IDs</span></a>.</p>
278 <p>Priv ID is a hardware concept. Every transaction on the interconnect has various
279 attributes including but not limited to Priv ID, user/privileged, secure/non
280 secure. Each host maps to a Priv ID. See <a class="reference internal" href="../5_soc_doc/am6x/firewalls.html#soc-doc-am6-public-fwl-desc-priv-id-list"><span class="std std-ref">AM65x List of priv ids</span></a> for the mapping.</p>
281 </div>
282 <div class="section" id="is-programming-overlapping-firewalls-supported">
283 <h2><a class="toc-backref" href="#id9">Is programming overlapping firewalls supported ?</a><a class="headerlink" href="#is-programming-overlapping-firewalls-supported" title="Permalink to this headline">¶</a></h2>
284 <p>Yes. Programming overlapping firewalls is supported.
285 System Firmware performs additional checks when overlapping firewall regions are being programmed.</p>
286 <ol class="arabic simple">
287 <li>A background region cannot overlap with another background region.</li>
288 <li>A foreground region cannot overlap with another foreground region.</li>
289 </ol>
290 <p>The above two checks are to prevent undefined behaviour as per hardware specification.</p>
291 <ol class="arabic simple" start="3">
292 <li>Same host must own both the foreground and background region in case of an overlap.
293 This check prevents one host from using a foreground region to override
294 firewall configuration performed by another host</li>
295 </ol>
296 <p>Before programming overlapping firewall regions, please claim ownership of both the
297 regions using the <a class="reference internal" href="../2_tisci_msgs/security/firewall_api.html#change-firewall-owner"><span class="std std-ref">TISCI_MSG_CHANGE_FWL_OWNER</span></a> message.</p>
298 </div>
299 <div class="section" id="what-are-background-and-foreground-regions">
300 <h2><a class="toc-backref" href="#id10">What are background and foreground regions ?</a><a class="headerlink" href="#what-are-background-and-foreground-regions" title="Permalink to this headline">¶</a></h2>
301 <p>The firewall IP supports the concept for foreground and background regions.
302 The firewall permissions specified in a background region can be overridden
303 by using a foreground region.</p>
304 <p>A region can be specified as foreground or background using a bit in the control register.
305 Please refer to the following section in TRM for more information.</p>
306 <p>“System Interconnect” -&gt; “System Interconnect Registers” -&gt; “Firewall Region Registers”</p>
307 <p>Following restrictions apply from hardware perspective.</p>
308 <ol class="arabic simple">
309 <li>A background region cannot overlap with another background region.</li>
310 <li>A foreground region cannot overlap with another foreground region.</li>
311 <li>A foreground region cannot span two background regions.</li>
312 </ol>
313 </div>
314 <div class="section" id="how-do-i-debug-firewall-issues">
315 <h2><a class="toc-backref" href="#id11">How do I debug firewall issues ?</a><a class="headerlink" href="#how-do-i-debug-firewall-issues" title="Permalink to this headline">¶</a></h2>
316 <p>The programmed firewall settings can be read back by the owner using
317 <a class="reference internal" href="../2_tisci_msgs/security/firewall_api.html#get-firewall-region"><span class="std std-ref">TISCI_MSG_GET_FWL_REGION</span></a>.</p>
318 <p>Direct readback of the firewall configuration registers is not currently
319 allowed.</p>
320 <p>When a firewall exception occurs, the exception data is sent out via the
321 enabled trace method.
322 The data sent out is the dump of the firewall exception registers as
323 defined in below section in the corresponding device TRM.</p>
324 <p>“System Interconnect” -&gt; “System Interconnect Registers” -&gt; “Firewall Exception Registers”</p>
325 <div class="code highlight-cpp"><div class="highlight"><pre><span></span><span class="n">FWL</span> <span class="n">Exception</span>  <span class="mh">0x1116100</span>
326 <span class="mh">0x70000</span>
327 <span class="mh">0x70000000</span>
328 <span class="mh">0x0</span>
329 <span class="mh">0xE022000</span>
330 <span class="mh">0x8</span>
331 </pre></div>
332 </div>
333 <p>The 6 hex values shown above correspond to the 2 exception header registers and
334 4 exception data registers in the order shown in the TRM.</p>
335 <div class="admonition warning">
336 <p class="first admonition-title">Warning</p>
337 <p class="last">Please note that this format is being deprecated in favour of a binary format
338 in conformance with the rest of traces supplied by System Firmware.</p>
339 </div>
340 </div>
341 <div class="section" id="how-are-dmsc-managed-resources-firewalled">
342 <h2><a class="toc-backref" href="#id12">How are DMSC-managed resources firewalled ?</a><a class="headerlink" href="#how-are-dmsc-managed-resources-firewalled" title="Permalink to this headline">¶</a></h2>
343 <p>NAVSS resources managed by DMSC (UDMA channels, Rings, Proxy channels and IRQ)
344 are firewalled automatically when the corresponding RM TISCI messages are sent.</p>
345 <p>Accessing these resources before sending the corresponding RM TISCI message
346 will result in a firewall exception.</p>
347 </div>
348 </div>
351            </div>
352           </div>
353           <footer>
354   
355     <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
356       
357         <a href="sa2ul_access.html" class="btn btn-neutral float-right" title="SA2UL Access Outside of SYSFW" accesskey="n">Next <span class="fa fa-arrow-circle-right"></span></a>
358       
359       
360         <a href="dkek_management.html" class="btn btn-neutral" title="Using Derived KEK on HS devices" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous</a>
361       
362     </div>
363   
365   <hr/>
367   <div role="contentinfo">
368     <p>
369       <a href="http://www.ti.com/corp/docs/legal/copyright.shtml">&copy; Copyright 2016-2020</a>, Texas Instruments Incorporated. All rights reserved. <br>
370       <a href="http://www.ti.com/corp/docs/legal/trademark/trademrk.htm">Trademarks</a> | <a href="http://www.ti.com/corp/docs/legal/privacy.shtml">Privacy policy</a> | <a href="http://www.ti.com/corp/docs/legal/termsofuse.shtml">Terms of use</a> | <a href="http://www.ti.com/lsds/ti/legal/termsofsale.page">Terms of sale</a>
372     </p>
373   </div> 
375 </footer>
377         </div>
378       </div>
380     </section>
382   </div>
383   
386   
388     <script type="text/javascript">
389         var DOCUMENTATION_OPTIONS = {
390             URL_ROOT:'../',
391             VERSION:'',
392             COLLAPSE_INDEX:false,
393             FILE_SUFFIX:'.html',
394             HAS_SOURCE:  true
395         };
396     </script>
397       <script type="text/javascript" src="../_static/jquery.js"></script>
398       <script type="text/javascript" src="../_static/underscore.js"></script>
399       <script type="text/javascript" src="../_static/doctools.js"></script>
400       <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
402     <script src="http://www.ti.com/assets/js/headerfooter/analytics.js" type="text/javascript" charset="utf-8"></script>
404   
406   
407   
408     <script type="text/javascript" src="../_static/js/theme.js"></script>
409   
411   
412   
413   <script type="text/javascript">
414       jQuery(function () {
415           SphinxRtdTheme.StickyNav.enable();
416         });
418       var menuHeight = window.innerHeight;
420       var contentOffset = $(".wy-nav-content-wrap").offset();
421       var contentHeight = $(".wy-nav-content-wrap").height();
422       var contentBottom = contentOffset.top + contentHeight;
424       function setNavbarTop() {
425           var scrollTop = $(window).scrollTop();
426           var maxTop = scrollTop + menuHeight;
428           // If past the header
429           if (scrollTop > contentOffset.top && maxTop < contentBottom) {
430             stickyTop = scrollTop - contentOffset.top;
431           } else if (maxTop > contentBottom) {
432             stickyTop = scrollTop - contentOffset.top - (maxTop - contentBottom);
433           } else {
434             stickyTop = 0;
435           }
437           $(".wy-nav-side").css("top", stickyTop);
438       }
440       $(document).ready(function() {
441         setNavbarTop();
442         $(window).scroll(function () {
443           setNavbarTop();
444         });
446         $('body').on("mousewheel", function () {
447             // Remove default behavior
448             event.preventDefault();
449             // Scroll without smoothing
450             var wheelDelta = event.wheelDelta;
451             var currentScrollPosition = window.pageYOffset;
452             window.scrollTo(0, currentScrollPosition - wheelDelta);
453         });
454       });
455   </script>
456    
458 </body>
459 </html>