2005-04-17 06:20:36 +08:00
|
|
|
/*
|
|
|
|
* include/asm-s390/sigp.h
|
|
|
|
*
|
|
|
|
* S390 version
|
|
|
|
* Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
|
|
|
|
* Author(s): Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com),
|
|
|
|
* Martin Schwidefsky (schwidefsky@de.ibm.com)
|
|
|
|
* Heiko Carstens (heiko.carstens@de.ibm.com)
|
|
|
|
*
|
|
|
|
* sigp.h by D.J. Barrow (c) IBM 1999
|
|
|
|
* contains routines / structures for signalling other S/390 processors in an
|
|
|
|
* SMP configuration.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __SIGP__
|
|
|
|
#define __SIGP__
|
|
|
|
|
2010-01-14 03:44:37 +08:00
|
|
|
#include <asm/system.h>
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
/* get real cpu address from logical cpu number */
|
2010-01-14 03:44:35 +08:00
|
|
|
extern int __cpu_logical_map[];
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2010-01-14 03:44:37 +08:00
|
|
|
static inline int cpu_logical_map(int cpu)
|
|
|
|
{
|
|
|
|
#ifdef CONFIG_SMP
|
|
|
|
return __cpu_logical_map[cpu];
|
|
|
|
#else
|
|
|
|
return stap();
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
sigp_unassigned=0x0,
|
|
|
|
sigp_sense,
|
|
|
|
sigp_external_call,
|
|
|
|
sigp_emergency_signal,
|
|
|
|
sigp_start,
|
|
|
|
sigp_stop,
|
|
|
|
sigp_restart,
|
|
|
|
sigp_unassigned1,
|
|
|
|
sigp_unassigned2,
|
|
|
|
sigp_stop_and_store_status,
|
|
|
|
sigp_unassigned3,
|
|
|
|
sigp_initial_cpu_reset,
|
|
|
|
sigp_cpu_reset,
|
|
|
|
sigp_set_prefix,
|
|
|
|
sigp_store_status_at_address,
|
|
|
|
sigp_store_extended_status_at_address
|
|
|
|
} sigp_order_code;
|
|
|
|
|
|
|
|
typedef __u32 sigp_status_word;
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
sigp_order_code_accepted=0,
|
|
|
|
sigp_status_stored,
|
|
|
|
sigp_busy,
|
|
|
|
sigp_not_operational
|
|
|
|
} sigp_ccode;
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Definitions for the external call
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* 'Bit' signals, asynchronous */
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
ec_schedule=0,
|
|
|
|
ec_call_function,
|
2008-12-25 20:38:39 +08:00
|
|
|
ec_call_function_single,
|
2005-04-17 06:20:36 +08:00
|
|
|
ec_bit_last
|
|
|
|
} ec_bit_sig;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Signal processor
|
|
|
|
*/
|
2005-11-09 13:34:42 +08:00
|
|
|
static inline sigp_ccode
|
2005-04-17 06:20:36 +08:00
|
|
|
signal_processor(__u16 cpu_addr, sigp_order_code order_code)
|
|
|
|
{
|
2006-09-28 22:56:43 +08:00
|
|
|
register unsigned long reg1 asm ("1") = 0;
|
2005-04-17 06:20:36 +08:00
|
|
|
sigp_ccode ccode;
|
|
|
|
|
2006-09-28 22:56:43 +08:00
|
|
|
asm volatile(
|
|
|
|
" sigp %1,%2,0(%3)\n"
|
|
|
|
" ipm %0\n"
|
|
|
|
" srl %0,28\n"
|
|
|
|
: "=d" (ccode)
|
2010-01-14 03:44:37 +08:00
|
|
|
: "d" (reg1), "d" (cpu_logical_map(cpu_addr)),
|
2006-09-28 22:56:43 +08:00
|
|
|
"a" (order_code) : "cc" , "memory");
|
2005-04-17 06:20:36 +08:00
|
|
|
return ccode;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Signal processor with parameter
|
|
|
|
*/
|
2005-11-09 13:34:42 +08:00
|
|
|
static inline sigp_ccode
|
2006-09-28 22:56:43 +08:00
|
|
|
signal_processor_p(__u32 parameter, __u16 cpu_addr, sigp_order_code order_code)
|
2005-04-17 06:20:36 +08:00
|
|
|
{
|
2006-09-28 22:56:43 +08:00
|
|
|
register unsigned int reg1 asm ("1") = parameter;
|
2005-04-17 06:20:36 +08:00
|
|
|
sigp_ccode ccode;
|
2006-09-28 22:56:43 +08:00
|
|
|
|
|
|
|
asm volatile(
|
|
|
|
" sigp %1,%2,0(%3)\n"
|
|
|
|
" ipm %0\n"
|
|
|
|
" srl %0,28\n"
|
2005-04-17 06:20:36 +08:00
|
|
|
: "=d" (ccode)
|
2010-01-14 03:44:37 +08:00
|
|
|
: "d" (reg1), "d" (cpu_logical_map(cpu_addr)),
|
2006-09-28 22:56:43 +08:00
|
|
|
"a" (order_code) : "cc" , "memory");
|
2005-04-17 06:20:36 +08:00
|
|
|
return ccode;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Signal processor with parameter and return status
|
|
|
|
*/
|
2005-11-09 13:34:42 +08:00
|
|
|
static inline sigp_ccode
|
2006-09-28 22:56:43 +08:00
|
|
|
signal_processor_ps(__u32 *statusptr, __u32 parameter, __u16 cpu_addr,
|
|
|
|
sigp_order_code order_code)
|
2005-04-17 06:20:36 +08:00
|
|
|
{
|
2006-09-28 22:56:43 +08:00
|
|
|
register unsigned int reg1 asm ("1") = parameter;
|
2005-04-17 06:20:36 +08:00
|
|
|
sigp_ccode ccode;
|
2006-09-28 22:56:43 +08:00
|
|
|
|
|
|
|
asm volatile(
|
|
|
|
" sigp %1,%2,0(%3)\n"
|
|
|
|
" ipm %0\n"
|
|
|
|
" srl %0,28\n"
|
|
|
|
: "=d" (ccode), "+d" (reg1)
|
2010-01-14 03:44:37 +08:00
|
|
|
: "d" (cpu_logical_map(cpu_addr)), "a" (order_code)
|
2006-09-28 22:56:43 +08:00
|
|
|
: "cc" , "memory");
|
|
|
|
*statusptr = reg1;
|
|
|
|
return ccode;
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* __SIGP__ */
|