Lines Matching +full:sclp +full:- +full:3 +full:g
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * SCLP line mode and ASCII console driver
20 #include "sclp.h"
23 * ASCII (IBM PC 437) -> EBCDIC 037
29 /* ->NL */
34 /* ->IGS ->IRS ->IUS */
38 /*28 ( ) * + , - . / */
40 /*30 0 1 2 3 4 5 6 7 */
44 /*40 @ A B C D E F G */
52 /*60 ` a b c d e f g */
136 static int read_index = sizeof(read_buf) - 1;
143 char *str_dest = (char *)&sccb->msg; in sclp_print_ascii()
162 sccb->h.length = offsetof(WriteEventData, msg) + len; in sclp_print_ascii()
163 sccb->h.function_code = SCLP_FC_NORMAL_WRITE; in sclp_print_ascii()
164 sccb->ebh.length = sizeof(EventBufferHeader) + len; in sclp_print_ascii()
165 sccb->ebh.type = SCLP_EVENT_ASCII_CONSOLE_DATA; in sclp_print_ascii()
181 end = (unsigned char *) sccb + 4096 - 1; in lm_print()
183 ptr = (unsigned char *) &sccb->msg.mdb.mto; in lm_print()
193 mto->length = count; in lm_print()
194 mto->type = 4; in lm_print()
195 mto->line_type_flags = LNTPFLGS_ENDTEXT; in lm_print()
198 len = ptr - (unsigned char *) sccb; in lm_print()
199 sccb->h.length = len - offsetof(struct WriteEventData, h); in lm_print()
200 sccb->h.function_code = SCLP_FC_NORMAL_WRITE; in lm_print()
201 sccb->ebh.type = EVTYP_MSG; in lm_print()
202 sccb->ebh.length = len - offsetof(struct WriteEventData, ebh); in lm_print()
203 mdb = &sccb->msg.mdb; in lm_print()
204 mdb->header.type = 1; in lm_print()
205 mdb->header.tag = 0xD4C4C240; in lm_print()
206 mdb->header.revision_code = 1; in lm_print()
207 mdb->header.length = len - offsetof(struct WriteEventData, msg.mdb.header); in lm_print()
208 go = &mdb->go; in lm_print()
209 go->length = sizeof(*go); in lm_print()
210 go->type = 1; in lm_print()
237 if (str[i] == '\n' || lm_buff_off == (ARRAY_SIZE(lm_buff) - 1)) { in sclp_print_lm()
246 * SCLP needs to be initialized by setting a send and receive mask,
256 sccb->h.length = sizeof(WriteEventMask); in sclp_write_event_mask()
257 sccb->h.function_code = SCLP_FC_NORMAL_WRITE; in sclp_write_event_mask()
258 sccb->mask_length = sizeof(sccb_mask_t); in sclp_write_event_mask()
260 sccb->cp_receive_mask = receive_mask; in sclp_write_event_mask()
261 sccb->cp_send_mask = send_mask; in sclp_write_event_mask()
264 assert(sccb->h.response_code == SCLP_RC_NORMAL_COMPLETION); in sclp_write_event_mask()
311 const int max_event_buffer_len = SCCB_SIZE - offsetof(ReadEventDataAsciiConsole, ebh); in console_read_ascii()
314 assert(ebh->length <= max_event_buffer_len); in console_read_ascii()
315 assert(ebh->length > event_buffer_ascii_recv_header_len); in console_read_ascii()
317 *len = ebh->length - event_buffer_ascii_recv_header_len; in console_read_ascii()
318 return evdata->data; in console_read_ascii()
326 for (v = start; (void *)v < end; v = (void *)v + v->length) in sclp_find_gds_vector()
327 if (v->gds_id == id) in sclp_find_gds_vector()
336 end = (void *)sv + sv->length; in sclp_eval_selfdeftextmsg()
337 for (sv = sv + 1; (void *)sv < end; sv = (void *)sv + sv->length) in sclp_eval_selfdeftextmsg()
338 if (sv->key == 0x30) in sclp_eval_selfdeftextmsg()
348 end = (void *)v + v->length; in sclp_eval_textcmd()
350 sv = (void *)sv + sv->length) in sclp_eval_textcmd()
351 if (sv->key == GDS_KEY_SELFDEFTEXTMSG) in sclp_eval_textcmd()
360 end = (void *)v + v->length; in sclp_eval_cpmsu()
361 for (v = v + 1; (void *)v < end; v = (void *)v + v->length) in sclp_eval_cpmsu()
362 if (v->gds_id == GDS_ID_TEXTCMD) in sclp_eval_cpmsu()
369 v = sclp_find_gds_vector(v + 1, (void *)v + v->length, GDS_ID_CPMSU); in sclp_eval_mdsmu()
380 v = sclp_find_gds_vector(v, (void *)ebh + ebh->length, in console_read_lm()
389 *len = sv->length - (sizeof(*sv)); in console_read_lm()
406 int ret = -1, len; in console_refill_read_buffer()
412 sccb->length = PAGE_SIZE; in console_refill_read_buffer()
413 sccb->function_code = SCLP_UNCONDITIONAL_READ; in console_refill_read_buffer()
414 sccb->control_mask[2] = SCLP_CM2_VARIABLE_LENGTH_RESPONSE; in console_refill_read_buffer()
418 if (sccb->response_code == SCLP_RC_NO_EVENT_BUFFERS_STORED) in console_refill_read_buffer()
421 switch (ebh->type) { in console_refill_read_buffer()