Commit e252e372 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

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: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 3ad89009
......@@ -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)
......
......@@ -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;
......
#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__ */
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