From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 490093858D20 for ; Mon, 8 Apr 2024 11:24:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 490093858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 490093858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712575461; cv=none; b=V8W8CwNxTlFsg+NTr7a8hitlyRb2QblV5KniYnFoXq2xhosi2TuOO+LCsO1rL1dzgc5R+JHRugJfa7jSo767Uvt2E62cP3qBa0TIQ2OX9tMH/9f5EkLUMsRUuX52+wf6RLkeAZwNgmF4pnywjix0ezfDM9mnbNe7hOdJu2eWJYA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712575461; c=relaxed/simple; bh=P5hnciPPBfbgFi3nMuCXkph4d7eTsEGn+pHCM5jM1Yk=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=H67TcZx4s51KIOTZW/pK9clbcIVkGv+w1nIXj971mNpjTu7v9lUVBp2pD2AgenFWn8v+nyJ0pbjJhwYJOMpMia5zVFoWscq48j5B1BCiOM+5u6fn4dnGAhh4wtZ27uPcdlV8paq19kIU2+BtAgWW9Xcv7cWKONVuo5WldGueAig= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712575459; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=adqZyaC6oGQ5ysqgKnMXFtmHDaWnTH8pggCnyRfUu1U=; b=HRtHz/L3o6q4Huty6fjttlnxn/ctyaz8NWuWw4TKsPd1xE3H4QCqmzeLm7fBeDetCJsIl5 9n4AAE+SapndwW8iGx0NZBvWbIJAeBIgrmr/k+CctGxhG6KXNIKKx+hesrtUl42LvVdzFN OzREyhLskfIcLZuvadCRcrgMTM334yY= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-646-1RnBARkNMXCSanGKpZcxiw-1; Mon, 08 Apr 2024 07:24:18 -0400 X-MC-Unique: 1RnBARkNMXCSanGKpZcxiw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 31A9C3C0ED52; Mon, 8 Apr 2024 11:24:18 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.59]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B08B317AB3; Mon, 8 Apr 2024 11:24:17 +0000 (UTC) From: Florian Weimer To: Matheus Afonso Martins Moreira via Gcc Cc: Matheus Afonso Martins Moreira Subject: Re: [RFC] Linux system call builtins In-Reply-To: <2d2f1e405361d2b36dd513e3fabd1fe0@gmail.com> (Matheus Afonso Martins Moreira via Gcc's message of "Mon, 08 Apr 2024 06:19:14 -0300") References: <2d2f1e405361d2b36dd513e3fabd1fe0@gmail.com> Date: Mon, 08 Apr 2024 13:24:11 +0200 Message-ID: <87plv0w10k.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: * Matheus Afonso Martins Moreira via Gcc: > + It's stable > > This is one of the things which makes Linux unique > in the operating system landscape: applications > can target the kernel directly. Unlike in virtually > every other operating system out there, the Linux kernel > to user space binary interface is documented[2] as stable. > Breaking it is considered a regression in the kernel. > Therefore it makes sense for a compiler to target it. > The same is not true for any other operating system. There is quite a bit of variance in how the kernel is entered. On x86-64, one once popular mechanism is longer present in widely-used kernels. For POWER, the preferred way changed over time. Likewise for i386. > + It's a calling convention > > GCC already supports many calling conventions > via function attributes. On x86 alone[3] there's > cdecl, fastcall, thiscall, stdcall, ms_abi, sysv_abi, > Win32 specific hot patching hooks. So I believe this > would not at all be a strange addition to the compiler. But using a builtin obfuscates that relationship. There is no __builtin_call_ms_abi, is there? Thanks, Florian