Home | History | Annotate | Line # | Download | only in lib
      1  1.13  sborrill /*	$NetBSD: riscoscalls.h,v 1.13 2019/01/23 14:49:00 sborrill Exp $	*/
      2   1.1   reinoud 
      3   1.1   reinoud /*-
      4   1.1   reinoud  * Copyright (c) 2001 Ben Harris
      5   1.1   reinoud  * All rights reserved.
      6   1.1   reinoud  *
      7   1.1   reinoud  * Redistribution and use in source and binary forms, with or without
      8   1.1   reinoud  * modification, are permitted provided that the following conditions
      9   1.1   reinoud  * are met:
     10   1.1   reinoud  * 1. Redistributions of source code must retain the above copyright
     11   1.1   reinoud  *    notice, this list of conditions and the following disclaimer.
     12   1.1   reinoud  * 2. Redistributions in binary form must reproduce the above copyright
     13   1.1   reinoud  *    notice, this list of conditions and the following disclaimer in the
     14   1.1   reinoud  *    documentation and/or other materials provided with the distribution.
     15   1.1   reinoud  * 3. The name of the author may not be used to endorse or promote products
     16   1.1   reinoud  *    derived from this software without specific prior written permission.
     17   1.1   reinoud  *
     18   1.1   reinoud  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     19   1.1   reinoud  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     20   1.1   reinoud  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     21   1.1   reinoud  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     22   1.1   reinoud  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     23   1.1   reinoud  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     24   1.1   reinoud  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     25   1.1   reinoud  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     26   1.1   reinoud  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     27   1.1   reinoud  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     28   1.1   reinoud  */
     29   1.1   reinoud 
     30   1.1   reinoud /*
     31   1.1   reinoud  * This file defines the interface for the veneers over RISC OS SWIs used
     32   1.1   reinoud  * by libsa.  Only those SWIs actually needed by libsa are included.  In
     33   1.1   reinoud  * general, the interface is based on the one provided by OsLib, though
     34   1.1   reinoud  * this implementation is independent.
     35   1.1   reinoud  */
     36   1.1   reinoud 
     37   1.1   reinoud #define OS_WriteC		0x000000
     38   1.1   reinoud #define XOS_WriteC		0x020000
     39   1.1   reinoud #define OS_NewLine		0x000003
     40   1.1   reinoud #define XOS_NewLine		0x020003
     41   1.1   reinoud #define OS_ReadC		0x000004
     42   1.1   reinoud #define XOS_ReadC		0x020004
     43   1.1   reinoud #define OS_CLI			0x000005
     44   1.1   reinoud #define XOS_CLI			0x020005
     45   1.1   reinoud #define OS_Byte			0x000006
     46   1.1   reinoud #define XOS_Byte		0x020006
     47   1.1   reinoud #define OS_Word			0x000007
     48   1.1   reinoud #define XOS_Word		0x020007
     49   1.1   reinoud #define OS_Args			0x000009
     50   1.1   reinoud #define XOS_Args		0x020009
     51   1.1   reinoud #define OS_GBPB			0x00000c
     52   1.1   reinoud #define XOS_GBPB		0x02000c
     53   1.1   reinoud #define OS_Find			0x00000d
     54   1.1   reinoud #define XOS_Find		0x02000d
     55   1.1   reinoud #define OS_GetEnv		0x000010
     56   1.1   reinoud #define XOS_GetEnv		0x020010
     57   1.1   reinoud #define OS_Exit			0x000011
     58   1.1   reinoud #define XOS_Exit		0x020011
     59   1.1   reinoud #define OS_IntOff		0x000014
     60   1.1   reinoud #define XOS_IntOff		0x020014
     61   1.1   reinoud #define OS_EnterOS		0x000016
     62   1.1   reinoud #define XOS_EnterOS		0x020016
     63   1.1   reinoud #define OS_Module		0x00001e
     64   1.1   reinoud #define XOS_Module		0x02001e
     65   1.1   reinoud #define OS_FSControl		0x000029
     66   1.1   reinoud #define XOS_FSControl		0x020029
     67   1.1   reinoud #define OS_ServiceCall		0x000030
     68   1.1   reinoud #define XOS_ServiceCall		0x020030
     69   1.1   reinoud #define OS_ReadVduVariables	0x000031
     70   1.1   reinoud #define XOS_ReadVduVariables	0x020031
     71   1.1   reinoud #define OS_SWINumberFromString	0x000039
     72   1.1   reinoud #define XOS_SWINumberFromString	0x020039
     73   1.9     bjh21 #define OS_ReadMonotonicTime	0x000042
     74   1.9     bjh21 #define XOS_ReadMonotonicTime	0x020042
     75   1.1   reinoud #define OS_ReadMemMapInfo	0x000051
     76   1.1   reinoud #define XOS_ReadMemMapInfo	0x020051
     77   1.1   reinoud #define OS_ReadMemMapEntries	0x000052
     78   1.1   reinoud #define XOS_ReadMemMapEntries	0x020052
     79   1.1   reinoud #define OS_ReadSysInfo		0x000058
     80   1.1   reinoud #define XOS_ReadSysInfo		0x020058
     81   1.1   reinoud #define OS_Memory		0x000068
     82   1.1   reinoud #define XOS_Memory		0x020068
     83   1.1   reinoud 
     84   1.1   reinoud #define Cache_Control		0x000280
     85   1.1   reinoud #define XCache_Control		0x020280
     86   1.1   reinoud 
     87   1.3     gavan #define Wimp_SlotSize		0x0400ec
     88   1.3     gavan #define XWimp_SlotSize		0x0600ec
     89   1.3     gavan 
     90   1.5     bjh21 #define FileCore_DiscOp		0x040540
     91   1.5     bjh21 #define XFileCore_DiscOp	0x060540
     92   1.5     bjh21 #define FileCore_Drives		0x040542
     93   1.5     bjh21 #define XFileCore_Drives	0x060542
     94   1.5     bjh21 #define FileCore_SectorOp	0x04054A
     95   1.5     bjh21 #define XFileCore_SectorOp	0x06054A
     96   1.5     bjh21 #define FileCore_DiscOp64	0x04054E
     97   1.5     bjh21 #define XFileCore_DiscOp64	0x06054E
     98   1.5     bjh21 
     99   1.5     bjh21 
    100   1.1   reinoud #ifndef __ASSEMBLER__
    101   1.1   reinoud typedef struct os_error {
    102  1.12     skrll 	uint32_t errnum;
    103   1.1   reinoud 	char errmess[252];
    104   1.1   reinoud } os_error;
    105   1.1   reinoud 
    106   1.1   reinoud /* Errors talking to the console may as well be fatal. */
    107   1.1   reinoud 
    108   1.1   reinoud extern void os_writec(int);
    109   1.1   reinoud extern void os_new_line(void);
    110   1.1   reinoud extern int os_readc(void);
    111   1.1   reinoud #endif
    112   1.1   reinoud 
    113   1.1   reinoud /* OS_CLI */
    114   1.1   reinoud 
    115   1.1   reinoud #ifndef __ASSEMBLER__
    116   1.2     bjh21 extern void os_cli(char *);
    117   1.2     bjh21 extern os_error *xos_cli(char *);
    118   1.1   reinoud #endif
    119   1.1   reinoud 
    120   1.1   reinoud /* OS_Byte */
    121   1.1   reinoud 
    122   1.1   reinoud #define osbyte_OUTPUT_CURSOR_POSITION	165
    123   1.9     bjh21 #define osbyte_VAR_VSYNC_TIMER		176
    124   1.1   reinoud 
    125   1.1   reinoud #ifndef __ASSEMBLER__
    126   1.1   reinoud extern void os_byte(int, int, int, int *, int *);
    127   1.9     bjh21 extern int osbyte_read(int);
    128   1.1   reinoud #endif
    129   1.1   reinoud 
    130   1.1   reinoud /* OS_Word */
    131   1.1   reinoud 
    132   1.1   reinoud #define osword_WRITE_SCREEN_ADDRESS	 22
    133   1.1   reinoud 
    134   1.1   reinoud #ifndef __ASSEMBLER__
    135   1.1   reinoud extern void os_word(int, char *);
    136   1.1   reinoud #endif
    137   1.1   reinoud 
    138   1.1   reinoud /* OS_Args */
    139   1.1   reinoud 
    140   1.1   reinoud #define OSArgs_ReadPtr		0
    141   1.1   reinoud #define OSArgs_SetPtr		1
    142   1.1   reinoud #define OSArgs_ReadExt		2
    143   1.1   reinoud #define OSArgs_SetExt		3
    144   1.1   reinoud #define OSArgs_ReadAllocation	4
    145   1.1   reinoud #define OSArgs_ReadEOFStatus	5
    146   1.1   reinoud 
    147   1.1   reinoud #ifndef __ASSEMBLER__
    148   1.1   reinoud extern os_error *xosargs_read(int, int, int *);
    149   1.1   reinoud extern os_error *xosargs_set(int, int, int);
    150   1.1   reinoud 
    151   1.1   reinoud #define xosargs_read_ptr(f, vp)	xosargs_read(OSArgs_ReadPtr, (f), (vp))
    152   1.1   reinoud #define xosargs_set_ptr(f, v)	xosargs_set(OSArgs_SetPtr, (f), (v))
    153   1.1   reinoud #define xosargs_read_ext(f, vp)	xosargs_read(OSArgs_ReadExt, (f), (vp))
    154   1.1   reinoud #define xosargs_set_ext(f, v)	xosargs_set(OSArgs_SetExt, (f), (v))
    155   1.1   reinoud #define xosargs_read_allocation(f, vp) \
    156   1.1   reinoud 				xosargs_read(OSArgs_ReadAllocation, (f), (vp))
    157   1.1   reinoud #define xosargs_read_eof_status(f, vp) \
    158   1.1   reinoud 				xosargs_read(OSArgs_ReadEOFStatus, (f), (vp))
    159   1.1   reinoud #endif
    160   1.1   reinoud 
    161   1.1   reinoud /* OS_GBPB */
    162   1.1   reinoud 
    163   1.1   reinoud #define OSGBPB_WriteAt		1
    164   1.1   reinoud #define OSGBPB_Write		2
    165   1.1   reinoud #define OSGBPB_ReadAt		3
    166   1.1   reinoud #define OSGBPB_Read		4
    167   1.1   reinoud 
    168   1.1   reinoud #ifndef __ASSEMBLER__
    169   1.1   reinoud extern os_error *xosgbpb_write(int, char const *, int, int *);
    170   1.1   reinoud extern os_error *xosgbpb_read(int, char *, int, int *);
    171   1.1   reinoud #endif
    172   1.1   reinoud 
    173   1.1   reinoud /* OS_Find */
    174   1.1   reinoud 
    175   1.1   reinoud #define OSFind_Close	0x00
    176   1.1   reinoud #define OSFind_Openin	0x40
    177   1.1   reinoud #define OSFind_Openout	0x80
    178   1.1   reinoud #define OSFind_Openup	0xc0
    179   1.1   reinoud 
    180   1.1   reinoud #define osfind_PATH		0x01
    181   1.1   reinoud #define osfind_PATH_VAR		0x02
    182   1.1   reinoud #define osfind_NO_PATH		0x03
    183   1.1   reinoud #define osfind_ERROR_IF_DIR	0x04
    184   1.1   reinoud #define osfind_ERROR_IF_ABSENT	0x08
    185   1.1   reinoud 
    186   1.1   reinoud #ifndef __ASSEMBLER__
    187   1.1   reinoud extern os_error *xosfind_close(int);
    188   1.1   reinoud extern os_error *xosfind_open(int, char const *, char const *, int *);
    189   1.1   reinoud #endif
    190   1.1   reinoud 
    191   1.1   reinoud /* OS_ReadSysInfo */
    192   1.1   reinoud 
    193   1.1   reinoud #define	OSReadSysInfo_ReadConfiguredScreenSize	0x00
    194   1.1   reinoud #define OSReadSysInfo_ReadMonitorInfo		0x01
    195   1.1   reinoud #define OSReadSysInfo_ReadChipPresenceAndId	0x02
    196   1.1   reinoud #define OSReadSysInfo_ReadSuperIOFeatures	0x03
    197  1.11     gavan #define OSReadSysInfo_ReadPlatformClass		0x08
    198   1.1   reinoud 
    199   1.1   reinoud #define osreadsysinfo_IOEB_ASIC_PRESENT		0x01
    200   1.1   reinoud #define osreadsysinfo_SUPERIO_PRESENT		0x02
    201   1.1   reinoud #define osreadsysinfo_LCD_ASIC_PRESENT		0x04
    202   1.1   reinoud 
    203  1.11     gavan #define osreadsysinfo_Platform_Unknown		0x00
    204  1.11     gavan #define osreadsysinfo_Platform_RiscPC		0x01
    205  1.11     gavan #define osreadsysinfo_Platform_A7000		0x02
    206  1.11     gavan #define osreadsysinfo_Platform_A7000Plus	0x03
    207  1.11     gavan #define osreadsysinfo_Platform_Phoebe		0x04
    208  1.11     gavan #define osreadsysinfo_Platform_Pace		0x05
    209  1.11     gavan #define osreadsysinfo_Platform_VirtualRPC	0x06
    210  1.11     gavan #define osreadsysinfo_Platform_A9		0x07
    211  1.11     gavan 
    212   1.1   reinoud #ifndef __ASSEMBLER__
    213   1.1   reinoud extern void os_readsysinfo(int what, int *r0, int *r1, int *r2, int *r3, int *r4);
    214   1.1   reinoud #define os_readsysinfo_configured_screensize(s) \
    215   1.1   reinoud 	os_readsysinfo(OSReadSysInfo_ReadConfiguredScreenSize, (s), 0, 0, 0, 0)
    216   1.1   reinoud 
    217   1.1   reinoud #define os_readsysinfo_monitor_info(mode, type, sync) \
    218   1.1   reinoud 	os_readsysinfo(OSReadSysInfo_ReadMonitorInfo, (mode), (type), (sync), 0, 0)
    219   1.1   reinoud 
    220   1.1   reinoud #define os_readsysinfo_chip_presence(ioeb, superio, lcd) \
    221   1.1   reinoud 	os_readsysinfo(OSReadSysInfo_ReadChipPresenceAndId, (ioeb), (superio), (lcd), 0, 0)
    222   1.1   reinoud 
    223   1.1   reinoud #define os_readsysinfo_unique_id(low, high) \
    224   1.1   reinoud 	os_readsysinfo(OSReadSysInfo_ReadChipPresenceAndId, 0, 0, 0, (low), (high))
    225   1.1   reinoud 
    226   1.1   reinoud #define os_readsysinfo_superio_features(basic, extra) \
    227   1.1   reinoud 	os_readsysinfo(OSReadSysInfo_ReadSuperIOFeatures, (basic), (extra), 0, 0, 0)
    228   1.1   reinoud 
    229  1.11     gavan #define os_readsysinfo_platform_class(class, flags, feature) \
    230  1.11     gavan 	os_readsysinfo(OSReadSysInfo_ReadPlatformClass, (class), (flags), (feature), 0, 0)
    231  1.11     gavan 
    232   1.1   reinoud #endif
    233   1.1   reinoud 
    234   1.1   reinoud /* OS_Memory */
    235   1.1   reinoud 
    236   1.1   reinoud #define OSMemory_PageOp				0x00
    237   1.1   reinoud #define OSMemory_ReadArrangementTableSize	0x06
    238   1.1   reinoud #define OSMemory_ReadArrangementTable		0x07
    239   1.1   reinoud #define OSMemory_ReadSize			0x08
    240   1.1   reinoud #define OSMemory_ReadController			0x09
    241   1.1   reinoud 
    242   1.1   reinoud #define osmemory_GIVEN_PAGE_NO		0x0100
    243   1.1   reinoud #define osmemory_GIVEN_LOG_ADDR		0x0200
    244   1.1   reinoud #define osmemory_GIVEN_PHYS_ADDR	0x0400
    245   1.1   reinoud #define osmemory_RETURN_PAGE_NO		0x0800
    246   1.1   reinoud #define osmemory_RETURN_LOG_ADDR	0x1000
    247   1.1   reinoud #define osmemory_RETURN_PHYS_ADDR	0x2000
    248   1.1   reinoud 
    249   1.1   reinoud #define osmemory_TYPE			0xf00
    250   1.1   reinoud #define osmemory_TYPE_SHIFT		8
    251   1.1   reinoud #define osmemory_TYPE_ABSENT		0x0
    252   1.1   reinoud #define osmemory_TYPE_DRAM		0x1
    253   1.1   reinoud #define osmemory_TYPE_VRAM		0x2
    254   1.1   reinoud #define osmemory_TYPE_ROM		0x3
    255   1.1   reinoud #define osmemory_TYPE_IO		0x4
    256   1.1   reinoud /* 5, 6, 7 are undefined */
    257   1.1   reinoud #define osmemory_TYPE_ALLOCATABLE_MASK	0x8	/* bit signaling allocatable */
    258   1.1   reinoud 
    259   1.1   reinoud 
    260   1.1   reinoud #ifndef __ASSEMBLER__
    261   1.1   reinoud struct page_info {
    262   1.1   reinoud 	int	pagenumber;
    263   1.1   reinoud 	int	logical;
    264   1.1   reinoud 	int	physical;
    265   1.1   reinoud };
    266   1.1   reinoud 
    267   1.1   reinoud extern void osmemory_read_arrangement_table_size(int *size, int *nbpp);
    268   1.7     bjh21 extern os_error *xosmemory_read_arrangement_table_size(int *size, int *nbpp);
    269   1.1   reinoud extern void osmemory_read_arrangement_table(unsigned char *block);
    270   1.7     bjh21 extern os_error *xosmemory_read_arrangement_table(unsigned char *block);
    271   1.1   reinoud extern void osmemory_page_op(int fromto, struct page_info *block, int num_pages);
    272   1.1   reinoud #endif
    273   1.1   reinoud 
    274   1.1   reinoud /* Misc */
    275   1.1   reinoud #ifndef __ASSEMBLER__
    276  1.10  christos extern char *os_get_env(void **, void **);
    277   1.1   reinoud 
    278   1.1   reinoud extern void os_exit(os_error const *, int) __attribute__((noreturn));
    279   1.1   reinoud 
    280   1.1   reinoud extern void os_int_off(void);
    281   1.1   reinoud 
    282   1.1   reinoud extern void os_enter_os(void);
    283   1.1   reinoud #endif
    284   1.1   reinoud 
    285   1.5     bjh21 #define OSModule_Alloc		6
    286   1.5     bjh21 #define OSModule_Free		7
    287   1.5     bjh21 #define OSModule_Lookup		18
    288  1.13  sborrill #define OSModule_EnumerateWithVersion	20
    289   1.5     bjh21 
    290   1.5     bjh21 #ifndef __ASSEMBLER__
    291   1.5     bjh21 extern os_error *xosmodule_alloc(int, void **);
    292   1.5     bjh21 extern os_error *xosmodule_free(void *);
    293   1.5     bjh21 extern os_error *xosmodule_lookup(char const *, int *, int *, void **, void **,
    294   1.5     bjh21     char **);
    295  1.13  sborrill extern os_error *xosmodule_enumeratewithversion(int *, int *, char **, int *,
    296  1.13  sborrill     int *, int *);
    297   1.5     bjh21 #endif
    298   1.5     bjh21 
    299   1.5     bjh21 #define OSFSControl_AddFS		12
    300   1.7     bjh21 #define OSFSControl_SelectFS		14
    301   1.5     bjh21 #define OSFSControl_RemoveFS		16
    302   1.5     bjh21 #define OSFSControl_Shutdown		23
    303   1.5     bjh21 
    304   1.5     bjh21 #define fileswitch_SUPPORTS_SPECIAL		(1 << 31)
    305   1.5     bjh21 #define fileswitch_INTERACTIVE			(1 << 30)
    306   1.5     bjh21 #define fileswitch_SUPPORTS_EMPTY_NAMES		(1 << 29)
    307   1.5     bjh21 #define fileswitch_NEEDS_CREATE			(1 << 28)
    308   1.5     bjh21 #define fileswitch_NEEDS_FLUSH			(1 << 27)
    309   1.5     bjh21 #define fileswitch_SUPPORTS_STAMP_NAMED		(1 << 26)
    310   1.5     bjh21 #define fileswitch_SUPPORTS_FILE_INFO		(1 << 25)
    311   1.5     bjh21 #define fileswitch_SUPPORTS_SET_CONTEXTS	(1 << 24) /* MBZ in RO3 */
    312   1.5     bjh21 #define fileswitch_SUPPORTS_IMAGE		(1 << 23)
    313   1.5     bjh21 #define fileswitch_NEEDS_URD_AND_LIB		(1 << 22)
    314   1.5     bjh21 #define fileswitch_IMPLICIT_DIRECTORIES		(1 << 21)
    315   1.5     bjh21 #define fileswitch_NO_LOAD_ENTRY		(1 << 20)
    316   1.5     bjh21 #define fileswitch_NO_SAVE_ENTRY		(1 << 19)
    317   1.5     bjh21 #define fileswitch_NO_FILE_ENTRIES		(1 << 18)
    318   1.5     bjh21 #define fileswitch_HAS_EXTRA_FLAGS		(1 << 17)
    319   1.5     bjh21 #define fileswitch_READ_ONLY			(1 << 16)
    320   1.5     bjh21 
    321   1.5     bjh21 #define fileswitch_SUPPORTS_DIR_CHANGE		(1 << 0)
    322   1.5     bjh21 #define fileswitch_NEEDS_CAT			(1 << 1)
    323   1.5     bjh21 #define fileswitch_NEEDS_EX			(1 << 2)
    324   1.1   reinoud 
    325   1.6     bjh21 #define fileswitch_NOT_FOUND	0
    326   1.6     bjh21 #define fileswitch_IS_FILE	1
    327   1.6     bjh21 #define fileswitch_IS_DIR	2
    328   1.6     bjh21 #define fileswitch_IS_IMAGE	3
    329   1.6     bjh21 
    330   1.6     bjh21 #define fileswitch_ATTR_OWNER_READ	(1 << 0)
    331   1.6     bjh21 #define fileswitch_ATTR_OWNER_WRITE	(1 << 1)
    332   1.6     bjh21 #define fileswitch_ATTR_OWNER_LOCKED	(1 << 3)
    333   1.6     bjh21 #define fileswitch_ATTR_WORLD_READ	(1 << 4)
    334   1.6     bjh21 #define fileswitch_ATTR_WORLD_WRITE	(1 << 5)
    335   1.6     bjh21 #define fileswitch_ATTR_WORLD_LOCKED	(1 << 7)
    336   1.6     bjh21 
    337   1.1   reinoud #ifndef __ASSEMBLER__
    338   1.7     bjh21 struct fileswitch_dirent {
    339   1.7     bjh21 	uint32_t	loadaddr;
    340   1.7     bjh21 	uint32_t	execaddr;
    341   1.7     bjh21 	uint32_t	length;
    342   1.7     bjh21 	uint32_t	attr;
    343   1.7     bjh21 	uint32_t	objtype;
    344   1.7     bjh21 	char		name[1];	/* Actually variable length */
    345   1.7     bjh21 };
    346   1.7     bjh21 
    347   1.1   reinoud extern os_error *xosfscontrol_shutdown(void);
    348   1.1   reinoud #endif
    349   1.1   reinoud 
    350   1.8     bjh21 #define Service_FSRedeclare	0x40
    351   1.1   reinoud #define Service_PreReset	0x45
    352   1.1   reinoud 
    353   1.1   reinoud #ifndef __ASSEMBLER__
    354   1.1   reinoud extern void service_pre_reset(void);
    355   1.1   reinoud #endif
    356   1.1   reinoud 
    357   1.1   reinoud #define os_MODEVAR_LOG2_BPP		9
    358   1.1   reinoud #define os_MODEVAR_XWIND_LIMIT		11
    359   1.1   reinoud #define os_MODEVAR_YWIND_LIMIT		12
    360   1.1   reinoud #define os_VDUVAR_DISPLAY_START		149
    361   1.1   reinoud #define os_VDUVAR_TOTAL_SCREEN_SIZE	150
    362   1.1   reinoud #define os_VDUVAR_TCHAR_SPACEY		170
    363   1.1   reinoud 
    364   1.1   reinoud #ifndef __ASSEMBLER__
    365   1.1   reinoud extern void os_read_vdu_variables(const int *, int *);
    366   1.1   reinoud 
    367   1.1   reinoud extern os_error *xos_swi_number_from_string(char const *, int *);
    368   1.1   reinoud 
    369   1.9     bjh21 extern unsigned int os_read_monotonic_time(void);
    370   1.9     bjh21 
    371   1.1   reinoud extern void os_read_mem_map_info(int *, int *);
    372   1.1   reinoud 
    373   1.1   reinoud struct os_mem_map_request {
    374   1.1   reinoud 	int page_no;
    375  1.10  christos 	void *map;
    376   1.1   reinoud 	int access;
    377   1.1   reinoud #define os_AREA_ACCESS_READ_WRITE	0
    378   1.1   reinoud #define os_AREA_ACCESS_READ_ONLY	1
    379   1.1   reinoud #define os_AREA_ACCESS_NONE		3
    380   1.1   reinoud };
    381   1.1   reinoud 
    382   1.1   reinoud extern void os_read_mem_map_entries(struct os_mem_map_request *);
    383   1.1   reinoud 
    384   1.1   reinoud extern os_error xcache_control(u_int, u_int, u_int *);
    385   1.1   reinoud 
    386   1.5     bjh21 #endif
    387   1.5     bjh21 
    388   1.5     bjh21 #define FileCoreDiscOp_ReadSectors		1
    389   1.5     bjh21 
    390   1.5     bjh21 #ifndef __ASSEMBLER__
    391   1.5     bjh21 
    392   1.1   reinoud struct filecore_disc {
    393  1.12     skrll 	uint8_t		log2secsize;
    394  1.12     skrll 	uint8_t		secspertrack;
    395  1.12     skrll 	uint8_t		heads;
    396  1.12     skrll 	uint8_t		density;
    397  1.12     skrll 	uint8_t		idlen;
    398  1.12     skrll 	uint8_t		log2bpmp;
    399  1.12     skrll 	uint8_t		skew;
    400  1.12     skrll 	uint8_t		bootoption;
    401  1.12     skrll 	uint8_t		lowsector;
    402  1.12     skrll 	uint8_t		nzones;
    403  1.12     skrll 	uint16_t	zone_spare;
    404  1.12     skrll 	uint32_t	root;
    405  1.12     skrll 	uint32_t	disc_size;
    406  1.12     skrll 	uint16_t	disc_id;
    407   1.1   reinoud 	char		disc_name[10];
    408  1.12     skrll 	uint32_t	disc_type;
    409  1.12     skrll 	uint32_t	disc_size_hi;
    410  1.12     skrll 	uint8_t		share_size;
    411  1.12     skrll 	uint8_t		big_flag;
    412  1.12     skrll 	uint8_t		reserved[22];
    413   1.1   reinoud };
    414   1.1   reinoud 
    415   1.5     bjh21 struct filecore_daddr64 {
    416   1.5     bjh21 	uint32_t	drive;
    417   1.5     bjh21 	uint64_t	daddr;
    418   1.5     bjh21 };
    419   1.5     bjh21 
    420   1.5     bjh21 extern os_error *xfilecorediscop_read_sectors(uint32_t, uint32_t, void *,
    421   1.5     bjh21     size_t, void *, uint32_t *, void **, size_t *);
    422   1.5     bjh21 extern os_error *xfilecoresectorop_read_sectors(uint32_t, uint32_t, void *,
    423   1.5     bjh21     size_t, void *, uint32_t *, void **, size_t *);
    424   1.5     bjh21 extern os_error *xfilecorediscop64_read_sectors(uint32_t,
    425   1.5     bjh21     struct filecore_daddr64 *, void *, size_t, struct filecore_disc const *,
    426   1.5     bjh21     void *, uint32_t *, void **, size_t *);
    427   1.5     bjh21 extern os_error *xfilecore_drives(void *, int *, int *, int *);
    428   1.5     bjh21 
    429   1.1   reinoud #endif
    430   1.1   reinoud 
    431   1.1   reinoud /* RISC OS Error numbers */
    432   1.1   reinoud 
    433   1.1   reinoud #define error_IS_ADIR			0xa8
    434   1.1   reinoud #define error_TOO_MANY_OPEN_FILES	0xc0
    435   1.1   reinoud #define error_FILE_NOT_FOUND		0xd6
    436   1.1   reinoud 
    437   1.1   reinoud #ifndef __ASSEMBLER__
    438   1.1   reinoud extern int riscos_errno(os_error *);
    439   1.1   reinoud #endif
    440