www.digitalmars.com         C & C++   DMDScript  

D - Dernel: D & interrupt handling

reply "=?iso-8859-1?Q?Robert_M._M=FCnch?=" <robert.muench robertmuench.de> writes:
Hi Walter, how about adding an attribute "interrupt"? Functions marked  
with this attribute should use a IRET instead of a RET/RETF. At least for  
the X86 versions, this would make D even more interesting to system  
development.

-- 
Robert M. Münch
Management & IT Freelancer
http://www.robertmuench.de
Mar 03 2004
next sibling parent reply Russ Lewis <spamhole-2001-07-16 deming-os.org> writes:
Robert M. Münch wrote:
 Hi Walter, how about adding an attribute "interrupt"? Functions marked  
 with this attribute should use a IRET instead of a RET/RETF. At least 
 for  the X86 versions, this would make D even more interesting to 
 system  development.

'extern(interrupt)' would seem to make sense for this.
Mar 04 2004
parent "=?iso-8859-1?Q?Robert_M._M=FCnch?=" <robert.muench robertmuench.de> writes:
On Thu, 04 Mar 2004 13:50:19 -0700, Russ Lewis  
<spamhole-2001-07-16 deming-os.org> wrote:

 'extern(interrupt)' would seem to make sense for this.

Why extern? But if this makes sense, why not. Robert
Mar 05 2004
prev sibling parent reply "Walter" <walter digitalmars.com> writes:
"Robert M. Münch" <robert.muench robertmuench.de> wrote in message
news:opr4buchrsheztw6 news.digitalmars.com...
 Hi Walter, how about adding an attribute "interrupt"? Functions marked
 with this attribute should use a IRET instead of a RET/RETF. At least for
 the X86 versions, this would make D even more interesting to system
 development.

How about instead using inline assembler? void my_interrupt_handler() { asm { naked ; pusha ; call function ; popa ; iret ; } } void function() { ... handle interrupt ... }
Mar 05 2004
parent "=?iso-8859-1?Q?Robert_M._M=FCnch?=" <robert.muench robertmuench.de> writes:
On Fri, 5 Mar 2004 14:19:45 -0800, Walter <walter digitalmars.com> wrote:

 How about instead using inline assembler?

Yes, that's the workaround. Of course possible and not to hard to do. My ides was based on the attribute concept being included in D because I like approaches, that are extendable and re-use the available concepts as much as possible. I'm going to use this code for now ;-)) Robert
Mar 06 2004