Changeset 86


Ignore:
Timestamp:
Apr 28, 2011, 7:41:44 PM (14 years ago)
Author:
chris
Message:
  • Cosmetic changes to comments
  • Fix number to string conversion for negative [decimal] numbers (the minus sign was at the wrong location and the two's complement was not respected). This functionality was unused so far but popped up during a code review.
Location:
trunk/src/os2ahci
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/os2ahci/ahci.c

    r82 r86  
    12361236
    12371237/******************************************************************************
    1238  * set device into IDLE mode (spin down); this was used during
    1239  * debugging/testing and is still there since it does not hurt...
     1238 * Set device into IDLE mode (spin down); this was used during
     1239 * debugging/testing and is now unused; it's still there in case we need it
     1240 * again...
     1241 *
    12401242 * If 'idle' is != 0, the idle timeout is set to 5 seconds, otherwise it
    12411243 * is turned off.
     
    12581260 * the driver-level spinlock when actually changing the driver state (IORB
    12591261 * queues, ...)
     1262 *
     1263 * NOTE: OS/2 expects the carry flag set upon return from an interrupt
     1264 *       handler if the interrupt has not been handled. We do this by
     1265 *       shifting the return code from this function one bit to the right,
     1266 *       thus the return code must set bit 0 in this case.
    12601267 */
    12611268int ahci_intr(u16 irq)
  • trunk/src/os2ahci/ata.c

    r82 r86  
    4747 *    be 0 for the time being.
    4848 *
    49  *  - 'cmd' is passwd as 16-bit integer because the compiler would push
     49 *  - 'cmd' is passed as 16-bit integer because the compiler would push
    5050 *    a 'u8' as 16-bit value (it's a fixed argument) and the stdarg
    5151 *    macros would screw up the address of the first variable argument
  • trunk/src/os2ahci/ioctl.c

    r84 r86  
    232232  while (!(ic->iorb.iorbh.Status & IORB_DONE)) {
    233233#   ifndef OS2AHCI_SMP
    234     drv_lock = 0;
     234      drv_lock = 0;
    235235#   endif
    236236    DevHelp_ProcBlock((ULONG) (void _far *) &ic->iorb.iorbh, 30000, 1);
  • trunk/src/os2ahci/libc.c

    r82 r86  
    715715static void long_to_asc(long val, char _far *buf, int base, int zero, int flen)
    716716{
    717   register unsigned long abs_val = (unsigned long) val;
     717  register unsigned long abs_val;
    718718  char tmp[80];
    719719  char _far *ptmp = tmp;
     
    725725  }
    726726
     727  abs_val = (unsigned long) ((val < 0 && base <= 10) ? -val : val);
    727728  tmp[sizeof(tmp) - 1] = '\0';
     729
    728730  for (s = ptmp + sizeof(tmp) - 2; s > ptmp; s--) {
    729731    *s = hex_digits[abs_val % base];
     
    734736  }
    735737
     738  /* left-pad the resulting number with zeros or spaces up to 'flen' */
     739  while (flen > 0) {
     740    *(--s) = (zero) ? '0' : ' ';
     741    flen--;
     742  }
     743
    736744  /* prepend minus sign if val was negative and base is decimal or less */
    737745  if (val < 0 && base <= 0) {
     
    740748  }
    741749
    742   /* left-pad the resulting number with zeros or spaces up to 'flen' */
    743   while (flen > 0) {
    744     *(--s) = (zero) ? '0' : ' ';
    745     flen--;
    746   }
    747 
    748750  strcpy(buf, s);
    749751}
  • trunk/src/os2ahci/os2ahci.c

    r82 r86  
    430430
    431431    if (iorb_driver_level(iorb)) {
    432       /* adapter-level IORB */
     432      /* driver-level IORB */
    433433      iorb->UnitHandle = 0;
    434434      iorb_queue_add(&driver_queue, iorb);
     
    531531 *
    532532 *   - Driver-level IORB handlers must not access the hardware of a
    533  *     particular adapter if it's flagged as 'busy'
     533 *     particular adapter if it's flagged as 'busy' by another IORB.
    534534 */
    535535int trigger_engine_1(void)
     
    13081308 * hook right inside this timer callback. Not exactly pretty, especially
    13091309 * considering the fact that context hooks were implemented to prevent running
    1310  * lengthy operations like a port reset at task time, but without this
     1310 * lengthy operations like a port reset at interrupt time, but without this
    13111311 * watchdog mechanism we run the risk of getting completely stalled by device
    13121312 * problems during the early boot phase.
  • trunk/src/os2ahci/version.h

    r85 r86  
    99
    1010
    11 #define VERSION            110       /* driver version (2 implied decimals) */
     11#define VERSION            111       /* driver version (2 implied decimals) */
    1212
Note: See TracChangeset for help on using the changeset viewer.