mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
common: one char arch shorthands, fail nicely on invalid arch
This commit is contained in:
15
README.adoc
15
README.adoc
@@ -1630,7 +1630,7 @@ which automatically finds unstripped shared libraries on the host for us.
|
|||||||
|
|
||||||
See also: https://stackoverflow.com/questions/8611194/debugging-shared-libraries-with-gdbserver/45252113#45252113
|
See also: https://stackoverflow.com/questions/8611194/debugging-shared-libraries-with-gdbserver/45252113#45252113
|
||||||
|
|
||||||
== Architectures
|
== CPU architecture
|
||||||
|
|
||||||
The portability of the kernel and toolchains is amazing: change an option and most things magically work on completely different hardware.
|
The portability of the kernel and toolchains is amazing: change an option and most things magically work on completely different hardware.
|
||||||
|
|
||||||
@@ -1649,6 +1649,19 @@ Debug:
|
|||||||
./rungdb -a arm
|
./rungdb -a arm
|
||||||
....
|
....
|
||||||
|
|
||||||
|
We also have one letter shorthand names for the architectures:
|
||||||
|
|
||||||
|
....
|
||||||
|
# aarch64
|
||||||
|
./run -a A
|
||||||
|
# arm
|
||||||
|
./run -a a
|
||||||
|
# mips64
|
||||||
|
./run -a m
|
||||||
|
# x86_64
|
||||||
|
./run -a x
|
||||||
|
....
|
||||||
|
|
||||||
Known quirks of the supported architectures are documented in this section.
|
Known quirks of the supported architectures are documented in this section.
|
||||||
|
|
||||||
=== mips64
|
=== mips64
|
||||||
|
|||||||
18
common
18
common
@@ -22,6 +22,24 @@ common_bench_cmd() (
|
|||||||
set_common_vars() {
|
set_common_vars() {
|
||||||
arch="$1"
|
arch="$1"
|
||||||
gem5="${2:-false}"
|
gem5="${2:-false}"
|
||||||
|
case "$arch" in
|
||||||
|
a|arm)
|
||||||
|
arch=arm
|
||||||
|
;;
|
||||||
|
A|aarch64)
|
||||||
|
arch=aarch64
|
||||||
|
;;
|
||||||
|
m|mips64)
|
||||||
|
arch=mips64
|
||||||
|
;;
|
||||||
|
x|x86_64)
|
||||||
|
arch=x86_64
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
printf "unknown arch: ${arch}\n" 1>&2
|
||||||
|
exit 2
|
||||||
|
;;
|
||||||
|
esac
|
||||||
common_suffix="${3:-}"
|
common_suffix="${3:-}"
|
||||||
buildroot_dir="${root_dir}/buildroot"
|
buildroot_dir="${root_dir}/buildroot"
|
||||||
arch_dir="$arch"
|
arch_dir="$arch"
|
||||||
|
|||||||
Reference in New Issue
Block a user