public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Matheus Afonso Martins Moreira via Gcc <gcc@gcc.gnu.org>
Cc: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
Subject: Re: [RFC] Linux system call builtins
Date: Mon, 08 Apr 2024 13:24:11 +0200	[thread overview]
Message-ID: <87plv0w10k.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <2d2f1e405361d2b36dd513e3fabd1fe0@gmail.com> (Matheus Afonso Martins Moreira via Gcc's message of "Mon, 08 Apr 2024 06:19:14 -0300")

* 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


  parent reply	other threads:[~2024-04-08 11:24 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-08  9:19 Matheus Afonso Martins Moreira
2024-04-08  9:58 ` Jonathan Wakely
2024-04-08 11:59   ` Matheus Afonso Martins Moreira
2024-04-08 14:00     ` Jonathan Wakely
2024-04-08 11:24 ` Florian Weimer [this message]
2024-04-08 11:44   ` Alexander Monakov
2024-04-08 11:50     ` Florian Weimer
2024-04-08 13:01       ` Alexander Monakov
2024-04-08 13:37   ` Matheus Afonso Martins Moreira
2024-04-08 18:18 ` Paul Iannetta
2024-04-08 18:26   ` Andrew Pinski
2024-04-08 20:01     ` Paul Iannetta
2024-04-08 20:20       ` Paul Koning
2024-04-10  1:48     ` Matheus Afonso Martins Moreira
2024-04-10 13:15       ` Paul Koning
2024-04-10 14:10         ` Matheus Afonso Martins Moreira
2024-04-10  1:26   ` Matheus Afonso Martins Moreira
2024-04-08 20:24 ` Paul Floyd
2024-04-10  2:19   ` Matheus Afonso Martins Moreira
2024-04-09 11:45 ` Szabolcs Nagy
2024-04-10  2:59   ` Matheus Afonso Martins Moreira
2024-04-10 11:04     ` Szabolcs Nagy
2024-04-10 14:00       ` Matheus Afonso Martins Moreira

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87plv0w10k.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=gcc@gcc.gnu.org \
    --cc=matheus.a.m.moreira@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).