Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ ifeq ($(TARGET_USE_SBL),true)
KERNELFLINGER_CFLAGS += -DUSE_SBL
endif

ifeq ($(TARGET_USE_ACRN),true)
KERNELFLINGER_CFLAGS += -DUSE_ACRN -DMB2_PARTS=\"$(MB2_PARTS)\"
endif

ifeq ($(TARGET_USE_TRUSTY),true)
KERNELFLINGER_CFLAGS += -DUSE_TRUSTY
endif
Expand Down
2 changes: 2 additions & 0 deletions include/acpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ enum acpi_src_type {
ACPI_SRC_TYPE_MAX
};

EFI_STATUS get_acpi_rsdp(VOID **prsdp);

/* Some ACPI table signatures, SSDT for instance, might appear several
* times. An extra table number can be appended to the supplied
* SIGNATURE to specify which one is required. For instance, with
Expand Down
67 changes: 67 additions & 0 deletions include/acrn.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
* Copyright (C) 2012 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#ifndef __ACRN_H__
#define __ACRN_H__

#include "multiboot.h"

struct efi_memmap_info {
UINTN map_size;
UINTN map_key;
UINT32 desc_version;
UINTN desc_size;
EFI_MEMORY_DESCRIPTOR *mmap;
};

/*
* We allocate memory for the following struct together with hyperivosr itself
* memory allocation during boot.
*/
#define MBOOT_MMAP_NUMS 256
#define MBOOT_MMAP_SIZE (sizeof(struct multiboot_mmap) * MBOOT_MMAP_NUMS)
#define MBOOT_INFO_SIZE (sizeof(struct multiboot_info))
#define MBOOT_MODS_NUMS 4
#define MBOOT_MODS_SIZE (sizeof(struct multiboot_module) * MBOOT_MODS_NUMS)
#define BOOT_LOADER_NAME "kernelflinger"
#define BOOT_LOADER_NAME_SIZE (strlen(BOOT_LOADER_NAME) + 1)
#define EFI_BOOT_MEM_SIZE \
(MBOOT_MMAP_SIZE + MBOOT_INFO_SIZE + MBOOT_MODS_SIZE + BOOT_LOADER_NAME_SIZE)
#define MBOOT_MMAP_PTR(addr) \
((struct multiboot_mmap *)((VOID *)(addr)))
#define MBOOT_INFO_PTR(addr) \
((struct multiboot_info *)((VOID *)(addr) + MBOOT_MMAP_SIZE))
#define MBOOT_MODS_PTR(addr) \
((struct multiboot_module *)((VOID *)(addr) + MBOOT_MMAP_SIZE + MBOOT_INFO_SIZE))
#define BOOT_LOADER_NAME_PTR(addr) \
((char *)((VOID *)(addr) + MBOOT_MMAP_SIZE + MBOOT_INFO_SIZE + MBOOT_MODS_SIZE))


EFI_STATUS acrn_mb2_add_kernel(
IN struct mb2_images *images,
IN EFI_PHYSICAL_ADDRESS kernel_start,
IN UINTN kernel_size,
IN EFI_PHYSICAL_ADDRESS cmdline_start,
IN UINTN cmdline_size,
IN EFI_PHYSICAL_ADDRESS ramdisk_start,
IN INTN ramdisk_size);

/* Functions to load acrn multiboot2 image and modules. */
EFI_STATUS acrn_image_start(
IN EFI_HANDLE parent_image,
IN struct mb2_images *images);

#endif /* __ACRN_H__ */
16 changes: 16 additions & 0 deletions include/android.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#endif
#include "targets.h"
#include "android_vb2.h"
#include "multiboot.h"

#define BOOT_MAGIC "ANDROID!"
#define BOOT_MAGIC_SIZE 8
Expand Down Expand Up @@ -495,6 +496,21 @@ _Static_assert(sizeof(struct bootloader_control) ==
"struct bootloader_control has wrong size");
#endif

/* load kernel, cmdline and ramdisk */
EFI_STATUS load_kernel(
IN __attribute__((unused)) EFI_HANDLE parent_image,
IN VOID *bootimage,
IN VOID *vendorbootimage,
IN enum boot_target boot_target,
IN UINT8 boot_state,
IN EFI_GUID *swap_guid,
IN VBDATA *vb_data,
IN const CHAR8 *abl_cmd_line,
IN EFI_PHYSICAL_ADDRESS *kernel_start, IN UINTN *kernel_size,
IN EFI_PHYSICAL_ADDRESS *ramdisk_start, IN UINTN *ramdisk_size,
IN EFI_PHYSICAL_ADDRESS *cmdline_start, IN UINTN *cmdline_size);


/* Functions to load an Android boot image.
* You can do this from a file, a partition GUID, or
* from a RAM buffer */
Expand Down
Loading