From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id A1A0C4B1DA for ; Thu, 30 May 2024 19:44:15 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id ECE7968D51E; Thu, 30 May 2024 22:43:58 +0300 (EEST) Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 60D2168D499 for ; Thu, 30 May 2024 22:43:51 +0300 (EEST) Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-354f14bd80cso845102f8f.1 for ; Thu, 30 May 2024 12:43:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717098231; x=1717703031; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YQokBrOZJDgr0wSMeCnmVVhgGHDGob+KoTnF5Za6/CI=; b=JCeIG++qjotQbwADnepsoR7V/EM/rhFtQTpB/jfuZBLjz9eSbeDLYC2PGSmsrhQS2B mEcTajlayNJozQ3pCguwCpiPW5PRyIh68YCv+W/bKiZVJ1SltlNk20zjBFAfc0Kxa7PJ nbRGt2Bg6SI3Eh6qzswtxHU8ir6rdBZqK/HrL1WIe4KgEPxVE+3dUgLQHzsFUFhoqmP9 XmlQXTw5cCxLyJV4tKsrlFsgUfJtnAjwVkE/CnJa0hXeS5AsE/ZqgQxTU0Jkt50AUK9c 1HokjxK6zYAVEdBguCPjY7IYMwgMdohWhF4/0mzy+dc2JulEVTroxNQVv6/Tx2/QZafQ vDFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717098231; x=1717703031; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YQokBrOZJDgr0wSMeCnmVVhgGHDGob+KoTnF5Za6/CI=; b=XPbomaFJecRafgLHbk66kDVqYmEWSuNWLyQ5qESx7dw64Lze7SUUDb6MTNspVFSCJ7 64b0aE3fP+lZMo9g2LgmM+yTH2Wv6PH6fR1+8Q2fs7+IgXCr3eviT9KECqE8abv6AIhK oId0MCw4D/SvZ6VISrq41uwhhTssRXnswQnOK63Ny1VzcpgyLeAtTHe39Y3C7A8NuU6H zQFdEVFgTDW8BXttm4Ob+D4Se5a47NKNGbVVR+l1ZXkT2RxF+mo8k/cE2BbIqRnmtzSc 39zRZAR3l6x4ynP7n0iaQ6NUG1X2V15R92zJtwLSkyqt3UuGQg/i5MNBnvcRiL693kLx cgYA== X-Gm-Message-State: AOJu0Yz9sLQRwjzmlzAITArxI5/C5Qfcuk39m3lJ68M38NZZigjHf4Fc xHczUOS4drgwq2ZrgaAzr3iCeW5dZm2D4oC2sv/uE6JYW6TmcW7zrvOKig== X-Google-Smtp-Source: AGHT+IFZgPRQZwdMxsyIf/JYXcSRZ3lndSWYLYsiv98bJt3lubPoTW23RCw0tgVoJazY6YO+1BEnPA== X-Received: by 2002:adf:ef4c:0:b0:354:fc65:39d6 with SMTP id ffacd0b85a97d-35dc00923c6mr2455352f8f.26.1717098230668; Thu, 30 May 2024 12:43:50 -0700 (PDT) Received: from fractale.lan ([2001:861:5102:3290:f88d:fc8b:a14:3fcb]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35dd04c0de3sm225126f8f.9.2024.05.30.12.43.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 12:43:50 -0700 (PDT) From: averne To: ffmpeg-devel@ffmpeg.org Date: Thu, 30 May 2024 21:43:04 +0200 Message-ID: <2071da3c6620fd5ca9dd769a467f248796a51f67.1717083799.git.averne381@gmail.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: References: MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 02/16] configure, avutil: add support for HorizonOS X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: averne Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: HorizonOS (HOS) is the operating system of the Nintendo Switch. This patch enables integration with the homebrew toolchain developped by the devkitPro team. Its two main components are devkitA64 (common toolchain for aarch64 targets) and libnx (library implementing interaction with the HOS kernel and system daemons, termed sysmodules). Signed-off-by: averne --- configure | 8 ++++++++ libavutil/cpu.c | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/configure b/configure index 96b181fd21..09fb2aed1b 100755 --- a/configure +++ b/configure @@ -5967,6 +5967,10 @@ case $target_os in ;; minix) ;; + horizon) + enable section_data_rel_ro + add_extralibs -lnx + ;; none) ;; *) @@ -7710,6 +7714,10 @@ haiku) disable memalign fi ;; +horizon) + disable sysctl + disable sysctlbyname + ;; esac flatten_extralibs(){ diff --git a/libavutil/cpu.c b/libavutil/cpu.c index 9ac2f01c20..6a77df5e34 100644 --- a/libavutil/cpu.c +++ b/libavutil/cpu.c @@ -48,6 +48,9 @@ #if HAVE_UNISTD_H #include #endif +#ifdef __SWITCH__ +#include +#endif static atomic_int cpu_flags = -1; static atomic_int cpu_count = -1; @@ -247,6 +250,10 @@ int av_cpu_count(void) #elif HAVE_WINRT GetNativeSystemInfo(&sysinfo); nb_cpus = sysinfo.dwNumberOfProcessors; +#elif defined(__SWITCH__) + u64 core_mask = 0; + Result rc = svcGetInfo(&core_mask, InfoType_CoreMask, CUR_PROCESS_HANDLE, 0); + nb_cpus = R_SUCCEEDED(rc) ? av_popcount64(core_mask) : 3; #endif if (!atomic_exchange_explicit(&printed, 1, memory_order_relaxed)) -- 2.45.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".