2005-10-10 16:36:14 +04:00
/ *
* This f i l e c o n t a i n s t h e t a b l e o f s y s c a l l - h a n d l i n g f u n c t i o n s .
* Copyright ( C ) 1 9 9 5 - 1 9 9 6 G a r y T h o m a s ( g d t @linuxppc.org)
*
* Largely r e w r i t t e n b y C o r t D o u g a n ( c o r t @cs.nmt.edu)
* and P a u l M a c k e r r a s .
*
* Adapted f o r i S e r i e s b y M i k e C o r r i g a n ( m i k e j c @us.ibm.com)
* PPC6 4 u p d a t e s b y D a v e E n g e b r e t s e n ( e n g e b r e t @us.ibm.com)
*
* 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 i t 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
* as p u b l i s h e d 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 ; either version
* 2 of t h e L i c e n s e , o r ( a t y o u r o p t i o n ) a n y l a t e r v e r s i o n .
* /
# include < a s m / p p c _ a s m . h >
# ifdef C O N F I G _ P P C 6 4
2017-03-09 08:42:12 +03:00
# define S Y S C A L L ( f u n c ) . 8 b y t e D O T S Y M ( s y s _ ## f u n c ) , D O T S Y M ( s y s _ # # f u n c )
# define C O M P A T _ S Y S ( f u n c ) . 8 b y t e D O T S Y M ( s y s _ ## f u n c ) , D O T S Y M ( c o m p a t _ s y s _ # # f u n c )
# define P P C _ S Y S ( f u n c ) . 8 b y t e D O T S Y M ( p p c _ ## f u n c ) , D O T S Y M ( p p c _ # # f u n c )
# define O L D S Y S ( f u n c ) . 8 b y t e D O T S Y M ( s y s _ n i _ s y s c a l l ) ,D O T S Y M ( s y s _ n i _ s y s c a l l )
# define S Y S 3 2 O N L Y ( f u n c ) . 8 b y t e D O T S Y M ( s y s _ n i _ s y s c a l l ) ,D O T S Y M ( c o m p a t _ s y s _ ## f u n c )
# define P P C 6 4 O N L Y ( f u n c ) . 8 b y t e D O T S Y M ( p p c _ ## f u n c ) , D O T S Y M ( s y s _ n i _ s y s c a l l )
# define S Y S X ( f , f32 6 4 , f32 ) . 8 b y t e D O T S Y M ( f ) ,D O T S Y M ( f32 6 4 )
2005-10-10 16:36:14 +04:00
# else
# define S Y S C A L L ( f u n c ) . l o n g s y s _ ## f u n c
# define C O M P A T _ S Y S ( f u n c ) . l o n g s y s _ ## f u n c
# define P P C _ S Y S ( f u n c ) . l o n g p p c _ ## f u n c
# define O L D S Y S ( f u n c ) . l o n g s y s _ ## f u n c
# define S Y S 3 2 O N L Y ( f u n c ) . l o n g s y s _ ## f u n c
powerpc: Add a proper syscall for switching endianness
We currently have a "special" syscall for switching endianness. This is
syscall number 0x1ebe, which is handled explicitly in the 64-bit syscall
exception entry.
That has a few problems, firstly the syscall number is outside of the
usual range, which confuses various tools. For example strace doesn't
recognise the syscall at all.
Secondly it's handled explicitly as a special case in the syscall
exception entry, which is complicated enough without it.
As a first step toward removing the special syscall, we need to add a
regular syscall that implements the same functionality.
The logic is simple, it simply toggles the MSR_LE bit in the userspace
MSR. This is the same as the special syscall, with the caveat that the
special syscall clobbers fewer registers.
This version clobbers r9-r12, XER, CTR, and CR0-1,5-7.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2015-03-28 13:35:16 +03:00
# define P P C 6 4 O N L Y ( f u n c ) . l o n g s y s _ n i _ s y s c a l l
2005-10-10 16:36:14 +04:00
# define S Y S X ( f , f32 6 4 , f32 ) . l o n g f32
# endif
2006-06-20 00:45:04 +04:00
# define S Y S C A L L _ S P U ( f u n c ) S Y S C A L L ( f u n c )
# define C O M P A T _ S Y S _ S P U ( f u n c ) C O M P A T _ S Y S ( f u n c )
# define S Y S X _ S P U ( f , f32 6 4 , f32 ) S Y S X ( f , f32 6 4 , f32 )
2005-10-10 16:36:14 +04:00
2014-02-04 09:05:53 +04:00
.section .rodata , " a"
2005-10-10 16:36:14 +04:00
# ifdef C O N F I G _ P P C 6 4
2007-10-09 11:03:57 +04:00
.p2align 3
2005-10-10 16:36:14 +04:00
# endif
2014-02-04 09:05:53 +04:00
.globl sys_call_table
sys_call_table :
2006-06-20 00:45:04 +04:00
# include < a s m / s y s t b l . h >