hugetlbpage.c 1.5 KB
Newer Older
Linus Torvalds's avatar
Linus Torvalds committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*
 * arch/sh/mm/hugetlbpage.c
 *
 * SuperH HugeTLB page support.
 *
 * Cloned from sparc64 by Paul Mundt.
 *
 * Copyright (C) 2002, 2003 David S. Miller (davem@redhat.com)
 */

#include <linux/init.h>
#include <linux/fs.h>
#include <linux/mm.h>
#include <linux/hugetlb.h>
#include <linux/pagemap.h>
#include <linux/sysctl.h>

#include <asm/mman.h>
#include <asm/pgalloc.h>
#include <asm/tlb.h>
#include <asm/tlbflush.h>
#include <asm/cacheflush.h>

24
25
pte_t *huge_pte_alloc(struct mm_struct *mm,
			unsigned long addr, unsigned long sz)
Linus Torvalds's avatar
Linus Torvalds committed
26
27
{
	pgd_t *pgd;
Paul Mundt's avatar
Paul Mundt committed
28
	pud_t *pud;
Linus Torvalds's avatar
Linus Torvalds committed
29
30
31
32
33
	pmd_t *pmd;
	pte_t *pte = NULL;

	pgd = pgd_offset(mm, addr);
	if (pgd) {
Paul Mundt's avatar
Paul Mundt committed
34
35
36
37
		pud = pud_alloc(mm, pgd, addr);
		if (pud) {
			pmd = pmd_alloc(mm, pud, addr);
			if (pmd)
38
				pte = pte_alloc_map(mm, NULL, pmd, addr);
Paul Mundt's avatar
Paul Mundt committed
39
		}
Linus Torvalds's avatar
Linus Torvalds committed
40
	}
Paul Mundt's avatar
Paul Mundt committed
41

Linus Torvalds's avatar
Linus Torvalds committed
42
43
44
	return pte;
}

David Gibson's avatar
David Gibson committed
45
pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr)
Linus Torvalds's avatar
Linus Torvalds committed
46
47
{
	pgd_t *pgd;
Paul Mundt's avatar
Paul Mundt committed
48
	pud_t *pud;
Linus Torvalds's avatar
Linus Torvalds committed
49
50
51
52
53
	pmd_t *pmd;
	pte_t *pte = NULL;

	pgd = pgd_offset(mm, addr);
	if (pgd) {
Paul Mundt's avatar
Paul Mundt committed
54
55
56
57
58
59
		pud = pud_offset(pgd, addr);
		if (pud) {
			pmd = pmd_offset(pud, addr);
			if (pmd)
				pte = pte_offset_map(pmd, addr);
		}
David Gibson's avatar
David Gibson committed
60
	}
Linus Torvalds's avatar
Linus Torvalds committed
61

Paul Mundt's avatar
Paul Mundt committed
62
	return pte;
Linus Torvalds's avatar
Linus Torvalds committed
63
64
}

65
66
67
68
69
int huge_pmd_unshare(struct mm_struct *mm, unsigned long *addr, pte_t *ptep)
{
	return 0;
}

Linus Torvalds's avatar
Linus Torvalds committed
70
71
72
73
74
75
76
77
78
79
80
struct page *follow_huge_addr(struct mm_struct *mm,
			      unsigned long address, int write)
{
	return ERR_PTR(-EINVAL);
}

int pmd_huge(pmd_t pmd)
{
	return 0;
}

Andi Kleen's avatar
Andi Kleen committed
81
82
83
84
85
int pud_huge(pud_t pud)
{
	return 0;
}

Linus Torvalds's avatar
Linus Torvalds committed
86
87
88
89
90
struct page *follow_huge_pmd(struct mm_struct *mm, unsigned long address,
			     pmd_t *pmd, int write)
{
	return NULL;
}