Commit 8e525d59 authored by Liu Yu-B13201's avatar Liu Yu-B13201 Committed by Alexander Graf

PPC: Don't use hardcoded opcode for ePAPR hcall invocation

Signed-off-by: default avatarLiu Yu <yu.liu@freescale.com>
Signed-off-by: default avatarStuart Yoder <stuart.yoder@freescale.com>
Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
parent 305bcf26
...@@ -195,7 +195,7 @@ static inline unsigned int ev_int_set_config(unsigned int interrupt, ...@@ -195,7 +195,7 @@ static inline unsigned int ev_int_set_config(unsigned int interrupt,
r5 = priority; r5 = priority;
r6 = destination; r6 = destination;
__asm__ __volatile__ ("sc 1" asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3), "+r" (r4), "+r" (r5), "+r" (r6) : "+r" (r11), "+r" (r3), "+r" (r4), "+r" (r5), "+r" (r6)
: : EV_HCALL_CLOBBERS4 : : EV_HCALL_CLOBBERS4
); );
...@@ -224,7 +224,7 @@ static inline unsigned int ev_int_get_config(unsigned int interrupt, ...@@ -224,7 +224,7 @@ static inline unsigned int ev_int_get_config(unsigned int interrupt,
r11 = EV_HCALL_TOKEN(EV_INT_GET_CONFIG); r11 = EV_HCALL_TOKEN(EV_INT_GET_CONFIG);
r3 = interrupt; r3 = interrupt;
__asm__ __volatile__ ("sc 1" asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3), "=r" (r4), "=r" (r5), "=r" (r6) : "+r" (r11), "+r" (r3), "=r" (r4), "=r" (r5), "=r" (r6)
: : EV_HCALL_CLOBBERS4 : : EV_HCALL_CLOBBERS4
); );
...@@ -254,7 +254,7 @@ static inline unsigned int ev_int_set_mask(unsigned int interrupt, ...@@ -254,7 +254,7 @@ static inline unsigned int ev_int_set_mask(unsigned int interrupt,
r3 = interrupt; r3 = interrupt;
r4 = mask; r4 = mask;
__asm__ __volatile__ ("sc 1" asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3), "+r" (r4) : "+r" (r11), "+r" (r3), "+r" (r4)
: : EV_HCALL_CLOBBERS2 : : EV_HCALL_CLOBBERS2
); );
...@@ -279,7 +279,7 @@ static inline unsigned int ev_int_get_mask(unsigned int interrupt, ...@@ -279,7 +279,7 @@ static inline unsigned int ev_int_get_mask(unsigned int interrupt,
r11 = EV_HCALL_TOKEN(EV_INT_GET_MASK); r11 = EV_HCALL_TOKEN(EV_INT_GET_MASK);
r3 = interrupt; r3 = interrupt;
__asm__ __volatile__ ("sc 1" asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3), "=r" (r4) : "+r" (r11), "+r" (r3), "=r" (r4)
: : EV_HCALL_CLOBBERS2 : : EV_HCALL_CLOBBERS2
); );
...@@ -307,7 +307,7 @@ static inline unsigned int ev_int_eoi(unsigned int interrupt) ...@@ -307,7 +307,7 @@ static inline unsigned int ev_int_eoi(unsigned int interrupt)
r11 = EV_HCALL_TOKEN(EV_INT_EOI); r11 = EV_HCALL_TOKEN(EV_INT_EOI);
r3 = interrupt; r3 = interrupt;
__asm__ __volatile__ ("sc 1" asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3) : "+r" (r11), "+r" (r3)
: : EV_HCALL_CLOBBERS1 : : EV_HCALL_CLOBBERS1
); );
...@@ -346,7 +346,7 @@ static inline unsigned int ev_byte_channel_send(unsigned int handle, ...@@ -346,7 +346,7 @@ static inline unsigned int ev_byte_channel_send(unsigned int handle,
r7 = be32_to_cpu(p[2]); r7 = be32_to_cpu(p[2]);
r8 = be32_to_cpu(p[3]); r8 = be32_to_cpu(p[3]);
__asm__ __volatile__ ("sc 1" asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3), : "+r" (r11), "+r" (r3),
"+r" (r4), "+r" (r5), "+r" (r6), "+r" (r7), "+r" (r8) "+r" (r4), "+r" (r5), "+r" (r6), "+r" (r7), "+r" (r8)
: : EV_HCALL_CLOBBERS6 : : EV_HCALL_CLOBBERS6
...@@ -385,7 +385,7 @@ static inline unsigned int ev_byte_channel_receive(unsigned int handle, ...@@ -385,7 +385,7 @@ static inline unsigned int ev_byte_channel_receive(unsigned int handle,
r3 = handle; r3 = handle;
r4 = *count; r4 = *count;
__asm__ __volatile__ ("sc 1" asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3), "+r" (r4), : "+r" (r11), "+r" (r3), "+r" (r4),
"=r" (r5), "=r" (r6), "=r" (r7), "=r" (r8) "=r" (r5), "=r" (r6), "=r" (r7), "=r" (r8)
: : EV_HCALL_CLOBBERS6 : : EV_HCALL_CLOBBERS6
...@@ -423,7 +423,7 @@ static inline unsigned int ev_byte_channel_poll(unsigned int handle, ...@@ -423,7 +423,7 @@ static inline unsigned int ev_byte_channel_poll(unsigned int handle,
r11 = EV_HCALL_TOKEN(EV_BYTE_CHANNEL_POLL); r11 = EV_HCALL_TOKEN(EV_BYTE_CHANNEL_POLL);
r3 = handle; r3 = handle;
__asm__ __volatile__ ("sc 1" asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3), "=r" (r4), "=r" (r5) : "+r" (r11), "+r" (r3), "=r" (r4), "=r" (r5)
: : EV_HCALL_CLOBBERS3 : : EV_HCALL_CLOBBERS3
); );
...@@ -456,7 +456,7 @@ static inline unsigned int ev_int_iack(unsigned int handle, ...@@ -456,7 +456,7 @@ static inline unsigned int ev_int_iack(unsigned int handle,
r11 = EV_HCALL_TOKEN(EV_INT_IACK); r11 = EV_HCALL_TOKEN(EV_INT_IACK);
r3 = handle; r3 = handle;
__asm__ __volatile__ ("sc 1" asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3), "=r" (r4) : "+r" (r11), "+r" (r3), "=r" (r4)
: : EV_HCALL_CLOBBERS2 : : EV_HCALL_CLOBBERS2
); );
...@@ -480,7 +480,7 @@ static inline unsigned int ev_doorbell_send(unsigned int handle) ...@@ -480,7 +480,7 @@ static inline unsigned int ev_doorbell_send(unsigned int handle)
r11 = EV_HCALL_TOKEN(EV_DOORBELL_SEND); r11 = EV_HCALL_TOKEN(EV_DOORBELL_SEND);
r3 = handle; r3 = handle;
__asm__ __volatile__ ("sc 1" asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3) : "+r" (r11), "+r" (r3)
: : EV_HCALL_CLOBBERS1 : : EV_HCALL_CLOBBERS1
); );
...@@ -500,7 +500,7 @@ static inline unsigned int ev_idle(void) ...@@ -500,7 +500,7 @@ static inline unsigned int ev_idle(void)
r11 = EV_HCALL_TOKEN(EV_IDLE); r11 = EV_HCALL_TOKEN(EV_IDLE);
__asm__ __volatile__ ("sc 1" asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "=r" (r3) : "+r" (r11), "=r" (r3)
: : EV_HCALL_CLOBBERS1 : : EV_HCALL_CLOBBERS1
); );
......
...@@ -96,7 +96,7 @@ static inline unsigned int fh_send_nmi(unsigned int vcpu_mask) ...@@ -96,7 +96,7 @@ static inline unsigned int fh_send_nmi(unsigned int vcpu_mask)
r11 = FH_HCALL_TOKEN(FH_SEND_NMI); r11 = FH_HCALL_TOKEN(FH_SEND_NMI);
r3 = vcpu_mask; r3 = vcpu_mask;
__asm__ __volatile__ ("sc 1" asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3) : "+r" (r11), "+r" (r3)
: : EV_HCALL_CLOBBERS1 : : EV_HCALL_CLOBBERS1
); );
...@@ -151,7 +151,7 @@ static inline unsigned int fh_partition_get_dtprop(int handle, ...@@ -151,7 +151,7 @@ static inline unsigned int fh_partition_get_dtprop(int handle,
r9 = (uint32_t)propvalue_addr; r9 = (uint32_t)propvalue_addr;
r10 = *propvalue_len; r10 = *propvalue_len;
__asm__ __volatile__ ("sc 1" asm volatile("bl epapr_hypercall_start"
: "+r" (r11), : "+r" (r11),
"+r" (r3), "+r" (r4), "+r" (r5), "+r" (r6), "+r" (r7), "+r" (r3), "+r" (r4), "+r" (r5), "+r" (r6), "+r" (r7),
"+r" (r8), "+r" (r9), "+r" (r10) "+r" (r8), "+r" (r9), "+r" (r10)
...@@ -205,7 +205,7 @@ static inline unsigned int fh_partition_set_dtprop(int handle, ...@@ -205,7 +205,7 @@ static inline unsigned int fh_partition_set_dtprop(int handle,
r9 = (uint32_t)propvalue_addr; r9 = (uint32_t)propvalue_addr;
r10 = propvalue_len; r10 = propvalue_len;
__asm__ __volatile__ ("sc 1" asm volatile("bl epapr_hypercall_start"
: "+r" (r11), : "+r" (r11),
"+r" (r3), "+r" (r4), "+r" (r5), "+r" (r6), "+r" (r7), "+r" (r3), "+r" (r4), "+r" (r5), "+r" (r6), "+r" (r7),
"+r" (r8), "+r" (r9), "+r" (r10) "+r" (r8), "+r" (r9), "+r" (r10)
...@@ -229,7 +229,7 @@ static inline unsigned int fh_partition_restart(unsigned int partition) ...@@ -229,7 +229,7 @@ static inline unsigned int fh_partition_restart(unsigned int partition)
r11 = FH_HCALL_TOKEN(FH_PARTITION_RESTART); r11 = FH_HCALL_TOKEN(FH_PARTITION_RESTART);
r3 = partition; r3 = partition;
__asm__ __volatile__ ("sc 1" asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3) : "+r" (r11), "+r" (r3)
: : EV_HCALL_CLOBBERS1 : : EV_HCALL_CLOBBERS1
); );
...@@ -262,7 +262,7 @@ static inline unsigned int fh_partition_get_status(unsigned int partition, ...@@ -262,7 +262,7 @@ static inline unsigned int fh_partition_get_status(unsigned int partition,
r11 = FH_HCALL_TOKEN(FH_PARTITION_GET_STATUS); r11 = FH_HCALL_TOKEN(FH_PARTITION_GET_STATUS);
r3 = partition; r3 = partition;
__asm__ __volatile__ ("sc 1" asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3), "=r" (r4) : "+r" (r11), "+r" (r3), "=r" (r4)
: : EV_HCALL_CLOBBERS2 : : EV_HCALL_CLOBBERS2
); );
...@@ -295,7 +295,7 @@ static inline unsigned int fh_partition_start(unsigned int partition, ...@@ -295,7 +295,7 @@ static inline unsigned int fh_partition_start(unsigned int partition,
r4 = entry_point; r4 = entry_point;
r5 = load; r5 = load;
__asm__ __volatile__ ("sc 1" asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3), "+r" (r4), "+r" (r5) : "+r" (r11), "+r" (r3), "+r" (r4), "+r" (r5)
: : EV_HCALL_CLOBBERS3 : : EV_HCALL_CLOBBERS3
); );
...@@ -317,7 +317,7 @@ static inline unsigned int fh_partition_stop(unsigned int partition) ...@@ -317,7 +317,7 @@ static inline unsigned int fh_partition_stop(unsigned int partition)
r11 = FH_HCALL_TOKEN(FH_PARTITION_STOP); r11 = FH_HCALL_TOKEN(FH_PARTITION_STOP);
r3 = partition; r3 = partition;
__asm__ __volatile__ ("sc 1" asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3) : "+r" (r11), "+r" (r3)
: : EV_HCALL_CLOBBERS1 : : EV_HCALL_CLOBBERS1
); );
...@@ -376,7 +376,7 @@ static inline unsigned int fh_partition_memcpy(unsigned int source, ...@@ -376,7 +376,7 @@ static inline unsigned int fh_partition_memcpy(unsigned int source,
#endif #endif
r7 = count; r7 = count;
__asm__ __volatile__ ("sc 1" asm volatile("bl epapr_hypercall_start"
: "+r" (r11), : "+r" (r11),
"+r" (r3), "+r" (r4), "+r" (r5), "+r" (r6), "+r" (r7) "+r" (r3), "+r" (r4), "+r" (r5), "+r" (r6), "+r" (r7)
: : EV_HCALL_CLOBBERS5 : : EV_HCALL_CLOBBERS5
...@@ -399,7 +399,7 @@ static inline unsigned int fh_dma_enable(unsigned int liodn) ...@@ -399,7 +399,7 @@ static inline unsigned int fh_dma_enable(unsigned int liodn)
r11 = FH_HCALL_TOKEN(FH_DMA_ENABLE); r11 = FH_HCALL_TOKEN(FH_DMA_ENABLE);
r3 = liodn; r3 = liodn;
__asm__ __volatile__ ("sc 1" asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3) : "+r" (r11), "+r" (r3)
: : EV_HCALL_CLOBBERS1 : : EV_HCALL_CLOBBERS1
); );
...@@ -421,7 +421,7 @@ static inline unsigned int fh_dma_disable(unsigned int liodn) ...@@ -421,7 +421,7 @@ static inline unsigned int fh_dma_disable(unsigned int liodn)
r11 = FH_HCALL_TOKEN(FH_DMA_DISABLE); r11 = FH_HCALL_TOKEN(FH_DMA_DISABLE);
r3 = liodn; r3 = liodn;
__asm__ __volatile__ ("sc 1" asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3) : "+r" (r11), "+r" (r3)
: : EV_HCALL_CLOBBERS1 : : EV_HCALL_CLOBBERS1
); );
...@@ -447,7 +447,7 @@ static inline unsigned int fh_vmpic_get_msir(unsigned int interrupt, ...@@ -447,7 +447,7 @@ static inline unsigned int fh_vmpic_get_msir(unsigned int interrupt,
r11 = FH_HCALL_TOKEN(FH_VMPIC_GET_MSIR); r11 = FH_HCALL_TOKEN(FH_VMPIC_GET_MSIR);
r3 = interrupt; r3 = interrupt;
__asm__ __volatile__ ("sc 1" asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3), "=r" (r4) : "+r" (r11), "+r" (r3), "=r" (r4)
: : EV_HCALL_CLOBBERS2 : : EV_HCALL_CLOBBERS2
); );
...@@ -469,7 +469,7 @@ static inline unsigned int fh_system_reset(void) ...@@ -469,7 +469,7 @@ static inline unsigned int fh_system_reset(void)
r11 = FH_HCALL_TOKEN(FH_SYSTEM_RESET); r11 = FH_HCALL_TOKEN(FH_SYSTEM_RESET);
__asm__ __volatile__ ("sc 1" asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "=r" (r3) : "+r" (r11), "=r" (r3)
: : EV_HCALL_CLOBBERS1 : : EV_HCALL_CLOBBERS1
); );
...@@ -506,7 +506,7 @@ static inline unsigned int fh_err_get_info(int queue, uint32_t *bufsize, ...@@ -506,7 +506,7 @@ static inline unsigned int fh_err_get_info(int queue, uint32_t *bufsize,
r6 = addr_lo; r6 = addr_lo;
r7 = peek; r7 = peek;
__asm__ __volatile__ ("sc 1" asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3), "+r" (r4), "+r" (r5), "+r" (r6), : "+r" (r11), "+r" (r3), "+r" (r4), "+r" (r5), "+r" (r6),
"+r" (r7) "+r" (r7)
: : EV_HCALL_CLOBBERS5 : : EV_HCALL_CLOBBERS5
...@@ -542,7 +542,7 @@ static inline unsigned int fh_get_core_state(unsigned int handle, ...@@ -542,7 +542,7 @@ static inline unsigned int fh_get_core_state(unsigned int handle,
r3 = handle; r3 = handle;
r4 = vcpu; r4 = vcpu;
__asm__ __volatile__ ("sc 1" asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3), "+r" (r4) : "+r" (r11), "+r" (r3), "+r" (r4)
: : EV_HCALL_CLOBBERS2 : : EV_HCALL_CLOBBERS2
); );
...@@ -572,7 +572,7 @@ static inline unsigned int fh_enter_nap(unsigned int handle, unsigned int vcpu) ...@@ -572,7 +572,7 @@ static inline unsigned int fh_enter_nap(unsigned int handle, unsigned int vcpu)
r3 = handle; r3 = handle;
r4 = vcpu; r4 = vcpu;
__asm__ __volatile__ ("sc 1" asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3), "+r" (r4) : "+r" (r11), "+r" (r3), "+r" (r4)
: : EV_HCALL_CLOBBERS2 : : EV_HCALL_CLOBBERS2
); );
...@@ -597,7 +597,7 @@ static inline unsigned int fh_exit_nap(unsigned int handle, unsigned int vcpu) ...@@ -597,7 +597,7 @@ static inline unsigned int fh_exit_nap(unsigned int handle, unsigned int vcpu)
r3 = handle; r3 = handle;
r4 = vcpu; r4 = vcpu;
__asm__ __volatile__ ("sc 1" asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3), "+r" (r4) : "+r" (r11), "+r" (r3), "+r" (r4)
: : EV_HCALL_CLOBBERS2 : : EV_HCALL_CLOBBERS2
); );
...@@ -618,7 +618,7 @@ static inline unsigned int fh_claim_device(unsigned int handle) ...@@ -618,7 +618,7 @@ static inline unsigned int fh_claim_device(unsigned int handle)
r11 = FH_HCALL_TOKEN(FH_CLAIM_DEVICE); r11 = FH_HCALL_TOKEN(FH_CLAIM_DEVICE);
r3 = handle; r3 = handle;
__asm__ __volatile__ ("sc 1" asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3) : "+r" (r11), "+r" (r3)
: : EV_HCALL_CLOBBERS1 : : EV_HCALL_CLOBBERS1
); );
...@@ -645,7 +645,7 @@ static inline unsigned int fh_partition_stop_dma(unsigned int handle) ...@@ -645,7 +645,7 @@ static inline unsigned int fh_partition_stop_dma(unsigned int handle)
r11 = FH_HCALL_TOKEN(FH_PARTITION_STOP_DMA); r11 = FH_HCALL_TOKEN(FH_PARTITION_STOP_DMA);
r3 = handle; r3 = handle;
__asm__ __volatile__ ("sc 1" asm volatile("bl epapr_hypercall_start"
: "+r" (r11), "+r" (r3) : "+r" (r11), "+r" (r3)
: : EV_HCALL_CLOBBERS1 : : EV_HCALL_CLOBBERS1
); );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment