Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 
0003 /*
0004  *  Linux logo to be displayed on boot
0005  *
0006  *  Copyright (C) 1996 Larry Ewing (lewing@isc.tamu.edu)
0007  *  Copyright (C) 1996,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
0008  *  Copyright (C) 2001 Greg Banks <gnb@alphalink.com.au>
0009  *  Copyright (C) 2001 Jan-Benedict Glaw <jbglaw@lug-owl.de>
0010  *  Copyright (C) 2003 Geert Uytterhoeven <geert@linux-m68k.org>
0011  */
0012 
0013 #include <linux/linux_logo.h>
0014 #include <linux/stddef.h>
0015 #include <linux/module.h>
0016 
0017 #ifdef CONFIG_M68K
0018 #include <asm/setup.h>
0019 #endif
0020 
0021 static bool nologo;
0022 module_param(nologo, bool, 0);
0023 MODULE_PARM_DESC(nologo, "Disables startup logo");
0024 
0025 /*
0026  * Logos are located in the initdata, and will be freed in kernel_init.
0027  * Use late_init to mark the logos as freed to prevent any further use.
0028  */
0029 
0030 static bool logos_freed;
0031 
0032 static int __init fb_logo_late_init(void)
0033 {
0034     logos_freed = true;
0035     return 0;
0036 }
0037 
0038 late_initcall_sync(fb_logo_late_init);
0039 
0040 /* logo's are marked __initdata. Use __ref to tell
0041  * modpost that it is intended that this function uses data
0042  * marked __initdata.
0043  */
0044 const struct linux_logo * __ref fb_find_logo(int depth)
0045 {
0046     const struct linux_logo *logo = NULL;
0047 
0048     if (nologo || logos_freed)
0049         return NULL;
0050 
0051     if (depth >= 1) {
0052 #ifdef CONFIG_LOGO_LINUX_MONO
0053         /* Generic Linux logo */
0054         logo = &logo_linux_mono;
0055 #endif
0056 #ifdef CONFIG_LOGO_SUPERH_MONO
0057         /* SuperH Linux logo */
0058         logo = &logo_superh_mono;
0059 #endif
0060     }
0061     
0062     if (depth >= 4) {
0063 #ifdef CONFIG_LOGO_LINUX_VGA16
0064         /* Generic Linux logo */
0065         logo = &logo_linux_vga16;
0066 #endif
0067 #ifdef CONFIG_LOGO_SUPERH_VGA16
0068         /* SuperH Linux logo */
0069         logo = &logo_superh_vga16;
0070 #endif
0071     }
0072     
0073     if (depth >= 8) {
0074 #ifdef CONFIG_LOGO_LINUX_CLUT224
0075         /* Generic Linux logo */
0076         logo = &logo_linux_clut224;
0077 #endif
0078 #ifdef CONFIG_LOGO_DEC_CLUT224
0079         /* DEC Linux logo on MIPS/MIPS64 or ALPHA */
0080         logo = &logo_dec_clut224;
0081 #endif
0082 #ifdef CONFIG_LOGO_MAC_CLUT224
0083         /* Macintosh Linux logo on m68k */
0084         if (MACH_IS_MAC)
0085             logo = &logo_mac_clut224;
0086 #endif
0087 #ifdef CONFIG_LOGO_PARISC_CLUT224
0088         /* PA-RISC Linux logo */
0089         logo = &logo_parisc_clut224;
0090 #endif
0091 #ifdef CONFIG_LOGO_SGI_CLUT224
0092         /* SGI Linux logo on MIPS/MIPS64 */
0093         logo = &logo_sgi_clut224;
0094 #endif
0095 #ifdef CONFIG_LOGO_SUN_CLUT224
0096         /* Sun Linux logo */
0097         logo = &logo_sun_clut224;
0098 #endif
0099 #ifdef CONFIG_LOGO_SUPERH_CLUT224
0100         /* SuperH Linux logo */
0101         logo = &logo_superh_clut224;
0102 #endif
0103     }
0104     return logo;
0105 }
0106 EXPORT_SYMBOL_GPL(fb_find_logo);