Skip to content

Commit

Permalink
x86, vdso: Move more vdso definitions into vdso.h
Browse files Browse the repository at this point in the history
This fixes the Xen build and gets rid of a silly header file.

Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Cc: Stefani Seibold <stefani@seibold.net>
Link: http://lkml.kernel.org/r/1df77311795aff75f5742c787d277518314a38d3.1395366931.git.luto@amacapital.net
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
  • Loading branch information
Andy Lutomirski authored and H. Peter Anvin committed Mar 21, 2014
1 parent b67e612 commit 9e6f450
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 41 deletions.
38 changes: 38 additions & 0 deletions arch/x86/include/asm/vdso.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,46 @@
#ifndef _ASM_X86_VDSO_H
#define _ASM_X86_VDSO_H

#include <asm/page_types.h>
#include <linux/linkage.h>

#ifdef __ASSEMBLER__

#define DEFINE_VDSO_IMAGE(symname, filename) \
__PAGE_ALIGNED_DATA ; \
.globl symname##_start, symname##_end ; \
.align PAGE_SIZE ; \
symname##_start: ; \
.incbin filename ; \
symname##_end: ; \
.align PAGE_SIZE /* extra data here leaks to userspace. */ ; \
\
.previous ; \
\
.globl symname##_pages ; \
.bss ; \
.align 8 ; \
.type symname##_pages, @object ; \
symname##_pages: ; \
.zero (symname##_end - symname##_start + PAGE_SIZE - 1) / PAGE_SIZE * (BITS_PER_LONG / 8) ; \
.size symname##_pages, .-symname##_pages

#else

#define DECLARE_VDSO_IMAGE(symname) \
extern char symname##_start[], symname##_end[]; \
extern struct page *symname##_pages[]

#if defined CONFIG_X86_32 || defined CONFIG_COMPAT

#include <asm/vdso32.h>

DECLARE_VDSO_IMAGE(vdso32_int80);
#ifdef CONFIG_COMPAT
DECLARE_VDSO_IMAGE(vdso32_syscall);
#endif
DECLARE_VDSO_IMAGE(vdso32_sysenter);

extern const char VDSO32_PRELINK[];

/*
Expand All @@ -27,4 +63,6 @@ extern void __user __kernel_rt_sigreturn;

void __init patch_vdso32(void *vdso, size_t len);

#endif /* __ASSEMBLER__ */

#endif /* _ASM_X86_VDSO_H */
2 changes: 1 addition & 1 deletion arch/x86/vdso/vdso.S
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#include "vdso_image.h"
#include <asm/vdso.h>

DEFINE_VDSO_IMAGE(vdso, "arch/x86/vdso/vdso.so")
7 changes: 0 additions & 7 deletions arch/x86/vdso/vdso32-setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include <asm/fixmap.h>
#include <asm/hpet.h>
#include <asm/vvar.h>
#include "vdso_image.h"

#ifdef CONFIG_COMPAT_VDSO
#define VDSO_DEFAULT 0
Expand All @@ -42,12 +41,6 @@
#define arch_setup_additional_pages syscall32_setup_pages
#endif

DECLARE_VDSO_IMAGE(vdso32_int80);
#ifdef CONFIG_COMPAT
DECLARE_VDSO_IMAGE(vdso32_syscall);
#endif
DECLARE_VDSO_IMAGE(vdso32_sysenter);

/*
* Should the kernel map a VDSO page into processes and pass its
* address down to glibc upon exec()?
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/vdso/vdso32.S
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "vdso_image.h"
#include <asm/vdso.h>

DEFINE_VDSO_IMAGE(vdso32_int80, "arch/x86/vdso/vdso32-int80.so")

Expand Down
30 changes: 0 additions & 30 deletions arch/x86/vdso/vdso_image.h

This file was deleted.

2 changes: 1 addition & 1 deletion arch/x86/vdso/vdsox32.S
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#include "vdso_image.h"
#include <asm/vdso.h>

DEFINE_VDSO_IMAGE(vdsox32, "arch/x86/vdso/vdsox32.so")
1 change: 0 additions & 1 deletion arch/x86/vdso/vma.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include <asm/proto.h>
#include <asm/vdso.h>
#include <asm/page.h>
#include "vdso_image.h"

#if defined(CONFIG_X86_64)
unsigned int __read_mostly vdso_enabled = 1;
Expand Down

0 comments on commit 9e6f450

Please sign in to comment.