Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
os-area.c File Reference
#include <linux/kernel.h>
#include <linux/io.h>
#include <linux/workqueue.h>
#include <linux/fs.h>
#include <linux/syscalls.h>
#include <linux/export.h>
#include <linux/ctype.h>
#include <linux/memblock.h>
#include <linux/of.h>
#include <linux/slab.h>
#include <asm/prom.h>
#include "platform.h"

Go to the source code of this file.

Data Structures

struct  os_area_header
 
struct  os_area_params
 
struct  os_area_db
 
struct  os_area_db_id
 
struct  saved_params
 
struct  db_index
 
struct  db_iterator
 

Macros

#define OS_AREA_HEADER_MAGIC_NUM   "cell_ext_os_area"
 
#define OS_AREA_DB_MAGIC_NUM   "-db-"
 
#define SECONDS_FROM_1970_TO_2000   946684800LL
 
#define dump_header(_a)   _dump_header(_a, __func__, __LINE__)
 
#define dump_params(_a)   _dump_params(_a, __func__, __LINE__)
 
#define dump_db(a)   _dump_db(a, __func__, __LINE__)
 

Enumerations

enum  { OS_AREA_SEGMENT_SIZE = 0X200 }
 
enum  os_area_ldr_format { HEADER_LDR_FORMAT_RAW = 0, HEADER_LDR_FORMAT_GZIP = 1 }
 
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 }
 
enum  os_area_db_owner {
  OS_AREA_DB_OWNER_ANY = -1, OS_AREA_DB_OWNER_NONE = 0, OS_AREA_DB_OWNER_PROTOTYPE = 1, OS_AREA_DB_OWNER_LINUX = 2,
  OS_AREA_DB_OWNER_PETITBOOT = 3, OS_AREA_DB_OWNER_MAX = 32
}
 
enum  os_area_db_key {
  OS_AREA_DB_KEY_ANY = -1, OS_AREA_DB_KEY_NONE = 0, OS_AREA_DB_KEY_RTC_DIFF = 1, OS_AREA_DB_KEY_VIDEO_MODE = 2,
  OS_AREA_DB_KEY_MAX = 8
}
 

Functions

void ps3_os_area_flash_register (const struct ps3_os_area_flash_ops *ops)
 
 EXPORT_SYMBOL_GPL (ps3_os_area_flash_register)
 
void __init ps3_os_area_save_params (void)
 
void __init ps3_os_area_init (void)
 
u64 ps3_os_area_get_rtc_diff (void)
 
 EXPORT_SYMBOL_GPL (ps3_os_area_get_rtc_diff)
 
void ps3_os_area_set_rtc_diff (u64 rtc_diff)
 
 EXPORT_SYMBOL_GPL (ps3_os_area_set_rtc_diff)
 
enum ps3_param_av_multi_out ps3_os_area_get_av_multi_out (void)
 
 EXPORT_SYMBOL_GPL (ps3_os_area_get_av_multi_out)
 

Variables

struct saved_params saved_params
 

Macro Definition Documentation

#define dump_db (   a)    _dump_db(a, __func__, __LINE__)

Definition at line 542 of file os-area.c.

#define dump_header (   _a)    _dump_header(_a, __func__, __LINE__)

Definition at line 322 of file os-area.c.

#define dump_params (   _a)    _dump_params(_a, __func__, __LINE__)

Definition at line 343 of file os-area.c.

#define OS_AREA_DB_MAGIC_NUM   "-db-"

Definition at line 124 of file os-area.c.

#define OS_AREA_HEADER_MAGIC_NUM   "cell_ext_os_area"

Definition at line 45 of file os-area.c.

#define SECONDS_FROM_1970_TO_2000   946684800LL

Definition at line 202 of file os-area.c.

Enumeration Type Documentation

anonymous enum
Enumerator:
OS_AREA_SEGMENT_SIZE 

Definition at line 36 of file os-area.c.

Enumerator:
PARAM_BOOT_FLAG_GAME_OS 
PARAM_BOOT_FLAG_OTHER_OS 

Definition at line 73 of file os-area.c.

Enumerator:
PARAM_CTRL_BUTTON_O_IS_YES 
PARAM_CTRL_BUTTON_X_IS_YES 

Definition at line 78 of file os-area.c.

Enumerator:
OS_AREA_DB_KEY_ANY 
OS_AREA_DB_KEY_NONE 
OS_AREA_DB_KEY_RTC_DIFF 
OS_AREA_DB_KEY_VIDEO_MODE 
OS_AREA_DB_KEY_MAX 

Definition at line 169 of file os-area.c.

enum os_area_db_owner - Data owners.

Enumerator:
OS_AREA_DB_OWNER_ANY 
OS_AREA_DB_OWNER_NONE 
OS_AREA_DB_OWNER_PROTOTYPE 
OS_AREA_DB_OWNER_LINUX 
OS_AREA_DB_OWNER_PETITBOOT 
OS_AREA_DB_OWNER_MAX 

Definition at line 160 of file os-area.c.

Enumerator:
HEADER_LDR_FORMAT_RAW 
HEADER_LDR_FORMAT_GZIP 

Definition at line 40 of file os-area.c.

Function Documentation

EXPORT_SYMBOL_GPL ( ps3_os_area_flash_register  )
EXPORT_SYMBOL_GPL ( ps3_os_area_get_rtc_diff  )
EXPORT_SYMBOL_GPL ( ps3_os_area_set_rtc_diff  )
EXPORT_SYMBOL_GPL ( ps3_os_area_get_av_multi_out  )
void ps3_os_area_flash_register ( const struct ps3_os_area_flash_ops ops)

Definition at line 236 of file os-area.c.

enum ps3_param_av_multi_out ps3_os_area_get_av_multi_out ( void  )

ps3_os_area_get_av_multi_out - Returns the default video mode.

Definition at line 847 of file os-area.c.

u64 ps3_os_area_get_rtc_diff ( void  )

ps3_os_area_get_rtc_diff - Returns the rtc diff value.

Definition at line 821 of file os-area.c.

void __init ps3_os_area_init ( void  )

ps3_os_area_init - Setup os area device tree properties as needed.

Definition at line 789 of file os-area.c.

void __init ps3_os_area_save_params ( void  )

ps3_os_area_save_params - Copy data from os area mirror to .

For the convenience of the guest the HV makes a copy of the os area in flash to a high address in the boot memory region and then puts that RAM address and the byte count into the repository for retrieval by the guest. We copy the data we want into a static variable and allow the memory setup by the HV to be claimed by the memblock manager.

The os area mirror will not be available to a second stage kernel, and the header verify will fail. In this case, the saved_params values will be set from flash memory or the passed in device tree in ps3_os_area_init().

Definition at line 734 of file os-area.c.

void ps3_os_area_set_rtc_diff ( u64  rtc_diff)

ps3_os_area_set_rtc_diff - Set the rtc diff value.

An asynchronous write is needed to support writing updates from the timer interrupt context.

Definition at line 834 of file os-area.c.

Variable Documentation