Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 #ifndef _PPC_BOOT_REG_H
0003 #define _PPC_BOOT_REG_H
0004 /*
0005  * Copyright 2007 Davud Gibson, IBM Corporation.
0006  */
0007 
0008 static inline u32 mfpvr(void)
0009 {
0010     u32 pvr;
0011     asm volatile ("mfpvr    %0" : "=r"(pvr));
0012     return pvr;
0013 }
0014 
0015 #define __stringify_1(x)    #x
0016 #define __stringify(x)      __stringify_1(x)
0017 
0018 #define mfspr(rn)   ({unsigned long rval; \
0019             asm volatile("mfspr %0," __stringify(rn) \
0020                 : "=r" (rval)); rval; })
0021 #define mtspr(rn, v)    asm volatile("mtspr " __stringify(rn) ",%0" : : "r" (v))
0022 
0023 register void *__stack_pointer asm("r1");
0024 #define get_sp()    (__stack_pointer)
0025 
0026 #endif  /* _PPC_BOOT_REG_H */