Index: trunk/src/os2ahci/ahci.c
===================================================================
--- trunk/src/os2ahci/ahci.c	(revision 85)
+++ trunk/src/os2ahci/ahci.c	(revision 86)
@@ -1236,6 +1236,8 @@
 
 /******************************************************************************
- * set device into IDLE mode (spin down); this was used during
- * debugging/testing and is still there since it does not hurt...
+ * Set device into IDLE mode (spin down); this was used during
+ * debugging/testing and is now unused; it's still there in case we need it
+ * again...
+ *
  * If 'idle' is != 0, the idle timeout is set to 5 seconds, otherwise it
  * is turned off.
@@ -1258,4 +1260,9 @@
  * the driver-level spinlock when actually changing the driver state (IORB
  * queues, ...)
+ *
+ * NOTE: OS/2 expects the carry flag set upon return from an interrupt
+ *       handler if the interrupt has not been handled. We do this by
+ *       shifting the return code from this function one bit to the right,
+ *       thus the return code must set bit 0 in this case.
  */
 int ahci_intr(u16 irq)
Index: trunk/src/os2ahci/ata.c
===================================================================
--- trunk/src/os2ahci/ata.c	(revision 85)
+++ trunk/src/os2ahci/ata.c	(revision 86)
@@ -47,5 +47,5 @@
  *    be 0 for the time being.
  *
- *  - 'cmd' is passwd as 16-bit integer because the compiler would push
+ *  - 'cmd' is passed as 16-bit integer because the compiler would push
  *    a 'u8' as 16-bit value (it's a fixed argument) and the stdarg
  *    macros would screw up the address of the first variable argument
Index: trunk/src/os2ahci/ioctl.c
===================================================================
--- trunk/src/os2ahci/ioctl.c	(revision 85)
+++ trunk/src/os2ahci/ioctl.c	(revision 86)
@@ -232,5 +232,5 @@
   while (!(ic->iorb.iorbh.Status & IORB_DONE)) {
 #   ifndef OS2AHCI_SMP
-    drv_lock = 0;
+      drv_lock = 0;
 #   endif
     DevHelp_ProcBlock((ULONG) (void _far *) &ic->iorb.iorbh, 30000, 1);
Index: trunk/src/os2ahci/libc.c
===================================================================
--- trunk/src/os2ahci/libc.c	(revision 85)
+++ trunk/src/os2ahci/libc.c	(revision 86)
@@ -715,5 +715,5 @@
 static void long_to_asc(long val, char _far *buf, int base, int zero, int flen)
 {
-  register unsigned long abs_val = (unsigned long) val;
+  register unsigned long abs_val;
   char tmp[80];
   char _far *ptmp = tmp;
@@ -725,5 +725,7 @@
   }
 
+  abs_val = (unsigned long) ((val < 0 && base <= 10) ? -val : val);
   tmp[sizeof(tmp) - 1] = '\0';
+
   for (s = ptmp + sizeof(tmp) - 2; s > ptmp; s--) {
     *s = hex_digits[abs_val % base];
@@ -734,4 +736,10 @@
   }
 
+  /* left-pad the resulting number with zeros or spaces up to 'flen' */
+  while (flen > 0) {
+    *(--s) = (zero) ? '0' : ' ';
+    flen--;
+  }
+
   /* prepend minus sign if val was negative and base is decimal or less */
   if (val < 0 && base <= 0) {
@@ -740,10 +748,4 @@
   }
 
-  /* left-pad the resulting number with zeros or spaces up to 'flen' */
-  while (flen > 0) {
-    *(--s) = (zero) ? '0' : ' ';
-    flen--;
-  }
-
   strcpy(buf, s);
 }
Index: trunk/src/os2ahci/os2ahci.c
===================================================================
--- trunk/src/os2ahci/os2ahci.c	(revision 85)
+++ trunk/src/os2ahci/os2ahci.c	(revision 86)
@@ -430,5 +430,5 @@
 
     if (iorb_driver_level(iorb)) {
-      /* adapter-level IORB */
+      /* driver-level IORB */
       iorb->UnitHandle = 0;
       iorb_queue_add(&driver_queue, iorb);
@@ -531,5 +531,5 @@
  *
  *   - Driver-level IORB handlers must not access the hardware of a
- *     particular adapter if it's flagged as 'busy'
+ *     particular adapter if it's flagged as 'busy' by another IORB.
  */
 int trigger_engine_1(void)
@@ -1308,5 +1308,5 @@
  * hook right inside this timer callback. Not exactly pretty, especially
  * considering the fact that context hooks were implemented to prevent running
- * lengthy operations like a port reset at task time, but without this
+ * lengthy operations like a port reset at interrupt time, but without this
  * watchdog mechanism we run the risk of getting completely stalled by device
  * problems during the early boot phase.
Index: trunk/src/os2ahci/version.h
===================================================================
--- trunk/src/os2ahci/version.h	(revision 85)
+++ trunk/src/os2ahci/version.h	(revision 86)
@@ -9,4 +9,4 @@
 
 
-#define VERSION            110       /* driver version (2 implied decimals) */
+#define VERSION            111       /* driver version (2 implied decimals) */
 
