Merge lp:~hamo/ubuntu/precise/grub2/grub2.lp1297128 into lp:~ubuntu-core-dev/ubuntu/precise/grub2/precise
- Precise (12.04)
- grub2.lp1297128
- Merge into precise
Proposed by
Yang Bai
Status: | Merged |
---|---|
Approved by: | Colin Watson |
Approved revision: | 2296 |
Merged at revision: | 2296 |
Proposed branch: | lp:~hamo/ubuntu/precise/grub2/grub2.lp1297128 |
Merge into: | lp:~ubuntu-core-dev/ubuntu/precise/grub2/precise |
Diff against target: |
1230 lines (+1205/-0) 3 files modified
debian/changelog (+5/-0) debian/patches/larger_terminal_size_restriction.patch (+1199/-0) debian/patches/series (+1/-0) |
To merge this branch: | bzr merge lp:~hamo/ubuntu/precise/grub2/grub2.lp1297128 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Colin Watson | Approve | ||
Review via email: mp+213097@code.launchpad.net |
Commit message
Description of the change
backport upstream commits to precise-updates 2b23074a0c08221
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'debian/changelog' | |||
2 | --- debian/changelog 2013-12-12 01:31:53 +0000 | |||
3 | +++ debian/changelog 2014-03-27 15:56:07 +0000 | |||
4 | @@ -1,8 +1,13 @@ | |||
5 | 1 | grub2 (1.99-21ubuntu3.15) UNRELEASED; urgency=low | 1 | grub2 (1.99-21ubuntu3.15) UNRELEASED; urgency=low |
6 | 2 | 2 | ||
7 | 3 | [ Colin Watson ] | ||
8 | 3 | * Backport from upstream: | 4 | * Backport from upstream: |
9 | 4 | - Fix sector number when writing to non-512B disks (LP: #1253443). | 5 | - Fix sector number when writing to non-512B disks (LP: #1253443). |
10 | 5 | 6 | ||
11 | 7 | [ Yang Bai ] | ||
12 | 8 | * Backport from upstream: | ||
13 | 9 | - Support high resolution for grub terminal (LP: #1297128). | ||
14 | 10 | |||
15 | 6 | -- Colin Watson <cjwatson@ubuntu.com> Thu, 12 Dec 2013 01:27:08 +0000 | 11 | -- Colin Watson <cjwatson@ubuntu.com> Thu, 12 Dec 2013 01:27:08 +0000 |
16 | 7 | 12 | ||
17 | 8 | grub2 (1.99-21ubuntu3.14) precise; urgency=low | 13 | grub2 (1.99-21ubuntu3.14) precise; urgency=low |
18 | 9 | 14 | ||
19 | === added file 'debian/patches/larger_terminal_size_restriction.patch' | |||
20 | --- debian/patches/larger_terminal_size_restriction.patch 1970-01-01 00:00:00 +0000 | |||
21 | +++ debian/patches/larger_terminal_size_restriction.patch 2014-03-27 15:56:07 +0000 | |||
22 | @@ -0,0 +1,1199 @@ | |||
23 | 1 | Index: grub2-backport/grub-core/commands/sleep.c | ||
24 | 2 | =================================================================== | ||
25 | 3 | --- grub2-backport.orig/grub-core/commands/sleep.c | ||
26 | 4 | +++ grub2-backport/grub-core/commands/sleep.c | ||
27 | 5 | @@ -34,7 +34,7 @@ static const struct grub_arg_option opti | ||
28 | 6 | {0, 0, 0, 0, 0, 0} | ||
29 | 7 | }; | ||
30 | 8 | |||
31 | 9 | -static grub_uint16_t *pos; | ||
32 | 10 | +static struct grub_term_coordinate *pos; | ||
33 | 11 | |||
34 | 12 | static void | ||
35 | 13 | do_print (int n) | ||
36 | 14 | Index: grub2-backport/grub-core/kern/term.c | ||
37 | 15 | =================================================================== | ||
38 | 16 | --- grub2-backport.orig/grub-core/kern/term.c | ||
39 | 17 | +++ grub2-backport/grub-core/kern/term.c | ||
40 | 18 | @@ -49,7 +49,7 @@ grub_putcode_dumb (grub_uint32_t code, | ||
41 | 19 | { | ||
42 | 20 | int n; | ||
43 | 21 | |||
44 | 22 | - n = 8 - ((term->getxy (term) >> 8) & 7); | ||
45 | 23 | + n = 8 - ((term->getxy (term).x) & 7); | ||
46 | 24 | while (n--) | ||
47 | 25 | grub_putcode_dumb (' ', term); | ||
48 | 26 | |||
49 | 27 | Index: grub2-backport/grub-core/loader/i386/linux.c | ||
50 | 28 | =================================================================== | ||
51 | 29 | --- grub2-backport.orig/grub-core/loader/i386/linux.c | ||
52 | 30 | +++ grub2-backport/grub-core/loader/i386/linux.c | ||
53 | 31 | @@ -493,9 +493,9 @@ grub_linux_boot (void) | ||
54 | 32 | || grub_strcmp (term->name, "console") == 0 | ||
55 | 33 | || grub_strcmp (term->name, "ofconsole") == 0) | ||
56 | 34 | { | ||
57 | 35 | - grub_uint16_t pos = grub_term_getxy (term); | ||
58 | 36 | - params->video_cursor_x = pos >> 8; | ||
59 | 37 | - params->video_cursor_y = pos & 0xff; | ||
60 | 38 | + struct grub_term_coordinate pos = grub_term_getxy (term); | ||
61 | 39 | + params->video_cursor_x = pos.x; | ||
62 | 40 | + params->video_cursor_y = pos.y; | ||
63 | 41 | params->video_width = grub_term_width (term); | ||
64 | 42 | params->video_height = grub_term_height (term); | ||
65 | 43 | found = 1; | ||
66 | 44 | Index: grub2-backport/grub-core/normal/cmdline.c | ||
67 | 45 | =================================================================== | ||
68 | 46 | --- grub2-backport.orig/grub-core/normal/cmdline.c | ||
69 | 47 | +++ grub2-backport/grub-core/normal/cmdline.c | ||
70 | 48 | @@ -203,7 +203,8 @@ print_completion (const char *item, grub | ||
71 | 49 | |||
72 | 50 | struct cmdline_term | ||
73 | 51 | { | ||
74 | 52 | - unsigned xpos, ypos, ystart, width, height; | ||
75 | 53 | + struct grub_term_coordinate pos; | ||
76 | 54 | + unsigned ystart, width, height; | ||
77 | 55 | struct grub_term_output *term; | ||
78 | 56 | }; | ||
79 | 57 | |||
80 | 58 | @@ -235,9 +236,9 @@ grub_cmdline_get (const char *prompt) | ||
81 | 59 | |||
82 | 60 | void cl_set_pos (struct cmdline_term *cl_term) | ||
83 | 61 | { | ||
84 | 62 | - cl_term->xpos = (plen + lpos) % (cl_term->width - 1); | ||
85 | 63 | - cl_term->ypos = cl_term->ystart + (plen + lpos) / (cl_term->width - 1); | ||
86 | 64 | - grub_term_gotoxy (cl_term->term, cl_term->xpos, cl_term->ypos); | ||
87 | 65 | + cl_term->pos.x = (plen + lpos) % (cl_term->width - 1); | ||
88 | 66 | + cl_term->pos.y = cl_term->ystart + (plen + lpos) / (cl_term->width - 1); | ||
89 | 67 | + grub_term_gotoxy (cl_term->term, cl_term->pos); | ||
90 | 68 | } | ||
91 | 69 | |||
92 | 70 | void cl_set_pos_all (void) | ||
93 | 71 | @@ -257,14 +258,14 @@ grub_cmdline_get (const char *prompt) | ||
94 | 72 | grub_putcode (c, cl_term->term); | ||
95 | 73 | else | ||
96 | 74 | grub_putcode (*p, cl_term->term); | ||
97 | 75 | - cl_term->xpos++; | ||
98 | 76 | - if (cl_term->xpos >= cl_term->width - 1) | ||
99 | 77 | + cl_term->pos.x++; | ||
100 | 78 | + if (cl_term->pos.x >= cl_term->width - 1) | ||
101 | 79 | { | ||
102 | 80 | - cl_term->xpos = 0; | ||
103 | 81 | - if (cl_term->ypos >= (unsigned) (cl_term->height - 1)) | ||
104 | 82 | + cl_term->pos.x = 0; | ||
105 | 83 | + if (cl_term->pos.y >= (unsigned) (cl_term->height - 1)) | ||
106 | 84 | cl_term->ystart--; | ||
107 | 85 | else | ||
108 | 86 | - cl_term->ypos++; | ||
109 | 87 | + cl_term->pos.y++; | ||
110 | 88 | grub_putcode ('\n', cl_term->term); | ||
111 | 89 | } | ||
112 | 90 | } | ||
113 | 91 | @@ -332,9 +333,9 @@ grub_cmdline_get (const char *prompt) | ||
114 | 92 | |||
115 | 93 | void init_clterm (struct cmdline_term *cl_term_cur) | ||
116 | 94 | { | ||
117 | 95 | - cl_term_cur->xpos = plen; | ||
118 | 96 | - cl_term_cur->ypos = (grub_term_getxy (cl_term_cur->term) & 0xFF); | ||
119 | 97 | - cl_term_cur->ystart = cl_term_cur->ypos; | ||
120 | 98 | + cl_term_cur->pos.x = plen; | ||
121 | 99 | + cl_term_cur->pos.y = grub_term_getxy (cl_term_cur->term).y; | ||
122 | 100 | + cl_term_cur->ystart = cl_term_cur->pos.y; | ||
123 | 101 | cl_term_cur->width = grub_term_width (cl_term_cur->term); | ||
124 | 102 | cl_term_cur->height = grub_term_height (cl_term_cur->term); | ||
125 | 103 | } | ||
126 | 104 | @@ -358,7 +359,7 @@ grub_cmdline_get (const char *prompt) | ||
127 | 105 | grub_term_output_t term; | ||
128 | 106 | |||
129 | 107 | FOR_ACTIVE_TERM_OUTPUTS(term) | ||
130 | 108 | - if ((grub_term_getxy (term) >> 8) != 0) | ||
131 | 109 | + if ((grub_term_getxy (term).x) != 0) | ||
132 | 110 | grub_putcode ('\n', term); | ||
133 | 111 | } | ||
134 | 112 | grub_printf ("%s ", prompt_translated); | ||
135 | 113 | Index: grub2-backport/grub-core/normal/main.c | ||
136 | 114 | =================================================================== | ||
137 | 115 | --- grub2-backport.orig/grub-core/normal/main.c | ||
138 | 116 | +++ grub2-backport/grub-core/normal/main.c | ||
139 | 117 | @@ -233,7 +233,7 @@ grub_normal_init_page (struct grub_term_ | ||
140 | 118 | |||
141 | 119 | posx = grub_getstringwidth (unicode_msg, last_position, term); | ||
142 | 120 | posx = (grub_term_width (term) - posx) / 2; | ||
143 | 121 | - grub_term_gotoxy (term, posx, 1); | ||
144 | 122 | + grub_term_gotoxy (term, (struct grub_term_coordinate) { posx, 1 }); | ||
145 | 123 | |||
146 | 124 | grub_print_ucs4 (unicode_msg, last_position, 0, 0, term); | ||
147 | 125 | grub_putcode ('\n', term); | ||
148 | 126 | Index: grub2-backport/grub-core/normal/menu_entry.c | ||
149 | 127 | =================================================================== | ||
150 | 128 | --- grub2-backport.orig/grub-core/normal/menu_entry.c | ||
151 | 129 | +++ grub2-backport/grub-core/normal/menu_entry.c | ||
152 | 130 | @@ -124,8 +124,8 @@ print_line (struct line *linep, int offs | ||
153 | 131 | struct per_term_screen *term_screen) | ||
154 | 132 | { | ||
155 | 133 | grub_term_gotoxy (term_screen->term, | ||
156 | 134 | - GRUB_TERM_LEFT_BORDER_X + GRUB_TERM_MARGIN + start + 1, | ||
157 | 135 | - y + GRUB_TERM_FIRST_ENTRY_Y); | ||
158 | 136 | + (struct grub_term_coordinate) {GRUB_TERM_LEFT_BORDER_X + GRUB_TERM_MARGIN + start + 1, | ||
159 | 137 | + y + GRUB_TERM_FIRST_ENTRY_Y }); | ||
160 | 138 | |||
161 | 139 | if (linep->len >= offset + grub_term_entry_width (term_screen->term)) | ||
162 | 140 | { | ||
163 | 141 | @@ -162,8 +162,8 @@ print_empty_line (int y, struct per_term | ||
164 | 142 | int i; | ||
165 | 143 | |||
166 | 144 | grub_term_gotoxy (term_screen->term, | ||
167 | 145 | - GRUB_TERM_LEFT_BORDER_X + GRUB_TERM_MARGIN + 1, | ||
168 | 146 | - y + GRUB_TERM_FIRST_ENTRY_Y); | ||
169 | 147 | + (struct grub_term_coordinate) {GRUB_TERM_LEFT_BORDER_X + GRUB_TERM_MARGIN + 1, | ||
170 | 148 | + y + GRUB_TERM_FIRST_ENTRY_Y }); | ||
171 | 149 | |||
172 | 150 | for (i = 0; i < grub_term_entry_width (term_screen->term) + 1; i++) | ||
173 | 151 | grub_putcode (' ', term_screen->term); | ||
174 | 152 | @@ -173,9 +173,9 @@ print_empty_line (int y, struct per_term | ||
175 | 153 | static void | ||
176 | 154 | print_up (int flag, struct per_term_screen *term_screen) | ||
177 | 155 | { | ||
178 | 156 | - grub_term_gotoxy (term_screen->term, GRUB_TERM_LEFT_BORDER_X | ||
179 | 157 | + grub_term_gotoxy (term_screen->term, (struct grub_term_coordinate) { GRUB_TERM_LEFT_BORDER_X | ||
180 | 158 | + grub_term_border_width (term_screen->term), | ||
181 | 159 | - GRUB_TERM_FIRST_ENTRY_Y); | ||
182 | 160 | + GRUB_TERM_FIRST_ENTRY_Y }); | ||
183 | 161 | |||
184 | 162 | if (flag) | ||
185 | 163 | grub_putcode (GRUB_UNICODE_UPARROW, term_screen->term); | ||
186 | 164 | @@ -187,10 +187,10 @@ print_up (int flag, struct per_term_scre | ||
187 | 165 | static void | ||
188 | 166 | print_down (int flag, struct per_term_screen *term_screen) | ||
189 | 167 | { | ||
190 | 168 | - grub_term_gotoxy (term_screen->term, GRUB_TERM_LEFT_BORDER_X | ||
191 | 169 | + grub_term_gotoxy (term_screen->term, (struct grub_term_coordinate) { GRUB_TERM_LEFT_BORDER_X | ||
192 | 170 | + grub_term_border_width (term_screen->term), | ||
193 | 171 | GRUB_TERM_TOP_BORDER_Y | ||
194 | 172 | - + term_screen->num_entries); | ||
195 | 173 | + + term_screen->num_entries }); | ||
196 | 174 | |||
197 | 175 | if (flag) | ||
198 | 176 | grub_putcode (GRUB_UNICODE_DOWNARROW, term_screen->term); | ||
199 | 177 | @@ -298,9 +298,9 @@ update_screen (struct screen *screen, st | ||
200 | 178 | |||
201 | 179 | /* Place the cursor. */ | ||
202 | 180 | grub_term_gotoxy (term_screen->term, | ||
203 | 181 | - GRUB_TERM_LEFT_BORDER_X + GRUB_TERM_MARGIN + 1 | ||
204 | 182 | + (struct grub_term_coordinate) { GRUB_TERM_LEFT_BORDER_X + GRUB_TERM_MARGIN + 1 | ||
205 | 183 | + term_screen->x, | ||
206 | 184 | - GRUB_TERM_FIRST_ENTRY_Y + term_screen->y); | ||
207 | 185 | + GRUB_TERM_FIRST_ENTRY_Y + term_screen->y }); | ||
208 | 186 | |||
209 | 187 | grub_term_refresh (term_screen->term); | ||
210 | 188 | } | ||
211 | 189 | @@ -1056,17 +1056,17 @@ complete (struct screen *screen, int con | ||
212 | 190 | / (grub_term_width (screen->terms[i].term) | ||
213 | 191 | - 8)); | ||
214 | 192 | grub_uint32_t *endp; | ||
215 | 193 | - grub_uint16_t pos; | ||
216 | 194 | + struct grub_term_coordinate pos; | ||
217 | 195 | grub_uint32_t *p = ucs4; | ||
218 | 196 | |||
219 | 197 | pos = grub_term_getxy (screen->terms[i].term); | ||
220 | 198 | - grub_term_gotoxy (screen->terms[i].term, 0, | ||
221 | 199 | - grub_term_height (screen->terms[i].term) - 3); | ||
222 | 200 | + grub_term_gotoxy (screen->terms[i].term, (struct grub_term_coordinate) { 0, | ||
223 | 201 | + grub_term_height (screen->terms[i].term) - 3 }); | ||
224 | 202 | |||
225 | 203 | screen->completion_shown = 1; | ||
226 | 204 | |||
227 | 205 | - grub_term_gotoxy (screen->terms[i].term, 0, | ||
228 | 206 | - grub_term_height (screen->terms[i].term) - 3); | ||
229 | 207 | + grub_term_gotoxy (screen->terms[i].term, (struct grub_term_coordinate) { 0, | ||
230 | 208 | + grub_term_height (screen->terms[i].term) - 3 }); | ||
231 | 209 | grub_puts_terminal (" ", screen->terms[i].term); | ||
232 | 210 | switch (completion_type) | ||
233 | 211 | { | ||
234 | 212 | @@ -1112,7 +1112,7 @@ complete (struct screen *screen, int con | ||
235 | 213 | |||
236 | 214 | if (ucs4 + ucs4len > endp) | ||
237 | 215 | grub_putcode (GRUB_UNICODE_RIGHTARROW, screen->terms[i].term); | ||
238 | 216 | - grub_term_gotoxy (screen->terms[i].term, pos >> 8, pos & 0xFF); | ||
239 | 217 | + grub_term_gotoxy (screen->terms[i].term, pos); | ||
240 | 218 | } | ||
241 | 219 | } | ||
242 | 220 | |||
243 | 221 | @@ -1133,12 +1133,12 @@ complete (struct screen *screen, int con | ||
244 | 222 | static void | ||
245 | 223 | clear_completions (struct per_term_screen *term_screen) | ||
246 | 224 | { | ||
247 | 225 | - grub_uint16_t pos; | ||
248 | 226 | + struct grub_term_coordinate pos; | ||
249 | 227 | unsigned i, j; | ||
250 | 228 | |||
251 | 229 | pos = grub_term_getxy (term_screen->term); | ||
252 | 230 | - grub_term_gotoxy (term_screen->term, 0, | ||
253 | 231 | - grub_term_height (term_screen->term) - 3); | ||
254 | 232 | + grub_term_gotoxy (term_screen->term, (struct grub_term_coordinate) { 0, | ||
255 | 233 | + grub_term_height (term_screen->term) - 3 }); | ||
256 | 234 | |||
257 | 235 | for (i = 0; i < 2; i++) | ||
258 | 236 | { | ||
259 | 237 | @@ -1147,7 +1147,7 @@ clear_completions (struct per_term_scree | ||
260 | 238 | grub_putcode ('\n', term_screen->term); | ||
261 | 239 | } | ||
262 | 240 | |||
263 | 241 | - grub_term_gotoxy (term_screen->term, pos >> 8, pos & 0xFF); | ||
264 | 242 | + grub_term_gotoxy (term_screen->term, pos); | ||
265 | 243 | grub_term_refresh (term_screen->term); | ||
266 | 244 | } | ||
267 | 245 | |||
268 | 246 | Index: grub2-backport/grub-core/normal/menu_text.c | ||
269 | 247 | =================================================================== | ||
270 | 248 | --- grub2-backport.orig/grub-core/normal/menu_text.c | ||
271 | 249 | +++ grub2-backport/grub-core/normal/menu_text.c | ||
272 | 250 | @@ -106,7 +106,7 @@ draw_border (struct grub_term_output *te | ||
273 | 251 | |||
274 | 252 | grub_term_setcolorstate (term, GRUB_TERM_COLOR_NORMAL); | ||
275 | 253 | |||
276 | 254 | - grub_term_gotoxy (term, GRUB_TERM_MARGIN, GRUB_TERM_TOP_BORDER_Y); | ||
277 | 255 | + grub_term_gotoxy (term, (struct grub_term_coordinate) { GRUB_TERM_MARGIN, GRUB_TERM_TOP_BORDER_Y }); | ||
278 | 256 | grub_putcode (GRUB_UNICODE_CORNER_UL, term); | ||
279 | 257 | for (i = 0; i < (unsigned) grub_term_border_width (term) - 2; i++) | ||
280 | 258 | grub_putcode (GRUB_UNICODE_HLINE, term); | ||
281 | 259 | @@ -114,16 +114,16 @@ draw_border (struct grub_term_output *te | ||
282 | 260 | |||
283 | 261 | for (i = 0; i < (unsigned) num_entries; i++) | ||
284 | 262 | { | ||
285 | 263 | - grub_term_gotoxy (term, GRUB_TERM_MARGIN, GRUB_TERM_TOP_BORDER_Y + i + 1); | ||
286 | 264 | + grub_term_gotoxy (term, (struct grub_term_coordinate) { GRUB_TERM_MARGIN, GRUB_TERM_TOP_BORDER_Y + i + 1 }); | ||
287 | 265 | grub_putcode (GRUB_UNICODE_VLINE, term); | ||
288 | 266 | - grub_term_gotoxy (term, GRUB_TERM_MARGIN + grub_term_border_width (term) | ||
289 | 267 | + grub_term_gotoxy (term, (struct grub_term_coordinate) { GRUB_TERM_MARGIN + grub_term_border_width (term) | ||
290 | 268 | - 1, | ||
291 | 269 | - GRUB_TERM_TOP_BORDER_Y + i + 1); | ||
292 | 270 | + GRUB_TERM_TOP_BORDER_Y + i + 1 }); | ||
293 | 271 | grub_putcode (GRUB_UNICODE_VLINE, term); | ||
294 | 272 | } | ||
295 | 273 | |||
296 | 274 | - grub_term_gotoxy (term, GRUB_TERM_MARGIN, | ||
297 | 275 | - GRUB_TERM_TOP_BORDER_Y + num_entries + 1); | ||
298 | 276 | + grub_term_gotoxy (term, (struct grub_term_coordinate) { GRUB_TERM_MARGIN, | ||
299 | 277 | + GRUB_TERM_TOP_BORDER_Y + num_entries + 1 }); | ||
300 | 278 | grub_putcode (GRUB_UNICODE_CORNER_LL, term); | ||
301 | 279 | for (i = 0; i < (unsigned) grub_term_border_width (term) - 2; i++) | ||
302 | 280 | grub_putcode (GRUB_UNICODE_HLINE, term); | ||
303 | 281 | @@ -131,9 +131,9 @@ draw_border (struct grub_term_output *te | ||
304 | 282 | |||
305 | 283 | grub_term_setcolorstate (term, GRUB_TERM_COLOR_NORMAL); | ||
306 | 284 | |||
307 | 285 | - grub_term_gotoxy (term, GRUB_TERM_MARGIN, | ||
308 | 286 | - (GRUB_TERM_TOP_BORDER_Y + num_entries | ||
309 | 287 | - + GRUB_TERM_MARGIN + 1)); | ||
310 | 288 | + grub_term_gotoxy (term, (struct grub_term_coordinate) { GRUB_TERM_MARGIN, | ||
311 | 289 | + (GRUB_TERM_TOP_BORDER_Y + num_entries | ||
312 | 290 | + + GRUB_TERM_MARGIN + 1) }); | ||
313 | 291 | } | ||
314 | 292 | |||
315 | 293 | static int | ||
316 | 294 | @@ -227,7 +227,7 @@ print_entry (int y, int highlight, grub_ | ||
317 | 295 | ? GRUB_TERM_COLOR_HIGHLIGHT | ||
318 | 296 | : GRUB_TERM_COLOR_NORMAL); | ||
319 | 297 | |||
320 | 298 | - grub_term_gotoxy (term, GRUB_TERM_LEFT_BORDER_X + GRUB_TERM_MARGIN, y); | ||
321 | 299 | + grub_term_gotoxy (term, (struct grub_term_coordinate) { GRUB_TERM_LEFT_BORDER_X + GRUB_TERM_MARGIN, y }); | ||
322 | 300 | |||
323 | 301 | int last_printed = 0; | ||
324 | 302 | for (x = GRUB_TERM_LEFT_BORDER_X + GRUB_TERM_MARGIN + 1, i = 0; | ||
325 | 303 | @@ -281,7 +281,7 @@ print_entry (int y, int highlight, grub_ | ||
326 | 304 | grub_term_setcolorstate (term, GRUB_TERM_COLOR_NORMAL); | ||
327 | 305 | grub_putcode (' ', term); | ||
328 | 306 | |||
329 | 307 | - grub_term_gotoxy (term, grub_term_cursor_x (term), y); | ||
330 | 308 | + grub_term_gotoxy (term, (struct grub_term_coordinate) { grub_term_cursor_x (term), y }); | ||
331 | 309 | |||
332 | 310 | grub_term_setcolor (term, old_color_normal, old_color_highlight); | ||
333 | 311 | grub_term_setcolorstate (term, GRUB_TERM_COLOR_NORMAL); | ||
334 | 312 | @@ -295,8 +295,8 @@ print_entries (grub_menu_t menu, const s | ||
335 | 313 | int i; | ||
336 | 314 | |||
337 | 315 | grub_term_gotoxy (data->term, | ||
338 | 316 | - GRUB_TERM_LEFT_BORDER_X + grub_term_border_width (data->term), | ||
339 | 317 | - GRUB_TERM_FIRST_ENTRY_Y); | ||
340 | 318 | + (struct grub_term_coordinate) { GRUB_TERM_LEFT_BORDER_X + grub_term_border_width (data->term), | ||
341 | 319 | + GRUB_TERM_FIRST_ENTRY_Y }); | ||
342 | 320 | |||
343 | 321 | if (data->first) | ||
344 | 322 | grub_putcode (GRUB_UNICODE_UPARROW, data->term); | ||
345 | 323 | @@ -313,17 +313,17 @@ print_entries (grub_menu_t menu, const s | ||
346 | 324 | e = e->next; | ||
347 | 325 | } | ||
348 | 326 | |||
349 | 327 | - grub_term_gotoxy (data->term, GRUB_TERM_LEFT_BORDER_X | ||
350 | 328 | - + grub_term_border_width (data->term), | ||
351 | 329 | - GRUB_TERM_TOP_BORDER_Y + data->num_entries); | ||
352 | 330 | + grub_term_gotoxy (data->term, (struct grub_term_coordinate) { GRUB_TERM_LEFT_BORDER_X | ||
353 | 331 | + + grub_term_border_width (data->term), | ||
354 | 332 | + GRUB_TERM_TOP_BORDER_Y + data->num_entries }); | ||
355 | 333 | |||
356 | 334 | if (e) | ||
357 | 335 | grub_putcode (GRUB_UNICODE_DOWNARROW, data->term); | ||
358 | 336 | else | ||
359 | 337 | grub_putcode (' ', data->term); | ||
360 | 338 | |||
361 | 339 | - grub_term_gotoxy (data->term, grub_term_cursor_x (data->term), | ||
362 | 340 | - GRUB_TERM_FIRST_ENTRY_Y + data->offset); | ||
363 | 341 | + grub_term_gotoxy (data->term, (struct grub_term_coordinate) { grub_term_cursor_x (data->term), | ||
364 | 342 | + GRUB_TERM_FIRST_ENTRY_Y + data->offset }); | ||
365 | 343 | } | ||
366 | 344 | |||
367 | 345 | /* Initialize the screen. If NESTED is non-zero, assume that this menu | ||
368 | 346 | @@ -367,7 +367,7 @@ menu_text_print_timeout (int timeout, vo | ||
369 | 347 | char *msg_translated; | ||
370 | 348 | int posx; | ||
371 | 349 | |||
372 | 350 | - grub_term_gotoxy (data->term, 0, grub_term_height (data->term) - 3); | ||
373 | 351 | + grub_term_gotoxy (data->term, (struct grub_term_coordinate) { 0, grub_term_height (data->term) - 3 }); | ||
374 | 352 | |||
375 | 353 | msg_translated = grub_xasprintf (msg, timeout); | ||
376 | 354 | if (!msg_translated) | ||
377 | 355 | @@ -379,12 +379,12 @@ menu_text_print_timeout (int timeout, vo | ||
378 | 356 | |||
379 | 357 | grub_print_message_indented (msg_translated, 3, 0, data->term); | ||
380 | 358 | |||
381 | 359 | - posx = grub_term_getxy (data->term) >> 8; | ||
382 | 360 | + posx = grub_term_getxy (data->term).x; | ||
383 | 361 | grub_print_spaces (data->term, grub_term_width (data->term) - posx - 1); | ||
384 | 362 | |||
385 | 363 | grub_term_gotoxy (data->term, | ||
386 | 364 | - grub_term_cursor_x (data->term), | ||
387 | 365 | - GRUB_TERM_FIRST_ENTRY_Y + data->offset); | ||
388 | 366 | + (struct grub_term_coordinate) { grub_term_cursor_x (data->term), | ||
389 | 367 | + GRUB_TERM_FIRST_ENTRY_Y + data->offset }); | ||
390 | 368 | grub_term_refresh (data->term); | ||
391 | 369 | } | ||
392 | 370 | |||
393 | 371 | @@ -437,10 +437,10 @@ menu_text_clear_timeout (void *dataptr) | ||
394 | 372 | { | ||
395 | 373 | struct menu_viewer_data *data = dataptr; | ||
396 | 374 | |||
397 | 375 | - grub_term_gotoxy (data->term, 0, grub_term_height (data->term) - 3); | ||
398 | 376 | + grub_term_gotoxy (data->term, (struct grub_term_coordinate) { 0, grub_term_height (data->term) - 3 }); | ||
399 | 377 | grub_print_spaces (data->term, grub_term_width (data->term) - 1); | ||
400 | 378 | - grub_term_gotoxy (data->term, grub_term_cursor_x (data->term), | ||
401 | 379 | - GRUB_TERM_FIRST_ENTRY_Y + data->offset); | ||
402 | 380 | + grub_term_gotoxy (data->term, (struct grub_term_coordinate) { grub_term_cursor_x (data->term), | ||
403 | 381 | + GRUB_TERM_FIRST_ENTRY_Y + data->offset }); | ||
404 | 382 | grub_term_refresh (data->term); | ||
405 | 383 | } | ||
406 | 384 | |||
407 | 385 | Index: grub2-backport/grub-core/normal/term.c | ||
408 | 386 | =================================================================== | ||
409 | 387 | --- grub2-backport.orig/grub-core/normal/term.c | ||
410 | 388 | +++ grub2-backport/grub-core/normal/term.c | ||
411 | 389 | @@ -57,7 +57,7 @@ static void | ||
412 | 390 | print_more (void) | ||
413 | 391 | { | ||
414 | 392 | char key; | ||
415 | 393 | - grub_uint16_t *pos; | ||
416 | 394 | + struct grub_term_coordinate *pos; | ||
417 | 395 | grub_term_output_t term; | ||
418 | 396 | grub_uint32_t *unicode_str, *unicode_last_position; | ||
419 | 397 | |||
420 | 398 | @@ -236,12 +236,12 @@ grub_puts_terminal (const char *str, str | ||
421 | 399 | grub_free (unicode_str); | ||
422 | 400 | } | ||
423 | 401 | |||
424 | 402 | -grub_uint16_t * | ||
425 | 403 | +struct grub_term_coordinate * | ||
426 | 404 | grub_term_save_pos (void) | ||
427 | 405 | { | ||
428 | 406 | struct grub_term_output *cur; | ||
429 | 407 | unsigned cnt = 0; | ||
430 | 408 | - grub_uint16_t *ret, *ptr; | ||
431 | 409 | + struct grub_term_coordinate *ret, *ptr; | ||
432 | 410 | |||
433 | 411 | FOR_ACTIVE_TERM_OUTPUTS(cur) | ||
434 | 412 | cnt++; | ||
435 | 413 | @@ -258,17 +258,17 @@ grub_term_save_pos (void) | ||
436 | 414 | } | ||
437 | 415 | |||
438 | 416 | void | ||
439 | 417 | -grub_term_restore_pos (grub_uint16_t *pos) | ||
440 | 418 | +grub_term_restore_pos (struct grub_term_coordinate *pos) | ||
441 | 419 | { | ||
442 | 420 | struct grub_term_output *cur; | ||
443 | 421 | - grub_uint16_t *ptr = pos; | ||
444 | 422 | + struct grub_term_coordinate *ptr = pos; | ||
445 | 423 | |||
446 | 424 | if (!pos) | ||
447 | 425 | return; | ||
448 | 426 | |||
449 | 427 | FOR_ACTIVE_TERM_OUTPUTS(cur) | ||
450 | 428 | { | ||
451 | 429 | - grub_term_gotoxy (cur, (*ptr & 0xff00) >> 8, *ptr & 0xff); | ||
452 | 430 | + grub_term_gotoxy (cur, *ptr); | ||
453 | 431 | ptr++; | ||
454 | 432 | } | ||
455 | 433 | } | ||
456 | 434 | @@ -405,7 +405,7 @@ putglyph (const struct grub_unicode_glyp | ||
457 | 435 | { | ||
458 | 436 | int n; | ||
459 | 437 | |||
460 | 438 | - n = 8 - ((term->getxy (term) >> 8) & 7); | ||
461 | 439 | + n = 8 - ((term->getxy (term).x) & 7); | ||
462 | 440 | c2.base = ' '; | ||
463 | 441 | while (n--) | ||
464 | 442 | (term->putchar) (term, &c2); | ||
465 | 443 | @@ -507,7 +507,7 @@ static grub_ssize_t | ||
466 | 444 | get_startwidth (struct grub_term_output *term, | ||
467 | 445 | int margin_left) | ||
468 | 446 | { | ||
469 | 447 | - return ((term->getxy (term) >> 8) & 0xff) - margin_left; | ||
470 | 448 | + return (term->getxy (term).x) - margin_left; | ||
471 | 449 | } | ||
472 | 450 | |||
473 | 451 | static int | ||
474 | 452 | @@ -727,8 +727,8 @@ print_ucs4_real (const grub_uint32_t * s | ||
475 | 453 | if (backlog) | ||
476 | 454 | state = find_term_state (term); | ||
477 | 455 | |||
478 | 456 | - if (((term->getxy (term) >> 8) & 0xff) < margin_left) | ||
479 | 457 | - grub_print_spaces (term, margin_left - ((term->getxy (term) >> 8) & 0xff)); | ||
480 | 458 | + if ((term->getxy (term).x) < margin_left) | ||
481 | 459 | + grub_print_spaces (term, margin_left - (term->getxy (term).x)); | ||
482 | 460 | } | ||
483 | 461 | |||
484 | 462 | if ((term->flags & GRUB_TERM_CODE_TYPE_MASK) | ||
485 | 463 | Index: grub2-backport/grub-core/term/efi/console.c | ||
486 | 464 | =================================================================== | ||
487 | 465 | --- grub2-backport.orig/grub-core/term/efi/console.c | ||
488 | 466 | +++ grub2-backport/grub-core/term/efi/console.c | ||
489 | 467 | @@ -132,7 +132,7 @@ grub_console_getkey (struct grub_term_in | ||
490 | 468 | return GRUB_TERM_NO_KEY; | ||
491 | 469 | } | ||
492 | 470 | |||
493 | 471 | -static grub_uint16_t | ||
494 | 472 | +static struct grub_term_coordinate | ||
495 | 473 | grub_console_getwh (struct grub_term_output *term __attribute__ ((unused))) | ||
496 | 474 | { | ||
497 | 475 | grub_efi_simple_text_output_interface_t *o; | ||
498 | 476 | @@ -147,24 +147,24 @@ grub_console_getwh (struct grub_term_out | ||
499 | 477 | rows = 25; | ||
500 | 478 | } | ||
501 | 479 | |||
502 | 480 | - return ((columns << 8) | rows); | ||
503 | 481 | + return (struct grub_term_coordinate) { columns, rows }; | ||
504 | 482 | } | ||
505 | 483 | |||
506 | 484 | -static grub_uint16_t | ||
507 | 485 | +static struct grub_term_coordinate | ||
508 | 486 | grub_console_getxy (struct grub_term_output *term __attribute__ ((unused))) | ||
509 | 487 | { | ||
510 | 488 | grub_efi_simple_text_output_interface_t *o; | ||
511 | 489 | |||
512 | 490 | if (grub_efi_is_finished) | ||
513 | 491 | - return 0; | ||
514 | 492 | + return (struct grub_term_coordinate) { 0, 0 }; | ||
515 | 493 | |||
516 | 494 | o = grub_efi_system_table->con_out; | ||
517 | 495 | - return ((o->mode->cursor_column << 8) | o->mode->cursor_row); | ||
518 | 496 | + return (struct grub_term_coordinate) { o->mode->cursor_column, o->mode->cursor_row }; | ||
519 | 497 | } | ||
520 | 498 | |||
521 | 499 | static void | ||
522 | 500 | grub_console_gotoxy (struct grub_term_output *term __attribute__ ((unused)), | ||
523 | 501 | - grub_uint8_t x, grub_uint8_t y) | ||
524 | 502 | + struct grub_term_coordinate pos) | ||
525 | 503 | { | ||
526 | 504 | grub_efi_simple_text_output_interface_t *o; | ||
527 | 505 | |||
528 | 506 | @@ -172,7 +172,7 @@ grub_console_gotoxy (struct grub_term_ou | ||
529 | 507 | return; | ||
530 | 508 | |||
531 | 509 | o = grub_efi_system_table->con_out; | ||
532 | 510 | - efi_call_3 (o->set_cursor_position, o, x, y); | ||
533 | 511 | + efi_call_3 (o->set_cursor_position, o, pos.x, pos.y); | ||
534 | 512 | } | ||
535 | 513 | |||
536 | 514 | static void | ||
537 | 515 | Index: grub2-backport/grub-core/term/gfxterm.c | ||
538 | 516 | =================================================================== | ||
539 | 517 | --- grub2-backport.orig/grub-core/term/gfxterm.c | ||
540 | 518 | +++ grub2-backport/grub-core/term/gfxterm.c | ||
541 | 519 | @@ -978,34 +978,34 @@ grub_gfxterm_getcharwidth (struct grub_t | ||
542 | 520 | / virtual_screen.normal_char_width; | ||
543 | 521 | } | ||
544 | 522 | |||
545 | 523 | -static grub_uint16_t | ||
546 | 524 | +static struct grub_term_coordinate | ||
547 | 525 | grub_virtual_screen_getwh (struct grub_term_output *term __attribute__ ((unused))) | ||
548 | 526 | { | ||
549 | 527 | - return (virtual_screen.columns << 8) | virtual_screen.rows; | ||
550 | 528 | + return (struct grub_term_coordinate) { virtual_screen.columns, virtual_screen.rows }; | ||
551 | 529 | } | ||
552 | 530 | |||
553 | 531 | -static grub_uint16_t | ||
554 | 532 | +static struct grub_term_coordinate | ||
555 | 533 | grub_virtual_screen_getxy (struct grub_term_output *term __attribute__ ((unused))) | ||
556 | 534 | { | ||
557 | 535 | - return ((virtual_screen.cursor_x << 8) | virtual_screen.cursor_y); | ||
558 | 536 | + return (struct grub_term_coordinate) { virtual_screen.cursor_x, virtual_screen.cursor_y }; | ||
559 | 537 | } | ||
560 | 538 | |||
561 | 539 | static void | ||
562 | 540 | grub_gfxterm_gotoxy (struct grub_term_output *term __attribute__ ((unused)), | ||
563 | 541 | - grub_uint8_t x, grub_uint8_t y) | ||
564 | 542 | + struct grub_term_coordinate pos) | ||
565 | 543 | { | ||
566 | 544 | - if (x >= virtual_screen.columns) | ||
567 | 545 | - x = virtual_screen.columns - 1; | ||
568 | 546 | + if (pos.x >= virtual_screen.columns) | ||
569 | 547 | + pos.x = virtual_screen.columns - 1; | ||
570 | 548 | |||
571 | 549 | - if (y >= virtual_screen.rows) | ||
572 | 550 | - y = virtual_screen.rows - 1; | ||
573 | 551 | + if (pos.y >= virtual_screen.rows) | ||
574 | 552 | + pos.y = virtual_screen.rows - 1; | ||
575 | 553 | |||
576 | 554 | /* Erase current cursor, if any. */ | ||
577 | 555 | if (virtual_screen.cursor_state) | ||
578 | 556 | draw_cursor (0); | ||
579 | 557 | |||
580 | 558 | - virtual_screen.cursor_x = x; | ||
581 | 559 | - virtual_screen.cursor_y = y; | ||
582 | 560 | + virtual_screen.cursor_x = pos.x; | ||
583 | 561 | + virtual_screen.cursor_y = pos.y; | ||
584 | 562 | |||
585 | 563 | /* Draw cursor if visible. */ | ||
586 | 564 | if (virtual_screen.cursor_state) | ||
587 | 565 | Index: grub2-backport/grub-core/term/i386/pc/vga_text.c | ||
588 | 566 | =================================================================== | ||
589 | 567 | --- grub2-backport.orig/grub-core/term/i386/pc/vga_text.c | ||
590 | 568 | +++ grub2-backport/grub-core/term/i386/pc/vga_text.c | ||
591 | 569 | @@ -27,7 +27,7 @@ GRUB_MOD_LICENSE ("GPLv3+"); | ||
592 | 570 | #define COLS 80 | ||
593 | 571 | #define ROWS 25 | ||
594 | 572 | |||
595 | 573 | -static int grub_curr_x, grub_curr_y; | ||
596 | 574 | +static struct grub_term_coordinate grub_curr_pos; | ||
597 | 575 | |||
598 | 576 | #define VGA_TEXT_SCREEN ((grub_uint16_t *) 0xb8000) | ||
599 | 577 | |||
600 | 578 | @@ -46,7 +46,7 @@ screen_read_char (int x, int y) | ||
601 | 579 | static void | ||
602 | 580 | update_cursor (void) | ||
603 | 581 | { | ||
604 | 582 | - unsigned int pos = grub_curr_y * COLS + grub_curr_x; | ||
605 | 583 | + unsigned int pos = grub_curr_pos.y * COLS + grub_curr_pos.x; | ||
606 | 584 | grub_vga_cr_write (pos >> 8, GRUB_VGA_CR_CURSOR_ADDR_HIGH); | ||
607 | 585 | grub_vga_cr_write (pos & 0xFF, GRUB_VGA_CR_CURSOR_ADDR_LOW); | ||
608 | 586 | } | ||
609 | 587 | @@ -54,9 +54,9 @@ update_cursor (void) | ||
610 | 588 | static void | ||
611 | 589 | inc_y (void) | ||
612 | 590 | { | ||
613 | 591 | - grub_curr_x = 0; | ||
614 | 592 | - if (grub_curr_y < ROWS - 1) | ||
615 | 593 | - grub_curr_y++; | ||
616 | 594 | + grub_curr_pos.x = 0; | ||
617 | 595 | + if (grub_curr_pos.y < ROWS - 1) | ||
618 | 596 | + grub_curr_pos.y++; | ||
619 | 597 | else | ||
620 | 598 | { | ||
621 | 599 | int x, y; | ||
622 | 600 | @@ -71,10 +71,10 @@ inc_y (void) | ||
623 | 601 | static void | ||
624 | 602 | inc_x (void) | ||
625 | 603 | { | ||
626 | 604 | - if (grub_curr_x >= COLS - 1) | ||
627 | 605 | + if (grub_curr_pos.x >= COLS - 1) | ||
628 | 606 | inc_y (); | ||
629 | 607 | else | ||
630 | 608 | - grub_curr_x++; | ||
631 | 609 | + grub_curr_pos.x++; | ||
632 | 610 | } | ||
633 | 611 | |||
634 | 612 | static void | ||
635 | 613 | @@ -84,17 +84,17 @@ grub_vga_text_putchar (struct grub_term_ | ||
636 | 614 | switch (c->base) | ||
637 | 615 | { | ||
638 | 616 | case '\b': | ||
639 | 617 | - if (grub_curr_x != 0) | ||
640 | 618 | - screen_write_char (grub_curr_x--, grub_curr_y, ' '); | ||
641 | 619 | + if (grub_curr_pos.x != 0) | ||
642 | 620 | + screen_write_char (grub_curr_pos.x--, grub_curr_pos.y, ' '); | ||
643 | 621 | break; | ||
644 | 622 | case '\n': | ||
645 | 623 | inc_y (); | ||
646 | 624 | break; | ||
647 | 625 | case '\r': | ||
648 | 626 | - grub_curr_x = 0; | ||
649 | 627 | + grub_curr_pos.x = 0; | ||
650 | 628 | break; | ||
651 | 629 | default: | ||
652 | 630 | - screen_write_char (grub_curr_x, grub_curr_y, | ||
653 | 631 | + screen_write_char (grub_curr_pos.x, grub_curr_pos.y, | ||
654 | 632 | c->base | (grub_console_cur_color << 8)); | ||
655 | 633 | inc_x (); | ||
656 | 634 | } | ||
657 | 635 | @@ -102,18 +102,17 @@ grub_vga_text_putchar (struct grub_term_ | ||
658 | 636 | update_cursor (); | ||
659 | 637 | } | ||
660 | 638 | |||
661 | 639 | -static grub_uint16_t | ||
662 | 640 | +static struct grub_term_coordinate | ||
663 | 641 | grub_vga_text_getxy (struct grub_term_output *term __attribute__ ((unused))) | ||
664 | 642 | { | ||
665 | 643 | - return (grub_curr_x << 8) | grub_curr_y; | ||
666 | 644 | + return grub_curr_pos; | ||
667 | 645 | } | ||
668 | 646 | |||
669 | 647 | static void | ||
670 | 648 | grub_vga_text_gotoxy (struct grub_term_output *term __attribute__ ((unused)), | ||
671 | 649 | - grub_uint8_t x, grub_uint8_t y) | ||
672 | 650 | + struct grub_term_coordinate pos) | ||
673 | 651 | { | ||
674 | 652 | - grub_curr_x = x; | ||
675 | 653 | - grub_curr_y = y; | ||
676 | 654 | + grub_curr_pos = pos; | ||
677 | 655 | update_cursor (); | ||
678 | 656 | } | ||
679 | 657 | |||
680 | 658 | @@ -123,7 +122,7 @@ grub_vga_text_cls (struct grub_term_outp | ||
681 | 659 | int i; | ||
682 | 660 | for (i = 0; i < ROWS * COLS; i++) | ||
683 | 661 | VGA_TEXT_SCREEN[i] = ' ' | (grub_console_cur_color << 8); | ||
684 | 662 | - grub_vga_text_gotoxy (term, 0, 0); | ||
685 | 663 | + grub_vga_text_gotoxy (term, (struct grub_term_coordinate) { 0, 0 }); | ||
686 | 664 | } | ||
687 | 665 | |||
688 | 666 | static void | ||
689 | 667 | Index: grub2-backport/grub-core/term/ieee1275/ofconsole.c | ||
690 | 668 | =================================================================== | ||
691 | 669 | --- grub2-backport.orig/grub-core/term/ieee1275/ofconsole.c | ||
692 | 670 | +++ grub2-backport/grub-core/term/ieee1275/ofconsole.c | ||
693 | 671 | @@ -90,7 +90,7 @@ grub_ofconsole_dimensions (void) | ||
694 | 672 | |||
695 | 673 | if (! grub_ieee1275_get_property (options, "screen-#columns", | ||
696 | 674 | val, lval, 0)) | ||
697 | 675 | - grub_ofconsole_terminfo_output.width | ||
698 | 676 | + grub_ofconsole_terminfo_output.size.x | ||
699 | 677 | = (grub_uint8_t) grub_strtoul (val, 0, 10); | ||
700 | 678 | } | ||
701 | 679 | if (! grub_ieee1275_get_property_length (options, "screen-#rows", &lval) | ||
702 | 680 | @@ -99,16 +99,16 @@ grub_ofconsole_dimensions (void) | ||
703 | 681 | char val[lval]; | ||
704 | 682 | if (! grub_ieee1275_get_property (options, "screen-#rows", | ||
705 | 683 | val, lval, 0)) | ||
706 | 684 | - grub_ofconsole_terminfo_output.height | ||
707 | 685 | + grub_ofconsole_terminfo_output.size.y | ||
708 | 686 | = (grub_uint8_t) grub_strtoul (val, 0, 10); | ||
709 | 687 | } | ||
710 | 688 | } | ||
711 | 689 | |||
712 | 690 | /* Use a small console by default. */ | ||
713 | 691 | - if (! grub_ofconsole_terminfo_output.width) | ||
714 | 692 | - grub_ofconsole_terminfo_output.width = 80; | ||
715 | 693 | - if (! grub_ofconsole_terminfo_output.height) | ||
716 | 694 | - grub_ofconsole_terminfo_output.height = 24; | ||
717 | 695 | + if (! grub_ofconsole_terminfo_output.size.x) | ||
718 | 696 | + grub_ofconsole_terminfo_output.size.x = 80; | ||
719 | 697 | + if (! grub_ofconsole_terminfo_output.size.y) | ||
720 | 698 | + grub_ofconsole_terminfo_output.size.y = 24; | ||
721 | 699 | } | ||
722 | 700 | |||
723 | 701 | static void | ||
724 | 702 | @@ -185,8 +185,7 @@ struct grub_terminfo_input_state grub_of | ||
725 | 703 | struct grub_terminfo_output_state grub_ofconsole_terminfo_output = | ||
726 | 704 | { | ||
727 | 705 | .put = put, | ||
728 | 706 | - .width = 80, | ||
729 | 707 | - .height = 24 | ||
730 | 708 | + .size = { 80, 24 } | ||
731 | 709 | }; | ||
732 | 710 | |||
733 | 711 | static struct grub_term_input grub_ofconsole_term_input = | ||
734 | 712 | Index: grub2-backport/grub-core/term/serial.c | ||
735 | 713 | =================================================================== | ||
736 | 714 | --- grub2-backport.orig/grub-core/term/serial.c | ||
737 | 715 | +++ grub2-backport/grub-core/term/serial.c | ||
738 | 716 | @@ -84,8 +84,7 @@ static const struct grub_serial_output_s | ||
739 | 717 | .tinfo = | ||
740 | 718 | { | ||
741 | 719 | .put = serial_put, | ||
742 | 720 | - .width = 80, | ||
743 | 721 | - .height = 24 | ||
744 | 722 | + .size = { 80, 24 } | ||
745 | 723 | } | ||
746 | 724 | }; | ||
747 | 725 | |||
748 | 726 | Index: grub2-backport/grub-core/term/terminfo.c | ||
749 | 727 | =================================================================== | ||
750 | 728 | --- grub2-backport.orig/grub-core/term/terminfo.c | ||
751 | 729 | +++ grub2-backport/grub-core/term/terminfo.c | ||
752 | 730 | @@ -200,38 +200,37 @@ putstr (struct grub_term_output *term, c | ||
753 | 731 | data->put (term, *str++); | ||
754 | 732 | } | ||
755 | 733 | |||
756 | 734 | -grub_uint16_t | ||
757 | 735 | +struct grub_term_coordinate | ||
758 | 736 | grub_terminfo_getxy (struct grub_term_output *term) | ||
759 | 737 | { | ||
760 | 738 | struct grub_terminfo_output_state *data | ||
761 | 739 | = (struct grub_terminfo_output_state *) term->data; | ||
762 | 740 | |||
763 | 741 | - return ((data->xpos << 8) | data->ypos); | ||
764 | 742 | + return data->pos; | ||
765 | 743 | } | ||
766 | 744 | |||
767 | 745 | void | ||
768 | 746 | grub_terminfo_gotoxy (struct grub_term_output *term, | ||
769 | 747 | - grub_uint8_t x, grub_uint8_t y) | ||
770 | 748 | + struct grub_term_coordinate pos) | ||
771 | 749 | { | ||
772 | 750 | struct grub_terminfo_output_state *data | ||
773 | 751 | = (struct grub_terminfo_output_state *) term->data; | ||
774 | 752 | |||
775 | 753 | - if (x > grub_term_width (term) || y > grub_term_height (term)) | ||
776 | 754 | + if (pos.x > grub_term_width (term) || pos.y > grub_term_height (term)) | ||
777 | 755 | { | ||
778 | 756 | - grub_error (GRUB_ERR_OUT_OF_RANGE, "invalid point (%u,%u)", x, y); | ||
779 | 757 | + grub_error (GRUB_ERR_OUT_OF_RANGE, "invalid point (%u,%u)", pos.x, pos.y); | ||
780 | 758 | return; | ||
781 | 759 | } | ||
782 | 760 | |||
783 | 761 | if (data->gotoxy) | ||
784 | 762 | - putstr (term, grub_terminfo_tparm (data->gotoxy, y, x)); | ||
785 | 763 | + putstr (term, grub_terminfo_tparm (data->gotoxy, pos.y, pos.x)); | ||
786 | 764 | else | ||
787 | 765 | { | ||
788 | 766 | - if ((y == data->ypos) && (x == data->xpos - 1)) | ||
789 | 767 | + if ((pos.y == data->pos.y) && (pos.x == data->pos.x - 1)) | ||
790 | 768 | data->put (term, '\b'); | ||
791 | 769 | } | ||
792 | 770 | |||
793 | 771 | - data->xpos = x; | ||
794 | 772 | - data->ypos = y; | ||
795 | 773 | + data->pos = pos; | ||
796 | 774 | } | ||
797 | 775 | |||
798 | 776 | /* Clear the screen. */ | ||
799 | 777 | @@ -243,7 +242,7 @@ grub_terminfo_cls (struct grub_term_outp | ||
800 | 778 | |||
801 | 779 | putstr (term, grub_terminfo_tparm (data->cls)); | ||
802 | 780 | |||
803 | 781 | - data->xpos = data->ypos = 0; | ||
804 | 782 | + data->pos = (struct grub_term_coordinate) { 0, 0 }; | ||
805 | 783 | } | ||
806 | 784 | |||
807 | 785 | void | ||
808 | 786 | @@ -331,42 +330,42 @@ grub_terminfo_putchar (struct grub_term_ | ||
809 | 787 | |||
810 | 788 | case '\b': | ||
811 | 789 | case 127: | ||
812 | 790 | - if (data->xpos > 0) | ||
813 | 791 | - data->xpos--; | ||
814 | 792 | + if (data->pos.x > 0) | ||
815 | 793 | + data->pos.x--; | ||
816 | 794 | break; | ||
817 | 795 | |||
818 | 796 | case '\n': | ||
819 | 797 | - if (data->ypos < grub_term_height (term) - 1) | ||
820 | 798 | - data->ypos++; | ||
821 | 799 | + if (data->pos.y < grub_term_height (term) - 1) | ||
822 | 800 | + data->pos.y++; | ||
823 | 801 | break; | ||
824 | 802 | |||
825 | 803 | case '\r': | ||
826 | 804 | - data->xpos = 0; | ||
827 | 805 | + data->pos.x = 0; | ||
828 | 806 | break; | ||
829 | 807 | |||
830 | 808 | default: | ||
831 | 809 | - if (data->xpos + c->estimated_width >= grub_term_width (term) + 1) | ||
832 | 810 | + if ((int) data->pos.x + c->estimated_width >= (int) grub_term_width (term) + 1) | ||
833 | 811 | { | ||
834 | 812 | - data->xpos = 0; | ||
835 | 813 | - if (data->ypos < grub_term_height (term) - 1) | ||
836 | 814 | - data->ypos++; | ||
837 | 815 | + data->pos.x = 0; | ||
838 | 816 | + if (data->pos.y < grub_term_height (term) - 1) | ||
839 | 817 | + data->pos.y++; | ||
840 | 818 | data->put (term, '\r'); | ||
841 | 819 | data->put (term, '\n'); | ||
842 | 820 | } | ||
843 | 821 | - data->xpos += c->estimated_width; | ||
844 | 822 | + data->pos.x += c->estimated_width; | ||
845 | 823 | break; | ||
846 | 824 | } | ||
847 | 825 | |||
848 | 826 | data->put (term, c->base); | ||
849 | 827 | } | ||
850 | 828 | |||
851 | 829 | -grub_uint16_t | ||
852 | 830 | +struct grub_term_coordinate | ||
853 | 831 | grub_terminfo_getwh (struct grub_term_output *term) | ||
854 | 832 | { | ||
855 | 833 | struct grub_terminfo_output_state *data | ||
856 | 834 | = (struct grub_terminfo_output_state *) term->data; | ||
857 | 835 | |||
858 | 836 | - return (data->width << 8) | data->height; | ||
859 | 837 | + return data->size; | ||
860 | 838 | } | ||
861 | 839 | |||
862 | 840 | #define ANSI_C0 0x9b | ||
863 | 841 | @@ -621,8 +620,8 @@ grub_cmd_terminfo (grub_extcmd_context_t | ||
864 | 842 | { | ||
865 | 843 | struct grub_terminfo_output_state *data | ||
866 | 844 | = (struct grub_terminfo_output_state *) cur->data; | ||
867 | 845 | - data->width = w; | ||
868 | 846 | - data->height = h; | ||
869 | 847 | + data->pos.x = w; | ||
870 | 848 | + data->pos.y = h; | ||
871 | 849 | } | ||
872 | 850 | |||
873 | 851 | if (argc == 1) | ||
874 | 852 | Index: grub2-backport/include/grub/term.h | ||
875 | 853 | =================================================================== | ||
876 | 854 | --- grub2-backport.orig/include/grub/term.h | ||
877 | 855 | +++ grub2-backport/include/grub/term.h | ||
878 | 856 | @@ -167,6 +167,13 @@ struct grub_term_input | ||
879 | 857 | }; | ||
880 | 858 | typedef struct grub_term_input *grub_term_input_t; | ||
881 | 859 | |||
882 | 860 | +/* Made in a way to fit into uint32_t and so be passed in a register. */ | ||
883 | 861 | +struct grub_term_coordinate | ||
884 | 862 | +{ | ||
885 | 863 | + grub_uint16_t x; | ||
886 | 864 | + grub_uint16_t y; | ||
887 | 865 | +}; | ||
888 | 866 | + | ||
889 | 867 | struct grub_term_output | ||
890 | 868 | { | ||
891 | 869 | /* The next terminal. */ | ||
892 | 870 | @@ -190,15 +197,15 @@ struct grub_term_output | ||
893 | 871 | grub_ssize_t (*getcharwidth) (struct grub_term_output *term, | ||
894 | 872 | const struct grub_unicode_glyph *c); | ||
895 | 873 | |||
896 | 874 | - /* Get the screen size. The return value is ((Width << 8) | Height). */ | ||
897 | 875 | - grub_uint16_t (*getwh) (struct grub_term_output *term); | ||
898 | 876 | + /* Get the screen size. */ | ||
899 | 877 | + struct grub_term_coordinate (*getwh) (struct grub_term_output *term); | ||
900 | 878 | |||
901 | 879 | - /* Get the cursor position. The return value is ((X << 8) | Y). */ | ||
902 | 880 | - grub_uint16_t (*getxy) (struct grub_term_output *term); | ||
903 | 881 | + /* Get the cursor position. */ | ||
904 | 882 | + struct grub_term_coordinate (*getxy) (struct grub_term_output *term); | ||
905 | 883 | |||
906 | 884 | /* Go to the position (X, Y). */ | ||
907 | 885 | void (*gotoxy) (struct grub_term_output *term, | ||
908 | 886 | - grub_uint8_t x, grub_uint8_t y); | ||
909 | 887 | + struct grub_term_coordinate pos); | ||
910 | 888 | |||
911 | 889 | /* Clear the screen. */ | ||
912 | 890 | void (*cls) (struct grub_term_output *term); | ||
913 | 891 | @@ -308,17 +315,17 @@ int EXPORT_FUNC(grub_checkkey) (void); | ||
914 | 892 | void grub_cls (void); | ||
915 | 893 | void EXPORT_FUNC(grub_refresh) (void); | ||
916 | 894 | void grub_puts_terminal (const char *str, struct grub_term_output *term); | ||
917 | 895 | -grub_uint16_t *grub_term_save_pos (void); | ||
918 | 896 | -void grub_term_restore_pos (grub_uint16_t *pos); | ||
919 | 897 | +struct grub_term_coordinate *grub_term_save_pos (void); | ||
920 | 898 | +void grub_term_restore_pos (struct grub_term_coordinate *pos); | ||
921 | 899 | |||
922 | 900 | static inline unsigned grub_term_width (struct grub_term_output *term) | ||
923 | 901 | { | ||
924 | 902 | - return ((term->getwh(term)&0xFF00)>>8); | ||
925 | 903 | + return term->getwh(term).x; | ||
926 | 904 | } | ||
927 | 905 | |||
928 | 906 | static inline unsigned grub_term_height (struct grub_term_output *term) | ||
929 | 907 | { | ||
930 | 908 | - return (term->getwh(term)&0xFF); | ||
931 | 909 | + return term->getwh(term).y; | ||
932 | 910 | } | ||
933 | 911 | |||
934 | 912 | /* The width of the border. */ | ||
935 | 913 | @@ -336,7 +343,7 @@ grub_term_entry_width (struct grub_term_ | ||
936 | 914 | return grub_term_border_width (term) - 2 - GRUB_TERM_MARGIN * 2 - 1; | ||
937 | 915 | } | ||
938 | 916 | |||
939 | 917 | -static inline grub_uint16_t | ||
940 | 918 | +static inline struct grub_term_coordinate | ||
941 | 919 | grub_term_getxy (struct grub_term_output *term) | ||
942 | 920 | { | ||
943 | 921 | return term->getxy (term); | ||
944 | 922 | @@ -350,9 +357,9 @@ grub_term_refresh (struct grub_term_outp | ||
945 | 923 | } | ||
946 | 924 | |||
947 | 925 | static inline void | ||
948 | 926 | -grub_term_gotoxy (struct grub_term_output *term, grub_uint8_t x, grub_uint8_t y) | ||
949 | 927 | +grub_term_gotoxy (struct grub_term_output *term, struct grub_term_coordinate pos) | ||
950 | 928 | { | ||
951 | 929 | - term->gotoxy (term, x, y); | ||
952 | 930 | + term->gotoxy (term, pos); | ||
953 | 931 | } | ||
954 | 932 | |||
955 | 933 | static inline void | ||
956 | 934 | Index: grub2-backport/include/grub/terminfo.h | ||
957 | 935 | =================================================================== | ||
958 | 936 | --- grub2-backport.orig/include/grub/terminfo.h | ||
959 | 937 | +++ grub2-backport/include/grub/terminfo.h | ||
960 | 938 | @@ -49,18 +49,17 @@ struct grub_terminfo_output_state | ||
961 | 939 | char *cursor_off; | ||
962 | 940 | char *setcolor; | ||
963 | 941 | |||
964 | 942 | - unsigned int width, height; | ||
965 | 943 | - | ||
966 | 944 | - unsigned int xpos, ypos; | ||
967 | 945 | + struct grub_term_coordinate size; | ||
968 | 946 | + struct grub_term_coordinate pos; | ||
969 | 947 | |||
970 | 948 | void (*put) (struct grub_term_output *term, const int c); | ||
971 | 949 | }; | ||
972 | 950 | |||
973 | 951 | grub_err_t EXPORT_FUNC(grub_terminfo_output_init) (struct grub_term_output *term); | ||
974 | 952 | void EXPORT_FUNC(grub_terminfo_gotoxy) (grub_term_output_t term, | ||
975 | 953 | - grub_uint8_t x, grub_uint8_t y); | ||
976 | 954 | + struct grub_term_coordinate pos); | ||
977 | 955 | void EXPORT_FUNC(grub_terminfo_cls) (grub_term_output_t term); | ||
978 | 956 | -grub_uint16_t EXPORT_FUNC (grub_terminfo_getxy) (struct grub_term_output *term); | ||
979 | 957 | +struct grub_term_coordinate EXPORT_FUNC (grub_terminfo_getxy) (struct grub_term_output *term); | ||
980 | 958 | void EXPORT_FUNC (grub_terminfo_setcursor) (struct grub_term_output *term, | ||
981 | 959 | const int on); | ||
982 | 960 | void EXPORT_FUNC (grub_terminfo_setcolorstate) (struct grub_term_output *term, | ||
983 | 961 | @@ -71,7 +70,7 @@ grub_err_t EXPORT_FUNC (grub_terminfo_in | ||
984 | 962 | int EXPORT_FUNC (grub_terminfo_getkey) (struct grub_term_input *term); | ||
985 | 963 | void EXPORT_FUNC (grub_terminfo_putchar) (struct grub_term_output *term, | ||
986 | 964 | const struct grub_unicode_glyph *c); | ||
987 | 965 | -grub_uint16_t EXPORT_FUNC (grub_terminfo_getwh) (struct grub_term_output *term); | ||
988 | 966 | +struct grub_term_coordinate EXPORT_FUNC (grub_terminfo_getwh) (struct grub_term_output *term); | ||
989 | 967 | |||
990 | 968 | |||
991 | 969 | grub_err_t EXPORT_FUNC (grub_terminfo_output_register) (struct grub_term_output *term, | ||
992 | 970 | Index: grub2-backport/grub-core/kern/emu/console.c | ||
993 | 971 | =================================================================== | ||
994 | 972 | --- grub2-backport.orig/grub-core/kern/emu/console.c | ||
995 | 973 | +++ grub2-backport/grub-core/kern/emu/console.c | ||
996 | 974 | @@ -168,7 +168,7 @@ grub_ncurses_getkey (struct grub_term_in | ||
997 | 975 | return c; | ||
998 | 976 | } | ||
999 | 977 | |||
1000 | 978 | -static grub_uint16_t | ||
1001 | 979 | +static struct grub_term_coordinate | ||
1002 | 980 | grub_ncurses_getxy (struct grub_term_output *term __attribute__ ((unused))) | ||
1003 | 981 | { | ||
1004 | 982 | int x; | ||
1005 | 983 | @@ -176,10 +176,10 @@ grub_ncurses_getxy (struct grub_term_out | ||
1006 | 984 | |||
1007 | 985 | getyx (stdscr, y, x); | ||
1008 | 986 | |||
1009 | 987 | - return (x << 8) | y; | ||
1010 | 988 | + return (struct grub_term_coordinate) { x, y }; | ||
1011 | 989 | } | ||
1012 | 990 | |||
1013 | 991 | -static grub_uint16_t | ||
1014 | 992 | +static struct grub_term_coordinate | ||
1015 | 993 | grub_ncurses_getwh (struct grub_term_output *term __attribute__ ((unused))) | ||
1016 | 994 | { | ||
1017 | 995 | int x; | ||
1018 | 996 | @@ -187,14 +187,14 @@ grub_ncurses_getwh (struct grub_term_out | ||
1019 | 997 | |||
1020 | 998 | getmaxyx (stdscr, y, x); | ||
1021 | 999 | |||
1022 | 1000 | - return (x << 8) | y; | ||
1023 | 1001 | + return (struct grub_term_coordinate) { x, y }; | ||
1024 | 1002 | } | ||
1025 | 1003 | |||
1026 | 1004 | static void | ||
1027 | 1005 | grub_ncurses_gotoxy (struct grub_term_output *term __attribute__ ((unused)), | ||
1028 | 1006 | - grub_uint8_t x, grub_uint8_t y) | ||
1029 | 1007 | + struct grub_term_coordinate pos) | ||
1030 | 1008 | { | ||
1031 | 1009 | - move (y, x); | ||
1032 | 1010 | + move (pos.y, pos.x); | ||
1033 | 1011 | } | ||
1034 | 1012 | |||
1035 | 1013 | static void | ||
1036 | 1014 | Index: grub2-backport/grub-core/term/i386/vga_common.c | ||
1037 | 1015 | =================================================================== | ||
1038 | 1016 | --- grub2-backport.orig/grub-core/term/i386/vga_common.c | ||
1039 | 1017 | +++ grub2-backport/grub-core/term/i386/vga_common.c | ||
1040 | 1018 | @@ -22,10 +22,10 @@ | ||
1041 | 1019 | |||
1042 | 1020 | grub_uint8_t grub_console_cur_color = 0x7; | ||
1043 | 1021 | |||
1044 | 1022 | -grub_uint16_t | ||
1045 | 1023 | +struct grub_term_coordinate | ||
1046 | 1024 | grub_console_getwh (struct grub_term_output *term __attribute__ ((unused))) | ||
1047 | 1025 | { | ||
1048 | 1026 | - return (80 << 8) | 25; | ||
1049 | 1027 | + return (struct grub_term_coordinate) { 80, 25 }; | ||
1050 | 1028 | } | ||
1051 | 1029 | |||
1052 | 1030 | void | ||
1053 | 1031 | Index: grub2-backport/include/grub/i386/vga_common.h | ||
1054 | 1032 | =================================================================== | ||
1055 | 1033 | --- grub2-backport.orig/include/grub/i386/vga_common.h | ||
1056 | 1034 | +++ grub2-backport/include/grub/i386/vga_common.h | ||
1057 | 1035 | @@ -25,7 +25,7 @@ | ||
1058 | 1036 | |||
1059 | 1037 | extern grub_uint8_t grub_console_cur_color; | ||
1060 | 1038 | |||
1061 | 1039 | -grub_uint16_t grub_console_getwh (struct grub_term_output *term); | ||
1062 | 1040 | +struct grub_term_coordinate grub_console_getwh (struct grub_term_output *term); | ||
1063 | 1041 | void grub_console_setcolorstate (struct grub_term_output *term, | ||
1064 | 1042 | grub_term_color_state state); | ||
1065 | 1043 | |||
1066 | 1044 | Index: grub2-backport/include/grub/i386/pc/console.h | ||
1067 | 1045 | =================================================================== | ||
1068 | 1046 | --- grub2-backport.orig/include/grub/i386/pc/console.h | ||
1069 | 1047 | +++ grub2-backport/include/grub/i386/pc/console.h | ||
1070 | 1048 | @@ -28,9 +28,6 @@ | ||
1071 | 1049 | |||
1072 | 1050 | /* These are global to share code between C and asm. */ | ||
1073 | 1051 | int grub_console_getkey (struct grub_term_input *term); | ||
1074 | 1052 | -grub_uint16_t grub_console_getxy (struct grub_term_output *term); | ||
1075 | 1053 | -void grub_console_gotoxy (struct grub_term_output *term, | ||
1076 | 1054 | - grub_uint8_t x, grub_uint8_t y); | ||
1077 | 1055 | void grub_console_cls (struct grub_term_output *term); | ||
1078 | 1056 | void grub_console_setcursor (struct grub_term_output *term, int on); | ||
1079 | 1057 | void grub_console_putchar (struct grub_term_output *term, | ||
1080 | 1058 | Index: grub2-backport/grub-core/kern/i386/pc/startup.S | ||
1081 | 1059 | =================================================================== | ||
1082 | 1060 | --- grub2-backport.orig/grub-core/kern/i386/pc/startup.S | ||
1083 | 1061 | +++ grub2-backport/grub-core/kern/i386/pc/startup.S | ||
1084 | 1062 | @@ -678,72 +678,6 @@ notpending: | ||
1085 | 1063 | |||
1086 | 1064 | |||
1087 | 1065 | /* | ||
1088 | 1066 | - * grub_uint16_t grub_console_getxy (void) | ||
1089 | 1067 | - * BIOS call "INT 10H Function 03h" to get cursor position | ||
1090 | 1068 | - * Call with %ah = 0x03 | ||
1091 | 1069 | - * %bh = page | ||
1092 | 1070 | - * Returns %ch = starting scan line | ||
1093 | 1071 | - * %cl = ending scan line | ||
1094 | 1072 | - * %dh = row (0 is top) | ||
1095 | 1073 | - * %dl = column (0 is left) | ||
1096 | 1074 | - */ | ||
1097 | 1075 | - | ||
1098 | 1076 | - | ||
1099 | 1077 | -FUNCTION(grub_console_getxy) | ||
1100 | 1078 | - pushl %ebp | ||
1101 | 1079 | - pushl %ebx /* save EBX */ | ||
1102 | 1080 | - | ||
1103 | 1081 | - call prot_to_real | ||
1104 | 1082 | - .code16 | ||
1105 | 1083 | - | ||
1106 | 1084 | - xorb %bh, %bh /* set page to 0 */ | ||
1107 | 1085 | - movb $0x3, %ah | ||
1108 | 1086 | - int $0x10 /* get cursor position */ | ||
1109 | 1087 | - | ||
1110 | 1088 | - DATA32 call real_to_prot | ||
1111 | 1089 | - .code32 | ||
1112 | 1090 | - | ||
1113 | 1091 | - movb %dl, %ah | ||
1114 | 1092 | - movb %dh, %al | ||
1115 | 1093 | - | ||
1116 | 1094 | - popl %ebx | ||
1117 | 1095 | - popl %ebp | ||
1118 | 1096 | - ret | ||
1119 | 1097 | - | ||
1120 | 1098 | - | ||
1121 | 1099 | -/* | ||
1122 | 1100 | - * void grub_console_gotoxy(grub_uint8_t x, grub_uint8_t y) | ||
1123 | 1101 | - * BIOS call "INT 10H Function 02h" to set cursor position | ||
1124 | 1102 | - * Call with %ah = 0x02 | ||
1125 | 1103 | - * %bh = page | ||
1126 | 1104 | - * %dh = row (0 is top) | ||
1127 | 1105 | - * %dl = column (0 is left) | ||
1128 | 1106 | - */ | ||
1129 | 1107 | - | ||
1130 | 1108 | - | ||
1131 | 1109 | -FUNCTION(grub_console_gotoxy) | ||
1132 | 1110 | - pushl %ebp | ||
1133 | 1111 | - pushl %ebx /* save EBX */ | ||
1134 | 1112 | - | ||
1135 | 1113 | - movb %cl, %dh /* %dh = y */ | ||
1136 | 1114 | - /* %dl = x */ | ||
1137 | 1115 | - | ||
1138 | 1116 | - call prot_to_real | ||
1139 | 1117 | - .code16 | ||
1140 | 1118 | - | ||
1141 | 1119 | - xorb %bh, %bh /* set page to 0 */ | ||
1142 | 1120 | - movb $0x2, %ah | ||
1143 | 1121 | - int $0x10 /* set cursor position */ | ||
1144 | 1122 | - | ||
1145 | 1123 | - DATA32 call real_to_prot | ||
1146 | 1124 | - .code32 | ||
1147 | 1125 | - | ||
1148 | 1126 | - popl %ebx | ||
1149 | 1127 | - popl %ebp | ||
1150 | 1128 | - ret | ||
1151 | 1129 | - | ||
1152 | 1130 | - | ||
1153 | 1131 | -/* | ||
1154 | 1132 | * void grub_console_cls (void) | ||
1155 | 1133 | * BIOS call "INT 10H Function 09h" to write character and attribute | ||
1156 | 1134 | * Call with %ah = 0x09 | ||
1157 | 1135 | Index: grub2-backport/grub-core/term/i386/pc/console.c | ||
1158 | 1136 | =================================================================== | ||
1159 | 1137 | --- grub2-backport.orig/grub-core/term/i386/pc/console.c | ||
1160 | 1138 | +++ grub2-backport/grub-core/term/i386/pc/console.c | ||
1161 | 1139 | @@ -20,10 +20,60 @@ | ||
1162 | 1140 | #include <grub/machine/console.h> | ||
1163 | 1141 | #include <grub/term.h> | ||
1164 | 1142 | #include <grub/types.h> | ||
1165 | 1143 | +#include <grub/machine/int.h> | ||
1166 | 1144 | |||
1167 | 1145 | static const struct grub_machine_bios_data_area *bios_data_area = | ||
1168 | 1146 | (struct grub_machine_bios_data_area *) GRUB_MEMORY_MACHINE_BIOS_DATA_AREA_ADDR; | ||
1169 | 1147 | |||
1170 | 1148 | +/* | ||
1171 | 1149 | + * BIOS call "INT 10H Function 03h" to get cursor position | ||
1172 | 1150 | + * Call with %ah = 0x03 | ||
1173 | 1151 | + * %bh = page | ||
1174 | 1152 | + * Returns %ch = starting scan line | ||
1175 | 1153 | + * %cl = ending scan line | ||
1176 | 1154 | + * %dh = row (0 is top) | ||
1177 | 1155 | + * %dl = column (0 is left) | ||
1178 | 1156 | + */ | ||
1179 | 1157 | + | ||
1180 | 1158 | + | ||
1181 | 1159 | +static struct grub_term_coordinate | ||
1182 | 1160 | +grub_console_getxy (struct grub_term_output *term __attribute__ ((unused)) | ||
1183 | 1161 | +) | ||
1184 | 1162 | +{ | ||
1185 | 1163 | + struct grub_bios_int_registers regs; | ||
1186 | 1164 | + | ||
1187 | 1165 | + regs.eax = 0x0300; | ||
1188 | 1166 | + regs.ebx = 0; | ||
1189 | 1167 | + regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; | ||
1190 | 1168 | + grub_bios_interrupt (0x10, ®s); | ||
1191 | 1169 | + | ||
1192 | 1170 | + return (struct grub_term_coordinate) { | ||
1193 | 1171 | + (regs.edx & 0xff), ((regs.edx & 0xff00) >> 8) }; | ||
1194 | 1172 | +} | ||
1195 | 1173 | + | ||
1196 | 1174 | +/* | ||
1197 | 1175 | + * BIOS call "INT 10H Function 02h" to set cursor position | ||
1198 | 1176 | + * Call with %ah = 0x02 | ||
1199 | 1177 | + * %bh = page | ||
1200 | 1178 | + * %dh = row (0 is top) | ||
1201 | 1179 | + * %dl = column (0 is left) | ||
1202 | 1180 | + */ | ||
1203 | 1181 | +static void | ||
1204 | 1182 | +grub_console_gotoxy (struct grub_term_output *term __attribute__ ((unused) | ||
1205 | 1183 | +), | ||
1206 | 1184 | + struct grub_term_coordinate pos) | ||
1207 | 1185 | +{ | ||
1208 | 1186 | + struct grub_bios_int_registers regs; | ||
1209 | 1187 | + | ||
1210 | 1188 | + /* set page to 0 */ | ||
1211 | 1189 | + regs.ebx = 0; | ||
1212 | 1190 | + regs.eax = 0x0200; | ||
1213 | 1191 | + regs.edx = (pos.y << 8) | pos.x; | ||
1214 | 1192 | + regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; | ||
1215 | 1193 | + grub_bios_interrupt (0x10, ®s); | ||
1216 | 1194 | +} | ||
1217 | 1195 | + | ||
1218 | 1196 | + | ||
1219 | 1197 | static int | ||
1220 | 1198 | grub_console_getkeystatus (struct grub_term_input *term __attribute__ ((unused))) | ||
1221 | 1199 | { | ||
1222 | 0 | 1200 | ||
1223 | === modified file 'debian/patches/series' | |||
1224 | --- debian/patches/series 2013-12-12 01:31:53 +0000 | |||
1225 | +++ debian/patches/series 2014-03-27 15:56:07 +0000 | |||
1226 | @@ -85,3 +85,4 @@ | |||
1227 | 85 | ubuntu_probe_fusionio.patch | 85 | ubuntu_probe_fusionio.patch |
1228 | 86 | ubuntu_sysfs_partition_start.patch | 86 | ubuntu_sysfs_partition_start.patch |
1229 | 87 | ubuntu_disk_write_non_512_sectors.patch | 87 | ubuntu_disk_write_non_512_sectors.patch |
1230 | 88 | larger_terminal_size_restriction.patch |
I'll fix the patch name to be in our namespace, but otherwise this looks fine, thanks.