Command SubSystem: Difference between revisions

Jump to navigation Jump to search
no edit summary
[unchecked revision][unchecked revision]
(Created page with "The command subsystem is responsible of handling command programs and routing programs and actions to specific devices. It works as if it was a big device which has DMA. The ...")
 
No edit summary
Line 46:
=== Enable (0x27) ===
Used mostly by telnet terminals to request them to be enabled (start listening/activate send mode).
 
== Examples ==
 
=== Start Channel ===
Starts the execution of an ORB which will be executed on the given device.
<source lang="c">
// cc=0 - operational
// cc=3 - not available/device was taken off
int css_start_channel(
struct css_schid schid,
struct css_orb *schib)
{
register struct css_schid r1 __asm__("1") = schid;
int cc = -1;
__asm__ __volatile__(
"ssch 0(%1)\n"
"ipm %0\n"
: "+d"(cc)
: "a"(schib), "d"(r1), "m"(schib)
: "cc", "memory");
return cc >> 28;
}
</source>
 
=== Store Channel ===
<source lang="c">
// cc=0 - operational
// cc=3 - not available/device was taken off
int css_store_channel(
struct css_schid schid,
void *schib)
{
register struct css_schid r1 __asm__("1") = schid;
int cc = -1;
__asm__ __volatile__(
"stsch 0(%2)\n"
"ipm %0"
: "+d"(cc), "=m"(*schib)
: "a"(schib), "d"(r1)
: "cc", "memory");
return cc >> 28;
}
</source>
 
=== Modify Channel ===
Modify channel parameters.
<source lang="c">
// cc=0 - operational
// cc=3 - not available/device was taken off
int css_modify_channel(
struct css_schid schid,
struct css_schib *schib)
{
register struct css_schid r1 __asm__("1") = schid;
int cc = -1;
__asm__ __volatile__(
"msch 0(%2)\n"
"ipm %0"
: "+d"(cc), "=m"(*schib)
: "a"(schib), "d"(r1)
: "cc", "memory");
return cc >> 28;
}
</source>
 
=== Test Channel ===
Usually used to obtain the status of a device after an execution/action.
<source lang="c">
// cc=0 - operational
// cc=3 - not available/device was taken off
int css_test_channel(
struct css_schid schid,
struct css_irb *schib)
{
register struct css_schid r1 __asm__("1") = schid;
int cc = -1;
__asm__ __volatile__(
"tsch 0(%2)\n"
"ipm %0"
: "+d"(cc), "=m"(*schib)
: "a"(schib), "d"(r1)
: "cc", "memory");
return cc >> 28;
}
</source>
 
[[Category:S390]]
170

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu