Ignore:
Timestamp:
2009-03-03T16:12:43Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
02fd705
Parents:
f24d300
Message:

better inline assembler readability using the new symbolic syntax

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/arm32/src/mm/page_fault.c

    rf24d300 re762b43  
    5050{
    5151        fault_status_union_t fsu;
    52 
     52       
    5353        /* fault status is stored in CP15 register 5 */
    5454        asm volatile (
    55                 "mrc p15, 0, %0, c5, c0, 0"
    56                 : "=r"(fsu.dummy)
     55                "mrc p15, 0, %[dummy], c5, c0, 0"
     56                : [dummy] "=r" (fsu.dummy)
    5757        );
     58       
    5859        return fsu.fs;
    5960}
     
    6263 *
    6364 * @return FAR (fault address register) content (address that caused a page
    64  *         fault)
     65 *         fault)
    6566 */
    6667static inline uintptr_t read_fault_address_register(void)
    6768{
    6869        uintptr_t ret;
    69 
     70       
    7071        /* fault adress is stored in CP15 register 6 */
    7172        asm volatile (
    72                 "mrc p15, 0, %0, c6, c0, 0"
    73                 : "=r"(ret)
     73                "mrc p15, 0, %[ret], c6, c0, 0"
     74                : [ret] "=r" (ret)
    7475        );
     76       
    7577        return ret;
    7678}
     
    8183 *
    8284 * @return true when instruction is load/store, false otherwise
     85 *
    8386 */
    8487static inline bool is_load_store_instruction(instruction_t instr)
    8588{
    8689        /* load store immediate offset */
    87         if (instr.type == 0x2) {
    88                 return true;
    89         }
    90 
     90        if (instr.type == 0x2)
     91                return true;
     92       
    9193        /* load store register offset */
    92         if (instr.type == 0x3 && instr.bit4 == 0) {
    93                 return true;
    94         }
    95 
     94        if ((instr.type == 0x3) && (instr.bit4 == 0))
     95                return true;
     96       
    9697        /* load store multiple */
    97         if (instr.type == 0x4) {
    98                 return true;
    99         }
    100 
     98        if (instr.type == 0x4)
     99                return true;
     100       
    101101        /* oprocessor load/store */
    102         if (instr.type == 0x6) {
    103                 return true;
    104         }
    105 
     102        if (instr.type == 0x6)
     103                return true;
     104       
    106105        return false;
    107106}
     
    116115{
    117116        /* swap, swapb instruction */
    118         if (instr.type == 0x0 &&
    119             (instr.opcode == 0x8 || instr.opcode == 0xa) &&
    120             instr.access == 0x0 && instr.bits567 == 0x4 && instr.bit4 == 1) {
    121                 return true;
    122         }
    123 
     117        if ((instr.type == 0x0) &&
     118            ((instr.opcode == 0x8) || (instr.opcode == 0xa)) &&
     119            (instr.access == 0x0) && (instr.bits567 == 0x4) && (instr.bit4 == 1))
     120                return true;
     121       
    124122        return false;
    125123}
Note: See TracChangeset for help on using the changeset viewer.