diff options
Diffstat (limited to 'include/asm-parisc/assembly.h')
-rw-r--r-- | include/asm-parisc/assembly.h | 71 |
1 files changed, 63 insertions, 8 deletions
diff --git a/include/asm-parisc/assembly.h b/include/asm-parisc/assembly.h index 30b023411fef..3ce3440d1b0c 100644 --- a/include/asm-parisc/assembly.h +++ b/include/asm-parisc/assembly.h | |||
@@ -21,7 +21,9 @@ | |||
21 | #ifndef _PARISC_ASSEMBLY_H | 21 | #ifndef _PARISC_ASSEMBLY_H |
22 | #define _PARISC_ASSEMBLY_H | 22 | #define _PARISC_ASSEMBLY_H |
23 | 23 | ||
24 | #ifdef __LP64__ | 24 | #define CALLEE_FLOAT_FRAME_SIZE 80 |
25 | |||
26 | #ifdef CONFIG_64BIT | ||
25 | #define LDREG ldd | 27 | #define LDREG ldd |
26 | #define STREG std | 28 | #define STREG std |
27 | #define LDREGX ldd,s | 29 | #define LDREGX ldd,s |
@@ -30,8 +32,8 @@ | |||
30 | #define SHRREG shrd | 32 | #define SHRREG shrd |
31 | #define RP_OFFSET 16 | 33 | #define RP_OFFSET 16 |
32 | #define FRAME_SIZE 128 | 34 | #define FRAME_SIZE 128 |
33 | #define CALLEE_SAVE_FRAME_SIZE 144 | 35 | #define CALLEE_REG_FRAME_SIZE 144 |
34 | #else | 36 | #else /* CONFIG_64BIT */ |
35 | #define LDREG ldw | 37 | #define LDREG ldw |
36 | #define STREG stw | 38 | #define STREG stw |
37 | #define LDREGX ldwx,s | 39 | #define LDREGX ldwx,s |
@@ -40,9 +42,11 @@ | |||
40 | #define SHRREG shr | 42 | #define SHRREG shr |
41 | #define RP_OFFSET 20 | 43 | #define RP_OFFSET 20 |
42 | #define FRAME_SIZE 64 | 44 | #define FRAME_SIZE 64 |
43 | #define CALLEE_SAVE_FRAME_SIZE 128 | 45 | #define CALLEE_REG_FRAME_SIZE 128 |
44 | #endif | 46 | #endif |
45 | 47 | ||
48 | #define CALLEE_SAVE_FRAME_SIZE (CALLEE_REG_FRAME_SIZE + CALLEE_FLOAT_FRAME_SIZE) | ||
49 | |||
46 | #ifdef CONFIG_PA20 | 50 | #ifdef CONFIG_PA20 |
47 | #define BL b,l | 51 | #define BL b,l |
48 | # ifdef CONFIG_64BIT | 52 | # ifdef CONFIG_64BIT |
@@ -300,9 +304,35 @@ | |||
300 | fldd,mb -8(\regs), %fr0 | 304 | fldd,mb -8(\regs), %fr0 |
301 | .endm | 305 | .endm |
302 | 306 | ||
307 | .macro callee_save_float | ||
308 | fstd,ma %fr12, 8(%r30) | ||
309 | fstd,ma %fr13, 8(%r30) | ||
310 | fstd,ma %fr14, 8(%r30) | ||
311 | fstd,ma %fr15, 8(%r30) | ||
312 | fstd,ma %fr16, 8(%r30) | ||
313 | fstd,ma %fr17, 8(%r30) | ||
314 | fstd,ma %fr18, 8(%r30) | ||
315 | fstd,ma %fr19, 8(%r30) | ||
316 | fstd,ma %fr20, 8(%r30) | ||
317 | fstd,ma %fr21, 8(%r30) | ||
318 | .endm | ||
319 | |||
320 | .macro callee_rest_float | ||
321 | fldd,mb -8(%r30), %fr21 | ||
322 | fldd,mb -8(%r30), %fr20 | ||
323 | fldd,mb -8(%r30), %fr19 | ||
324 | fldd,mb -8(%r30), %fr18 | ||
325 | fldd,mb -8(%r30), %fr17 | ||
326 | fldd,mb -8(%r30), %fr16 | ||
327 | fldd,mb -8(%r30), %fr15 | ||
328 | fldd,mb -8(%r30), %fr14 | ||
329 | fldd,mb -8(%r30), %fr13 | ||
330 | fldd,mb -8(%r30), %fr12 | ||
331 | .endm | ||
332 | |||
303 | #ifdef __LP64__ | 333 | #ifdef __LP64__ |
304 | .macro callee_save | 334 | .macro callee_save |
305 | std,ma %r3, CALLEE_SAVE_FRAME_SIZE(%r30) | 335 | std,ma %r3, CALLEE_REG_FRAME_SIZE(%r30) |
306 | mfctl %cr27, %r3 | 336 | mfctl %cr27, %r3 |
307 | std %r4, -136(%r30) | 337 | std %r4, -136(%r30) |
308 | std %r5, -128(%r30) | 338 | std %r5, -128(%r30) |
@@ -340,13 +370,13 @@ | |||
340 | ldd -128(%r30), %r5 | 370 | ldd -128(%r30), %r5 |
341 | ldd -136(%r30), %r4 | 371 | ldd -136(%r30), %r4 |
342 | mtctl %r3, %cr27 | 372 | mtctl %r3, %cr27 |
343 | ldd,mb -CALLEE_SAVE_FRAME_SIZE(%r30), %r3 | 373 | ldd,mb -CALLEE_REG_FRAME_SIZE(%r30), %r3 |
344 | .endm | 374 | .endm |
345 | 375 | ||
346 | #else /* ! __LP64__ */ | 376 | #else /* ! __LP64__ */ |
347 | 377 | ||
348 | .macro callee_save | 378 | .macro callee_save |
349 | stw,ma %r3, CALLEE_SAVE_FRAME_SIZE(%r30) | 379 | stw,ma %r3, CALLEE_REG_FRAME_SIZE(%r30) |
350 | mfctl %cr27, %r3 | 380 | mfctl %cr27, %r3 |
351 | stw %r4, -124(%r30) | 381 | stw %r4, -124(%r30) |
352 | stw %r5, -120(%r30) | 382 | stw %r5, -120(%r30) |
@@ -384,7 +414,7 @@ | |||
384 | ldw -120(%r30), %r5 | 414 | ldw -120(%r30), %r5 |
385 | ldw -124(%r30), %r4 | 415 | ldw -124(%r30), %r4 |
386 | mtctl %r3, %cr27 | 416 | mtctl %r3, %cr27 |
387 | ldw,mb -CALLEE_SAVE_FRAME_SIZE(%r30), %r3 | 417 | ldw,mb -CALLEE_REG_FRAME_SIZE(%r30), %r3 |
388 | .endm | 418 | .endm |
389 | #endif /* ! __LP64__ */ | 419 | #endif /* ! __LP64__ */ |
390 | 420 | ||
@@ -450,5 +480,30 @@ | |||
450 | REST_CR (%cr22, PT_PSW (\regs)) | 480 | REST_CR (%cr22, PT_PSW (\regs)) |
451 | .endm | 481 | .endm |
452 | 482 | ||
483 | |||
484 | /* First step to create a "relied upon translation" | ||
485 | * See PA 2.0 Arch. page F-4 and F-5. | ||
486 | * | ||
487 | * The ssm was originally necessary due to a "PCxT bug". | ||
488 | * But someone decided it needed to be added to the architecture | ||
489 | * and this "feature" went into rev3 of PA-RISC 1.1 Arch Manual. | ||
490 | * It's been carried forward into PA 2.0 Arch as well. :^( | ||
491 | * | ||
492 | * "ssm 0,%r0" is a NOP with side effects (prefetch barrier). | ||
493 | * rsm/ssm prevents the ifetch unit from speculatively fetching | ||
494 | * instructions past this line in the code stream. | ||
495 | * PA 2.0 processor will single step all insn in the same QUAD (4 insn). | ||
496 | */ | ||
497 | .macro pcxt_ssm_bug | ||
498 | rsm PSW_SM_I,%r0 | ||
499 | nop /* 1 */ | ||
500 | nop /* 2 */ | ||
501 | nop /* 3 */ | ||
502 | nop /* 4 */ | ||
503 | nop /* 5 */ | ||
504 | nop /* 6 */ | ||
505 | nop /* 7 */ | ||
506 | .endm | ||
507 | |||
453 | #endif /* __ASSEMBLY__ */ | 508 | #endif /* __ASSEMBLY__ */ |
454 | #endif | 509 | #endif |