Skip to content

Commit

Permalink
um: merge arch/um/sys-{i386,x86_64}
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
  • Loading branch information
Al Viro authored and Richard Weinberger committed Nov 2, 2011
1 parent 858ba94 commit 6582b7f
Show file tree
Hide file tree
Showing 51 changed files with 81 additions and 193 deletions.
6 changes: 3 additions & 3 deletions arch/um/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ archclean:

# Generated files

$(ARCH_DIR)/sys-$(SUBARCH)/user-offsets.s: FORCE
$(Q)$(MAKE) $(build)=$(ARCH_DIR)/sys-$(SUBARCH) $@
$(ARCH_DIR)/sys-$(HEADER_ARCH)/user-offsets.s: FORCE
$(Q)$(MAKE) $(build)=$(ARCH_DIR)/sys-$(HEADER_ARCH) $@

define filechk_gen-asm-offsets
(set -e; \
Expand All @@ -137,7 +137,7 @@ define filechk_gen-asm-offsets
echo ""; )
endef

include/generated/user_constants.h: $(ARCH_DIR)/sys-$(SUBARCH)/user-offsets.s
include/generated/user_constants.h: $(ARCH_DIR)/sys-$(HEADER_ARCH)/user-offsets.s
$(call filechk,gen-asm-offsets)

export SUBARCH USER_CFLAGS CFLAGS_NO_HARDENING OS HEADER_ARCH DEV_NULL_PATH
2 changes: 1 addition & 1 deletion arch/um/Makefile-i386
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
core-y += arch/um/sys-i386/ arch/x86/crypto/
core-y += arch/um/sys-x86/ arch/x86/crypto/

TOP_ADDR := $(CONFIG_TOP_ADDR)

Expand Down
2 changes: 1 addition & 1 deletion arch/um/Makefile-x86_64
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright 2003 - 2004 Pathscale, Inc
# Released under the GPL

core-y += arch/um/sys-x86_64/ arch/x86/crypto/
core-y += arch/um/sys-x86/ arch/x86/crypto/
START := 0x60000000

_extra_flags_ = -fno-builtin -m64
Expand Down
24 changes: 0 additions & 24 deletions arch/um/sys-i386/Makefile

This file was deleted.

21 changes: 0 additions & 21 deletions arch/um/sys-i386/bug.c

This file was deleted.

5 changes: 0 additions & 5 deletions arch/um/sys-i386/ksyms.c

This file was deleted.

53 changes: 0 additions & 53 deletions arch/um/sys-i386/user-offsets.c

This file was deleted.

45 changes: 45 additions & 0 deletions arch/um/sys-x86/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#
# Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
#

ifeq ($(CONFIG_X86_32),y)
BITS := 32
else
BITS := 64
endif

obj-y = bug.o bugs_$(BITS).o delay_$(BITS).o fault.o ksyms.o ldt.o \
ptrace_$(BITS).o ptrace_user.o setjmp_$(BITS).o signal_$(BITS).o \
stub_$(BITS).o stub_segv_$(BITS).o syscalls_$(BITS).o \
sys_call_table_$(BITS).o sysrq_$(BITS).o tls_$(BITS).o mem_$(BITS).o

ifeq ($(CONFIG_X86_32),y)

obj-y += checksum_32.o
obj-$(CONFIG_BINFMT_ELF) += elfcore.o

subarch-obj-y = lib/string_32.o lib/atomic64_32.o lib/atomic64_cx8_32.o
subarch-obj-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += lib/rwsem.o
subarch-obj-$(CONFIG_HIGHMEM) += mm/highmem_32.o
subarch-obj-$(CONFIG_MODULES) += kernel/module.o

else

obj-y += vdso/

subarch-obj-y = lib/csum-partial_64.o lib/memcpy_64.o lib/thunk_64.o \
lib/rwsem.o

endif

subarch-obj-$(CONFIG_MODULES) += kernel/module.o

USER_OBJS := bugs_$(BITS).o ptrace_user.o fault.o

extra-y += user-offsets.s
$(obj)/user-offsets.s: c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS)

UNPROFILE_OBJS := stub_segv.o
CFLAGS_stub_segv.o := $(CFLAGS_NO_HARDENING)

include arch/um/scripts/Makefile.rules
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions arch/um/sys-x86_64/ksyms.c → arch/um/sys-x86/ksyms.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
#include <asm/string.h>
#include <asm/checksum.h>

#ifndef CONFIG_X86_32
/*XXX: we need them because they would be exported by x86_64 */
#if (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) || __GNUC__ > 4
EXPORT_SYMBOL(memcpy);
#else
EXPORT_SYMBOL(__memcpy);
#endif
#endif
EXPORT_SYMBOL(csum_partial);
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

#include <errno.h>
#include <sys/ptrace.h>
#include "ptrace_user.h"

int ptrace_getregs(long pid, unsigned long *regs_out)
{
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,41 @@
#include <asm/types.h>

#define DEFINE(sym, val) \
asm volatile("\n->" #sym " %0 " #val : : "i" (val))
asm volatile("\n->" #sym " %0 " #val : : "i" (val))

#define DEFINE_LONGS(sym, val) \
asm volatile("\n->" #sym " %0 " #val : : "i" (val/sizeof(unsigned long)))
asm volatile("\n->" #sym " %0 " #val : : "i" (val/sizeof(unsigned long)))

#define OFFSET(sym, str, mem) \
DEFINE(sym, offsetof(struct str, mem));

void foo(void)
{
OFFSET(HOST_SC_CR2, sigcontext, cr2);
OFFSET(HOST_SC_ERR, sigcontext, err);
OFFSET(HOST_SC_TRAPNO, sigcontext, trapno);
OFFSET(HOST_SC_ERR, sigcontext, err);
OFFSET(HOST_SC_CR2, sigcontext, cr2);

#ifdef __i386__
DEFINE_LONGS(HOST_FP_SIZE, sizeof(struct user_fpregs_struct));
DEFINE_LONGS(HOST_FPX_SIZE, sizeof(struct user_fpxregs_struct));

DEFINE(HOST_IP, EIP);
DEFINE(HOST_SP, UESP);
DEFINE(HOST_EFLAGS, EFL);
DEFINE(HOST_EAX, EAX);
DEFINE(HOST_EBX, EBX);
DEFINE(HOST_ECX, ECX);
DEFINE(HOST_EDX, EDX);
DEFINE(HOST_ESI, ESI);
DEFINE(HOST_EDI, EDI);
DEFINE(HOST_EBP, EBP);
DEFINE(HOST_CS, CS);
DEFINE(HOST_SS, SS);
DEFINE(HOST_DS, DS);
DEFINE(HOST_FS, FS);
DEFINE(HOST_ES, ES);
DEFINE(HOST_GS, GS);
#else
DEFINE(HOST_FP_SIZE, sizeof(struct _fpstate) / sizeof(unsigned long));
DEFINE_LONGS(HOST_RBX, RBX);
DEFINE_LONGS(HOST_RCX, RCX);
Expand Down Expand Up @@ -52,9 +73,9 @@ void foo(void)

DEFINE_LONGS(HOST_IP, RIP);
DEFINE_LONGS(HOST_SP, RSP);
DEFINE(UM_FRAME_SIZE, sizeof(struct user_regs_struct));
#endif

/* XXX Duplicated between i386 and x86_64 */
DEFINE(UM_FRAME_SIZE, sizeof(struct user_regs_struct));
DEFINE(UM_POLLIN, POLLIN);
DEFINE(UM_POLLPRI, POLLPRI);
DEFINE(UM_POLLOUT, POLLOUT);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ __INITDATA

.globl vdso_start, vdso_end
vdso_start:
.incbin "arch/um/sys-x86_64/vdso/vdso.so"
.incbin "arch/um/sys-x86/vdso/vdso.so"
vdso_end:

__FINIT
File renamed without changes.
File renamed without changes.
27 changes: 0 additions & 27 deletions arch/um/sys-x86_64/Makefile

This file was deleted.

28 changes: 0 additions & 28 deletions arch/um/sys-x86_64/fault.c

This file was deleted.

22 changes: 0 additions & 22 deletions arch/um/sys-x86_64/ptrace_user.c

This file was deleted.

0 comments on commit 6582b7f

Please sign in to comment.