linux.cc revision 5543
17754SWilliam.Wang@arm.com/* 27754SWilliam.Wang@arm.com * Copyright (c) 2003-2005 The Regents of The University of Michigan 37754SWilliam.Wang@arm.com * All rights reserved. 47754SWilliam.Wang@arm.com * 57754SWilliam.Wang@arm.com * Redistribution and use in source and binary forms, with or without 67754SWilliam.Wang@arm.com * modification, are permitted provided that the following conditions are 77754SWilliam.Wang@arm.com * met: redistributions of source code must retain the above copyright 87754SWilliam.Wang@arm.com * notice, this list of conditions and the following disclaimer; 97754SWilliam.Wang@arm.com * redistributions in binary form must reproduce the above copyright 107754SWilliam.Wang@arm.com * notice, this list of conditions and the following disclaimer in the 117754SWilliam.Wang@arm.com * documentation and/or other materials provided with the distribution; 127754SWilliam.Wang@arm.com * neither the name of the copyright holders nor the names of its 137754SWilliam.Wang@arm.com * contributors may be used to endorse or promote products derived from 147754SWilliam.Wang@arm.com * this software without specific prior written permission. 157754SWilliam.Wang@arm.com * 167754SWilliam.Wang@arm.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 177754SWilliam.Wang@arm.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 187754SWilliam.Wang@arm.com * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 197754SWilliam.Wang@arm.com * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 207754SWilliam.Wang@arm.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 217754SWilliam.Wang@arm.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 227754SWilliam.Wang@arm.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 237754SWilliam.Wang@arm.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 247754SWilliam.Wang@arm.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 257754SWilliam.Wang@arm.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 267754SWilliam.Wang@arm.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 277754SWilliam.Wang@arm.com * 287754SWilliam.Wang@arm.com * Authors: Korey Sewell 297754SWilliam.Wang@arm.com */ 307754SWilliam.Wang@arm.com 317754SWilliam.Wang@arm.com#include "arch/alpha/linux/linux.hh" 327754SWilliam.Wang@arm.com 337754SWilliam.Wang@arm.com#include <fcntl.h> 347754SWilliam.Wang@arm.com 357754SWilliam.Wang@arm.com// open(2) flags translation table 367754SWilliam.Wang@arm.comOpenFlagTransTable AlphaLinux::openFlagTable[] = { 377754SWilliam.Wang@arm.com#ifdef _MSC_VER 387754SWilliam.Wang@arm.com { AlphaLinux::TGT_O_RDONLY, _O_RDONLY }, 397754SWilliam.Wang@arm.com { AlphaLinux::TGT_O_WRONLY, _O_WRONLY }, 407950SAli.Saidi@ARM.com { AlphaLinux::TGT_O_RDWR, _O_RDWR }, 417950SAli.Saidi@ARM.com { AlphaLinux::TGT_O_APPEND, _O_APPEND }, 427754SWilliam.Wang@arm.com { AlphaLinux::TGT_O_CREAT, _O_CREAT }, 437754SWilliam.Wang@arm.com { AlphaLinux::TGT_O_TRUNC, _O_TRUNC }, 448229Snate@binkert.org { AlphaLinux::TGT_O_EXCL, _O_EXCL }, 457754SWilliam.Wang@arm.com#ifdef _O_NONBLOCK 468245Snate@binkert.org { AlphaLinux::TGT_O_NONBLOCK, _O_NONBLOCK }, 477754SWilliam.Wang@arm.com#endif 487754SWilliam.Wang@arm.com#ifdef _O_NOCTTY 497950SAli.Saidi@ARM.com { AlphaLinux::TGT_O_NOCTTY, _O_NOCTTY }, 507754SWilliam.Wang@arm.com#endif 517754SWilliam.Wang@arm.com#ifdef _O_SYNC 527754SWilliam.Wang@arm.com { AlphaLinux::TGT_O_SYNC, _O_SYNC }, 537754SWilliam.Wang@arm.com#endif 547950SAli.Saidi@ARM.com#else /* !_MSC_VER */ 557950SAli.Saidi@ARM.com { AlphaLinux::TGT_O_RDONLY, O_RDONLY }, 567950SAli.Saidi@ARM.com { AlphaLinux::TGT_O_WRONLY, O_WRONLY }, 577754SWilliam.Wang@arm.com { AlphaLinux::TGT_O_RDWR, O_RDWR }, 587754SWilliam.Wang@arm.com { AlphaLinux::TGT_O_APPEND, O_APPEND }, 597950SAli.Saidi@ARM.com { AlphaLinux::TGT_O_CREAT, O_CREAT }, 607950SAli.Saidi@ARM.com { AlphaLinux::TGT_O_TRUNC, O_TRUNC }, 617950SAli.Saidi@ARM.com { AlphaLinux::TGT_O_EXCL, O_EXCL }, 627950SAli.Saidi@ARM.com { AlphaLinux::TGT_O_NONBLOCK, O_NONBLOCK }, 637950SAli.Saidi@ARM.com { AlphaLinux::TGT_O_NOCTTY, O_NOCTTY }, 647950SAli.Saidi@ARM.com#ifdef O_SYNC 657950SAli.Saidi@ARM.com { AlphaLinux::TGT_O_SYNC, O_SYNC }, 667754SWilliam.Wang@arm.com#endif 677754SWilliam.Wang@arm.com#endif /* _MSC_VER */ 687754SWilliam.Wang@arm.com}; 697754SWilliam.Wang@arm.com 707754SWilliam.Wang@arm.comconst int AlphaLinux::NUM_OPEN_FLAGS = 717754SWilliam.Wang@arm.com (sizeof(AlphaLinux::openFlagTable)/sizeof(AlphaLinux::openFlagTable[0])); 727754SWilliam.Wang@arm.com 737754SWilliam.Wang@arm.com 747754SWilliam.Wang@arm.com 757754SWilliam.Wang@arm.com