Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 305325
b: refs/heads/master
c: 07c044c
h: refs/heads/master
i:
  305323: 2c27692
v: v3
  • Loading branch information
Geoff Levand committed Apr 24, 2012
1 parent 08f58b2 commit fa15ac7
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 08a6b25631b5f1984a963fd7cf9771898ebb07e5
refs/heads/master: 07c044c86e05818c2d5e99b8ff881e2e4543c6ad
13 changes: 13 additions & 0 deletions trunk/arch/powerpc/platforms/ps3/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,19 @@ config PS3_SYS_MANAGER
This support is required for system control. In
general, all users will say Y or M.

config PS3_REPOSITORY_WRITE
bool "PS3 Repository write support" if PS3_ADVANCED
depends on PPC_PS3
default n
help
Enables support for writing to the PS3 System Repository.

This support is intended for bootloaders that need to store data
in the repository for later boot stages.

If in doubt, say N here and reduce the size of the kernel by a
small amount.

config PS3_STORAGE
depends on PPC_PS3
tristate
Expand Down
58 changes: 58 additions & 0 deletions trunk/arch/powerpc/platforms/ps3/repository.c
Original file line number Diff line number Diff line change
Expand Up @@ -1002,6 +1002,64 @@ int ps3_repository_read_lpm_privileges(unsigned int be_index, u64 *lpar,
lpar, rights);
}

#if defined(CONFIG_PS3_REPOSITORY_WRITE)

static int create_node(u64 n1, u64 n2, u64 n3, u64 n4, u64 v1, u64 v2)
{
int result;

dump_node(0, n1, n2, n3, n4, v1, v2);

result = lv1_create_repository_node(n1, n2, n3, n4, v1, v2);

if (result) {
pr_devel("%s:%d: lv1_create_repository_node failed: %s\n",
__func__, __LINE__, ps3_result(result));
return -ENOENT;
}

return 0;
}

static int delete_node(u64 n1, u64 n2, u64 n3, u64 n4)
{
int result;

dump_node(0, n1, n2, n3, n4, 0, 0);

result = lv1_delete_repository_node(n1, n2, n3, n4);

if (result) {
pr_devel("%s:%d: lv1_delete_repository_node failed: %s\n",
__func__, __LINE__, ps3_result(result));
return -ENOENT;
}

return 0;
}

static int write_node(u64 n1, u64 n2, u64 n3, u64 n4, u64 v1, u64 v2)
{
int result;

result = create_node(n1, n2, n3, n4, v1, v2);

if (!result)
return 0;

result = lv1_write_repository_node(n1, n2, n3, n4, v1, v2);

if (result) {
pr_devel("%s:%d: lv1_write_repository_node failed: %s\n",
__func__, __LINE__, ps3_result(result));
return -ENOENT;
}

return 0;
}

#endif /* defined(CONFIG_PS3_WRITE_REPOSITORY) */

#if defined(DEBUG)

int ps3_repository_dump_resource_info(const struct ps3_repository_device *repo)
Expand Down

0 comments on commit fa15ac7

Please sign in to comment.