.. | .. |
---|
311 | 311 | addis reg,reg,(name - 0b)@ha; \ |
---|
312 | 312 | addi reg,reg,(name - 0b)@l; |
---|
313 | 313 | |
---|
314 | | -#ifdef __powerpc64__ |
---|
315 | | -#ifdef HAVE_AS_ATHIGH |
---|
| 314 | +#if defined(__powerpc64__) && defined(HAVE_AS_ATHIGH) |
---|
316 | 315 | #define __AS_ATHIGH high |
---|
317 | 316 | #else |
---|
318 | 317 | #define __AS_ATHIGH h |
---|
319 | 318 | #endif |
---|
320 | | -#define LOAD_REG_IMMEDIATE(reg,expr) \ |
---|
321 | | - lis reg,(expr)@highest; \ |
---|
322 | | - ori reg,reg,(expr)@higher; \ |
---|
323 | | - rldicr reg,reg,32,31; \ |
---|
324 | | - oris reg,reg,(expr)@__AS_ATHIGH; \ |
---|
325 | | - ori reg,reg,(expr)@l; |
---|
| 319 | + |
---|
| 320 | +.macro __LOAD_REG_IMMEDIATE_32 r, x |
---|
| 321 | + .if (\x) >= 0x8000 || (\x) < -0x8000 |
---|
| 322 | + lis \r, (\x)@__AS_ATHIGH |
---|
| 323 | + .if (\x) & 0xffff != 0 |
---|
| 324 | + ori \r, \r, (\x)@l |
---|
| 325 | + .endif |
---|
| 326 | + .else |
---|
| 327 | + li \r, (\x)@l |
---|
| 328 | + .endif |
---|
| 329 | +.endm |
---|
| 330 | + |
---|
| 331 | +.macro __LOAD_REG_IMMEDIATE r, x |
---|
| 332 | + .if (\x) >= 0x80000000 || (\x) < -0x80000000 |
---|
| 333 | + __LOAD_REG_IMMEDIATE_32 \r, (\x) >> 32 |
---|
| 334 | + sldi \r, \r, 32 |
---|
| 335 | + .if (\x) & 0xffff0000 != 0 |
---|
| 336 | + oris \r, \r, (\x)@__AS_ATHIGH |
---|
| 337 | + .endif |
---|
| 338 | + .if (\x) & 0xffff != 0 |
---|
| 339 | + ori \r, \r, (\x)@l |
---|
| 340 | + .endif |
---|
| 341 | + .else |
---|
| 342 | + __LOAD_REG_IMMEDIATE_32 \r, \x |
---|
| 343 | + .endif |
---|
| 344 | +.endm |
---|
| 345 | + |
---|
| 346 | +#ifdef __powerpc64__ |
---|
| 347 | + |
---|
| 348 | +#define LOAD_REG_IMMEDIATE(reg, expr) __LOAD_REG_IMMEDIATE reg, expr |
---|
| 349 | + |
---|
| 350 | +#define LOAD_REG_IMMEDIATE_SYM(reg, tmp, expr) \ |
---|
| 351 | + lis tmp, (expr)@highest; \ |
---|
| 352 | + lis reg, (expr)@__AS_ATHIGH; \ |
---|
| 353 | + ori tmp, tmp, (expr)@higher; \ |
---|
| 354 | + ori reg, reg, (expr)@l; \ |
---|
| 355 | + rldimi reg, tmp, 32, 0 |
---|
326 | 356 | |
---|
327 | 357 | #define LOAD_REG_ADDR(reg,name) \ |
---|
328 | 358 | ld reg,name@got(r2) |
---|
.. | .. |
---|
335 | 365 | |
---|
336 | 366 | #else /* 32-bit */ |
---|
337 | 367 | |
---|
338 | | -#define LOAD_REG_IMMEDIATE(reg,expr) \ |
---|
| 368 | +#define LOAD_REG_IMMEDIATE(reg, expr) __LOAD_REG_IMMEDIATE_32 reg, expr |
---|
| 369 | + |
---|
| 370 | +#define LOAD_REG_IMMEDIATE_SYM(reg,expr) \ |
---|
339 | 371 | lis reg,(expr)@ha; \ |
---|
340 | 372 | addi reg,reg,(expr)@l; |
---|
341 | 373 | |
---|
342 | | -#define LOAD_REG_ADDR(reg,name) LOAD_REG_IMMEDIATE(reg, name) |
---|
| 374 | +#define LOAD_REG_ADDR(reg,name) LOAD_REG_IMMEDIATE_SYM(reg, name) |
---|
343 | 375 | |
---|
344 | 376 | #define LOAD_REG_ADDRBASE(reg, name) lis reg,name@ha |
---|
345 | 377 | #define ADDROFF(name) name@l |
---|
.. | .. |
---|
350 | 382 | #endif |
---|
351 | 383 | |
---|
352 | 384 | /* various errata or part fixups */ |
---|
353 | | -#ifdef CONFIG_PPC601_SYNC_FIX |
---|
354 | | -#define SYNC \ |
---|
355 | | -BEGIN_FTR_SECTION \ |
---|
356 | | - sync; \ |
---|
357 | | - isync; \ |
---|
358 | | -END_FTR_SECTION_IFSET(CPU_FTR_601) |
---|
359 | | -#define SYNC_601 \ |
---|
360 | | -BEGIN_FTR_SECTION \ |
---|
361 | | - sync; \ |
---|
362 | | -END_FTR_SECTION_IFSET(CPU_FTR_601) |
---|
363 | | -#define ISYNC_601 \ |
---|
364 | | -BEGIN_FTR_SECTION \ |
---|
365 | | - isync; \ |
---|
366 | | -END_FTR_SECTION_IFSET(CPU_FTR_601) |
---|
367 | | -#else |
---|
368 | | -#define SYNC |
---|
369 | | -#define SYNC_601 |
---|
370 | | -#define ISYNC_601 |
---|
371 | | -#endif |
---|
372 | | - |
---|
373 | 385 | #if defined(CONFIG_PPC_CELL) || defined(CONFIG_PPC_FSL_BOOK3E) |
---|
374 | 386 | #define MFTB(dest) \ |
---|
375 | 387 | 90: mfspr dest, SPRN_TBRL; \ |
---|
.. | .. |
---|
391 | 403 | |
---|
392 | 404 | #ifndef CONFIG_SMP |
---|
393 | 405 | #define TLBSYNC |
---|
394 | | -#else /* CONFIG_SMP */ |
---|
395 | | -/* tlbsync is not implemented on 601 */ |
---|
396 | | -#define TLBSYNC \ |
---|
397 | | -BEGIN_FTR_SECTION \ |
---|
398 | | - tlbsync; \ |
---|
399 | | - sync; \ |
---|
400 | | -END_FTR_SECTION_IFCLR(CPU_FTR_601) |
---|
| 406 | +#else |
---|
| 407 | +#define TLBSYNC tlbsync; sync |
---|
401 | 408 | #endif |
---|
402 | 409 | |
---|
403 | 410 | #ifdef CONFIG_PPC64 |
---|
.. | .. |
---|
480 | 487 | ori rd,rd,((KERNELBASE>>48)&0xFFFF);\ |
---|
481 | 488 | rotldi rd,rd,48 |
---|
482 | 489 | #else |
---|
483 | | -/* |
---|
484 | | - * On APUS (Amiga PowerPC cpu upgrade board), we don't know the |
---|
485 | | - * physical base address of RAM at compile time. |
---|
486 | | - */ |
---|
487 | 490 | #define toreal(rd) tophys(rd,rd) |
---|
488 | 491 | #define fromreal(rd) tovirt(rd,rd) |
---|
489 | 492 | |
---|
490 | | -#define tophys(rd,rs) \ |
---|
491 | | -0: addis rd,rs,-PAGE_OFFSET@h; \ |
---|
492 | | - .section ".vtop_fixup","aw"; \ |
---|
493 | | - .align 1; \ |
---|
494 | | - .long 0b; \ |
---|
495 | | - .previous |
---|
496 | | - |
---|
497 | | -#define tovirt(rd,rs) \ |
---|
498 | | -0: addis rd,rs,PAGE_OFFSET@h; \ |
---|
499 | | - .section ".ptov_fixup","aw"; \ |
---|
500 | | - .align 1; \ |
---|
501 | | - .long 0b; \ |
---|
502 | | - .previous |
---|
| 493 | +#define tophys(rd, rs) addis rd, rs, -PAGE_OFFSET@h |
---|
| 494 | +#define tovirt(rd, rs) addis rd, rs, PAGE_OFFSET@h |
---|
503 | 495 | #endif |
---|
504 | 496 | |
---|
505 | 497 | #ifdef CONFIG_PPC_BOOK3S_64 |
---|
.. | .. |
---|
752 | 744 | #define N_SLINE 68 |
---|
753 | 745 | #define N_SO 100 |
---|
754 | 746 | |
---|
| 747 | +#define RFSCV .long 0x4c0000a4 |
---|
| 748 | + |
---|
755 | 749 | /* |
---|
756 | 750 | * Create an endian fixup trampoline |
---|
757 | 751 | * |
---|
.. | .. |
---|
771 | 765 | #define FIXUP_ENDIAN |
---|
772 | 766 | #else |
---|
773 | 767 | /* |
---|
774 | | - * This version may be used in in HV or non-HV context. |
---|
| 768 | + * This version may be used in HV or non-HV context. |
---|
775 | 769 | * MSR[EE] must be disabled. |
---|
776 | 770 | */ |
---|
777 | 771 | #define FIXUP_ENDIAN \ |
---|