/* static */ SysStatusUval SysVSharedMem::ShmGet(sval32 key, uval size, uval flags) { RegionInfo *ri = NULL; uval sid; // get this logic out of the way obj->lock.acquire(); if ((key != IPC_PRIVATE) && (obj->regionsByKey.find(key, ri))) { sid = ri->shmID; } else { sid = 0; } obj->lock.release(); if (ri == NULL) { // Regions does not exist if ((key != IPC_PRIVATE) && !(flags & IPC_CREAT)) { // We are NOT creating return _SERROR(2048, 0, ENOENT); } // Make the Region return MakeRegion(key, size, flags); } else { if (flags & IPC_EXCL) { // require exclusive region return _SERROR(2049, 0, EEXIST); } return _SRETUVAL(sid); } }
Region Reg::MakeRegion() { return MakeRegion(0, 0); }
float GPS_STAIRWAY_START_X = 4277.0; float GPS_STAIRWAY_START_Y = -1500.0; float GPS_STAIRWAY_START_DIRECTION = 180.0; // インコースガレージ・イン開始座標 // ゴール前直線上(階段の直線の延長線と交わる座標) float GPS_GARAGEIN_START_X = 4790.0; float GPS_GARAGEIN_START_Y = -1500.0; float GPS_GARAGEIN_START_DIRECTION = 450.0; // インコースガレージ中心座標 float GPS_GARAGE_X = 4790; float GPS_GARAGE_Y = -870; float GPS_GARAGE_DIRECTION = 450; Region GPS_SEESAW_START = MakeRegion(GPS_SEESAW_START_X, GPS_SEESAW_START_Y + 250.0, GPS_SEESAW_START_X + 500.0, GPS_SEESAW_START_Y - 250.0); Region GPS_STAIRWAY_START = MakeRegion(GPS_STAIRWAY_START_X - 500.0, GPS_STAIRWAY_START_Y + 250.0, GPS_STAIRWAY_START_X, GPS_STAIRWAY_START_Y - 250.0); Region GPS_GARAGEIN_START = MakeRegion(GPS_GARAGEIN_START_X - 250.0, GPS_GARAGEIN_START_Y -500.0,GPS_GARAGEIN_START_X + 250.0, GPS_GARAGEIN_START_Y); #endif #ifdef OUTCOURSE // アウトコーススタート座標 float GPS_COURSE_START_X = 4323.0; float GPS_COURSE_START_Y = -255.0; float GPS_COURSE_START_DIRECTION = 180.0; // ルックアップゲート開始座標 // 中間ゲート float GPS_LOOKUP_START_X = 2934.0; float GPS_LOOKUP_START_Y = -3350.0; float GPS_LOOKUP_START_DIRECTION = 360.0;
/* 1.4 Convert this face to a ~region~ */ Region Face::MakeRegion(bool withholes) { return MakeRegion(0, 0, 1, 1, withholes); }