NO

Author Topic: Missing return in __declspec(naked) functions  (Read 19655 times)

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Missing return in __declspec(naked) functions
« Reply #15 on: February 11, 2005, 01:43:13 PM »
Since I support both __declspec(naked) and __fastcall, I guess a combination of the two must be supported somehow. However, it might not be necessary to support straight C code in this case - maybe enough with just inline assembly? It might be required to get efficient code anyway...

I guess it's best to add __LOCAL_SIZE after all. Might be useful for __cdecl and __stdcall functions too. Will only add it to the X86 target for now. Don't think it's equally important for the ARM target.

Pelle
/Pelle

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
Missing return in __declspec(naked) functions
« Reply #16 on: February 11, 2005, 02:32:49 PM »
I think it's important to support "C" code since this permit in a low level call, as an interrupt handler, to write plain C to build and access control structures more complicate and tedious to access in assembler. Allowing only the use of inline assembly will make the naked option only useful to write wrappers to call "C" functions. That is the actual standard way using an external assembler.
For the ARM processor I can't be very helpfull, because I'm not used to program them in assembler.
F.
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Missing return in __declspec(naked) functions
« Reply #17 on: February 11, 2005, 09:18:23 PM »
Quote from: "frankie"
I think it's important to support "C" code since this permit in a low level call, as an interrupt handler, to write plain C to build and access control structures more complicate and tedious to access in assembler. Allowing only the use of inline assembly will make the naked option only useful to write wrappers to call "C" functions. That is the actual standard way using an external assembler.

I was talking specifically about the __fastcall case. Never mind - I will support it in the same way as Microsoft. Not sure when I will add it.

Pelle
/Pelle

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
Missing return in __declspec(naked) functions
« Reply #18 on: February 12, 2005, 01:27:01 PM »
Ok, Pelle,
anyway it seems that MS just supports the _cdecl and __stdcall, the support for __fastcall is something aleatory, because the it uses the stack anyway.
so just support it for the first two, the __fastcall is just a programmer robin-round with the stack.
Thank-you
Have a nice weekend.
F.
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide