Diff for /qemu/hw/jazz_led.c between versions 1.1.1.4 and 1.1.1.5

version 1.1.1.4, 2018/04/24 17:37:13 version 1.1.1.5, 2018/04/24 18:37:25
Line 29 Line 29
   
 //#define DEBUG_LED  //#define DEBUG_LED
   
   #ifdef DEBUG_LED
   #define DPRINTF(fmt, ...) \
   do { printf("jazz led: " fmt , ## __VA_ARGS__); } while (0)
   #else
   #define DPRINTF(fmt, ...) do {} while (0)
   #endif
   #define BADF(fmt, ...) \
   do { fprintf(stderr, "jazz led ERROR: " fmt , ## __VA_ARGS__);} while (0)
   
 typedef enum {  typedef enum {
     REDRAW_NONE = 0, REDRAW_SEGMENTS = 1, REDRAW_BACKGROUND = 2,      REDRAW_NONE = 0, REDRAW_SEGMENTS = 1, REDRAW_BACKGROUND = 2,
 } screen_state_t;  } screen_state_t;
Line 49  static uint32_t led_readb(void *opaque,  Line 58  static uint32_t led_readb(void *opaque, 
             val = s->segments;              val = s->segments;
             break;              break;
         default:          default:
 #ifdef DEBUG_LED              BADF("invalid read at [" TARGET_FMT_plx "]\n", addr);
             printf("jazz led: invalid read [0x%x]\n", relative_addr);  
 #endif  
             val = 0;              val = 0;
     }      }
   
       DPRINTF("read addr=" TARGET_FMT_plx " val=0x%02x\n", addr, val);
   
     return val;      return val;
 }  }
   
Line 92  static void led_writeb(void *opaque, tar Line 101  static void led_writeb(void *opaque, tar
 {  {
     LedState *s = opaque;      LedState *s = opaque;
   
       DPRINTF("write addr=" TARGET_FMT_plx " val=0x%02x\n", addr, val);
   
     switch (addr) {      switch (addr) {
         case 0:          case 0:
             s->segments = val;              s->segments = val;
             s->state |= REDRAW_SEGMENTS;              s->state |= REDRAW_SEGMENTS;
             break;              break;
         default:          default:
 #ifdef DEBUG_LED              BADF("invalid write of 0x%08x at [" TARGET_FMT_plx "]\n", val, addr);
             printf("jazz led: invalid write of 0x%02x at [0x%x]\n", val, relative_addr);  
 #endif  
             break;              break;
     }      }
 }  }
Line 307  void jazz_led_init(target_phys_addr_t ba Line 316  void jazz_led_init(target_phys_addr_t ba
   
     s->state = REDRAW_SEGMENTS | REDRAW_BACKGROUND;      s->state = REDRAW_SEGMENTS | REDRAW_BACKGROUND;
   
     io = cpu_register_io_memory(led_read, led_write, s);      io = cpu_register_io_memory(led_read, led_write, s,
                                   DEVICE_NATIVE_ENDIAN);
     cpu_register_physical_memory(base, 1, io);      cpu_register_physical_memory(base, 1, io);
   
     s->ds = graphic_console_init(jazz_led_update_display,      s->ds = graphic_console_init(jazz_led_update_display,

Removed from v.1.1.1.4  
changed lines
  Added in v.1.1.1.5


unix.superglobalmegacorp.com