mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-01-16 06:31:46 +00:00
powerpc/ps3: Add highmem repository write routines
Add routines to allow Linux based bootloaders to create and/or modify highmem region info in the PS3 system repository where it can be retrived by later boot stages. Signed-off-by: Geoff Levand <geoff@infradead.org>
This commit is contained in:
parent
07c044c86e
commit
79f2a81bf1
@ -189,6 +189,15 @@ int ps3_repository_read_region_total(u64 *region_total);
|
||||
int ps3_repository_read_mm_info(u64 *rm_base, u64 *rm_size,
|
||||
u64 *region_total);
|
||||
|
||||
int ps3_repository_write_highmem_region_count(unsigned int region_count);
|
||||
int ps3_repository_write_highmem_base(unsigned int region_index,
|
||||
u64 highmem_base);
|
||||
int ps3_repository_write_highmem_size(unsigned int region_index,
|
||||
u64 highmem_size);
|
||||
int ps3_repository_write_highmem_info(unsigned int region_index,
|
||||
u64 highmem_base, u64 highmem_size);
|
||||
int ps3_repository_delete_highmem_info(unsigned int region_index);
|
||||
|
||||
/* repository pme info */
|
||||
|
||||
int ps3_repository_read_num_be(unsigned int *num_be);
|
||||
|
@ -1058,6 +1058,80 @@ static int write_node(u64 n1, u64 n2, u64 n3, u64 n4, u64 v1, u64 v2)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ps3_repository_write_highmem_region_count(unsigned int region_count)
|
||||
{
|
||||
int result;
|
||||
u64 v1 = (u64)region_count;
|
||||
|
||||
result = write_node(
|
||||
make_first_field("highmem", 0),
|
||||
make_field("region", 0),
|
||||
make_field("count", 0),
|
||||
0,
|
||||
v1, 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
int ps3_repository_write_highmem_base(unsigned int region_index,
|
||||
u64 highmem_base)
|
||||
{
|
||||
return write_node(
|
||||
make_first_field("highmem", 0),
|
||||
make_field("region", region_index),
|
||||
make_field("base", 0),
|
||||
0,
|
||||
highmem_base, 0);
|
||||
}
|
||||
|
||||
int ps3_repository_write_highmem_size(unsigned int region_index,
|
||||
u64 highmem_size)
|
||||
{
|
||||
return write_node(
|
||||
make_first_field("highmem", 0),
|
||||
make_field("region", region_index),
|
||||
make_field("size", 0),
|
||||
0,
|
||||
highmem_size, 0);
|
||||
}
|
||||
|
||||
int ps3_repository_write_highmem_info(unsigned int region_index,
|
||||
u64 highmem_base, u64 highmem_size)
|
||||
{
|
||||
int result;
|
||||
|
||||
result = ps3_repository_write_highmem_base(region_index, highmem_base);
|
||||
return result ? result
|
||||
: ps3_repository_write_highmem_size(region_index, highmem_size);
|
||||
}
|
||||
|
||||
static int ps3_repository_delete_highmem_base(unsigned int region_index)
|
||||
{
|
||||
return delete_node(
|
||||
make_first_field("highmem", 0),
|
||||
make_field("region", region_index),
|
||||
make_field("base", 0),
|
||||
0);
|
||||
}
|
||||
|
||||
static int ps3_repository_delete_highmem_size(unsigned int region_index)
|
||||
{
|
||||
return delete_node(
|
||||
make_first_field("highmem", 0),
|
||||
make_field("region", region_index),
|
||||
make_field("size", 0),
|
||||
0);
|
||||
}
|
||||
|
||||
int ps3_repository_delete_highmem_info(unsigned int region_index)
|
||||
{
|
||||
int result;
|
||||
|
||||
result = ps3_repository_delete_highmem_base(region_index);
|
||||
result += ps3_repository_delete_highmem_size(region_index);
|
||||
|
||||
return result ? -1 : 0;
|
||||
}
|
||||
|
||||
#endif /* defined(CONFIG_PS3_WRITE_REPOSITORY) */
|
||||
|
||||
#if defined(DEBUG)
|
||||
|
Loading…
x
Reference in New Issue
Block a user