diff options
author | YASUOKA Masahiko <yasuoka@cvs.openbsd.org> | 2017-10-28 01:48:04 +0000 |
---|---|---|
committer | YASUOKA Masahiko <yasuoka@cvs.openbsd.org> | 2017-10-28 01:48:04 +0000 |
commit | 7dfc83c4a447d37e8bb008d66d1eb85c013c2683 (patch) | |
tree | 15f54ff4e38981321c515f3c5c256adde3ab2095 /sys/arch/amd64 | |
parent | 8eceddcdd371b7b447eecbea8b92660d07b0b72e (diff) |
Rename function name and order. No fuctional change.
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r-- | sys/arch/amd64/amd64/efifb.c | 55 |
1 files changed, 27 insertions, 28 deletions
diff --git a/sys/arch/amd64/amd64/efifb.c b/sys/arch/amd64/amd64/efifb.c index bee973b1fa3..609de484ae0 100644 --- a/sys/arch/amd64/amd64/efifb.c +++ b/sys/arch/amd64/amd64/efifb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: efifb.c,v 1.11 2017/10/28 01:37:52 yasuoka Exp $ */ +/* $OpenBSD: efifb.c,v 1.12 2017/10/28 01:48:03 yasuoka Exp $ */ /* * Copyright (c) 2015 YASUOKA Masahiko <yasuoka@yasuoka.net> @@ -92,7 +92,6 @@ struct efifb_softc { int efifb_match(struct device *, void *, void *); void efifb_attach(struct device *, struct device *, void *); void efifb_rasops_preinit(struct efifb *); -void efifb_rasops_init(void); int efifb_ioctl(void *, u_long, caddr_t, int, struct proc *); paddr_t efifb_mmap(void *, off_t, int); int efifb_alloc_screen(void *, const struct wsscreen_descr *, void **, @@ -103,6 +102,7 @@ int efifb_show_screen(void *, void *, int, void (*cb) (void *, int, int), int efifb_list_font(void *, struct wsdisplay_font *); int efifb_load_font(void *, void *, struct wsdisplay_font *); void efifb_efiinfo_init(struct efifb *); +void efifb_cnattach_common(void); struct cb_framebuffer *cb_find_fb(paddr_t); @@ -407,7 +407,7 @@ efifb_cnattach(void) memset(&efifb_console, 0, sizeof(efifb_console)); efifb_efiinfo_init(&efifb_console); - efifb_rasops_init(); + efifb_cnattach_common(); return (0); } @@ -423,6 +423,29 @@ efifb_efiinfo_init(struct efifb *fb) fb->psize = bios_efiinfo->fb_height * bios_efiinfo->fb_pixpsl * (fb->depth / 8); } +void +efifb_cnattach_common(void) +{ + struct efifb *fb = &efifb_console; + struct rasops_info *ri = &fb->rinfo; + long defattr = 0; + + ri->ri_bits = (u_char *)PMAP_DIRECT_MAP(fb->paddr); + + efifb_rasops_preinit(fb); + + ri->ri_flg = RI_CLEAR | RI_CENTER | RI_WRONLY; + rasops_init(ri, EFIFB_HEIGHT, EFIFB_WIDTH); + efifb_std_descr.ncols = ri->ri_cols; + efifb_std_descr.nrows = ri->ri_rows; + efifb_std_descr.textops = &ri->ri_ops; + efifb_std_descr.fontwidth = ri->ri_font->fontwidth; + efifb_std_descr.fontheight = ri->ri_font->fontheight; + efifb_std_descr.capabilities = ri->ri_caps; + + ri->ri_ops.alloc_attr(ri, 0, 0, 0, &defattr); + wsdisplay_cnattach(&efifb_std_descr, ri, 0, 0, defattr); +} int efifb_is_console(struct pci_attach_args *pa) @@ -461,30 +484,6 @@ efifb_cndetach(void) efifb_console.detached = 1; } -void -efifb_rasops_init(void) -{ - struct efifb *fb = &efifb_console; - struct rasops_info *ri = &fb->rinfo; - long defattr = 0; - - ri->ri_bits = (u_char *)PMAP_DIRECT_MAP(fb->paddr); - - efifb_rasops_preinit(fb); - - ri->ri_flg = RI_CLEAR | RI_CENTER | RI_WRONLY; - rasops_init(ri, EFIFB_HEIGHT, EFIFB_WIDTH); - efifb_std_descr.ncols = ri->ri_cols; - efifb_std_descr.nrows = ri->ri_rows; - efifb_std_descr.textops = &ri->ri_ops; - efifb_std_descr.fontwidth = ri->ri_font->fontwidth; - efifb_std_descr.fontheight = ri->ri_font->fontheight; - efifb_std_descr.capabilities = ri->ri_caps; - - ri->ri_ops.alloc_attr(ri, 0, 0, 0, &defattr); - wsdisplay_cnattach(&efifb_std_descr, ri, 0, 0, defattr); -} - int efifb_cb_cnattach(void) { @@ -501,7 +500,7 @@ efifb_cb_cnattach(void) efifb_console.depth = cb_fb->bits_per_pixel; efifb_console.psize = cb_fb->y_resolution * cb_fb->bytes_per_line; - efifb_rasops_init(); + efifb_cnattach_common(); return (0); } |