Changeset a4bd537 in mainline


Ignore:
Timestamp:
2019-04-06T13:39:58Z (6 years ago)
Author:
Petr Pavlu <setup@…>
Children:
f7842ef
Parents:
0d073b8
git-author:
Petr Pavlu <setup@…> (2019-03-31 14:09:57)
git-committer:
Petr Pavlu <setup@…> (2019-04-06 13:39:58)
Message:

arm64: Add support for the architecture

This changeset adds basic support to run HelenOS on AArch64, targeting
the QEMU virt platform.

Boot:

  • Boot relies on the EDK II firmware, GRUB2 for EFI and the HelenOS bootloader (UEFI application). EDK II loads GRUB2 from a CD, GRUB2 loads the HelenOS bootloader (via UEFI) which loads OS components.
  • UEFI applications use the PE/COFF format and must be relocatable. The first problem is solved by manually having the PE/COFF headers and tables written in assembler. The relocatable requirement is addressed by compiling the code with -fpic and having the bootloader relocate itself at its startup.

Kernel:

  • Kernel code for AArch64 consists mostly of stubbing out various architecture-specific hooks: virtual memory management, interrupt and exception handling, context switching (including FPU lazy switching), support for virtual timer, atomic sequences and barriers, cache and TLB maintenance, thread and process initialization.
  • The patch adds a kernel driver for GICv2 (interrupt controller).
  • The PL011 kernel driver is extended to allow userspace to take ownership of the console.
  • The current code is not able to dynamically obtain information about available devices on the underlying machine. The port instead implements a machine-func interface similar to the one implemented by arm32. It defines a machine for the QEMU AArch64 virt platform. The configuration (device addresses and IRQ numbers) is then baked into the machine definition.

User space:

  • Uspace code for AArch64 similarly mostly implements architecture-specific hooks: context saving/restoring, syscall support, TLS support.

The patchset allows to boot the system but user interaction with the OS
is not yet possible.

Files:
92 added
32 edited

Legend:

Unmodified
Added
Removed
  • .gitignore

    r0d073b8 ra4bd537  
    1414/Makefile.config
    1515/PKG
     16/QEMU_EFI_ARM64.fd
    1617/common.h
    1718/config.h
     
    2425autotool/
    2526boot/arch/arm32/_link.ld
     27boot/arch/arm64/_link.ld
    2628boot/arch/ia64/_link.ld
    2729boot/arch/mips32/_link.ld
     
    4951kernel/arch/amd64/_link.ld
    5052kernel/arch/arm32/_link.ld
     53kernel/arch/arm64/_link.ld
    5154kernel/arch/ia32/_link.ld
    5255kernel/arch/ia64/_link.ld
     
    361364uspace/lib/c/arch/arm32/_link-shlib.ld
    362365uspace/lib/c/arch/arm32/_link.ld
     366uspace/lib/c/arch/arm64/_link-dlexe.ld
     367uspace/lib/c/arch/arm64/_link-loader.ld
     368uspace/lib/c/arch/arm64/_link-shlib.ld
     369uspace/lib/c/arch/arm64/_link.ld
    363370uspace/lib/c/arch/ia32/_link-dlexe.ld
    364371uspace/lib/c/arch/ia32/_link-loader.ld
  • HelenOS.config

    r0d073b8 ra4bd537  
    3434@ "amd64" AMD64/EM64T 64-bit (PC)
    3535@ "arm32" ARM 32-bit
     36@ "arm64" ARM 64-bit (AArch64)
    3637@ "ia32" IA-32 32-bit (PC)
    3738@ "ia64" IA-64 64-bit
     
    6566! [PLATFORM=arm32] MACHINE (choice)
    6667
     68% Machine type
     69@ "virt" QEMU virt
     70! [PLATFORM=arm64] MACHINE (choice)
     71
    6772% CPU type
    6873@ "pentium4" Pentium 4
     
    160165
    161166% Kernel architecture
     167@ "arm64"
     168! [PLATFORM=arm64] KARCH (choice)
     169
     170% Kernel architecture
    162171@ "ia32"
    163172! [PLATFORM=ia32] KARCH (choice)
     
    207216
    208217% User space architecture
     218@ "arm64"
     219! [PLATFORM=arm64] UARCH (choice)
     220
     221% User space architecture
    209222@ "ia32"
    210223! [PLATFORM=ia32|PLATFORM=ia32xen] UARCH (choice)
     
    252265@ "arm32"
    253266! [PLATFORM=arm32] BARCH (choice)
     267
     268% Boot architecture
     269@ "arm64"
     270! [PLATFORM=arm64] BARCH (choice)
    254271
    255272% Boot architecture
     
    334351
    335352% IOMAP dummy support
    336 ! [PLATFORM=abs32le|PLATFORM=arm32|PLATFORM=mips32|PLATFORM=ppc32|PLATFORM=riscv64|PLATFORM=sparc64] CONFIG_IOMAP_DUMMY (y)
     353! [PLATFORM=abs32le|PLATFORM=arm32|PLATFORM=arm64|PLATFORM=mips32|PLATFORM=ppc32|PLATFORM=riscv64|PLATFORM=sparc64] CONFIG_IOMAP_DUMMY (y)
    337354
    338355% ACPI support
     
    340357
    341358% Hierarchical page tables support
    342 ! [PLATFORM=abs32le|PLATFORM=ia32|PLATFORM=amd64|PLATFORM=arm32|PLATFORM=mips32|PLATFORM=ppc32|PLATFORM=riscv64] CONFIG_PAGE_PT (y)
     359! [PLATFORM=abs32le|PLATFORM=ia32|PLATFORM=amd64|PLATFORM=arm32|PLATFORM=arm64|PLATFORM=mips32|PLATFORM=ppc32|PLATFORM=riscv64] CONFIG_PAGE_PT (y)
    343360
    344361% Page hash table support
     
    349366
    350367% ASID support
    351 ! [PLATFORM=ia64|PLATFORM=mips32|PLATFORM=ppc32|PLATFORM=sparc64] CONFIG_ASID (y)
     368! [PLATFORM=arm64|PLATFORM=ia64|PLATFORM=mips32|PLATFORM=ppc32|PLATFORM=sparc64] CONFIG_ASID (y)
    352369
    353370% ASID FIFO support
    354 ! [PLATFORM=ia64|PLATFORM=mips32|PLATFORM=ppc32|PLATFORM=sparc64] CONFIG_ASID_FIFO (y)
     371! [PLATFORM=arm64|PLATFORM=ia64|PLATFORM=mips32|PLATFORM=ppc32|PLATFORM=sparc64] CONFIG_ASID_FIFO (y)
    355372
    356373% OpenFirmware tree support
     
    364381
    365382% FPU support
    366 ! [PLATFORM=ia32|PLATFORM=amd64|PLATFORM=ia64|PLATFORM=ppc32|PLATFORM=sparc64] CONFIG_FPU (y)
     383! [PLATFORM=ia32|PLATFORM=amd64|PLATFORM=arm64|PLATFORM=ia64|PLATFORM=ppc32|PLATFORM=sparc64] CONFIG_FPU (y)
    367384
    368385## ARMv7 made FPU hardware compulsory
     
    377394
    378395% Support for SMP
    379 ! [(PLATFORM=ia32&PROCESSOR!=athlon_xp)|PLATFORM=amd64|PLATFORM=sparc64|PLATFORM=ia64|(PLATFORM=mips32&MACHINE=msim)|PLATFORM=abs32le] CONFIG_SMP (y/n)
     396! [(PLATFORM=ia32&PROCESSOR!=athlon_xp)|PLATFORM=amd64|PLATFORM=arm64|PLATFORM=sparc64|PLATFORM=ia64|(PLATFORM=mips32&MACHINE=msim)|PLATFORM=abs32le] CONFIG_SMP (y/n)
    380397
    381398% Debug build
     
    442459% Input device class
    443460@ "generic" Keyboard or serial line
    444 ! [PLATFORM=arm32&MACHINE=integratorcp] CONFIG_HID_IN (choice)
     461! [(PLATFORM=arm32&MACHINE=integratorcp)|PLATFORM=arm64] CONFIG_HID_IN (choice)
    445462
    446463% Input device class
     
    458475% Output device class
    459476@ "generic" Monitor or serial line
    460 ! [PLATFORM=arm32&(MACHINE=gta02|MACHINE=integratorcp|MACHINE=beagleboardxm|MACHINE=beaglebone|MACHINE=raspberrypi)] CONFIG_HID_OUT (choice)
     477! [(PLATFORM=arm32&(MACHINE=gta02|MACHINE=integratorcp|MACHINE=beagleboardxm|MACHINE=beaglebone|MACHINE=raspberrypi))|PLATFORM=arm64] CONFIG_HID_OUT (choice)
    461478
    462479% Output device class
     
    493510
    494511% Support for PL011 UART
    495 ! [(CONFIG_HID_OUT=generic|CONFIG_HID_OUT=serial)&PLATFORM=arm32&(MACHINE=integratorcp|MACHINE=raspberrypi)] CONFIG_PL011_UART (y/n)
     512! [(CONFIG_HID_OUT=generic|CONFIG_HID_OUT=serial)&(PLATFORM=arm32&(MACHINE=integratorcp|MACHINE=raspberrypi))] CONFIG_PL011_UART (y/n)
     513
     514% Support for PL011 UART
     515! [CONFIG_HID_OUT=generic|(PLATFORM=arm64&MACHINE=virt)] CONFIG_PL011_UART (y)
    496516
    497517% Support for NS16550 controller (kernel console)
     
    522542! [PLATFORM=arm32&MACHINE=raspberrypi] CONFIG_BCM2835_MAILBOX (y/n)
    523543
     544% Support for ARM GICv2
     545! [PLATFORM=arm64&MACHINE=virt] CONFIG_GICV2 (y)
     546
    524547% Support for i8042 controller
    525548! [CONFIG_PC_KBD=y] CONFIG_I8042 (y)
     
    541564
    542565% Serial line input module
    543 ! [CONFIG_DSRLNIN=y|(PLATFORM=arm32&MACHINE=gta02)|(PLATFORM=arm32&MACHINE=integratorcp&CONFIG_PL011_UART=y)|(PLATFORM=arm32&MACHINE=beaglebone&CONFIG_OMAP_UART=y)|(PLATFORM=arm32&MACHINE=beagleboardxm&CONFIG_OMAP_UART=y)|(PLATFORM=ia64&MACHINE=i460GX&CONFIG_NS16550=y)|(PLATFORM=ia64&MACHINE=ski)|(PLATFORM=sparc64&PROCESSOR=sun4v)|(PLATFORM=arm32&MACHINE=raspberrypi&CONFIG_PL011_UART=y)|(PLATFORM=ia32&CONFIG_NS16550=y)|(PLATFORM=amd64&CONFIG_NS16550=y)|(PLATFORM=mips32&CONFIG_NS16550=y)] CONFIG_SRLN (y)
     566! [CONFIG_DSRLNIN=y|(PLATFORM=arm32&MACHINE=gta02)|(PLATFORM=arm32&MACHINE=integratorcp&CONFIG_PL011_UART=y)|(PLATFORM=arm32&MACHINE=beaglebone&CONFIG_OMAP_UART=y)|(PLATFORM=arm32&MACHINE=beagleboardxm&CONFIG_OMAP_UART=y)|(PLATFORM=arm64&CONFIG_PL011_UART=y)|(PLATFORM=ia64&MACHINE=i460GX&CONFIG_NS16550=y)|(PLATFORM=ia64&MACHINE=ski)|(PLATFORM=sparc64&PROCESSOR=sun4v)|(PLATFORM=arm32&MACHINE=raspberrypi&CONFIG_PL011_UART=y)|(PLATFORM=ia32&CONFIG_NS16550=y)|(PLATFORM=amd64&CONFIG_NS16550=y)|(PLATFORM=mips32&CONFIG_NS16550=y)] CONFIG_SRLN (y)
    544567
    545568% EGA support
     
    588611% Dynamic linking support
    589612! [PLATFORM=amd64|PLATFORM=arm32|PLATFORM=ia32|PLATFORM=ppc32|PLATFORM=sparc64] CONFIG_RTLD (y/n)
    590 ! [PLATFORM=abs32le|PLATFORM=ia64|PLATFORM=mips32|PLATFORM=riscv64] CONFIG_RTLD (n)
     613! [PLATFORM=abs32le|PLATFORM=arm64|PLATFORM=ia64|PLATFORM=mips32|PLATFORM=riscv64] CONFIG_RTLD (n)
    591614
    592615% Build shared libraries
     
    651674! [PLATFORM=ia32|PLATFORM=amd64] GRUB_ARCH (choice)
    652675
     676% GRUB boot loader architecture
     677@ "efi" GRUB for UEFI
     678! [PLATFORM=arm64&MACHINE=virt] GRUB_ARCH (choice)
     679
    653680% uImage OS type
    654681@ "2" NetBSD stage 2 boot loader
  • abi/doc/doxygroups.h

    r0d073b8 ra4bd537  
    2626/**
    2727 * @defgroup abi_arm32 arm32
     28 * @ingroup abi
     29 */
     30
     31/**
     32 * @defgroup abi_arm64 arm64
    2833 * @ingroup abi
    2934 */
  • abi/include/abi/elf.h

    r0d073b8 ra4bd537  
    7777        EM_IA_64       = 50,   /* IA-64 */
    7878        EM_X86_64      = 62,   /* AMD64/EMT64 */
     79        EM_AARCH64     = 183,  /* ARM 64-bit architecture */
    7980        EM_RISCV       = 243,  /* RISC-V */
    8081};
     
    515516typedef struct elf32_rel elf_rel_t;
    516517typedef struct elf32_rela elf_rela_t;
     518#define ELF_R_TYPE(i)  ELF32_R_TYPE(i)
    517519#endif
    518520
     
    526528typedef struct elf64_rel elf_rel_t;
    527529typedef struct elf64_rela elf_rela_t;
     530#define ELF_R_TYPE(i)  ELF64_R_TYPE(i)
    528531#endif
    529532
  • boot/Makefile.build

    r0d073b8 ra4bd537  
    3737
    3838AFLAGS = --fatal-warnings
    39 LDFLAGS = -Wl,--fatal-warnings,--warn-common
     39LDFLAGS = -Wl,--fatal-warnings,--warn-common $(EXTRA_LDFLAGS)
    4040
    4141COMMON_CFLAGS = $(INCLUDES) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
  • boot/Makefile.grub

    r0d073b8 ra4bd537  
    6464endif
    6565
     66ifeq ($(GRUB_LOADER),multiboot)
    6667        for module in $(COMPONENTS) ; do \
    6768                cp "$$module" $(BOOT)/ ; \
    6869        done
     70endif
     71ifeq ($(GRUB_LOADER),chainloader)
     72        cp "$(BOOT_OUTPUT)" $(BOOT)/
     73endif
    6974
    7075        echo "set default=0" > $(BOOT_CONFIG)
     
    8388
    8489        echo "menuentry 'HelenOS $(RELEASE)' --class helenos --class os {" >> $(BOOT_CONFIG)
     90ifeq ($(GRUB_LOADER),multiboot)
    8591        for module in $(MODULES) ; do \
    8692                echo "  echo 'Loading $$module'" >> $(BOOT_CONFIG) ; \
     
    9197                fi \
    9298        done
     99endif
     100ifeq ($(GRUB_LOADER),chainloader)
     101        echo "  echo 'Loading $(BOOT_OUTPUT)'" >> $(BOOT_CONFIG)
     102        echo "  chainloader /boot/$(BOOT_OUTPUT)" >> $(BOOT_CONFIG)
     103        echo "  boot" >> $(BOOT_CONFIG)
     104endif
    93105        echo "}" >> $(BOOT_CONFIG)
    94106
  • boot/arch/amd64/Makefile.inc

    r0d073b8 ra4bd537  
    7474BUILD = Makefile.empty
    7575POSTBUILD = Makefile.grub
     76GRUB_LOADER = multiboot
  • boot/doc/doxygroups.h

    r0d073b8 ra4bd537  
    1111 *     @ingroup boot
    1212 */
     13
     14/**    @addtogroup boot_arm64 arm64
     15 *     @ingroup boot
     16 */
  • boot/genarch/include/genarch/efi.h

    r0d073b8 ra4bd537  
    3232#include <arch/types.h>
    3333
     34#define EFI_SUCCESS  0
     35#define EFI_ERROR(code) (((sysarg_t) 1 << (sizeof(sysarg_t) * 8 - 1)) | (code))
     36#define EFI_LOAD_ERROR  EFI_ERROR(1)
     37#define EFI_UNSUPPORTED  EFI_ERROR(3)
     38#define EFI_BUFFER_TOO_SMALL  EFI_ERROR(5)
     39
     40typedef uint64_t efi_status_t;
     41
    3442typedef struct {
    3543        uint64_t signature;
     
    5664} efi_guid_t;
    5765
    58 typedef struct {
    59         efi_guid_t guid;
    60         void *table;
    61 } efi_configuration_table_t;
    62 
    63 typedef struct {
    64         efi_table_header_t hdr;
    65         char *fw_vendor;
    66         uint32_t fw_revision;
    67         void *cons_in_handle;
    68         void *cons_in;
    69         void *cons_out_handle;
    70         void *cons_out;
    71         void *cons_err_handle;
    72         void *cons_err;
    73         void *runtime_services;
    74         void *boot_services;
    75         sysarg_t conf_table_entries;
    76         efi_configuration_table_t *conf_table;
    77 } efi_system_table_t;
     66typedef enum {
     67        EFI_ALLOCATE_ANY_PAGES,
     68        EFI_ALLOCATE_MAX_ADDRESS,
     69        EFI_ALLOCATE_ADDRESS
     70} efi_allocate_type_t;
    7871
    7972typedef enum {
     
    9184        EFI_MEMORY_MAPPED_IO,
    9285        EFI_MEMORY_MAPPED_IO_PORT_SPACE,
    93         EFI_PAL_CODE
     86        EFI_PAL_CODE,
     87        EFI_PERSISTENT_MEMORY
    9488} efi_memory_type_t;
     89
     90#define EFI_MEMORY_UC             UINT64_C(0x0000000000000001)
     91#define EFI_MEMORY_WC             UINT64_C(0x0000000000000002)
     92#define EFI_MEMORY_WT             UINT64_C(0x0000000000000004)
     93#define EFI_MEMORY_WB             UINT64_C(0x0000000000000008)
     94#define EFI_MEMORY_UCE            UINT64_C(0x0000000000000010)
     95#define EFI_MEMORY_WP             UINT64_C(0x0000000000001000)
     96#define EFI_MEMORY_RP             UINT64_C(0x0000000000002000)
     97#define EFI_MEMORY_XP             UINT64_C(0x0000000000004000)
     98#define EFI_MEMORY_NV             UINT64_C(0x0000000000008000)
     99#define EFI_MEMORY_MORE_RELIABLE  UINT64_C(0x0000000000010000)
     100#define EFI_MEMORY_RO             UINT64_C(0x0000000000020000)
     101#define EFI_MEMORY_RUNTIME        UINT64_C(0x8000000000000000)
    95102
    96103typedef struct {
     
    102109} efi_v1_memdesc_t;
    103110
     111typedef struct {
     112        efi_guid_t guid;
     113        void *table;
     114} efi_configuration_table_t;
     115
     116typedef struct efi_simple_text_output_protocol {
     117        void *reset;
     118        efi_status_t (*output_string)(struct efi_simple_text_output_protocol *,
     119            int16_t *);
     120        void *test_string;
     121        void *query_mode;
     122        void *set_mode;
     123        void *set_attribute;
     124        void *clear_screen;
     125        void *set_cursor_position;
     126        void *enable_cursor;
     127        void *mode;
     128} efi_simple_text_output_protocol_t;
     129
     130typedef struct {
     131        efi_table_header_t hdr;
     132        void *raise_TPL;
     133        void *restore_TPL;
     134        efi_status_t (*allocate_pages)(efi_allocate_type_t, efi_memory_type_t,
     135            sysarg_t, uint64_t *);
     136        efi_status_t (*free_pages)(uint64_t, sysarg_t);
     137        efi_status_t (*get_memory_map)(sysarg_t *, efi_v1_memdesc_t *,
     138            sysarg_t *, sysarg_t *, uint32_t *);
     139        efi_status_t (*allocate_pool)(efi_memory_type_t, sysarg_t, void **);
     140        efi_status_t (*free_pool)(void *);
     141        void *create_event;
     142        void *set_timer;
     143        void *wait_for_event;
     144        void *signal_event;
     145        void *close_event;
     146        void *check_event;
     147        void *install_protocol_interface;
     148        void *reinstall_protocol_interface;
     149        void *uninstall_protocol_interface;
     150        void *handle_protocol;
     151        void *reserved;
     152        void *register_protocol_notify;
     153        void *locate_handle;
     154        void *locate_device_path;
     155        void *install_configuration_table;
     156        void *load_image;
     157        void *start_image;
     158        void *exit;
     159        void *unload_image;
     160        efi_status_t (*exit_boot_services)(void *, sysarg_t);
     161        void *get_next_monotonic_count;
     162        void *stall;
     163        void *set_watchdog_timer;
     164        void *connect_controller;
     165        void *disconnect_controller;
     166        void *open_protocol;
     167        void *close_protocol;
     168        void *open_protocol_information;
     169        void *protocols_per_handle;
     170        void *locate_handle_buffer;
     171        void *locate_protocol;
     172        void *install_multiple_protocol_interfaces;
     173        void *uninstall_multiple_protocol_intefaces;
     174        void *calculate_crc32;
     175        void *copy_mem;
     176        void *set_mem;
     177        void *create_event_ex;
     178} efi_boot_services_t;
     179
     180typedef struct {
     181        efi_table_header_t hdr;
     182        char *fw_vendor;
     183        uint32_t fw_revision;
     184        void *cons_in_handle;
     185        void *cons_in;
     186        void *cons_out_handle;
     187        efi_simple_text_output_protocol_t *cons_out;
     188        void *cons_err_handle;
     189        efi_simple_text_output_protocol_t *cons_err;
     190        void *runtime_services;
     191        efi_boot_services_t *boot_services;
     192        sysarg_t conf_table_entries;
     193        efi_configuration_table_t *conf_table;
     194} efi_system_table_t;
     195
    104196#define EFI_PAGE_SIZE   4096
    105197
    106198extern void *efi_vendor_table_find(efi_system_table_t *, efi_guid_t);
     199extern efi_status_t efi_get_memory_map(efi_system_table_t *, sysarg_t *,
     200    efi_v1_memdesc_t **, sysarg_t *, sysarg_t *, uint32_t *);
    107201
    108202#endif
  • boot/genarch/src/efi.c

    r0d073b8 ra4bd537  
    4242        return NULL;
    4343}
     44
     45efi_status_t efi_get_memory_map(efi_system_table_t *st,
     46    sysarg_t *memory_map_size, efi_v1_memdesc_t **memory_map, sysarg_t *map_key,
     47    sysarg_t *descriptor_size, uint32_t *descriptor_version)
     48{
     49        efi_status_t status;
     50
     51        *memory_map_size = 8 * sizeof(**memory_map);
     52
     53        do {
     54                /* Allocate space for the memory map. */
     55                status = st->boot_services->allocate_pool(EFI_LOADER_DATA,
     56                    *memory_map_size, (void **) memory_map);
     57                if (status != EFI_SUCCESS)
     58                        return status;
     59
     60                /* Try to obtain the map. */
     61                status = st->boot_services->get_memory_map(memory_map_size,
     62                    *memory_map, map_key, descriptor_size, descriptor_version);
     63                if (status == EFI_SUCCESS)
     64                        return status;
     65
     66                /* An error occurred, release the allocated memory. */
     67                st->boot_services->free_pool(*memory_map);
     68        } while (status == EFI_BUFFER_TOO_SMALL);
     69
     70        return status;
     71}
  • boot/generic/include/align.h

    r0d073b8 ra4bd537  
    4949#define ALIGN_UP(s, a)  (((s) + ((a) - 1)) & ~((a) - 1))
    5050
     51/** Check alignment.
     52 *
     53 * @param s Address or size to be checked for alignment.
     54 * @param a Size of alignment, must be a power of 2.
     55 */
     56#define IS_ALIGNED(s, a)  (ALIGN_UP((s), (a)) == (s))
     57
    5158#endif
    5259
  • contrib/qemu/build-from-scratch.sh

    r0d073b8 ra4bd537  
    106106echo "==== Configuring QEMU ===="
    107107
    108 ./configure --target-list=i386-softmmu,x86_64-softmmu,arm-softmmu,ppc-softmmu,sparc64-softmmu,mips-softmmu,mipsel-softmmu --audio-drv-list=pa
     108./configure --target-list=i386-softmmu,x86_64-softmmu,arm-softmmu,aarch64-softmmu,ppc-softmmu,sparc64-softmmu,mips-softmmu,mipsel-softmmu --audio-drv-list=pa
    109109
    110110echo "==== Building QEMU ===="
  • doxygen/doxygen.cfg.diff

    r0d073b8 ra4bd537  
    2424 
    2525-ENABLED_SECTIONS       =
    26 +ENABLED_SECTIONS       = abs32le amd64 arm32 ia32 ia64 mips32 ppc32 riscv64 sparc64
     26+ENABLED_SECTIONS       = abs32le amd64 arm32 arm64 ia32 ia64 mips32 ppc32 riscv64 sparc64
    2727 
    2828 # The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
  • kernel/arch/abs32le/include/arch/mm/as.h

    r0d073b8 ra4bd537  
    3737
    3838#define KERNEL_ADDRESS_SPACE_SHADOWED_ARCH  0
     39#define KERNEL_SEPARATE_PTL0_ARCH           0
    3940
    4041#define KERNEL_ADDRESS_SPACE_START_ARCH  UINT32_C(0x80000000)
  • kernel/arch/amd64/include/arch/mm/as.h

    r0d073b8 ra4bd537  
    4040
    4141#define KERNEL_ADDRESS_SPACE_SHADOWED_ARCH  0
     42#define KERNEL_SEPARATE_PTL0_ARCH           0
    4243
    4344#define KERNEL_ADDRESS_SPACE_START_ARCH  UINT64_C(0xffff800000000000)
  • kernel/arch/arm32/include/arch/mm/as.h

    r0d073b8 ra4bd537  
    3838
    3939#define KERNEL_ADDRESS_SPACE_SHADOWED_ARCH  0
     40#define KERNEL_SEPARATE_PTL0_ARCH           0
    4041
    4142#define KERNEL_ADDRESS_SPACE_START_ARCH  UINT32_C(0x80000000)
  • kernel/arch/ia32/include/arch/mm/as.h

    r0d073b8 ra4bd537  
    3737
    3838#define KERNEL_ADDRESS_SPACE_SHADOWED_ARCH  0
     39#define KERNEL_SEPARATE_PTL0_ARCH           0
    3940
    4041#define KERNEL_ADDRESS_SPACE_START_ARCH  UINT32_C(0x80000000)
  • kernel/arch/ia64/include/arch/mm/as.h

    r0d073b8 ra4bd537  
    3737
    3838#define KERNEL_ADDRESS_SPACE_SHADOWED_ARCH  0
     39#define KERNEL_SEPARATE_PTL0_ARCH           0
    3940
    4041#define KERNEL_ADDRESS_SPACE_START_ARCH  UINT64_C(0xe000000000000000)
  • kernel/arch/mips32/include/arch/mm/as.h

    r0d073b8 ra4bd537  
    3737
    3838#define KERNEL_ADDRESS_SPACE_SHADOWED_ARCH  0
     39#define KERNEL_SEPARATE_PTL0_ARCH           0
    3940
    4041#define KERNEL_ADDRESS_SPACE_START_ARCH  UINT32_C(0x80000000)
  • kernel/arch/ppc32/include/arch/mm/as.h

    r0d073b8 ra4bd537  
    3939
    4040#define KERNEL_ADDRESS_SPACE_SHADOWED_ARCH  0
     41#define KERNEL_SEPARATE_PTL0_ARCH           0
    4142
    4243#define KERNEL_ADDRESS_SPACE_START_ARCH  UINT32_C(0x80000000)
  • kernel/arch/riscv64/include/arch/mm/as.h

    r0d073b8 ra4bd537  
    4040
    4141#define KERNEL_ADDRESS_SPACE_SHADOWED_ARCH  0
     42#define KERNEL_SEPARATE_PTL0_ARCH           0
    4243
    4344#define KERNEL_ADDRESS_SPACE_START_ARCH  UINT64_C(0xffff800000000000)
  • kernel/arch/sparc64/include/arch/mm/sun4u/as.h

    r0d073b8 ra4bd537  
    3939
    4040#define KERNEL_ADDRESS_SPACE_SHADOWED_ARCH  1
     41#define KERNEL_SEPARATE_PTL0_ARCH           0
    4142
    4243#define KERNEL_ADDRESS_SPACE_START_ARCH  UINT64_C(0x0000000000000000)
  • kernel/arch/sparc64/include/arch/mm/sun4v/as.h

    r0d073b8 ra4bd537  
    4141
    4242#define KERNEL_ADDRESS_SPACE_SHADOWED_ARCH  1
     43#define KERNEL_SEPARATE_PTL0_ARCH           0
    4344
    4445#define KERNEL_ADDRESS_SPACE_START_ARCH  UINT64_C(0x0000000000000000)
  • kernel/doc/doxygroups.h

    r0d073b8 ra4bd537  
    4747
    4848/**
     49 *     @cond arm64
     50 *     @defgroup kernel_arm64_proc arm64
     51 *     @ingroup proc
     52 *     @endcond
     53 */
     54
     55/**
    4956 *     @cond ia32
    5057 *     @defgroup kernel_ia32_proc ia32
     
    123130 *     @cond arm32
    124131 *     @defgroup kernel_arm32_mm arm32
     132 *     @ingroup mm
     133 *     @endcond
     134 */
     135
     136/**
     137 *     @cond arm64
     138 *     @defgroup kernel_arm64_mm arm64
    125139 *     @ingroup mm
    126140 *     @endcond
     
    209223
    210224/**
     225 *     @cond arm64
     226 *     @defgroup kernel_arm64_ddi arm64
     227 *     @ingroup ddi
     228 *     @endcond
     229 */
     230
     231/**
    211232 *     @cond ia32
    212233 *     @defgroup kernel_ia32_ddi ia32
     
    281302
    282303/**
     304 *     @cond arm64
     305 *     @defgroup kernel_arm64_debug arm64
     306 *     @ingroup debug
     307 *     @endcond
     308 */
     309
     310/**
    283311 *     @cond ia32
    284312 *     @defgroup kernel_amd64_debug ia32/amd64
     
    352380
    353381/**
     382 *     @cond arm64
     383 *     @defgroup kernel_arm64_interrupt arm64
     384 *     @ingroup interrupt
     385 *     @endcond
     386 */
     387
     388/**
    354389 *     @cond ia32
    355390 *     @defgroup kernel_ia32_interrupt ia32
     
    429464
    430465/**
     466 *     @cond arm64
     467 *     @defgroup kernel_arm64 arm64
     468 *     @ingroup others
     469 *     @endcond
     470 */
     471
     472/**
    431473 *     @cond ia32
    432474 *     @defgroup kernel_ia32 ia32
  • kernel/genarch/Makefile.inc

    r0d073b8 ra4bd537  
    127127endif
    128128
     129ifeq ($(CONFIG_GICV2), y)
     130GENARCH_SOURCES += \
     131        genarch/src/drivers/gicv2/gicv2.c
     132endif
     133
    129134ifeq ($(CONFIG_VIA_CUDA),y)
    130135GENARCH_SOURCES += \
  • kernel/genarch/include/genarch/drivers/pl011/pl011.h

    r0d073b8 ra4bd537  
    3838#define KERN_PL011_H_
    3939
     40#include <ddi/ddi.h>
    4041#include <ddi/irq.h>
    4142#include <console/chardev.h>
     
    150151        outdev_t outdev;
    151152        irq_t irq;
     153        parea_t parea;
    152154} pl011_uart_t;
    153155
  • kernel/genarch/src/drivers/pl011/pl011.c

    r0d073b8 ra4bd537  
    6060        pl011_uart_t *uart = dev->data;
    6161
    62         if (!ascii_check(ch)) {
     62        /* If the userspace owns the console, do not output anything. */
     63        if (uart->parea.mapped && !console_override)
     64                return;
     65
     66        if (!ascii_check(ch))
    6367                pl011_uart_sendb(uart, U_SPECIAL);
    64         } else {
     68        else {
    6569                if (ch == '\n')
    6670                        pl011_uart_sendb(uart, (uint8_t) '\r');
     
    100104        assert(uart);
    101105        uart->regs = (void *)km_map(addr, sizeof(pl011_uart_regs_t),
    102             KM_NATURAL_ALIGNMENT, PAGE_NOT_CACHEABLE);
     106            KM_NATURAL_ALIGNMENT, PAGE_WRITE | PAGE_NOT_CACHEABLE);
    103107        assert(uart->regs);
    104108
     
    131135        uart->irq.instance = uart;
    132136
     137        ddi_parea_init(&uart->parea);
     138        uart->parea.pbase = addr;
     139        uart->parea.frames = 1;
     140        uart->parea.unpriv = false;
     141        uart->parea.mapped = false;
     142        ddi_parea_register(&uart->parea);
     143
    133144        return true;
    134145}
  • kernel/genarch/src/mm/as_pt.c

    r0d073b8 ra4bd537  
    7676            PA2KA(frame_alloc(PTL0_FRAMES, FRAME_LOWMEM, PTL0_SIZE - 1));
    7777
    78         if (flags & FLAG_AS_KERNEL)
    79                 memsetb(dst_ptl0, PTL0_SIZE, 0);
    80         else {
     78        memsetb(dst_ptl0, PTL0_SIZE, 0);
     79
     80        if (!KERNEL_SEPARATE_PTL0 && !(flags & FLAG_AS_KERNEL)) {
    8181                /*
    8282                 * Copy the kernel address space portion to new PTL0.
     
    9393                    &dst_ptl0[PTL0_INDEX(KERNEL_ADDRESS_SPACE_START)];
    9494
    95                 memsetb(dst_ptl0, PTL0_SIZE, 0);
    9695                memcpy((void *) dst, (void *) src,
    9796                    PTL0_SIZE - (src - (uintptr_t) src_ptl0));
  • kernel/generic/include/mm/as.h

    r0d073b8 ra4bd537  
    5959#define KERNEL_ADDRESS_SPACE_SHADOWED  KERNEL_ADDRESS_SPACE_SHADOWED_ARCH
    6060
     61/**
     62 * Defined to be true if user address space and kernel address space do not
     63 * share the same page table.
     64 */
     65#define KERNEL_SEPARATE_PTL0 KERNEL_SEPARATE_PTL0_ARCH
     66
    6167#define KERNEL_ADDRESS_SPACE_START  KERNEL_ADDRESS_SPACE_START_ARCH
    6268#define KERNEL_ADDRESS_SPACE_END    KERNEL_ADDRESS_SPACE_END_ARCH
  • tools/autotool.py

    r0d073b8 ra4bd537  
    201201                target = "arm-helenos"
    202202
     203        if (config['PLATFORM'] == "arm64"):
     204                platform = config['PLATFORM']
     205                target = "aarch64-helenos"
     206
    203207        if (config['PLATFORM'] == "ia32"):
    204208                platform = config['PLATFORM']
     
    633637
    634638                # Platform-specific utilities
    635                 if ((config['BARCH'] == "amd64") or (config['BARCH'] == "ia32") or (config['BARCH'] == "ppc32") or (config['BARCH'] == "sparc64")):
     639                if (config['BARCH'] in ('amd64', 'arm64', 'ia32', 'ppc32', 'sparc64')):
    636640                        common['GENISOIMAGE'] = check_app_alternatives(["genisoimage", "mkisofs", "xorriso"], ["--version"], "ISO 9660 creation utility", "usually part of genisoimage")
    637641                        if common['GENISOIMAGE'] == 'xorriso':
  • tools/ew.py

    r0d073b8 ra4bd537  
    9494        elif platform == 'arm32':
    9595                return 'system-arm', '-M integratorcp'
     96        elif platform == 'arm64':
     97                # Check that ROM image is present. Provide the user with
     98                # appropriate steps to fix this problem.
     99                if not os.path.exists('QEMU_EFI_ARM64.fd'):
     100                        sys.stderr.write('Could not find ' +
     101                            '\'QEMU_EFI_ARM64.fd\' which is expected to ' +
     102                            'contain EDK2 firmware image.\n')
     103                        sys.stderr.write('Pre-built image can be obtained by ' +
     104                            'running the following command:\n')
     105                        sys.stderr.write('$ wget http://snapshots.linaro.org/' +
     106                            'components/kernel/leg-virt-tianocore-edk2-' +
     107                            'upstream/latest/QEMU-AARCH64/RELEASE_GCC49/' +
     108                            'QEMU_EFI.fd -O QEMU_EFI_ARM64.fd\n')
     109                        raise Exception
     110                return 'system-aarch64', \
     111                    '-M virt -cpu cortex-a57 -m 1024 -bios QEMU_EFI_ARM64.fd'
    96112        elif platform == 'ia32':
    97113                return 'system-i386', pc_options(32)
     
    208224                cmdline += ' ' + options
    209225
    210         cmdline += qemu_bd_options()
    211 
     226        if (not 'hdd' in cfg.keys() or cfg['hdd']):
     227                cmdline += qemu_bd_options()
    212228        if (not 'net' in cfg.keys()) or cfg['net']:
    213229                cmdline += qemu_net_options()
     
    234250        if cfg['image'] == 'image.iso':
    235251                cmdline += ' -boot d -cdrom image.iso'
     252        elif cfg['image'] == 'image.iso@arm64':
     253                # Define image.iso cdrom backend.
     254                cmdline += ' -drive if=none,file=image.iso,id=cdrom,media=cdrom'
     255                # Define scsi bus.
     256                cmdline += ' -device virtio-scsi-device'
     257                # Define cdrom frontend connected to this scsi bus.
     258                cmdline += ' -device scsi-cd,drive=cdrom'
    236259        elif cfg['image'] == 'image.boot':
    237260                cmdline += ' -kernel image.boot'
     
    276299                        'xhci' : False,
    277300                        'tablet' : False
     301                }
     302        },
     303        'arm64' : {
     304                'virt' : {
     305                        'run' : qemu_run,
     306                        'image' : 'image.iso@arm64',
     307                        'audio' : False,
     308                        'console' : True,
     309                        'hdd' : False,
     310                        'net' : False,
     311                        'tablet' : False,
     312                        'usb' : False,
     313                        'xhci' : False
    278314                }
    279315        },
  • uspace/lib/c/doc/doxygroups.h

    r0d073b8 ra4bd537  
    1717/**
    1818 * @addtogroup libcarm32 arm32
     19 * @ingroup libc
     20 */
     21
     22/**
     23 * @addtogroup libcarm64 arm64
    1924 * @ingroup libc
    2025 */
Note: See TracChangeset for help on using the changeset viewer.