OS.swi OS_Memory 'Check Memory Access' bits

Justin F gerph at gerph.org
Sat Apr 24 23:08:09 BST 2021


Hiya,

In running my parser, I get a warning from the OS library every time it's 
parsed (which is for most files because most files have a 'needs' of 
'os'), which looks like this:

```
$ python3 oslib_parser.py --oslib-dir ro-oslib-code/!OSLib/Source/ os --create-python-api-template os.py
Reading ro-oslib-code/!OSLib/Source/Core/oslib/OS.swi
Redefinition of constant 'OSMemoryCheckMemoryAccessBits_PrivWFull'
Create os.py
```

This appears to be because... it is indeed defined twice:

CONST
   OSMemoryCheckMemoryAccessBits_UserRFull = OSMemoryCheckMemoryAccess_Bits: 0x0001,
   OSMemoryCheckMemoryAccessBits_UserWFull = OSMemoryCheckMemoryAccess_Bits: 0x0002,
   OSMemoryCheckMemoryAccessBits_PrivRFull = OSMemoryCheckMemoryAccess_Bits: 0x0004,
   OSMemoryCheckMemoryAccessBits_PrivWFull = OSMemoryCheckMemoryAccess_Bits: 0x0008,
   OSMemoryCheckMemoryAccessBits_UserRPart = OSMemoryCheckMemoryAccess_Bits: 0x0010,
   OSMemoryCheckMemoryAccessBits_UserWPart = OSMemoryCheckMemoryAccess_Bits: 0x0020,
   OSMemoryCheckMemoryAccessBits_PrivRPart = OSMemoryCheckMemoryAccess_Bits: 0x0040,
   OSMemoryCheckMemoryAccessBits_PrivWFull = OSMemoryCheckMemoryAccess_Bits: 0x0080,
   OSMemoryCheckMemoryAccessBits_PhysFull  = OSMemoryCheckMemoryAccess_Bits: 0x0100,
   OSMemoryCheckMemoryAccessBits_AbortFull = OSMemoryCheckMemoryAccess_Bits: 0x0200,
   OSMemoryCheckMemoryAccessBits_PhysPart  = OSMemoryCheckMemoryAccess_Bits: 0x1000,
   OSMemoryCheckMemoryAccessBits_AbortPart = OSMemoryCheckMemoryAccess_Bits: 0x2000;

0x80 and 0x08 are both assigned to that value.

I believe the 0x80 version should be ..._PrivWPart, indicating that the 
memory region is partially writeable in priveledged mode.

-- 
Charles Justin Ferguson
[ All information, speculation, opinion or data within, or attached to,
  this email is private and confidential. Such content may not be
  disclosed to third parties, or a public forum, without explicit
  permission being granted. ]



More information about the oslib-user mailing list