Commit 6f61488f authored by Alexander Kartashov's avatar Alexander Kartashov Committed by Pavel Emelyanov

x86: moved x86-specific files into the directory arch/x86.

* The following files goes into the directory arch/x86/include/asm unmodified:
  - include/atomic.h,
  - include/linkage.h,
  - include/memcpy_64.h,
  - include/types.h,
  - include/bitops.h,
  - pie/parasite-head-x86-64.S,
  - include/processor-flags.h,
  - include/syscall-x86-64.def.

* Changed include directives in the source files that include the headers
  listed above.

* Modified build scripts to reflect the source moves.
Signed-off-by: 's avatarAlexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 3716fd67
...@@ -41,8 +41,9 @@ ifeq ($(uname_M),x86_64) ...@@ -41,8 +41,9 @@ ifeq ($(uname_M),x86_64)
endif endif
SRC_DIR ?= $(shell pwd) SRC_DIR ?= $(shell pwd)
ARCH_DIR := $(SRC_DIR)/arch/$(ARCH)
CFLAGS = -I$(SRC_DIR)/include -I$(SRC_DIR)/pie -I$(SRC_DIR)/arch/$(ARCH)/ -fno-strict-aliasing CFLAGS += -I$(SRC_DIR)/include -I$(SRC_DIR)/pie -I$(ARCH_DIR) -iquote $(ARCH_DIR)/include -fno-strict-aliasing
LIBS := -lrt -lpthread -lprotobuf-c LIBS := -lrt -lpthread -lprotobuf-c
...@@ -70,7 +71,7 @@ CFLAGS += $(WARNINGS) $(DEFINES) ...@@ -70,7 +71,7 @@ CFLAGS += $(WARNINGS) $(DEFINES)
SYSCALL-LIB = $(SRC_DIR)/arch/$(ARCH)/syscalls.o SYSCALL-LIB = $(SRC_DIR)/arch/$(ARCH)/syscalls.o
PROTOBUF-LIB = $(SRC_DIR)/protobuf/protobuf-lib.o PROTOBUF-LIB = $(SRC_DIR)/protobuf/protobuf-lib.o
export E Q CC ECHO MAKE CFLAGS LIBS ARCH DEFINES MAKEFLAGS SRC_DIR SYSCALL-LIB SH export E Q CC ECHO MAKE CFLAGS LIBS ARCH DEFINES MAKEFLAGS SRC_DIR SYSCALL-LIB SH ARCH_DIR
PROGRAM := crtools PROGRAM := crtools
......
SYS-DEF := $(SRC_DIR)/include/syscall-x86-64.def SYS-DEF := $(ARCH_DIR)/syscall-x86-64.def
SYS-ASM-COMMON := syscall-common-x86-64.S SYS-ASM-COMMON := syscall-common-x86-64.S
SYS-TYPES := $(SRC_DIR)/include/syscall-types.h SYS-TYPES := $(SRC_DIR)/include/syscall-types.h
...@@ -47,5 +47,6 @@ clean: ...@@ -47,5 +47,6 @@ clean:
$(Q) $(RM) -f $(SYS-PROTO) $(Q) $(RM) -f $(SYS-PROTO)
$(Q) $(RM) -f $(SYS-OBJ) $(Q) $(RM) -f $(SYS-OBJ)
$(Q) $(RM) -f $(SYS-EXEC-TBL) $(Q) $(RM) -f $(SYS-EXEC-TBL)
$(Q) $(RM) -f *.o *.d
.PHONY: clean x86 .PHONY: clean x86
#ifndef __CR_ATOMIC_H__ #ifndef __CR_ATOMIC_H__
#define __CR_ATOMIC_H__ #define __CR_ATOMIC_H__
#include "types.h" #include "asm/types.h"
typedef struct { typedef struct {
u32 counter; u32 counter;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#define __CR_MEMCPY_64_H__ #define __CR_MEMCPY_64_H__
#include "compiler.h" #include "compiler.h"
#include "types.h" #include "asm/types.h"
static always_inline void *builtin_memcpy(void *to, const void *from, unsigned int n) static always_inline void *builtin_memcpy(void *to, const void *from, unsigned int n)
{ {
......
#ifndef __CR_TYPES_H__ #ifndef __CR_ASM_TYPES_H__
#define __CR_TYPES_H__ #define __CR_ASM_TYPES_H__
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include <signal.h> #include <signal.h>
#include "bitops.h" #include "asm/bitops.h"
/* prctl */ /* prctl */
#define ARCH_SET_GS 0x1001 #define ARCH_SET_GS 0x1001
...@@ -245,4 +245,4 @@ typedef struct { ...@@ -245,4 +245,4 @@ typedef struct {
# define MADV_DONTDUMP 16 # define MADV_DONTDUMP 16
#endif #endif
#endif /* __CR_TYPES_H__ */ #endif /* __CR_ASM_TYPES_H__ */
#include "linkage.h" #include "asm/linkage.h"
#include "parasite.h" #include "parasite.h"
.section .head.text, "ax" .section .head.text, "ax"
......
#include "linkage.h" #include "asm/linkage.h"
#define SYSCALL(name, opcode) \ #define SYSCALL(name, opcode) \
ENTRY(name); \ ENTRY(name); \
......
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
#include <sys/types.h> #include <sys/types.h>
#include "compiler.h" #include "compiler.h"
#include "types.h" #include "asm/types.h"
#include "log.h" #include "log.h"
#include "util.h" #include "util.h"
#include "bitops.h" #include "asm/bitops.h"
#include "proc_parse.h" #include "proc_parse.h"
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include "protobuf/creds.pb-c.h" #include "protobuf/creds.pb-c.h"
#include "protobuf/core.pb-c.h" #include "protobuf/core.pb-c.h"
#include "types.h" #include "asm/types.h"
#include "list.h" #include "list.h"
#include "file-ids.h" #include "file-ids.h"
#include "kcmp-ids.h" #include "kcmp-ids.h"
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include <sys/sendfile.h> #include <sys/sendfile.h>
#include "compiler.h" #include "compiler.h"
#include "types.h" #include "asm/types.h"
#include "image.h" #include "image.h"
#include "util.h" #include "util.h"
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include "types.h" #include "asm/types.h"
#include "list.h" #include "list.h"
#include "namespaces.h" #include "namespaces.h"
#include "compiler.h" #include "compiler.h"
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include "types.h" #include "asm/types.h"
#include "compiler.h" #include "compiler.h"
#include "crtools.h" #include "crtools.h"
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include <sys/eventfd.h> #include <sys/eventfd.h>
#include "compiler.h" #include "compiler.h"
#include "types.h" #include "asm/types.h"
#include "eventfd.h" #include "eventfd.h"
#include "proc_parse.h" #include "proc_parse.h"
#include "crtools.h" #include "crtools.h"
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include <sys/epoll.h> #include <sys/epoll.h>
#include "compiler.h" #include "compiler.h"
#include "types.h" #include "asm/types.h"
#include "eventpoll.h" #include "eventpoll.h"
#include "proc_parse.h" #include "proc_parse.h"
#include "crtools.h" #include "crtools.h"
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#include <sys/types.h> #include <sys/types.h>
#include "types.h" #include "asm/types.h"
#include "file-ids.h" #include "file-ids.h"
#include "rbtree.h" #include "rbtree.h"
#include "kcmp-ids.h" #include "kcmp-ids.h"
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include "image.h" #include "image.h"
#include "list.h" #include "list.h"
#include "util.h" #include "util.h"
#include "atomic.h" #include "asm/atomic.h"
#include "protobuf.h" #include "protobuf.h"
#include "protobuf/regfile.pb-c.h" #include "protobuf/regfile.pb-c.h"
......
#ifndef __CR_CPU_H__ #ifndef __CR_CPU_H__
#define __CR_CPU_H__ #define __CR_CPU_H__
#include "types.h" #include "asm/types.h"
/* /*
* Adopted from linux kernel. * Adopted from linux kernel.
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#include <sys/types.h> #include <sys/types.h>
#include "list.h" #include "list.h"
#include "types.h" #include "asm/types.h"
#include "list.h" #include "list.h"
#include "util.h" #include "util.h"
#include "image.h" #include "image.h"
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include <unistd.h> #include <unistd.h>
#include "compiler.h" #include "compiler.h"
#include "types.h" #include "asm/types.h"
#include "files.h" #include "files.h"
#include "crtools.h" #include "crtools.h"
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include <unistd.h> #include <unistd.h>
#include "compiler.h" #include "compiler.h"
#include "types.h" #include "asm/types.h"
#include "files.h" #include "files.h"
#include "crtools.h" #include "crtools.h"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#define __CR_FILE_IDS_H__ #define __CR_FILE_IDS_H__
#include "compiler.h" #include "compiler.h"
#include "types.h" #include "asm/types.h"
#include "rbtree.h" #include "rbtree.h"
#include "../protobuf/fdinfo.pb-c.h" #include "../protobuf/fdinfo.pb-c.h"
......
#ifndef __CR_FILES_REG_H__ #ifndef __CR_FILES_REG_H__
#define __CR_FILES_REG_H__ #define __CR_FILES_REG_H__
#include "types.h" #include "asm/types.h"
#include "files.h" #include "files.h"
#include "image.h" #include "image.h"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#define __CR_FILES_H__ #define __CR_FILES_H__
#include "compiler.h" #include "compiler.h"
#include "types.h" #include "asm/types.h"
#include "lock.h" #include "lock.h"
#include "list.h" #include "list.h"
#include "image.h" #include "image.h"
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#include <sys/types.h> #include <sys/types.h>
#include "compiler.h" #include "compiler.h"
#include "types.h" #include "asm/types.h"
#define FP_MIN_ALIGN_BYTES 64 #define FP_MIN_ALIGN_BYTES 64
......
#ifndef __CR_IMAGE_H__ #ifndef __CR_IMAGE_H__
#define __CR_IMAGE_H__ #define __CR_IMAGE_H__
#include "types.h" #include "asm/types.h"
#include "compiler.h" #include "compiler.h"
/* /*
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include <unistd.h> #include <unistd.h>
#include "compiler.h" #include "compiler.h"
#include "types.h" #include "asm/types.h"
#include "files.h" #include "files.h"
#include "crtools.h" #include "crtools.h"
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
#include <limits.h> #include <limits.h>
#include <errno.h> #include <errno.h>
#include "types.h" #include "asm/types.h"
#include "atomic.h" #include "asm/atomic.h"
#include "syscall.h" #include "syscall.h"
#include "util.h" #include "util.h"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#define __CR_PROC_PARSE_H__ #define __CR_PROC_PARSE_H__
#include <sys/types.h> #include <sys/types.h>
#include "types.h" #include "asm/types.h"
#include "image.h" #include "image.h"
#include "list.h" #include "list.h"
......
#ifndef __CR_PROTOBUF_H__ #ifndef __CR_PROTOBUF_H__
#define __CR_PROTOBUF_H__ #define __CR_PROTOBUF_H__
#include "types.h" #include "asm/types.h"
#include "compiler.h" #include "compiler.h"
#include "util.h" #include "util.h"
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include <stddef.h> #include <stddef.h>
#include "compiler.h" #include "compiler.h"
#include "types.h" #include "asm/types.h"
#define RB_RED 0 #define RB_RED 0
#define RB_BLACK 1 #define RB_BLACK 1
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include <limits.h> #include <limits.h>
#include "compiler.h" #include "compiler.h"
#include "types.h" #include "asm/types.h"
#include "image.h" #include "image.h"
#include "lock.h" #include "lock.h"
#include "util.h" #include "util.h"
......
#ifndef __CR_SK_QUEUE_H__ #ifndef __CR_SK_QUEUE_H__
#define __CR_SK_QUEUE_H__ #define __CR_SK_QUEUE_H__
#include "types.h" #include "asm/types.h"
#include "list.h" #include "list.h"
#include "crtools.h" #include "crtools.h"
#include "image.h" #include "image.h"
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#include <unistd.h> #include <unistd.h>
#include <stdbool.h> #include <stdbool.h>
#include "types.h" #include "asm/types.h"
#include "protobuf.h" #include "protobuf.h"
#include "../protobuf/sk-opts.pb-c.h" #include "../protobuf/sk-opts.pb-c.h"
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include <arpa/inet.h> #include <arpa/inet.h>
#include <sched.h> #include <sched.h>
#include "types.h" #include "asm/types.h"
#ifndef CONFIG_X86_64 #ifndef CONFIG_X86_64
# error x86-32 bit mode not yet implemented # error x86-32 bit mode not yet implemented
......
#ifndef __CR_UNIX_DIAG_H__ #ifndef __CR_UNIX_DIAG_H__
#define __CR_UNIX_DIAG_H__ #define __CR_UNIX_DIAG_H__
#include "types.h" #include "asm/types.h"
struct unix_diag_req { struct unix_diag_req {
u8 sdiag_family; u8 sdiag_family;
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include <dirent.h> #include <dirent.h>
#include "compiler.h" #include "compiler.h"
#include "types.h" #include "asm/types.h"
#include "log.h" #include "log.h"
#include "../protobuf/vma.pb-c.h" #include "../protobuf/vma.pb-c.h"
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include <aio.h> #include <aio.h>
#include "compiler.h" #include "compiler.h"
#include "types.h" #include "asm/types.h"
#include "inotify.h" #include "inotify.h"
#include "proc_parse.h" #include "proc_parse.h"
#include "syscall.h" #include "syscall.h"
......
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#include "types.h" #include "asm/types.h"
#include "rbtree.h" #include "rbtree.h"
#include "util.h" #include "util.h"
#include "syscall.h" #include "syscall.h"
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include <fcntl.h> #include <fcntl.h>
#include "compiler.h" #include "compiler.h"
#include "types.h" #include "asm/types.h"
#include "util.h" #include "util.h"
#include "crtools.h" #include "crtools.h"
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include <sys/wait.h> #include <sys/wait.h>
#include "crtools.h" #include "crtools.h"
#include "types.h" #include "asm/types.h"
#include "util.h" #include "util.h"
#include "log.h" #include "log.h"
#include "mount.h" #include "mount.h"
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include <wait.h> #include <wait.h>
#include <stdlib.h> #include <stdlib.h>
#include "types.h" #include "asm/types.h"
#include "util.h" #include "util.h"
#include "list.h" #include "list.h"
#include "files.h" #include "files.h"
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include "syscall.h" #include "syscall.h"
#include "ptrace.h" #include "ptrace.h"
#include "processor-flags.h" #include "asm/processor-flags.h"
#include "parasite-syscall.h" #include "parasite-syscall.h"
#include "parasite-blob.h" #include "parasite-blob.h"
#include "parasite.h" #include "parasite.h"
......
...@@ -3,7 +3,7 @@ CFLAGS += -fpie -Wa,--noexecstack -fno-strict-aliasing ...@@ -3,7 +3,7 @@ CFLAGS += -fpie -Wa,--noexecstack -fno-strict-aliasing
GEN-OFFSETS := gen-offsets.sh GEN-OFFSETS := gen-offsets.sh
PASM-OBJS += parasite-head-x86-64.o PASM-OBJS += $(ARCH_DIR)/parasite-head.o
PARASITE += parasite.bin.o parasite.bin PARASITE += parasite.bin.o parasite.bin
RESTORER := restorer.bin.o restorer.bin RESTORER := restorer.bin.o restorer.bin
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include <sys/resource.h> #include <sys/resource.h>
#include "compiler.h" #include "compiler.h"
#include "types.h" #include "asm/types.h"
#include "syscall.h" #include "syscall.h"
#include "log.h" #include "log.h"
#include "util.h" #include "util.h"
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#include <string.h> #include <string.h>
#include <linux/fs.h> #include <linux/fs.h>
#include "types.h" #include "asm/types.h"
#include "list.h" #include "list.h"
#include "util.h" #include "util.h"
#include "crtools.h" #include "crtools.h"
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include "crtools.h" #include "crtools.h"
#include "compiler.h" #include "compiler.h"
#include "types.h" #include "asm/types.h"
#include "log.h" #include "log.h"
#include "util.h" #include "util.h"
#include "string.h" #include "string.h"
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include "crtools.h" #include "crtools.h"
#include "compiler.h" #include "compiler.h"
#include "types.h" #include "asm/types.h"
#include "util.h" #include "util.h"
#include "ptrace.h" #include "ptrace.h"
#include "proc_parse.h" #include "proc_parse.h"
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#include <sys/signalfd.h> #include <sys/signalfd.h>
#include "compiler.h" #include "compiler.h"
#include "types.h" #include "asm/types.h"
#include "signalfd.h" #include "signalfd.h"
#include "proc_parse.h" #include "proc_parse.h"
#include "crtools.h" #include "crtools.h"
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include "types.h" #include "asm/types.h"
#include "libnetlink.h" #include "libnetlink.h"
#include "crtools.h" #include "crtools.h"
#include "inet_diag.h" #include "inet_diag.h"
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include <unistd.h> #include <unistd.h>
#include <string.h> #include <string.h>
#include "crtools.h" #include "crtools.h"
#include "types.h" #include "asm/types.h"
#include "files.h" #include "files.h"
#include "sockets.h" #include "sockets.h"
#include "libnetlink.h" #include "libnetlink.h"
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/sendfile.h> #include <sys/sendfile.h>
#include "types.h" #include "asm/types.h"
#include "list.h" #include "list.h"
#include "image.h" #include "image.h"
#include "crtools.h" #include "crtools.h"
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include "util.h" #include "util.h"
#include "list.h" #include "list.h"
#include "log.h" #include "log.h"
#include "types.h" #include "asm/types.h"
#include "files.h" #include "files.h"
#include "sockets.h" #include "sockets.h"
#include "files.h" #include "files.h"
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include <sys/un.h> #include <sys/un.h>
#include <stdlib.h> #include <stdlib.h>
#include "types.h" #include "asm/types.h"
#include "libnetlink.h" #include "libnetlink.h"
#include "crtools.h" #include "crtools.h"
#include "unix_diag.h" #include "unix_diag.h"
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include "types.h" #include "asm/types.h"
#include "sysctl.h" #include "sysctl.h"
#include "util.h" #include "util.h"
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include <linux/major.h> #include <linux/major.h>
#include "compiler.h" #include "compiler.h"
#include "types.h" #include "asm/types.h"
#include "syscall.h" #include "syscall.h"
#include "files.h" #include "files.h"
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
#include <errno.h> #include <errno.h>
#include "compiler.h" #include "compiler.h"
#include "memcpy_64.h" #include "asm/memcpy_64.h"
#include "types.h" #include "asm/types.h"
#include "syscall.h" #include "syscall.h"
#include "util-net.h" #include "util-net.h"
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include <sys/wait.h> #include <sys/wait.h>
#include "compiler.h" #include "compiler.h"
#include "types.h" #include "asm/types.h"
#include "list.h" #include "list.h"
#include "util.h" #include "util.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment