Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
osv
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Verlässliche Systemsoftware
projects
osv
Commits
11b4d732
Commit
11b4d732
authored
12 years ago
by
Avi Kivity
Browse files
Options
Downloads
Patches
Plain Diff
memory: count up total physical memory
parent
990ae584
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
arch/x64/arch-setup.cc
+1
-0
1 addition, 0 deletions
arch/x64/arch-setup.cc
mempool.cc
+2
-0
2 additions, 0 deletions
mempool.cc
mempool.hh
+2
-0
2 additions, 0 deletions
mempool.hh
with
5 additions
and
0 deletions
arch/x64/arch-setup.cc
+
1
−
0
View file @
11b4d732
...
...
@@ -49,6 +49,7 @@ void arch_setup_free_memory()
while
(
p
<
tmp
+
mb
.
mmap_length
)
{
auto
ent
=
static_cast
<
e820ent
*>
(
p
);
if
(
ent
->
type
==
1
)
{
memory
::
phys_mem_size
+=
ent
->
size
;
if
(
ent
->
addr
<
edata
)
{
u64
adjust
=
std
::
min
(
edata
-
ent
->
addr
,
ent
->
size
);
ent
->
addr
+=
adjust
;
...
...
This diff is collapsed.
Click to expand it.
mempool.cc
+
2
−
0
View file @
11b4d732
...
...
@@ -8,6 +8,8 @@
namespace
memory
{
size_t
phys_mem_size
;
// Memory allocation strategy
//
// The chief requirement is to be able to deduce the object size.
...
...
This diff is collapsed.
Click to expand it.
mempool.hh
+
2
−
0
View file @
11b4d732
...
...
@@ -11,6 +11,8 @@ using std::size_t;
const
size_t
page_size
=
4096
;
extern
size_t
phys_mem_size
;
void
*
alloc_page
();
void
free_page
(
void
*
page
);
void
*
alloc_page_range
(
size_t
bytes
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment