arch/powerpc/platforms/ps3/os-area.c
Source file repositories/reference/linux-study-clean/arch/powerpc/platforms/ps3/os-area.c
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/platforms/ps3/os-area.c- Extension
.c- Size
- 21403 bytes
- Lines
- 831
- Domain
- Architecture Layer
- Bucket
- arch/powerpc
- Inferred role
- Architecture Layer: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/io.hlinux/workqueue.hlinux/fs.hlinux/syscalls.hlinux/export.hlinux/ctype.hlinux/memblock.hlinux/of.hlinux/slab.hplatform.h
Detected Declarations
struct os_area_headerstruct os_area_paramsstruct os_area_dbstruct os_area_db_idstruct db_indexstruct db_iteratorenum os_area_ldr_formatenum os_area_boot_flagenum os_area_ctrl_buttonenum os_area_db_ownerenum os_area_db_keyfunction ps3_os_area_flash_registerfunction os_area_flash_readfunction os_area_flash_writefunction os_area_set_propertyfunction os_area_get_propertyfunction dump_fieldfunction _dump_headerfunction _dump_paramsfunction verify_headerfunction db_verifyfunction db_align_upfunction db_for_each_64function db_delete_64function db_set_64function db_get_64function db_get_rtc_difffunction _dump_dbfunction os_area_db_initfunction update_flash_dbfunction os_area_queue_work_handlerfunction os_area_queue_workfunction ps3_os_area_initfunction ps3_os_area_initfunction ps3_os_area_get_rtc_difffunction ps3_os_area_set_rtc_difffunction ps3_os_area_get_av_multi_outexport ps3_os_area_flash_registerexport ps3_os_area_get_rtc_diffexport ps3_os_area_set_rtc_diffexport ps3_os_area_get_av_multi_out
Annotated Snippet
struct os_area_header {
u8 magic_num[16];
u32 hdr_version;
u32 db_area_offset;
u32 ldr_area_offset;
u32 _reserved_1;
u32 ldr_format;
u32 ldr_size;
u32 _reserved_2[6];
};
enum os_area_boot_flag {
PARAM_BOOT_FLAG_GAME_OS = 0,
PARAM_BOOT_FLAG_OTHER_OS = 1,
};
enum os_area_ctrl_button {
PARAM_CTRL_BUTTON_O_IS_YES = 0,
PARAM_CTRL_BUTTON_X_IS_YES = 1,
};
/**
* struct os_area_params - os area params segment.
* @boot_flag: User preference of operating system, PARAM_BOOT_FLAG flag.
* @num_params: Number of params in this (params) segment.
* @rtc_diff: Difference in seconds between 1970 and the ps3 rtc value.
* @av_multi_out: User preference of AV output, PARAM_AV_MULTI_OUT flag.
* @ctrl_button: User preference of controller button config, PARAM_CTRL_BUTTON
* flag.
* @static_ip_addr: User preference of static IP address.
* @network_mask: User preference of static network mask.
* @default_gateway: User preference of static default gateway.
* @dns_primary: User preference of static primary dns server.
* @dns_secondary: User preference of static secondary dns server.
*
* The ps3 rtc maintains a read-only value that approximates seconds since
* 2000-01-01 00:00:00 UTC.
*
* User preference of zero for static_ip_addr means use dhcp.
*/
struct os_area_params {
u32 boot_flag;
u32 _reserved_1[3];
u32 num_params;
u32 _reserved_2[3];
/* param 0 */
s64 rtc_diff;
u8 av_multi_out;
u8 ctrl_button;
u8 _reserved_3[6];
/* param 1 */
u8 static_ip_addr[4];
u8 network_mask[4];
u8 default_gateway[4];
u8 _reserved_4[4];
/* param 2 */
u8 dns_primary[4];
u8 dns_secondary[4];
u8 _reserved_5[8];
};
#define OS_AREA_DB_MAGIC_NUM "-db-"
/**
* struct os_area_db - Shared flash memory database.
* @magic_num: Always '-db-'.
* @version: os_area_db format version number.
* @index_64: byte offset of the database id index for 64 bit variables.
* @count_64: number of usable 64 bit index entries
* @index_32: byte offset of the database id index for 32 bit variables.
* @count_32: number of usable 32 bit index entries
* @index_16: byte offset of the database id index for 16 bit variables.
* @count_16: number of usable 16 bit index entries
*
* Flash rom storage for exclusive use by guests running in the other os lpar.
* The current system configuration allocates 1K (two segments) for other os
* use.
*/
struct os_area_db {
u8 magic_num[4];
u16 version;
u16 _reserved_1;
u16 index_64;
u16 count_64;
u16 index_32;
u16 count_32;
u16 index_16;
u16 count_16;
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/io.h`, `linux/workqueue.h`, `linux/fs.h`, `linux/syscalls.h`, `linux/export.h`, `linux/ctype.h`, `linux/memblock.h`.
- Detected declarations: `struct os_area_header`, `struct os_area_params`, `struct os_area_db`, `struct os_area_db_id`, `struct db_index`, `struct db_iterator`, `enum os_area_ldr_format`, `enum os_area_boot_flag`, `enum os_area_ctrl_button`, `enum os_area_db_owner`.
- Atlas domain: Architecture Layer / arch/powerpc.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.