Revision eb38c52c

b/elf.h
1123 1123
  Elf64_Word n_type;	/* Content type */
1124 1124
} Elf64_Nhdr;
1125 1125

  
1126
#ifdef ELF_CLASS
1126 1127
#if ELF_CLASS == ELFCLASS32
1127 1128

  
1128 1129
#define elfhdr		elf32_hdr
......
1165 1166
# endif
1166 1167
#endif
1167 1168

  
1169
#endif /* ELF_CLASS */
1170

  
1168 1171

  
1169 1172
#endif /* _QEMU_ELF_H */
b/exec.c
2259 2259
#endif
2260 2260
#ifdef TARGET_SPARC
2261 2261
    do_unassigned_access(addr, 0, 0, 0);
2262
#elif TARGET_CRIS
2262
#elif defined(TARGET_CRIS)
2263 2263
    do_unassigned_access(addr, 0, 0, 0);
2264 2264
#endif
2265 2265
    return 0;
......
2272 2272
#endif
2273 2273
#ifdef TARGET_SPARC
2274 2274
    do_unassigned_access(addr, 1, 0, 0);
2275
#elif TARGET_CRIS
2275
#elif defined(TARGET_CRIS)
2276 2276
    do_unassigned_access(addr, 1, 0, 0);
2277 2277
#endif
2278 2278
}
b/hw/omap1.c
3478 3478

  
3479 3479
    switch (offset) {
3480 3480
    case 0x00:	/* SECONDS_REG */
3481
#if ALMDEBUG
3481
#ifdef ALMDEBUG
3482 3482
        printf("RTC SEC_REG <-- %02x\n", value);
3483 3483
#endif
3484 3484
        s->ti -= s->current_tm.tm_sec;
......
3486 3486
        return;
3487 3487

  
3488 3488
    case 0x04:	/* MINUTES_REG */
3489
#if ALMDEBUG
3489
#ifdef ALMDEBUG
3490 3490
        printf("RTC MIN_REG <-- %02x\n", value);
3491 3491
#endif
3492 3492
        s->ti -= s->current_tm.tm_min * 60;
......
3494 3494
        return;
3495 3495

  
3496 3496
    case 0x08:	/* HOURS_REG */
3497
#if ALMDEBUG
3497
#ifdef ALMDEBUG
3498 3498
        printf("RTC HRS_REG <-- %02x\n", value);
3499 3499
#endif
3500 3500
        s->ti -= s->current_tm.tm_hour * 3600;
......
3506 3506
        return;
3507 3507

  
3508 3508
    case 0x0c:	/* DAYS_REG */
3509
#if ALMDEBUG
3509
#ifdef ALMDEBUG
3510 3510
        printf("RTC DAY_REG <-- %02x\n", value);
3511 3511
#endif
3512 3512
        s->ti -= s->current_tm.tm_mday * 86400;
......
3514 3514
        return;
3515 3515

  
3516 3516
    case 0x10:	/* MONTHS_REG */
3517
#if ALMDEBUG
3517
#ifdef ALMDEBUG
3518 3518
        printf("RTC MTH_REG <-- %02x\n", value);
3519 3519
#endif
3520 3520
        memcpy(&new_tm, &s->current_tm, sizeof(new_tm));
......
3533 3533
        return;
3534 3534

  
3535 3535
    case 0x14:	/* YEARS_REG */
3536
#if ALMDEBUG
3536
#ifdef ALMDEBUG
3537 3537
        printf("RTC YRS_REG <-- %02x\n", value);
3538 3538
#endif
3539 3539
        memcpy(&new_tm, &s->current_tm, sizeof(new_tm));
......
3555 3555
        return;	/* Ignored */
3556 3556

  
3557 3557
    case 0x20:	/* ALARM_SECONDS_REG */
3558
#if ALMDEBUG
3558
#ifdef ALMDEBUG
3559 3559
        printf("ALM SEC_REG <-- %02x\n", value);
3560 3560
#endif
3561 3561
        s->alarm_tm.tm_sec = omap_rtc_bin(value);
......
3563 3563
        return;
3564 3564

  
3565 3565
    case 0x24:	/* ALARM_MINUTES_REG */
3566
#if ALMDEBUG
3566
#ifdef ALMDEBUG
3567 3567
        printf("ALM MIN_REG <-- %02x\n", value);
3568 3568
#endif
3569 3569
        s->alarm_tm.tm_min = omap_rtc_bin(value);
......
3571 3571
        return;
3572 3572

  
3573 3573
    case 0x28:	/* ALARM_HOURS_REG */
3574
#if ALMDEBUG
3574
#ifdef ALMDEBUG
3575 3575
        printf("ALM HRS_REG <-- %02x\n", value);
3576 3576
#endif
3577 3577
        if (s->pm_am)
......
3584 3584
        return;
3585 3585

  
3586 3586
    case 0x2c:	/* ALARM_DAYS_REG */
3587
#if ALMDEBUG
3587
#ifdef ALMDEBUG
3588 3588
        printf("ALM DAY_REG <-- %02x\n", value);
3589 3589
#endif
3590 3590
        s->alarm_tm.tm_mday = omap_rtc_bin(value);
......
3592 3592
        return;
3593 3593

  
3594 3594
    case 0x30:	/* ALARM_MONTHS_REG */
3595
#if ALMDEBUG
3595
#ifdef ALMDEBUG
3596 3596
        printf("ALM MON_REG <-- %02x\n", value);
3597 3597
#endif
3598 3598
        s->alarm_tm.tm_mon = omap_rtc_bin(value);
......
3600 3600
        return;
3601 3601

  
3602 3602
    case 0x34:	/* ALARM_YEARS_REG */
3603
#if ALMDEBUG
3603
#ifdef ALMDEBUG
3604 3604
        printf("ALM YRS_REG <-- %02x\n", value);
3605 3605
#endif
3606 3606
        s->alarm_tm.tm_year = omap_rtc_bin(value);
......
3608 3608
        return;
3609 3609

  
3610 3610
    case 0x40:	/* RTC_CTRL_REG */
3611
#if ALMDEBUG
3611
#ifdef ALMDEBUG
3612 3612
        printf("RTC CONTROL <-- %02x\n", value);
3613 3613
#endif
3614 3614
        s->pm_am = (value >> 3) & 1;
......
3620 3620
        return;
3621 3621

  
3622 3622
    case 0x44:	/* RTC_STATUS_REG */
3623
#if ALMDEBUG
3623
#ifdef ALMDEBUG
3624 3624
        printf("RTC STATUSL <-- %02x\n", value);
3625 3625
#endif
3626 3626
        s->status &= ~((value & 0xc0) ^ 0x80);
......
3628 3628
        return;
3629 3629

  
3630 3630
    case 0x48:	/* RTC_INTERRUPTS_REG */
3631
#if ALMDEBUG
3631
#ifdef ALMDEBUG
3632 3632
        printf("RTC INTRS <-- %02x\n", value);
3633 3633
#endif
3634 3634
        s->interrupts = value;
3635 3635
        return;
3636 3636

  
3637 3637
    case 0x4c:	/* RTC_COMP_LSB_REG */
3638
#if ALMDEBUG
3638
#ifdef ALMDEBUG
3639 3639
        printf("RTC COMPLSB <-- %02x\n", value);
3640 3640
#endif
3641 3641
        s->comp_reg &= 0xff00;
......
3643 3643
        return;
3644 3644

  
3645 3645
    case 0x50:	/* RTC_COMP_MSB_REG */
3646
#if ALMDEBUG
3646
#ifdef ALMDEBUG
3647 3647
        printf("RTC COMPMSB <-- %02x\n", value);
3648 3648
#endif
3649 3649
        s->comp_reg &= 0x00ff;
b/hw/pc.c
76 76
    /* Note: when using kqemu, it is more logical to return the host TSC
77 77
       because kqemu does not trap the RDTSC instruction for
78 78
       performance reasons */
79
#if USE_KQEMU
79
#ifdef USE_KQEMU
80 80
    if (env->kqemu_enabled) {
81 81
        return cpu_get_real_ticks();
82 82
    } else
b/hw/rtl8139.c
3356 3356
    return next_time;
3357 3357
}
3358 3358

  
3359
#if RTL8139_ONBOARD_TIMER
3359
#ifdef RTL8139_ONBOARD_TIMER
3360 3360
static void rtl8139_timer(void *opaque)
3361 3361
{
3362 3362
    RTL8139State *s = opaque;
......
3456 3456

  
3457 3457
    register_savevm("rtl8139", -1, 3, rtl8139_save, rtl8139_load, s);
3458 3458

  
3459
#if RTL8139_ONBOARD_TIMER
3459
#ifdef RTL8139_ONBOARD_TIMER
3460 3460
    s->timer = qemu_new_timer(vm_clock, rtl8139_timer, s);
3461 3461

  
3462 3462
    qemu_mod_timer(s->timer,
b/hw/usb-net.c
1069 1069
    case ClassInterfaceOutRequest | USB_CDC_SEND_ENCAPSULATED_COMMAND:
1070 1070
        if (!s->rndis || value || index != 0)
1071 1071
            goto fail;
1072
#if TRAFFIC_DEBUG
1072
#ifdef TRAFFIC_DEBUG
1073 1073
        {
1074 1074
            unsigned int i;
1075 1075
            fprintf(stderr, "SEND_ENCAPSULATED_COMMAND:");
......
1092 1092
            data[0] = 0;
1093 1093
            ret = 1;
1094 1094
        }
1095
#if TRAFFIC_DEBUG
1095
#ifdef TRAFFIC_DEBUG
1096 1096
        {
1097 1097
            unsigned int i;
1098 1098
            fprintf(stderr, "GET_ENCAPSULATED_RESPONSE:");
......
1219 1219
    if (!s->rndis_resp.tqh_first)
1220 1220
        ret = USB_RET_NAK;
1221 1221

  
1222
#if DEBUG
1222
#ifdef TRAFFIC_DEBUG
1223 1223
    fprintf(stderr, "usbnet: interrupt poll len %u return %d", p->len, ret);
1224 1224
    {
1225 1225
        int i;
......
1260 1260
        s->in_ptr = s->in_len = 0;
1261 1261
    }
1262 1262

  
1263
#if TRAFFIC_DEBUG
1263
#ifdef TRAFFIC_DEBUG
1264 1264
    fprintf(stderr, "usbnet: data in len %u return %d", p->len, ret);
1265 1265
    {
1266 1266
        int i;
......
1285 1285
            (struct rndis_packet_msg_type *) s->out_buf;
1286 1286
    uint32_t len;
1287 1287

  
1288
#if TRAFFIC_DEBUG
1288
#ifdef TRAFFIC_DEBUG
1289 1289
    fprintf(stderr, "usbnet: data out len %u\n", p->len);
1290 1290
    {
1291 1291
        int i;
b/hw/usb-ohci.c
1598 1598
    int i;
1599 1599

  
1600 1600
    if (usb_frame_time == 0) {
1601
#if OHCI_TIME_WARP
1601
#ifdef OHCI_TIME_WARP
1602 1602
        usb_frame_time = ticks_per_sec;
1603 1603
        usb_bit_time = muldiv64(1, ticks_per_sec, USB_HZ/1000);
1604 1604
#else
b/linux-user/arm/nwfpe/fpa11.c
54 54
  fpa11->fpsr = FP_EMULATOR | BIT_AC;
55 55

  
56 56
  /* FPCR: set SB, AB and DA bits, clear all others */
57
#if MAINTAIN_FPCR
57
#ifdef MAINTAIN_FPCR
58 58
  fpa11->fpcr = MASK_RESET;
59 59
#endif
60 60
}
......
64 64
    int rounding_mode;
65 65
   FPA11 *fpa11 = GET_FPA11();
66 66

  
67
#if MAINTAIN_FPCR
67
#ifdef MAINTAIN_FPCR
68 68
   fpa11->fpcr &= ~MASK_ROUNDING_MODE;
69 69
#endif
70 70
   switch (opcode & MASK_ROUNDING_MODE)
......
72 72
      default:
73 73
      case ROUND_TO_NEAREST:
74 74
         rounding_mode = float_round_nearest_even;
75
#if MAINTAIN_FPCR
75
#ifdef MAINTAIN_FPCR
76 76
         fpa11->fpcr |= ROUND_TO_NEAREST;
77 77
#endif
78 78
      break;
79 79

  
80 80
      case ROUND_TO_PLUS_INFINITY:
81 81
         rounding_mode = float_round_up;
82
#if MAINTAIN_FPCR
82
#ifdef MAINTAIN_FPCR
83 83
         fpa11->fpcr |= ROUND_TO_PLUS_INFINITY;
84 84
#endif
85 85
      break;
86 86

  
87 87
      case ROUND_TO_MINUS_INFINITY:
88 88
         rounding_mode = float_round_down;
89
#if MAINTAIN_FPCR
89
#ifdef MAINTAIN_FPCR
90 90
         fpa11->fpcr |= ROUND_TO_MINUS_INFINITY;
91 91
#endif
92 92
      break;
93 93

  
94 94
      case ROUND_TO_ZERO:
95 95
         rounding_mode = float_round_to_zero;
96
#if MAINTAIN_FPCR
96
#ifdef MAINTAIN_FPCR
97 97
         fpa11->fpcr |= ROUND_TO_ZERO;
98 98
#endif
99 99
      break;
......
105 105
{
106 106
    int rounding_precision;
107 107
   FPA11 *fpa11 = GET_FPA11();
108
#if MAINTAIN_FPCR
108
#ifdef MAINTAIN_FPCR
109 109
   fpa11->fpcr &= ~MASK_ROUNDING_PRECISION;
110 110
#endif
111 111
   switch (opcode & MASK_ROUNDING_PRECISION)
112 112
   {
113 113
      case ROUND_SINGLE:
114 114
         rounding_precision = 32;
115
#if MAINTAIN_FPCR
115
#ifdef MAINTAIN_FPCR
116 116
         fpa11->fpcr |= ROUND_SINGLE;
117 117
#endif
118 118
      break;
119 119

  
120 120
      case ROUND_DOUBLE:
121 121
         rounding_precision = 64;
122
#if MAINTAIN_FPCR
122
#ifdef MAINTAIN_FPCR
123 123
         fpa11->fpcr |= ROUND_DOUBLE;
124 124
#endif
125 125
      break;
126 126

  
127 127
      case ROUND_EXTENDED:
128 128
         rounding_precision = 80;
129
#if MAINTAIN_FPCR
129
#ifdef MAINTAIN_FPCR
130 130
         fpa11->fpcr |= ROUND_EXTENDED;
131 131
#endif
132 132
      break;
b/linux-user/main.c
282 282
    p[1] = tswap32(e2);
283 283
}
284 284

  
285
#if TARGET_X86_64
285
#ifdef TARGET_X86_64
286 286
uint64_t idt_table[512];
287 287

  
288 288
static void set_gate64(void *ptr, unsigned int type, unsigned int dpl,
b/mips-dis.c
3302 3302
#endif
3303 3303

  
3304 3304
  /* Set ISA, architecture, and cp0 register names as best we can.  */
3305
#if ! SYMTAB_AVAILABLE && 0
3305
#if !defined(SYMTAB_AVAILABLE) && 0
3306 3306
  /* This is running out on a target machine, not in a host tool.
3307 3307
     FIXME: Where does mips_target_info come from?  */
3308 3308
  target_processor = mips_target_info.processor;
b/slirp/ip_icmp.c
228 228
  /* check msrc */
229 229
  if(!msrc) goto end_error;
230 230
  ip = mtod(msrc, struct ip *);
231
#if DEBUG
231
#ifdef DEBUG
232 232
  { char bufa[20], bufb[20];
233 233
    strcpy(bufa, inet_ntoa(ip->ip_src));
234 234
    strcpy(bufb, inet_ntoa(ip->ip_dst));
......
285 285
  HTONS(icp->icmp_ip.ip_id);
286 286
  HTONS(icp->icmp_ip.ip_off);
287 287

  
288
#if DEBUG
288
#ifdef DEBUG
289 289
  if(message) {           /* DEBUG : append message to ICMP packet */
290 290
    int message_len;
291 291
    char *cpnt;
b/slirp/slirp.h
103 103
# include <sys/time.h>
104 104
# include <time.h>
105 105
#else
106
# if HAVE_SYS_TIME_H
106
# ifdef HAVE_SYS_TIME_H
107 107
#  include <sys/time.h>
108 108
# else
109 109
#  include <time.h>
b/target-i386/op_helper.c
1217 1217
        }
1218 1218
    }
1219 1219
    if (env->cr[0] & CR0_PE_MASK) {
1220
#if TARGET_X86_64
1220
#ifdef TARGET_X86_64
1221 1221
        if (env->hflags & HF_LMA_MASK) {
1222 1222
            do_interrupt64(intno, is_int, error_code, next_eip, is_hw);
1223 1223
        } else
b/vnc.c
35 35
#include "keymaps.c"
36 36
#include "d3des.h"
37 37

  
38
#if CONFIG_VNC_TLS
38
#ifdef CONFIG_VNC_TLS
39 39
#include <gnutls/gnutls.h>
40 40
#include <gnutls/x509.h>
41 41
#endif /* CONFIG_VNC_TLS */
42 42

  
43 43
// #define _VNC_DEBUG 1
44 44

  
45
#if _VNC_DEBUG
45
#ifdef _VNC_DEBUG
46 46
#define VNC_DEBUG(fmt, ...) do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
47 47

  
48 48
#if CONFIG_VNC_TLS && _VNC_DEBUG >= 2
......
93 93
    VNC_AUTH_VENCRYPT = 19
94 94
};
95 95

  
96
#if CONFIG_VNC_TLS
96
#ifdef CONFIG_VNC_TLS
97 97
enum {
98 98
    VNC_WIREMODE_CLEAR,
99 99
    VNC_WIREMODE_TLS,
......
141 141
    char *display;
142 142
    char *password;
143 143
    int auth;
144
#if CONFIG_VNC_TLS
144
#ifdef CONFIG_VNC_TLS
145 145
    int subauth;
146 146
    int x509verify;
147 147

  
......
152 152
#endif
153 153
    char challenge[VNC_AUTH_CHALLENGE_SIZE];
154 154

  
155
#if CONFIG_VNC_TLS
155
#ifdef CONFIG_VNC_TLS
156 156
    int wiremode;
157 157
    gnutls_session_t tls_session;
158 158
#endif
......
662 662
	buffer_reset(&vs->input);
663 663
	buffer_reset(&vs->output);
664 664
	vs->need_update = 0;
665
#if CONFIG_VNC_TLS
665
#ifdef CONFIG_VNC_TLS
666 666
	if (vs->tls_session) {
667 667
	    gnutls_deinit(vs->tls_session);
668 668
	    vs->tls_session = NULL;
......
684 684
    long ret;
685 685
    VncState *vs = opaque;
686 686

  
687
#if CONFIG_VNC_TLS
687
#ifdef CONFIG_VNC_TLS
688 688
    if (vs->tls_session) {
689 689
	ret = gnutls_write(vs->tls_session, vs->output.buffer, vs->output.offset);
690 690
	if (ret < 0) {
......
722 722

  
723 723
    buffer_reserve(&vs->input, 4096);
724 724

  
725
#if CONFIG_VNC_TLS
725
#ifdef CONFIG_VNC_TLS
726 726
    if (vs->tls_session) {
727 727
	ret = gnutls_read(vs->tls_session, buffer_end(&vs->input), 4096);
728 728
	if (ret < 0) {
......
829 829
	    (data[offset + 2] << 8) | data[offset + 3]);
830 830
}
831 831

  
832
#if CONFIG_VNC_TLS
832
#ifdef CONFIG_VNC_TLS
833 833
static ssize_t vnc_tls_push(gnutls_transport_ptr_t transport,
834 834
                            const void *data,
835 835
                            size_t len) {
......
1439 1439
}
1440 1440

  
1441 1441

  
1442
#if CONFIG_VNC_TLS
1442
#ifdef CONFIG_VNC_TLS
1443 1443
#define DH_BITS 1024
1444 1444
static gnutls_dh_params_t dh_params;
1445 1445

  
......
1877 1877
           VNC_DEBUG("Start VNC auth\n");
1878 1878
           return start_auth_vnc(vs);
1879 1879

  
1880
#if CONFIG_VNC_TLS
1880
#ifdef CONFIG_VNC_TLS
1881 1881
       case VNC_AUTH_VENCRYPT:
1882 1882
           VNC_DEBUG("Accept VeNCrypt auth\n");;
1883 1883
           return start_auth_vencrypt(vs);
......
2030 2030
    vnc_dpy_resize(vs->ds, 640, 400);
2031 2031
}
2032 2032

  
2033
#if CONFIG_VNC_TLS
2033
#ifdef CONFIG_VNC_TLS
2034 2034
static int vnc_set_x509_credential(VncState *vs,
2035 2035
				   const char *certdir,
2036 2036
				   const char *filename,
......
2107 2107
	buffer_reset(&vs->input);
2108 2108
	buffer_reset(&vs->output);
2109 2109
	vs->need_update = 0;
2110
#if CONFIG_VNC_TLS
2110
#ifdef CONFIG_VNC_TLS
2111 2111
	if (vs->tls_session) {
2112 2112
	    gnutls_deinit(vs->tls_session);
2113 2113
	    vs->tls_session = NULL;
......
2116 2116
#endif /* CONFIG_VNC_TLS */
2117 2117
    }
2118 2118
    vs->auth = VNC_AUTH_INVALID;
2119
#if CONFIG_VNC_TLS
2119
#ifdef CONFIG_VNC_TLS
2120 2120
    vs->subauth = VNC_AUTH_INVALID;
2121 2121
    vs->x509verify = 0;
2122 2122
#endif
......
2152 2152
    const char *options;
2153 2153
    int password = 0;
2154 2154
    int reverse = 0;
2155
#if CONFIG_VNC_TLS
2155
#ifdef CONFIG_VNC_TLS
2156 2156
    int tls = 0, x509 = 0;
2157 2157
#endif
2158 2158

  
......
2170 2170
	    password = 1; /* Require password auth */
2171 2171
	} else if (strncmp(options, "reverse", 7) == 0) {
2172 2172
	    reverse = 1;
2173
#if CONFIG_VNC_TLS
2173
#ifdef CONFIG_VNC_TLS
2174 2174
	} else if (strncmp(options, "tls", 3) == 0) {
2175 2175
	    tls = 1; /* Require TLS */
2176 2176
	} else if (strncmp(options, "x509", 4) == 0) {
......
2208 2208
    }
2209 2209

  
2210 2210
    if (password) {
2211
#if CONFIG_VNC_TLS
2211
#ifdef CONFIG_VNC_TLS
2212 2212
	if (tls) {
2213 2213
	    vs->auth = VNC_AUTH_VENCRYPT;
2214 2214
	    if (x509) {
......
2222 2222
#endif
2223 2223
	    VNC_DEBUG("Initializing VNC server with password auth\n");
2224 2224
	    vs->auth = VNC_AUTH_VNC;
2225
#if CONFIG_VNC_TLS
2225
#ifdef CONFIG_VNC_TLS
2226 2226
	    vs->subauth = VNC_AUTH_INVALID;
2227 2227
	}
2228 2228
#endif
2229 2229
    } else {
2230
#if CONFIG_VNC_TLS
2230
#ifdef CONFIG_VNC_TLS
2231 2231
	if (tls) {
2232 2232
	    vs->auth = VNC_AUTH_VENCRYPT;
2233 2233
	    if (x509) {
......
2241 2241
#endif
2242 2242
	    VNC_DEBUG("Initializing VNC server with no auth\n");
2243 2243
	    vs->auth = VNC_AUTH_NONE;
2244
#if CONFIG_VNC_TLS
2244
#ifdef CONFIG_VNC_TLS
2245 2245
	    vs->subauth = VNC_AUTH_INVALID;
2246 2246
	}
2247 2247
#endif

Also available in: Unified diff