Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Arm Trusted Firmware
Commits
b27280a8
Commit
b27280a8
authored
Nov 15, 2019
by
Sandrine Bailleux
Committed by
TrustedFirmware Code Review
Nov 15, 2019
Browse files
Merge "Coding guideline suggest not to use unsigned long" into integration
parents
90199457
9afe8cdc
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/xlat_tables/aarch32/nonlpae_tables.c
View file @
b27280a8
...
@@ -284,10 +284,10 @@ void mmap_add_region(unsigned long long base_pa, uintptr_t base_va,
...
@@ -284,10 +284,10 @@ void mmap_add_region(unsigned long long base_pa, uintptr_t base_va,
}
}
/* map all memory as shared/global/domain0/no-usr access */
/* map all memory as shared/global/domain0/no-usr access */
static
u
nsigned
long
mmap_desc
(
unsigned
attr
,
unsigned
long
addr_pa
,
static
u
int32_t
mmap_desc
(
unsigned
attr
,
unsigned
int
addr_pa
,
unsigned
int
level
)
unsigned
int
level
)
{
{
u
nsigned
long
desc
;
u
int32_t
desc
;
switch
(
level
)
{
switch
(
level
)
{
case
1
:
case
1
:
...
@@ -380,14 +380,14 @@ static unsigned int mmap_region_attr(const mmap_region_t *mm, uintptr_t base_va,
...
@@ -380,14 +380,14 @@ static unsigned int mmap_region_attr(const mmap_region_t *mm, uintptr_t base_va,
}
}
static
mmap_region_t
*
init_xlation_table_inner
(
mmap_region_t
*
mm
,
static
mmap_region_t
*
init_xlation_table_inner
(
mmap_region_t
*
mm
,
unsigned
long
base_va
,
unsigned
int
base_va
,
u
nsigned
long
*
table
,
u
int32_t
*
table
,
unsigned
int
level
)
unsigned
int
level
)
{
{
unsigned
int
level_size_shift
=
(
level
==
1
)
?
unsigned
int
level_size_shift
=
(
level
==
1
)
?
ONE_MB_SHIFT
:
FOUR_KB_SHIFT
;
ONE_MB_SHIFT
:
FOUR_KB_SHIFT
;
unsigned
int
level_size
=
1
<<
level_size_shift
;
unsigned
int
level_size
=
1
<<
level_size_shift
;
unsigned
long
level_index_mask
=
(
level
==
1
)
?
unsigned
int
level_index_mask
=
(
level
==
1
)
?
(
NUM_1MB_IN_4GB
-
1
)
<<
ONE_MB_SHIFT
:
(
NUM_1MB_IN_4GB
-
1
)
<<
ONE_MB_SHIFT
:
(
NUM_4K_IN_1MB
-
1
)
<<
FOUR_KB_SHIFT
;
(
NUM_4K_IN_1MB
-
1
)
<<
FOUR_KB_SHIFT
;
...
@@ -396,7 +396,7 @@ static mmap_region_t *init_xlation_table_inner(mmap_region_t *mm,
...
@@ -396,7 +396,7 @@ static mmap_region_t *init_xlation_table_inner(mmap_region_t *mm,
VERBOSE
(
"init xlat table at %p (level%1d)
\n
"
,
(
void
*
)
table
,
level
);
VERBOSE
(
"init xlat table at %p (level%1d)
\n
"
,
(
void
*
)
table
,
level
);
do
{
do
{
u
nsigned
long
desc
=
MMU32B_UNSET_DESC
;
u
int32_t
desc
=
MMU32B_UNSET_DESC
;
if
(
mm
->
base_va
+
mm
->
size
<=
base_va
)
{
if
(
mm
->
base_va
+
mm
->
size
<=
base_va
)
{
/* Area now after the region so skip it */
/* Area now after the region so skip it */
...
@@ -427,7 +427,7 @@ static mmap_region_t *init_xlation_table_inner(mmap_region_t *mm,
...
@@ -427,7 +427,7 @@ static mmap_region_t *init_xlation_table_inner(mmap_region_t *mm,
}
}
if
(
desc
==
MMU32B_UNSET_DESC
)
{
if
(
desc
==
MMU32B_UNSET_DESC
)
{
u
nsigned
long
xlat_table
;
u
intptr_t
xlat_table
;
/*
/*
* Area not covered by a region so need finer table
* Area not covered by a region so need finer table
...
@@ -443,7 +443,7 @@ static mmap_region_t *init_xlation_table_inner(mmap_region_t *mm,
...
@@ -443,7 +443,7 @@ static mmap_region_t *init_xlation_table_inner(mmap_region_t *mm,
~
(
MMU32B_L1_TABLE_ALIGN
-
1
);
~
(
MMU32B_L1_TABLE_ALIGN
-
1
);
desc
=
*
table
;
desc
=
*
table
;
}
else
{
}
else
{
xlat_table
=
(
u
nsigned
long
)
mmu_l2_base
+
xlat_table
=
(
u
intptr_t
)
mmu_l2_base
+
next_xlat
*
MMU32B_L2_TABLE_SIZE
;
next_xlat
*
MMU32B_L2_TABLE_SIZE
;
next_xlat
++
;
next_xlat
++
;
assert
(
next_xlat
<=
MAX_XLAT_TABLES
);
assert
(
next_xlat
<=
MAX_XLAT_TABLES
);
...
@@ -456,7 +456,7 @@ static mmap_region_t *init_xlation_table_inner(mmap_region_t *mm,
...
@@ -456,7 +456,7 @@ static mmap_region_t *init_xlation_table_inner(mmap_region_t *mm,
}
}
/* Recurse to fill in new table */
/* Recurse to fill in new table */
mm
=
init_xlation_table_inner
(
mm
,
base_va
,
mm
=
init_xlation_table_inner
(
mm
,
base_va
,
(
u
nsigned
long
*
)
xlat_table
,
(
u
int32_t
*
)
xlat_table
,
level
+
1
);
level
+
1
);
}
}
#if LOG_LEVEL >= LOG_LEVEL_VERBOSE
#if LOG_LEVEL >= LOG_LEVEL_VERBOSE
...
@@ -480,7 +480,7 @@ void init_xlat_tables(void)
...
@@ -480,7 +480,7 @@ void init_xlat_tables(void)
memset
(
mmu_l1_base
,
0
,
MMU32B_L1_TABLE_SIZE
);
memset
(
mmu_l1_base
,
0
,
MMU32B_L1_TABLE_SIZE
);
init_xlation_table_inner
(
mmap
,
0
,
(
u
nsigned
long
*
)
mmu_l1_base
,
1
);
init_xlation_table_inner
(
mmap
,
0
,
(
u
int32_t
*
)
mmu_l1_base
,
1
);
VERBOSE
(
"init xlat - max_va=%p, max_pa=%llx
\n
"
,
VERBOSE
(
"init xlat - max_va=%p, max_pa=%llx
\n
"
,
(
void
*
)
xlat_max_va
,
xlat_max_pa
);
(
void
*
)
xlat_max_va
,
xlat_max_pa
);
...
...
lib/xlat_tables_v2/xlat_tables_core.c
View file @
b27280a8
...
@@ -607,7 +607,8 @@ static uintptr_t xlat_tables_map_region(xlat_ctx_t *ctx, mmap_region_t *mm,
...
@@ -607,7 +607,8 @@ static uintptr_t xlat_tables_map_region(xlat_ctx_t *ctx, mmap_region_t *mm,
}
}
/* Point to new subtable from this one. */
/* Point to new subtable from this one. */
table_base
[
table_idx
]
=
TABLE_DESC
|
(
unsigned
long
)
subtable
;
table_base
[
table_idx
]
=
TABLE_DESC
|
(
uintptr_t
)
subtable
;
/* Recurse to write into subtable */
/* Recurse to write into subtable */
end_va
=
xlat_tables_map_region
(
ctx
,
mm
,
table_idx_va
,
end_va
=
xlat_tables_map_region
(
ctx
,
mm
,
table_idx_va
,
...
...
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