Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
f01324b3
Commit
f01324b3
authored
Feb 27, 2004
by
Russell King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ARM] Make free_memmap() use PFNs instead of physical addresses.
parent
45425f2f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
11 deletions
+27
-11
arch/arm/mm/mm-armv.c
arch/arm/mm/mm-armv.c
+27
-11
No files found.
arch/arm/mm/mm-armv.c
View file @
f01324b3
...
@@ -585,20 +585,31 @@ void __init iotable_init(struct map_desc *io_desc, int nr)
...
@@ -585,20 +585,31 @@ void __init iotable_init(struct map_desc *io_desc, int nr)
create_mapping
(
io_desc
+
i
);
create_mapping
(
io_desc
+
i
);
}
}
static
inline
void
free_memmap
(
int
node
,
unsigned
long
start
,
unsigned
long
end
)
static
inline
void
free_memmap
(
int
node
,
unsigned
long
start_pfn
,
unsigned
long
end_pfn
)
{
{
struct
page
*
start_pg
,
*
end_pg
;
unsigned
long
pg
,
pgend
;
unsigned
long
pg
,
pgend
;
start
=
__phys_to_virt
(
start
);
/*
end
=
__phys_to_virt
(
end
);
* Convert start_pfn/end_pfn to a struct page pointer.
*/
pg
=
PAGE_ALIGN
((
unsigned
long
)(
virt_to_page
(
start
))
);
start_pg
=
pfn_to_page
(
start_pfn
);
pgend
=
((
unsigned
long
)(
virt_to_page
(
end
)))
&
PAGE_MASK
;
end_pg
=
pfn_to_page
(
end_pfn
)
;
start
=
__virt_to_phys
(
pg
);
/*
end
=
__virt_to_phys
(
pgend
);
* Convert to physical addresses, and
* round start upwards and end downwards.
*/
pg
=
PAGE_ALIGN
(
__pa
(
start_pg
));
pgend
=
__pa
(
end_pg
)
&
PAGE_MASK
;
free_bootmem_node
(
NODE_DATA
(
node
),
start
,
end
-
start
);
/*
* If there are free pages between these,
* free the section of the memmap array.
*/
if
(
pg
<
pgend
)
free_bootmem_node
(
NODE_DATA
(
node
),
pg
,
pgend
-
pg
);
}
}
static
inline
void
free_unused_memmap_node
(
int
node
,
struct
meminfo
*
mi
)
static
inline
void
free_unused_memmap_node
(
int
node
,
struct
meminfo
*
mi
)
...
@@ -615,7 +626,12 @@ static inline void free_unused_memmap_node(int node, struct meminfo *mi)
...
@@ -615,7 +626,12 @@ static inline void free_unused_memmap_node(int node, struct meminfo *mi)
if
(
mi
->
bank
[
i
].
size
==
0
||
mi
->
bank
[
i
].
node
!=
node
)
if
(
mi
->
bank
[
i
].
size
==
0
||
mi
->
bank
[
i
].
node
!=
node
)
continue
;
continue
;
bank_start
=
mi
->
bank
[
i
].
start
&
PAGE_MASK
;
bank_start
=
mi
->
bank
[
i
].
start
>>
PAGE_SHIFT
;
if
(
bank_start
<
prev_bank_end
)
{
printk
(
KERN_ERR
"MEM: unordered memory banks. "
"Not freeing memmap.
\n
"
);
break
;
}
/*
/*
* If we had a previous bank, and there is a space
* If we had a previous bank, and there is a space
...
@@ -625,7 +641,7 @@ static inline void free_unused_memmap_node(int node, struct meminfo *mi)
...
@@ -625,7 +641,7 @@ static inline void free_unused_memmap_node(int node, struct meminfo *mi)
free_memmap
(
node
,
prev_bank_end
,
bank_start
);
free_memmap
(
node
,
prev_bank_end
,
bank_start
);
prev_bank_end
=
PAGE_ALIGN
(
mi
->
bank
[
i
].
start
+
prev_bank_end
=
PAGE_ALIGN
(
mi
->
bank
[
i
].
start
+
mi
->
bank
[
i
].
size
);
mi
->
bank
[
i
].
size
)
>>
PAGE_SHIFT
;
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment