2016-01-04 15:44:32 +01:00
/ *
* Copyright ( c ) 2 0 1 5 , L i n a r o L i m i t e d
*
* This p r o g r a m i s f r e e s o f t w a r e ; you can redistribute it and/or modify
* it u n d e r t h e t e r m s o f t h e G N U G e n e r a l P u b l i c L i c e n s e V e r s i o n 2 a s
* published b y t h e F r e e S o f t w a r e F o u n d a t i o n .
*
* This p r o g r a m i s d i s t r i b u t e d i n t h e h o p e t h a t i t w i l l b e u s e f u l ,
* but W I T H O U T A N Y W A R R A N T Y ; without even the implied warranty of
* MERCHANTABILITY o r F I T N E S S F O R A P A R T I C U L A R P U R P O S E . S e e t h e
* GNU G e n e r a l P u b l i c L i c e n s e f o r m o r e d e t a i l s .
*
* /
# include < l i n u x / l i n k a g e . h >
2017-02-01 11:28:28 -06:00
# include < l i n u x / a r m - s m c c c . h >
2016-01-04 15:44:32 +01:00
# include < a s m / a s m - o f f s e t s . h >
.macro SMCCC instr
.cfi_startproc
\ instr #0
ldr x4 , [ s p ]
stp x0 , x1 , [ x4 , #A R M _ S M C C C _ R E S _ X 0 _ O F F S ]
stp x2 , x3 , [ x4 , #A R M _ S M C C C _ R E S _ X 2 _ O F F S ]
2017-02-01 11:28:28 -06:00
ldr x4 , [ s p , #8 ]
cbz x4 , 1 f / * n o q u i r k s t r u c t u r e * /
ldr x9 , [ x4 , #A R M _ S M C C C _ Q U I R K _ I D _ O F F S ]
cmp x9 , #A R M _ S M C C C _ Q U I R K _ Q C O M _ A 6
b. n e 1 f
str x6 , [ x4 , A R M _ S M C C C _ Q U I R K _ S T A T E _ O F F S ]
1 : ret
2016-01-04 15:44:32 +01:00
.cfi_endproc
.endm
/ *
* void a r m _ s m c c c _ s m c ( u n s i g n e d l o n g a0 , u n s i g n e d l o n g a1 , u n s i g n e d l o n g a2 ,
* unsigned l o n g a3 , u n s i g n e d l o n g a4 , u n s i g n e d l o n g a5 ,
2017-02-01 11:28:27 -06:00
* unsigned l o n g a6 , u n s i g n e d l o n g a7 , s t r u c t a r m _ s m c c c _ r e s * r e s ,
* struct a r m _ s m c c c _ q u i r k * q u i r k )
2016-01-04 15:44:32 +01:00
* /
2017-02-01 11:28:27 -06:00
ENTRY( _ _ a r m _ s m c c c _ s m c )
2016-01-04 15:44:32 +01:00
SMCCC s m c
2017-02-01 11:28:27 -06:00
ENDPROC( _ _ a r m _ s m c c c _ s m c )
2016-01-04 15:44:32 +01:00
/ *
* void a r m _ s m c c c _ h v c ( u n s i g n e d l o n g a0 , u n s i g n e d l o n g a1 , u n s i g n e d l o n g a2 ,
* unsigned l o n g a3 , u n s i g n e d l o n g a4 , u n s i g n e d l o n g a5 ,
2017-02-01 11:28:27 -06:00
* unsigned l o n g a6 , u n s i g n e d l o n g a7 , s t r u c t a r m _ s m c c c _ r e s * r e s ,
* struct a r m _ s m c c c _ q u i r k * q u i r k )
2016-01-04 15:44:32 +01:00
* /
2017-02-01 11:28:27 -06:00
ENTRY( _ _ a r m _ s m c c c _ h v c )
2016-01-04 15:44:32 +01:00
SMCCC h v c
2017-02-01 11:28:27 -06:00
ENDPROC( _ _ a r m _ s m c c c _ h v c )