亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? tx_byta.c

?? ThreadX優秀的硬實時操作系統.This Express Start Guide is designed to help you install and use ThreadX for the
?? C
字號:
/**************************************************************************/ 
/*                                                                        */ 
/*            Copyright (c) 1996-2000 by Express Logic Inc.               */ 
/*                                                                        */ 
/*  This software is copyrighted by and is the sole property of Express   */ 
/*  Logic, Inc.  All rights, title, ownership, or other interests         */ 
/*  in the software remain the property of Express Logic, Inc.  This      */ 
/*  software may only be used in accordance with the corresponding        */ 
/*  license agreement.  Any unauthorized use, duplication, transmission,  */ 
/*  distribution, or disclosure of this software is expressly forbidden.  */ 
/*                                                                        */
/*  This Copyright notice may not be removed or modified without prior    */ 
/*  written consent of Express Logic, Inc.                                */ 
/*                                                                        */ 
/*  Express Logic, Inc. reserves the right to modify this software        */ 
/*  without notice.                                                       */ 
/*                                                                        */ 
/*  Express Logic, Inc.                                                   */
/*  11440 West Bernardo Court               info@expresslogic.com         */
/*  Suite 366                               http://www.expresslogic.com   */
/*  San Diego, CA  92127                                                  */
/*                                                                        */
/**************************************************************************/


/**************************************************************************/
/**************************************************************************/
/**                                                                       */ 
/** ThreadX Component                                                     */ 
/**                                                                       */
/**   Byte Memory (BYT)                                                   */
/**                                                                       */
/**************************************************************************/
/**************************************************************************/

#define TX_SOURCE_CODE


/* Include necessary system files.  */

#include    "tx_api.h"
#include    "tx_thr.h"
#include    "tx_tim.h"
#include    "tx_byt.h"


/**************************************************************************/ 
/*                                                                        */ 
/*  FUNCTION                                               RELEASE        */ 
/*                                                                        */ 
/*    _tx_byte_allocate                                   PORTABLE C      */ 
/*                                                           3.0f         */ 
/*  AUTHOR                                                                */ 
/*                                                                        */ 
/*    William E. Lamie, Express Logic, Inc.                               */ 
/*                                                                        */ 
/*  DESCRIPTION                                                           */ 
/*                                                                        */ 
/*    This function allocates bytes from the specified memory byte        */ 
/*    pool.                                                               */ 
/*                                                                        */ 
/*  INPUT                                                                 */ 
/*                                                                        */ 
/*    pool_ptr                          Pointer to pool control block     */ 
/*    memory_ptr                        Pointer to place allocated bytes  */ 
/*                                        pointer                         */
/*    memory_size                       Number of bytes to allocate       */ 
/*    wait_option                       Suspension option                 */ 
/*                                                                        */ 
/*  OUTPUT                                                                */ 
/*                                                                        */ 
/*    status                            Completion status                 */ 
/*                                                                        */ 
/*  CALLS                                                                 */ 
/*                                                                        */ 
/*    _tx_timer_activate                Activate timer routine            */ 
/*    _tx_thread_suspend                Suspend thread service            */ 
/*    _tx_byte_pool_search              Search byte pool for memory       */ 
/*                                                                        */ 
/*  CALLED BY                                                             */ 
/*                                                                        */ 
/*    Application Code                                                    */ 
/*                                                                        */ 
/*  RELEASE HISTORY                                                       */ 
/*                                                                        */ 
/*    DATE              NAME                      DESCRIPTION             */ 
/*                                                                        */ 
/*  12-31-1996     William E. Lamie         Initial Version 3.0           */ 
/*  11-11-1997     Andrea Temple            Added rounding to memory size */ 
/*                                            to ensure ULONG alignment   */ 
/*                                            and modified comments,      */ 
/*                                            resulting in version 3.0b.  */ 
/*  03-01-1998     William E. Lamie         Optimized post RESTORE        */ 
/*                                            processing, resulting in    */ 
/*                                            version 3.0d.               */ 
/*  01-01-1999     William E. Lamie         Modified comment(s),          */ 
/*                                            resulting in version 3.0e.  */ 
/*  11-01-1999     William E. Lamie         Modified comment(s),          */ 
/*                                            added logic to track events,*/ 
/*                                            resulting in version 3.0f.  */ 
/*                                                                        */ 
/**************************************************************************/ 
UINT    _tx_byte_allocate(TX_BYTE_POOL *pool_ptr, VOID **memory_ptr, 
                                    ULONG memory_size,  ULONG wait_option)
{

TX_INTERRUPT_SAVE_AREA

REG_1   UINT        status;                 /* Return status              */
REG_2   TX_THREAD   *thread_ptr;            /* Working thread pointer     */
REG_3   CHAR_PTR    work_ptr;               /* Working byte pointer       */


    /* Pickup the thread pointer.  */
    thread_ptr =  _tx_thread_current_ptr;

    /* Round the memory size up to the next size that is evenly divisable by
       an ULONG.  This guarantees proper alignment.  */
    memory_size = ((memory_size + sizeof(ULONG)-1)/sizeof(ULONG)) * sizeof(ULONG);

    /* Disable interrupts.  */
    TX_DISABLE

    /* Log this kernel call.  */
    TX_EL_BYTE_ALLOCATE_INSERT

    /* Loop to handle cases where the owner of the pool changed.  */
    do
    {

        /* Indicate that this thread is the current owner.  */
        pool_ptr -> tx_byte_pool_owner =  thread_ptr;

        /* Restore interrupts.  */
        TX_RESTORE

        /* At this point, the executing thread owns the pool and can perform a search
           for free memory.  */
        work_ptr =  _tx_byte_pool_search(pool_ptr, memory_size);

        /* Lockout interrupts.  */
        TX_DISABLE

    } while ((!work_ptr) && (pool_ptr -> tx_byte_pool_owner != thread_ptr));

    /* Determine if memory was found.  */
    if (work_ptr)
    {

        /* Copy the pointer into the return destination.  */
        *memory_ptr =  (VOID *) work_ptr;

        /* Set the status to success.  */
        status =  TX_SUCCESS;
    }
    else
    {

        /* No memory of sufficient size was found...  */

        /* Determine if the request specifies suspension.  */
        if (wait_option)
        {

            /* Prepare for suspension of this thread.  */
 
            /* Setup cleanup routine pointer.  */
            thread_ptr -> tx_suspend_cleanup =  _tx_byte_pool_cleanup;

            /* Setup cleanup information, i.e. this pool control
               block.  */
            thread_ptr -> tx_suspend_control_block =  (VOID_PTR) pool_ptr;

            /* Save the return memory pointer address as well.  */
            thread_ptr -> tx_additional_suspend_info =  (VOID_PTR) memory_ptr;

            /* Save the byte size requested.  */
            thread_ptr -> tx_suspend_info =  memory_size;

            /* Setup suspension list.  */
            if (pool_ptr -> tx_byte_pool_suspension_list)
            {

                /* This list is not NULL, add current thread to the end. */
                thread_ptr -> tx_suspended_next =      
                        pool_ptr -> tx_byte_pool_suspension_list;
                thread_ptr -> tx_suspended_previous =  
                        (pool_ptr -> tx_byte_pool_suspension_list) -> tx_suspended_previous;
                ((pool_ptr -> tx_byte_pool_suspension_list) -> tx_suspended_previous) -> tx_suspended_next =  
                        thread_ptr;
                (pool_ptr -> tx_byte_pool_suspension_list) -> tx_suspended_previous =   thread_ptr;
            }
            else
            {

                /* No other threads are suspended.  Setup the head pointer and
                   just setup this threads pointers to itself.  */
                pool_ptr -> tx_byte_pool_suspension_list =  thread_ptr;
                thread_ptr -> tx_suspended_next =           thread_ptr;
                thread_ptr -> tx_suspended_previous =       thread_ptr;
            }

            /* Increment the suspended thread count.  */
            pool_ptr -> tx_byte_pool_suspended_count++;

            /* Set the state to suspended.  */
            thread_ptr -> tx_state =       TX_BYTE_MEMORY;

            /* Set the suspending flag.  */
            thread_ptr -> tx_suspending =  TX_TRUE;

            /* Temporarily disable preemption.  */
            _tx_thread_preempt_disable++;

            /* Save the timeout value.  */
            thread_ptr -> tx_thread_timer.tx_remaining_ticks =  wait_option;

            /* Restore interrupts.  */
            TX_RESTORE

            /* See if we need to start a timer.  */
            if (wait_option != TX_WAIT_FOREVER)
            {

                /* A timeout is required.  */

                /* Activate the thread timer for the timeout.  */
                _tx_timer_activate(&(thread_ptr -> tx_thread_timer));
            }

            /* Call actual thread suspension routine.  */
            _tx_thread_suspend(thread_ptr);

            /* Return the completion status.  */
            return(thread_ptr -> tx_suspend_status);
        }
        else
        {
    
            /* Immediate return, return error completion.  */
            status =  TX_NO_MEMORY;
        }
    }

    /* Restore interrupts.  */
    TX_RESTORE

    /* Return completion status.  */
    return(status);
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩欧美一级二级| 成人av电影在线网| 日韩一区二区三区电影在线观看| 午夜日韩在线电影| 日韩欧美一级精品久久| 国产在线不卡视频| 中文字幕一区二区三区乱码在线| 91老师片黄在线观看| 亚洲一区二区三区视频在线播放 | 欧美一区二区三区视频在线| 日日夜夜一区二区| 久久免费精品国产久精品久久久久| 国产99久久久国产精品免费看| 国产精品久久免费看| 欧美视频一二三区| 韩国精品在线观看| 亚洲精品成人天堂一二三| 亚洲黄网站在线观看| 欧美精品在线视频| 国产高清精品久久久久| 亚洲欧美日韩一区| 欧美刺激午夜性久久久久久久| 国产精品99久久久| 亚洲午夜在线视频| 精品福利一二区| 色婷婷久久综合| 精品一区二区三区免费观看| 国产精品视频麻豆| 欧美一区二区视频观看视频| 成人黄色软件下载| 日本中文一区二区三区| 国产精品每日更新| 欧美一级夜夜爽| 一本大道av一区二区在线播放| 捆绑调教一区二区三区| 一区二区欧美视频| 日本一区二区三区在线观看| 欧美情侣在线播放| 99精品视频中文字幕| 毛片一区二区三区| 亚洲一区二区成人在线观看| 久久久久国产精品麻豆| 欧美日韩国产小视频| 不卡视频免费播放| 国精产品一区一区三区mba桃花| 亚洲一区二三区| 中文在线一区二区| 日韩欧美高清一区| 欧美日韩dvd在线观看| 成人av免费在线观看| 精品中文字幕一区二区| 天堂在线一区二区| 一区二区三区日本| 中文字幕一区二区三区av| 精品福利在线导航| 欧美一级免费大片| 欧美日韩在线播放| 91福利在线播放| av一区二区不卡| 国产又黄又大久久| 久久99精品国产.久久久久| 日日摸夜夜添夜夜添精品视频| 国产精品短视频| 亚洲国产高清不卡| 国产亚洲短视频| 久久精品一区二区三区不卡牛牛| 日韩欧美色综合网站| 欧美一卡2卡三卡4卡5免费| 欧美调教femdomvk| 亚洲女人的天堂| 国产精品欧美极品| 国产精品免费久久| 国产精品福利影院| 中文字幕在线免费不卡| 国产精品视频观看| 中文字幕精品三区| 国产精品美女久久久久久久久| 久久精品人人做人人爽97| 精品对白一区国产伦| 26uuuu精品一区二区| 精品区一区二区| 久久久久国产成人精品亚洲午夜| 欧美va亚洲va在线观看蝴蝶网| 日韩精品在线网站| 久久九九影视网| 国产欧美一区二区精品性| 国产欧美日韩卡一| 亚洲人妖av一区二区| 亚洲日本免费电影| 亚洲成人三级小说| 日产国产高清一区二区三区 | 日本最新不卡在线| 日本va欧美va精品发布| 日本不卡一二三| 国产成人精品亚洲777人妖 | www.亚洲在线| 日本精品一区二区三区高清 | 国产凹凸在线观看一区二区| 成人福利电影精品一区二区在线观看| 99热精品一区二区| 欧美午夜片在线观看| 91精品国产一区二区三区 | 久久久久国产成人精品亚洲午夜| 国产精品伦理一区二区| 亚洲中国最大av网站| 美女网站在线免费欧美精品| 国产成人免费在线视频| 在线观看日产精品| 精品久久一二三区| 亚洲同性gay激情无套| 日欧美一区二区| 成人午夜看片网址| 欧美日韩色综合| 久久精品一区二区三区不卡牛牛| 亚洲免费电影在线| 免费成人av资源网| 91美女片黄在线观看91美女| 欧美日本在线观看| 日本一区二区免费在线观看视频| 亚洲人xxxx| 精彩视频一区二区三区| 91免费观看在线| 精品免费国产二区三区| 亚洲精品免费看| 韩国毛片一区二区三区| 欧美日韩在线直播| 亚洲国产精品99久久久久久久久| 亚洲电影一区二区三区| 国产一区二区三区黄视频| 精品视频一区二区三区免费| 国产网站一区二区三区| 日韩成人午夜精品| 色综合一个色综合亚洲| 久久久噜噜噜久久中文字幕色伊伊| 夜夜亚洲天天久久| 成人精品免费看| 日韩免费一区二区三区在线播放| 亚洲女人小视频在线观看| 国产中文字幕一区| 欧美妇女性影城| 一区二区三区四区乱视频| 欧美电影免费观看高清完整版在线 | 欧美一级在线视频| 亚洲一区在线观看网站| 99久久久久久| 国产日韩综合av| 国模少妇一区二区三区| 日韩亚洲欧美在线观看| 亚洲无人区一区| 91蜜桃视频在线| 亚洲视频免费在线观看| 国产福利一区二区三区视频| 日韩视频免费观看高清在线视频| 亚洲国产va精品久久久不卡综合| 97精品久久久午夜一区二区三区| 日本一区二区三区国色天香| 精品中文字幕一区二区小辣椒| 欧美一区二区三区性视频| 亚洲午夜私人影院| 91小视频在线免费看| 亚洲品质自拍视频| 91免费在线看| 一区二区三区在线视频免费| 91网站黄www| 亚洲精品高清在线观看| 日本高清无吗v一区| 亚洲免费看黄网站| 欧美在线观看禁18| 亚洲妇女屁股眼交7| 欧美高清视频在线高清观看mv色露露十八| 亚洲激情五月婷婷| 欧美三级日韩三级| 午夜影院在线观看欧美| 51精品秘密在线观看| 免费在线欧美视频| 久久综合色综合88| 成人久久视频在线观看| 日韩一区欧美一区| 欧美中文字幕亚洲一区二区va在线| 亚洲自拍与偷拍| 欧美一区二区三区日韩视频| 免费成人结看片| 国产丝袜美腿一区二区三区| 成人美女视频在线看| 亚洲女人的天堂| 欧美精品第1页| 九九国产精品视频| 国产清纯美女被跳蛋高潮一区二区久久w | 国产亚洲欧美中文| 99久久精品免费看国产| 亚洲国产一区二区在线播放| 91精品国产综合久久久久久久久久 | 福利一区在线观看| 亚洲三级久久久| 91精品国产色综合久久ai换脸| 经典一区二区三区| 亚洲女爱视频在线| 日韩欧美在线1卡| 成人性生交大片免费看中文网站| 亚洲男人电影天堂|