From owner-svn-src-projects@FreeBSD.ORG Thu Feb 20 23:17:25 2014 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 818A2B8E; Thu, 20 Feb 2014 23:17:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6DA411C54; Thu, 20 Feb 2014 23:17:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1KNHPTf007763; Thu, 20 Feb 2014 23:17:25 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1KNHPwX007762; Thu, 20 Feb 2014 23:17:25 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201402202317.s1KNHPwX007762@svn.freebsd.org> From: Andrew Turner Date: Thu, 20 Feb 2014 23:17:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r262270 - projects/arm64/sys/arm64/include X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Feb 2014 23:17:25 -0000 Author: andrew Date: Thu Feb 20 23:17:24 2014 New Revision: 262270 URL: http://svnweb.freebsd.org/changeset/base/262270 Log: Add the start of the required pte definitions Modified: projects/arm64/sys/arm64/include/pte.h Modified: projects/arm64/sys/arm64/include/pte.h ============================================================================== --- projects/arm64/sys/arm64/include/pte.h Thu Feb 20 23:08:01 2014 (r262269) +++ projects/arm64/sys/arm64/include/pte.h Thu Feb 20 23:17:24 2014 (r262270) @@ -42,6 +42,43 @@ typedef uint64_t pd_entry_t; /* page di typedef uint64_t pt_entry_t; /* page table entry */ #endif +/* Block and Page attributes */ +/* TODO: Add the upper attributes */ +#define ATTR_nG (1 << 11) +#define ATTR_AF (1 << 10) +#define ATTR_SH(x) ((x) << 8) +#define ATTR_AP(x) ((x) << 6) +#define ATTR_NS (1 << 5) +#define ATTR_IDX(x) ((x) << 3) + +/* Level 0 table, 512GiB per entry */ +#define L0_SHIFT 39 +#define L0_INVAL 0x0 /* An invalid address */ +#define L0_BLOCK 0x1 /* A block */ + /* 0x2 also marks an invalid address */ +#define L0_TABLE 0x3 /* A next-level table */ + +/* Level 1 table, 1GiB per entry */ +#define L1_SHIFT 30 +#define L1_INVAL L0_INVAL +#define L1_BLOCK L0_BLOCK +#define L1_TABLE L0_TABLE + +/* Level 2 table, 2MiB per entry */ +#define L2_SHIFT 21 +#define L2_INVAL L0_INVAL +#define L2_BLOCK L0_BLOCK +#define L2_TABLE L0_TABLE + +/* Level 3 table, 4KiB per entry */ +#define L3_SHIFT 12 +#define L3_INVAL 0x0 + /* 0x1 is reserved */ + /* 0x2 also marks an invalid address */ +#define L3_TABLE 0x3 + +#define Ln_ADDR_MASK ((1 << 9) - 1) + #endif /* !_MACHINE_PTE_H_ */ /* End of pte.h */