Merge lp:~hamo/ubuntu/precise/grub2/grub2.lp1297128 into lp:~ubuntu-core-dev/ubuntu/precise/grub2/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
Reviewer Review Type Date Requested Status
Colin Watson Approve
Review via email: mp+213097@code.launchpad.net

Description of the change

backport upstream commits to precise-updates 2b23074a0c082219fe4490fa05b13a481b34b41e(partial), e89c2d48a991590c18c28ac867ccda67d4425187 and 44d47bbe6fe6ed0c8fc5855c07b2917a38371ae4 to support high resolution for grub terminal.

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote :

I'll fix the patch name to be in our namespace, but otherwise this looks fine, thanks.

review: Approve

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

Subscribers

People subscribed via source and target branches