| Roland McGrath | 00f8b1b | 2008-01-30 13:30:43 +0100 | [diff] [blame] | 1 | /* | 
| Roland McGrath | 69d0627 | 2008-01-30 13:30:44 +0100 | [diff] [blame] | 2 |  * Code for the vDSO.  This version uses the syscall instruction. | 
 | 3 |  * | 
 | 4 |  * First get the common code for the sigreturn entry points. | 
 | 5 |  * This must come first. | 
| Roland McGrath | 00f8b1b | 2008-01-30 13:30:43 +0100 | [diff] [blame] | 6 |  */ | 
| Roland McGrath | 69d0627 | 2008-01-30 13:30:44 +0100 | [diff] [blame] | 7 | #define SYSCALL_ENTER_KERNEL	syscall | 
 | 8 | #include "sigreturn.S" | 
| Roland McGrath | 00f8b1b | 2008-01-30 13:30:43 +0100 | [diff] [blame] | 9 |  | 
| Roland McGrath | 00f8b1b | 2008-01-30 13:30:43 +0100 | [diff] [blame] | 10 | #include <asm/segment.h> | 
 | 11 |  | 
 | 12 | 	.text | 
 | 13 | 	.globl __kernel_vsyscall | 
 | 14 | 	.type __kernel_vsyscall,@function | 
| Roland McGrath | 69d0627 | 2008-01-30 13:30:44 +0100 | [diff] [blame] | 15 | 	ALIGN | 
| Roland McGrath | 00f8b1b | 2008-01-30 13:30:43 +0100 | [diff] [blame] | 16 | __kernel_vsyscall: | 
 | 17 | .LSTART_vsyscall: | 
 | 18 | 	push	%ebp | 
 | 19 | .Lpush_ebp: | 
 | 20 | 	movl	%ecx, %ebp | 
 | 21 | 	syscall | 
 | 22 | 	movl	$__USER32_DS, %ecx | 
 | 23 | 	movl	%ecx, %ss | 
 | 24 | 	movl	%ebp, %ecx | 
 | 25 | 	popl	%ebp | 
 | 26 | .Lpop_ebp: | 
 | 27 | 	ret | 
 | 28 | .LEND_vsyscall: | 
 | 29 | 	.size __kernel_vsyscall,.-.LSTART_vsyscall | 
 | 30 |  | 
 | 31 | 	.section .eh_frame,"a",@progbits | 
 | 32 | .LSTARTFRAME: | 
 | 33 | 	.long .LENDCIE-.LSTARTCIE | 
 | 34 | .LSTARTCIE: | 
 | 35 | 	.long 0			/* CIE ID */ | 
 | 36 | 	.byte 1			/* Version number */ | 
 | 37 | 	.string "zR"		/* NUL-terminated augmentation string */ | 
 | 38 | 	.uleb128 1		/* Code alignment factor */ | 
 | 39 | 	.sleb128 -4		/* Data alignment factor */ | 
 | 40 | 	.byte 8			/* Return address register column */ | 
 | 41 | 	.uleb128 1		/* Augmentation value length */ | 
 | 42 | 	.byte 0x1b		/* DW_EH_PE_pcrel|DW_EH_PE_sdata4. */ | 
 | 43 | 	.byte 0x0c		/* DW_CFA_def_cfa */ | 
 | 44 | 	.uleb128 4 | 
 | 45 | 	.uleb128 4 | 
 | 46 | 	.byte 0x88		/* DW_CFA_offset, column 0x8 */ | 
 | 47 | 	.uleb128 1 | 
 | 48 | 	.align 4 | 
 | 49 | .LENDCIE: | 
 | 50 |  | 
 | 51 | 	.long .LENDFDE1-.LSTARTFDE1	/* Length FDE */ | 
 | 52 | .LSTARTFDE1: | 
 | 53 | 	.long .LSTARTFDE1-.LSTARTFRAME	/* CIE pointer */ | 
 | 54 | 	.long .LSTART_vsyscall-.	/* PC-relative start address */ | 
 | 55 | 	.long .LEND_vsyscall-.LSTART_vsyscall | 
 | 56 | 	.uleb128 0			/* Augmentation length */ | 
 | 57 | 	/* What follows are the instructions for the table generation. | 
 | 58 | 	   We have to record all changes of the stack pointer.  */ | 
 | 59 | 	.byte 0x40 + .Lpush_ebp-.LSTART_vsyscall /* DW_CFA_advance_loc */ | 
 | 60 | 	.byte 0x0e		/* DW_CFA_def_cfa_offset */ | 
 | 61 | 	.uleb128 8 | 
 | 62 | 	.byte 0x85, 0x02	/* DW_CFA_offset %ebp -8 */ | 
 | 63 | 	.byte 0x40 + .Lpop_ebp-.Lpush_ebp /* DW_CFA_advance_loc */ | 
 | 64 | 	.byte 0xc5		/* DW_CFA_restore %ebp */ | 
 | 65 | 	.byte 0x0e		/* DW_CFA_def_cfa_offset */ | 
 | 66 | 	.uleb128 4 | 
 | 67 | 	.align 4 | 
 | 68 | .LENDFDE1: | 
| Roland McGrath | 69d0627 | 2008-01-30 13:30:44 +0100 | [diff] [blame] | 69 | 	.previous | 
| Roland McGrath | 00f8b1b | 2008-01-30 13:30:43 +0100 | [diff] [blame] | 70 |  | 
| Roland McGrath | 69d0627 | 2008-01-30 13:30:44 +0100 | [diff] [blame] | 71 | 	/* | 
 | 72 | 	 * Pad out the segment to match the size of the sysenter.S version. | 
 | 73 | 	 */ | 
| Roland McGrath | cadd516 | 2008-01-30 13:30:44 +0100 | [diff] [blame] | 74 | VDSO32_vsyscall_eh_frame_size = 0x40 | 
| Roland McGrath | 69d0627 | 2008-01-30 13:30:44 +0100 | [diff] [blame] | 75 | 	.section .data,"aw",@progbits | 
 | 76 | 	.space VDSO32_vsyscall_eh_frame_size-(.LENDFDE1-.LSTARTFRAME), 0 | 
 | 77 | 	.previous |