Skip to content

Commit

Permalink
linker: Add MODINFOMD_SPLASH type
Browse files Browse the repository at this point in the history
This mod type and structure holds the splash screen data and metadata.

Differential Revision:	https://reviews.freebsd.org/D45930
Reviewed by:		tsoome
Sponsored by:		Beckhoff Automation GmbH & Co. KG
  • Loading branch information
evadot committed Jul 11, 2024
1 parent b93028d commit 966e53a
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
9 changes: 9 additions & 0 deletions sys/kern/subr_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ preload_bootstrap_relocate(vm_offset_t offset)
switch (hdr[0]) {
case MODINFO_ADDR:
case MODINFO_METADATA|MODINFOMD_FONT:
case MODINFO_METADATA|MODINFOMD_SPLASH:
case MODINFO_METADATA|MODINFOMD_SSYM:
case MODINFO_METADATA|MODINFOMD_ESYM:
ptr = (vm_offset_t *)(curp + (sizeof(uint32_t) * 2));
Expand Down Expand Up @@ -423,6 +424,11 @@ preload_modinfo_type(struct sbuf *sbp, int type)
case MODINFOMD_FONT:
sbuf_cat(sbp, "MODINFOMD_FONT");
break;
#endif
#ifdef MODINFOMD_SPLASH
case MODINFOMD_SPLASH:
sbuf_cat(sbp, "MODINFOMD_SPLASH");
break;
#endif
default:
sbuf_cat(sbp, "unrecognized metadata type");
Expand Down Expand Up @@ -475,6 +481,9 @@ preload_modinfo_value(struct sbuf *sbp, uint32_t *bptr, int type, int len)
#endif
#ifdef MODINFOMD_FONT
case MODINFO_METADATA | MODINFOMD_FONT:
#endif
#ifdef MODINFOMD_SPLASH
case MODINFO_METADATA | MODINFOMD_SPLASH:
#endif
sbuf_print_vmoffset(sbp, *(vm_offset_t *)bptr);
break;
Expand Down
1 change: 1 addition & 0 deletions sys/sys/linker.h
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ void linker_kldload_unbusy(int flags);
#define MODINFOMD_FW_HANDLE 0x000c /* Firmware dependent handle */
#define MODINFOMD_KEYBUF 0x000d /* Crypto key intake buffer */
#define MODINFOMD_FONT 0x000e /* Console font */
#define MODINFOMD_SPLASH 0x000f /* Console splash screen */
#define MODINFOMD_NOCOPY 0x8000 /* don't copy this metadata to the kernel */

#define MODINFOMD_DEPLIST (0x4001 | MODINFOMD_NOCOPY) /* depends on */
Expand Down
17 changes: 17 additions & 0 deletions sys/sys/splash.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*-
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2024 Beckhoff Automation GmbH & Co. KG
*
*/

#ifndef _SYS_SPLASH_H_
#define _SYS_SPLASH_H_

struct splash_info {
uint32_t si_width;
uint32_t si_height;
uint32_t si_depth;
};

#endif /* _SYS_SPLASH_H_ */

0 comments on commit 966e53a

Please sign in to comment.