<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://xinu.cs.mu.edu/index.php?action=history&amp;feed=atom&amp;title=BCM2835_System_Timer</id>
	<title>BCM2835 System Timer - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://xinu.cs.mu.edu/index.php?action=history&amp;feed=atom&amp;title=BCM2835_System_Timer"/>
	<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=BCM2835_System_Timer&amp;action=history"/>
	<updated>2026-06-15T16:26:00Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.2</generator>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=BCM2835_System_Timer&amp;diff=4078&amp;oldid=prev</id>
		<title>Ebiggers at 01:48, 12 September 2013</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=BCM2835_System_Timer&amp;diff=4078&amp;oldid=prev"/>
		<updated>2013-09-12T01:48:52Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 01:48, 12 September 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l34&quot; &gt;Line 34:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 34:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Use in Embedded Xinu ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Use in Embedded Xinu ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In the [[Raspberry Pi]] port of Embedded Xinu, the BCM2835 System Timer is used to implement [[Preemptive_Multitasking_(ARM)|preemptive multitasking]] and keep the system time.  The code can be found in system/platforms/arm-rpi/timer.c and is fairly simple, as it only needs to implement clkcount() and clkupdate().&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In the [[Raspberry Pi]] port of &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;[[&lt;/ins&gt;Embedded Xinu&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;]], or [[XinuPi]]&lt;/ins&gt;, the BCM2835 System Timer is used to implement [[Preemptive_Multitasking_(ARM)|preemptive multitasking]] and keep the system time.  The code can be found in &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;{{SourceFile|&lt;/ins&gt;system/platforms/arm-rpi/timer.c&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;}} &lt;/ins&gt;and is fairly simple, as it only needs to implement &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;code&amp;gt;&lt;/ins&gt;clkcount()&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/code&amp;gt; &lt;/ins&gt;and &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;code&amp;gt;&lt;/ins&gt;clkupdate()&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/code&amp;gt;&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Ebiggers</name></author>
		
	</entry>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=BCM2835_System_Timer&amp;diff=4026&amp;oldid=prev</id>
		<title>Ebiggers: Bold article subject</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=BCM2835_System_Timer&amp;diff=4026&amp;oldid=prev"/>
		<updated>2013-09-07T23:02:03Z</updated>

		<summary type="html">&lt;p&gt;Bold article subject&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 23:02, 7 September 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The BCM2835 System Timer is a memory-mapped peripheral available on the [[BCM2835|BCM2835 System-on-a-Chip]] used in the [[Raspberry Pi]].  It features a 64-bit free-running counter that runs at 1 MHz and four separate &amp;quot;output compare registers&amp;quot; that can be used to schedule interrupts.  However, two output compare registers are already used by the VideoCore GPU, leaving only two available for the ARM CPU to use.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/ins&gt;BCM2835 System Timer&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;''' &lt;/ins&gt;is a memory-mapped peripheral available on the [[BCM2835|BCM2835 System-on-a-Chip]] used in the [[Raspberry Pi]].  It features a 64-bit free-running counter that runs at 1 MHz and four separate &amp;quot;output compare registers&amp;quot; that can be used to schedule interrupts.  However, two output compare registers are already used by the VideoCore GPU, leaving only two available for the ARM CPU to use.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Hardware details ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Hardware details ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Ebiggers</name></author>
		
	</entry>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=BCM2835_System_Timer&amp;diff=4025&amp;oldid=prev</id>
		<title>Ebiggers: Link to BCM2835</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=BCM2835_System_Timer&amp;diff=4025&amp;oldid=prev"/>
		<updated>2013-09-07T23:01:45Z</updated>

		<summary type="html">&lt;p&gt;Link to BCM2835&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 23:01, 7 September 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The BCM2835 System Timer is a memory-mapped peripheral available on the BCM2835 System-on-a-Chip used in the [[Raspberry Pi]].  It features a 64-bit free-running counter that runs at 1 MHz and four separate &amp;quot;output compare registers&amp;quot; that can be used to schedule interrupts.  However, two output compare registers are already used by the VideoCore GPU, leaving only two available for the ARM CPU to use.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The BCM2835 System Timer is a memory-mapped peripheral available on the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;[[BCM2835|&lt;/ins&gt;BCM2835 System-on-a-Chip&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;]] &lt;/ins&gt;used in the [[Raspberry Pi]].  It features a 64-bit free-running counter that runs at 1 MHz and four separate &amp;quot;output compare registers&amp;quot; that can be used to schedule interrupts.  However, two output compare registers are already used by the VideoCore GPU, leaving only two available for the ARM CPU to use.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Hardware details ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Hardware details ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Ebiggers</name></author>
		
	</entry>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=BCM2835_System_Timer&amp;diff=4017&amp;oldid=prev</id>
		<title>Ebiggers: /* Use in Embedded Xinu */:  Add links</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=BCM2835_System_Timer&amp;diff=4017&amp;oldid=prev"/>
		<updated>2013-08-03T17:04:11Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Use in Embedded Xinu: &lt;/span&gt;:  Add links&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 17:04, 3 August 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l34&quot; &gt;Line 34:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 34:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Use in Embedded Xinu ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Use in Embedded Xinu ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In the Raspberry Pi port of Embedded Xinu, the BCM2835 System Timer is used to implement preemptive multitasking and keep the system time.  The code can be found in system/platforms/arm-rpi/timer.c and is fairly simple, as it only needs to implement clkcount() and clkupdate().&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;[[&lt;/ins&gt;Raspberry Pi&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;]] &lt;/ins&gt;port of Embedded Xinu, the BCM2835 System Timer is used to implement &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;[[Preemptive_Multitasking_(ARM)|&lt;/ins&gt;preemptive multitasking&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;]] &lt;/ins&gt;and keep the system time.  The code can be found in system/platforms/arm-rpi/timer.c and is fairly simple, as it only needs to implement clkcount() and clkupdate().&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Ebiggers</name></author>
		
	</entry>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=BCM2835_System_Timer&amp;diff=4000&amp;oldid=prev</id>
		<title>Ebiggers: Created page</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=BCM2835_System_Timer&amp;diff=4000&amp;oldid=prev"/>
		<updated>2013-07-31T21:18:10Z</updated>

		<summary type="html">&lt;p&gt;Created page&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;The BCM2835 System Timer is a memory-mapped peripheral available on the BCM2835 System-on-a-Chip used in the [[Raspberry Pi]].  It features a 64-bit free-running counter that runs at 1 MHz and four separate &amp;quot;output compare registers&amp;quot; that can be used to schedule interrupts.  However, two output compare registers are already used by the VideoCore GPU, leaving only two available for the ARM CPU to use.&lt;br /&gt;
&lt;br /&gt;
== Hardware details ==&lt;br /&gt;
&lt;br /&gt;
The interface to the BCM2835 System Timer is a set of 32-bit memory-mapped registers beginning at physical address 0x20003000.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| +0x00 || CS || System Timer Control and Status&lt;br /&gt;
|-&lt;br /&gt;
| +0x04 || CLO || System Timer Counter Lower 32 bits&lt;br /&gt;
|-&lt;br /&gt;
| +0x08 || CHI || System Timer Counter Upper 32 bits&lt;br /&gt;
|- style=&amp;quot;background: gray&amp;quot;&lt;br /&gt;
| +0x0C || C0 || System Timer Compare 0; corresponds to IRQ line 0.&lt;br /&gt;
|-&lt;br /&gt;
| +0x10 || C1 || System Timer Compare 1; corresponds to IRQ line 1.&lt;br /&gt;
|- style=&amp;quot;background: gray&amp;quot;&lt;br /&gt;
| +0x14 || C2 || System Timer Compare 2; corresponds to IRQ line 2.&lt;br /&gt;
|-&lt;br /&gt;
| +0x18 || C3 || System Timer Compare 3; corresponds to IRQ line 3.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
CLO and CHI form a 64-bit free-running counter, which increases by itself at a rate of 1 MHz, that software can read to get the current number of timer ticks.  There are, however, two caveats:&lt;br /&gt;
&lt;br /&gt;
* Appropriate [[BCM2835 Memory Barriers|memory barriers]] should be inserted to guarantee that read data is not re-ordered with that from a different peripheral.&lt;br /&gt;
* Reading CLO can be done in a single 32-bit access.  However, we are not currently aware of a way to read CLO and CHI together atomically.  To work around this when the full 64-bit time is desired, software can read CHI, then CLO, then read CHI and retry if CHI changed.&lt;br /&gt;
&lt;br /&gt;
To schedule an interrupt using the System Timer, software can write the value of CLO at which an interrupt will be generated into one of the System Timer Compare registers.  However, the CPU actually only use C1 and C3, since C0 and C2 are used by the GPU.  Also, to actually receive the scheduled interrupt, the software must have previously enabled the corresponding IRQ line using the [[BCM2835 Interrupt Controller]].  To clear the interrupt, software must write 1 to the bit in CS that has the index the same as that of the System Timer Compare register.  That is, to clear an interrupt set in C1, software must write 0x20 to CS, and to clear an interrupt set in C3, software must write 0x80 to CS.&lt;br /&gt;
&lt;br /&gt;
== Use in Embedded Xinu ==&lt;br /&gt;
&lt;br /&gt;
In the Raspberry Pi port of Embedded Xinu, the BCM2835 System Timer is used to implement preemptive multitasking and keep the system time.  The code can be found in system/platforms/arm-rpi/timer.c and is fairly simple, as it only needs to implement clkcount() and clkupdate().&lt;/div&gt;</summary>
		<author><name>Ebiggers</name></author>
		
	</entry>
</feed>