VirtualBox

Changeset 1912 in vbox for trunk


Ignore:
Timestamp:
Apr 4, 2007 8:25:13 AM (18 years ago)
Author:
vboxsync
Message:

muldiv64() => ASMMultU64ByU32DivByU32(); dma.c => DevDMA.cpp

Location:
trunk/src/VBox/Devices
Files:
1 deleted
6 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Makefile

    r1723 r1912  
    9292VBoxDD_SDKS.win         = WINPSDK DXSDK W2K3DDK VBOX_NTDLL
    9393VBoxDD_SOURCES          = \
    94         Builtins.cpp \
    95         muldiv64.c
     94        Builtins.cpp
    9695VBoxDD_DEFS             = VBOX_ACPI
    9796ifdef VBOX_WITH_USB
     
    181180        Network/DevPCNet.cpp \
    182181        Audio/DevIchAc97.cpp \
    183         PC/dma.c \
     182        PC/DevDMA.cpp \
    184183        Storage/fdc.c \
    185184        Serial/DevSerial.cpp
     
    216215        $(PATH_CURRENT)
    217216VBoxDDGC_SOURCES        = \
    218         muldiv64.c \
    219217        Bus/DevPCI.cpp \
    220218        Graphics/DevVGA.cpp \
     
    253251        $(PATH_CURRENT)
    254252VBoxDDR0_SOURCES        = \
    255         muldiv64.c \
    256253        Bus/DevPCI.cpp \
    257254        Graphics/DevVGA.cpp \
  • trunk/src/VBox/Devices/PC/DevACPI.cpp

    r491 r1912  
    2626#include <VBox/log.h>
    2727#include <iprt/assert.h>
     28#include <iprt/asm.h>
    2829#ifdef IN_RING3
    2930#include <iprt/alloc.h>
     
    871872
    872873    freq = TMTimerGetFreq (s->CTXSUFF(ts));
    873     interval = muldiv64 (0xffffffff, freq, PM_TMR_FREQ);
     874    interval = ASMMultU64ByU32DivByU32 (0xffffffff, freq, PM_TMR_FREQ);
    874875    Log (("interval = %RU64\n", interval));
    875876    TMTimerSet (s->CTXSUFF(ts), TMTimerGet (s->CTXSUFF(ts)) + interval);
     
    12161217        int64_t elapsed = now - s->pm_timer_initial;
    12171218
    1218         *pu32 = muldiv64 (elapsed, PM_TMR_FREQ, TMTimerGetFreq (s->CTXSUFF(ts)));
     1219        *pu32 = ASMMultU64ByU32DivByU32 (elapsed, PM_TMR_FREQ, TMTimerGetFreq (s->CTXSUFF(ts)));
    12191220        Log (("acpi: acpiPMTmrRead -> %#x\n", *pu32));
    12201221        return VINF_SUCCESS;
  • trunk/src/VBox/Devices/PC/DevDMA.cpp

    r1906 r1912  
    169169static void write_page (void *opaque, uint32_t nport, uint32_t data)
    170170{
    171     struct dma_cont *d = opaque;
     171    struct dma_cont *d = (struct dma_cont*)opaque;
    172172    int ichan;
    173173
     
    182182static void write_pageh (void *opaque, uint32_t nport, uint32_t data)
    183183{
    184     struct dma_cont *d = opaque;
     184    struct dma_cont *d = (struct dma_cont*)opaque;
    185185    int ichan;
    186186
     
    195195static uint32_t read_page (void *opaque, uint32_t nport)
    196196{
    197     struct dma_cont *d = opaque;
     197    struct dma_cont *d = (struct dma_cont*)opaque;
    198198    int ichan;
    199199
     
    208208static uint32_t read_pageh (void *opaque, uint32_t nport)
    209209{
    210     struct dma_cont *d = opaque;
     210    struct dma_cont *d = (struct dma_cont*)opaque;
    211211    int ichan;
    212212
     
    239239static uint32_t read_chan (void *opaque, uint32_t nport)
    240240{
    241     struct dma_cont *d = opaque;
     241    struct dma_cont *d = (struct dma_cont*)opaque;
    242242    int ichan, nreg, iport, ff, val, dir;
    243243    struct dma_regs *r;
     
    261261static void write_chan (void *opaque, uint32_t nport, uint32_t data)
    262262{
    263     struct dma_cont *d = opaque;
     263    struct dma_cont *d = (struct dma_cont*)opaque;
    264264    int iport, ichan, nreg;
    265265    struct dma_regs *r;
     
    279279static void write_cont (void *opaque, uint32_t nport, uint32_t data)
    280280{
    281     struct dma_cont *d = opaque;
     281    struct dma_cont *d = (struct dma_cont*)opaque;
    282282    int iport, ichan = 0;
    283283
     
    363363static uint32_t read_cont (void *opaque, uint32_t nport)
    364364{
    365     struct dma_cont *d = opaque;
     365    struct dma_cont *d = (struct dma_cont*)opaque;
    366366    int iport, val;
    367367
     
    480480
    481481    if (r->mode & 0x20) {
    482         int i;
    483         uint8_t *p = buf;
     482        unsigned i;
     483        uint8_t *p = (uint8_t*)buf;
    484484
    485485#ifdef VBOX
     
    513513
    514514    if (r->mode & 0x20) {
    515         int i;
     515        unsigned i;
    516516        uint8_t *p = (uint8_t *) buf;
    517517
     
    548548static void dma_reset(void *opaque)
    549549{
    550     struct dma_cont *d = opaque;
     550    struct dma_cont *d = (struct dma_cont*)opaque;
    551551    write_cont (d, (0x0d << d->dshift), 0);
    552552}
     
    727727static void dma_save (QEMUFile *f, void *opaque)
    728728{
    729     struct dma_cont *d = opaque;
     729    struct dma_cont *d = (struct dma_cont*)opaque;
    730730    int i;
    731731
     
    752752static int dma_load (QEMUFile *f, void *opaque, int version_id)
    753753{
    754     struct dma_cont *d = opaque;
     754    struct dma_cont *d = (struct dma_cont*)opaque;
    755755    int i;
    756756
  • trunk/src/VBox/Devices/PC/DevPit-i8254.cpp

    r485 r1912  
    5353#define LOG_GROUP LOG_GROUP_DEV_PIT
    5454#include <VBox/pdm.h>
    55 
    5655#include <VBox/log.h>
     56#include <VBox/stam.h>
    5757#include <iprt/assert.h>
    58 #include <VBox/stam.h>
    59 
    60 #include "vl_vbox.h"
    61 
     58#include <iprt/asm.h>
     59
     60#include "Builtins.h"
    6261
    6362/*******************************************************************************
     
    172171        d = TMTimerGet(pTimer);
    173172        d -= s->u64ReloadTS;
    174         d = muldiv64(d, PIT_FREQ, TMTimerGetFreq(pTimer));
     173        d = ASMMultU64ByU32DivByU32(d, PIT_FREQ, TMTimerGetFreq(pTimer));
    175174#else /* variable time because of catch up */
    176175        if (s->u64NextTS == UINT64_MAX)
    177176            return 1; /** @todo check this value. */
    178177        d = TMTimerGet(pTimer);
    179         d = muldiv64(d - s->u64ReloadTS, s->count, s->u64NextTS - s->u64ReloadTS);
     178        d = ASMMultU64ByU32DivByU32(d - s->u64ReloadTS, s->count, s->u64NextTS - s->u64ReloadTS);
    180179#endif
    181180        if (d >= s->count)
     
    183182        return s->count - d;
    184183    }
    185     d = muldiv64(TMTimerGet(pTimer) - s->count_load_time, PIT_FREQ, TMTimerGetFreq(pTimer));
     184    d = ASMMultU64ByU32DivByU32(TMTimerGet(pTimer) - s->count_load_time, PIT_FREQ, TMTimerGetFreq(pTimer));
    186185    switch(s->mode) {
    187186    case 0:
     
    210209    int out;
    211210
    212     d = muldiv64(current_time - s->count_load_time, PIT_FREQ, TMTimerGetFreq(pTimer));
     211    d = ASMMultU64ByU32DivByU32(current_time - s->count_load_time, PIT_FREQ, TMTimerGetFreq(pTimer));
    213212    switch(s->mode) {
    214213    default:
     
    259258        s->count_latched = s->rw_mode;
    260259        LogFlow(("pit_latch_count: latched_count=%#06x / %10RU64 ns (c=%#06x m=%d)\n",
    261                  s->latched_count, muldiv64(s->count - s->latched_count, 1000000000, PIT_FREQ), s->count, s->mode));
     260                 s->latched_count, ASMMultU64ByU32DivByU32(s->count - s->latched_count, 1000000000, PIT_FREQ), s->count, s->mode));
    262261    }
    263262}
     
    316315    uint32_t period2;
    317316
    318     d = muldiv64(current_time - s->count_load_time, PIT_FREQ, TMTimerGetFreq(pTimer));
     317    d = ASMMultU64ByU32DivByU32(current_time - s->count_load_time, PIT_FREQ, TMTimerGetFreq(pTimer));
    319318    switch(s->mode) {
    320319    default:
     
    366365    /* convert to timer units */
    367366    LogFlow(("PIT: next_time=%14RI64 %20RI64 mode=%#x count=%#06x\n", next_time,
    368              muldiv64(next_time, TMTimerGetFreq(pTimer), PIT_FREQ), s->mode, s->count));
    369     next_time = s->count_load_time + muldiv64(next_time, TMTimerGetFreq(pTimer), PIT_FREQ);
     367             ASMMultU64ByU32DivByU32(next_time, TMTimerGetFreq(pTimer), PIT_FREQ), s->mode, s->count));
     368    next_time = s->count_load_time + ASMMultU64ByU32DivByU32(next_time, TMTimerGetFreq(pTimer), PIT_FREQ);
    370369    /* fix potential rounding problems */
    371370    /* XXX: better solution: use a clock at PIT_FREQ Hz */
     
    418417                LogFlow(("PIT: m=%d cnt=%#4x irq=%#x delay=%8RI64 next=%20RI64 now=%20RI64 load=%20RI64 %9RI64 delta=%9RI64\n",
    419418                         s->mode, s->count, irq_level, quarter, s->u64NextTS, now, s->count_load_time,
    420                          muldiv64(s->u64NextTS - s->count_load_time, PIT_FREQ, TMTimerGetFreq(pTimer)), delta));
     419                         ASMMultU64ByU32DivByU32(s->u64NextTS - s->count_load_time, PIT_FREQ, TMTimerGetFreq(pTimer)), delta));
    421420            }
    422421            else
     
    427426                LogFlow(("PIT: m=%d cnt=%#4x irq=%#x delay=%8RI64 next=%20RI64 now=%20RI64 load=%20RI64 %9RI64 delta=%9RI64 giving up!\n",
    428427                         s->mode, s->count, irq_level, quarter, s->u64NextTS, now, s->count_load_time,
    429                          muldiv64(s->u64NextTS - s->count_load_time, PIT_FREQ, TMTimerGetFreq(pTimer)), delta));
     428                         ASMMultU64ByU32DivByU32(s->u64NextTS - s->count_load_time, PIT_FREQ, TMTimerGetFreq(pTimer)), delta));
    430429            }
    431430        }
     
    436435            LogFlow(("PIT: m=%d cnt=%#4x irq=%#x delay=%8RI64 next=%20RI64 now=%20RI64 load=%20RI64 %9RI64\n",
    437436                     s->mode, s->count, irq_level, expire_time - now, expire_time, now, s->count_load_time,
    438                      muldiv64(expire_time - s->count_load_time, PIT_FREQ, TMTimerGetFreq(pTimer))));
     437                     ASMMultU64ByU32DivByU32(expire_time - s->count_load_time, PIT_FREQ, TMTimerGetFreq(pTimer))));
    439438        }
    440439        TMTimerSet(s->CTXSUFF(pTimer), s->u64NextTS);
  • trunk/src/VBox/Devices/PC/DevRTC.cpp

    r1384 r1912  
    5252#define LOG_GROUP LOG_GROUP_DEV_RTC
    5353#include <VBox/pdm.h>
    54 
    5554#include <VBox/log.h>
     55#include <iprt/asm.h>
    5656#include <iprt/assert.h>
    5757
     
    163163        freq = TMTimerGetFreq(s->CTXSUFF(pPeriodicTimer));
    164164
    165         cur_clock = muldiv64(current_time, 32768, freq);
     165        cur_clock = ASMMultU64ByU32DivByU32(current_time, 32768, freq);
    166166        next_irq_clock = (cur_clock & ~(uint64_t)(period - 1)) + period;
    167         s->next_periodic_time = muldiv64(next_irq_clock, freq, 32768) + 1;
     167        s->next_periodic_time = ASMMultU64ByU32DivByU32(next_irq_clock, freq, 32768) + 1;
    168168
    169169        /* fiddly bits for dealing with running to keep up and losing interrupts. */
    170         quarter_period_time = muldiv64(period, freq, 32768 * 4);
     170        quarter_period_time = ASMMultU64ByU32DivByU32(period, freq, 32768 * 4);
    171171        now = TMTimerGet(s->CTXSUFF(pPeriodicTimer));
    172172        delta = s->next_periodic_time - now;
  • trunk/src/VBox/Devices/PC/Etherboot-src/Makefile.kmk

    r1846 r1912  
    198198# General rules for compiling/assembling source files.
    199199$(PATH_TARGET)/%.o: core/%.c $(MAKEDEPS)
    200         $(call MSG_L1,Compiling $<,=> $@)
     200        $(call MSG_COMPILE,$@,$<,$@,CC)
    201201        $(QUIET)$(EB_CC) $(EB_CFLAGS) -o $@ -c $<
    202202
    203203$(PATH_TARGET)/%.o: drivers/net/%.c $(MAKEDEPS)
    204         $(call MSG_L1,Compiling $<,=> $@)
     204        $(call MSG_COMPILE,$@,$<,$@,CC)
    205205        $(QUIET)$(EB_CC) $(EB_CFLAGS) -o $@ -c $<
    206206
    207207$(PATH_TARGET)/%.o: arch/$(ARCH)/core/%.c $(MAKEDEPS)
    208         $(call MSG_L1,Compiling $<,=> $@)
     208        $(call MSG_COMPILE,$@,$<,$@,CC)
    209209        $(QUIET)$(EB_CC) $(EB_CFLAGS) -o $@ -c $<
    210210
     
    227227# General rules for generating runtime (rt) files.
    228228$(PATH_TARGET)/%.rt.o: $(PATH_TARGET)/%.o $(START) $(PATH_TARGET)/config.o $(BLIB) $(MAKEDEPS)
     229        $(call MSG_LINK,$@,$@)
    229230        $(call MSG_L1,Linking $@)
    230231        $(QUIET)$(EB_LD) $(EB_LDFLAGS) -r $(START) $(PATH_TARGET)/config.o $< $(BLIB) -o $@
  • trunk/src/VBox/Devices/vl_vbox.h

    r1723 r1912  
    173173 * Misc.
    174174 */
    175 uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c);
    176 
    177175
    178176#ifdef _MSC_VER
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette