2 * Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
30 #include <chud/ppc/chud_spr.h>
32 #include <mach/kern_return.h>
35 * kern_return_t mfspr64(uint64_t *val, int spr);
37 * r3: address to store value in
38 * r4: spr to read from
42 ; Force a line boundry here
47 ;; generic PPC 64-bit wide SPRs
48 cmpwi r4,chud_ppc_srr0
50 cmpwi r4,chud_ppc_srr1
54 cmpwi r4,chud_ppc_sdr1
56 cmpwi r4,chud_ppc_sprg0
58 cmpwi r4,chud_ppc_sprg1
60 cmpwi r4,chud_ppc_sprg2
62 cmpwi r4,chud_ppc_sprg3
64 cmpwi r4,chud_ppc64_asr
66 cmpwi r4,chud_ppc_dabr
69 ;; GPUL specific 64-bit wide SPRs
70 cmpwi r4,chud_970_hid0
72 cmpwi r4,chud_970_hid1
74 cmpwi r4,chud_970_hid4
76 cmpwi r4,chud_970_hid5
78 cmpwi r4,chud_970_mmcr0
80 cmpwi r4,chud_970_mmcr1
82 cmpwi r4,chud_970_mmcra
84 cmpwi r4,chud_970_siar
86 cmpwi r4,chud_970_sdar
90 cmpwi r4,chud_970_rmor
92 cmpwi r4,chud_970_hrmor
94 cmpwi r4,chud_970_hior
96 cmpwi r4,chud_970_lpidr
98 cmpwi r4,chud_970_lpcr
100 cmpwi r4,chud_970_dabrx
102 cmpwi r4,chud_970_hsprg0
104 cmpwi r4,chud_970_hsprg1
106 cmpwi r4,chud_970_hsrr0
108 cmpwi r4,chud_970_hsrr1
110 cmpwi r4,chud_970_hdec
112 cmpwi r4,chud_970_trig0
114 cmpwi r4,chud_970_trig1
116 cmpwi r4,chud_970_trig2
118 cmpwi r4,chud_ppc64_accr
120 cmpwi r4,chud_970_scomc
122 cmpwi r4,chud_970_scomd
128 mfspr r5,chud_ppc_srr0
132 mfspr r5,chud_ppc_srr1
136 mfspr r5,chud_ppc_dar
140 mfspr r5,chud_ppc_sdr1
144 mfspr r5,chud_ppc_sprg0
148 mfspr r5,chud_ppc_sprg1
152 mfspr r5,chud_ppc_sprg2
156 mfspr r5,chud_ppc_sprg3
160 mfspr r5,chud_ppc64_asr
164 mfspr r5,chud_ppc_dabr
168 mfspr r5,chud_970_hid0
172 mfspr r5,chud_970_hid1
176 mfspr r5,chud_970_hid4
180 mfspr r5,chud_970_hid5
184 mfspr r5,chud_970_mmcr0
188 mfspr r5,chud_970_mmcr1
192 mfspr r5,chud_970_mmcra
196 mfspr r5,chud_970_siar
200 mfspr r5,chud_970_sdar
204 mfspr r5,chud_970_imc
208 mfspr r5,chud_970_rmor
212 mfspr r5,chud_970_hrmor
216 mfspr r5,chud_970_hior
220 mfspr r5,chud_970_lpidr
224 mfspr r5,chud_970_lpcr
228 mfspr r5,chud_970_dabrx
232 mfspr r5,chud_970_hsprg0
236 mfspr r5,chud_970_hsprg1
240 mfspr r5,chud_970_hsrr0
244 mfspr r5,chud_970_hsrr1
248 mfspr r5,chud_970_hdec
252 mfspr r5,chud_970_trig0
256 mfspr r5,chud_970_trig1
260 mfspr r5,chud_970_trig2
264 mfspr r5,chud_ppc64_accr
268 mfspr r5,chud_970_scomc
272 mfspr r5,chud_970_scomd
286 * kern_return_t mtspr64(int spr, uint64_t *val);
288 * r3: spr to write to
289 * r4: address to get value from
293 ; Force a line boundry here
298 ;; generic PPC 64-bit wide SPRs
299 cmpwi r3,chud_ppc_srr0
301 cmpwi r3,chud_ppc_srr1
303 cmpwi r3,chud_ppc_dar
305 cmpwi r3,chud_ppc_sdr1
307 cmpwi r3,chud_ppc_sprg0
309 cmpwi r3,chud_ppc_sprg1
311 cmpwi r3,chud_ppc_sprg2
313 cmpwi r3,chud_ppc_sprg3
315 cmpwi r3,chud_ppc64_asr
317 cmpwi r3,chud_ppc_dabr
320 ;; GPUL specific 64-bit wide SPRs
321 cmpwi r3,chud_970_hid0
323 cmpwi r3,chud_970_hid1
325 cmpwi r3,chud_970_hid4
327 cmpwi r3,chud_970_hid5
329 cmpwi r3,chud_970_mmcr0
331 cmpwi r3,chud_970_mmcr1
333 cmpwi r3,chud_970_mmcra
335 cmpwi r3,chud_970_siar
337 cmpwi r3,chud_970_sdar
339 cmpwi r3,chud_970_imc
341 cmpwi r3,chud_970_rmor
343 cmpwi r3,chud_970_hrmor
345 cmpwi r3,chud_970_hior
347 cmpwi r3,chud_970_lpidr
349 cmpwi r3,chud_970_lpcr
351 cmpwi r3,chud_970_dabrx
353 cmpwi r3,chud_970_hsprg0
355 cmpwi r3,chud_970_hsprg1
357 cmpwi r3,chud_970_hsrr0
359 cmpwi r3,chud_970_hsrr1
361 cmpwi r3,chud_970_hdec
363 cmpwi r3,chud_970_trig0
365 cmpwi r3,chud_970_trig1
367 cmpwi r3,chud_970_trig2
369 cmpwi r3,chud_ppc64_accr
371 cmpwi r3,chud_970_scomc
373 cmpwi r3,chud_970_scomd
380 mtspr chud_ppc_srr0,r5
384 mtspr chud_ppc_srr1,r5
388 mtspr chud_ppc_dar,r5
392 mtspr chud_ppc_sdr1,r5
396 mtspr chud_ppc_sprg0,r5
400 mtspr chud_ppc_sprg1,r5
404 mtspr chud_ppc_sprg2,r5
408 mtspr chud_ppc_sprg3,r5
412 mtspr chud_ppc64_asr,r5
416 mtspr chud_ppc_dabr,r5
421 mtspr chud_970_hid0,r5
422 mfspr r5,chud_970_hid0 /* syncronization requirements */
423 mfspr r5,chud_970_hid0
424 mfspr r5,chud_970_hid0
425 mfspr r5,chud_970_hid0
426 mfspr r5,chud_970_hid0
427 mfspr r5,chud_970_hid0
431 mtspr chud_970_hid1,r5 /* tell you twice */
432 mtspr chud_970_hid1,r5
437 sync /* syncronization requirements */
438 mtspr chud_970_hid4,r5
443 mtspr chud_970_hid5,r5
447 mtspr chud_970_mmcr0,r5
451 mtspr chud_970_mmcr1,r5
455 mtspr chud_970_mmcra,r5
459 mtspr chud_970_siar,r5
463 mtspr chud_970_sdar,r5
467 mtspr chud_970_imc,r5
471 mtspr chud_970_rmor,r5
475 mtspr chud_970_hrmor,r5
479 mtspr chud_970_hior,r5
483 mtspr chud_970_lpidr,r5
487 mtspr chud_970_lpcr,r5
491 mtspr chud_970_dabrx,r5
495 mtspr chud_970_hsprg0,r5
499 mtspr chud_970_hsprg1,r5
503 mtspr chud_970_hsrr0,r5
507 mtspr chud_970_hsrr1,r5
511 mtspr chud_970_hdec,r5
515 mtspr chud_970_trig0,r5
519 mtspr chud_970_trig1,r5
523 mtspr chud_970_trig2,r5
527 mtspr chud_ppc64_accr,r5
531 mtspr chud_970_scomc,r5
535 mtspr chud_970_scomd,r5
548 * kern_return_t mfmsr64(uint64_t *val);
550 * r3: address to store value in
554 ; Force a line boundry here
571 * kern_return_t mtmsr64(uint64_t *val);
573 * r3: address to load value from
577 ; Force a line boundry here