lpar.c (463ce0e103f419f51b1769111e73fe8bb305d0ec) lpar.c (51d3082fe6e55aecfa17113dbe98077c749f724c)
1/*
2 * pSeries_lpar.c
3 * Copyright (C) 2001 Todd Inglett, IBM Corporation
4 *
5 * pSeries LPAR support.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by

--- 47 unchanged lines hidden (view full) ---

56EXPORT_SYMBOL(plpar_hcall_8arg_2ret);
57
58extern void pSeries_find_serial_port(void);
59
60
61int vtermno; /* virtual terminal# for udbg */
62
63#define __ALIGNED__ __attribute__((__aligned__(sizeof(long))))
1/*
2 * pSeries_lpar.c
3 * Copyright (C) 2001 Todd Inglett, IBM Corporation
4 *
5 * pSeries LPAR support.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by

--- 47 unchanged lines hidden (view full) ---

56EXPORT_SYMBOL(plpar_hcall_8arg_2ret);
57
58extern void pSeries_find_serial_port(void);
59
60
61int vtermno; /* virtual terminal# for udbg */
62
63#define __ALIGNED__ __attribute__((__aligned__(sizeof(long))))
64static void udbg_hvsi_putc(unsigned char c)
64static void udbg_hvsi_putc(char c)
65{
66 /* packet's seqno isn't used anyways */
67 uint8_t packet[] __ALIGNED__ = { 0xff, 5, 0, 0, c };
68 int rc;
69
70 if (c == '\n')
71 udbg_hvsi_putc('\r');
72

--- 34 unchanged lines hidden (view full) ---

107 for (i = 1; i < hvsi_udbg_buf_len; i++) {
108 hvsi_udbg_buf[i-1] = hvsi_udbg_buf[i];
109 }
110 hvsi_udbg_buf_len--;
111
112 return ch;
113}
114
65{
66 /* packet's seqno isn't used anyways */
67 uint8_t packet[] __ALIGNED__ = { 0xff, 5, 0, 0, c };
68 int rc;
69
70 if (c == '\n')
71 udbg_hvsi_putc('\r');
72

--- 34 unchanged lines hidden (view full) ---

107 for (i = 1; i < hvsi_udbg_buf_len; i++) {
108 hvsi_udbg_buf[i-1] = hvsi_udbg_buf[i];
109 }
110 hvsi_udbg_buf_len--;
111
112 return ch;
113}
114
115static unsigned char udbg_hvsi_getc(void)
115static char udbg_hvsi_getc(void)
116{
117 int ch;
118 for (;;) {
119 ch = udbg_hvsi_getc_poll();
120 if (ch == -1) {
121 /* This shouldn't be needed...but... */
122 volatile unsigned long delay;
123 for (delay=0; delay < 2000000; delay++)
124 ;
125 } else {
126 return ch;
127 }
128 }
129}
130
116{
117 int ch;
118 for (;;) {
119 ch = udbg_hvsi_getc_poll();
120 if (ch == -1) {
121 /* This shouldn't be needed...but... */
122 volatile unsigned long delay;
123 for (delay=0; delay < 2000000; delay++)
124 ;
125 } else {
126 return ch;
127 }
128 }
129}
130
131static void udbg_putcLP(unsigned char c)
131static void udbg_putcLP(char c)
132{
133 char buf[16];
134 unsigned long rc;
135
136 if (c == '\n')
137 udbg_putcLP('\r');
138
139 buf[0] = c;

--- 28 unchanged lines hidden (view full) ---

168 }
169 ch = buf[0];
170 for (i = 1; i < inbuflen; i++) /* shuffle them down. */
171 buf[i-1] = buf[i];
172 inbuflen--;
173 return ch;
174}
175
132{
133 char buf[16];
134 unsigned long rc;
135
136 if (c == '\n')
137 udbg_putcLP('\r');
138
139 buf[0] = c;

--- 28 unchanged lines hidden (view full) ---

168 }
169 ch = buf[0];
170 for (i = 1; i < inbuflen; i++) /* shuffle them down. */
171 buf[i-1] = buf[i];
172 inbuflen--;
173 return ch;
174}
175
176static unsigned char udbg_getcLP(void)
176static char udbg_getcLP(void)
177{
178 int ch;
179 for (;;) {
180 ch = udbg_getc_pollLP();
181 if (ch == -1) {
182 /* This shouldn't be needed...but... */
183 volatile unsigned long delay;
184 for (delay=0; delay < 2000000; delay++)

--- 342 unchanged lines hidden ---
177{
178 int ch;
179 for (;;) {
180 ch = udbg_getc_pollLP();
181 if (ch == -1) {
182 /* This shouldn't be needed...but... */
183 volatile unsigned long delay;
184 for (delay=0; delay < 2000000; delay++)

--- 342 unchanged lines hidden ---