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