e1f6ac8860
* Initial aarch64 port * Enable chainload on aarch64 No changes necessary since it's all UEFI anyway. * Add specification for Limine protocol for aarch64 * PROTOCOL: Specify state of information in DT /chosen node * common: Add spinup code for aarch64 * common: Port elf and term to aarch64 * common: Port vmm to aarch64 Also prepare to drop VMM_FLAG_PRESENT on x86. * protos: Port limine boot protocol to aarch64 Also drop VMM_FLAG_PRESENT since we never unmap pages anyway. * test: Add DTB request * PROTOCOL: Port SMP request to aarch64 * cpu: Add cache maintenance functions for aarch64 * protos/limine, sys: Port SMP to aarch64 Also move common asm macros into a header file. * test: Start up APs * vmm: Unify get_next_level and implement large page splitting * protos/limine: Map framebuffer using correct caching mode on AArch64 * CI: Fix GCC build for aarch64 * entry, menu: Replace uses of naked attribute with separate asm file GCC does not understand the naked attribute on aarch64, and didn't understand it for x86 in older versions.
50 lines
1015 B
Bash
Executable File
50 lines
1015 B
Bash
Executable File
#! /bin/sh
|
|
|
|
set -e
|
|
|
|
LC_ALL=C
|
|
export LC_ALL
|
|
|
|
TMP0="$(mktemp)"
|
|
|
|
cat >"$TMP0" <<EOF
|
|
#! /bin/sh
|
|
|
|
set -e
|
|
|
|
set -o pipefail 2>/dev/null
|
|
EOF
|
|
|
|
chmod +x "$TMP0"
|
|
|
|
"$TMP0" && set -o pipefail
|
|
|
|
rm "$TMP0"
|
|
|
|
TMP1="$(mktemp)"
|
|
TMP2="$(mktemp)"
|
|
TMP3="$(mktemp)"
|
|
TMP4="$(mktemp)"
|
|
|
|
trap "rm -f '$TMP1' '$TMP2' '$TMP3' '$TMP4'; trap - EXIT; exit" EXIT INT TERM QUIT HUP
|
|
|
|
"$CROSS_OBJDUMP" -t "$1" | ( "$SED" '/[[:<:]]d[[:>:]]/d' 2>/dev/null || "$SED" '/\bd\b/d' ) | sort > "$TMP1"
|
|
"$GREP" "$4" < "$TMP1" | cut -d' ' -f1 > "$TMP2"
|
|
"$GREP" "$4" < "$TMP1" | "$AWK" 'NF{ print $NF }' > "$TMP3"
|
|
|
|
echo ".section .$2_map" > "$TMP4"
|
|
echo ".globl $2_map" >> "$TMP4"
|
|
echo "$2_map:" >> "$TMP4"
|
|
|
|
if [ "$3" = "32" ]; then
|
|
paste -d'#' "$TMP2" "$TMP3" | "$SED" 's/^/.long 0x/g;s/$/"/g;s/\#/\
|
|
.asciz "/g' >> "$TMP4"
|
|
echo ".long 0xffffffff" >> "$TMP4"
|
|
elif [ "$3" = "64" ]; then
|
|
paste -d'#' "$TMP2" "$TMP3" | "$SED" 's/^/.quad 0x/g;s/$/"/g;s/\#/\
|
|
.asciz "/g' >> "$TMP4"
|
|
echo ".quad 0xffffffffffffffff" >> "$TMP4"
|
|
fi
|
|
|
|
mv "$TMP4" "$2.map.S"
|