delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2024/04/21/15:14:26

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Recipient: djgpp AT delorie DOT com
X-Original-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
mime-version; bh=1l6OiSZWxCaOgrDOha5t+Bg8zXFWGoxZkPkrbq332do=; b=ikyT6ujMkX8N
ToIMwUeE7QbIuq96lhXArW3hTYKaqVBVJu6udwC6GpGLUnvtv/Ef7579+Hd8Af57y+5mmZIDQWZmU
JWFR5BkQMcYCcz2TUuwN5RME8rcV89QzJ5l2BYJiYGe08IASOeisePkBgDfwdjgQ4aUAbURhV5Ly7
vM6J0otVauA4m2AdOxdVa7Ycme1NUKx7FLsYL1sFcmVMCntjyxWecpSe1+41Nb1WepeU/6xuFs+uj
YeiOGyi+QPfH76Lh5FVtuPfH/GUH75fe3TLfpdf6xDknvRPIaZg99FrdTFZLOKcmR0jKYpYceJtJ3
9eTvEyCRVK+VwGFVPdCL6g==;
Date: Sun, 21 Apr 2024 22:13:28 +0300
Message-Id: <86le567cmf.fsf@gnu.org>
From: "Eli Zaretskii (eliz AT gnu DOT org) [via djgpp AT delorie DOT com]" <djgpp AT delorie DOT com>
To: Pali <pali AT pali DOT im>
Cc: djgpp AT delorie DOT com
In-Reply-To: <20240421102444.zjl5mmuhqbmuknhn@pali> (message from Pali on Sun,
21 Apr 2024 12:24:44 +0200)
Subject: Re: Error handling in __djgpp_map_physical_memory()
References: <20240421102444 DOT zjl5mmuhqbmuknhn AT pali>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> Date: Sun, 21 Apr 2024 12:24:44 +0200
> From: Pali <pali AT pali DOT im>
> Cc: djgpp AT delorie DOT com
> 
> Hello, I have there a change for __djgpp_map_physical_memory function,
> it is improving setting errno in the same way as was done already for
> the function __djgpp_set_page_attributes.

Thanks, I have a couple of minor comments below.

> +      /* Base address of the memory handle must be page aligned too. */
> +      if (d->address & 0xfff)
> +        {
> +          errno = EFAULT;

I think this should be EINVAL.  An unaligned address is not really
"bad address", it's just that it's not valid for this function.

> +              case 0x8023: /* Invalid handle (in ESI) */
> +              case 0x8025: /* Invalid linear address (specified range is not within specified block or EBX/EDX is not page-aligned) */
> +                errno = EFAULT;

These two should also be EINVAL, IMO.

- Raw text -


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