2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-29 13:28:27 +00:00

asm-generic: Introduce page.h

At the moment we are using 4K pages all the time,
so instead of copying code over all archs we're
supporting -- add asm-generic/page.h header.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Cyrill Gorcunov 2014-02-20 18:36:00 +04:00 committed by Pavel Emelyanov
parent 3ad89009a2
commit e252e37201
3 changed files with 20 additions and 16 deletions

View File

@ -6,6 +6,7 @@
#include <signal.h>
#include "protobuf/core.pb-c.h"
#include "asm-generic/page.h"
#include "asm/bitops.h"
#include "asm/int.h"
@ -92,14 +93,6 @@ struct user_vfp_exc {
#define ASSIGN_TYPED(a, b) do { a = (typeof(a))b; } while (0)
#define ASSIGN_MEMBER(a,b,m) do { ASSIGN_TYPED((a)->m, (b)->m); } while (0)
#ifndef PAGE_SIZE
# define PAGE_SIZE 4096
#endif
#ifndef PAGE_MASK
# define PAGE_MASK (~(PAGE_SIZE - 1))
#endif
#define REG_RES(regs) ((regs).ARM_r0)
#define REG_IP(regs) ((regs).ARM_pc)
#define REG_SYSCALL_NR(regs) ((regs).ARM_r7)

View File

@ -4,6 +4,7 @@
#include <stdbool.h>
#include <signal.h>
#include "asm-generic/page.h"
#include "asm/bitops.h"
#include "asm/int.h"
#include "asm/prlimit.h"
@ -108,14 +109,6 @@ typedef struct {
#define ASSIGN_TYPED(a, b) do { a = (typeof(a))b; } while (0)
#define ASSIGN_MEMBER(a,b,m) do { ASSIGN_TYPED((a)->m, (b)->m); } while (0)
#ifndef PAGE_SIZE
# define PAGE_SIZE 4096
#endif
#ifndef PAGE_MASK
# define PAGE_MASK (~(PAGE_SIZE - 1))
#endif
#define TASK_SIZE ((1UL << 47) - PAGE_SIZE)
typedef u64 auxv_t;

View File

@ -0,0 +1,18 @@
#ifndef __CR_ASM_GENERIC_PAGE_H__
#define __CR_ASM_GENERIC_PAGE_H__
#ifndef PAGE_SHIFT
# define PAGE_SHIFT 12
#endif
#ifndef PAGE_SIZE
# define PAGE_SIZE (1UL << PAGE_SHIFT)
#endif
#ifndef PAGE_MASK
# define PAGE_MASK (~(PAGE_SIZE - 1))
#endif
#define PAGE_PFN(addr) ((addr) / PAGE_SIZE)
#endif /* __CR_ASM_GENERIC_PAGE_H__ */