2 * This file is part of the LinuxBIOS project.
4 * Copyright (C) 2000 AG Electronics Ltd.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 unsigned ppc_getmsr(void)
26 __asm__ volatile ("mfmsr %0" : "=r" (result));
30 unsigned ppc_gethid0(void)
33 __asm__ volatile ("mfspr %0,1008" : "=r" (result));
37 unsigned ppc_gethid1(void)
40 __asm__ volatile ("mfspr %0,1009" : "=r" (result));
44 void ppc_sethid0(unsigned value)
46 __asm__ volatile ("mtspr 1008,%0" : : "r" (value));
49 unsigned ppc_getpvr(void)
52 __asm__("mfspr %0, 287" : "=r" (result));
56 void ppc_setmsr(unsigned value)
58 __asm__ volatile ("mtmsr %0; sync" :: "r" (value));
61 void ppc_set1015(unsigned value)
63 __asm__ volatile ("mtspr 1015,%0" : : "r" (value));