public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "radoslaw.biernacki at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/50242] __attribute__((naked)) is not implemented on IA32 (x86)
Date: Sun, 25 Dec 2011 15:45:00 -0000	[thread overview]
Message-ID: <bug-50242-4-e8eS08L1hL@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-50242-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50242

Radoslaw Biernacki <radoslaw.biernacki at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |radoslaw.biernacki at gmail
                   |                            |dot com

--- Comment #8 from Radoslaw Biernacki <radoslaw.biernacki at gmail dot com> 2011-12-25 15:37:49 UTC ---
I will attach my comment to discussion.

I see the reason for naked attribute. I develop an embedded OS for small uC and
I would like to make a port for x86 Linux userspace. The scheduler for my OS
will behave as "fibres implementation". It will be similar to old fashioned
setcontext getcontext calls.

I need to compile following function:
void OS_NAKED OS_HOT os_context_switch(os_task_t *new_task)
{
   arch_contextstore_u();
   task_current = new_task;
   task_current->state = TASKSTATE_RUNNING;
   arch_contextrestore_u();
}

where arch_contextstore_u and arch_contextrestore_u are the architecture
depended function implemented by me in pure asm. arch_contextrestore_u will
make a return to address stored in task_current context (previously pushed on
stack by call (x86) instruction while calling os_context_switch).

The problem that I have is, that for x86 Linux environment, gcc does not
support the __attibute__ ((naked)). This attribute is supported on embedded
environments (bare metal) of all gcc ports that I found (like ARM, msp430-gcc,
avr-gcc etc).

So I'm the next person that wait for this implementation on x86 Linux.


  parent reply	other threads:[~2011-12-25 15:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-30 20:34 [Bug c++/50242] New: __attribute__((naked)) is ignored " congruwer at yahoo dot co.uk
2011-08-30 20:50 ` [Bug target/50242] " pinskia at gcc dot gnu.org
2011-08-31 16:11 ` [Bug target/50242] __attribute__((naked)) is not implemented " congruwer at yahoo dot co.uk
2011-08-31 17:12 ` jakub at gcc dot gnu.org
2011-09-01  8:10 ` congruwer at yahoo dot co.uk
2011-09-01  8:13 ` jakub at gcc dot gnu.org
2011-09-01  9:16 ` congruwer at yahoo dot co.uk
2011-09-01  9:21 ` congruwer at yahoo dot co.uk
2011-12-25 15:45 ` radoslaw.biernacki at gmail dot com [this message]
2011-12-25 17:22 ` pinskia at gcc dot gnu.org

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=bug-50242-4-e8eS08L1hL@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).