summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2011-02-13 19:25:48 +0000
committermarcel <marcel@FreeBSD.org>2011-02-13 19:25:48 +0000
commitf94334062099887d1a819b33400336b0fe2b56d9 (patch)
tree8b315c48daa0d84244327319d24d6977cd9aee08
parentc9efdfff4f3a923b76c5ead93996e388cfcecb29 (diff)
downloadFreeBSD-src-f94334062099887d1a819b33400336b0fe2b56d9.zip
FreeBSD-src-f94334062099887d1a819b33400336b0fe2b56d9.tar.gz
Use the preload_fetch_addr() and preload_fetch_size() convenience
functions to obtain the address and size of the bitmap splash image. Sponsored by: Juniper Networks.
-rw-r--r--sys/dev/fb/splash.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/sys/dev/fb/splash.c b/sys/dev/fb/splash.c
index ec25d1c..ac005887 100644
--- a/sys/dev/fb/splash.c
+++ b/sys/dev/fb/splash.c
@@ -59,26 +59,28 @@ static void *splash_arg;
static int
splash_find_data(splash_decoder_t *decoder)
{
- caddr_t image_module;
- caddr_t p;
+ caddr_t image_module;
+ void *ptr;
+ size_t sz;
if (decoder->data_type == NULL)
- return 0;
+ return (0);
+
image_module = preload_search_by_type(decoder->data_type);
if (image_module == NULL)
- return ENOENT;
- p = preload_search_info(image_module, MODINFO_ADDR);
- if (p == NULL)
- return ENOENT;
- decoder->data = *(void **)p;
- p = preload_search_info(image_module, MODINFO_SIZE);
- if (p == NULL)
- return ENOENT;
- decoder->data_size = *(size_t *)p;
+ return (ENOENT);
+
+ ptr = preload_fetch_addr(image_module);
+ sz = preload_fetch_size(image_module);
+ if (ptr == NULL || sz == 0)
+ return (ENOENT);
+
if (bootverbose)
- printf("splash: image@%p, size:%lu\n",
- (void *)decoder->data, (long)decoder->data_size);
- return 0;
+ printf("splash: image@%p, size:%zu\n", ptr, sz);
+
+ decoder->data = ptr;
+ decoder->data_size = sz;
+ return (0);
}
static int
OpenPOWER on IntegriCloud