2 * (C) Copyright 2007-2011 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
4 * This file is released under the GPLv2. See the COPYING file for more
14 * This guest OS has a very simple purpose. It is responsible for
15 * displaying the login splash, prompting the user for a username and
16 * password, and then querying CP to verify that the password is correct.
17 * If correct, CP will detach the rdev from this guest, and attach it to the
20 * +------------------------------------------------+
21 * | +------------------------------------+ |
23 * | | +--------+ +-------+ +---------+ | +----+|
24 * | | |virt_cpu| |storage| |virt_cons|<--+-->|rdev||
25 * | | +--------+ +-------+ +---------+ | +----+|
29 * | | +--------+ +--------+ +--------+ | |
30 * | | |virt_dev| |virt_dev| |virt_dev| | |
31 * | | +--------+ +--------+ +--------+ | |
32 * | +------------------------------------+ |
34 * | +------------------------------------+ |
36 * | | +--------+ +-------+ +---------+ | +----+|
37 * | | |virt_cpu| |storage| |virt_cons|<--+-->|rdev||
38 * | | +--------+ +-------+ +---------+ | +----+|
42 * | | +--------+ +--------+ +--------+ | |
43 * | | |virt_dev| |virt_dev| |virt_dev| | |
44 * | | +--------+ +--------+ +--------+ | |
45 * | +------------------------------------+ |
51 * | +------------------------------------+ |
52 * | | virt_sys (*LOGIN) | |
53 * | | +--------+ +-------+ +---------+ | |
54 * | | |virt_cpu| |storage| |virt_cons| | |
55 * | | +--------+ +-------+ +---------+ | |
56 * | | +--------+ | +----+|
57 * | | |virt_dev|<--+-->|rdev||
58 * | | +--------+ | +----+|
59 * | | +--------+ | +----+|
60 * | | |virt_dev|<--+-->|rdev||
61 * | | +--------+ | +----+|
62 * | | +--------+ | +----+|
63 * | | |virt_dev|<--+-->|rdev||
64 * | | +--------+ | +----+|
65 * | +------------------------------------+ |
66 * +------------------------------------------------+
69 * In other words, here are the actions that CP takes:
73 * - attach operator console to *LOGIN
76 * - alloc virt sys, virt cpu, virt devices, virt cons, storage
77 * - detach console rdev from *LOGIN
78 * - attach console rdev to virt cons
81 * - free virt sys, virt cpu, virt devices, virt cons, storage
82 * - attach console rdev to *LOGIN
85 * - detach console rdev from virt cons
86 * - attach console rdev to *LOGIN
89 * - detach console rdev from *LOGIN
90 * - attach console rdev to virt cons
93 struct psw disabled_wait
= { .w
= 1, .ea
= 1, .ba
= 1, .ptr
= 0xfafafa, };
94 struct psw enabled_wait
= { .io
= 1, .m
= 1, .w
= 1, .ea
= 1, .ba
= 1, };
96 static struct psw __new_rst
= { .ea
= 1, .ba
= 1, .ptr
= ADDR64(&rst_int
), };
97 static struct psw __new_ext
= { .ea
= 1, .ba
= 1, .ptr
= ADDR64(&ext_int
), };
98 static struct psw __new_svc
= { .ea
= 1, .ba
= 1, .ptr
= ADDR64(&svc_int
), };
99 static struct psw __new_prg
= { .ea
= 1, .ba
= 1, .ptr
= ADDR64(&prg_int
), };
100 static struct psw __new_mch
= { .ea
= 1, .ba
= 1, .ptr
= ADDR64(&mch_int
), };
101 static struct psw __new_io
= { .ea
= 1, .ba
= 1, .ptr
= ADDR64(&io_int
), };
103 static void init_io(void)
109 /* enable all I/O interrupt classes */
124 /* set up interrupt PSWs */
125 memcpy(&psw_rst_new
, &__new_rst
, sizeof(struct psw
));
126 memcpy(&psw_ext_new
, &__new_ext
, sizeof(struct psw
));
127 memcpy(&psw_svc_new
, &__new_svc
, sizeof(struct psw
));
128 memcpy(&psw_prg_new
, &__new_prg
, sizeof(struct psw
));
129 memcpy(&psw_mch_new
, &__new_mch
, sizeof(struct psw
));
130 memcpy(&psw_io_new
, &__new_io
, sizeof(struct psw
));
132 /* enable all 8 I/O classes */
135 /* enable Channel-Report-Pending Machine Check Interruption subclass */
136 set_cr(14, get_cr(14) | BIT64(35));
138 /* this enables I/O & MCH interrupts */
139 lpswe(&enabled_wait
);