Home

Resume

Blog

Teikitu


// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= //
//  »Project«   Teikitu Gaming System (TgS) (∂)
//  »File«      TgS Common - Util MP - Type.h
//  »Author«    Andrew Aye (EMail: mailto:andrew.aye@gmail.com, Web: http://www.andrewaye.com)
//  »Version«   4.0
// ------------------------------------------------------------------------------------------------------------------------------ //
//  Copyright: © 2002-2010, Andrew Aye.  All Rights Reserved.
//  This software is free for non-commercial use. Redistribution and use in source and binary forms, with or without modification,
//  are permitted provided that the following conditions are met: 
//    Redistributions of source code must retain this copyright notice, this list of conditions and the following disclaimers. 
//    Redistributions in binary form must reproduce this copyright notice, this list of conditions and the following
//      disclaimers in the documentation and other materials provided with the distribution. 
//  Neither the names of the copyright owner nor the names of its contributors may be used to endorse or promote products derived
//  from this software without specific prior written permission. 
//  The intellectual property rights of the algorithms used reside with Andrew Aye.  You may not use this software, in whole or
//  in part, in support of any commercial product without the express written consent of the author.
//  There is no warranty or other guarantee of fitness of this software for any purpose. It is provided solely "as is".
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= //
#if !defined(_TGS_COMMON_UTIL_MP_TYPE_H_)
#define _TGS_COMMON_UTIL_MP_TYPE_H_
#pragma once


// -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. //
//  Type Definitions
// -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. //

typedef union TgALIGN(TgCOMPILE_CACHE_LINE_SIZE)
{
    volatile TgATOMIC_PVOID                     p;
    TgSINTPTR                                   i;
#if TgCOMPILE_CACHE_LINE_SIZE > TgCOMPILE_POINTER_SIZE
    TgUINT08                                    m_uiPad[TgCOMPILE_CACHE_LINE_SIZE];
#endif
} STg1_UTM_PVoid;
TgTYPE_PREFIX( STg1_UTM_PVoid );

typedef struct
{
    volatile TgATOMIC_PVOID                     m_pNext_Node;
} STg2_UTM_Element;
TgTYPE_PREFIX( STg2_UTM_Element );

#if TgCOMPILE_64BIT_POINTER
typedef union TgALIGN(16)
{
    struct
    {
    #if TgCOMPILE_LITTLE_ENDIAN
        volatile TgATOMIC_PVOID                     pNode;
        volatile TgATOMIC_INT64                     niVal;
    #else
        volatile TgATOMIC_INT64                     niVal;
        volatile TgATOMIC_PVOID                     pNode;
    #endif // TgCOMPILE_LITTLE_ENDIAN
    }                                           m;
} STg2_UTM_AM_PTR;

#else

typedef union TgALIGN(8)
{
    struct
    {
    #if TgCOMPILE_LITTLE_ENDIAN
        volatile TgATOMIC_PVOID                     pNode;
        volatile TgATOMIC_INT32                     niVal;
    #else
        volatile TgATOMIC_INT32                     niVal;
        volatile TgATOMIC_PVOID                     pNode;
    #endif // TgCOMPILE_LITTLE_ENDIAN
    }                                           m;
    volatile TgATOMIC_INT64                     m_iData;
} STg2_UTM_AM_PTR;
#endif // TgCOMPILE_64BIT_POINTER

#endif //  END  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////