9
0
Fork 0

* Code cleanup:

- remove trailing white space, trailing empty lines, C++ comments, etc.
  - split cmd_boot.c (separate cmd_bdinfo.c and cmd_load.c)

* Patches by Kenneth Johansson, 25 Jun 2003:
  - major rework of command structure
    (work done mostly by Michal Cendrowski and Joakim Kristiansen)
This commit is contained in:
wdenk 2003-06-27 21:31:46 +00:00
parent 993cad9364
commit 8bde7f776c
1246 changed files with 46635 additions and 48962 deletions

View File

@ -1,11 +1,25 @@
====================================================================== ======================================================================
Changes since U-Boot 0.3.1: Changes since U-Boot 0.4.0:
======================================================================
* Code cleanup:
- remove trailing white space, trailing empty lines, C++ comments, etc.
- split cmd_boot.c (separate cmd_bdinfo.c and cmd_load.c)
* Patches by Kenneth Johansson, 25 Jun 2003:
- major rework of command structure
(work done mostly by Michal Cendrowski and Joakim Kristiansen)
======================================================================
Changes for U-Boot 0.4.0:
====================================================================== ======================================================================
* Patches by Robert Schwebel, 26 Jun 2003: * Patches by Robert Schwebel, 26 Jun 2003:
- logdl - csb226 configuration updated
- csb226 - credits for logodl port updated
- innokom - innokom configuration updated
- logodl tree update, still with coding style inconsistencies
- added OCM for ppc405 warning to README
* Patch by Pantelis Antoniou, 25 Jun 2003: * Patch by Pantelis Antoniou, 25 Jun 2003:
update NetVia with V2 board support update NetVia with V2 board support

View File

@ -134,7 +134,8 @@ u-boot.dis: u-boot
$(OBJDUMP) -d $< > $@ $(OBJDUMP) -d $< > $@
u-boot: depend subdirs $(OBJS) $(LIBS) $(LDSCRIPT) u-boot: depend subdirs $(OBJS) $(LIBS) $(LDSCRIPT)
$(LD) $(LDFLAGS) $(OBJS) \ UNDEF_SYM=`$(OBJDUMP) -x $(LIBS) |sed -n -e 's/.*\(__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
$(LD) $(LDFLAGS) $$UNDEF_SYM $(OBJS) \
--start-group $(LIBS) --end-group \ --start-group $(LIBS) --end-group \
-Map u-boot.map -o u-boot -Map u-boot.map -o u-boot

9
README
View File

@ -1349,8 +1349,6 @@ Modem Support:
See also: doc/README.Modem See also: doc/README.Modem
Configuration Settings: Configuration Settings:
----------------------- -----------------------
@ -1842,7 +1840,6 @@ Note: for some board special configuration names may exist; check if
etc. etc.
Finally, type "make all", and you should get some working U-Boot Finally, type "make all", and you should get some working U-Boot
images ready for downlod to / installation on your system: images ready for downlod to / installation on your system:
@ -1906,7 +1903,6 @@ or to build on a native PowerPC system you can type
See also "U-Boot Porting Guide" below. See also "U-Boot Porting Guide" below.
Monitor Commands - Overview: Monitor Commands - Overview:
============================ ============================
@ -2165,7 +2161,6 @@ o If neither SROM nor the environment contain a MAC address, an error
is raised. is raised.
Image Formats: Image Formats:
============== ==============
@ -2428,7 +2423,6 @@ corruption happened:
Verifying Checksum ... OK Verifying Checksum ... OK
Boot Linux: Boot Linux:
----------- -----------
@ -2641,7 +2635,6 @@ Hit 'q':
[q, b, e, ?] ## Application terminated, rc = 0x0 [q, b, e, ?] ## Application terminated, rc = 0x0
Minicom warning: Minicom warning:
================ ================
@ -2813,7 +2806,6 @@ On ARM, the following registers are used:
==> U-Boot will use R8 to hold a pointer to the global data ==> U-Boot will use R8 to hold a pointer to the global data
Memory Management: Memory Management:
------------------ ------------------
@ -2959,7 +2951,6 @@ void no_more_time (int sig)
} }
Coding Standards: Coding Standards:
----------------- -----------------

View File

@ -1,3 +1,4 @@
####################################################################### #######################################################################
# #
# Copyright (C) 2000, 2001, 2002, 2003 # Copyright (C) 2000, 2001, 2002, 2003
@ -35,7 +36,7 @@ LIB = lib$(BOARD).a
OBJS = $(BOARD).o flash.o OBJS = $(BOARD).o flash.o
$(LIB): .depend $(OBJS) $(LIB): .depend $(OBJS)
$(AR) crv $@ $^ $(AR) crv $@ $(OBJS)
######################################################################### #########################################################################

View File

@ -123,6 +123,10 @@ SECTIONS
_edata = .; _edata = .;
PROVIDE (edata = .); PROVIDE (edata = .);
__u_boot_cmd_start = .;
.u_boot_cmd : { *(.u_boot_cmd) }
__u_boot_cmd_end = .;
__start___ex_table = .; __start___ex_table = .;
__ex_table : { *(__ex_table) } __ex_table : { *(__ex_table) }
__stop___ex_table = .; __stop___ex_table = .;

View File

@ -137,4 +137,3 @@ SECTIONS
_end = . ; _end = . ;
PROVIDE (end = .); PROVIDE (end = .);
} }

View File

@ -86,7 +86,6 @@ long initdram (int board_type)
} }
void after_reloc (ulong dest_addr, gd_t *gd) void after_reloc (ulong dest_addr, gd_t *gd)
{ {
/* HJF: DECLARE_GLOBAL_DATA_PTR; */ /* HJF: DECLARE_GLOBAL_DATA_PTR; */

View File

@ -134,7 +134,6 @@
#define ARTICIAS_ISAIO_PHYS 0xfe002000 #define ARTICIAS_ISAIO_PHYS 0xfe002000
/* Prototypes */ /* Prototypes */
long articiaS_ram_init(void); long articiaS_ram_init(void);
void articiaS_pci_init(void); void articiaS_pci_init(void);

View File

@ -123,14 +123,14 @@ struct pci_irq_fixup_table fixuptab [] =
{ {
{ 0, 0, 0, 0xff}, /* Articia S host bridge */ { 0, 0, 0, 0xff}, /* Articia S host bridge */
{ 0, 1, 0, 0xff}, /* Articia S AGP bridge */ { 0, 1, 0, 0xff}, /* Articia S AGP bridge */
// { 0, 6, 0, 0x05}, /* 3COM ethernet */ /* { 0, 6, 0, 0x05}, /###* 3COM ethernet */
{ 0, 7, 0, 0xff}, /* VIA southbridge */ { 0, 7, 0, 0xff}, /* VIA southbridge */
{ 0, 7, 1, 0x0e}, /* IDE controller in legacy mode */ { 0, 7, 1, 0x0e}, /* IDE controller in legacy mode */
// { 0, 7, 2, 0x05}, /* First USB controller */ /* { 0, 7, 2, 0x05}, /###* First USB controller */
// { 0, 7, 3, 0x0c}, /* Second USB controller (shares interrupt with ethernet) */ /* { 0, 7, 3, 0x0c}, /###* Second USB controller (shares interrupt with ethernet) */
{ 0, 7, 4, 0xff}, /* ACPI Power Management */ { 0, 7, 4, 0xff}, /* ACPI Power Management */
// { 0, 7, 5, 0x08}, /* AC97 */ /* { 0, 7, 5, 0x08}, /###* AC97 */
// { 0, 7, 6, 0x08}, /* MC97 */ /* { 0, 7, 6, 0x08}, /###* MC97 */
{ 0xff, 0xff, 0xff, 0xff} { 0xff, 0xff, 0xff, 0xff}
}; };
@ -287,7 +287,7 @@ void articiaS_pci_init (void)
PRINTF("atriciaS_pci_init\n"); PRINTF("atriciaS_pci_init\n");
// Why aren't these relocated?? /* Why aren't these relocated?? */
for (i=0; config_table[i].config_device; i++) for (i=0; config_table[i].config_device; i++)
{ {
switch((int)config_table[i].config_device) switch((int)config_table[i].config_device)
@ -335,7 +335,6 @@ void articiaS_pci_init (void)
PCI_REGION_IO); PCI_REGION_IO);
articiaS_hose.region_count = 4; articiaS_hose.region_count = 4;
pci_setup_indirect(&articiaS_hose, ARTICIAS_PCI_CFGADDR, ARTICIAS_PCI_CFGDATA); pci_setup_indirect(&articiaS_hose, ARTICIAS_PCI_CFGADDR, ARTICIAS_PCI_CFGDATA);
@ -410,8 +409,8 @@ pci_dev_t pci_hose_find_class(struct pci_controller *hose, int bus, short find_c
pci_hose_read_config_byte(hose, dev, 0x0B, &c1); pci_hose_read_config_byte(hose, dev, 0x0B, &c1);
pci_hose_read_config_byte(hose, dev, 0x0A, &c2); pci_hose_read_config_byte(hose, dev, 0x0A, &c2);
class = c1<<8 | c2; class = c1<<8 | c2;
//printf("At %02x:%02x:%02x: class %x\n", /*printf("At %02x:%02x:%02x: class %x\n", */
// PCI_BUS(dev), PCI_DEV(dev), PCI_FUNC(dev), class); /* PCI_BUS(dev), PCI_DEV(dev), PCI_FUNC(dev), class); */
if (class == find_class) if (class == find_class)
{ {
if (index == 0) if (index == 0)
@ -441,7 +440,7 @@ pci_dev_t pci_find_bridge_for_bus(struct pci_controller *hose, int busnr)
if (hose == NULL) hose = &articiaS_hose; if (hose == NULL) hose = &articiaS_hose;
if (busnr < hose->first_busno || busnr > hose->last_busno) return PCI_ANY_ID; // Not in range if (busnr < hose->first_busno || busnr > hose->last_busno) return PCI_ANY_ID; /* Not in range */
/* /*
* The bridge must be on a lower bus number * The bridge must be on a lower bus number
@ -467,7 +466,7 @@ pci_dev_t pci_find_bridge_for_bus(struct pci_controller *hose, int busnr)
if (!PCI_FUNC(dev)) if (!PCI_FUNC(dev))
found_multi = header_type & 0x80; found_multi = header_type & 0x80;
if (header_type == 1) // Bridge device header if (header_type == 1) /* Bridge device header */
{ {
pci_hose_read_config_byte(hose, dev, PCI_SECONDARY_BUS, &secondary_bus); pci_hose_read_config_byte(hose, dev, PCI_SECONDARY_BUS, &secondary_bus);
if ((int)secondary_bus == busnr) return dev; if ((int)secondary_bus == busnr) return dev;

View File

@ -1,5 +1,4 @@
#include "macros.h" #include "macros.h"
#define GLOBALINFO0 0x50 #define GLOBALINFO0 0x50

View File

@ -1,6 +1,5 @@
#include <common.h> #include <common.h>
#include <command.h> #include <command.h>
#include <cmd_boota.h>
#include "../disk/part_amiga.h" #include "../disk/part_amiga.h"
#include <asm/cache.h> #include <asm/cache.h>
@ -121,3 +120,10 @@ int do_boota (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
return 0; return 0;
} }
#if defined(CONFIG_AMIGAONEG3SE) && (CONFIG_COMMANDS & CFG_CMD_BSP)
cmd_tbl_t U_BOOT_CMD(BOOTA) = MK_CMD_ENTRY(
"boota", 3, 1, do_boota,
"boota - boot an Amiga kernel\n",
"address disk"
);
#endif /* _CMD_BOOTA_H */

View File

@ -30,4 +30,3 @@ X86EMU = -I../bios_emulator/scitech/include -I../bios_emulator/scitech/src/x86e
TEXT_BASE = 0xfff00000 TEXT_BASE = 0xfff00000
PLATFORM_CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE) -Wa,-mregnames -DEASTEREGG $(X86EMU) -Dprintk=printf #-DDEBUG PLATFORM_CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE) -Wa,-mregnames -DEASTEREGG $(X86EMU) -Dprintk=printf #-DDEBUG

View File

@ -36,7 +36,7 @@
/* 3Com Ethernet PCI definitions*/ /* 3Com Ethernet PCI definitions*/
// #define PCI_VENDOR_ID_3COM 0x10B7 /* #define PCI_VENDOR_ID_3COM 0x10B7 */
#define PCI_DEVICE_ID_3COM_3C905C 0x9200 #define PCI_DEVICE_ID_3COM_3C905C 0x9200
/* 3Com Commands, top 5 bits are command and bottom 11 bits are parameters */ /* 3Com Commands, top 5 bits are command and bottom 11 bits are parameters */
@ -353,7 +353,7 @@ static int issue_and_wait(struct eth_device* dev, int command)
ETH_CMD(dev, command); ETH_CMD(dev, command);
for (i = 0; i < 2000; i++) { for (i = 0; i < 2000; i++) {
status = ETH_STATUS(dev); status = ETH_STATUS(dev);
//printf ("Issue: status 0x%4x.\n", status); /*printf ("Issue: status 0x%4x.\n", status); */
if (!(status & CmdInProgress)) if (!(status & CmdInProgress))
return 1; return 1;
} }
@ -361,7 +361,7 @@ static int issue_and_wait(struct eth_device* dev, int command)
/* OK, that didn't work. Do it the slow way. One second */ /* OK, that didn't work. Do it the slow way. One second */
for (i = 0; i < 100000; i++) { for (i = 0; i < 100000; i++) {
status = ETH_STATUS(dev); status = ETH_STATUS(dev);
//printf ("Issue: status 0x%4x.\n", status); /*printf ("Issue: status 0x%4x.\n", status); */
return 1; return 1;
udelay(10); udelay(10);
} }
@ -378,7 +378,7 @@ static int auto_negotiate(struct eth_device* dev)
EL3WINDOW(dev, 1); EL3WINDOW(dev, 1);
// Wait for Auto negotiation to complete /* Wait for Auto negotiation to complete */
for (i = 0; i <= 1000; i++) for (i = 0; i <= 1000; i++)
{ {
if (ETH_INW(dev, 2) & 0x04) if (ETH_INW(dev, 2) & 0x04)
@ -393,7 +393,6 @@ static int auto_negotiate(struct eth_device* dev)
} }
return 1; return 1;
} }
@ -481,7 +480,7 @@ int eth_3com_initialize(bd_t *bis)
goto Done; goto Done;
} }
dev = (struct eth_device*) malloc(sizeof(*dev)); //struct eth_device)); dev = (struct eth_device*) malloc(sizeof(*dev)); /*struct eth_device)); */
sprintf(dev->name, "3Com 3c920c#%d", card_number); sprintf(dev->name, "3Com 3c920c#%d", card_number);
dev->iobase = eth_iobase; dev->iobase = eth_iobase;
@ -583,7 +582,7 @@ static int eth_3com_init(struct eth_device* dev, bd_t *bis)
/* Below sets no bits are to cause an interrupt since this is just polling */ /* Below sets no bits are to cause an interrupt since this is just polling */
intr_enable = SetIntrEnb; intr_enable = SetIntrEnb;
// intr_enable = SetIntrEnb | (1<<9) | (1<<10) | (1<<6); /* intr_enable = SetIntrEnb | (1<<9) | (1<<10) | (1<<6); */
ETH_CMD(dev, intr_enable); ETH_CMD(dev, intr_enable);
ETH_OUTB(dev, 127, UpPoll); ETH_OUTB(dev, 127, UpPoll);
@ -758,8 +757,8 @@ void eth_3com_halt(struct eth_device* dev)
issue_and_wait(dev, RxDisable); issue_and_wait(dev, RxDisable);
issue_and_wait(dev, TxDisable); issue_and_wait(dev, TxDisable);
// free(tx_ring); /* release memory allocated to the DPD and UPD rings */ /* free(tx_ring); /###* release memory allocated to the DPD and UPD rings */
// free(rx_ring); /* free(rx_ring); */
Done: Done:
return; return;
@ -883,4 +882,3 @@ static void read_hw_addr(struct eth_device* dev, bd_t *bis)
Done: Done:
return; return;
} }

View File

@ -31,7 +31,6 @@
/*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/
#undef DEBUG_FLASH #undef DEBUG_FLASH
//#define DEBUG_FLASH
#ifdef DEBUG_FLASH #ifdef DEBUG_FLASH
#define DEBUGF(fmt,args...) printf(fmt ,##args) #define DEBUGF(fmt,args...) printf(fmt ,##args)

View File

@ -75,16 +75,16 @@ void i8259_init(void)
char dummy; char dummy;
PRINTF("Initializing Interrupt controller\n"); PRINTF("Initializing Interrupt controller\n");
/* init master interrupt controller */ /* init master interrupt controller */
out8(0x20, 0x11); //0x19); // was: 0x11); /* Start init sequence */ out8(0x20, 0x11); /* 0x19); /###* Start init sequence */
out8(0x21, 0x00); /* Vector base */ out8(0x21, 0x00); /* Vector base */
out8(0x21, 0x04); /* edge tiggered, Cascade (slave) on IRQ2 */ out8(0x21, 0x04); /* edge tiggered, Cascade (slave) on IRQ2 */
out8(0x21, 0x11); // was: 0x01); /* Select 8086 mode */ out8(0x21, 0x11); /* was: 0x01); /###* Select 8086 mode */
/* init slave interrupt controller */ /* init slave interrupt controller */
out8(0xA0, 0x11); //0x19); // was: 0x11); /* Start init sequence */ out8(0xA0, 0x11); /* 0x19); /###* Start init sequence */
out8(0xA1, 0x08); /* Vector base */ out8(0xA1, 0x08); /* Vector base */
out8(0xA1, 0x02); /* edge triggered, Cascade (slave) on IRQ2 */ out8(0xA1, 0x02); /* edge triggered, Cascade (slave) on IRQ2 */
out8(0xA1, 0x11); // was: 0x01); /* Select 8086 mode */ out8(0xA1, 0x11); /* was: 0x01); /###* Select 8086 mode */
/* always read ISR */ /* always read ISR */
out8(0x20, 0x0B); out8(0x20, 0x0B);

View File

@ -167,8 +167,8 @@ external_interrupt(struct pt_regs *regs)
int irq, unmask = 1; int irq, unmask = 1;
irq = i8259_irq(); //i8259_get_irq(regs); irq = i8259_irq(); /*i8259_get_irq(regs); */
// printf("irq = %d, handler at %p ack=%d\n", irq, irq_handlers[irq].handler, *(volatile unsigned char *)0xFEF00000); /* printf("irq = %d, handler at %p ack=%d\n", irq, irq_handlers[irq].handler, *(volatile unsigned char *)0xFEF00000); */
i8259_mask_and_ack(irq); i8259_mask_and_ack(irq);
if (irq_handlers[irq].handler != NULL) if (irq_handlers[irq].handler != NULL)
@ -264,5 +264,3 @@ do_irqinfo(cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[])
{ {
puts("IRQ related functions are unimplemented currently.\n"); puts("IRQ related functions are unimplemented currently.\n");
} }

View File

@ -1,7 +1,6 @@
#include "macros.h" #include "macros.h"
.globl pci_read_cfg_byte .globl pci_read_cfg_byte
pci_read_cfg_byte: pci_read_cfg_byte:
@ -13,7 +12,6 @@ pci_read_cfg_byte:
blr blr
.globl pci_write_cfg_byte .globl pci_write_cfg_byte
pci_write_cfg_byte: pci_write_cfg_byte:
@ -25,7 +23,6 @@ pci_write_cfg_byte:
blr blr
.globl pci_read_cfg_word .globl pci_read_cfg_word
pci_read_cfg_word: pci_read_cfg_word:
@ -37,7 +34,6 @@ pci_read_cfg_word:
blr blr
.globl pci_write_cfg_word .globl pci_write_cfg_word
pci_write_cfg_word: pci_write_cfg_word:
@ -49,7 +45,6 @@ pci_write_cfg_word:
blr blr
.globl pci_read_cfg_long .globl pci_read_cfg_long
pci_read_cfg_long: pci_read_cfg_long:
@ -61,7 +56,6 @@ pci_read_cfg_long:
blr blr
.globl pci_write_cfg_long .globl pci_write_cfg_long
pci_write_cfg_long: pci_write_cfg_long:
@ -71,4 +65,3 @@ pci_write_cfg_long:
eieio eieio
sync sync
blr blr

View File

@ -34,4 +34,3 @@ void disable_nvram(void)
{ {
pci_write_cfg_byte(0, 0, 0x56, 0x0); pci_write_cfg_byte(0, 0, 0x56, 0x0);
} }

View File

@ -48,7 +48,6 @@ void i8259_unmask_irq(unsigned int irq);
#undef KBG_DEBUG #undef KBG_DEBUG
//#define KBG_DEBUG
#ifdef KBG_DEBUG #ifdef KBG_DEBUG
#define PRINTF(fmt,args...) printf (fmt ,##args) #define PRINTF(fmt,args...) printf (fmt ,##args)
@ -143,8 +142,6 @@ void i8259_unmask_irq(unsigned int irq);
#define KBD_BUFFER_LEN 0x20 /* size of the keyboardbuffer */ #define KBD_BUFFER_LEN 0x20 /* size of the keyboardbuffer */
static volatile char kbd_buffer[KBD_BUFFER_LEN]; static volatile char kbd_buffer[KBD_BUFFER_LEN];
static volatile int in_pointer = 0; static volatile int in_pointer = 0;
static volatile int out_pointer = 0; static volatile int out_pointer = 0;
@ -494,7 +491,6 @@ unsigned char handle_kbd_event(void)
} }
/****************************************************************************** /******************************************************************************
* Lowlevel Part of keyboard section * Lowlevel Part of keyboard section
*/ */
@ -692,8 +688,3 @@ void kbd_interrupt(void)
{ {
handle_kbd_event(); handle_kbd_event();
} }
/* eof */

View File

@ -106,36 +106,36 @@ void sm_send_stop(void)
int sm_read_byte_from_device(uint8 addr, uint8 reg, uint8 *storage) int sm_read_byte_from_device(uint8 addr, uint8 reg, uint8 *storage)
{ {
// S Addr Wr /* S Addr Wr */
sm_write_mode(); sm_write_mode();
sm_send_start(); sm_send_start();
sm_write_byte((addr<<1)); sm_write_byte((addr<<1));
// [A] /* [A] */
sm_read_mode(); sm_read_mode();
if (sm_get_ack() == FALSE) return FALSE; if (sm_get_ack() == FALSE) return FALSE;
// Comm /* Comm */
sm_write_mode(); sm_write_mode();
sm_write_byte(reg); sm_write_byte(reg);
// [A] /* [A] */
sm_read_mode(); sm_read_mode();
if (sm_get_ack() == FALSE) return FALSE; if (sm_get_ack() == FALSE) return FALSE;
// S Addr Rd /* S Addr Rd */
sm_write_mode(); sm_write_mode();
sm_send_start(); sm_send_start();
sm_write_byte((addr<<1)|1); sm_write_byte((addr<<1)|1);
// [A] /* [A] */
sm_read_mode(); sm_read_mode();
if (sm_get_ack() == FALSE) return FALSE; if (sm_get_ack() == FALSE) return FALSE;
// [Data] /* [Data] */
*storage = sm_read_byte(); *storage = sm_read_byte();
// NA /* NA */
sm_write_mode(); sm_write_mode();
sm_write_nack(); sm_write_nack();
sm_send_stop(); sm_send_stop();

View File

@ -148,7 +148,6 @@
/*--------------------------------------------------------------*/ /*--------------------------------------------------------------*/
/*--------------------------------------------------------------*/ /*--------------------------------------------------------------*/
/* END TERON Articia / SDRAM Initialization code */ /* END TERON Articia / SDRAM Initialization code */
/*--------------------------------------------------------------*/ /*--------------------------------------------------------------*/
@ -197,5 +196,3 @@ write dmem 0xfee00cfc 0x00003280
write dmem 0xfec00cf8 0xc4000080 write dmem 0xfec00cf8 0xc4000080
write dmem 0xfee00cfc 0x00003290 write dmem 0xfee00cfc 0x00003290

View File

@ -108,6 +108,11 @@ SECTIONS
_edata = .; _edata = .;
PROVIDE (edata = .); PROVIDE (edata = .);
__u_boot_cmd_start = .;
.u_boot_cmd : { *(.u_boot_cmd) }
__u_boot_cmd_end = .;
__start___ex_table = .; __start___ex_table = .;
__ex_table : { *(__ex_table) } __ex_table : { *(__ex_table) }
__stop___ex_table = .; __stop___ex_table = .;

View File

@ -83,7 +83,7 @@
#define USB_MAX_TEMP_INT_TD 32 /* number of temporary TDs for Interrupt transfers */ #define USB_MAX_TEMP_INT_TD 32 /* number of temporary TDs for Interrupt transfers */
//#define USB_UHCI_DEBUG /*#define USB_UHCI_DEBUG */
#ifdef USB_UHCI_DEBUG #ifdef USB_UHCI_DEBUG
#define USB_UHCI_PRINTF(fmt,args...) printf (fmt ,##args) #define USB_UHCI_PRINTF(fmt,args...) printf (fmt ,##args)
@ -1115,7 +1115,6 @@ static void usb_display_wValue(unsigned short wValue,unsigned short wIndex)
#endif #endif
#ifdef USB_UHCI_DEBUG #ifdef USB_UHCI_DEBUG
static int usb_display_td(uhci_td_t *td) static int usb_display_td(uhci_td_t *td)

View File

@ -190,5 +190,3 @@ struct virt_root_hub {
#endif /* _USB_UHCI_H_ */ #endif /* _USB_UHCI_H_ */

View File

@ -129,11 +129,11 @@ int drv_video_init(void)
int video_init(void) int video_init(void)
{ {
cursor_position = VIDEO_BASE; // Color text display base cursor_position = VIDEO_BASE; /* Color text display base */
cursor_row = 0; cursor_row = 0;
cursor_col = 0; cursor_col = 0;
current_attr = video_get_attr(); // Currently selected value for attribute. current_attr = video_get_attr(); /* Currently selected value for attribute. */
// video_test(); /* video_test(); */
video_set_color(current_attr); video_set_color(current_attr);
return 0; return 0;
@ -328,7 +328,7 @@ void video_draw_box(int style, int attr, char *title, int separate, int x, int y
*(fb2+1) = attr; fb2 += 2*VIDEO_COLS; *(fb2+1) = attr; fb2 += 2*VIDEO_COLS;
} }
// Draw title /* Draw title */
if (title) if (title)
{ {
if (separate == 0) if (separate == 0)

View File

@ -130,14 +130,14 @@ static void X86API int1A(int intno)
switch(M.x86.R_AX) switch(M.x86.R_AX)
{ {
case 0xB101: // PCI Bios Present? case 0xB101: /* PCI Bios Present? */
M.x86.R_AL = 0x00; M.x86.R_AL = 0x00;
M.x86.R_EDX = 0x20494350; M.x86.R_EDX = 0x20494350;
M.x86.R_BX = 0x0210; M.x86.R_BX = 0x0210;
M.x86.R_CL = 3; M.x86.R_CL = 3;
CLEAR_FLAG(F_CF); CLEAR_FLAG(F_CF);
break; break;
case 0xB102: // Find device case 0xB102: /* Find device */
device = mypci_find_device(M.x86.R_DX, M.x86.R_CX, M.x86.R_SI); device = mypci_find_device(M.x86.R_DX, M.x86.R_CX, M.x86.R_SI);
if (device != -1) if (device != -1)
{ {
@ -151,52 +151,52 @@ static void X86API int1A(int intno)
} }
CONDITIONAL_SET_FLAG((M.x86.R_AH != PCIBIOS_SUCCESSFUL), F_CF); CONDITIONAL_SET_FLAG((M.x86.R_AH != PCIBIOS_SUCCESSFUL), F_CF);
break; break;
case 0xB103: // Find PCI class code case 0xB103: /* Find PCI class code */
M.x86.R_AH = PCIBIOS_DEVICE_NOT_FOUND; M.x86.R_AH = PCIBIOS_DEVICE_NOT_FOUND;
//printf("Find by class not yet implmented"); /*printf("Find by class not yet implmented"); */
CONDITIONAL_SET_FLAG((M.x86.R_AH != PCIBIOS_SUCCESSFUL), F_CF); CONDITIONAL_SET_FLAG((M.x86.R_AH != PCIBIOS_SUCCESSFUL), F_CF);
break; break;
case 0xB108: // read config byte case 0xB108: /* read config byte */
M.x86.R_CL = mypci_read_cfg_byte(M.x86.R_BH, M.x86.R_BL, M.x86.R_DI); M.x86.R_CL = mypci_read_cfg_byte(M.x86.R_BH, M.x86.R_BL, M.x86.R_DI);
M.x86.R_AH = PCIBIOS_SUCCESSFUL; M.x86.R_AH = PCIBIOS_SUCCESSFUL;
CONDITIONAL_SET_FLAG((M.x86.R_AH != PCIBIOS_SUCCESSFUL), F_CF); CONDITIONAL_SET_FLAG((M.x86.R_AH != PCIBIOS_SUCCESSFUL), F_CF);
//printf("read_config_byte %x,%x,%x -> %x\n", M.x86.R_BH, M.x86.R_BL, M.x86.R_DI, /*printf("read_config_byte %x,%x,%x -> %x\n", M.x86.R_BH, M.x86.R_BL, M.x86.R_DI, */
// M.x86.R_CL); /* M.x86.R_CL); */
break; break;
case 0xB109: // read config word case 0xB109: /* read config word */
M.x86.R_CX = mypci_read_cfg_word(M.x86.R_BH, M.x86.R_BL, M.x86.R_DI); M.x86.R_CX = mypci_read_cfg_word(M.x86.R_BH, M.x86.R_BL, M.x86.R_DI);
M.x86.R_AH = PCIBIOS_SUCCESSFUL; M.x86.R_AH = PCIBIOS_SUCCESSFUL;
CONDITIONAL_SET_FLAG((M.x86.R_AH != PCIBIOS_SUCCESSFUL), F_CF); CONDITIONAL_SET_FLAG((M.x86.R_AH != PCIBIOS_SUCCESSFUL), F_CF);
//printf("read_config_word %x,%x,%x -> %x\n", M.x86.R_BH, M.x86.R_BL, M.x86.R_DI, /*printf("read_config_word %x,%x,%x -> %x\n", M.x86.R_BH, M.x86.R_BL, M.x86.R_DI, */
// M.x86.R_CX); /* M.x86.R_CX); */
break; break;
case 0xB10A: // read config dword case 0xB10A: /* read config dword */
M.x86.R_ECX = mypci_read_cfg_long(M.x86.R_BH, M.x86.R_BL, M.x86.R_DI); M.x86.R_ECX = mypci_read_cfg_long(M.x86.R_BH, M.x86.R_BL, M.x86.R_DI);
M.x86.R_AH = PCIBIOS_SUCCESSFUL; M.x86.R_AH = PCIBIOS_SUCCESSFUL;
CONDITIONAL_SET_FLAG((M.x86.R_AH != PCIBIOS_SUCCESSFUL), F_CF); CONDITIONAL_SET_FLAG((M.x86.R_AH != PCIBIOS_SUCCESSFUL), F_CF);
//printf("read_config_long %x,%x,%x -> %x\n", M.x86.R_BH, M.x86.R_BL, M.x86.R_DI, /*printf("read_config_long %x,%x,%x -> %x\n", M.x86.R_BH, M.x86.R_BL, M.x86.R_DI, */
// M.x86.R_ECX); /* M.x86.R_ECX); */
break; break;
case 0xB10B: // write config byte case 0xB10B: /* write config byte */
mypci_write_cfg_byte(M.x86.R_BH, M.x86.R_BL, M.x86.R_DI, M.x86.R_CL); mypci_write_cfg_byte(M.x86.R_BH, M.x86.R_BL, M.x86.R_DI, M.x86.R_CL);
M.x86.R_AH = PCIBIOS_SUCCESSFUL; M.x86.R_AH = PCIBIOS_SUCCESSFUL;
CONDITIONAL_SET_FLAG((M.x86.R_AH != PCIBIOS_SUCCESSFUL), F_CF); CONDITIONAL_SET_FLAG((M.x86.R_AH != PCIBIOS_SUCCESSFUL), F_CF);
//printf("write_config_byte %x,%x,%x <- %x\n", M.x86.R_BH, M.x86.R_BL, M.x86.R_DI, /*printf("write_config_byte %x,%x,%x <- %x\n", M.x86.R_BH, M.x86.R_BL, M.x86.R_DI, */
// M.x86.R_CL); /* M.x86.R_CL); */
break; break;
case 0xB10C: // write config word case 0xB10C: /* write config word */
mypci_write_cfg_word(M.x86.R_BH, M.x86.R_BL, M.x86.R_DI, M.x86.R_CX); mypci_write_cfg_word(M.x86.R_BH, M.x86.R_BL, M.x86.R_DI, M.x86.R_CX);
M.x86.R_AH = PCIBIOS_SUCCESSFUL; M.x86.R_AH = PCIBIOS_SUCCESSFUL;
CONDITIONAL_SET_FLAG((M.x86.R_AH != PCIBIOS_SUCCESSFUL), F_CF); CONDITIONAL_SET_FLAG((M.x86.R_AH != PCIBIOS_SUCCESSFUL), F_CF);
//printf("write_config_word %x,%x,%x <- %x\n", M.x86.R_BH, M.x86.R_BL, M.x86.R_DI, /*printf("write_config_word %x,%x,%x <- %x\n", M.x86.R_BH, M.x86.R_BL, M.x86.R_DI, */
// M.x86.R_CX); /* M.x86.R_CX); */
break; break;
case 0xB10D: // write config dword case 0xB10D: /* write config dword */
mypci_write_cfg_long(M.x86.R_BH, M.x86.R_BL, M.x86.R_DI, M.x86.R_ECX); mypci_write_cfg_long(M.x86.R_BH, M.x86.R_BL, M.x86.R_DI, M.x86.R_ECX);
M.x86.R_AH = PCIBIOS_SUCCESSFUL; M.x86.R_AH = PCIBIOS_SUCCESSFUL;
CONDITIONAL_SET_FLAG((M.x86.R_AH != PCIBIOS_SUCCESSFUL), F_CF); CONDITIONAL_SET_FLAG((M.x86.R_AH != PCIBIOS_SUCCESSFUL), F_CF);
//printf("write_config_long %x,%x,%x <- %x\n", M.x86.R_BH, M.x86.R_BL, M.x86.R_DI, /*printf("write_config_long %x,%x,%x <- %x\n", M.x86.R_BH, M.x86.R_BL, M.x86.R_DI, */
// M.x86.R_ECX); /* M.x86.R_ECX); */
break; break;
default: default:
PRINTF("BIOS int %xh: Unknown function AX=%04xh\n", intno, M.x86.R_AX); PRINTF("BIOS int %xh: Unknown function AX=%04xh\n", intno, M.x86.R_AX);
@ -252,14 +252,14 @@ unsigned char setup_bw[] =
unsigned char * setup_modes[] = unsigned char * setup_modes[] =
{ {
setup_40x25, // mode 0: 40x25 bw text setup_40x25, /* mode 0: 40x25 bw text */
setup_40x25, // mode 1: 40x25 col text setup_40x25, /* mode 1: 40x25 col text */
setup_80x25, // mode 2: 80x25 bw text setup_80x25, /* mode 2: 80x25 bw text */
setup_80x25, // mode 3: 80x25 col text setup_80x25, /* mode 3: 80x25 col text */
setup_graphics, // mode 4: 320x200 col graphics setup_graphics, /* mode 4: 320x200 col graphics */
setup_graphics, // mode 5: 320x200 bw graphics setup_graphics, /* mode 5: 320x200 bw graphics */
setup_graphics, // mode 6: 640x200 bw graphics setup_graphics, /* mode 6: 640x200 bw graphics */
setup_bw // mode 7: 80x25 mono text setup_bw /* mode 7: 80x25 mono text */
}; };
unsigned int setup_cols[] = unsigned int setup_cols[] =
@ -280,13 +280,13 @@ unsigned int setup_bufsize[] =
void bios_set_mode(int mode) void bios_set_mode(int mode)
{ {
int i; int i;
unsigned char mode_set = setup_modesets[mode]; // Control register value unsigned char mode_set = setup_modesets[mode]; /* Control register value */
unsigned char *setup_regs = setup_modes[mode]; // Register 3D4 Array unsigned char *setup_regs = setup_modes[mode]; /* Register 3D4 Array */
// Switch video off /* Switch video off */
out_byte(0x3D8, mode_set & 0x37); out_byte(0x3D8, mode_set & 0x37);
// Set up parameters at 3D4h /* Set up parameters at 3D4h */
for (i=0; i<16; i++) for (i=0; i<16; i++)
{ {
out_byte(0x3D4, (unsigned char)i); out_byte(0x3D4, (unsigned char)i);
@ -294,10 +294,10 @@ void bios_set_mode(int mode)
setup_regs++; setup_regs++;
} }
// Enable video /* Enable video */
out_byte(0x3D8, mode_set); out_byte(0x3D8, mode_set);
// Set overscan /* Set overscan */
if (mode == 6) out_byte(0x3D9, 0x3F); if (mode == 6) out_byte(0x3D9, 0x3F);
else out_byte(0x3D9, 0x30); else out_byte(0x3D9, 0x30);
} }

View File

@ -401,7 +401,7 @@ int find_image(u32 rom_address, u32 rom_size, void **image, u32 *image_size)
{ {
int i = 0; int i = 0;
unsigned char *rom = (unsigned char *)rom_address; unsigned char *rom = (unsigned char *)rom_address;
/* if (*rom != 0x55 || *(rom+1) != 0xAA) return 0; // No bios rom this is, yes. */ /* if (*rom != 0x55 || *(rom+1) != 0xAA) return 0; /* No bios rom this is, yes. */ */
for (;;) for (;;)
{ {
@ -479,7 +479,6 @@ void show_bat_mapping(void)
} }
void remove_init_data(void) void remove_init_data(void)
{ {
char *s; char *s;

View File

@ -152,4 +152,3 @@ void PMAPI BE_exit(void);
#endif #endif
#endif /* __BIOSEMU_H */ #endif /* __BIOSEMU_H */

View File

@ -411,4 +411,3 @@ ulong _ASMAPI PCIBIOS_getEntry(void);
#endif #endif
#endif /* __PCILIB_H */ #endif /* __PCILIB_H */

View File

@ -164,4 +164,3 @@ typedef enum {
#endif /* !__OS2__ */ #endif /* !__OS2__ */
#endif /* __PMHELP_H */ #endif /* __PMHELP_H */

View File

@ -73,4 +73,3 @@ PMHELP_CTL_CODE(GASETLOCALPATH ,0x002D),
PMHELP_CTL_CODE(GAGETEXPORTS ,0x002E), PMHELP_CTL_CODE(GAGETEXPORTS ,0x002E),
PMHELP_CTL_CODE(GATHUNK ,0x002F), PMHELP_CTL_CODE(GATHUNK ,0x002F),
PMHELP_CTL_CODE(SETNUCLEUSPATH ,0x0030), PMHELP_CTL_CODE(SETNUCLEUSPATH ,0x0030),

View File

@ -1146,4 +1146,3 @@ int PMAPI PM_int386x(int intno, PMREGS *in, PMREGS *out,PMSREGS *sregs);
#endif #endif
#endif /* __PMAPI_H */ #endif /* __PMAPI_H */

View File

@ -191,4 +191,3 @@ PM_imports _VARAPI _PM_imports = {
NULL, NULL,
#endif #endif
}; };

View File

@ -80,7 +80,7 @@
#ifdef __GNUC__ #ifdef __GNUC__
#ifdef __cplusplus #ifdef __cplusplus
// G++ currently fucks this up! /* G++ currently fucks this up! */
#define __cdecl #define __cdecl
#define __stdcall #define __stdcall
#else #else
@ -636,10 +636,10 @@ void _ASMAPI DebugVxD(void);
/* Get rid of some helaciously annoying Visual C++ warnings! */ /* Get rid of some helaciously annoying Visual C++ warnings! */
#if defined(_MSC_VER) && !defined(__MWERKS__) && !defined(__SC__) #if defined(_MSC_VER) && !defined(__MWERKS__) && !defined(__SC__)
#pragma warning(disable:4761) // integral size mismatch in argument; conversion supplied #pragma warning(disable:4761) /* integral size mismatch in argument; conversion supplied */
#pragma warning(disable:4244) // conversion from 'unsigned short ' to 'unsigned char ', possible loss of data #pragma warning(disable:4244) /* conversion from 'unsigned short ' to 'unsigned char ', possible loss of data */
#pragma warning(disable:4018) // '<' : signed/unsigned mismatch #pragma warning(disable:4018) /* '<' : signed/unsigned mismatch */
#pragma warning(disable:4305) // 'initializing' : truncation from 'const double' to 'float' #pragma warning(disable:4305) /* 'initializing' : truncation from 'const double' to 'float' */
#endif #endif
/*--------------------------------------------------------------------------- /*---------------------------------------------------------------------------

View File

@ -322,7 +322,7 @@ extern X86EMU_sysEnv _X86EMU_env;
/* Function to log information at runtime */ /* Function to log information at runtime */
//void printk(const char *fmt, ...); /*void printk(const char *fmt, ...); */
#ifdef __cplusplus #ifdef __cplusplus
} /* End of "C" linkage for C++ */ } /* End of "C" linkage for C++ */

View File

@ -178,4 +178,3 @@ ASFLAGS += -d__SNAP__
# Include file dependencies # Include file dependencies
.INCLUDE .IGNORE: "makefile.dep" .INCLUDE .IGNORE: "makefile.dep"

View File

@ -178,4 +178,3 @@ PMLIB := -lpm
# Define which file contains our rules # Define which file contains our rules
RULES_MAK := gcc_linux.mk RULES_MAK := gcc_linux.mk

View File

@ -133,4 +133,3 @@ PMLIB := -lpm
# Define which file contains our rules # Define which file contains our rules
RULES_MAK := gcc_win32.mk RULES_MAK := gcc_win32.mk

View File

@ -162,4 +162,3 @@ PMLIB := -lpm
# Define which file contains our rules # Define which file contains our rules
RULES_MAK := qnx4.mk RULES_MAK := qnx4.mk

View File

@ -45,4 +45,3 @@ PMLIB :=
# Implicit rule for building an executable file # Implicit rule for building an executable file
%$E: ; $(LD) $(LDFLAGS) -o $@ $& $(EXELIBS) $(PMLIB) %$E: ; $(LD) $(LDFLAGS) -o $@ $& $(EXELIBS) $(PMLIB)

View File

@ -91,4 +91,3 @@ LD := $(LDXX)
@$(ECHO) ld $@ @$(ECHO) ld $@
@$(LD) $(LDFLAGS) -o $@ $& $(EXELIBS) $(PMLIB) -lm @$(LD) $(LDFLAGS) -o $@ $& $(EXELIBS) $(PMLIB) -lm
.ENDIF .ENDIF

View File

@ -88,4 +88,3 @@ LD := $(LDXX)
@$(ECHO) ld $@ @$(ECHO) ld $@
@$(LD) $(LDFLAGS) -o $@ @$(mktmp $(&:s/\/\\) $(EXELIBS) $(PMLIB) -lm) @$(LD) $(LDFLAGS) -o $@ @$(mktmp $(&:s/\/\\) $(EXELIBS) $(PMLIB) -lm)
.ENDIF .ENDIF

View File

@ -262,4 +262,3 @@ dllstart.obj: dllstart.asm
@$(RM) -S $(mktmp *.lnk) @$(RM) -S $(mktmp *.lnk)
.ENDIF .ENDIF
.ENDIF .ENDIF

View File

@ -159,4 +159,3 @@ __.SILENT := $(.SILENT)
# We dont use TABS in our makefiles # We dont use TABS in our makefiles
.NOTABS := yes .NOTABS := yes

View File

@ -351,4 +351,3 @@ LIB_BASE_DIR := $(SCITECH_LIB)\lib\release
# Define which file contains our rules # Define which file contains our rules
RULES_MAK := wc32.mk RULES_MAK := wc32.mk

View File

@ -431,13 +431,13 @@ BE_exports * _CEXPORT BE_initLibrary(
int i,max; int i,max;
ulong *p; ulong *p;
// Initialize all default imports to point to fatal error handler /* Initialize all default imports to point to fatal error handler */
// for upwards compatibility. /* for upwards compatibility. */
max = sizeof(_PM_imports)/sizeof(BE_initLibrary_t); max = sizeof(_PM_imports)/sizeof(BE_initLibrary_t);
for (i = 0,p = (ulong*)&_PM_imports; i < max; i++) for (i = 0,p = (ulong*)&_PM_imports; i < max; i++)
*p++ = (ulong)_PM_fatalErrorHandler; *p++ = (ulong)_PM_fatalErrorHandler;
// Now copy all our imported functions /* Now copy all our imported functions */
memcpy(&_PM_imports,pmImp,MIN(sizeof(_PM_imports),pmImp->dwSize)); memcpy(&_PM_imports,pmImp,MIN(sizeof(_PM_imports),pmImp->dwSize));
return &_BE_exports; return &_BE_exports;
} }

View File

@ -165,27 +165,27 @@ static void PCI_doBIOSPOST(
RMREGS regs; RMREGS regs;
RMSREGS sregs; RMSREGS sregs;
// Determine the value to store in AX for BIOS POST /* Determine the value to store in AX for BIOS POST */
regs.x.ax = (u16)(PCI[DeviceIndex[device]].slot.i >> 8); regs.x.ax = (u16)(PCI[DeviceIndex[device]].slot.i >> 8);
if (useV86) { if (useV86) {
// Post the BIOS using the PM functions (ie: v86 mode on Linux) /* Post the BIOS using the PM functions (ie: v86 mode on Linux) */
if (!PM_doBIOSPOST(regs.x.ax,BIOSPhysAddr,mappedBIOS,BIOSLen)) { if (!PM_doBIOSPOST(regs.x.ax,BIOSPhysAddr,mappedBIOS,BIOSLen)) {
// If the PM function fails, this probably means are we are on /* If the PM function fails, this probably means are we are on */
// DOS and can't re-map the real mode 0xC0000 region. In thise /* DOS and can't re-map the real mode 0xC0000 region. In thise */
// case if the device is the primary, we can use the real /* case if the device is the primary, we can use the real */
// BIOS at 0xC0000 directly. /* BIOS at 0xC0000 directly. */
if (device == 0) if (device == 0)
PM_doBIOSPOST(regs.x.ax,0xC0000,mappedBIOS,BIOSLen); PM_doBIOSPOST(regs.x.ax,0xC0000,mappedBIOS,BIOSLen);
} }
} }
else { else {
// Setup the X86 emulator for the VGA BIOS /* Setup the X86 emulator for the VGA BIOS */
BE_setVGA(&VGAInfo[device]); BE_setVGA(&VGAInfo[device]);
// Execute the BIOS POST code /* Execute the BIOS POST code */
BE_callRealMode(0xC000,0x0003,&regs,&sregs); BE_callRealMode(0xC000,0x0003,&regs,&sregs);
// Cleanup and exit /* Cleanup and exit */
BE_getVGA(&VGAInfo[device]); BE_getVGA(&VGAInfo[device]);
} }
} }
@ -206,34 +206,34 @@ static ibool PCI_postControllers(void)
char filename[_MAX_PATH]; char filename[_MAX_PATH];
FILE *f; FILE *f;
// Disable the primary display controller and AGP VGA pass-through /* Disable the primary display controller and AGP VGA pass-through */
DISABLE_DEVICE(0); DISABLE_DEVICE(0);
if (AGPBridge) if (AGPBridge)
DISABLE_AGP_VGA(); DISABLE_AGP_VGA();
// Now POST all the secondary controllers /* Now POST all the secondary controllers */
for (device = 0; device < NumDevices; device++) { for (device = 0; device < NumDevices; device++) {
// Skip the device if it is not enabled (probably an ISA device) /* Skip the device if it is not enabled (probably an ISA device) */
if (DeviceIndex[device] == -1) if (DeviceIndex[device] == -1)
continue; continue;
// Enable secondary display controller. If the secondary controller /* Enable secondary display controller. If the secondary controller */
// is on the AGP bus, then enable VGA resources for the AGP device. /* is on the AGP bus, then enable VGA resources for the AGP device. */
ENABLE_DEVICE(device); ENABLE_DEVICE(device);
if (AGPBridge && AGPBridge->SecondayBusNumber == PCI[DeviceIndex[device]].slot.p.Bus) if (AGPBridge && AGPBridge->SecondayBusNumber == PCI[DeviceIndex[device]].slot.p.Bus)
ENABLE_AGP_VGA(); ENABLE_AGP_VGA();
// Check if the controller has already been POST'ed /* Check if the controller has already been POST'ed */
if (VGA_NOT_ACTIVE()) { if (VGA_NOT_ACTIVE()) {
// Find a viable place to map the secondary PCI BIOS image and map it /* Find a viable place to map the secondary PCI BIOS image and map it */
printk("Device %d not enabled, so attempting warm boot it\n", device); printk("Device %d not enabled, so attempting warm boot it\n", device);
// For AGP devices (and PCI devices that do have the ROM base /* For AGP devices (and PCI devices that do have the ROM base */
// address zero'ed out) we have to map the BIOS to a location /* address zero'ed out) we have to map the BIOS to a location */
// that is passed by the AGP bridge to the bus. Some AGP devices /* that is passed by the AGP bridge to the bus. Some AGP devices */
// have the ROM base address already set up for us, and some /* have the ROM base address already set up for us, and some */
// do not (we map to one of the existing BAR locations in /* do not (we map to one of the existing BAR locations in */
// this case). /* this case). */
mappedBIOS = NULL; mappedBIOS = NULL;
if (PCI[DeviceIndex[device]].ROMBaseAddress != 0) if (PCI[DeviceIndex[device]].ROMBaseAddress != 0)
mappedBIOSPhys = PCI[DeviceIndex[device]].ROMBaseAddress & ~0xF; mappedBIOSPhys = PCI[DeviceIndex[device]].ROMBaseAddress & ~0xF;
@ -248,26 +248,26 @@ static ibool PCI_postControllers(void)
memcpy(copyOfBIOS,mappedBIOS,BIOSImageLen); memcpy(copyOfBIOS,mappedBIOS,BIOSImageLen);
PM_freePhysicalAddr(mappedBIOS,MAX_BIOSLEN-1); PM_freePhysicalAddr(mappedBIOS,MAX_BIOSLEN-1);
// Allocate memory to store copy of BIOS from secondary controllers /* Allocate memory to store copy of BIOS from secondary controllers */
VGAInfo[device].pciInfo = &PCI[DeviceIndex[device]]; VGAInfo[device].pciInfo = &PCI[DeviceIndex[device]];
VGAInfo[device].BIOSImage = copyOfBIOS; VGAInfo[device].BIOSImage = copyOfBIOS;
VGAInfo[device].BIOSImageLen = BIOSImageLen; VGAInfo[device].BIOSImageLen = BIOSImageLen;
// Restore device mappings /* Restore device mappings */
PCI_writePCIRegL(0x30,PCI[DeviceIndex[device]].ROMBaseAddress,device); PCI_writePCIRegL(0x30,PCI[DeviceIndex[device]].ROMBaseAddress,device);
PCI_writePCIRegL(0x10,PCI[DeviceIndex[device]].BaseAddress10,device); PCI_writePCIRegL(0x10,PCI[DeviceIndex[device]].BaseAddress10,device);
PCI_writePCIRegL(0x14,PCI[DeviceIndex[device]].BaseAddress14,device); PCI_writePCIRegL(0x14,PCI[DeviceIndex[device]].BaseAddress14,device);
// Now execute the BIOS POST for the device /* Now execute the BIOS POST for the device */
if (copyOfBIOS[0] == 0x55 && copyOfBIOS[1] == 0xAA) { if (copyOfBIOS[0] == 0x55 && copyOfBIOS[1] == 0xAA) {
printk("Executing BIOS POST for controller.\n"); printk("Executing BIOS POST for controller.\n");
PCI_doBIOSPOST(device,mappedBIOSPhys,copyOfBIOS,BIOSImageLen); PCI_doBIOSPOST(device,mappedBIOSPhys,copyOfBIOS,BIOSImageLen);
} }
// Reset the size of the BIOS image to the final size /* Reset the size of the BIOS image to the final size */
VGAInfo[device].BIOSImageLen = FINAL_BIOSLEN; VGAInfo[device].BIOSImageLen = FINAL_BIOSLEN;
// Save the BIOS and interrupt vector information to disk /* Save the BIOS and interrupt vector information to disk */
sprintf(filename,"%s/bios.%02d",PM_getNucleusConfigPath(),device); sprintf(filename,"%s/bios.%02d",PM_getNucleusConfigPath(),device);
if ((f = fopen(filename,"wb")) != NULL) { if ((f = fopen(filename,"wb")) != NULL) {
fwrite(copyOfBIOS,1,FINAL_BIOSLEN,f); fwrite(copyOfBIOS,1,FINAL_BIOSLEN,f);
@ -276,14 +276,14 @@ static ibool PCI_postControllers(void)
} }
} }
else { else {
// Allocate memory to store copy of BIOS from secondary controllers /* Allocate memory to store copy of BIOS from secondary controllers */
if ((copyOfBIOS = malloc(FINAL_BIOSLEN)) == NULL) if ((copyOfBIOS = malloc(FINAL_BIOSLEN)) == NULL)
return false; return false;
VGAInfo[device].pciInfo = &PCI[DeviceIndex[device]]; VGAInfo[device].pciInfo = &PCI[DeviceIndex[device]];
VGAInfo[device].BIOSImage = copyOfBIOS; VGAInfo[device].BIOSImage = copyOfBIOS;
VGAInfo[device].BIOSImageLen = FINAL_BIOSLEN; VGAInfo[device].BIOSImageLen = FINAL_BIOSLEN;
// Load the BIOS and interrupt vector information from disk /* Load the BIOS and interrupt vector information from disk */
sprintf(filename,"%s/bios.%02d",PM_getNucleusConfigPath(),device); sprintf(filename,"%s/bios.%02d",PM_getNucleusConfigPath(),device);
if ((f = fopen(filename,"rb")) != NULL) { if ((f = fopen(filename,"rb")) != NULL) {
fread(copyOfBIOS,1,FINAL_BIOSLEN,f); fread(copyOfBIOS,1,FINAL_BIOSLEN,f);
@ -292,25 +292,25 @@ static ibool PCI_postControllers(void)
} }
} }
// Fix up all the secondary PCI base address registers /* Fix up all the secondary PCI base address registers */
// (restores them all from the values we read previously) /* (restores them all from the values we read previously) */
_PCI_fixupSecondaryBARs(); _PCI_fixupSecondaryBARs();
// Disable the secondary controller and AGP VGA pass-through /* Disable the secondary controller and AGP VGA pass-through */
DISABLE_DEVICE(device); DISABLE_DEVICE(device);
if (AGPBridge) if (AGPBridge)
DISABLE_AGP_VGA(); DISABLE_AGP_VGA();
} }
// Reenable primary display controller and reset AGP bridge control /* Reenable primary display controller and reset AGP bridge control */
if (AGPBridge) if (AGPBridge)
RESTORE_AGP_VGA(); RESTORE_AGP_VGA();
ENABLE_DEVICE(0); ENABLE_DEVICE(0);
// Free physical BIOS image mapping /* Free physical BIOS image mapping */
PM_freePhysicalAddr(mappedBIOS,MAX_BIOSLEN-1); PM_freePhysicalAddr(mappedBIOS,MAX_BIOSLEN-1);
// Restore the X86 emulator BIOS info to primary controller /* Restore the X86 emulator BIOS info to primary controller */
if (!useV86) if (!useV86)
BE_setVGA(&VGAInfo[0]); BE_setVGA(&VGAInfo[0]);
return true; return true;
@ -460,15 +460,15 @@ static int PCI_enumerateDevices(void)
int i,j; int i,j;
PCIBridgeInfo *info; PCIBridgeInfo *info;
// If this is the first time we have been called, enumerate all /* If this is the first time we have been called, enumerate all */
// devices on the PCI bus. /* devices on the PCI bus. */
if (NumPCI == -1) { if (NumPCI == -1) {
for (i = 0; i < MAX_PCI_DEVICES; i++) for (i = 0; i < MAX_PCI_DEVICES; i++)
PCI[i].dwSize = sizeof(PCI[i]); PCI[i].dwSize = sizeof(PCI[i]);
if ((NumPCI = PCI_enumerate(PCI,MAX_PCI_DEVICES)) == 0) if ((NumPCI = PCI_enumerate(PCI,MAX_PCI_DEVICES)) == 0)
return -1; return -1;
// Build a list of all PCI bridge devices /* Build a list of all PCI bridge devices */
for (i = 0,NumBridges = 0,BridgeIndex[0] = -1; i < NumPCI; i++) { for (i = 0,NumBridges = 0,BridgeIndex[0] = -1; i < NumPCI; i++) {
if (PCI[i].BaseClass == PCI_BRIDGE_CLASS) { if (PCI[i].BaseClass == PCI_BRIDGE_CLASS) {
if (NumBridges < MAX_PCI_DEVICES) if (NumBridges < MAX_PCI_DEVICES)
@ -476,7 +476,7 @@ static int PCI_enumerateDevices(void)
} }
} }
// Now build a list of all display class devices /* Now build a list of all display class devices */
for (i = 0,NumDevices = 1,DeviceIndex[0] = -1; i < NumPCI; i++) { for (i = 0,NumDevices = 1,DeviceIndex[0] = -1; i < NumPCI; i++) {
if (PCI_IS_DISPLAY_CLASS(&PCI[i])) { if (PCI_IS_DISPLAY_CLASS(&PCI[i])) {
if ((PCI[i].Command & 0x3) == 0x3) { if ((PCI[i].Command & 0x3) == 0x3) {
@ -487,10 +487,10 @@ static int PCI_enumerateDevices(void)
DeviceIndex[NumDevices++] = i; DeviceIndex[NumDevices++] = i;
} }
if (PCI[i].slot.p.Bus != 0) { if (PCI[i].slot.p.Bus != 0) {
// This device is on a different bus than the primary /* This device is on a different bus than the primary */
// PCI bus, so it is probably an AGP device. Find the /* PCI bus, so it is probably an AGP device. Find the */
// AGP bus device that controls that bus so we can /* AGP bus device that controls that bus so we can */
// control it. /* control it. */
for (j = 0; j < NumBridges; j++) { for (j = 0; j < NumBridges; j++) {
info = (PCIBridgeInfo*)&PCI[BridgeIndex[j]]; info = (PCIBridgeInfo*)&PCI[BridgeIndex[j]];
if (info->SecondayBusNumber == PCI[i].slot.p.Bus) { if (info->SecondayBusNumber == PCI[i].slot.p.Bus) {
@ -502,7 +502,7 @@ static int PCI_enumerateDevices(void)
} }
} }
// Enumerate all PCI and bridge devices to log file /* Enumerate all PCI and bridge devices to log file */
EnumeratePCI(); EnumeratePCI();
} }
return NumDevices; return NumDevices;
@ -548,20 +548,20 @@ int main(int argc,char *argv[])
PM_init(); PM_init();
if (!useV86) { if (!useV86) {
// Initialise the x86 BIOS emulator /* Initialise the x86 BIOS emulator */
BE_init(false,debugFlags,65536,&VGAInfo[0]); BE_init(false,debugFlags,65536,&VGAInfo[0]);
} }
// Enumerate all devices (which POST's them at the same time) /* Enumerate all devices (which POST's them at the same time) */
if (PCI_enumerateDevices() < 1) { if (PCI_enumerateDevices() < 1) {
printk("No PCI display devices found!\n"); printk("No PCI display devices found!\n");
return -1; return -1;
} }
// Post all the display controller BIOS'es /* Post all the display controller BIOS'es */
PCI_postControllers(); PCI_postControllers();
// Cleanup and exit the emulator /* Cleanup and exit the emulator */
if (!useV86) if (!useV86)
BE_exit(); BE_exit();
fclose(logfile); fclose(logfile);

View File

@ -197,8 +197,8 @@ void NAPI _OS_delay(
if (!inited) { if (!inited) {
#ifndef __WIN32_VXD__ #ifndef __WIN32_VXD__
// This has been causing problems in VxD's for some reason, so for now /* This has been causing problems in VxD's for some reason, so for now */
// we avoid using it. /* we avoid using it. */
if (_GA_haveCPUID() && (_GA_getCPUIDFeatures() & CPU_HaveRDTSC) != 0) { if (_GA_haveCPUID() && (_GA_getCPUIDFeatures() & CPU_HaveRDTSC) != 0) {
ZTimerInit(); ZTimerInit();
haveRDTSC = true; haveRDTSC = true;
@ -217,4 +217,3 @@ void NAPI _OS_delay(
else else
_OS_delay8253(microSeconds); _OS_delay8253(microSeconds);
} }

View File

@ -120,4 +120,3 @@ void _EXPORT CenterLogo(HWND hWndLogo, HWND hWndParent, int CenterY)
(RectCenter.right - RectCenter.left), (RectCenter.right - RectCenter.left),
(RectCenter.bottom - RectCenter.top), false); (RectCenter.bottom - RectCenter.top), false);
} }

View File

@ -70,10 +70,10 @@ library is used with the application local version of Nucleus.
****************************************************************************/ ****************************************************************************/
PM_imports * NAPI GA_getSystemPMImports(void) PM_imports * NAPI GA_getSystemPMImports(void)
{ {
// TODO: We may very well want to provide a system shared library /* TODO: We may very well want to provide a system shared library */
// that eports the PM functions required by the Nucleus library /* that eports the PM functions required by the Nucleus library */
// for BeOS here. That will eliminate fatal errors loading new /* for BeOS here. That will eliminate fatal errors loading new */
// drivers on BeOS! /* drivers on BeOS! */
return &_PM_imports; return &_PM_imports;
} }

View File

@ -133,4 +133,3 @@ void NAPI GA_TimerRead(
{ {
_GA_readTimeStamp(value); _GA_readTimeStamp(value);
} }

View File

@ -266,4 +266,3 @@ N_uint32 * NAPI GA_getLicensedDevices(ibool shared)
return __GA_exports.GA_getLicensedDevices(shared); return __GA_exports.GA_getLicensedDevices(shared);
} }
#endif #endif

View File

@ -72,10 +72,10 @@ library is used with the application local version of Nucleus.
****************************************************************************/ ****************************************************************************/
PM_imports * NAPI GA_getSystemPMImports(void) PM_imports * NAPI GA_getSystemPMImports(void)
{ {
// TODO: We may very well want to provide a system shared library /* TODO: We may very well want to provide a system shared library */
// that eports the PM functions required by the Nucleus library /* that eports the PM functions required by the Nucleus library */
// for Linux here. That will eliminate fatal errors loading new /* for Linux here. That will eliminate fatal errors loading new */
// drivers on Linux! /* drivers on Linux! */
return &_PM_imports; return &_PM_imports;
} }

View File

@ -134,4 +134,3 @@ void NAPI GA_TimerRead(
else else
KeQuerySystemTime((LARGE_INTEGER*)value); KeQuerySystemTime((LARGE_INTEGER*)value);
} }

View File

@ -72,10 +72,10 @@ library is used with the application local version of Nucleus.
****************************************************************************/ ****************************************************************************/
PM_imports * NAPI GA_getSystemPMImports(void) PM_imports * NAPI GA_getSystemPMImports(void)
{ {
// TODO: We may very well want to provide a system shared library /* TODO: We may very well want to provide a system shared library */
// that eports the PM functions required by the Nucleus library /* that eports the PM functions required by the Nucleus library */
// for QNX here. That will eliminate fatal errors loading new /* for QNX here. That will eliminate fatal errors loading new */
// drivers on QNX! /* drivers on QNX! */
return &_PM_imports; return &_PM_imports;
} }

View File

@ -134,4 +134,3 @@ void NAPI GA_TimerRead(
else else
VTD_Get_Real_Time(&value->high,&value->low); VTD_Get_Real_Time(&value->high,&value->low);
} }

View File

@ -188,7 +188,7 @@ ibool NAPI GA_queryFunctions(
static ibool (NAPIP _GA_queryFunctions)(GA_devCtx *dc,N_uint32 id,void _FAR_ *funcs) = NULL; static ibool (NAPIP _GA_queryFunctions)(GA_devCtx *dc,N_uint32 id,void _FAR_ *funcs) = NULL;
if (useRing0Driver) { if (useRing0Driver) {
// Call the version in nga_w32.dll if it is loaded /* Call the version in nga_w32.dll if it is loaded */
if (!_GA_queryFunctions) { if (!_GA_queryFunctions) {
if ((_GA_queryFunctions = (void*)GetProcAddress(hModDLL,"_GA_queryFunctions")) == NULL) if ((_GA_queryFunctions = (void*)GetProcAddress(hModDLL,"_GA_queryFunctions")) == NULL)
if ((_GA_queryFunctions = (void*)GetProcAddress(hModDLL,"__GA_queryFunctions")) == NULL) if ((_GA_queryFunctions = (void*)GetProcAddress(hModDLL,"__GA_queryFunctions")) == NULL)
@ -211,7 +211,7 @@ ibool NAPI REF2D_queryFunctions(
static ibool (NAPIP _REF2D_queryFunctions)(REF2D_driver *ref2d,N_uint32 id,void _FAR_ *funcs) = NULL; static ibool (NAPIP _REF2D_queryFunctions)(REF2D_driver *ref2d,N_uint32 id,void _FAR_ *funcs) = NULL;
if (useRing0Driver) { if (useRing0Driver) {
// Call the version in nga_w32.dll if it is loaded /* Call the version in nga_w32.dll if it is loaded */
if (!_REF2D_queryFunctions) { if (!_REF2D_queryFunctions) {
if ((_REF2D_queryFunctions = (void*)GetProcAddress(hModDLL,"_REF2D_queryFunctions")) == NULL) if ((_REF2D_queryFunctions = (void*)GetProcAddress(hModDLL,"_REF2D_queryFunctions")) == NULL)
if ((_REF2D_queryFunctions = (void*)GetProcAddress(hModDLL,"__REF2D_queryFunctions")) == NULL) if ((_REF2D_queryFunctions = (void*)GetProcAddress(hModDLL,"__REF2D_queryFunctions")) == NULL)
@ -253,4 +253,3 @@ void NAPI GA_TimerRead(
else else
QueryPerformanceCounter((LARGE_INTEGER*)value); QueryPerformanceCounter((LARGE_INTEGER*)value);
} }

View File

@ -444,7 +444,7 @@ int _CDECL stub_isatty(int _fildes)
int _CDECL stub_unlink(const char *_path) int _CDECL stub_unlink(const char *_path)
{ {
// TODO: Implement this! /* TODO: Implement this! */
return -1; return -1;
} }
@ -454,7 +454,7 @@ int _CDECL stub_remove(const char *_filename)
int _CDECL stub_rename(const char *_old, const char *_new) int _CDECL stub_rename(const char *_old, const char *_new)
{ {
// TODO: Implement this! /* TODO: Implement this! */
return -1; return -1;
} }
@ -825,4 +825,3 @@ void * _CDECL stub_signal(int sig, void *handler)
return (void*)signal(sig,(__code_ptr)handler); return (void*)signal(sig,(__code_ptr)handler);
#endif #endif
} }

View File

@ -584,4 +584,3 @@ int PEAPI PE_getError(void)
{ {
return result; return result;
} }

View File

@ -64,8 +64,8 @@ Initialise the counter and return the frequency of the counter.
static void GetCounterFrequency( static void GetCounterFrequency(
CPU_largeInteger *freq) CPU_largeInteger *freq)
{ {
// TODO: Return the frequency of the counter in here. You should try to /* TODO: Return the frequency of the counter in here. You should try to */
// normalise this value to be around 100,000 ticks per second. /* normalise this value to be around 100,000 ticks per second. */
freq->low = 1000000; freq->low = 1000000;
freq->high = 0; freq->high = 0;
} }

View File

@ -59,7 +59,7 @@ events.
****************************************************************************/ ****************************************************************************/
ulong _EVT_getTicks(void) ulong _EVT_getTicks(void)
{ {
// TODO: Implement this for your OS! /* TODO: Implement this for your OS! */
} }
/**************************************************************************** /****************************************************************************
@ -68,36 +68,36 @@ Pumps all messages in the application message queue into our event queue.
****************************************************************************/ ****************************************************************************/
static void _EVT_pumpMessages(void) static void _EVT_pumpMessages(void)
{ {
// TODO: The purpose of this function is to read all keyboard and mouse /* TODO: The purpose of this function is to read all keyboard and mouse */
// events from the OS specific event queue, translate them and post /* events from the OS specific event queue, translate them and post */
// them into the SciTech event queue. /* them into the SciTech event queue. */
// /* */
// NOTE: There are a couple of important things that this function must /* NOTE: There are a couple of important things that this function must */
// take care of: /* take care of: */
// /* */
// 1. Support for KEYDOWN, KEYREPEAT and KEYUP is required. /* 1. Support for KEYDOWN, KEYREPEAT and KEYUP is required. */
// /* */
// 2. Support for reading hardware scan code as well as ASCII /* 2. Support for reading hardware scan code as well as ASCII */
// translated values is required. Games use the scan codes rather /* translated values is required. Games use the scan codes rather */
// than ASCII values. Scan codes go into the high order byte of the /* than ASCII values. Scan codes go into the high order byte of the */
// keyboard message field. /* keyboard message field. */
// /* */
// 3. Support for at least reading mouse motion data (mickeys) from the /* 3. Support for at least reading mouse motion data (mickeys) from the */
// mouse is required. Using the mickey values, we can then translate /* mouse is required. Using the mickey values, we can then translate */
// to mouse cursor coordinates scaled to the range of the current /* to mouse cursor coordinates scaled to the range of the current */
// graphics display mode. Mouse values are scaled based on the /* graphics display mode. Mouse values are scaled based on the */
// global 'rangeX' and 'rangeY'. /* global 'rangeX' and 'rangeY'. */
// /* */
// 4. Support for a timestamp for the events is required, which is /* 4. Support for a timestamp for the events is required, which is */
// defined as the number of milliseconds since some event (usually /* defined as the number of milliseconds since some event (usually */
// system startup). This is the timestamp when the event occurred /* system startup). This is the timestamp when the event occurred */
// (ie: at interrupt time) not when it was stuff into the SciTech /* (ie: at interrupt time) not when it was stuff into the SciTech */
// event queue. /* event queue. */
// /* */
// 5. Support for mouse double click events. If the OS has a native /* 5. Support for mouse double click events. If the OS has a native */
// mechanism to determine this, it should be used. Otherwise the /* mechanism to determine this, it should be used. Otherwise the */
// time stamp information will be used by the generic event code /* time stamp information will be used by the generic event code */
// to generate double click events. /* to generate double click events. */
} }
/**************************************************************************** /****************************************************************************
@ -141,7 +141,7 @@ void EVTAPI EVT_init(
initEventQueue(); initEventQueue();
memset(keyUpMsg,0,sizeof(keyUpMsg)); memset(keyUpMsg,0,sizeof(keyUpMsg));
// TODO: Do any OS specific initialisation here /* TODO: Do any OS specific initialisation here */
/* Catch program termination signals so we can clean up properly */ /* Catch program termination signals so we can clean up properly */
signal(SIGABRT, _EVT_abort); signal(SIGABRT, _EVT_abort);
@ -171,7 +171,7 @@ and this function can be used to resume it again later.
****************************************************************************/ ****************************************************************************/
void EVT_resume(void) void EVT_resume(void)
{ {
// Do nothing for non DOS systems /* Do nothing for non DOS systems */
} }
/**************************************************************************** /****************************************************************************
@ -181,7 +181,7 @@ de-install the event handling code.
****************************************************************************/ ****************************************************************************/
void EVT_suspend(void) void EVT_suspend(void)
{ {
// Do nothing for non DOS systems /* Do nothing for non DOS systems */
} }
/**************************************************************************** /****************************************************************************
@ -195,5 +195,5 @@ void EVT_exit(void)
signal(SIGFPE, SIG_DFL); signal(SIGFPE, SIG_DFL);
signal(SIGINT, SIG_DFL); signal(SIGINT, SIG_DFL);
// TODO: Do any OS specific cleanup in here /* TODO: Do any OS specific cleanup in here */
} }

View File

@ -28,5 +28,5 @@
* *
****************************************************************************/ ****************************************************************************/
// This is where you include OS specific headers for the event handling /* This is where you include OS specific headers for the event handling */
// library. /* library. */

View File

@ -38,7 +38,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
// TODO: Include any BeOS specific headers here! /* TODO: Include any BeOS specific headers here! */
/*--------------------------- Global variables ----------------------------*/ /*--------------------------- Global variables ----------------------------*/
@ -48,12 +48,12 @@ static void (PMAPIP fatalErrorCleanup)(void) = NULL;
void PMAPI PM_init(void) void PMAPI PM_init(void)
{ {
// TODO: Do any initialisation in here. This includes getting IOPL /* TODO: Do any initialisation in here. This includes getting IOPL */
// access for the process calling PM_init. This will get called /* access for the process calling PM_init. This will get called */
// more than once. /* more than once. */
// TODO: If you support the supplied MTRR register stuff (you need to /* TODO: If you support the supplied MTRR register stuff (you need to */
// be at ring 0 for this!), you should initialise it in here. /* be at ring 0 for this!), you should initialise it in here. */
/* MTRR_init(); */ /* MTRR_init(); */
} }
@ -81,9 +81,9 @@ void PMAPI PM_setFatalErrorCleanup(
void PMAPI PM_fatalError(const char *msg) void PMAPI PM_fatalError(const char *msg)
{ {
// TODO: If you are running in a GUI environment without a console, /* TODO: If you are running in a GUI environment without a console, */
// this needs to be changed to bring up a fatal error message /* this needs to be changed to bring up a fatal error message */
// box and terminate the program. /* box and terminate the program. */
if (fatalErrorCleanup) if (fatalErrorCleanup)
fatalErrorCleanup(); fatalErrorCleanup();
fprintf(stderr,"%s\n", msg); fprintf(stderr,"%s\n", msg);
@ -92,101 +92,101 @@ void PMAPI PM_fatalError(const char *msg)
void * PMAPI PM_getVESABuf(uint *len,uint *rseg,uint *roff) void * PMAPI PM_getVESABuf(uint *len,uint *rseg,uint *roff)
{ {
// No BIOS access for the BeOS /* No BIOS access for the BeOS */
return NULL; return NULL;
} }
int PMAPI PM_kbhit(void) int PMAPI PM_kbhit(void)
{ {
// TODO: This function checks if a key is available to be read. This /* TODO: This function checks if a key is available to be read. This */
// should be implemented, but is mostly used by the test programs /* should be implemented, but is mostly used by the test programs */
// these days. /* these days. */
return true; return true;
} }
int PMAPI PM_getch(void) int PMAPI PM_getch(void)
{ {
// TODO: This returns the ASCII code of the key pressed. This /* TODO: This returns the ASCII code of the key pressed. This */
// should be implemented, but is mostly used by the test programs /* should be implemented, but is mostly used by the test programs */
// these days. /* these days. */
return 0xD; return 0xD;
} }
int PMAPI PM_openConsole(void) int PMAPI PM_openConsole(void)
{ {
// TODO: Opens up a fullscreen console for graphics output. If your /* TODO: Opens up a fullscreen console for graphics output. If your */
// console does not have graphics/text modes, this can be left /* console does not have graphics/text modes, this can be left */
// empty. The main purpose of this is to disable console switching /* empty. The main purpose of this is to disable console switching */
// when in graphics modes if you can switch away from fullscreen /* when in graphics modes if you can switch away from fullscreen */
// consoles (if you want to allow switching, this can be done /* consoles (if you want to allow switching, this can be done */
// elsewhere with a full save/restore state of the graphics mode). /* elsewhere with a full save/restore state of the graphics mode). */
return 0; return 0;
} }
int PMAPI PM_getConsoleStateSize(void) int PMAPI PM_getConsoleStateSize(void)
{ {
// TODO: Returns the size of the console state buffer used to save the /* TODO: Returns the size of the console state buffer used to save the */
// state of the console before going into graphics mode. This is /* state of the console before going into graphics mode. This is */
// used to restore the console back to normal when we are done. /* used to restore the console back to normal when we are done. */
return 1; return 1;
} }
void PMAPI PM_saveConsoleState(void *stateBuf,int console_id) void PMAPI PM_saveConsoleState(void *stateBuf,int console_id)
{ {
// TODO: Saves the state of the console into the state buffer. This is /* TODO: Saves the state of the console into the state buffer. This is */
// used to restore the console back to normal when we are done. /* used to restore the console back to normal when we are done. */
// We will always restore 80x25 text mode after being in graphics /* We will always restore 80x25 text mode after being in graphics */
// mode, so if restoring text mode is all you need to do this can /* mode, so if restoring text mode is all you need to do this can */
// be left empty. /* be left empty. */
} }
void PMAPI PM_restoreConsoleState(const void *stateBuf,int console_id) void PMAPI PM_restoreConsoleState(const void *stateBuf,int console_id)
{ {
// TODO: Restore the state of the console from the state buffer. This is /* TODO: Restore the state of the console from the state buffer. This is */
// used to restore the console back to normal when we are done. /* used to restore the console back to normal when we are done. */
// We will always restore 80x25 text mode after being in graphics /* We will always restore 80x25 text mode after being in graphics */
// mode, so if restoring text mode is all you need to do this can /* mode, so if restoring text mode is all you need to do this can */
// be left empty. /* be left empty. */
} }
void PMAPI PM_closeConsole(int console_id) void PMAPI PM_closeConsole(int console_id)
{ {
// TODO: Close the console when we are done, going back to text mode. /* TODO: Close the console when we are done, going back to text mode. */
} }
void PM_setOSCursorLocation(int x,int y) void PM_setOSCursorLocation(int x,int y)
{ {
// TODO: Set the OS console cursor location to the new value. This is /* TODO: Set the OS console cursor location to the new value. This is */
// generally used for new OS ports (used mostly for DOS). /* generally used for new OS ports (used mostly for DOS). */
} }
void PM_setOSScreenWidth(int width,int height) void PM_setOSScreenWidth(int width,int height)
{ {
// TODO: Set the OS console screen width. This is generally unused for /* TODO: Set the OS console screen width. This is generally unused for */
// new OS ports. /* new OS ports. */
} }
ibool PMAPI PM_setRealTimeClockHandler(PM_intHandler ih, int frequency) ibool PMAPI PM_setRealTimeClockHandler(PM_intHandler ih, int frequency)
{ {
// TODO: Install a real time clock interrupt handler. Normally this /* TODO: Install a real time clock interrupt handler. Normally this */
// will not be supported from most OS'es in user land, so an /* will not be supported from most OS'es in user land, so an */
// alternative mechanism is needed to enable software stereo. /* alternative mechanism is needed to enable software stereo. */
// Hence leave this unimplemented unless you have a high priority /* Hence leave this unimplemented unless you have a high priority */
// mechanism to call the 32-bit callback when the real time clock /* mechanism to call the 32-bit callback when the real time clock */
// interrupt fires. /* interrupt fires. */
return false; return false;
} }
void PMAPI PM_setRealTimeClockFrequency(int frequency) void PMAPI PM_setRealTimeClockFrequency(int frequency)
{ {
// TODO: Set the real time clock interrupt frequency. Used for stereo /* TODO: Set the real time clock interrupt frequency. Used for stereo */
// LC shutter glasses when doing software stereo. Usually sets /* LC shutter glasses when doing software stereo. Usually sets */
// the frequency to around 2048 Hz. /* the frequency to around 2048 Hz. */
} }
void PMAPI PM_restoreRealTimeClockHandler(void) void PMAPI PM_restoreRealTimeClockHandler(void)
{ {
// TODO: Restores the real time clock handler. /* TODO: Restores the real time clock handler. */
} }
char * PMAPI PM_getCurrentPath( char * PMAPI PM_getCurrentPath(
@ -219,8 +219,8 @@ const char * PMAPI PM_getNucleusConfigPath(void)
const char * PMAPI PM_getUniqueID(void) const char * PMAPI PM_getUniqueID(void)
{ {
// TODO: Return a unique ID for the machine. If a unique ID is not /* TODO: Return a unique ID for the machine. If a unique ID is not */
// available, return the machine name. /* available, return the machine name. */
static char buf[128]; static char buf[128];
gethostname(buf, 128); gethostname(buf, 128);
return buf; return buf;
@ -228,7 +228,7 @@ const char * PMAPI PM_getUniqueID(void)
const char * PMAPI PM_getMachineName(void) const char * PMAPI PM_getMachineName(void)
{ {
// TODO: Return the network machine name for the machine. /* TODO: Return the network machine name for the machine. */
static char buf[128]; static char buf[128];
gethostname(buf, 128); gethostname(buf, 128);
return buf; return buf;
@ -236,7 +236,7 @@ const char * PMAPI PM_getMachineName(void)
void * PMAPI PM_getBIOSPointer(void) void * PMAPI PM_getBIOSPointer(void)
{ {
// No BIOS access on the BeOS /* No BIOS access on the BeOS */
return NULL; return NULL;
} }
@ -250,49 +250,49 @@ void * PMAPI PM_getA0000Pointer(void)
void * PMAPI PM_mapPhysicalAddr(ulong base,ulong limit,ibool isCached) void * PMAPI PM_mapPhysicalAddr(ulong base,ulong limit,ibool isCached)
{ {
// TODO: This function maps a physical memory address to a linear /* TODO: This function maps a physical memory address to a linear */
// address in the address space of the calling process. /* address in the address space of the calling process. */
// NOTE: This function *must* be able to handle any phsyical base /* NOTE: This function *must* be able to handle any phsyical base */
// address, and hence you will have to handle rounding of /* address, and hence you will have to handle rounding of */
// the physical base address to a page boundary (ie: 4Kb on /* the physical base address to a page boundary (ie: 4Kb on */
// x86 CPU's) to be able to properly map in the memory /* x86 CPU's) to be able to properly map in the memory */
// region. /* region. */
// NOTE: If possible the isCached bit should be used to ensure that /* NOTE: If possible the isCached bit should be used to ensure that */
// the PCD (Page Cache Disable) and PWT (Page Write Through) /* the PCD (Page Cache Disable) and PWT (Page Write Through) */
// bits are set to disable caching for a memory mapping used /* bits are set to disable caching for a memory mapping used */
// for MMIO register access. We also disable caching using /* for MMIO register access. We also disable caching using */
// the MTRR registers for Pentium Pro and later chipsets so if /* the MTRR registers for Pentium Pro and later chipsets so if */
// MTRR support is enabled for your OS then you can safely ignore /* MTRR support is enabled for your OS then you can safely ignore */
// the isCached flag and always enable caching in the page /* the isCached flag and always enable caching in the page */
// tables. /* tables. */
return NULL; return NULL;
} }
void PMAPI PM_freePhysicalAddr(void *ptr,ulong limit) void PMAPI PM_freePhysicalAddr(void *ptr,ulong limit)
{ {
// TODO: This function will free a physical memory mapping previously /* TODO: This function will free a physical memory mapping previously */
// allocated with PM_mapPhysicalAddr() if at all possible. If /* allocated with PM_mapPhysicalAddr() if at all possible. If */
// you can't free physical memory mappings, simply do nothing. /* you can't free physical memory mappings, simply do nothing. */
} }
ulong PMAPI PM_getPhysicalAddr(void *p) ulong PMAPI PM_getPhysicalAddr(void *p)
{ {
// TODO: This function should find the physical address of a linear /* TODO: This function should find the physical address of a linear */
// address. /* address. */
return 0xFFFFFFFFUL; return 0xFFFFFFFFUL;
} }
void PMAPI PM_sleep(ulong milliseconds) void PMAPI PM_sleep(ulong milliseconds)
{ {
// TODO: Put the process to sleep for milliseconds /* TODO: Put the process to sleep for milliseconds */
} }
int PMAPI PM_getCOMPort(int port) int PMAPI PM_getCOMPort(int port)
{ {
// TODO: Re-code this to determine real values using the Plug and Play /* TODO: Re-code this to determine real values using the Plug and Play */
// manager for the OS. /* manager for the OS. */
switch (port) { switch (port) {
case 0: return 0x3F8; case 0: return 0x3F8;
case 1: return 0x2F8; case 1: return 0x2F8;
@ -302,8 +302,8 @@ int PMAPI PM_getCOMPort(int port)
int PMAPI PM_getLPTPort(int port) int PMAPI PM_getLPTPort(int port)
{ {
// TODO: Re-code this to determine real values using the Plug and Play /* TODO: Re-code this to determine real values using the Plug and Play */
// manager for the OS. /* manager for the OS. */
switch (port) { switch (port) {
case 0: return 0x3BC; case 0: return 0x3BC;
case 1: return 0x378; case 1: return 0x378;
@ -314,142 +314,142 @@ int PMAPI PM_getLPTPort(int port)
void * PMAPI PM_mallocShared(long size) void * PMAPI PM_mallocShared(long size)
{ {
// TODO: This is used to allocate memory that is shared between process /* TODO: This is used to allocate memory that is shared between process */
// that all access the common Nucleus drivers via a common display /* that all access the common Nucleus drivers via a common display */
// driver DLL. If your OS does not support shared memory (or if /* driver DLL. If your OS does not support shared memory (or if */
// the display driver does not need to allocate shared memory /* the display driver does not need to allocate shared memory */
// for each process address space), this should just call PM_malloc. /* for each process address space), this should just call PM_malloc. */
return PM_malloc(size); return PM_malloc(size);
} }
void PMAPI PM_freeShared(void *ptr) void PMAPI PM_freeShared(void *ptr)
{ {
// TODO: Free the shared memory block. This will be called in the context /* TODO: Free the shared memory block. This will be called in the context */
// of the original calling process that allocated the shared /* of the original calling process that allocated the shared */
// memory with PM_mallocShared. Simply call free if you do not /* memory with PM_mallocShared. Simply call free if you do not */
// need this. /* need this. */
PM_free(ptr); PM_free(ptr);
} }
void * PMAPI PM_mapToProcess(void *base,ulong limit) void * PMAPI PM_mapToProcess(void *base,ulong limit)
{ {
// TODO: This function is used to map a physical memory mapping /* TODO: This function is used to map a physical memory mapping */
// previously allocated with PM_mapPhysicalAddr into the /* previously allocated with PM_mapPhysicalAddr into the */
// address space of the calling process. If the memory mapping /* address space of the calling process. If the memory mapping */
// allocated by PM_mapPhysicalAddr is global to all processes, /* allocated by PM_mapPhysicalAddr is global to all processes, */
// simply return the pointer. /* simply return the pointer. */
return base; return base;
} }
void * PMAPI PM_mapRealPointer(uint r_seg,uint r_off) void * PMAPI PM_mapRealPointer(uint r_seg,uint r_off)
{ {
// No BIOS access on the BeOS /* No BIOS access on the BeOS */
return NULL; return NULL;
} }
void * PMAPI PM_allocRealSeg(uint size,uint *r_seg,uint *r_off) void * PMAPI PM_allocRealSeg(uint size,uint *r_seg,uint *r_off)
{ {
// No BIOS access on the BeOS /* No BIOS access on the BeOS */
return NULL; return NULL;
} }
void PMAPI PM_freeRealSeg(void *mem) void PMAPI PM_freeRealSeg(void *mem)
{ {
// No BIOS access on the BeOS /* No BIOS access on the BeOS */
} }
void PMAPI DPMI_int86(int intno, DPMI_regs *regs) void PMAPI DPMI_int86(int intno, DPMI_regs *regs)
{ {
// No BIOS access on the BeOS /* No BIOS access on the BeOS */
} }
int PMAPI PM_int86(int intno, RMREGS *in, RMREGS *out) int PMAPI PM_int86(int intno, RMREGS *in, RMREGS *out)
{ {
// No BIOS access on the BeOS /* No BIOS access on the BeOS */
return 0; return 0;
} }
int PMAPI PM_int86x(int intno, RMREGS *in, RMREGS *out, int PMAPI PM_int86x(int intno, RMREGS *in, RMREGS *out,
RMSREGS *sregs) RMSREGS *sregs)
{ {
// No BIOS access on the BeOS /* No BIOS access on the BeOS */
return 0; return 0;
} }
void PMAPI PM_callRealMode(uint seg,uint off, RMREGS *in, void PMAPI PM_callRealMode(uint seg,uint off, RMREGS *in,
RMSREGS *sregs) RMSREGS *sregs)
{ {
// No BIOS access on the BeOS /* No BIOS access on the BeOS */
} }
void PMAPI PM_availableMemory(ulong *physical,ulong *total) void PMAPI PM_availableMemory(ulong *physical,ulong *total)
{ {
// TODO: Report the amount of available memory, both the amount of /* TODO: Report the amount of available memory, both the amount of */
// physical memory left and the amount of virtual memory left. /* physical memory left and the amount of virtual memory left. */
// If the OS does not provide these services, report 0's. /* If the OS does not provide these services, report 0's. */
*physical = *total = 0; *physical = *total = 0;
} }
void * PMAPI PM_allocLockedMem(uint size,ulong *physAddr,ibool contiguous,ibool below16Meg) void * PMAPI PM_allocLockedMem(uint size,ulong *physAddr,ibool contiguous,ibool below16Meg)
{ {
// TODO: Allocate a block of locked, physical memory of the specified /* TODO: Allocate a block of locked, physical memory of the specified */
// size. This is used for bus master operations. If this is not /* size. This is used for bus master operations. If this is not */
// supported by the OS, return NULL and bus mastering will not /* supported by the OS, return NULL and bus mastering will not */
// be used. /* be used. */
return NULL; return NULL;
} }
void PMAPI PM_freeLockedMem(void *p,uint size,ibool contiguous) void PMAPI PM_freeLockedMem(void *p,uint size,ibool contiguous)
{ {
// TODO: Free a memory block allocated with PM_allocLockedMem. /* TODO: Free a memory block allocated with PM_allocLockedMem. */
} }
void PMAPI PM_setBankA(int bank) void PMAPI PM_setBankA(int bank)
{ {
// No BIOS access on the BeOS /* No BIOS access on the BeOS */
} }
void PMAPI PM_setBankAB(int bank) void PMAPI PM_setBankAB(int bank)
{ {
// No BIOS access on the BeOS /* No BIOS access on the BeOS */
} }
void PMAPI PM_setCRTStart(int x,int y,int waitVRT) void PMAPI PM_setCRTStart(int x,int y,int waitVRT)
{ {
// No BIOS access on the BeOS /* No BIOS access on the BeOS */
} }
ibool PMAPI PM_enableWriteCombine(ulong base,ulong length,uint type) ibool PMAPI PM_enableWriteCombine(ulong base,ulong length,uint type)
{ {
// TODO: This function should enable Pentium Pro and Pentium II MTRR /* TODO: This function should enable Pentium Pro and Pentium II MTRR */
// write combining for the passed in physical memory base address /* write combining for the passed in physical memory base address */
// and length. Normally this is done via calls to an OS specific /* and length. Normally this is done via calls to an OS specific */
// device driver as this can only be done at ring 0. /* device driver as this can only be done at ring 0. */
// /* */
// NOTE: This is a *very* important function to implement! If you do /* NOTE: This is a *very* important function to implement! If you do */
// not implement, graphics performance on the latest Intel chips /* not implement, graphics performance on the latest Intel chips */
// will be severly impaired. For sample code that can be used /* will be severly impaired. For sample code that can be used */
// directly in a ring 0 device driver, see the MSDOS implementation /* directly in a ring 0 device driver, see the MSDOS implementation */
// which includes assembler code to do this directly (if the /* which includes assembler code to do this directly (if the */
// program is running at ring 0). /* program is running at ring 0). */
return false; return false;
} }
ibool PMAPI PM_doBIOSPOST(ushort axVal,ulong BIOSPhysAddr,void *mappedBIOS) ibool PMAPI PM_doBIOSPOST(ushort axVal,ulong BIOSPhysAddr,void *mappedBIOS)
{ {
// TODO: This function is used to run the BIOS POST code on a secondary /* TODO: This function is used to run the BIOS POST code on a secondary */
// controller to initialise it for use. This is not necessary /* controller to initialise it for use. This is not necessary */
// for multi-controller operation, but it will make it a lot /* for multi-controller operation, but it will make it a lot */
// more convenicent for end users (otherwise they have to boot /* more convenicent for end users (otherwise they have to boot */
// the system once with the secondary controller as primary, and /* the system once with the secondary controller as primary, and */
// then boot with both controllers installed). /* then boot with both controllers installed). */
// /* */
// Even if you don't support full BIOS access, it would be /* Even if you don't support full BIOS access, it would be */
// adviseable to be able to POST the secondary controllers in the /* adviseable to be able to POST the secondary controllers in the */
// system using this function as a minimum requirement. Some /* system using this function as a minimum requirement. Some */
// graphics hardware has registers that contain values that only /* graphics hardware has registers that contain values that only */
// the BIOS knows about, which makes bring up a card from cold /* the BIOS knows about, which makes bring up a card from cold */
// reset difficult if the BIOS has not POST'ed it. /* reset difficult if the BIOS has not POST'ed it. */
return false; return false;
} }
@ -533,7 +533,7 @@ void PMAPI PM_setFileAttr(
const char *filename, const char *filename,
uint attrib) uint attrib)
{ {
// TODO: Set the file attributes for a file /* TODO: Set the file attributes for a file */
(void)filename; (void)filename;
(void)attrib; (void)attrib;
} }

View File

@ -36,7 +36,7 @@ Initialise the Zen Timer module internals.
****************************************************************************/ ****************************************************************************/
void _ZTimerInit(void) void _ZTimerInit(void)
{ {
// TODO: Do any specific internal initialisation in here /* TODO: Do any specific internal initialisation in here */
} }
/**************************************************************************** /****************************************************************************
@ -46,8 +46,8 @@ Start the Zen Timer counting.
static void _LZTimerOn( static void _LZTimerOn(
LZTimerObject *tm) LZTimerObject *tm)
{ {
// TODO: Start the Zen Timer counting. This should be a macro if /* TODO: Start the Zen Timer counting. This should be a macro if */
// possible. /* possible. */
} }
/**************************************************************************** /****************************************************************************
@ -57,8 +57,8 @@ Compute the lap time since the timer was started.
static ulong _LZTimerLap( static ulong _LZTimerLap(
LZTimerObject *tm) LZTimerObject *tm)
{ {
// TODO: Compute the lap time between the current time and when the /* TODO: Compute the lap time between the current time and when the */
// timer was started. /* timer was started. */
return 0; return 0;
} }
@ -69,7 +69,7 @@ Stop the Zen Timer counting.
static void _LZTimerOff( static void _LZTimerOff(
LZTimerObject *tm) LZTimerObject *tm)
{ {
// TODO: Stop the timer counting. Should be a macro if possible. /* TODO: Stop the timer counting. Should be a macro if possible. */
} }
/**************************************************************************** /****************************************************************************
@ -79,7 +79,7 @@ Compute the elapsed time in microseconds between start and end timings.
static ulong _LZTimerCount( static ulong _LZTimerCount(
LZTimerObject *tm) LZTimerObject *tm)
{ {
// TODO: Compute the elapsed time and return it. Always microseconds. /* TODO: Compute the elapsed time and return it. Always microseconds. */
return 0; return 0;
} }
@ -95,9 +95,9 @@ Read the Long Period timer from the OS
****************************************************************************/ ****************************************************************************/
static ulong _ULZReadTime(void) static ulong _ULZReadTime(void)
{ {
// TODO: Read the long period timer from the OS. The resolution of this /* TODO: Read the long period timer from the OS. The resolution of this */
// timer should be around 1/20 of a second for timing long /* timer should be around 1/20 of a second for timing long */
// periods if possible. /* periods if possible. */
} }
/**************************************************************************** /****************************************************************************

View File

@ -187,4 +187,3 @@ ibool PMAPI PM_agpFreePhysical(
} }
#endif /* !REALMODE */ #endif /* !REALMODE */

View File

@ -447,4 +447,3 @@ void EVTAPI EVT_allowLEDS(
setLEDS(0); setLEDS(0);
EVT.allowLEDS = enable; EVT.allowLEDS = enable;
} }

View File

@ -280,7 +280,7 @@ ibool PMAPI PM_getFileTime(
ibool gmTime, ibool gmTime,
PM_time *time) PM_time *time)
{ {
// TODO: Implement this! /* TODO: Implement this! */
(void)filename; (void)filename;
(void)gmTime; (void)gmTime;
(void)time; (void)time;
@ -297,7 +297,7 @@ ibool PMAPI PM_setFileTime(
ibool gmTime, ibool gmTime,
PM_time *time) PM_time *time)
{ {
// TODO: Implement this! /* TODO: Implement this! */
(void)filename; (void)filename;
(void)gmTime; (void)gmTime;
(void)time; (void)time;

View File

@ -75,7 +75,7 @@ static void EVTAPI _EVT_pumpMessages(void)
_EVT_restoreInt(ps); _EVT_restoreInt(ps);
} }
regs.x.ax = 0x0B; // Reset Move Mouse regs.x.ax = 0x0B; /* Reset Move Mouse */
PM_int86(0x33,&regs,&regs); PM_int86(0x33,&regs,&regs);
} }
#endif #endif

View File

@ -813,9 +813,9 @@ ibool PMAPI PM_driveValid(
{ {
RMREGS regs; RMREGS regs;
regs.h.dl = (uchar)(drive - 'A' + 1); regs.h.dl = (uchar)(drive - 'A' + 1);
regs.h.ah = 0x36; // Get disk information service regs.h.ah = 0x36; /* Get disk information service */
PM_int86(0x21,&regs,&regs); PM_int86(0x21,&regs,&regs);
return regs.x.ax != 0xFFFF; // AX = 0xFFFF if disk is invalid return regs.x.ax != 0xFFFF; /* AX = 0xFFFF if disk is invalid */
} }
/**************************************************************************** /****************************************************************************
@ -2212,7 +2212,7 @@ Function to get the file attributes for a specific file.
uint PMAPI PM_getFileAttr( uint PMAPI PM_getFileAttr(
const char *filename) const char *filename)
{ {
// TODO: Implement this! /* TODO: Implement this! */
return 0; return 0;
} }
@ -2225,7 +2225,7 @@ ibool PMAPI PM_getFileTime(
ibool gmTime, ibool gmTime,
PM_time *time) PM_time *time)
{ {
// TODO: Implement this! /* TODO: Implement this! */
return false; return false;
} }
@ -2238,6 +2238,6 @@ ibool PMAPI PM_setFileTime(
ibool gmTime, ibool gmTime,
PM_time *time) PM_time *time)
{ {
// TODO: Implement this! /* TODO: Implement this! */
return false; return false;
} }

View File

@ -89,7 +89,7 @@ mouse_info mouse_infos[] = {
{"BusMouse", STD_FLG, NULL, {0xf8, 0x80, 0x00, 0x00}, 3, 3}, {"BusMouse", STD_FLG, NULL, {0xf8, 0x80, 0x00, 0x00}, 3, 3},
{"MouseMan", CS7 | STD_FLG, _EVT_mouse_init, {0x40, 0x40, 0x40, 0x00}, 3, 1}, {"MouseMan", CS7 | STD_FLG, _EVT_mouse_init, {0x40, 0x40, 0x40, 0x00}, 3, 1},
{"IntelliMouse", CS7 | STD_FLG, _EVT_pnpmouse_init, {0xc0, 0x40, 0xc0, 0x00}, 4, 1}, {"IntelliMouse", CS7 | STD_FLG, _EVT_pnpmouse_init, {0xc0, 0x40, 0xc0, 0x00}, 4, 1},
{"IMPS2", CS7 | STD_FLG, NULL, {0xc0, 0x40, 0xc0, 0x00}, 4, 1}, // ? {"IMPS2", CS7 | STD_FLG, NULL, {0xc0, 0x40, 0xc0, 0x00}, 4, 1}, /* ? */
}; };
#define NB_MICE (sizeof(mouse_infos)/sizeof(mouse_info)) #define NB_MICE (sizeof(mouse_infos)/sizeof(mouse_info))
@ -109,7 +109,7 @@ typedef struct {
int map; int map;
} keymap; } keymap;
// TODO: Fix this and set it up so we can do a binary search! /* TODO: Fix this and set it up so we can do a binary search! */
keymap keymaps[] = { keymap keymaps[] = {
{96, KB_padEnter}, {96, KB_padEnter},
@ -539,7 +539,7 @@ int EVTAPI EVT_joyIsPresent(void)
joystick0_fd = 0; joystick0_fd = 0;
if ((joystick1_fd = open(joystick1_dev, O_RDONLY)) < 0) if ((joystick1_fd = open(joystick1_dev, O_RDONLY)) < 0)
joystick1_fd = 0; joystick1_fd = 0;
if (!joystick0_fd && !joystick1_fd) // No joysticks detected if (!joystick0_fd && !joystick1_fd) /* No joysticks detected */
return 0; return 0;
inited = true; inited = true;
if (ioctl(joystick0_fd ? joystick0_fd : joystick1_fd, JSIOCGVERSION, &js_version) < 0) if (ioctl(joystick0_fd ? joystick0_fd : joystick1_fd, JSIOCGVERSION, &js_version) < 0)
@ -820,11 +820,11 @@ static void _EVT_pumpMessages(void)
release = c & 0x80; release = c & 0x80;
c &= 0x7F; c &= 0x7F;
// TODO: This is wrong! We need this to be the time stamp at /* TODO: This is wrong! We need this to be the time stamp at */
// ** interrupt ** time!! One solution would be to /* ** interrupt ** time!! One solution would be to */
// put the keyboard and mouse polling loops into /* put the keyboard and mouse polling loops into */
// a separate thread that can block on I/O to the /* a separate thread that can block on I/O to the */
// necessay file descriptor. /* necessay file descriptor. */
evt.when = _EVT_getTicks(); evt.when = _EVT_getTicks();
if (release) { if (release) {
@ -966,11 +966,11 @@ static void _EVT_pumpMessages(void)
evt.relative_x = dx; evt.relative_x = dx;
evt.relative_y = dy; evt.relative_y = dy;
// TODO: This is wrong! We need this to be the time stamp at /* TODO: This is wrong! We need this to be the time stamp at */
// ** interrupt ** time!! One solution would be to /* ** interrupt ** time!! One solution would be to */
// put the keyboard and mouse polling loops into /* put the keyboard and mouse polling loops into */
// a separate thread that can block on I/O to the /* a separate thread that can block on I/O to the */
// necessay file descriptor. /* necessay file descriptor. */
evt.when = _EVT_getTicks(); evt.when = _EVT_getTicks();
evt.modifiers = _PM_modifiers; evt.modifiers = _PM_modifiers;
if (buts & 4) if (buts & 4)
@ -1038,7 +1038,7 @@ static void _EVT_pumpMessages(void)
} }
#ifdef USE_OS_JOYSTICK #ifdef USE_OS_JOYSTICK
// Poll joystick events using the 1.x joystick driver API in the 2.2 kernels /* Poll joystick events using the 1.x joystick driver API in the 2.2 kernels */
if (js_version & ~0xffff) { if (js_version & ~0xffff) {
static struct js_event js; static struct js_event js;
@ -1318,7 +1318,7 @@ and this function can be used to resume it again later.
****************************************************************************/ ****************************************************************************/
void EVT_resume(void) void EVT_resume(void)
{ {
// Do nothing for Linux /* Do nothing for Linux */
} }
/**************************************************************************** /****************************************************************************
@ -1328,7 +1328,7 @@ de-install the event handling code.
****************************************************************************/ ****************************************************************************/
void EVT_suspend(void) void EVT_suspend(void)
{ {
// Do nothing for Linux /* Do nothing for Linux */
} }
/**************************************************************************** /****************************************************************************
@ -1358,4 +1358,3 @@ void EVT_exit(void)
} }
#endif #endif
} }

View File

@ -58,4 +58,3 @@ void _PM_keyboard_rawmode(void);
/* Linux needs the generic joystick scaling code */ /* Linux needs the generic joystick scaling code */
#define NEED_SCALE_JOY_AXIS #define NEED_SCALE_JOY_AXIS

View File

@ -562,37 +562,37 @@ int PMAPI PM_getch(void)
c &= 0x7F; c &= 0x7F;
if (release) { if (release) {
switch(c){ switch(c){
case 42: case 54: // Shift case 42: case 54: /* Shift */
_PM_modifiers &= ~KB_SHIFT; _PM_modifiers &= ~KB_SHIFT;
break; break;
case 29: case 97: // Control case 29: case 97: /* Control */
_PM_modifiers &= ~KB_CONTROL; _PM_modifiers &= ~KB_CONTROL;
break; break;
case 56: case 100: // Alt / AltGr case 56: case 100: /* Alt / AltGr */
_PM_modifiers &= ~KB_ALT; _PM_modifiers &= ~KB_ALT;
break; break;
} }
continue; continue;
} }
switch (c) { switch (c) {
case 42: case 54: // Shift case 42: case 54: /* Shift */
_PM_modifiers |= KB_SHIFT; _PM_modifiers |= KB_SHIFT;
break; break;
case 29: case 97: // Control case 29: case 97: /* Control */
_PM_modifiers |= KB_CONTROL; _PM_modifiers |= KB_CONTROL;
break; break;
case 56: case 100: // Alt / AltGr case 56: case 100: /* Alt / AltGr */
_PM_modifiers |= KB_ALT; _PM_modifiers |= KB_ALT;
break; break;
case 58: // Caps Lock case 58: /* Caps Lock */
_PM_modifiers ^= KB_CAPS; _PM_modifiers ^= KB_CAPS;
ioctl(_PM_console_fd, KDSETLED, _PM_modifiers & 7); ioctl(_PM_console_fd, KDSETLED, _PM_modifiers & 7);
break; break;
case 69: // Num Lock case 69: /* Num Lock */
_PM_modifiers ^= KB_NUMLOCK; _PM_modifiers ^= KB_NUMLOCK;
ioctl(_PM_console_fd, KDSETLED, _PM_modifiers & 7); ioctl(_PM_console_fd, KDSETLED, _PM_modifiers & 7);
break; break;
case 70: // Scroll Lock case 70: /* Scroll Lock */
_PM_modifiers ^= KB_SCROLL; _PM_modifiers ^= KB_SCROLL;
ioctl(_PM_console_fd, KDSETLED, _PM_modifiers & 7); ioctl(_PM_console_fd, KDSETLED, _PM_modifiers & 7);
break; break;
@ -855,12 +855,12 @@ void PM_setOSScreenWidth(int width,int height)
struct winsize ws; struct winsize ws;
struct vt_sizes vs; struct vt_sizes vs;
// Resize the software terminal /* Resize the software terminal */
ws.ws_col = width; ws.ws_col = width;
ws.ws_row = height; ws.ws_row = height;
ioctl(_PM_console_fd, TIOCSWINSZ, &ws); ioctl(_PM_console_fd, TIOCSWINSZ, &ws);
// And the hardware /* And the hardware */
vs.v_rows = height; vs.v_rows = height;
vs.v_cols = width; vs.v_cols = width;
vs.v_scrollsize = 0; vs.v_scrollsize = 0;
@ -869,18 +869,18 @@ void PM_setOSScreenWidth(int width,int height)
ibool PMAPI PM_setRealTimeClockHandler(PM_intHandler ih, int frequency) ibool PMAPI PM_setRealTimeClockHandler(PM_intHandler ih, int frequency)
{ {
// TODO: Implement this for Linux /* TODO: Implement this for Linux */
return false; return false;
} }
void PMAPI PM_setRealTimeClockFrequency(int frequency) void PMAPI PM_setRealTimeClockFrequency(int frequency)
{ {
// TODO: Implement this for Linux /* TODO: Implement this for Linux */
} }
void PMAPI PM_restoreRealTimeClockHandler(void) void PMAPI PM_restoreRealTimeClockHandler(void)
{ {
// TODO: Implement this for Linux /* TODO: Implement this for Linux */
} }
char * PMAPI PM_getCurrentPath( char * PMAPI PM_getCurrentPath(
@ -978,27 +978,27 @@ void PMAPI PM_freePhysicalAddr(void *ptr,ulong limit)
ulong PMAPI PM_getPhysicalAddr(void *p) ulong PMAPI PM_getPhysicalAddr(void *p)
{ {
// TODO: This function should find the physical address of a linear /* TODO: This function should find the physical address of a linear */
// address. /* address. */
return 0xFFFFFFFFUL; return 0xFFFFFFFFUL;
} }
ibool PMAPI PM_getPhysicalAddrRange(void *p,ulong length,ulong *physAddress) ibool PMAPI PM_getPhysicalAddrRange(void *p,ulong length,ulong *physAddress)
{ {
// TODO: This function should find a range of physical addresses /* TODO: This function should find a range of physical addresses */
// for a linear address. /* for a linear address. */
return false; return false;
} }
void PMAPI PM_sleep(ulong milliseconds) void PMAPI PM_sleep(ulong milliseconds)
{ {
// TODO: Put the process to sleep for milliseconds /* TODO: Put the process to sleep for milliseconds */
} }
int PMAPI PM_getCOMPort(int port) int PMAPI PM_getCOMPort(int port)
{ {
// TODO: Re-code this to determine real values using the Plug and Play /* TODO: Re-code this to determine real values using the Plug and Play */
// manager for the OS. /* manager for the OS. */
switch (port) { switch (port) {
case 0: return 0x3F8; case 0: return 0x3F8;
case 1: return 0x2F8; case 1: return 0x2F8;
@ -1008,8 +1008,8 @@ int PMAPI PM_getCOMPort(int port)
int PMAPI PM_getLPTPort(int port) int PMAPI PM_getLPTPort(int port)
{ {
// TODO: Re-code this to determine real values using the Plug and Play /* TODO: Re-code this to determine real values using the Plug and Play */
// manager for the OS. /* manager for the OS. */
switch (port) { switch (port) {
case 0: return 0x3BC; case 0: return 0x3BC;
case 1: return 0x378; case 1: return 0x378;
@ -1558,26 +1558,26 @@ void PMAPI PM_availableMemory(ulong *physical,ulong *total)
void * PMAPI PM_allocLockedMem(uint size,ulong *physAddr,ibool contiguous,ibool below16M) void * PMAPI PM_allocLockedMem(uint size,ulong *physAddr,ibool contiguous,ibool below16M)
{ {
// TODO: Implement this for Linux /* TODO: Implement this for Linux */
return NULL; return NULL;
} }
void PMAPI PM_freeLockedMem(void *p,uint size,ibool contiguous) void PMAPI PM_freeLockedMem(void *p,uint size,ibool contiguous)
{ {
// TODO: Implement this for Linux /* TODO: Implement this for Linux */
} }
void * PMAPI PM_allocPage( void * PMAPI PM_allocPage(
ibool locked) ibool locked)
{ {
// TODO: Implement this for Linux /* TODO: Implement this for Linux */
return NULL; return NULL;
} }
void PMAPI PM_freePage( void PMAPI PM_freePage(
void *p) void *p)
{ {
// TODO: Implement this for Linux /* TODO: Implement this for Linux */
} }
void PMAPI PM_setBankA(int bank) void PMAPI PM_setBankA(int bank)
@ -1661,7 +1661,7 @@ int PMAPI PM_enableWriteCombine(ulong base,ulong length,uint type)
sentry.size = length; sentry.size = length;
sentry.type = type; sentry.type = type;
if (ioctl(mtrr_fd, MTRRIOC_ADD_ENTRY, &sentry) == -1) { if (ioctl(mtrr_fd, MTRRIOC_ADD_ENTRY, &sentry) == -1) {
// TODO: Need to decode MTRR error codes!! /* TODO: Need to decode MTRR error codes!! */
return PM_MTRR_NOT_SUPPORTED; return PM_MTRR_NOT_SUPPORTED;
} }
return PM_MTRR_ERR_OK; return PM_MTRR_ERR_OK;
@ -1690,8 +1690,8 @@ int PMAPI PM_enumWriteCombine(
for (gentry.regnum = 0; ioctl (mtrr_fd, MTRRIOC_GET_ENTRY, &gentry) == 0; for (gentry.regnum = 0; ioctl (mtrr_fd, MTRRIOC_GET_ENTRY, &gentry) == 0;
++gentry.regnum) { ++gentry.regnum) {
if (gentry.size > 0) { if (gentry.size > 0) {
// WARNING: This code assumes that the types in pmapi.h match the ones /* WARNING: This code assumes that the types in pmapi.h match the ones */
// in the Linux kernel (mtrr.h) /* in the Linux kernel (mtrr.h) */
callback(gentry.base, gentry.size, gentry.type); callback(gentry.base, gentry.size, gentry.type);
} }
} }
@ -1774,7 +1774,7 @@ int PMAPI PM_unlockCodePages(void (*p)(),uint len,PM_lockHandle *lh)
PM_MODULE PMAPI PM_loadLibrary( PM_MODULE PMAPI PM_loadLibrary(
const char *szDLLName) const char *szDLLName)
{ {
// TODO: Implement this to load shared libraries! /* TODO: Implement this to load shared libraries! */
(void)szDLLName; (void)szDLLName;
return NULL; return NULL;
} }
@ -1783,7 +1783,7 @@ void * PMAPI PM_getProcAddress(
PM_MODULE hModule, PM_MODULE hModule,
const char *szProcName) const char *szProcName)
{ {
// TODO: Implement this! /* TODO: Implement this! */
(void)hModule; (void)hModule;
(void)szProcName; (void)szProcName;
return NULL; return NULL;
@ -1792,19 +1792,18 @@ void * PMAPI PM_getProcAddress(
void PMAPI PM_freeLibrary( void PMAPI PM_freeLibrary(
PM_MODULE hModule) PM_MODULE hModule)
{ {
// TODO: Implement this! /* TODO: Implement this! */
(void)hModule; (void)hModule;
} }
int PMAPI PM_setIOPL( int PMAPI PM_setIOPL(
int level) int level)
{ {
// TODO: Move the IOPL switching into this function!! /* TODO: Move the IOPL switching into this function!! */
return level; return level;
} }
void PMAPI PM_flushTLB(void) void PMAPI PM_flushTLB(void)
{ {
// Do nothing on Linux. /* Do nothing on Linux. */
} }

View File

@ -62,4 +62,3 @@ Read the counter and return the counter value.
(t)->low = lt.LowPart; \ (t)->low = lt.LowPart; \
(t)->high = lt.HighPart; \ (t)->high = lt.HighPart; \
} }

View File

@ -43,7 +43,7 @@ We do have limited BIOS access under Windows NT device drivers.
****************************************************************************/ ****************************************************************************/
ibool PMAPI PM_haveBIOSAccess(void) ibool PMAPI PM_haveBIOSAccess(void)
{ {
// Return false unless we have full buffer passing! /* Return false unless we have full buffer passing! */
return false; return false;
} }
@ -63,8 +63,8 @@ void * PMAPI PM_getVESABuf(
uint *rseg, uint *rseg,
uint *roff) uint *roff)
{ {
// No buffers supported under Windows NT (Windows XP has them however if /* No buffers supported under Windows NT (Windows XP has them however if */
// we ever decide to support this!) /* we ever decide to support this!) */
return NULL; return NULL;
} }
@ -90,7 +90,7 @@ void * PMAPI PM_mapRealPointer(
uint r_seg, uint r_seg,
uint r_off) uint r_off)
{ {
// Not used for Windows NT drivers! /* Not used for Windows NT drivers! */
return NULL; return NULL;
} }
@ -103,7 +103,7 @@ void * PMAPI PM_allocRealSeg(
uint *r_seg, uint *r_seg,
uint *r_off) uint *r_off)
{ {
// Not supported in NT drivers /* Not supported in NT drivers */
(void)size; (void)size;
(void)r_seg; (void)r_seg;
(void)r_off; (void)r_off;
@ -117,7 +117,7 @@ Free a block of real mode memory.
void PMAPI PM_freeRealSeg( void PMAPI PM_freeRealSeg(
void *mem) void *mem)
{ {
// Not supported in NT drivers /* Not supported in NT drivers */
(void)mem; (void)mem;
} }
@ -129,7 +129,7 @@ void PMAPI DPMI_int86(
int intno, int intno,
DPMI_regs *regs) DPMI_regs *regs)
{ {
// Not used in NT drivers /* Not used in NT drivers */
} }
/**************************************************************************** /****************************************************************************
@ -143,7 +143,7 @@ void PMAPI PM_callRealMode(
RMREGS *regs, RMREGS *regs,
RMSREGS *sregs) RMSREGS *sregs)
{ {
// TODO!! /* TODO!! */
#if 0 #if 0
CLIENT_STRUCT saveRegs; CLIENT_STRUCT saveRegs;
@ -174,7 +174,7 @@ int PMAPI PM_int86(
RMREGS *in, RMREGS *in,
RMREGS *out) RMREGS *out)
{ {
// TODO!! /* TODO!! */
#if 0 #if 0
RMSREGS sregs = {0}; RMSREGS sregs = {0};
CLIENT_STRUCT saveRegs; CLIENT_STRUCT saveRegs;
@ -214,7 +214,7 @@ int PMAPI PM_int86x(
RMREGS *out, RMREGS *out,
RMSREGS *sregs) RMSREGS *sregs)
{ {
// TODO!! /* TODO!! */
#if 0 #if 0
CLIENT_STRUCT saveRegs; CLIENT_STRUCT saveRegs;
ushort oldDisable; ushort oldDisable;
@ -249,4 +249,3 @@ int PMAPI PM_int86x(
#endif #endif
return out->x.ax; return out->x.ax;
} }

View File

@ -140,4 +140,3 @@ void PMAPI PM_restoreRealTimeClockHandler(void)
_PM_rtcHandler = NULL; _PM_rtcHandler = NULL;
} }
} }

View File

@ -70,7 +70,7 @@ static memlocked locked[MAX_MEMORY_LOCKED];
ulong PMAPI _PM_getPDB(void); ulong PMAPI _PM_getPDB(void);
// Page table entry flags /* Page table entry flags */
#define PAGE_FLAGS_PRESENT 0x00000001 #define PAGE_FLAGS_PRESENT 0x00000001
#define PAGE_FLAGS_WRITEABLE 0x00000002 #define PAGE_FLAGS_WRITEABLE 0x00000002
@ -100,10 +100,10 @@ static ulong _PM_mapPhysicalToLinear(
ulong length = limit+1; ulong length = limit+1;
PHYSICAL_ADDRESS paIoBase = {0}; PHYSICAL_ADDRESS paIoBase = {0};
// NT loves large Ints /* NT loves large Ints */
paIoBase = RtlConvertUlongToLargeInteger( base ); paIoBase = RtlConvertUlongToLargeInteger( base );
// Map IO space into Kernel /* Map IO space into Kernel */
if (isCached) if (isCached)
return (ULONG)MmMapIoSpace(paIoBase, length, MmCached ); return (ULONG)MmMapIoSpace(paIoBase, length, MmCached );
else else
@ -149,12 +149,12 @@ static void _PM_adjustPageTables(
endPDB = ((linear+limit) >> 22) & 0x3FF; endPDB = ((linear+limit) >> 22) & 0x3FF;
endPage = ((linear+limit) >> 12) & 0x3FF; endPage = ((linear+limit) >> 12) & 0x3FF;
for (iPDB = startPDB; iPDB <= endPDB; iPDB++) { for (iPDB = startPDB; iPDB <= endPDB; iPDB++) {
// Set the bits in the page directory entry - required as per /* Set the bits in the page directory entry - required as per */
// Pentium 4 manual. This also takes care of the 4MB page entries /* Pentium 4 manual. This also takes care of the 4MB page entries */
pPDB[iPDB] = (pPDB[iPDB] & mask) | bits; pPDB[iPDB] = (pPDB[iPDB] & mask) | bits;
if (!(pPDB[iPDB] & PAGE_FLAGS_4MB)) { if (!(pPDB[iPDB] & PAGE_FLAGS_4MB)) {
// If we are dealing with 4KB pages then we need to iterate /* If we are dealing with 4KB pages then we need to iterate */
// through each of the page table entries /* through each of the page table entries */
pageTable = pPDB[iPDB] & ~0xFFF; pageTable = pPDB[iPDB] & ~0xFFF;
pPageTable = (ulong*)_PM_mapPhysicalToLinear(pageTable,0xFFF,true); pPageTable = (ulong*)_PM_mapPhysicalToLinear(pageTable,0xFFF,true);
start = (iPDB == startPDB) ? startPage : 0; start = (iPDB == startPDB) ? startPage : 0;
@ -183,7 +183,7 @@ void * PMAPI PM_mallocShared(
{ {
int i; int i;
// First find a free slot in our shared memory table /* First find a free slot in our shared memory table */
for (i = 0; i < MAX_MEMORY_SHARED; i++) { for (i = 0; i < MAX_MEMORY_SHARED; i++) {
if (shared[i].linear == 0) if (shared[i].linear == 0)
break; break;
@ -191,16 +191,16 @@ void * PMAPI PM_mallocShared(
if (i == MAX_MEMORY_SHARED) if (i == MAX_MEMORY_SHARED)
return NULL; return NULL;
// Allocate the paged pool /* Allocate the paged pool */
shared[i].linear = ExAllocatePool(PagedPool, size); shared[i].linear = ExAllocatePool(PagedPool, size);
// Create a list to manage this allocation /* Create a list to manage this allocation */
shared[i].pMdl = IoAllocateMdl(shared[i].linear,size,FALSE,FALSE,(PIRP) NULL); shared[i].pMdl = IoAllocateMdl(shared[i].linear,size,FALSE,FALSE,(PIRP) NULL);
// Lock this allocation in memory /* Lock this allocation in memory */
MmProbeAndLockPages(shared[i].pMdl,KernelMode,IoModifyAccess); MmProbeAndLockPages(shared[i].pMdl,KernelMode,IoModifyAccess);
// Modify bits to grant user access /* Modify bits to grant user access */
_PM_adjustPageTables((ulong)shared[i].linear, size, true, true); _PM_adjustPageTables((ulong)shared[i].linear, size, true, true);
return (void*)shared[i].linear; return (void*)shared[i].linear;
} }
@ -214,19 +214,19 @@ void PMAPI PM_freeShared(
{ {
int i; int i;
// Find a shared memory block in our table and free it /* Find a shared memory block in our table and free it */
for (i = 0; i < MAX_MEMORY_SHARED; i++) { for (i = 0; i < MAX_MEMORY_SHARED; i++) {
if (shared[i].linear == p) { if (shared[i].linear == p) {
// Unlock what we locked /* Unlock what we locked */
MmUnlockPages(shared[i].pMdl); MmUnlockPages(shared[i].pMdl);
// Free our MDL /* Free our MDL */
IoFreeMdl(shared[i].pMdl); IoFreeMdl(shared[i].pMdl);
// Free our mem /* Free our mem */
ExFreePool(shared[i].linear); ExFreePool(shared[i].linear);
// Flag that is entry is available /* Flag that is entry is available */
shared[i].linear = 0; shared[i].linear = 0;
break; break;
} }
@ -245,8 +245,8 @@ void * PMAPI PM_mapPhysicalAddr(
ulong linear,length = limit+1; ulong linear,length = limit+1;
int i; int i;
// Search table of existing mappings to see if we have already mapped /* Search table of existing mappings to see if we have already mapped */
// a region of memory that will serve this purpose. /* a region of memory that will serve this purpose. */
for (i = 0; i < numMappings; i++) { for (i = 0; i < numMappings; i++) {
if (maps[i].physical == base && maps[i].length == length && maps[i].isCached == isCached) { if (maps[i].physical == base && maps[i].length == length && maps[i].isCached == isCached) {
_PM_adjustPageTables((ulong)maps[i].linear, maps[i].length, true, isCached); _PM_adjustPageTables((ulong)maps[i].linear, maps[i].length, true, isCached);
@ -256,7 +256,7 @@ void * PMAPI PM_mapPhysicalAddr(
if (numMappings == MAX_MEMORY_MAPPINGS) if (numMappings == MAX_MEMORY_MAPPINGS)
return NULL; return NULL;
// We did not find any previously mapped memory region, so maps it in. /* We did not find any previously mapped memory region, so maps it in. */
if ((linear = _PM_mapPhysicalToLinear(base,limit,isCached)) == 0xFFFFFFFF) if ((linear = _PM_mapPhysicalToLinear(base,limit,isCached)) == 0xFFFFFFFF)
return NULL; return NULL;
maps[numMappings].physical = base; maps[numMappings].physical = base;
@ -265,7 +265,7 @@ void * PMAPI PM_mapPhysicalAddr(
maps[numMappings].isCached = isCached; maps[numMappings].isCached = isCached;
numMappings++; numMappings++;
// Grant user access to this I/O space /* Grant user access to this I/O space */
_PM_adjustPageTables((ulong)linear, length, true, isCached); _PM_adjustPageTables((ulong)linear, length, true, isCached);
return (void*)linear; return (void*)linear;
} }
@ -278,8 +278,8 @@ void PMAPI PM_freePhysicalAddr(
void *ptr, void *ptr,
ulong limit) ulong limit)
{ {
// We don't free the memory mappings in here because we cache all /* We don't free the memory mappings in here because we cache all */
// the memory mappings we create in the system for later use. /* the memory mappings we create in the system for later use. */
} }
/**************************************************************************** /****************************************************************************
@ -340,7 +340,7 @@ void * PMAPI PM_allocLockedMem(
int i; int i;
PHYSICAL_ADDRESS paOurAddress; PHYSICAL_ADDRESS paOurAddress;
// First find a free slot in our shared memory table /* First find a free slot in our shared memory table */
for (i = 0; i < MAX_MEMORY_LOCKED; i++) { for (i = 0; i < MAX_MEMORY_LOCKED; i++) {
if (locked[i].linear == 0) if (locked[i].linear == 0)
break; break;
@ -348,9 +348,9 @@ void * PMAPI PM_allocLockedMem(
if (i == MAX_MEMORY_LOCKED) if (i == MAX_MEMORY_LOCKED)
return NULL; return NULL;
// HighestAcceptableAddress - Specifies the highest valid physical address /* HighestAcceptableAddress - Specifies the highest valid physical address */
// the driver can use. For example, if a device can only reference physical /* the driver can use. For example, if a device can only reference physical */
// memory in the lower 16MB, this value would be set to 0x00000000FFFFFF. /* memory in the lower 16MB, this value would be set to 0x00000000FFFFFF. */
paOurAddress.HighPart = 0; paOurAddress.HighPart = 0;
if (below16M) if (below16M)
paOurAddress.LowPart = 0x00FFFFFF; paOurAddress.LowPart = 0x00FFFFFF;
@ -358,37 +358,37 @@ void * PMAPI PM_allocLockedMem(
paOurAddress.LowPart = 0xFFFFFFFF; paOurAddress.LowPart = 0xFFFFFFFF;
if (contiguous) { if (contiguous) {
// Allocate from the non-paged pool (unfortunately 4MB pages) /* Allocate from the non-paged pool (unfortunately 4MB pages) */
locked[i].linear = MmAllocateContiguousMemory(size, paOurAddress); locked[i].linear = MmAllocateContiguousMemory(size, paOurAddress);
if (!locked[i].linear) if (!locked[i].linear)
return NULL; return NULL;
// Flag no MDL /* Flag no MDL */
locked[i].pMdl = NULL; locked[i].pMdl = NULL;
// Map the physical address for the memory so we can manage /* Map the physical address for the memory so we can manage */
// the page tables in 4KB chunks mapped into user space. /* the page tables in 4KB chunks mapped into user space. */
// TODO: Map this with the physical address to the linear addresss /* TODO: Map this with the physical address to the linear addresss */
locked[i].mmIoMapped = locked[i].linear; locked[i].mmIoMapped = locked[i].linear;
// Modify bits to grant user access, flag not cached /* Modify bits to grant user access, flag not cached */
_PM_adjustPageTables((ulong)locked[i].mmIoMapped, size, true, false); _PM_adjustPageTables((ulong)locked[i].mmIoMapped, size, true, false);
return (void*)locked[i].mmIoMapped; return (void*)locked[i].mmIoMapped;
} }
else { else {
// Allocate from the paged pool /* Allocate from the paged pool */
locked[i].linear = ExAllocatePool(PagedPool, size); locked[i].linear = ExAllocatePool(PagedPool, size);
if (!locked[i].linear) if (!locked[i].linear)
return NULL; return NULL;
// Create a list to manage this allocation /* Create a list to manage this allocation */
locked[i].pMdl = IoAllocateMdl(locked[i].linear,size,FALSE,FALSE,(PIRP) NULL); locked[i].pMdl = IoAllocateMdl(locked[i].linear,size,FALSE,FALSE,(PIRP) NULL);
// Lock this allocation in memory /* Lock this allocation in memory */
MmProbeAndLockPages(locked[i].pMdl,KernelMode,IoModifyAccess); MmProbeAndLockPages(locked[i].pMdl,KernelMode,IoModifyAccess);
// Modify bits to grant user access, flag not cached /* Modify bits to grant user access, flag not cached */
_PM_adjustPageTables((ulong)locked[i].linear, size, true, false); _PM_adjustPageTables((ulong)locked[i].linear, size, true, false);
return (void*)locked[i].linear; return (void*)locked[i].linear;
} }
@ -408,22 +408,22 @@ void PMAPI PM_freeLockedMem(
/* Find a locked memory block in our table and free it */ /* Find a locked memory block in our table and free it */
for (i = 0; i < MAX_MEMORY_LOCKED; i++) { for (i = 0; i < MAX_MEMORY_LOCKED; i++) {
if (locked[i].linear == p) { if (locked[i].linear == p) {
// An Mdl indicates that we used the paged pool, and locked it, /* An Mdl indicates that we used the paged pool, and locked it, */
// so now we have to unlock, free the MDL, and free paged /* so now we have to unlock, free the MDL, and free paged */
if (locked[i].pMdl) { if (locked[i].pMdl) {
// Unlock what we locked and free the Mdl /* Unlock what we locked and free the Mdl */
MmUnlockPages(locked[i].pMdl); MmUnlockPages(locked[i].pMdl);
IoFreeMdl(locked[i].pMdl); IoFreeMdl(locked[i].pMdl);
ExFreePool(locked[i].linear); ExFreePool(locked[i].linear);
} }
else { else {
// TODO: Free the mmIoMap mapping for the memory! /* TODO: Free the mmIoMap mapping for the memory! */
// Free non-paged pool /* Free non-paged pool */
MmFreeContiguousMemory(locked[i].linear); MmFreeContiguousMemory(locked[i].linear);
} }
// Flag that is entry is available /* Flag that is entry is available */
locked[i].linear = 0; locked[i].linear = 0;
break; break;
} }
@ -437,8 +437,8 @@ Allocates a page aligned and page sized block of memory
void * PMAPI PM_allocPage( void * PMAPI PM_allocPage(
ibool locked) ibool locked)
{ {
// Allocate the memory from the non-paged pool if we want the memory /* Allocate the memory from the non-paged pool if we want the memory */
// to be locked. /* to be locked. */
return ExAllocatePool( return ExAllocatePool(
locked ? NonPagedPoolCacheAligned : PagedPoolCacheAligned, locked ? NonPagedPoolCacheAligned : PagedPoolCacheAligned,
PAGE_SIZE); PAGE_SIZE);
@ -465,11 +465,11 @@ int PMAPI PM_lockDataPages(
{ {
MDL *pMdl; MDL *pMdl;
// Create a list to manage this allocation /* Create a list to manage this allocation */
if ((pMdl = IoAllocateMdl(p,len,FALSE,FALSE,(PIRP)NULL)) == NULL) if ((pMdl = IoAllocateMdl(p,len,FALSE,FALSE,(PIRP)NULL)) == NULL)
return false; return false;
// Lock this allocation in memory /* Lock this allocation in memory */
MmProbeAndLockPages(pMdl,KernelMode,IoModifyAccess); MmProbeAndLockPages(pMdl,KernelMode,IoModifyAccess);
*((PMDL*)(&lh->h)) = pMdl; *((PMDL*)(&lh->h)) = pMdl;
return true; return true;
@ -485,7 +485,7 @@ int PMAPI PM_unlockDataPages(
PM_lockHandle *lh) PM_lockHandle *lh)
{ {
if (p && lh) { if (p && lh) {
// Unlock what we locked /* Unlock what we locked */
MDL *pMdl = *((PMDL*)(&lh->h)); MDL *pMdl = *((PMDL*)(&lh->h));
MmUnlockPages(pMdl); MmUnlockPages(pMdl);
IoFreeMdl(pMdl); IoFreeMdl(pMdl);
@ -516,4 +516,3 @@ int PMAPI PM_unlockCodePages(
{ {
return PM_unlockDataPages((void*)p,len,lh); return PM_unlockDataPages((void*)p,len,lh);
} }

View File

@ -42,5 +42,4 @@
UNICODE_STRING * _PM_CStringToUnicodeString(const char *cstr); UNICODE_STRING * _PM_CStringToUnicodeString(const char *cstr);
void _PM_FreeUnicodeString(UNICODE_STRING *uniStr); void _PM_FreeUnicodeString(UNICODE_STRING *uniStr);
#endif // __NTDRV_OSHDR_H #endif /* __NTDRV_OSHDR_H */

View File

@ -118,23 +118,23 @@ void PMAPI PM_fatalError(
if (fatalErrorCleanup) if (fatalErrorCleanup)
fatalErrorCleanup(); fatalErrorCleanup();
#ifdef DBG // Send output to debugger, just return so as not to force a reboot #ifdef DBG /* Send output to debugger, just return so as not to force a reboot */
#pragma message("INFO: building for debug, PM_fatalError() re-routed") #pragma message("INFO: building for debug, PM_fatalError() re-routed")
DBGMSG2("SDDHELP> PM_fatalError(): ERROR: %s\n", msg); DBGMSG2("SDDHELP> PM_fatalError(): ERROR: %s\n", msg);
return ; return ;
#endif #endif
// KeBugCheckEx brings down the system in a controlled /* KeBugCheckEx brings down the system in a controlled */
// manner when the caller discovers an unrecoverable /* manner when the caller discovers an unrecoverable */
// inconsistency that would corrupt the system if /* inconsistency that would corrupt the system if */
// the caller continued to run. /* the caller continued to run. */
// /* */
// hack - dump the first 20 chars in hex using the variables /* hack - dump the first 20 chars in hex using the variables */
// provided - Each ULONG is equal to four characters... /* provided - Each ULONG is equal to four characters... */
for(len = 0; len < 20; len++) for(len = 0; len < 20; len++)
if (msg[len] == (char)0) if (msg[len] == (char)0)
break; break;
// This looks bad but it's quick and reliable... /* This looks bad but it's quick and reliable... */
p = (char *)&BugCheckCode; p = (char *)&BugCheckCode;
if(len > 0) p[3] = msg[0]; if(len > 0) p[3] = msg[0];
if(len > 1) p[2] = msg[1]; if(len > 1) p[2] = msg[1];
@ -165,7 +165,7 @@ void PMAPI PM_fatalError(
if(len > 18) p[1] = msg[18]; if(len > 18) p[1] = msg[18];
if(len > 19) p[0] = msg[19]; if(len > 19) p[0] = msg[19];
// Halt the system! /* Halt the system! */
KeBugCheckEx(BugCheckCode, MoreBugCheckData[0], MoreBugCheckData[1], MoreBugCheckData[2], MoreBugCheckData[3]); KeBugCheckEx(BugCheckCode, MoreBugCheckData[0], MoreBugCheckData[1], MoreBugCheckData[2], MoreBugCheckData[3]);
} }
@ -209,14 +209,14 @@ static ibool REG_queryString(
STRING stringdata; STRING stringdata;
UNICODE_STRING unidata; UNICODE_STRING unidata;
// Convert strings to UniCode /* Convert strings to UniCode */
status = false; status = false;
if ((uniKey = _PM_CStringToUnicodeString(szKey)) == NULL) if ((uniKey = _PM_CStringToUnicodeString(szKey)) == NULL)
goto Exit; goto Exit;
if ((uniValue = _PM_CStringToUnicodeString(szValue)) == NULL) if ((uniValue = _PM_CStringToUnicodeString(szValue)) == NULL)
goto Exit; goto Exit;
// Open the key /* Open the key */
InitializeObjectAttributes( &keyAttributes, InitializeObjectAttributes( &keyAttributes,
uniKey, uniKey,
OBJ_CASE_INSENSITIVE, OBJ_CASE_INSENSITIVE,
@ -228,7 +228,7 @@ static ibool REG_queryString(
if (!NT_SUCCESS(rval)) if (!NT_SUCCESS(rval))
goto Exit; goto Exit;
// Query the value /* Query the value */
length = sizeof (KEY_VALUE_FULL_INFORMATION) length = sizeof (KEY_VALUE_FULL_INFORMATION)
+ size * sizeof(WCHAR); + size * sizeof(WCHAR);
if ((fullInfo = ExAllocatePool (PagedPool, length)) == NULL) if ((fullInfo = ExAllocatePool (PagedPool, length)) == NULL)
@ -241,12 +241,12 @@ static ibool REG_queryString(
length, length,
&length); &length);
if (NT_SUCCESS (rval)) { if (NT_SUCCESS (rval)) {
// Create the UniCode string so we can convert it /* Create the UniCode string so we can convert it */
unidata.Buffer = (PWCHAR)(((PCHAR)fullInfo) + fullInfo->DataOffset); unidata.Buffer = (PWCHAR)(((PCHAR)fullInfo) + fullInfo->DataOffset);
unidata.Length = (USHORT)fullInfo->DataLength; unidata.Length = (USHORT)fullInfo->DataLength;
unidata.MaximumLength = (USHORT)fullInfo->DataLength + sizeof(WCHAR); unidata.MaximumLength = (USHORT)fullInfo->DataLength + sizeof(WCHAR);
// Convert unicode univalue to ansi string. /* Convert unicode univalue to ansi string. */
rval = RtlUnicodeStringToAnsiString(&stringdata, &unidata, TRUE); rval = RtlUnicodeStringToAnsiString(&stringdata, &unidata, TRUE);
if (NT_SUCCESS(rval)) { if (NT_SUCCESS(rval)) {
strcpy(value,stringdata.Buffer); strcpy(value,stringdata.Buffer);
@ -345,7 +345,7 @@ Check if a key has been pressed.
****************************************************************************/ ****************************************************************************/
int PMAPI PM_kbhit(void) int PMAPI PM_kbhit(void)
{ {
// Not used in NT drivers /* Not used in NT drivers */
return true; return true;
} }
@ -355,7 +355,7 @@ Wait for and return the next keypress.
****************************************************************************/ ****************************************************************************/
int PMAPI PM_getch(void) int PMAPI PM_getch(void)
{ {
// Not used in NT drivers /* Not used in NT drivers */
return 0xD; return 0xD;
} }
@ -372,7 +372,7 @@ PM_HWND PMAPI PM_openConsole(
int bpp, int bpp,
ibool fullScreen) ibool fullScreen)
{ {
// Not used in NT drivers /* Not used in NT drivers */
(void)hwndUser; (void)hwndUser;
(void)device; (void)device;
(void)xRes; (void)xRes;
@ -388,7 +388,7 @@ Find the size of the console state buffer.
****************************************************************************/ ****************************************************************************/
int PMAPI PM_getConsoleStateSize(void) int PMAPI PM_getConsoleStateSize(void)
{ {
// Not used in NT drivers /* Not used in NT drivers */
return 1; return 1;
} }
@ -400,7 +400,7 @@ void PMAPI PM_saveConsoleState(
void *stateBuf, void *stateBuf,
PM_HWND hwndConsole) PM_HWND hwndConsole)
{ {
// Not used in NT drivers /* Not used in NT drivers */
(void)stateBuf; (void)stateBuf;
(void)hwndConsole; (void)hwndConsole;
} }
@ -412,7 +412,7 @@ Set the suspend application callback for the fullscreen console.
void PMAPI PM_setSuspendAppCallback( void PMAPI PM_setSuspendAppCallback(
PM_saveState_cb saveState) PM_saveState_cb saveState)
{ {
// Not used in NT drivers /* Not used in NT drivers */
(void)saveState; (void)saveState;
} }
@ -424,7 +424,7 @@ void PMAPI PM_restoreConsoleState(
const void *stateBuf, const void *stateBuf,
PM_HWND hwndConsole) PM_HWND hwndConsole)
{ {
// Not used in NT drivers /* Not used in NT drivers */
(void)stateBuf; (void)stateBuf;
(void)hwndConsole; (void)hwndConsole;
} }
@ -436,7 +436,7 @@ Close the fullscreen console.
void PMAPI PM_closeConsole( void PMAPI PM_closeConsole(
PM_HWND hwndConsole) PM_HWND hwndConsole)
{ {
// Not used in NT drivers /* Not used in NT drivers */
(void)hwndConsole; (void)hwndConsole;
} }
@ -475,7 +475,7 @@ void * PMAPI PM_mapToProcess(
void *base, void *base,
ulong limit) ulong limit)
{ {
// Not used anymore /* Not used anymore */
(void)base; (void)base;
(void)limit; (void)limit;
return NULL; return NULL;
@ -491,7 +491,7 @@ ibool PMAPI PM_doBIOSPOST(
void *mappedBIOS, void *mappedBIOS,
ulong BIOSLen) ulong BIOSLen)
{ {
// This may not be possible in NT and should be done by the OS anyway /* This may not be possible in NT and should be done by the OS anyway */
(void)axVal; (void)axVal;
(void)BIOSPhysAddr; (void)BIOSPhysAddr;
(void)mappedBIOS; (void)mappedBIOS;
@ -505,7 +505,7 @@ Return a pointer to the real mode BIOS data area.
****************************************************************************/ ****************************************************************************/
void * PMAPI PM_getBIOSPointer(void) void * PMAPI PM_getBIOSPointer(void)
{ {
// Note that on NT this probably does not do what we expect! /* Note that on NT this probably does not do what we expect! */
return PM_mapPhysicalAddr(0x400, 0x1000, true); return PM_mapPhysicalAddr(0x400, 0x1000, true);
} }
@ -525,7 +525,7 @@ Sleep for the specified number of milliseconds.
void PMAPI PM_sleep( void PMAPI PM_sleep(
ulong milliseconds) ulong milliseconds)
{ {
// We never use this in NT drivers /* We never use this in NT drivers */
(void)milliseconds; (void)milliseconds;
} }
@ -535,8 +535,8 @@ Return the base I/O port for the specified COM port.
****************************************************************************/ ****************************************************************************/
int PMAPI PM_getCOMPort(int port) int PMAPI PM_getCOMPort(int port)
{ {
// TODO: Re-code this to determine real values using the Plug and Play /* TODO: Re-code this to determine real values using the Plug and Play */
// manager for the OS. /* manager for the OS. */
switch (port) { switch (port) {
case 0: return 0x3F8; case 0: return 0x3F8;
case 1: return 0x2F8; case 1: return 0x2F8;
@ -552,8 +552,8 @@ Return the base I/O port for the specified LPT port.
****************************************************************************/ ****************************************************************************/
int PMAPI PM_getLPTPort(int port) int PMAPI PM_getLPTPort(int port)
{ {
// TODO: Re-code this to determine real values using the Plug and Play /* TODO: Re-code this to determine real values using the Plug and Play */
// manager for the OS. /* manager for the OS. */
switch (port) { switch (port) {
case 0: return 0x3BC; case 0: return 0x3BC;
case 1: return 0x378; case 1: return 0x378;
@ -580,7 +580,7 @@ OS specific shared libraries not supported inside a VxD
PM_MODULE PMAPI PM_loadLibrary( PM_MODULE PMAPI PM_loadLibrary(
const char *szDLLName) const char *szDLLName)
{ {
// Not used in NT drivers /* Not used in NT drivers */
(void)szDLLName; (void)szDLLName;
return NULL; return NULL;
} }
@ -593,7 +593,7 @@ void * PMAPI PM_getProcAddress(
PM_MODULE hModule, PM_MODULE hModule,
const char *szProcName) const char *szProcName)
{ {
// Not used in NT drivers /* Not used in NT drivers */
(void)hModule; (void)hModule;
(void)szProcName; (void)szProcName;
return NULL; return NULL;
@ -606,7 +606,7 @@ OS specific shared libraries not supported inside a VxD
void PMAPI PM_freeLibrary( void PMAPI PM_freeLibrary(
PM_MODULE hModule) PM_MODULE hModule)
{ {
// Not used in NT drivers /* Not used in NT drivers */
(void)hModule; (void)hModule;
} }
@ -618,9 +618,9 @@ void *PMAPI PM_findFirstFile(
const char *filename, const char *filename,
PM_findData *findData) PM_findData *findData)
{ {
// TODO: This function should start a directory enumeration search /* TODO: This function should start a directory enumeration search */
// given the filename (with wildcards). The data should be /* given the filename (with wildcards). The data should be */
// converted and returned in the findData standard form. /* converted and returned in the findData standard form. */
(void)filename; (void)filename;
(void)findData; (void)findData;
return PM_FILE_INVALID; return PM_FILE_INVALID;
@ -634,10 +634,10 @@ ibool PMAPI PM_findNextFile(
void *handle, void *handle,
PM_findData *findData) PM_findData *findData)
{ {
// TODO: This function should find the next file in directory enumeration /* TODO: This function should find the next file in directory enumeration */
// search given the search criteria defined in the call to /* search given the search criteria defined in the call to */
// PM_findFirstFile. The data should be converted and returned /* PM_findFirstFile. The data should be converted and returned */
// in the findData standard form. /* in the findData standard form. */
(void)handle; (void)handle;
(void)findData; (void)findData;
return false; return false;
@ -650,8 +650,8 @@ Function to close the find process
void PMAPI PM_findClose( void PMAPI PM_findClose(
void *handle) void *handle)
{ {
// TODO: This function should close the find process. This may do /* TODO: This function should close the find process. This may do */
// nothing for some OS'es. /* nothing for some OS'es. */
(void)handle; (void)handle;
} }
@ -671,7 +671,7 @@ numbering is:
ibool PMAPI PM_driveValid( ibool PMAPI PM_driveValid(
char drive) char drive)
{ {
// Not supported in NT drivers /* Not supported in NT drivers */
(void)drive; (void)drive;
return false; return false;
} }
@ -687,7 +687,7 @@ void PMAPI PM_getdcwd(
char *dir, char *dir,
int len) int len)
{ {
// Not supported in NT drivers /* Not supported in NT drivers */
(void)drive; (void)drive;
(void)dir; (void)dir;
(void)len; (void)len;
@ -733,7 +733,7 @@ void PMAPI PM_setFileAttr(
char kernelFilename[PM_MAX_PATH+5]; char kernelFilename[PM_MAX_PATH+5];
ULONG FileAttributes = 0; ULONG FileAttributes = 0;
// Convert file attribute flags /* Convert file attribute flags */
if (attrib & PM_FILE_READONLY) if (attrib & PM_FILE_READONLY)
FileAttributes |= FILE_ATTRIBUTE_READONLY; FileAttributes |= FILE_ATTRIBUTE_READONLY;
if (attrib & PM_FILE_ARCHIVE) if (attrib & PM_FILE_ARCHIVE)
@ -743,15 +743,15 @@ void PMAPI PM_setFileAttr(
if (attrib & PM_FILE_SYSTEM) if (attrib & PM_FILE_SYSTEM)
FileAttributes |= FILE_ATTRIBUTE_SYSTEM; FileAttributes |= FILE_ATTRIBUTE_SYSTEM;
// Add prefix for addressing the file system. "\??\" is short for "\DosDevices\" /* Add prefix for addressing the file system. "\??\" is short for "\DosDevices\" */
strcpy(kernelFilename, "\\??\\"); strcpy(kernelFilename, "\\??\\");
strcat(kernelFilename, filename); strcat(kernelFilename, filename);
// Convert filename string to ansi string /* Convert filename string to ansi string */
if ((uniFile = _PM_CStringToUnicodeString(kernelFilename)) == NULL) if ((uniFile = _PM_CStringToUnicodeString(kernelFilename)) == NULL)
goto Exit; goto Exit;
// Must open a file to query it's attributes /* Must open a file to query it's attributes */
InitializeObjectAttributes (&ObjectAttributes, InitializeObjectAttributes (&ObjectAttributes,
uniFile, uniFile,
OBJ_CASE_INSENSITIVE, OBJ_CASE_INSENSITIVE,
@ -761,18 +761,18 @@ void PMAPI PM_setFileAttr(
DesiredAccess | SYNCHRONIZE, DesiredAccess | SYNCHRONIZE,
&ObjectAttributes, &ObjectAttributes,
&IoStatusBlock, &IoStatusBlock,
NULL, //AllocationSize OPTIONAL, NULL, /*AllocationSize OPTIONAL, */
FILE_ATTRIBUTE_NORMAL, FILE_ATTRIBUTE_NORMAL,
ShareAccess, ShareAccess,
CreateDisposition, CreateDisposition,
FILE_RANDOM_ACCESS, //CreateOptions, FILE_RANDOM_ACCESS, /*CreateOptions, */
NULL, //EaBuffer OPTIONAL, NULL, /*EaBuffer OPTIONAL, */
0 //EaLength (required if EaBuffer) 0 /*EaLength (required if EaBuffer) */
); );
if (!NT_SUCCESS (status)) if (!NT_SUCCESS (status))
goto Exit; goto Exit;
// Query timestamps /* Query timestamps */
status = ZwQueryInformationFile(FileHandle, status = ZwQueryInformationFile(FileHandle,
&IoStatusBlock, &IoStatusBlock,
&FileBasic, &FileBasic,
@ -782,12 +782,12 @@ void PMAPI PM_setFileAttr(
if (!NT_SUCCESS (status)) if (!NT_SUCCESS (status))
goto Exit; goto Exit;
// Change the four bits we change /* Change the four bits we change */
FileBasic.FileAttributes &= ~(FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_ARCHIVE FileBasic.FileAttributes &= ~(FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_ARCHIVE
| FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM); | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM);
FileBasic.FileAttributes |= FileAttributes; FileBasic.FileAttributes |= FileAttributes;
// Set timestamps /* Set timestamps */
ZwSetInformationFile( FileHandle, ZwSetInformationFile( FileHandle,
&IoStatusBlock, &IoStatusBlock,
&FileBasic, &FileBasic,
@ -821,15 +821,15 @@ uint PMAPI PM_getFileAttr(
ULONG FileAttributes = 0; ULONG FileAttributes = 0;
uint retval = 0; uint retval = 0;
// Add prefix for addressing the file system. "\??\" is short for "\DosDevices\" /* Add prefix for addressing the file system. "\??\" is short for "\DosDevices\" */
strcpy(kernelFilename, "\\??\\"); strcpy(kernelFilename, "\\??\\");
strcat(kernelFilename, filename); strcat(kernelFilename, filename);
// Convert filename string to ansi string /* Convert filename string to ansi string */
if ((uniFile = _PM_CStringToUnicodeString(kernelFilename)) == NULL) if ((uniFile = _PM_CStringToUnicodeString(kernelFilename)) == NULL)
goto Exit; goto Exit;
// Must open a file to query it's attributes /* Must open a file to query it's attributes */
InitializeObjectAttributes (&ObjectAttributes, InitializeObjectAttributes (&ObjectAttributes,
uniFile, uniFile,
OBJ_CASE_INSENSITIVE, OBJ_CASE_INSENSITIVE,
@ -839,18 +839,18 @@ uint PMAPI PM_getFileAttr(
DesiredAccess | SYNCHRONIZE, DesiredAccess | SYNCHRONIZE,
&ObjectAttributes, &ObjectAttributes,
&IoStatusBlock, &IoStatusBlock,
NULL, //AllocationSize OPTIONAL, NULL, /*AllocationSize OPTIONAL, */
FILE_ATTRIBUTE_NORMAL, FILE_ATTRIBUTE_NORMAL,
ShareAccess, ShareAccess,
CreateDisposition, CreateDisposition,
FILE_RANDOM_ACCESS, //CreateOptions, FILE_RANDOM_ACCESS, /*CreateOptions, */
NULL, //EaBuffer OPTIONAL, NULL, /*EaBuffer OPTIONAL, */
0 //EaLength (required if EaBuffer) 0 /*EaLength (required if EaBuffer) */
); );
if (!NT_SUCCESS (status)) if (!NT_SUCCESS (status))
goto Exit; goto Exit;
// Query timestamps /* Query timestamps */
status = ZwQueryInformationFile(FileHandle, status = ZwQueryInformationFile(FileHandle,
&IoStatusBlock, &IoStatusBlock,
&FileBasic, &FileBasic,
@ -860,7 +860,7 @@ uint PMAPI PM_getFileAttr(
if (!NT_SUCCESS (status)) if (!NT_SUCCESS (status))
goto Exit; goto Exit;
// Translate the file attributes /* Translate the file attributes */
if (FileBasic.FileAttributes & FILE_ATTRIBUTE_READONLY) if (FileBasic.FileAttributes & FILE_ATTRIBUTE_READONLY)
retval |= PM_FILE_READONLY; retval |= PM_FILE_READONLY;
if (FileBasic.FileAttributes & FILE_ATTRIBUTE_ARCHIVE) if (FileBasic.FileAttributes & FILE_ATTRIBUTE_ARCHIVE)
@ -883,7 +883,7 @@ Function to create a directory.
ibool PMAPI PM_mkdir( ibool PMAPI PM_mkdir(
const char *filename) const char *filename)
{ {
// Not supported in NT drivers /* Not supported in NT drivers */
(void)filename; (void)filename;
return false; return false;
} }
@ -895,7 +895,7 @@ Function to remove a directory.
ibool PMAPI PM_rmdir( ibool PMAPI PM_rmdir(
const char *filename) const char *filename)
{ {
// Not supported in NT drivers /* Not supported in NT drivers */
(void)filename; (void)filename;
return false; return false;
} }
@ -909,7 +909,7 @@ ibool PMAPI PM_getFileTime(
ibool gmTime, ibool gmTime,
PM_time *time) PM_time *time)
{ {
// Not supported in NT drivers /* Not supported in NT drivers */
(void)filename; (void)filename;
(void)gmTime; (void)gmTime;
(void)time; (void)time;
@ -925,10 +925,9 @@ ibool PMAPI PM_setFileTime(
ibool gmTime, ibool gmTime,
PM_time *time) PM_time *time)
{ {
// Not supported in NT drivers /* Not supported in NT drivers */
(void)filename; (void)filename;
(void)gmTime; (void)gmTime;
(void)time; (void)time;
return false; return false;
} }

View File

@ -42,7 +42,7 @@ FILE * fopen(
const char *filename, const char *filename,
const char *mode) const char *mode)
{ {
ACCESS_MASK DesiredAccess; // for ZwCreateFile... ACCESS_MASK DesiredAccess; /* for ZwCreateFile... */
OBJECT_ATTRIBUTES ObjectAttributes; OBJECT_ATTRIBUTES ObjectAttributes;
ULONG ShareAccess; ULONG ShareAccess;
ULONG CreateDisposition; ULONG CreateDisposition;
@ -56,7 +56,7 @@ FILE * fopen(
char kernelFilename[PM_MAX_PATH+5]; char kernelFilename[PM_MAX_PATH+5];
FILE *f; FILE *f;
// Add prefix for addressing the file system. "\??\" is short for "\DosDevices\" /* Add prefix for addressing the file system. "\??\" is short for "\DosDevices\" */
strcpy(kernelFilename, "\\??\\"); strcpy(kernelFilename, "\\??\\");
strcat(kernelFilename, filename); strcat(kernelFilename, filename);
if ((f = PM_malloc(sizeof(FILE))) == NULL) if ((f = PM_malloc(sizeof(FILE))) == NULL)
@ -65,32 +65,32 @@ FILE * fopen(
f->text = (mode[1] == 't' || mode[2] == 't'); f->text = (mode[1] == 't' || mode[2] == 't');
f->writemode = (mode[0] == 'w') || (mode[0] == 'a'); f->writemode = (mode[0] == 'w') || (mode[0] == 'a');
if (mode[0] == 'r') { if (mode[0] == 'r') {
// omode = OPEN_ACCESS_READONLY | OPEN_SHARE_COMPATIBLE; /* omode = OPEN_ACCESS_READONLY | OPEN_SHARE_COMPATIBLE; */
// action = ACTION_IFEXISTS_OPEN | ACTION_IFNOTEXISTS_FAIL; /* action = ACTION_IFEXISTS_OPEN | ACTION_IFNOTEXISTS_FAIL; */
DesiredAccess = GENERIC_READ; DesiredAccess = GENERIC_READ;
ShareAccess = FILE_SHARE_READ | FILE_SHARE_WRITE; ShareAccess = FILE_SHARE_READ | FILE_SHARE_WRITE;
CreateDisposition = FILE_OPEN; CreateDisposition = FILE_OPEN;
} }
else if (mode[0] == 'w') { else if (mode[0] == 'w') {
// omode = OPEN_ACCESS_WRITEONLY | OPEN_SHARE_COMPATIBLE; /* omode = OPEN_ACCESS_WRITEONLY | OPEN_SHARE_COMPATIBLE; */
// action = ACTION_IFEXISTS_TRUNCATE | ACTION_IFNOTEXISTS_CREATE; /* action = ACTION_IFEXISTS_TRUNCATE | ACTION_IFNOTEXISTS_CREATE; */
DesiredAccess = GENERIC_WRITE; DesiredAccess = GENERIC_WRITE;
ShareAccess = FILE_SHARE_READ | FILE_SHARE_WRITE; ShareAccess = FILE_SHARE_READ | FILE_SHARE_WRITE;
CreateDisposition = FILE_SUPERSEDE; CreateDisposition = FILE_SUPERSEDE;
} }
else { else {
// omode = OPEN_ACCESS_READWRITE | OPEN_SHARE_COMPATIBLE; /* omode = OPEN_ACCESS_READWRITE | OPEN_SHARE_COMPATIBLE; */
// action = ACTION_IFEXISTS_OPEN | ACTION_IFNOTEXISTS_CREATE; /* action = ACTION_IFEXISTS_OPEN | ACTION_IFNOTEXISTS_CREATE; */
DesiredAccess = GENERIC_READ | GENERIC_WRITE; DesiredAccess = GENERIC_READ | GENERIC_WRITE;
ShareAccess = FILE_SHARE_READ; ShareAccess = FILE_SHARE_READ;
CreateDisposition = FILE_OPEN_IF; CreateDisposition = FILE_OPEN_IF;
} }
// Convert filename string to ansi string and then to UniCode string /* Convert filename string to ansi string and then to UniCode string */
if ((uniFile = _PM_CStringToUnicodeString(kernelFilename)) == NULL) if ((uniFile = _PM_CStringToUnicodeString(kernelFilename)) == NULL)
return NULL; return NULL;
// Create the file /* Create the file */
InitializeObjectAttributes (&ObjectAttributes, InitializeObjectAttributes (&ObjectAttributes,
uniFile, uniFile,
OBJ_CASE_INSENSITIVE, OBJ_CASE_INSENSITIVE,
@ -100,19 +100,19 @@ FILE * fopen(
DesiredAccess | SYNCHRONIZE, DesiredAccess | SYNCHRONIZE,
&ObjectAttributes, &ObjectAttributes,
&IoStatusBlock, &IoStatusBlock,
NULL, // AllocationSize OPTIONAL, NULL, /* AllocationSize OPTIONAL, */
FILE_ATTRIBUTE_NORMAL, FILE_ATTRIBUTE_NORMAL,
ShareAccess, ShareAccess,
CreateDisposition, CreateDisposition,
FILE_RANDOM_ACCESS, // CreateOptions, FILE_RANDOM_ACCESS, /* CreateOptions, */
NULL, // EaBuffer OPTIONAL, NULL, /* EaBuffer OPTIONAL, */
0 // EaLength (required if EaBuffer) 0 /* EaLength (required if EaBuffer) */
); );
if (!NT_SUCCESS (status)) if (!NT_SUCCESS (status))
goto Error; goto Error;
f->handle = (int)FileHandle; f->handle = (int)FileHandle;
// Determine size of the file /* Determine size of the file */
status = ZwQueryInformationFile( FileHandle, status = ZwQueryInformationFile( FileHandle,
&IoStatusBlock, &IoStatusBlock,
&FileInformation, &FileInformation,
@ -123,7 +123,7 @@ FILE * fopen(
goto Error; goto Error;
f->filesize = FileInformation.EndOfFile.LowPart; f->filesize = FileInformation.EndOfFile.LowPart;
// Move to the end of the file if we are appending /* Move to the end of the file if we are appending */
if (mode[0] == 'a') { if (mode[0] == 'a') {
FilePosition.CurrentByteOffset.HighPart = 0; FilePosition.CurrentByteOffset.HighPart = 0;
FilePosition.CurrentByteOffset.LowPart = f->filesize; FilePosition.CurrentByteOffset.LowPart = f->filesize;
@ -158,18 +158,18 @@ size_t fread(
IO_STATUS_BLOCK IoStatusBlock; IO_STATUS_BLOCK IoStatusBlock;
LARGE_INTEGER ByteOffset; LARGE_INTEGER ByteOffset;
// Read any extra bytes from the file /* Read any extra bytes from the file */
ByteOffset.HighPart = 0; ByteOffset.HighPart = 0;
ByteOffset.LowPart = f->offset; ByteOffset.LowPart = f->offset;
status = ZwReadFile( (HANDLE)f->handle, status = ZwReadFile( (HANDLE)f->handle,
NULL, //IN HANDLE Event OPTIONAL, NULL, /*IN HANDLE Event OPTIONAL, */
NULL, // IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, NULL, /* IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, */
NULL, // IN PVOID ApcContext OPTIONAL, NULL, /* IN PVOID ApcContext OPTIONAL, */
&IoStatusBlock, &IoStatusBlock,
ptr, // OUT PVOID Buffer, ptr, /* OUT PVOID Buffer, */
size * n, //IN ULONG Length, size * n, /*IN ULONG Length, */
&ByteOffset, //OPTIONAL, &ByteOffset, /*OPTIONAL, */
NULL //IN PULONG Key OPTIONAL NULL /*IN PULONG Key OPTIONAL */
); );
if (!NT_SUCCESS (status)) if (!NT_SUCCESS (status))
return 0; return 0;
@ -196,14 +196,14 @@ size_t fwrite(
ByteOffset.HighPart = 0; ByteOffset.HighPart = 0;
ByteOffset.LowPart = f->offset; ByteOffset.LowPart = f->offset;
status = ZwWriteFile( (HANDLE)f->handle, status = ZwWriteFile( (HANDLE)f->handle,
NULL, //IN HANDLE Event OPTIONAL, NULL, /*IN HANDLE Event OPTIONAL, */
NULL, // IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, NULL, /* IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, */
NULL, // IN PVOID ApcContext OPTIONAL, NULL, /* IN PVOID ApcContext OPTIONAL, */
&IoStatusBlock, &IoStatusBlock,
(void*)ptr, // OUT PVOID Buffer, (void*)ptr, /* OUT PVOID Buffer, */
size * n, //IN ULONG Length, size * n, /*IN ULONG Length, */
&ByteOffset, //OPTIONAL, &ByteOffset, /*OPTIONAL, */
NULL //IN PULONG Key OPTIONAL NULL /*IN PULONG Key OPTIONAL */
); );
if (!NT_SUCCESS (status)) if (!NT_SUCCESS (status))
return 0; return 0;
@ -220,7 +220,7 @@ NT driver implementation of the ANSI C fflush function.
int fflush( int fflush(
FILE *f) FILE *f)
{ {
// Nothing to do here as we are not doing buffered I/O /* Nothing to do here as we are not doing buffered I/O */
(void)f; (void)f;
return 0; return 0;
} }
@ -289,11 +289,11 @@ char *fgets(
int len; int len;
char *cs; char *cs;
// Read the entire buffer into memory (our functions are unbuffered!) /* Read the entire buffer into memory (our functions are unbuffered!) */
if ((len = fread(s,1,n,f)) == 0) if ((len = fread(s,1,n,f)) == 0)
return NULL; return NULL;
// Search for '\n' or end of string /* Search for '\n' or end of string */
if (n > len) if (n > len)
n = len; n = len;
cs = s; cs = s;
@ -328,4 +328,3 @@ int fclose(
PM_free(f); PM_free(f);
return 0; return 0;
} }

View File

@ -102,11 +102,11 @@ UNICODE_STRING *_PM_CStringToUnicodeString(
ANSI_STRING ansiStr; ANSI_STRING ansiStr;
UNICODE_STRING *uniStr; UNICODE_STRING *uniStr;
// Allocate memory for the string structure /* Allocate memory for the string structure */
if ((uniStr = ExAllocatePool(NonPagedPool, sizeof(UNICODE_STRING))) == NULL) if ((uniStr = ExAllocatePool(NonPagedPool, sizeof(UNICODE_STRING))) == NULL)
return NULL; return NULL;
// Allocate memory for the wide string itself /* Allocate memory for the wide string itself */
length = (strlen(cstr) * sizeof(WCHAR)) + sizeof(WCHAR); length = (strlen(cstr) * sizeof(WCHAR)) + sizeof(WCHAR);
if ((uniStr->Buffer = ExAllocatePool(NonPagedPool, length)) == NULL) { if ((uniStr->Buffer = ExAllocatePool(NonPagedPool, length)) == NULL) {
ExFreePool(uniStr); ExFreePool(uniStr);
@ -116,7 +116,7 @@ UNICODE_STRING *_PM_CStringToUnicodeString(
uniStr->Length = 0; uniStr->Length = 0;
uniStr->MaximumLength = (USHORT)length; uniStr->MaximumLength = (USHORT)length;
// Convert filename string to ansi string and then to UniCode string /* Convert filename string to ansi string and then to UniCode string */
RtlInitAnsiString(&ansiStr, cstr); RtlInitAnsiString(&ansiStr, cstr);
RtlAnsiStringToUnicodeString(uniStr, &ansiStr, FALSE); RtlAnsiStringToUnicodeString(uniStr, &ansiStr, FALSE);
return uniStr; return uniStr;
@ -137,4 +137,3 @@ void _PM_FreeUnicodeString(
ExFreePool(uniStr); ExFreePool(uniStr);
} }
} }

View File

@ -121,4 +121,3 @@ passed, so if this happens we will be generating erronous results.
****************************************************************************/ ****************************************************************************/
ulong __ULZElapsedTime(ulong start,ulong finish) ulong __ULZElapsedTime(ulong start,ulong finish)
{ return finish - start; } { return finish - start; }

View File

@ -87,8 +87,8 @@ Converts a mickey movement value to a pixel adjustment value.
static int MickeyToPixel( static int MickeyToPixel(
int mickey) int mickey)
{ {
// TODO: We can add some code in here to handle 'acceleration' for /* TODO: We can add some code in here to handle 'acceleration' for */
// the mouse cursor. For now just use the mickeys. /* the mouse cursor. For now just use the mickeys. */
return mickey; return mickey;
} }
@ -369,15 +369,15 @@ static void _kbdMonThread(
continue; continue;
} }
//TODO: to be removed /*TODO: to be removed */
/* Skip extended scancodes & some others */ /* Skip extended scancodes & some others */
if (((kp.MonFlagWord >> 8) == 0xE0) || ((kp.KbdDDFlagWord & 0x0F) == 0x0F)) { if (((kp.MonFlagWord >> 8) == 0xE0) || ((kp.KbdDDFlagWord & 0x0F) == 0x0F)) {
DosMonWrite((PBYTE)&monOutbuf, (PBYTE)&kp, count); DosMonWrite((PBYTE)&monOutbuf, (PBYTE)&kp, count);
continue; continue;
} }
// printf("RawScan = %X, XlatedScan = %X, fbStatus = %X, KbdDDFlags = %X\n", /* printf("RawScan = %X, XlatedScan = %X, fbStatus = %X, KbdDDFlags = %X\n", */
// kp.MonFlagWord >> 8, kp.XlatedScan, kp.u.ShiftState, kp.KbdDDFlagWord); /* kp.MonFlagWord >> 8, kp.XlatedScan, kp.u.ShiftState, kp.KbdDDFlagWord); */
/* Protect access to buffer with mutex semaphore */ /* Protect access to buffer with mutex semaphore */
rc = DosRequestMutexSem(hmtxKeyBuf, 1000); rc = DosRequestMutexSem(hmtxKeyBuf, 1000);
@ -395,7 +395,7 @@ static void _kbdMonThread(
kpNew = 0; kpNew = 0;
if (kpNew != kpTail) { if (kpNew != kpTail) {
memcpy(&keyMonPkts[kpHead], &kp, sizeof(KEYPACKET)); memcpy(&keyMonPkts[kpHead], &kp, sizeof(KEYPACKET));
// TODO: fix this! /* TODO: fix this! */
/* Convert break to make code */ /* Convert break to make code */
keyMonPkts[kpHead].MonFlagWord &= 0x7FFF; keyMonPkts[kpHead].MonFlagWord &= 0x7FFF;
kpHead = kpNew; kpHead = kpNew;
@ -517,7 +517,7 @@ and this function can be used to resume it again later.
****************************************************************************/ ****************************************************************************/
void EVT_resume(void) void EVT_resume(void)
{ {
// Do nothing for OS/2 /* Do nothing for OS/2 */
} }
/**************************************************************************** /****************************************************************************
@ -527,7 +527,7 @@ de-install the event handling code.
****************************************************************************/ ****************************************************************************/
void EVT_suspend(void) void EVT_suspend(void)
{ {
// Do nothing for OS/2 /* Do nothing for OS/2 */
} }
/**************************************************************************** /****************************************************************************
@ -563,4 +563,3 @@ void EVT_exit(void)
DosCloseMutexSem(hmtxKeyBuf); DosCloseMutexSem(hmtxKeyBuf);
KbdFlushBuffer(0); KbdFlushBuffer(0);
} }

View File

@ -63,55 +63,55 @@ typedef struct _MLNPACKET {
USHORT KbdDDFlagWord; USHORT KbdDDFlagWord;
} MLNPACKET; } MLNPACKET;
// DBCSStatus /* DBCSStatus */
#define SF_SHIFTS 1 // If set to 1, shift status returned without a character #define SF_SHIFTS 1 /* If set to 1, shift status returned without a character */
#define SF_NOTCHAR 2 // 0 - Scan code is a character #define SF_NOTCHAR 2 /* 0 - Scan code is a character */
// 1 - Scan code is not a character; /* 1 - Scan code is not a character; */
// instead it is an extended key code from the keyboard. /* instead it is an extended key code from the keyboard. */
#define SF_IMMEDIATE 32 // If set to 1, immediate conversion requested #define SF_IMMEDIATE 32 /* If set to 1, immediate conversion requested */
#define SF_TYPEMASK 192 // Has the following values: #define SF_TYPEMASK 192 /* Has the following values: */
// 00 - Undefined /* 00 - Undefined */
// 01 - Final character; interim character flag is turned off /* 01 - Final character; interim character flag is turned off */
// 10 - Interim character /* 10 - Interim character */
// 11 - Final character; interim character flag is turned on. /* 11 - Final character; interim character flag is turned on. */
// MonFlagWord /* MonFlagWord */
#define MF_OPEN 1 // open #define MF_OPEN 1 /* open */
#define MF_CLOSE 2 // close #define MF_CLOSE 2 /* close */
#define MF_FLUSH 4 // is flush packet #define MF_FLUSH 4 /* is flush packet */
// KbdDDFlagWord /* KbdDDFlagWord */
#define KF_NOTSQPACKET 1024 // Don't put this packet in SQ buffer #define KF_NOTSQPACKET 1024 /* Don't put this packet in SQ buffer */
#define KF_ACCENTEDKEY 512 // Key was translated using previous accent. #define KF_ACCENTEDKEY 512 /* Key was translated using previous accent. */
#define KF_MULTIMAKE 256 // Key was repeated make of a toggle key. #define KF_MULTIMAKE 256 /* Key was repeated make of a toggle key. */
#define KF_SECONDARYKEY 128 // Previous scan code was the E0 prefix code. #define KF_SECONDARYKEY 128 /* Previous scan code was the E0 prefix code. */
#define KF_KEYBREAK 64 // This is the break of the key. #define KF_KEYBREAK 64 /* This is the break of the key. */
#define KF_KEYTYPEMASK 63 // Isolates the Key Type field of DDFlags. #define KF_KEYTYPEMASK 63 /* Isolates the Key Type field of DDFlags. */
#define KF_UNDEFKEY 63 // Key packet is undefined #define KF_UNDEFKEY 63 /* Key packet is undefined */
#define KF_SYSREQKEY 23 // This key packet is the SysReq key (4990) #define KF_SYSREQKEY 23 /* This key packet is the SysReq key (4990) */
#define KF_PRINTFLUSHKEY 22 // This packet is Ct-Alt-PrtScr #define KF_PRINTFLUSHKEY 22 /* This packet is Ct-Alt-PrtScr */
#define KF_PSPRINTECHOKEY 21 // This packet is Ctl-P #define KF_PSPRINTECHOKEY 21 /* This packet is Ctl-P */
#define KF_PRINTECHOKEY 20 // This packet is Ctl-PrtScr #define KF_PRINTECHOKEY 20 /* This packet is Ctl-PrtScr */
#define KF_PRTSCRKEY 19 // This packet is PrtScr #define KF_PRTSCRKEY 19 /* This packet is PrtScr */
#define KF_PSBREAKKEY 18 // This packet is Ctl-C #define KF_PSBREAKKEY 18 /* This packet is Ctl-C */
#define KF_BREAKKEY 17 // This packet is Ctl-Break #define KF_BREAKKEY 17 /* This packet is Ctl-Break */
#define KF_ACCENTKEY 16 // This packet is an accent key #define KF_ACCENTKEY 16 /* This packet is an accent key */
#define KF_XRORPNOT 13 // This packet is a Read or Peek Notification Pct. #define KF_XRORPNOT 13 /* This packet is a Read or Peek Notification Pct. */
#define KF_MLNOTIFICATION 14 // packet is a Multi-Layer NLS packet #define KF_MLNOTIFICATION 14 /* packet is a Multi-Layer NLS packet */
#define KF_HOTKEYPACKET 12 // This packet is the hot key. #define KF_HOTKEYPACKET 12 /* This packet is the hot key. */
#define KF_BADKEYCOMBO 11 // Accent/char combo undefined, beep only. #define KF_BADKEYCOMBO 11 /* Accent/char combo undefined, beep only. */
#define KF_WAKEUPKEY 10 // This packet is one following PAUSEKEY #define KF_WAKEUPKEY 10 /* This packet is one following PAUSEKEY */
#define KF_PSPAUSEKEY 9 // This packet is Ctl-S #define KF_PSPAUSEKEY 9 /* This packet is Ctl-S */
#define KF_PAUSEKEY 8 // This packet is Ctl-Numlock or PAUSE #define KF_PAUSEKEY 8 /* This packet is Ctl-Numlock or PAUSE */
#define KF_SHIFTMASK 7 // Key is a shift Key #define KF_SHIFTMASK 7 /* Key is a shift Key */
#define KF_DUMPKEY 6 // This packet is Ctl-Numlock-NumLock #define KF_DUMPKEY 6 /* This packet is Ctl-Numlock-NumLock */
#define KF_REBOOTKEY 5 // This packet is Ctl-Alt-Del #define KF_REBOOTKEY 5 /* This packet is Ctl-Alt-Del */
#define KF_RESENDCODE 4 // This packet is resend code from controller #define KF_RESENDCODE 4 /* This packet is resend code from controller */
#define KF_OVERRUNCODE 3 // This packet is overrun code from controller #define KF_OVERRUNCODE 3 /* This packet is overrun code from controller */
#define KF_SECPREFIXCODE 2 // This packet is E0/E1 scan code #define KF_SECPREFIXCODE 2 /* This packet is E0/E1 scan code */
#define KF_ACKCODE 1 // This packet is ack code from keyboard #define KF_ACKCODE 1 /* This packet is ack code from keyboard */
typedef struct _MONBUF { typedef struct _MONBUF {
@ -120,29 +120,29 @@ typedef struct _MONBUF {
BYTE Reserved[20]; BYTE Reserved[20];
} MONBUF; } MONBUF;
#define RS_SYSREG 32768 // Bit 15 SysReq key down #define RS_SYSREG 32768 /* Bit 15 SysReq key down */
#define RS_CAPSLOCK 16384 // Bit 14 Caps Lock key down #define RS_CAPSLOCK 16384 /* Bit 14 Caps Lock key down */
#define RS_NUMLOCK 8192 // Bit 13 NumLock key down #define RS_NUMLOCK 8192 /* Bit 13 NumLock key down */
#define RS_SCROLLLOCK 4096 // Bit 12 Scroll Lock key down #define RS_SCROLLLOCK 4096 /* Bit 12 Scroll Lock key down */
#define RS_RALT 2048 // Bit 11 Right Alt key down #define RS_RALT 2048 /* Bit 11 Right Alt key down */
#define RS_RCONTROL 1024 // Bit 10 Right Ctrl key down #define RS_RCONTROL 1024 /* Bit 10 Right Ctrl key down */
#define RS_LALT 512 // Bit 9 Left Alt key down #define RS_LALT 512 /* Bit 9 Left Alt key down */
#define RS_LCONTROL 256 // Bit 8 Left Ctrl key down #define RS_LCONTROL 256 /* Bit 8 Left Ctrl key down */
#define RS_INSERT 128 // Bit 7 Insert on #define RS_INSERT 128 /* Bit 7 Insert on */
#define RS_CAPS 64 // Bit 6 Caps Lock on #define RS_CAPS 64 /* Bit 6 Caps Lock on */
#define RS_NUM 32 // Bit 5 NumLock on #define RS_NUM 32 /* Bit 5 NumLock on */
#define RS_SCROLL 16 // Bit 4 Scroll Lock on #define RS_SCROLL 16 /* Bit 4 Scroll Lock on */
#define RS_ALT 8 // Bit 3 Either Alt key down #define RS_ALT 8 /* Bit 3 Either Alt key down */
#define RS_CONTROL 4 // Bit 2 Either Ctrl key down #define RS_CONTROL 4 /* Bit 2 Either Ctrl key down */
#define RS_LSHIFT 2 // Bit 1 Left Shift key down #define RS_LSHIFT 2 /* Bit 1 Left Shift key down */
#define RS_RSHIFT 1 // Bit 0 Right Shift key down #define RS_RSHIFT 1 /* Bit 0 Right Shift key down */
#define CS_RCONTROL 91 // Right Control #define CS_RCONTROL 91 /* Right Control */
#define CS_LSHIFT 42 // Left Shift #define CS_LSHIFT 42 /* Left Shift */
#define CS_RSHIFT 54 // Right Shift #define CS_RSHIFT 54 /* Right Shift */
#define CS_LALT 56 // Left Alt #define CS_LALT 56 /* Left Alt */
#define CS_RALT 94 // Right Alt #define CS_RALT 94 /* Right Alt */
/* DosMon* prototypes */ /* DosMon* prototypes */

View File

@ -39,4 +39,3 @@
#include "os2/mon.h" #include "os2/mon.h"
void __PM_checkConsoleSwitch(void); void __PM_checkConsoleSwitch(void);

View File

@ -116,16 +116,16 @@ typedef struct _VIDEO_ADAPTER {
/* PMIREQUEST_SOFTWAREINT structures from OS/2 DDK */ /* PMIREQUEST_SOFTWAREINT structures from OS/2 DDK */
typedef struct { typedef struct {
ULONG ulFlags; // VDM initialization type ULONG ulFlags; /* VDM initialization type */
#define VDM_POSTLOAD 0x1 // adapter just loaded, used internally for initialization #define VDM_POSTLOAD 0x1 /* adapter just loaded, used internally for initialization */
#define VDM_INITIALIZE 0x2 // force initialization of a permanently open VDM, even if previously initialized #define VDM_INITIALIZE 0x2 /* force initialization of a permanently open VDM, even if previously initialized */
#define VDM_TERMINATE_POSTINITIALIZE 0x6 //start VDM with initialization, but close it afterwards (includes VDM_INITIALIZE) #define VDM_TERMINATE_POSTINITIALIZE 0x6 /*start VDM with initialization, but close it afterwards (includes VDM_INITIALIZE) */
#define VDM_QUERY_CAPABILITY 0x10 // query the current int 10 capability #define VDM_QUERY_CAPABILITY 0x10 /* query the current int 10 capability */
#define VDM_FULL_VDM_CREATED 0x20 // a full VDM is created #define VDM_FULL_VDM_CREATED 0x20 /* a full VDM is created */
#define VDM_MINI_VDM_CREATED 0x40 // a mini VDM is created #define VDM_MINI_VDM_CREATED 0x40 /* a mini VDM is created */
#define VDM_MINI_VDM_SUPPORTED 0x80 // mini VDM support is available #define VDM_MINI_VDM_SUPPORTED 0x80 /* mini VDM support is available */
PCHAR szName; // VDM initialization program PCHAR szName; /* VDM initialization program */
PCHAR szArgs; // VDM initialization arguments PCHAR szArgs; /* VDM initialization arguments */
}INITVDM; }INITVDM;
typedef struct { typedef struct {
@ -218,7 +218,7 @@ typedef struct _SESWITCHREC {
HEV Event; /* Posted after callback is called */ HEV Event; /* Posted after callback is called */
} SESWITCHREC; } SESWITCHREC;
// Page sized block cache /* Page sized block cache */
#define PAGES_PER_BLOCK 32 #define PAGES_PER_BLOCK 32
#define PAGE_BLOCK_SIZE (PAGES_PER_BLOCK * PM_PAGE_SIZE + (PM_PAGE_SIZE-1) + sizeof(pageblock)) #define PAGE_BLOCK_SIZE (PAGES_PER_BLOCK * PM_PAGE_SIZE + (PM_PAGE_SIZE-1) + sizeof(pageblock))
@ -726,7 +726,7 @@ Set the suspend application callback for the fullscreen console.
void PMAPI PM_setSuspendAppCallback( void PMAPI PM_setSuspendAppCallback(
PM_saveState_cb saveState) PM_saveState_cb saveState)
{ {
// If PM isn't loaded, this stuff will cause crashes! /* If PM isn't loaded, this stuff will cause crashes! */
if (__isShellLoaded()) { if (__isShellLoaded()) {
if (saveState) { if (saveState) {
/* Create the threads responsible for tracking console switches */ /* Create the threads responsible for tracking console switches */
@ -813,7 +813,7 @@ ibool PMAPI PM_setRealTimeClockHandler(
PM_intHandler ih, PM_intHandler ih,
int frequency) int frequency)
{ {
// TODO: Implement this! /* TODO: Implement this! */
(void)ih; (void)ih;
(void)frequency; (void)frequency;
return false; return false;
@ -826,7 +826,7 @@ Set the real time clock frequency (for stereo modes).
void PMAPI PM_setRealTimeClockFrequency( void PMAPI PM_setRealTimeClockFrequency(
int frequency) int frequency)
{ {
// TODO: Implement this! /* TODO: Implement this! */
(void)frequency; (void)frequency;
} }
@ -836,7 +836,7 @@ Restore the original real time clock handler.
****************************************************************************/ ****************************************************************************/
void PMAPI PM_restoreRealTimeClockHandler(void) void PMAPI PM_restoreRealTimeClockHandler(void)
{ {
// TODO: Implement this! /* TODO: Implement this! */
} }
/**************************************************************************** /****************************************************************************
@ -1625,8 +1625,8 @@ int PMAPI PM_enableWriteCombine(
return MTRR_enableWriteCombine(base,size,type); return MTRR_enableWriteCombine(base,size,type);
} }
// TODO: Move the MTRR helper stuff into the call gate, or better yet /* TODO: Move the MTRR helper stuff into the call gate, or better yet */
// entirely into the ring 0 helper driver!! /* entirely into the ring 0 helper driver!! */
/* MTRR helper functions. To make it easier to implement the MTRR support /* MTRR helper functions. To make it easier to implement the MTRR support
* under OS/2, we simply put our ring 0 helper functions into the * under OS/2, we simply put our ring 0 helper functions into the
@ -1705,7 +1705,7 @@ void _ASMAPI _MTRR_writeMSR(
PM_MODULE PMAPI PM_loadLibrary( PM_MODULE PMAPI PM_loadLibrary(
const char *szDLLName) const char *szDLLName)
{ {
// TODO: Implement this to load shared libraries! /* TODO: Implement this to load shared libraries! */
(void)szDLLName; (void)szDLLName;
return NULL; return NULL;
} }
@ -1714,7 +1714,7 @@ void * PMAPI PM_getProcAddress(
PM_MODULE hModule, PM_MODULE hModule,
const char *szProcName) const char *szProcName)
{ {
// TODO: Implement this! /* TODO: Implement this! */
(void)hModule; (void)hModule;
(void)szProcName; (void)szProcName;
return NULL; return NULL;
@ -1723,7 +1723,7 @@ void * PMAPI PM_getProcAddress(
void PMAPI PM_freeLibrary( void PMAPI PM_freeLibrary(
PM_MODULE hModule) PM_MODULE hModule)
{ {
// TODO: Implement this! /* TODO: Implement this! */
(void)hModule; (void)hModule;
} }

View File

@ -59,7 +59,7 @@ Pumps all messages in the message queue from OS/2 into our event queue.
****************************************************************************/ ****************************************************************************/
static void _EVT_pumpMessages(void) static void _EVT_pumpMessages(void)
{ {
// TODO: Implement this for OS/2 Presentation Manager apps! /* TODO: Implement this for OS/2 Presentation Manager apps! */
} }
/**************************************************************************** /****************************************************************************
@ -105,7 +105,7 @@ void EVTAPI EVT_init(
oldKeyMessage = 0; oldKeyMessage = 0;
memset(keyUpMsg,0,sizeof(keyUpMsg)); memset(keyUpMsg,0,sizeof(keyUpMsg));
// TODO: OS/2 PM specific initialisation code! /* TODO: OS/2 PM specific initialisation code! */
/* Catch program termination signals so we can clean up properly */ /* Catch program termination signals so we can clean up properly */
signal(SIGABRT, _EVT_abort); signal(SIGABRT, _EVT_abort);
@ -135,7 +135,7 @@ and this function can be used to resume it again later.
****************************************************************************/ ****************************************************************************/
void EVT_resume(void) void EVT_resume(void)
{ {
// Do nothing for OS/2 /* Do nothing for OS/2 */
} }
/**************************************************************************** /****************************************************************************
@ -145,7 +145,7 @@ de-install the event handling code.
****************************************************************************/ ****************************************************************************/
void EVT_suspend(void) void EVT_suspend(void)
{ {
// Do nothing for OS/2 /* Do nothing for OS/2 */
} }
/**************************************************************************** /****************************************************************************
@ -159,7 +159,7 @@ void EVT_exit(void)
signal(SIGFPE, SIG_DFL); signal(SIGFPE, SIG_DFL);
signal(SIGINT, SIG_DFL); signal(SIGINT, SIG_DFL);
// TODO: OS/2 PM specific exit code /* TODO: OS/2 PM specific exit code */
} }
/**************************************************************************** /****************************************************************************

View File

@ -230,8 +230,8 @@ void EVTAPI EVT_setMouseRange(
int xRes, int xRes,
int yRes) int yRes)
{ {
// TODO: Need to call Input to change the coordinates that it returns /* TODO: Need to call Input to change the coordinates that it returns */
// for mouse events!! /* for mouse events!! */
} }
/**************************************************************************** /****************************************************************************
@ -242,7 +242,7 @@ and this function can be used to resume it again later.
****************************************************************************/ ****************************************************************************/
void EVT_resume(void) void EVT_resume(void)
{ {
// Do nothing for Photon /* Do nothing for Photon */
} }
/**************************************************************************** /****************************************************************************
@ -252,7 +252,7 @@ de-install the event handling code.
****************************************************************************/ ****************************************************************************/
void EVT_suspend(void) void EVT_suspend(void)
{ {
// Do nothing for Photon /* Do nothing for Photon */
} }
/**************************************************************************** /****************************************************************************

View File

@ -37,7 +37,7 @@
#ifndef __QNXNTO__ #ifndef __QNXNTO__
static struct _mouse_ctrl *_PM_mouse_ctl; static struct _mouse_ctrl *_PM_mouse_ctl;
static int _PM_keyboard_fd = -1; static int _PM_keyboard_fd = -1;
//static int _PM_modifiers, _PM_leds; /*static int _PM_modifiers, _PM_leds; */
#else #else
static int kbd_fd = -1, mouse_fd = -1; static int kbd_fd = -1, mouse_fd = -1;
#endif #endif
@ -58,7 +58,7 @@ typedef struct {
int map; int map;
} keymap; } keymap;
// TODO: Fix this and set it up so we can do a binary search! /* TODO: Fix this and set it up so we can do a binary search! */
keymap keymaps[] = { keymap keymaps[] = {
{96, KB_padEnter}, {96, KB_padEnter},
@ -146,8 +146,8 @@ Converts a mickey movement value to a pixel adjustment value.
static int MickeyToPixel( static int MickeyToPixel(
int mickey) int mickey)
{ {
// TODO: We can add some code in here to handle 'acceleration' for /* TODO: We can add some code in here to handle 'acceleration' for */
// the mouse cursor. For now just use the mickeys. /* the mouse cursor. For now just use the mickeys. */
return mickey; return mickey;
} }
@ -532,7 +532,7 @@ and this function can be used to resume it again later.
****************************************************************************/ ****************************************************************************/
void EVT_resume(void) void EVT_resume(void)
{ {
// Do nothing for QNX /* Do nothing for QNX */
} }
/**************************************************************************** /****************************************************************************
@ -542,7 +542,7 @@ de-install the event handling code.
****************************************************************************/ ****************************************************************************/
void EVT_suspend(void) void EVT_suspend(void)
{ {
// Do nothing for QNX /* Do nothing for QNX */
} }
/**************************************************************************** /****************************************************************************
@ -599,4 +599,3 @@ void EVT_exit(void)
kill_pid = 0; kill_pid = 0;
} }
} }

View File

@ -75,7 +75,7 @@ Return true if ring 0 (or if we can call the helpers functions at ring 0)
ibool _ASMAPI _MTRR_isRing0(void) ibool _ASMAPI _MTRR_isRing0(void)
{ {
#ifdef __QNXNTO__ #ifdef __QNXNTO__
return false; // Not implemented yet! return false; /* Not implemented yet! */
#else #else
return true; return true;
#endif #endif

View File

@ -320,18 +320,18 @@ void PM_setOSScreenWidth(int width,int height)
ibool PMAPI PM_setRealTimeClockHandler(PM_intHandler ih, int frequency) ibool PMAPI PM_setRealTimeClockHandler(PM_intHandler ih, int frequency)
{ {
// TODO: Implement this for QNX /* TODO: Implement this for QNX */
return false; return false;
} }
void PMAPI PM_setRealTimeClockFrequency(int frequency) void PMAPI PM_setRealTimeClockFrequency(int frequency)
{ {
// TODO: Implement this for QNX /* TODO: Implement this for QNX */
} }
void PMAPI PM_restoreRealTimeClockHandler(void) void PMAPI PM_restoreRealTimeClockHandler(void)
{ {
// TODO: Implement this for QNX /* TODO: Implement this for QNX */
} }
char * PMAPI PM_getCurrentPath( char * PMAPI PM_getCurrentPath(
@ -504,8 +504,8 @@ void PMAPI PM_freePhysicalAddr(void *ptr,ulong limit)
ulong PMAPI PM_getPhysicalAddr(void *p) ulong PMAPI PM_getPhysicalAddr(void *p)
{ {
// TODO: This function should find the physical address of a linear /* TODO: This function should find the physical address of a linear */
// address. /* address. */
return 0xFFFFFFFFUL; return 0xFFFFFFFFUL;
} }
@ -514,19 +514,19 @@ ibool PMAPI PM_getPhysicalAddrRange(
ulong length, ulong length,
ulong *physAddress) ulong *physAddress)
{ {
// TODO: Implement this! /* TODO: Implement this! */
return false; return false;
} }
void PMAPI PM_sleep(ulong milliseconds) void PMAPI PM_sleep(ulong milliseconds)
{ {
// TODO: Put the process to sleep for milliseconds /* TODO: Put the process to sleep for milliseconds */
} }
int PMAPI PM_getCOMPort(int port) int PMAPI PM_getCOMPort(int port)
{ {
// TODO: Re-code this to determine real values using the Plug and Play /* TODO: Re-code this to determine real values using the Plug and Play */
// manager for the OS. /* manager for the OS. */
switch (port) { switch (port) {
case 0: return 0x3F8; case 0: return 0x3F8;
case 1: return 0x2F8; case 1: return 0x2F8;
@ -536,8 +536,8 @@ int PMAPI PM_getCOMPort(int port)
int PMAPI PM_getLPTPort(int port) int PMAPI PM_getLPTPort(int port)
{ {
// TODO: Re-code this to determine real values using the Plug and Play /* TODO: Re-code this to determine real values using the Plug and Play */
// manager for the OS. /* manager for the OS. */
switch (port) { switch (port) {
case 0: return 0x3BC; case 0: return 0x3BC;
case 1: return 0x378; case 1: return 0x378;
@ -730,7 +730,7 @@ void * PMAPI PM_allocLockedMem(
ibool contiguous, ibool contiguous,
ibool below16M) ibool below16M)
{ {
// TODO: Implement this on QNX /* TODO: Implement this on QNX */
return NULL; return NULL;
} }
@ -739,20 +739,20 @@ void PMAPI PM_freeLockedMem(
uint size, uint size,
ibool contiguous) ibool contiguous)
{ {
// TODO: Implement this on QNX /* TODO: Implement this on QNX */
} }
void * PMAPI PM_allocPage( void * PMAPI PM_allocPage(
ibool locked) ibool locked)
{ {
// TODO: Implement this on QNX /* TODO: Implement this on QNX */
return NULL; return NULL;
} }
void PMAPI PM_freePage( void PMAPI PM_freePage(
void *p) void *p)
{ {
// TODO: Implement this on QNX /* TODO: Implement this on QNX */
} }
void PMAPI PM_setBankA(int bank) void PMAPI PM_setBankA(int bank)
@ -837,7 +837,7 @@ int PMAPI PM_unlockCodePages(void (*p)(),uint len,PM_lockHandle *lh)
PM_MODULE PMAPI PM_loadLibrary( PM_MODULE PMAPI PM_loadLibrary(
const char *szDLLName) const char *szDLLName)
{ {
// TODO: Implement this to load shared libraries! /* TODO: Implement this to load shared libraries! */
(void)szDLLName; (void)szDLLName;
return NULL; return NULL;
} }
@ -846,7 +846,7 @@ void * PMAPI PM_getProcAddress(
PM_MODULE hModule, PM_MODULE hModule,
const char *szProcName) const char *szProcName)
{ {
// TODO: Implement this! /* TODO: Implement this! */
(void)hModule; (void)hModule;
(void)szProcName; (void)szProcName;
return NULL; return NULL;
@ -855,14 +855,14 @@ void * PMAPI PM_getProcAddress(
void PMAPI PM_freeLibrary( void PMAPI PM_freeLibrary(
PM_MODULE hModule) PM_MODULE hModule)
{ {
// TODO: Implement this! /* TODO: Implement this! */
(void)hModule; (void)hModule;
} }
int PMAPI PM_setIOPL( int PMAPI PM_setIOPL(
int level) int level)
{ {
// QNX handles IOPL selection at the program link level. /* QNX handles IOPL selection at the program link level. */
return level; return level;
} }

View File

@ -261,7 +261,7 @@ and this function can be used to resume it again later.
****************************************************************************/ ****************************************************************************/
void EVT_resume(void) void EVT_resume(void)
{ {
// Do nothing for Win32 /* Do nothing for Win32 */
} }
/**************************************************************************** /****************************************************************************
@ -271,7 +271,7 @@ de-install the event handling code.
****************************************************************************/ ****************************************************************************/
void EVT_suspend(void) void EVT_suspend(void)
{ {
// Do nothing for Win32 /* Do nothing for Win32 */
} }
/**************************************************************************** /****************************************************************************

View File

@ -59,7 +59,7 @@ Initialise the PM library.
****************************************************************************/ ****************************************************************************/
void PMAPI PM_init(void) void PMAPI PM_init(void)
{ {
// TODO: dO any special init code in here. /* TODO: dO any special init code in here. */
MTRR_init(); MTRR_init();
} }
@ -114,8 +114,8 @@ void PMAPI PM_fatalError(
{ {
if (fatalErrorCleanup) if (fatalErrorCleanup)
fatalErrorCleanup(); fatalErrorCleanup();
// TODO: Display a fatal error message and exit! /* TODO: Display a fatal error message and exit! */
// MessageBox(NULL,msg,"Fatal Error!", MB_ICONEXCLAMATION); /* MessageBox(NULL,msg,"Fatal Error!", MB_ICONEXCLAMATION); */
exit(1); exit(1);
} }
@ -138,7 +138,7 @@ Check if a key has been pressed.
****************************************************************************/ ****************************************************************************/
int PMAPI PM_kbhit(void) int PMAPI PM_kbhit(void)
{ {
// TODO: Need to check if a key is waiting on the keyboard queue /* TODO: Need to check if a key is waiting on the keyboard queue */
return true; return true;
} }
@ -148,7 +148,7 @@ Wait for and return the next keypress.
****************************************************************************/ ****************************************************************************/
int PMAPI PM_getch(void) int PMAPI PM_getch(void)
{ {
// TODO: Need to obtain the next keypress, and block until one is hit /* TODO: Need to obtain the next keypress, and block until one is hit */
return 0xD; return 0xD;
} }
@ -240,7 +240,7 @@ Return the path to the Nucleus driver files.
****************************************************************************/ ****************************************************************************/
const char * PMAPI PM_getNucleusPath(void) const char * PMAPI PM_getNucleusPath(void)
{ {
// TODO: Point this at the path when the Nucleus drivers will be found /* TODO: Point this at the path when the Nucleus drivers will be found */
return "c:\\nucleus"; return "c:\\nucleus";
} }
@ -307,7 +307,7 @@ void * PMAPI PM_mapPhysicalAddr(
ulong limit, ulong limit,
ibool isCached) ibool isCached)
{ {
// TODO: Map a physical memory address to a linear address /* TODO: Map a physical memory address to a linear address */
return NULL; return NULL;
} }
@ -319,13 +319,13 @@ void PMAPI PM_freePhysicalAddr(
void *ptr, void *ptr,
ulong limit) ulong limit)
{ {
// TODO: Free the physical address mapping /* TODO: Free the physical address mapping */
} }
ulong PMAPI PM_getPhysicalAddr(void *p) ulong PMAPI PM_getPhysicalAddr(void *p)
{ {
// TODO: This function should find the physical address of a linear /* TODO: This function should find the physical address of a linear */
// address. /* address. */
return 0xFFFFFFFFUL; return 0xFFFFFFFFUL;
} }
@ -336,8 +336,8 @@ void PMAPI PM_sleep(ulong milliseconds)
int PMAPI PM_getCOMPort(int port) int PMAPI PM_getCOMPort(int port)
{ {
// TODO: Re-code this to determine real values using the Plug and Play /* TODO: Re-code this to determine real values using the Plug and Play */
// manager for the OS. /* manager for the OS. */
switch (port) { switch (port) {
case 0: return 0x3F8; case 0: return 0x3F8;
case 1: return 0x2F8; case 1: return 0x2F8;
@ -347,8 +347,8 @@ int PMAPI PM_getCOMPort(int port)
int PMAPI PM_getLPTPort(int port) int PMAPI PM_getLPTPort(int port)
{ {
// TODO: Re-code this to determine real values using the Plug and Play /* TODO: Re-code this to determine real values using the Plug and Play */
// manager for the OS. /* manager for the OS. */
switch (port) { switch (port) {
case 0: return 0x3BC; case 0: return 0x3BC;
case 1: return 0x378; case 1: return 0x378;
@ -484,8 +484,8 @@ void PMAPI PM_availableMemory(
ulong *physical, ulong *physical,
ulong *total) ulong *total)
{ {
// TODO: Figure out how to determine the available memory. Not entirely /* TODO: Figure out how to determine the available memory. Not entirely */
// critical so returning 0 is OK. /* critical so returning 0 is OK. */
*physical = *total = 0; *physical = *total = 0;
} }
@ -499,7 +499,7 @@ void * PMAPI PM_allocLockedMem(
ibool contiguous, ibool contiguous,
ibool below16M) ibool below16M)
{ {
// TODO: Allocate a block of locked, phsyically contigous memory for DMA /* TODO: Allocate a block of locked, phsyically contigous memory for DMA */
return 0; return 0;
} }
@ -513,7 +513,7 @@ void PMAPI PM_freeLockedMem(
ibool contiguous) ibool contiguous)
{ {
// TODO: Free a locked memory buffer /* TODO: Free a locked memory buffer */
} }
/**************************************************************************** /****************************************************************************
@ -564,7 +564,7 @@ ibool PMAPI PM_doBIOSPOST(
PM_MODULE PMAPI PM_loadLibrary( PM_MODULE PMAPI PM_loadLibrary(
const char *szDLLName) const char *szDLLName)
{ {
// TODO: Implement this to load shared libraries! /* TODO: Implement this to load shared libraries! */
(void)szDLLName; (void)szDLLName;
return NULL; return NULL;
} }
@ -573,7 +573,7 @@ void * PMAPI PM_getProcAddress(
PM_MODULE hModule, PM_MODULE hModule,
const char *szProcName) const char *szProcName)
{ {
// TODO: Implement this! /* TODO: Implement this! */
(void)hModule; (void)hModule;
(void)szProcName; (void)szProcName;
return NULL; return NULL;
@ -582,7 +582,7 @@ void * PMAPI PM_getProcAddress(
void PMAPI PM_freeLibrary( void PMAPI PM_freeLibrary(
PM_MODULE hModule) PM_MODULE hModule)
{ {
// TODO: Implement this! /* TODO: Implement this! */
(void)hModule; (void)hModule;
} }
@ -594,9 +594,9 @@ ulong PMAPI PM_findFirstFile(
const char *filename, const char *filename,
PM_findData *findData) PM_findData *findData)
{ {
// TODO: This function should start a directory enumeration search /* TODO: This function should start a directory enumeration search */
// given the filename (with wildcards). The data should be /* given the filename (with wildcards). The data should be */
// converted and returned in the findData standard form. /* converted and returned in the findData standard form. */
(void)filename; (void)filename;
(void)findData; (void)findData;
return PM_FILE_INVALID; return PM_FILE_INVALID;
@ -610,10 +610,10 @@ ibool PMAPI PM_findNextFile(
ulong handle, ulong handle,
PM_findData *findData) PM_findData *findData)
{ {
// TODO: This function should find the next file in directory enumeration /* TODO: This function should find the next file in directory enumeration */
// search given the search criteria defined in the call to /* search given the search criteria defined in the call to */
// PM_findFirstFile. The data should be converted and returned /* PM_findFirstFile. The data should be converted and returned */
// in the findData standard form. /* in the findData standard form. */
(void)handle; (void)handle;
(void)findData; (void)findData;
return false; return false;
@ -626,8 +626,8 @@ Function to close the find process
void PMAPI PM_findClose( void PMAPI PM_findClose(
ulong handle) ulong handle)
{ {
// TODO: This function should close the find process. This may do /* TODO: This function should close the find process. This may do */
// nothing for some OS'es. /* nothing for some OS'es. */
(void)handle; (void)handle;
} }
@ -675,7 +675,7 @@ void PMAPI PM_setFileAttr(
const char *filename, const char *filename,
uint attrib) uint attrib)
{ {
// TODO: Set the file attributes for a file /* TODO: Set the file attributes for a file */
(void)filename; (void)filename;
(void)attrib; (void)attrib;
} }

View File

@ -140,8 +140,8 @@ and we call the addMouseEvent() routine to add the appropriate mouse event
to the event queue. to the event queue.
Note: Interrupts are ON when this routine is called by the mouse driver code. Note: Interrupts are ON when this routine is called by the mouse driver code.
//AM: NOTE: This function has not actually been ported from DOS yet and should not /*AM: NOTE: This function has not actually been ported from DOS yet and should not */
//AM: be installed until it is. /*AM: be installed until it is. */
****************************************************************************/ ****************************************************************************/
static void EVTAPI mouseISR( static void EVTAPI mouseISR(
uint mask, uint mask,

View File

@ -165,8 +165,8 @@ void PMAPI PM_fatalError(const char *msg)
if (fatalErrorCleanup) if (fatalErrorCleanup)
fatalErrorCleanup(); fatalErrorCleanup();
MGLOutput(msg); MGLOutput(msg);
// No support for fprintf() under smx currently! /* No support for fprintf() under smx currently! */
// fprintf(stderr,"%s\n", msg); /* fprintf(stderr,"%s\n", msg); */
exit(1); exit(1);
} }
@ -614,9 +614,9 @@ ibool PMAPI PM_driveValid(
{ {
RMREGS regs; RMREGS regs;
regs.h.dl = (uchar)(drive - 'A' + 1); regs.h.dl = (uchar)(drive - 'A' + 1);
regs.h.ah = 0x36; // Get disk information service regs.h.ah = 0x36; /* Get disk information service */
PM_int86(0x21,&regs,&regs); PM_int86(0x21,&regs,&regs);
return regs.x.ax != 0xFFFF; // AX = 0xFFFF if disk is invalid return regs.x.ax != 0xFFFF; /* AX = 0xFFFF if disk is invalid */
} }
/**************************************************************************** /****************************************************************************
@ -682,7 +682,7 @@ ibool PMAPI PM_mkdir(
#ifdef __GNUC__ #ifdef __GNUC__
return mkdir(filename,S_IRUSR) == 0; return mkdir(filename,S_IRUSR) == 0;
#else #else
//AM: return mkdir(filename) == 0; /*AM: return mkdir(filename) == 0; */
return(false); return(false);
#endif #endif
} }
@ -694,7 +694,7 @@ Function to remove a directory.
ibool PMAPI PM_rmdir( ibool PMAPI PM_rmdir(
const char *filename) const char *filename)
{ {
//AM: return rmdir(filename) == 0; /*AM: return rmdir(filename) == 0; */
return(false); return(false);
} }
@ -1003,8 +1003,8 @@ void PMAPI PM_freePhysicalAddr(void *ptr,ulong limit)
ulong PMAPI PM_getPhysicalAddr(void *p) ulong PMAPI PM_getPhysicalAddr(void *p)
{ {
// TODO: This function should find the physical address of a linear /* TODO: This function should find the physical address of a linear */
// address. /* address. */
(void)p; (void)p;
return 0xFFFFFFFFUL; return 0xFFFFFFFFUL;
} }
@ -1086,8 +1086,8 @@ int PMAPI PM_int86(int intno, RMREGS *in, RMREGS *out)
memset(&rmregs, 0, sizeof(rmregs)); memset(&rmregs, 0, sizeof(rmregs));
IN(eax); IN(ebx); IN(ecx); IN(edx); IN(esi); IN(edi); IN(eax); IN(ebx); IN(ecx); IN(edx); IN(esi); IN(edi);
// These real mode ints may cause crashes. /* These real mode ints may cause crashes. */
//AM: DPMI_int86(intno,&rmregs); /* DPMI issue real interrupt */ /*AM: DPMI_int86(intno,&rmregs); /###* DPMI issue real interrupt */
OUT(eax); OUT(ebx); OUT(ecx); OUT(edx); OUT(esi); OUT(edi); OUT(eax); OUT(ebx); OUT(ecx); OUT(edx); OUT(esi); OUT(edi);
out->x.cflag = rmregs.flags & 0x1; out->x.cflag = rmregs.flags & 0x1;
@ -1104,7 +1104,7 @@ int PMAPI PM_int86x(int intno, RMREGS *in, RMREGS *out,
rmregs.es = sregs->es; rmregs.es = sregs->es;
rmregs.ds = sregs->ds; rmregs.ds = sregs->ds;
//AM: DPMI_int86(intno,&rmregs); /* DPMI issue real interrupt */ /*AM: DPMI_int86(intno,&rmregs); /###* DPMI issue real interrupt */
OUT(eax); OUT(ebx); OUT(ecx); OUT(edx); OUT(esi); OUT(edi); OUT(eax); OUT(ebx); OUT(ecx); OUT(edx); OUT(esi); OUT(edi);
sregs->es = rmregs.es; sregs->es = rmregs.es;
@ -1156,7 +1156,7 @@ Function to get the file attributes for a specific file.
uint PMAPI PM_getFileAttr( uint PMAPI PM_getFileAttr(
const char *filename) const char *filename)
{ {
// TODO: Implement this! /* TODO: Implement this! */
return 0; return 0;
} }
@ -1169,7 +1169,7 @@ ibool PMAPI PM_getFileTime(
ibool gmTime, ibool gmTime,
PM_time *time) PM_time *time)
{ {
// TODO: Implement this! /* TODO: Implement this! */
return false; return false;
} }
@ -1182,6 +1182,6 @@ ibool PMAPI PM_setFileTime(
ibool gmTime, ibool gmTime,
PM_time *time) PM_time *time)
{ {
// TODO: Implement this! /* TODO: Implement this! */
return false; return false;
} }

View File

@ -457,9 +457,9 @@ int PMAPI PM_lockCodePages(void (*p)(),uint len,PM_lockHandle *lh)
{ {
PMSREGS sregs; PMSREGS sregs;
PM_segread(&sregs); PM_segread(&sregs);
//AM: causes minor glitch with /*AM: causes minor glitch with */
//AM: older versions pmEasy which don't allow DPMI 06 on /*AM: older versions pmEasy which don't allow DPMI 06 on */
//AM: Code selector 0x0C -- assume base is 0 which it should be. /*AM: Code selector 0x0C -- assume base is 0 which it should be. */
return DPMI_lockLinearPages((uint)p,len); return DPMI_lockLinearPages((uint)p,len);
} }

View File

@ -37,8 +37,8 @@ Increase the thread priority to maximum, if possible.
****************************************************************************/ ****************************************************************************/
static int SetMaxThreadPriority(void) static int SetMaxThreadPriority(void)
{ {
// TODO: If you have thread priorities, increase it to maximum for the /* TODO: If you have thread priorities, increase it to maximum for the */
// thread for timing the CPU frequency. /* thread for timing the CPU frequency. */
return oldPriority; return oldPriority;
} }
@ -49,7 +49,7 @@ Restore the original thread priority.
static void RestoreThreadPriority( static void RestoreThreadPriority(
int priority) int priority)
{ {
// TODO: Restore the original thread priority on exit. /* TODO: Restore the original thread priority on exit. */
} }
/**************************************************************************** /****************************************************************************
@ -59,8 +59,8 @@ Initialise the counter and return the frequency of the counter.
static void GetCounterFrequency( static void GetCounterFrequency(
CPU_largeInteger *freq) CPU_largeInteger *freq)
{ {
// TODO: Return the frequency of the counter in here. You should try to /* TODO: Return the frequency of the counter in here. You should try to */
// normalise this value to be around 100,000 ticks per second. /* normalise this value to be around 100,000 ticks per second. */
freq->low = 0; freq->low = 0;
freq->high = 0; freq->high = 0;
} }

View File

@ -59,7 +59,7 @@ events.
****************************************************************************/ ****************************************************************************/
ulong _EVT_getTicks(void) ulong _EVT_getTicks(void)
{ {
// TODO: Implement this for your OS! /* TODO: Implement this for your OS! */
} }
/**************************************************************************** /****************************************************************************
@ -68,36 +68,36 @@ Pumps all messages in the application message queue into our event queue.
****************************************************************************/ ****************************************************************************/
static void _EVT_pumpMessages(void) static void _EVT_pumpMessages(void)
{ {
// TODO: The purpose of this function is to read all keyboard and mouse /* TODO: The purpose of this function is to read all keyboard and mouse */
// events from the OS specific event queue, translate them and post /* events from the OS specific event queue, translate them and post */
// them into the SciTech event queue. /* them into the SciTech event queue. */
// /* */
// NOTE: There are a couple of important things that this function must /* NOTE: There are a couple of important things that this function must */
// take care of: /* take care of: */
// /* */
// 1. Support for KEYDOWN, KEYREPEAT and KEYUP is required. /* 1. Support for KEYDOWN, KEYREPEAT and KEYUP is required. */
// /* */
// 2. Support for reading hardware scan code as well as ASCII /* 2. Support for reading hardware scan code as well as ASCII */
// translated values is required. Games use the scan codes rather /* translated values is required. Games use the scan codes rather */
// than ASCII values. Scan codes go into the high order byte of the /* than ASCII values. Scan codes go into the high order byte of the */
// keyboard message field. /* keyboard message field. */
// /* */
// 3. Support for at least reading mouse motion data (mickeys) from the /* 3. Support for at least reading mouse motion data (mickeys) from the */
// mouse is required. Using the mickey values, we can then translate /* mouse is required. Using the mickey values, we can then translate */
// to mouse cursor coordinates scaled to the range of the current /* to mouse cursor coordinates scaled to the range of the current */
// graphics display mode. Mouse values are scaled based on the /* graphics display mode. Mouse values are scaled based on the */
// global 'rangeX' and 'rangeY'. /* global 'rangeX' and 'rangeY'. */
// /* */
// 4. Support for a timestamp for the events is required, which is /* 4. Support for a timestamp for the events is required, which is */
// defined as the number of milliseconds since some event (usually /* defined as the number of milliseconds since some event (usually */
// system startup). This is the timestamp when the event occurred /* system startup). This is the timestamp when the event occurred */
// (ie: at interrupt time) not when it was stuff into the SciTech /* (ie: at interrupt time) not when it was stuff into the SciTech */
// event queue. /* event queue. */
// /* */
// 5. Support for mouse double click events. If the OS has a native /* 5. Support for mouse double click events. If the OS has a native */
// mechanism to determine this, it should be used. Otherwise the /* mechanism to determine this, it should be used. Otherwise the */
// time stamp information will be used by the generic event code /* time stamp information will be used by the generic event code */
// to generate double click events. /* to generate double click events. */
} }
/**************************************************************************** /****************************************************************************
@ -141,7 +141,7 @@ void EVTAPI EVT_init(
initEventQueue(); initEventQueue();
memset(keyUpMsg,0,sizeof(keyUpMsg)); memset(keyUpMsg,0,sizeof(keyUpMsg));
// TODO: Do any OS specific initialisation here /* TODO: Do any OS specific initialisation here */
/* Catch program termination signals so we can clean up properly */ /* Catch program termination signals so we can clean up properly */
signal(SIGABRT, _EVT_abort); signal(SIGABRT, _EVT_abort);
@ -171,7 +171,7 @@ and this function can be used to resume it again later.
****************************************************************************/ ****************************************************************************/
void EVT_resume(void) void EVT_resume(void)
{ {
// Do nothing for non DOS systems /* Do nothing for non DOS systems */
} }
/**************************************************************************** /****************************************************************************
@ -181,7 +181,7 @@ de-install the event handling code.
****************************************************************************/ ****************************************************************************/
void EVT_suspend(void) void EVT_suspend(void)
{ {
// Do nothing for non DOS systems /* Do nothing for non DOS systems */
} }
/**************************************************************************** /****************************************************************************
@ -195,5 +195,5 @@ void EVT_exit(void)
signal(SIGFPE, SIG_DFL); signal(SIGFPE, SIG_DFL);
signal(SIGINT, SIG_DFL); signal(SIGINT, SIG_DFL);
// TODO: Do any OS specific cleanup in here /* TODO: Do any OS specific cleanup in here */
} }

View File

@ -28,6 +28,6 @@
* *
****************************************************************************/ ****************************************************************************/
// TODO: This is where you include OS specific headers for the event handling /* TODO: This is where you include OS specific headers for the event handling */
// library. You may leave this empty if you have no OS specific headers /* library. You may leave this empty if you have no OS specific headers */
// to include. /* to include. */

View File

@ -38,13 +38,13 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
// TODO: Include any OS specific headers here! /* TODO: Include any OS specific headers here! */
/*--------------------------- Global variables ----------------------------*/ /*--------------------------- Global variables ----------------------------*/
// TODO: If you support access to the BIOS, the following VESABuf globals /* TODO: If you support access to the BIOS, the following VESABuf globals */
// keep track of a single VESA transfer buffer. If you don't support /* keep track of a single VESA transfer buffer. If you don't support */
// access to the BIOS, remove these variables. /* access to the BIOS, remove these variables. */
static uint VESABuf_len = 1024; /* Length of the VESABuf buffer */ static uint VESABuf_len = 1024; /* Length of the VESABuf buffer */
static void *VESABuf_ptr = NULL; /* Near pointer to VESABuf */ static void *VESABuf_ptr = NULL; /* Near pointer to VESABuf */
@ -61,12 +61,12 @@ Initialise the PM library.
****************************************************************************/ ****************************************************************************/
void PMAPI PM_init(void) void PMAPI PM_init(void)
{ {
// TODO: Do any initialisation in here. This includes getting IOPL /* TODO: Do any initialisation in here. This includes getting IOPL */
// access for the process calling PM_init. This will get called /* access for the process calling PM_init. This will get called */
// more than once. /* more than once. */
// TODO: If you support the supplied MTRR register stuff (you need to /* TODO: If you support the supplied MTRR register stuff (you need to */
// be at ring 0 for this!), you should initialise it in here. /* be at ring 0 for this!), you should initialise it in here. */
/* MTRR_init(); */ /* MTRR_init(); */
} }
@ -77,7 +77,7 @@ Return the operating system type identifier.
****************************************************************************/ ****************************************************************************/
long PMAPI PM_getOSType(void) long PMAPI PM_getOSType(void)
{ {
// TODO: Change this to return the define for your OS from drvlib/os.h /* TODO: Change this to return the define for your OS from drvlib/os.h */
return _OS_MYOS; return _OS_MYOS;
} }
@ -119,9 +119,9 @@ Report a fatal error condition and halt the program.
void PMAPI PM_fatalError( void PMAPI PM_fatalError(
const char *msg) const char *msg)
{ {
// TODO: If you are running in a GUI environment without a console, /* TODO: If you are running in a GUI environment without a console, */
// this needs to be changed to bring up a fatal error message /* this needs to be changed to bring up a fatal error message */
// box and terminate the program. /* box and terminate the program. */
if (fatalErrorCleanup) if (fatalErrorCleanup)
fatalErrorCleanup(); fatalErrorCleanup();
fprintf(stderr,"%s\n", msg); fprintf(stderr,"%s\n", msg);
@ -134,7 +134,7 @@ Exit handler to kill the VESA transfer buffer.
****************************************************************************/ ****************************************************************************/
static void ExitVBEBuf(void) static void ExitVBEBuf(void)
{ {
// TODO: If you do not have BIOS access, remove this function. /* TODO: If you do not have BIOS access, remove this function. */
if (VESABuf_ptr) if (VESABuf_ptr)
PM_freeRealSeg(VESABuf_ptr); PM_freeRealSeg(VESABuf_ptr);
VESABuf_ptr = 0; VESABuf_ptr = 0;
@ -149,8 +149,8 @@ void * PMAPI PM_getVESABuf(
uint *rseg, uint *rseg,
uint *roff) uint *roff)
{ {
// TODO: If you do not have BIOS access, simply delete the guts of /* TODO: If you do not have BIOS access, simply delete the guts of */
// this function and return NULL. /* this function and return NULL. */
if (!VESABuf_ptr) { if (!VESABuf_ptr) {
/* Allocate a global buffer for communicating with the VESA VBE */ /* Allocate a global buffer for communicating with the VESA VBE */
if ((VESABuf_ptr = PM_allocRealSeg(VESABuf_len, &VESABuf_rseg, &VESABuf_roff)) == NULL) if ((VESABuf_ptr = PM_allocRealSeg(VESABuf_len, &VESABuf_rseg, &VESABuf_roff)) == NULL)
@ -169,9 +169,9 @@ Check if a key has been pressed.
****************************************************************************/ ****************************************************************************/
int PMAPI PM_kbhit(void) int PMAPI PM_kbhit(void)
{ {
// TODO: This function checks if a key is available to be read. This /* TODO: This function checks if a key is available to be read. This */
// should be implemented, but is mostly used by the test programs /* should be implemented, but is mostly used by the test programs */
// these days. /* these days. */
return true; return true;
} }
@ -181,9 +181,9 @@ Wait for and return the next keypress.
****************************************************************************/ ****************************************************************************/
int PMAPI PM_getch(void) int PMAPI PM_getch(void)
{ {
// TODO: This returns the ASCII code of the key pressed. This /* TODO: This returns the ASCII code of the key pressed. This */
// should be implemented, but is mostly used by the test programs /* should be implemented, but is mostly used by the test programs */
// these days. /* these days. */
return 0xD; return 0xD;
} }
@ -193,12 +193,12 @@ Open a fullscreen console mode for output.
****************************************************************************/ ****************************************************************************/
int PMAPI PM_openConsole(void) int PMAPI PM_openConsole(void)
{ {
// TODO: Opens up a fullscreen console for graphics output. If your /* TODO: Opens up a fullscreen console for graphics output. If your */
// console does not have graphics/text modes, this can be left /* console does not have graphics/text modes, this can be left */
// empty. The main purpose of this is to disable console switching /* empty. The main purpose of this is to disable console switching */
// when in graphics modes if you can switch away from fullscreen /* when in graphics modes if you can switch away from fullscreen */
// consoles (if you want to allow switching, this can be done /* consoles (if you want to allow switching, this can be done */
// elsewhere with a full save/restore state of the graphics mode). /* elsewhere with a full save/restore state of the graphics mode). */
return 0; return 0;
} }
@ -208,9 +208,9 @@ Return the size of the state buffer used to save the console state.
****************************************************************************/ ****************************************************************************/
int PMAPI PM_getConsoleStateSize(void) int PMAPI PM_getConsoleStateSize(void)
{ {
// TODO: Returns the size of the console state buffer used to save the /* TODO: Returns the size of the console state buffer used to save the */
// state of the console before going into graphics mode. This is /* state of the console before going into graphics mode. This is */
// used to restore the console back to normal when we are done. /* used to restore the console back to normal when we are done. */
return 1; return 1;
} }
@ -222,11 +222,11 @@ void PMAPI PM_saveConsoleState(
void *stateBuf, void *stateBuf,
int console_id) int console_id)
{ {
// TODO: Saves the state of the console into the state buffer. This is /* TODO: Saves the state of the console into the state buffer. This is */
// used to restore the console back to normal when we are done. /* used to restore the console back to normal when we are done. */
// We will always restore 80x25 text mode after being in graphics /* We will always restore 80x25 text mode after being in graphics */
// mode, so if restoring text mode is all you need to do this can /* mode, so if restoring text mode is all you need to do this can */
// be left empty. /* be left empty. */
} }
/**************************************************************************** /****************************************************************************
@ -237,11 +237,11 @@ void PMAPI PM_restoreConsoleState(
const void *stateBuf, const void *stateBuf,
int console_id) int console_id)
{ {
// TODO: Restore the state of the console from the state buffer. This is /* TODO: Restore the state of the console from the state buffer. This is */
// used to restore the console back to normal when we are done. /* used to restore the console back to normal when we are done. */
// We will always restore 80x25 text mode after being in graphics /* We will always restore 80x25 text mode after being in graphics */
// mode, so if restoring text mode is all you need to do this can /* mode, so if restoring text mode is all you need to do this can */
// be left empty. /* be left empty. */
} }
/**************************************************************************** /****************************************************************************
@ -251,7 +251,7 @@ Close the console and return to non-fullscreen console mode.
void PMAPI PM_closeConsole( void PMAPI PM_closeConsole(
int console_id) int console_id)
{ {
// TODO: Close the console when we are done, going back to text mode. /* TODO: Close the console when we are done, going back to text mode. */
} }
/**************************************************************************** /****************************************************************************
@ -262,8 +262,8 @@ void PM_setOSCursorLocation(
int x, int x,
int y) int y)
{ {
// TODO: Set the OS console cursor location to the new value. This is /* TODO: Set the OS console cursor location to the new value. This is */
// generally used for new OS ports (used mostly for DOS). /* generally used for new OS ports (used mostly for DOS). */
} }
/**************************************************************************** /****************************************************************************
@ -274,8 +274,8 @@ void PM_setOSScreenWidth(
int width, int width,
int height) int height)
{ {
// TODO: Set the OS console screen width. This is generally unused for /* TODO: Set the OS console screen width. This is generally unused for */
// new OS ports. /* new OS ports. */
} }
/**************************************************************************** /****************************************************************************
@ -286,12 +286,12 @@ ibool PMAPI PM_setRealTimeClockHandler(
PM_intHandler ih, PM_intHandler ih,
int frequency) int frequency)
{ {
// TODO: Install a real time clock interrupt handler. Normally this /* TODO: Install a real time clock interrupt handler. Normally this */
// will not be supported from most OS'es in user land, so an /* will not be supported from most OS'es in user land, so an */
// alternative mechanism is needed to enable software stereo. /* alternative mechanism is needed to enable software stereo. */
// Hence leave this unimplemented unless you have a high priority /* Hence leave this unimplemented unless you have a high priority */
// mechanism to call the 32-bit callback when the real time clock /* mechanism to call the 32-bit callback when the real time clock */
// interrupt fires. /* interrupt fires. */
return false; return false;
} }
@ -302,9 +302,9 @@ Set the real time clock frequency (for stereo modes).
void PMAPI PM_setRealTimeClockFrequency( void PMAPI PM_setRealTimeClockFrequency(
int frequency) int frequency)
{ {
// TODO: Set the real time clock interrupt frequency. Used for stereo /* TODO: Set the real time clock interrupt frequency. Used for stereo */
// LC shutter glasses when doing software stereo. Usually sets /* LC shutter glasses when doing software stereo. Usually sets */
// the frequency to around 2048 Hz. /* the frequency to around 2048 Hz. */
} }
/**************************************************************************** /****************************************************************************
@ -313,7 +313,7 @@ Restore the original real time clock handler.
****************************************************************************/ ****************************************************************************/
void PMAPI PM_restoreRealTimeClockHandler(void) void PMAPI PM_restoreRealTimeClockHandler(void)
{ {
// TODO: Restores the real time clock handler. /* TODO: Restores the real time clock handler. */
} }
/**************************************************************************** /****************************************************************************
@ -333,8 +333,8 @@ Return the drive letter for the boot drive.
****************************************************************************/ ****************************************************************************/
char PMAPI PM_getBootDrive(void) char PMAPI PM_getBootDrive(void)
{ {
// TODO: Return the boot drive letter for the OS. Normally this is 'c' /* TODO: Return the boot drive letter for the OS. Normally this is 'c' */
// for DOS based OS'es and '/' for Unices. /* for DOS based OS'es and '/' for Unices. */
return '/'; return '/';
} }
@ -353,8 +353,8 @@ Return the path to the Nucleus driver files.
****************************************************************************/ ****************************************************************************/
const char * PMAPI PM_getNucleusPath(void) const char * PMAPI PM_getNucleusPath(void)
{ {
// TODO: Change this to the default path to Nucleus driver files. The /* TODO: Change this to the default path to Nucleus driver files. The */
// following is the default for Unices. /* following is the default for Unices. */
char *env = getenv("NUCLEUS_PATH"); char *env = getenv("NUCLEUS_PATH");
return env ? env : "/usr/lib/nucleus"; return env ? env : "/usr/lib/nucleus";
} }
@ -378,8 +378,8 @@ Return a unique identifier for the machine if possible.
****************************************************************************/ ****************************************************************************/
const char * PMAPI PM_getUniqueID(void) const char * PMAPI PM_getUniqueID(void)
{ {
// TODO: Return a unique ID for the machine. If a unique ID is not /* TODO: Return a unique ID for the machine. If a unique ID is not */
// available, return the machine name. /* available, return the machine name. */
static char buf[128]; static char buf[128];
gethostname(buf, 128); gethostname(buf, 128);
return buf; return buf;
@ -391,7 +391,7 @@ Get the name of the machine on the network.
****************************************************************************/ ****************************************************************************/
const char * PMAPI PM_getMachineName(void) const char * PMAPI PM_getMachineName(void)
{ {
// TODO: Return the network machine name for the machine. /* TODO: Return the network machine name for the machine. */
static char buf[128]; static char buf[128];
gethostname(buf, 128); gethostname(buf, 128);
return buf; return buf;
@ -403,8 +403,8 @@ Return a pointer to the real mode BIOS data area.
****************************************************************************/ ****************************************************************************/
void * PMAPI PM_getBIOSPointer(void) void * PMAPI PM_getBIOSPointer(void)
{ {
// TODO: This returns a pointer to the real mode BIOS data area. If you /* TODO: This returns a pointer to the real mode BIOS data area. If you */
// do not support BIOS access, you can simply return NULL here. /* do not support BIOS access, you can simply return NULL here. */
if (!zeroPtr) if (!zeroPtr)
zeroPtr = PM_mapPhysicalAddr(0,0xFFFFF,true); zeroPtr = PM_mapPhysicalAddr(0,0xFFFFF,true);
return (void*)(zeroPtr + 0x400); return (void*)(zeroPtr + 0x400);
@ -431,23 +431,23 @@ void * PMAPI PM_mapPhysicalAddr(
ulong limit, ulong limit,
ibool isCached) ibool isCached)
{ {
// TODO: This function maps a physical memory address to a linear /* TODO: This function maps a physical memory address to a linear */
// address in the address space of the calling process. /* address in the address space of the calling process. */
// NOTE: This function *must* be able to handle any phsyical base /* NOTE: This function *must* be able to handle any phsyical base */
// address, and hence you will have to handle rounding of /* address, and hence you will have to handle rounding of */
// the physical base address to a page boundary (ie: 4Kb on /* the physical base address to a page boundary (ie: 4Kb on */
// x86 CPU's) to be able to properly map in the memory /* x86 CPU's) to be able to properly map in the memory */
// region. /* region. */
// NOTE: If possible the isCached bit should be used to ensure that /* NOTE: If possible the isCached bit should be used to ensure that */
// the PCD (Page Cache Disable) and PWT (Page Write Through) /* the PCD (Page Cache Disable) and PWT (Page Write Through) */
// bits are set to disable caching for a memory mapping used /* bits are set to disable caching for a memory mapping used */
// for MMIO register access. We also disable caching using /* for MMIO register access. We also disable caching using */
// the MTRR registers for Pentium Pro and later chipsets so if /* the MTRR registers for Pentium Pro and later chipsets so if */
// MTRR support is enabled for your OS then you can safely ignore /* MTRR support is enabled for your OS then you can safely ignore */
// the isCached flag and always enable caching in the page /* the isCached flag and always enable caching in the page */
// tables. /* tables. */
return NULL; return NULL;
} }
@ -459,9 +459,9 @@ void PMAPI PM_freePhysicalAddr(
void *ptr, void *ptr,
ulong limit) ulong limit)
{ {
// TODO: This function will free a physical memory mapping previously /* TODO: This function will free a physical memory mapping previously */
// allocated with PM_mapPhysicalAddr() if at all possible. If /* allocated with PM_mapPhysicalAddr() if at all possible. If */
// you can't free physical memory mappings, simply do nothing. /* you can't free physical memory mappings, simply do nothing. */
} }
/**************************************************************************** /****************************************************************************
@ -470,20 +470,20 @@ Find the physical address of a linear memory address in current process.
****************************************************************************/ ****************************************************************************/
ulong PMAPI PM_getPhysicalAddr(void *p) ulong PMAPI PM_getPhysicalAddr(void *p)
{ {
// TODO: This function should find the physical address of a linear /* TODO: This function should find the physical address of a linear */
// address. /* address. */
return 0xFFFFFFFFUL; return 0xFFFFFFFFUL;
} }
void PMAPI PM_sleep(ulong milliseconds) void PMAPI PM_sleep(ulong milliseconds)
{ {
// TODO: Put the process to sleep for milliseconds /* TODO: Put the process to sleep for milliseconds */
} }
int PMAPI PM_getCOMPort(int port) int PMAPI PM_getCOMPort(int port)
{ {
// TODO: Re-code this to determine real values using the Plug and Play /* TODO: Re-code this to determine real values using the Plug and Play */
// manager for the OS. /* manager for the OS. */
switch (port) { switch (port) {
case 0: return 0x3F8; case 0: return 0x3F8;
case 1: return 0x2F8; case 1: return 0x2F8;
@ -493,8 +493,8 @@ int PMAPI PM_getCOMPort(int port)
int PMAPI PM_getLPTPort(int port) int PMAPI PM_getLPTPort(int port)
{ {
// TODO: Re-code this to determine real values using the Plug and Play /* TODO: Re-code this to determine real values using the Plug and Play */
// manager for the OS. /* manager for the OS. */
switch (port) { switch (port) {
case 0: return 0x3BC; case 0: return 0x3BC;
case 1: return 0x378; case 1: return 0x378;
@ -510,11 +510,11 @@ Allocate a block of (unnamed) shared memory.
void * PMAPI PM_mallocShared( void * PMAPI PM_mallocShared(
long size) long size)
{ {
// TODO: This is used to allocate memory that is shared between process /* TODO: This is used to allocate memory that is shared between process */
// that all access the common Nucleus drivers via a common display /* that all access the common Nucleus drivers via a common display */
// driver DLL. If your OS does not support shared memory (or if /* driver DLL. If your OS does not support shared memory (or if */
// the display driver does not need to allocate shared memory /* the display driver does not need to allocate shared memory */
// for each process address space), this should just call PM_malloc. /* for each process address space), this should just call PM_malloc. */
return PM_malloc(size); return PM_malloc(size);
} }
@ -525,10 +525,10 @@ Free a block of shared memory.
void PMAPI PM_freeShared( void PMAPI PM_freeShared(
void *ptr) void *ptr)
{ {
// TODO: Free the shared memory block. This will be called in the context /* TODO: Free the shared memory block. This will be called in the context */
// of the original calling process that allocated the shared /* of the original calling process that allocated the shared */
// memory with PM_mallocShared. Simply call PM_free if you do not /* memory with PM_mallocShared. Simply call PM_free if you do not */
// need this. /* need this. */
PM_free(ptr); PM_free(ptr);
} }
@ -542,16 +542,16 @@ void * PMAPI PM_mapToProcess(
void *base, void *base,
ulong limit) ulong limit)
{ {
// TODO: This function is used to map a physical memory mapping /* TODO: This function is used to map a physical memory mapping */
// previously allocated with PM_mapPhysicalAddr into the /* previously allocated with PM_mapPhysicalAddr into the */
// address space of the calling process. If the memory mapping /* address space of the calling process. If the memory mapping */
// allocated by PM_mapPhysicalAddr is global to all processes, /* allocated by PM_mapPhysicalAddr is global to all processes, */
// simply return the pointer. /* simply return the pointer. */
// NOTE: This function must also handle rounding to page boundaries, /* NOTE: This function must also handle rounding to page boundaries, */
// since this function is used to map in shared memory buffers /* since this function is used to map in shared memory buffers */
// allocated with PM_mapPhysicalAddr(). Hence if you aligned /* allocated with PM_mapPhysicalAddr(). Hence if you aligned */
// the physical address above, then you also need to do it here. /* the physical address above, then you also need to do it here. */
return base; return base;
} }
@ -563,9 +563,9 @@ void * PMAPI PM_mapRealPointer(
uint r_seg, uint r_seg,
uint r_off) uint r_off)
{ {
// TODO: This function maps a real mode memory pointer into the /* TODO: This function maps a real mode memory pointer into the */
// calling processes address space as a 32-bit near pointer. If /* calling processes address space as a 32-bit near pointer. If */
// you do not support BIOS access, simply return NULL here. /* you do not support BIOS access, simply return NULL here. */
if (!zeroPtr) if (!zeroPtr)
zeroPtr = PM_mapPhysicalAddr(0,0xFFFFF); zeroPtr = PM_mapPhysicalAddr(0,0xFFFFF);
return (void*)(zeroPtr + MK_PHYS(r_seg,r_off)); return (void*)(zeroPtr + MK_PHYS(r_seg,r_off));
@ -580,10 +580,10 @@ void * PMAPI PM_allocRealSeg(
uint *r_seg, uint *r_seg,
uint *r_off) uint *r_off)
{ {
// TODO: This function allocates a block of real mode memory for the /* TODO: This function allocates a block of real mode memory for the */
// calling process used to communicate with real mode BIOS /* calling process used to communicate with real mode BIOS */
// functions. If you do not support BIOS access, simply return /* functions. If you do not support BIOS access, simply return */
// NULL here. /* NULL here. */
return NULL; return NULL;
} }
@ -594,8 +594,8 @@ Free a block of real mode memory.
void PMAPI PM_freeRealSeg( void PMAPI PM_freeRealSeg(
void *mem) void *mem)
{ {
// TODO: Frees a previously allocated real mode memory block. If you /* TODO: Frees a previously allocated real mode memory block. If you */
// do not support BIOS access, this function should be empty. /* do not support BIOS access, this function should be empty. */
} }
/**************************************************************************** /****************************************************************************
@ -606,9 +606,9 @@ void PMAPI DPMI_int86(
int intno, int intno,
DPMI_regs *regs) DPMI_regs *regs)
{ {
// TODO: This function calls the real mode BIOS using the passed in /* TODO: This function calls the real mode BIOS using the passed in */
// register structure. If you do not support real mode BIOS /* register structure. If you do not support real mode BIOS */
// access, this function should be empty. /* access, this function should be empty. */
} }
/**************************************************************************** /****************************************************************************
@ -620,9 +620,9 @@ int PMAPI PM_int86(
RMREGS *in, RMREGS *in,
RMREGS *out) RMREGS *out)
{ {
// TODO: This function calls the real mode BIOS using the passed in /* TODO: This function calls the real mode BIOS using the passed in */
// register structure. If you do not support real mode BIOS /* register structure. If you do not support real mode BIOS */
// access, this function should return 0. /* access, this function should return 0. */
return 0; return 0;
} }
@ -636,9 +636,9 @@ int PMAPI PM_int86x(
RMREGS *out, RMREGS *out,
RMSREGS *sregs) RMSREGS *sregs)
{ {
// TODO: This function calls the real mode BIOS using the passed in /* TODO: This function calls the real mode BIOS using the passed in */
// register structure. If you do not support real mode BIOS /* register structure. If you do not support real mode BIOS */
// access, this function should return 0. /* access, this function should return 0. */
return 0; return 0;
} }
@ -652,9 +652,9 @@ void PMAPI PM_callRealMode(
RMREGS *in, RMREGS *in,
RMSREGS *sregs) RMSREGS *sregs)
{ {
// TODO: This function calls a real mode far function with a far call. /* TODO: This function calls a real mode far function with a far call. */
// If you do not support BIOS access, this function should be /* If you do not support BIOS access, this function should be */
// empty. /* empty. */
} }
/**************************************************************************** /****************************************************************************
@ -665,9 +665,9 @@ void PMAPI PM_availableMemory(
ulong *physical, ulong *physical,
ulong *total) ulong *total)
{ {
// TODO: Report the amount of available memory, both the amount of /* TODO: Report the amount of available memory, both the amount of */
// physical memory left and the amount of virtual memory left. /* physical memory left and the amount of virtual memory left. */
// If the OS does not provide these services, report 0's. /* If the OS does not provide these services, report 0's. */
*physical = *total = 0; *physical = *total = 0;
} }
@ -681,10 +681,10 @@ void * PMAPI PM_allocLockedMem(
ibool contiguous, ibool contiguous,
ibool below16M) ibool below16M)
{ {
// TODO: Allocate a block of locked, physical memory of the specified /* TODO: Allocate a block of locked, physical memory of the specified */
// size. This is used for bus master operations. If this is not /* size. This is used for bus master operations. If this is not */
// supported by the OS, return NULL and bus mastering will not /* supported by the OS, return NULL and bus mastering will not */
// be used. /* be used. */
return NULL; return NULL;
} }
@ -697,7 +697,7 @@ void PMAPI PM_freeLockedMem(
uint size, uint size,
ibool contiguous) ibool contiguous)
{ {
// TODO: Free a memory block allocated with PM_allocLockedMem. /* TODO: Free a memory block allocated with PM_allocLockedMem. */
} }
/**************************************************************************** /****************************************************************************
@ -709,9 +709,9 @@ void PMAPI PM_setBankA(
{ {
RMREGS regs; RMREGS regs;
// TODO: This does a bank switch function by calling the real mode /* TODO: This does a bank switch function by calling the real mode */
// VESA BIOS. If you do not support BIOS access, this function should /* VESA BIOS. If you do not support BIOS access, this function should */
// be empty. /* be empty. */
regs.x.ax = 0x4F05; regs.x.ax = 0x4F05;
regs.x.bx = 0x0000; regs.x.bx = 0x0000;
regs.x.dx = bank; regs.x.dx = bank;
@ -727,9 +727,9 @@ void PMAPI PM_setBankAB(
{ {
RMREGS regs; RMREGS regs;
// TODO: This does a bank switch function by calling the real mode /* TODO: This does a bank switch function by calling the real mode */
// VESA BIOS. If you do not support BIOS access, this function should /* VESA BIOS. If you do not support BIOS access, this function should */
// be empty. /* be empty. */
regs.x.ax = 0x4F05; regs.x.ax = 0x4F05;
regs.x.bx = 0x0000; regs.x.bx = 0x0000;
regs.x.dx = bank; regs.x.dx = bank;
@ -751,9 +751,9 @@ void PMAPI PM_setCRTStart(
{ {
RMREGS regs; RMREGS regs;
// TODO: This changes the display start address by calling the real mode /* TODO: This changes the display start address by calling the real mode */
// VESA BIOS. If you do not support BIOS access, this function /* VESA BIOS. If you do not support BIOS access, this function */
// should be empty. /* should be empty. */
regs.x.ax = 0x4F07; regs.x.ax = 0x4F07;
regs.x.bx = waitVRT; regs.x.bx = waitVRT;
regs.x.cx = x; regs.x.cx = x;
@ -770,17 +770,17 @@ ibool PMAPI PM_enableWriteCombine(
ulong length, ulong length,
uint type) uint type)
{ {
// TODO: This function should enable Pentium Pro and Pentium II MTRR /* TODO: This function should enable Pentium Pro and Pentium II MTRR */
// write combining for the passed in physical memory base address /* write combining for the passed in physical memory base address */
// and length. Normally this is done via calls to an OS specific /* and length. Normally this is done via calls to an OS specific */
// device driver as this can only be done at ring 0. /* device driver as this can only be done at ring 0. */
// /* */
// NOTE: This is a *very* important function to implement! If you do /* NOTE: This is a *very* important function to implement! If you do */
// not implement, graphics performance on the latest Intel chips /* not implement, graphics performance on the latest Intel chips */
// will be severly impaired. For sample code that can be used /* will be severly impaired. For sample code that can be used */
// directly in a ring 0 device driver, see the MSDOS implementation /* directly in a ring 0 device driver, see the MSDOS implementation */
// which includes assembler code to do this directly (if the /* which includes assembler code to do this directly (if the */
// program is running at ring 0). /* program is running at ring 0). */
return false; return false;
} }
@ -793,19 +793,19 @@ ibool PMAPI PM_doBIOSPOST(
ulong BIOSPhysAddr, ulong BIOSPhysAddr,
void *mappedBIOS) void *mappedBIOS)
{ {
// TODO: This function is used to run the BIOS POST code on a secondary /* TODO: This function is used to run the BIOS POST code on a secondary */
// controller to initialise it for use. This is not necessary /* controller to initialise it for use. This is not necessary */
// for multi-controller operation, but it will make it a lot /* for multi-controller operation, but it will make it a lot */
// more convenicent for end users (otherwise they have to boot /* more convenicent for end users (otherwise they have to boot */
// the system once with the secondary controller as primary, and /* the system once with the secondary controller as primary, and */
// then boot with both controllers installed). /* then boot with both controllers installed). */
// /* */
// Even if you don't support full BIOS access, it would be /* Even if you don't support full BIOS access, it would be */
// adviseable to be able to POST the secondary controllers in the /* adviseable to be able to POST the secondary controllers in the */
// system using this function as a minimum requirement. Some /* system using this function as a minimum requirement. Some */
// graphics hardware has registers that contain values that only /* graphics hardware has registers that contain values that only */
// the BIOS knows about, which makes bring up a card from cold /* the BIOS knows about, which makes bring up a card from cold */
// reset difficult if the BIOS has not POST'ed it. /* reset difficult if the BIOS has not POST'ed it. */
return false; return false;
} }
@ -817,8 +817,8 @@ shared libraries, simply return NULL.
PM_MODULE PMAPI PM_loadLibrary( PM_MODULE PMAPI PM_loadLibrary(
const char *szDLLName) const char *szDLLName)
{ {
// TODO: This function should load a native shared library from disk /* TODO: This function should load a native shared library from disk */
// given the path to the library. /* given the path to the library. */
(void)szDLLName; (void)szDLLName;
return NULL; return NULL;
} }
@ -831,8 +831,8 @@ void * PMAPI PM_getProcAddress(
PM_MODULE hModule, PM_MODULE hModule,
const char *szProcName) const char *szProcName)
{ {
// TODO: This function should return the address of a named procedure /* TODO: This function should return the address of a named procedure */
// from a native shared library. /* from a native shared library. */
(void)hModule; (void)hModule;
(void)szProcName; (void)szProcName;
return NULL; return NULL;
@ -845,7 +845,7 @@ Unload a shared library.
void PMAPI PM_freeLibrary( void PMAPI PM_freeLibrary(
PM_MODULE hModule) PM_MODULE hModule)
{ {
// TODO: This function free a previously loaded native shared library. /* TODO: This function free a previously loaded native shared library. */
(void)hModule; (void)hModule;
} }
@ -860,8 +860,8 @@ the switch occurred so it can be properly restored.
int PMAPI PM_setIOPL( int PMAPI PM_setIOPL(
int level) int level)
{ {
// TODO: This function should enable IOPL for the task (if IOPL is /* TODO: This function should enable IOPL for the task (if IOPL is */
// not always enabled for the app through some other means). /* not always enabled for the app through some other means). */
return level; return level;
} }
@ -873,9 +873,9 @@ void *PMAPI PM_findFirstFile(
const char *filename, const char *filename,
PM_findData *findData) PM_findData *findData)
{ {
// TODO: This function should start a directory enumeration search /* TODO: This function should start a directory enumeration search */
// given the filename (with wildcards). The data should be /* given the filename (with wildcards). The data should be */
// converted and returned in the findData standard form. /* converted and returned in the findData standard form. */
(void)filename; (void)filename;
(void)findData; (void)findData;
return PM_FILE_INVALID; return PM_FILE_INVALID;
@ -889,10 +889,10 @@ ibool PMAPI PM_findNextFile(
void *handle, void *handle,
PM_findData *findData) PM_findData *findData)
{ {
// TODO: This function should find the next file in directory enumeration /* TODO: This function should find the next file in directory enumeration */
// search given the search criteria defined in the call to /* search given the search criteria defined in the call to */
// PM_findFirstFile. The data should be converted and returned /* PM_findFirstFile. The data should be converted and returned */
// in the findData standard form. /* in the findData standard form. */
(void)handle; (void)handle;
(void)findData; (void)findData;
return false; return false;
@ -905,8 +905,8 @@ Function to close the find process
void PMAPI PM_findClose( void PMAPI PM_findClose(
void *handle) void *handle)
{ {
// TODO: This function should close the find process. This may do /* TODO: This function should close the find process. This may do */
// nothing for some OS'es. /* nothing for some OS'es. */
(void)handle; (void)handle;
} }
@ -954,7 +954,7 @@ void PMAPI PM_setFileAttr(
const char *filename, const char *filename,
uint attrib) uint attrib)
{ {
// TODO: Set the file attributes for a file /* TODO: Set the file attributes for a file */
(void)filename; (void)filename;
(void)attrib; (void)attrib;
} }

View File

@ -36,7 +36,7 @@ Initialise the Zen Timer module internals.
****************************************************************************/ ****************************************************************************/
void __ZTimerInit(void) void __ZTimerInit(void)
{ {
// TODO: Do any specific internal initialisation in here /* TODO: Do any specific internal initialisation in here */
} }
/**************************************************************************** /****************************************************************************
@ -46,8 +46,8 @@ Start the Zen Timer counting.
static void __LZTimerOn( static void __LZTimerOn(
LZTimerObject *tm) LZTimerObject *tm)
{ {
// TODO: Start the Zen Timer counting. This should be a macro if /* TODO: Start the Zen Timer counting. This should be a macro if */
// possible. /* possible. */
} }
/**************************************************************************** /****************************************************************************
@ -57,8 +57,8 @@ Compute the lap time since the timer was started.
static ulong __LZTimerLap( static ulong __LZTimerLap(
LZTimerObject *tm) LZTimerObject *tm)
{ {
// TODO: Compute the lap time between the current time and when the /* TODO: Compute the lap time between the current time and when the */
// timer was started. /* timer was started. */
return 0; return 0;
} }
@ -69,7 +69,7 @@ Stop the Zen Timer counting.
static void __LZTimerOff( static void __LZTimerOff(
LZTimerObject *tm) LZTimerObject *tm)
{ {
// TODO: Stop the timer counting. Should be a macro if possible. /* TODO: Stop the timer counting. Should be a macro if possible. */
} }
/**************************************************************************** /****************************************************************************
@ -79,7 +79,7 @@ Compute the elapsed time in microseconds between start and end timings.
static ulong __LZTimerCount( static ulong __LZTimerCount(
LZTimerObject *tm) LZTimerObject *tm)
{ {
// TODO: Compute the elapsed time and return it. Always microseconds. /* TODO: Compute the elapsed time and return it. Always microseconds. */
return 0; return 0;
} }
@ -95,9 +95,9 @@ Read the Long Period timer from the OS
****************************************************************************/ ****************************************************************************/
static ulong __ULZReadTime(void) static ulong __ULZReadTime(void)
{ {
// TODO: Read the long period timer from the OS. The resolution of this /* TODO: Read the long period timer from the OS. The resolution of this */
// timer should be around 1/20 of a second for timing long /* timer should be around 1/20 of a second for timing long */
// periods if possible. /* periods if possible. */
} }
/**************************************************************************** /****************************************************************************

Some files were not shown because too many files have changed in this diff Show More