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
6fd11a21
Commit
6fd11a21
authored
Mar 24, 2006
by
Ralf Baechle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[MIPS] Cleanup free_initmem the same way as i386 did.
Signed-off-by:
Ralf Baechle
<
ralf@linux-mips.org
>
parent
18b68e15
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
25 deletions
+23
-25
arch/mips/mm/init.c
arch/mips/mm/init.c
+23
-25
No files found.
arch/mips/mm/init.c
View file @
6fd11a21
...
@@ -276,6 +276,20 @@ void __init mem_init(void)
...
@@ -276,6 +276,20 @@ void __init mem_init(void)
}
}
#endif
/* !CONFIG_NEED_MULTIPLE_NODES */
#endif
/* !CONFIG_NEED_MULTIPLE_NODES */
void
free_init_pages
(
char
*
what
,
unsigned
long
begin
,
unsigned
long
end
)
{
unsigned
long
addr
;
for
(
addr
=
begin
;
addr
<
end
;
addr
+=
PAGE_SIZE
)
{
ClearPageReserved
(
virt_to_page
(
addr
));
init_page_count
(
virt_to_page
(
addr
));
memset
((
void
*
)
addr
,
0xcc
,
PAGE_SIZE
);
free_page
(
addr
);
totalram_pages
++
;
}
printk
(
KERN_INFO
"Freeing %s: %ldk freed
\n
"
,
what
,
(
end
-
begin
)
>>
10
);
}
#ifdef CONFIG_BLK_DEV_INITRD
#ifdef CONFIG_BLK_DEV_INITRD
void
free_initrd_mem
(
unsigned
long
start
,
unsigned
long
end
)
void
free_initrd_mem
(
unsigned
long
start
,
unsigned
long
end
)
{
{
...
@@ -284,16 +298,7 @@ void free_initrd_mem(unsigned long start, unsigned long end)
...
@@ -284,16 +298,7 @@ void free_initrd_mem(unsigned long start, unsigned long end)
start
=
(
unsigned
long
)
phys_to_virt
(
CPHYSADDR
(
start
));
start
=
(
unsigned
long
)
phys_to_virt
(
CPHYSADDR
(
start
));
end
=
(
unsigned
long
)
phys_to_virt
(
CPHYSADDR
(
end
));
end
=
(
unsigned
long
)
phys_to_virt
(
CPHYSADDR
(
end
));
#endif
#endif
if
(
start
<
end
)
free_init_pages
(
"initrd memory"
,
start
,
end
);
printk
(
KERN_INFO
"Freeing initrd memory: %ldk freed
\n
"
,
(
end
-
start
)
>>
10
);
for
(;
start
<
end
;
start
+=
PAGE_SIZE
)
{
ClearPageReserved
(
virt_to_page
(
start
));
init_page_count
(
virt_to_page
(
start
));
free_page
(
start
);
totalram_pages
++
;
}
}
}
#endif
#endif
...
@@ -301,24 +306,17 @@ extern unsigned long prom_free_prom_memory(void);
...
@@ -301,24 +306,17 @@ extern unsigned long prom_free_prom_memory(void);
void
free_initmem
(
void
)
void
free_initmem
(
void
)
{
{
unsigned
long
addr
,
page
,
freed
;
unsigned
long
start
,
end
,
freed
;
freed
=
prom_free_prom_memory
();
freed
=
prom_free_prom_memory
();
if
(
freed
)
printk
(
KERN_INFO
"Freeing firmware memory: %ldk freed
\n
"
,
freed
);
addr
=
(
unsigned
long
)
&
__init_begin
;
start
=
(
unsigned
long
)(
&
__init_begin
)
;
while
(
addr
<
(
unsigned
long
)
&
__init_end
)
{
end
=
(
unsigned
long
)(
&
__init_end
);
#ifdef CONFIG_64BIT
#ifdef CONFIG_64BIT
page
=
PAGE_OFFSET
|
CPHYSADDR
(
addr
);
start
=
PAGE_OFFSET
|
CPHYSADDR
(
start
);
#else
end
=
PAGE_OFFSET
|
CPHYSADDR
(
end
);
page
=
addr
;
#endif
#endif
ClearPageReserved
(
virt_to_page
(
page
));
free_init_pages
(
"unused kernel memory"
,
start
,
end
);
init_page_count
(
virt_to_page
(
page
));
free_page
(
page
);
totalram_pages
++
;
freed
+=
PAGE_SIZE
;
addr
+=
PAGE_SIZE
;
}
printk
(
KERN_INFO
"Freeing unused kernel memory: %ldk freed
\n
"
,
freed
>>
10
);
}
}
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