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
Kirill Smelkov
linux
Commits
bed76b96
Commit
bed76b96
authored
Jun 01, 2002
by
Anton Blanchard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ppc64: kill MAP_NR, dont mark free_initmem as __init
parent
90047b4b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
27 deletions
+19
-27
arch/ppc64/mm/init.c
arch/ppc64/mm/init.c
+18
-24
include/asm-ppc64/page.h
include/asm-ppc64/page.h
+0
-2
include/asm-ppc64/pgtable.h
include/asm-ppc64/pgtable.h
+1
-1
No files found.
arch/ppc64/mm/init.c
View file @
bed76b96
...
...
@@ -392,38 +392,32 @@ __flush_tlb_range(struct mm_struct *mm, unsigned long start, unsigned long end)
flush_hash_range
(
context
,
i
,
local
);
}
void
__init
free_initmem
(
void
)
void
free_initmem
(
void
)
{
unsigned
long
a
;
unsigned
long
num_freed_pages
=
0
;
#define FREESEC(START,END,CNT) do { \
a = (unsigned long)(&START); \
for (; a < (unsigned long)(&END); a += PAGE_SIZE) { \
clear_bit(PG_reserved, &mem_map[MAP_NR(a)].flags); \
set_page_count(mem_map+MAP_NR(a), 1); \
free_page(a); \
CNT++; \
} \
} while (0)
FREESEC
(
__init_begin
,
__init_end
,
num_freed_pages
);
printk
(
"Freeing unused kernel memory: %ldk init
\n
"
,
PGTOKB
(
num_freed_pages
));
unsigned
long
addr
;
addr
=
(
unsigned
long
)(
&
__init_begin
);
for
(;
addr
<
(
unsigned
long
)(
&
__init_end
);
addr
+=
PAGE_SIZE
)
{
ClearPageReserved
(
virt_to_page
(
addr
));
set_page_count
(
virt_to_page
(
addr
),
1
);
free_page
(
addr
);
totalram_pages
++
;
}
printk
(
"Freeing unused kernel memory: %dk freed
\n
"
,
(
&
__init_end
-
&
__init_begin
)
>>
10
);
}
#ifdef CONFIG_BLK_DEV_INITRD
void
free_initrd_mem
(
unsigned
long
start
,
unsigned
long
end
)
{
unsigned
long
xstart
=
start
;
if
(
start
<
end
)
printk
(
"Freeing initrd memory: %ldk freed
\n
"
,
(
end
-
start
)
>>
10
);
for
(;
start
<
end
;
start
+=
PAGE_SIZE
)
{
ClearPageReserved
(
mem_map
+
MAP_NR
(
start
));
set_page_count
(
mem_map
+
MAP_NR
(
start
),
1
);
ClearPageReserved
(
virt_to_page
(
start
));
set_page_count
(
virt_to_page
(
start
),
1
);
free_page
(
start
);
totalram_pages
++
;
}
printk
(
"Freeing initrd memory: %ldk freed
\n
"
,
(
end
-
xstart
)
>>
10
);
}
#endif
...
...
@@ -572,11 +566,11 @@ void __init mem_init(void)
for
(
addr
=
(
unsigned
long
)
sysmap
;
addr
<
PAGE_ALIGN
((
unsigned
long
)
sysmap
+
sysmap_size
)
;
addr
+=
PAGE_SIZE
)
SetPageReserved
(
mem_map
+
MAP_NR
(
addr
));
SetPageReserved
(
virt_to_page
(
addr
));
for
(
addr
=
KERNELBASE
;
addr
<=
(
unsigned
long
)
__va
(
lmb_end_of_DRAM
());
addr
+=
PAGE_SIZE
)
{
if
(
!
PageReserved
(
mem_map
+
MAP_NR
(
addr
)))
if
(
!
PageReserved
(
virt_to_page
(
addr
)))
continue
;
if
(
addr
<
(
ulong
)
etext
)
codepages
++
;
...
...
include/asm-ppc64/page.h
View file @
bed76b96
...
...
@@ -222,8 +222,6 @@ static inline int get_order(unsigned long size)
#define pfn_valid(pfn) ((pfn) < max_mapnr)
#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
#define MAP_NR(addr) (__pa(addr) >> PAGE_SHIFT)
#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
...
...
include/asm-ppc64/pgtable.h
View file @
bed76b96
...
...
@@ -155,7 +155,7 @@
* for zero-mapped memory areas etc..
*/
extern
unsigned
long
empty_zero_page
[
PAGE_SIZE
/
sizeof
(
unsigned
long
)];
#define ZERO_PAGE(vaddr) (
mem_map + MAP_NR
(empty_zero_page))
#define ZERO_PAGE(vaddr) (
virt_to_page
(empty_zero_page))
#endif
/* __ASSEMBLY__ */
/* shift to put page number into pte */
...
...
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