From 93d51f494af98b26e021d30ae6bfda7c45efdf12 Mon Sep 17 00:00:00 2001 From: Dale Henrichs Date: Tue, 14 Nov 2023 17:33:16 -0800 Subject: [PATCH] make dev/setSharedMemory.sh a standalone script that can be used by GsDevKitStones --- dev/setSharedMemory.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/dev/setSharedMemory.sh b/dev/setSharedMemory.sh index 9e1b46d..279ee3e 100755 --- a/dev/setSharedMemory.sh +++ b/dev/setSharedMemory.sh @@ -1,5 +1,19 @@ #! /usr/bin/env bash +PLATFORM="`uname -sm | tr ' ' '-'`" +case "$PLATFORM" in + Darwin-arm64) ;; + Darwin-x86_64) ;; + Linux-x86_64) + echo "no need to set up shared memory" + exit 0 + ;; + *) + echo "This script should only be run on Mac (Darwin-i386 or Darwin-arm64), or Linux (Linux-x86_64) ). The result from \"uname -sm\" is \"`uname -sm`\"" + exit 1 + ;; +esac + totalMem="`sysctl hw.memsize | cut -f2 -d' '`" # Figure out the max shared memory segment size currently allowed shmmax="`sysctl kern.sysv.shmmax | cut -f2 -d' '`"