Changeset 737 for trunk/src/kernel32


Ignore:
Timestamp:
Aug 29, 1999, 4:56:47 PM (26 years ago)
Author:
sandervl
Message:

Interlock apis ported from Wine

Location:
trunk/src/kernel32
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/KERNEL32.CPP

    r705 r737  
    1 /* $Id: KERNEL32.CPP,v 1.18 1999-08-26 12:55:34 sandervl Exp $ */
     1/* $Id: KERNEL32.CPP,v 1.19 1999-08-29 14:56:02 sandervl Exp $ */
    22
    33/*
     
    173173//******************************************************************************
    174174//******************************************************************************
    175 LONG WIN32API InterlockedDecrement(LPLONG lplVal)
    176 {
    177   dprintf(("KERNEL32:  InterlockedDecrement\n"));
    178   return(O32_InterlockedDecrement(lplVal));
    179 }
    180 //******************************************************************************
    181 //******************************************************************************
    182 LONG WIN32API InterlockedIncrement(LPLONG lplVal)
    183 {
    184   dprintf(("KERNEL32:  InterlockedIncrement\n"));
    185   return(O32_InterlockedIncrement(lplVal));
    186 }
    187 //******************************************************************************
    188 //******************************************************************************
    189 LONG WIN32API InterlockedExchange( PLONG arg1, LONG  arg2)
    190 {
    191     dprintf(("KERNEL32:  InterlockedExchange\n"));
    192     return O32_InterlockedExchange(arg1, arg2);
    193 }
    194 
    195 
    196 /************************************************************************
    197  *           InterlockedCompareExchange     [KERNEL32.879]
    198  *
    199  * Atomically compares Destination and Comperand, and if found equal exchanges
    200  * the value of Destination with Exchange
    201  *
    202  * RETURNS
    203  * Prior value of value pointed to by Destination
    204  */
    205 PVOID WIN32API InterlockedCompareExchange(
    206        PVOID *Destination, /* Address of 32-bit value to exchange */
    207        PVOID Exchange,      /* change value, 32 bits */
    208             PVOID Comperand      /* value to compare, 32 bits */
    209 ) {
    210    PVOID ret;
    211    /* StopAllThreadsAndProcesses() */
    212 
    213    ret=*Destination;
    214         if(*Destination==Comperand) *Destination=Exchange;
    215 
    216    /* ResumeAllThreadsAndProcesses() */
    217    return ret;
    218 }
    219 
    220 /************************************************************************
    221  *           InterlockedExchangeAdd            [KERNEL32.880]
    222  *
    223  * Atomically adds Increment to Addend and returns the previous value of
    224  * Addend
    225  *
    226  * RETURNS
    227  * Prior value of value pointed to by cwAddendTarget
    228  */
    229 LONG WIN32API InterlockedExchangeAdd(
    230        PLONG Addend, /* Address of 32-bit value to exchange */
    231        LONG Increment /* Value to add */
    232 ) {
    233    LONG ret;
    234    /* StopAllThreadsAndProcesses() */
    235 
    236    ret = *Addend;
    237    *Addend += Increment;
    238 
    239    /* ResumeAllThreadsAndProcesses() */
    240    return ret;
    241 }
    242 
    243 
    244175//******************************************************************************
    245176//******************************************************************************
  • trunk/src/kernel32/exceptutil.asm

    r620 r737  
    1 ; $Id: exceptutil.asm,v 1.1 1999-08-22 12:55:57 sandervl Exp $
     1; $Id: exceptutil.asm,v 1.2 1999-08-29 14:56:02 sandervl Exp $
    22
    33;/*
     
    1212
    1313CODE32          SEGMENT DWORD PUBLIC USE32 'CODE'
    14                 ASSUME  CS:FLAT ,DS:FLAT,SS:FLAT
    1514        public  RaiseExceptionAsm
    1615        extrn   OS2RAISEEXCEPTION : near
  • trunk/src/kernel32/makefile

    r707 r737  
    1 # $Id: makefile,v 1.35 1999-08-26 15:05:14 sandervl Exp $
     1# $Id: makefile,v 1.36 1999-08-29 14:56:02 sandervl Exp $
    22
    33#
     
    3333 atom.obj disk.obj directory.obj cvtbitmap.obj hmmmap.obj \
    3434 cvtmenu.obj cvtaccel.obj cvticon.obj cvticongrp.obj \
    35  cvtcursor.obj cvtcursorgrp.obj stubs.obj
     35 cvtcursor.obj cvtcursorgrp.obj stubs.obj interlock.obj
    3636
    3737
     
    326326cvtcursorgrp.obj: cvtcursorgrp.cpp $(PDWIN32_INCLUDE)\wincursor.h $(PDWIN32_INCLUDE)\winicon.h $(PDWIN32_INCLUDE)\misc.h cvtresource.h
    327327
     328interlock.obj: interlock.asm
     329
    328330clean:
    329331        $(RM) *.OBJ *.LIB *.dll *~ *.map *.pch
Note: See TracChangeset for help on using the changeset viewer.