mirror of
git://projects.qi-hardware.com/xburst-tools.git
synced 2024-11-25 22:15:55 +02:00
phase2: use a typedefed type for the kernel function
This makes things a little easier to read, particularly when we return this pointer from a function, which we'll do in the next patch. Signed-off-by: Werner Almesberger <werner@openmoko.org>
This commit is contained in:
parent
73b8441e3b
commit
31448578d1
@ -30,6 +30,9 @@
|
|||||||
#include <setup.h>
|
#include <setup.h>
|
||||||
#include <ext2.h>
|
#include <ext2.h>
|
||||||
|
|
||||||
|
|
||||||
|
typedef void (*the_kernel_fn)(int zero, int arch, uint params);
|
||||||
|
|
||||||
unsigned long partition_offset_blocks = 0;
|
unsigned long partition_offset_blocks = 0;
|
||||||
unsigned long partition_length_blocks = 0;
|
unsigned long partition_length_blocks = 0;
|
||||||
|
|
||||||
@ -276,7 +279,7 @@ static int do_crc(const image_header_t *hdr, const void *kernel_dram)
|
|||||||
|
|
||||||
static void try_this_kernel(void)
|
static void try_this_kernel(void)
|
||||||
{
|
{
|
||||||
void (*the_kernel)(int zero, int arch, uint params);
|
the_kernel_fn the_kernel;
|
||||||
unsigned int initramfs_len = 0;
|
unsigned int initramfs_len = 0;
|
||||||
static char commandline_rootfs_append[512] = "";
|
static char commandline_rootfs_append[512] = "";
|
||||||
int ret;
|
int ret;
|
||||||
@ -368,8 +371,7 @@ static void try_this_kernel(void)
|
|||||||
if (!do_crc(hdr, kernel_dram))
|
if (!do_crc(hdr, kernel_dram))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
the_kernel = (void (*)(int, int, uint))
|
the_kernel = (the_kernel_fn) (((char *)hdr) + sizeof(image_header_t));
|
||||||
(((char *)hdr) + sizeof(image_header_t));
|
|
||||||
|
|
||||||
do_params(initramfs_len, commandline_rootfs_append);
|
do_params(initramfs_len, commandline_rootfs_append);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user