sc_sys.c

来自「Usb Host/Periphel Control TD1120 codes」· C语言 代码 · 共 64 行

C
64
字号
/*------------------------------------------------------------------------------
$File: //tdi_sw/tdi/source/common/sc_sys.c $
$DateTime: 2004/12/20 19:06:16 $
$Revision: #4 $
Purpose: All abstracted functions for memory alloc/de-alloc, move, set etc.
------------------------------------------------------------------------------*/

/*------------------------------------------------------------------------------
CONFIDENTIAL AND PROPRIETARY INFORMATION OF SOFTCONNEX TECHNOLOGIES, INC.

THIS NOTICE IS NOT TO BE DELETED, MODIFIED, MOVED OR CHANGED IN ANY WAY.

Copyright (c) 1999 - 2004 by SoftConnex Technologies, Inc. 

This software is protected by copyright laws and international copyright 
treaties, as well as other intellectual property laws and treaties.  This
software is a CONFIDENTIAL, unpublished work of authorship, and with portions 
constituting TRADE SECRETS of SoftConnex Technologies, Inc., a Delaware USA 
corporation.  Any unauthorized use, disclosure,	and/or reproduction of this 
software, or any part of this software; or distribution of this software in any 
form or by any means; or storage of this software in any database or retrieval 
system, without the express written consent of, and license from, SoftConnex 
Technologies, Inc. is strictly prohibited.  This software is protected under the
copyright and/or trade secret laws in other countries in addition to USA.  All 
Rights Reserved.  Failure to abide by the use, disclosure and/or reproduction 
restrictions may result in civil and /or criminal penalties, and will be 
prosecuted to the maximum extent of the law.
------------------------------------------------------------------------------*/
#include "sc_types.h"

/*------------------------------------------------------------------------------
Name      : SYS_GetAlignedAddress
Purpose   : Get aligned address of a buffer that was allocated using 
            OS_MallocNoncached.
Arguments : buffer - The memory buffer of which the starting address needs
            to be aligned
            alignmentBytes - byte boundary alignment to be performed on  
Return    : None.
Notes     : None.
------------------------------------------------------------------------------*/
U32 SYS_GetAlignedAddress(void *buffer, U32 alignmentBytes)
   {
   U32 alignedAddress = (U32)buffer;
   
   alignedAddress += (-alignedAddress & (alignmentBytes - 1));
   return (alignedAddress);
   }

   

   

   



   





   

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?