delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/06/17/03:24:59

Date: Thu, 17 Jun 1999 10:22:06 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Clemens Valens <c DOT valens AT mindless DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: Q: __djgpp_ds_alias already locked?
In-Reply-To: <929528357.1182@www.remarq.com>
Message-ID: <Pine.SUN.3.91.990617102138.22717H-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Wed, 16 Jun 1999, Clemens Valens wrote:

> I assume the error is due to the fact that __djgpp_ds_alias
> is already locked.

Probably.

> Is this true?

Yes, __djgpp_ds_alias is already locked by the startup code.

> (If so, where is it done?
> I looked through the djgpp sources but couldn't find it.)

It is locked by the function __djgpp_exception_setup that is called
by the startup code.  Around line 540 in the file
src/libc/go32/dpmiexcp.c you will find this snippet:

  /* lock addresses which may see HW interrupts */
  lockmem.address = __djgpp_base_address + (unsigned) &__djgpp_hw_lock_start;
  lockmem.size = ((unsigned) &__djgpp_hw_lock_end
		  - (unsigned) &__djgpp_hw_lock_start);
  __dpmi_lock_linear_region(&lockmem);

The symbols __djgpp_hw_lock_start and __djgpp_hw_lock_end are defined
in src/libc/go32/exceptn.S, and they include the DS alias and many
other things which are touched by the hardware interrupt handlers
installed by the startup code.

> The dpmi functions seem to use an error variable named
> __dpmi_error. Where can I find the meaning of its value?

Nowhere, unless you want this information specific to a certain DPMI
server, in which case you need the sources/docs of that specific
server.  The problem is that the DPMI spec doesn't specify any
specific error codes, except of including some vague blurb about
returning AX unmodified with the 15th bit set, so every server does
whatever pleases its author(s).  At least for CWSDPMI you have its
sources; but if you want to support other servers, I suggest to give
up on the error codes.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019