arch/powerpc/include/asm/ps3.h

Source file repositories/reference/linux-study-clean/arch/powerpc/include/asm/ps3.h

File Facts

System
Linux kernel
Corpus path
arch/powerpc/include/asm/ps3.h
Extension
.h
Size
15315 bytes
Lines
523
Domain
Architecture Layer
Bucket
arch/powerpc
Inferred role
Architecture Layer: operation-table or driver-model contract
Status
pattern 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.

Dependency Surface

Detected Declarations

Annotated Snippet

struct device_driver core;
	int (*probe)(struct ps3_system_bus_device *);
	void (*remove)(struct ps3_system_bus_device *);
	void (*shutdown)(struct ps3_system_bus_device *);
/*	int (*suspend)(struct ps3_system_bus_device *, pm_message_t); */
/*	int (*resume)(struct ps3_system_bus_device *); */
};

int ps3_system_bus_device_register(struct ps3_system_bus_device *dev);
int ps3_system_bus_driver_register(struct ps3_system_bus_driver *drv);
void ps3_system_bus_driver_unregister(struct ps3_system_bus_driver *drv);

#define ps3_drv_to_system_bus_drv(_drv) container_of_const(_drv, struct ps3_system_bus_driver, core)
static inline struct ps3_system_bus_device *ps3_dev_to_system_bus_dev(
	const struct device *_dev)
{
	return container_of(_dev, struct ps3_system_bus_device, core);
}
static inline struct ps3_system_bus_driver *
	ps3_system_bus_dev_to_system_bus_drv(struct ps3_system_bus_device *_dev)
{
	BUG_ON(!_dev);
	BUG_ON(!_dev->core.driver);
	return ps3_drv_to_system_bus_drv(_dev->core.driver);
}

/**
 * ps3_system_bus_set_drvdata - set driver's private data for this device
 * @dev: device structure
 * @data: Data to set
 */

static inline void ps3_system_bus_set_drvdata(
	struct ps3_system_bus_device *dev, void *data)
{
	dev_set_drvdata(&dev->core, data);
}
static inline void *ps3_system_bus_get_drvdata(
	struct ps3_system_bus_device *dev)
{
	return dev_get_drvdata(&dev->core);
}

/* system manager */

struct ps3_sys_manager_ops {
	struct ps3_system_bus_device *dev;
	void (*power_off)(struct ps3_system_bus_device *dev);
	void (*restart)(struct ps3_system_bus_device *dev);
};

void ps3_sys_manager_register_ops(const struct ps3_sys_manager_ops *ops);
void __noreturn ps3_sys_manager_power_off(void);
void __noreturn ps3_sys_manager_restart(void);
void __noreturn ps3_sys_manager_halt(void);
int ps3_sys_manager_get_wol(void);
void ps3_sys_manager_set_wol(int state);

struct ps3_prealloc {
    const char *name;
    void *address;
    unsigned long size;
    unsigned long align;
};

extern struct ps3_prealloc ps3fb_videomemory;
extern struct ps3_prealloc ps3flash_bounce_buffer;

/* logical performance monitor */

/**
 * enum ps3_lpm_rights - Rigths granted by the system policy module.
 *
 * @PS3_LPM_RIGHTS_USE_LPM: The right to use the lpm.
 * @PS3_LPM_RIGHTS_USE_TB: The right to use the internal trace buffer.
 */

enum ps3_lpm_rights {
	PS3_LPM_RIGHTS_USE_LPM = 0x001,
	PS3_LPM_RIGHTS_USE_TB = 0x100,
};

/**
 * enum ps3_lpm_tb_type - Type of trace buffer lv1 should use.
 *
 * @PS3_LPM_TB_TYPE_NONE: Do not use a trace buffer.
 * @PS3_LPM_TB_TYPE_INTERNAL: Use the lv1 internal trace buffer.  Must have
 *  rights @PS3_LPM_RIGHTS_USE_TB.
 */

Annotation

Implementation Notes