[top] add header declaration for lk_boot_args

Update users of the boot args array to use the header.
This commit is contained in:
Travis Geiselbrecht
2024-02-11 00:35:11 -08:00
parent f7121c7b7e
commit d9b7d070c9
5 changed files with 15 additions and 15 deletions

View File

@@ -7,12 +7,13 @@
*/
#include <lib/bootargs.h>
#include <lk/trace.h>
#include <stdlib.h>
#include <stdio.h>
#include <lk/err.h>
#include <string.h>
#include <lk/init.h>
#include <lk/main.h>
#include <lk/trace.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#if WITH_KERNEL_VM
#include <kernel/vm.h>
@@ -20,9 +21,6 @@
#define LOCAL_TRACE 0
/* saved by the main entry point in lk */
extern ulong lk_boot_args[4];
static bool boot_args_valid = false;
static struct lk_boot_arg *boot_args;

View File

@@ -7,6 +7,7 @@
*/
#include <inttypes.h>
#include <lk/err.h>
#include <lk/main.h>
#include <lk/reg.h>
#include <lk/trace.h>
#include <kernel/thread.h>
@@ -30,8 +31,6 @@
#define LOCAL_TRACE 1
extern ulong lk_boot_args[4];
#if WITH_KERNEL_VM
#define DEFAULT_MEMORY_SIZE (MEMSIZE) /* try to fetch from the emulator via the fdt */

View File

@@ -7,6 +7,7 @@
*/
#include <inttypes.h>
#include <lk/err.h>
#include <lk/main.h>
#include <lk/reg.h>
#include <lk/trace.h>
#include <kernel/thread.h>
@@ -37,8 +38,6 @@
#define LOCAL_TRACE 0
extern ulong lk_boot_args[4];
#if WITH_KERNEL_VM
#define DEFAULT_MEMORY_SIZE (MEMSIZE) /* try to fetch from the emulator via the fdt */

View File

@@ -6,6 +6,7 @@
* https://opensource.org/licenses/MIT
*/
#include <lk/err.h>
#include <lk/main.h>
#include <lk/reg.h>
#include <lk/trace.h>
#include <kernel/thread.h>
@@ -44,19 +45,19 @@ struct rosco_system_data_block {
};
STATIC_ASSERT(sizeof(struct rosco_system_data_block) == 0x20);
const volatile struct rosco_system_data_block *sdb = (void *)0x400;
void platform_early_init(void) {
duart_early_init();
volatile struct rosco_system_data_block *sdb = (void *)lk_boot_args[0];
// default to 1MB memory at 0
uint32_t membase = 0x0;
uint32_t memsize = 0x100000; // 1MB
if (sdb->magic != ROSCO_SDB_MAGIC) {
dprintf(INFO, "ROSCO-M68K: firmware failed magic check\n");
dprintf(INFO, "ROSCO-M68K: firmware failed magic check at %p\n", sdb);
} else {
dprintf(INFO, "ROSCO-M68K: firmware structure at 0x400 - 0x41f:\n");
dprintf(INFO, "ROSCO-M68K: firmware structure at %p - %p:\n", sdb, sdb + 0x1f);
hexdump((void *)sdb, sizeof(*sdb));
printf("cpu family %u speed %u\n", sdb->cpu_info >> 29, sdb->cpu_info & 0x1fffffff);

View File

@@ -12,6 +12,9 @@
__BEGIN_CDECLS
// Possible boot args passed from various arch's start.S
extern ulong lk_boot_args[4];
void lk_main(ulong arg0, ulong arg1, ulong arg2, ulong arg3) __NO_RETURN __EXTERNALLY_VISIBLE;
void lk_secondary_cpu_entry(void);
void lk_init_secondary_cpus(uint secondary_cpu_count);