Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 3500f75 in mainline for kernel/arch/ppc32/include/cpu.h


Ignore:
Timestamp:
2010-05-21T22:50:45Z (12 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master
Children:
7c8e1e1
Parents:
339249f
Message:

ppc32: add interrupts_disabled(), simplify CPU identification

File:
1 edited

Legend:

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

    r339249f r3500f75  
    3636#define KERN_ppc32_CPU_H_
    3737
    38 #include <arch/asm.h>
     38/* MSR bits */
     39#define MSR_DR  (1 << 4)
     40#define MSR_IR  (1 << 5)
     41#define MSR_PR  (1 << 14)
     42#define MSR_EE  (1 << 15)
     43
     44/* HID0 bits */
     45#define HID0_STEN  (1 << 24)
     46#define HID0_ICE   (1 << 15)
     47#define HID0_DCE   (1 << 14)
     48#define HID0_ICFI  (1 << 11)
     49#define HID0_DCI   (1 << 10)
     50
     51#ifndef __ASM__
     52
     53#include <typedefs.h>
    3954
    4055typedef struct {
    41         int version;
    42         int revision;
    43 } cpu_arch_t;
    44        
     56        uint16_t version;
     57        uint16_t revision;
     58} __attribute__ ((packed)) cpu_arch_t;
     59
     60static inline void cpu_version(cpu_arch_t *info)
     61{
     62        asm volatile (
     63                "mfpvr %[cpu_info]\n"
     64                : [cpu_info] "=r" (*info)
     65        );
     66}
     67
     68#endif /* __ASM__ */
     69
    4570#endif
    4671
Note: See TracChangeset for help on using the changeset viewer.