Changeset 3665


Ignore:
Timestamp:
12/17/07 18:52:55 (6 years ago)
Author:
andrew
Message:

Merge cvs.savannah.nongnu.org:/sources/qemu.

Location:
trunk/src/host/qemu-neo1973
Files:
3 added
1 deleted
52 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/host/qemu-neo1973/Makefile

    r3627 r3665  
    122122        $(AR) rcs $@ $(OBJS) 
    123123 
     124QEMU_IMG_BLOCK_OBJS = $(BLOCK_OBJS) 
     125ifdef CONFIG_WIN32 
     126QEMU_IMG_BLOCK_OBJS += qemu-img-block-raw-win32.o 
     127else 
     128QEMU_IMG_BLOCK_OBJS += qemu-img-block-raw-posix.o 
     129endif 
     130 
    124131###################################################################### 
    125132 
    126 qemu-img$(EXESUF): qemu-img.o qemu-img-block.o qemu-img-block-raw.o $(BLOCK_OBJS) 
     133qemu-img$(EXESUF): qemu-img.o qemu-img-block.o $(QEMU_IMG_BLOCK_OBJS) 
    127134        $(CC) $(LDFLAGS) $(BASE_LDFLAGS) -o $@ $^ -lz $(LIBS) 
    128135 
  • trunk/src/host/qemu-neo1973/Makefile.target

    r3627 r3665  
    162162  else 
    163163    BASE_CFLAGS+=-ffixed-g1 -ffixed-g6 
    164     HELPER_CFLAGS=$(CFLAGS) -ffixed-i0 -mflat 
     164    HELPER_CFLAGS=$(CFLAGS) -ffixed-i0 
    165165    # -static is used to avoid g1/g3 usage by the dynamic linker 
    166166    BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static 
     
    399399VL_OBJS=vl.o osdep.o monitor.o pci.o loader.o isa_mmio.o 
    400400# XXX: suppress QEMU_TOOL tests 
    401 VL_OBJS+=block-raw.o 
     401ifdef CONFIG_WIN32 
     402VL_OBJS+=block-raw-win32.o 
     403else 
     404VL_OBJS+=block-raw-posix.o 
     405endif 
    402406 
    403407ifdef CONFIG_ALSA 
     
    503507VL_OBJS+= arm-semi.o 
    504508VL_OBJS+= pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o 
    505 VL_OBJS+= pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o 
     509VL_OBJS+= pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o 
    506510VL_OBJS+= pflash_cfi01.o gumstix.o 
    507511VL_OBJS+= spitz.o ide.o serial.o nand.o ecc.o 
  • trunk/src/host/qemu-neo1973/audio/alsaaudio.c

    r3443 r3665  
    8787 
    8888struct alsa_params_req { 
    89     int freq; 
     89    unsigned int freq; 
    9090    audfmt_e fmt; 
    91     int nchannels; 
     91    unsigned int nchannels; 
    9292    unsigned int buffer_size; 
    9393    unsigned int period_size; 
     
    286286    snd_pcm_t *handle; 
    287287    snd_pcm_hw_params_t *hw_params; 
    288     int err, freq, nchannels; 
     288    int err; 
     289    unsigned int freq, nchannels; 
    289290    const char *pcm_name = in ? conf.pcm_name_in : conf.pcm_name_out; 
    290291    unsigned int period_size, buffer_size; 
  • trunk/src/host/qemu-neo1973/block-vpc.c

    r3406 r3665  
    8282static int vpc_probe(const uint8_t *buf, int buf_size, const char *filename) 
    8383{ 
    84     if (buf_size >= 8 && !strncmp(buf, "conectix", 8)) 
     84    if (buf_size >= 8 && !strncmp((char *)buf, "conectix", 8)) 
    8585        return 100; 
    8686    return 0; 
  • trunk/src/host/qemu-neo1973/block-vvfat.c

    r3443 r3665  
    413413 
    414414/* dest is assumed to hold 258 bytes, and pads with 0xffff up to next multiple of 26 */ 
    415 static inline int short2long_name(unsigned char* dest,const char* src) 
     415static inline int short2long_name(char* dest,const char* src) 
    416416{ 
    417417    int i; 
     
    566566        return le16_to_cpu(*entry); 
    567567    } else { 
    568         const uint8_t* x=s->fat.pointer+cluster*3/2; 
     568        const uint8_t* x=(uint8_t*)(s->fat.pointer)+cluster*3/2; 
    569569        return ((x[0]|(x[1]<<8))>>(cluster&1?4:0))&0x0fff; 
    570570    } 
     
    627627    entry=array_get_next(&(s->directory)); 
    628628    memset(entry->name,0x20,11); 
    629     strncpy(entry->name,filename,i); 
     629    strncpy((char*)entry->name,filename,i); 
    630630 
    631631    if(j > 0) 
     
    869869        direntry_t* entry=array_get_next(&(s->directory)); 
    870870        entry->attributes=0x28; /* archive | volume label */ 
    871         snprintf(entry->name,11,"QEMU VVFAT"); 
     871        snprintf((char*)entry->name,11,"QEMU VVFAT"); 
    872872    } 
    873873 
     
    11881188read_cluster_directory: 
    11891189                offset = s->cluster_size*(cluster_num-s->current_mapping->begin); 
    1190                 s->cluster = s->directory.pointer+offset 
     1190                s->cluster = (unsigned char*)s->directory.pointer+offset 
    11911191                        + 0x20*s->current_mapping->info.dir.first_dir_index; 
    11921192                assert(((s->cluster-(unsigned char*)s->directory.pointer)%s->cluster_size)==0); 
     
    14581458 
    14591459    if (pointer[0] & 0x40) 
    1460         lfn->len = offset + strlen(lfn->name + offset); 
     1460        lfn->len = offset + strlen((char*)lfn->name + offset); 
    14611461 
    14621462    return 0; 
     
    14971497        lfn->name[i + j + 1] = '\0'; 
    14981498 
    1499     lfn->len = strlen(lfn->name); 
     1499    lfn->len = strlen((char*)lfn->name); 
    15001500 
    15011501    return 0; 
     
    17931793                    goto fail; 
    17941794                } 
    1795                 if (subret > 0 || !strcmp(lfn.name, ".") 
    1796                         || !strcmp(lfn.name, "..")) 
     1795                if (subret > 0 || !strcmp((char*)lfn.name, ".") 
     1796                        || !strcmp((char*)lfn.name, "..")) 
    17971797                    continue; 
    17981798            } 
     
    18031803                goto fail; 
    18041804            } 
    1805             strcpy(path2 + path_len + 1, lfn.name); 
     1805            strcpy(path2 + path_len + 1, (char*)lfn.name); 
    18061806 
    18071807            if (is_directory(direntries + i)) { 
     
    22352235 
    22362236        ret = vvfat_read(s->bs, cluster2sector(s, c), 
    2237             cluster, (rest_size + 0x1ff) / 0x200); 
     2237            (uint8_t*)cluster, (rest_size + 0x1ff) / 0x200); 
    22382238 
    22392239        if (ret < 0) 
  • trunk/src/host/qemu-neo1973/cpu-all.h

    r3517 r3665  
    717717   code */ 
    718718#define PAGE_WRITE_ORG 0x0010 
     719#define PAGE_RESERVED  0x0020 
    719720 
    720721void page_dump(FILE *f); 
  • trunk/src/host/qemu-neo1973/cpu-exec.c

    r3555 r3665  
    4040//#define DEBUG_EXEC 
    4141//#define DEBUG_SIGNAL 
     42 
     43#define SAVE_GLOBALS() 
     44#define RESTORE_GLOBALS() 
     45 
     46#if defined(__sparc__) && !defined(HOST_SOLARIS) 
     47#include <features.h> 
     48#if defined(__GLIBC__) && ((__GLIBC__ < 2) || \ 
     49                           ((__GLIBC__ == 2) && (__GLIBC_MINOR__ <= 90))) 
     50// Work around ugly bugs in glibc that mangle global register contents 
     51 
     52static volatile void *saved_env; 
     53static volatile unsigned long saved_t0, saved_i7; 
     54#undef SAVE_GLOBALS 
     55#define SAVE_GLOBALS() do {                                     \ 
     56        saved_env = env;                                        \ 
     57        saved_t0 = T0;                                          \ 
     58        asm volatile ("st %%i7, [%0]" : : "r" (&saved_i7));     \ 
     59    } while(0) 
     60 
     61#undef RESTORE_GLOBALS 
     62#define RESTORE_GLOBALS() do {                                  \ 
     63        env = (void *)saved_env;                                \ 
     64        T0 = saved_t0;                                          \ 
     65        asm volatile ("ld [%0], %%i7" : : "r" (&saved_i7));     \ 
     66    } while(0) 
     67 
     68static int sparc_setjmp(jmp_buf buf) 
     69{ 
     70    int ret; 
     71 
     72    SAVE_GLOBALS(); 
     73    ret = setjmp(buf); 
     74    RESTORE_GLOBALS(); 
     75    return ret; 
     76} 
     77#undef setjmp 
     78#define setjmp(jmp_buf) sparc_setjmp(jmp_buf) 
     79 
     80static void sparc_longjmp(jmp_buf buf, int val) 
     81{ 
     82    SAVE_GLOBALS(); 
     83    longjmp(buf, val); 
     84} 
     85#define longjmp(jmp_buf, val) sparc_longjmp(jmp_buf, val) 
     86#endif 
     87#endif 
    4288 
    4389void cpu_loop_exit(void) 
     
    134180    tb->cs_base = cs_base; 
    135181    tb->flags = flags; 
    136     cpu_gen_code(env, tb, CODE_GEN_MAX_SIZE, &code_gen_size); 
     182    SAVE_GLOBALS(); 
     183    cpu_gen_code(env, tb, &code_gen_size); 
     184    RESTORE_GLOBALS(); 
    137185    code_gen_ptr = (void *)(((unsigned long)code_gen_ptr + code_gen_size + CODE_GEN_ALIGN - 1) & ~(CODE_GEN_ALIGN - 1)); 
    138186 
     
    233281} 
    234282 
    235 #if defined(__sparc__) && !defined(HOST_SOLARIS) 
    236 #define BREAK_CHAIN tmp_T0 = 0 
    237 #else 
    238283#define BREAK_CHAIN T0 = 0 
    239 #endif 
    240284 
    241285/* main execution loop */ 
     
    250294#endif 
    251295#endif 
    252 #if defined(__sparc__) && !defined(HOST_SOLARIS) 
    253     int saved_i7; 
    254     target_ulong tmp_T0; 
    255 #endif 
    256296    int ret, interrupt_request; 
    257297    void (*gen_func)(void); 
     
    268308#include "hostregs_helper.h" 
    269309    env = env1; 
    270 #if defined(__sparc__) && !defined(HOST_SOLARIS) 
    271     /* we also save i7 because longjmp may not restore it */ 
    272     asm volatile ("mov %%i7, %0" : "=r" (saved_i7)); 
    273 #endif 
     310    SAVE_GLOBALS(); 
    274311 
    275312    env_to_regs(); 
     
    381418            T0 = 0; /* force lookup of first TB */ 
    382419            for(;;) { 
    383 #if defined(__sparc__) && !defined(HOST_SOLARIS) 
    384                 /* g1 can be modified by some libc? functions */ 
    385                 tmp_T0 = T0; 
    386 #endif 
     420                SAVE_GLOBALS(); 
    387421                interrupt_request = env->interrupt_request; 
    388422                if (__builtin_expect(interrupt_request, 0) 
     
    598632                } 
    599633#endif 
    600 #if defined(__sparc__) && !defined(HOST_SOLARIS) 
    601                 T0 = tmp_T0; 
    602 #endif 
     634                RESTORE_GLOBALS(); 
    603635                /* see if we can patch the calling TB. When the TB 
    604636                   spans two pages, we cannot safely do a direct 
     
    696728 
    697729    /* restore global registers */ 
    698 #if defined(__sparc__) && !defined(HOST_SOLARIS) 
    699     asm volatile ("mov %0, %%i7" : : "r" (saved_i7)); 
    700 #endif 
     730    RESTORE_GLOBALS(); 
    701731#include "hostregs_helper.h" 
    702732 
  • trunk/src/host/qemu-neo1973/exec-all.h

    r3443 r3665  
    6565int gen_intermediate_code_pc(CPUState *env, struct TranslationBlock *tb); 
    6666void dump_ops(const uint16_t *opc_buf, const uint32_t *opparam_buf); 
     67unsigned long code_gen_max_block_size(void); 
    6768int cpu_gen_code(CPUState *env, struct TranslationBlock *tb, 
    68                  int max_code_size, int *gen_code_size_ptr); 
     69                 int *gen_code_size_ptr); 
    6970int cpu_restore_state(struct TranslationBlock *tb, 
    7071                      CPUState *env, unsigned long searched_pc, 
     
    9596} 
    9697 
    97 #define CODE_GEN_MAX_SIZE        65536 
    9898#define CODE_GEN_ALIGN           16 /* must be >= of the size of a icache line */ 
    9999 
  • trunk/src/host/qemu-neo1973/exec.c

    r3627 r3665  
    5757 
    5858/* threshold to flush the translated code buffer */ 
    59 #define CODE_GEN_BUFFER_MAX_SIZE (CODE_GEN_BUFFER_SIZE - CODE_GEN_MAX_SIZE) 
     59#define CODE_GEN_BUFFER_MAX_SIZE (CODE_GEN_BUFFER_SIZE - code_gen_max_block_size()) 
    6060 
    6161#define SMC_BITMAP_USE_THRESHOLD 10 
     
    210210    l1_phys_map = qemu_vmalloc(L1_SIZE * sizeof(void *)); 
    211211    memset(l1_phys_map, 0, L1_SIZE * sizeof(void *)); 
     212 
     213#if !defined(_WIN32) && defined(CONFIG_USER_ONLY) 
     214    { 
     215        long long startaddr, endaddr; 
     216        FILE *f; 
     217        int n; 
     218 
     219        f = fopen("/proc/self/maps", "r"); 
     220        if (f) { 
     221            do { 
     222                n = fscanf (f, "%llx-%llx %*[^\n]\n", &startaddr, &endaddr); 
     223                if (n == 2) { 
     224                    page_set_flags(TARGET_PAGE_ALIGN(startaddr), 
     225                                   TARGET_PAGE_ALIGN(endaddr), 
     226                                   PAGE_RESERVED);  
     227                } 
     228            } while (!feof(f)); 
     229            fclose(f); 
     230        } 
     231    } 
     232#endif 
    212233} 
    213234 
     
    623644    tb->flags = flags; 
    624645    tb->cflags = cflags; 
    625     cpu_gen_code(env, tb, CODE_GEN_MAX_SIZE, &code_gen_size); 
     646    cpu_gen_code(env, tb, &code_gen_size); 
    626647    code_gen_ptr = (void *)(((unsigned long)code_gen_ptr + code_gen_size + CODE_GEN_ALIGN - 1) & ~(CODE_GEN_ALIGN - 1)); 
    627648 
  • trunk/src/host/qemu-neo1973/gdbstub.c

    r3443 r3665  
    6464    int line_buf_index; 
    6565    int line_csum; 
    66     char last_packet[4100]; 
     66    uint8_t last_packet[4100]; 
    6767    int last_packet_len; 
    6868#ifdef CONFIG_USER_ONLY 
     
    189189{ 
    190190    int len, csum, i; 
    191     char *p; 
     191    uint8_t *p; 
    192192 
    193193#ifdef DEBUG_GDB 
     
    210210 
    211211        s->last_packet_len = p - s->last_packet; 
    212         put_buffer(s, s->last_packet, s->last_packet_len); 
     212        put_buffer(s, (uint8_t *)s->last_packet, s->last_packet_len); 
    213213 
    214214#ifdef CONFIG_USER_ONLY 
     
    11801180    CPUState *env = s->env; 
    11811181    int i, csum; 
    1182     char reply[1]; 
     1182    uint8_t reply; 
    11831183 
    11841184#ifndef CONFIG_USER_ONLY 
     
    11901190            printf("Got NACK, retransmitting\n"); 
    11911191#endif 
    1192             put_buffer(s, s->last_packet, s->last_packet_len); 
     1192            put_buffer(s, (uint8_t *)s->last_packet, s->last_packet_len); 
    11931193        } 
    11941194#ifdef DEBUG_GDB 
     
    12381238            } 
    12391239            if (s->line_csum != (csum & 0xff)) { 
    1240                 reply[0] = '-'; 
    1241                 put_buffer(s, reply, 1); 
     1240                reply = '-'; 
     1241                put_buffer(s, &reply, 1); 
    12421242                s->state = RS_IDLE; 
    12431243            } else { 
    1244                 reply[0] = '+'; 
    1245                 put_buffer(s, reply, 1); 
     1244                reply = '+'; 
     1245                put_buffer(s, &reply, 1); 
    12461246                s->state = gdb_handle_packet(s, env, s->line_buf); 
    12471247            } 
  • trunk/src/host/qemu-neo1973/hw/acpi.c

    r3443 r3665  
    440440    qemu_put_8s(f, &s->apms); 
    441441    qemu_put_timer(f, s->tmr_timer); 
    442     qemu_put_be64s(f, &s->tmr_overflow_time); 
     442    qemu_put_be64(f, s->tmr_overflow_time); 
    443443} 
    444444 
     
    461461    qemu_get_8s(f, &s->apms); 
    462462    qemu_get_timer(f, s->tmr_timer); 
    463     qemu_get_be64s(f, &s->tmr_overflow_time); 
     463    s->tmr_overflow_time=qemu_get_be64(f); 
    464464 
    465465    pm_io_space_update(s); 
  • trunk/src/host/qemu-neo1973/hw/apic.c

    r3443 r3665  
    762762    qemu_put_be32s(f, &s->icr[1]); 
    763763    qemu_put_be32s(f, &s->divide_conf); 
    764     qemu_put_be32s(f, &s->count_shift); 
     764    qemu_put_be32(f, s->count_shift); 
    765765    qemu_put_be32s(f, &s->initial_count); 
    766     qemu_put_be64s(f, &s->initial_count_load_time); 
    767     qemu_put_be64s(f, &s->next_time); 
     766    qemu_put_be64(f, s->initial_count_load_time); 
     767    qemu_put_be64(f, s->next_time); 
    768768 
    769769    qemu_put_timer(f, s->timer); 
     
    798798    qemu_get_be32s(f, &s->icr[1]); 
    799799    qemu_get_be32s(f, &s->divide_conf); 
    800     qemu_get_be32s(f, &s->count_shift); 
     800    s->count_shift=qemu_get_be32(f); 
    801801    qemu_get_be32s(f, &s->initial_count); 
    802     qemu_get_be64s(f, &s->initial_count_load_time); 
    803     qemu_get_be64s(f, &s->next_time); 
     802    s->initial_count_load_time=qemu_get_be64(f); 
     803    s->next_time=qemu_get_be64(f); 
    804804 
    805805    if (version_id >= 2) 
  • trunk/src/host/qemu-neo1973/hw/boards.h

    r3582 r3665  
    5353 
    5454/* sun4m.c */ 
    55 extern QEMUMachine ss5_machine, ss10_machine, ss600mp_machine; 
     55extern QEMUMachine ss5_machine, ss10_machine, ss600mp_machine, ss20_machine; 
    5656 
    5757/* sun4u.c */ 
  • trunk/src/host/qemu-neo1973/hw/cirrus_vga.c

    r3443 r3665  
    29862986    qemu_put_8s(f, &s->ar_index); 
    29872987    qemu_put_buffer(f, s->ar, 21); 
    2988     qemu_put_be32s(f, &s->ar_flip_flop); 
     2988    qemu_put_be32(f, s->ar_flip_flop); 
    29892989    qemu_put_8s(f, &s->cr_index); 
    29902990    qemu_put_buffer(f, s->cr, 256); 
     
    30013001    qemu_put_buffer(f, s->palette, 768); 
    30023002 
    3003     qemu_put_be32s(f, &s->bank_offset); 
     3003    qemu_put_be32(f, s->bank_offset); 
    30043004 
    30053005    qemu_put_8s(f, &s->cirrus_hidden_dac_lockindex); 
     
    30373037    qemu_get_8s(f, &s->ar_index); 
    30383038    qemu_get_buffer(f, s->ar, 21); 
    3039     qemu_get_be32s(f, &s->ar_flip_flop); 
     3039    s->ar_flip_flop=qemu_get_be32(f); 
    30403040    qemu_get_8s(f, &s->cr_index); 
    30413041    qemu_get_buffer(f, s->cr, 256); 
     
    30523052    qemu_get_buffer(f, s->palette, 768); 
    30533053 
    3054     qemu_get_be32s(f, &s->bank_offset); 
     3054    s->bank_offset=qemu_get_be32(f); 
    30553055 
    30563056    qemu_get_8s(f, &s->cirrus_hidden_dac_lockindex); 
  • trunk/src/host/qemu-neo1973/hw/dma.c

    r3443 r3665  
    483483    qemu_put_8s (f, &d->mask); 
    484484    qemu_put_8s (f, &d->flip_flop); 
    485     qemu_put_be32s (f, &d->dshift); 
     485    qemu_put_be32 (f, d->dshift); 
    486486 
    487487    for (i = 0; i < 4; ++i) { 
    488488        struct dma_regs *r = &d->regs[i]; 
    489         qemu_put_be32s (f, &r->now[0]); 
    490         qemu_put_be32s (f, &r->now[1]); 
     489        qemu_put_be32 (f, r->now[0]); 
     490        qemu_put_be32 (f, r->now[1]); 
    491491        qemu_put_be16s (f, &r->base[0]); 
    492492        qemu_put_be16s (f, &r->base[1]); 
     
    511511    qemu_get_8s (f, &d->mask); 
    512512    qemu_get_8s (f, &d->flip_flop); 
    513     qemu_get_be32s (f, &d->dshift); 
     513    d->dshift=qemu_get_be32 (f); 
    514514 
    515515    for (i = 0; i < 4; ++i) { 
    516516        struct dma_regs *r = &d->regs[i]; 
    517         qemu_get_be32s (f, &r->now[0]); 
    518         qemu_get_be32s (f, &r->now[1]); 
     517        r->now[0]=qemu_get_be32 (f); 
     518        r->now[1]=qemu_get_be32 (f); 
    519519        qemu_get_be16s (f, &r->base[0]); 
    520520        qemu_get_be16s (f, &r->base[1]); 
  • trunk/src/host/qemu-neo1973/hw/fdc.c

    r3443 r3665  
    181181    uint8_t max_track; 
    182182    uint8_t max_head; 
    183     const unsigned char *str; 
     183    const char *str; 
    184184} fd_format_t; 
    185185 
  • trunk/src/host/qemu-neo1973/hw/i8254.c

    r3443 r3665  
    398398    for(i = 0; i < 3; i++) { 
    399399        s = &pit->channels[i]; 
    400         qemu_put_be32s(f, &s->count); 
     400        qemu_put_be32(f, s->count); 
    401401        qemu_put_be16s(f, &s->latched_count); 
    402402        qemu_put_8s(f, &s->count_latched); 
     
    410410        qemu_put_8s(f, &s->bcd); 
    411411        qemu_put_8s(f, &s->gate); 
    412         qemu_put_be64s(f, &s->count_load_time); 
     412        qemu_put_be64(f, s->count_load_time); 
    413413        if (s->irq_timer) { 
    414             qemu_put_be64s(f, &s->next_transition_time); 
     414            qemu_put_be64(f, s->next_transition_time); 
    415415            qemu_put_timer(f, s->irq_timer); 
    416416        } 
     
    429429    for(i = 0; i < 3; i++) { 
    430430        s = &pit->channels[i]; 
    431         qemu_get_be32s(f, &s->count); 
     431        s->count=qemu_get_be32(f); 
    432432        qemu_get_be16s(f, &s->latched_count); 
    433433        qemu_get_8s(f, &s->count_latched); 
     
    441441        qemu_get_8s(f, &s->bcd); 
    442442        qemu_get_8s(f, &s->gate); 
    443         qemu_get_be64s(f, &s->count_load_time); 
     443        s->count_load_time=qemu_get_be64(f); 
    444444        if (s->irq_timer) { 
    445             qemu_get_be64s(f, &s->next_transition_time); 
     445            s->next_transition_time=qemu_get_be64(f); 
    446446            qemu_get_timer(f, s->irq_timer); 
    447447        } 
  • trunk/src/host/qemu-neo1973/hw/ide.c

    r3627 r3665  
    472472    put_le16(p + 6, s->sectors); 
    473473    snprintf(buf, sizeof(buf), "QM%05d", s->drive_serial); 
    474     padstr((uint8_t *)(p + 10), buf, 20); /* serial number */ 
     474    padstr((char *)(p + 10), buf, 20); /* serial number */ 
    475475    put_le16(p + 20, 3); /* XXX: retired, remove ? */ 
    476476    put_le16(p + 21, 512); /* cache size in sectors */ 
    477477    put_le16(p + 22, 4); /* ecc bytes */ 
    478     padstr((uint8_t *)(p + 23), QEMU_VERSION, 8); /* firmware version */ 
    479     padstr((uint8_t *)(p + 27), "QEMU HARDDISK", 40); /* model */ 
     478    padstr((char *)(p + 23), QEMU_VERSION, 8); /* firmware version */ 
     479    padstr((char *)(p + 27), "QEMU HARDDISK", 40); /* model */ 
    480480#if MAX_MULT_SECTORS > 1 
    481481    put_le16(p + 47, 0x8000 | MAX_MULT_SECTORS); 
     
    537537    put_le16(p + 0, (2 << 14) | (5 << 8) | (1 << 7) | (2 << 5) | (0 << 0)); 
    538538    snprintf(buf, sizeof(buf), "QM%05d", s->drive_serial); 
    539     padstr((uint8_t *)(p + 10), buf, 20); /* serial number */ 
     539    padstr((char *)(p + 10), buf, 20); /* serial number */ 
    540540    put_le16(p + 20, 3); /* buffer type */ 
    541541    put_le16(p + 21, 512); /* cache size in sectors */ 
    542542    put_le16(p + 22, 4); /* ecc bytes */ 
    543     padstr((uint8_t *)(p + 23), QEMU_VERSION, 8); /* firmware version */ 
    544     padstr((uint8_t *)(p + 27), "QEMU CD-ROM", 40); /* model */ 
     543    padstr((char *)(p + 23), QEMU_VERSION, 8); /* firmware version */ 
     544    padstr((char *)(p + 27), "QEMU CD-ROM", 40); /* model */ 
    545545    put_le16(p + 48, 1); /* dword I/O (XXX: should not be set on CDROM) */ 
    546546#ifdef USE_DMA_CDROM 
     
    592592    put_le16(p + 8, s->nb_sectors);             /* Sectors per card */ 
    593593    snprintf(buf, sizeof(buf), "QM%05d", s->drive_serial); 
    594     padstr((uint8_t *)(p + 10), buf, 20);       /* Serial number in ASCII */ 
     594    padstr((char *)(p + 10), buf, 20);  /* Serial number in ASCII */ 
    595595    put_le16(p + 22, 0x0004);                   /* ECC bytes */ 
    596     padstr((uint8_t *) (p + 23), QEMU_VERSION, 8);      /* Firmware Revision */ 
    597     padstr((uint8_t *) (p + 27), "QEMU MICRODRIVE", 40);/* Model number */ 
     596    padstr((char *) (p + 23), QEMU_VERSION, 8); /* Firmware Revision */ 
     597    padstr((char *) (p + 27), "QEMU MICRODRIVE", 40);/* Model number */ 
    598598#if MAX_MULT_SECTORS > 1 
    599599    put_le16(p + 47, 0x8000 | MAX_MULT_SECTORS); 
     
    20432043            s->status = 0x00; /* NOTE: READY is _not_ set */ 
    20442044            s->error = 0x01; 
     2045            ide_set_irq(s); 
    20452046            break; 
    20462047        case WIN_SRST: 
     
    25092510static void ide_save(QEMUFile* f, IDEState *s) 
    25102511{ 
    2511     qemu_put_be32s(f, &s->mult_sectors); 
    2512     qemu_put_be32s(f, &s->identify_set); 
     2512    qemu_put_be32(f, s->mult_sectors); 
     2513    qemu_put_be32(f, s->identify_set); 
    25132514    if (s->identify_set) { 
    25142515        qemu_put_buffer(f, (const uint8_t *)s->identify_data, 512); 
     
    25372538static void ide_load(QEMUFile* f, IDEState *s) 
    25382539{ 
    2539     qemu_get_be32s(f, &s->mult_sectors); 
    2540     qemu_get_be32s(f, &s->identify_set); 
     2540    s->mult_sectors=qemu_get_be32(f); 
     2541    s->identify_set=qemu_get_be32(f); 
    25412542    if (s->identify_set) { 
    25422543        qemu_get_buffer(f, (uint8_t *)s->identify_data, 512); 
  • trunk/src/host/qemu-neo1973/hw/mainstone.c

    r3627 r3665  
    1818#include "sysemu.h" 
    1919#include "flash.h" 
     20 
     21static struct keymap map[0xE0] = { 
     22    [0 ... 0xDF] = { -1, -1 }, 
     23    [0x1e] = {0,0}, /* a */ 
     24    [0x30] = {0,1}, /* b */ 
     25    [0x2e] = {0,2}, /* c */ 
     26    [0x20] = {0,3}, /* d */ 
     27    [0x12] = {0,4}, /* e */ 
     28    [0x21] = {0,5}, /* f */ 
     29    [0x22] = {1,0}, /* g */ 
     30    [0x23] = {1,1}, /* h */ 
     31    [0x17] = {1,2}, /* i */ 
     32    [0x24] = {1,3}, /* j */ 
     33    [0x25] = {1,4}, /* k */ 
     34    [0x26] = {1,5}, /* l */ 
     35    [0x32] = {2,0}, /* m */ 
     36    [0x31] = {2,1}, /* n */ 
     37    [0x18] = {2,2}, /* o */ 
     38    [0x19] = {2,3}, /* p */ 
     39    [0x10] = {2,4}, /* q */ 
     40    [0x13] = {2,5}, /* r */ 
     41    [0x1f] = {3,0}, /* s */ 
     42    [0x14] = {3,1}, /* t */ 
     43    [0x16] = {3,2}, /* u */ 
     44    [0x2f] = {3,3}, /* v */ 
     45    [0x11] = {3,4}, /* w */ 
     46    [0x2d] = {3,5}, /* x */ 
     47    [0x15] = {4,2}, /* y */ 
     48    [0x2c] = {4,3}, /* z */ 
     49    [0xc7] = {5,0}, /* Home */ 
     50    [0x2a] = {5,1}, /* shift */ 
     51    [0x39] = {5,2}, /* space */ 
     52    [0x39] = {5,3}, /* space */ 
     53    [0x1c] = {5,5}, /*  enter */ 
     54    [0xc8] = {6,0}, /* up */ 
     55    [0xd0] = {6,1}, /* down */ 
     56    [0xcb] = {6,2}, /* left */ 
     57    [0xcd] = {6,3}, /* right */ 
     58}; 
    2059 
    2160enum mainstone_model_e { mainstone }; 
     
    80119    mst_irq = mst_irq_init(cpu, MST_FPGA_PHYS, PXA2XX_PIC_GPIO_0); 
    81120 
     121    /* setup keypad */ 
     122    printf("map addr %p\n", &map); 
     123    pxa27x_register_keypad(cpu->kp, map, 0xe0); 
     124 
    82125    /* MMC/SD host */ 
    83126    pxa2xx_mmci_handlers(cpu->mmc, NULL, mst_irq[MMC_IRQ]); 
  • trunk/src/host/qemu-neo1973/hw/mc146818rtc.c

    r3443 r3665  
    422422    qemu_put_8s(f, &s->cmos_index); 
    423423 
    424     qemu_put_be32s(f, &s->current_tm.tm_sec); 
    425     qemu_put_be32s(f, &s->current_tm.tm_min); 
    426     qemu_put_be32s(f, &s->current_tm.tm_hour); 
    427     qemu_put_be32s(f, &s->current_tm.tm_wday); 
    428     qemu_put_be32s(f, &s->current_tm.tm_mday); 
    429     qemu_put_be32s(f, &s->current_tm.tm_mon); 
    430     qemu_put_be32s(f, &s->current_tm.tm_year); 
     424    qemu_put_be32(f, s->current_tm.tm_sec); 
     425    qemu_put_be32(f, s->current_tm.tm_min); 
     426    qemu_put_be32(f, s->current_tm.tm_hour); 
     427    qemu_put_be32(f, s->current_tm.tm_wday); 
     428    qemu_put_be32(f, s->current_tm.tm_mday); 
     429    qemu_put_be32(f, s->current_tm.tm_mon); 
     430    qemu_put_be32(f, s->current_tm.tm_year); 
    431431 
    432432    qemu_put_timer(f, s->periodic_timer); 
    433     qemu_put_be64s(f, &s->next_periodic_time); 
    434  
    435     qemu_put_be64s(f, &s->next_second_time); 
     433    qemu_put_be64(f, s->next_periodic_time); 
     434 
     435    qemu_put_be64(f, s->next_second_time); 
    436436    qemu_put_timer(f, s->second_timer); 
    437437    qemu_put_timer(f, s->second_timer2); 
     
    448448    qemu_get_8s(f, &s->cmos_index); 
    449449 
    450     qemu_get_be32s(f, &s->current_tm.tm_sec); 
    451     qemu_get_be32s(f, &s->current_tm.tm_min); 
    452     qemu_get_be32s(f, &s->current_tm.tm_hour); 
    453     qemu_get_be32s(f, &s->current_tm.tm_wday); 
    454     qemu_get_be32s(f, &s->current_tm.tm_mday); 
    455     qemu_get_be32s(f, &s->current_tm.tm_mon); 
    456     qemu_get_be32s(f, &s->current_tm.tm_year); 
     450    s->current_tm.tm_sec=qemu_get_be32(f); 
     451    s->current_tm.tm_min=qemu_get_be32(f); 
     452    s->current_tm.tm_hour=qemu_get_be32(f); 
     453    s->current_tm.tm_wday=qemu_get_be32(f); 
     454    s->current_tm.tm_mday=qemu_get_be32(f); 
     455    s->current_tm.tm_mon=qemu_get_be32(f); 
     456    s->current_tm.tm_year=qemu_get_be32(f); 
    457457 
    458458    qemu_get_timer(f, s->periodic_timer); 
    459     qemu_get_be64s(f, &s->next_periodic_time); 
    460  
    461     qemu_get_be64s(f, &s->next_second_time); 
     459    s->next_periodic_time=qemu_get_be64(f); 
     460 
     461    s->next_second_time=qemu_get_be64(f); 
    462462    qemu_get_timer(f, s->second_timer); 
    463463    qemu_get_timer(f, s->second_timer2); 
  • trunk/src/host/qemu-neo1973/hw/ne2000.c

    r3443 r3665  
    648648{ 
    649649        NE2000State* s=(NE2000State*)opaque; 
    650         int tmp; 
     650        uint32_t tmp; 
    651651 
    652652        if (s->pci_dev) 
     
    680680        NE2000State* s=(NE2000State*)opaque; 
    681681        int ret; 
    682         int tmp; 
     682        uint32_t tmp; 
    683683 
    684684        if (version_id > 3) 
  • trunk/src/host/qemu-neo1973/hw/pc.c

    r3555 r3665  
    553553 
    554554    /* kernel command line */ 
    555     pstrcpy(cmdline_addr, 4096, kernel_cmdline); 
     555    pstrcpy((char*)cmdline_addr, 4096, kernel_cmdline); 
    556556 
    557557    if (protocol >= 0x202) { 
  • trunk/src/host/qemu-neo1973/hw/pcnet.c

    r3443 r3665  
    18441844        pci_device_save(s->pci_dev, f); 
    18451845 
    1846     qemu_put_be32s(f, &s->rap); 
    1847     qemu_put_be32s(f, &s->isr); 
    1848     qemu_put_be32s(f, &s->lnkst); 
     1846    qemu_put_be32(f, s->rap); 
     1847    qemu_put_be32(f, s->isr); 
     1848    qemu_put_be32(f, s->lnkst); 
    18491849    qemu_put_be32s(f, &s->rdra); 
    18501850    qemu_put_be32s(f, &s->tdra); 
     
    18551855        qemu_put_be16s(f, &s->bcr[i]); 
    18561856    qemu_put_be64s(f, &s->timer); 
    1857     qemu_put_be32s(f, &s->xmit_pos); 
    1858     qemu_put_be32s(f, &s->recv_pos); 
     1857    qemu_put_be32(f, s->xmit_pos); 
     1858    qemu_put_be32(f, s->recv_pos); 
    18591859    qemu_put_buffer(f, s->buffer, 4096); 
    1860     qemu_put_be32s(f, &s->tx_busy); 
     1860    qemu_put_be32(f, s->tx_busy); 
    18611861    qemu_put_timer(f, s->poll_timer); 
    18621862} 
     
    18761876    } 
    18771877 
    1878     qemu_get_be32s(f, &s->rap); 
    1879     qemu_get_be32s(f, &s->isr); 
    1880     qemu_get_be32s(f, &s->lnkst); 
     1878    qemu_get_be32s(f, (uint32_t*)&s->rap); 
     1879    qemu_get_be32s(f, (uint32_t*)&s->isr); 
     1880    qemu_get_be32s(f, (uint32_t*)&s->lnkst); 
    18811881    qemu_get_be32s(f, &s->rdra); 
    18821882    qemu_get_be32s(f, &s->tdra); 
     
    18871887        qemu_get_be16s(f, &s->bcr[i]); 
    18881888    qemu_get_be64s(f, &s->timer); 
    1889     qemu_get_be32s(f, &s->xmit_pos); 
    1890     qemu_get_be32s(f, &s->recv_pos); 
     1889    qemu_get_be32s(f, (uint32_t*)&s->xmit_pos); 
     1890    qemu_get_be32s(f, (uint32_t*)&s->recv_pos); 
    18911891    qemu_get_buffer(f, s->buffer, 4096); 
    1892     qemu_get_be32s(f, &s->tx_busy); 
     1892    qemu_get_be32s(f, (uint32_t*)&s->tx_busy); 
    18931893    qemu_get_timer(f, s->poll_timer); 
    18941894 
  • trunk/src/host/qemu-neo1973/hw/ps2.c

    r3443 r3665  
    471471static void ps2_common_save (QEMUFile *f, PS2State *s) 
    472472{ 
    473     qemu_put_be32s (f, &s->write_cmd); 
    474     qemu_put_be32s (f, &s->queue.rptr); 
    475     qemu_put_be32s (f, &s->queue.wptr); 
    476     qemu_put_be32s (f, &s->queue.count); 
     473    qemu_put_be32 (f, s->write_cmd); 
     474    qemu_put_be32 (f, s->queue.rptr); 
     475    qemu_put_be32 (f, s->queue.wptr); 
     476    qemu_put_be32 (f, s->queue.count); 
    477477    qemu_put_buffer (f, s->queue.data, sizeof (s->queue.data)); 
    478478} 
     
    480480static void ps2_common_load (QEMUFile *f, PS2State *s) 
    481481{ 
    482     qemu_get_be32s (f, &s->write_cmd); 
    483     qemu_get_be32s (f, &s->queue.rptr); 
    484     qemu_get_be32s (f, &s->queue.wptr); 
    485     qemu_get_be32s (f, &s->queue.count); 
     482    s->write_cmd=qemu_get_be32 (f); 
     483    s->queue.rptr=qemu_get_be32 (f); 
     484    s->queue.wptr=qemu_get_be32 (f); 
     485    s->queue.count=qemu_get_be32 (f); 
    486486    qemu_get_buffer (f, s->queue.data, sizeof (s->queue.data)); 
    487487} 
     
    492492 
    493493    ps2_common_save (f, &s->common); 
    494     qemu_put_be32s(f, &s->scan_enabled); 
    495     qemu_put_be32s(f, &s->translate); 
     494    qemu_put_be32(f, s->scan_enabled); 
     495    qemu_put_be32(f, s->translate); 
    496496} 
    497497 
     
    507507    qemu_put_8s(f, &s->mouse_type); 
    508508    qemu_put_8s(f, &s->mouse_detect_state); 
    509     qemu_put_be32s(f, &s->mouse_dx); 
    510     qemu_put_be32s(f, &s->mouse_dy); 
    511     qemu_put_be32s(f, &s->mouse_dz); 
     509    qemu_put_be32(f, s->mouse_dx); 
     510    qemu_put_be32(f, s->mouse_dy); 
     511    qemu_put_be32(f, s->mouse_dz); 
    512512    qemu_put_8s(f, &s->mouse_buttons); 
    513513} 
     
    521521 
    522522    ps2_common_load (f, &s->common); 
    523     qemu_get_be32s(f, &s->scan_enabled); 
    524     qemu_get_be32s(f, &s->translate); 
     523    s->scan_enabled=qemu_get_be32(f); 
     524    s->translate=qemu_get_be32(f); 
    525525    return 0; 
    526526} 
     
    540540    qemu_get_8s(f, &s->mouse_type); 
    541541    qemu_get_8s(f, &s->mouse_detect_state); 
    542     qemu_get_be32s(f, &s->mouse_dx); 
    543     qemu_get_be32s(f, &s->mouse_dy); 
    544     qemu_get_be32s(f, &s->mouse_dz); 
     542    s->mouse_dx=qemu_get_be32(f); 
     543    s->mouse_dy=qemu_get_be32(f); 
     544    s->mouse_dz=qemu_get_be32(f); 
    545545    qemu_get_8s(f, &s->mouse_buttons); 
    546546    return 0; 
  • trunk/src/host/qemu-neo1973/hw/pxa.h

    r3443 r3665  
    1414# define PXA2XX_PIC_USBH2       2 
    1515# define PXA2XX_PIC_USBH1       3 
     16# define PXA2XX_PIC_KEYPAD      4 
    1617# define PXA2XX_PIC_PWRI2C      6 
    1718# define PXA25X_PIC_HWUART      7 
     
    107108void pxa2xx_pcmcia_set_irq_cb(void *opaque, qemu_irq irq, qemu_irq cd_irq); 
    108109 
     110/* pxa2xx_keypad.c */ 
     111struct  keymap { 
     112    int column; 
     113    int row; 
     114}; 
     115struct pxa2xx_keypad_s; 
     116struct pxa2xx_keypad_s *pxa27x_keypad_init(target_phys_addr_t base, 
     117                qemu_irq irq); 
     118void pxa27x_register_keypad(struct pxa2xx_keypad_s *kp, struct keymap *map, 
     119                int size); 
     120 
    109121/* pxa2xx.c */ 
    110122struct pxa2xx_ssp_s; 
     
    134146    struct pxa2xx_i2s_s *i2s; 
    135147    struct pxa2xx_fir_s *fir; 
     148    struct pxa2xx_keypad_s *kp; 
    136149 
    137150    /* Power management */ 
  • trunk/src/host/qemu-neo1973/hw/pxa2xx.c

    r3555 r3665  
    21552155    s->i2s = pxa2xx_i2s_init(0x40400000, s->pic[PXA2XX_PIC_I2S], s->dma); 
    21562156 
     2157    s->kp = pxa27x_keypad_init(0x41500000, s->pic[PXA2XX_PIC_KEYPAD]); 
     2158 
    21572159    /* GPIO1 resets the processor */ 
    21582160    /* The handler can be overridden by board-specific code */ 
  • trunk/src/host/qemu-neo1973/hw/rtl8139.c

    r3443 r3665  
    31203120{ 
    31213121    RTL8139State* s=(RTL8139State*)opaque; 
    3122     int i; 
     3122    unsigned int i; 
    31233123 
    31243124    pci_device_save(s->pci_dev, f); 
     
    31733173    qemu_put_be32s(f, &i); /* unused.  */ 
    31743174    qemu_put_buffer(f, s->macaddr, 6); 
    3175     qemu_put_be32s(f, &s->rtl8139_mmio_io_addr); 
     3175    qemu_put_be32(f, s->rtl8139_mmio_io_addr); 
    31763176 
    31773177    qemu_put_be32s(f, &s->currTxDesc); 
     
    31853185        qemu_put_be16s(f, &s->eeprom.contents[i]); 
    31863186    } 
    3187     qemu_put_be32s(f, &s->eeprom.mode); 
     3187    qemu_put_be32(f, s->eeprom.mode); 
    31883188    qemu_put_be32s(f, &s->eeprom.tick); 
    31893189    qemu_put_8s(f, &s->eeprom.address); 
     
    31983198    qemu_put_be32s(f, &s->TCTR); 
    31993199    qemu_put_be32s(f, &s->TimerInt); 
    3200     qemu_put_be64s(f, &s->TCTR_base); 
     3200    qemu_put_be64(f, s->TCTR_base); 
    32013201 
    32023202    RTL8139TallyCounters_save(f, &s->tally_counters); 
     
    32063206{ 
    32073207    RTL8139State* s=(RTL8139State*)opaque; 
    3208     int i, ret; 
     3208    unsigned int i; 
     3209    int ret; 
    32093210 
    32103211    /* just 2 versions for now */ 
     
    32673268    qemu_get_be32s(f, &i); /* unused.  */ 
    32683269    qemu_get_buffer(f, s->macaddr, 6); 
    3269     qemu_get_be32s(f, &s->rtl8139_mmio_io_addr); 
     3270    s->rtl8139_mmio_io_addr=qemu_get_be32(f); 
    32703271 
    32713272    qemu_get_be32s(f, &s->currTxDesc); 
     
    32793280        qemu_get_be16s(f, &s->eeprom.contents[i]); 
    32803281    } 
    3281     qemu_get_be32s(f, &s->eeprom.mode); 
     3282    s->eeprom.mode=qemu_get_be32(f); 
    32823283    qemu_get_be32s(f, &s->eeprom.tick); 
    32833284    qemu_get_8s(f, &s->eeprom.address); 
     
    32953296        qemu_get_be32s(f, &s->TCTR); 
    32963297        qemu_get_be32s(f, &s->TimerInt); 
    3297         qemu_get_be64s(f, &s->TCTR_base); 
     3298        s->TCTR_base=qemu_get_be64(f); 
    32983299 
    32993300        RTL8139TallyCounters_load(f, &s->tally_counters); 
  • trunk/src/host/qemu-neo1973/hw/sb16.c

    r3443 r3665  
    12581258    SB16State *s = opaque; 
    12591259 
    1260     qemu_put_be32s (f, &s->irq); 
    1261     qemu_put_be32s (f, &s->dma); 
    1262     qemu_put_be32s (f, &s->hdma); 
    1263     qemu_put_be32s (f, &s->port); 
    1264     qemu_put_be32s (f, &s->ver); 
    1265     qemu_put_be32s (f, &s->in_index); 
    1266     qemu_put_be32s (f, &s->out_data_len); 
    1267     qemu_put_be32s (f, &s->fmt_stereo); 
    1268     qemu_put_be32s (f, &s->fmt_signed); 
    1269     qemu_put_be32s (f, &s->fmt_bits); 
     1260    qemu_put_be32 (f, s->irq); 
     1261    qemu_put_be32 (f, s->dma); 
     1262    qemu_put_be32 (f, s->hdma); 
     1263    qemu_put_be32 (f, s->port); 
     1264    qemu_put_be32 (f, s->ver); 
     1265    qemu_put_be32 (f, s->in_index); 
     1266    qemu_put_be32 (f, s->out_data_len); 
     1267    qemu_put_be32 (f, s->fmt_stereo); 
     1268    qemu_put_be32 (f, s->fmt_signed); 
     1269    qemu_put_be32 (f, s->fmt_bits); 
    12701270    qemu_put_be32s (f, &s->fmt); 
    1271     qemu_put_be32s (f, &s->dma_auto); 
    1272     qemu_put_be32s (f, &s->block_size); 
    1273     qemu_put_be32s (f, &s->fifo); 
    1274     qemu_put_be32s (f, &s->freq); 
    1275     qemu_put_be32s (f, &s->time_const); 
    1276     qemu_put_be32s (f, &s->speaker); 
    1277     qemu_put_be32s (f, &s->needed_bytes); 
    1278     qemu_put_be32s (f, &s->cmd); 
    1279     qemu_put_be32s (f, &s->use_hdma); 
    1280     qemu_put_be32s (f, &s->highspeed); 
    1281     qemu_put_be32s (f, &s->can_write); 
    1282     qemu_put_be32s (f, &s->v2x6); 
     1271    qemu_put_be32 (f, s->dma_auto); 
     1272    qemu_put_be32 (f, s->block_size); 
     1273    qemu_put_be32 (f, s->fifo); 
     1274    qemu_put_be32 (f, s->freq); 
     1275    qemu_put_be32 (f, s->time_const); 
     1276    qemu_put_be32 (f, s->speaker); 
     1277    qemu_put_be32 (f, s->needed_bytes); 
     1278    qemu_put_be32 (f, s->cmd); 
     1279    qemu_put_be32 (f, s->use_hdma); 
     1280    qemu_put_be32 (f, s->highspeed); 
     1281    qemu_put_be32 (f, s->can_write); 
     1282    qemu_put_be32 (f, s->v2x6); 
    12831283 
    12841284    qemu_put_8s (f, &s->csp_param); 
     
    12891289    qemu_put_8s (f, &s->csp_index); 
    12901290    qemu_put_buffer (f, s->csp_reg83, 4); 
    1291     qemu_put_be32s (f, &s->csp_reg83r); 
    1292     qemu_put_be32s (f, &s->csp_reg83w); 
     1291    qemu_put_be32 (f, s->csp_reg83r); 
     1292    qemu_put_be32 (f, s->csp_reg83w); 
    12931293 
    12941294    qemu_put_buffer (f, s->in2_data, sizeof (s->in2_data)); 
     
    12971297    qemu_put_8s (f, &s->last_read_byte); 
    12981298 
    1299     qemu_put_be32s (f, &s->nzero); 
    1300     qemu_put_be32s (f, &s->left_till_irq); 
    1301     qemu_put_be32s (f, &s->dma_running); 
    1302     qemu_put_be32s (f, &s->bytes_per_second); 
    1303     qemu_put_be32s (f, &s->align); 
    1304  
    1305     qemu_put_be32s (f, &s->mixer_nreg); 
     1299    qemu_put_be32 (f, s->nzero); 
     1300    qemu_put_be32 (f, s->left_till_irq); 
     1301    qemu_put_be32 (f, s->dma_running); 
     1302    qemu_put_be32 (f, s->bytes_per_second); 
     1303    qemu_put_be32 (f, s->align); 
     1304 
     1305    qemu_put_be32 (f, s->mixer_nreg); 
    13061306    qemu_put_buffer (f, s->mixer_regs, 256); 
    13071307} 
     
    13151315    } 
    13161316 
    1317     qemu_get_be32s (f, &s->irq); 
    1318     qemu_get_be32s (f, &s->dma); 
    1319     qemu_get_be32s (f, &s->hdma); 
    1320     qemu_get_be32s (f, &s->port); 
    1321     qemu_get_be32s (f, &s->ver); 
    1322     qemu_get_be32s (f, &s->in_index); 
    1323     qemu_get_be32s (f, &s->out_data_len); 
    1324     qemu_get_be32s (f, &s->fmt_stereo); 
    1325     qemu_get_be32s (f, &s->fmt_signed); 
    1326     qemu_get_be32s (f, &s->fmt_bits); 
     1317    s->irq=qemu_get_be32 (f); 
     1318    s->dma=qemu_get_be32 (f); 
     1319    s->hdma=qemu_get_be32 (f); 
     1320    s->port=qemu_get_be32 (f); 
     1321    s->ver=qemu_get_be32 (f); 
     1322    s->in_index=qemu_get_be32 (f); 
     1323    s->out_data_len=qemu_get_be32 (f); 
     1324    s->fmt_stereo=qemu_get_be32 (f); 
     1325    s->fmt_signed=qemu_get_be32 (f); 
     1326    s->fmt_bits=qemu_get_be32 (f); 
    13271327    qemu_get_be32s (f, &s->fmt); 
    1328     qemu_get_be32s (f, &s->dma_auto); 
    1329     qemu_get_be32s (f, &s->block_size); 
    1330     qemu_get_be32s (f, &s->fifo); 
    1331     qemu_get_be32s (f, &s->freq); 
    1332     qemu_get_be32s (f, &s->time_const); 
    1333     qemu_get_be32s (f, &s->speaker); 
    1334     qemu_get_be32s (f, &s->needed_bytes); 
    1335     qemu_get_be32s (f, &s->cmd); 
    1336     qemu_get_be32s (f, &s->use_hdma); 
    1337     qemu_get_be32s (f, &s->highspeed); 
    1338     qemu_get_be32s (f, &s->can_write); 
    1339     qemu_get_be32s (f, &s->v2x6); 
     1328    s->dma_auto=qemu_get_be32 (f); 
     1329    s->block_size=qemu_get_be32 (f); 
     1330    s->fifo=qemu_get_be32 (f); 
     1331    s->freq=qemu_get_be32 (f); 
     1332    s->time_const=qemu_get_be32 (f); 
     1333    s->speaker=qemu_get_be32 (f); 
     1334    s->needed_bytes=qemu_get_be32 (f); 
     1335    s->cmd=qemu_get_be32 (f); 
     1336    s->use_hdma=qemu_get_be32 (f); 
     1337    s->highspeed=qemu_get_be32 (f); 
     1338    s->can_write=qemu_get_be32 (f); 
     1339    s->v2x6=qemu_get_be32 (f); 
    13401340 
    13411341    qemu_get_8s (f, &s->csp_param); 
     
    13461346    qemu_get_8s (f, &s->csp_index); 
    13471347    qemu_get_buffer (f, s->csp_reg83, 4); 
    1348     qemu_get_be32s (f, &s->csp_reg83r); 
    1349     qemu_get_be32s (f, &s->csp_reg83w); 
     1348    s->csp_reg83r=qemu_get_be32 (f); 
     1349    s->csp_reg83w=qemu_get_be32 (f); 
    13501350 
    13511351    qemu_get_buffer (f, s->in2_data, sizeof (s->in2_data)); 
     
    13541354    qemu_get_8s (f, &s->last_read_byte); 
    13551355 
    1356     qemu_get_be32s (f, &s->nzero); 
    1357     qemu_get_be32s (f, &s->left_till_irq); 
    1358     qemu_get_be32s (f, &s->dma_running); 
    1359     qemu_get_be32s (f, &s->bytes_per_second); 
    1360     qemu_get_be32s (f, &s->align); 
    1361  
    1362     qemu_get_be32s (f, &s->mixer_nreg); 
     1356    s->nzero=qemu_get_be32 (f); 
     1357    s->left_till_irq=qemu_get_be32 (f); 
     1358    s->dma_running=qemu_get_be32 (f); 
     1359    s->bytes_per_second=qemu_get_be32 (f); 
     1360    s->align=qemu_get_be32 (f); 
     1361 
     1362    s->mixer_nreg=qemu_get_be32 (f); 
    13631363    qemu_get_buffer (f, s->mixer_regs, 256); 
    13641364 
  • trunk/src/host/qemu-neo1973/hw/sh.h

    r3443 r3665  
    22#define QEMU_SH_H 
    33/* Definitions for SH board emulation.  */ 
     4 
     5#include "sh_intc.h" 
    46 
    57/* sh7750.c */ 
     
    2628#define TMU012_FEAT_3CHAN  (1 << 1) 
    2729#define TMU012_FEAT_EXTCLK (1 << 2) 
    28 void tmu012_init(uint32_t base, int feat, uint32_t freq); 
     30void tmu012_init(target_phys_addr_t base, int feat, uint32_t freq, 
     31                 struct intc_source *ch0_irq, struct intc_source *ch1_irq, 
     32                 struct intc_source *ch2_irq0, struct intc_source *ch2_irq1); 
     33 
    2934 
    3035/* sh_serial.c */ 
  • trunk/src/host/qemu-neo1973/hw/sh7750.c

    r3555 r3665  
    560560    tmu012_init(0x1fd80000, 
    561561                TMU012_FEAT_TOCR | TMU012_FEAT_3CHAN | TMU012_FEAT_EXTCLK, 
    562                 s->periph_freq); 
    563  
     562                s->periph_freq, 
     563                sh_intc_source(&s->intc, TMU0), 
     564                sh_intc_source(&s->intc, TMU1), 
     565                sh_intc_source(&s->intc, TMU2_TUNI), 
     566                sh_intc_source(&s->intc, TMU2_TICPI)); 
    564567 
    565568    if (cpu_model & (SH_CPU_SH7750 | SH_CPU_SH7750S | SH_CPU_SH7751)) { 
     
    579582                                 _INTC_ARRAY(vectors_tmu34), 
    580583                                 NULL, 0); 
    581         tmu012_init(0x1e100000, 0, s->periph_freq); 
     584        tmu012_init(0x1e100000, 0, s->periph_freq, 
     585                    sh_intc_source(&s->intc, TMU3), 
     586                    sh_intc_source(&s->intc, TMU4), 
     587                    NULL, NULL); 
    582588    } 
    583589 
  • trunk/src/host/qemu-neo1973/hw/sh_serial.c

    r3443 r3665  
    294294    s->smr = 0; 
    295295    s->brr = 0xff; 
    296     s->scr = 0; 
     296    s->scr = 1 << 5; /* pretend that TX is enabled so early printk works */ 
    297297    s->sptr = 0; 
    298298 
  • trunk/src/host/qemu-neo1973/hw/sh_timer.c

    r3443 r3665  
    3434    int freq; 
    3535    int int_level; 
     36    int old_level; 
    3637    int feat; 
    3738    int enabled; 
    38     qemu_irq irq; 
     39    struct intc_source *irq; 
    3940} sh_timer_state; 
    4041 
     
    4344static void sh_timer_update(sh_timer_state *s) 
    4445{ 
    45 #if 0 /* not yet */ 
    46     /* Update interrupts.  */ 
    47     if (s->int_level && (s->tcr & TIMER_TCR_UNIE)) { 
    48         qemu_irq_raise(s->irq); 
    49     } else { 
    50         qemu_irq_lower(s->irq); 
    51     } 
    52 #endif 
     46    int new_level = s->int_level && (s->tcr & TIMER_TCR_UNIE); 
     47 
     48    if (new_level != s->old_level) 
     49      sh_intc_toggle_source(s->irq, 0, new_level ? 1 : -1); 
     50 
     51    s->old_level = s->int_level; 
     52    s->int_level = new_level; 
    5353} 
    5454 
     
    186186} 
    187187 
    188 static void *sh_timer_init(uint32_t freq, int feat) 
     188static void *sh_timer_init(uint32_t freq, int feat, struct intc_source *irq) 
    189189{ 
    190190    sh_timer_state *s; 
     
    199199    s->tcor = 0; 
    200200    s->enabled = 0; 
     201    s->irq = irq; 
    201202 
    202203    bh = qemu_bh_new(sh_timer_tick, s); 
     
    306307}; 
    307308 
    308 void tmu012_init(uint32_t base, int feat, uint32_t freq) 
     309void tmu012_init(target_phys_addr_t base, int feat, uint32_t freq, 
     310                 struct intc_source *ch0_irq, struct intc_source *ch1_irq, 
     311                 struct intc_source *ch2_irq0, struct intc_source *ch2_irq1) 
    309312{ 
    310313    int iomemtype; 
     
    315318    s->base = base; 
    316319    s->feat = feat; 
    317     s->timer[0] = sh_timer_init(freq, timer_feat); 
    318     s->timer[1] = sh_timer_init(freq, timer_feat); 
     320    s->timer[0] = sh_timer_init(freq, timer_feat, ch0_irq); 
     321    s->timer[1] = sh_timer_init(freq, timer_feat, ch1_irq); 
    319322    if (feat & TMU012_FEAT_3CHAN) 
    320         s->timer[2] = sh_timer_init(freq, timer_feat | TIMER_FEAT_CAPT); 
     323        s->timer[2] = sh_timer_init(freq, timer_feat | TIMER_FEAT_CAPT, 
     324                                    ch2_irq0); /* ch2_irq1 not supported */ 
    321325    iomemtype = cpu_register_io_memory(0, tmu012_readfn, 
    322326                                       tmu012_writefn, s); 
  • trunk/src/host/qemu-neo1973/hw/slavio_serial.c

    r3613 r3665  
    9090} SERIOQueue; 
    9191 
     92#define SERIAL_REGS 16 
    9293typedef struct ChannelState { 
    9394    qemu_irq irq; 
     
    9798    chn_type_t type; 
    9899    struct ChannelState *otherchn; 
    99     uint8_t rx, tx, wregs[16], rregs[16]; 
     100    uint8_t rx, tx, wregs[SERIAL_REGS], rregs[SERIAL_REGS]; 
    100101    SERIOQueue queue; 
    101102    CharDriverState *chr; 
     
    110111#define SERIAL_MAXADDR 7 
    111112#define SERIAL_SIZE (SERIAL_MAXADDR + 1) 
     113#define SERIAL_CTRL 0 
     114#define SERIAL_DATA 1 
     115 
     116#define W_CMD     0 
     117#define CMD_PTR_MASK   0x07 
     118#define CMD_CMD_MASK   0x38 
     119#define CMD_HI         0x08 
     120#define CMD_CLR_TXINT  0x28 
     121#define CMD_CLR_IUS    0x38 
     122#define W_INTR    1 
     123#define INTR_INTALL    0x01 
     124#define INTR_TXINT     0x02 
     125#define INTR_RXMODEMSK 0x18 
     126#define INTR_RXINT1ST  0x08 
     127#define INTR_RXINTALL  0x10 
     128#define W_IVEC    2 
     129#define W_RXCTRL  3 
     130#define RXCTRL_RXEN    0x01 
     131#define W_TXCTRL1 4 
     132#define TXCTRL1_PAREN  0x01 
     133#define TXCTRL1_PAREV  0x02 
     134#define TXCTRL1_1STOP  0x04 
     135#define TXCTRL1_1HSTOP 0x08 
     136#define TXCTRL1_2STOP  0x0c 
     137#define TXCTRL1_STPMSK 0x0c 
     138#define TXCTRL1_CLK1X  0x00 
     139#define TXCTRL1_CLK16X 0x40 
     140#define TXCTRL1_CLK32X 0x80 
     141#define TXCTRL1_CLK64X 0xc0 
     142#define TXCTRL1_CLKMSK 0xc0 
     143#define W_TXCTRL2 5 
     144#define TXCTRL2_TXEN   0x08 
     145#define TXCTRL2_BITMSK 0x60 
     146#define TXCTRL2_5BITS  0x00 
     147#define TXCTRL2_7BITS  0x20 
     148#define TXCTRL2_6BITS  0x40 
     149#define TXCTRL2_8BITS  0x60 
     150#define W_SYNC1   6 
     151#define W_SYNC2   7 
     152#define W_TXBUF   8 
     153#define W_MINTR   9 
     154#define MINTR_STATUSHI 0x10 
     155#define MINTR_RST_MASK 0xc0 
     156#define MINTR_RST_B    0x40 
     157#define MINTR_RST_A    0x80 
     158#define MINTR_RST_ALL  0xc0 
     159#define W_MISC1  10 
     160#define W_CLOCK  11 
     161#define CLOCK_TRXC     0x08 
     162#define W_BRGLO  12 
     163#define W_BRGHI  13 
     164#define W_MISC2  14 
     165#define MISC2_PLLDIS   0x30 
     166#define W_EXTINT 15 
     167#define EXTINT_DCD     0x08 
     168#define EXTINT_SYNCINT 0x10 
     169#define EXTINT_CTSINT  0x20 
     170#define EXTINT_TXUNDRN 0x40 
     171#define EXTINT_BRKINT  0x80 
     172 
     173#define R_STATUS  0 
     174#define STATUS_RXAV    0x01 
     175#define STATUS_ZERO    0x02 
     176#define STATUS_TXEMPTY 0x04 
     177#define STATUS_DCD     0x08 
     178#define STATUS_SYNC    0x10 
     179#define STATUS_CTS     0x20 
     180#define STATUS_TXUNDRN 0x40 
     181#define STATUS_BRK     0x80 
     182#define R_SPEC    1 
     183#define SPEC_ALLSENT   0x01 
     184#define SPEC_BITS8     0x06 
     185#define R_IVEC    2 
     186#define IVEC_TXINTB    0x00 
     187#define IVEC_LONOINT   0x06 
     188#define IVEC_LORXINTA  0x0c 
     189#define IVEC_LORXINTB  0x04 
     190#define IVEC_LOTXINTA  0x08 
     191#define IVEC_HINOINT   0x60 
     192#define IVEC_HIRXINTA  0x30 
     193#define IVEC_HIRXINTB  0x20 
     194#define IVEC_HITXINTA  0x10 
     195#define R_INTR    3 
     196#define INTR_EXTINTB   0x01 
     197#define INTR_TXINTB    0x02 
     198#define INTR_RXINTB    0x04 
     199#define INTR_EXTINTA   0x08 
     200#define INTR_TXINTA    0x10 
     201#define INTR_RXINTA    0x20 
     202#define R_IPEN    4 
     203#define R_TXCTRL1 5 
     204#define R_TXCTRL2 6 
     205#define R_BC      7 
     206#define R_RXBUF   8 
     207#define R_RXCTRL  9 
     208#define R_MISC   10 
     209#define R_MISC1  11 
     210#define R_BRGLO  12 
     211#define R_BRGHI  13 
     212#define R_MISC1I 14 
     213#define R_EXTINT 15 
    112214 
    113215static void handle_kbd_command(ChannelState *s, int val); 
     
    160262static int slavio_serial_update_irq_chn(ChannelState *s) 
    161263{ 
    162     if ((s->wregs[1] & 1) && // interrupts enabled 
    163         (((s->wregs[1] & 2) && s->txint == 1) || // tx ints enabled, pending 
    164          ((((s->wregs[1] & 0x18) == 8) || ((s->wregs[1] & 0x18) == 0x10)) && 
     264    if ((s->wregs[W_INTR] & INTR_INTALL) && // interrupts enabled 
     265        (((s->wregs[W_INTR] & INTR_TXINT) && s->txint == 1) || 
     266         // tx ints enabled, pending 
     267         ((((s->wregs[W_INTR] & INTR_RXMODEMSK) == INTR_RXINT1ST) || 
     268           ((s->wregs[W_INTR] & INTR_RXMODEMSK) == INTR_RXINTALL)) && 
    165269          s->rxint == 1) || // rx ints enabled, pending 
    166          ((s->wregs[15] & 0x80) && (s->rregs[0] & 0x80)))) { // break int e&p 
     270         ((s->wregs[W_EXTINT] & EXTINT_BRKINT) && 
     271          (s->rregs[R_STATUS] & STATUS_BRK)))) { // break int e&p 
    167272        return 1; 
    168273    } 
     
    190295        s->wregs[i] = 0; 
    191296    } 
    192     s->wregs[4] = 4; 
    193     s->wregs[9] = 0xc0; 
    194     s->wregs[11] = 8; 
    195     s->wregs[14] = 0x30; 
    196     s->wregs[15] = 0xf8; 
     297    s->wregs[W_TXCTRL1] = TXCTRL1_1STOP; // 1X divisor, 1 stop bit, no parity 
     298    s->wregs[W_MINTR] = MINTR_RST_ALL; 
     299    s->wregs[W_CLOCK] = CLOCK_TRXC; // Synch mode tx clock = TRxC 
     300    s->wregs[W_MISC2] = MISC2_PLLDIS; // PLL disabled 
     301    s->wregs[W_EXTINT] = EXTINT_DCD | EXTINT_SYNCINT | EXTINT_CTSINT | 
     302        EXTINT_TXUNDRN | EXTINT_BRKINT; // Enable most interrupts 
    197303    if (s->disabled) 
    198         s->rregs[0] = 0x7c; 
     304        s->rregs[R_STATUS] = STATUS_TXEMPTY | STATUS_DCD | STATUS_SYNC | 
     305            STATUS_CTS | STATUS_TXUNDRN; 
    199306    else 
    200         s->rregs[0] = 0x44; 
    201     s->rregs[1] = 6; 
     307        s->rregs[R_STATUS] = STATUS_TXEMPTY | STATUS_TXUNDRN; 
     308    s->rregs[R_SPEC] = SPEC_BITS8; 
    202309 
    203310    s->rx = s->tx = 0; 
     
    220327    s->rxint_under_svc = 0; 
    221328    if (s->chn == chn_a) { 
    222         if (s->wregs[9] & 0x10) 
    223             s->otherchn->rregs[2] = 0x60; 
     329        if (s->wregs[W_MINTR] & MINTR_STATUSHI) 
     330            s->otherchn->rregs[R_IVEC] = IVEC_HINOINT; 
    224331        else 
    225             s->otherchn->rregs[2] = 0x06; 
    226         s->rregs[3] &= ~0x20; 
     332            s->otherchn->rregs[R_IVEC] = IVEC_LONOINT; 
     333        s->rregs[R_INTR] &= ~INTR_RXINTA; 
    227334    } else { 
    228         if (s->wregs[9] & 0x10) 
    229             s->rregs[2] = 0x60; 
     335        if (s->wregs[W_MINTR] & MINTR_STATUSHI) 
     336            s->rregs[R_IVEC] = IVEC_HINOINT; 
    230337        else 
    231             s->rregs[2] = 0x06; 
    232         s->otherchn->rregs[3] &= ~4; 
     338            s->rregs[R_IVEC] = IVEC_LONOINT; 
     339        s->otherchn->rregs[R_INTR] &= ~INTR_RXINTB; 
    233340    } 
    234341    if (s->txint) 
     
    243350        s->rxint_under_svc = 1; 
    244351        if (s->chn == chn_a) { 
    245             if (s->wregs[9] & 0x10) 
    246                 s->otherchn->rregs[2] = 0x30; 
     352            if (s->wregs[W_MINTR] & MINTR_STATUSHI) 
     353                s->otherchn->rregs[R_IVEC] = IVEC_HIRXINTA; 
    247354            else 
    248                 s->otherchn->rregs[2] = 0x0c; 
     355                s->otherchn->rregs[R_IVEC] = IVEC_LORXINTA; 
    249356        } else { 
    250             if (s->wregs[9] & 0x10) 
    251                 s->rregs[2] = 0x20; 
     357            if (s->wregs[W_MINTR] & MINTR_STATUSHI) 
     358                s->rregs[R_IVEC] = IVEC_HIRXINTB; 
    252359            else 
    253                 s->rregs[2] = 0x04; 
     360                s->rregs[R_IVEC] = IVEC_LORXINTB; 
    254361        } 
    255362    } 
    256363    if (s->chn == chn_a) 
    257         s->rregs[3] |= 0x20; 
     364        s->rregs[R_INTR] |= INTR_RXINTA; 
    258365    else 
    259         s->otherchn->rregs[3] |= 4; 
     366        s->otherchn->rregs[R_INTR] |= INTR_RXINTB; 
    260367    slavio_serial_update_irq(s); 
    261368} 
     
    266373    s->txint_under_svc = 0; 
    267374    if (s->chn == chn_a) { 
    268         if (s->wregs[9] & 0x10) 
    269             s->otherchn->rregs[2] = 0x60; 
     375        if (s->wregs[W_MINTR] & MINTR_STATUSHI) 
     376            s->otherchn->rregs[R_IVEC] = IVEC_HINOINT; 
    270377        else 
    271             s->otherchn->rregs[2] = 0x06; 
    272         s->rregs[3] &= ~0x10; 
     378            s->otherchn->rregs[R_IVEC] = IVEC_LONOINT; 
     379        s->rregs[R_INTR] &= ~INTR_TXINTA; 
    273380    } else { 
    274         if (s->wregs[9] & 0x10) 
    275             s->rregs[2] = 0x60; 
     381        if (s->wregs[W_MINTR] & MINTR_STATUSHI) 
     382            s->rregs[R_IVEC] = IVEC_HINOINT; 
    276383        else 
    277             s->rregs[2] = 0x06; 
    278         s->otherchn->rregs[3] &= ~2; 
     384            s->rregs[R_IVEC] = IVEC_LONOINT; 
     385        s->otherchn->rregs[R_INTR] &= ~INTR_TXINTB; 
    279386    } 
    280387    if (s->rxint) 
     
    289396        s->txint_under_svc = 1; 
    290397        if (s->chn == chn_a) { 
    291             if (s->wregs[9] & 0x10) 
    292                 s->otherchn->rregs[2] = 0x10; 
     398            if (s->wregs[W_MINTR] & MINTR_STATUSHI) 
     399                s->otherchn->rregs[R_IVEC] = IVEC_HITXINTA; 
    293400            else 
    294                 s->otherchn->rregs[2] = 0x08; 
     401                s->otherchn->rregs[R_IVEC] = IVEC_LOTXINTA; 
    295402        } else { 
    296             s->rregs[2] = 0; 
     403            s->rregs[R_IVEC] = IVEC_TXINTB; 
    297404        } 
    298405    } 
    299406    if (s->chn == chn_a) 
    300         s->rregs[3] |= 0x10; 
     407        s->rregs[R_INTR] |= INTR_TXINTA; 
    301408    else 
    302         s->otherchn->rregs[3] |= 2; 
     409        s->otherchn->rregs[R_INTR] |= INTR_TXINTB; 
    303410    slavio_serial_update_irq(s); 
    304411} 
     
    312419        return; 
    313420 
    314     if (s->wregs[4] & 1) { 
    315         if (s->wregs[4] & 2) 
     421    if (s->wregs[W_TXCTRL1] & TXCTRL1_PAREN) { 
     422        if (s->wregs[W_TXCTRL1] & TXCTRL1_PAREV) 
    316423            parity = 'E'; 
    317424        else 
     
    320427        parity = 'N'; 
    321428    } 
    322     if ((s->wregs[4] & 0x0c) == 0x0c) 
     429    if ((s->wregs[W_TXCTRL1] & TXCTRL1_STPMSK) == TXCTRL1_2STOP) 
    323430        stop_bits = 2; 
    324431    else 
    325432        stop_bits = 1; 
    326     switch (s->wregs[5] & 0x60) { 
    327     case 0x00: 
     433    switch (s->wregs[W_TXCTRL2] & TXCTRL2_BITMSK) { 
     434    case TXCTRL2_5BITS: 
    328435        data_bits = 5; 
    329436        break; 
    330     case 0x20: 
     437    case TXCTRL2_7BITS: 
    331438        data_bits = 7; 
    332439        break; 
    333     case 0x40: 
     440    case TXCTRL2_6BITS: 
    334441        data_bits = 6; 
    335442        break; 
    336443    default: 
    337     case 0x60: 
     444    case TXCTRL2_8BITS: 
    338445        data_bits = 8; 
    339446        break; 
    340447    } 
    341     speed = 2457600 / ((s->wregs[12] | (s->wregs[13] << 8)) + 2); 
    342     switch (s->wregs[4] & 0xc0) { 
    343     case 0x00: 
    344         break; 
    345     case 0x40: 
     448    speed = 2457600 / ((s->wregs[W_BRGLO] | (s->wregs[W_BRGHI] << 8)) + 2); 
     449    switch (s->wregs[W_TXCTRL1] & TXCTRL1_CLKMSK) { 
     450    case TXCTRL1_CLK1X: 
     451        break; 
     452    case TXCTRL1_CLK16X: 
    346453        speed /= 16; 
    347454        break; 
    348     case 0x80: 
     455    case TXCTRL1_CLK32X: 
    349456        speed /= 32; 
    350457        break; 
    351458    default: 
    352     case 0xc0: 
     459    case TXCTRL1_CLK64X: 
    353460        speed /= 64; 
    354461        break; 
     
    363470} 
    364471 
    365 static void slavio_serial_mem_writeb(void *opaque, target_phys_addr_t addr, uint32_t val) 
     472static void slavio_serial_mem_writeb(void *opaque, target_phys_addr_t addr, 
     473                                     uint32_t val) 
    366474{ 
    367475    SerialState *serial = opaque; 
     
    375483    s = &serial->chn[channel]; 
    376484    switch (saddr) { 
    377     case 0: 
    378         SER_DPRINTF("Write channel %c, reg[%d] = %2.2x\n", CHN_C(s), s->reg, val & 0xff); 
     485    case SERIAL_CTRL: 
     486        SER_DPRINTF("Write channel %c, reg[%d] = %2.2x\n", CHN_C(s), s->reg, 
     487                    val & 0xff); 
    379488        newreg = 0; 
    380489        switch (s->reg) { 
    381         case 0: 
    382             newreg = val & 7; 
    383             val &= 0x38; 
     490        case W_CMD: 
     491            newreg = val & CMD_PTR_MASK; 
     492            val &= CMD_CMD_MASK; 
    384493            switch (val) { 
    385             case 8: 
    386                 newreg |= 0x8; 
     494            case CMD_HI: 
     495                newreg |= CMD_HI; 
    387496                break; 
    388             case 0x28: 
     497            case CMD_CLR_TXINT: 
    389498                clr_txint(s); 
    390499                break; 
    391             case 0x38: 
     500            case CMD_CLR_IUS: 
    392501                if (s->rxint_under_svc) 
    393502                    clr_rxint(s); 
     
    399508            } 
    400509            break; 
    401         case 1 ... 3: 
    402         case 6 ... 8: 
    403         case 10 ... 11: 
    404         case 14 ... 15: 
     510        case W_INTR ... W_RXCTRL: 
     511        case W_SYNC1 ... W_TXBUF: 
     512        case W_MISC1 ... W_CLOCK: 
     513        case W_MISC2 ... W_EXTINT: 
    405514            s->wregs[s->reg] = val; 
    406515            break; 
    407         case 4: 
    408         case 5: 
    409         case 12: 
    410         case 13: 
     516        case W_TXCTRL1: 
     517        case W_TXCTRL2: 
     518        case W_BRGLO: 
     519        case W_BRGHI: 
    411520            s->wregs[s->reg] = val; 
    412521            slavio_serial_update_parameters(s); 
    413522            break; 
    414         case 9: 
    415             switch (val & 0xc0) { 
     523        case W_MINTR: 
     524            switch (val & MINTR_RST_MASK) { 
    416525            case 0: 
    417526            default: 
    418527                break; 
    419             case 0x40: 
     528            case MINTR_RST_B: 
    420529                slavio_serial_reset_chn(&serial->chn[1]); 
    421530                return; 
    422             case 0x80: 
     531            case MINTR_RST_A: 
    423532                slavio_serial_reset_chn(&serial->chn[0]); 
    424533                return; 
    425             case 0xc0: 
     534            case MINTR_RST_ALL: 
    426535                slavio_serial_reset(serial); 
    427536                return; 
     
    436545            s->reg = 0; 
    437546        break; 
    438     case 1: 
     547    case SERIAL_DATA: 
    439548        SER_DPRINTF("Write channel %c, ch %d\n", CHN_C(s), val); 
    440549        s->tx = val; 
    441         if (s->wregs[5] & 8) { // tx enabled 
     550        if (s->wregs[W_TXCTRL2] & TXCTRL2_TXEN) { // tx enabled 
    442551            if (s->chr) 
    443552                qemu_chr_write(s->chr, &s->tx, 1); 
     
    446555            } 
    447556        } 
    448         s->rregs[0] |= 4; // Tx buffer empty 
    449         s->rregs[1] |= 1; // All sent 
     557        s->rregs[R_STATUS] |= STATUS_TXEMPTY; // Tx buffer empty 
     558        s->rregs[R_SPEC] |= SPEC_ALLSENT; // All sent 
    450559        set_txint(s); 
    451560        break; 
     
    467576    s = &serial->chn[channel]; 
    468577    switch (saddr) { 
    469     case 0: 
    470         SER_DPRINTF("Read channel %c, reg[%d] = %2.2x\n", CHN_C(s), s->reg, s->rregs[s->reg]); 
     578    case SERIAL_CTRL: 
     579        SER_DPRINTF("Read channel %c, reg[%d] = %2.2x\n", CHN_C(s), s->reg, 
     580                    s->rregs[s->reg]); 
    471581        ret = s->rregs[s->reg]; 
    472582        s->reg = 0; 
    473583        return ret; 
    474     case 1: 
    475         s->rregs[0] &= ~1; 
     584    case SERIAL_DATA: 
     585        s->rregs[R_STATUS] &= ~STATUS_RXAV; 
    476586        clr_rxint(s); 
    477587        if (s->type == kbd || s->type == mouse) 
     
    494604    int ret; 
    495605 
    496     if (((s->wregs[3] & 1) == 0) // Rx not enabled 
    497         || ((s->rregs[0] & 1) == 1)) // char already available 
     606    if (((s->wregs[W_RXCTRL] & RXCTRL_RXEN) == 0) // Rx not enabled 
     607        || ((s->rregs[R_STATUS] & STATUS_RXAV) == STATUS_RXAV)) 
     608        // char already available 
    498609        ret = 0; 
    499610    else 
    500611        ret = 1; 
    501     //SER_DPRINTF("channel %c can receive %d\n", CHN_C(s), ret); 
    502612    return ret; 
    503613} 
     
    506616{ 
    507617    SER_DPRINTF("channel %c put ch %d\n", CHN_C(s), ch); 
    508     s->rregs[0] |= 1; 
     618    s->rregs[R_STATUS] |= STATUS_RXAV; 
    509619    s->rx = ch; 
    510620    set_rxint(s); 
     
    513623static void serial_receive_break(ChannelState *s) 
    514624{ 
    515     s->rregs[0] |= 0x80; 
     625    s->rregs[R_STATUS] |= STATUS_BRK; 
    516626    slavio_serial_update_irq(s); 
    517627} 
     
    554664    qemu_put_8s(f, &s->rx); 
    555665    qemu_put_8s(f, &s->tx); 
    556     qemu_put_buffer(f, s->wregs, 16); 
    557     qemu_put_buffer(f, s->rregs, 16); 
     666    qemu_put_buffer(f, s->wregs, SERIAL_REGS); 
     667    qemu_put_buffer(f, s->rregs, SERIAL_REGS); 
    558668} 
    559669 
     
    583693    qemu_get_8s(f, &s->rx); 
    584694    qemu_get_8s(f, &s->tx); 
    585     qemu_get_buffer(f, s->wregs, 16); 
    586     qemu_get_buffer(f, s->rregs, 16); 
     695    qemu_get_buffer(f, s->wregs, SERIAL_REGS); 
     696    qemu_get_buffer(f, s->rregs, SERIAL_REGS); 
    587697    return 0; 
    588698} 
     
    611721        return NULL; 
    612722 
    613     slavio_serial_io_memory = cpu_register_io_memory(0, slavio_serial_mem_read, slavio_serial_mem_write, s); 
     723    slavio_serial_io_memory = cpu_register_io_memory(0, slavio_serial_mem_read, 
     724                                                     slavio_serial_mem_write, 
     725                                                     s); 
    614726    cpu_register_physical_memory(base, SERIAL_SIZE, slavio_serial_io_memory); 
    615727 
     
    630742    s->chn[0].otherchn = &s->chn[1]; 
    631743    s->chn[1].otherchn = &s->chn[0]; 
    632     register_savevm("slavio_serial", base, 2, slavio_serial_save, slavio_serial_load, s); 
     744    register_savevm("slavio_serial", base, 2, slavio_serial_save, 
     745                    slavio_serial_load, s); 
    633746    qemu_register_reset(slavio_serial_reset, s); 
    634747    slavio_serial_reset(s); 
     
    663776    int release = ch & 0x80; 
    664777 
    665     KBD_DPRINTF("Untranslated keycode %2.2x (%s)\n", ch, release? "release" : "press"); 
     778    KBD_DPRINTF("Untranslated keycode %2.2x (%s)\n", ch, release? "release" : 
     779                "press"); 
    666780    switch (ch) { 
    667781    case 58: // Caps lock press 
     
    793907    s->chn[1].disabled = disabled; 
    794908 
    795     slavio_serial_io_memory = cpu_register_io_memory(0, slavio_serial_mem_read, slavio_serial_mem_write, s); 
     909    slavio_serial_io_memory = cpu_register_io_memory(0, slavio_serial_mem_read, 
     910                                                     slavio_serial_mem_write, 
     911                                                     s); 
    796912    cpu_register_physical_memory(base, SERIAL_SIZE, slavio_serial_io_memory); 
    797913 
    798     qemu_add_mouse_event_handler(sunmouse_event, &s->chn[0], 0, "QEMU Sun Mouse"); 
     914    qemu_add_mouse_event_handler(sunmouse_event, &s->chn[0], 0, 
     915                                 "QEMU Sun Mouse"); 
    799916    qemu_add_kbd_event_handler(sunkbd_event, &s->chn[1]); 
    800     register_savevm("slavio_serial_mouse", base, 2, slavio_serial_save, slavio_serial_load, s); 
     917    register_savevm("slavio_serial_mouse", base, 2, slavio_serial_save, 
     918                    slavio_serial_load, s); 
    801919    qemu_register_reset(slavio_serial_reset, s); 
    802920    slavio_serial_reset(s); 
  • trunk/src/host/qemu-neo1973/hw/sun4m.c

    r3627 r3665  
    601601        .default_cpu_model = "TI SuperSparc II", 
    602602    }, 
     603    /* SS-20 */ 
     604    { 
     605        .iommu_base   = 0xfe0000000ULL, 
     606        .tcx_base     = 0xe20000000ULL, 
     607        .cs_base      = -1, 
     608        .slavio_base  = 0xff0000000ULL, 
     609        .ms_kb_base   = 0xff1000000ULL, 
     610        .serial_base  = 0xff1100000ULL, 
     611        .nvram_base   = 0xff1200000ULL, 
     612        .fd_base      = 0xff1700000ULL, 
     613        .counter_base = 0xff1300000ULL, 
     614        .intctl_base  = 0xff1400000ULL, 
     615        .dma_base     = 0xef0400000ULL, 
     616        .esp_base     = 0xef0800000ULL, 
     617        .le_base      = 0xef0c00000ULL, 
     618        .power_base   = 0xefa000000ULL, 
     619        .ecc_base     = 0xf00000000ULL, 
     620        .ecc_version  = 0x20000000, // version 0, implementation 2 
     621        .vram_size    = 0x00100000, 
     622        .nvram_size   = 0x2000, 
     623        .esp_irq = 18, 
     624        .le_irq = 16, 
     625        .clock_irq = 7, 
     626        .clock1_irq = 19, 
     627        .ms_kb_irq = 14, 
     628        .ser_irq = 15, 
     629        .fd_irq = 22, 
     630        .me_irq = 30, 
     631        .cs_irq = -1, 
     632        .machine_id = 0x72, 
     633        .iommu_version = 0x13000000, 
     634        .intbit_to_level = { 
     635            2, 3, 5, 7, 9, 11, 0, 14,   3, 5, 7, 9, 11, 13, 12, 12, 
     636            6, 0, 4, 10, 8, 0, 11, 0,   0, 0, 0, 0, 15, 0, 15, 0, 
     637        }, 
     638        .max_mem = 0xffffffff, // XXX actually first 62GB ok 
     639        .default_cpu_model = "TI SuperSparc II", 
     640    }, 
    603641}; 
    604642 
     
    633671} 
    634672 
     673/* SPARCstation 20 hardware initialisation */ 
     674static void ss20_init(int RAM_size, int vga_ram_size, 
     675                      const char *boot_device, DisplayState *ds, 
     676                      const char *kernel_filename, const char *kernel_cmdline, 
     677                      const char *initrd_filename, const char *cpu_model) 
     678{ 
     679    sun4m_hw_init(&hwdefs[3], RAM_size, boot_device, ds, kernel_filename, 
     680                  kernel_cmdline, initrd_filename, cpu_model); 
     681} 
     682 
    635683QEMUMachine ss5_machine = { 
    636684    "SS-5", 
     
    650698    ss600mp_init, 
    651699}; 
     700 
     701QEMUMachine ss20_machine = { 
     702    "SS-20", 
     703    "Sun4m platform, SPARCstation 20", 
     704    ss20_init, 
     705}; 
     706 
  • trunk/src/host/qemu-neo1973/hw/usb-uhci.c

    r3443 r3665  
    509509          1 if TD unsuccessful or inactive 
    510510*/ 
    511 static int uhci_handle_td(UHCIState *s, UHCI_TD *td, int *int_mask, 
     511static int uhci_handle_td(UHCIState *s, UHCI_TD *td, uint32_t *int_mask, 
    512512                          int completion) 
    513513{ 
     
    734734    UHCIState *s = opaque; 
    735735    int64_t expire_time; 
    736     uint32_t frame_addr, link, old_td_ctrl, val; 
    737     int int_mask, cnt, ret; 
     736    uint32_t frame_addr, link, old_td_ctrl, val, int_mask; 
     737    int cnt, ret; 
    738738    UHCI_TD td; 
    739739    UHCI_QH qh; 
  • trunk/src/host/qemu-neo1973/hw/vga.c

    r3443 r3665  
    16881688    qemu_put_8s(f, &s->ar_index); 
    16891689    qemu_put_buffer(f, s->ar, 21); 
    1690     qemu_put_be32s(f, &s->ar_flip_flop); 
     1690    qemu_put_be32(f, s->ar_flip_flop); 
    16911691    qemu_put_8s(f, &s->cr_index); 
    16921692    qemu_put_buffer(f, s->cr, 256); 
    16931693    qemu_put_8s(f, &s->msr); 
    16941694    qemu_put_8s(f, &s->fcr); 
    1695     qemu_put_8s(f, &s->st00); 
     1695    qemu_put_byte(f, s->st00); 
    16961696    qemu_put_8s(f, &s->st01); 
    16971697 
     
    17031703    qemu_put_buffer(f, s->palette, 768); 
    17041704 
    1705     qemu_put_be32s(f, &s->bank_offset); 
     1705    qemu_put_be32(f, s->bank_offset); 
    17061706#ifdef CONFIG_BOCHS_VBE 
    17071707    qemu_put_byte(f, 1); 
     
    17381738    qemu_get_8s(f, &s->ar_index); 
    17391739    qemu_get_buffer(f, s->ar, 21); 
    1740     qemu_get_be32s(f, &s->ar_flip_flop); 
     1740    s->ar_flip_flop=qemu_get_be32(f); 
    17411741    qemu_get_8s(f, &s->cr_index); 
    17421742    qemu_get_buffer(f, s->cr, 256); 
     
    17531753    qemu_get_buffer(f, s->palette, 768); 
    17541754 
    1755     qemu_get_be32s(f, &s->bank_offset); 
     1755    s->bank_offset=qemu_get_be32(f); 
    17561756    is_vbe = qemu_get_byte(f); 
    17571757#ifdef CONFIG_BOCHS_VBE 
  • trunk/src/host/qemu-neo1973/hw/vmware_vga.c

    r3443 r3665  
    10291029static void vmsvga_save(struct vmsvga_state_s *s, QEMUFile *f) 
    10301030{ 
    1031     qemu_put_be32s(f, &s->depth); 
    1032     qemu_put_be32s(f, &s->enable); 
    1033     qemu_put_be32s(f, &s->config); 
    1034     qemu_put_be32s(f, &s->cursor.id); 
    1035     qemu_put_be32s(f, &s->cursor.x); 
    1036     qemu_put_be32s(f, &s->cursor.y); 
    1037     qemu_put_be32s(f, &s->cursor.on); 
    1038     qemu_put_be32s(f, &s->index); 
     1031    qemu_put_be32(f, s->depth); 
     1032    qemu_put_be32(f, s->enable); 
     1033    qemu_put_be32(f, s->config); 
     1034    qemu_put_be32(f, s->cursor.id); 
     1035    qemu_put_be32(f, s->cursor.x); 
     1036    qemu_put_be32(f, s->cursor.y); 
     1037    qemu_put_be32(f, s->cursor.on); 
     1038    qemu_put_be32(f, s->index); 
    10391039    qemu_put_buffer(f, (uint8_t *) s->scratch, s->scratch_size * 4); 
    1040     qemu_put_be32s(f, &s->new_width); 
    1041     qemu_put_be32s(f, &s->new_height); 
     1040    qemu_put_be32(f, s->new_width); 
     1041    qemu_put_be32(f, s->new_height); 
    10421042    qemu_put_be32s(f, &s->guest); 
    10431043    qemu_put_be32s(f, &s->svgaid); 
    1044     qemu_put_be32s(f, &s->syncing); 
    1045     qemu_put_be32s(f, &s->fb_size); 
     1044    qemu_put_be32(f, s->syncing); 
     1045    qemu_put_be32(f, s->fb_size); 
    10461046} 
    10471047 
     
    10491049{ 
    10501050    int depth; 
    1051     qemu_get_be32s(f, &depth); 
    1052     qemu_get_be32s(f, &s->enable); 
    1053     qemu_get_be32s(f, &s->config); 
    1054     qemu_get_be32s(f, &s->cursor.id); 
    1055     qemu_get_be32s(f, &s->cursor.x); 
    1056     qemu_get_be32s(f, &s->cursor.y); 
    1057     qemu_get_be32s(f, &s->cursor.on); 
    1058     qemu_get_be32s(f, &s->index); 
     1051    depth=qemu_get_be32(f); 
     1052    s->enable=qemu_get_be32(f); 
     1053    s->config=qemu_get_be32(f); 
     1054    s->cursor.id=qemu_get_be32(f); 
     1055    s->cursor.x=qemu_get_be32(f); 
     1056    s->cursor.y=qemu_get_be32(f); 
     1057    s->cursor.on=qemu_get_be32(f); 
     1058    s->index=qemu_get_be32(f); 
    10591059    qemu_get_buffer(f, (uint8_t *) s->scratch, s->scratch_size * 4); 
    1060     qemu_get_be32s(f, &s->new_width); 
    1061     qemu_get_be32s(f, &s->new_height); 
     1060    s->new_width=qemu_get_be32(f); 
     1061    s->new_height=qemu_get_be32(f); 
    10621062    qemu_get_be32s(f, &s->guest); 
    10631063    qemu_get_be32s(f, &s->svgaid); 
    1064     qemu_get_be32s(f, &s->syncing); 
    1065     qemu_get_be32s(f, &s->fb_size); 
     1064    s->syncing=qemu_get_be32(f); 
     1065    s->fb_size=qemu_get_be32(f); 
    10661066 
    10671067    if (s->enable && depth != s->depth) { 
  • trunk/src/host/qemu-neo1973/linux-user/main.c

    r3555 r3665  
    19071907           "-d options   activate log (logfile=%s)\n" 
    19081908           "-p pagesize  set the host page size to 'pagesize'\n" 
    1909            "-strace      log system calls\n", 
     1909           "-strace      log system calls\n" 
     1910           "\n" 
     1911           "environment variables:\n" 
     1912           "QEMU_STRACE       Print system calls and arguments similar to the\n" 
     1913           "                  'strace' program.  Enable by setting to any value.\n" 
     1914           , 
    19101915           TARGET_ARCH, 
    19111916           interp_prefix, 
  • trunk/src/host/qemu-neo1973/linux-user/mmap.c

    r3443 r3665  
    163163   Return -1 if error. 
    164164*/ 
    165 /* XXX: should mark pages used by the host as reserved to be sure not 
     165/* page_init() marks pages used by the host as reserved to be sure not 
    166166   to use them. */ 
    167167static abi_ulong mmap_find_vma(abi_ulong start, abi_ulong size) 
  • trunk/src/host/qemu-neo1973/linux-user/syscall.c

    r3627 r3665  
    31783178        ret = get_errno(sys_unlinkat(arg1, p, arg3)); 
    31793179        unlock_user(p, arg2, 0); 
     3180        break; 
    31803181#endif 
    31813182    case TARGET_NR_execve: 
  • trunk/src/host/qemu-neo1973/monitor.c

    r3555 r3665  
    7878static term_cmd_t modem_cmds[]; 
    7979 
    80 static char term_outbuf[1024]; 
     80static uint8_t term_outbuf[1024]; 
    8181static int term_outbuf_index; 
    8282 
     
    9999void term_puts(const char *str) 
    100100{ 
    101     int c; 
     101    char c; 
    102102    for(;;) { 
    103103        c = *str++; 
  • trunk/src/host/qemu-neo1973/osdep.h

    r3443 r3665  
    5757 
    5858#ifdef _WIN32 
     59int ffs(int i); 
     60 
    5961typedef struct { 
    6062    long tv_sec; 
  • trunk/src/host/qemu-neo1973/pc-bios/README

    r3443 r3665  
    1616  1275-1994 (referred to as Open Firmware) compliant firmware. 
    1717  The included Sparc32 and Sparc64 images are built from SVN 
    18   revision 176. 
     18  revision 181. 
    1919 
    2020- The PXE roms come from Rom-o-Matic etherboot 5.4.2. 
  • trunk/src/host/qemu-neo1973/qemu-doc.texi

    r3517 r3665  
    227227@option{-cdrom} at the same time). You can use the host CD-ROM by 
    228228using @file{/dev/cdrom} as filename (@pxref{host_drives}). 
     229 
     230@item -drive @var{option}[,@var{option}[,@var{option}[,...]]] 
     231 
     232Define a new drive. Valid options are: 
     233 
     234@table @code 
     235@item file=@var{file} 
     236This option defines which disk image (@pxref{disk_images}) to use with 
     237this drive. 
     238@item if=@var{interface} 
     239This option defines on which type on interface the drive is connected. 
     240Available types are: ide, scsi, sd, mtd, floppy, pflash. 
     241@item bus=@var{bus},unit=@var{unit} 
     242These options define where is connected the drive by defining the bus number and 
     243the unit id. 
     244@item index=@var{index} 
     245This option defines where is connected the drive by using an index in the list 
     246of available connectors of a given interface type. 
     247@item media=@var{media} 
     248This option defines the type of the media: disk or cdrom. 
     249@item cyls=@var{c},heads=@var{h},secs=@var{s}[,trans=@var{t}] 
     250These options have the same definition as they have in @option{-hdachs}. 
     251@item snapshot=@var{snapshot} 
     252@var{snapshot} is "on" or "off" and allows to enable snapshot for given drive (see @option{-snapshot}). 
     253@end table 
     254 
     255Instead of @option{-cdrom} you can use: 
     256@example 
     257qemu -drive file=file,index=2,media=cdrom 
     258@end example 
     259 
     260Instead of @option{-hda}, @option{-hdb}, @option{-hdc}, @option{-hdd}, you can 
     261use: 
     262@example 
     263qemu -drive file=file,index=0,media=disk 
     264qemu -drive file=file,index=1,media=disk 
     265qemu -drive file=file,index=2,media=disk 
     266qemu -drive file=file,index=3,media=disk 
     267@end example 
     268 
     269You can connect a CDROM to the slave of ide0: 
     270@example 
     271qemu -drive file=file,if=ide,index=1,media=cdrom 
     272@end example 
     273 
     274If you don't specify the "file=" argument, you define an empty drive: 
     275@example 
     276qemu -drive if=ide,index=1,media=cdrom 
     277@end example 
     278 
     279You can connect a SCSI disk with unit ID 6 on the bus #0: 
     280@example 
     281qemu -drive file=file,if=scsi,bus=0,unit=6 
     282@end example 
     283 
     284Instead of @option{-fda}, @option{-fdb}, you can use: 
     285@example 
     286qemu -drive file=file,index=0,if=floppy 
     287qemu -drive file=file,index=1,if=floppy 
     288@end example 
     289 
     290By default, @var{interface} is "ide" and @var{index} is automatically 
     291incremented: 
     292@example 
     293qemu -drive file=a -drive file=b" 
     294@end example 
     295is interpreted like: 
     296@example 
     297qemu -hda a -hdb b 
     298@end example 
    229299 
    230300@item -boot [a|c|d|n] 
     
    24382508@end table 
    24392509 
     2510Environment variables: 
     2511 
     2512@table @env 
     2513@item QEMU_STRACE 
     2514Print system calls and arguments similar to the 'strace' program 
     2515(NOTE: the actual 'strace' program will not work because the user 
     2516space emulator hasn't implemented ptrace).  At the moment this is 
     2517incomplete.  All system calls that don't have a specific argument 
     2518format are printed with information for six arguments.  Many 
     2519flag-style arguments don't have decoders and will show up as numbers. 
     2520 
    24402521@node Other binaries 
    24412522@subsection Other binaries 
  • trunk/src/host/qemu-neo1973/target-sparc/op.c

    r3517 r3665  
    12451245    env->exception_index = PARAM1; 
    12461246    cpu_loop_exit(); 
     1247    FORCE_RET(); 
    12471248} 
    12481249 
     
    12511252    env->exception_index = TT_TRAP + (T0 & 0x7f); 
    12521253    cpu_loop_exit(); 
     1254    FORCE_RET(); 
    12531255} 
    12541256 
  • trunk/src/host/qemu-neo1973/target-sparc/op_helper.c

    r3555 r3665  
    412412        } 
    413413        break; 
     414    case 0x39: /* data cache diagnostic register */ 
     415        ret = 0; 
     416        break; 
    414417    case 0x21 ... 0x2d: /* MMU passthrough, unassigned */ 
    415418    default: 
     
    704707        } 
    705708        return; 
    706     case 0x31: /* Ross RT620 I-cache flush */ 
     709    case 0x30: /* store buffer tags */ 
     710    case 0x31: /* store buffer data or Ross RT620 I-cache flush */ 
     711    case 0x32: /* store buffer control */ 
    707712    case 0x36: /* I-cache flash clear */ 
    708713    case 0x37: /* D-cache flash clear */ 
     714    case 0x38: /* breakpoint diagnostics */ 
     715    case 0x4c: /* breakpoint action */ 
    709716        break; 
    710717    case 9: /* Supervisor code access, XXX */ 
  • trunk/src/host/qemu-neo1973/translate-all.c

    r3555 r3665  
    133133} 
    134134 
     135unsigned long code_gen_max_block_size(void) 
     136{ 
     137    static unsigned long max; 
     138 
     139    if (max == 0) { 
     140#define DEF(s, n, copy_size) max = copy_size > max? copy_size : max; 
     141#include "opc.h" 
     142#undef DEF 
     143        max *= OPC_MAX_SIZE; 
     144    } 
     145 
     146    return max; 
     147} 
     148 
    135149/* return non zero if the very first instruction is invalid so that 
    136150   the virtual CPU can trigger an exception. 
     
    139153   code). 
    140154*/ 
    141 int cpu_gen_code(CPUState *env, TranslationBlock *tb, 
    142                  int max_code_size, int *gen_code_size_ptr) 
     155int cpu_gen_code(CPUState *env, TranslationBlock *tb, int *gen_code_size_ptr) 
    143156{ 
    144157    uint8_t *gen_code_buf; 
  • trunk/src/host/qemu-neo1973/vl.c

    r3616 r3665  
    238238static CPUState *cur_cpu; 
    239239static CPUState *next_cpu; 
    240 static int event_pending; 
     240static int event_pending = 1; 
    241241 
    242242#define TFR(expr) do { if ((expr) != -1) break; } while (errno == EINTR) 
     
    829829 
    830830#define ALARM_FLAG_DYNTICKS  0x1 
     831#define ALARM_FLAG_MODIFIED  0x2 
    831832 
    832833static inline int alarm_has_dynticks(struct qemu_alarm_timer *t) 
     
    839840    if (!alarm_has_dynticks(t)) 
    840841        return; 
     842 
     843    if (!(t->flags & ALARM_FLAG_MODIFIED)) 
     844        return; 
     845 
     846    t->flags &= ~(ALARM_FLAG_MODIFIED); 
    841847 
    842848    t->rearm(t); 
     
    10121018{ 
    10131019    QEMUTimer **pt, *t; 
     1020 
     1021    alarm_timer->flags |= ALARM_FLAG_MODIFIED; 
    10141022 
    10151023    /* NOTE: this code must be signal safe because 
     
    10931101        ts->cb(ts->opaque); 
    10941102    } 
    1095     qemu_rearm_alarm_timer(alarm_timer); 
    10961103} 
    10971104 
     
    11451152        hw_error("cannot save state if virtual timers are running"); 
    11461153    } 
    1147     qemu_put_be64s(f, &cpu_ticks_offset); 
    1148     qemu_put_be64s(f, &ticks_per_sec); 
    1149     qemu_put_be64s(f, &cpu_clock_offset); 
     1154    qemu_put_be64(f, cpu_ticks_offset); 
     1155    qemu_put_be64(f, ticks_per_sec); 
     1156    qemu_put_be64(f, cpu_clock_offset); 
    11501157} 
    11511158 
     
    11571164        return -EINVAL; 
    11581165    } 
    1159     qemu_get_be64s(f, &cpu_ticks_offset); 
    1160     qemu_get_be64s(f, &ticks_per_sec); 
     1166    cpu_ticks_offset=qemu_get_be64(f); 
     1167    ticks_per_sec=qemu_get_be64(f); 
    11611168    if (version_id == 2) { 
    1162         qemu_get_be64s(f, &cpu_clock_offset); 
     1169        cpu_clock_offset=qemu_get_be64(f); 
    11631170    } 
    11641171    return 0; 
     
    12161223            return; 
    12171224 
    1218         /* stop the currently executing cpu because a timer occured */ 
    1219         cpu_interrupt(env, CPU_INTERRUPT_EXIT); 
     1225        if (env) { 
     1226            alarm_timer->flags |= ALARM_FLAG_MODIFIED; 
     1227            /* stop the currently executing cpu because a timer occured */ 
     1228            cpu_interrupt(env, CPU_INTERRUPT_EXIT); 
    12201229#ifdef USE_KQEMU 
    1221         if (env->kqemu_enabled) { 
    1222             kqemu_cpu_interrupt(env); 
    1223         } 
    1224 #endif 
     1230            if (env->kqemu_enabled) { 
     1231                kqemu_cpu_interrupt(env); 
     1232            } 
     1233#endif 
     1234        } 
    12251235        event_pending = 1; 
    12261236    } 
     
    16401650    va_start(ap, fmt); 
    16411651    vsnprintf(buf, sizeof(buf), fmt, ap); 
    1642     qemu_chr_write(s, buf, strlen(buf)); 
     1652    qemu_chr_write(s, (uint8_t *)buf, strlen(buf)); 
    16431653    va_end(ap); 
    16441654} 
     
    17291739                         secs % 60, 
    17301740                         (int)((ti / 1000000) % 1000)); 
    1731                 d->drv->chr_write(d->drv, buf1, strlen(buf1)); 
     1741                d->drv->chr_write(d->drv, (uint8_t *)buf1, strlen(buf1)); 
    17321742            } 
    17331743        } 
     
    17581768        sprintf(ebuf,"C-%c", term_escape_char - 1 + 'a'); 
    17591769    } else { 
    1760         sprintf(cbuf,"\n\rEscape-Char set to Ascii: 0x%02x\n\r\n\r", term_escape_char); 
    1761     } 
    1762     chr->chr_write(chr, cbuf, strlen(cbuf)); 
     1770        sprintf(cbuf,"\n\rEscape-Char set to Ascii: 0x%02x\n\r\n\r", 
     1771            term_escape_char); 
     1772    } 
     1773    chr->chr_write(chr, (uint8_t *)cbuf, strlen(cbuf)); 
    17631774    for (i = 0; mux_help[i] != NULL; i++) { 
    17641775        for (j=0; mux_help[i][j] != '\0'; j++) { 
    17651776            if (mux_help[i][j] == '%') 
    1766                 chr->chr_write(chr, ebuf, strlen(ebuf)); 
     1777                chr->chr_write(chr, (uint8_t *)ebuf, strlen(ebuf)); 
    17671778            else 
    1768                 chr->chr_write(chr, &mux_help[i][j], 1); 
     1779                chr->chr_write(chr, (uint8_t *)&mux_help[i][j], 1); 
    17691780        } 
    17701781    } 
     
    17851796            { 
    17861797                 char *term =  "QEMU: Terminated\n\r"; 
    1787                  chr->chr_write(chr,term,strlen(term)); 
     1798                 chr->chr_write(chr,(uint8_t *)term,strlen(term)); 
    17881799                 exit(0); 
    17891800                 break; 
     
    29062917    int fd; 
    29072918    struct sockaddr_in daddr; 
    2908     char buf[1024]; 
     2919    uint8_t buf[1024]; 
    29092920    int bufcnt; 
    29102921    int bufptr; 
     
    30643075static void tcp_chr_process_IAC_bytes(CharDriverState *chr, 
    30653076                                      TCPCharDriver *s, 
    3066                                       char *buf, int *size) 
     3077                                      uint8_t *buf, int *size) 
    30673078{ 
    30683079    /* Handle any telnet client's basic IAC options to satisfy char by 
     
    34823493{ 
    34833494    int i; 
    3484     for(i = 0; i < 6; i++) { 
    3485         macaddr[i] = strtol(p, (char **)&p, 16); 
    3486         if (i == 5) { 
    3487             if (*p != '\0') 
    3488                 return -1; 
    3489         } else { 
    3490             if (*p != ':') 
    3491                 return -1; 
    3492             p++; 
    3493         } 
    3494     } 
    3495     return 0; 
     3495    char *last_char; 
     3496    long int offset; 
     3497 
     3498    errno = 0; 
     3499    offset = strtol(p, &last_char, 0);     
     3500    if (0 == errno && '\0' == *last_char && 
     3501            offset >= 0 && offset <= 0xFFFFFF) { 
     3502        macaddr[3] = (offset & 0xFF0000) >> 16; 
     3503        macaddr[4] = (offset & 0xFF00) >> 8; 
     3504        macaddr[5] = offset & 0xFF; 
     3505        return 0; 
     3506    } else { 
     3507        for(i = 0; i < 6; i++) { 
     3508            macaddr[i] = strtol(p, (char **)&p, 16); 
     3509            if (i == 5) { 
     3510                if (*p != '\0') 
     3511                    return -1; 
     3512            } else { 
     3513                if (*p != ':' && *p != '-') 
     3514                    return -1; 
     3515                p++; 
     3516            } 
     3517        } 
     3518        return 0;     
     3519    } 
     3520 
     3521    return -1; 
    34963522} 
    34973523 
     
    60346060        len = strlen(se->idstr); 
    60356061        qemu_put_byte(f, len); 
    6036         qemu_put_buffer(f, se->idstr, len); 
     6062        qemu_put_buffer(f, (uint8_t *)se->idstr, len); 
    60376063 
    60386064        qemu_put_be32(f, se->instance_id); 
     
    60956121            break; 
    60966122        len = qemu_get_byte(f); 
    6097         qemu_get_buffer(f, idstr, len); 
     6123        qemu_get_buffer(f, (uint8_t *)idstr, len); 
    60986124        idstr[len] = '\0'; 
    60996125        instance_id = qemu_get_be32(f); 
     
    76017627    qemu_run_timers(&active_timers[QEMU_TIMER_REALTIME], 
    76027628                    qemu_get_clock(rt_clock)); 
     7629 
     7630    qemu_rearm_alarm_timer(alarm_timer); 
    76037631 
    76047632    /* Check bottom-halves last in case any of the earlier events triggered 
     
    80978125    qemu_register_machine(&ss10_machine); 
    80988126    qemu_register_machine(&ss600mp_machine); 
     8127    qemu_register_machine(&ss20_machine); 
    80998128#endif 
    81008129#elif defined(TARGET_ARM) 
     
    85278556                { 
    85288557                    /* Could easily be extended to 64 devices if needed */ 
    8529                     const unsigned char *p; 
     8558                    const char *p; 
    85308559                     
    85318560                    boot_devices_bitmap = 0; 
     
    89969025 
    89979026#ifdef TARGET_I386 
    8998     /* XXX: this should be moved in the PC machine instanciation code */ 
     9027    /* XXX: this should be moved in the PC machine instantiation code */ 
    89999028    if (net_boot != 0) { 
    90009029        int netroms = 0; 
  • trunk/src/host/qemu-neo1973/vnc.c

    r3443 r3665  
    6161    size_t capacity; 
    6262    size_t offset; 
    63     char *buffer; 
     63    uint8_t *buffer; 
    6464} Buffer; 
    6565 
    6666typedef struct VncState VncState; 
    6767 
    68 typedef int VncReadEvent(VncState *vs, char *data, size_t len); 
     68typedef int VncReadEvent(VncState *vs, uint8_t *data, size_t len); 
    6969 
    7070typedef void VncWritePixels(VncState *vs, void *data, int size); 
     
    258258 
    259259    h += y; 
     260 
     261    /* round x down to ensure the loop only spans one 16-pixel block per, 
     262       iteration.  otherwise, if (x % 16) != 0, the last iteration may span 
     263       two 16-pixel blocks but we only mark the first as dirty 
     264    */ 
     265    w += (x % 16); 
     266    x -= (x % 16); 
    260267 
    261268    for (; y < h; y++) 
     
    370377{ 
    371378    int i; 
    372     char *row; 
     379    uint8_t *row; 
    373380 
    374381    vnc_framebuffer_update(vs, x, y, w, h, 0); 
     
    434441{ 
    435442    int src, dst; 
    436     char *src_row; 
    437     char *dst_row; 
     443    uint8_t *src_row; 
     444    uint8_t *dst_row; 
    438445    char *old_row; 
    439446    int y = 0; 
     
    493500    if (vs->need_update && vs->csock != -1) { 
    494501        int y; 
    495         char *row; 
     502        uint8_t *row; 
    496503        char *old_row; 
    497504        uint32_t width_mask[VNC_DIRTY_WORDS]; 
     
    510517            if (vnc_and_bits(vs->dirty_row[y], width_mask, VNC_DIRTY_WORDS)) { 
    511518                int x; 
    512                 char *ptr, *old_ptr; 
     519                uint8_t *ptr; 
     520                char *old_ptr; 
    513521 
    514522                ptr = row; 
    515                 old_ptr = old_row; 
     523                old_ptr = (char*)old_row; 
    516524 
    517525                for (x = 0; x < vs->ds->width; x += 16) { 
     
    616624} 
    617625 
    618 static char *buffer_end(Buffer *buffer) 
     626static uint8_t *buffer_end(Buffer *buffer) 
    619627{ 
    620628    return buffer->buffer + buffer->offset; 
     
    847855#endif /* CONFIG_VNC_TLS */ 
    848856 
    849 static void client_cut_text(VncState *vs, size_t len, char *text) 
     857static void client_cut_text(VncState *vs, size_t len, uint8_t *text) 
    850858{ 
    851859} 
     
    11751183} 
    11761184 
    1177 static int protocol_client_msg(VncState *vs, char *data, size_t len) 
     1185static int protocol_client_msg(VncState *vs, uint8_t *data, size_t len) 
    11781186{ 
    11791187    int i; 
     
    12481256} 
    12491257 
    1250 static int protocol_client_init(VncState *vs, char *data, size_t len) 
     1258static int protocol_client_init(VncState *vs, uint8_t *data, size_t len) 
    12511259{ 
    12521260    char pad[3] = { 0, 0, 0 }; 
     
    13211329} 
    13221330 
    1323 static int protocol_client_auth_vnc(VncState *vs, char *data, size_t len) 
    1324 { 
    1325     char response[VNC_AUTH_CHALLENGE_SIZE]; 
     1331static int protocol_client_auth_vnc(VncState *vs, uint8_t *data, size_t len) 
     1332{ 
     1333    unsigned char response[VNC_AUTH_CHALLENGE_SIZE]; 
    13261334    int i, j, pwlen; 
    1327     char key[8]; 
     1335    unsigned char key[8]; 
    13281336 
    13291337    if (!vs->password || !vs->password[0]) { 
     
    17321740} 
    17331741 
    1734 static int protocol_client_vencrypt_auth(VncState *vs, char *data, size_t len) 
     1742static int protocol_client_vencrypt_auth(VncState *vs, uint8_t *data, size_t len) 
    17351743{ 
    17361744    int auth = read_u32(data, 0); 
     
    17621770} 
    17631771 
    1764 static int protocol_client_vencrypt_init(VncState *vs, char *data, size_t len) 
     1772static int protocol_client_vencrypt_init(VncState *vs, uint8_t *data, size_t len) 
    17651773{ 
    17661774    if (data[0] != 0 || 
     
    17921800#endif /* CONFIG_VNC_TLS */ 
    17931801 
    1794 static int protocol_client_auth(VncState *vs, char *data, size_t len) 
     1802static int protocol_client_auth(VncState *vs, uint8_t *data, size_t len) 
    17951803{ 
    17961804    /* We only advertise 1 auth scheme at a time, so client 
     
    18411849} 
    18421850 
    1843 static int protocol_version(VncState *vs, char *version, size_t len) 
     1851static int protocol_version(VncState *vs, uint8_t *version, size_t len) 
    18441852{ 
    18451853    char local[13]; 
  • trunk/src/host/qemu-neo1973/vnchextile.h

    r2981 r3665  
    1414                                             int *has_bg, int *has_fg) 
    1515{ 
    16     char *row = (vs->ds->data + y * vs->ds->linesize + x * vs->depth); 
     16    uint8_t *row = (vs->ds->data + y * vs->ds->linesize + x * vs->depth); 
    1717    pixel_t *irow = (pixel_t *)row; 
    1818    int j, i; 
Note: See TracChangeset for help on using the changeset viewer.