Difference between revisions of "ARM processor"

From Wiki at Neela Nurseries
Jump to: navigation, search
m (^ Synchronization Primitives LDREX and STREX: - noting ARM related abbreviations ERG and SCU)
m (^ Synchronization Primitives LDREX and STREX: - link to article by Raymond Chen)
 
(7 intermediate revisions by the same user not shown)
Line 35: Line 35:
  
 
Abbreviations:
 
Abbreviations:
 +
{| class="wikitable"
 +
|-
 +
|abbr ERG || Exclusive Reservation Granuale, refers to smallest memory regions which Exclusive Monitors are able to tag for exclusive access || ARM Developer docs
 +
|-
 +
|abbr SCU || Snoop Control Unit || ARM Developer docs
 +
|-
 +
|abbr KPCR || Kernel Processor Control Region || arm_assembler_primer.html
 +
|}
  
 +
2023-04-17 Monday<br />
  
Help:Tables
+
Searching for an example assembly code snippet calling `STREX` and branching conditionally based on result.  Search string is "arm assembly strex and branch example".  First found results include:
  
    Help
+
*  https://codemachine.com/articles/arm_assembler_primer.html
    Discussion
+
*  https://developer.arm.com/documentation/dui0489/c/arm-and-thumb-instructions/memory-access-instructions/ldrex-and-strex
 +
Article by Raymond Chen:
 +
*  https://devblogs.microsoft.com/oldnewthing/20210614-00/?p=105307
  
     Read
+
Excerpt:
     View source
+
<pre>
     View history
+
    MOV r1, #0x1                ; load the 'lock taken' value
 +
try
 +
    LDREX r0, [LockAddr]        ; load the lock value
 +
    CMP r0, #0                  ; is the lock free?
 +
    STREXEQ r0, r1, [LockAddr]  ; try and claim the lock
 +
     CMPEQ r0, #0                ; did this succeed?
 +
     BNE try                    ; no - try again
 +
     ....                        ; yes - we have the lock
 +
</pre>
  
Tools
+
<!-- comentario -->
  
Translate this page
 
Languages:
 
  
    Bahasa Indonesia Deutsch English Esperanto Nederlands Qaraqalpaqsha Tiếng Việt Türkçe Yorùbá Zazaki català dansk español français italiano norsk bokmål polski português português do Brasil română slovenčina srpskohrvatski / српскохрватски suomi svenska čeština русский тоҷикӣ українська հայերեն العربية فارسی ไทย 中文 日本語 한국어
 
 
PD Note: When you edit this page, you agree to release your contribution under the CC0. See Public Domain Help Pages for more info.
 
Translate
 
PD
 
 
    Tables redirects here; for information about database table structure, see Manual:Database layout.
 
 
Tables may be created in wiki pages. As a general rule, it is best to avoid using a table unless you need one. Table markup often complicates page editing.[1]
 
Wiki table markup summary
 
{| table start, required
 
|+ table caption, optional; only between table start and table row
 
|- table row, optional on first row—wiki engine assumes the first row
 
! table header cell, optional. Consecutive table header cells may be added on same line separated by double marks (!!) or start on new lines, each with its own single mark (!).
 
| table data cell, optional. Consecutive table data cells may be added on same line separated by double marks (||) or start on new lines, each with its own single mark (|).
 
|} table end, required
 
 
    The above marks must start on a new line except the double || and !! for optionally adding consecutive cells to a line. However, blank spaces at the beginning of a line are ignored.
 
    HTML attributes. Each mark, except table end, optionally accepts one or more HTML attributes. Attributes must be on the same line as the mark. Separate attributes from each other with a single space.
 
        Cells and caption (| or ||, ! or !!, and |+) hold content. So separate any attributes from content with a single pipe (|). Cell content may follow on same line or on following lines.
 
        Table and row marks ({| and |-) do not directly hold content. Do not add pipe (|) after their optional attributes. If you erroneously add a pipe after attributes for the table mark or row mark the parser will delete it and your final attribute if it was touching the erroneous pipe!
 
    Content may (a) follow its cell mark on the same line after any optional HTML attributes or (b) on lines below the cell mark. Content that uses wiki markup that itself needs to start on a new line, such as lists, headings, or nested tables, must be on its own new line.
 
        Pipe character as content. To insert a pipe (|) character into a table, use the <nowiki><code>|</code></nowiki> escaping markup.
 
 
Basics
 
Create a table with editor toolbar
 
 
In wikitext editor, place the caret where you want to insert a table. Then, in the toolbar, press “Advanced”, then choose Table button. A dialog opens.
 
 
From the dialog, you can choose whether to enable a table header row, to stylize the table with border and to make the table sortable. A preview example is displayed. You can also set row and column counts you need. Then, press “Insert” button.
 
 
By default, the following code is generated:
 
Wikicode:
 
 
{| class="wikitable"
 
|-
 
|abbr ERG || Exclusive Reservation Granuale, refers to smallest memory regions which Exclusive Monitors are able to tag for exclusive access
 
|-
 
|abbr SCU || Snoop Control Unit
 
|}
 
 
<!-- comentario -->
 
  
  
  
 
<!-- EOF -->
 
<!-- EOF -->

Latest revision as of 20:49, 17 April 2023

^ OVERVIEW

This page for notes on ARM processor architecture, and related ARM IP works.


ARM Architecture and Instruction Set Notes

[ ] . . . search for Armv8-M Architecture Reference Manual ID28092022


^ Advanced Hardware Bus AHB

ARM architecture and related IP, link to AHB paper by Rinku 1, Pawan Kumar Dahiya 2


^ Synchronization Primitives LDREX and STREX

ARM Synchronization Primitives LDREX and STREX, split a normally atomic memory write operation and allow for checking whether other Processing Elements or "bus primaries" (note 1) are also accessing the given memory location. From the short documentations linked below, it looks like LDREX updates local and global resource access monitors in certain ARM variants, and STREX either succeeds or fails based on checking one or both of those monitors, depending on whether the memory or resource is shared or not shared among multiple processing elements (PEs).

Article locally numbered (3) in the following list of URLs introduces a comparative concept in its text "The Data Memory Barrier existed before ARMv7 as a cp15 operation, but ARMv7 introduced a dedicated instruction, DMB."

Abbreviations:

abbr ERG Exclusive Reservation Granuale, refers to smallest memory regions which Exclusive Monitors are able to tag for exclusive access ARM Developer docs
abbr SCU Snoop Control Unit ARM Developer docs
abbr KPCR Kernel Processor Control Region arm_assembler_primer.html

2023-04-17 Monday

Searching for an example assembly code snippet calling `STREX` and branching conditionally based on result. Search string is "arm assembly strex and branch example". First found results include:

Article by Raymond Chen:

Excerpt:

    MOV r1, #0x1                ; load the 'lock taken' value
try
    LDREX r0, [LockAddr]        ; load the lock value
    CMP r0, #0                  ; is the lock free?
    STREXEQ r0, r1, [LockAddr]  ; try and claim the lock
    CMPEQ r0, #0                ; did this succeed?
    BNE try                     ; no - try again
    ....                        ; yes - we have the lock