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

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

?? select.cxx

?? Intel XScale PXA255 引導Linux的Redboot 版bootloader源代碼!
?? CXX
字號:
//==========================================================================////      select.cxx////      Fileio select() support////==========================================================================//####COPYRIGHTBEGIN####//                                                                          // -------------------------------------------                              // The contents of this file are subject to the Red Hat eCos Public License // Version 1.1 (the "License"); you may not use this file except in         // compliance with the License.  You may obtain a copy of the License at    // http://www.redhat.com/                                                   //                                                                          // Software distributed under the License is distributed on an "AS IS"      // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the // License for the specific language governing rights and limitations under // the License.                                                             //                                                                          // The Original Code is eCos - Embedded Configurable Operating System,      // released September 30, 1998.                                             //                                                                          // The Initial Developer of the Original Code is Red Hat.                   // Portions created by Red Hat are                                          // Copyright (C) 1998, 1999, 2000 Red Hat, Inc.                             // All Rights Reserved.                                                     // -------------------------------------------                              //                                                                          //####COPYRIGHTEND####//==========================================================================//#####DESCRIPTIONBEGIN####//// Author(s):           nickg// Contributors:        nickg// Date:                2000-05-25// Purpose:             Fileio select() support// Description:         Support for select().//                      //              //              ////####DESCRIPTIONEND####////==========================================================================#include <pkgconf/hal.h>#include <pkgconf/kernel.h>#include <pkgconf/io_fileio.h>#include <cyg/kernel/ktypes.h>         // base kernel types#include <cyg/infra/cyg_trac.h>        // tracing macros#include <cyg/infra/cyg_ass.h>         // assertion macros#include <stdarg.h>                     // for fcntl()#include "fio.h"                       // Private header#include <cyg/kernel/sched.hxx>        // scheduler definitions#include <cyg/kernel/thread.hxx>       // thread definitions#include <cyg/kernel/mutex.hxx>        // mutex definitions#include <cyg/kernel/clock.hxx>        // clock definitions#include <cyg/kernel/sched.inl>#include <cyg/kernel/thread.inl>#include <cyg/kernel/clock.inl>//==========================================================================// File object locking#define LOCK_FILE( fp ) cyg_file_lock( fp )#define UNLOCK_FILE( fp ) cyg_file_unlock( fp )//==========================================================================// Local variables// Mutex for serializing select processing. This essntially controls// access to the contents of the selinfo structures embedded in the// client system data structures.static Cyg_Mutex select_mutex CYGBLD_ATTRIB_INIT_PRI(CYG_INIT_IO);// Condition variable where any thread that is waiting for a select to// fire is suspended. Note that select is not intended to be a real time// operation. Whenever any selectable event occurs, all selecting threads// will be resumed. They must then rescan their selectees and resuspend if// necessary.static Cyg_Condition_Variable selwait( select_mutex ) CYGBLD_ATTRIB_INIT_PRI(CYG_INIT_IO);static volatile cyg_uint32 selwake_count = 0;//==========================================================================// Timeval to ticks conversion support// Converters from sec and us to ticksstatic struct Cyg_Clock::converter us_converter, sec_converter;static cyg_bool converters_initialized = false;externC cyg_tick_count cyg_timeval_to_ticks( const struct timeval *tv ){    if( !converters_initialized )    {        // Create the converters we need.        Cyg_Clock::real_time_clock->get_other_to_clock_converter( 1000, &us_converter );        Cyg_Clock::real_time_clock->get_other_to_clock_converter( 1000000000, &sec_converter );        converters_initialized = true;    }        // Short circuit zero timeval    if( tv->tv_sec == 0 && tv->tv_usec == 0 )    {        return 0;    }            // Convert the seconds field to ticks.    cyg_tick_count ticks = Cyg_Clock::convert( tv->tv_sec, &sec_converter );    // Convert the nanoseconds. This will round down to nearest whole tick.    ticks += Cyg_Clock::convert( (cyg_tick_count)tv->tv_usec, &us_converter );    return ticks;}//==========================================================================// Select API function__externC intselect(int nfd, fd_set *in, fd_set *out, fd_set *ex, struct timeval *tv){    FILEIO_ENTRY();    int error = ENOERR;    int fd, mode, num;    cyg_file *fp;    fd_set in_res, out_res, ex_res;  // Result sets    fd_set *selection[3], *result[3];    cyg_tick_count ticks;    int mode_type[] = {CYG_FREAD, CYG_FWRITE, 0};    cyg_uint32 wake_count;        FD_ZERO(&in_res);    FD_ZERO(&out_res);    FD_ZERO(&ex_res);    // Set up sets    selection[0] = in;   result[0] = &in_res;    selection[1] = out;  result[1] = &out_res;    selection[2] = ex;   result[2] = &ex_res;    // Compute end time    if (tv)        ticks = Cyg_Clock::real_time_clock->current_value() +            cyg_timeval_to_ticks( tv );    else ticks = 0;    // Lock the mutex    select_mutex.lock();    // Scan sets for possible I/O until something found, timeout or error.    while (!error)    {        wake_count = selwake_count;                num = 0;  // Total file descriptors "ready"        for (mode = 0;  !error && mode < 3;  mode++)        {            if (selection[mode]) {                for (fd = 0;  !error && fd < nfd;  fd++)                {                    if (FD_ISSET(fd, selection[mode]))                    {                        fp = cyg_fp_get( fd );                        if( fp == NULL )                        {                            error = EBADF;                            break;                        }                        if ((*fp->f_ops->fo_select)(fp, mode_type[mode], 0))                        {                            FD_SET(fd, result[mode]);                            num++;                        }                        cyg_fp_free( fp );                    }                }            }        }                if (num)        {            // Found something, update user's sets            if (in)  FD_COPY( &in_res, in );            if (out) FD_COPY( &out_res, out );            if (ex)  FD_COPY( &ex_res, ex );            select_mutex.unlock();            FILEIO_RETURN_VALUE(num);        }        Cyg_Scheduler::lock();        if( wake_count == selwake_count )        {            // Nothing found, see if we want to wait            if (tv)            {                if (ticks == 0)                {                    // Special case of "poll"                    select_mutex.unlock();                    Cyg_Scheduler::unlock();                    FILEIO_RETURN_VALUE(0);                }                if( !selwait.wait( ticks ) )                {                    // A non-standard wakeup, if the current time is equal to                    // or past the timeout, return zero. Otherwise return                    // EINTR, since we have been released.                    if( Cyg_Clock::real_time_clock->current_value() >= ticks )                    {                        select_mutex.unlock();                        Cyg_Scheduler::unlock();                        FILEIO_RETURN_VALUE(0);                    }                    else error = EINTR;                }            }            else            {                // Wait forever (until something happens)                            if( !selwait.wait() )                    error = EINTR;            }        }        Cyg_Scheduler::unlock();            } // while(!error)    select_mutex.unlock();     FILEIO_RETURN(error);}//==========================================================================// Select support functions.// -------------------------------------------------------------------------// cyg_selinit() is used to initialize a selinfo structurevoid cyg_selinit( struct CYG_SELINFO_TAG *sip ){    sip->si_info = 0;    sip->si_thread = 0;}// -------------------------------------------------------------------------// cyg_selrecord() is called when a client device needs to register// the current thread for selection.void cyg_selrecord( CYG_ADDRWORD info, struct CYG_SELINFO_TAG *sip ){    sip->si_info = info;    sip->si_thread = (CYG_ADDRESS)Cyg_Thread::self();}// -------------------------------------------------------------------------// cyg_selwakeup() is called when the client device matches the select// criterion, and needs to wake up a selector.void cyg_selwakeup( struct CYG_SELINFO_TAG *sip ){    // We don't actually use the si_info field of selinfo at present.    // A potential use would be to select one of several selwait condition    // variables to signal. However, that would only be necessary if we    // end up having lots of threads in select.    Cyg_Scheduler::lock();     if( sip->si_thread != 0 )    {        // If the thread pointer is still present, this selection has        // not been fired before. We just wake up all threads waiting,        // regardless of whether they are waiting for this event or        // not.  This avoids any race conditions, and is consistent        // with the behaviour of the BSD kernel.                sip->si_thread = 0;        selwait.broadcast();        selwake_count++;    }    Cyg_Scheduler::unlock();    }// -------------------------------------------------------------------------// EOF select.cxx

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产久卡久卡久卡久卡视频精品| 男女性色大片免费观看一区二区| 亚洲男人的天堂av| 日日摸夜夜添夜夜添精品视频 | 亚洲精品国产a| 精品一区二区三区欧美| 91一区二区在线| 国产日本欧美一区二区| 热久久久久久久| 欧美日韩国产123区| 亚洲人成亚洲人成在线观看图片| 精品亚洲成a人| 91精品国产一区二区三区香蕉| 18涩涩午夜精品.www| 国产二区国产一区在线观看| 欧美老肥妇做.爰bbww| 亚洲精品成人精品456| 成年人网站91| 国产欧美一区二区在线观看| 美脚の诱脚舐め脚责91| 555www色欧美视频| 亚洲高清在线精品| 在线日韩国产精品| 亚洲免费观看在线视频| 99精品欧美一区| 综合激情成人伊人| 97久久精品人人做人人爽50路| 国产亚洲欧美在线| 国产精品乡下勾搭老头1| 日韩精品一区二区三区swag | 国产精品色在线| 国产高清久久久| 国产色一区二区| 粉嫩13p一区二区三区| 国产女人18毛片水真多成人如厕| 国产在线国偷精品产拍免费yy| 日韩精品一区二区三区蜜臀| 蜜臀av国产精品久久久久 | 欧美videos中文字幕| 免费成人在线播放| 日韩精品专区在线影院重磅| 精品一区二区三区的国产在线播放| 91精品黄色片免费大全| 免费成人深夜小野草| 精品久久免费看| 不卡的av中国片| 一区二区三区四区不卡在线| 欧美午夜电影在线播放| 日本va欧美va精品发布| 久久久久久99精品| www.欧美色图| 午夜精品福利久久久| 7878成人国产在线观看| 精品无人区卡一卡二卡三乱码免费卡| 久久综合色鬼综合色| 成人黄色免费短视频| 亚洲五月六月丁香激情| 日韩欧美一区在线| 国产99久久久久久免费看农村| 中文字幕在线不卡| 欧美日韩一区精品| 国产精一区二区三区| 一区二区三区在线观看动漫| 制服.丝袜.亚洲.中文.综合| 国产成人免费视频精品含羞草妖精 | 日韩三区在线观看| 国产不卡一区视频| 亚洲国产综合在线| 久久久久久久久久久久久女国产乱 | 免费在线一区观看| 亚洲国产精品精华液ab| 欧美色国产精品| 国产麻豆视频一区二区| 一区二区三区中文字幕精品精品 | 亚洲午夜电影在线| 久久品道一品道久久精品| 99国产精品久久久久久久久久| 日韩专区一卡二卡| 中文字幕一区二区三区四区不卡 | 91网站最新网址| 久久福利视频一区二区| 亚洲乱码中文字幕综合| 亚洲精品一区二区在线观看| 色婷婷国产精品久久包臀| 国模套图日韩精品一区二区| 亚洲久本草在线中文字幕| 精品国产1区二区| 欧美日韩一区久久| 99视频精品免费视频| 久久成人精品无人区| 一区二区三区精品在线| 久久精品一二三| 日韩亚洲欧美中文三级| 色播五月激情综合网| 国产高清不卡一区| 蜜桃视频在线观看一区| 亚洲午夜免费电影| 中文字幕一区二| 久久久久久一级片| 日韩午夜激情视频| 欧美人妇做爰xxxⅹ性高电影| 成人av在线资源网站| 国内精品嫩模私拍在线| 日韩精品高清不卡| 亚洲电影你懂得| 艳妇臀荡乳欲伦亚洲一区| 中文字幕亚洲一区二区av在线| 久久久国产综合精品女国产盗摄| 3751色影院一区二区三区| 91国偷自产一区二区开放时间 | 五月天一区二区三区| 依依成人综合视频| 亚洲欧美欧美一区二区三区| 欧美韩国日本不卡| 欧美高清在线一区二区| 久久久国产精品午夜一区ai换脸| 日韩精品一区二区三区视频播放 | 9色porny自拍视频一区二区| 成人午夜大片免费观看| 成人综合激情网| 成人午夜在线视频| 成人免费电影视频| 成人精品国产一区二区4080| 成人免费高清视频在线观看| 99久久国产免费看| 在线观看日韩高清av| 欧美精品精品一区| 欧美va亚洲va国产综合| 精品1区2区在线观看| 亚洲国产精品精华液ab| 亚洲欧美激情插| 亚洲3atv精品一区二区三区| 免费视频一区二区| 国产高清久久久| 日本高清不卡视频| 欧美一区二区国产| 国产欧美精品一区二区三区四区| 国产精品久久久久久久蜜臀| 亚洲精品欧美二区三区中文字幕| 亚洲成人免费av| 韩国av一区二区三区四区| 成人美女在线观看| 欧美日韩精品欧美日韩精品| 欧美成人国产一区二区| 国产精品久久久久久久第一福利| 亚洲精品乱码久久久久久黑人| 三级一区在线视频先锋| 国产精品正在播放| 欧美中文字幕一二三区视频| 精品久久一区二区三区| 亚洲视频一二三区| 蜜桃精品在线观看| 99久久99久久综合| 欧美成人video| 一区二区三区精品在线| 精品一区二区精品| 色呦呦国产精品| 2021中文字幕一区亚洲| 夜夜精品浪潮av一区二区三区| 久久er99精品| 欧美网站一区二区| 国产喷白浆一区二区三区| 亚洲精品国产第一综合99久久 | 欧美精品一区二区三区很污很色的| 中文字幕一区视频| 久久精工是国产品牌吗| 在线视频欧美精品| 国产欧美日韩精品a在线观看| 天天综合日日夜夜精品| 99在线精品视频| 久久综合九色综合97婷婷女人| 一区二区三区欧美| youjizz久久| 久久精子c满五个校花| 日韩av在线播放中文字幕| 色悠悠久久综合| 中文字幕中文字幕中文字幕亚洲无线| 美女视频免费一区| 精品视频在线免费看| 亚洲免费大片在线观看| 成人国产在线观看| 国产色产综合产在线视频| 九色porny丨国产精品| 欧美福利电影网| 亚洲国产精品久久艾草纯爱| 99精品视频在线观看| 中文无字幕一区二区三区| 国产在线视视频有精品| 日韩精品一区二区三区蜜臀| 丝袜国产日韩另类美女| 色婷婷久久综合| 亚洲精品中文在线影院| av激情亚洲男人天堂| 中文在线一区二区| 高清成人免费视频| 国产精品色婷婷| 成人福利电影精品一区二区在线观看| 久久久久综合网| 国产精品一区二区在线观看不卡 | 免费观看在线色综合|