blob: a43d3b638ddc3611cb76c8f57a4c4cacd3ab9dbc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
.\" -*- nroff -*-
.\"
.\" copyright (C) 1997 Stephen Williams <steve@icarus.com>
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one
.\"
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date. The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein. The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
.TH skel 9 "$Date:$" "Linux DDI" "VM Functions"
.\"
.\" Turn off hyphenation and right justification for the first sections.
.hlm 0
.na
.\" The name should be formatted this way for apropos to work
.SH NAME
MAP_NR \- get memory map index for page in kernel memory
.\"
.\"
.SH SYNOPSIS
.B #include <linux/mm.h>
.sp
.BI "#define MAP_NR(" page ")"
.HP
.\"
.\" Turn hyphenation and adjustment back on.
.hlm 1
.ad
.SH DESCRIPTION
This macro maps the page of kernel memory to an index into the
.B mem_map
array. The input page is kernel-space page addresses such as those
that come from the
.BR get_free_page "(9)"
function. The expression
.I "mem_map[MAP_NR(page)]"
returns a pointer to a
.I mem_map_t
for the page in question.
.PP
Device drivers need access to the page structure if it is implimenting
some special kind of memory segment, i.e. cache for a virtual frame buffer.
.SH "RETURN VALUE"
Returns an index into the
.B mem_map
array.
.SH AVAILABILITY
Linux 2.0+
.SH "SEE ALSO"
.hlm 0
.na
.BR get_free_pages "(9)"
.ad
.hlm 1
.PP
.I "/usr/include/asm/page.h"
.SH AUTHOR
Stephen Williams <steve@icarus.com>
.SH BUGS
There is no check that the page you are passing really is a valid page
address.
|