/* SPDX-License-Identifier: GPL-2.0-only */ /* * Page management definitions for the Hexagon architecture * * Copyright (c) 2010-2013, The Linux Foundation. All rights reserved.
*/
#ifndef _ASM_PAGE_H #define _ASM_PAGE_H
#include <linux/const.h>
/* This is probably not the most graceful way to handle this. */
/* * These should be defined in hugetlb.h, but apparently not. * "Huge" for us should be 4MB or 16MB, which are both represented * in L1 PTE's. Right now, it's set up for 4MB.
*/ #ifdef CONFIG_HUGETLB_PAGE #define HPAGE_SHIFT 22 #define HPAGE_SIZE (1UL << HPAGE_SHIFT) #define HPAGE_MASK (~(HPAGE_SIZE-1)) #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT-PAGE_SHIFT) #define HVM_HUGEPAGE_SIZE 0x5 #endif
#include <vdso/page.h>
#ifdef __KERNEL__ #ifndef __ASSEMBLY__
/* * This is for PFN_DOWN, which mm.h needs. Seems the right place to pull it in.
*/ #include <linux/pfn.h>
/* * We implement a two-level architecture-specific page table structure. * Null intermediate page table level (pmd, pud) definitions will come from * asm-generic/pagetable-nopmd.h and asm-generic/pagetable-nopud.h
*/ typedefstruct { unsignedlong pte; } pte_t; typedefstruct { unsignedlong pgd; } pgd_t; typedefstruct { unsignedlong pgprot; } pgprot_t; typedefstruct page *pgtable_t;
/* Needed for PAGE_OFFSET used in the macro right below */ #include <asm/mem-layout.h>
/* * We need a __pa and a __va routine for kernel space. * MIPS says they're only used during mem_init. * also, check if we need a PHYS_OFFSET.
*/ #define __pa(x) ((unsignedlong)(x) - PAGE_OFFSET + PHYS_OFFSET) #define __va(x) ((void *)((unsignedlong)(x) - PHYS_OFFSET + PAGE_OFFSET))
/* The "page frame" descriptor is defined in linux/mm.h */ struct page;
/* Need to not use a define for linesize; may move this to another file. */ staticinlinevoid clear_page(void *page)
{ /* This can only be done on pages with L1 WB cache */ asmvolatile( " loop0(1f,%1);\n" "1: { dczeroa(%0);\n" " %0 = add(%0,#32); }:endloop0\n"
: "+r" (page)
: "r" (PAGE_SIZE/32)
: "lc0", "sa0", "memory"
);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.