Minor cleanup of the PS3 file os-area.c:
o Correct file text header.
o Add type names enum os_area_ldr_format, enum os_area_boot_flag,
enum os_area_ctrl_button.
o Change struct os_area_header.magic_num type to u8.
o Add preprocessor macro SECONDS_FROM_1970_TO_2000.
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
- * PS3 'Other OS' area data.
+ * PS3 flash memory os area.
*
* Copyright (C) 2006 Sony Computer Entertainment Inc.
* Copyright 2006 Sony Corp.
*
* Copyright (C) 2006 Sony Computer Entertainment Inc.
* Copyright 2006 Sony Corp.
OS_AREA_SEGMENT_SIZE = 0X200,
};
OS_AREA_SEGMENT_SIZE = 0X200,
};
+enum os_area_ldr_format {
HEADER_LDR_FORMAT_RAW = 0,
HEADER_LDR_FORMAT_GZIP = 1,
};
HEADER_LDR_FORMAT_RAW = 0,
HEADER_LDR_FORMAT_GZIP = 1,
};
*/
struct os_area_header {
*/
struct os_area_header {
u32 hdr_version;
u32 os_area_offset;
u32 ldr_area_offset;
u32 hdr_version;
u32 os_area_offset;
u32 ldr_area_offset;
+enum os_area_boot_flag {
PARAM_BOOT_FLAG_GAME_OS = 0,
PARAM_BOOT_FLAG_OTHER_OS = 1,
};
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,
};
PARAM_CTRL_BUTTON_O_IS_YES = 0,
PARAM_CTRL_BUTTON_X_IS_YES = 1,
};
* @dns_primary: User preference of static primary dns server.
* @dns_secondary: User preference of static secondary dns server.
*
* @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.
*/
* User preference of zero for static_ip_addr means use dhcp.
*/
+#define SECONDS_FROM_1970_TO_2000 946684800LL
+
/**
* struct saved_params - Static working copies of data from the 'Other OS' area.
*
/**
* struct saved_params - Static working copies of data from the 'Other OS' area.
*
}
header = (struct os_area_header *)__va(lpar_addr);
}
header = (struct os_area_header *)__va(lpar_addr);
- params = (struct os_area_params *)__va(lpar_addr + OS_AREA_SEGMENT_SIZE);
+ params = (struct os_area_params *)__va(lpar_addr
+ + OS_AREA_SEGMENT_SIZE);
result = verify_header(header);
result = verify_header(header);
- * ps3_os_area_rtc_diff - Returns the ps3 rtc diff value.
- *
- * The ps3 rtc maintains a value that approximates seconds since
- * 2000-01-01 00:00:00 UTC. Returns the exact number of seconds from 1970 to
- * 2000 when saved_params.rtc_diff has not been properly set up.
+ * ps3_os_area_rtc_diff - Returns the rtc diff value.
*/
u64 ps3_os_area_rtc_diff(void)
{
*/
u64 ps3_os_area_rtc_diff(void)
{
- return saved_params.rtc_diff ? saved_params.rtc_diff : 946684800UL;
+ return saved_params.rtc_diff ? saved_params.rtc_diff
+ : SECONDS_FROM_1970_TO_2000;