Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
ipl.c File Reference
#include <linux/types.h>
#include <linux/module.h>
#include <linux/device.h>
#include <linux/delay.h>
#include <linux/reboot.h>
#include <linux/ctype.h>
#include <linux/fs.h>
#include <linux/gfp.h>
#include <linux/crash_dump.h>
#include <linux/debug_locks.h>
#include <asm/ipl.h>
#include <asm/smp.h>
#include <asm/setup.h>
#include <asm/cpcmd.h>
#include <asm/cio.h>
#include <asm/ebcdic.h>
#include <asm/reset.h>
#include <asm/sclp.h>
#include <asm/checksum.h>
#include <asm/debug.h>
#include <asm/os_info.h>
#include "entry.h"

Go to the source code of this file.

Data Structures

struct  shutdown_trigger
 
struct  shutdown_action
 

Macros

#define IPL_PARM_BLOCK_VERSION   0
 
#define IPL_UNKNOWN_STR   "unknown"
 
#define IPL_CCW_STR   "ccw"
 
#define IPL_FCP_STR   "fcp"
 
#define IPL_FCP_DUMP_STR   "fcp_dump"
 
#define IPL_NSS_STR   "nss"
 
#define DUMP_CCW_STR   "ccw"
 
#define DUMP_FCP_STR   "fcp"
 
#define DUMP_NONE_STR   "none"
 
#define ON_PANIC_STR   "on_panic"
 
#define ON_HALT_STR   "on_halt"
 
#define ON_POFF_STR   "on_poff"
 
#define ON_REIPL_STR   "on_reboot"
 
#define ON_RESTART_STR   "on_restart"
 
#define SHUTDOWN_ACTION_IPL_STR   "ipl"
 
#define SHUTDOWN_ACTION_REIPL_STR   "reipl"
 
#define SHUTDOWN_ACTION_DUMP_STR   "dump"
 
#define SHUTDOWN_ACTION_VMCMD_STR   "vmcmd"
 
#define SHUTDOWN_ACTION_STOP_STR   "stop"
 
#define SHUTDOWN_ACTION_DUMP_REIPL_STR   "dump_reipl"
 
#define DEFINE_IPL_ATTR_RO(_prefix, _name, _format, _value)
 
#define DEFINE_IPL_ATTR_RW(_prefix, _name, _fmt_out, _fmt_in, _value)
 
#define DEFINE_IPL_ATTR_STR_RW(_prefix, _name, _fmt_out, _fmt_in, _value)
 
#define SHUTDOWN_ACTIONS_COUNT   (sizeof(shutdown_actions_list) / sizeof(void *))
 

Enumerations

enum  dump_type { DUMP_TYPE_NONE = 1, DUMP_TYPE_CCW = 2, DUMP_TYPE_FCP = 4 }
 
enum  ipl_method {
  REIPL_METHOD_CCW_CIO, REIPL_METHOD_CCW_DIAG, REIPL_METHOD_CCW_VM, REIPL_METHOD_FCP_RO_DIAG,
  REIPL_METHOD_FCP_RW_DIAG, REIPL_METHOD_FCP_RO_VM, REIPL_METHOD_FCP_DUMP, REIPL_METHOD_NSS,
  REIPL_METHOD_NSS_DIAG, REIPL_METHOD_DEFAULT
}
 
enum  dump_method {
  DUMP_METHOD_NONE, DUMP_METHOD_CCW_CIO, DUMP_METHOD_CCW_DIAG, DUMP_METHOD_CCW_VM,
  DUMP_METHOD_FCP_DIAG
}
 

Functions

int diag308 (unsigned long subcode, void *addr)
 
 EXPORT_SYMBOL_GPL (diag308)
 
 EXPORT_SYMBOL_GPL (ipl_info)
 
size_t append_ipl_vmparm (char *dest, size_t size)
 
size_t append_ipl_scpdata (char *dest, size_t len)
 
 DEFINE_IPL_ATTR_RO (ipl_nss, name,"%s\n", kernel_nss_name)
 
 DEFINE_IPL_ATTR_RW (reipl_fcp, wwpn,"0x%016llx\n","%016llx\n", reipl_block_fcp->ipl_info.fcp.wwpn)
 
 DEFINE_IPL_ATTR_RW (reipl_fcp, lun,"0x%016llx\n","%016llx\n", reipl_block_fcp->ipl_info.fcp.lun)
 
 DEFINE_IPL_ATTR_RW (reipl_fcp, bootprog,"%lld\n","%lld\n", reipl_block_fcp->ipl_info.fcp.bootprog)
 
 DEFINE_IPL_ATTR_RW (reipl_fcp, br_lba,"%lld\n","%lld\n", reipl_block_fcp->ipl_info.fcp.br_lba)
 
 DEFINE_IPL_ATTR_RW (reipl_fcp, device,"0.0.%04llx\n","0.0.%llx\n", reipl_block_fcp->ipl_info.fcp.devno)
 
 DEFINE_IPL_ATTR_RW (reipl_ccw, device,"0.0.%04llx\n","0.0.%llx\n", reipl_block_ccw->ipl_info.ccw.devno)
 
 DEFINE_IPL_ATTR_RW (dump_fcp, wwpn,"0x%016llx\n","%016llx\n", dump_block_fcp->ipl_info.fcp.wwpn)
 
 DEFINE_IPL_ATTR_RW (dump_fcp, lun,"0x%016llx\n","%016llx\n", dump_block_fcp->ipl_info.fcp.lun)
 
 DEFINE_IPL_ATTR_RW (dump_fcp, bootprog,"%lld\n","%lld\n", dump_block_fcp->ipl_info.fcp.bootprog)
 
 DEFINE_IPL_ATTR_RW (dump_fcp, br_lba,"%lld\n","%lld\n", dump_block_fcp->ipl_info.fcp.br_lba)
 
 DEFINE_IPL_ATTR_RW (dump_fcp, device,"0.0.%04llx\n","0.0.%llx\n", dump_block_fcp->ipl_info.fcp.devno)
 
 DEFINE_IPL_ATTR_RW (dump_ccw, device,"0.0.%04llx\n","0.0.%llx\n", dump_block_ccw->ipl_info.ccw.devno)
 
 DEFINE_IPL_ATTR_STR_RW (vmcmd, on_reboot,"%s\n","%s\n", vmcmd_on_reboot)
 
 DEFINE_IPL_ATTR_STR_RW (vmcmd, on_panic,"%s\n","%s\n", vmcmd_on_panic)
 
 DEFINE_IPL_ATTR_STR_RW (vmcmd, on_halt,"%s\n","%s\n", vmcmd_on_halt)
 
 DEFINE_IPL_ATTR_STR_RW (vmcmd, on_poff,"%s\n","%s\n", vmcmd_on_poff)
 
 DEFINE_IPL_ATTR_STR_RW (vmcmd, on_restart,"%s\n","%s\n", vmcmd_on_restart)
 
void do_restart (void)
 
 __initcall (s390_ipl_init)
 
 __setup ("vmreboot=", vmcmd_on_reboot_setup)
 
void __init setup_ipl (void)
 
void __init ipl_update_parameters (void)
 
void __init ipl_save_parameters (void)
 
void register_reset_call (struct reset_call *reset)
 
 EXPORT_SYMBOL_GPL (register_reset_call)
 
void unregister_reset_call (struct reset_call *reset)
 
 EXPORT_SYMBOL_GPL (unregister_reset_call)
 
void s390_reset_system (void(*func)(void *), void *data)
 

Variables

struct ipl_info ipl_info
 
IPL_PARMBLOCK_START ipl_info fcp wwpn
 
IPL_PARMBLOCK_START ipl_info fcp lun
 
IPL_PARMBLOCK_START ipl_info fcp bootprog
 
IPL_PARMBLOCK_START ipl_info fcp br_lba
 
void(* _machine_restart )(char *command) = do_machine_restart
 
void(* _machine_halt )(void) = do_machine_halt
 
void(* _machine_power_off )(void) = do_machine_power_off
 
u32 dump_prefix_page
 

Macro Definition Documentation

#define DEFINE_IPL_ATTR_RO (   _prefix,
  _name,
  _format,
  _value 
)
Value:
static ssize_t sys_##_prefix##_##_name##_show(struct kobject *kobj, \
struct kobj_attribute *attr, \
char *page) \
{ \
return sprintf(page, _format, _value); \
} \
static struct kobj_attribute sys_##_prefix##_##_name##_attr = \
__ATTR(_name, S_IRUGO, sys_##_prefix##_##_name##_show, NULL);

Definition at line 185 of file ipl.c.

#define DEFINE_IPL_ATTR_RW (   _prefix,
  _name,
  _fmt_out,
  _fmt_in,
  _value 
)
Value:
static ssize_t sys_##_prefix##_##_name##_show(struct kobject *kobj, \
struct kobj_attribute *attr, \
char *page) \
{ \
return sprintf(page, _fmt_out, \
(unsigned long long) _value); \
} \
static ssize_t sys_##_prefix##_##_name##_store(struct kobject *kobj, \
struct kobj_attribute *attr, \
const char *buf, size_t len) \
{ \
unsigned long long value; \
if (sscanf(buf, _fmt_in, &value) != 1) \
return -EINVAL; \
_value = value; \
return len; \
} \
static struct kobj_attribute sys_##_prefix##_##_name##_attr = \
__ATTR(_name,(S_IRUGO | S_IWUSR), \
sys_##_prefix##_##_name##_show, \
sys_##_prefix##_##_name##_store);

Definition at line 195 of file ipl.c.

#define DEFINE_IPL_ATTR_STR_RW (   _prefix,
  _name,
  _fmt_out,
  _fmt_in,
  _value 
)
Value:
static ssize_t sys_##_prefix##_##_name##_show(struct kobject *kobj, \
struct kobj_attribute *attr, \
char *page) \
{ \
return sprintf(page, _fmt_out, _value); \
} \
static ssize_t sys_##_prefix##_##_name##_store(struct kobject *kobj, \
struct kobj_attribute *attr, \
const char *buf, size_t len) \
{ \
strncpy(_value, buf, sizeof(_value) - 1); \
strim(_value); \
return len; \
} \
static struct kobj_attribute sys_##_prefix##_##_name##_attr = \
__ATTR(_name,(S_IRUGO | S_IWUSR), \
sys_##_prefix##_##_name##_show, \
sys_##_prefix##_##_name##_store);

Definition at line 218 of file ipl.c.

#define DUMP_CCW_STR   "ccw"

Definition at line 41 of file ipl.c.

#define DUMP_FCP_STR   "fcp"

Definition at line 42 of file ipl.c.

#define DUMP_NONE_STR   "none"

Definition at line 43 of file ipl.c.

#define IPL_CCW_STR   "ccw"

Definition at line 36 of file ipl.c.

#define IPL_FCP_DUMP_STR   "fcp_dump"

Definition at line 38 of file ipl.c.

#define IPL_FCP_STR   "fcp"

Definition at line 37 of file ipl.c.

#define IPL_NSS_STR   "nss"

Definition at line 39 of file ipl.c.

#define IPL_PARM_BLOCK_VERSION   0

Definition at line 33 of file ipl.c.

#define IPL_UNKNOWN_STR   "unknown"

Definition at line 35 of file ipl.c.

#define ON_HALT_STR   "on_halt"

Definition at line 54 of file ipl.c.

#define ON_PANIC_STR   "on_panic"

Definition at line 53 of file ipl.c.

#define ON_POFF_STR   "on_poff"

Definition at line 55 of file ipl.c.

#define ON_REIPL_STR   "on_reboot"

Definition at line 56 of file ipl.c.

#define ON_RESTART_STR   "on_restart"

Definition at line 57 of file ipl.c.

#define SHUTDOWN_ACTION_DUMP_REIPL_STR   "dump_reipl"

Definition at line 73 of file ipl.c.

#define SHUTDOWN_ACTION_DUMP_STR   "dump"

Definition at line 70 of file ipl.c.

#define SHUTDOWN_ACTION_IPL_STR   "ipl"

Definition at line 68 of file ipl.c.

#define SHUTDOWN_ACTION_REIPL_STR   "reipl"

Definition at line 69 of file ipl.c.

#define SHUTDOWN_ACTION_STOP_STR   "stop"

Definition at line 72 of file ipl.c.

#define SHUTDOWN_ACTION_VMCMD_STR   "vmcmd"

Definition at line 71 of file ipl.c.

#define SHUTDOWN_ACTIONS_COUNT   (sizeof(shutdown_actions_list) / sizeof(void *))

Definition at line 1639 of file ipl.c.

Enumeration Type Documentation

Enumerator:
DUMP_METHOD_NONE 
DUMP_METHOD_CCW_CIO 
DUMP_METHOD_CCW_DIAG 
DUMP_METHOD_CCW_VM 
DUMP_METHOD_FCP_DIAG 

Definition at line 139 of file ipl.c.

enum dump_type
Enumerator:
DUMP_TYPE_NONE 
DUMP_TYPE_CCW 
DUMP_TYPE_FCP 

Definition at line 99 of file ipl.c.

enum ipl_method
Enumerator:
REIPL_METHOD_CCW_CIO 
REIPL_METHOD_CCW_DIAG 
REIPL_METHOD_CCW_VM 
REIPL_METHOD_FCP_RO_DIAG 
REIPL_METHOD_FCP_RW_DIAG 
REIPL_METHOD_FCP_RO_VM 
REIPL_METHOD_FCP_DUMP 
REIPL_METHOD_NSS 
REIPL_METHOD_NSS_DIAG 
REIPL_METHOD_DEFAULT 

Definition at line 126 of file ipl.c.

Function Documentation

__initcall ( s390_ipl_init  )
__setup ( )
size_t append_ipl_scpdata ( char dest,
size_t  len 
)

Definition at line 376 of file ipl.c.

size_t append_ipl_vmparm ( char dest,
size_t  size 
)

Definition at line 313 of file ipl.c.

DEFINE_IPL_ATTR_RO ( ipl_nss  ,
name  ,
"%s\n"  ,
kernel_nss_name   
)
DEFINE_IPL_ATTR_RW ( reipl_fcp  ,
wwpn  ,
"0x%016llx\n"  ,
"%016llx\n"  ,
reipl_block_fcp->ipl_info.fcp.  wwpn 
)
DEFINE_IPL_ATTR_RW ( reipl_fcp  ,
lun  ,
"0x%016llx\n"  ,
"%016llx\n"  ,
reipl_block_fcp->ipl_info.fcp.  lun 
)
DEFINE_IPL_ATTR_RW ( reipl_fcp  ,
bootprog  ,
"%lld\n"  ,
"%lld\n"  ,
reipl_block_fcp->ipl_info.fcp.  bootprog 
)
DEFINE_IPL_ATTR_RW ( reipl_fcp  ,
br_lba  ,
"%lld\n"  ,
"%lld\n"  ,
reipl_block_fcp->ipl_info.fcp.  br_lba 
)
DEFINE_IPL_ATTR_RW ( reipl_fcp  ,
device  ,
"0.0.%04llx\n"  ,
"0.0.%llx\n"  ,
reipl_block_fcp->ipl_info.fcp.  devno 
)
DEFINE_IPL_ATTR_RW ( reipl_ccw  ,
device  ,
"0.0.%04llx\n"  ,
"0.0.%llx\n"  ,
reipl_block_ccw->ipl_info.ccw.  devno 
)
DEFINE_IPL_ATTR_RW ( dump_fcp  ,
wwpn  ,
"0x%016llx\n"  ,
"%016llx\n"  ,
dump_block_fcp->ipl_info.fcp.  wwpn 
)
DEFINE_IPL_ATTR_RW ( dump_fcp  ,
lun  ,
"0x%016llx\n"  ,
"%016llx\n"  ,
dump_block_fcp->ipl_info.fcp.  lun 
)
DEFINE_IPL_ATTR_RW ( dump_fcp  ,
bootprog  ,
"%lld\n"  ,
"%lld\n"  ,
dump_block_fcp->ipl_info.fcp.  bootprog 
)
DEFINE_IPL_ATTR_RW ( dump_fcp  ,
br_lba  ,
"%lld\n"  ,
"%lld\n"  ,
dump_block_fcp->ipl_info.fcp.  br_lba 
)
DEFINE_IPL_ATTR_RW ( dump_fcp  ,
device  ,
"0.0.%04llx\n"  ,
"0.0.%llx\n"  ,
dump_block_fcp->ipl_info.fcp.  devno 
)
DEFINE_IPL_ATTR_RW ( dump_ccw  ,
device  ,
"0.0.%04llx\n"  ,
"0.0.%llx\n"  ,
dump_block_ccw->ipl_info.ccw.  devno 
)
DEFINE_IPL_ATTR_STR_RW ( vmcmd  ,
on_reboot  ,
"%s\n"  ,
"%s\n"  ,
vmcmd_on_reboot   
)
DEFINE_IPL_ATTR_STR_RW ( vmcmd  ,
on_panic  ,
"%s\n"  ,
"%s\n"  ,
vmcmd_on_panic   
)
DEFINE_IPL_ATTR_STR_RW ( vmcmd  ,
on_halt  ,
"%s\n"  ,
"%s\n"  ,
vmcmd_on_halt   
)
DEFINE_IPL_ATTR_STR_RW ( vmcmd  ,
on_poff  ,
"%s\n"  ,
"%s\n"  ,
vmcmd_on_poff   
)
DEFINE_IPL_ATTR_STR_RW ( vmcmd  ,
on_restart  ,
"%s\n"  ,
"%s\n"  ,
vmcmd_on_restart   
)
int diag308 ( unsigned long  subcode,
void addr 
)

Definition at line 168 of file ipl.c.

void do_restart ( void  )

Definition at line 1753 of file ipl.c.

EXPORT_SYMBOL_GPL ( diag308  )
EXPORT_SYMBOL_GPL ( ipl_info  )
EXPORT_SYMBOL_GPL ( register_reset_call  )
EXPORT_SYMBOL_GPL ( unregister_reset_call  )
void __init ipl_save_parameters ( void  )

Definition at line 1973 of file ipl.c.

void __init ipl_update_parameters ( void  )

Definition at line 1964 of file ipl.c.

void register_reset_call ( struct reset_call reset)

Definition at line 1995 of file ipl.c.

void s390_reset_system ( void(*)(void *)  func,
void data 
)

Definition at line 2027 of file ipl.c.

void __init setup_ipl ( void  )

Definition at line 1937 of file ipl.c.

void unregister_reset_call ( struct reset_call reset)

Definition at line 2003 of file ipl.c.

Variable Documentation

void(* _machine_halt)(void) = do_machine_halt

Definition at line 1788 of file ipl.c.

void(* _machine_power_off)(void) = do_machine_power_off

Definition at line 1817 of file ipl.c.

void(* _machine_restart)(char *command) = do_machine_restart

Definition at line 1692 of file ipl.c.

Definition at line 454 of file ipl.c.

Definition at line 456 of file ipl.c.

u32 dump_prefix_page

Definition at line 2025 of file ipl.c.

Definition at line 269 of file ipl.c.

Definition at line 452 of file ipl.c.

Definition at line 450 of file ipl.c.