diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-ia64/sn/sn_sal.h | 65 |
1 files changed, 46 insertions, 19 deletions
diff --git a/include/asm-ia64/sn/sn_sal.h b/include/asm-ia64/sn/sn_sal.h index f914f6da077c..56d74ca76b5d 100644 --- a/include/asm-ia64/sn/sn_sal.h +++ b/include/asm-ia64/sn/sn_sal.h | |||
@@ -557,7 +557,8 @@ static inline u64 | |||
557 | ia64_sn_partition_serial_get(void) | 557 | ia64_sn_partition_serial_get(void) |
558 | { | 558 | { |
559 | struct ia64_sal_retval ret_stuff; | 559 | struct ia64_sal_retval ret_stuff; |
560 | SAL_CALL(ret_stuff, SN_SAL_PARTITION_SERIAL_GET, 0, 0, 0, 0, 0, 0, 0); | 560 | ia64_sal_oemcall_reentrant(&ret_stuff, SN_SAL_PARTITION_SERIAL_GET, 0, |
561 | 0, 0, 0, 0, 0, 0); | ||
561 | if (ret_stuff.status != 0) | 562 | if (ret_stuff.status != 0) |
562 | return 0; | 563 | return 0; |
563 | return ret_stuff.v0; | 564 | return ret_stuff.v0; |
@@ -565,11 +566,10 @@ ia64_sn_partition_serial_get(void) | |||
565 | 566 | ||
566 | static inline u64 | 567 | static inline u64 |
567 | sn_partition_serial_number_val(void) { | 568 | sn_partition_serial_number_val(void) { |
568 | if (sn_partition_serial_number) { | 569 | if (unlikely(sn_partition_serial_number == 0)) { |
569 | return(sn_partition_serial_number); | 570 | sn_partition_serial_number = ia64_sn_partition_serial_get(); |
570 | } else { | ||
571 | return(sn_partition_serial_number = ia64_sn_partition_serial_get()); | ||
572 | } | 571 | } |
572 | return sn_partition_serial_number; | ||
573 | } | 573 | } |
574 | 574 | ||
575 | /* | 575 | /* |
@@ -580,8 +580,8 @@ static inline partid_t | |||
580 | ia64_sn_sysctl_partition_get(nasid_t nasid) | 580 | ia64_sn_sysctl_partition_get(nasid_t nasid) |
581 | { | 581 | { |
582 | struct ia64_sal_retval ret_stuff; | 582 | struct ia64_sal_retval ret_stuff; |
583 | SAL_CALL(ret_stuff, SN_SAL_SYSCTL_PARTITION_GET, nasid, | 583 | ia64_sal_oemcall_nolock(&ret_stuff, SN_SAL_SYSCTL_PARTITION_GET, nasid, |
584 | 0, 0, 0, 0, 0, 0); | 584 | 0, 0, 0, 0, 0, 0); |
585 | if (ret_stuff.status != 0) | 585 | if (ret_stuff.status != 0) |
586 | return INVALID_PARTID; | 586 | return INVALID_PARTID; |
587 | return ((partid_t)ret_stuff.v0); | 587 | return ((partid_t)ret_stuff.v0); |
@@ -595,11 +595,38 @@ extern partid_t sn_partid; | |||
595 | 595 | ||
596 | static inline partid_t | 596 | static inline partid_t |
597 | sn_local_partid(void) { | 597 | sn_local_partid(void) { |
598 | if (sn_partid < 0) { | 598 | if (unlikely(sn_partid < 0)) { |
599 | return (sn_partid = ia64_sn_sysctl_partition_get(cpuid_to_nasid(smp_processor_id()))); | 599 | sn_partid = ia64_sn_sysctl_partition_get(cpuid_to_nasid(smp_processor_id())); |
600 | } else { | ||
601 | return sn_partid; | ||
602 | } | 600 | } |
601 | return sn_partid; | ||
602 | } | ||
603 | |||
604 | /* | ||
605 | * Returns the physical address of the partition's reserved page through | ||
606 | * an iterative number of calls. | ||
607 | * | ||
608 | * On first call, 'cookie' and 'len' should be set to 0, and 'addr' | ||
609 | * set to the nasid of the partition whose reserved page's address is | ||
610 | * being sought. | ||
611 | * On subsequent calls, pass the values, that were passed back on the | ||
612 | * previous call. | ||
613 | * | ||
614 | * While the return status equals SALRET_MORE_PASSES, keep calling | ||
615 | * this function after first copying 'len' bytes starting at 'addr' | ||
616 | * into 'buf'. Once the return status equals SALRET_OK, 'addr' will | ||
617 | * be the physical address of the partition's reserved page. If the | ||
618 | * return status equals neither of these, an error as occurred. | ||
619 | */ | ||
620 | static inline s64 | ||
621 | sn_partition_reserved_page_pa(u64 buf, u64 *cookie, u64 *addr, u64 *len) | ||
622 | { | ||
623 | struct ia64_sal_retval rv; | ||
624 | ia64_sal_oemcall_reentrant(&rv, SN_SAL_GET_PARTITION_ADDR, *cookie, | ||
625 | *addr, buf, *len, 0, 0, 0); | ||
626 | *cookie = rv.v0; | ||
627 | *addr = rv.v1; | ||
628 | *len = rv.v2; | ||
629 | return rv.status; | ||
603 | } | 630 | } |
604 | 631 | ||
605 | /* | 632 | /* |
@@ -621,8 +648,8 @@ static inline int | |||
621 | sn_register_xp_addr_region(u64 paddr, u64 len, int operation) | 648 | sn_register_xp_addr_region(u64 paddr, u64 len, int operation) |
622 | { | 649 | { |
623 | struct ia64_sal_retval ret_stuff; | 650 | struct ia64_sal_retval ret_stuff; |
624 | SAL_CALL(ret_stuff, SN_SAL_XP_ADDR_REGION, paddr, len, (u64)operation, | 651 | ia64_sal_oemcall(&ret_stuff, SN_SAL_XP_ADDR_REGION, paddr, len, |
625 | 0, 0, 0, 0); | 652 | (u64)operation, 0, 0, 0, 0); |
626 | return ret_stuff.status; | 653 | return ret_stuff.status; |
627 | } | 654 | } |
628 | 655 | ||
@@ -646,8 +673,8 @@ sn_register_nofault_code(u64 start_addr, u64 end_addr, u64 return_addr, | |||
646 | } else { | 673 | } else { |
647 | call = SN_SAL_NO_FAULT_ZONE_PHYSICAL; | 674 | call = SN_SAL_NO_FAULT_ZONE_PHYSICAL; |
648 | } | 675 | } |
649 | SAL_CALL(ret_stuff, call, start_addr, end_addr, return_addr, (u64)1, | 676 | ia64_sal_oemcall(&ret_stuff, call, start_addr, end_addr, return_addr, |
650 | 0, 0, 0); | 677 | (u64)1, 0, 0, 0); |
651 | return ret_stuff.status; | 678 | return ret_stuff.status; |
652 | } | 679 | } |
653 | 680 | ||
@@ -668,8 +695,8 @@ static inline int | |||
668 | sn_change_coherence(u64 *new_domain, u64 *old_domain) | 695 | sn_change_coherence(u64 *new_domain, u64 *old_domain) |
669 | { | 696 | { |
670 | struct ia64_sal_retval ret_stuff; | 697 | struct ia64_sal_retval ret_stuff; |
671 | SAL_CALL(ret_stuff, SN_SAL_COHERENCE, new_domain, old_domain, 0, 0, | 698 | ia64_sal_oemcall(&ret_stuff, SN_SAL_COHERENCE, (u64)new_domain, |
672 | 0, 0, 0); | 699 | (u64)old_domain, 0, 0, 0, 0, 0); |
673 | return ret_stuff.status; | 700 | return ret_stuff.status; |
674 | } | 701 | } |
675 | 702 | ||
@@ -688,8 +715,8 @@ sn_change_memprotect(u64 paddr, u64 len, u64 perms, u64 *nasid_array) | |||
688 | cnodeid = nasid_to_cnodeid(get_node_number(paddr)); | 715 | cnodeid = nasid_to_cnodeid(get_node_number(paddr)); |
689 | // spin_lock(&NODEPDA(cnodeid)->bist_lock); | 716 | // spin_lock(&NODEPDA(cnodeid)->bist_lock); |
690 | local_irq_save(irq_flags); | 717 | local_irq_save(irq_flags); |
691 | SAL_CALL_NOLOCK(ret_stuff, SN_SAL_MEMPROTECT, paddr, len, nasid_array, | 718 | ia64_sal_oemcall_nolock(&ret_stuff, SN_SAL_MEMPROTECT, paddr, len, |
692 | perms, 0, 0, 0); | 719 | (u64)nasid_array, perms, 0, 0, 0); |
693 | local_irq_restore(irq_flags); | 720 | local_irq_restore(irq_flags); |
694 | // spin_unlock(&NODEPDA(cnodeid)->bist_lock); | 721 | // spin_unlock(&NODEPDA(cnodeid)->bist_lock); |
695 | return ret_stuff.status; | 722 | return ret_stuff.status; |