Changeset da1bafb in mainline for kernel/arch/ppc32/include/asm.h


Ignore:
Timestamp:
2010-05-24T18:57:31Z (14 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0095368
Parents:
666f492
Message:

major code revision

  • replace spinlocks taken with interrupts disabled with irq_spinlocks
  • change spacing (not indendation) to be tab-size independent
  • use unsigned integer types where appropriate (especially bit flags)
  • visual separation
  • remove argument names in function prototypes
  • string changes
  • correct some formating directives
  • replace various cryptic single-character variables (t, a, m, c, b, etc.) with proper identifiers (thread, task, timeout, as, itm, itc, etc.)
  • unify some assembler constructs
  • unused page table levels are now optimized out in compile time
  • replace several ints (with boolean semantics) with bools
  • use specifically sized types instead of generic types where appropriate (size_t, uint32_t, btree_key_t)
  • improve comments
  • split asserts with conjuction into multiple independent asserts
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ppc32/include/asm.h

    r666f492 rda1bafb  
    3939#include <config.h>
    4040#include <arch/cpu.h>
     41#include <arch/mm/asid.h>
    4142
    4243static inline uint32_t msr_read(void)
     
    5859                :: [msr] "r" (msr)
    5960        );
     61}
     62
     63static inline void sr_set(uint32_t flags, asid_t asid, uint32_t sr)
     64{
     65        asm volatile (
     66                "mtsrin %[value], %[sr]\n"
     67                :: [value] "r" ((flags << 16) + (asid << 4) + sr),
     68                   [sr] "r" (sr << 28)
     69        );
     70}
     71
     72static inline uint32_t sr_get(uint32_t vaddr)
     73{
     74        uint32_t vsid;
     75       
     76        asm volatile (
     77                "mfsrin %[vsid], %[vaddr]\n"
     78                : [vsid] "=r" (vsid)
     79                : [vaddr] "r" (vaddr)
     80        );
     81       
     82        return vsid;
     83}
     84
     85static inline uint32_t sdr1_get(void)
     86{
     87        uint32_t sdr1;
     88       
     89        asm volatile (
     90                "mfsdr1 %[sdr1]\n"
     91                : [sdr1] "=r" (sdr1)
     92        );
     93       
     94        return sdr1;
    6095}
    6196
Note: See TracChangeset for help on using the changeset viewer.