Skip to content

Commit a8384e6

Browse files
Christoph Hellwigaegl
authored andcommitted
ia64: move the screen_info setup to common code
There is nothing really platform specific about setting about the screen_info from the ia64_boot_param structure, so move it from the dig machvec to common code. Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://lkml.kernel.org/r/20190813072514.23299-26-hch@lst.de Signed-off-by: Tony Luck <tony.luck@intel.com>
1 parent fa809d7 commit a8384e6

2 files changed

Lines changed: 34 additions & 30 deletions

File tree

‎arch/ia64/dig/setup.c‎

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -26,37 +26,7 @@
2626
void __init
2727
dig_setup (char **cmdline_p)
2828
{
29-
unsigned int orig_x, orig_y, num_cols, num_rows, font_height;
30-
3129
#ifdef CONFIG_SMP
3230
init_smp_config();
3331
#endif
34-
35-
memset(&screen_info, 0, sizeof(screen_info));
36-
37-
if (!ia64_boot_param->console_info.num_rows
38-
|| !ia64_boot_param->console_info.num_cols)
39-
{
40-
printk(KERN_WARNING "dig_setup: warning: invalid screen-info, guessing 80x25\n");
41-
orig_x = 0;
42-
orig_y = 0;
43-
num_cols = 80;
44-
num_rows = 25;
45-
font_height = 16;
46-
} else {
47-
orig_x = ia64_boot_param->console_info.orig_x;
48-
orig_y = ia64_boot_param->console_info.orig_y;
49-
num_cols = ia64_boot_param->console_info.num_cols;
50-
num_rows = ia64_boot_param->console_info.num_rows;
51-
font_height = 400 / num_rows;
52-
}
53-
54-
screen_info.orig_x = orig_x;
55-
screen_info.orig_y = orig_y;
56-
screen_info.orig_video_cols = num_cols;
57-
screen_info.orig_video_lines = num_rows;
58-
screen_info.orig_video_points = font_height;
59-
screen_info.orig_video_mode = 3; /* XXX fake */
60-
screen_info.orig_video_isVGA = 1; /* XXX fake */
61-
screen_info.orig_video_ega_bx = 3; /* XXX fake */
6232
}

‎arch/ia64/kernel/setup.c‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,39 @@ early_console_setup (char *cmdline)
469469
return -1;
470470
}
471471

472+
static void __init
473+
screen_info_setup(void)
474+
{
475+
unsigned int orig_x, orig_y, num_cols, num_rows, font_height;
476+
477+
memset(&screen_info, 0, sizeof(screen_info));
478+
479+
if (!ia64_boot_param->console_info.num_rows ||
480+
!ia64_boot_param->console_info.num_cols) {
481+
printk(KERN_WARNING "invalid screen-info, guessing 80x25\n");
482+
orig_x = 0;
483+
orig_y = 0;
484+
num_cols = 80;
485+
num_rows = 25;
486+
font_height = 16;
487+
} else {
488+
orig_x = ia64_boot_param->console_info.orig_x;
489+
orig_y = ia64_boot_param->console_info.orig_y;
490+
num_cols = ia64_boot_param->console_info.num_cols;
491+
num_rows = ia64_boot_param->console_info.num_rows;
492+
font_height = 400 / num_rows;
493+
}
494+
495+
screen_info.orig_x = orig_x;
496+
screen_info.orig_y = orig_y;
497+
screen_info.orig_video_cols = num_cols;
498+
screen_info.orig_video_lines = num_rows;
499+
screen_info.orig_video_points = font_height;
500+
screen_info.orig_video_mode = 3; /* XXX fake */
501+
screen_info.orig_video_isVGA = 1; /* XXX fake */
502+
screen_info.orig_video_ega_bx = 3; /* XXX fake */
503+
}
504+
472505
static inline void
473506
mark_bsp_online (void)
474507
{
@@ -609,6 +642,7 @@ setup_arch (char **cmdline_p)
609642
ROOT_DEV = Root_SDA2; /* default to second partition on first drive */
610643

611644
platform_setup(cmdline_p);
645+
screen_info_setup();
612646
paging_init();
613647

614648
clear_sched_clock_stable();

0 commit comments

Comments
 (0)