-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Michael Holzheu
authored and
Martin Schwidefsky
committed
Aug 22, 2007
1 parent
8fb275e
commit a42a61b
Showing
13 changed files
with
151 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: 37cd0a007f88f1d6269035bdb02b50f536cca8de | ||
refs/heads/master: 0a87c5cfc0bb0c1bdcc1cc9fd82e4a1711fac512 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
/* | ||
* Implementation of s390 diagnose codes | ||
* | ||
* Copyright IBM Corp. 2007 | ||
* Author(s): Michael Holzheu <holzheu@de.ibm.com> | ||
*/ | ||
|
||
#include <linux/module.h> | ||
#include <asm/diag.h> | ||
|
||
/* | ||
* Diagnose 10: Release pages | ||
*/ | ||
void diag10(unsigned long addr) | ||
{ | ||
if (addr >= 0x7ff00000) | ||
return; | ||
asm volatile( | ||
#ifdef CONFIG_64BIT | ||
" sam31\n" | ||
" diag %0,%0,0x10\n" | ||
"0: sam64\n" | ||
#else | ||
" diag %0,%0,0x10\n" | ||
"0:\n" | ||
#endif | ||
EX_TABLE(0b, 0b) | ||
: : "a" (addr)); | ||
} | ||
EXPORT_SYMBOL(diag10); | ||
|
||
/* | ||
* Diagnose 14: Input spool file manipulation | ||
*/ | ||
int diag14(unsigned long rx, unsigned long ry1, unsigned long subcode) | ||
{ | ||
register unsigned long _ry1 asm("2") = ry1; | ||
register unsigned long _ry2 asm("3") = subcode; | ||
int rc = 0; | ||
|
||
asm volatile( | ||
#ifdef CONFIG_64BIT | ||
" sam31\n" | ||
" diag %2,2,0x14\n" | ||
" sam64\n" | ||
#else | ||
" diag %2,2,0x14\n" | ||
#endif | ||
" ipm %0\n" | ||
" srl %0,28\n" | ||
: "=d" (rc), "+d" (_ry2) | ||
: "d" (rx), "d" (_ry1) | ||
: "cc"); | ||
|
||
return rc; | ||
} | ||
EXPORT_SYMBOL(diag14); | ||
|
||
/* | ||
* Diagnose 210: Get information about a virtual device | ||
*/ | ||
int diag210(struct diag210 *addr) | ||
{ | ||
/* | ||
* diag 210 needs its data below the 2GB border, so we | ||
* use a static data area to be sure | ||
*/ | ||
static struct diag210 diag210_tmp; | ||
static DEFINE_SPINLOCK(diag210_lock); | ||
unsigned long flags; | ||
int ccode; | ||
|
||
spin_lock_irqsave(&diag210_lock, flags); | ||
diag210_tmp = *addr; | ||
|
||
#ifdef CONFIG_64BIT | ||
asm volatile( | ||
" lhi %0,-1\n" | ||
" sam31\n" | ||
" diag %1,0,0x210\n" | ||
"0: ipm %0\n" | ||
" srl %0,28\n" | ||
"1: sam64\n" | ||
EX_TABLE(0b, 1b) | ||
: "=&d" (ccode) : "a" (&diag210_tmp) : "cc", "memory"); | ||
#else | ||
asm volatile( | ||
" lhi %0,-1\n" | ||
" diag %1,0,0x210\n" | ||
"0: ipm %0\n" | ||
" srl %0,28\n" | ||
"1:\n" | ||
EX_TABLE(0b, 1b) | ||
: "=&d" (ccode) : "a" (&diag210_tmp) : "cc", "memory"); | ||
#endif | ||
|
||
*addr = diag210_tmp; | ||
spin_unlock_irqrestore(&diag210_lock, flags); | ||
|
||
return ccode; | ||
} | ||
EXPORT_SYMBOL(diag210); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* s390 diagnose functions | ||
* | ||
* Copyright IBM Corp. 2007 | ||
* Author(s): Michael Holzheu <holzheu@de.ibm.com> | ||
*/ | ||
|
||
#ifndef _ASM_S390_DIAG_H | ||
#define _ASM_S390_DIAG_H | ||
|
||
/* | ||
* Diagnose 10: Release pages | ||
*/ | ||
extern void diag10(unsigned long addr); | ||
|
||
/* | ||
* Diagnose 14: Input spool file manipulation | ||
*/ | ||
extern int diag14(unsigned long rx, unsigned long ry1, unsigned long subcode); | ||
|
||
/* | ||
* Diagnose 210: Get information about a virtual device | ||
*/ | ||
struct diag210 { | ||
u16 vrdcdvno; /* device number (input) */ | ||
u16 vrdclen; /* data block length (input) */ | ||
u8 vrdcvcla; /* virtual device class (output) */ | ||
u8 vrdcvtyp; /* virtual device type (output) */ | ||
u8 vrdcvsta; /* virtual device status (output) */ | ||
u8 vrdcvfla; /* virtual device flags (output) */ | ||
u8 vrdcrccl; /* real device class (output) */ | ||
u8 vrdccrty; /* real device type (output) */ | ||
u8 vrdccrmd; /* real device model (output) */ | ||
u8 vrdccrft; /* real device feature (output) */ | ||
} __attribute__((packed, aligned(4))); | ||
|
||
extern int diag210(struct diag210 *addr); | ||
|
||
#endif /* _ASM_S390_DIAG_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters