max_stars_repo_path
stringlengths
4
261
max_stars_repo_name
stringlengths
6
106
max_stars_count
int64
0
38.8k
id
stringlengths
1
6
text
stringlengths
7
1.05M
tests/rule_simple/17.asm
NullMember/customasm
414
100407
<reponame>NullMember/customasm<filename>tests/rule_simple/17.asm #ruledef test { test => 1 > 2 } test ; error: wrong type
tools-src/gnu/gcc/gcc/ada/5vvaflop.adb
enfoTek/tomato.linksys.e2000.nvram-mod
80
17904
<filename>tools-src/gnu/gcc/gcc/ada/5vvaflop.adb ------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- S Y S T E M . V A X _ F L O A T _ O P E R A T I O N S -- -- -- -- B o d y -- -- -- -- $Revision$ -- -- -- Copyright (C) 1997-2000 Free Software Foundation, Inc. -- -- (Version for Alpha OpenVMS) -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with System.IO; use System.IO; with System.Machine_Code; use System.Machine_Code; package body System.Vax_Float_Operations is -- Ensure this gets compiled with -O to avoid extra (and possibly -- improper) memory stores. pragma Optimize (Time); -- Declare the functions that do the conversions between floating-point -- formats. Call the operands IEEE float so they get passed in -- FP registers. function Cvt_G_T (X : T) return T; function Cvt_T_G (X : T) return T; function Cvt_T_F (X : T) return S; pragma Import (C, Cvt_G_T, "OTS$CVT_FLOAT_G_T"); pragma Import (C, Cvt_T_G, "OTS$CVT_FLOAT_T_G"); pragma Import (C, Cvt_T_F, "OTS$CVT_FLOAT_T_F"); -- In each of the conversion routines that are done with OTS calls, -- we define variables of the corresponding IEEE type so that they are -- passed and kept in the proper register class. ------------ -- D_To_G -- ------------ function D_To_G (X : D) return G is A, B : T; C : G; begin Asm ("ldg %0,%1", T'Asm_Output ("=f", A), D'Asm_Input ("m", X)); Asm ("cvtdg %1,%0", T'Asm_Output ("=f", B), T'Asm_Input ("f", A)); Asm ("stg %1,%0", G'Asm_Output ("=m", C), T'Asm_Input ("f", B)); return C; end D_To_G; ------------ -- F_To_G -- ------------ function F_To_G (X : F) return G is A : T; B : G; begin Asm ("ldf %0,%1", T'Asm_Output ("=f", A), F'Asm_Input ("m", X)); Asm ("stg %1,%0", G'Asm_Output ("=m", B), T'Asm_Input ("f", A)); return B; end F_To_G; ------------ -- F_To_S -- ------------ function F_To_S (X : F) return S is A : T; B : S; begin -- Because converting to a wider FP format is a no-op, we say -- A is 64-bit even though we are loading 32 bits into it. Asm ("ldf %0,%1", T'Asm_Output ("=f", A), F'Asm_Input ("m", X)); B := S (Cvt_G_T (A)); return B; end F_To_S; ------------ -- G_To_D -- ------------ function G_To_D (X : G) return D is A, B : T; C : D; begin Asm ("ldg %0,%1", T'Asm_Output ("=f", A), G'Asm_Input ("m", X)); Asm ("cvtgd %1,%0", T'Asm_Output ("=f", B), T'Asm_Input ("f", A)); Asm ("stg %1,%0", D'Asm_Output ("=m", C), T'Asm_Input ("f", B)); return C; end G_To_D; ------------ -- G_To_F -- ------------ function G_To_F (X : G) return F is A : T; B : S; C : F; begin Asm ("ldg %0,%1", T'Asm_Output ("=f", A), G'Asm_Input ("m", X)); Asm ("cvtgf %1,%0", S'Asm_Output ("=f", B), T'Asm_Input ("f", A)); Asm ("stf %1,%0", F'Asm_Output ("=m", C), S'Asm_Input ("f", B)); return C; end G_To_F; ------------ -- G_To_Q -- ------------ function G_To_Q (X : G) return Q is A : T; B : Q; begin Asm ("ldg %0,%1", T'Asm_Output ("=f", A), G'Asm_Input ("m", X)); Asm ("cvtgq %1,%0", Q'Asm_Output ("=f", B), T'Asm_Input ("f", A)); return B; end G_To_Q; ------------ -- G_To_T -- ------------ function G_To_T (X : G) return T is A, B : T; begin Asm ("ldg %0,%1", T'Asm_Output ("=f", A), G'Asm_Input ("m", X)); B := Cvt_G_T (A); return B; end G_To_T; ------------ -- F_To_Q -- ------------ function F_To_Q (X : F) return Q is begin return G_To_Q (F_To_G (X)); end F_To_Q; ------------ -- Q_To_F -- ------------ function Q_To_F (X : Q) return F is A : S; B : F; begin Asm ("cvtqf %1,%0", S'Asm_Output ("=f", A), Q'Asm_Input ("f", X)); Asm ("stf %1,%0", F'Asm_Output ("=m", B), S'Asm_Input ("f", A)); return B; end Q_To_F; ------------ -- Q_To_G -- ------------ function Q_To_G (X : Q) return G is A : T; B : G; begin Asm ("cvtqg %1,%0", T'Asm_Output ("=f", A), Q'Asm_Input ("f", X)); Asm ("stg %1,%0", G'Asm_Output ("=m", B), T'Asm_Input ("f", A)); return B; end Q_To_G; ------------ -- S_To_F -- ------------ function S_To_F (X : S) return F is A : S; B : F; begin A := Cvt_T_F (T (X)); Asm ("stf %1,%0", F'Asm_Output ("=m", B), S'Asm_Input ("f", A)); return B; end S_To_F; ------------ -- T_To_D -- ------------ function T_To_D (X : T) return D is begin return G_To_D (T_To_G (X)); end T_To_D; ------------ -- T_To_G -- ------------ function T_To_G (X : T) return G is A : T; B : G; begin A := Cvt_T_G (X); Asm ("stg %1,%0", G'Asm_Output ("=m", B), T'Asm_Input ("f", A)); return B; end T_To_G; ----------- -- Abs_F -- ----------- function Abs_F (X : F) return F is A, B : S; C : F; begin Asm ("ldf %0,%1", S'Asm_Output ("=f", A), F'Asm_Input ("m", X)); Asm ("cpys $f31,%1,%0", S'Asm_Output ("=f", B), S'Asm_Input ("f", A)); Asm ("stf %1,%0", F'Asm_Output ("=m", C), S'Asm_Input ("f", B)); return C; end Abs_F; ----------- -- Abs_G -- ----------- function Abs_G (X : G) return G is A, B : T; C : G; begin Asm ("ldg %0,%1", T'Asm_Output ("=f", A), G'Asm_Input ("m", X)); Asm ("cpys $f31,%1,%0", T'Asm_Output ("=f", B), T'Asm_Input ("f", A)); Asm ("stg %1,%0", G'Asm_Output ("=m", C), T'Asm_Input ("f", B)); return C; end Abs_G; ----------- -- Add_F -- ----------- function Add_F (X, Y : F) return F is X1, Y1, R : S; R1 : F; begin Asm ("ldf %0,%1", S'Asm_Output ("=f", X1), F'Asm_Input ("m", X)); Asm ("ldf %0,%1", S'Asm_Output ("=f", Y1), F'Asm_Input ("m", Y)); Asm ("addf %1,%2,%0", S'Asm_Output ("=f", R), (S'Asm_Input ("f", X1), S'Asm_Input ("f", Y1))); Asm ("stf %1,%0", F'Asm_Output ("=m", R1), S'Asm_Input ("f", R)); return R1; end Add_F; ----------- -- Add_G -- ----------- function Add_G (X, Y : G) return G is X1, Y1, R : T; R1 : G; begin Asm ("ldg %0,%1", T'Asm_Output ("=f", X1), G'Asm_Input ("m", X)); Asm ("ldg %0,%1", T'Asm_Output ("=f", Y1), G'Asm_Input ("m", Y)); Asm ("addg %1,%2,%0", T'Asm_Output ("=f", R), (T'Asm_Input ("f", X1), T'Asm_Input ("f", Y1))); Asm ("stg %1,%0", G'Asm_Output ("=m", R1), T'Asm_Input ("f", R)); return R1; end Add_G; -------------------- -- Debug_Output_D -- -------------------- procedure Debug_Output_D (Arg : D) is begin Put (D'Image (Arg)); end Debug_Output_D; -------------------- -- Debug_Output_F -- -------------------- procedure Debug_Output_F (Arg : F) is begin Put (F'Image (Arg)); end Debug_Output_F; -------------------- -- Debug_Output_G -- -------------------- procedure Debug_Output_G (Arg : G) is begin Put (G'Image (Arg)); end Debug_Output_G; -------------------- -- Debug_String_D -- -------------------- Debug_String_Buffer : String (1 .. 32); -- Buffer used by all Debug_String_x routines for returning result function Debug_String_D (Arg : D) return System.Address is Image_String : constant String := D'Image (Arg) & ASCII.NUL; Image_Size : constant Integer := Image_String'Length; begin Debug_String_Buffer (1 .. Image_Size) := Image_String; return Debug_String_Buffer (1)'Address; end Debug_String_D; -------------------- -- Debug_String_F -- -------------------- function Debug_String_F (Arg : F) return System.Address is Image_String : constant String := F'Image (Arg) & ASCII.NUL; Image_Size : constant Integer := Image_String'Length; begin Debug_String_Buffer (1 .. Image_Size) := Image_String; return Debug_String_Buffer (1)'Address; end Debug_String_F; -------------------- -- Debug_String_G -- -------------------- function Debug_String_G (Arg : G) return System.Address is Image_String : constant String := G'Image (Arg) & ASCII.NUL; Image_Size : constant Integer := Image_String'Length; begin Debug_String_Buffer (1 .. Image_Size) := Image_String; return Debug_String_Buffer (1)'Address; end Debug_String_G; ----------- -- Div_F -- ----------- function Div_F (X, Y : F) return F is X1, Y1, R : S; R1 : F; begin Asm ("ldf %0,%1", S'Asm_Output ("=f", X1), F'Asm_Input ("m", X)); Asm ("ldf %0,%1", S'Asm_Output ("=f", Y1), F'Asm_Input ("m", Y)); Asm ("divf %1,%2,%0", S'Asm_Output ("=f", R), (S'Asm_Input ("f", X1), S'Asm_Input ("f", Y1))); Asm ("stf %1,%0", F'Asm_Output ("=m", R1), S'Asm_Input ("f", R)); return R1; end Div_F; ----------- -- Div_G -- ----------- function Div_G (X, Y : G) return G is X1, Y1, R : T; R1 : G; begin Asm ("ldg %0,%1", T'Asm_Output ("=f", X1), G'Asm_Input ("m", X)); Asm ("ldg %0,%1", T'Asm_Output ("=f", Y1), G'Asm_Input ("m", Y)); Asm ("divg %1,%2,%0", T'Asm_Output ("=f", R), (T'Asm_Input ("f", X1), T'Asm_Input ("f", Y1))); Asm ("stg %1,%0", G'Asm_Output ("=m", R1), T'Asm_Input ("f", R)); return R1; end Div_G; ---------- -- Eq_F -- ---------- function Eq_F (X, Y : F) return Boolean is X1, Y1, R : S; begin Asm ("ldf %0,%1", S'Asm_Output ("=f", X1), F'Asm_Input ("m", X)); Asm ("ldf %0,%1", S'Asm_Output ("=f", Y1), F'Asm_Input ("m", Y)); Asm ("cmpgeq %1,%2,%0", S'Asm_Output ("=f", R), (S'Asm_Input ("f", X1), S'Asm_Input ("f", Y1))); return R /= 0.0; end Eq_F; ---------- -- Eq_G -- ---------- function Eq_G (X, Y : G) return Boolean is X1, Y1, R : T; begin Asm ("ldg %0,%1", T'Asm_Output ("=f", X1), G'Asm_Input ("m", X)); Asm ("ldg %0,%1", T'Asm_Output ("=f", Y1), G'Asm_Input ("m", Y)); Asm ("cmpgeq %1,%2,%0", T'Asm_Output ("=f", R), (T'Asm_Input ("f", X1), T'Asm_Input ("f", Y1))); return R /= 0.0; end Eq_G; ---------- -- Le_F -- ---------- function Le_F (X, Y : F) return Boolean is X1, Y1, R : S; begin Asm ("ldf %0,%1", S'Asm_Output ("=f", X1), F'Asm_Input ("m", X)); Asm ("ldf %0,%1", S'Asm_Output ("=f", Y1), F'Asm_Input ("m", Y)); Asm ("cmpgle %1,%2,%0", S'Asm_Output ("=f", R), (S'Asm_Input ("f", X1), S'Asm_Input ("f", Y1))); return R /= 0.0; end Le_F; ---------- -- Le_G -- ---------- function Le_G (X, Y : G) return Boolean is X1, Y1, R : T; begin Asm ("ldg %0,%1", T'Asm_Output ("=f", X1), G'Asm_Input ("m", X)); Asm ("ldg %0,%1", T'Asm_Output ("=f", Y1), G'Asm_Input ("m", Y)); Asm ("cmpgle %1,%2,%0", T'Asm_Output ("=f", R), (T'Asm_Input ("f", X1), T'Asm_Input ("f", Y1))); return R /= 0.0; end Le_G; ---------- -- Lt_F -- ---------- function Lt_F (X, Y : F) return Boolean is X1, Y1, R : S; begin Asm ("ldf %0,%1", S'Asm_Output ("=f", X1), F'Asm_Input ("m", X)); Asm ("ldf %0,%1", S'Asm_Output ("=f", Y1), F'Asm_Input ("m", Y)); Asm ("cmpglt %1,%2,%0", S'Asm_Output ("=f", R), (S'Asm_Input ("f", X1), S'Asm_Input ("f", Y1))); return R /= 0.0; end Lt_F; ---------- -- Lt_G -- ---------- function Lt_G (X, Y : G) return Boolean is X1, Y1, R : T; begin Asm ("ldg %0,%1", T'Asm_Output ("=f", X1), G'Asm_Input ("m", X)); Asm ("ldg %0,%1", T'Asm_Output ("=f", Y1), G'Asm_Input ("m", Y)); Asm ("cmpglt %1,%2,%0", T'Asm_Output ("=f", R), (T'Asm_Input ("f", X1), T'Asm_Input ("f", Y1))); return R /= 0.0; end Lt_G; ----------- -- Mul_F -- ----------- function Mul_F (X, Y : F) return F is X1, Y1, R : S; R1 : F; begin Asm ("ldf %0,%1", S'Asm_Output ("=f", X1), F'Asm_Input ("m", X)); Asm ("ldf %0,%1", S'Asm_Output ("=f", Y1), F'Asm_Input ("m", Y)); Asm ("mulf %1,%2,%0", S'Asm_Output ("=f", R), (S'Asm_Input ("f", X1), S'Asm_Input ("f", Y1))); Asm ("stf %1,%0", F'Asm_Output ("=m", R1), S'Asm_Input ("f", R)); return R1; end Mul_F; ----------- -- Mul_G -- ----------- function Mul_G (X, Y : G) return G is X1, Y1, R : T; R1 : G; begin Asm ("ldg %0,%1", T'Asm_Output ("=f", X1), G'Asm_Input ("m", X)); Asm ("ldg %0,%1", T'Asm_Output ("=f", Y1), G'Asm_Input ("m", Y)); Asm ("mulg %1,%2,%0", T'Asm_Output ("=f", R), (T'Asm_Input ("f", X1), T'Asm_Input ("f", Y1))); Asm ("stg %1,%0", G'Asm_Output ("=m", R1), T'Asm_Input ("f", R)); return R1; end Mul_G; ----------- -- Neg_F -- ----------- function Neg_F (X : F) return F is A, B : S; C : F; begin Asm ("ldf %0,%1", S'Asm_Output ("=f", A), F'Asm_Input ("m", X)); Asm ("cpysn %1,%1,%0", S'Asm_Output ("=f", B), S'Asm_Input ("f", A)); Asm ("stf %1,%0", F'Asm_Output ("=m", C), S'Asm_Input ("f", B)); return C; end Neg_F; ----------- -- Neg_G -- ----------- function Neg_G (X : G) return G is A, B : T; C : G; begin Asm ("ldg %0,%1", T'Asm_Output ("=f", A), G'Asm_Input ("m", X)); Asm ("cpysn %1,%1,%0", T'Asm_Output ("=f", B), T'Asm_Input ("f", A)); Asm ("stg %1,%0", G'Asm_Output ("=m", C), T'Asm_Input ("f", B)); return C; end Neg_G; -------- -- pd -- -------- procedure pd (Arg : D) is begin Put_Line (D'Image (Arg)); end pd; -------- -- pf -- -------- procedure pf (Arg : F) is begin Put_Line (F'Image (Arg)); end pf; -------- -- pg -- -------- procedure pg (Arg : G) is begin Put_Line (G'Image (Arg)); end pg; ----------- -- Sub_F -- ----------- function Sub_F (X, Y : F) return F is X1, Y1, R : S; R1 : F; begin Asm ("ldf %0,%1", S'Asm_Output ("=f", X1), F'Asm_Input ("m", X)); Asm ("ldf %0,%1", S'Asm_Output ("=f", Y1), F'Asm_Input ("m", Y)); Asm ("subf %1,%2,%0", S'Asm_Output ("=f", R), (S'Asm_Input ("f", X1), S'Asm_Input ("f", Y1))); Asm ("stf %1,%0", F'Asm_Output ("=m", R1), S'Asm_Input ("f", R)); return R1; end Sub_F; ----------- -- Sub_G -- ----------- function Sub_G (X, Y : G) return G is X1, Y1, R : T; R1 : G; begin Asm ("ldg %0,%1", T'Asm_Output ("=f", X1), G'Asm_Input ("m", X)); Asm ("ldg %0,%1", T'Asm_Output ("=f", Y1), G'Asm_Input ("m", Y)); Asm ("subg %1,%2,%0", T'Asm_Output ("=f", R), (T'Asm_Input ("f", X1), T'Asm_Input ("f", Y1))); Asm ("stg %1,%0", G'Asm_Output ("=m", R1), T'Asm_Input ("f", R)); return R1; end Sub_G; end System.Vax_Float_Operations;
test/Succeed/builtinInModule.agda
cruhland/agda
1,989
3939
<gh_stars>1000+ module builtinInModule where module Str where postulate S : Set {-# BUILTIN STRING S #-} primitive primStringAppend : S → S → S
projects/07/MemoryAccess/StaticTest/StaticTest.asm
theapi/nand2tetris
0
20845
<filename>projects/07/MemoryAccess/StaticTest/StaticTest.asm // init SP pointing to 256 @256 D=A @SP M=D // init LCL pointing to 300 @300 D=A @LCL M=D // init ARG pointing to 400 @400 D=A @ARG M=D // init THIS pointing to 3000 @3000 D=A @THIS M=D // init THAT pointing to 3010 @3010 D=A @THAT M=D // constant @111 D=A // Store the numeric value in D // PUSH @SP A=M // set the address to where the SP is pointing M=D // store the value in the stack @SP M=M+1 // Advance the stack pointer // constant @333 D=A // Store the numeric value in D // PUSH @SP A=M // set the address to where the SP is pointing M=D // store the value in the stack @SP M=M+1 // Advance the stack pointer // constant @888 D=A // Store the numeric value in D // PUSH @SP A=M // set the address to where the SP is pointing M=D // store the value in the stack @SP M=M+1 // Advance the stack pointer // segment direct @8 D=A // Store the index value in D @StaticTest.8 // set address to StaticTest.8 D=D+A // store the address of StaticTest.8 + index in D @R13 // temp store the address M=D // store the address in R13 // POP @SP M=M-1 // decrement (pop) the stack pointer A=M // set the address to where the SP is pointing D=M // store the value in D @R13 // R13 address A=M // use the value stored in R13 as the next address M=D // store the value at the address // segment direct @3 D=A // Store the index value in D @StaticTest.3 // set address to StaticTest.3 D=D+A // store the address of StaticTest.3 + index in D @R13 // temp store the address M=D // store the address in R13 // POP @SP M=M-1 // decrement (pop) the stack pointer A=M // set the address to where the SP is pointing D=M // store the value in D @R13 // R13 address A=M // use the value stored in R13 as the next address M=D // store the value at the address // segment direct @1 D=A // Store the index value in D @StaticTest.1 // set address to StaticTest.1 D=D+A // store the address of StaticTest.1 + index in D @R13 // temp store the address M=D // store the address in R13 // POP @SP M=M-1 // decrement (pop) the stack pointer A=M // set the address to where the SP is pointing D=M // store the value in D @R13 // R13 address A=M // use the value stored in R13 as the next address M=D // store the value at the address // segment direct @3 D=A // Store the index value in D @StaticTest.3 // set address to StaticTest.3 A=D+A // set the address to be address of StaticTest.3 + index D=M // store the push value in D // PUSH @SP A=M // set the address to where the SP is pointing M=D // store the value in the stack @SP M=M+1 // Advance the stack pointer // segment direct @1 D=A // Store the index value in D @StaticTest.1 // set address to StaticTest.1 A=D+A // set the address to be address of StaticTest.1 + index D=M // store the push value in D // PUSH @SP A=M // set the address to where the SP is pointing M=D // store the value in the stack @SP M=M+1 // Advance the stack pointer // sub // POP @SP M=M-1 // decrement (pop) the stack pointer A=M // set the address to where the SP is pointing D=M // the last entered value // POP @SP M=M-1 // decrement (pop) the stack pointer A=M // set the address to where the SP is pointing D=M-D // x-y // PUSH @SP A=M // set the address to where the SP is pointing M=D // store the value in the stack @SP M=M+1 // Advance the stack pointer // segment direct @8 D=A // Store the index value in D @StaticTest.8 // set address to StaticTest.8 A=D+A // set the address to be address of StaticTest.8 + index D=M // store the push value in D // PUSH @SP A=M // set the address to where the SP is pointing M=D // store the value in the stack @SP M=M+1 // Advance the stack pointer // add // POP @SP M=M-1 // decrement (pop) the stack pointer A=M // set the address to where the SP is pointing D=M // the last entered value // POP @SP M=M-1 // decrement (pop) the stack pointer A=M // set the address to where the SP is pointing D=D+M // x+y // PUSH @SP A=M // set the address to where the SP is pointing M=D // store the value in the stack @SP M=M+1 // Advance the stack pointer
Transynther/x86/_processed/AVXALIGN/_ht_zr_/i7-7700_9_0xca_notsx.log_21829_1082.asm
ljhsiun2/medusa
9
81246
<gh_stars>1-10 .global s_prepare_buffers s_prepare_buffers: push %r11 push %r13 push %r8 push %rcx push %rdi push %rdx push %rsi lea addresses_A_ht+0x37b8, %rsi lea addresses_WT_ht+0x6658, %rdi clflush (%rsi) nop nop nop nop nop sub %r8, %r8 mov $79, %rcx rep movsq nop nop add $36533, %r11 lea addresses_A_ht+0x3bb8, %rdx nop nop nop nop sub %r13, %r13 mov $0x6162636465666768, %rcx movq %rcx, (%rdx) nop nop nop dec %r11 pop %rsi pop %rdx pop %rdi pop %rcx pop %r8 pop %r13 pop %r11 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r13 push %r14 push %r15 push %r9 // Faulty Load lea addresses_D+0x3fb8, %r9 clflush (%r9) nop nop nop sub $21253, %r10 movaps (%r9), %xmm6 vpextrq $1, %xmm6, %r14 lea oracles, %r15 and $0xff, %r14 shlq $12, %r14 mov (%r15,%r14,1), %r14 pop %r9 pop %r15 pop %r14 pop %r13 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'NT': True, 'AVXalign': False, 'size': 2, 'congruent': 0, 'same': True, 'type': 'addresses_D'}, 'OP': 'LOAD'} [Faulty Load] {'src': {'NT': True, 'AVXalign': True, 'size': 16, 'congruent': 0, 'same': True, 'type': 'addresses_D'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'congruent': 11, 'same': False, 'type': 'addresses_A_ht'}, 'dst': {'congruent': 5, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM'} {'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 10, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'STOR'} {'00': 7, '45': 21822} 00 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 00 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 */
src/test_functions.adb
joffreyhuguet/curve25519-spark2014
4
24714
<reponame>joffreyhuguet/curve25519-spark2014 with Types; use Types; with Curve25519_Add; use Curve25519_Add; with Curve25519_Mult; use Curve25519_Mult; with Curve25519_Other_Mult; use Curve25519_Other_Mult; with Ada.Text_IO; use Ada.Text_IO; procedure Test_Functions is begin -- Testing Add pragma Assert (Add ((0, 0, 0, 0, 0, 0, 0, 0, 0, 0), (0, 0, 0, 0, 0, 0, 0, 0, 0, 0)) = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0)); pragma Assert (Add ((94746531, 84168, 3265, 85385, 31543, 18538, 36351, 846, 553, 126805), (0, 0, 0, 0, 0, 0, 0, 0, 0, 0)) = (94746531, 84168, 3265, 85385, 31543, 18538, 36351, 846, 553, 126805)); pragma Assert (Add ((94746531, 84168, 3265 , 85385, 31543, 18538, 36351 , 846 , 553 , 126805), (564854 , 86435, 8641684, 35218, 53197, 94653, 984165, 81384, 93618, 61063)) = (95311385, 170603 , 8644949, 120603, 84740, 113191 , 1020516, 82230 , 94171 , 187868)); -- Testing Multiply pragma Assert (Multiply ((0, 0, 0, 0, 0, 0, 0, 0, 0, 0), (0, 0, 0, 0, 0, 0, 0, 0, 0, 0)) = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)); pragma Assert (Multiply ((1, 0, 0, 0, 0, 0, 0, 0, 0, 0), (0, 0, 0, 0, 0, 0, 0, 0, 0, 0)) = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)); pragma Assert (Multiply ((1, 0, 0, 0, 0, 0, 0, 0, 0, 0), (854651, 54654, 6486, 342, 8946, 8564, 7863, 48964, 786, 54)) = (854651, 54654, 6486, 342, 8946, 8564, 7863, 48964, 786, 54, 0, 0, 0, 0, 0, 0, 0, 0, 0)); pragma Assert (Multiply ((854651 , 54654, 6486, 342 , 8946 , 8564 , 7863 , 48964, 786, 54), (94746531, 84168, 3265, 85385, 31543, 18538, 36351, 846 , 553, 126805)) = (80975217465681, 5250211170642, 626516671325, 106102048195, 883972734101 , 830284653512 , 779819572890, 4643463560012, 85297057072 , 114871856552 , 23128942595 , 2899049302 , 2241403601 , 2941950074 , 2289685357 , 1026772717 , 12418286066 , 99698592 , 13694940)); -- Testing Multiply_1 pragma Assert (Multiply_1 ((0, 0, 0, 0, 0, 0, 0, 0, 0, 0), (0, 0, 0, 0, 0, 0, 0, 0, 0, 0)) = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)); pragma Assert (Multiply_1 ((1, 0, 0, 0, 0, 0, 0, 0, 0, 0), (0, 0, 0, 0, 0, 0, 0, 0, 0, 0)) = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)); pragma Assert (Multiply_1 ((1, 0, 0, 0, 0, 0, 0, 0, 0, 0), (854651, 54654, 6486, 342, 8946, 8564, 7863, 48964, 786, 54)) = (854651, 54654, 6486, 342, 8946, 8564, 7863, 48964, 786, 54, 0, 0, 0, 0, 0, 0, 0, 0, 0)); pragma Assert (Multiply_1 ((854651 , 54654, 6486, 342 , 8946 , 8564 , 7863 , 48964, 786, 54), (94746531, 84168, 3265, 85385, 31543, 18538, 36351, 846 , 553, 126805)) = (80975217465681, 5250211170642, 626516671325, 106102048195, 883972734101 , 830284653512 , 779819572890, 4643463560012, 85297057072 , 114871856552 , 23128942595 , 2899049302 , 2241403601 , 2941950074 , 2289685357 , 1026772717 , 12418286066 , 99698592 , 13694940)); -- Testing Multiply_2 pragma Assert (Multiply_2 ((0, 0, 0, 0, 0, 0, 0, 0, 0, 0), (0, 0, 0, 0, 0, 0, 0, 0, 0, 0)) = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)); pragma Assert (Multiply_2 ((1, 0, 0, 0, 0, 0, 0, 0, 0, 0), (0, 0, 0, 0, 0, 0, 0, 0, 0, 0)) = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)); pragma Assert (Multiply_2 ((1, 0, 0, 0, 0, 0, 0, 0, 0, 0), (854651, 54654, 6486, 342, 8946, 8564, 7863, 48964, 786, 54)) = (854651, 54654, 6486, 342, 8946, 8564, 7863, 48964, 786, 54, 0, 0, 0, 0, 0, 0, 0, 0, 0)); pragma Assert (Multiply_2 ((854651 , 54654, 6486, 342 , 8946 , 8564 , 7863 , 48964, 786, 54), (94746531, 84168, 3265, 85385, 31543, 18538, 36351, 846 , 553, 126805)) = (80975217465681, 5250211170642, 626516671325, 106102048195, 883972734101 , 830284653512 , 779819572890, 4643463560012, 85297057072 , 114871856552 , 23128942595 , 2899049302 , 2241403601 , 2941950074 , 2289685357 , 1026772717 , 12418286066 , 99698592 , 13694940)); Put_Line ("All tests passed successfully."); end Test_Functions;
ugbc/src/hw/6502/number_to_string.asm
Samuel-DEVULDER/ugbasic
0
241268
<gh_stars>0 ; /***************************************************************************** ; * ugBASIC - an isomorphic BASIC language compiler for retrocomputers * ; ***************************************************************************** ; * Copyright 2021 <NAME> (<EMAIL>) ; * ; * 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. ; *---------------------------------------------------------------------------- ; * Concesso in licenza secondo i termini della Licenza Apache, versione 2.0 ; * (la "Licenza"); è proibito usare questo file se non in conformità alla ; * Licenza. Una copia della Licenza è disponibile all'indirizzo: ; * ; * http://www.apache.org/licenses/LICENSE-2.0 ; * ; * Se non richiesto dalla legislazione vigente o concordato per iscritto, ; * il software distribuito nei termini della Licenza è distribuito ; * "COSì COM'è", SENZA GARANZIE O CONDIZIONI DI ALCUN TIPO, esplicite o ; * implicite. Consultare la Licenza per il testo specifico che regola le ; * autorizzazioni e le limitazioni previste dalla medesima. ; ****************************************************************************/ ;* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ;* * ;* CONVERT A NUMBER TO A STRING * ;* * ;* by <NAME> * ;* * ;* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * N2STRING: JSR N2STRINGH2D LDX #9; LDY #0; N2STRINGL1: LDA RESBUFFER,x BNE N2STRINGL2 DEX BNE N2STRINGL1 N2STRINGL2: LDA MATHPTR4 BEQ N2STRINGL2A LDA #'-' STA (TMPPTR),Y INY N2STRINGL2A: LDA RESBUFFER,X ORA #$30 STA (TMPPTR),Y INY DEX BPL N2STRINGL2A JMP N2STRINGEND N2STRINGH2D: LDX #0 N2STRINGL3: JSR N2STRINGDIV10 STA RESBUFFER, X INX CPX #10 BNE N2STRINGL3 RTS N2STRINGDIV10: LDY #32 LDA #0 CLC N2STRINGL4: ROL CMP #10 BCC N2STRINGSSKIP SBC #10 N2STRINGSSKIP: ROL MATHPTR0 ROL MATHPTR1 ROL MATHPTR2 ROL MATHPTR3 DEY BPL N2STRINGL4 RTS N2STRINGEND: TYA STA MATHPTR5 RTS RESBUFFER: .RES 10
Code.g4
dijkstraj/dry-cleaner
0
4253
grammar Code; code: token+; token: IDENTIFIER | STRING | NUMBER; KEYWORD: ('import' | 'from' | 'as' | 'if' | 'else' | 'for' | 'while' | 'class' | 'type' | 'typeof' | 'this' | 'function') -> skip; LINE_COMMENT: '//' ~[\r\n]+ -> skip; BLOCK_COMMENT: '/*' .*? '*/' -> skip; IDENTIFIER: '@'? [a-zA-Z_$][a-zA-Z0-9_$]*; BRACKET: [{}()[\]] -> skip; NUMBER: ('.' [0-9]+) | ([0-9]+ ('.' [0-9]+)?); OPERATOR: ('+' | '.' | '*' | '/' | '-' | '||' | '&&' | '|' | ';' | ':' | ',' | '=' | '!' | '>' | '<') -> skip; STRING: '\'\'' | '\'' ~[']+ '\'' | '`' ~[`]+ '`'; QUESTIONMARK: '?' -> skip; WS: [ \t\r\n]+ -> skip;
test/Fail/GeneralizeRHS.agda
cagix/agda
1,989
1409
-- Andreas, 2021-10-08, first test case for unsupported generalization variable X : Set Y = X -- Expected: -- Generalizable variable GeneralizeRHS.X is not supported here -- when scope checking X
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca.log_13915_1872.asm
ljhsiun2/medusa
9
101798
<filename>Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca.log_13915_1872.asm .global s_prepare_buffers s_prepare_buffers: push %r10 push %r12 push %r13 push %r15 push %r9 push %rax push %rcx push %rdi push %rdx push %rsi lea addresses_WC_ht+0x1768, %rdx nop nop nop cmp %r12, %r12 movups (%rdx), %xmm1 vpextrq $1, %xmm1, %rax add $49750, %r15 lea addresses_WT_ht+0x937a, %r10 nop nop nop nop lfence mov (%r10), %r9 nop cmp $39566, %r12 lea addresses_UC_ht+0x1e77a, %rsi lea addresses_WC_ht+0x8d7a, %rdi nop cmp %r13, %r13 mov $46, %rcx rep movsl nop nop nop dec %rdi pop %rsi pop %rdx pop %rdi pop %rcx pop %rax pop %r9 pop %r15 pop %r13 pop %r12 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r12 push %r13 push %rax push %rcx push %rdi push %rsi // REPMOV lea addresses_normal+0x15e7c, %rsi mov $0x8b4, %rdi nop nop nop and $14018, %r10 mov $121, %rcx rep movsw nop nop add %r13, %r13 // Faulty Load lea addresses_PSE+0xeb7a, %r12 inc %rcx mov (%r12), %r13w lea oracles, %rsi and $0xff, %r13 shlq $12, %r13 mov (%rsi,%r13,1), %r13 pop %rsi pop %rdi pop %rcx pop %rax pop %r13 pop %r12 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_PSE'}, 'OP': 'LOAD'} {'src': {'congruent': 1, 'same': False, 'type': 'addresses_normal'}, 'OP': 'REPM', 'dst': {'congruent': 0, 'same': False, 'type': 'addresses_P'}} [Faulty Load] {'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 2, 'NT': False, 'type': 'addresses_PSE'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'congruent': 1, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 9, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 9, 'same': False, 'type': 'addresses_WC_ht'}} {'33': 13915} 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 */
src/Game.asm
luca1337/Snake_ASM
0
177002
<reponame>luca1337/Snake_ASM include "Hardware.asm" include "Header.asm" ; include "Tank.asm" include "Snake.asm" SECTION "Setup", ROM0[$0100] JP Start SECTION "Main", ROM0[$0150] Start: ei ld sp, $FFFE ; setup stack pointer to the top call TurnOffLcd ; XOR A ; LD [$FF42], A ; LD [$FF43], A ; define the pattern table from the darkest to the lightest ld a, %11100100 ldh [rBGP], a ldh [rOCPD], a ldh [rOBP0], a ldh [rOBP1], a ; clear everything before writing call ClearVram call ClearOam call ClearRam ld hl, _VRAM ; vram is where we write our tiles ld bc, WhiteQuad ld e, $10 call SetTile ld bc, BlackQuad ld e, $10 call SetTile ld bc, Snake_Head ld e, $10 call SetTile ld bc, Snake_Tail ld e, $10 call SetTile ld bc, Map ld de, 1024 ld hl, $9C00 call LoadMap call Snake_Load ;call Dma_Copy ; begin dma copy transfer call TurnOnLCD ; turn back on the lcd call AdjustWindowPosition ; ld hl, 0 GameLoop: call Wait_vBlank ld a, 0 ld [newPosX], a ld bc, newPosX+1 ld [bc], a ld a, 0 ld [newPosY], a ld bc, newPosY+1 ld [bc], a call Get_Tile ld bc, $9C00 scf ccf add hl, bc ld a, [hl] cp $02 jp nz, continue ld [hl], 0 continue: call Snake_Input ;call _HRAM ; call dma subroutine at 0xff80, which then copies the bytes to the OAM and sprites begin to draw jp GameLoop ;----------------- ; subroutines ;---------------- include "Utils.asm" TurnOffLcd: call Wait_vBlank xor a ld [rLCDC], a ret ; -- THIS IS OUR PATTERN TABLE DEFINED ABOVE: ; -- ; -- DB $FF, $FF = darkest color [ ◻ ◻ ◻ ◼ ] ; -- ; -- DB $00, $FF = middle dark color [ ◻ ◻ ◼ ◻ ] ; -- ; -- DB $FF, $00 = middle clear color [ ◻ ◼ ◻ ◻ ] ; -- ; -- DB $00, $00 = lightest color [ ◼ ◻ ◻ ◻ ] ; -- _Palettes_Table_NOCALL EQU $0000000000 BlackQuad: DB $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF Snake_Head: DB $FF,$FF,$81,$81,$81,$81,$99,$99,$99,$99,$81,$81,$81,$81,$FF,$FF Snake_Tail: DB $FF,$FF,$99,$99,$99,$99,$99,$99,$99,$99,$99,$99,$99,$99,$FF,$FF WhiteQuad: DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ; Cross: ; DB $00,$18,$00,$18,$00,$18,$00,$FF,$00,$FF,$00,$18,$00,$18,$00,$18 ; Cross2: ; DB $18,$18,$18,$18,$18,$18,$00,$FF,$00,$FF,$18,$18,$18,$18,$18,$18 ; Cross3: ; DB $FF,$FF,$81,$81,$81,$81,$81,$81,$81,$81,$81,$81,$81,$81,$FF,$FF ; Quad: ; DB $FF,$FF,$81,$81,$81,$81,$81,$81,$81,$81,$81,$81,$81,$81,$FF,$FF ; WhiteQuad: ; DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ; BlackQuad: ; DB $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF ; Tank_left: ; db $00,$00,$03,$03,$03,$03,$03,$03,$03,$03,$03,$03,$03,$03,$1F,$00 ; db $3F,$00,$78,$07,$70,$01,$70,$01,$70,$01,$7F,$00,$3F,$00,$1F,$00 ; Tank_right: ; db $00,$00,$C0,$C0,$C0,$C0,$C0,$C0,$C0,$C0,$C0,$C0,$C0,$C0,$F8,$00 ; db $FC,$00,$1E,$D0,$0E,$F0,$0F,$0F,$0F,$F0,$FE,$00,$FC,$00,$F8,$00 Map: DB 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2 DB 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,2,2,2,2,2,2,2,2,2,2 DB 1,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,2,2,2,2,2,2,2,2,2,2 DB 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,0,1,2,2,2,2,2,2,2,2,2,2,2,2 DB 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,2,2,2,2,2,2,2,2,2,2 DB 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,2,2,2,2,2,2,2,2,2,2 DB 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,2,2,2,2,2,2,2,2,2,2 DB 1,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,1,2,2,2,2,2,2,2,2,2,2,2,2 DB 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,2,2,2,2,2,2,2,2,2,2 DB 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,2,2,2,2,2,2,2,2,2,2 DB 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,2,2,2,2,2,2,2,2,2,2 DB 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,2,2,2,2,2,2,2,2,2,2 DB 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,2,2,2,2,2,2,2,2,2,2 DB 1,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,1,2,2,2,2,2,2,2,2,2,2,2,2 DB 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,2,2,2,2,2,2,2,2,2,2 DB 1,0,0,0,0,0,0,0,2,0,0,0,0,0,0,2,0,0,0,1,2,2,2,2,2,2,2,2,2,2,2,2 DB 1,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,1,2,2,2,2,2,2,2,2,2,2,2,2 DB 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2 DB 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 DB 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 DB 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 DB 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 DB 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 DB 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 DB 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 DB 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 DB 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 DB 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 DB 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 DB 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 DB 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 DB 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 SECTION "RAM", WRAM0[$C000] ; stand here all work ram varibles posX: ds 1 posY: ds 1 newPosX: ds 2 newPosY: ds 2 stack_ptr: ds 2 snake_frames: ds 1 snake_frame_offset: ds 16 tail_cnt: ds 1 Tank_Sprite: ds 4*4 is_pressed: ds 1 player_index: ds 2 SECTION "OAM", WRAM0[$C100] Snake ds 1
oeis/284/A284096.asm
neoneye/loda-programs
11
102463
<filename>oeis/284/A284096.asm<gh_stars>10-100 ; A284096: a(n) is the nearest integer to prime(n)*exp(prime(n)). ; Submitted by <NAME>(s1.) ; 15,60,742,7676,658616,5751374,410634197,3391163718,224130479264,114008694617177,900514339622670,433608267793696618,26233583234732252918,203297097133861902143,12132170565093316762294,5519292499505416532507241,2478714138236403410424390124 seq $0,40 ; The prime numbers. seq $0,58748 ; a(n) = round(n*exp(n)).
experiments/asm-call-c/asm_main.asm
daltonmatos/avrgcc-mixed-with-avrasm2
2
1668
<reponame>daltonmatos/avrgcc-mixed-with-avrasm2<gh_stars>1-10 .org 0x0000 ;_other_routines: ; nop ; This funcions is just a stub. Its implementation will be in C call_me_maybe: nop internal_to_asm: ret asm_main: call internal_to_asm call call_me_maybe ret
src/test/resources/data/generationtests/mdl-safetylabels2-expected.asm
cpcitor/mdlz80optimizer
36
178066
; test to verify the creation of safety labels org #4000 call ___MDL_SAFETY_LABEL_1 jp ___MDL_SAFETY_LABEL_2 nop loop: ___MDL_SAFETY_LABEL_2: jp loop ___MDL_SAFETY_LABEL_1: ret
Cubical/Experiments/NatMinusTwo.agda
dan-iel-lee/cubical
0
6846
{- This type ℕ₋₂ was originally used as the index to n-truncation in order to be consistent with the notation in the HoTT book. However, ℕ was already being used as an analogous index in Foundations.HLevels, and it became clear that having two different indexing schemes for truncation levels was very inconvenient. In the end, having slightly nicer notation was not worth the hassle of having to use this type everywhere where truncation levels were needed. So for this library, use the type `HLevel = ℕ` instead. See the discussions below for more context: - https://github.com/agda/cubical/issues/266 - https://github.com/agda/cubical/pull/238 -} {-# OPTIONS --cubical --no-import-sorts --safe #-} module Cubical.Experiments.NatMinusTwo where open import Cubical.Experiments.NatMinusTwo.Base public open import Cubical.Experiments.NatMinusTwo.Properties public open import Cubical.Experiments.NatMinusTwo.ToNatMinusOne using (1+_; ℕ₋₁→ℕ₋₂; -1+Path) public
RFrontEndSolution/RGrammarParser/RFilter.g4
AlexandrosPlessias/CompilerFrontEndForRLanguage
0
6127
<gh_stars>0 /* [The "BSD licence"] Copyright (c) 2017 <NAME> 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. 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. */ /* Always parse R files with filter before grammar parse. We strip NL inside expressions. */ parser grammar RFilter; options { tokenVocab=R; } stream : (elem|NL|';')* EOF ; eat : (NL {((IWritableToken)$NL).Channel = TokenConstants.HiddenChannel;} )+ ; elem: op eat? | atom | '{' eat? (elem|NL|';')* '}' | '(' (elem|eat)* ')' | '[' (elem|eat)* ']' | '[[' (elem|eat)* ']' ']' | 'function' eat? '(' (elem|eat)* ')' eat? | 'for' eat? '(' (elem|eat)* ')' eat? | 'while' eat? '(' (elem|eat)* ')' eat? | 'if' eat? '(' (elem|eat)* ')' eat? | 'else' eat? { /* 10.4.5 Flow control elements (from R-lang manual) R contains the following control structures as special syntactic constructs if ( cond ) expr if ( cond ) expr1 else expr2 -> The expressions in these constructs will typically be compound expressions. */ /* And the "input" attribute from the abstract class Parser (which your generated parser extends from) now has an underscore ("_input") in front of it. Lt(-2) : Predicates minus 2 positions/tokens from current. */ IWritableToken tok = (IWritableToken) _input.Lt(-2); if ( ((IToken)tok).Type.Equals(NL)) // (if (_input.Lt(-2) == NL) ) tok.Channel= TokenConstants.HiddenChannel; // I set the token's Channel from Default to HiddenChannel. // Anything on different channel than DEFAULT_CHANNEL is not parsed by parser. } ; atom: 'next' | 'break' | ID | STRING | HEX | INT | FLOAT | COMPLEX | 'NULL' | 'NA' | 'NA_integer_' | 'NA_real_' | 'NA_complex_' |'NA_character_'| 'Inf' | 'NaN' | 'TRUE' | 'FALSE' ; op : '+'|'-'|'*'|'/'|'^'|'<'|'<='|'>='|'>'|'=='|'!='|'&'|'&&'|USER_OP| 'repeat'|'in'|'?'|'!'|'='|':'|'~'|'$'|'@'|'<-'|'<<-'|'->'|'->>'|'='|'::'|':::'| ','|'||'| '|' ;
prototyping/FFI/Data/Scientific.agda
TheGreatSageEqualToHeaven/luau
1
3400
module FFI.Data.Scientific where open import Agda.Builtin.Float using (Float) open import FFI.Data.String using (String) open import FFI.Data.HaskellString using (HaskellString; pack; unpack) {-# FOREIGN GHC import qualified Data.Scientific #-} {-# FOREIGN GHC import qualified Text.Show #-} postulate Scientific : Set {-# COMPILE GHC Scientific = type Data.Scientific.Scientific #-} postulate showHaskell : Scientific → HaskellString toFloat : Scientific → Float {-# COMPILE GHC showHaskell = \x -> Text.Show.show x #-} {-# COMPILE GHC toFloat = \x -> Data.Scientific.toRealFloat x #-} show : Scientific → String show x = pack (showHaskell x)
Working Disassembly/General/Sprites/Spiker/Map - Spiker.asm
TeamASM-Blur/Sonic-3-Blue-Balls-Edition
5
2284
Map_361CB8: dc.w Frame_361CC8-Map_361CB8 ; ... dc.w Frame_361CDC-Map_361CB8 dc.w Frame_361CF0-Map_361CB8 dc.w Frame_361D04-Map_361CB8 dc.w Frame_361D0C-Map_361CB8 dc.w Frame_361D14-Map_361CB8 dc.w Frame_361D1C-Map_361CB8 dc.w Frame_361D24-Map_361CB8 Frame_361CC8: dc.w 3 dc.b $E8, 7, 0, 0,$FF,$F0 dc.b $E8, 7, 0, 0, 0, 0 dc.b 8, 4, 0,$17,$FF,$F8 Frame_361CDC: dc.w 3 dc.b $F0, $A, 0, 8,$FF,$E8 dc.b $F0, $A, 8, 8, 0, 0 dc.b 8, 4, 0,$17,$FF,$F8 Frame_361CF0: dc.w 3 dc.b $F8, 9, 0,$11,$FF,$E8 dc.b $F8, 9, 8,$11, 0, 0 dc.b 8, 4, 0,$17,$FF,$F8 Frame_361D04: dc.w 1 dc.b $FC, 4, 0,$19,$FF,$F8 Frame_361D0C: dc.w 1 dc.b $FC, 4, 0,$1B,$FF,$F8 Frame_361D14: dc.w 1 dc.b $FC, 0, 0,$1D,$FF,$FC Frame_361D1C: dc.w 1 dc.b $FC, 0, 0,$1E,$FF,$FC Frame_361D24: dc.w 0
src/bintoasc-base64.adb
jhumphry/Ada_BinToAsc
0
5500
-- BinToAsc.Base64 -- Binary data to ASCII codecs - Base64 codec as in RFC4648 -- Copyright (c) 2015, <NAME> - see LICENSE file for details package body BinToAsc.Base64 is Reverse_Alphabet : constant Reverse_Alphabet_Lookup := Make_Reverse_Alphabet(Alphabet, True); -- -- Base64_To_String -- procedure Reset (C : out Base64_To_String) is begin C := (State => Ready, Next_Index => 0, Buffer => (others => 0)); end Reset; procedure Process (C : in out Base64_To_String; Input : in Bin; Output : out String; Output_Length : out Natural) is begin C.Buffer(C.Next_Index) := Input; if C.Next_Index /= 2 then Output := (others => ' '); Output_Length := 0; C.Next_Index := C.Next_Index + 1; else C.Next_Index := 0; Output := ( Alphabet(C.Buffer(0) / 4), Alphabet((C.Buffer(0) and 2#00000011#) * 16 or C.Buffer(1) / 16), Alphabet((C.Buffer(1) and 2#00001111#) * 4 or C.Buffer(2) / 64), Alphabet(C.Buffer(2) and 2#00111111#), others => ' '); Output_Length := 4; end if; end Process; procedure Process (C : in out Base64_To_String; Input : in Bin_Array; Output : out String; Output_Length : out Natural) is Output_Index : Integer := Output'First; begin for I in Input'Range loop C.Buffer(C.Next_Index) := Input(I); if C.Next_Index /= 2 then C.Next_Index := C.Next_Index + 1; else C.Next_Index := 0; Output (Output_Index .. Output_Index + 3) := ( Alphabet(C.Buffer(0) / 4), Alphabet((C.Buffer(0) and 2#00000011#) * 16 or C.Buffer(1) / 16), Alphabet((C.Buffer(1) and 2#00001111#) * 4 or C.Buffer(2) / 64), Alphabet(C.Buffer(2) and 2#00111111#) ); Output_Index := Output_Index + 4; end if; end loop; Output_Length := Output_Index - Output'First; end Process; procedure Complete (C : in out Base64_To_String; Output : out String; Output_Length : out Natural) is begin C.State := Completed; case C.Next_Index is when 0 => Output := (others => ' '); Output_Length := 0; when 1 => Output := ( Alphabet(C.Buffer(0) / 4), Alphabet((C.Buffer(0) and 2#00000011#) * 16), Padding, Padding, others => ' '); Output_Length := 4; when 2 => Output := ( Alphabet(C.Buffer(0) / 4), Alphabet((C.Buffer(0) and 2#00000011#) * 16 or C.Buffer(1) / 16), Alphabet((C.Buffer(1) and 2#00001111#) * 4), Padding, others => ' '); Output_Length := 4; end case; end Complete; function To_String_Private is new BinToAsc.To_String(Codec => Base64_To_String); function To_String (Input : in Bin_Array) return String renames To_String_Private; -- -- Base64_To_Bin -- procedure Reset (C : out Base64_To_Bin) is begin C := (State => Ready, Next_Index => 0, Buffer => (others => 0), Padding_Length => 0); end Reset; procedure Process (C : in out Base64_To_Bin; Input : in Character; Output : out Bin_Array; Output_Length : out Bin_Array_Index) is Input_Bin : Bin; begin if Input = Padding then Input_Bin := 0; C.Padding_Length := C.Padding_Length + 1; if C.Padding_Length > 2 then -- No reason to ever have more than two padding characters in Base64 -- input C.State := Failed; end if; elsif C.Padding_Length > 0 then -- After the first padding character, only a second padding character -- can be valid C.State := Failed; else Input_Bin := Reverse_Alphabet(Input); if Input_Bin = Invalid_Character_Input then C.State := Failed; end if; end if; if not (C.State = Failed) then C.Buffer(C.Next_Index) := Input_Bin; if C.Next_Index /= 3 then Output := (others => 0); Output_Length := 0; C.Next_Index := C.Next_Index + 1; else C.Next_Index := 0; Output := ( C.Buffer(0) * 4 or C.Buffer(1) / 16, (C.Buffer(1) and 2#001111#) * 16 or C.Buffer(2) / 4, (C.Buffer(2) and 2#000011#) * 64 or C.Buffer(3), others => 0); Output_Length := 3 - C.Padding_Length; end if; else Output := (others => 0); Output_Length := 0; end if; end Process; procedure Process (C : in out Base64_To_Bin; Input : in String; Output : out Bin_Array; Output_Length : out Bin_Array_Index) is Input_Bin : Bin; Output_Index : Bin_Array_Index := Output'First; begin for I in Input'Range loop if Input(I) = Padding then Input_Bin := 0; C.Padding_Length := C.Padding_Length + 1; if C.Padding_Length > 2 then -- No reason to ever have more than two padding characters in -- Base64 input C.State := Failed; exit; end if; elsif C.Padding_Length > 0 then -- After the first padding character, only a second padding -- character can be valid C.State := Failed; exit; else Input_Bin := Reverse_Alphabet(Input(I)); if Input_Bin = Invalid_Character_Input then C.State := Failed; exit; end if; end if; C.Buffer(C.Next_Index) := Input_Bin; if C.Next_Index /= 3 then C.Next_Index := C.Next_Index + 1; else C.Next_Index := 0; Output(Output_Index .. Output_Index + 2) := ( C.Buffer(0) * 4 or C.Buffer(1) / 16, (C.Buffer(1) and 2#001111#) * 16 or C.Buffer(2) / 4, (C.Buffer(2) and 2#000011#) * 64 or C.Buffer(3)); Output_Index := Output_Index + 3; end if; end loop; if C.State = Failed then Output := (others => 0); Output_Length := 0; else Output(Output_Index .. Output'Last) := (others => 0); Output_Length := Bin_Array_Index'Max(0, Output_Index - Output'First - C.Padding_Length); end if; end Process; procedure Complete (C : in out Base64_To_Bin; Output : out Bin_Array; Output_Length : out Bin_Array_Index) is begin if C.Next_Index /= 0 then C.State := Failed; elsif C.State = Ready then C.State := Completed; end if; Output := (others => 0); Output_Length := 0; end Complete; function To_Bin_Private is new BinToAsc.To_Bin(Codec => Base64_To_Bin); function To_Bin (Input : in String) return Bin_Array renames To_Bin_Private; begin -- The following Compile_Time_Error test is silently ignored by GNAT GPL 2015, -- although it does appear to be a static boolean expression as required by -- the user guide. It works if converted to a run-time test so it has been -- left in, in the hope that in a future version of GNAT it will actually be -- tested. pragma Warnings (GNATprove, Off, "Compile_Time_Error"); pragma Compile_Time_Error ((for some X in 1..Alphabet'Last => (for some Y in 0..X-1 => Alphabet(Y) = Alphabet(X) ) ), "Duplicate letter in alphabet for Base64 codec."); pragma Warnings (GNATprove, On, "Compile_Time_Error"); end BinToAsc.Base64;
src/fltk-widgets-progress_bars.ads
micahwelf/FLTK-Ada
1
24675
<reponame>micahwelf/FLTK-Ada<gh_stars>1-10 package FLTK.Widgets.Progress_Bars is type Progress_Bar is new Widget with private; type Progress_Bar_Reference (Data : not null access Progress_Bar'Class) is limited null record with Implicit_Dereference => Data; package Forge is function Create (X, Y, W, H : in Integer; Text : in String) return Progress_Bar; end Forge; function Get_Minimum (This : in Progress_Bar) return Float; procedure Set_Minimum (This : in out Progress_Bar; To : in Float); function Get_Maximum (This : in Progress_Bar) return Float; procedure Set_Maximum (This : in out Progress_Bar; To : in Float); function Get_Value (This : in Progress_Bar) return Float; procedure Set_Value (This : in out Progress_Bar; To : in Float); procedure Draw (This : in out Progress_Bar); function Handle (This : in out Progress_Bar; Event : in Event_Kind) return Event_Outcome; private type Progress_Bar is new Widget with null record; overriding procedure Finalize (This : in out Progress_Bar); pragma Inline (Get_Minimum); pragma Inline (Set_Minimum); pragma Inline (Get_Maximum); pragma Inline (Set_Maximum); pragma Inline (Get_Value); pragma Inline (Set_Value); pragma Inline (Draw); pragma Inline (Handle); end FLTK.Widgets.Progress_Bars;
src/arch/socs/stm32f429/soc-rcc.adb
PThierry/ewok-kernel
0
27847
<filename>src/arch/socs/stm32f429/soc-rcc.adb -- -- Copyright 2018 The wookey project team <<EMAIL>> -- - <NAME> -- - <NAME> -- - <NAME> -- - <NAME> -- - <NAME> -- -- 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. -- -- with ada.unchecked_conversion; with soc.devmap; use soc.devmap; with soc.pwr; with soc.flash; with soc.rcc.default; package body soc.rcc with spark_mode => off is procedure reset is function to_rcc_cfgr is new ada.unchecked_conversion (unsigned_32, t_RCC_CFGR); function to_rcc_pllcfgr is new ada.unchecked_conversion (unsigned_32, t_RCC_PLLCFGR); begin RCC.CR.HSION := true; RCC.CFGR := to_rcc_cfgr (0); RCC.CR.HSEON := false; RCC.CR.CSSON := false; RCC.CR.PLLON := false; -- Magic number. Cf. STM32F4 datasheet RCC.PLLCFGR := to_rcc_pllcfgr (16#2400_3010#); RCC.CR.HSEBYP := false; RCC.CIR := 0; -- Reset all interrupts end reset; procedure init is begin -- Power interface clock enable RCC.APB1ENR.PWREN := true; -- Regulator voltage scaling output selection -- This bit controls the main internal voltage regulator output voltage -- to achieve a trade-off between performance and power consumption when -- the device does not operate at the maximum frequency. soc.pwr.PWR.CR.VOS := soc.pwr.VOS_SCALE1; if default.enable_hse then RCC.CR.HSEON := true; loop exit when RCC.CR.HSERDY; end loop; else -- Enable HSI RCC.CR.HSION := true; loop exit when RCC.CR.HSIRDY; end loop; end if; if default.enable_pll then RCC.CR.PLLON := false; RCC.PLLCFGR := (PLLM => default.PLL_M, -- Division factor for the main PLL PLLN => default.PLL_N, -- Main PLL multiplication factor for VCO PLLP => default.PLL_P, -- Main PLL division factor for main system clock PLLSRC => (if default.enable_hse then 1 else 0), -- HSE or HSI oscillator clock selected as PLL PLLQ => default.PLL_Q); -- Main PLL division factor for USB OTG FS, SDIO and random -- number generator -- Enable the main PLL RCC.CR.PLLON := true; loop exit when RCC.CR.PLLRDY; end loop; end if; -- Configuring flash (prefetch, instruction cache, data cache, wait state) soc.flash.FLASH.ACR.ICEN := true; -- Instruction cache enable soc.flash.FLASH.ACR.DCEN := true; -- Data cache is enabled soc.flash.FLASH.ACR.PRFTEN := false; -- Prefetch is disabled to avoid -- SPA or DPA side channel attacks soc.flash.FLASH.ACR.LATENCY := 5; -- Latency = 5 wait states -- Set clock dividers RCC.CFGR.HPRE := default.AHB_DIV; -- AHB prescaler RCC.CFGR.PPRE1 := default.APB1_DIV; -- APB1 low speed prescaler RCC.CFGR.PPRE2 := default.APB2_DIV; -- APB2 high speed prescaler if default.enable_pll then RCC.CFGR.SW := 2#10#; -- PLL selected as system clock loop exit when RCC.CFGR.SWS = 2#10#; end loop; end if; end init; procedure enable_clock (periph : in soc.devmap.t_periph_id) is begin case periph is when NO_PERIPH => return; when DMA1_INFO .. DMA1_STR7 => soc.rcc.RCC.AHB1ENR.DMA1EN := true; when DMA2_INFO .. DMA2_STR7 => soc.rcc.RCC.AHB1ENR.DMA2EN := true; when CRYP_CFG .. CRYP => soc.rcc.RCC.AHB2ENR.CRYPEN := true; when HASH => soc.rcc.RCC.AHB2ENR.HASHEN := true; when RNG => soc.rcc.RCC.AHB2ENR.RNGEN := true; when USB_OTG_FS => soc.rcc.RCC.AHB2ENR.OTGFSEN := true; when USB_OTG_HS => soc.rcc.RCC.AHB1ENR.OTGHSEN := true; soc.rcc.RCC.AHB1ENR.OTGHSULPIEN := true; when SDIO => soc.rcc.RCC.APB2ENR.SDIOEN := true; when ETH_MAC => soc.rcc.RCC.AHB1ENR.ETHMACEN := true; when CRC => soc.rcc.RCC.AHB1ENR.CRCEN := true; when SPI1 => soc.rcc.RCC.APB2ENR.SPI1EN := true; when SPI2 => soc.rcc.RCC.APB1ENR.SPI2EN := true; when SPI3 => soc.rcc.RCC.APB1ENR.SPI3EN := true; when I2C1 => soc.rcc.RCC.APB1ENR.I2C1EN := true; when I2C2 => soc.rcc.RCC.APB1ENR.I2C2EN := true; when I2C3 => soc.rcc.RCC.APB1ENR.I2C3EN := true; when CAN1 => soc.rcc.RCC.APB1ENR.CAN1EN := true; when CAN2 => soc.rcc.RCC.APB1ENR.CAN2EN := true; when USART1 => soc.rcc.RCC.APB2ENR.USART1EN := true; when USART6 => soc.rcc.RCC.APB2ENR.USART6EN := true; when USART2 => soc.rcc.RCC.APB1ENR.USART2EN := true; when USART3 => soc.rcc.RCC.APB1ENR.USART3EN := true; when UART4 => soc.rcc.RCC.APB1ENR.UART4EN := true; when UART5 => soc.rcc.RCC.APB1ENR.UART5EN := true; when TIM1 => soc.rcc.RCC.APB2ENR.TIM1EN := true; when TIM8 => soc.rcc.RCC.APB2ENR.TIM8EN := true; when TIM9 => soc.rcc.RCC.APB2ENR.TIM9EN := true; when TIM10 => soc.rcc.RCC.APB2ENR.TIM10EN := true; when TIM11 => soc.rcc.RCC.APB2ENR.TIM11EN := true; when TIM2 => soc.rcc.RCC.APB1ENR.TIM2EN := true; when TIM3 => soc.rcc.RCC.APB1ENR.TIM3EN := true; when TIM4 => soc.rcc.RCC.APB1ENR.TIM4EN := true; when TIM5 => soc.rcc.RCC.APB1ENR.TIM5EN := true; when TIM6 => soc.rcc.RCC.APB1ENR.TIM6EN := true; when TIM7 => soc.rcc.RCC.APB1ENR.TIM7EN := true; when TIM12 => soc.rcc.RCC.APB1ENR.TIM12EN := true; when TIM13 => soc.rcc.RCC.APB1ENR.TIM13EN := true; when TIM14 => soc.rcc.RCC.APB1ENR.TIM14EN := true; when FLASH_CTRL .. FLASH_FLOP => null; end case; end enable_clock; end soc.rcc;
libsrc/nc100/txtoutput.asm
meesokim/z88dk
0
91571
<filename>libsrc/nc100/txtoutput.asm PUBLIC txtoutput ; fastcall .txtoutput ld a, l jp 0xB833
src/fot/FOTC/Data/Nat/List/PropertiesATP.agda
asr/fotc
11
9476
------------------------------------------------------------------------------ -- Properties related with lists of natural numbers ------------------------------------------------------------------------------ {-# OPTIONS --exact-split #-} {-# OPTIONS --no-sized-types #-} {-# OPTIONS --no-universe-polymorphism #-} {-# OPTIONS --without-K #-} module FOTC.Data.Nat.List.PropertiesATP where open import FOTC.Base open import FOTC.Base.List open import FOTC.Data.Nat.List open import FOTC.Data.List ------------------------------------------------------------------------------ ++-ListN : ∀ {ms ns} → ListN ms → ListN ns → ListN (ms ++ ns) ++-ListN {ns = ns} lnnil nsL = prf where postulate prf : ListN ([] ++ ns) {-# ATP prove prf #-} ++-ListN {ns = ns} (lncons {m} {ms} Nd LNms) LNns = prf (++-ListN LNms LNns) where postulate prf : ListN (ms ++ ns) → ListN ((m ∷ ms) ++ ns) {-# ATP prove prf #-}
tests/src/text_dirty.adb
Fabien-Chouteau/GESTE
13
11751
<filename>tests/src/text_dirty.adb<gh_stars>10-100 with GESTE; with GESTE.Text; with Ada.Text_IO; with Console_Char_Screen; with GESTE_Fonts.FreeMono8pt7b; procedure Text_Dirty is package Font_A renames GESTE_Fonts.FreeMono8pt7b; package Console_Screen is new Console_Char_Screen (Width => 45, Height => 20, Buffer_Size => 45, Init_Char => ' '); Text_A : aliased GESTE.Text.Instance (Font_A.Font, 4, 1, '#', ' '); procedure Update is begin GESTE.Render_Dirty (Screen_Rect => Console_Screen.Screen_Rect, Background => ' ', Buffer => Console_Screen.Buffer, Push_Pixels => Console_Screen.Push_Pixels'Unrestricted_Access, Set_Drawing_Area => Console_Screen.Set_Drawing_Area'Unrestricted_Access); Console_Screen.Print; Ada.Text_IO.New_Line; end Update; begin Console_Screen.Verbose; Text_A.Put ("test"); Text_A.Move ((0, 0)); GESTE.Add (Text_A'Unrestricted_Access, 0); GESTE.Render_Window (Window => Console_Screen.Screen_Rect, Background => ' ', Buffer => Console_Screen.Buffer, Push_Pixels => Console_Screen.Push_Pixels'Unrestricted_Access, Set_Drawing_Area => Console_Screen.Set_Drawing_Area'Unrestricted_Access); Console_Screen.Print; Ada.Text_IO.New_Line; Update; -- Check that inverting a char triggers a re-draw Text_A.Invert (2, 1); Update; -- Check that changing a char triggers a re-draw Text_A.Cursor (3, 1); Text_A.Put ('O'); Update; -- Check that changing colors triggers a re-draw Text_A.Set_Colors (4, 1, '_', ' '); Update; -- Check that clearing text triggers a re-draw Text_A.Clear; Update; end Text_Dirty;
libsrc/_DEVELOPMENT/network/arpa/c/sdcc_iy/ntohl.asm
jpoikela/z88dk
640
11652
; uint32_t ntohl(uint32_t) SECTION code_clib SECTION code_network PUBLIC _ntohl EXTERN _htonl defc _ntohl = _htonl
src/tools/Dependency_Graph_Extractor/src/extraction-node_edge_types.adb
selroc/Renaissance-Ada
1
8138
with Ada.Characters.Handling; with GNATCOLL.VFS_Utils; with Langkit_Support.Slocs; with Langkit_Support.Text; package body Extraction.Node_Edge_Types is use type LALCO.Ada_Node_Kind_Type; use type VFS.Filesystem_String; use type VFS.Virtual_File; Decl_Name_Prefix : constant String := "decl:"; Dir_Name_Prefix : constant String := "dir:"; File_Name_Prefix : constant String := "file:"; Proj_Name_Prefix : constant String := "proj:"; Filenames_Are_Case_Insensitive : constant Boolean := not GNATCOLL.VFS_Utils.Local_Host_Is_Case_Sensitive; function Encode(Text : Langkit_Support.Text.Text_Type) return String is (Langkit_Support.Text.To_UTF8(Text)); function Encode(Sloc_Range : Langkit_Support.Slocs.Source_Location_Range) return String is (Langkit_Support.Slocs.Image(Sloc_Range)); function Encode(Value : Boolean) return String is (if Value then "true" else "false"); function Get_Node_Name (File : VFS.Virtual_File; Directory_Prefix : VFS.Virtual_File) return String is Filename : constant String := Utilities.Get_Unique_Filename(File, Directory_Prefix, Make_Lower_Case => Filenames_Are_Case_Insensitive); begin if File.Is_Directory then return Dir_Name_Prefix & Filename; else return File_Name_Prefix & Filename; end if; end Get_Node_Name; function Get_Node_Name (Project : GPR.Project_Type; Directory_Prefix : VFS.Virtual_File) return String is Filename : constant String := Utilities.Get_Unique_Filename(Project.Project_Path, Directory_Prefix, Make_Lower_Case => Filenames_Are_Case_Insensitive); Name : constant String := Project.Name; begin return Proj_Name_Prefix & Filename & ":" & Name; end Get_Node_Name; function Get_Node_Name (Analysis_Unit : LAL.Analysis_Unit; Directory_Prefix : VFS.Virtual_File) return String is Filename : constant String := Utilities.Get_Unique_Filename(Analysis_Unit.Get_Filename, Directory_Prefix, Make_Lower_Case => Filenames_Are_Case_Insensitive); begin return File_Name_Prefix & Filename; end Get_Node_Name; function Get_Node_Name (Defining_Name : LAL.Defining_Name; Basic_Decl : LAL.Basic_Decl'Class; Directory_Prefix : VFS.Virtual_File) return String is Filename : constant String := Utilities.Get_Unique_Filename(Defining_Name.Unit.Get_Filename, Directory_Prefix, Make_Lower_Case => Filenames_Are_Case_Insensitive); Name : constant String := Encode(Defining_Name.P_Relative_Name.Text); Sloc_Range : constant String := Encode(Basic_Decl.Sloc_Range); begin return Decl_Name_Prefix & Filename & ":" & Name & "[" & Sloc_Range & "]"; end Get_Node_Name; function Node_Attributes return GW.Attribute_Definition_Sets.Map is begin return Attributes : GW.Attribute_Definition_Sets.Map do Attributes.Insert(Node_Attribute_Fully_Qualified_Name, GW.GraphML_String); Attributes.Insert(Node_Attribute_Is_Formal_Parameter, GW.GraphML_Boolean); Attributes.Insert(Node_Attribute_Is_Main_Program, GW.GraphML_Boolean); Attributes.Insert(Node_Attribute_Relative_Name, GW.GraphML_String); Attributes.Insert(Node_Attribute_Source_Location, GW.GraphML_String); end return; end Node_Attributes; function Get_Node_Attributes (File : VFS.Virtual_File; Directory_Prefix : VFS.Virtual_File) return GW.Attribute_Value_Sets.Map is -- Note that in the case of the fully quantified and relative names, we -- keep the original casing to keep the names as readable as possible. -- This differs from the behavior in the case of node names, where we -- normalize the casing depending on the case-sensitivity of file system -- to ensure that we do not get dupicate nodes on case-insensitive file -- systems due to file names having different casings in different parts -- of a codebase. As Extraction.Extract_Dependency_Graph first iterates -- over the file system to create nodes for all files and directories, it -- is ensured, via the implementation of Extraction.File_System, that the -- fully quantified and relative names that end up in our graph have -- casings that match the on-disk ones. Fully_Qualified_Name : constant SU.Unbounded_String := +Utilities.Get_Unique_Filename(File, Directory_Prefix, Make_Lower_Case => False); Relative_Name : constant SU.Unbounded_String := +(+File.Base_Dir_Name); begin return Attributes : GW.Attribute_Value_Sets.Map do Attributes.Insert(Node_Attribute_Fully_Qualified_Name, Fully_Qualified_Name); Attributes.Insert(Node_Attribute_Relative_Name, Relative_Name); end return; end Get_Node_Attributes; function Get_Node_Attributes (Project : GPR.Project_Type) return GW.Attribute_Value_Sets.Map is Fully_Qualified_Name : constant SU.Unbounded_String := +Project.Name; Relative_Name : constant SU.Unbounded_String := +Project.Name; begin return Attributes : GW.Attribute_Value_Sets.Map do Attributes.Insert(Node_Attribute_Fully_Qualified_Name, Fully_Qualified_Name); Attributes.Insert(Node_Attribute_Relative_Name, Relative_Name); end return; end Get_Node_Attributes; function Get_Node_Attributes (Defining_Name : LAL.Defining_Name; Basic_Decl : LAL.Basic_Decl; Context : Utilities.Project_Context) return GW.Attribute_Value_Sets.Map is Uninstantiated_Defining_Name : constant LAL.Defining_Name := Defining_Name.P_Get_Uninstantiated_Node.As_Defining_Name; Uninstantiated_Basic_Decl : constant LAL.Basic_Decl := Basic_Decl.P_Get_Uninstantiated_Node.As_Basic_Decl; Fully_Qualified_Name : constant String := Encode(Uninstantiated_Defining_Name.P_Fully_Qualified_Name); Is_Formal_Parameter : constant String := Encode(Uninstantiated_Basic_Decl.P_Is_Formal); Is_Main_Subprogram : constant String := Encode(Utilities.Is_Project_Main_Program(Uninstantiated_Basic_Decl, Context)); Relative_Name : constant String := Encode(Uninstantiated_Defining_Name.P_Relative_Name.Text); Sloc_Range : constant String := Encode(Uninstantiated_Basic_Decl.Sloc_Range); begin return Attributes : GW.Attribute_Value_Sets.Map do Attributes.Insert(Node_Attribute_Fully_Qualified_Name, +Fully_Qualified_Name); Attributes.Insert(Node_Attribute_Is_Formal_Parameter, +Is_Formal_Parameter); Attributes.Insert(Node_Attribute_Relative_Name, +Relative_Name); Attributes.Insert(Node_Attribute_Source_Location, +Sloc_Range); if Basic_Decl.P_Is_Subprogram then Attributes.Insert(Node_Attribute_Is_Main_Program, +Is_Main_Subprogram); end if; end return; end Get_Node_Attributes; function Get_File_Subtype(File : VFS.Virtual_File) return GW.Node_Subtype is Extension : constant String := Ada.Characters.Handling.To_Lower(+File.File_Extension); begin if File = Utilities.Standard_Unit_File then return Node_Type_Ada_Specification_File; elsif Extension = ".adb" then return Node_Type_Ada_Body_File; elsif Extension = ".ads" then return Node_Type_Ada_Specification_File; elsif Extension = ".c" then return Node_Type_C_Source_File; elsif Extension = ".gpr" then return Node_Type_Gnat_Project_File; elsif Extension = ".h" then return Node_Type_C_Header_File; else return Node_Type_Unknown_File_Type; end if; end Get_File_Subtype; function Get_Decl_Subtype(Decl : LAL.Basic_Decl) return GW.Node_Subtype is begin case LALCO.Ada_Basic_Decl(Decl.Kind) is -- Components. when LALCO.Ada_Component_Decl => return Node_Type_Ada_Component_Declaration; -- Discriminants. when LALCO.Ada_Discriminant_Spec => return Node_Type_Ada_Discriminant_Declaration; -- Exceptions. when LALCO.Ada_Exception_Decl => return Node_Type_Ada_Exception_Declaration; -- Numbers. when LALCO.Ada_Number_Decl => return Node_Type_Ada_Number_Declaration; -- Objects. when LALCO.Ada_Object_Decl => return Node_Type_Ada_Object_Declaration; -- Packages. when LALCO.Ada_Package_Decl | LALCO.Ada_Package_Body_Stub | LALCO.Ada_Package_Body | LALCO.Ada_Package_Renaming_Decl | LALCO.Ada_Generic_Package_Decl | LALCO.Ada_Generic_Package_Instantiation | LALCO.Ada_Generic_Package_Renaming_Decl => return Node_Type_Ada_Package_Declaration; -- Protected. when LALCO.Ada_Protected_Type_Decl | LALCO.Ada_Protected_Body_Stub | LALCO.Ada_Protected_Body | LALCO.Ada_Single_Protected_Decl => return Node_Type_Ada_Protected_Declaration; -- Subprograms. when LALCO.Ada_Abstract_Subp_Decl | LALCO.Ada_Subp_Decl | LALCO.Ada_Expr_Function | LALCO.Ada_Null_Subp_Decl | LALCO.Ada_Subp_Body | LALCO.Ada_Subp_Renaming_Decl | LALCO.Ada_Subp_Body_Stub | LALCO.Ada_Generic_Subp_Decl | LALCO.Ada_Generic_Subp_Instantiation | LALCO.Ada_Generic_Subp_Renaming_Decl | LALCO.Ada_Abstract_Formal_Subp_Decl | LALCO.Ada_Concrete_Formal_Subp_Decl => return Node_Type_Ada_Subprogram_Declaration; when LALCO.Ada_Entry_Decl | LALCO.Ada_Entry_Body => return Node_Type_Ada_Entry_Declaration; when LALCO.Ada_Enum_Literal_Decl => return Node_Type_Ada_Enum_Literal_Declaration; -- Tasks. when LALCO.Ada_Task_Type_Decl | LALCO.Ada_Task_Body_Stub | LALCO.Ada_Task_Body | LALCO.Ada_Single_Task_Decl => return Node_Type_Ada_Task_Declaration; -- Types. when LALCO.Ada_Type_Decl | LALCO.Ada_Subtype_Decl | LALCO.Ada_Incomplete_Type_Decl | LALCO.Ada_Incomplete_Tagged_Type_Decl => return Node_Type_Ada_Type_Declaration; when others => raise Internal_Extraction_Error with "Unhandled basic declaration: " & Decl.Kind'Image; end case; end Get_Decl_Subtype; function Edge_Attributes return GW.Attribute_Definition_Sets.Map is begin return Attributes : GW.Attribute_Definition_Sets.Map do Attributes.Insert(Edge_Attribute_Has_Access_Type, GW.GraphML_Boolean); Attributes.Insert(Edge_Attribute_Has_Array_Type, GW.GraphML_Boolean); Attributes.Insert(Edge_Attribute_Is_Dispatching, GW.GraphML_Boolean); end return; end Edge_Attributes; function Get_Edge_Attributes (Expr : LAL.Expr'Class) return GW.Attribute_Value_Sets.Map is Is_Dispatching : constant String := Encode(Expr.P_Is_Dispatching_Call); begin return Attributes : GW.Attribute_Value_Sets.Map do Attributes.Insert(Edge_Attribute_Is_Dispatching, +Is_Dispatching); end return; end Get_Edge_Attributes; function Get_Edge_Attributes (Type_Expr : LAL.Type_Expr'Class; Can_Have_Array_Type : Boolean) return GW.Attribute_Value_Sets.Map is Has_Access_Type : Boolean := False; Has_Array_Type : Boolean := False; procedure Get_Attribute_Values(Type_Def : LAL.Type_Def); procedure Get_Attribute_Values(Type_Expr : LAL.Type_Expr'Class) is begin if Type_Expr.Kind = LALCO.Ada_Anonymous_Type then Get_Attribute_Values(Type_Expr.As_Anonymous_Type.F_Type_Decl.F_Type_Def); end if; end Get_Attribute_Values; procedure Get_Attribute_Values(Type_Def : LAL.Type_Def) is begin if Type_Def.Kind = LALCO.Ada_Array_Type_Def then Has_Array_Type := True; Get_Attribute_Values(Type_Def.As_Array_Type_Def.F_Component_Type.F_Type_Expr); elsif Type_Def.Kind = LALCO.Ada_Type_Access_Def then Has_Access_Type := True; Get_Attribute_Values(Type_Def.As_Type_Access_Def.F_Subtype_Indication); end if; end Get_Attribute_Values; begin Get_Attribute_Values(Type_Expr); return Attributes : GW.Attribute_Value_Sets.Map do Attributes.Insert(Edge_Attribute_Has_Access_Type, +Encode(Has_Access_Type)); if Can_Have_Array_Type then Attributes.Insert(Edge_Attribute_Has_Array_Type, +Encode(Has_Array_Type)); elsif Has_Array_Type then raise Internal_Extraction_Error with "Unexpected Has_Array_Type in Get_Edge_Attributes"; end if; end return; end Get_Edge_Attributes; end Extraction.Node_Edge_Types;
test/Compiler/with-stdlib/Vec.agda
guilhermehas/agda
0
7306
<reponame>guilhermehas/agda<filename>test/Compiler/with-stdlib/Vec.agda -- Written by <NAME> module Vec where open import IO open import Data.Vec open import Data.Nat open import Data.Nat.Show open import Level using (0ℓ) Matrix : Set -> ℕ -> ℕ -> Set Matrix a n m = Vec (Vec a m) n madd : {n m : ℕ} -> Matrix ℕ m n -> Matrix ℕ m n -> Matrix ℕ m n madd a b = map (λ x → \y -> map _+_ x ⊛ y) a ⊛ b idMatrix : {n : ℕ} -> Matrix ℕ n n idMatrix {zero} = [] idMatrix {suc n} = (1 ∷ (replicate zero)) ∷ (map (λ x → zero ∷ x) idMatrix) transposeM : {n m : ℕ} {a : Set} -> Matrix a m n -> Matrix a n m transposeM {zero} {zero} a₁ = [] transposeM {zero} {suc m} {a} x = [] transposeM {suc n} {zero} a₁ = replicate [] transposeM {suc n} {suc m} {a} (_∷_ x₁ x₂) with map head (x₁ ∷ x₂) ... | vm = vm ∷ (map _∷_ (tail x₁) ⊛ transposeM (map tail x₂)) -- We use quite small numbers right now, as with big number the computation -- gets very slow (at least in MAlonzo) -- correct result : 109 compute : ℕ compute = sum (map sum g) where m : Matrix ℕ 3 3 m = (3 ∷ 5 ∷ 9 ∷ []) ∷ (12 ∷ 0 ∷ 7 ∷ []) ∷ (11 ∷ 2 ∷ 4 ∷ []) ∷ [] g : Matrix ℕ 3 3 g = madd (transposeM (transposeM m)) (transposeM (madd m idMatrix)) main = run {0ℓ} (putStrLn (show compute))
oeis/011/A011924.asm
neoneye/loda-programs
11
105087
<filename>oeis/011/A011924.asm<gh_stars>10-100 ; A011924: Floor[n(n-1)(n-2)(n-3)/14]. ; 0,0,0,0,1,8,25,60,120,216,360,565,848,1225,1716,2340,3120,4080,5245,6644,8305,10260,12540,15180,18216,21685,25628,30085,35100,40716,46980,53940,61645,70148,79501,89760,100980,113220,126540,141001,156668,173605,191880,211560,232716,255420,279745,305768,333565,363216,394800,428400,464100,501985,542144,584665,629640,677160,727320,780216,835945,894608,956305,1021140,1089216,1160640,1235520,1313965,1396088,1482001,1571820,1665660,1763640,1865880,1972501,2083628,2199385,2319900,2445300,2575716 bin $0,4 mul $0,24 div $0,14
source/regions/regions-symbols.ads
reznikmm/declarative-regions
0
29202
-- SPDX-FileCopyrightText: 2021 <NAME> <<EMAIL>> -- -- SPDX-License-Identifier: MIT ------------------------------------------------------------- package Regions.Symbols is pragma Pure; type Symbol is mod 2 ** 32; -- Symbol is case-insensitive representation of identifiers, operators -- and character literals end Regions.Symbols;
source/web/tools/a2js/webapi/dom/webapi-dom-nodes.ads
svn2github/matreshka
24
15166
<filename>source/web/tools/a2js/webapi/dom/webapi-dom-nodes.ads ------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Web Framework -- -- -- -- Web API Definition -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014-2015, <NAME> <<EMAIL>> -- -- 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 the Vadim Godunko, IE 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 -- -- 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. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This package provides binding to interface Node. ------------------------------------------------------------------------------ limited with WebAPI.DOM.Documents; limited with WebAPI.DOM.Elements; with WebAPI.DOM.Event_Targets; limited with WebAPI.DOM.Node_Lists; package WebAPI.DOM.Nodes is pragma Preelaborate; type Node is limited interface and WebAPI.DOM.Event_Targets.Event_Target; type Node_Access is access all Node'Class with Storage_Size => 0; -- XXX Not binded yet: -- const unsigned short ELEMENT_NODE = 1; -- const unsigned short ATTRIBUTE_NODE = 2; // historical -- const unsigned short TEXT_NODE = 3; -- const unsigned short CDATA_SECTION_NODE = 4; // historical -- const unsigned short ENTITY_REFERENCE_NODE = 5; // historical -- const unsigned short ENTITY_NODE = 6; // historical -- const unsigned short PROCESSING_INSTRUCTION_NODE = 7; -- const unsigned short COMMENT_NODE = 8; -- const unsigned short DOCUMENT_NODE = 9; -- const unsigned short DOCUMENT_TYPE_NODE = 10; -- const unsigned short DOCUMENT_FRAGMENT_NODE = 11; -- const unsigned short NOTATION_NODE = 12; // historical -- readonly attribute unsigned short nodeType; not overriding function Get_Node_Name (Self : not null access constant Node) return WebAPI.DOM_String is abstract with Import => True, Convention => JavaScript_Property_Getter, Link_Name => "nodeName"; -- Returns a string appropriate for the type of node, as follows: -- -- Element -- Its tagName attribute value. -- Text -- "#text". -- ProcessingInstruction -- Its target. -- Comment -- "#comment". -- Document -- "#document". -- DocumentType -- Its name. -- DocumentFragment -- "#document-fragment". not overriding function Get_Base_URI (Self : not null access constant Node) return WebAPI.DOM_String is abstract with Import => True, Convention => JavaScript_Property_Getter, Link_Name => "baseURI"; -- Returns the base URL. not overriding function Get_Owner_Document (Self : not null access constant Node) return WebAPI.DOM.Documents.Document_Access is abstract with Import => True, Convention => JavaScript_Property_Getter, Link_Name => "ownerDocument"; -- Returns the node document. -- -- Returns null for documents. not overriding function Get_Parent_Node (Self : not null access constant Node) return WebAPI.DOM.Nodes.Node_Access is abstract with Import => True, Convention => JavaScript_Property_Getter, Link_Name => "parentNode"; -- Returns the parent. not overriding function Get_Parent_Element (Self : not null access constant Node) return WebAPI.DOM.Elements.Element_Access is abstract with Import => True, Convention => JavaScript_Property_Getter, Link_Name => "parentElement"; -- Returns the parent element. not overriding function Has_Child_Nodes (Self : not null access constant Node) return Boolean is abstract with Import => True, Convention => JavaScript_Method, Link_Name => "hasChildNodes"; -- Returns whether node has children. not overriding function Get_Child_Nodes (Self : not null access constant Node) return WebAPI.DOM.Node_Lists.Node_List is abstract with Import => True, Convention => JavaScript_Property_Getter, Link_Name => "childNodes"; -- Returns the children. not overriding function Get_First_Child (Self : not null access constant Node) return WebAPI.DOM.Nodes.Node_Access is abstract with Import => True, Convention => JavaScript_Property_Getter, Link_Name => "firstChild"; -- Returns the first child. not overriding function Get_Last_Child (Self : not null access constant Node) return WebAPI.DOM.Nodes.Node_Access is abstract with Import => True, Convention => JavaScript_Property_Getter, Link_Name => "lastChild"; -- Returns the last child. not overriding function Get_Previous_Sibling (Self : not null access constant Node) return WebAPI.DOM.Nodes.Node_Access is abstract with Import => True, Convention => JavaScript_Property_Getter, Link_Name => "previousSibling"; -- Returns the previous sibling. not overriding function Get_Next_Sibling (Self : not null access constant Node) return WebAPI.DOM.Nodes.Node_Access is abstract with Import => True, Convention => JavaScript_Property_Getter, Link_Name => "nextSibling"; -- Returns the next sibling. not overriding function Get_Node_Value (Self : not null access constant Node) return WebAPI.DOM_String is abstract with Import => True, Convention => JavaScript_Property_Getter, Link_Name => "nodeValue"; -- The nodeValue attribute must return the following, depending on the -- context object: -- -- Text -- Comment -- ProcessingInstruction -- -- The context object's data. -- -- Any other node -- -- Null. not overriding procedure Set_Node_Value (Self : not null access Node; To : WebAPI.DOM_String) is abstract with Import => True, Convention => JavaScript_Property_Setter, Link_Name => "nodeValue"; -- The nodeValue attribute must, on setting, if the new value is null, act -- as if it was the empty string instead, and then do as described below, -- depending on the context object: -- -- Text -- Comment -- ProcessingInstruction -- -- Replace data with node context object, offset 0, count length -- attribute value, and data new value. -- -- Any other node -- -- Do nothing. not overriding function Get_Text_Content (Self : not null access constant Node) return WebAPI.DOM_String is abstract with Import => True, Convention => JavaScript_Property_Getter, Link_Name => "textContent"; -- The textContent attribute must return the following, depending on the -- context object: -- -- DocumentFragment -- Element -- -- The concatenation of data of all the Text node descendants of the -- context object, in tree order. -- -- Text -- ProcessingInstruction -- Comment -- -- The context object's data. -- -- Any other node -- -- Null. not overriding procedure Set_Text_Content (Self : not null access Node; To : WebAPI.DOM_String) is abstract with Import => True, Convention => JavaScript_Property_Setter, Link_Name => "textContent"; -- The textContent attribute must, on setting, if the new value is null, -- act as if it was the empty string instead, and then do as described -- below, depending on the context object: -- -- DocumentFragment -- Element -- -- 1. Let node be null. -- -- 2. If new value is not the empty string, set node to a new Text node -- whose data is new value. -- -- 3. Replace all with node within the context object. -- -- Text -- ProcessingInstruction -- Comment -- -- Replace data with node context object, offset 0, count length -- attribute value, and data new value. -- -- Any other node -- -- Do nothing. not overriding procedure Normalize (Self : not null access Node) is abstract with Import => True, Convention => JavaScript_Method, Link_Name => "normalize"; -- Removes empty Text nodes and concatenates the data of remaining -- contiguous Text nodes into the first of their nodes. not overriding function Clone_Node (Self : not null access Node; Deep : Boolean := False) return not null WebAPI.DOM.Nodes.Node_Access is abstract with Import => True, Convention => JavaScript_Method, Link_Name => "cloneNode"; -- Returns a copy of node. If deep is true, the copy also includes the -- node's descendants. not overriding function Is_Equal_Node (Self : not null access constant Node; Other : access Node'Class) return Boolean is abstract with Import => True, Convention => JavaScript_Method, Link_Name => "isEqualNode"; -- Returns whether node and other have the same properties. -- XXX Not bindied yet: -- const unsigned short DOCUMENT_POSITION_DISCONNECTED = 0x01; -- const unsigned short DOCUMENT_POSITION_PRECEDING = 0x02; -- const unsigned short DOCUMENT_POSITION_FOLLOWING = 0x04; -- const unsigned short DOCUMENT_POSITION_CONTAINS = 0x08; -- const unsigned short DOCUMENT_POSITION_CONTAINED_BY = 0x10; -- const unsigned short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20; -- unsigned short compareDocumentPosition(Node other); not overriding function Contains (Self : not null access constant Node; Other : access Node'Class) return Boolean is abstract with Import => True, Convention => JavaScript_Method, Link_Name => "contains"; -- Returns true if other is an inclusive descendant of node, and false -- otherwise. not overriding function Lookup_Prefix (Self : not null access constant Node; Namespace_URI : WebAPI.DOM_String) return WebAPI.DOM_String is abstract with Import => True, Convention => JavaScript_Method, Link_Name => "lookupPrefix"; -- The lookupPrefix(namespace) method must run these steps: -- -- 1. If namespace is null or the empty string, return null. -- -- 2. Otherwise it depends on the context object: -- -- Element -- -- Return the result of locating a namespace prefix for the node -- using namespace. -- -- Document -- -- Return the result of locating a namespace prefix for its document -- element, if that is not null, and null otherwise. -- -- DocumentType -- DocumentFragment -- -- Return null. -- -- Any other node -- -- Return the result of locating a namespace prefix for its parent -- element, or if that is null, null. not overriding function Lookup_Namespace_URI (Self : not null access constant Node; Prefix : WebAPI.DOM_String) return WebAPI.DOM_String is abstract with Import => True, Convention => JavaScript_Method, Link_Name => "lookupNamespaceURI"; -- The lookupNamespaceURI(prefix) method must run these steps: -- -- 1. If prefix is the empty string, set it to null. -- -- 2. Return the result of running locate a namespace for the context -- object using prefix. not overriding function Is_Default_Namespace (Self : not null access constant Node; Namespace_URI : WebAPI.DOM_String) return Boolean is abstract with Import => True, Convention => JavaScript_Method, Link_Name => "isDefaultNamespace"; -- The isDefaultNamespace(namespace) method must run these steps: -- -- 1. If namespace is the empty string, set it to null. -- -- 2. Let defaultNamespace be the result of running locate a namespace for -- the context object using null. -- -- 3. Return true if defaultNamespace is the same as namespace, and false -- otherwise. not overriding function Insert_Before (Self : not null access Node; Node : not null access WebAPI.DOM.Nodes.Node'Class; Child : access WebAPI.DOM.Nodes.Node'Class) return WebAPI.DOM.Nodes.Node_Access is abstract with Import => True, Convention => JavaScript_Method, Link_Name => "insertBefore"; procedure Insert_Before (Self : not null access Node'Class; Node : not null access WebAPI.DOM.Nodes.Node'Class; Child : access WebAPI.DOM.Nodes.Node'Class) with Import => True, Convention => JavaScript_Method, Link_Name => "insertBefore"; -- The insertBefore(node, child) method must return the result of -- pre-inserting node into the context object before child. not overriding function Append_Child (Self : not null access Node; Node : not null access WebAPI.DOM.Nodes.Node'Class) return Node_Access is abstract with Import => True, Convention => JavaScript_Method, Link_Name => "appendChild"; procedure Append_Child (Self : not null access Node'Class; Node : not null access WebAPI.DOM.Nodes.Node'Class) with Import => True, Convention => JavaScript_Method, Link_Name => "appendChild"; -- The appendChild(node) method must return the result of appending node to -- the context object. not overriding function Replace_Child (Self : not null access Node; Node : not null access WebAPI.DOM.Nodes.Node'Class; Child : not null access WebAPI.DOM.Nodes.Node'Class) return WebAPI.DOM.Nodes.Node_Access is abstract with Import => True, Convention => JavaScript_Method, Link_Name => "replaceChild"; procedure Replace_Child (Self : not null access Node'Class; Node : not null access WebAPI.DOM.Nodes.Node'Class; Child : not null access WebAPI.DOM.Nodes.Node'Class) with Import => True, Convention => JavaScript_Method, Link_Name => "replaceChild"; -- The replaceChild(node, child) method must return the result of replacing -- child with node within the context object. not overriding function Remove_Child (Self : not null access Node; Node : not null access WebAPI.DOM.Nodes.Node'Class) return Node_Access is abstract with Import => True, Convention => JavaScript_Method, Link_Name => "removeChild"; procedure Remove_Child (Self : not null access Node'Class; Node : not null access WebAPI.DOM.Nodes.Node'Class) with Import => True, Convention => JavaScript_Method, Link_Name => "removeChild"; -- The removeChild(child) method must return the result of pre-removing -- child from the context object. end WebAPI.DOM.Nodes;
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/access1.adb
best08618/asylo
7
25617
-- { dg-do compile } procedure access1 is protected Objet is procedure p; end Objet; protected body Objet is procedure p is begin null; end p; end Objet; type wrapper is record Ptr : access protected procedure := Objet.p'access; end record; It : wrapper; PP : access protected procedure; begin PP := Objet.p'access; PP.all; It.Ptr.all; end;
src/vulkan-math/vulkan-math-geometry.ads
zrmyers/VulkanAda
1
15
-------------------------------------------------------------------------------- -- MIT License -- -- Copyright (c) 2020 <NAME> -- -- 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. -------------------------------------------------------------------------------- with Vulkan.Math.GenFType; with Vulkan.Math.GenDType; with Vulkan.Math.Vec3; with Vulkan.Math.Dvec3; use Vulkan.Math.GenFType; use Vulkan.Math.GenDType; use Vulkan.Math.Vec3; use Vulkan.Math.Dvec3; -------------------------------------------------------------------------------- --< @group Vulkan Math Functions -------------------------------------------------------------------------------- --< @summary --< This package provides GLSL Geometry Built-in functions. --< --< @description --< All geometry functions operate on vectors as objects. -------------------------------------------------------------------------------- package Vulkan.Math.Geometry is pragma Preelaborate; pragma Pure; ---------------------------------------------------------------------------- --< @summary --< Calculate the magnitude of the vector. --< --< @description --< Calculate the magnitude of the GenFType vector, using the formula: --< --< Magnitude = sqrt(sum(x0^2, ..., xn^2)) --< --< @param x --< The vector to determine the magnitude for. --< --< @return --< The magnitude of the vector. ---------------------------------------------------------------------------- function Mag (x : in Vkm_GenFType) return Vkm_Float; ---------------------------------------------------------------------------- --< @summary --< Calculate the magnitude of the vector. --< --< @description --< Calculate the magnitude of the Vkm_GenDType vector, using the formula: --< --< Magnitude = sqrt(sum(x0^2, ..., xn^2)) --< --< @param x --< The vector to determine the magnitude for. --< --< @return --< The magnitude of the vector. ---------------------------------------------------------------------------- function Mag (x : in Vkm_GenDType) return Vkm_Double; ---------------------------------------------------------------------------- --< @summary --< Calculate the distance between two points, p0 and p1. --< --< @description --< Calculate the distance between two GenFType vectors representing points p0 --< and p1, using the formula: --< --< Distance = Magnitude(p0 - p1) --< --< @param p0 --< A vector which represents the first point. --< --< @param p1 --< A vector which represents the seconds point. --< --< @return --< The distance between the two points. ---------------------------------------------------------------------------- function Distance (p0, p1 : in Vkm_GenFType) return Vkm_Float is (Mag(p0 - p1)) with Inline; ---------------------------------------------------------------------------- --< @summary --< Calculate the distance between two points, p0 and p1. --< --< @description --< Calculate the distance between two GenDType vectors representing points p0 --< and p1, using the formula: --< --< Distance = Magnitude(p0 - p1) --< --< @param p0 --< A vector which represents the first point. --< --< @param p1 --< A vector which represents the seconds point. --< --< @return --< The distance between the two points. ---------------------------------------------------------------------------- function Distance (p0, p1 : in Vkm_GenDType) return Vkm_Double is (Mag(p0 - p1)) with Inline; ---------------------------------------------------------------------------- --< @summary --< Calculate the dot product between two vectors. --< --< @description --< Calculate the dot product between two GenFType vectors. --< --< x dot y = --< \ [x1 ... xN] . | y1 | = x1*y1 + ... xN * yN --< \ | ... | --< \ | yN | --< --< @param x --< The left vector in the dot product operation. --< --< @param y --< The right vector in the dot product operation. --< --< --< @return The dot product of the two vectors. ---------------------------------------------------------------------------- function Dot (x, y : in Vkm_GenFType) return Vkm_Float; ---------------------------------------------------------------------------- --< @summary --< Calculate the dot product between two vectors. --< --< @description --< Calculate the dot product between the two GenDType vectors. --< --< x dot y = --< \ [x1 ... xN] . | y1 | = x1*y1 + ... xN * yN --< \ | ... | --< \ | yN | --< --< @param x --< The left vector in the dot product operation. --< --< @param y --< The right vector in the dot product operation. --< --< @return --< The dot product of the two vectors. ---------------------------------------------------------------------------- function Dot (x, y : in Vkm_GenDType) return Vkm_Double; ---------------------------------------------------------------------------- --< @summary --< Calculate the cross product between two 3 dimmensional vectors. --< --< @description --< Calculate the cross product between two 3 dimmensional GenFType vectors. --< --< x cross y = --< \ | i j k | = i | x1 x2 | -j | x0 x2 | +k | x0 x1 | = | +(x1*y2 - x2*y1) | --< \ | x0 x1 x2 | | y1 y2 | | y0 y2 | | y0 y1 | | -(x0*y2 - x2*y1) | --< \ | y0 y1 y2 | | +(x0*y1 - x1*y0) | --< --< @param x --< The left vector in the cross product operation. --< --< @param y --< The right vector in the cross product operation. --< --< @return --< The cross product of the two vectors. ---------------------------------------------------------------------------- function Cross (x, y : in Vkm_Vec3 ) return Vkm_Vec3; ---------------------------------------------------------------------------- --< @summary --< Calculate the cross product between two 3 dimmensional vectors. --< --< @description --< Calculate the cross product between two 3 dimmensional GenDType vectors. --< --< x cross y = --< \ | i j k | = i | x1 x2 | -j | x0 x2 | +k | x0 x1 | = | +(x1*y2 - x2*y1) | --< \ | x0 x1 x2 | | y1 y2 | | y0 y2 | | y0 y1 | | -(x0*y2 - x2*y1) | --< \ | y0 y1 y2 | | +(x0*y1 - x1*y0) | --< --< @param x --< The left vector in the cross product operation. --< --< @param y --< The right vector in the cross product operation. --< --< @return --< The cross product of the two vectors. ---------------------------------------------------------------------------- function Cross (x, y : in Vkm_Dvec3) return Vkm_Dvec3; ---------------------------------------------------------------------------- --< @summary --< Normalize a vector. --< --< @description --< Normalize the GenFType vector so that it has a magnitude of 1. --< --< @param x --< The vector to normalize. --< --< @return --< The normalized vector. ---------------------------------------------------------------------------- function Normalize(x : in Vkm_GenFType) return Vkm_GenFType is (x / Mag(x)) with inline; ---------------------------------------------------------------------------- --< @summary --< Normalize a vector. --< --< @description --< Normalize the GenDType vector so that it has a magnitude of 1. --< --< @param x --< The vector to normalize. --< --< @return --< The normalized vector. ---------------------------------------------------------------------------- function Normalize(x : in Vkm_GenDType) return Vkm_GenDType is (x / Mag(x)) with inline; ---------------------------------------------------------------------------- --< @summary --< Force a normal vector to face an incident vector. --< --< @description --< Return a normal vector N as-is if an incident vector I points in the opposite --< direction of a reference normal vector, Nref. Otherwise, if I is pointing --< in the same direction as the reference normal, flip the normal vector N. --< --< - If Nref dot I is negative, these vectors are not facing the same direction. --< - If Nref dot I is positive, these vectors are facing in the same direction. --< - If Nref dot I is zero, these two vectors are orthogonal to each other. --< --< @param n --< The normal vector N --< --< @param i --< The incident vector I --< --< @param nref --< The reference normal vector Nref --< --< @return --< If I dot Nref < 0, return N. Otherwise return -N. ---------------------------------------------------------------------------- function Face_Forward(n, i, nref : in Vkm_GenFType) return Vkm_GenFType is (if Dot(nref,i) < 0.0 then n else -n) with Inline; ---------------------------------------------------------------------------- --< @summary --< Force a normal vector to face an incident vector. --< --< @description --< Return a normal vector N as-is if an incident vector I points in the opposite --< direction of a reference normal vector, Nref. Otherwise, if I is pointing --< in the same direction as the reference normal, flip the normal vector N. --< --< - If Nref dot I is negative, these vectors are not facing the same direction. --< - If Nref dot I is positive, these vectors are facing in the same direction. --< - If Nref dot I is zero, these two vectors are orthogonal to each other. --< --< @param n --< The normal vector N --< --< @param i --< The incident vector I --< --< @param nref --< The reference normal vector Nref --< --< @return --< If I dot Nref < 0, return N. Otherwise return -N. ---------------------------------------------------------------------------- function Face_Forward(n, i, nref : in Vkm_GenDType) return Vkm_GenDType is (if Dot(nref,i) < 0.0 then n else -n) with Inline; ---------------------------------------------------------------------------- --< @summary --< Calculate the reflection of an incident vector using the normal vector --< for the surface. --< --< @description --< For the incident vector I and surface orientation N, returns the reflection --< direction: --< --< I - 2 * ( N dot I ) * N. --< --< @param i --< The incident vector I. --< --< @param n --< The normal vector N. N should already be normalized. --< --< @return The reflection direction. ---------------------------------------------------------------------------- function Reflect(i, n : in Vkm_GenFType) return Vkm_GenFType is (i - 2.0 * Dot(n, i) * n) with Inline; ---------------------------------------------------------------------------- --< @summary --< Calculate the reflection of an incident vector using the normal vector --< for the surface. --< --< @description --< For the incident vector I and surface orientation N, returns the reflection --< direction: --< --< I - 2 * ( N dot I ) * N. --< --< @param i --< The incident vector I. --< --< @param n --< The normal vector N. N should already be normalized. --< --< @return The reflection direction. ---------------------------------------------------------------------------- function Reflect(i, n : in Vkm_GenDType) return Vkm_GenDType is (i - 2.0 * Dot(n, i) * n) with Inline; ---------------------------------------------------------------------------- --< @summary --< Calculate the refraction vector for the incident vector I travelling --< through the surface with normal N and a ratio of refraction eta. --< --< @description --< For the indident vector I and surface normal N, and the ratio of refraction --< eta, calculate the refraction vector. --< --< k = 1.0 - eta^2 (1.0 - dot(N,I)^2) --< If k < 0, the result is a vector of all zeros. --< Else , the result is: eta*I - (eta*dot(N,I) + sqrt(k))*N --< --< @param i --< The incident vector I. --< --< @param n --< The surface normal vector N. --< --< @param eta --< The indices of refraction. --< --< @return --< The refraction vector. ---------------------------------------------------------------------------- function Refract(i, n : in Vkm_GenFType; eta : in Vkm_Float ) return Vkm_GenFType; ---------------------------------------------------------------------------- --< @summary --< Calculate the refraction vector for the incident vector I travelling --< through the surface with normal N and a ratio of refraction eta. --< --< @description --< For the indident vector I and surface normal N, and the ratio of refraction --< eta, calculate the refraction vector. --< --< k = 1.0 - eta^2 (1.0 - dot(N,I)^2) --< If k < 0, the result is a vector of all zeros. --< Else , the result is: eta*I - (eta*dot(N,I) + sqrt(k))*N --< --< @param i --< The incident vector I. --< --< @param n --< The surface normal vector N. --< --< @param eta --< The indices of refraction. --< --< @return --< The refraction vector. ---------------------------------------------------------------------------- function Refract(i, n : in Vkm_GenDType; eta : in Vkm_Double ) return Vkm_GenDType; end Vulkan.Math.Geometry;
src/main/antlr4/TinyX.g4
deviknitkkr/TinyX
1
6214
<filename>src/main/antlr4/TinyX.g4 grammar TinyX; program : statement+; statement : let | show ; let : VAR '=' (INT | VAR) ; show : 'show' (INT | VAR) ; VAR : [a-z]+ ; INT : [0-9]+ ; WS : [ \n\t]+ -> skip;
arch/RISC-V/SiFive/drivers/uart0/sifive-uart.ads
rocher/Ada_Drivers_Library
192
25161
<reponame>rocher/Ada_Drivers_Library<gh_stars>100-1000 ------------------------------------------------------------------------------ -- -- -- Copyright (C) 2017-2019, AdaCore -- -- -- -- 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 the copyright holder 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 -- -- 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. -- -- -- ------------------------------------------------------------------------------ with System.Storage_Elements; with HAL; use HAL; with HAL.UART; use HAL.UART; private with System; package SiFive.UART is type UART_Device (Base_Address : System.Storage_Elements.Integer_Address) is limited new HAL.UART.UART_Port with private; type Stop_Bits is (Stopbits_1, Stopbits_2); procedure Set_Stop_Bits (This : in out UART_Device; To : Stop_Bits); subtype Baud_Rates is UInt32; procedure Set_Baud_Rate (This : in out UART_Device; CPU_Frequency : UInt32; To : Baud_Rates); procedure Enable_RX (This : in out UART_Device); procedure Enable_TX (This : in out UART_Device); procedure Disable_RX (This : in out UART_Device); procedure Disable_TX (This : in out UART_Device); function RX_Interrupt_Pending (This : UART_Device) return Boolean; -- The interrupt flag is set when the RX fifo is strictly greater than the -- threshold (default to 0). -- -- The flag is cleared by the hardware when enough data have been dequeued. function TX_Interrupt_Pending (This : UART_Device) return Boolean; -- The interrupt flag is set when the TX fifo is strictly less than the -- threshold (default to 0). -- -- The flag is cleared by the hardware when enough data have been enqueued. procedure Enable_RX_Interrupt (This : in out UART_Device); procedure Enable_TX_Interrupt (This : in out UART_Device); procedure Disable_RX_Interrupt (This : in out UART_Device); procedure Disable_TX_Interrupt (This : in out UART_Device); procedure Set_Interrupt_Thresholds (This : in out UART_Device; RX, TX : UInt3); --------------- -- HAL.GPIO -- --------------- overriding function Data_Size (Port : UART_Device) return UART_Data_Size is (Data_Size_8b); -- FE310 UARTs are 8bits only overriding procedure Transmit (This : in out UART_Device; Data : UART_Data_8b; Status : out UART_Status; Timeout : Natural := 1000); overriding procedure Transmit (This : in out UART_Device; Data : UART_Data_9b; Status : out UART_Status; Timeout : Natural := 1000); overriding procedure Receive (This : in out UART_Device; Data : out UART_Data_8b; Status : out UART_Status; Timeout : Natural := 1000); overriding procedure Receive (This : in out UART_Device; Data : out UART_Data_9b; Status : out UART_Status; Timeout : Natural := 1000); private --------------- -- Registers -- --------------- subtype TXDATA_DATA_Field is HAL.UInt8; -- Transmit Data Register. type TXDATA_Register is record DATA : TXDATA_DATA_Field := 16#0#; -- unspecified Reserved_8_30 : HAL.UInt23 := 16#0#; FULL : Boolean := False; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for TXDATA_Register use record DATA at 0 range 0 .. 7; Reserved_8_30 at 0 range 8 .. 30; FULL at 0 range 31 .. 31; end record; subtype RXDATA_DATA_Field is HAL.UInt8; -- Receive Data Register. type RXDATA_Register is record DATA : RXDATA_DATA_Field := 16#0#; -- unspecified Reserved_8_30 : HAL.UInt23 := 16#0#; EMPTY : Boolean := False; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for RXDATA_Register use record DATA at 0 range 0 .. 7; Reserved_8_30 at 0 range 8 .. 30; EMPTY at 0 range 31 .. 31; end record; subtype TXCTRL_TXCNT_Field is HAL.UInt3; -- Transmit Control Register. type TXCTRL_Register is record ENABLE : Boolean := False; NSTOP : Boolean := False; -- unspecified Reserved_2_15 : HAL.UInt14 := 16#0#; TXCNT : TXCTRL_TXCNT_Field := 16#0#; -- unspecified Reserved_19_31 : HAL.UInt13 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for TXCTRL_Register use record ENABLE at 0 range 0 .. 0; NSTOP at 0 range 1 .. 1; Reserved_2_15 at 0 range 2 .. 15; TXCNT at 0 range 16 .. 18; Reserved_19_31 at 0 range 19 .. 31; end record; subtype RXCTRL_RXCNT_Field is HAL.UInt3; -- Receive Control Register. type RXCTRL_Register is record ENABLE : Boolean := False; -- unspecified Reserved_1_15 : HAL.UInt15 := 16#0#; RXCNT : RXCTRL_RXCNT_Field := 16#0#; -- unspecified Reserved_19_31 : HAL.UInt13 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for RXCTRL_Register use record ENABLE at 0 range 0 .. 0; Reserved_1_15 at 0 range 1 .. 15; RXCNT at 0 range 16 .. 18; Reserved_19_31 at 0 range 19 .. 31; end record; -- Interrupt Pending Register. type IP_Register is record TXWM : Boolean := False; RXWM : Boolean := False; -- unspecified Reserved_2_31 : HAL.UInt30 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for IP_Register use record TXWM at 0 range 0 .. 0; RXWM at 0 range 1 .. 1; Reserved_2_31 at 0 range 2 .. 31; end record; -- Interrupt Enable Register. type IE_Register is record TXWM : Boolean := False; RXWM : Boolean := False; -- unspecified Reserved_2_31 : HAL.UInt30 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for IE_Register use record TXWM at 0 range 0 .. 0; RXWM at 0 range 1 .. 1; Reserved_2_31 at 0 range 2 .. 31; end record; subtype DIV_DIV_Field is HAL.UInt16; -- Baud Rate Divisor Register (BAUD = Fin / (DIV + 1)). type DIV_Register is record DIV : DIV_DIV_Field := 16#0#; -- unspecified Reserved_16_31 : HAL.UInt16 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for DIV_Register use record DIV at 0 range 0 .. 15; Reserved_16_31 at 0 range 16 .. 31; end record; ----------------- -- Peripherals -- ----------------- -- Universal Asynchronous Receiver/Transmitter. type UART_Peripheral is record -- Transmit Data Register. TXDATA : aliased TXDATA_Register; -- Receive Data Register. RXDATA : aliased RXDATA_Register; -- Transmit Control Register. TXCTRL : aliased TXCTRL_Register; -- Receive Control Register. RXCTRL : aliased RXCTRL_Register; -- Interrupt Pending Register. IP : aliased IP_Register; -- Interrupt Enable Register. IE : aliased IE_Register; -- Baud Rate Divisor Register (BAUD = Fin / (DIV + 1)). DIV : aliased DIV_Register; end record with Volatile; for UART_Peripheral use record TXDATA at 16#0# range 0 .. 31; RXDATA at 16#4# range 0 .. 31; TXCTRL at 16#8# range 0 .. 31; RXCTRL at 16#C# range 0 .. 31; IP at 16#10# range 0 .. 31; IE at 16#14# range 0 .. 31; DIV at 16#18# range 0 .. 31; end record; type UART_Device (Base_Address : System.Storage_Elements.Integer_Address) is limited new HAL.UART.UART_Port with null record; end SiFive.UART;
awa/src/model/awa-oauth-models.adb
My-Colaborations/ada-awa
81
6053
----------------------------------------------------------------------- -- AWA.OAuth.Models -- AWA.OAuth.Models ----------------------------------------------------------------------- -- File generated by ada-gen DO NOT MODIFY -- Template used: templates/model/package-body.xhtml -- Ada Generator: https://ada-gen.googlecode.com/svn/trunk Revision 1095 ----------------------------------------------------------------------- -- Copyright (C) 2020 <NAME> -- Written by <NAME> (<EMAIL>) -- -- 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. ----------------------------------------------------------------------- with Ada.Unchecked_Deallocation; with Util.Beans.Objects.Time; package body AWA.OAuth.Models is use type ADO.Objects.Object_Record_Access; use type ADO.Objects.Object_Ref; pragma Warnings (Off, "formal parameter * is not referenced"); function Application_Key (Id : in ADO.Identifier) return ADO.Objects.Object_Key is Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER, Of_Class => APPLICATION_DEF'Access); begin ADO.Objects.Set_Value (Result, Id); return Result; end Application_Key; function Application_Key (Id : in String) return ADO.Objects.Object_Key is Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER, Of_Class => APPLICATION_DEF'Access); begin ADO.Objects.Set_Value (Result, Id); return Result; end Application_Key; function "=" (Left, Right : Application_Ref'Class) return Boolean is begin return ADO.Objects.Object_Ref'Class (Left) = ADO.Objects.Object_Ref'Class (Right); end "="; procedure Set_Field (Object : in out Application_Ref'Class; Impl : out Application_Access) is Result : ADO.Objects.Object_Record_Access; begin Object.Prepare_Modify (Result); Impl := Application_Impl (Result.all)'Access; end Set_Field; -- Internal method to allocate the Object_Record instance procedure Allocate (Object : in out Application_Ref) is Impl : Application_Access; begin Impl := new Application_Impl; Impl.Version := 0; Impl.Create_Date := ADO.DEFAULT_TIME; Impl.Update_Date := ADO.DEFAULT_TIME; ADO.Objects.Set_Object (Object, Impl.all'Access); end Allocate; -- ---------------------------------------- -- Data object: Application -- ---------------------------------------- procedure Set_Id (Object : in out Application_Ref; Value : in ADO.Identifier) is Impl : Application_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Key_Value (Impl.all, 1, Value); end Set_Id; function Get_Id (Object : in Application_Ref) return ADO.Identifier is Impl : constant Application_Access := Application_Impl (Object.Get_Object.all)'Access; begin return Impl.Get_Key_Value; end Get_Id; procedure Set_Name (Object : in out Application_Ref; Value : in String) is Impl : Application_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_String (Impl.all, 2, Impl.Name, Value); end Set_Name; procedure Set_Name (Object : in out Application_Ref; Value : in Ada.Strings.Unbounded.Unbounded_String) is Impl : Application_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Unbounded_String (Impl.all, 2, Impl.Name, Value); end Set_Name; function Get_Name (Object : in Application_Ref) return String is begin return Ada.Strings.Unbounded.To_String (Object.Get_Name); end Get_Name; function Get_Name (Object : in Application_Ref) return Ada.Strings.Unbounded.Unbounded_String is Impl : constant Application_Access := Application_Impl (Object.Get_Load_Object.all)'Access; begin return Impl.Name; end Get_Name; procedure Set_Secret_Key (Object : in out Application_Ref; Value : in String) is Impl : Application_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_String (Impl.all, 3, Impl.Secret_Key, Value); end Set_Secret_Key; procedure Set_Secret_Key (Object : in out Application_Ref; Value : in Ada.Strings.Unbounded.Unbounded_String) is Impl : Application_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Unbounded_String (Impl.all, 3, Impl.Secret_Key, Value); end Set_Secret_Key; function Get_Secret_Key (Object : in Application_Ref) return String is begin return Ada.Strings.Unbounded.To_String (Object.Get_Secret_Key); end Get_Secret_Key; function Get_Secret_Key (Object : in Application_Ref) return Ada.Strings.Unbounded.Unbounded_String is Impl : constant Application_Access := Application_Impl (Object.Get_Load_Object.all)'Access; begin return Impl.Secret_Key; end Get_Secret_Key; procedure Set_Client_Id (Object : in out Application_Ref; Value : in String) is Impl : Application_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_String (Impl.all, 4, Impl.Client_Id, Value); end Set_Client_Id; procedure Set_Client_Id (Object : in out Application_Ref; Value : in Ada.Strings.Unbounded.Unbounded_String) is Impl : Application_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Unbounded_String (Impl.all, 4, Impl.Client_Id, Value); end Set_Client_Id; function Get_Client_Id (Object : in Application_Ref) return String is begin return Ada.Strings.Unbounded.To_String (Object.Get_Client_Id); end Get_Client_Id; function Get_Client_Id (Object : in Application_Ref) return Ada.Strings.Unbounded.Unbounded_String is Impl : constant Application_Access := Application_Impl (Object.Get_Load_Object.all)'Access; begin return Impl.Client_Id; end Get_Client_Id; function Get_Version (Object : in Application_Ref) return Integer is Impl : constant Application_Access := Application_Impl (Object.Get_Load_Object.all)'Access; begin return Impl.Version; end Get_Version; procedure Set_Create_Date (Object : in out Application_Ref; Value : in Ada.Calendar.Time) is Impl : Application_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Time (Impl.all, 6, Impl.Create_Date, Value); end Set_Create_Date; function Get_Create_Date (Object : in Application_Ref) return Ada.Calendar.Time is Impl : constant Application_Access := Application_Impl (Object.Get_Load_Object.all)'Access; begin return Impl.Create_Date; end Get_Create_Date; procedure Set_Update_Date (Object : in out Application_Ref; Value : in Ada.Calendar.Time) is Impl : Application_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Time (Impl.all, 7, Impl.Update_Date, Value); end Set_Update_Date; function Get_Update_Date (Object : in Application_Ref) return Ada.Calendar.Time is Impl : constant Application_Access := Application_Impl (Object.Get_Load_Object.all)'Access; begin return Impl.Update_Date; end Get_Update_Date; procedure Set_Title (Object : in out Application_Ref; Value : in String) is Impl : Application_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_String (Impl.all, 8, Impl.Title, Value); end Set_Title; procedure Set_Title (Object : in out Application_Ref; Value : in Ada.Strings.Unbounded.Unbounded_String) is Impl : Application_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Unbounded_String (Impl.all, 8, Impl.Title, Value); end Set_Title; function Get_Title (Object : in Application_Ref) return String is begin return Ada.Strings.Unbounded.To_String (Object.Get_Title); end Get_Title; function Get_Title (Object : in Application_Ref) return Ada.Strings.Unbounded.Unbounded_String is Impl : constant Application_Access := Application_Impl (Object.Get_Load_Object.all)'Access; begin return Impl.Title; end Get_Title; procedure Set_Description (Object : in out Application_Ref; Value : in String) is Impl : Application_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_String (Impl.all, 9, Impl.Description, Value); end Set_Description; procedure Set_Description (Object : in out Application_Ref; Value : in Ada.Strings.Unbounded.Unbounded_String) is Impl : Application_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Unbounded_String (Impl.all, 9, Impl.Description, Value); end Set_Description; function Get_Description (Object : in Application_Ref) return String is begin return Ada.Strings.Unbounded.To_String (Object.Get_Description); end Get_Description; function Get_Description (Object : in Application_Ref) return Ada.Strings.Unbounded.Unbounded_String is Impl : constant Application_Access := Application_Impl (Object.Get_Load_Object.all)'Access; begin return Impl.Description; end Get_Description; procedure Set_App_Login_Url (Object : in out Application_Ref; Value : in String) is Impl : Application_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_String (Impl.all, 10, Impl.App_Login_Url, Value); end Set_App_Login_Url; procedure Set_App_Login_Url (Object : in out Application_Ref; Value : in Ada.Strings.Unbounded.Unbounded_String) is Impl : Application_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Unbounded_String (Impl.all, 10, Impl.App_Login_Url, Value); end Set_App_Login_Url; function Get_App_Login_Url (Object : in Application_Ref) return String is begin return Ada.Strings.Unbounded.To_String (Object.Get_App_Login_Url); end Get_App_Login_Url; function Get_App_Login_Url (Object : in Application_Ref) return Ada.Strings.Unbounded.Unbounded_String is Impl : constant Application_Access := Application_Impl (Object.Get_Load_Object.all)'Access; begin return Impl.App_Login_Url; end Get_App_Login_Url; procedure Set_App_Logo_Url (Object : in out Application_Ref; Value : in String) is Impl : Application_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_String (Impl.all, 11, Impl.App_Logo_Url, Value); end Set_App_Logo_Url; procedure Set_App_Logo_Url (Object : in out Application_Ref; Value : in Ada.Strings.Unbounded.Unbounded_String) is Impl : Application_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Unbounded_String (Impl.all, 11, Impl.App_Logo_Url, Value); end Set_App_Logo_Url; function Get_App_Logo_Url (Object : in Application_Ref) return String is begin return Ada.Strings.Unbounded.To_String (Object.Get_App_Logo_Url); end Get_App_Logo_Url; function Get_App_Logo_Url (Object : in Application_Ref) return Ada.Strings.Unbounded.Unbounded_String is Impl : constant Application_Access := Application_Impl (Object.Get_Load_Object.all)'Access; begin return Impl.App_Logo_Url; end Get_App_Logo_Url; procedure Set_User (Object : in out Application_Ref; Value : in AWA.Users.Models.User_Ref'Class) is Impl : Application_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Object (Impl.all, 12, Impl.User, Value); end Set_User; function Get_User (Object : in Application_Ref) return AWA.Users.Models.User_Ref'Class is Impl : constant Application_Access := Application_Impl (Object.Get_Load_Object.all)'Access; begin return Impl.User; end Get_User; -- Copy of the object. procedure Copy (Object : in Application_Ref; Into : in out Application_Ref) is Result : Application_Ref; begin if not Object.Is_Null then declare Impl : constant Application_Access := Application_Impl (Object.Get_Load_Object.all)'Access; Copy : constant Application_Access := new Application_Impl; begin ADO.Objects.Set_Object (Result, Copy.all'Access); Copy.Copy (Impl.all); Copy.Name := Impl.Name; Copy.Secret_Key := Impl.Secret_Key; Copy.Client_Id := Impl.Client_Id; Copy.Version := Impl.Version; Copy.Create_Date := Impl.Create_Date; Copy.Update_Date := Impl.Update_Date; Copy.Title := Impl.Title; Copy.Description := Impl.Description; Copy.App_Login_Url := Impl.App_Login_Url; Copy.App_Logo_Url := Impl.App_Logo_Url; Copy.User := Impl.User; end; end if; Into := Result; end Copy; procedure Find (Object : in out Application_Ref; Session : in out ADO.Sessions.Session'Class; Query : in ADO.SQL.Query'Class; Found : out Boolean) is Impl : constant Application_Access := new Application_Impl; begin Impl.Find (Session, Query, Found); if Found then ADO.Objects.Set_Object (Object, Impl.all'Access); else ADO.Objects.Set_Object (Object, null); Destroy (Impl); end if; end Find; procedure Load (Object : in out Application_Ref; Session : in out ADO.Sessions.Session'Class; Id : in ADO.Identifier) is Impl : constant Application_Access := new Application_Impl; Found : Boolean; Query : ADO.SQL.Query; begin Query.Bind_Param (Position => 1, Value => Id); Query.Set_Filter ("id = ?"); Impl.Find (Session, Query, Found); if not Found then Destroy (Impl); raise ADO.Objects.NOT_FOUND; end if; ADO.Objects.Set_Object (Object, Impl.all'Access); end Load; procedure Load (Object : in out Application_Ref; Session : in out ADO.Sessions.Session'Class; Id : in ADO.Identifier; Found : out Boolean) is Impl : constant Application_Access := new Application_Impl; Query : ADO.SQL.Query; begin Query.Bind_Param (Position => 1, Value => Id); Query.Set_Filter ("id = ?"); Impl.Find (Session, Query, Found); if not Found then Destroy (Impl); else ADO.Objects.Set_Object (Object, Impl.all'Access); end if; end Load; procedure Save (Object : in out Application_Ref; Session : in out ADO.Sessions.Master_Session'Class) is Impl : ADO.Objects.Object_Record_Access := Object.Get_Object; begin if Impl = null then Impl := new Application_Impl; ADO.Objects.Set_Object (Object, Impl); end if; if not ADO.Objects.Is_Created (Impl.all) then Impl.Create (Session); else Impl.Save (Session); end if; end Save; procedure Delete (Object : in out Application_Ref; Session : in out ADO.Sessions.Master_Session'Class) is Impl : constant ADO.Objects.Object_Record_Access := Object.Get_Object; begin if Impl /= null then Impl.Delete (Session); end if; end Delete; -- -------------------- -- Free the object -- -------------------- procedure Destroy (Object : access Application_Impl) is type Application_Impl_Ptr is access all Application_Impl; procedure Unchecked_Free is new Ada.Unchecked_Deallocation (Application_Impl, Application_Impl_Ptr); pragma Warnings (Off, "*redundant conversion*"); Ptr : Application_Impl_Ptr := Application_Impl (Object.all)'Access; pragma Warnings (On, "*redundant conversion*"); begin Unchecked_Free (Ptr); end Destroy; procedure Find (Object : in out Application_Impl; Session : in out ADO.Sessions.Session'Class; Query : in ADO.SQL.Query'Class; Found : out Boolean) is Stmt : ADO.Statements.Query_Statement := Session.Create_Statement (Query, APPLICATION_DEF'Access); begin Stmt.Execute; if Stmt.Has_Elements then Object.Load (Stmt, Session); Stmt.Next; Found := not Stmt.Has_Elements; else Found := False; end if; end Find; overriding procedure Load (Object : in out Application_Impl; Session : in out ADO.Sessions.Session'Class) is Found : Boolean; Query : ADO.SQL.Query; Id : constant ADO.Identifier := Object.Get_Key_Value; begin Query.Bind_Param (Position => 1, Value => Id); Query.Set_Filter ("id = ?"); Object.Find (Session, Query, Found); if not Found then raise ADO.Objects.NOT_FOUND; end if; end Load; procedure Save (Object : in out Application_Impl; Session : in out ADO.Sessions.Master_Session'Class) is Stmt : ADO.Statements.Update_Statement := Session.Create_Statement (APPLICATION_DEF'Access); begin if Object.Is_Modified (1) then Stmt.Save_Field (Name => COL_0_1_NAME, -- id Value => Object.Get_Key); Object.Clear_Modified (1); end if; if Object.Is_Modified (2) then Stmt.Save_Field (Name => COL_1_1_NAME, -- name Value => Object.Name); Object.Clear_Modified (2); end if; if Object.Is_Modified (3) then Stmt.Save_Field (Name => COL_2_1_NAME, -- secret_key Value => Object.Secret_Key); Object.Clear_Modified (3); end if; if Object.Is_Modified (4) then Stmt.Save_Field (Name => COL_3_1_NAME, -- client_id Value => Object.Client_Id); Object.Clear_Modified (4); end if; if Object.Is_Modified (6) then Stmt.Save_Field (Name => COL_5_1_NAME, -- create_date Value => Object.Create_Date); Object.Clear_Modified (6); end if; if Object.Is_Modified (7) then Stmt.Save_Field (Name => COL_6_1_NAME, -- update_date Value => Object.Update_Date); Object.Clear_Modified (7); end if; if Object.Is_Modified (8) then Stmt.Save_Field (Name => COL_7_1_NAME, -- title Value => Object.Title); Object.Clear_Modified (8); end if; if Object.Is_Modified (9) then Stmt.Save_Field (Name => COL_8_1_NAME, -- description Value => Object.Description); Object.Clear_Modified (9); end if; if Object.Is_Modified (10) then Stmt.Save_Field (Name => COL_9_1_NAME, -- app_login_url Value => Object.App_Login_Url); Object.Clear_Modified (10); end if; if Object.Is_Modified (11) then Stmt.Save_Field (Name => COL_10_1_NAME, -- app_logo_url Value => Object.App_Logo_Url); Object.Clear_Modified (11); end if; if Object.Is_Modified (12) then Stmt.Save_Field (Name => COL_11_1_NAME, -- user_id Value => Object.User); Object.Clear_Modified (12); end if; if Stmt.Has_Save_Fields then Object.Version := Object.Version + 1; Stmt.Save_Field (Name => "version", Value => Object.Version); Stmt.Set_Filter (Filter => "id = ? and version = ?"); Stmt.Add_Param (Value => Object.Get_Key); Stmt.Add_Param (Value => Object.Version - 1); declare Result : Integer; begin Stmt.Execute (Result); if Result /= 1 then if Result /= 0 then raise ADO.Objects.UPDATE_ERROR; else raise ADO.Objects.LAZY_LOCK; end if; end if; end; end if; end Save; procedure Create (Object : in out Application_Impl; Session : in out ADO.Sessions.Master_Session'Class) is Query : ADO.Statements.Insert_Statement := Session.Create_Statement (APPLICATION_DEF'Access); Result : Integer; begin Object.Version := 1; Session.Allocate (Id => Object); Query.Save_Field (Name => COL_0_1_NAME, -- id Value => Object.Get_Key); Query.Save_Field (Name => COL_1_1_NAME, -- name Value => Object.Name); Query.Save_Field (Name => COL_2_1_NAME, -- secret_key Value => Object.Secret_Key); Query.Save_Field (Name => COL_3_1_NAME, -- client_id Value => Object.Client_Id); Query.Save_Field (Name => COL_4_1_NAME, -- version Value => Object.Version); Query.Save_Field (Name => COL_5_1_NAME, -- create_date Value => Object.Create_Date); Query.Save_Field (Name => COL_6_1_NAME, -- update_date Value => Object.Update_Date); Query.Save_Field (Name => COL_7_1_NAME, -- title Value => Object.Title); Query.Save_Field (Name => COL_8_1_NAME, -- description Value => Object.Description); Query.Save_Field (Name => COL_9_1_NAME, -- app_login_url Value => Object.App_Login_Url); Query.Save_Field (Name => COL_10_1_NAME, -- app_logo_url Value => Object.App_Logo_Url); Query.Save_Field (Name => COL_11_1_NAME, -- user_id Value => Object.User); Query.Execute (Result); if Result /= 1 then raise ADO.Objects.INSERT_ERROR; end if; ADO.Objects.Set_Created (Object); end Create; procedure Delete (Object : in out Application_Impl; Session : in out ADO.Sessions.Master_Session'Class) is Stmt : ADO.Statements.Delete_Statement := Session.Create_Statement (APPLICATION_DEF'Access); begin Stmt.Set_Filter (Filter => "id = ?"); Stmt.Add_Param (Value => Object.Get_Key); Stmt.Execute; end Delete; -- ------------------------------ -- Get the bean attribute identified by the name. -- ------------------------------ overriding function Get_Value (From : in Application_Ref; Name : in String) return Util.Beans.Objects.Object is Obj : ADO.Objects.Object_Record_Access; Impl : access Application_Impl; begin if From.Is_Null then return Util.Beans.Objects.Null_Object; end if; Obj := From.Get_Load_Object; Impl := Application_Impl (Obj.all)'Access; if Name = "id" then return ADO.Objects.To_Object (Impl.Get_Key); elsif Name = "name" then return Util.Beans.Objects.To_Object (Impl.Name); elsif Name = "secret_key" then return Util.Beans.Objects.To_Object (Impl.Secret_Key); elsif Name = "client_id" then return Util.Beans.Objects.To_Object (Impl.Client_Id); elsif Name = "create_date" then return Util.Beans.Objects.Time.To_Object (Impl.Create_Date); elsif Name = "update_date" then return Util.Beans.Objects.Time.To_Object (Impl.Update_Date); elsif Name = "title" then return Util.Beans.Objects.To_Object (Impl.Title); elsif Name = "description" then return Util.Beans.Objects.To_Object (Impl.Description); elsif Name = "app_login_url" then return Util.Beans.Objects.To_Object (Impl.App_Login_Url); elsif Name = "app_logo_url" then return Util.Beans.Objects.To_Object (Impl.App_Logo_Url); end if; return Util.Beans.Objects.Null_Object; end Get_Value; procedure List (Object : in out Application_Vector; Session : in out ADO.Sessions.Session'Class; Query : in ADO.SQL.Query'Class) is Stmt : ADO.Statements.Query_Statement := Session.Create_Statement (Query, APPLICATION_DEF'Access); begin Stmt.Execute; Application_Vectors.Clear (Object); while Stmt.Has_Elements loop declare Item : Application_Ref; Impl : constant Application_Access := new Application_Impl; begin Impl.Load (Stmt, Session); ADO.Objects.Set_Object (Item, Impl.all'Access); Object.Append (Item); end; Stmt.Next; end loop; end List; -- ------------------------------ -- Load the object from current iterator position -- ------------------------------ procedure Load (Object : in out Application_Impl; Stmt : in out ADO.Statements.Query_Statement'Class; Session : in out ADO.Sessions.Session'Class) is begin Object.Set_Key_Value (Stmt.Get_Identifier (0)); Object.Name := Stmt.Get_Unbounded_String (1); Object.Secret_Key := Stmt.Get_Unbounded_String (2); Object.Client_Id := Stmt.Get_Unbounded_String (3); Object.Create_Date := Stmt.Get_Time (5); Object.Update_Date := Stmt.Get_Time (6); Object.Title := Stmt.Get_Unbounded_String (7); Object.Description := Stmt.Get_Unbounded_String (8); Object.App_Login_Url := Stmt.Get_Unbounded_String (9); Object.App_Logo_Url := Stmt.Get_Unbounded_String (10); if not Stmt.Is_Null (11) then Object.User.Set_Key_Value (Stmt.Get_Identifier (11), Session); end if; Object.Version := Stmt.Get_Integer (4); ADO.Objects.Set_Created (Object); end Load; function Callback_Key (Id : in ADO.Identifier) return ADO.Objects.Object_Key is Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER, Of_Class => CALLBACK_DEF'Access); begin ADO.Objects.Set_Value (Result, Id); return Result; end Callback_Key; function Callback_Key (Id : in String) return ADO.Objects.Object_Key is Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER, Of_Class => CALLBACK_DEF'Access); begin ADO.Objects.Set_Value (Result, Id); return Result; end Callback_Key; function "=" (Left, Right : Callback_Ref'Class) return Boolean is begin return ADO.Objects.Object_Ref'Class (Left) = ADO.Objects.Object_Ref'Class (Right); end "="; procedure Set_Field (Object : in out Callback_Ref'Class; Impl : out Callback_Access) is Result : ADO.Objects.Object_Record_Access; begin Object.Prepare_Modify (Result); Impl := Callback_Impl (Result.all)'Access; end Set_Field; -- Internal method to allocate the Object_Record instance procedure Allocate (Object : in out Callback_Ref) is Impl : Callback_Access; begin Impl := new Callback_Impl; Impl.Version := 0; ADO.Objects.Set_Object (Object, Impl.all'Access); end Allocate; -- ---------------------------------------- -- Data object: Callback -- ---------------------------------------- procedure Set_Id (Object : in out Callback_Ref; Value : in ADO.Identifier) is Impl : Callback_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Key_Value (Impl.all, 1, Value); end Set_Id; function Get_Id (Object : in Callback_Ref) return ADO.Identifier is Impl : constant Callback_Access := Callback_Impl (Object.Get_Object.all)'Access; begin return Impl.Get_Key_Value; end Get_Id; procedure Set_Url (Object : in out Callback_Ref; Value : in String) is Impl : Callback_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_String (Impl.all, 2, Impl.Url, Value); end Set_Url; procedure Set_Url (Object : in out Callback_Ref; Value : in Ada.Strings.Unbounded.Unbounded_String) is Impl : Callback_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Unbounded_String (Impl.all, 2, Impl.Url, Value); end Set_Url; function Get_Url (Object : in Callback_Ref) return String is begin return Ada.Strings.Unbounded.To_String (Object.Get_Url); end Get_Url; function Get_Url (Object : in Callback_Ref) return Ada.Strings.Unbounded.Unbounded_String is Impl : constant Callback_Access := Callback_Impl (Object.Get_Load_Object.all)'Access; begin return Impl.Url; end Get_Url; function Get_Version (Object : in Callback_Ref) return Integer is Impl : constant Callback_Access := Callback_Impl (Object.Get_Load_Object.all)'Access; begin return Impl.Version; end Get_Version; procedure Set_Application (Object : in out Callback_Ref; Value : in AWA.OAuth.Models.Application_Ref'Class) is Impl : Callback_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Object (Impl.all, 4, Impl.Application, Value); end Set_Application; function Get_Application (Object : in Callback_Ref) return AWA.OAuth.Models.Application_Ref'Class is Impl : constant Callback_Access := Callback_Impl (Object.Get_Load_Object.all)'Access; begin return Impl.Application; end Get_Application; -- Copy of the object. procedure Copy (Object : in Callback_Ref; Into : in out Callback_Ref) is Result : Callback_Ref; begin if not Object.Is_Null then declare Impl : constant Callback_Access := Callback_Impl (Object.Get_Load_Object.all)'Access; Copy : constant Callback_Access := new Callback_Impl; begin ADO.Objects.Set_Object (Result, Copy.all'Access); Copy.Copy (Impl.all); Copy.Url := Impl.Url; Copy.Version := Impl.Version; Copy.Application := Impl.Application; end; end if; Into := Result; end Copy; procedure Find (Object : in out Callback_Ref; Session : in out ADO.Sessions.Session'Class; Query : in ADO.SQL.Query'Class; Found : out Boolean) is Impl : constant Callback_Access := new Callback_Impl; begin Impl.Find (Session, Query, Found); if Found then ADO.Objects.Set_Object (Object, Impl.all'Access); else ADO.Objects.Set_Object (Object, null); Destroy (Impl); end if; end Find; procedure Load (Object : in out Callback_Ref; Session : in out ADO.Sessions.Session'Class; Id : in ADO.Identifier) is Impl : constant Callback_Access := new Callback_Impl; Found : Boolean; Query : ADO.SQL.Query; begin Query.Bind_Param (Position => 1, Value => Id); Query.Set_Filter ("id = ?"); Impl.Find (Session, Query, Found); if not Found then Destroy (Impl); raise ADO.Objects.NOT_FOUND; end if; ADO.Objects.Set_Object (Object, Impl.all'Access); end Load; procedure Load (Object : in out Callback_Ref; Session : in out ADO.Sessions.Session'Class; Id : in ADO.Identifier; Found : out Boolean) is Impl : constant Callback_Access := new Callback_Impl; Query : ADO.SQL.Query; begin Query.Bind_Param (Position => 1, Value => Id); Query.Set_Filter ("id = ?"); Impl.Find (Session, Query, Found); if not Found then Destroy (Impl); else ADO.Objects.Set_Object (Object, Impl.all'Access); end if; end Load; procedure Save (Object : in out Callback_Ref; Session : in out ADO.Sessions.Master_Session'Class) is Impl : ADO.Objects.Object_Record_Access := Object.Get_Object; begin if Impl = null then Impl := new Callback_Impl; ADO.Objects.Set_Object (Object, Impl); end if; if not ADO.Objects.Is_Created (Impl.all) then Impl.Create (Session); else Impl.Save (Session); end if; end Save; procedure Delete (Object : in out Callback_Ref; Session : in out ADO.Sessions.Master_Session'Class) is Impl : constant ADO.Objects.Object_Record_Access := Object.Get_Object; begin if Impl /= null then Impl.Delete (Session); end if; end Delete; -- -------------------- -- Free the object -- -------------------- procedure Destroy (Object : access Callback_Impl) is type Callback_Impl_Ptr is access all Callback_Impl; procedure Unchecked_Free is new Ada.Unchecked_Deallocation (Callback_Impl, Callback_Impl_Ptr); pragma Warnings (Off, "*redundant conversion*"); Ptr : Callback_Impl_Ptr := Callback_Impl (Object.all)'Access; pragma Warnings (On, "*redundant conversion*"); begin Unchecked_Free (Ptr); end Destroy; procedure Find (Object : in out Callback_Impl; Session : in out ADO.Sessions.Session'Class; Query : in ADO.SQL.Query'Class; Found : out Boolean) is Stmt : ADO.Statements.Query_Statement := Session.Create_Statement (Query, CALLBACK_DEF'Access); begin Stmt.Execute; if Stmt.Has_Elements then Object.Load (Stmt, Session); Stmt.Next; Found := not Stmt.Has_Elements; else Found := False; end if; end Find; overriding procedure Load (Object : in out Callback_Impl; Session : in out ADO.Sessions.Session'Class) is Found : Boolean; Query : ADO.SQL.Query; Id : constant ADO.Identifier := Object.Get_Key_Value; begin Query.Bind_Param (Position => 1, Value => Id); Query.Set_Filter ("id = ?"); Object.Find (Session, Query, Found); if not Found then raise ADO.Objects.NOT_FOUND; end if; end Load; procedure Save (Object : in out Callback_Impl; Session : in out ADO.Sessions.Master_Session'Class) is Stmt : ADO.Statements.Update_Statement := Session.Create_Statement (CALLBACK_DEF'Access); begin if Object.Is_Modified (1) then Stmt.Save_Field (Name => COL_0_2_NAME, -- id Value => Object.Get_Key); Object.Clear_Modified (1); end if; if Object.Is_Modified (2) then Stmt.Save_Field (Name => COL_1_2_NAME, -- url Value => Object.Url); Object.Clear_Modified (2); end if; if Object.Is_Modified (4) then Stmt.Save_Field (Name => COL_3_2_NAME, -- application_id Value => Object.Application); Object.Clear_Modified (4); end if; if Stmt.Has_Save_Fields then Object.Version := Object.Version + 1; Stmt.Save_Field (Name => "version", Value => Object.Version); Stmt.Set_Filter (Filter => "id = ? and version = ?"); Stmt.Add_Param (Value => Object.Get_Key); Stmt.Add_Param (Value => Object.Version - 1); declare Result : Integer; begin Stmt.Execute (Result); if Result /= 1 then if Result /= 0 then raise ADO.Objects.UPDATE_ERROR; else raise ADO.Objects.LAZY_LOCK; end if; end if; end; end if; end Save; procedure Create (Object : in out Callback_Impl; Session : in out ADO.Sessions.Master_Session'Class) is Query : ADO.Statements.Insert_Statement := Session.Create_Statement (CALLBACK_DEF'Access); Result : Integer; begin Object.Version := 1; Session.Allocate (Id => Object); Query.Save_Field (Name => COL_0_2_NAME, -- id Value => Object.Get_Key); Query.Save_Field (Name => COL_1_2_NAME, -- url Value => Object.Url); Query.Save_Field (Name => COL_2_2_NAME, -- version Value => Object.Version); Query.Save_Field (Name => COL_3_2_NAME, -- application_id Value => Object.Application); Query.Execute (Result); if Result /= 1 then raise ADO.Objects.INSERT_ERROR; end if; ADO.Objects.Set_Created (Object); end Create; procedure Delete (Object : in out Callback_Impl; Session : in out ADO.Sessions.Master_Session'Class) is Stmt : ADO.Statements.Delete_Statement := Session.Create_Statement (CALLBACK_DEF'Access); begin Stmt.Set_Filter (Filter => "id = ?"); Stmt.Add_Param (Value => Object.Get_Key); Stmt.Execute; end Delete; -- ------------------------------ -- Get the bean attribute identified by the name. -- ------------------------------ overriding function Get_Value (From : in Callback_Ref; Name : in String) return Util.Beans.Objects.Object is Obj : ADO.Objects.Object_Record_Access; Impl : access Callback_Impl; begin if From.Is_Null then return Util.Beans.Objects.Null_Object; end if; Obj := From.Get_Load_Object; Impl := Callback_Impl (Obj.all)'Access; if Name = "id" then return ADO.Objects.To_Object (Impl.Get_Key); elsif Name = "url" then return Util.Beans.Objects.To_Object (Impl.Url); end if; return Util.Beans.Objects.Null_Object; end Get_Value; procedure List (Object : in out Callback_Vector; Session : in out ADO.Sessions.Session'Class; Query : in ADO.SQL.Query'Class) is Stmt : ADO.Statements.Query_Statement := Session.Create_Statement (Query, CALLBACK_DEF'Access); begin Stmt.Execute; Callback_Vectors.Clear (Object); while Stmt.Has_Elements loop declare Item : Callback_Ref; Impl : constant Callback_Access := new Callback_Impl; begin Impl.Load (Stmt, Session); ADO.Objects.Set_Object (Item, Impl.all'Access); Object.Append (Item); end; Stmt.Next; end loop; end List; -- ------------------------------ -- Load the object from current iterator position -- ------------------------------ procedure Load (Object : in out Callback_Impl; Stmt : in out ADO.Statements.Query_Statement'Class; Session : in out ADO.Sessions.Session'Class) is begin Object.Set_Key_Value (Stmt.Get_Identifier (0)); Object.Url := Stmt.Get_Unbounded_String (1); if not Stmt.Is_Null (3) then Object.Application.Set_Key_Value (Stmt.Get_Identifier (3), Session); end if; Object.Version := Stmt.Get_Integer (2); ADO.Objects.Set_Created (Object); end Load; function Session_Key (Id : in ADO.Identifier) return ADO.Objects.Object_Key is Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER, Of_Class => SESSION_DEF'Access); begin ADO.Objects.Set_Value (Result, Id); return Result; end Session_Key; function Session_Key (Id : in String) return ADO.Objects.Object_Key is Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER, Of_Class => SESSION_DEF'Access); begin ADO.Objects.Set_Value (Result, Id); return Result; end Session_Key; function "=" (Left, Right : Session_Ref'Class) return Boolean is begin return ADO.Objects.Object_Ref'Class (Left) = ADO.Objects.Object_Ref'Class (Right); end "="; procedure Set_Field (Object : in out Session_Ref'Class; Impl : out Session_Access) is Result : ADO.Objects.Object_Record_Access; begin Object.Prepare_Modify (Result); Impl := Session_Impl (Result.all)'Access; end Set_Field; -- Internal method to allocate the Object_Record instance procedure Allocate (Object : in out Session_Ref) is Impl : Session_Access; begin Impl := new Session_Impl; Impl.Create_Date := ADO.DEFAULT_TIME; Impl.Expire_Date := ADO.DEFAULT_TIME; ADO.Objects.Set_Object (Object, Impl.all'Access); end Allocate; -- ---------------------------------------- -- Data object: Session -- ---------------------------------------- procedure Set_Id (Object : in out Session_Ref; Value : in ADO.Identifier) is Impl : Session_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Key_Value (Impl.all, 1, Value); end Set_Id; function Get_Id (Object : in Session_Ref) return ADO.Identifier is Impl : constant Session_Access := Session_Impl (Object.Get_Object.all)'Access; begin return Impl.Get_Key_Value; end Get_Id; procedure Set_Create_Date (Object : in out Session_Ref; Value : in Ada.Calendar.Time) is Impl : Session_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Time (Impl.all, 2, Impl.Create_Date, Value); end Set_Create_Date; function Get_Create_Date (Object : in Session_Ref) return Ada.Calendar.Time is Impl : constant Session_Access := Session_Impl (Object.Get_Load_Object.all)'Access; begin return Impl.Create_Date; end Get_Create_Date; procedure Set_Salt (Object : in out Session_Ref; Value : in String) is Impl : Session_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_String (Impl.all, 3, Impl.Salt, Value); end Set_Salt; procedure Set_Salt (Object : in out Session_Ref; Value : in Ada.Strings.Unbounded.Unbounded_String) is Impl : Session_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Unbounded_String (Impl.all, 3, Impl.Salt, Value); end Set_Salt; function Get_Salt (Object : in Session_Ref) return String is begin return Ada.Strings.Unbounded.To_String (Object.Get_Salt); end Get_Salt; function Get_Salt (Object : in Session_Ref) return Ada.Strings.Unbounded.Unbounded_String is Impl : constant Session_Access := Session_Impl (Object.Get_Load_Object.all)'Access; begin return Impl.Salt; end Get_Salt; procedure Set_Expire_Date (Object : in out Session_Ref; Value : in Ada.Calendar.Time) is Impl : Session_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Time (Impl.all, 4, Impl.Expire_Date, Value); end Set_Expire_Date; function Get_Expire_Date (Object : in Session_Ref) return Ada.Calendar.Time is Impl : constant Session_Access := Session_Impl (Object.Get_Load_Object.all)'Access; begin return Impl.Expire_Date; end Get_Expire_Date; procedure Set_Application (Object : in out Session_Ref; Value : in AWA.OAuth.Models.Application_Ref'Class) is Impl : Session_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Object (Impl.all, 5, Impl.Application, Value); end Set_Application; function Get_Application (Object : in Session_Ref) return AWA.OAuth.Models.Application_Ref'Class is Impl : constant Session_Access := Session_Impl (Object.Get_Load_Object.all)'Access; begin return Impl.Application; end Get_Application; procedure Set_User (Object : in out Session_Ref; Value : in AWA.Users.Models.User_Ref'Class) is Impl : Session_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Object (Impl.all, 6, Impl.User, Value); end Set_User; function Get_User (Object : in Session_Ref) return AWA.Users.Models.User_Ref'Class is Impl : constant Session_Access := Session_Impl (Object.Get_Load_Object.all)'Access; begin return Impl.User; end Get_User; procedure Set_Session (Object : in out Session_Ref; Value : in AWA.Users.Models.Session_Ref'Class) is Impl : Session_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Object (Impl.all, 7, Impl.Session, Value); end Set_Session; function Get_Session (Object : in Session_Ref) return AWA.Users.Models.Session_Ref'Class is Impl : constant Session_Access := Session_Impl (Object.Get_Load_Object.all)'Access; begin return Impl.Session; end Get_Session; -- Copy of the object. procedure Copy (Object : in Session_Ref; Into : in out Session_Ref) is Result : Session_Ref; begin if not Object.Is_Null then declare Impl : constant Session_Access := Session_Impl (Object.Get_Load_Object.all)'Access; Copy : constant Session_Access := new Session_Impl; begin ADO.Objects.Set_Object (Result, Copy.all'Access); Copy.Copy (Impl.all); Copy.Create_Date := Impl.Create_Date; Copy.Salt := Impl.Salt; Copy.Expire_Date := Impl.Expire_Date; Copy.Application := Impl.Application; Copy.User := Impl.User; Copy.Session := Impl.Session; end; end if; Into := Result; end Copy; procedure Find (Object : in out Session_Ref; Session : in out ADO.Sessions.Session'Class; Query : in ADO.SQL.Query'Class; Found : out Boolean) is Impl : constant Session_Access := new Session_Impl; begin Impl.Find (Session, Query, Found); if Found then ADO.Objects.Set_Object (Object, Impl.all'Access); else ADO.Objects.Set_Object (Object, null); Destroy (Impl); end if; end Find; procedure Load (Object : in out Session_Ref; Session : in out ADO.Sessions.Session'Class; Id : in ADO.Identifier) is Impl : constant Session_Access := new Session_Impl; Found : Boolean; Query : ADO.SQL.Query; begin Query.Bind_Param (Position => 1, Value => Id); Query.Set_Filter ("id = ?"); Impl.Find (Session, Query, Found); if not Found then Destroy (Impl); raise ADO.Objects.NOT_FOUND; end if; ADO.Objects.Set_Object (Object, Impl.all'Access); end Load; procedure Load (Object : in out Session_Ref; Session : in out ADO.Sessions.Session'Class; Id : in ADO.Identifier; Found : out Boolean) is Impl : constant Session_Access := new Session_Impl; Query : ADO.SQL.Query; begin Query.Bind_Param (Position => 1, Value => Id); Query.Set_Filter ("id = ?"); Impl.Find (Session, Query, Found); if not Found then Destroy (Impl); else ADO.Objects.Set_Object (Object, Impl.all'Access); end if; end Load; procedure Save (Object : in out Session_Ref; Session : in out ADO.Sessions.Master_Session'Class) is Impl : ADO.Objects.Object_Record_Access := Object.Get_Object; begin if Impl = null then Impl := new Session_Impl; ADO.Objects.Set_Object (Object, Impl); end if; if not ADO.Objects.Is_Created (Impl.all) then Impl.Create (Session); else Impl.Save (Session); end if; end Save; procedure Delete (Object : in out Session_Ref; Session : in out ADO.Sessions.Master_Session'Class) is Impl : constant ADO.Objects.Object_Record_Access := Object.Get_Object; begin if Impl /= null then Impl.Delete (Session); end if; end Delete; -- -------------------- -- Free the object -- -------------------- procedure Destroy (Object : access Session_Impl) is type Session_Impl_Ptr is access all Session_Impl; procedure Unchecked_Free is new Ada.Unchecked_Deallocation (Session_Impl, Session_Impl_Ptr); pragma Warnings (Off, "*redundant conversion*"); Ptr : Session_Impl_Ptr := Session_Impl (Object.all)'Access; pragma Warnings (On, "*redundant conversion*"); begin Unchecked_Free (Ptr); end Destroy; procedure Find (Object : in out Session_Impl; Session : in out ADO.Sessions.Session'Class; Query : in ADO.SQL.Query'Class; Found : out Boolean) is Stmt : ADO.Statements.Query_Statement := Session.Create_Statement (Query, SESSION_DEF'Access); begin Stmt.Execute; if Stmt.Has_Elements then Object.Load (Stmt, Session); Stmt.Next; Found := not Stmt.Has_Elements; else Found := False; end if; end Find; overriding procedure Load (Object : in out Session_Impl; Session : in out ADO.Sessions.Session'Class) is Found : Boolean; Query : ADO.SQL.Query; Id : constant ADO.Identifier := Object.Get_Key_Value; begin Query.Bind_Param (Position => 1, Value => Id); Query.Set_Filter ("id = ?"); Object.Find (Session, Query, Found); if not Found then raise ADO.Objects.NOT_FOUND; end if; end Load; procedure Save (Object : in out Session_Impl; Session : in out ADO.Sessions.Master_Session'Class) is Stmt : ADO.Statements.Update_Statement := Session.Create_Statement (SESSION_DEF'Access); begin if Object.Is_Modified (1) then Stmt.Save_Field (Name => COL_0_3_NAME, -- id Value => Object.Get_Key); Object.Clear_Modified (1); end if; if Object.Is_Modified (2) then Stmt.Save_Field (Name => COL_1_3_NAME, -- create_date Value => Object.Create_Date); Object.Clear_Modified (2); end if; if Object.Is_Modified (3) then Stmt.Save_Field (Name => COL_2_3_NAME, -- salt Value => Object.Salt); Object.Clear_Modified (3); end if; if Object.Is_Modified (4) then Stmt.Save_Field (Name => COL_3_3_NAME, -- expire_date Value => Object.Expire_Date); Object.Clear_Modified (4); end if; if Object.Is_Modified (5) then Stmt.Save_Field (Name => COL_4_3_NAME, -- application_id Value => Object.Application); Object.Clear_Modified (5); end if; if Object.Is_Modified (6) then Stmt.Save_Field (Name => COL_5_3_NAME, -- user_id Value => Object.User); Object.Clear_Modified (6); end if; if Object.Is_Modified (7) then Stmt.Save_Field (Name => COL_6_3_NAME, -- session_id Value => Object.Session); Object.Clear_Modified (7); end if; if Stmt.Has_Save_Fields then Stmt.Set_Filter (Filter => "id = ?"); Stmt.Add_Param (Value => Object.Get_Key); declare Result : Integer; begin Stmt.Execute (Result); if Result /= 1 then if Result /= 0 then raise ADO.Objects.UPDATE_ERROR; end if; end if; end; end if; end Save; procedure Create (Object : in out Session_Impl; Session : in out ADO.Sessions.Master_Session'Class) is Query : ADO.Statements.Insert_Statement := Session.Create_Statement (SESSION_DEF'Access); Result : Integer; begin Session.Allocate (Id => Object); Query.Save_Field (Name => COL_0_3_NAME, -- id Value => Object.Get_Key); Query.Save_Field (Name => COL_1_3_NAME, -- create_date Value => Object.Create_Date); Query.Save_Field (Name => COL_2_3_NAME, -- salt Value => Object.Salt); Query.Save_Field (Name => COL_3_3_NAME, -- expire_date Value => Object.Expire_Date); Query.Save_Field (Name => COL_4_3_NAME, -- application_id Value => Object.Application); Query.Save_Field (Name => COL_5_3_NAME, -- user_id Value => Object.User); Query.Save_Field (Name => COL_6_3_NAME, -- session_id Value => Object.Session); Query.Execute (Result); if Result /= 1 then raise ADO.Objects.INSERT_ERROR; end if; ADO.Objects.Set_Created (Object); end Create; procedure Delete (Object : in out Session_Impl; Session : in out ADO.Sessions.Master_Session'Class) is Stmt : ADO.Statements.Delete_Statement := Session.Create_Statement (SESSION_DEF'Access); begin Stmt.Set_Filter (Filter => "id = ?"); Stmt.Add_Param (Value => Object.Get_Key); Stmt.Execute; end Delete; -- ------------------------------ -- Get the bean attribute identified by the name. -- ------------------------------ overriding function Get_Value (From : in Session_Ref; Name : in String) return Util.Beans.Objects.Object is Obj : ADO.Objects.Object_Record_Access; Impl : access Session_Impl; begin if From.Is_Null then return Util.Beans.Objects.Null_Object; end if; Obj := From.Get_Load_Object; Impl := Session_Impl (Obj.all)'Access; if Name = "id" then return ADO.Objects.To_Object (Impl.Get_Key); elsif Name = "create_date" then return Util.Beans.Objects.Time.To_Object (Impl.Create_Date); elsif Name = "salt" then return Util.Beans.Objects.To_Object (Impl.Salt); elsif Name = "expire_date" then return Util.Beans.Objects.Time.To_Object (Impl.Expire_Date); end if; return Util.Beans.Objects.Null_Object; end Get_Value; procedure List (Object : in out Session_Vector; Session : in out ADO.Sessions.Session'Class; Query : in ADO.SQL.Query'Class) is Stmt : ADO.Statements.Query_Statement := Session.Create_Statement (Query, SESSION_DEF'Access); begin Stmt.Execute; Session_Vectors.Clear (Object); while Stmt.Has_Elements loop declare Item : Session_Ref; Impl : constant Session_Access := new Session_Impl; begin Impl.Load (Stmt, Session); ADO.Objects.Set_Object (Item, Impl.all'Access); Object.Append (Item); end; Stmt.Next; end loop; end List; -- ------------------------------ -- Load the object from current iterator position -- ------------------------------ procedure Load (Object : in out Session_Impl; Stmt : in out ADO.Statements.Query_Statement'Class; Session : in out ADO.Sessions.Session'Class) is begin Object.Set_Key_Value (Stmt.Get_Identifier (0)); Object.Create_Date := Stmt.Get_Time (1); Object.Salt := Stmt.Get_Unbounded_String (2); Object.Expire_Date := Stmt.Get_Time (3); if not Stmt.Is_Null (4) then Object.Application.Set_Key_Value (Stmt.Get_Identifier (4), Session); end if; if not Stmt.Is_Null (5) then Object.User.Set_Key_Value (Stmt.Get_Identifier (5), Session); end if; if not Stmt.Is_Null (6) then Object.Session.Set_Key_Value (Stmt.Get_Identifier (6), Session); end if; ADO.Objects.Set_Created (Object); end Load; end AWA.OAuth.Models;
tpantlr2-code/code/reference/ExprLR.g4
cgonul/antlr-poc
10
3737
<reponame>cgonul/antlr-poc<gh_stars>1-10 grammar ExprLR; expr : expr '^'<assoc=right> expr | expr '*' expr // match subexpressions joined with '*' operator | expr '+' expr // match subexpressions joined with '+' operator | INT // matches simple integer atom ; INT : '0'..'9'+ ; WS : [ \n]+ -> skip ;
uP Project (EMU8086).asm
Val-Matrix/Smart-Door-Control-System
0
5530
#start=simple.exe# #start=stepper_motor.exe# #start=traffic_lights.exe# JMP BEGIN PORT_THERMOPILE EQU 112 ;TEMPERATURE INPUT PORT_CAMERA EQU 110 ;FACE_MASK INPUT PORT_CMD1 EQU 003H ;FIRST PPI PORT_LED EQU 004 ;LED OUTPUT PORT_STEPPER EQU 007 ;STEPPER MOTOR OUTPUT PORT_CMD2 EQU 008H ;SECOND PPI (supposed to be 007H, but in conflict with virtual traffic light port of EMU8086) MAX_HALF_STEPS EQU 16 ;limit stepper motor rotation to 180 degrees (16 X 11.25 degrees) DATCW_HS DB 00000110B ;data to rotate stepper motor clockwise DB 00000100B DB 00000011B DB 00000010B DATCCW_HS DB 00000011B ;data to rotate stepper motor counterclocwise DB 00000001B DB 00000110B DB 00000010B BEGIN: MOV AL, 10011011B ;configure the 2 82C55s OUT PORT_CMD1, AL ;mode 00 input for all ports MOV AL, 10000000B OUT PORT_CMD2, AL ;mode 00 output for all ports MOV AX, 0800H ;set ES at 0800H for segment override in SRAM memory addressing MOV ES, AX MOV AL, 0 OUT PORT_LED, AL ;turn off all LEDs TEMPERATURE: IN AL, PORT_THERMOPILE CMP AL, 170 ;correspond to 35 degrees Celcius JB TEMPERATURE MOV ES:[0000H], AL ;copy thermopile data to memory address 8000H MOV AX, 0 FACE_MASK: IN AL, PORT_CAMERA MOV ES:[0001H], AL ;copy camera data to memory address 8001H MOV AX, 0 LED_RED: MOV BL, ES:[0000H] ;copy thermopile data from memory address 8000H to BL CMP BL, 221 ;correspond to 38 degrees Celcius JB LED_AMBER ;skip next instruction if < 38 degrees Celcius ADD AL, 1 ;activate bit for red light (>= 38 degrees Celcius) LED_AMBER: MOV BL, ES:[0001H] ;copy camera data from memory address 8001H to BL TEST BL, 1 JNZ LED_OUTPUT ;skip next instruction if face mask present (= 1) ADD AL, 2 ;activate bit for amber light (no face mask) LED_OUTPUT: OUT PORT_LED, AL ;send LEDs' data in AL to LEDs' port LED_CHECK: CMP AL, 0 ;detect red and amber LEDs JE LED_GREEN ;skip next few instructions if no red and amber LEDs MOV CX, 4CH MOV DX, 4B40H ;004C4B40H = 5000000 X 1 us = 5 s MOV AH, 86H INT 15H ;wait for 5 seconds MOV AL, 0 OUT PORT_LED, AL ;turn off all LEDs JMP TEMPERATURE ;return to temperature sensing LED_GREEN: MOV AX, 0 ADD AL, 4 ;activate bit for green light OUT PORT_LED, AL ;send LEDs' data in AL to LEDs' port CALL STEPPER_MOTOR_OPEN MOTION: MOV AH, 1H INT 21H ;receive PIR motion sensor input via keyboard TEST AL, 1 ;check if person has passed through the gate (= 1?) JZ MOTION ;loop if person hasn't passed through the gate (= 0) CALL STEPPER_MOTOR_CLOSE MOV AL, 0 OUT PORT_LED, AL ;turn off all LEDs JMP TEMPERATURE ;return to temperature sensing PROC STEPPER_MOTOR_OPEN MOV BX, OFFSET DATCW_HS ;copy clockwise rotation data's offset addresses to BX MOV SI, 0 ;address first byte in DATCW_HS MOV CX, 0 WAIT1: IN AL, 7 TEST AL, 10000000B ;test if stepper motor is ready to receive input JZ WAIT1 MOV AL, [BX][SI] OUT PORT_STEPPER, AL ;rotate stepper motor clockwise by 1 half-step (11.25 degrees) INC SI ;address next byte in DATCW_HS INC CX ;increase count for no. of half-steps executed CMP CX, MAX_HALF_STEPS ;check if CX reached count limit JAE EXIT_PROC1 ;exit procedure if CX reached count limit CMP SI, 4 ;check if SI is out of bounds of DATCW_HS JB WAIT1 MOV SI, 0 ;reset back to first byte of DATCW_HS JMP WAIT1 EXIT_PROC1: RET ;return to main program ENDP STEPPER_MOTOR_OPEN PROC STEPPER_MOTOR_CLOSE MOV BX, OFFSET DATCCW_HS ;copy counterclockwise rotation data's offset addresses to BX MOV SI, 0 ;address first byte in DATCCW_HS MOV CX, 0 WAIT2: IN AL, 7 TEST AL, 10000000B ;test if stepper motor is ready to receive input JZ WAIT2 MOV AL, [BX][SI] OUT PORT_STEPPER, AL ;rotate stepper motor counterclockwise by 1 half-step (11.25 degrees) INC SI ;address next byte in DATCCW_HS INC CX ;increase count for no. of half-steps executed CMP CX, MAX_HALF_STEPS ;check if CX reached count limit JAE EXIT_PROC2 ;exit procedure if CX reached count limit CMP SI, 4 ;check if SI is out of bounds of DATCCW_HS JB WAIT2 MOV SI, 0 ;reset back to first byte of DATCW_HS JMP WAIT2 EXIT_PROC2: RET ;return to main program ENDP STEPPER_MOTOR_CLOSE
arch/ARM/STM32/svd/stm32l4x6/stm32_svd-hash.ads
morbos/Ada_Drivers_Library
2
2959
-- This spec has been automatically generated from STM32L4x6.svd pragma Restrictions (No_Elaboration_Code); pragma Ada_2012; pragma Style_Checks (Off); with HAL; with System; package STM32_SVD.HASH is pragma Preelaborate; --------------- -- Registers -- --------------- subtype CR_DATATYPE_Field is HAL.UInt2; subtype CR_NBW_Field is HAL.UInt4; -- control register type CR_Register is record -- unspecified Reserved_0_1 : HAL.UInt2 := 16#0#; -- Write-only. Initialize message digest calculation INIT : Boolean := False; -- DMA enable DMAE : Boolean := False; -- Data type selection DATATYPE : CR_DATATYPE_Field := 16#0#; -- Mode selection MODE : Boolean := False; -- Algorithm selection ALGO0 : Boolean := False; -- Read-only. Number of words already pushed NBW : CR_NBW_Field := 16#0#; -- Read-only. DIN not empty DINNE : Boolean := False; -- Multiple DMA Transfers MDMAT : Boolean := False; -- unspecified Reserved_14_15 : HAL.UInt2 := 16#0#; -- Long key selection LKEY : Boolean := False; -- unspecified Reserved_17_17 : HAL.Bit := 16#0#; -- ALGO ALGO1 : Boolean := False; -- unspecified Reserved_19_31 : HAL.UInt13 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for CR_Register use record Reserved_0_1 at 0 range 0 .. 1; INIT at 0 range 2 .. 2; DMAE at 0 range 3 .. 3; DATATYPE at 0 range 4 .. 5; MODE at 0 range 6 .. 6; ALGO0 at 0 range 7 .. 7; NBW at 0 range 8 .. 11; DINNE at 0 range 12 .. 12; MDMAT at 0 range 13 .. 13; Reserved_14_15 at 0 range 14 .. 15; LKEY at 0 range 16 .. 16; Reserved_17_17 at 0 range 17 .. 17; ALGO1 at 0 range 18 .. 18; Reserved_19_31 at 0 range 19 .. 31; end record; subtype STR_NBLW_Field is HAL.UInt5; -- start register type STR_Register is record -- Number of valid bits in the last word of the message NBLW : STR_NBLW_Field := 16#0#; -- unspecified Reserved_5_7 : HAL.UInt3 := 16#0#; -- Write-only. Digest calculation DCAL : Boolean := False; -- unspecified Reserved_9_31 : HAL.UInt23 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for STR_Register use record NBLW at 0 range 0 .. 4; Reserved_5_7 at 0 range 5 .. 7; DCAL at 0 range 8 .. 8; Reserved_9_31 at 0 range 9 .. 31; end record; -- interrupt enable register type IMR_Register is record -- Data input interrupt enable DINIE : Boolean := False; -- Digest calculation completion interrupt enable DCIE : Boolean := False; -- unspecified Reserved_2_31 : HAL.UInt30 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for IMR_Register use record DINIE at 0 range 0 .. 0; DCIE at 0 range 1 .. 1; Reserved_2_31 at 0 range 2 .. 31; end record; -- status register type SR_Register is record -- Data input interrupt status DINIS : Boolean := True; -- Digest calculation completion interrupt status DCIS : Boolean := False; -- Read-only. DMA Status DMAS : Boolean := False; -- Read-only. Busy bit BUSY : Boolean := False; -- unspecified Reserved_4_31 : HAL.UInt28 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for SR_Register use record DINIS at 0 range 0 .. 0; DCIS at 0 range 1 .. 1; DMAS at 0 range 2 .. 2; BUSY at 0 range 3 .. 3; Reserved_4_31 at 0 range 4 .. 31; end record; ----------------- -- Peripherals -- ----------------- -- Hash processor type HASH_Peripheral is record -- control register CR : aliased CR_Register; -- data input register DIN : aliased HAL.UInt32; -- start register STR : aliased STR_Register; -- digest registers HR0 : aliased HAL.UInt32; -- interrupt enable register IMR : aliased IMR_Register; -- status register SR : aliased SR_Register; -- context swap registers CSR0 : aliased HAL.UInt32; -- context swap registers CSR1 : aliased HAL.UInt32; -- context swap registers CSR2 : aliased HAL.UInt32; -- context swap registers CSR3 : aliased HAL.UInt32; -- context swap registers CSR4 : aliased HAL.UInt32; -- context swap registers CSR5 : aliased HAL.UInt32; -- context swap registers CSR6 : aliased HAL.UInt32; -- context swap registers CSR7 : aliased HAL.UInt32; -- context swap registers CSR8 : aliased HAL.UInt32; -- context swap registers CSR9 : aliased HAL.UInt32; -- context swap registers CSR10 : aliased HAL.UInt32; -- context swap registers CSR11 : aliased HAL.UInt32; -- context swap registers CSR12 : aliased HAL.UInt32; -- context swap registers CSR13 : aliased HAL.UInt32; -- context swap registers CSR14 : aliased HAL.UInt32; -- context swap registers CSR15 : aliased HAL.UInt32; -- context swap registers CSR16 : aliased HAL.UInt32; -- context swap registers CSR17 : aliased HAL.UInt32; -- context swap registers CSR18 : aliased HAL.UInt32; -- context swap registers CSR19 : aliased HAL.UInt32; -- context swap registers CSR20 : aliased HAL.UInt32; -- context swap registers CSR21 : aliased HAL.UInt32; -- context swap registers CSR22 : aliased HAL.UInt32; -- context swap registers CSR23 : aliased HAL.UInt32; -- context swap registers CSR24 : aliased HAL.UInt32; -- context swap registers CSR25 : aliased HAL.UInt32; -- context swap registers CSR26 : aliased HAL.UInt32; -- context swap registers CSR27 : aliased HAL.UInt32; -- context swap registers CSR28 : aliased HAL.UInt32; -- context swap registers CSR29 : aliased HAL.UInt32; -- context swap registers CSR30 : aliased HAL.UInt32; -- context swap registers CSR31 : aliased HAL.UInt32; -- context swap registers CSR32 : aliased HAL.UInt32; -- context swap registers CSR33 : aliased HAL.UInt32; -- context swap registers CSR34 : aliased HAL.UInt32; -- context swap registers CSR35 : aliased HAL.UInt32; -- context swap registers CSR36 : aliased HAL.UInt32; -- context swap registers CSR37 : aliased HAL.UInt32; -- context swap registers CSR38 : aliased HAL.UInt32; -- context swap registers CSR39 : aliased HAL.UInt32; -- context swap registers CSR40 : aliased HAL.UInt32; -- context swap registers CSR41 : aliased HAL.UInt32; -- context swap registers CSR42 : aliased HAL.UInt32; -- context swap registers CSR43 : aliased HAL.UInt32; -- context swap registers CSR44 : aliased HAL.UInt32; -- context swap registers CSR45 : aliased HAL.UInt32; -- context swap registers CSR46 : aliased HAL.UInt32; -- context swap registers CSR47 : aliased HAL.UInt32; -- context swap registers CSR48 : aliased HAL.UInt32; -- context swap registers CSR49 : aliased HAL.UInt32; -- context swap registers CSR50 : aliased HAL.UInt32; -- context swap registers CSR51 : aliased HAL.UInt32; -- context swap registers CSR52 : aliased HAL.UInt32; -- context swap registers CSR53 : aliased HAL.UInt32; -- HASH digest register HASH_HR0 : aliased HAL.UInt32; -- read-only HASH_HR1 : aliased HAL.UInt32; -- read-only HASH_HR2 : aliased HAL.UInt32; -- read-only HASH_HR3 : aliased HAL.UInt32; -- read-only HASH_HR4 : aliased HAL.UInt32; -- read-only HASH_HR5 : aliased HAL.UInt32; -- read-only HASH_HR6 : aliased HAL.UInt32; -- read-only HASH_HR7 : aliased HAL.UInt32; end record with Volatile; for HASH_Peripheral use record CR at 16#0# range 0 .. 31; DIN at 16#4# range 0 .. 31; STR at 16#8# range 0 .. 31; HR0 at 16#C# range 0 .. 31; IMR at 16#20# range 0 .. 31; SR at 16#24# range 0 .. 31; CSR0 at 16#F8# range 0 .. 31; CSR1 at 16#FC# range 0 .. 31; CSR2 at 16#100# range 0 .. 31; CSR3 at 16#104# range 0 .. 31; CSR4 at 16#108# range 0 .. 31; CSR5 at 16#10C# range 0 .. 31; CSR6 at 16#110# range 0 .. 31; CSR7 at 16#114# range 0 .. 31; CSR8 at 16#118# range 0 .. 31; CSR9 at 16#11C# range 0 .. 31; CSR10 at 16#120# range 0 .. 31; CSR11 at 16#124# range 0 .. 31; CSR12 at 16#128# range 0 .. 31; CSR13 at 16#12C# range 0 .. 31; CSR14 at 16#130# range 0 .. 31; CSR15 at 16#134# range 0 .. 31; CSR16 at 16#138# range 0 .. 31; CSR17 at 16#13C# range 0 .. 31; CSR18 at 16#140# range 0 .. 31; CSR19 at 16#144# range 0 .. 31; CSR20 at 16#148# range 0 .. 31; CSR21 at 16#14C# range 0 .. 31; CSR22 at 16#150# range 0 .. 31; CSR23 at 16#154# range 0 .. 31; CSR24 at 16#158# range 0 .. 31; CSR25 at 16#15C# range 0 .. 31; CSR26 at 16#160# range 0 .. 31; CSR27 at 16#164# range 0 .. 31; CSR28 at 16#168# range 0 .. 31; CSR29 at 16#16C# range 0 .. 31; CSR30 at 16#170# range 0 .. 31; CSR31 at 16#174# range 0 .. 31; CSR32 at 16#178# range 0 .. 31; CSR33 at 16#17C# range 0 .. 31; CSR34 at 16#180# range 0 .. 31; CSR35 at 16#184# range 0 .. 31; CSR36 at 16#188# range 0 .. 31; CSR37 at 16#18C# range 0 .. 31; CSR38 at 16#190# range 0 .. 31; CSR39 at 16#194# range 0 .. 31; CSR40 at 16#198# range 0 .. 31; CSR41 at 16#19C# range 0 .. 31; CSR42 at 16#1A0# range 0 .. 31; CSR43 at 16#1A4# range 0 .. 31; CSR44 at 16#1A8# range 0 .. 31; CSR45 at 16#1AC# range 0 .. 31; CSR46 at 16#1B0# range 0 .. 31; CSR47 at 16#1B4# range 0 .. 31; CSR48 at 16#1B8# range 0 .. 31; CSR49 at 16#1BC# range 0 .. 31; CSR50 at 16#1C0# range 0 .. 31; CSR51 at 16#1C4# range 0 .. 31; CSR52 at 16#1C8# range 0 .. 31; CSR53 at 16#1CC# range 0 .. 31; HASH_HR0 at 16#310# range 0 .. 31; HASH_HR1 at 16#314# range 0 .. 31; HASH_HR2 at 16#318# range 0 .. 31; HASH_HR3 at 16#31C# range 0 .. 31; HASH_HR4 at 16#320# range 0 .. 31; HASH_HR5 at 16#324# range 0 .. 31; HASH_HR6 at 16#328# range 0 .. 31; HASH_HR7 at 16#32C# range 0 .. 31; end record; -- Hash processor HASH_Periph : aliased HASH_Peripheral with Import, Address => System'To_Address (16#50060400#); end STM32_SVD.HASH;
bessel_func1.asm
rgimad/fasm_programs
8
175772
<gh_stars>1-10 format PE64 Console 5.0 entry main include 'C:\Program Files (x86)\fasmw17322\INCLUDE\win64a.inc' ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; section '.text' code readable executable main: ; for printf, scanf etc. we use cinvoke (__cdecl), invoke is used for __stdcall functions cinvoke printf, msg_enter_x cinvoke scanf, x_read_fmt, x mov rax, 0.0 ; for double values we must write .0 always. movq xmm5, rax ; xmm5 is s mov rax, 1.0 ; 64bit mode allows only signed 32bit immediates. Only instruction that can take 64bit immediate is "mov rax, imm64" movq xmm6, rax ; xmm6 is p mov ecx, 0 ; ecx is n movq xmm7, [x] ; xmm7 is x while_1: ; check if abs(p) >= eps. if false break movq xmm0, xmm6 pslld xmm0, 1 psrld xmm0, 1 comisd xmm0, [eps] jc while_1_end ; if abs(p) < eps then break movq xmm1, xmm5 addsd xmm1, xmm6 movq xmm5, xmm1 inc ecx cvtsi2sd xmm1, ecx ; convert int to double. ~ xmm1 = (double)n; mulsd xmm1, xmm1 ; now xmm1 = n^2 mov rax, 4.0 movq xmm4, rax mulsd xmm1, xmm4 ; now xmm1 = 4*(n^2) movq xmm0, xmm7 mulsd xmm0, xmm0 ; now xmm0 = x^2 mov rax, -1.0 movq xmm4, rax mulsd xmm0, xmm4 ; now xmm0 = -(x^2) movq xmm3, xmm6 mulsd xmm3, xmm0 divsd xmm3, xmm1 movq xmm6, xmm3 jmp while_1 while_1_end: movq [s], xmm5 cinvoke printf, <"J0(%f) = %f", 13, 10, 13, 10>, [x], [s] ;cinvoke getchar ; first getchar will read \n ;cinvoke getchar jmp main Exit: ; exit from program invoke ExitProcess, 0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; section '.data' data readable writeable ; db - reserve byte, dw - reserve word, dd - reserve dword, dq - reserve qword eps dq 0.000001 ; double eps = 0.000001; // epsilon x dq ? ; double x; // x value n dd ? ; int n; // step counter s dq ? ; double s; // current sum p dq ? ; double p; // current member of series msg_enter_x db 'Enter x: ', 13, 10, 0 x_read_fmt db '%lf', 0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;section '.bss' readable writeable ; statically-allocated variables that are not explicitly initialized to any value ; readBuf db ? ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; section '.idata' import data readable library msvcrt,'MSVCRT.DLL',\ kernel,'KERNEL32.DLL' import kernel,\ ExitProcess, 'ExitProcess' ;SetConsoleTitleA, 'SetConsoleTitleA',\ ;GetStdHandle, 'GetStdHandle',\ ;WriteConsoleA, 'WriteConsoleA',\ ;ReadConsoleA, 'ReadConsoleA' import msvcrt,\ puts,'puts',\ scanf,'scanf',\ printf,'printf',\ getchar,'getchar',\ system,'system',\ exit,'exit'
alloy4fun_models/trashltl/models/4/z9HWK9n52MbyXiqWB.als
Kaixi26/org.alloytools.alloy
0
4167
open main pred idz9HWK9n52MbyXiqWB_prop5 { some f:File | eventually f in Trash and f.link in Trash } pred __repair { idz9HWK9n52MbyXiqWB_prop5 } check __repair { idz9HWK9n52MbyXiqWB_prop5 <=> prop5o }
src/orig/dds-request_reply-treqtrepsimplereplier.adb
alexcamposruiz/dds-requestreply
0
16377
<filename>src/orig/dds-request_reply-treqtrepsimplereplier.adb package body DDS.Request_Reply.treqtrepsimplereplier is -- /* $Id$ -- -- (c) Copyright, Real-Time Innovations, 2012-2016. -- All rights reserved. -- No duplications, whole or partial, manual or electronic, may be made -- without express written permission. Any such copies, or -- revisions thereof, must display this notice unaltered. -- This code contains trade secrets of Real-Time Innovations, Inc. -- -- modification history -- --------------------- -- 5.20,20aug14,acr Moved out function that previously was inside macro and -- duplicated a symbol when declaring more than -- one SimpleReplier for different types (REQREPLY-18) -- 1.0a,2mar12,jch Created. -- ============================================================================ */ -- -- #include "log/log_makeheader.h" -- -- /*#include <stdlib.h>*/ -- -- #ifndef log_common_h -- #include "log/log_common.h" -- #endif -- -- #ifndef connext_c_replier_h -- #include "connext_c/connext_c_replier.h" -- #endif -- -- #include "connext_c/connext_c_simple_replier.h" -- -- #ifndef connext_c_replier_impl_h -- #include "connext_c/connext_c_replier_impl.h" -- #endif -- -- #include "dds_c/dds_c_log_impl.h" -- -- #include "connext_c/connext_c_untyped_impl.h" -- -- /* TODO: add RTI_Connext_SimpleReplier type here -- * Type will contain TReqTRepReplier in it */ -- /* TODO: consider abstracting out common TypeSupport defines to common.gen file & include it */ -- -- #define DDS_CURRENT_SUBMODULE DDS_SUBMODULE_MASK_DATA -- -- #if defined(TReq) && defined(TRep) -- -- #define TReqTRep_SimpleName_c(TReq, TRep) concatenate(TReq, TRep) -- #define TReqTRep_SimpleName TReqTRep_SimpleName_c(TReq, TRep) -- -- #ifdef TSimpleReplier -- #define TReqTRepSimpleReplier_name_c(SimpleReplier_name) SimpleReplier_name -- #define TReqTRepSimpleReplier_name TReqTRepSimpleReplier_name_c(TSimpleReplier) -- #define TReqTRepSimpleReplier TReqTRepSimpleReplier_name_c(TSimpleReplier) -- #else -- #define TReqTRepSimpleReplier_name_c(TReqTRep_SimpleName) concatenate(TReqTRep_SimpleName, SimpleReplier) -- #define TReqTRepSimpleReplier_name TReqTRepSimpleReplier_name_c(TReqTRep_SimpleName) -- #define TReqTRepSimpleReplier TReqTRepSimpleReplier_name_c(TReqTRep_name) -- #endif -- -- #define TReqTypeSupport_c(TReq) concatenate(TReq, TypeSupport) -- #define TReqTypeSupport TReqTypeSupport_c(TReq) -- -- #define TRepTypeSupport_c(TRep) concatenate(TRep, TypeSupport) -- #define TRepTypeSupport TRepTypeSupport_c(TRep) -- -- #define TRepTypeSupport_copy_data_c(TRepTypeSupport) concatenate(TRepTypeSupport, _copy_data) -- #define TRepTypeSupport_copy_data TRepTypeSupport_copy_data_c(TRepTypeSupport) -- -- #define TReqTypeSupport_register_type_c(TReqTypeSupport) concatenate(TReqTypeSupport, _register_type) -- #define TReqTypeSupport_register_type TReqTypeSupport_register_type_c(TReqTypeSupport) -- -- #define TReqTypeSupport_get_type_name_c(TReqTypeSupport) concatenate(TReqTypeSupport, _get_type_name) -- #define TReqTypeSupport_get_type_name TReqTypeSupport_get_type_name_c(TReqTypeSupport) -- -- #define TRepTypeSupport_register_type_c(TRepTypeSupport) concatenate(TRepTypeSupport, _register_type) -- #define TRepTypeSupport_register_type TRepTypeSupport_register_type_c(TRepTypeSupport) -- -- #define TRepTypeSupport_get_type_name_c(TRepTypeSupport) concatenate(TRepTypeSupport, _get_type_name) -- #define TRepTypeSupport_get_type_name TRepTypeSupport_get_type_name_c(TRepTypeSupport) -- -- #define TReqTRepSimpleReplier_on_data_available_c(TReqTRepSimpleReplier_name) concatenate(TReqTRepSimpleReplier_name, _on_data_available) -- #define TReqTRepSimpleReplier_on_data_available TReqTRepSimpleReplier_on_data_available_c(TReqTRepSimpleReplier_name) -- -- #define TReqDataReader_c(TReq) concatenate(TReq, DataReader) -- #define TReqDataReader TReqDataReader_c(TReq) -- -- #define TRepDataWriter_c(TRep) concatenate(TRep, DataWriter) -- #define TRepDataWriter TRepDataWriter_c(TRep) -- -- #define TReqSeq_c(TReq) concatenate(TReq, Seq) -- #define TReqSeq TReqSeq_c(TReq) -- -- #define TReqDataReader_narrow_c(TReqDataReader) concatenate(TReqDataReader, _narrow) -- #define TReqDataReader_narrow TReqDataReader_narrow_c(TReqDataReader) -- -- #define TRepDataWriter_narrow_c(TRepDataWriter) concatenate(TRepDataWriter, _narrow) -- #define TRepDataWriter_narrow TRepDataWriter_narrow_c(TRepDataWriter) -- -- #define TReqDataReader_take_c(TReqDataReader) concatenate(TReqDataReader, _take) -- #define TReqDataReader_take TReqDataReader_take_c(TReqDataReader) -- -- #define TReqSeq_get_length_c(TReqSeq) concatenate(TReqSeq, _get_length) -- #define TReqSeq_get_length TReqSeq_get_length_c(TReqSeq) -- -- #define TReqSeq_get_reference_c(TReqSeq) concatenate(TReqSeq, _get_reference) -- #define TReqSeq_get_reference TReqSeq_get_reference_c(TReqSeq) -- -- #define TRepDataWriter_write_w_params_c(TRepDataWriter) concatenate(TRepDataWriter, _write_w_params) -- #define TRepDataWriter_write_w_params TRepDataWriter_write_w_params_c(TRepDataWriter) -- -- #define TReqDataReader_return_loan_c(TReqDataReader) concatenate(TReqDataReader, _return_loan) -- #define TReqDataReader_return_loan TReqDataReader_return_loan_c(TReqDataReader) -- -- #define TReqTRepSimpleReplier_create_c(TReqTRepSimpleReplier_name) concatenate(TReqTRepSimpleReplier_name, _create) -- #define TReqTRepSimpleReplier_create TReqTRepSimpleReplier_create_c(TReqTRepSimpleReplier_name) -- -- #define TReqTRepSimpleReplier_create_w_params_c(TReqTRepSimpleReplier_name) concatenate(TReqTRepSimpleReplier_name, _create_w_params) -- #define TReqTRepSimpleReplier_create_w_params TReqTRepSimpleReplier_create_w_params_c(TReqTRepSimpleReplier_name) -- -- #define TReqTRepSimpleReplier_delete_c(TReqTRepSimpleReplier_name) concatenate(TReqTRepSimpleReplier_name, _delete) -- #define TReqTRepSimpleReplier_delete TReqTRepSimpleReplier_delete_c(TReqTRepSimpleReplier_name) -- -- #define TReqTRepSimpleReplier_get_request_datareader_c(TReqTRepSimpleReplier_name) concatenate(TReqTRepSimpleReplier_name, _get_request_datareader) -- #define TReqTRepSimpleReplier_get_request_datareader TReqTRepSimpleReplier_get_request_datareader_c(TReqTRepSimpleReplier_name) -- -- #define TReqTRepSimpleReplier_get_reply_datawriter_c(TReqTRepSimpleReplier_name) concatenate(TReqTRepSimpleReplier_name, _get_reply_datawriter) -- #define TReqTRepSimpleReplier_get_reply_datawriter TReqTRepSimpleReplier_get_reply_datawriter_c(TReqTRepSimpleReplier_name) -- -- void TReqTRepSimpleReplier_on_data_available( -- void* listener_data, DDS_DataReader* reader) -- { -- struct TReqSeq typed_seq = DDS_SEQUENCE_INITIALIZER; -- struct DDS_SampleInfoSeq info_seq = DDS_SEQUENCE_INITIALIZER; -- DDS_ReturnCode_t retcode = DDS_RETCODE_OK; -- int i = 0; -- TReqTRepSimpleReplier* self = (TReqTRepSimpleReplier*) listener_data; -- -- retcode = TReqTRepReplier_take_requests( -- (TReqTRepReplier *) self, -- &typed_seq, &info_seq, -- DDS_LENGTH_UNLIMITED); -- -- if (retcode != DDS_RETCODE_OK) { -- DDSLog_exception(&RTI_LOG_GET_FAILURE_s, -- "requests from Replier"); -- return; -- } -- -- for (i = 0; i < TReqSeq_get_length(&typed_seq); ++i) { -- struct DDS_SampleIdentity_t id = DDS_UNKNOWN_SAMPLE_IDENTITY; -- -- TReq* sample = TReqSeq_get_reference(&typed_seq, i); -- struct DDS_SampleInfo* info = -- DDS_SampleInfoSeq_get_reference(&info_seq, i); -- -- TRep* reply = (TRep*)self->parent.simpleListener.on_request_available( -- &self->parent.simpleListener, (void *) sample, info); -- -- if (reply == NULL) { -- continue; -- } -- -- DDS_GUID_copy(&id.writer_guid, -- &info->original_publication_virtual_guid); -- id.sequence_number = info->original_publication_virtual_sequence_number; -- -- retcode = TReqTRepReplier_send_reply( -- (TReqTRepReplier *) self, reply, &id); -- if (retcode != DDS_RETCODE_OK) { -- DDSLog_exception(&RTI_LOG_ANY_FAILURE_s, -- "write reply"); -- } -- -- self->parent.simpleListener.return_loan( -- &self->parent.simpleListener, (void*)reply); -- } -- -- retcode = TReqTRepReplier_return_loan( -- (TReqTRepReplier *) self, &typed_seq, &info_seq); -- -- if (retcode != DDS_RETCODE_OK) { -- DDSLog_exception(&RTI_LOG_ANY_FAILURE_s, -- "return loan to Replier"); -- } -- } -- -- /* TODO: move out of macro */ -- DDS_ReturnCode_t TReqTRepSimpleReplier_delete(TReqTRepSimpleReplier * self) -- { -- DDS_ReturnCode_t retcode = DDS_RETCODE_OK; -- -- /* TODO: error on precondition */ -- if(self != NULL) { -- if(self->parent._impl != NULL) { -- RTI_Connext_EntityUntypedImpl_delete(self->parent._impl); -- } -- RTIOsapiHeap_free(self); -- } -- -- return retcode; -- } -- -- TReqTRepSimpleReplier* TReqTRepSimpleReplier_create( -- DDS_DomainParticipant * participant, -- char * service_name, -- RTI_Connext_SimpleReplierListener * listener) -- { -- TReqTRepSimpleReplier* replier = NULL; -- -- RTI_Connext_SimpleReplierParams params = -- RTI_Connext_SimpleReplierParams_INITIALIZER; -- -- params.participant = participant; -- params.service_name = (char *) service_name; -- params.simple_listener = listener; -- -- replier = TReqTRepSimpleReplier_create_w_params(&params); -- if(replier == NULL) { -- DDSLog_exception(&RTI_LOG_CREATION_FAILURE_s, -- "SimpleReplier with params"); -- return NULL; -- } -- -- return replier; -- } -- -- TReqTRepSimpleReplier* TReqTRepSimpleReplier_create_w_params( -- RTI_Connext_SimpleReplierParams* params) -- { -- TReqTRepSimpleReplier * replier = NULL; -- DDS_ReturnCode_t retCode = DDS_RETCODE_OK; -- struct DDS_DataReaderListener reader_listener = -- DDS_DataReaderListener_INITIALIZER; -- RTI_Connext_EntityParams entity_params; -- -- if(params == NULL) { -- DDSLog_exception(&DDS_LOG_BAD_PARAMETER_s, -- "params"); -- return NULL; -- } -- -- if (params->simple_listener == NULL) { -- DDSLog_exception(&DDS_LOG_BAD_PARAMETER_s, -- "listener is required"); -- return NULL; -- } -- -- RTIOsapiHeap_allocateStructure(&replier, TReqTRepSimpleReplier); -- if(replier == NULL) { -- DDSLog_exception(&RTI_LOG_ANY_FAILURE_s, -- "error creating a TReqTRepRequester"); -- replier = NULL; -- goto finish; -- } -- -- replier->parent._impl = NULL; -- replier->parent.simpleListener = *params->simple_listener; -- -- replier->parent._impl = RTI_Connext_ReplierUntypedImpl_create(); -- if(replier->parent._impl == NULL) { -- DDSLog_exception(&RTI_LOG_CREATION_FAILURE_s, -- "ReplierUntypedImpl"); -- goto finish; -- } -- -- reader_listener.on_data_available = TReqTRepSimpleReplier_on_data_available; -- reader_listener.as_listener.listener_data = replier; -- -- RTI_Connext_SimpleReplierParams_to_entityparams(params, &entity_params); -- retCode = RTI_Connext_ReplierUntypedImpl_initialize( -- replier->parent._impl, -- &entity_params, -- &TReqTypeSupport_register_type, -- TReqTypeSupport_get_type_name(), -- &TRepTypeSupport_register_type, -- TRepTypeSupport_get_type_name(), -- sizeof(TReq), -- &reader_listener); -- -- if(retCode != DDS_RETCODE_OK) { -- DDSLog_exception(&RTI_LOG_ANY_FAILURE_s, -- "initialize ReplierUntypedImpl"); -- goto finish; -- } -- -- return replier; -- -- finish: -- if(replier != NULL) { -- TReqTRepSimpleReplier_delete(replier); -- } -- return NULL; -- } -- -- TReqDataReader* TReqTRepSimpleReplier_get_request_datareader( -- TReqTRepSimpleReplier* self) -- { -- return TReqTRepReplier_get_request_datareader((TReqTRepReplier* )self); -- } -- -- TRepDataWriter* TReqTRepSimpleReplier_get_reply_datawriter( -- TReqTRepSimpleReplier* self) -- { -- return TReqTRepReplier_get_reply_datawriter((TReqTRepReplier* )self); -- } -- -- #endif -- /* ----------------------------------------------------------------- */ -- /* End of $Id$ */ end DDS.Request_Reply.treqtrepsimplereplier;
other.7z/NEWS.7z/NEWS/テープリストア/NEWS_05/NEWS_05.tar/home/kimura/polygon.lzh/polygon/sample0/main.asm
prismotizm/gigaleak
0
177043
Name: main.asm Type: file Size: 5274 Last-Modified: '1992-09-24T01:08:42Z' SHA-1: CED8E1B076F92DE338DA96019AA80ACF37F7780A Description: null
tests/42.asm
tcort/lmc
2
13227
<reponame>tcort/lmc LDA CELL // load data from CELL into accumulator OUT // output value to user HLT // halt CELL DAT 42
alloy4fun_models/trashltl/models/14/bPHssAJi2KdSHDv2Z.als
Kaixi26/org.alloytools.alloy
0
694
<gh_stars>0 open main pred idbPHssAJi2KdSHDv2Z_prop15 { always some f : File | eventually f in Trash } pred __repair { idbPHssAJi2KdSHDv2Z_prop15 } check __repair { idbPHssAJi2KdSHDv2Z_prop15 <=> prop15o }
Transynther/x86/_processed/NONE/_xt_sm_/i9-9900K_12_0xca.log_21829_356.asm
ljhsiun2/medusa
9
14360
<gh_stars>1-10 .global s_prepare_buffers s_prepare_buffers: push %r11 push %r13 push %r8 push %rax push %rbp push %rcx push %rdi push %rsi lea addresses_D_ht+0x1bc22, %r8 nop cmp %r13, %r13 mov $0x6162636465666768, %rsi movq %rsi, (%r8) nop nop xor %r13, %r13 lea addresses_WC_ht+0x193fa, %rcx clflush (%rcx) nop nop nop lfence vmovups (%rcx), %ymm1 vextracti128 $1, %ymm1, %xmm1 vpextrq $0, %xmm1, %rax nop nop nop sub $6529, %rax lea addresses_D_ht+0xe870, %r13 nop nop nop nop xor $56949, %r11 movb $0x61, (%r13) nop nop nop nop nop inc %r13 lea addresses_normal_ht+0x1e238, %r11 nop nop nop nop sub $38517, %rsi and $0xffffffffffffffc0, %r11 movntdqa (%r11), %xmm0 vpextrq $1, %xmm0, %r13 and %rcx, %rcx lea addresses_WT_ht+0xa24e, %r13 nop nop cmp %r11, %r11 vmovups (%r13), %ymm6 vextracti128 $0, %ymm6, %xmm6 vpextrq $0, %xmm6, %rbp nop nop nop dec %rbp lea addresses_UC_ht+0x1bc8, %rax nop nop xor $20225, %r8 mov $0x6162636465666768, %rsi movq %rsi, %xmm1 vmovups %ymm1, (%rax) nop add %r11, %r11 lea addresses_WT_ht+0x14569, %r11 clflush (%r11) nop nop nop xor %rbp, %rbp mov $0x6162636465666768, %r8 movq %r8, %xmm0 vmovups %ymm0, (%r11) nop nop sub $7898, %rsi lea addresses_A_ht+0x1cb8c, %r11 nop nop nop cmp $14359, %rcx mov (%r11), %r8w nop cmp $2849, %rax lea addresses_normal_ht+0x3144, %rsi lea addresses_WT_ht+0xb0f4, %rdi nop nop nop nop dec %r13 mov $41, %rcx rep movsq nop nop nop nop nop xor $28049, %rsi lea addresses_UC_ht+0x1b680, %rdi nop nop nop xor $22228, %r8 mov $0x6162636465666768, %r13 movq %r13, (%rdi) cmp %rdi, %rdi lea addresses_WC_ht+0x15f24, %r8 nop nop nop and $1466, %r13 mov (%r8), %bp nop nop nop nop nop xor $12325, %r11 lea addresses_normal_ht+0x1bf74, %r11 nop nop nop nop nop mfence mov $0x6162636465666768, %rax movq %rax, (%r11) dec %rsi lea addresses_D_ht+0x3e24, %rsi lea addresses_UC_ht+0xf024, %rdi nop nop nop sub %r8, %r8 mov $44, %rcx rep movsq nop nop nop nop inc %rax pop %rsi pop %rdi pop %rcx pop %rbp pop %rax pop %r8 pop %r13 pop %r11 ret .global s_faulty_load s_faulty_load: push %r10 push %r12 push %r13 push %r8 push %rbx push %rdi push %rsi // Store lea addresses_WC+0x18824, %r12 nop nop nop nop nop sub %r8, %r8 mov $0x5152535455565758, %rdi movq %rdi, (%r12) nop nop nop sub %rsi, %rsi // Store lea addresses_D+0x16c24, %rbx nop nop nop nop sub %r13, %r13 mov $0x5152535455565758, %r8 movq %r8, %xmm5 movups %xmm5, (%rbx) and %r10, %r10 // Store mov $0xfa4, %r13 nop xor %r12, %r12 mov $0x5152535455565758, %rsi movq %rsi, (%r13) nop nop nop xor $47015, %rdi // Faulty Load lea addresses_WC+0x18824, %rsi nop nop xor %r10, %r10 vmovups (%rsi), %ymm7 vextracti128 $0, %ymm7, %xmm7 vpextrq $0, %xmm7, %r12 lea oracles, %r8 and $0xff, %r12 shlq $12, %r12 mov (%r8,%r12,1), %r12 pop %rsi pop %rdi pop %rbx pop %r8 pop %r13 pop %r12 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'size': 1, 'NT': True, 'type': 'addresses_WC', 'same': False, 'AVXalign': False, 'congruent': 0}} {'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_WC', 'same': True, 'AVXalign': False, 'congruent': 0}} {'OP': 'STOR', 'dst': {'size': 16, 'NT': False, 'type': 'addresses_D', 'same': False, 'AVXalign': False, 'congruent': 8}} {'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_P', 'same': False, 'AVXalign': False, 'congruent': 7}} [Faulty Load] {'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_WC', 'same': True, 'AVXalign': False, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 1}} {'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 1}} {'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 1}} {'OP': 'LOAD', 'src': {'size': 16, 'NT': True, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 1}} {'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': False, 'congruent': 0}} {'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 1}} {'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': False, 'congruent': 0}} {'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 2}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 5}, 'dst': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 4}} {'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 2}} {'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': True, 'congruent': 8}} {'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_normal_ht', 'same': True, 'AVXalign': False, 'congruent': 4}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_D_ht', 'congruent': 8}, 'dst': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 11}} {'58': 21829} 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 */
archive/agda-3/src/Oscar/Class/Kitten.agda
m0davis/oscar
0
13062
open import Oscar.Prelude open import Oscar.Class.IsPrecategory open import Oscar.Class.IsCategory open import Oscar.Class.Category open import Oscar.Class.IsFunctor open import Oscar.Class.Functor open import Oscar.Class.Reflexivity open import Oscar.Class.Transitivity open import Oscar.Class.Surjection open import Oscar.Class.Smap open import Oscar.Class.Transextensionality open import Oscar.Class.Transassociativity open import Oscar.Class.Transleftidentity open import Oscar.Class.Transrightidentity open import Oscar.Class.Surjidentity open import Oscar.Class module Oscar.Class.Kitten where productCat : ∀ {𝔬₁ 𝔯₁ ℓ₁ 𝔬₂ 𝔯₂ ℓ₂} → Category 𝔬₁ 𝔯₁ ℓ₁ → Category 𝔬₂ 𝔯₂ ℓ₂ → Category (𝔬₁ ∙̂ 𝔬₂) (𝔯₁ ∙̂ 𝔯₂) (ℓ₁ ∙̂ ℓ₂) Category.𝔒 (productCat c₁ c₂) = Category.𝔒 c₁ × Category.𝔒 c₂ Category._∼_ (productCat c₁ c₂) (x₁ , x₂) (y₁ , y₂) = Category._∼_ c₁ x₁ y₁ × Category._∼_ c₂ x₂ y₂ Category._∼̇_ (productCat c₁ c₂) {x₁ , x₂} {y₁ , y₂} (f₁ , g₁) (f₂ , g₂) = Category._∼̇_ c₁ f₁ f₂ × Category._∼̇_ c₂ g₁ g₂ Category.category-ε (productCat c₁ c₂) = (Category.category-ε c₁) , (Category.category-ε c₂) Category._↦_ (productCat c₁ c₂) (f₁ , f₂) (g₁ , g₂) = (Category._↦_ c₁ f₁ g₁) , (Category._↦_ c₂ f₂ g₂) Category.`IsCategory (productCat c₁ c₂) .IsCategory.`IsPrecategory .IsPrecategory.`𝓣ransextensionality .⋆ (x₁ , y₁) (x₂ , y₂) = transextensionality x₁ x₂ , transextensionality y₁ y₂ Category.`IsCategory (productCat c₁ c₂) .IsCategory.`IsPrecategory .IsPrecategory.`𝓣ransassociativity .⋆ f g h = transassociativity (f .π₀) (g .π₀) (h .π₀) , transassociativity (f .π₁) (g .π₁) (h .π₁) Category.`IsCategory (productCat c₁ c₂) .IsCategory.`𝓣ransleftidentity .⋆ = transleftidentity , transleftidentity Category.`IsCategory (productCat c₁ c₂) .IsCategory.`𝓣ransrightidentity = ∁ (transrightidentity , transrightidentity) record AFunctor {𝔬₁ 𝔯₁ ℓ₁ 𝔬₂ 𝔯₂ ℓ₂} (source : Category 𝔬₁ 𝔯₁ ℓ₁) (target : Category 𝔬₂ 𝔯₂ ℓ₂) : Ø 𝔬₁ ∙̂ 𝔯₁ ∙̂ ℓ₁ ∙̂ 𝔬₂ ∙̂ 𝔯₂ ∙̂ ℓ₂ where constructor ∁ private module S = Category source private module T = Category target field F₀ : S.𝔒 → T.𝔒 F₁ : Smap.type S._∼_ T._∼_ F₀ F₀ isFunctor : IsFunctor S._∼_ S._∼̇_ S.category-ε S._↦_ T._∼_ T._∼̇_ T.category-ε T._↦_ F₁ record MonoidalCategory 𝔬 𝔯 ℓ : Ø ↑̂ (𝔬 ∙̂ 𝔯 ∙̂ ℓ) where constructor ∁ field thecat : Category 𝔬 𝔯 ℓ thefunc : AFunctor (productCat thecat thecat) thecat O : Ø 𝔬 O = Category.𝔒 thecat field 𝟏 : O _⟶_ : O → O → Ø 𝔯 _⟶_ = Category._∼_ thecat _⊗_ : O → O → O _⊗_ = λ x y → AFunctor.F₀ thefunc (x , y) _⨂_ : ∀ {w x y z} → w ⟶ x → y ⟶ z → (w ⊗ y) ⟶ (x ⊗ z) _⨂_ f g = AFunctor.F₁ thefunc (f , g) _↦_ : ∀ {x y z} (f : x ⟶ y) (g : y ⟶ z) → x ⟶ z _↦_ = Category._↦_ thecat i : ∀ {x} → x ⟶ x i = Category.category-ε thecat _≈̇_ = Category._∼̇_ thecat -- infixr 9 _⊗_ field associator : ∀ (x y z : O) → Σ (((x ⊗ y) ⊗ z) ⟶ (x ⊗ (y ⊗ z))) λ f → Σ ((x ⊗ (y ⊗ z)) ⟶ ((x ⊗ y) ⊗ z)) λ f⁻¹ → ((f ↦ f⁻¹) ≈̇ i) × ((f⁻¹ ↦ f) ≈̇ i) left-unitor : ∀ (x : O) → Σ ((𝟏 ⊗ x) ⟶ x) λ f → Σ (x ⟶ (𝟏 ⊗ x)) λ f⁻¹ → ((f ↦ f⁻¹) ≈̇ i) × ((f⁻¹ ↦ f) ≈̇ i) right-unitor : ∀ (x : O) → Σ ((x ⊗ 𝟏) ⟶ x) λ f → Σ (x ⟶ (x ⊗ 𝟏)) λ f⁻¹ → ((f ↦ f⁻¹) ≈̇ i) × ((f⁻¹ ↦ f) ≈̇ i) assoc : ∀ (x y z : O) → ((x ⊗ y) ⊗ z) ⟶ (x ⊗ (y ⊗ z)) assoc x y z = π₀ (associator x y z) ru : ∀ x → (x ⊗ 𝟏) ⟶ x ru x = π₀ (right-unitor x) lu : ∀ x → (𝟏 ⊗ x) ⟶ x lu x = π₀ (left-unitor x) field triangle-identity : ∀ (x y : O) → (ru x ⨂ i) ≈̇ (assoc x 𝟏 y ↦ (i ⨂ lu y)) pentagon-identity : ∀ (w x y z : O) → (((assoc w x y ⨂ i) ↦ assoc w (x ⊗ y) z) ↦ (i ⨂ assoc x y z)) ≈̇ (assoc (w ⊗ x) y z ↦ assoc w x (y ⊗ z)) module _ {𝔬₁ 𝔯₁ ℓ₁ 𝔬₂ 𝔯₂ ℓ₂} (source : MonoidalCategory 𝔬₁ 𝔯₁ ℓ₁) (target : MonoidalCategory 𝔬₂ 𝔯₂ ℓ₂) where record LaxMonoidalFunctor : Ø 𝔬₁ ∙̂ 𝔯₁ ∙̂ ℓ₁ ∙̂ 𝔬₂ ∙̂ 𝔯₂ ∙̂ ℓ₂ where module C = MonoidalCategory source module D = MonoidalCategory target field 𝓕 : AFunctor C.thecat D.thecat open AFunctor 𝓕 public field e : D.𝟏 D.⟶ F₀ C.𝟏 μ : ∀ x y → (F₀ x D.⊗ F₀ y) D.⟶ F₀ (x C.⊗ y) -- F A → F B → F (A × B) associativity : ∀ x y z → ((μ x y D.⨂ D.i) D.↦ (μ (x C.⊗ y) z D.↦ F₁ (C.assoc x y z))) D.≈̇ (D.assoc (F₀ x) (F₀ y) (F₀ z) D.↦ ((D.i D.⨂ μ y z) D.↦ μ x (y C.⊗ z))) left-unitality : ∀ x → (D.lu (F₀ x)) D.≈̇ ((e D.⨂ D.i) D.↦ (μ C.𝟏 x D.↦ F₁ (C.lu x))) right-unitality : ∀ x → (D.ru (F₀ x)) D.≈̇ ((D.i D.⨂ e) D.↦ (μ x C.𝟏 D.↦ F₁ (C.ru x))) module _ {𝔬₁ 𝔯₁ ℓ₁ 𝔬₂ 𝔯₂ ℓ₂} (source : MonoidalCategory 𝔬₁ 𝔯₁ ℓ₁) (target : MonoidalCategory 𝔬₂ 𝔯₂ ℓ₂) (let module C = MonoidalCategory source) (let module D = MonoidalCategory target) (𝓕 : AFunctor C.thecat D.thecat) (open AFunctor 𝓕) (e : D.𝟏 D.⟶ F₀ C.𝟏) (μ : ∀ x y → (F₀ x D.⊗ F₀ y) D.⟶ F₀ (x C.⊗ y)) where record IsLaxMonoidalFunctor : Ø 𝔬₁ ∙̂ 𝔯₁ ∙̂ ℓ₁ ∙̂ 𝔬₂ ∙̂ 𝔯₂ ∙̂ ℓ₂ where field associativity : ∀ x y z → ((μ x y D.⨂ D.i) D.↦ (μ (x C.⊗ y) z D.↦ F₁ (C.assoc x y z))) D.≈̇ (D.assoc (F₀ x) (F₀ y) (F₀ z) D.↦ ((D.i D.⨂ μ y z) D.↦ μ x (y C.⊗ z))) left-unitality : ∀ x → (D.lu (F₀ x)) D.≈̇ ((e D.⨂ D.i) D.↦ (μ C.𝟏 x D.↦ F₁ (C.lu x))) right-unitality : ∀ x → (D.ru (F₀ x)) D.≈̇ ((D.i D.⨂ e) D.↦ (μ x C.𝟏 D.↦ F₁ (C.ru x))) record GenericApplicativeRaw {lc ld} {Oc : Ø lc} {Od : Ø ld} (F : Oc → Od) (1c : Oc) (1d : Od) (_⊗c_ : Oc → Oc → Oc) (_⊗d_ : Od → Od → Od) {ℓc} (_⟶c_ : Oc → Oc → Ø ℓc) {ℓd} (_⟶d_ : Od → Od → Ø ℓd) : Ø ℓd ∙̂ lc ∙̂ ℓc where field m : ∀ {x y} → x ⟶c y → F x ⟶d F y -- fmap e : 1d ⟶d F 1c -- pure μ : ∀ {x y} → (F x ⊗d F y) ⟶d F (x ⊗c y) -- apply -- _<*>_ : ∀ {x y : Oc} → ? → ? → {!!} -- F (x ⟶c y) → F x ⟶d F y -- _<*>_ f x = m ? (μ ) {- _<*>_ : ∀ {A B} → F (A → B) → F A → F B _<*>_ f x = sfmap (λ {(f , x) → f x}) (f <s> x) -} {- record ContainedGenericApplicativeRaw {lc ld} {Oc : Ø lc} {Od : Ø ld} (F : Oc → Od) (1c : Oc) (1d : Od) (_⊗c_ : Oc → Oc → Oc) (_⊗d_ : Od → Od → Od) {ℓd} (_⟶d_ : Od → Od → Ø ℓd) : Ø ℓd ∙̂ lc where field e : 1d ⟶d F 1c μ : ∀ {x y} → (F x ⊗d F y) ⟶d F (x ⊗c y) -} open import Oscar.Data.𝟙 open import Oscar.Data.Proposequality record Action {a b} {A : Set a} {B : Set b} {f g h} (F : A → B → Set f) (G : A → Set g) (H : B → Set h) : Ø a ∙̂ b ∙̂ f ∙̂ g ∙̂ h where field act : ∀ {x y} → F x y → G x → H y record SetApplyM {a b} (F : Set a → Set b) -- (𝟏ᴬ : Set a) (𝟏ᴮ : Set b) (_⊕_ : Set p → Set p → Set p) (_⟶_ : A → A → Set ℓ) : Ø ↑̂ a ∙̂ b where field sfmap : ∀ {A B} → (A → B) → F A → F B sunit : Lift {_} {a} 𝟙 → F (Lift 𝟙) _<s>_ : ∀ {A B} → F A → F B → F (A × B) _<*>_ : ∀ {A B} → F (A → B) → F A → F B _<*>_ f x = sfmap (λ {(f , x) → f x}) (f <s> x) _⨂_ : ∀ {A B C D : Ø a} → (A → B) → (C → D) → A × C → B × D _⨂_ f g ac = let (a , c) = ac in f a , g c assoc : ∀ {A B C : Ø a} → A × (B × C) → (A × B) × C assoc abc = let (a , (b , c)) = abc in (a , b) , c field law-nat : ∀ {A B C D} (f : A → B) (g : C → D) u v → sfmap (f ⨂ g) (u <s> v) ≡ (sfmap f u <s> sfmap g v) leftid : ∀ {B} (v : F B) → sfmap π₁ (sunit _ <s> v) ≡ v righttid : ∀ {A} (u : F A) → sfmap π₀ (u <s> sunit _) ≡ u associativity : ∀ {A B C} u v w → sfmap (assoc {A} {B} {C}) (u <s> (v <s> w)) ≡ ((u <s> v) <s> w) source-cat : MonoidalCategory _ _ _ source-cat .MonoidalCategory.thecat .Category.𝔒 = Ø a source-cat .MonoidalCategory.thecat .Category._∼_ = Function source-cat .MonoidalCategory.thecat .Category._∼̇_ = _≡̇_ source-cat .MonoidalCategory.thecat .Category.category-ε = ¡ source-cat .MonoidalCategory.thecat .Category._↦_ = flip _∘′_ source-cat .MonoidalCategory.thecat .Category.`IsCategory = {!!} source-cat .MonoidalCategory.thefunc .AFunctor.F₀ (A , B) = A × B source-cat .MonoidalCategory.thefunc .AFunctor.F₁ = {!!} source-cat .MonoidalCategory.thefunc .AFunctor.isFunctor = {!!} source-cat .MonoidalCategory.𝟏 = Lift 𝟙 source-cat .MonoidalCategory.associator = {!!} source-cat .MonoidalCategory.left-unitor = {!!} source-cat .MonoidalCategory.right-unitor = {!!} source-cat .MonoidalCategory.triangle-identity = {!!} source-cat .MonoidalCategory.pentagon-identity = {!!} target-cat : MonoidalCategory _ _ _ target-cat .MonoidalCategory.thecat .Category.𝔒 = Ø b target-cat .MonoidalCategory.thecat .Category._∼_ = Function target-cat .MonoidalCategory.thecat .Category._∼̇_ = _≡̇_ target-cat .MonoidalCategory.thecat .Category.category-ε = ¡ target-cat .MonoidalCategory.thecat .Category._↦_ = flip _∘′_ target-cat .MonoidalCategory.thecat .Category.`IsCategory = {!!} target-cat .MonoidalCategory.thefunc .AFunctor.F₀ (A , B) = A × B target-cat .MonoidalCategory.thefunc .AFunctor.F₁ = {!!} target-cat .MonoidalCategory.thefunc .AFunctor.isFunctor = {!!} target-cat .MonoidalCategory.𝟏 = Lift 𝟙 target-cat .MonoidalCategory.associator = {!!} target-cat .MonoidalCategory.left-unitor = {!!} target-cat .MonoidalCategory.right-unitor = {!!} target-cat .MonoidalCategory.triangle-identity = {!!} target-cat .MonoidalCategory.pentagon-identity = {!!} module C = MonoidalCategory source-cat module D = MonoidalCategory target-cat the-functor : AFunctor C.thecat D.thecat the-functor .AFunctor.F₀ = F the-functor .AFunctor.F₁ = sfmap the-functor .AFunctor.isFunctor = {!!} open AFunctor the-functor the-e : D.𝟏 D.⟶ F₀ C.𝟏 -- F (Lift 𝟙) the-e = {!!} the-μ : ∀ x y → (F₀ x D.⊗ F₀ y) D.⟶ F₀ (x C.⊗ y) -- F A → F B → F (A × B) the-μ A B (FA , FB) = FA <s> FB toSetApply : ∀ {a b} (F : Set a → Set b) (gar : GenericApplicativeRaw F (Lift 𝟙) (Lift 𝟙) (λ A B → A × B) (λ A B → A × B) Function Function) → SetApplyM F toSetApply F gar .SetApplyM.sfmap = GenericApplicativeRaw.m gar toSetApply F gar .SetApplyM.sunit _ = GenericApplicativeRaw.e gar ! toSetApply F gar .SetApplyM._<s>_ FA FB = GenericApplicativeRaw.μ gar (FA , FB) toSetApply F gar .SetApplyM.law-nat = {!!} toSetApply F gar .SetApplyM.leftid = {!!} toSetApply F gar .SetApplyM.righttid = {!!} toSetApply F gar .SetApplyM.associativity = {!!} module _ {𝔬₁ 𝔯₁ ℓ₁ 𝔬₂ 𝔯₂ ℓ₂} (C : MonoidalCategory 𝔬₁ 𝔯₁ ℓ₁) (D : MonoidalCategory 𝔬₂ 𝔯₂ ℓ₂) where record LaxMonoidalFunctorWithStrength : Ø 𝔬₁ ∙̂ 𝔯₁ ∙̂ ℓ₁ ∙̂ 𝔬₂ ∙̂ 𝔯₂ ∙̂ ℓ₂ where field laxMonoidalFunctor : LaxMonoidalFunctor C D open LaxMonoidalFunctor laxMonoidalFunctor {- field β : ∀ v w → (v D.⊗ F₀ w) D.⟶ F₀ (v C.⊗ w) commute-5 : ∀ u v w → (C.assoc u v (F₀ w) C.↦ ((C.i C.⨂ β v w) C.↦ β u (v C.⊗ w))) C.≈̇ (β (u C.⊗ v) w C.↦ F₁ (C.assoc u v w)) commute-3 : ∀ v → C.lu (F₀ v) C.≈̇ (β C.𝟏 v C.↦ F₁ (C.lu v)) -- strength : TensorialStrength C (LaxMonoidalFunctor.𝓕 laxMonoidalEndofunctor) -} module _ {𝔬 𝔯 ℓ} (V : MonoidalCategory 𝔬 𝔯 ℓ) (let C = MonoidalCategory.thecat V) (F : AFunctor C C) where open MonoidalCategory V open AFunctor F record TensorialStrength : Ø 𝔬 ∙̂ 𝔯 ∙̂ ℓ where field β : ∀ v w → (v ⊗ F₀ w) ⟶ F₀ (v ⊗ w) commute-5 : ∀ u v w → (assoc u v (F₀ w) ↦ ((i ⨂ β v w) ↦ β u (v ⊗ w))) ≈̇ (β (u ⊗ v) w ↦ F₁ (assoc u v w)) commute-3 : ∀ v → lu (F₀ v) ≈̇ (β 𝟏 v ↦ F₁ (lu v)) module _ {𝔬 𝔯 ℓ} (C : MonoidalCategory 𝔬 𝔯 ℓ) where record LaxMonoidalEndofunctorWithStrength : Ø 𝔬 ∙̂ 𝔯 ∙̂ ℓ where field laxMonoidalEndofunctor : LaxMonoidalFunctor C C strength : TensorialStrength C (LaxMonoidalFunctor.𝓕 laxMonoidalEndofunctor) {- want parameters : X : Set a Y : Set b X₀ : X F : X → Y _⨁_ : X → X → Set a LaxMonoidalFunctor.e = unit : F X₀ LaxMonoidalFunctor.μ = apply : ∀ {A B : X} → F A → F B → F (A ⨁ B) LaxMonoidalFunctor.𝓕.F₀ = F : X → Y -} record GenericApplyM {a ℓ} {A : Set a} (F : A → A) (𝟏 : A) (_⊕_ : A → A → A) (_⟶_ : A → A → Set ℓ) : Ø a ∙̂ ℓ where field gunit : 𝟏 ⟶ F 𝟏 gproduct : ∀ {x y : A} → (F x ⊕ F y) ⟶ F (x ⊕ y) open import Oscar.Data.𝟙 -- open import Oscar.Class.Kitten open import Oscar.Class.Category open import Oscar.Class.IsPrefunctor open import Oscar.Class.IsCategory open import Oscar.Class.IsPrecategory open import Oscar.Property.Category.Function open import Oscar.Class open import Oscar.Class.Fmap import Oscar.Class.Reflexivity.Function module _ {𝔬₁ 𝔬₂} (𝓕 : Ø 𝔬₁ → Ø 𝔬₂) (fmapper : Fmap 𝓕) (fpure : ∀ {𝔄} → 𝔄 → 𝓕 𝔄) (fapply : ∀ {𝔄 𝔅} → 𝓕 (𝔄 → 𝔅) → 𝓕 𝔄 → 𝓕 𝔅) where -- instance _ = fmapper fmap' = λ {A B} (f : A → B) → fapply (fpure f) mkProductMonoidalCategory : MonoidalCategory _ _ _ mkProductMonoidalCategory .MonoidalCategory.thecat .Category.𝔒 = Ø 𝔬₁ mkProductMonoidalCategory .MonoidalCategory.thecat .Category._∼_ = MFunction 𝓕 mkProductMonoidalCategory .MonoidalCategory.thecat .Category._∼̇_ = Proposextensequality mkProductMonoidalCategory .MonoidalCategory.thecat .Category.category-ε = ε mkProductMonoidalCategory .MonoidalCategory.thecat .Category._↦_ = (flip _∘′_) mkProductMonoidalCategory .MonoidalCategory.thecat .Category.`IsCategory = ? mkProductMonoidalCategory .MonoidalCategory.thefunc .AFunctor.F₀ (A , B) = A × B mkProductMonoidalCategory .MonoidalCategory.thefunc .AFunctor.F₁ (f , g) xy = fapply (fmap' _,_ (f (fmap' π₀ xy))) (g (fmap' π₁ xy)) mkProductMonoidalCategory .MonoidalCategory.thefunc .AFunctor.isFunctor .IsFunctor.`IsPrefunctor .IsPrefunctor.`𝓢urjtranscommutativity = {!!} mkProductMonoidalCategory .MonoidalCategory.thefunc .AFunctor.isFunctor .IsFunctor.`IsPrefunctor .IsPrefunctor.`𝓢urjextensionality = {!!} mkProductMonoidalCategory .MonoidalCategory.thefunc .AFunctor.isFunctor .IsFunctor.`𝒮urjidentity = {!!} mkProductMonoidalCategory .MonoidalCategory.𝟏 = {!!} mkProductMonoidalCategory .MonoidalCategory.associator = {!!} mkProductMonoidalCategory .MonoidalCategory.left-unitor = {!!} mkProductMonoidalCategory .MonoidalCategory.right-unitor = {!!} mkProductMonoidalCategory .MonoidalCategory.triangle-identity = {!!} mkProductMonoidalCategory .MonoidalCategory.pentagon-identity = {!!} record HApplicativeFunctor {𝔬₁ 𝔬₂} (𝓕 : Ø 𝔬₁ → Ø 𝔬₂) : Ø (↑̂ (↑̂ 𝔬₁ ∙̂ 𝔬₂)) where constructor ∁ field fmapper : Fmap 𝓕 fpure : ∀ {𝔄} → 𝔄 → 𝓕 𝔄 fapply : ∀ {𝔄 𝔅} → 𝓕 (𝔄 → 𝔅) → 𝓕 𝔄 → 𝓕 𝔅 field isStrongLaxMonoidalEndofunctor : LaxMonoidalEndofunctorWithStrength (mkProductMonoidalCategory 𝓕 fmapper fpure fapply) module LMF = LaxMonoidalFunctor (LaxMonoidalEndofunctorWithStrength.laxMonoidalEndofunctor isStrongLaxMonoidalEndofunctor) derive-fpure : ∀ {𝔄} → 𝔄 → 𝓕 𝔄 derive-fpure = {!LMF!} where {- ⦃ isFunctor ⦄ : IsFunctor {𝔒₁ = Ø 𝔬₁} (λ A B → A × 𝓕 B) {!(λ { {A} {B} (x₁ , f₁) (x₂ , f₂) → {!(x₁ ≡ x₂) × !}})!} (λ {A} → {!!} , {!!}) {!!} {𝔒₂ = Ø 𝔬₁} {!!} {!!} {!!} {!!} {!!} -} record MonoidalFunctor {𝔬₁ 𝔬₂} (𝓕 : Ø 𝔬₁ → Ø 𝔬₂) : Ø (↑̂ (↑̂ 𝔬₁ ∙̂ 𝔬₂)) where constructor ∁ field ⦃ isFmap ⦄ : Fmap 𝓕 unit : 𝓕 (Lift 𝟙) mappend : ∀ {𝔄 𝔅} → 𝓕 𝔄 → 𝓕 𝔅 → 𝓕 (𝔄 × 𝔅) {- ⦃ isFunctor ⦄ : IsFunctor Function⟦ 𝔬₁ ⟧ Proposextensequality ε (flip _∘′_) (MFunction 𝓕) Proposextensequality ε (flip _∘′_) {!!} -} pure : ∀ {𝔄} → 𝔄 → 𝓕 𝔄 pure x = fmap (x ∞) unit infixl 4 _<*>_ _<*>_ : ∀ {𝔄 𝔅} → 𝓕 (𝔄 → 𝔅) → 𝓕 𝔄 → 𝓕 𝔅 f <*> x = fmap (λ {(f , x) → f x}) (mappend f x) app-identity : ∀ {𝔄} (v : 𝓕 𝔄) → (pure ¡[ 𝔄 ] <*> v) ≡ v app-identity v = {!!} open MonoidalFunctor ⦃ … ⦄ public using (unit; mappend) -- record ApplicativeFunctor where module Purity {𝔵₁ 𝔵₂ 𝔯} {𝔛₁ : Ø 𝔵₁} {𝔛₂ : Ø 𝔵₂} (F : 𝔛₁ → 𝔛₂) (x₁ : 𝔛₁) (x₂ : 𝔛₂) (_⟶_ : 𝔛₂ → 𝔛₂ → Ø 𝔯) = ℭLASS (F , x₁ , x₂ , _⟶_) (x₂ ⟶ F x₁) module Applicativity {𝔵₁ 𝔵₂ 𝔯} {𝔛₁ : Ø 𝔵₁} {𝔛₂ : Ø 𝔵₂} (F : 𝔛₁ → 𝔛₂) (_⊗₁_ : 𝔛₁ → 𝔛₁ → 𝔛₁) (_⊗₂_ : 𝔛₂ → 𝔛₂ → 𝔛₂) (_⟶_ : 𝔛₂ → 𝔛₂ → Ø 𝔯) = ℭLASS (F , _⊗₁_ , _⊗₂_ , _⟶_) (∀ x y → (F x ⊗₂ F y) ⟶ F (x ⊗₁ y)) -- FunctionalMonoidalCategory AFunctorFunction²Function : ∀ {𝔬₁} → AFunctor (productCat (CategoryFunction {𝔬₁}) (CategoryFunction {𝔬₁})) (CategoryFunction {𝔬₁}) AFunctorFunction²Function .AFunctor.F₀ = uncurry _×_ AFunctorFunction²Function .AFunctor.F₁ (f₁ , f₂) (x₁ , x₂) = f₁ x₁ , f₂ x₂ AFunctorFunction²Function .AFunctor.isFunctor .IsFunctor.`IsPrefunctor .IsPrefunctor.`𝓢urjtranscommutativity = {!!} AFunctorFunction²Function .AFunctor.isFunctor .IsFunctor.`IsPrefunctor .IsPrefunctor.`𝓢urjextensionality = {!!} AFunctorFunction²Function .AFunctor.isFunctor .IsFunctor.`𝒮urjidentity = {!!} record LMF {𝔬₁ 𝔬₂} (𝓕 : Ø 𝔬₁ → Ø 𝔬₂) ⦃ _ : Fmap 𝓕 ⦄ : Ø ↑̂ (↑̂ 𝔬₁ ∙̂ 𝔬₂) where constructor ∁ field lmf-pure : Purity.type 𝓕 (Lift 𝟙) (Lift 𝟙) Function lmf-apply : Applicativity.type 𝓕 _×_ _×_ Function lmf-happly : ∀ {𝔄 𝔅} → 𝓕 (𝔄 → 𝔅) → 𝓕 𝔄 → 𝓕 𝔅 lmf-happly f x = fmap (λ {(f , x) → f x}) (lmf-apply _ _ (f , x)) field ⦃ islmf ⦄ : IsLaxMonoidalFunctor (∁ CategoryFunction (∁ (uncurry _×_) {!!} {!!}) (Lift 𝟙) {!!} {!!} {!!} {!!} {!!}) (∁ CategoryFunction (∁ (uncurry _×_) {!!} {!!}) ((Lift 𝟙)) {!!} {!!} {!!} {!!} {!!}) (record { F₀ = 𝓕 ; F₁ = fmap ; isFunctor = ∁ ⦃ {!!} ⦄ ⦃ ! ⦄ ⦃ ! ⦄ ⦃ {!!} ⦄ }) lmf-pure lmf-apply
models/Desc.agda
mietek/epigram
48
9570
<gh_stars>10-100 {-# OPTIONS --universe-polymorphism #-} module Desc where --******************************************** -- Prelude --******************************************** -- Some preliminary stuffs, to avoid relying on the stdlib --**************** -- Universe polymorphism --**************** data Level : Set where zero : Level suc : Level -> Level {-# BUILTIN LEVEL Level #-} {-# BUILTIN LEVELZERO zero #-} {-# BUILTIN LEVELSUC suc #-} max : Level -> Level -> Level max zero m = m max (suc n) zero = suc n max (suc n) (suc m) = suc (max n m) {-# BUILTIN LEVELMAX max #-} data Lifted {l : Level} (A : Set l) : Set (suc l) where lifter : A → Lifted A lift : {i : Level} -> Set i -> Set (suc i) lift x = Lifted x unlift : {l : Level}{A : Set l} -> Lifted A -> A unlift (lifter a) = a --**************** -- Sigma and friends --**************** data Sigma {i j : Level}(A : Set i) (B : A -> Set j) : Set (max i j) where _,_ : (x : A) (y : B x) -> Sigma A B pair : {i j : Level}{A : Set i}{B : A -> Set j} -> (x : A) (y : B x) -> Sigma {i = i}{j = j} A B pair x y = x , y _*_ : {i j : Level}(A : Set i)(B : Set j) -> Set (max i j) A * B = Sigma A \_ -> B fst : {i j : Level}{A : Set i}{B : A -> Set j} -> Sigma A B -> A fst (a , _) = a snd : {i j : Level}{A : Set i}{B : A -> Set j} (p : Sigma A B) -> B (fst p) snd (a , b) = b data Zero {i : Level} : Set i where data Unit {i : Level} : Set i where Void : Unit --**************** -- Sum and friends --**************** data _+_ {i j : Level}(A : Set i)(B : Set j) : Set (max i j) where l : A -> A + B r : B -> A + B --**************** -- Equality --**************** data _==_ {l : Level}{A : Set l}(x : A) : A -> Set l where refl : x == x cong : {l m : Level}{A : Set l}{B : Set m} (f : A -> B){x y : A} -> x == y -> f x == f y cong f refl = refl cong2 : {l m n : Level}{A : Set l}{B : Set m}{C : Set n} (f : A -> B -> C){x y : A}{z t : B} -> x == y -> z == t -> f x z == f y t cong2 f refl refl = refl trans : {l : Level}{A : Set l}{x y z : A} -> x == y -> y == z -> x == z trans refl refl = refl proof-lift-unlift-eq : {l : Level}{A : Set l}(x : Lifted A) -> lifter (unlift x) == x proof-lift-unlift-eq (lifter a) = refl postulate reflFun : {l m : Level}{A : Set l}{B : A -> Set m}(f : (a : A) -> B a)(g : (a : A) -> B a)-> ((a : A) -> f a == g a) -> f == g --******************************************** -- Desc code --******************************************** -- In the paper, we have presented Desc as the grammar of inductive -- types. Hence, the codes in the paper closely follow this -- grammar: data DescPaper : Set1 where oneP : DescPaper sigmaP : (S : Set) -> (S -> DescPaper) -> DescPaper indx : DescPaper -> DescPaper hindx : Set -> DescPaper -> DescPaper -- We take advantage of this model to give you an alternative -- presentation. This alternative model is the one implemented in -- Epigram. It is also the one which inspired the code for indexed -- descriptions. -- With sigma, we are actually "quoting" a standard type-former, -- namely: -- |Sigma : (S : Set) -> (S -> Set) -> Set| -- With: -- |sigma : (S : Set) -> (S -> Desc) -> Desc| -- In the alternative presentation, we go further and present all our -- codes as quotations of standard type-formers: data Desc {l : Level} : Set (suc l) where id : Desc const : Set l -> Desc prod : Desc -> Desc -> Desc sigma : (S : Set l) -> (S -> Desc) -> Desc pi : (S : Set l) -> (S -> Desc) -> Desc -- Note that we replace |oneP| by a more general |const| code. Whereas -- |oneP| was interpreted as the unit set, |const K| is -- interpreted as |K|, for any |K : Set|. Extensionally, -- |const K| and |sigma K (\_ -> Unit)| are equivalent. However, -- |const| is *first-order*, unlike its equivalent encoding. From a -- definitional perspective, we are giving more opportunities to the -- type-system, hence reducing the burden on the programmer. For the same -- reason, we introduce |prod| that overlaps with |pi|. -- This reorganisation is strictly equivalent to the |DescPaper|. For -- instance, we can encode |indx| and |hindx| using the following -- code: indx2 : {l : Level} -> Desc {l = l} -> Desc {l = l} indx2 D = prod id D hindx2 : Set -> Desc -> Desc hindx2 H D = prod (pi H (\_ -> id)) D --******************************************** -- Desc interpretation --******************************************** [|_|]_ : {l : Level} -> Desc -> Set l -> Set l [| id |] Z = Z [| const X |] Z = X [| prod D D' |] Z = [| D |] Z * [| D' |] Z [| sigma S T |] Z = Sigma S (\s -> [| T s |] Z) [| pi S T |] Z = (s : S) -> [| T s |] Z --******************************************** -- Fixpoint construction --******************************************** data Mu {l : Level}(D : Desc {l = l}) : Set l where con : [| D |] (Mu D) -> Mu D --******************************************** -- Predicate: All --******************************************** All : {l : Level}(D : Desc)(X : Set)(P : X -> Set l) -> [| D |] X -> Set l All id X P x = P x All (const Z) X P x = Unit All (prod D D') X P (d , d') = (All D X P d) * (All D' X P d') All (sigma S T) X P (a , b) = All (T a) X P b All (pi S T) X P f = (s : S) -> All (T s) X P (f s) all : {l : Level}(D : Desc)(X : Set)(P : X -> Set l)(R : (x : X) -> P x)(x : [| D |] X) -> All D X P x all id X P R x = R x all (const Z) X P R z = Void all (prod D D') X P R (d , d') = all D X P R d , all D' X P R d' all (sigma S T) X P R (a , b) = all (T a) X P R b all (pi S T) X P R f = \ s -> all (T s) X P R (f s) --******************************************** -- Map --******************************************** -- This one is bonus: one could rightfully expect our so-called -- functors to have a morphism part! Here it is. map : {l : Level}(D : Desc)(X Y : Set l)(f : X -> Y)(v : [| D |] X) -> [| D |] Y map id X Y sig x = sig x map (const Z) X Y sig z = z map (prod D D') X Y sig (d , d') = map D X Y sig d , map D' X Y sig d' map (sigma S T) X Y sig (a , b) = (a , map (T a) X Y sig b) map (pi S T) X Y sig f = \x -> map (T x) X Y sig (f x) -- Together with the proof that they respect the functor laws: -- map id = id proof-map-id : {l : Level}(D : Desc)(X : Set l)(v : [| D |] X) -> map D X X (\x -> x) v == v proof-map-id id X v = refl proof-map-id (const Z) X v = refl proof-map-id (prod D D') X (v , v') = cong2 (\x y -> (x , y)) (proof-map-id D X v) (proof-map-id D' X v') proof-map-id (sigma S T) X (a , b) = cong (\x -> (a , x)) (proof-map-id (T a) X b) proof-map-id (pi S T) X f = reflFun (\a -> map (T a) X X (\x -> x) (f a)) f (\a -> proof-map-id (T a) X (f a)) -- map (f . g) = map f . map g proof-map-compos : {l : Level}(D : Desc)(X Y Z : Set l) (f : X -> Y)(g : Y -> Z) (v : [| D |] X) -> map D X Z (\x -> g (f x)) v == map D Y Z g (map D X Y f v) proof-map-compos id X Y Z f g v = refl proof-map-compos (const K) X Y Z f g v = refl proof-map-compos (prod D D') X Y Z f g (v , v') = cong2 (\x y -> (x , y)) (proof-map-compos D X Y Z f g v) (proof-map-compos D' X Y Z f g v') proof-map-compos (sigma S T) X Y Z f g (a , b) = cong (\x -> (a , x)) (proof-map-compos (T a) X Y Z f g b) proof-map-compos (pi S T) X Y Z f g fc = reflFun (\a -> map (T a) X Z (\x -> g (f x)) (fc a)) (\a -> map (T a) Y Z g (map (T a) X Y f (fc a))) (\a -> proof-map-compos (T a) X Y Z f g (fc a)) --******************************************** -- Elimination principle: induction --******************************************** -- One would like to write the following: {- ind : {l : Level} (D : Desc) (P : Mu D -> Set l) -> ( (x : [| D |] (Mu D)) -> All D (Mu D) P x -> P (con x)) -> (v : Mu D) -> P v ind D P ms (con xs) = ms xs (all D (Mu D) P (\x -> ind D P ms x) xs) -} -- But the termination checker is unhappy. -- So we write the following: module Elim {l : Level} (D : Desc) (P : Mu D -> Set l) (ms : (x : [| D |] (Mu D)) -> All D (Mu D) P x -> P (con x)) where mutual ind : (x : Mu D) -> P x ind (con xs) = ms xs (hyps D xs) hyps : (D' : Desc) (xs : [| D' |] (Mu D)) -> All D' (Mu D) P xs hyps id x = ind x hyps (const Z) z = Void hyps (prod D D') (d , d') = hyps D d , hyps D' d' hyps (sigma S T) (a , b) = hyps (T a) b hyps (pi S T) f = \s -> hyps (T s) (f s) ind : {l : Level} (D : Desc) (P : Mu D -> Set l) -> ( (x : [| D |] (Mu D)) -> All D (Mu D) P x -> P (con x)) -> (v : Mu D) -> P v ind D P ms x = Elim.ind D P ms x --******************************************** -- Examples --******************************************** --**************** -- Nat --**************** data NatConst : Set where Ze : NatConst Su : NatConst natCases : NatConst -> Desc natCases Ze = const Unit natCases Suc = id NatD : Desc NatD = sigma NatConst natCases Nat : Set Nat = Mu NatD ze : Nat ze = con (Ze , Void) su : Nat -> Nat su n = con (Su , n) -- Now we can get addition for example: plusCase : (xs : [| NatD |] Nat) -> All NatD Nat (\_ -> Nat -> Nat) xs -> Nat -> Nat plusCase ( Ze , Void ) hs y = y plusCase ( Su , n ) hs y = su (hs y) plus : Nat -> Nat -> Nat plus x = ind NatD (\ _ -> (Nat -> Nat)) plusCase x -- Do this thing in Epigram, you will see that this is *not* -- hieroglyphic with a bit of elaboration. --**************** -- List --**************** data ListConst : Set where Nil : ListConst Cons : ListConst listCases : Set -> ListConst -> Desc listCases X Nil = const Unit listCases X Cons = sigma X (\_ -> id) ListD : Set -> Desc ListD X = sigma ListConst (listCases X) List : Set -> Set List X = Mu (ListD X) nil : {X : Set} -> List X nil = con ( Nil , Void ) cons : {X : Set} -> X -> List X -> List X cons x t = con ( Cons , ( x , t )) --**************** -- Tree --**************** data TreeConst : Set where Leaf : TreeConst Node : TreeConst treeCases : Set -> TreeConst -> Desc treeCases X Leaf = const Unit treeCases X Node = sigma X (\_ -> prod id id) TreeD : Set -> Desc TreeD X = sigma TreeConst (treeCases X) Tree : Set -> Set Tree X = Mu (TreeD X) leaf : {X : Set} -> Tree X leaf = con (Leaf , Void) node : {X : Set} -> X -> Tree X -> Tree X -> Tree X node x le ri = con (Node , (x , (le , ri))) --******************************************** -- Finite sets --******************************************** -- If we weren't such big fans of levitating things, we would -- implement finite sets with: {- data En : Set where nE : En cE : En -> En spi : (e : En)(P : EnumT e -> Set) -> Set spi nE P = Unit spi (cE e) P = P EZe * spi e (\e -> P (ESu e)) switch : (e : En)(P : EnumT e -> Set)(b : spi e P)(x : EnumT e) -> P x switch nE P b () switch (cE e) P b EZe = fst b switch (cE e) P b (ESu n) = switch e (\e -> P (ESu e)) (snd b) n -} -- But no, we make it fly in Desc: --**************** -- En --**************** -- As we have no tags here, we use Nat instead of List. EnD : Desc EnD = NatD En : Set En = Nat nE : En nE = ze cE : En -> En cE e = su e --**************** -- EnumT --**************** -- Because I don't want to fall back on wacky unicode symbols, I will -- write EnumT for #, EZe for 0, and ESu for 1+. Sorry about that data EnumT : (e : En) -> Set where EZe : {e : En} -> EnumT (cE e) ESu : {e : En} -> EnumT e -> EnumT (cE e) --**************** -- Small Pi --**************** -- This corresponds to the small pi |\pi|. casesSpi : {l : Level}(xs : [| EnD |] En) -> All EnD En (\e -> (EnumT e -> Set l) -> Set l) xs -> (EnumT (con xs) -> Set l) -> Set l casesSpi (Ze , Void) hs P' = Unit casesSpi (Su , n) hs P' = P' EZe * hs (\e -> P' (ESu e)) spi : {l : Level}(e : En)(P : EnumT e -> Set l) -> Set l spi {x} e P = ind EnD (\E -> (EnumT E -> Set x) -> Set x) casesSpi e P --**************** -- Switch --**************** casesSwitch : {l : Level} (xs : [| EnD |] En) -> All EnD En (\e -> (P' : EnumT e -> Set l) (b' : spi e P') (x' : EnumT e) -> P' x') xs -> (P' : EnumT (con xs) -> Set l) (b' : spi (con xs) P') (x' : EnumT (con xs)) -> P' x' casesSwitch (Ze , Void) hs P' b' () casesSwitch (Su , n) hs P' b' EZe = fst b' casesSwitch (Su , n) hs P' b' (ESu e') = hs (\e -> P' (ESu e)) (snd b') e' switch : {l : Level} (e : En) (P : EnumT e -> Set l) (b : spi e P) (x : EnumT e) -> P x switch {x} e P b xs = ind EnD (\e -> (P : EnumT e -> Set x) (b : spi e P) (xs : EnumT e) -> P xs) casesSwitch e P b xs --**************** -- Desc --**************** -- In the following, we implement Desc in itself. As usual, we have a -- finite set of constructors -- the name of the codes. Note that we -- could really define these as a finite set built above. However, in -- Agda, it's horribly verbose. For the sake of clarity, we won't do -- that here. data DescDef : Set1 where DescId : DescDef DescConst : DescDef DescProd : DescDef DescSigma : DescDef DescPi : DescDef -- We slightly diverge here from the presentation of the paper: note -- the presence of terminating "const Unit". Recall our Lisp-ish -- notation for nested tuples: -- |[a b c]| -- Corresponds to -- |[a , [ b , [c , []]]]| -- So, if we want to write constructors using our Lisp-ish notation, the interpretation -- [| DescD |] (Mu DescD) have to evaluates to [ constructor , [ arg1 , [ arg2 , []]]] -- Hence, we define Desc's code as follow: descCases : DescDef -> Desc descCases DescId = const Unit descCases DescConst = sigma Set (\_ -> const Unit) descCases DescProd = prod id (prod id (const Unit)) descCases DescSigma = sigma Set (\S -> prod (pi (lift S) (\_ -> id)) (const Unit)) descCases DescPi = sigma Set (\S -> prod (pi (lift S) (\_ -> id)) (const Unit)) DescD : Desc DescD = sigma DescDef descCases DescIn : Set1 DescIn = Mu DescD -- So that the constructors are: -- (Note the annoying |pair|s to set the implicit levels. I could not -- get rid of the yellow otherwise) idIn : DescIn idIn = con (pair {i = suc zero} {j = suc zero} DescId Void) constIn : Set -> DescIn constIn K = con (pair {i = suc zero} {j = suc zero} DescConst (K , Void)) prodIn : (D D' : DescIn) -> DescIn prodIn D D' = con (pair {i = suc zero} {j = suc zero} DescProd (D , ( D' , Void ))) sigmaIn : (S : Set)(D : S -> DescIn) -> DescIn sigmaIn S D = con (pair {i = suc zero} {j = suc zero} DescSigma (S , ((\s -> D (unlift s)) , Void ))) piIn : (S : Set)(D : S -> DescIn) -> DescIn piIn S D = con (pair {i = suc zero} {j = suc zero} DescPi (S , ((\s -> D (unlift s)) , Void ))) -- At this stage, we could prove the isomorphism between |DescIn| and -- |Desc|. While not technically difficult, it is long and -- laborious. We have carried this proof on the more complex and -- interesting |IDesc| universe, in IDesc.agda. --******************************************** -- Tagged description --******************************************** TagDesc : {l : Level} -> Set (suc l) TagDesc = Sigma En (\e -> spi e (\_ -> Desc)) de : TagDesc -> Desc de (B , F) = sigma (EnumT B) (\E -> switch B (\_ -> Desc) F E) --******************************************** -- Catamorphism --******************************************** cata : (D : Desc) (T : Set) -> ([| D |] T -> T) -> (Mu D) -> T cata D T phi x = ind D (\_ -> T) (\x ms -> phi (replace D T x ms)) x where replace : (D' : Desc)(T : Set)(xs : [| D' |] (Mu D))(ms : All D' (Mu D) (\_ -> T) xs) -> [| D' |] T replace id T x y = y replace (const Z) T z z' = z replace (prod D D') T (x , x') (y , y') = replace D T x y , replace D' T x' y' replace (sigma A B) T (a , b) t = a , replace (B a) T b t replace (pi A B) T f t = \s -> replace (B s) T (f s) (t s) --******************************************** -- Free monad construction --******************************************** _**_ : TagDesc -> (X : Set) -> TagDesc (e , D) ** X = cE e , (const X , D) --******************************************** -- Substitution --******************************************** apply : (D : TagDesc)(X Y : Set) -> (X -> Mu (de (D ** Y))) -> [| de (D ** X) |] (Mu (de (D ** Y))) -> Mu (de (D ** Y)) apply (E , B) X Y sig (EZe , x) = sig x apply (E , B) X Y sig (ESu n , t) = con (ESu n , t) subst : (D : TagDesc)(X Y : Set) -> Mu (de (D ** X)) -> (X -> Mu (de (D ** Y))) -> Mu (de (D ** Y)) subst D X Y x sig = cata (de (D ** X)) (Mu (de (D ** Y))) (apply D X Y sig) x
Program3.asm
pbhandari9541/COSC-2329
0
5810
;<NAME> ;Program: 3 ;Title: Conversion of octal to binary and base 4 org 100h section .data msg1 DB 0Ah,0Dh,'Parame<NAME> $' msg2 DB 0Ah,0Dh,'Enter an octal number onvert: $' msg3 DB 0Ah,0Dh,'The converted character in binary is: $' msg4 DB 0Ah,0Dh,'The converted character in Base4 is: $' msg5 DB 0Ah,0Dh,'press 1 to continue:' CHAR DB ' ','$' exCode DB 0 section .text start: mov dx, msg1 ;get message1 mov ah,09h ;display string function int 21h ;Display message1 mov ah,09h ;display string function mov dx, msg2 ;get message2 int 21h ;Display message2 ; input base octal value xor bx,bx ; bx holds input value mov ah,1 ; input char function int 21h ; read char into al top1: ; while (char != CR) cmp al,0Dh ; is char = CR? je out1 ; yes? finished with input je out2 push ax mov ax,8 ; set up to multiply bx by 8 mul bx ; dx:ax = bx*8 mov bx,ax pop ax and ax,0Fh ; convert from ASCII to base 10 value add bx,ax ; bx = old bx*8 + new digit mov ah,1 ; input char function int 21h ; read next character jmp top1 ; loop until done ; restore the register pop ax pop bx ret ; now, output it in binary out1: mov ah,9 ; print binary output label mov dx,msg3 int 21h ; for 16 times do this: mov cx, 16 ; loop counter top2: rol bx,1 ; rotate msb into CF jc one ; CF = 1? mov dl,'0' ; no, set up to print a 0 jmp print ; now print one: mov dl,'1' ; printing a 1 print: mov ah,2 ; print char fcn int 21h ; print it loop top2 ; loop until done ;now, output it on base 4 out2: mov ah,9 ; print octal output label mov dx,msg4 int 21h ; for 8 times do this: mov cx, 8 ; loop counter top3: rol bx,2 ; rotate top nybble into the bottom mov dl,bl ; put a copy in dl and dl,00000011b ; we only want the lower 2 bits cmp dl,3 ; is it in [0-3]? or dl,30h ; convert 0-3 to '0'-'3' jmp print2 ; now print print2: mov ah,2 ; print char fcn int 21h ; print it loop top3 ; loop until done finish: mov ah,9 ;user ask message mov dx,msg5 int 21h mov ah,1 ; input char function int 21h ; read char into al cmp al,031h ;compare if user input 1 je start ;jump start if user enter 1 jne exit ;else exit exit: mov ah,4Ch ;DOS function: exit program mov al,[exCode] ;Return exit code value int 21h ;call DOS. Terminte Program
Transynther/x86/_processed/AVXALIGN/_st_/i7-8650U_0xd2_notsx.log_15165_1514.asm
ljhsiun2/medusa
9
160836
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %rbp push %rcx push %rdi push %rdx push %rsi lea addresses_WT_ht+0x15dfd, %rsi lea addresses_A_ht+0x1e47d, %rdi nop nop nop add %r10, %r10 mov $101, %rcx rep movsb nop sub %rcx, %rcx lea addresses_WT_ht+0x27b6, %rsi lea addresses_WT_ht+0x7e7d, %rdi clflush (%rsi) nop sub %r11, %r11 mov $66, %rcx rep movsw nop add $58385, %r11 lea addresses_WC_ht+0x119ca, %rsi lea addresses_A_ht+0x50fd, %rdi nop nop nop nop cmp $30405, %rdx mov $25, %rcx rep movsl nop nop sub $4452, %r10 lea addresses_WC_ht+0xa977, %r11 xor %rbp, %rbp movw $0x6162, (%r11) nop nop nop and $26551, %rdx lea addresses_D_ht+0x1a27d, %r11 nop nop add %rdx, %rdx mov $0x6162636465666768, %rsi movq %rsi, %xmm7 movups %xmm7, (%r11) nop nop nop nop nop cmp $39454, %rdi pop %rsi pop %rdx pop %rdi pop %rcx pop %rbp pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r11 push %r14 push %r15 push %r9 push %rbx push %rcx push %rsi // Store lea addresses_WC+0xb86b, %r11 nop nop sub $58196, %rsi movw $0x5152, (%r11) and %r14, %r14 // Store lea addresses_normal+0x1a37d, %r9 nop nop nop nop nop dec %r15 mov $0x5152535455565758, %r14 movq %r14, %xmm0 vmovups %ymm0, (%r9) nop nop nop nop cmp %r9, %r9 // Faulty Load lea addresses_UC+0x7d, %r9 nop nop nop nop nop xor %rsi, %rsi mov (%r9), %rbx lea oracles, %r15 and $0xff, %rbx shlq $12, %rbx mov (%r15,%rbx,1), %rbx pop %rsi pop %rcx pop %rbx pop %r9 pop %r15 pop %r14 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'size': 32, 'AVXalign': False, 'NT': True, 'congruent': 0, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'size': 8, 'AVXalign': False, 'NT': True, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': True}, 'dst': {'type': 'addresses_A_ht', 'congruent': 10, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 7, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}} {'37': 15165} 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 */
courses/spark_for_ada_programmers/labs/source/070_type_contracts/important_dates.ads
AdaCore/training_material
15
29780
package Important_Dates with SPARK_Mode => On is type Date_T is record Year : Positive := Positive'First; Month : Positive := Positive'First; Day : Positive := Positive'First; end record; type Calendar_T is private; procedure Add_Event (Calendar : in out Calendar_T; Description : String; Date : Date_T); procedure Remove_Event (Calendar : in out Calendar_T; Description : String; Date : Date_T); procedure Print_Events (Calendar : Calendar_T; Number_Of_Events : Positive; Date : Date_T); private type Calendar_T is null record; end Important_Dates;
bb-runtimes/runtimes/ravenscar-full-stm32g474/gnat/s-dorepr.adb
JCGobbi/Nucleo-STM32G474RE
0
2798
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- S Y S T E M . D O U B L E _ R E A L . P R O D U C T -- -- -- -- B o d y -- -- -- -- Copyright (C) 2021, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- -- -- -- -- -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This is the default version of the separate package body with Interfaces; use Interfaces; separate (System.Double_Real) package body Product is procedure Split (N : Num; Hi : out Num; Lo : out Num); -- Compute high part and low part of N ----------- -- Split -- ----------- -- We use a bit manipulation algorithm instead of Veltkamp's splitting -- because it is faster and has the property that the magnitude of the -- high part is never larger than that of the input number, which will -- avoid spurious overflows in the Two_Prod algorithm. -- See the recent paper by <NAME>, <NAME> -- and <NAME>: On various ways to split a floating-point number -- ARITH 2018 - 25th IEEE Symposium on Computer Arithmetic, Jun 2018, -- Amherst (MA), United States, pages 53-60. procedure Split (N : Num; Hi : out Num; Lo : out Num) is X : Num; begin -- Spill the input into the appropriate (maybe larger) bit container, -- mask out the low bits and reload the modified value. case Num'Machine_Mantissa is when 24 => declare Rep32 : aliased Interfaces.Unsigned_32; Temp : Num := N with Address => Rep32'Address; pragma Annotate (CodePeer, Modified, Rep32); begin -- Mask out the low 12 bits Rep32 := Rep32 and 16#FFFFF000#; X := Temp; end; when 53 => declare Rep64 : aliased Interfaces.Unsigned_64; Temp : Num := N with Address => Rep64'Address; pragma Annotate (CodePeer, Modified, Rep64); begin -- Mask out the low 27 bits Rep64 := Rep64 and 16#FFFFFFFFF8000000#; X := Temp; end; when 64 => declare Rep80 : aliased array (1 .. 2) of Interfaces.Unsigned_64; Temp : Num := N with Address => Rep80'Address; pragma Annotate (CodePeer, Modified, Rep80); begin -- Mask out the low 32 bits if System.Default_Bit_Order = High_Order_First then Rep80 (1) := Rep80 (1) and 16#FFFFFFFFFFFF0000#; Rep80 (2) := Rep80 (2) and 16#0000FFFFFFFFFFFF#; else Rep80 (1) := Rep80 (1) and 16#FFFFFFFF00000000#; end if; X := Temp; end; when others => raise Program_Error; end case; -- Deal with denormalized numbers if X = 0.0 then Hi := N; Lo := 0.0; else Hi := X; Lo := N - X; end if; end Split; -------------- -- Two_Prod -- -------------- function Two_Prod (A, B : Num) return Double_T is P : constant Num := A * B; Ahi, Alo, Bhi, Blo, E : Num; begin if Is_Infinity (P) or else Is_Zero (P) then return (P, 0.0); else Split (A, Ahi, Alo); Split (B, Bhi, Blo); E := ((Ahi * Bhi - P) + Ahi * Blo + Alo * Bhi) + Alo * Blo; return (P, E); end if; end Two_Prod; ------------- -- Two_Sqr -- ------------- function Two_Sqr (A : Num) return Double_T is Q : constant Num := A * A; Hi, Lo, E : Num; begin if Is_Infinity (Q) or else Is_Zero (Q) then return (Q, 0.0); else Split (A, Hi, Lo); E := ((Hi * Hi - Q) + 2.0 * Hi * Lo) + Lo * Lo; return (Q, E); end if; end Two_Sqr; end Product;
unittests/ASM/REP/F3_7F.asm
cobalt2727/FEX
628
16826
%ifdef CONFIG { "RegData": { "XMM0": ["0x4142434445464748", "0x5152535455565758"], "XMM1": ["0x5152535455565758", "0x6162636465666768"], "XMM2": ["0x4142434445464748", "0x5152535455565758"], "XMM3": ["0x0", "0x0"], "XMM4": ["0x5152535455565758", "0x6162636465666768"] }, "MemoryRegions": { "0x100000000": "4096" } } %endif mov rdx, 0xe0000000 mov rax, 0x4142434445464748 mov [rdx + 8 * 0], rax mov rax, 0x5152535455565758 mov [rdx + 8 * 1], rax mov rax, 0x6162636465666768 mov [rdx + 8 * 2], rax mov rax, 0 mov [rdx + 8 * 3], rax mov [rdx + 8 * 4], rax mov [rdx + 8 * 5], rax mov [rdx + 8 * 6], rax mov [rdx + 8 * 7], rax movdqu xmm0, [rdx + 8 * 0] movdqu xmm1, [rdx + 8 * 1] movdqu [rdx + 8 * 3], xmm0 movdqu xmm2, [rdx + 8 * 3] ; Ensure it didn't write past where it should movdqu xmm3, [rdx + 8 * 5] movdqu xmm4, xmm1 hlt
Kernel/asm/interrupts.asm
tomi2711/tpe-arqui
0
166990
GLOBAL kEnableInterrupts GLOBAL kDisableInterrupts GLOBAL kSetHandler GLOBAL kGetIDTR GLOBAL keyboardInterruptHandler GLOBAL syscallInterruptHandler GLOBAL TTInterruptHandler EXTERN keyboardHandler EXTERN syscallHandler EXTERN TTHandler section .text kEnableInterrupts: sti ret kDisableInterrupts: cli ret kGetIDTR: sidt [rdi] ret kSetHandler: mov rax, rsi shl rdi, 4 ; quickly multiply rdi by 16 to go to the corresponding place in the table add rdi, rdx ; adds the base address of the idt table to the place in the table stosw ; store the low word (15..0) shr rax, 16 add rdi, 4 ; skip the gate marker stosw ; store the high word (31..16) shr rax, 16 stosd ; store the high dword (63..32) ret ; Handlers TTInterruptHandler: call TTHandler mov al, 0x20 out 0x20, al iretq keyboardInterruptHandler: call keyboardHandler mov al, 0x20 out 0x20, al iretq syscallInterruptHandler: call syscallHandler iretq
source/pit.asm
re0ah/nameless-OS16
0
12007
<reponame>re0ah/nameless-OS16<gh_stars>0 ;This is free and unencumbered software released into the public domain. ;Anyone is free to copy, modify, publish, use, compile, sell, or ;distribute this software, either in source code form or as a compiled ;binary, for any purpose, commercial or non-commercial, and by any ;means. ;In jurisdictions that recognize copyright laws, the author or authors ;of this software dedicate any and all copyright interest in the ;software to the public domain. We make this dedication for the benefit ;of the public at large and to the detriment of our heirs and ;successors. We intend this dedication to be an overt act of ;relinquishment in perpetuity of all present and future rights to this ;software under copyright law. ;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 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. ;For more information, please refer to <http://unlicense.org/> ;more on http://www.scs.stanford.edu/10wi-cs140/pintos/specs/8254.pdf ;control word register: ; 0 bit : BCD ; 0 = 16-bit binary counter ; 1 = 16-bit BCD counter ; 1..3 bits: modes ; 000 = mode 0: interrupt on terminal count ; 001 = mode 1: hardware retriggerable one-shot ; 010 = mode 2: rate generator ; 011 = mode 3: square wave ; 100 = mode 4: software triggered strobe ; 101 = mode 5: harware triggered strobe (retriggerable) ; 4..5 bits: read_write ; 00 = counter latch commands ; 01 = read/write least significant byte only ; 10 = read/write most significant byte only ; 11 = read/write least significant byte first, them most significant byte ; 6..7 bits: select counter ; 00 = counter 0 ; 01 = counter 1 ; 10 = counter 2 ; 11 = read-back command PIT_0_PORT equ 0x40 PIT_COMMAND_PORT equ 0x43 PIT_MODE3 equ 0x06 PIT_RW4 equ 0x30 PIT_CONTROL_WORD_FORMAT equ PIT_MODE3 | PIT_RW4 PIT_DEFAULT_FREQUENCY equ 1193182 ;that is 0x001234DE, 32bit value. ;need to be careful with him pit_init: ;just set frequency of PIT mov ax, PIT_DEFAULT_FREQUENCY / 32 pit_set_frequency: ;in: ax = frequency ;out: al = ah mov word[pit_frequency], ax push ax mov al, PIT_CONTROL_WORD_FORMAT out PIT_COMMAND_PORT, al pop ax out PIT_0_PORT, al mov al, ah out PIT_0_PORT, al retn pit_int: jmp return_from_interrupt
src/servlet-core.ads
My-Colaborations/ada-servlet
6
22788
----------------------------------------------------------------------- -- servlet-servlets -- Servlet.Core -- Copyright (C) 2010, 2011, 2012, 2013, 2015, 2016, 2017, 2018, 2020 <NAME> -- Written by <NAME> (<EMAIL>) -- -- 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. ----------------------------------------------------------------------- with Servlet.Requests; with Servlet.Responses; with Servlet.Sessions; with Servlet.Sessions.Factory; with Servlet.Routes; limited with Servlet.Filters; with Ada.Finalization; with Ada.Strings.Unbounded; with Ada.Strings.Hash; with Ada.Calendar; with Ada.Exceptions; with Util.Log; with Util.Properties; with Util.Strings.Vectors; with EL.Contexts; private with Ada.Containers.Indefinite_Hashed_Maps; -- The <b>Servlet.Core</b> package implements a subset of the -- Java Servlet Specification adapted for the Ada language. -- -- The rationale for this implementation is to provide a set of -- interfaces and ways of developing a Web application which -- benefit from the architecture expertise defined in Java applications. -- -- The <b>Servlet.Core</b>, <b>Servlet.Requests</b>, <b>Servlet.Responses</b> -- and <b>Servlet.Sessions</b> packages are independent of the web server -- which will be used (such as <b>AWS</b>, <b>Apache</b> or <b>Lighthttpd</b>). -- package Servlet.Core is Servlet_Error : exception; type Status_Type is (Ready, Disabled, Started, Suspended, Stopped); -- Filter chain as defined by JSR 315 6. Filtering type Filter_Chain is limited private; type Filter_Config is private; type Filter_Access is access all Servlet.Filters.Filter'Class; type Filter_List_Access is access all Servlet.Filters.Filter_List; -- Causes the next filter in the chain to be invoked, or if the calling -- filter is the last filter in the chain, causes the resource at the end -- of the chain to be invoked. procedure Do_Filter (Chain : in out Filter_Chain; Request : in out Requests.Request'Class; Response : in out Responses.Response'Class); -- Get the filter name. function Get_Filter_Name (Config : in Filter_Config) return String; -- Returns a String containing the value of the named context-wide initialization -- parameter, or the default value if the parameter does not exist. -- -- The filter parameter name is automatically prefixed by the filter name followed by '.'. function Get_Init_Parameter (Config : in Filter_Config; Name : in String; Default : in String := "") return String; function Get_Init_Parameter (Config : in Filter_Config; Name : in String; Default : in String := "") return Ada.Strings.Unbounded.Unbounded_String; -- type Servlet_Registry; type Servlet_Registry is new Servlet.Sessions.Factory.Session_Factory with private; type Servlet_Registry_Access is access all Servlet_Registry'Class; -- Get the servlet context associated with the filter chain. function Get_Servlet_Context (Chain : in Filter_Chain) return Servlet_Registry_Access; -- Get the servlet context associated with the filter config. function Get_Servlet_Context (Config : in Filter_Config) return Servlet_Registry_Access; -- The <b>Servlet</b> represents the component that will handle -- an HTTP request received by the server. -- -- JSR 315 - 2. The Servlet Interface type Servlet is tagged limited private; type Servlet_Access is access all Servlet'Class; -- Get the servlet name. function Get_Name (Server : in Servlet) return String; -- Get the servlet context associated with this servlet. function Get_Servlet_Context (Server : in Servlet) return Servlet_Registry_Access; -- Called by the servlet container to indicate to a servlet that the servlet -- is being placed into service. -- not overriding procedure Initialize (Server : in out Servlet; Context : in Servlet_Registry'Class); -- Receives standard HTTP requests from the public service method and dispatches -- them to the Do_XXX methods defined in this class. This method is an HTTP-specific -- version of the Servlet.service(Request, Response) method. There's no need -- to override this method. procedure Service (Server : in Servlet; Request : in out Requests.Request'Class; Response : in out Responses.Response'Class); -- Returns the time the Request object was last modified, in milliseconds since -- midnight January 1, 1970 GMT. If the time is unknown, this method returns -- a negative number (the default). -- -- Servlets that support HTTP GET requests and can quickly determine their -- last modification time should override this method. This makes browser and -- proxy caches work more effectively, reducing the load on server and network -- resources. function Get_Last_Modified (Server : in Servlet; Request : in Requests.Request'Class) return Ada.Calendar.Time; -- Called by the server (via the service method) to allow a servlet to handle -- a GET request. -- -- Overriding this method to support a GET request also automatically supports -- an HTTP HEAD request. A HEAD request is a GET request that returns no body -- in the response, only the request header fields. -- -- When overriding this method, read the request data, write the response headers, -- get the response's writer or output stream object, and finally, write the -- response data. It's best to include content type and encoding. -- When using a PrintWriter object to return the response, set the content type -- before accessing the PrintWriter object. -- -- The servlet container must write the headers before committing the response, -- because in HTTP the headers must be sent before the response body. -- -- Where possible, set the Content-Length header (with the -- Response.Set_Content_Length method), to allow the servlet container -- to use a persistent connection to return its response to the client, -- improving performance. The content length is automatically set if the entire -- response fits inside the response buffer. -- -- When using HTTP 1.1 chunked encoding (which means that the response has a -- Transfer-Encoding header), do not set the Content-Length header. -- -- The GET method should be safe, that is, without any side effects for which -- users are held responsible. For example, most form queries have no side effects. -- If a client request is intended to change stored data, the request should use -- some other HTTP method. -- -- The GET method should also be idempotent, meaning that it can be safely repeated. -- Sometimes making a method safe also makes it idempotent. For example, repeating -- queries is both safe and idempotent, but buying a product online or modifying -- data is neither safe nor idempotent. -- -- If the request is incorrectly formatted, Do_Get returns an HTTP "Bad Request" procedure Do_Get (Server : in Servlet; Request : in out Requests.Request'Class; Response : in out Responses.Response'Class); -- Receives an HTTP HEAD request from the protected service method and handles -- the request. The client sends a HEAD request when it wants to see only the -- headers of a response, such as Content-Type or Content-Length. The HTTP HEAD -- method counts the output bytes in the response to set the Content-Length header -- accurately. -- -- If you override this method, you can avoid computing the response body and just -- set the response headers directly to improve performance. Make sure that the -- Do_Head method you write is both safe and idempotent (that is, protects itself -- from being called multiple times for one HTTP HEAD request). -- -- If the HTTP HEAD request is incorrectly formatted, doHead returns an HTTP -- "Bad Request" message. procedure Do_Head (Server : in Servlet; Request : in out Requests.Request'Class; Response : in out Responses.Response'Class); -- Called by the server (via the service method) to allow a servlet to handle -- a POST request. The HTTP POST method allows the client to send data of unlimited -- length to the Web server a single time and is useful when posting information -- such as credit card numbers. -- -- When overriding this method, read the request data, write the response headers, -- get the response's writer or output stream object, and finally, write the -- response data. It's best to include content type and encoding. When using -- a PrintWriter object to return the response, set the content type before -- accessing the PrintWriter object. -- -- The servlet container must write the headers before committing the response, -- because in HTTP the headers must be sent before the response body. -- -- Where possible, set the Content-Length header (with the -- Response.Set_Content_Length method), to allow the servlet container to use -- a persistent connection to return its response to the client, improving -- performance. The content length is automatically set if the entire response -- fits inside the response buffer. -- -- When using HTTP 1.1 chunked encoding (which means that the response has a -- Transfer-Encoding header), do not set the Content-Length header. -- -- This method does not need to be either safe or idempotent. Operations -- requested through POST can have side effects for which the user can be held -- accountable, for example, updating stored data or buying items online. -- -- If the HTTP POST request is incorrectly formatted, doPost returns -- an HTTP "Bad Request" message. procedure Do_Post (Server : in Servlet; Request : in out Requests.Request'Class; Response : in out Responses.Response'Class); -- Called by the server (via the service method) to allow a servlet to handle -- a PUT request. The PUT operation allows a client to place a file on the server -- and is similar to sending a file by FTP. -- -- When overriding this method, leave intact any content headers sent with -- the request (including Content-Length, Content-Type, Content-Transfer-Encoding, -- Content-Encoding, Content-Base, Content-Language, Content-Location, -- Content-MD5, and Content-Range). If your method cannot handle a content -- header, it must issue an error message (HTTP 501 - Not Implemented) and -- discard the request. For more information on HTTP 1.1, see RFC 2616 . -- -- This method does not need to be either safe or idempotent. Operations that -- Do_Put performs can have side effects for which the user can be held accountable. -- When using this method, it may be useful to save a copy of the affected URL -- in temporary storage. -- -- If the HTTP PUT request is incorrectly formatted, Do_Put returns -- an HTTP "Bad Request" message. procedure Do_Put (Server : in Servlet; Request : in out Requests.Request'Class; Response : in out Responses.Response'Class); -- Called by the server (via the service method) to allow a servlet to handle -- a DELETE request. The DELETE operation allows a client to remove a document -- or Web page from the server. -- -- This method does not need to be either safe or idempotent. Operations requested -- through DELETE can have side effects for which users can be held accountable. -- When using this method, it may be useful to save a copy of the affected URL in -- temporary storage. -- -- If the HTTP DELETE request is incorrectly formatted, Do_Delete returns an HTTP -- "Bad Request" message. procedure Do_Delete (Server : in Servlet; Request : in out Requests.Request'Class; Response : in out Responses.Response'Class); -- Called by the server (via the service method) to allow a servlet to handle a -- OPTIONS request. The OPTIONS request determines which HTTP methods the server -- supports and returns an appropriate header. For example, if a servlet overrides -- Do_Get, this method returns the following header: -- -- Allow: GET, HEAD, TRACE, OPTIONS -- -- There's no need to override this method unless the servlet implements new -- HTTP methods, beyond those implemented by HTTP 1.1. procedure Do_Options (Server : in Servlet; Request : in out Requests.Request'Class; Response : in out Responses.Response'Class); -- Called by the server (via the service method) to allow a servlet to handle -- a TRACE request. A TRACE returns the headers sent with the TRACE request to -- the client, so that they can be used in debugging. There's no need to override -- this method. procedure Do_Trace (Server : in Servlet; Request : in out Requests.Request'Class; Response : in out Responses.Response'Class); -- Called by the server (via the service method) to allow a servlet to handle -- a PATCH request (RFC 5789). procedure Do_Patch (Server : in Servlet; Request : in out Requests.Request'Class; Response : in out Responses.Response'Class); -- JSR 315 9. Dispatching Requests type Request_Dispatcher is limited private; -- Forwards a request from a servlet to another resource -- (servlet, or HTML file) on the server. This method allows one servlet to do -- preliminary processing of a request and another resource to generate the response. -- -- For a Request_Dispatcher obtained via Get_Request_Dispatcher(), -- the ServletRequest object has its path elements and parameters adjusted -- to match the path of the target resource. -- -- forward should be called before the response has been committed to the -- client (before response body output has been flushed). If the response -- already has been committed, this method throws an IllegalStateException. -- Uncommitted output in the response buffer is automatically cleared before -- the forward. -- -- The request and response parameters must be either the same objects as were -- passed to the calling servlet's service method or be subclasses of the -- RequestWrapper or ResponseWrapper classes that wrap them. procedure Forward (Dispatcher : in Request_Dispatcher; Request : in out Requests.Request'Class; Response : in out Responses.Response'Class); -- Includes the content of a resource (servlet, or, HTML file) in the response. -- In essence, this method enables programmatic server-side includes. -- -- The Response object has its path elements and parameters remain -- unchanged from the caller's. The included servlet cannot change the response -- status code or set headers; any attempt to make a change is ignored. -- -- The request and response parameters must be either the same objects as were -- passed to the calling servlet's service method or be subclasses of the -- RequestWrapper or ResponseWrapper classes that wrap them. procedure Include (Dispatcher : in Request_Dispatcher; Request : in out Requests.Request'Class; Response : in out Responses.Response'Class); -- Returns the servlet that will be called when forwarding the request. function Get_Servlet (Dispatcher : in Request_Dispatcher) return Servlet_Access; -- Returns a Request_Dispatcher object that acts as a wrapper for the resource -- located at the given path. A Request_Dispatcher object can be used to forward -- a request to the resource or to include the resource in a response. -- The resource can be dynamic or static. function Get_Request_Dispatcher (Context : in Servlet_Registry; Path : in String) return Request_Dispatcher; -- Returns a Request_Dispatcher object that acts as a wrapper for the named servlet. -- -- Servlets may be given names via server administration or via a web application -- deployment descriptor. A servlet instance can determine its name using -- ServletConfig.getServletName(). function Get_Name_Dispatcher (Context : in Servlet_Registry; Name : in String) return Request_Dispatcher; -- Returns the context path of the web application. -- The context path is the portion of the request URI that is used to select the context -- of the request. The context path always comes first in a request URI. The path starts -- with a "/" character but does not end with a "/" character. For servlets in the default -- (root) context, this method returns "". function Get_Context_Path (Context : in Servlet_Registry) return String; -- Returns a String containing the value of the named context-wide initialization -- parameter, or null if the parameter does not exist. -- -- This method can make available configuration information useful to an entire -- "web application". For example, it can provide a webmaster's email address -- or the name of a system that holds critical data. function Get_Init_Parameter (Context : in Servlet_Registry; Name : in String; Default : in String := "") return String; function Get_Init_Parameter (Context : in Servlet_Registry; Name : in String; Default : in String := "") return Ada.Strings.Unbounded.Unbounded_String; -- Set the init parameter identified by <b>Name</b> to the value <b>Value</b>. procedure Set_Init_Parameter (Context : in out Servlet_Registry; Name : in String; Value : in String); -- Set the init parameters by copying the properties defined in <b>Params</b>. -- Existing parameters will be overriding by the new values. procedure Set_Init_Parameters (Context : in out Servlet_Registry; Params : in Util.Properties.Manager'Class); -- Get access to the init parameters. procedure Get_Init_Parameters (Context : in Servlet_Registry; Process : not null access procedure (Params : in Util.Properties.Manager'Class)); -- Returns the absolute path of the resource identified by the given relative path. -- The resource is searched in a list of directories configured by the application. -- The path must begin with a "/" and is interpreted as relative to the current -- context root. -- -- This method allows the servlet container to make a resource available to -- servlets from any source. -- -- This method returns an empty string if the resource could not be localized. function Get_Resource (Context : in Servlet_Registry; Path : in String) return String; -- Registers the given servlet instance with this ServletContext under -- the given servletName. -- -- If this ServletContext already contains a preliminary -- ServletRegistration for a servlet with the given servletName, -- it will be completed (by assigning the class name of the given -- servlet instance to it) and returned. procedure Add_Servlet (Registry : in out Servlet_Registry; Name : in String; Server : in Servlet_Access); -- Registers the given filter instance with this Servlet context. procedure Add_Filter (Registry : in out Servlet_Registry; Name : in String; Filter : in Filter_Access); -- Add a filter mapping with the given pattern -- If the URL pattern is already mapped to a different servlet, -- no updates will be performed. procedure Add_Filter_Mapping (Registry : in out Servlet_Registry; Pattern : in String; Name : in String); -- Add a servlet mapping with the given pattern -- If the URL pattern is already mapped to a different servlet, -- no updates will be performed. procedure Add_Mapping (Registry : in out Servlet_Registry; Pattern : in String; Name : in String); -- Add a servlet mapping with the given pattern -- If the URL pattern is already mapped to a different servlet, -- no updates will be performed. procedure Add_Mapping (Registry : in out Servlet_Registry; Pattern : in String; Server : in Servlet_Access); -- Add a route associated with the given path pattern. The pattern is split into components. -- Some path components can be a fixed string (/home) and others can be variable. -- When a path component is variable, the value can be retrieved from the route context. -- Once the route path is created, the <tt>Process</tt> procedure is called with the route -- reference. procedure Add_Route (Registry : in out Servlet_Registry; Pattern : in String; ELContext : in EL.Contexts.ELContext'Class; Process : not null access procedure (Route : in out Routes.Route_Type_Ref)); -- Set the error page that will be used if a servlet returns an error. procedure Set_Error_Page (Server : in out Servlet_Registry; Error : in Integer; Page : in String); -- Send the error page content defined by the response status. procedure Send_Error_Page (Server : in Servlet_Registry; Request : in out Requests.Request'Class; Response : in out Responses.Response'Class); -- Report an error when an exception occurred while processing the request. procedure Error (Registry : in Servlet_Registry; Request : in out Requests.Request'Class; Response : in out Responses.Response'Class; Ex : in Ada.Exceptions.Exception_Occurrence); -- Register the application represented by <b>Registry</b> under the base URI defined -- by <b>URI</b>. This is called by the Web container when the application is registered. -- The default implementation keeps track of the base URI to implement the context path -- operation. procedure Register_Application (Registry : in out Servlet_Registry; URI : in String); -- Start the application. procedure Start (Registry : in out Servlet_Registry); -- Get the application status. function Get_Status (Registry : in Servlet_Registry) return Status_Type; -- Disable the application. procedure Disable (Registry : in out Servlet_Registry); -- Enable the application. procedure Enable (Registry : in out Servlet_Registry); -- Stop the application. procedure Stop (Registry : in out Servlet_Registry); -- Finalize the servlet registry releasing the internal mappings. overriding procedure Finalize (Registry : in out Servlet_Registry); -- Dump the routes and filter configuration in the log with the given log level. procedure Dump_Routes (Registry : in out Servlet_Registry; Level : in Util.Log.Level_Type); private use Ada.Strings.Unbounded; type Filter_Chain is limited record Filter_Pos : Natural; Filters : Filter_List_Access; Servlet : Servlet_Access; end record; type Request_Dispatcher is limited record Context : aliased Routes.Route_Context_Type; Filters : Filter_List_Access; Servlet : Servlet_Access := null; Pos : Natural := 0; end record; type Servlet is new Ada.Finalization.Limited_Controlled with record Name : Unbounded_String; Context : Servlet_Registry_Access := null; end record; package Filter_Maps is new Ada.Containers.Indefinite_Hashed_Maps (Key_Type => String, Element_Type => Filter_Access, Hash => Ada.Strings.Hash, Equivalent_Keys => "="); package Filter_List_Maps is new Ada.Containers.Indefinite_Hashed_Maps (Key_Type => String, Element_Type => Filter_List_Access, Hash => Ada.Strings.Hash, Equivalent_Keys => "="); package Servlet_Maps is new Ada.Containers.Indefinite_Hashed_Maps (Key_Type => String, Element_Type => Servlet_Access, Hash => Ada.Strings.Hash, Equivalent_Keys => "="); function Hash (N : Integer) return Ada.Containers.Hash_Type; package Error_Maps is new Ada.Containers.Indefinite_Hashed_Maps (Key_Type => Integer, Element_Type => String, Hash => Hash, Equivalent_Keys => "="); use Routes; type Servlet_Registry is new Sessions.Factory.Session_Factory with record Config : Util.Properties.Manager; Servlets : Servlet_Maps.Map; Filters : Filter_Maps.Map; Filter_Rules : Filter_List_Maps.Map; Filter_Patterns : Util.Strings.Vectors.Vector; Error_Pages : Error_Maps.Map; Context_Path : Unbounded_String; Routes : Router_Type; Status : Status_Type := Ready; end record; -- Install the servlet filters after all the mappings have been registered. procedure Install_Filters (Registry : in out Servlet_Registry); type Filter_Config is record Name : Unbounded_String; Context : Servlet_Registry_Access := null; end record; end Servlet.Core;
test/Compiler/simple/Erased-cubical-Pattern-matching-Cubical.agda
sseefried/agda
1
10801
{-# OPTIONS --cubical --save-metas #-} module Erased-cubical-Pattern-matching-Cubical where data D : Set where c₁ c₂ : D
src/opcodes.asm
DigiDwrf/neon64v2-easybuild
36
104370
// Ref opcodes: http://www.6502.org/tutorials/6502opcodes.html macro check_index(evaluate code) { if pc() - opcode_table != {code} * 8 { error "Table out of sync" } } macro read_op(evaluate code, _name, op1, op2) { check_index({code}) j {op1} la_gp(cpu_t0, {op2}) } macro write_op(evaluate code, _name, addr_mode, reg) { check_index({code}) j {addr_mode} move cpu_t0, {reg} } macro stack_op(evaluate code, _name, op) { check_index({code}) j {op} lbu cpu_t0, cpu_stack (r0) } // TODO: see if I can find a way to make use of this wasted space macro bad_op(evaluate code) { check_index({code}) j handle_bad_opcode lli cpu_t0, {code} } // Note: For ops that don't use the normal addressing modes, // or for Stores (write_op), I try to include some of the // work in the delay slot of the jump to the ex_*, usually // loading something into cpu_t0. opcode_table: stack_op( 0x00, "BRK", TakeBRK) read_op( 0x01, "ORA iX", addr_r_ix, ex_ora) bad_op( 0x02) bad_op( 0x03) bad_op( 0x04) read_op( 0x05, "ORA ZP", addr_r_zp, ex_ora) read_op( 0x06, "ASL ZP", addr_rw_zp, ex_asl) bad_op( 0x07) stack_op( 0x08, "PHP", ex_php) read_op( 0x09, "ORA imm", addr_r_imm, ex_ora) // 0x0a: ASL acc j ex_asl_acc srl cpu_t0, cpu_acc, 7 bad_op( 0x0b) bad_op( 0x0c) read_op( 0x0d, "ORA abs", addr_r_abs, ex_ora) read_op( 0x0e, "ASL abs", addr_rw_abs, ex_asl) bad_op( 0x0f) // 0x10: BPL j ex_bpl lb cpu_t0, cpu_n_byte (r0) read_op( 0x11, "ORA iY", addr_r_iy, ex_ora) bad_op( 0x12) bad_op( 0x13) bad_op( 0x14) read_op( 0x15, "ORA ZX", addr_r_zx, ex_ora) read_op( 0x16, "ASL ZX", addr_rw_zx, ex_asl) bad_op( 0x17) // 0x18: CLC j FinishCycleAndFetchOpcode sb r0, cpu_c_byte (r0) read_op( 0x19, "ORA absY", addr_r_absy, ex_ora) bad_op( 0x1a) bad_op( 0x1b) bad_op( 0x1c) read_op( 0x1d, "ORA absX", addr_r_absx, ex_ora) read_op( 0x1e, "ASL absX", addr_rw_absx, ex_asl) bad_op( 0x1f) // 0x20: JSR j ex_jsr lbu cpu_t0, 0 (cpu_mpc) read_op( 0x21, "AND iX", addr_r_ix, ex_and) bad_op( 0x22) bad_op( 0x23) read_op( 0x24, "BIT ZP", addr_r_zp, ex_bit) read_op( 0x25, "AND ZP", addr_r_zp, ex_and) read_op( 0x26, "ROL ZP", addr_rw_zp, ex_rol) bad_op( 0x27) stack_op( 0x28, "PLP", ex_plp) read_op( 0x29, "AND imm", addr_r_imm, ex_and) // 0x2a: ROL acc j ex_rol_acc lbu cpu_t0, cpu_c_byte (r0) bad_op( 0x2b) read_op( 0x2c, "BIT abs", addr_r_abs, ex_bit) read_op( 0x2d, "AND abs", addr_r_abs, ex_and) read_op( 0x2e, "ROL abs", addr_rw_abs, ex_rol) bad_op( 0x2f) // 0x30: BMI j ex_bmi lb cpu_t0, cpu_n_byte (r0) read_op( 0x31, "AND iY", addr_r_iy, ex_and) bad_op( 0x32) bad_op( 0x33) bad_op( 0x34) read_op( 0x35, "AND ZX", addr_r_zx, ex_and) read_op( 0x36, "ROL ZX", addr_rw_zx, ex_rol) bad_op( 0x37) // 0x38: SEC j ex_sec lli cpu_t0, 1 read_op( 0x39, "AND absY", addr_r_absy, ex_and) bad_op( 0x3a) bad_op( 0x3b) bad_op( 0x3c) read_op( 0x3d, "AND absX", addr_r_absx, ex_and) read_op( 0x3e, "ROL absX", addr_rw_absx, ex_rol) bad_op( 0x3f) stack_op( 0x40, "RTI", ex_rti) read_op( 0x41, "EOR iX", addr_r_ix, ex_eor) bad_op( 0x42) bad_op( 0x43) bad_op( 0x44) read_op( 0x45, "EOR ZP", addr_r_zp, ex_eor) read_op( 0x46, "LSR ZP", addr_rw_zp, ex_lsr) bad_op( 0x47) stack_op( 0x48, "PHA", ex_pha) read_op( 0x49, "EOR imm", addr_r_imm, ex_eor) // 0x4a: LSR acc j ex_lsr_acc andi cpu_t0, cpu_acc, 1 bad_op( 0x4b) // 0x4c: JMP abs j ex_jmp_abs lbu cpu_t0, 0 (cpu_mpc) read_op( 0x4d, "EOR abs", addr_r_abs, ex_eor) read_op( 0x4e, "LSR abs", addr_rw_abs, ex_lsr) bad_op( 0x4f) // 0x50: BVC j ex_bvc lbu cpu_t0, cpu_flags (r0) read_op( 0x51, "EOR iY", addr_r_iy, ex_eor) bad_op( 0x52) bad_op( 0x53) bad_op( 0x54) read_op( 0x55, "EOR ZX", addr_r_zx, ex_eor) read_op( 0x56, "LSR ZX", addr_rw_zx, ex_lsr) bad_op( 0x57) // 0x58: CLI j ex_cli lbu cpu_t0, cpu_flags (r0) read_op( 0x59, "EOR absY", addr_r_absy, ex_eor) bad_op( 0x5a) bad_op( 0x5b) bad_op( 0x5c) read_op( 0x5d, "EOR absX", addr_r_absx, ex_eor) read_op( 0x5e, "LSR absX", addr_rw_absx, ex_lsr) bad_op( 0x5f) stack_op( 0x60, "RTS", ex_rts) read_op( 0x61, "ADC iX", addr_r_ix, ex_adc) bad_op( 0x62) bad_op( 0x63) bad_op( 0x64) read_op( 0x65, "ADC ZP", addr_r_zp, ex_adc) read_op( 0x66, "ROR ZP", addr_rw_zp, ex_ror) bad_op( 0x67) stack_op( 0x68, "PLA", ex_pla) read_op( 0x69, "ADC imm", addr_r_imm, ex_adc) // 0x6a: ROR acc j ex_ror_acc lbu cpu_t0, cpu_c_byte (r0) bad_op( 0x6b) // 0x6c: JMP (abs) j ex_jmp_absi lbu cpu_t0, 0 (cpu_mpc) read_op( 0x6d, "ADC abs", addr_r_abs, ex_adc) read_op( 0x6e, "ROR abs", addr_rw_abs, ex_ror) bad_op( 0x6f) // 0x70: BVS j ex_bvs lbu cpu_t0, cpu_flags (r0) read_op( 0x71, "ADC iY", addr_r_iy, ex_adc) bad_op( 0x72) bad_op( 0x73) bad_op( 0x74) read_op( 0x75, "ADC ZX", addr_r_zx, ex_adc) read_op( 0x76, "ROR ZX", addr_rw_zx, ex_ror) bad_op( 0x77) // 0x78: SEI j ex_sei lbu cpu_t0, cpu_flags (r0) read_op( 0x79, "ADC absY", addr_r_absy, ex_adc) bad_op( 0x7a) bad_op( 0x7b) bad_op( 0x7c) read_op( 0x7d, "ADC absX", addr_r_absx, ex_adc) read_op( 0x7e, "ROR absX", addr_rw_absx, ex_ror) bad_op( 0x7f) bad_op( 0x80) write_op( 0x81, "STA iX", addr_w_ix, cpu_acc) bad_op( 0x82) bad_op( 0x83) write_op( 0x84, "STY ZP", addr_w_zp, cpu_y) write_op( 0x85, "STA ZP", addr_w_zp, cpu_acc) write_op( 0x86, "STX ZP", addr_w_zp, cpu_x) bad_op( 0x87) // 0x88: DEY j ex_iny_dey addiu cpu_y, -1 bad_op( 0x89) // 0x8a: TXA j ex_transfer_acc move cpu_acc, cpu_x bad_op( 0x8b) write_op( 0x8c, "STY abs", addr_w_abs, cpu_y) write_op( 0x8d, "STA abs", addr_w_abs, cpu_acc) write_op( 0x8e, "STX abs", addr_w_abs, cpu_x) bad_op( 0x8f) // 0x90: BCC j ex_bcc lbu cpu_t0, cpu_c_byte (r0) write_op( 0x91, "STA iY", addr_w_iy, cpu_acc) bad_op( 0x92) bad_op( 0x93) write_op( 0x94, "STY ZX", addr_w_zx, cpu_y) write_op( 0x95, "STA ZX", addr_w_zx, cpu_acc) write_op( 0x96, "STX ZY", addr_w_zy, cpu_x) bad_op( 0x97) // 0x98: TYA j ex_transfer_acc move cpu_acc, cpu_y write_op( 0x99, "STA absY", addr_w_absy, cpu_acc) // 0x9a: TXS j FinishCycleAndFetchOpcode sb cpu_x, cpu_stack (r0) bad_op( 0x9b) bad_op( 0x9c) write_op( 0x9d, "STA absX", addr_w_absx, cpu_acc) bad_op( 0x9e) bad_op( 0x9f) read_op( 0xa0, "LDY imm", addr_r_imm, ex_ldy) read_op( 0xa1, "LDA IX", addr_r_ix, ex_lda) read_op( 0xa2, "LDX imm", addr_r_imm, ex_ldx) bad_op( 0xa3) read_op( 0xa4, "LDY ZP", addr_r_zp, ex_ldy) read_op( 0xa5, "LDA ZP", addr_r_zp, ex_lda) read_op( 0xa6, "LDX ZP", addr_r_zp, ex_ldx) bad_op( 0xa7) // 0xa8: TAY j ex_transfer_acc move cpu_y, cpu_acc read_op( 0xa9, "LDA imm", addr_r_imm, ex_lda) // 0xaa: TAX j ex_transfer_acc move cpu_x, cpu_acc bad_op( 0xab) read_op( 0xac, "LDY abs", addr_r_abs, ex_ldy) read_op( 0xad, "LDA abs", addr_r_abs, ex_lda) read_op( 0xae, "LDX abs", addr_r_abs, ex_ldx) bad_op( 0xaf) // 0xb0: BCS j ex_bcs lbu cpu_t0, cpu_c_byte (r0) read_op( 0xb1, "LDA IY", addr_r_iy, ex_lda) bad_op( 0xb2) bad_op( 0xb3) read_op( 0xb4, "LDY ZX", addr_r_zx, ex_ldy) read_op( 0xb5, "LDA ZX", addr_r_zx, ex_lda) read_op( 0xb6, "LDX ZY", addr_r_zy, ex_ldx) bad_op( 0xb7) // 0xb8: CLV j ex_clv lbu cpu_t0, cpu_flags (r0) read_op( 0xb9, "LDA absY", addr_r_absy, ex_lda) // 0xba: TSX j ex_tsx lbu cpu_x, cpu_stack (r0) bad_op( 0xbb) read_op( 0xbc, "LDY absX", addr_r_absx, ex_ldy) read_op( 0xbd, "LDA absX", addr_r_absx, ex_lda) read_op( 0xbe, "LDX absY", addr_r_absy, ex_ldx) bad_op( 0xbf) read_op( 0xc0, "CPY imm", addr_r_imm, ex_cpy) read_op( 0xc1, "CMP IX", addr_r_ix, ex_cmp) bad_op( 0xc2) bad_op( 0xc3) read_op( 0xc4, "CPY ZP", addr_r_zp, ex_cpy) read_op( 0xc5, "CMP ZP", addr_r_zp, ex_cmp) read_op( 0xc6, "DEC ZP", addr_rw_zp, ex_dec) bad_op( 0xc7) // 0xc8: INY j ex_iny_dey addiu cpu_y, 1 read_op( 0xc9, "CMP imm", addr_r_imm, ex_cmp) // 0xca: DEX j ex_inx_dex addiu cpu_x, -1 bad_op( 0xcb) read_op( 0xcc, "CPY abs", addr_r_abs, ex_cpy) read_op( 0xcd, "CMP abs", addr_r_abs, ex_cmp) read_op( 0xce, "DEC abs", addr_rw_abs, ex_dec) bad_op( 0xcf) // 0xd0 j ex_bne lbu cpu_t0, cpu_z_byte (r0) read_op( 0xd1, "CMP IY", addr_r_iy, ex_cmp) bad_op( 0xd2) bad_op( 0xd3) bad_op( 0xd4) read_op( 0xd5, "CMP ZX", addr_r_zx, ex_cmp) read_op( 0xd6, "DEC ZX", addr_rw_zx, ex_dec) bad_op( 0xd7) // 0xd8: CLD j ex_cld lbu cpu_t0, cpu_flags (r0) read_op( 0xd9, "CMP absY", addr_r_absy, ex_cmp) bad_op( 0xda) bad_op( 0xdb) bad_op( 0xdc) read_op( 0xdd, "CMP absX", addr_r_absx, ex_cmp) read_op( 0xde, "DEC absX", addr_rw_absx, ex_dec) bad_op( 0xdf) read_op( 0xe0, "CPX imm", addr_r_imm, ex_cpx) read_op( 0xe1, "SBC IX", addr_r_ix, ex_sbc) bad_op( 0xe2) bad_op( 0xe3) read_op( 0xe4, "CPX ZP", addr_r_zp, ex_cpx) read_op( 0xe5, "SBC ZP", addr_r_zp, ex_sbc) read_op( 0xe6, "INC ZP", addr_rw_zp, ex_inc) bad_op( 0xe7) // 0xe8: INX j ex_inx_dex addi cpu_x, 1 read_op( 0xe9, "SBC imm", addr_r_imm, ex_sbc) // 0xea: NOP j FinishCycleAndFetchOpcode nop bad_op( 0xeb) read_op( 0xec, "CPX abs", addr_r_abs, ex_cpx) read_op( 0xed, "SBC abs", addr_r_abs, ex_sbc) read_op( 0xee, "INC abs", addr_rw_abs, ex_inc) bad_op( 0xef) // 0xf0: BEQ j ex_beq lbu cpu_t0, cpu_z_byte (r0) read_op( 0xf1, "SBC IY", addr_r_iy, ex_sbc) bad_op( 0xf2) bad_op( 0xf3) bad_op( 0xf4) read_op( 0xf5, "SBC ZX", addr_r_zx, ex_sbc) read_op( 0xf6, "INC ZX", addr_rw_zx, ex_inc) bad_op( 0xf7) // 0xf8: SED j ex_sed lbu cpu_t0, cpu_flags (r0) read_op( 0xf9, "SBC absY", addr_r_absy, ex_sbc) bad_op( 0xfa) bad_op( 0xfb) bad_op( 0xfc) read_op( 0xfd, "SBC absX", addr_r_absx, ex_sbc) read_op( 0xfe, "INC absX", addr_rw_absx, ex_inc) bad_op( 0xff) check_index(0x100)
oeis/286/A286771.asm
neoneye/loda-programs
11
2504
; A286771: Binary representation of the diagonal from the origin to the corner of the n-th stage of growth of the two-dimensional cellular automaton defined by "Rule 221", based on the 5-celled von Neumann neighborhood. ; Submitted by <NAME> ; 1,1,0,111,10000,11111,1000000,1111111,100000000,111111111,10000000000,11111111111,1000000000000,1111111111111,100000000000000,111111111111111,10000000000000000,11111111111111111,1000000000000000000,1111111111111111111,100000000000000000000,111111111111111111111,10000000000000000000000,11111111111111111111111,1000000000000000000000000,1111111111111111111111111,100000000000000000000000000,111111111111111111111111111,10000000000000000000000000000,11111111111111111111111111111 mov $1,$0 seq $0,280411 ; Binary representation of the x-axis, from the origin to the right edge, of the n-th stage of growth of the two-dimensional cellular automaton defined by "Rule 261", based on the 5-celled von Neumann neighborhood. cmp $1,2 cmp $1,0 mul $0,$1
src/cm_mainmenu_movies.asm
tewtal/lttphack
28
179410
<reponame>tewtal/lttphack ; MOVIES {{{ cm_main_goto_movies: %cm_submenu("Movies", cm_submenu_movies) cm_submenu_movies: dw cm_movie_1 dw cm_movie_2 dw cm_movie_3 dw cm_movie_4 dw cm_movie_5 dw cm_movie_6 dw cm_movie_7 dw cm_movie_8 dw cm_movie_9 dw cm_movie_10 dw cm_movie_11 dw cm_movie_12 dw cm_movie_13 dw cm_movie_14 dw cm_movie_15 dw cm_movie_16 dw !menu_end %cm_header("MOVIES") cm_movie_1: %cm_movie("Movie 01 (0000 bytes)", 0) cm_movie_2: %cm_movie("Movie 02 (0000 bytes)", 1) cm_movie_3: %cm_movie("Movie 03 (0000 bytes)", 2) cm_movie_4: %cm_movie("Movie 04 (0000 bytes)", 3) cm_movie_5: %cm_movie("Movie 05 (0000 bytes)", 4) cm_movie_6: %cm_movie("Movie 06 (0000 bytes)", 5) cm_movie_7: %cm_movie("Movie 07 (0000 bytes)", 6) cm_movie_8: %cm_movie("Movie 08 (0000 bytes)", 7) cm_movie_9: %cm_movie("Movie 09 (0000 bytes)", 8) cm_movie_10: %cm_movie("Movie 10 (0000 bytes)", 9) cm_movie_11: %cm_movie("Movie 11 (0000 bytes)", 10) cm_movie_12: %cm_movie("Movie 12 (0000 bytes)", 11) cm_movie_13: %cm_movie("Movie 13 (0000 bytes)", 12) cm_movie_14: %cm_movie("Movie 14 (0000 bytes)", 13) cm_movie_15: %cm_movie("Movie 15 (0000 bytes)", 14) cm_movie_16: %cm_movie("Movie 16 (0000 bytes)", 15) ; }}}
programs/oeis/249/A249031.asm
karttu/loda
1
165210
; A249031: The non-anti-Fibonacci numbers: numbers not in A075326. ; 1,2,4,5,6,7,8,10,11,12,14,15,16,17,19,20,21,22,24,25,26,27,28,30,31,32,34,35,36,37,38,40,41,42,44,45,46,47,48,50,51,52,54,55,56,57,59,60,61,62,64,65,66,67,68,70,71,72,74,75,76,77,79,80,81,82,84,85,86,87,88,90,91,92,94,95,96,97,99,100,101,102,104,105,106,107,108,110,111,112,114,115,116,117,118,120,121,122,124,125,126,127,128,130,131,132,134,135,136,137,139,140,141,142,144,145,146,147,148,150,151,152,154,155,156,157,158,160,161,162,164,165,166,167,168,170,171,172,174,175,176,177,179,180,181,182,184,185,186,187,188,190,191,192,194,195,196,197,198,200,201,202,204,205,206,207,208,210,211,212,214,215,216,217,219,220,221,222,224,225,226,227,228,230,231,232,234,235,236,237,239,240,241,242,244,245,246,247,248,250,251,252,254,255,256,257,259,260,261,262,264,265,266,267,268,270,271,272,274,275,276,277,278,280,281,282,284,285,286,287,288,290,291,292,294,295,296,297,299,300,301,302,304,305,306,307,308,310,311,312 add $0,2 cal $0,298468 ; Solution (aa(n)) of the system of 3 complementary equations in Comments. mov $1,$0 cal $1,168458 ; a(n) = 7 + 10*floor((n-1)/2). sub $1,37 div $1,10 add $1,1
Transynther/x86/_processed/NONE/_zr_/i3-7100_9_0x84_notsx.log_21829_2430.asm
ljhsiun2/medusa
9
101231
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r13 push %r15 push %r9 push %rax push %rcx push %rdi push %rsi lea addresses_D_ht+0xc932, %rsi lea addresses_A_ht+0x57b2, %rdi nop nop nop nop cmp $47448, %r10 mov $121, %rcx rep movsl nop nop xor $19693, %r13 lea addresses_normal_ht+0x1e18b, %r9 nop nop nop nop nop cmp %r15, %r15 movups (%r9), %xmm1 vpextrq $0, %xmm1, %rcx nop nop nop nop nop sub $63417, %r13 lea addresses_D_ht+0xd8aa, %rsi lea addresses_WC_ht+0x4f12, %rdi cmp %rax, %rax mov $47, %rcx rep movsw nop nop nop nop nop inc %r9 lea addresses_UC_ht+0x9132, %r10 nop nop nop inc %rdi mov (%r10), %r15 nop nop nop and $56402, %r10 pop %rsi pop %rdi pop %rcx pop %rax pop %r9 pop %r15 pop %r13 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r12 push %r15 push %rcx push %rdi push %rdx push %rsi // REPMOV lea addresses_WC+0x2832, %rsi lea addresses_WT+0xd762, %rdi nop nop nop add %r12, %r12 mov $111, %rcx rep movsw nop nop nop nop nop sub $10129, %rcx // Store lea addresses_WT+0xff32, %r12 clflush (%r12) nop nop add $43897, %rsi movw $0x5152, (%r12) nop add $9448, %rdi // Load lea addresses_A+0x1132, %r10 nop nop nop nop dec %r15 movaps (%r10), %xmm3 vpextrq $1, %xmm3, %rcx nop nop nop sub $9805, %rdx // Store mov $0xbf2, %rdi nop nop nop nop sub $52566, %rdx movb $0x51, (%rdi) nop nop nop inc %rdx // Store lea addresses_D+0xfb72, %rdx nop nop nop nop nop dec %r12 movw $0x5152, (%rdx) nop nop nop sub $57715, %r10 // Store lea addresses_WC+0x9232, %rsi nop dec %rdx mov $0x5152535455565758, %rdi movq %rdi, %xmm4 movups %xmm4, (%rsi) sub $56846, %r12 // Store lea addresses_A+0x35a6, %rdi nop nop add %rsi, %rsi mov $0x5152535455565758, %rdx movq %rdx, %xmm2 vmovups %ymm2, (%rdi) nop nop nop nop nop sub $46369, %rsi // Faulty Load lea addresses_A+0x1132, %rdi add %rdx, %rdx movb (%rdi), %r12b lea oracles, %rcx and $0xff, %r12 shlq $12, %r12 mov (%rcx,%r12,1), %r12 pop %rsi pop %rdx pop %rdi pop %rcx pop %r15 pop %r12 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_A', 'same': False, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WC', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_WT', 'congruent': 3, 'same': False}, 'OP': 'REPM'} {'dst': {'type': 'addresses_WT', 'same': False, 'size': 2, 'congruent': 9, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_A', 'same': True, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_P', 'same': False, 'size': 1, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_D', 'same': False, 'size': 2, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_WC', 'same': False, 'size': 16, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_A', 'same': False, 'size': 32, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} [Faulty Load] {'src': {'type': 'addresses_A', 'same': True, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_D_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_D_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_UC_ht', 'same': False, 'size': 8, 'congruent': 11, 'NT': False, 'AVXalign': False}, '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 */
source/oasis/program-compilations.ads
optikos/oasis
0
4982
<filename>source/oasis/program-compilations.ads<gh_stars>0 -- Copyright (c) 2019 <NAME> <<EMAIL>> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- with Program.Lexical_Elements; with Program.Contexts; package Program.Compilations is pragma Pure; -- A specific Compilation value is valid (usable) for as long as the -- Context variable, used to create it, remains open. Once an Context is -- closed, all associated Compilation values become invalid. It is -- erroneous to use an invalid Compilation value. type Compilation is limited interface; -- The Ada Compilation abstraction: -- -- The text of a program is submitted to the compiler in one or more -- compilations. Each compilation is a succession of compilation units. type Compilation_Access is access all Compilation'Class with Storage_Size => 0; function Is_Assigned (Self : access Compilation'Class) return Boolean is (Self /= null); not overriding function Context (Self : Compilation) return not null Program.Contexts.Context_Access is abstract; -- Return corresponding context not overriding function Text_Name (Self : Compilation) return Text is abstract; -- Returns the name of the text, or other structure, that was the source of -- the compilation that resulted in this Compilation. Returns a null string -- if the text name is not available for any reason. not overriding function Object_Name (Self : Compilation) return Text is abstract; -- Returns the name of the object, or other structure, that contains the -- binary result of the compilation for this Compilation. Returns a null -- string if the object name is not available for any reason. not overriding function Line_Count (Self : Compilation) return Natural is abstract; not overriding function Line (Self : Compilation; Index : Positive) return Text is abstract; not overriding function Lexical_Element_Count (Self : Compilation) return Natural is abstract; not overriding function Lexical_Element (Self : Compilation; Index : Positive) return Program.Lexical_Elements.Lexical_Element_Access is abstract; -- TODO: Compilation_Pragmas? end Program.Compilations;
alloy4fun_models/trashltl/models/13/33Qvsxqvik5t622bk.als
Kaixi26/org.alloytools.alloy
0
207
open main pred id33Qvsxqvik5t622bk_prop14 { always some f : File | (f in Protected & Trash) implies (f not in Protected') } pred __repair { id33Qvsxqvik5t622bk_prop14 } check __repair { id33Qvsxqvik5t622bk_prop14 <=> prop14o }
boot/multiboot.asm
theaarushgupta/smolOS
1
101430
; allows bootloaders to identify os section .multiboot start: dd 0xe85250d6 ; multiboot2 dd 0 ; protected mode (i386) dd end - start ; header size dd 0x100000000 - (0xe85250d6 + 0 + (end - start)) ; checksum ; end tag dw 0 dw 0 dd 8 end:
programs/oeis/021/A021769.asm
neoneye/loda
22
87517
; A021769: Decimal expansion of 1/765. ; 0,0,1,3,0,7,1,8,9,5,4,2,4,8,3,6,6,0,1,3,0,7,1,8,9,5,4,2,4,8,3,6,6,0,1,3,0,7,1,8,9,5,4,2,4,8,3,6,6,0,1,3,0,7,1,8,9,5,4,2,4,8,3,6,6,0,1,3,0,7,1,8,9,5,4,2,4,8,3,6,6,0,1,3,0,7,1,8,9,5,4,2,4,8,3,6,6,0,1 add $0,1 mov $1,10 pow $1,$0 mul $1,2 div $1,1530 mod $1,10 mov $0,$1
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c9/c92005a.ada
best08618/asylo
7
12831
<filename>gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c9/c92005a.ada -- C92005A.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- CHECK THAT FOR A NON-SINGLE TASK THE OBJECT VALUE IS SET DURING -- ELABORATION OF THE CORRESPONDING OBJECT DECLARATION. -- WEI 3/ 4/82 -- JBG 5/25/85 -- PWB 2/3/86 CORRECTED TEST ERROR; ADDED 'USE' CLAUSE TO MAKE "/=" -- FOR BIG_INT VISIBLE. WITH REPORT, SYSTEM; USE REPORT; PROCEDURE C92005A IS BEGIN TEST ("C92005A", "TASK OBJECT VALUE DURING ELABORATION"); DECLARE TASK TYPE TT1; OBJ_TT1 : TT1; PACKAGE PACK IS TYPE BIG_INT IS RANGE 0 .. SYSTEM.MAX_INT; I : BIG_INT; END PACK; PACKAGE BODY PACK IS BEGIN I := OBJ_TT1'STORAGE_SIZE; -- O.K. EXCEPTION WHEN OTHERS => FAILED ("TASK OBJECT RAISED EXCEPTION"); END PACK; USE PACK; TASK BODY TT1 IS BEGIN NULL; END TT1; BEGIN IF PACK.I /= OBJ_TT1'STORAGE_SIZE THEN COMMENT ("STORAGE SIZE CHANGED AFTER TASK ACTIVATED"); END IF; EXCEPTION WHEN OTHERS => FAILED ("EXCEPTION RAISED BY STORAGE_SIZE"); END; RESULT; END C92005A;
test/asset/agda-stdlib-1.0/Data/List/Membership/Setoid.agda
omega12345/agda-mode
0
5688
<reponame>omega12345/agda-mode<gh_stars>0 ------------------------------------------------------------------------ -- The Agda standard library -- -- List membership and some related definitions ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} open import Relation.Binary module Data.List.Membership.Setoid {c ℓ} (S : Setoid c ℓ) where open import Function using (_∘_; id; flip) open import Data.Fin using (Fin; zero; suc) open import Data.List.Base as List using (List; []; _∷_; length; lookup) open import Data.List.Relation.Unary.Any using (Any; index; map; here; there) open import Data.Product as Prod using (∃; _×_; _,_) open import Relation.Unary using (Pred) open import Relation.Nullary using (¬_) open Setoid S renaming (Carrier to A) open Data.List.Relation.Unary.Any using (_∷=_; _─_) public ------------------------------------------------------------------------ -- Definitions infix 4 _∈_ _∉_ _∈_ : A → List A → Set _ x ∈ xs = Any (x ≈_) xs _∉_ : A → List A → Set _ x ∉ xs = ¬ x ∈ xs ------------------------------------------------------------------------ -- Operations mapWith∈ : ∀ {b} {B : Set b} (xs : List A) → (∀ {x} → x ∈ xs → B) → List B mapWith∈ [] f = [] mapWith∈ (x ∷ xs) f = f (here refl) ∷ mapWith∈ xs (f ∘ there) ------------------------------------------------------------------------ -- Finding and losing witnesses module _ {p} {P : Pred A p} where find : ∀ {xs} → Any P xs → ∃ λ x → x ∈ xs × P x find (here px) = (_ , here refl , px) find (there pxs) = Prod.map id (Prod.map there id) (find pxs) lose : P Respects _≈_ → ∀ {x xs} → x ∈ xs → P x → Any P xs lose resp x∈xs px = map (flip resp px) x∈xs ------------------------------------------------------------------------ -- DEPRECATED ------------------------------------------------------------------------ -- Please use the new names as continuing support for the old names is -- not guaranteed. -- Version 0.16 map-with-∈ = mapWith∈ {-# WARNING_ON_USAGE map-with-∈ "Warning: map-with-∈ was deprecated in v0.16. Please use mapWith∈ instead." #-}
libsrc/_DEVELOPMENT/input/zx/z80/asm_in_mouse_kempston_wheel_delta.asm
jpoikela/z88dk
640
161488
<filename>libsrc/_DEVELOPMENT/input/zx/z80/asm_in_mouse_kempston_wheel_delta.asm<gh_stars>100-1000 ; =============================================================== ; Sep 2014 ; =============================================================== ; ; int16_t in_mouse_kempston_wheel_delta(void) ; ; Report change in position of mouse track wheel. ; ; =============================================================== SECTION code_clib SECTION code_input PUBLIC asm_in_mouse_kempston_wheel_delta EXTERN asm_in_mouse_kempston_wheel EXTERN __input_kempston_mouse_wheel asm_in_mouse_kempston_wheel_delta: ; exit : hl = signed change in track wheel position ; carry reset ; ; uses : af, de, hl call asm_in_mouse_kempston_wheel ; hl = current absolute wheel position ld de,(__input_kempston_mouse_wheel) ; de = former absolute wheel position ld (__input_kempston_mouse_wheel),hl ; store new absolute wheel position sbc hl,de ; hl = relative change in position ld a,h or a jp p, positive negative: inc a jr nz, negative_saturate bit 7,l ret nz negative_saturate: ld hl,-128 ret positive: jr nz, positive_saturate bit 7,l ret z positive_saturate: ld hl,127 ret
oeis/037/A037789.asm
neoneye/loda-programs
11
8542
; A037789: Base 7 digits are, in order, the first n terms of the periodic sequence with initial period 3,2,0,1. ; Submitted by <NAME>(s1.) ; 3,23,161,1128,7899,55295,387065,2709456,18966195,132763367,929343569,6505404984,45537834891,318764844239,2231353909673,15619477367712,109336341573987,765354391017911,5357480737125377 add $0,1 mov $2,3 lpb $0 mov $3,$2 lpb $3 add $2,1 mod $3,5 div $4,7 cmp $4,0 sub $3,$4 add $5,1 lpe sub $0,1 add $2,1 mul $5,7 lpe mov $0,$5 div $0,7
Snippets/ScreenDimFlash.applescript
rogues-gallery/applescript
360
4294
<reponame>rogues-gallery/applescript tell application "System Preferences" activate reveal anchor "displaysDisplayTab" of pane id "com.apple.preference.displays" -- tell application "System Events" to tell process "iTerm2" to set visible to false tell application "System Events" tell process "System Preferences" to set visible to false delay 1 set value of slider 1 of group 1 of tab group 1 of window 1 of process "System Preferences" to 0.5 delay 0.5 set value of slider 1 of group 1 of tab group 1 of window 1 of process "System Preferences" to 1 delay 0.5 set value of slider 1 of group 1 of tab group 1 of window 1 of process "System Preferences" to 0.5 delay 0.5 set value of slider 1 of group 1 of tab group 1 of window 1 of process "System Preferences" to 1 end tell quit end tell
src/opencl/layermodeltests.adb
sebsgit/textproc
0
28221
with AUnit.Assertions; use AUnit.Assertions; with Ada.Text_IO; with Tensor; with NN2; package body LayerModelTests is procedure Register_Tests (T: in out TestCase) is use AUnit.Test_Cases.Registration; begin Register_Routine (T, testDense'Access, "Layer Model: Dense"); Register_Routine (T, testDenseDeep'Access, "Layer Model: Dense (multilayer)"); end Register_Tests; function Name(T: TestCase) return Test_String is begin return Format("Layer Model Tests"); end Name; procedure testDense(T : in out Test_Cases.Test_Case'Class) is model: NN2.Model := NN2.Create(input_size => 2); layer: constant NN2.Dense_Layer_Access := model.Add_Dense_Layer(neuron_count => 1); begin layer.weights.Set((1.0, 2.0)); layer.biases.Set((1 => 0.0)); Assert(NN2.Output_Size(layer.all) = 1, ""); declare fwd_data: constant Tensor.Var := Tensor.Variable(values => (4.0, 5.0)); fwd_result: constant Tensor.Var := NN2.Forward(layer.all, fwd_data); model_fwd: constant Tensor.Var := model.Forward(fwd_data); begin Assert(fwd_result.Dimension_Count = 1, ""); Assert(fwd_result.Dimension(1) = 1, ""); Assert(fwd_result.Element(1, 1) = 14.0, ""); Assert(model_fwd.Dimension_Count = 1, ""); Assert(model_fwd.Dimension(1) = 1, ""); Assert(model_fwd.Element(1, 1) = 14.0, ""); end; end testDense; procedure testDenseDeep(T : in out Test_Cases.Test_Case'Class) is model: NN2.Model := NN2.Create(input_size => 3); layer0: constant NN2.Dense_Layer_Access := model.Add_Dense_Layer(neuron_count => 2); layer1: constant NN2.Dense_Layer_Access := model.Add_Dense_Layer(neuron_count => 3); output_layer: constant NN2.Dense_Layer_Access := model.Add_Dense_Layer(neuron_count => 1); begin -- I0 - L1_0 - -- L0_0 - -- I1 - L1_1 - OUT -- L0_1 - -- I2 - L1_2 - Assert(NN2.Input_Size(layer0.all) = 3, ""); Assert(NN2.Input_Size(layer1.all) = 2, ""); Assert(NN2.Input_Size(output_layer.all) = 3, ""); Assert(NN2.Output_Size(layer0.all) = 2, ""); Assert(NN2.Output_Size(layer1.all) = 3, ""); Assert(NN2.Output_Size(output_layer.all) = 1, ""); layer0.weights.Set(values => (1.0, 2.0, 1.0, -1.0, -0.5, 2.0)); layer1.weights.Set(values => (0.5, 0.2, 0.7, 0.3, -0.1, 0.5)); output_layer.weights.Set(values => (0.3, 0.4, 0.3)); layer0.biases.Set((0.5, 0.7)); layer1.biases.Set((1.1, 2.1, 3.1)); output_layer.biases.Set((1 => -1.0)); declare input: constant Tensor.Var := Tensor.Variable(values => (10.0, 15.0, 20.0)); output: constant Tensor.Var := model.Forward(input); layer_0_res: constant Tensor.Float_Array := (1 => 1.0 * 10.0 + 2.0 * 15.0 + 1.0 * 20.0 + 0.5, 2 => -1.0 * 10.0 - 0.5 * 15.0 + 2.0 * 20.0 + 0.7); layer_1_res: constant Tensor.Float_Array := (1 => 0.5 * layer_0_res(1) + 0.2 * layer_0_res(2) + 1.1, 2 => 0.7 * layer_0_res(1) + 0.3 * layer_0_res(2) + 2.1, 3 => -0.1 * layer_0_res(1) + 0.5 * layer_0_res(2) + 3.1); expected_result: constant Float := 0.3 * layer_1_res(1) + 0.4 * layer_1_res(2) + 0.3 * layer_1_res(3) - 1.0; begin Assert(output.Element_Count = 1, ""); Assert(expected_result = output.Element(1, 1), "Expected: " & expected_result'Image & ", actual: " & Float(output.Element(1, 1))'Image); end; end testDenseDeep; end LayerModelTests;
loaders_patches_etc/redefine_kyes_patch_amaurote.asm
alexanderbazhenoff/zx-spectrum-various
0
4588
ORG #67FF BORDER EQU 5 INTTABL EQU #7800 FONT EQU #7A00 K_TABL EQU #6800+#400 DI LD A,BORDER OUT (#FE),A LD BC,#7FFD LD A,#18 OUT (C),A LD (#5B5C),A PUSH BC CALL PANEL CALL CLS POP BC LD A,#10 OUT (C),A LD (#5B5C),A CALL REDEFK CALL PANEL DI LD HL,#67E8 PUSH HL LD HL,#4000 LD DE,#67FF LD BC,#1800 JP #33C3 CLS DI LD BC,#7FFD LD HL,#FFFF LD DE,#1F18 OUT (C),E LD (HL),E OUT (C),D LD (HL),D OUT (C),E LD A,D CP (HL) JP Z,MODE48 LD A,#18 OUT (C),A LD HL,INTTABL LD A,H LD I,A INC A LD B,L INTI_L LD (HL),A INC HL DJNZ INTI_L LD (HL),A LD H,A LD L,A LD (HL),#C9 IM 2 ML EI HALT DI DUP 5 LD (0),BC EDUP DUP 4 NOP EDUP LD BC,#7FFD LD DE,#1810 LD HL,BORDER OUT (C),E LD BC,#01FE PAUPA1 EQU $-1 OUT (C),H PAUS1 DUP 10 LD (0),BC EDUP NOP LD E,#10 DJNZ PAUS1 LD BC,#7FFD OUT (C),D LD BC,#9EFE PAUPA2 EQU $-1 OUT (C),L DUP 8 LD (0),BC EDUP INC A DEC A PAUS2 DUP 21 LD (0),BC EDUP NOP NOP LD E,#10 DJNZ PAUS2 LD R,A LD E,#10 NOP LD BC,#7FFD OUT (C),E LD C,#FE OUT (C),H LD A,(PAUPA1) INC A LD (PAUPA1),A LD A,(PAUPA2) DEC A LD (PAUPA2),A LD A,158 PAUPA3 EQU $-1 DEC A LD (PAUPA3),A OR A JP NZ,ML OUT (C),H LD BC,#7FFD LD A,#10 OUT (C),A IM 1 EI RET MODE48 EI HALT XOR A OUT (#FE),A LD HL,#5B00 CL48L DEC HL LD (HL),A OR A JR Z,CL48L RET REDEFK LD HL,#3C00 XOR A LD (23659),A PUSH HL INC H LD BC,#300 LD DE,FONT-#100 LD (23606),DE INC D FNTDL LD A,(HL) RRA OR (HL) LD (DE),A INC HL INC DE DEC BC LD A,B OR C JR NZ,FNTDL LD A,6 LD (23693),A LD A,2 CALL 5633 LD DE,TXTR LD BC,TXTRE-TXTR CALL 8252 REDRQ LD A,#DF IN A,(#FE) BIT 4,A JR Z,YEPR LD A,#7F IN A,(#FE) BIT 3,A JP Z,NOPR JR REDRQ YEPR CALL CLSCR LD HL,#FE LD (REP_KEY),HL LD (REP_K2),HL LD (REP_K3),HL LD (REP_K4),HL LD DE,TXTW LD BC,TXTWE-TXTW CALL 8252 AGAINR CALL REDFL LD (PO_L+1),A LD (BI_L),DE LD (REP_KEY),HL CALL REDFR LD (PO_R+1),A LD (BI_R),DE LD (REP_K2),HL CALL REDFU LD (PO_U+1),A LD (BI_U),DE LD (REP_K3),HL CALL REDFD LD (PO_D+1),A LD (BI_D),DE LD (REP_K4),HL CALL REDFF LD (PO_F+1),A LD (BI_F),DE LD DE,TXTCN LD BC,TXTCNE-TXTCN CALL 8252 REDRCQ LD A,#DF IN A,(#FE) BIT 4,A JR Z,NOPRCC LD A,#7F IN A,(#FE) BIT 3,A JR Z,NOPC JR REDRCQ NOPC CALL PAUSE JR YEPR NOPRCC LD HL,K_DRIV LD DE,#8B4F LD BC,K_DRVE-K_DRIV LDIR NOPR POP HL LD (23606),HL CALL CLSCR LD A,2 LD (23659),A RET CLSCR LD B,#0C LD HL,#20*4+#5800+#03 CLSCNC PUSH BC PUSH HL LD D,H LD E,L INC DE LD (HL),0 LD BC,25 LDIR POP HL LD DE,#20 ADD HL,DE POP BC DJNZ CLSCNC RET REDFL LD DE,TXTLK LD BC,TXTRK-TXTLK JR KEYINP REDFR LD DE,TXTRK LD BC,TXTUK-TXTRK JR KEYINP REDFU LD DE,TXTUK LD BC,TXTDK-TXTUK JR KEYINP REDFD LD DE,TXTDK LD BC,TXTFK-TXTDK JR KEYINP REDFF LD DE,TXTFK LD BC,ENTTX-TXTFK KEYINP CALL 8252 KEY LD IY,#5C3A EI RES 5,(IY+1) WAITK BIT 5,(IY+1) JR Z,WAITK LD A,(IY-50) CP #0D JR Z,ENTERK CP " " JR Z,SPCK CP #30 JR C,KEY CP #3A JR C,NUMB OR #20 CP #61 JR C,KEY CP "v" JR Z,KEY CP #7B JR C,NUMB JR KEY ENTERK CALL REP_KEY JR Z,KEY PUSH AF LD DE,ENTTX ENTERK1 LD BC,8 CALL 8252 POP AF JR DECODK SPCK CALL REP_KEY JR Z,KEY PUSH AF LD DE,SPCTX JR ENTERK1 NUMB CALL REP_KEY JR Z,KEY PUSH AF RST #10 POP AF ; DECODING KEY 2 PORT & BIT (A=CODE OF THE KEY) DECODK CALL PAUSE LD HL,KEYTABL LD L,A PUSH AF LD A,(HL) INC H LD D,(HL) LD E,#E6 POP HL LD L,#FE RET REP_KEY CP #00 RET Z REP_K2 CP #00 RET Z REP_K3 CP #00 RET Z REP_K4 CP #00 RET PAUSE LD B,#0A PAUSEL HALT DJNZ PAUSEL RET K_DRIV PO_R LD A,#3E IN A,(#FE) CPL BI_R AND #E6 LD (HL),A INC HL PO_D LD A,#3E IN A,(#FE) CPL BI_D AND #E6 LD (HL),A INC HL PO_U LD A,#3E IN A,(#FE) CPL BI_U AND #E6 LD (HL),A INC HL PO_L LD A,#3E IN A,(#FE) CPL BI_L AND #E6 LD (HL),A PO_F LD A,#3E IN A,(#FE) CPL BI_F AND #E6 K_DRVE ORG K_TABL KEYTABL DEFS #0D,0 ;ENT DEFB #BF DEFS #12,0 ;SPC DEFB #7F DEFS #0F,0 ; 0 1 2 3 4 5 6 7 8 9 DEFB #EF,#F7,#F7,#F7,#F7,#F7,#EF,#EF,#EF,#EF DEFS #27,0 ; A B C D E F G H I J DEFB #FD,#7F,#FE,#FD,#FB,#FD,#FD,#BF,#DF,#BF ; K L M N O P Q R S T DEFB #BF,#BF,#7F,#7F,#DF,#DF,#FB,#FB,#FD,#FB ; U V W X Y Z DEFB #DF,#FE,#FB,#FE,#DF,#FE DEFS #FF,0 ORG K_TABL+#100 DEFS #0D,0 ;ENT DEFB 1 DEFS #12,0 ;SPC DEFB 1 DEFS #0F,0 ; 0 1 2 3 4 5 6 7 8 9 DEFB #01,#01,#02,#04,#08,#10,#10,#08,#04,#02 DEFS #27,0 ; A B C D E F G H I J DEFB #01,#10,#08,#04,#04,#08,#10,#10,#04,#08 ; K L M N O P Q R S T DEFB #04,#02,#04,#08,#02,#01,#01,#08,#02,#10 ; U V W X Y Z DEFB #08,#10,#02,#04,#10,#02 TXTCN DEFB #16,#0F,#0F,#13,1,"Confirm? (Y/N)",#0D TXTCNE TXTR DEFB #16,#04,#03,#13,1,"Control keys are:" DEFB #16,#06,#0B,"Up Right" DEFB #16,#07,#03,#13,0,"(q,w,e,r,t) (y,u,i,o,p)" DEFB #16,#08,#0E,#13,1,"><" DEFB #16,#09,#03,#13,0,"(a,s,d,f,g) (h,j,k,l,ent)" DEFB #16,#0A,#09,#13,1,"Left Down" DEFB #16,#0C,#03,#13,1,"Radio menu ",#13,0,"(cs)" DEFB #16,#0D,#03,#13,1,"View mode ",#13,0,"(v)" DEFB #16,#0E,#03,#13,1,"Fire ",#13,0,"(b,n,m,ss,spc)" DEFB #16,#0F,#0E,#13,1,"Redefine? (Y/N)" TXTRE TXTW DEFB #16,#04,#04,#13,1,"Redefine keys options by" DEFB #16,#05,#0B,#13,0,"ALX/BW/XPJ" DEFB #16,#07,#0A,#13,1,"view: ",#13,0,"v" DEFB #16,#08,#0A,#13,1,"radio: ",#13,0,"<cs>" TXTWE TXTLK DEFB #16,#09,#0A,#13,1,"left: ",#13,0 TXTRK DEFB #16,#0A,#0A,#13,1,"right: ",#13,0 TXTUK DEFB #16,#0B,#0A,#13,1,"up: ",#13,0 TXTDK DEFB #16,#0C,#0A,#13,1,"down: ",#13,0 TXTFK DEFB #16,#0D,#0A,#13,1,"fire: ",#13,0 ENTTX DEFB "<ent>",#0D SPCTX DEFB "<spc>",#0D PANEL INCBIN "PANEL$" ORG #67FF
programs/oeis/267/A267868.asm
jmorken/loda
1
92983
<reponame>jmorken/loda ; A267868: Triangle read by rows giving successive states of cellular automaton generated by "Rule 233" initiated with a single ON (black) cell. ; 1,0,0,0,1,0,1,0,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 mov $5,$0 lpb $5 add $6,$5 sub $5,1 lpe add $$0,$$5 lpb $6 sub $6,1 add $7,3 lpe add $2,$$0 add $$0,6 lpb $0 sub $0,1 lpe add $$3,6 mov $1,1 add $1,1 add $$3,$0 sub $1,1 add $3,$$0 trn $$4,$$2 trn $$1,$$4 trn $$1,$3
programs/oeis/130/A130238.asm
neoneye/loda
22
15836
; A130238: Partial sums of A130237. ; 0,2,8,20,36,61,91,126,174,228,288,354,426,517,615,720,832,951,1077,1210,1350,1518,1694,1878,2070,2270,2478,2694,2918,3150,3390,3638,3894,4158,4464,4779,5103,5436,5778,6129,6489,6858,7236,7623,8019,8424,8838 lpb $0 mov $2,$0 sub $0,1 seq $2,130237 ; The 'lower' Fibonacci Inverse A130233(n) multiplied by n. add $1,$2 lpe mov $0,$1
L1/TPs/0204-ASM/tp3/binaire1.asm
Tehcam/Studies
0
9463
; Initialisation In ; (0) Store Mem[0] ; x (1) Load 0 ; (2) Store Mem[1] ; i (3) ; Si 7<i ? CMP 7 ; (4) JC 15 ; alors aller à la fin du programme (5) ; sinon continuer Load Mem[0] ; (6) Mod 2 ; (7) Out ; afficher x%2 (8) Load Mem[0] ; (9) Div 2 ; (10) Store Mem[0] ; (11) Load Mem[1] ; (12) Add 1 ; (13) JMP 3 ; retour au test (14) ; Fin du programme End ; (15)
programs/oeis/158/A158614.asm
neoneye/loda
22
91647
<reponame>neoneye/loda<filename>programs/oeis/158/A158614.asm ; A158614: Numbers n such that 30*n + 11 is prime. ; 0,1,2,3,4,6,8,9,10,13,14,15,16,17,21,23,25,27,29,30,31,32,34,35,36,38,39,43,45,48,49,50,52,53,57,60,62,63,64,69,70,71,78,79,80,81,84,86,87,90,91,93,95,100,101,106,107,108,112,115,116,119,122,123,125,127,128,129,130,133,136,140,141,142,146,147,148,149,156,157,158,162,164,167,168,169,172,174,175,178,179,181,182,183,184,186,188,190,191,193 mov $2,$0 add $2,1 pow $2,2 lpb $2 add $1,10 sub $2,1 mov $3,$1 seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0. sub $0,$3 add $1,20 mov $4,$0 max $4,0 cmp $4,$0 mul $2,$4 lpe div $1,2 sub $1,22 mul $1,2 add $1,14 div $1,30 mov $0,$1
public/wintab/wintabx/close.asm
SmileyAG/cstrike15_src
2
171088
include xlibproc.inc include Wintab.inc PROC_TEMPLATE WTClose, 1, Wintab, -, 22
oeis/263/A263624.asm
neoneye/loda-programs
11
171994
; A263624: Number of Seidel matrices of order n with exactly three distinct eigenvalues, up to switching equivalence. ; Submitted by <NAME> ; 0,0,1,2,0,2,3,4,0,10 mov $2,1 lpb $0 sub $0,1 mov $5,$1 mov $1,$4 add $1,$3 sub $3,$4 mov $4,$2 mov $2,$3 mov $3,$5 sub $3,$2 add $4,1 lpe trn $1,1 mov $0,$1
kernel.asm
NaorAbu/Ass1
0
179639
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 a0 10 00 mov $0x10a000,%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 20 c6 10 80 mov $0x8010c620,%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 80 2f 10 80 mov $0x80102f80,%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 struct buf *b; initlock(&bcache.lock, "bcache"); 80100041: ba 20 80 10 80 mov $0x80108020,%edx { 80100046: 89 e5 mov %esp,%ebp 80100048: 53 push %ebx //PAGEBREAK! // Create linked list of buffers bcache.head.prev = &bcache.head; bcache.head.next = &bcache.head; 80100049: bb 1c 0d 11 80 mov $0x80110d1c,%ebx { 8010004e: 83 ec 14 sub $0x14,%esp initlock(&bcache.lock, "bcache"); 80100051: 89 54 24 04 mov %edx,0x4(%esp) 80100055: c7 04 24 20 c6 10 80 movl $0x8010c620,(%esp) 8010005c: e8 3f 52 00 00 call 801052a0 <initlock> bcache.head.prev = &bcache.head; 80100061: b9 1c 0d 11 80 mov $0x80110d1c,%ecx bcache.head.next = &bcache.head; 80100066: ba 1c 0d 11 80 mov $0x80110d1c,%edx 8010006b: 89 1d 70 0d 11 80 mov %ebx,0x80110d70 for(b = bcache.buf; b < bcache.buf+NBUF; b++){ 80100071: bb 54 c6 10 80 mov $0x8010c654,%ebx bcache.head.prev = &bcache.head; 80100076: 89 0d 6c 0d 11 80 mov %ecx,0x80110d6c 8010007c: eb 04 jmp 80100082 <binit+0x42> 8010007e: 66 90 xchg %ax,%ax 80100080: 89 c3 mov %eax,%ebx b->next = bcache.head.next; b->prev = &bcache.head; initsleeplock(&b->lock, "buffer"); 80100082: b8 27 80 10 80 mov $0x80108027,%eax b->next = bcache.head.next; 80100087: 89 53 54 mov %edx,0x54(%ebx) b->prev = &bcache.head; 8010008a: c7 43 50 1c 0d 11 80 movl $0x80110d1c,0x50(%ebx) initsleeplock(&b->lock, "buffer"); 80100091: 89 44 24 04 mov %eax,0x4(%esp) 80100095: 8d 43 0c lea 0xc(%ebx),%eax 80100098: 89 04 24 mov %eax,(%esp) 8010009b: e8 d0 50 00 00 call 80105170 <initsleeplock> bcache.head.next->prev = b; 801000a0: a1 70 0d 11 80 mov 0x80110d70,%eax 801000a5: 89 da mov %ebx,%edx 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 801000b0: 3d 1c 0d 11 80 cmp $0x80110d1c,%eax bcache.head.next = b; 801000b5: 89 1d 70 0d 11 80 mov %ebx,0x80110d70 for(b = bcache.buf; b < bcache.buf+NBUF; b++){ 801000bb: 72 c3 jb 80100080 <binit+0x40> } } 801000bd: 83 c4 14 add $0x14,%esp 801000c0: 5b pop %ebx 801000c1: 5d pop %ebp 801000c2: c3 ret 801000c3: 8d b6 00 00 00 00 lea 0x0(%esi),%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 1c sub $0x1c,%esp acquire(&bcache.lock); 801000d9: c7 04 24 20 c6 10 80 movl $0x8010c620,(%esp) { 801000e0: 8b 75 08 mov 0x8(%ebp),%esi 801000e3: 8b 7d 0c mov 0xc(%ebp),%edi acquire(&bcache.lock); 801000e6: e8 05 53 00 00 call 801053f0 <acquire> for(b = bcache.head.next; b != &bcache.head; b = b->next){ 801000eb: 8b 1d 70 0d 11 80 mov 0x80110d70,%ebx 801000f1: 81 fb 1c 0d 11 80 cmp $0x80110d1c,%ebx 801000f7: 75 12 jne 8010010b <bread+0x3b> 801000f9: eb 25 jmp 80100120 <bread+0x50> 801000fb: 90 nop 801000fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80100100: 8b 5b 54 mov 0x54(%ebx),%ebx 80100103: 81 fb 1c 0d 11 80 cmp $0x80110d1c,%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: ff 43 4c incl 0x4c(%ebx) 80100118: eb 40 jmp 8010015a <bread+0x8a> 8010011a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi for(b = bcache.head.prev; b != &bcache.head; b = b->prev){ 80100120: 8b 1d 6c 0d 11 80 mov 0x80110d6c,%ebx 80100126: 81 fb 1c 0d 11 80 cmp $0x80110d1c,%ebx 8010012c: 75 0d jne 8010013b <bread+0x6b> 8010012e: eb 58 jmp 80100188 <bread+0xb8> 80100130: 8b 5b 50 mov 0x50(%ebx),%ebx 80100133: 81 fb 1c 0d 11 80 cmp $0x80110d1c,%ebx 80100139: 74 4d je 80100188 <bread+0xb8> 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: c7 04 24 20 c6 10 80 movl $0x8010c620,(%esp) 80100161: e8 2a 53 00 00 call 80105490 <release> acquiresleep(&b->lock); 80100166: 8d 43 0c lea 0xc(%ebx),%eax 80100169: 89 04 24 mov %eax,(%esp) 8010016c: e8 3f 50 00 00 call 801051b0 <acquiresleep> struct buf *b; b = bget(dev, blockno); if((b->flags & B_VALID) == 0) { 80100171: f6 03 02 testb $0x2,(%ebx) 80100174: 75 08 jne 8010017e <bread+0xae> iderw(b); 80100176: 89 1c 24 mov %ebx,(%esp) 80100179: e8 82 20 00 00 call 80102200 <iderw> } return b; } 8010017e: 83 c4 1c add $0x1c,%esp 80100181: 89 d8 mov %ebx,%eax 80100183: 5b pop %ebx 80100184: 5e pop %esi 80100185: 5f pop %edi 80100186: 5d pop %ebp 80100187: c3 ret panic("bget: no buffers"); 80100188: c7 04 24 2e 80 10 80 movl $0x8010802e,(%esp) 8010018f: e8 dc 01 00 00 call 80100370 <panic> 80100194: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010019a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 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 14 sub $0x14,%esp 801001a7: 8b 5d 08 mov 0x8(%ebp),%ebx if(!holdingsleep(&b->lock)) 801001aa: 8d 43 0c lea 0xc(%ebx),%eax 801001ad: 89 04 24 mov %eax,(%esp) 801001b0: e8 9b 50 00 00 call 80105250 <holdingsleep> 801001b5: 85 c0 test %eax,%eax 801001b7: 74 10 je 801001c9 <bwrite+0x29> panic("bwrite"); b->flags |= B_DIRTY; 801001b9: 83 0b 04 orl $0x4,(%ebx) iderw(b); 801001bc: 89 5d 08 mov %ebx,0x8(%ebp) } 801001bf: 83 c4 14 add $0x14,%esp 801001c2: 5b pop %ebx 801001c3: 5d pop %ebp iderw(b); 801001c4: e9 37 20 00 00 jmp 80102200 <iderw> panic("bwrite"); 801001c9: c7 04 24 3f 80 10 80 movl $0x8010803f,(%esp) 801001d0: e8 9b 01 00 00 call 80100370 <panic> 801001d5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%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: 83 ec 10 sub $0x10,%esp 801001e8: 8b 5d 08 mov 0x8(%ebp),%ebx if(!holdingsleep(&b->lock)) 801001eb: 8d 73 0c lea 0xc(%ebx),%esi 801001ee: 89 34 24 mov %esi,(%esp) 801001f1: e8 5a 50 00 00 call 80105250 <holdingsleep> 801001f6: 85 c0 test %eax,%eax 801001f8: 74 5a je 80100254 <brelse+0x74> panic("brelse"); releasesleep(&b->lock); 801001fa: 89 34 24 mov %esi,(%esp) 801001fd: e8 0e 50 00 00 call 80105210 <releasesleep> acquire(&bcache.lock); 80100202: c7 04 24 20 c6 10 80 movl $0x8010c620,(%esp) 80100209: e8 e2 51 00 00 call 801053f0 <acquire> b->refcnt--; if (b->refcnt == 0) { 8010020e: ff 4b 4c decl 0x4c(%ebx) 80100211: 75 2f jne 80100242 <brelse+0x62> // no one is waiting for it. b->next->prev = b->prev; 80100213: 8b 43 54 mov 0x54(%ebx),%eax 80100216: 8b 53 50 mov 0x50(%ebx),%edx 80100219: 89 50 50 mov %edx,0x50(%eax) b->prev->next = b->next; 8010021c: 8b 43 50 mov 0x50(%ebx),%eax 8010021f: 8b 53 54 mov 0x54(%ebx),%edx 80100222: 89 50 54 mov %edx,0x54(%eax) b->next = bcache.head.next; 80100225: a1 70 0d 11 80 mov 0x80110d70,%eax b->prev = &bcache.head; 8010022a: c7 43 50 1c 0d 11 80 movl $0x80110d1c,0x50(%ebx) b->next = bcache.head.next; 80100231: 89 43 54 mov %eax,0x54(%ebx) bcache.head.next->prev = b; 80100234: a1 70 0d 11 80 mov 0x80110d70,%eax 80100239: 89 58 50 mov %ebx,0x50(%eax) bcache.head.next = b; 8010023c: 89 1d 70 0d 11 80 mov %ebx,0x80110d70 } release(&bcache.lock); 80100242: c7 45 08 20 c6 10 80 movl $0x8010c620,0x8(%ebp) } 80100249: 83 c4 10 add $0x10,%esp 8010024c: 5b pop %ebx 8010024d: 5e pop %esi 8010024e: 5d pop %ebp release(&bcache.lock); 8010024f: e9 3c 52 00 00 jmp 80105490 <release> panic("brelse"); 80100254: c7 04 24 46 80 10 80 movl $0x80108046,(%esp) 8010025b: e8 10 01 00 00 call 80100370 <panic> 80100260 <consoleread>: } } int consoleread(struct inode *ip, char *dst, int n) { 80100260: 55 push %ebp 80100261: 89 e5 mov %esp,%ebp 80100263: 57 push %edi 80100264: 56 push %esi 80100265: 53 push %ebx 80100266: 83 ec 2c sub $0x2c,%esp 80100269: 8b 7d 08 mov 0x8(%ebp),%edi 8010026c: 8b 75 10 mov 0x10(%ebp),%esi uint target; int c; iunlock(ip); 8010026f: 89 3c 24 mov %edi,(%esp) 80100272: e8 59 15 00 00 call 801017d0 <iunlock> target = n; acquire(&cons.lock); 80100277: c7 04 24 20 b5 10 80 movl $0x8010b520,(%esp) 8010027e: e8 6d 51 00 00 call 801053f0 <acquire> while(n > 0){ 80100283: 31 c0 xor %eax,%eax 80100285: 85 f6 test %esi,%esi 80100287: 0f 8e a3 00 00 00 jle 80100330 <consoleread+0xd0> 8010028d: 89 f3 mov %esi,%ebx 8010028f: 89 75 10 mov %esi,0x10(%ebp) 80100292: 8b 75 0c mov 0xc(%ebp),%esi while(input.r == input.w){ 80100295: 8b 15 00 10 11 80 mov 0x80111000,%edx 8010029b: 39 15 04 10 11 80 cmp %edx,0x80111004 801002a1: 74 28 je 801002cb <consoleread+0x6b> 801002a3: eb 5b jmp 80100300 <consoleread+0xa0> 801002a5: 8d 76 00 lea 0x0(%esi),%esi if(myproc()->killed){ release(&cons.lock); ilock(ip); return -1; } sleep(&input.r, &cons.lock); 801002a8: b8 20 b5 10 80 mov $0x8010b520,%eax 801002ad: 89 44 24 04 mov %eax,0x4(%esp) 801002b1: c7 04 24 00 10 11 80 movl $0x80111000,(%esp) 801002b8: e8 13 3e 00 00 call 801040d0 <sleep> while(input.r == input.w){ 801002bd: 8b 15 00 10 11 80 mov 0x80111000,%edx 801002c3: 3b 15 04 10 11 80 cmp 0x80111004,%edx 801002c9: 75 35 jne 80100300 <consoleread+0xa0> if(myproc()->killed){ 801002cb: e8 f0 36 00 00 call 801039c0 <myproc> 801002d0: 8b 50 24 mov 0x24(%eax),%edx 801002d3: 85 d2 test %edx,%edx 801002d5: 74 d1 je 801002a8 <consoleread+0x48> release(&cons.lock); 801002d7: c7 04 24 20 b5 10 80 movl $0x8010b520,(%esp) 801002de: e8 ad 51 00 00 call 80105490 <release> ilock(ip); 801002e3: 89 3c 24 mov %edi,(%esp) 801002e6: e8 05 14 00 00 call 801016f0 <ilock> } release(&cons.lock); ilock(ip); return target - n; } 801002eb: 83 c4 2c add $0x2c,%esp return -1; 801002ee: b8 ff ff ff ff mov $0xffffffff,%eax } 801002f3: 5b pop %ebx 801002f4: 5e pop %esi 801002f5: 5f pop %edi 801002f6: 5d pop %ebp 801002f7: c3 ret 801002f8: 90 nop 801002f9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi c = input.buf[input.r++ % INPUT_BUF]; 80100300: 8d 42 01 lea 0x1(%edx),%eax 80100303: a3 00 10 11 80 mov %eax,0x80111000 80100308: 89 d0 mov %edx,%eax 8010030a: 83 e0 7f and $0x7f,%eax 8010030d: 0f be 80 80 0f 11 80 movsbl -0x7feef080(%eax),%eax if(c == C('D')){ // EOF 80100314: 83 f8 04 cmp $0x4,%eax 80100317: 74 39 je 80100352 <consoleread+0xf2> *dst++ = c; 80100319: 46 inc %esi --n; 8010031a: 4b dec %ebx if(c == '\n') 8010031b: 83 f8 0a cmp $0xa,%eax *dst++ = c; 8010031e: 88 46 ff mov %al,-0x1(%esi) if(c == '\n') 80100321: 74 42 je 80100365 <consoleread+0x105> while(n > 0){ 80100323: 85 db test %ebx,%ebx 80100325: 0f 85 6a ff ff ff jne 80100295 <consoleread+0x35> 8010032b: 8b 75 10 mov 0x10(%ebp),%esi 8010032e: 89 f0 mov %esi,%eax release(&cons.lock); 80100330: c7 04 24 20 b5 10 80 movl $0x8010b520,(%esp) 80100337: 89 45 e4 mov %eax,-0x1c(%ebp) 8010033a: e8 51 51 00 00 call 80105490 <release> ilock(ip); 8010033f: 89 3c 24 mov %edi,(%esp) 80100342: e8 a9 13 00 00 call 801016f0 <ilock> 80100347: 8b 45 e4 mov -0x1c(%ebp),%eax } 8010034a: 83 c4 2c add $0x2c,%esp 8010034d: 5b pop %ebx 8010034e: 5e pop %esi 8010034f: 5f pop %edi 80100350: 5d pop %ebp 80100351: c3 ret 80100352: 8b 75 10 mov 0x10(%ebp),%esi 80100355: 89 f0 mov %esi,%eax 80100357: 29 d8 sub %ebx,%eax if(n < target){ 80100359: 39 f3 cmp %esi,%ebx 8010035b: 73 d3 jae 80100330 <consoleread+0xd0> input.r--; 8010035d: 89 15 00 10 11 80 mov %edx,0x80111000 80100363: eb cb jmp 80100330 <consoleread+0xd0> 80100365: 8b 75 10 mov 0x10(%ebp),%esi 80100368: 89 f0 mov %esi,%eax 8010036a: 29 d8 sub %ebx,%eax 8010036c: eb c2 jmp 80100330 <consoleread+0xd0> 8010036e: 66 90 xchg %ax,%ax 80100370 <panic>: { 80100370: 55 push %ebp 80100371: 89 e5 mov %esp,%ebp 80100373: 56 push %esi 80100374: 53 push %ebx 80100375: 83 ec 40 sub $0x40,%esp } static inline void cli(void) { asm volatile("cli"); 80100378: fa cli cons.locking = 0; 80100379: 31 d2 xor %edx,%edx 8010037b: 89 15 54 b5 10 80 mov %edx,0x8010b554 getcallerpcs(&s, pcs); 80100381: 8d 5d d0 lea -0x30(%ebp),%ebx cprintf("lapicid %d: panic: ", lapicid()); 80100384: e8 a7 24 00 00 call 80102830 <lapicid> 80100389: 8d 75 f8 lea -0x8(%ebp),%esi 8010038c: c7 04 24 4d 80 10 80 movl $0x8010804d,(%esp) 80100393: 89 44 24 04 mov %eax,0x4(%esp) 80100397: e8 b4 02 00 00 call 80100650 <cprintf> cprintf(s); 8010039c: 8b 45 08 mov 0x8(%ebp),%eax 8010039f: 89 04 24 mov %eax,(%esp) 801003a2: e8 a9 02 00 00 call 80100650 <cprintf> cprintf("\n"); 801003a7: c7 04 24 df 89 10 80 movl $0x801089df,(%esp) 801003ae: e8 9d 02 00 00 call 80100650 <cprintf> getcallerpcs(&s, pcs); 801003b3: 8d 45 08 lea 0x8(%ebp),%eax 801003b6: 89 5c 24 04 mov %ebx,0x4(%esp) 801003ba: 89 04 24 mov %eax,(%esp) 801003bd: e8 fe 4e 00 00 call 801052c0 <getcallerpcs> 801003c2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801003c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi cprintf(" %p", pcs[i]); 801003d0: 8b 03 mov (%ebx),%eax 801003d2: 83 c3 04 add $0x4,%ebx 801003d5: c7 04 24 61 80 10 80 movl $0x80108061,(%esp) 801003dc: 89 44 24 04 mov %eax,0x4(%esp) 801003e0: e8 6b 02 00 00 call 80100650 <cprintf> for(i=0; i<10; i++) 801003e5: 39 f3 cmp %esi,%ebx 801003e7: 75 e7 jne 801003d0 <panic+0x60> panicked = 1; // freeze other CPU 801003e9: b8 01 00 00 00 mov $0x1,%eax 801003ee: a3 58 b5 10 80 mov %eax,0x8010b558 801003f3: eb fe jmp 801003f3 <panic+0x83> 801003f5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801003f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80100400 <consputc>: if(panicked){ 80100400: 8b 15 58 b5 10 80 mov 0x8010b558,%edx 80100406: 85 d2 test %edx,%edx 80100408: 74 06 je 80100410 <consputc+0x10> 8010040a: fa cli 8010040b: eb fe jmp 8010040b <consputc+0xb> 8010040d: 8d 76 00 lea 0x0(%esi),%esi { 80100410: 55 push %ebp 80100411: 89 e5 mov %esp,%ebp 80100413: 57 push %edi 80100414: 56 push %esi 80100415: 53 push %ebx 80100416: 89 c3 mov %eax,%ebx 80100418: 83 ec 2c sub $0x2c,%esp if(c == BACKSPACE){ 8010041b: 3d 00 01 00 00 cmp $0x100,%eax 80100420: 0f 84 9f 00 00 00 je 801004c5 <consputc+0xc5> uartputc(c); 80100426: 89 04 24 mov %eax,(%esp) 80100429: e8 d2 67 00 00 call 80106c00 <uartputc> asm volatile("out %0,%1" : : "a" (data), "d" (port)); 8010042e: be d4 03 00 00 mov $0x3d4,%esi 80100433: b0 0e mov $0xe,%al 80100435: 89 f2 mov %esi,%edx 80100437: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80100438: b9 d5 03 00 00 mov $0x3d5,%ecx 8010043d: 89 ca mov %ecx,%edx 8010043f: ec in (%dx),%al pos = inb(CRTPORT+1) << 8; 80100440: 0f b6 c0 movzbl %al,%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80100443: 89 f2 mov %esi,%edx 80100445: c1 e0 08 shl $0x8,%eax 80100448: 89 c7 mov %eax,%edi 8010044a: b0 0f mov $0xf,%al 8010044c: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010044d: 89 ca mov %ecx,%edx 8010044f: ec in (%dx),%al 80100450: 0f b6 c8 movzbl %al,%ecx pos |= inb(CRTPORT+1); 80100453: 09 f9 or %edi,%ecx if(c == '\n') 80100455: 83 fb 0a cmp $0xa,%ebx 80100458: 0f 84 ff 00 00 00 je 8010055d <consputc+0x15d> else if(c == BACKSPACE){ 8010045e: 81 fb 00 01 00 00 cmp $0x100,%ebx 80100464: 0f 84 e5 00 00 00 je 8010054f <consputc+0x14f> crt[pos++] = (c&0xff) | 0x0700; // black on white 8010046a: 0f b6 c3 movzbl %bl,%eax 8010046d: 0d 00 07 00 00 or $0x700,%eax 80100472: 66 89 84 09 00 80 0b mov %ax,-0x7ff48000(%ecx,%ecx,1) 80100479: 80 8010047a: 41 inc %ecx if(pos < 0 || pos > 25*80) 8010047b: 81 f9 d0 07 00 00 cmp $0x7d0,%ecx 80100481: 0f 8f bc 00 00 00 jg 80100543 <consputc+0x143> if((pos/80) >= 24){ // Scroll up. 80100487: 81 f9 7f 07 00 00 cmp $0x77f,%ecx 8010048d: 7f 5f jg 801004ee <consputc+0xee> asm volatile("out %0,%1" : : "a" (data), "d" (port)); 8010048f: be d4 03 00 00 mov $0x3d4,%esi 80100494: b0 0e mov $0xe,%al 80100496: 89 f2 mov %esi,%edx 80100498: ee out %al,(%dx) 80100499: bb d5 03 00 00 mov $0x3d5,%ebx outb(CRTPORT+1, pos>>8); 8010049e: 89 c8 mov %ecx,%eax 801004a0: c1 f8 08 sar $0x8,%eax 801004a3: 89 da mov %ebx,%edx 801004a5: ee out %al,(%dx) 801004a6: b0 0f mov $0xf,%al 801004a8: 89 f2 mov %esi,%edx 801004aa: ee out %al,(%dx) 801004ab: 88 c8 mov %cl,%al 801004ad: 89 da mov %ebx,%edx 801004af: ee out %al,(%dx) crt[pos] = ' ' | 0x0700; 801004b0: b8 20 07 00 00 mov $0x720,%eax 801004b5: 66 89 84 09 00 80 0b mov %ax,-0x7ff48000(%ecx,%ecx,1) 801004bc: 80 } 801004bd: 83 c4 2c add $0x2c,%esp 801004c0: 5b pop %ebx 801004c1: 5e pop %esi 801004c2: 5f pop %edi 801004c3: 5d pop %ebp 801004c4: c3 ret uartputc('\b'); uartputc(' '); uartputc('\b'); 801004c5: c7 04 24 08 00 00 00 movl $0x8,(%esp) 801004cc: e8 2f 67 00 00 call 80106c00 <uartputc> 801004d1: c7 04 24 20 00 00 00 movl $0x20,(%esp) 801004d8: e8 23 67 00 00 call 80106c00 <uartputc> 801004dd: c7 04 24 08 00 00 00 movl $0x8,(%esp) 801004e4: e8 17 67 00 00 call 80106c00 <uartputc> 801004e9: e9 40 ff ff ff jmp 8010042e <consputc+0x2e> memmove(crt, crt+80, sizeof(crt[0])*23*80); 801004ee: c7 44 24 08 60 0e 00 movl $0xe60,0x8(%esp) 801004f5: 00 801004f6: c7 44 24 04 a0 80 0b movl $0x800b80a0,0x4(%esp) 801004fd: 80 801004fe: c7 04 24 00 80 0b 80 movl $0x800b8000,(%esp) 80100505: 89 4d e4 mov %ecx,-0x1c(%ebp) 80100508: e8 93 50 00 00 call 801055a0 <memmove> pos -= 80; 8010050d: 8b 4d e4 mov -0x1c(%ebp),%ecx memset(crt+pos, 0, sizeof(crt[0])*(24*80 - pos)); 80100510: b8 80 07 00 00 mov $0x780,%eax 80100515: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 8010051c: 00 pos -= 80; 8010051d: 83 e9 50 sub $0x50,%ecx memset(crt+pos, 0, sizeof(crt[0])*(24*80 - pos)); 80100520: 29 c8 sub %ecx,%eax 80100522: 01 c0 add %eax,%eax 80100524: 89 44 24 08 mov %eax,0x8(%esp) 80100528: 8d 04 09 lea (%ecx,%ecx,1),%eax 8010052b: 2d 00 80 f4 7f sub $0x7ff48000,%eax 80100530: 89 04 24 mov %eax,(%esp) 80100533: 89 4d e4 mov %ecx,-0x1c(%ebp) 80100536: e8 a5 4f 00 00 call 801054e0 <memset> 8010053b: 8b 4d e4 mov -0x1c(%ebp),%ecx 8010053e: e9 4c ff ff ff jmp 8010048f <consputc+0x8f> panic("pos under/overflow"); 80100543: c7 04 24 65 80 10 80 movl $0x80108065,(%esp) 8010054a: e8 21 fe ff ff call 80100370 <panic> if(pos > 0) --pos; 8010054f: 85 c9 test %ecx,%ecx 80100551: 0f 84 38 ff ff ff je 8010048f <consputc+0x8f> 80100557: 49 dec %ecx 80100558: e9 1e ff ff ff jmp 8010047b <consputc+0x7b> pos += 80 - pos%80; 8010055d: 89 c8 mov %ecx,%eax 8010055f: bb 50 00 00 00 mov $0x50,%ebx 80100564: 99 cltd 80100565: f7 fb idiv %ebx 80100567: 29 d3 sub %edx,%ebx 80100569: 01 d9 add %ebx,%ecx 8010056b: e9 0b ff ff ff jmp 8010047b <consputc+0x7b> 80100570 <printint>: { 80100570: 55 push %ebp 80100571: 89 e5 mov %esp,%ebp 80100573: 57 push %edi 80100574: 56 push %esi 80100575: 53 push %ebx 80100576: 89 d3 mov %edx,%ebx 80100578: 83 ec 2c sub $0x2c,%esp if(sign && (sign = xx < 0)) 8010057b: 85 c9 test %ecx,%ecx { 8010057d: 89 4d d4 mov %ecx,-0x2c(%ebp) if(sign && (sign = xx < 0)) 80100580: 74 04 je 80100586 <printint+0x16> 80100582: 85 c0 test %eax,%eax 80100584: 78 62 js 801005e8 <printint+0x78> x = xx; 80100586: c7 45 d4 00 00 00 00 movl $0x0,-0x2c(%ebp) i = 0; 8010058d: 31 c9 xor %ecx,%ecx 8010058f: 8d 75 d7 lea -0x29(%ebp),%esi 80100592: eb 06 jmp 8010059a <printint+0x2a> 80100594: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi buf[i++] = digits[x % base]; 80100598: 89 f9 mov %edi,%ecx 8010059a: 31 d2 xor %edx,%edx 8010059c: f7 f3 div %ebx 8010059e: 8d 79 01 lea 0x1(%ecx),%edi 801005a1: 0f b6 92 90 80 10 80 movzbl -0x7fef7f70(%edx),%edx }while((x /= base) != 0); 801005a8: 85 c0 test %eax,%eax buf[i++] = digits[x % base]; 801005aa: 88 14 3e mov %dl,(%esi,%edi,1) }while((x /= base) != 0); 801005ad: 75 e9 jne 80100598 <printint+0x28> if(sign) 801005af: 8b 45 d4 mov -0x2c(%ebp),%eax 801005b2: 85 c0 test %eax,%eax 801005b4: 74 08 je 801005be <printint+0x4e> buf[i++] = '-'; 801005b6: c6 44 3d d8 2d movb $0x2d,-0x28(%ebp,%edi,1) 801005bb: 8d 79 02 lea 0x2(%ecx),%edi 801005be: 8d 5c 3d d7 lea -0x29(%ebp,%edi,1),%ebx 801005c2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801005c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi consputc(buf[i]); 801005d0: 0f be 03 movsbl (%ebx),%eax 801005d3: 4b dec %ebx 801005d4: e8 27 fe ff ff call 80100400 <consputc> while(--i >= 0) 801005d9: 39 f3 cmp %esi,%ebx 801005db: 75 f3 jne 801005d0 <printint+0x60> } 801005dd: 83 c4 2c add $0x2c,%esp 801005e0: 5b pop %ebx 801005e1: 5e pop %esi 801005e2: 5f pop %edi 801005e3: 5d pop %ebp 801005e4: c3 ret 801005e5: 8d 76 00 lea 0x0(%esi),%esi x = -xx; 801005e8: f7 d8 neg %eax 801005ea: eb a1 jmp 8010058d <printint+0x1d> 801005ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801005f0 <consolewrite>: int consolewrite(struct inode *ip, char *buf, int n) { 801005f0: 55 push %ebp 801005f1: 89 e5 mov %esp,%ebp 801005f3: 57 push %edi 801005f4: 56 push %esi 801005f5: 53 push %ebx 801005f6: 83 ec 1c sub $0x1c,%esp int i; iunlock(ip); 801005f9: 8b 45 08 mov 0x8(%ebp),%eax { 801005fc: 8b 75 10 mov 0x10(%ebp),%esi iunlock(ip); 801005ff: 89 04 24 mov %eax,(%esp) 80100602: e8 c9 11 00 00 call 801017d0 <iunlock> acquire(&cons.lock); 80100607: c7 04 24 20 b5 10 80 movl $0x8010b520,(%esp) 8010060e: e8 dd 4d 00 00 call 801053f0 <acquire> for(i = 0; i < n; i++) 80100613: 85 f6 test %esi,%esi 80100615: 7e 16 jle 8010062d <consolewrite+0x3d> 80100617: 8b 7d 0c mov 0xc(%ebp),%edi 8010061a: 8d 1c 37 lea (%edi,%esi,1),%ebx 8010061d: 8d 76 00 lea 0x0(%esi),%esi consputc(buf[i] & 0xff); 80100620: 0f b6 07 movzbl (%edi),%eax 80100623: 47 inc %edi 80100624: e8 d7 fd ff ff call 80100400 <consputc> for(i = 0; i < n; i++) 80100629: 39 fb cmp %edi,%ebx 8010062b: 75 f3 jne 80100620 <consolewrite+0x30> release(&cons.lock); 8010062d: c7 04 24 20 b5 10 80 movl $0x8010b520,(%esp) 80100634: e8 57 4e 00 00 call 80105490 <release> ilock(ip); 80100639: 8b 45 08 mov 0x8(%ebp),%eax 8010063c: 89 04 24 mov %eax,(%esp) 8010063f: e8 ac 10 00 00 call 801016f0 <ilock> return n; } 80100644: 83 c4 1c add $0x1c,%esp 80100647: 89 f0 mov %esi,%eax 80100649: 5b pop %ebx 8010064a: 5e pop %esi 8010064b: 5f pop %edi 8010064c: 5d pop %ebp 8010064d: c3 ret 8010064e: 66 90 xchg %ax,%ax 80100650 <cprintf>: { 80100650: 55 push %ebp 80100651: 89 e5 mov %esp,%ebp 80100653: 57 push %edi 80100654: 56 push %esi 80100655: 53 push %ebx 80100656: 83 ec 2c sub $0x2c,%esp locking = cons.locking; 80100659: a1 54 b5 10 80 mov 0x8010b554,%eax if(locking) 8010065e: 85 c0 test %eax,%eax locking = cons.locking; 80100660: 89 45 dc mov %eax,-0x24(%ebp) if(locking) 80100663: 0f 85 47 01 00 00 jne 801007b0 <cprintf+0x160> if (fmt == 0) 80100669: 8b 45 08 mov 0x8(%ebp),%eax 8010066c: 85 c0 test %eax,%eax 8010066e: 89 45 e4 mov %eax,-0x1c(%ebp) 80100671: 0f 84 4a 01 00 00 je 801007c1 <cprintf+0x171> for(i = 0; (c = fmt[i] & 0xff) != 0; i++){ 80100677: 0f b6 00 movzbl (%eax),%eax argp = (uint*)(void*)(&fmt + 1); 8010067a: 8d 4d 0c lea 0xc(%ebp),%ecx for(i = 0; (c = fmt[i] & 0xff) != 0; i++){ 8010067d: 31 db xor %ebx,%ebx 8010067f: 89 cf mov %ecx,%edi 80100681: 85 c0 test %eax,%eax 80100683: 75 59 jne 801006de <cprintf+0x8e> 80100685: eb 79 jmp 80100700 <cprintf+0xb0> 80100687: 89 f6 mov %esi,%esi 80100689: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi c = fmt[++i] & 0xff; 80100690: 0f b6 16 movzbl (%esi),%edx if(c == 0) 80100693: 85 d2 test %edx,%edx 80100695: 74 69 je 80100700 <cprintf+0xb0> 80100697: 8b 45 e4 mov -0x1c(%ebp),%eax 8010069a: 83 c3 02 add $0x2,%ebx switch(c){ 8010069d: 83 fa 70 cmp $0x70,%edx 801006a0: 8d 34 18 lea (%eax,%ebx,1),%esi 801006a3: 0f 84 81 00 00 00 je 8010072a <cprintf+0xda> 801006a9: 7f 75 jg 80100720 <cprintf+0xd0> 801006ab: 83 fa 25 cmp $0x25,%edx 801006ae: 0f 84 e4 00 00 00 je 80100798 <cprintf+0x148> 801006b4: 83 fa 64 cmp $0x64,%edx 801006b7: 0f 85 8b 00 00 00 jne 80100748 <cprintf+0xf8> printint(*argp++, 10, 1); 801006bd: 8d 47 04 lea 0x4(%edi),%eax 801006c0: b9 01 00 00 00 mov $0x1,%ecx 801006c5: 89 45 e0 mov %eax,-0x20(%ebp) 801006c8: 8b 07 mov (%edi),%eax 801006ca: ba 0a 00 00 00 mov $0xa,%edx 801006cf: e8 9c fe ff ff call 80100570 <printint> 801006d4: 8b 7d e0 mov -0x20(%ebp),%edi for(i = 0; (c = fmt[i] & 0xff) != 0; i++){ 801006d7: 0f b6 06 movzbl (%esi),%eax 801006da: 85 c0 test %eax,%eax 801006dc: 74 22 je 80100700 <cprintf+0xb0> 801006de: 8b 4d e4 mov -0x1c(%ebp),%ecx 801006e1: 8d 53 01 lea 0x1(%ebx),%edx if(c != '%'){ 801006e4: 83 f8 25 cmp $0x25,%eax 801006e7: 8d 34 11 lea (%ecx,%edx,1),%esi 801006ea: 74 a4 je 80100690 <cprintf+0x40> 801006ec: 89 55 e0 mov %edx,-0x20(%ebp) consputc(c); 801006ef: e8 0c fd ff ff call 80100400 <consputc> for(i = 0; (c = fmt[i] & 0xff) != 0; i++){ 801006f4: 0f b6 06 movzbl (%esi),%eax continue; 801006f7: 8b 55 e0 mov -0x20(%ebp),%edx for(i = 0; (c = fmt[i] & 0xff) != 0; i++){ 801006fa: 85 c0 test %eax,%eax continue; 801006fc: 89 d3 mov %edx,%ebx for(i = 0; (c = fmt[i] & 0xff) != 0; i++){ 801006fe: 75 de jne 801006de <cprintf+0x8e> if(locking) 80100700: 8b 45 dc mov -0x24(%ebp),%eax 80100703: 85 c0 test %eax,%eax 80100705: 74 0c je 80100713 <cprintf+0xc3> release(&cons.lock); 80100707: c7 04 24 20 b5 10 80 movl $0x8010b520,(%esp) 8010070e: e8 7d 4d 00 00 call 80105490 <release> } 80100713: 83 c4 2c add $0x2c,%esp 80100716: 5b pop %ebx 80100717: 5e pop %esi 80100718: 5f pop %edi 80100719: 5d pop %ebp 8010071a: c3 ret 8010071b: 90 nop 8010071c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi switch(c){ 80100720: 83 fa 73 cmp $0x73,%edx 80100723: 74 43 je 80100768 <cprintf+0x118> 80100725: 83 fa 78 cmp $0x78,%edx 80100728: 75 1e jne 80100748 <cprintf+0xf8> printint(*argp++, 16, 0); 8010072a: 8d 47 04 lea 0x4(%edi),%eax 8010072d: 31 c9 xor %ecx,%ecx 8010072f: 89 45 e0 mov %eax,-0x20(%ebp) 80100732: 8b 07 mov (%edi),%eax 80100734: ba 10 00 00 00 mov $0x10,%edx 80100739: e8 32 fe ff ff call 80100570 <printint> 8010073e: 8b 7d e0 mov -0x20(%ebp),%edi break; 80100741: eb 94 jmp 801006d7 <cprintf+0x87> 80100743: 90 nop 80100744: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi consputc('%'); 80100748: b8 25 00 00 00 mov $0x25,%eax 8010074d: 89 55 e0 mov %edx,-0x20(%ebp) 80100750: e8 ab fc ff ff call 80100400 <consputc> consputc(c); 80100755: 8b 55 e0 mov -0x20(%ebp),%edx 80100758: 89 d0 mov %edx,%eax 8010075a: e8 a1 fc ff ff call 80100400 <consputc> break; 8010075f: e9 73 ff ff ff jmp 801006d7 <cprintf+0x87> 80100764: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if((s = (char*)*argp++) == 0) 80100768: 8d 47 04 lea 0x4(%edi),%eax 8010076b: 8b 3f mov (%edi),%edi 8010076d: 89 45 e0 mov %eax,-0x20(%ebp) 80100770: 85 ff test %edi,%edi 80100772: 75 12 jne 80100786 <cprintf+0x136> s = "(null)"; 80100774: bf 78 80 10 80 mov $0x80108078,%edi for(; *s; s++) 80100779: b8 28 00 00 00 mov $0x28,%eax 8010077e: 66 90 xchg %ax,%ax consputc(*s); 80100780: e8 7b fc ff ff call 80100400 <consputc> for(; *s; s++) 80100785: 47 inc %edi 80100786: 0f be 07 movsbl (%edi),%eax 80100789: 84 c0 test %al,%al 8010078b: 75 f3 jne 80100780 <cprintf+0x130> if((s = (char*)*argp++) == 0) 8010078d: 8b 7d e0 mov -0x20(%ebp),%edi 80100790: e9 42 ff ff ff jmp 801006d7 <cprintf+0x87> 80100795: 8d 76 00 lea 0x0(%esi),%esi consputc('%'); 80100798: b8 25 00 00 00 mov $0x25,%eax 8010079d: e8 5e fc ff ff call 80100400 <consputc> break; 801007a2: e9 30 ff ff ff jmp 801006d7 <cprintf+0x87> 801007a7: 89 f6 mov %esi,%esi 801007a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi acquire(&cons.lock); 801007b0: c7 04 24 20 b5 10 80 movl $0x8010b520,(%esp) 801007b7: e8 34 4c 00 00 call 801053f0 <acquire> 801007bc: e9 a8 fe ff ff jmp 80100669 <cprintf+0x19> panic("null fmt"); 801007c1: c7 04 24 7f 80 10 80 movl $0x8010807f,(%esp) 801007c8: e8 a3 fb ff ff call 80100370 <panic> 801007cd: 8d 76 00 lea 0x0(%esi),%esi 801007d0 <consoleintr>: { 801007d0: 55 push %ebp 801007d1: 89 e5 mov %esp,%ebp 801007d3: 56 push %esi int c, doprocdump = 0; 801007d4: 31 f6 xor %esi,%esi { 801007d6: 53 push %ebx 801007d7: 83 ec 20 sub $0x20,%esp acquire(&cons.lock); 801007da: c7 04 24 20 b5 10 80 movl $0x8010b520,(%esp) { 801007e1: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&cons.lock); 801007e4: e8 07 4c 00 00 call 801053f0 <acquire> 801007e9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi while((c = getc()) >= 0){ 801007f0: ff d3 call *%ebx 801007f2: 85 c0 test %eax,%eax 801007f4: 89 c2 mov %eax,%edx 801007f6: 78 48 js 80100840 <consoleintr+0x70> switch(c){ 801007f8: 83 fa 10 cmp $0x10,%edx 801007fb: 0f 84 e7 00 00 00 je 801008e8 <consoleintr+0x118> 80100801: 7e 5d jle 80100860 <consoleintr+0x90> 80100803: 83 fa 15 cmp $0x15,%edx 80100806: 0f 84 ec 00 00 00 je 801008f8 <consoleintr+0x128> 8010080c: 83 fa 7f cmp $0x7f,%edx 8010080f: 90 nop 80100810: 75 53 jne 80100865 <consoleintr+0x95> if(input.e != input.w){ 80100812: a1 08 10 11 80 mov 0x80111008,%eax 80100817: 3b 05 04 10 11 80 cmp 0x80111004,%eax 8010081d: 74 d1 je 801007f0 <consoleintr+0x20> input.e--; 8010081f: 48 dec %eax 80100820: a3 08 10 11 80 mov %eax,0x80111008 consputc(BACKSPACE); 80100825: b8 00 01 00 00 mov $0x100,%eax 8010082a: e8 d1 fb ff ff call 80100400 <consputc> while((c = getc()) >= 0){ 8010082f: ff d3 call *%ebx 80100831: 85 c0 test %eax,%eax 80100833: 89 c2 mov %eax,%edx 80100835: 79 c1 jns 801007f8 <consoleintr+0x28> 80100837: 89 f6 mov %esi,%esi 80100839: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi release(&cons.lock); 80100840: c7 04 24 20 b5 10 80 movl $0x8010b520,(%esp) 80100847: e8 44 4c 00 00 call 80105490 <release> if(doprocdump) { 8010084c: 85 f6 test %esi,%esi 8010084e: 0f 85 f4 00 00 00 jne 80100948 <consoleintr+0x178> } 80100854: 83 c4 20 add $0x20,%esp 80100857: 5b pop %ebx 80100858: 5e pop %esi 80100859: 5d pop %ebp 8010085a: c3 ret 8010085b: 90 nop 8010085c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi switch(c){ 80100860: 83 fa 08 cmp $0x8,%edx 80100863: 74 ad je 80100812 <consoleintr+0x42> if(c != 0 && input.e-input.r < INPUT_BUF){ 80100865: 85 d2 test %edx,%edx 80100867: 74 87 je 801007f0 <consoleintr+0x20> 80100869: a1 08 10 11 80 mov 0x80111008,%eax 8010086e: 89 c1 mov %eax,%ecx 80100870: 2b 0d 00 10 11 80 sub 0x80111000,%ecx 80100876: 83 f9 7f cmp $0x7f,%ecx 80100879: 0f 87 71 ff ff ff ja 801007f0 <consoleintr+0x20> 8010087f: 8d 48 01 lea 0x1(%eax),%ecx 80100882: 83 e0 7f and $0x7f,%eax c = (c == '\r') ? '\n' : c; 80100885: 83 fa 0d cmp $0xd,%edx input.buf[input.e++ % INPUT_BUF] = c; 80100888: 89 0d 08 10 11 80 mov %ecx,0x80111008 c = (c == '\r') ? '\n' : c; 8010088e: 0f 84 c4 00 00 00 je 80100958 <consoleintr+0x188> input.buf[input.e++ % INPUT_BUF] = c; 80100894: 88 90 80 0f 11 80 mov %dl,-0x7feef080(%eax) consputc(c); 8010089a: 89 d0 mov %edx,%eax 8010089c: 89 55 f4 mov %edx,-0xc(%ebp) 8010089f: e8 5c fb ff ff call 80100400 <consputc> if(c == '\n' || c == C('D') || input.e == input.r+INPUT_BUF){ 801008a4: 8b 55 f4 mov -0xc(%ebp),%edx 801008a7: 83 fa 0a cmp $0xa,%edx 801008aa: 0f 84 b9 00 00 00 je 80100969 <consoleintr+0x199> 801008b0: 83 fa 04 cmp $0x4,%edx 801008b3: 0f 84 b0 00 00 00 je 80100969 <consoleintr+0x199> 801008b9: a1 00 10 11 80 mov 0x80111000,%eax 801008be: 83 e8 80 sub $0xffffff80,%eax 801008c1: 39 05 08 10 11 80 cmp %eax,0x80111008 801008c7: 0f 85 23 ff ff ff jne 801007f0 <consoleintr+0x20> wakeup(&input.r); 801008cd: c7 04 24 00 10 11 80 movl $0x80111000,(%esp) input.w = input.e; 801008d4: a3 04 10 11 80 mov %eax,0x80111004 wakeup(&input.r); 801008d9: e8 d2 39 00 00 call 801042b0 <wakeup> 801008de: e9 0d ff ff ff jmp 801007f0 <consoleintr+0x20> 801008e3: 90 nop 801008e4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi doprocdump = 1; 801008e8: be 01 00 00 00 mov $0x1,%esi 801008ed: e9 fe fe ff ff jmp 801007f0 <consoleintr+0x20> 801008f2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi while(input.e != input.w && 801008f8: a1 08 10 11 80 mov 0x80111008,%eax 801008fd: 39 05 04 10 11 80 cmp %eax,0x80111004 80100903: 75 2b jne 80100930 <consoleintr+0x160> 80100905: e9 e6 fe ff ff jmp 801007f0 <consoleintr+0x20> 8010090a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi input.e--; 80100910: a3 08 10 11 80 mov %eax,0x80111008 consputc(BACKSPACE); 80100915: b8 00 01 00 00 mov $0x100,%eax 8010091a: e8 e1 fa ff ff call 80100400 <consputc> while(input.e != input.w && 8010091f: a1 08 10 11 80 mov 0x80111008,%eax 80100924: 3b 05 04 10 11 80 cmp 0x80111004,%eax 8010092a: 0f 84 c0 fe ff ff je 801007f0 <consoleintr+0x20> input.buf[(input.e-1) % INPUT_BUF] != '\n'){ 80100930: 48 dec %eax 80100931: 89 c2 mov %eax,%edx 80100933: 83 e2 7f and $0x7f,%edx while(input.e != input.w && 80100936: 80 ba 80 0f 11 80 0a cmpb $0xa,-0x7feef080(%edx) 8010093d: 75 d1 jne 80100910 <consoleintr+0x140> 8010093f: e9 ac fe ff ff jmp 801007f0 <consoleintr+0x20> 80100944: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi } 80100948: 83 c4 20 add $0x20,%esp 8010094b: 5b pop %ebx 8010094c: 5e pop %esi 8010094d: 5d pop %ebp procdump(); // now call procdump() wo. cons.lock held 8010094e: e9 2d 3a 00 00 jmp 80104380 <procdump> 80100953: 90 nop 80100954: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi input.buf[input.e++ % INPUT_BUF] = c; 80100958: c6 80 80 0f 11 80 0a movb $0xa,-0x7feef080(%eax) consputc(c); 8010095f: b8 0a 00 00 00 mov $0xa,%eax 80100964: e8 97 fa ff ff call 80100400 <consputc> 80100969: a1 08 10 11 80 mov 0x80111008,%eax 8010096e: e9 5a ff ff ff jmp 801008cd <consoleintr+0xfd> 80100973: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80100979: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80100980 <consoleinit>: void consoleinit(void) { 80100980: 55 push %ebp initlock(&cons.lock, "console"); 80100981: b8 88 80 10 80 mov $0x80108088,%eax { 80100986: 89 e5 mov %esp,%ebp 80100988: 83 ec 18 sub $0x18,%esp initlock(&cons.lock, "console"); 8010098b: 89 44 24 04 mov %eax,0x4(%esp) 8010098f: c7 04 24 20 b5 10 80 movl $0x8010b520,(%esp) 80100996: e8 05 49 00 00 call 801052a0 <initlock> devsw[CONSOLE].write = consolewrite; devsw[CONSOLE].read = consoleread; cons.locking = 1; 8010099b: b8 01 00 00 00 mov $0x1,%eax devsw[CONSOLE].write = consolewrite; 801009a0: ba f0 05 10 80 mov $0x801005f0,%edx cons.locking = 1; 801009a5: a3 54 b5 10 80 mov %eax,0x8010b554 ioapicenable(IRQ_KBD, 0); 801009aa: 31 c0 xor %eax,%eax devsw[CONSOLE].read = consoleread; 801009ac: b9 60 02 10 80 mov $0x80100260,%ecx ioapicenable(IRQ_KBD, 0); 801009b1: 89 44 24 04 mov %eax,0x4(%esp) 801009b5: c7 04 24 01 00 00 00 movl $0x1,(%esp) devsw[CONSOLE].write = consolewrite; 801009bc: 89 15 cc 19 11 80 mov %edx,0x801119cc devsw[CONSOLE].read = consoleread; 801009c2: 89 0d c8 19 11 80 mov %ecx,0x801119c8 ioapicenable(IRQ_KBD, 0); 801009c8: e8 d3 19 00 00 call 801023a0 <ioapicenable> } 801009cd: c9 leave 801009ce: c3 ret 801009cf: 90 nop 801009d0 <exec>: #include "x86.h" #include "elf.h" int exec(char *path, char **argv) { 801009d0: 55 push %ebp 801009d1: 89 e5 mov %esp,%ebp 801009d3: 57 push %edi 801009d4: 56 push %esi 801009d5: 53 push %ebx 801009d6: 81 ec 2c 01 00 00 sub $0x12c,%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(); 801009dc: e8 df 2f 00 00 call 801039c0 <myproc> 801009e1: 89 85 f4 fe ff ff mov %eax,-0x10c(%ebp) begin_op(); 801009e7: e8 a4 22 00 00 call 80102c90 <begin_op> if((ip = namei(path)) == 0){ 801009ec: 8b 45 08 mov 0x8(%ebp),%eax 801009ef: 89 04 24 mov %eax,(%esp) 801009f2: e8 d9 15 00 00 call 80101fd0 <namei> 801009f7: 85 c0 test %eax,%eax 801009f9: 0f 84 b6 01 00 00 je 80100bb5 <exec+0x1e5> end_op(); cprintf("exec: fail\n"); return -1; } ilock(ip); 801009ff: 89 04 24 mov %eax,(%esp) 80100a02: 89 c7 mov %eax,%edi pgdir = 0; // Check ELF header if(readi(ip, (char*)&elf, 0, sizeof(elf)) != sizeof(elf)) 80100a04: 31 db xor %ebx,%ebx ilock(ip); 80100a06: e8 e5 0c 00 00 call 801016f0 <ilock> if(readi(ip, (char*)&elf, 0, sizeof(elf)) != sizeof(elf)) 80100a0b: b9 34 00 00 00 mov $0x34,%ecx 80100a10: 8d 85 24 ff ff ff lea -0xdc(%ebp),%eax 80100a16: 89 4c 24 0c mov %ecx,0xc(%esp) 80100a1a: 89 5c 24 08 mov %ebx,0x8(%esp) 80100a1e: 89 44 24 04 mov %eax,0x4(%esp) 80100a22: 89 3c 24 mov %edi,(%esp) 80100a25: e8 a6 0f 00 00 call 801019d0 <readi> 80100a2a: 83 f8 34 cmp $0x34,%eax 80100a2d: 74 21 je 80100a50 <exec+0x80> bad: if(pgdir) freevm(pgdir); if(ip){ iunlockput(ip); 80100a2f: 89 3c 24 mov %edi,(%esp) 80100a32: e8 49 0f 00 00 call 80101980 <iunlockput> end_op(); 80100a37: e8 c4 22 00 00 call 80102d00 <end_op> } return -1; 80100a3c: b8 ff ff ff ff mov $0xffffffff,%eax } 80100a41: 81 c4 2c 01 00 00 add $0x12c,%esp 80100a47: 5b pop %ebx 80100a48: 5e pop %esi 80100a49: 5f pop %edi 80100a4a: 5d pop %ebp 80100a4b: c3 ret 80100a4c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(elf.magic != ELF_MAGIC) 80100a50: 81 bd 24 ff ff ff 7f cmpl $0x464c457f,-0xdc(%ebp) 80100a57: 45 4c 46 80100a5a: 75 d3 jne 80100a2f <exec+0x5f> if((pgdir = setupkvm()) == 0) 80100a5c: e8 ff 72 00 00 call 80107d60 <setupkvm> 80100a61: 85 c0 test %eax,%eax 80100a63: 89 85 f0 fe ff ff mov %eax,-0x110(%ebp) 80100a69: 74 c4 je 80100a2f <exec+0x5f> for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){ 80100a6b: 8b 85 40 ff ff ff mov -0xc0(%ebp),%eax sz = 0; 80100a71: 31 f6 xor %esi,%esi for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){ 80100a73: 66 83 bd 50 ff ff ff cmpw $0x0,-0xb0(%ebp) 80100a7a: 00 80100a7b: 89 85 ec fe ff ff mov %eax,-0x114(%ebp) 80100a81: 0f 84 b8 02 00 00 je 80100d3f <exec+0x36f> 80100a87: 31 db xor %ebx,%ebx 80100a89: e9 8c 00 00 00 jmp 80100b1a <exec+0x14a> 80100a8e: 66 90 xchg %ax,%ax if(ph.type != ELF_PROG_LOAD) 80100a90: 83 bd 04 ff ff ff 01 cmpl $0x1,-0xfc(%ebp) 80100a97: 75 75 jne 80100b0e <exec+0x13e> if(ph.memsz < ph.filesz) 80100a99: 8b 85 18 ff ff ff mov -0xe8(%ebp),%eax 80100a9f: 3b 85 14 ff ff ff cmp -0xec(%ebp),%eax 80100aa5: 0f 82 a4 00 00 00 jb 80100b4f <exec+0x17f> 80100aab: 03 85 0c ff ff ff add -0xf4(%ebp),%eax 80100ab1: 0f 82 98 00 00 00 jb 80100b4f <exec+0x17f> if((sz = allocuvm(pgdir, sz, ph.vaddr + ph.memsz)) == 0) 80100ab7: 89 44 24 08 mov %eax,0x8(%esp) 80100abb: 8b 85 f0 fe ff ff mov -0x110(%ebp),%eax 80100ac1: 89 74 24 04 mov %esi,0x4(%esp) 80100ac5: 89 04 24 mov %eax,(%esp) 80100ac8: e8 b3 70 00 00 call 80107b80 <allocuvm> 80100acd: 85 c0 test %eax,%eax 80100acf: 89 c6 mov %eax,%esi 80100ad1: 74 7c je 80100b4f <exec+0x17f> if(ph.vaddr % PGSIZE != 0) 80100ad3: 8b 85 0c ff ff ff mov -0xf4(%ebp),%eax 80100ad9: a9 ff 0f 00 00 test $0xfff,%eax 80100ade: 75 6f jne 80100b4f <exec+0x17f> if(loaduvm(pgdir, (char*)ph.vaddr, ip, ph.off, ph.filesz) < 0) 80100ae0: 8b 95 14 ff ff ff mov -0xec(%ebp),%edx 80100ae6: 89 44 24 04 mov %eax,0x4(%esp) 80100aea: 8b 85 f0 fe ff ff mov -0x110(%ebp),%eax 80100af0: 89 7c 24 08 mov %edi,0x8(%esp) 80100af4: 89 54 24 10 mov %edx,0x10(%esp) 80100af8: 8b 95 08 ff ff ff mov -0xf8(%ebp),%edx 80100afe: 89 04 24 mov %eax,(%esp) 80100b01: 89 54 24 0c mov %edx,0xc(%esp) 80100b05: e8 b6 6f 00 00 call 80107ac0 <loaduvm> 80100b0a: 85 c0 test %eax,%eax 80100b0c: 78 41 js 80100b4f <exec+0x17f> for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){ 80100b0e: 0f b7 85 50 ff ff ff movzwl -0xb0(%ebp),%eax 80100b15: 43 inc %ebx 80100b16: 39 d8 cmp %ebx,%eax 80100b18: 7e 48 jle 80100b62 <exec+0x192> if(readi(ip, (char*)&ph, off, sizeof(ph)) != sizeof(ph)) 80100b1a: 8b 95 ec fe ff ff mov -0x114(%ebp),%edx 80100b20: b8 20 00 00 00 mov $0x20,%eax 80100b25: 89 44 24 0c mov %eax,0xc(%esp) 80100b29: 89 d8 mov %ebx,%eax 80100b2b: c1 e0 05 shl $0x5,%eax 80100b2e: 89 3c 24 mov %edi,(%esp) 80100b31: 01 d0 add %edx,%eax 80100b33: 89 44 24 08 mov %eax,0x8(%esp) 80100b37: 8d 85 04 ff ff ff lea -0xfc(%ebp),%eax 80100b3d: 89 44 24 04 mov %eax,0x4(%esp) 80100b41: e8 8a 0e 00 00 call 801019d0 <readi> 80100b46: 83 f8 20 cmp $0x20,%eax 80100b49: 0f 84 41 ff ff ff je 80100a90 <exec+0xc0> freevm(pgdir); 80100b4f: 8b 85 f0 fe ff ff mov -0x110(%ebp),%eax 80100b55: 89 04 24 mov %eax,(%esp) 80100b58: e8 83 71 00 00 call 80107ce0 <freevm> 80100b5d: e9 cd fe ff ff jmp 80100a2f <exec+0x5f> 80100b62: 81 c6 ff 0f 00 00 add $0xfff,%esi 80100b68: 81 e6 00 f0 ff ff and $0xfffff000,%esi 80100b6e: 8d 9e 00 20 00 00 lea 0x2000(%esi),%ebx iunlockput(ip); 80100b74: 89 3c 24 mov %edi,(%esp) 80100b77: e8 04 0e 00 00 call 80101980 <iunlockput> end_op(); 80100b7c: e8 7f 21 00 00 call 80102d00 <end_op> if((sz = allocuvm(pgdir, sz, sz + 2*PGSIZE)) == 0) 80100b81: 8b 85 f0 fe ff ff mov -0x110(%ebp),%eax 80100b87: 89 74 24 04 mov %esi,0x4(%esp) 80100b8b: 89 5c 24 08 mov %ebx,0x8(%esp) 80100b8f: 89 04 24 mov %eax,(%esp) 80100b92: e8 e9 6f 00 00 call 80107b80 <allocuvm> 80100b97: 85 c0 test %eax,%eax 80100b99: 89 c6 mov %eax,%esi 80100b9b: 75 33 jne 80100bd0 <exec+0x200> freevm(pgdir); 80100b9d: 8b 85 f0 fe ff ff mov -0x110(%ebp),%eax 80100ba3: 89 04 24 mov %eax,(%esp) 80100ba6: e8 35 71 00 00 call 80107ce0 <freevm> return -1; 80100bab: b8 ff ff ff ff mov $0xffffffff,%eax 80100bb0: e9 8c fe ff ff jmp 80100a41 <exec+0x71> end_op(); 80100bb5: e8 46 21 00 00 call 80102d00 <end_op> cprintf("exec: fail\n"); 80100bba: c7 04 24 a1 80 10 80 movl $0x801080a1,(%esp) 80100bc1: e8 8a fa ff ff call 80100650 <cprintf> return -1; 80100bc6: b8 ff ff ff ff mov $0xffffffff,%eax 80100bcb: e9 71 fe ff ff jmp 80100a41 <exec+0x71> clearpteu(pgdir, (char*)(sz - 2*PGSIZE)); 80100bd0: 8d 80 00 e0 ff ff lea -0x2000(%eax),%eax for(argc = 0; argv[argc]; argc++) { 80100bd6: 31 ff xor %edi,%edi clearpteu(pgdir, (char*)(sz - 2*PGSIZE)); 80100bd8: 89 44 24 04 mov %eax,0x4(%esp) 80100bdc: 8b 85 f0 fe ff ff mov -0x110(%ebp),%eax for(argc = 0; argv[argc]; argc++) { 80100be2: 89 f3 mov %esi,%ebx clearpteu(pgdir, (char*)(sz - 2*PGSIZE)); 80100be4: 89 04 24 mov %eax,(%esp) 80100be7: e8 14 72 00 00 call 80107e00 <clearpteu> for(argc = 0; argv[argc]; argc++) { 80100bec: 8b 45 0c mov 0xc(%ebp),%eax 80100bef: 8d 95 58 ff ff ff lea -0xa8(%ebp),%edx 80100bf5: 8b 00 mov (%eax),%eax 80100bf7: 85 c0 test %eax,%eax 80100bf9: 74 78 je 80100c73 <exec+0x2a3> 80100bfb: 89 b5 ec fe ff ff mov %esi,-0x114(%ebp) 80100c01: 8b b5 f0 fe ff ff mov -0x110(%ebp),%esi 80100c07: eb 0c jmp 80100c15 <exec+0x245> 80100c09: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if(argc >= MAXARG) 80100c10: 83 ff 20 cmp $0x20,%edi 80100c13: 74 88 je 80100b9d <exec+0x1cd> sp = (sp - (strlen(argv[argc]) + 1)) & ~3; 80100c15: 89 04 24 mov %eax,(%esp) 80100c18: e8 e3 4a 00 00 call 80105700 <strlen> 80100c1d: f7 d0 not %eax 80100c1f: 01 c3 add %eax,%ebx if(copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0) 80100c21: 8b 45 0c mov 0xc(%ebp),%eax sp = (sp - (strlen(argv[argc]) + 1)) & ~3; 80100c24: 83 e3 fc and $0xfffffffc,%ebx if(copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0) 80100c27: 8b 04 b8 mov (%eax,%edi,4),%eax 80100c2a: 89 04 24 mov %eax,(%esp) 80100c2d: e8 ce 4a 00 00 call 80105700 <strlen> 80100c32: 40 inc %eax 80100c33: 89 44 24 0c mov %eax,0xc(%esp) 80100c37: 8b 45 0c mov 0xc(%ebp),%eax 80100c3a: 8b 04 b8 mov (%eax,%edi,4),%eax 80100c3d: 89 5c 24 04 mov %ebx,0x4(%esp) 80100c41: 89 34 24 mov %esi,(%esp) 80100c44: 89 44 24 08 mov %eax,0x8(%esp) 80100c48: e8 23 73 00 00 call 80107f70 <copyout> 80100c4d: 85 c0 test %eax,%eax 80100c4f: 0f 88 48 ff ff ff js 80100b9d <exec+0x1cd> for(argc = 0; argv[argc]; argc++) { 80100c55: 8b 45 0c mov 0xc(%ebp),%eax ustack[3+argc] = sp; 80100c58: 8d 95 58 ff ff ff lea -0xa8(%ebp),%edx 80100c5e: 89 9c bd 64 ff ff ff mov %ebx,-0x9c(%ebp,%edi,4) for(argc = 0; argv[argc]; argc++) { 80100c65: 47 inc %edi 80100c66: 8b 04 b8 mov (%eax,%edi,4),%eax 80100c69: 85 c0 test %eax,%eax 80100c6b: 75 a3 jne 80100c10 <exec+0x240> 80100c6d: 8b b5 ec fe ff ff mov -0x114(%ebp),%esi ustack[3+argc] = 0; 80100c73: 31 c0 xor %eax,%eax ustack[0] = 0xffffffff; // fake return PC 80100c75: b9 ff ff ff ff mov $0xffffffff,%ecx ustack[3+argc] = 0; 80100c7a: 89 84 bd 64 ff ff ff mov %eax,-0x9c(%ebp,%edi,4) ustack[2] = sp - (argc+1)*4; // argv pointer 80100c81: 8d 04 bd 04 00 00 00 lea 0x4(,%edi,4),%eax ustack[0] = 0xffffffff; // fake return PC 80100c88: 89 8d 58 ff ff ff mov %ecx,-0xa8(%ebp) ustack[2] = sp - (argc+1)*4; // argv pointer 80100c8e: 89 d9 mov %ebx,%ecx 80100c90: 29 c1 sub %eax,%ecx sp -= (3+argc+1) * 4; 80100c92: 83 c0 0c add $0xc,%eax 80100c95: 29 c3 sub %eax,%ebx if(copyout(pgdir, sp, ustack, (3+argc+1)*4) < 0) 80100c97: 89 44 24 0c mov %eax,0xc(%esp) 80100c9b: 8b 85 f0 fe ff ff mov -0x110(%ebp),%eax 80100ca1: 89 54 24 08 mov %edx,0x8(%esp) 80100ca5: 89 5c 24 04 mov %ebx,0x4(%esp) ustack[1] = argc; 80100ca9: 89 bd 5c ff ff ff mov %edi,-0xa4(%ebp) if(copyout(pgdir, sp, ustack, (3+argc+1)*4) < 0) 80100caf: 89 04 24 mov %eax,(%esp) ustack[2] = sp - (argc+1)*4; // argv pointer 80100cb2: 89 8d 60 ff ff ff mov %ecx,-0xa0(%ebp) if(copyout(pgdir, sp, ustack, (3+argc+1)*4) < 0) 80100cb8: e8 b3 72 00 00 call 80107f70 <copyout> 80100cbd: 85 c0 test %eax,%eax 80100cbf: 0f 88 d8 fe ff ff js 80100b9d <exec+0x1cd> for(last=s=path; *s; s++) 80100cc5: 8b 45 08 mov 0x8(%ebp),%eax 80100cc8: 0f b6 00 movzbl (%eax),%eax 80100ccb: 84 c0 test %al,%al 80100ccd: 74 15 je 80100ce4 <exec+0x314> 80100ccf: 8b 55 08 mov 0x8(%ebp),%edx 80100cd2: 89 d1 mov %edx,%ecx 80100cd4: 41 inc %ecx 80100cd5: 3c 2f cmp $0x2f,%al 80100cd7: 0f b6 01 movzbl (%ecx),%eax 80100cda: 0f 44 d1 cmove %ecx,%edx 80100cdd: 84 c0 test %al,%al 80100cdf: 75 f3 jne 80100cd4 <exec+0x304> 80100ce1: 89 55 08 mov %edx,0x8(%ebp) safestrcpy(curproc->name, last, sizeof(curproc->name)); 80100ce4: 8b bd f4 fe ff ff mov -0x10c(%ebp),%edi 80100cea: 8b 45 08 mov 0x8(%ebp),%eax 80100ced: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp) 80100cf4: 00 80100cf5: 89 44 24 04 mov %eax,0x4(%esp) 80100cf9: 89 f8 mov %edi,%eax 80100cfb: 83 c0 6c add $0x6c,%eax 80100cfe: 89 04 24 mov %eax,(%esp) 80100d01: e8 ba 49 00 00 call 801056c0 <safestrcpy> curproc->pgdir = pgdir; 80100d06: 8b 95 f0 fe ff ff mov -0x110(%ebp),%edx oldpgdir = curproc->pgdir; 80100d0c: 89 f9 mov %edi,%ecx 80100d0e: 8b 7f 04 mov 0x4(%edi),%edi curproc->sz = sz; 80100d11: 89 31 mov %esi,(%ecx) curproc->tf->eip = elf.entry; // main 80100d13: 8b 41 18 mov 0x18(%ecx),%eax curproc->pgdir = pgdir; 80100d16: 89 51 04 mov %edx,0x4(%ecx) curproc->tf->eip = elf.entry; // main 80100d19: 8b 95 3c ff ff ff mov -0xc4(%ebp),%edx 80100d1f: 89 50 38 mov %edx,0x38(%eax) curproc->tf->esp = sp; 80100d22: 8b 41 18 mov 0x18(%ecx),%eax 80100d25: 89 58 44 mov %ebx,0x44(%eax) switchuvm(curproc); 80100d28: 89 0c 24 mov %ecx,(%esp) 80100d2b: e8 00 6c 00 00 call 80107930 <switchuvm> freevm(oldpgdir); 80100d30: 89 3c 24 mov %edi,(%esp) 80100d33: e8 a8 6f 00 00 call 80107ce0 <freevm> return 0; 80100d38: 31 c0 xor %eax,%eax 80100d3a: e9 02 fd ff ff jmp 80100a41 <exec+0x71> for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){ 80100d3f: bb 00 20 00 00 mov $0x2000,%ebx 80100d44: e9 2b fe ff ff jmp 80100b74 <exec+0x1a4> 80100d49: 66 90 xchg %ax,%ax 80100d4b: 66 90 xchg %ax,%ax 80100d4d: 66 90 xchg %ax,%ax 80100d4f: 90 nop 80100d50 <fileinit>: struct file file[NFILE]; } ftable; void fileinit(void) { 80100d50: 55 push %ebp initlock(&ftable.lock, "ftable"); 80100d51: b8 ad 80 10 80 mov $0x801080ad,%eax { 80100d56: 89 e5 mov %esp,%ebp 80100d58: 83 ec 18 sub $0x18,%esp initlock(&ftable.lock, "ftable"); 80100d5b: 89 44 24 04 mov %eax,0x4(%esp) 80100d5f: c7 04 24 20 10 11 80 movl $0x80111020,(%esp) 80100d66: e8 35 45 00 00 call 801052a0 <initlock> } 80100d6b: c9 leave 80100d6c: c3 ret 80100d6d: 8d 76 00 lea 0x0(%esi),%esi 80100d70 <filealloc>: // Allocate a file structure. struct file* filealloc(void) { 80100d70: 55 push %ebp 80100d71: 89 e5 mov %esp,%ebp 80100d73: 53 push %ebx struct file *f; acquire(&ftable.lock); for(f = ftable.file; f < ftable.file + NFILE; f++){ 80100d74: bb 54 10 11 80 mov $0x80111054,%ebx { 80100d79: 83 ec 14 sub $0x14,%esp acquire(&ftable.lock); 80100d7c: c7 04 24 20 10 11 80 movl $0x80111020,(%esp) 80100d83: e8 68 46 00 00 call 801053f0 <acquire> 80100d88: eb 11 jmp 80100d9b <filealloc+0x2b> 80100d8a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi for(f = ftable.file; f < ftable.file + NFILE; f++){ 80100d90: 83 c3 18 add $0x18,%ebx 80100d93: 81 fb b4 19 11 80 cmp $0x801119b4,%ebx 80100d99: 73 25 jae 80100dc0 <filealloc+0x50> if(f->ref == 0){ 80100d9b: 8b 43 04 mov 0x4(%ebx),%eax 80100d9e: 85 c0 test %eax,%eax 80100da0: 75 ee jne 80100d90 <filealloc+0x20> f->ref = 1; 80100da2: c7 43 04 01 00 00 00 movl $0x1,0x4(%ebx) release(&ftable.lock); 80100da9: c7 04 24 20 10 11 80 movl $0x80111020,(%esp) 80100db0: e8 db 46 00 00 call 80105490 <release> return f; } } release(&ftable.lock); return 0; } 80100db5: 83 c4 14 add $0x14,%esp 80100db8: 89 d8 mov %ebx,%eax 80100dba: 5b pop %ebx 80100dbb: 5d pop %ebp 80100dbc: c3 ret 80100dbd: 8d 76 00 lea 0x0(%esi),%esi release(&ftable.lock); 80100dc0: c7 04 24 20 10 11 80 movl $0x80111020,(%esp) return 0; 80100dc7: 31 db xor %ebx,%ebx release(&ftable.lock); 80100dc9: e8 c2 46 00 00 call 80105490 <release> } 80100dce: 83 c4 14 add $0x14,%esp 80100dd1: 89 d8 mov %ebx,%eax 80100dd3: 5b pop %ebx 80100dd4: 5d pop %ebp 80100dd5: c3 ret 80100dd6: 8d 76 00 lea 0x0(%esi),%esi 80100dd9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80100de0 <filedup>: // Increment ref count for file f. struct file* filedup(struct file *f) { 80100de0: 55 push %ebp 80100de1: 89 e5 mov %esp,%ebp 80100de3: 53 push %ebx 80100de4: 83 ec 14 sub $0x14,%esp 80100de7: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&ftable.lock); 80100dea: c7 04 24 20 10 11 80 movl $0x80111020,(%esp) 80100df1: e8 fa 45 00 00 call 801053f0 <acquire> if(f->ref < 1) 80100df6: 8b 43 04 mov 0x4(%ebx),%eax 80100df9: 85 c0 test %eax,%eax 80100dfb: 7e 18 jle 80100e15 <filedup+0x35> panic("filedup"); f->ref++; 80100dfd: 40 inc %eax 80100dfe: 89 43 04 mov %eax,0x4(%ebx) release(&ftable.lock); 80100e01: c7 04 24 20 10 11 80 movl $0x80111020,(%esp) 80100e08: e8 83 46 00 00 call 80105490 <release> return f; } 80100e0d: 83 c4 14 add $0x14,%esp 80100e10: 89 d8 mov %ebx,%eax 80100e12: 5b pop %ebx 80100e13: 5d pop %ebp 80100e14: c3 ret panic("filedup"); 80100e15: c7 04 24 b4 80 10 80 movl $0x801080b4,(%esp) 80100e1c: e8 4f f5 ff ff call 80100370 <panic> 80100e21: eb 0d jmp 80100e30 <fileclose> 80100e23: 90 nop 80100e24: 90 nop 80100e25: 90 nop 80100e26: 90 nop 80100e27: 90 nop 80100e28: 90 nop 80100e29: 90 nop 80100e2a: 90 nop 80100e2b: 90 nop 80100e2c: 90 nop 80100e2d: 90 nop 80100e2e: 90 nop 80100e2f: 90 nop 80100e30 <fileclose>: // Close file f. (Decrement ref count, close when reaches 0.) void fileclose(struct file *f) { 80100e30: 55 push %ebp 80100e31: 89 e5 mov %esp,%ebp 80100e33: 83 ec 38 sub $0x38,%esp 80100e36: 89 5d f4 mov %ebx,-0xc(%ebp) 80100e39: 8b 5d 08 mov 0x8(%ebp),%ebx struct file ff; acquire(&ftable.lock); 80100e3c: c7 04 24 20 10 11 80 movl $0x80111020,(%esp) { 80100e43: 89 75 f8 mov %esi,-0x8(%ebp) 80100e46: 89 7d fc mov %edi,-0x4(%ebp) acquire(&ftable.lock); 80100e49: e8 a2 45 00 00 call 801053f0 <acquire> if(f->ref < 1) 80100e4e: 8b 43 04 mov 0x4(%ebx),%eax 80100e51: 85 c0 test %eax,%eax 80100e53: 0f 8e a0 00 00 00 jle 80100ef9 <fileclose+0xc9> panic("fileclose"); if(--f->ref > 0){ 80100e59: 48 dec %eax 80100e5a: 85 c0 test %eax,%eax 80100e5c: 89 43 04 mov %eax,0x4(%ebx) 80100e5f: 74 1f je 80100e80 <fileclose+0x50> release(&ftable.lock); 80100e61: c7 45 08 20 10 11 80 movl $0x80111020,0x8(%ebp) else if(ff.type == FD_INODE){ begin_op(); iput(ff.ip); end_op(); } } 80100e68: 8b 5d f4 mov -0xc(%ebp),%ebx 80100e6b: 8b 75 f8 mov -0x8(%ebp),%esi 80100e6e: 8b 7d fc mov -0x4(%ebp),%edi 80100e71: 89 ec mov %ebp,%esp 80100e73: 5d pop %ebp release(&ftable.lock); 80100e74: e9 17 46 00 00 jmp 80105490 <release> 80100e79: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi ff = *f; 80100e80: 0f b6 43 09 movzbl 0x9(%ebx),%eax 80100e84: 8b 3b mov (%ebx),%edi 80100e86: 8b 73 0c mov 0xc(%ebx),%esi f->type = FD_NONE; 80100e89: c7 03 00 00 00 00 movl $0x0,(%ebx) ff = *f; 80100e8f: 88 45 e7 mov %al,-0x19(%ebp) 80100e92: 8b 43 10 mov 0x10(%ebx),%eax release(&ftable.lock); 80100e95: c7 04 24 20 10 11 80 movl $0x80111020,(%esp) ff = *f; 80100e9c: 89 45 e0 mov %eax,-0x20(%ebp) release(&ftable.lock); 80100e9f: e8 ec 45 00 00 call 80105490 <release> if(ff.type == FD_PIPE) 80100ea4: 83 ff 01 cmp $0x1,%edi 80100ea7: 74 17 je 80100ec0 <fileclose+0x90> else if(ff.type == FD_INODE){ 80100ea9: 83 ff 02 cmp $0x2,%edi 80100eac: 74 2a je 80100ed8 <fileclose+0xa8> } 80100eae: 8b 5d f4 mov -0xc(%ebp),%ebx 80100eb1: 8b 75 f8 mov -0x8(%ebp),%esi 80100eb4: 8b 7d fc mov -0x4(%ebp),%edi 80100eb7: 89 ec mov %ebp,%esp 80100eb9: 5d pop %ebp 80100eba: c3 ret 80100ebb: 90 nop 80100ebc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi pipeclose(ff.pipe, ff.writable); 80100ec0: 0f be 5d e7 movsbl -0x19(%ebp),%ebx 80100ec4: 89 34 24 mov %esi,(%esp) 80100ec7: 89 5c 24 04 mov %ebx,0x4(%esp) 80100ecb: e8 f0 25 00 00 call 801034c0 <pipeclose> 80100ed0: eb dc jmp 80100eae <fileclose+0x7e> 80100ed2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi begin_op(); 80100ed8: e8 b3 1d 00 00 call 80102c90 <begin_op> iput(ff.ip); 80100edd: 8b 45 e0 mov -0x20(%ebp),%eax 80100ee0: 89 04 24 mov %eax,(%esp) 80100ee3: e8 38 09 00 00 call 80101820 <iput> } 80100ee8: 8b 5d f4 mov -0xc(%ebp),%ebx 80100eeb: 8b 75 f8 mov -0x8(%ebp),%esi 80100eee: 8b 7d fc mov -0x4(%ebp),%edi 80100ef1: 89 ec mov %ebp,%esp 80100ef3: 5d pop %ebp end_op(); 80100ef4: e9 07 1e 00 00 jmp 80102d00 <end_op> panic("fileclose"); 80100ef9: c7 04 24 bc 80 10 80 movl $0x801080bc,(%esp) 80100f00: e8 6b f4 ff ff call 80100370 <panic> 80100f05: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80100f09: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 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 14 sub $0x14,%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: 8b 43 10 mov 0x10(%ebx),%eax 80100f22: 89 04 24 mov %eax,(%esp) 80100f25: e8 c6 07 00 00 call 801016f0 <ilock> stati(f->ip, st); 80100f2a: 8b 45 0c mov 0xc(%ebp),%eax 80100f2d: 89 44 24 04 mov %eax,0x4(%esp) 80100f31: 8b 43 10 mov 0x10(%ebx),%eax 80100f34: 89 04 24 mov %eax,(%esp) 80100f37: e8 64 0a 00 00 call 801019a0 <stati> iunlock(f->ip); 80100f3c: 8b 43 10 mov 0x10(%ebx),%eax 80100f3f: 89 04 24 mov %eax,(%esp) 80100f42: e8 89 08 00 00 call 801017d0 <iunlock> return 0; 80100f47: 31 c0 xor %eax,%eax } return -1; } 80100f49: 83 c4 14 add $0x14,%esp 80100f4c: 5b pop %ebx 80100f4d: 5d pop %ebp 80100f4e: c3 ret 80100f4f: 90 nop return -1; 80100f50: b8 ff ff ff ff mov $0xffffffff,%eax 80100f55: eb f2 jmp 80100f49 <filestat+0x39> 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: 83 ec 38 sub $0x38,%esp 80100f66: 89 5d f4 mov %ebx,-0xc(%ebp) 80100f69: 8b 5d 08 mov 0x8(%ebp),%ebx 80100f6c: 89 75 f8 mov %esi,-0x8(%ebp) 80100f6f: 8b 75 0c mov 0xc(%ebp),%esi 80100f72: 89 7d fc mov %edi,-0x4(%ebp) 80100f75: 8b 7d 10 mov 0x10(%ebp),%edi int r; if(f->readable == 0) 80100f78: 80 7b 08 00 cmpb $0x0,0x8(%ebx) 80100f7c: 74 72 je 80100ff0 <fileread+0x90> return -1; if(f->type == FD_PIPE) 80100f7e: 8b 03 mov (%ebx),%eax 80100f80: 83 f8 01 cmp $0x1,%eax 80100f83: 74 53 je 80100fd8 <fileread+0x78> return piperead(f->pipe, addr, n); if(f->type == FD_INODE){ 80100f85: 83 f8 02 cmp $0x2,%eax 80100f88: 75 6d jne 80100ff7 <fileread+0x97> ilock(f->ip); 80100f8a: 8b 43 10 mov 0x10(%ebx),%eax 80100f8d: 89 04 24 mov %eax,(%esp) 80100f90: e8 5b 07 00 00 call 801016f0 <ilock> if((r = readi(f->ip, addr, f->off, n)) > 0) 80100f95: 89 7c 24 0c mov %edi,0xc(%esp) 80100f99: 8b 43 14 mov 0x14(%ebx),%eax 80100f9c: 89 74 24 04 mov %esi,0x4(%esp) 80100fa0: 89 44 24 08 mov %eax,0x8(%esp) 80100fa4: 8b 43 10 mov 0x10(%ebx),%eax 80100fa7: 89 04 24 mov %eax,(%esp) 80100faa: e8 21 0a 00 00 call 801019d0 <readi> 80100faf: 85 c0 test %eax,%eax 80100fb1: 7e 03 jle 80100fb6 <fileread+0x56> f->off += r; 80100fb3: 01 43 14 add %eax,0x14(%ebx) iunlock(f->ip); 80100fb6: 8b 53 10 mov 0x10(%ebx),%edx 80100fb9: 89 45 e4 mov %eax,-0x1c(%ebp) 80100fbc: 89 14 24 mov %edx,(%esp) 80100fbf: e8 0c 08 00 00 call 801017d0 <iunlock> return r; 80100fc4: 8b 45 e4 mov -0x1c(%ebp),%eax } panic("fileread"); } 80100fc7: 8b 5d f4 mov -0xc(%ebp),%ebx 80100fca: 8b 75 f8 mov -0x8(%ebp),%esi 80100fcd: 8b 7d fc mov -0x4(%ebp),%edi 80100fd0: 89 ec mov %ebp,%esp 80100fd2: 5d pop %ebp 80100fd3: c3 ret 80100fd4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return piperead(f->pipe, addr, n); 80100fd8: 8b 43 0c mov 0xc(%ebx),%eax } 80100fdb: 8b 75 f8 mov -0x8(%ebp),%esi 80100fde: 8b 5d f4 mov -0xc(%ebp),%ebx 80100fe1: 8b 7d fc mov -0x4(%ebp),%edi return piperead(f->pipe, addr, n); 80100fe4: 89 45 08 mov %eax,0x8(%ebp) } 80100fe7: 89 ec mov %ebp,%esp 80100fe9: 5d pop %ebp return piperead(f->pipe, addr, n); 80100fea: e9 81 26 00 00 jmp 80103670 <piperead> 80100fef: 90 nop return -1; 80100ff0: b8 ff ff ff ff mov $0xffffffff,%eax 80100ff5: eb d0 jmp 80100fc7 <fileread+0x67> panic("fileread"); 80100ff7: c7 04 24 c6 80 10 80 movl $0x801080c6,(%esp) 80100ffe: e8 6d f3 ff ff call 80100370 <panic> 80101003: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80101009: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101010 <filewrite>: //PAGEBREAK! // Write to file f. int filewrite(struct file *f, char *addr, int n) { 80101010: 55 push %ebp 80101011: 89 e5 mov %esp,%ebp 80101013: 57 push %edi 80101014: 56 push %esi 80101015: 53 push %ebx 80101016: 83 ec 2c sub $0x2c,%esp 80101019: 8b 45 0c mov 0xc(%ebp),%eax 8010101c: 8b 7d 08 mov 0x8(%ebp),%edi 8010101f: 89 45 dc mov %eax,-0x24(%ebp) 80101022: 8b 45 10 mov 0x10(%ebp),%eax int r; if(f->writable == 0) 80101025: 80 7f 09 00 cmpb $0x0,0x9(%edi) { 80101029: 89 45 e4 mov %eax,-0x1c(%ebp) if(f->writable == 0) 8010102c: 0f 84 ae 00 00 00 je 801010e0 <filewrite+0xd0> return -1; if(f->type == FD_PIPE) 80101032: 8b 07 mov (%edi),%eax 80101034: 83 f8 01 cmp $0x1,%eax 80101037: 0f 84 c3 00 00 00 je 80101100 <filewrite+0xf0> return pipewrite(f->pipe, addr, n); if(f->type == FD_INODE){ 8010103d: 83 f8 02 cmp $0x2,%eax 80101040: 0f 85 d8 00 00 00 jne 8010111e <filewrite+0x10e> // 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){ 80101046: 8b 45 e4 mov -0x1c(%ebp),%eax int i = 0; 80101049: 31 f6 xor %esi,%esi while(i < n){ 8010104b: 85 c0 test %eax,%eax 8010104d: 7f 31 jg 80101080 <filewrite+0x70> 8010104f: e9 9c 00 00 00 jmp 801010f0 <filewrite+0xe0> 80101054: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi begin_op(); ilock(f->ip); if ((r = writei(f->ip, addr + i, f->off, n1)) > 0) f->off += r; iunlock(f->ip); 80101058: 8b 4f 10 mov 0x10(%edi),%ecx f->off += r; 8010105b: 01 47 14 add %eax,0x14(%edi) 8010105e: 89 45 e0 mov %eax,-0x20(%ebp) iunlock(f->ip); 80101061: 89 0c 24 mov %ecx,(%esp) 80101064: e8 67 07 00 00 call 801017d0 <iunlock> end_op(); 80101069: e8 92 1c 00 00 call 80102d00 <end_op> 8010106e: 8b 45 e0 mov -0x20(%ebp),%eax if(r < 0) break; if(r != n1) 80101071: 39 c3 cmp %eax,%ebx 80101073: 0f 85 99 00 00 00 jne 80101112 <filewrite+0x102> panic("short filewrite"); i += r; 80101079: 01 de add %ebx,%esi while(i < n){ 8010107b: 39 75 e4 cmp %esi,-0x1c(%ebp) 8010107e: 7e 70 jle 801010f0 <filewrite+0xe0> int n1 = n - i; 80101080: 8b 5d e4 mov -0x1c(%ebp),%ebx 80101083: b8 00 06 00 00 mov $0x600,%eax 80101088: 29 f3 sub %esi,%ebx 8010108a: 81 fb 00 06 00 00 cmp $0x600,%ebx 80101090: 0f 4f d8 cmovg %eax,%ebx begin_op(); 80101093: e8 f8 1b 00 00 call 80102c90 <begin_op> ilock(f->ip); 80101098: 8b 47 10 mov 0x10(%edi),%eax 8010109b: 89 04 24 mov %eax,(%esp) 8010109e: e8 4d 06 00 00 call 801016f0 <ilock> if ((r = writei(f->ip, addr + i, f->off, n1)) > 0) 801010a3: 89 5c 24 0c mov %ebx,0xc(%esp) 801010a7: 8b 47 14 mov 0x14(%edi),%eax 801010aa: 89 44 24 08 mov %eax,0x8(%esp) 801010ae: 8b 45 dc mov -0x24(%ebp),%eax 801010b1: 01 f0 add %esi,%eax 801010b3: 89 44 24 04 mov %eax,0x4(%esp) 801010b7: 8b 47 10 mov 0x10(%edi),%eax 801010ba: 89 04 24 mov %eax,(%esp) 801010bd: e8 2e 0a 00 00 call 80101af0 <writei> 801010c2: 85 c0 test %eax,%eax 801010c4: 7f 92 jg 80101058 <filewrite+0x48> iunlock(f->ip); 801010c6: 8b 4f 10 mov 0x10(%edi),%ecx 801010c9: 89 45 e0 mov %eax,-0x20(%ebp) 801010cc: 89 0c 24 mov %ecx,(%esp) 801010cf: e8 fc 06 00 00 call 801017d0 <iunlock> end_op(); 801010d4: e8 27 1c 00 00 call 80102d00 <end_op> if(r < 0) 801010d9: 8b 45 e0 mov -0x20(%ebp),%eax 801010dc: 85 c0 test %eax,%eax 801010de: 74 91 je 80101071 <filewrite+0x61> } return i == n ? n : -1; } panic("filewrite"); } 801010e0: 83 c4 2c add $0x2c,%esp return -1; 801010e3: be ff ff ff ff mov $0xffffffff,%esi } 801010e8: 5b pop %ebx 801010e9: 89 f0 mov %esi,%eax 801010eb: 5e pop %esi 801010ec: 5f pop %edi 801010ed: 5d pop %ebp 801010ee: c3 ret 801010ef: 90 nop return i == n ? n : -1; 801010f0: 39 75 e4 cmp %esi,-0x1c(%ebp) 801010f3: 75 eb jne 801010e0 <filewrite+0xd0> } 801010f5: 83 c4 2c add $0x2c,%esp 801010f8: 89 f0 mov %esi,%eax 801010fa: 5b pop %ebx 801010fb: 5e pop %esi 801010fc: 5f pop %edi 801010fd: 5d pop %ebp 801010fe: c3 ret 801010ff: 90 nop return pipewrite(f->pipe, addr, n); 80101100: 8b 47 0c mov 0xc(%edi),%eax 80101103: 89 45 08 mov %eax,0x8(%ebp) } 80101106: 83 c4 2c add $0x2c,%esp 80101109: 5b pop %ebx 8010110a: 5e pop %esi 8010110b: 5f pop %edi 8010110c: 5d pop %ebp return pipewrite(f->pipe, addr, n); 8010110d: e9 4e 24 00 00 jmp 80103560 <pipewrite> panic("short filewrite"); 80101112: c7 04 24 cf 80 10 80 movl $0x801080cf,(%esp) 80101119: e8 52 f2 ff ff call 80100370 <panic> panic("filewrite"); 8010111e: c7 04 24 d5 80 10 80 movl $0x801080d5,(%esp) 80101125: e8 46 f2 ff ff call 80100370 <panic> 8010112a: 66 90 xchg %ax,%ax 8010112c: 66 90 xchg %ax,%ax 8010112e: 66 90 xchg %ax,%ax 80101130 <balloc>: // Blocks. // Allocate a zeroed disk block. static uint balloc(uint dev) { 80101130: 55 push %ebp 80101131: 89 e5 mov %esp,%ebp 80101133: 57 push %edi 80101134: 56 push %esi 80101135: 53 push %ebx 80101136: 83 ec 2c sub $0x2c,%esp int b, bi, m; struct buf *bp; bp = 0; for(b = 0; b < sb.size; b += BPB){ 80101139: 8b 35 20 1a 11 80 mov 0x80111a20,%esi { 8010113f: 89 45 d8 mov %eax,-0x28(%ebp) for(b = 0; b < sb.size; b += BPB){ 80101142: 85 f6 test %esi,%esi 80101144: 0f 84 7e 00 00 00 je 801011c8 <balloc+0x98> 8010114a: c7 45 dc 00 00 00 00 movl $0x0,-0x24(%ebp) bp = bread(dev, BBLOCK(b, sb)); 80101151: 8b 75 dc mov -0x24(%ebp),%esi 80101154: 8b 1d 38 1a 11 80 mov 0x80111a38,%ebx 8010115a: 89 f0 mov %esi,%eax 8010115c: c1 f8 0c sar $0xc,%eax 8010115f: 01 d8 add %ebx,%eax 80101161: 89 44 24 04 mov %eax,0x4(%esp) 80101165: 8b 45 d8 mov -0x28(%ebp),%eax 80101168: 89 04 24 mov %eax,(%esp) 8010116b: e8 60 ef ff ff call 801000d0 <bread> 80101170: 89 c3 mov %eax,%ebx for(bi = 0; bi < BPB && b + bi < sb.size; bi++){ 80101172: a1 20 1a 11 80 mov 0x80111a20,%eax 80101177: 89 45 e0 mov %eax,-0x20(%ebp) 8010117a: 31 c0 xor %eax,%eax 8010117c: eb 2b jmp 801011a9 <balloc+0x79> 8010117e: 66 90 xchg %ax,%ax m = 1 << (bi % 8); 80101180: 89 c1 mov %eax,%ecx 80101182: bf 01 00 00 00 mov $0x1,%edi 80101187: 83 e1 07 and $0x7,%ecx 8010118a: d3 e7 shl %cl,%edi if((bp->data[bi/8] & m) == 0){ // Is block free? 8010118c: 89 c1 mov %eax,%ecx 8010118e: c1 f9 03 sar $0x3,%ecx m = 1 << (bi % 8); 80101191: 89 7d e4 mov %edi,-0x1c(%ebp) if((bp->data[bi/8] & m) == 0){ // Is block free? 80101194: 0f b6 7c 0b 5c movzbl 0x5c(%ebx,%ecx,1),%edi 80101199: 85 7d e4 test %edi,-0x1c(%ebp) 8010119c: 89 fa mov %edi,%edx 8010119e: 74 38 je 801011d8 <balloc+0xa8> for(bi = 0; bi < BPB && b + bi < sb.size; bi++){ 801011a0: 40 inc %eax 801011a1: 46 inc %esi 801011a2: 3d 00 10 00 00 cmp $0x1000,%eax 801011a7: 74 05 je 801011ae <balloc+0x7e> 801011a9: 39 75 e0 cmp %esi,-0x20(%ebp) 801011ac: 77 d2 ja 80101180 <balloc+0x50> brelse(bp); bzero(dev, b + bi); return b + bi; } } brelse(bp); 801011ae: 89 1c 24 mov %ebx,(%esp) 801011b1: e8 2a f0 ff ff call 801001e0 <brelse> for(b = 0; b < sb.size; b += BPB){ 801011b6: 81 45 dc 00 10 00 00 addl $0x1000,-0x24(%ebp) 801011bd: 8b 45 dc mov -0x24(%ebp),%eax 801011c0: 39 05 20 1a 11 80 cmp %eax,0x80111a20 801011c6: 77 89 ja 80101151 <balloc+0x21> } panic("balloc: out of blocks"); 801011c8: c7 04 24 df 80 10 80 movl $0x801080df,(%esp) 801011cf: e8 9c f1 ff ff call 80100370 <panic> 801011d4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi bp->data[bi/8] |= m; // Mark block in use. 801011d8: 0f b6 45 e4 movzbl -0x1c(%ebp),%eax 801011dc: 08 c2 or %al,%dl 801011de: 88 54 0b 5c mov %dl,0x5c(%ebx,%ecx,1) log_write(bp); 801011e2: 89 1c 24 mov %ebx,(%esp) 801011e5: e8 46 1c 00 00 call 80102e30 <log_write> brelse(bp); 801011ea: 89 1c 24 mov %ebx,(%esp) 801011ed: e8 ee ef ff ff call 801001e0 <brelse> bp = bread(dev, bno); 801011f2: 8b 45 d8 mov -0x28(%ebp),%eax 801011f5: 89 74 24 04 mov %esi,0x4(%esp) 801011f9: 89 04 24 mov %eax,(%esp) 801011fc: e8 cf ee ff ff call 801000d0 <bread> memset(bp->data, 0, BSIZE); 80101201: ba 00 02 00 00 mov $0x200,%edx 80101206: 31 c9 xor %ecx,%ecx 80101208: 89 54 24 08 mov %edx,0x8(%esp) 8010120c: 89 4c 24 04 mov %ecx,0x4(%esp) bp = bread(dev, bno); 80101210: 89 c3 mov %eax,%ebx memset(bp->data, 0, BSIZE); 80101212: 8d 40 5c lea 0x5c(%eax),%eax 80101215: 89 04 24 mov %eax,(%esp) 80101218: e8 c3 42 00 00 call 801054e0 <memset> log_write(bp); 8010121d: 89 1c 24 mov %ebx,(%esp) 80101220: e8 0b 1c 00 00 call 80102e30 <log_write> brelse(bp); 80101225: 89 1c 24 mov %ebx,(%esp) 80101228: e8 b3 ef ff ff call 801001e0 <brelse> } 8010122d: 83 c4 2c add $0x2c,%esp 80101230: 89 f0 mov %esi,%eax 80101232: 5b pop %ebx 80101233: 5e pop %esi 80101234: 5f pop %edi 80101235: 5d pop %ebp 80101236: c3 ret 80101237: 89 f6 mov %esi,%esi 80101239: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101240 <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) { 80101240: 55 push %ebp 80101241: 89 e5 mov %esp,%ebp 80101243: 57 push %edi 80101244: 89 c7 mov %eax,%edi 80101246: 56 push %esi struct inode *ip, *empty; acquire(&icache.lock); // Is the inode already cached? empty = 0; 80101247: 31 f6 xor %esi,%esi { 80101249: 53 push %ebx for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){ 8010124a: bb 74 1a 11 80 mov $0x80111a74,%ebx { 8010124f: 83 ec 2c sub $0x2c,%esp acquire(&icache.lock); 80101252: c7 04 24 40 1a 11 80 movl $0x80111a40,(%esp) { 80101259: 89 55 e4 mov %edx,-0x1c(%ebp) acquire(&icache.lock); 8010125c: e8 8f 41 00 00 call 801053f0 <acquire> for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){ 80101261: 8b 55 e4 mov -0x1c(%ebp),%edx 80101264: eb 18 jmp 8010127e <iget+0x3e> 80101266: 8d 76 00 lea 0x0(%esi),%esi 80101269: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101270: 81 c3 90 00 00 00 add $0x90,%ebx 80101276: 81 fb 94 36 11 80 cmp $0x80113694,%ebx 8010127c: 73 22 jae 801012a0 <iget+0x60> if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){ 8010127e: 8b 4b 08 mov 0x8(%ebx),%ecx 80101281: 85 c9 test %ecx,%ecx 80101283: 7e 04 jle 80101289 <iget+0x49> 80101285: 39 3b cmp %edi,(%ebx) 80101287: 74 47 je 801012d0 <iget+0x90> ip->ref++; release(&icache.lock); return ip; } if(empty == 0 && ip->ref == 0) // Remember empty slot. 80101289: 85 f6 test %esi,%esi 8010128b: 75 e3 jne 80101270 <iget+0x30> 8010128d: 85 c9 test %ecx,%ecx 8010128f: 0f 44 f3 cmove %ebx,%esi for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){ 80101292: 81 c3 90 00 00 00 add $0x90,%ebx 80101298: 81 fb 94 36 11 80 cmp $0x80113694,%ebx 8010129e: 72 de jb 8010127e <iget+0x3e> empty = ip; } // Recycle an inode cache entry. if(empty == 0) 801012a0: 85 f6 test %esi,%esi 801012a2: 74 4d je 801012f1 <iget+0xb1> panic("iget: no inodes"); ip = empty; ip->dev = dev; 801012a4: 89 3e mov %edi,(%esi) ip->inum = inum; 801012a6: 89 56 04 mov %edx,0x4(%esi) ip->ref = 1; 801012a9: c7 46 08 01 00 00 00 movl $0x1,0x8(%esi) ip->valid = 0; 801012b0: c7 46 4c 00 00 00 00 movl $0x0,0x4c(%esi) release(&icache.lock); 801012b7: c7 04 24 40 1a 11 80 movl $0x80111a40,(%esp) 801012be: e8 cd 41 00 00 call 80105490 <release> return ip; } 801012c3: 83 c4 2c add $0x2c,%esp 801012c6: 89 f0 mov %esi,%eax 801012c8: 5b pop %ebx 801012c9: 5e pop %esi 801012ca: 5f pop %edi 801012cb: 5d pop %ebp 801012cc: c3 ret 801012cd: 8d 76 00 lea 0x0(%esi),%esi if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){ 801012d0: 39 53 04 cmp %edx,0x4(%ebx) 801012d3: 75 b4 jne 80101289 <iget+0x49> ip->ref++; 801012d5: 41 inc %ecx return ip; 801012d6: 89 de mov %ebx,%esi release(&icache.lock); 801012d8: c7 04 24 40 1a 11 80 movl $0x80111a40,(%esp) ip->ref++; 801012df: 89 4b 08 mov %ecx,0x8(%ebx) release(&icache.lock); 801012e2: e8 a9 41 00 00 call 80105490 <release> } 801012e7: 83 c4 2c add $0x2c,%esp 801012ea: 89 f0 mov %esi,%eax 801012ec: 5b pop %ebx 801012ed: 5e pop %esi 801012ee: 5f pop %edi 801012ef: 5d pop %ebp 801012f0: c3 ret panic("iget: no inodes"); 801012f1: c7 04 24 f5 80 10 80 movl $0x801080f5,(%esp) 801012f8: e8 73 f0 ff ff call 80100370 <panic> 801012fd: 8d 76 00 lea 0x0(%esi),%esi 80101300 <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) { 80101300: 55 push %ebp 80101301: 89 e5 mov %esp,%ebp 80101303: 83 ec 38 sub $0x38,%esp uint addr, *a; struct buf *bp; if(bn < NDIRECT){ 80101306: 83 fa 0b cmp $0xb,%edx { 80101309: 89 75 f8 mov %esi,-0x8(%ebp) 8010130c: 89 c6 mov %eax,%esi 8010130e: 89 5d f4 mov %ebx,-0xc(%ebp) 80101311: 89 7d fc mov %edi,-0x4(%ebp) if(bn < NDIRECT){ 80101314: 77 1a ja 80101330 <bmap+0x30> 80101316: 8d 3c 90 lea (%eax,%edx,4),%edi if((addr = ip->addrs[bn]) == 0) 80101319: 8b 5f 5c mov 0x5c(%edi),%ebx 8010131c: 85 db test %ebx,%ebx 8010131e: 74 70 je 80101390 <bmap+0x90> brelse(bp); return addr; } panic("bmap: out of range"); } 80101320: 89 d8 mov %ebx,%eax 80101322: 8b 75 f8 mov -0x8(%ebp),%esi 80101325: 8b 5d f4 mov -0xc(%ebp),%ebx 80101328: 8b 7d fc mov -0x4(%ebp),%edi 8010132b: 89 ec mov %ebp,%esp 8010132d: 5d pop %ebp 8010132e: c3 ret 8010132f: 90 nop bn -= NDIRECT; 80101330: 8d 5a f4 lea -0xc(%edx),%ebx if(bn < NINDIRECT){ 80101333: 83 fb 7f cmp $0x7f,%ebx 80101336: 0f 87 85 00 00 00 ja 801013c1 <bmap+0xc1> if((addr = ip->addrs[NDIRECT]) == 0) 8010133c: 8b 90 8c 00 00 00 mov 0x8c(%eax),%edx 80101342: 8b 00 mov (%eax),%eax 80101344: 85 d2 test %edx,%edx 80101346: 74 68 je 801013b0 <bmap+0xb0> bp = bread(ip->dev, addr); 80101348: 89 54 24 04 mov %edx,0x4(%esp) 8010134c: 89 04 24 mov %eax,(%esp) 8010134f: e8 7c ed ff ff call 801000d0 <bread> if((addr = a[bn]) == 0){ 80101354: 8d 54 98 5c lea 0x5c(%eax,%ebx,4),%edx bp = bread(ip->dev, addr); 80101358: 89 c7 mov %eax,%edi if((addr = a[bn]) == 0){ 8010135a: 8b 1a mov (%edx),%ebx 8010135c: 85 db test %ebx,%ebx 8010135e: 75 19 jne 80101379 <bmap+0x79> a[bn] = addr = balloc(ip->dev); 80101360: 8b 06 mov (%esi),%eax 80101362: 89 55 e4 mov %edx,-0x1c(%ebp) 80101365: e8 c6 fd ff ff call 80101130 <balloc> 8010136a: 8b 55 e4 mov -0x1c(%ebp),%edx 8010136d: 89 02 mov %eax,(%edx) 8010136f: 89 c3 mov %eax,%ebx log_write(bp); 80101371: 89 3c 24 mov %edi,(%esp) 80101374: e8 b7 1a 00 00 call 80102e30 <log_write> brelse(bp); 80101379: 89 3c 24 mov %edi,(%esp) 8010137c: e8 5f ee ff ff call 801001e0 <brelse> } 80101381: 89 d8 mov %ebx,%eax 80101383: 8b 75 f8 mov -0x8(%ebp),%esi 80101386: 8b 5d f4 mov -0xc(%ebp),%ebx 80101389: 8b 7d fc mov -0x4(%ebp),%edi 8010138c: 89 ec mov %ebp,%esp 8010138e: 5d pop %ebp 8010138f: c3 ret ip->addrs[bn] = addr = balloc(ip->dev); 80101390: 8b 00 mov (%eax),%eax 80101392: e8 99 fd ff ff call 80101130 <balloc> 80101397: 89 47 5c mov %eax,0x5c(%edi) 8010139a: 89 c3 mov %eax,%ebx } 8010139c: 89 d8 mov %ebx,%eax 8010139e: 8b 75 f8 mov -0x8(%ebp),%esi 801013a1: 8b 5d f4 mov -0xc(%ebp),%ebx 801013a4: 8b 7d fc mov -0x4(%ebp),%edi 801013a7: 89 ec mov %ebp,%esp 801013a9: 5d pop %ebp 801013aa: c3 ret 801013ab: 90 nop 801013ac: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi ip->addrs[NDIRECT] = addr = balloc(ip->dev); 801013b0: e8 7b fd ff ff call 80101130 <balloc> 801013b5: 89 c2 mov %eax,%edx 801013b7: 89 86 8c 00 00 00 mov %eax,0x8c(%esi) 801013bd: 8b 06 mov (%esi),%eax 801013bf: eb 87 jmp 80101348 <bmap+0x48> panic("bmap: out of range"); 801013c1: c7 04 24 05 81 10 80 movl $0x80108105,(%esp) 801013c8: e8 a3 ef ff ff call 80100370 <panic> 801013cd: 8d 76 00 lea 0x0(%esi),%esi 801013d0 <readsb>: { 801013d0: 55 push %ebp bp = bread(dev, 1); 801013d1: b8 01 00 00 00 mov $0x1,%eax { 801013d6: 89 e5 mov %esp,%ebp 801013d8: 83 ec 18 sub $0x18,%esp bp = bread(dev, 1); 801013db: 89 44 24 04 mov %eax,0x4(%esp) 801013df: 8b 45 08 mov 0x8(%ebp),%eax { 801013e2: 89 5d f8 mov %ebx,-0x8(%ebp) 801013e5: 89 75 fc mov %esi,-0x4(%ebp) 801013e8: 8b 75 0c mov 0xc(%ebp),%esi bp = bread(dev, 1); 801013eb: 89 04 24 mov %eax,(%esp) 801013ee: e8 dd ec ff ff call 801000d0 <bread> memmove(sb, bp->data, sizeof(*sb)); 801013f3: ba 1c 00 00 00 mov $0x1c,%edx 801013f8: 89 34 24 mov %esi,(%esp) 801013fb: 89 54 24 08 mov %edx,0x8(%esp) bp = bread(dev, 1); 801013ff: 89 c3 mov %eax,%ebx memmove(sb, bp->data, sizeof(*sb)); 80101401: 8d 40 5c lea 0x5c(%eax),%eax 80101404: 89 44 24 04 mov %eax,0x4(%esp) 80101408: e8 93 41 00 00 call 801055a0 <memmove> } 8010140d: 8b 75 fc mov -0x4(%ebp),%esi brelse(bp); 80101410: 89 5d 08 mov %ebx,0x8(%ebp) } 80101413: 8b 5d f8 mov -0x8(%ebp),%ebx 80101416: 89 ec mov %ebp,%esp 80101418: 5d pop %ebp brelse(bp); 80101419: e9 c2 ed ff ff jmp 801001e0 <brelse> 8010141e: 66 90 xchg %ax,%ax 80101420 <bfree>: { 80101420: 55 push %ebp 80101421: 89 e5 mov %esp,%ebp 80101423: 56 push %esi 80101424: 89 c6 mov %eax,%esi 80101426: 53 push %ebx 80101427: 89 d3 mov %edx,%ebx 80101429: 83 ec 10 sub $0x10,%esp readsb(dev, &sb); 8010142c: ba 20 1a 11 80 mov $0x80111a20,%edx 80101431: 89 54 24 04 mov %edx,0x4(%esp) 80101435: 89 04 24 mov %eax,(%esp) 80101438: e8 93 ff ff ff call 801013d0 <readsb> bp = bread(dev, BBLOCK(b, sb)); 8010143d: 8b 0d 38 1a 11 80 mov 0x80111a38,%ecx 80101443: 89 da mov %ebx,%edx 80101445: c1 ea 0c shr $0xc,%edx 80101448: 89 34 24 mov %esi,(%esp) 8010144b: 01 ca add %ecx,%edx 8010144d: 89 54 24 04 mov %edx,0x4(%esp) 80101451: e8 7a ec ff ff call 801000d0 <bread> m = 1 << (bi % 8); 80101456: 89 d9 mov %ebx,%ecx if((bp->data[bi/8] & m) == 0) 80101458: c1 fb 03 sar $0x3,%ebx m = 1 << (bi % 8); 8010145b: 83 e1 07 and $0x7,%ecx if((bp->data[bi/8] & m) == 0) 8010145e: 81 e3 ff 01 00 00 and $0x1ff,%ebx bp = bread(dev, BBLOCK(b, sb)); 80101464: 89 c6 mov %eax,%esi m = 1 << (bi % 8); 80101466: b8 01 00 00 00 mov $0x1,%eax if((bp->data[bi/8] & m) == 0) 8010146b: 0f b6 54 1e 5c movzbl 0x5c(%esi,%ebx,1),%edx m = 1 << (bi % 8); 80101470: d3 e0 shl %cl,%eax 80101472: 89 c1 mov %eax,%ecx if((bp->data[bi/8] & m) == 0) 80101474: 85 c2 test %eax,%edx 80101476: 74 1f je 80101497 <bfree+0x77> bp->data[bi/8] &= ~m; 80101478: f6 d1 not %cl 8010147a: 20 d1 and %dl,%cl 8010147c: 88 4c 1e 5c mov %cl,0x5c(%esi,%ebx,1) log_write(bp); 80101480: 89 34 24 mov %esi,(%esp) 80101483: e8 a8 19 00 00 call 80102e30 <log_write> brelse(bp); 80101488: 89 34 24 mov %esi,(%esp) 8010148b: e8 50 ed ff ff call 801001e0 <brelse> } 80101490: 83 c4 10 add $0x10,%esp 80101493: 5b pop %ebx 80101494: 5e pop %esi 80101495: 5d pop %ebp 80101496: c3 ret panic("freeing free block"); 80101497: c7 04 24 18 81 10 80 movl $0x80108118,(%esp) 8010149e: e8 cd ee ff ff call 80100370 <panic> 801014a3: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801014a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801014b0 <iinit>: { 801014b0: 55 push %ebp initlock(&icache.lock, "icache"); 801014b1: b9 2b 81 10 80 mov $0x8010812b,%ecx { 801014b6: 89 e5 mov %esp,%ebp 801014b8: 53 push %ebx 801014b9: bb 80 1a 11 80 mov $0x80111a80,%ebx 801014be: 83 ec 24 sub $0x24,%esp initlock(&icache.lock, "icache"); 801014c1: 89 4c 24 04 mov %ecx,0x4(%esp) 801014c5: c7 04 24 40 1a 11 80 movl $0x80111a40,(%esp) 801014cc: e8 cf 3d 00 00 call 801052a0 <initlock> 801014d1: eb 0d jmp 801014e0 <iinit+0x30> 801014d3: 90 nop 801014d4: 90 nop 801014d5: 90 nop 801014d6: 90 nop 801014d7: 90 nop 801014d8: 90 nop 801014d9: 90 nop 801014da: 90 nop 801014db: 90 nop 801014dc: 90 nop 801014dd: 90 nop 801014de: 90 nop 801014df: 90 nop initsleeplock(&icache.inode[i].lock, "inode"); 801014e0: ba 32 81 10 80 mov $0x80108132,%edx 801014e5: 89 1c 24 mov %ebx,(%esp) 801014e8: 81 c3 90 00 00 00 add $0x90,%ebx 801014ee: 89 54 24 04 mov %edx,0x4(%esp) 801014f2: e8 79 3c 00 00 call 80105170 <initsleeplock> for(i = 0; i < NINODE; i++) { 801014f7: 81 fb a0 36 11 80 cmp $0x801136a0,%ebx 801014fd: 75 e1 jne 801014e0 <iinit+0x30> readsb(dev, &sb); 801014ff: b8 20 1a 11 80 mov $0x80111a20,%eax 80101504: 89 44 24 04 mov %eax,0x4(%esp) 80101508: 8b 45 08 mov 0x8(%ebp),%eax 8010150b: 89 04 24 mov %eax,(%esp) 8010150e: e8 bd fe ff ff call 801013d0 <readsb> cprintf("sb: size %d nblocks %d ninodes %d nlog %d logstart %d\ 80101513: a1 38 1a 11 80 mov 0x80111a38,%eax 80101518: c7 04 24 98 81 10 80 movl $0x80108198,(%esp) 8010151f: 89 44 24 1c mov %eax,0x1c(%esp) 80101523: a1 34 1a 11 80 mov 0x80111a34,%eax 80101528: 89 44 24 18 mov %eax,0x18(%esp) 8010152c: a1 30 1a 11 80 mov 0x80111a30,%eax 80101531: 89 44 24 14 mov %eax,0x14(%esp) 80101535: a1 2c 1a 11 80 mov 0x80111a2c,%eax 8010153a: 89 44 24 10 mov %eax,0x10(%esp) 8010153e: a1 28 1a 11 80 mov 0x80111a28,%eax 80101543: 89 44 24 0c mov %eax,0xc(%esp) 80101547: a1 24 1a 11 80 mov 0x80111a24,%eax 8010154c: 89 44 24 08 mov %eax,0x8(%esp) 80101550: a1 20 1a 11 80 mov 0x80111a20,%eax 80101555: 89 44 24 04 mov %eax,0x4(%esp) 80101559: e8 f2 f0 ff ff call 80100650 <cprintf> } 8010155e: 83 c4 24 add $0x24,%esp 80101561: 5b pop %ebx 80101562: 5d pop %ebp 80101563: c3 ret 80101564: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010156a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80101570 <ialloc>: { 80101570: 55 push %ebp 80101571: 89 e5 mov %esp,%ebp 80101573: 57 push %edi 80101574: 56 push %esi 80101575: 53 push %ebx 80101576: 83 ec 2c sub $0x2c,%esp 80101579: 0f bf 45 0c movswl 0xc(%ebp),%eax for(inum = 1; inum < sb.ninodes; inum++){ 8010157d: 83 3d 28 1a 11 80 01 cmpl $0x1,0x80111a28 { 80101584: 8b 75 08 mov 0x8(%ebp),%esi 80101587: 89 45 e4 mov %eax,-0x1c(%ebp) for(inum = 1; inum < sb.ninodes; inum++){ 8010158a: 0f 86 91 00 00 00 jbe 80101621 <ialloc+0xb1> 80101590: bb 01 00 00 00 mov $0x1,%ebx 80101595: eb 1a jmp 801015b1 <ialloc+0x41> 80101597: 89 f6 mov %esi,%esi 80101599: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi brelse(bp); 801015a0: 89 3c 24 mov %edi,(%esp) for(inum = 1; inum < sb.ninodes; inum++){ 801015a3: 43 inc %ebx brelse(bp); 801015a4: e8 37 ec ff ff call 801001e0 <brelse> for(inum = 1; inum < sb.ninodes; inum++){ 801015a9: 39 1d 28 1a 11 80 cmp %ebx,0x80111a28 801015af: 76 70 jbe 80101621 <ialloc+0xb1> bp = bread(dev, IBLOCK(inum, sb)); 801015b1: 8b 0d 34 1a 11 80 mov 0x80111a34,%ecx 801015b7: 89 d8 mov %ebx,%eax 801015b9: c1 e8 03 shr $0x3,%eax 801015bc: 89 34 24 mov %esi,(%esp) 801015bf: 01 c8 add %ecx,%eax 801015c1: 89 44 24 04 mov %eax,0x4(%esp) 801015c5: e8 06 eb ff ff call 801000d0 <bread> 801015ca: 89 c7 mov %eax,%edi dip = (struct dinode*)bp->data + inum%IPB; 801015cc: 89 d8 mov %ebx,%eax 801015ce: 83 e0 07 and $0x7,%eax 801015d1: c1 e0 06 shl $0x6,%eax 801015d4: 8d 4c 07 5c lea 0x5c(%edi,%eax,1),%ecx if(dip->type == 0){ // a free inode 801015d8: 66 83 39 00 cmpw $0x0,(%ecx) 801015dc: 75 c2 jne 801015a0 <ialloc+0x30> memset(dip, 0, sizeof(*dip)); 801015de: 31 d2 xor %edx,%edx 801015e0: b8 40 00 00 00 mov $0x40,%eax 801015e5: 89 54 24 04 mov %edx,0x4(%esp) 801015e9: 89 0c 24 mov %ecx,(%esp) 801015ec: 89 44 24 08 mov %eax,0x8(%esp) 801015f0: 89 4d e0 mov %ecx,-0x20(%ebp) 801015f3: e8 e8 3e 00 00 call 801054e0 <memset> dip->type = type; 801015f8: 8b 45 e4 mov -0x1c(%ebp),%eax 801015fb: 8b 4d e0 mov -0x20(%ebp),%ecx 801015fe: 66 89 01 mov %ax,(%ecx) log_write(bp); // mark it allocated on the disk 80101601: 89 3c 24 mov %edi,(%esp) 80101604: e8 27 18 00 00 call 80102e30 <log_write> brelse(bp); 80101609: 89 3c 24 mov %edi,(%esp) 8010160c: e8 cf eb ff ff call 801001e0 <brelse> } 80101611: 83 c4 2c add $0x2c,%esp return iget(dev, inum); 80101614: 89 da mov %ebx,%edx } 80101616: 5b pop %ebx return iget(dev, inum); 80101617: 89 f0 mov %esi,%eax } 80101619: 5e pop %esi 8010161a: 5f pop %edi 8010161b: 5d pop %ebp return iget(dev, inum); 8010161c: e9 1f fc ff ff jmp 80101240 <iget> panic("ialloc: no inodes"); 80101621: c7 04 24 38 81 10 80 movl $0x80108138,(%esp) 80101628: e8 43 ed ff ff call 80100370 <panic> 8010162d: 8d 76 00 lea 0x0(%esi),%esi 80101630 <iupdate>: { 80101630: 55 push %ebp 80101631: 89 e5 mov %esp,%ebp 80101633: 56 push %esi 80101634: 53 push %ebx 80101635: 83 ec 10 sub $0x10,%esp 80101638: 8b 5d 08 mov 0x8(%ebp),%ebx bp = bread(ip->dev, IBLOCK(ip->inum, sb)); 8010163b: 8b 15 34 1a 11 80 mov 0x80111a34,%edx 80101641: 8b 43 04 mov 0x4(%ebx),%eax memmove(dip->addrs, ip->addrs, sizeof(ip->addrs)); 80101644: 83 c3 5c add $0x5c,%ebx bp = bread(ip->dev, IBLOCK(ip->inum, sb)); 80101647: c1 e8 03 shr $0x3,%eax 8010164a: 01 d0 add %edx,%eax 8010164c: 89 44 24 04 mov %eax,0x4(%esp) 80101650: 8b 43 a4 mov -0x5c(%ebx),%eax 80101653: 89 04 24 mov %eax,(%esp) 80101656: e8 75 ea ff ff call 801000d0 <bread> dip->type = ip->type; 8010165b: 0f bf 53 f4 movswl -0xc(%ebx),%edx memmove(dip->addrs, ip->addrs, sizeof(ip->addrs)); 8010165f: b9 34 00 00 00 mov $0x34,%ecx bp = bread(ip->dev, IBLOCK(ip->inum, sb)); 80101664: 89 c6 mov %eax,%esi dip = (struct dinode*)bp->data + ip->inum%IPB; 80101666: 8b 43 a8 mov -0x58(%ebx),%eax 80101669: 83 e0 07 and $0x7,%eax 8010166c: c1 e0 06 shl $0x6,%eax 8010166f: 8d 44 06 5c lea 0x5c(%esi,%eax,1),%eax dip->type = ip->type; 80101673: 66 89 10 mov %dx,(%eax) memmove(dip->addrs, ip->addrs, sizeof(ip->addrs)); 80101676: 83 c0 0c add $0xc,%eax dip->major = ip->major; 80101679: 0f bf 53 f6 movswl -0xa(%ebx),%edx 8010167d: 66 89 50 f6 mov %dx,-0xa(%eax) dip->minor = ip->minor; 80101681: 0f bf 53 f8 movswl -0x8(%ebx),%edx 80101685: 66 89 50 f8 mov %dx,-0x8(%eax) dip->nlink = ip->nlink; 80101689: 0f bf 53 fa movswl -0x6(%ebx),%edx 8010168d: 66 89 50 fa mov %dx,-0x6(%eax) dip->size = ip->size; 80101691: 8b 53 fc mov -0x4(%ebx),%edx 80101694: 89 50 fc mov %edx,-0x4(%eax) memmove(dip->addrs, ip->addrs, sizeof(ip->addrs)); 80101697: 89 4c 24 08 mov %ecx,0x8(%esp) 8010169b: 89 5c 24 04 mov %ebx,0x4(%esp) 8010169f: 89 04 24 mov %eax,(%esp) 801016a2: e8 f9 3e 00 00 call 801055a0 <memmove> log_write(bp); 801016a7: 89 34 24 mov %esi,(%esp) 801016aa: e8 81 17 00 00 call 80102e30 <log_write> brelse(bp); 801016af: 89 75 08 mov %esi,0x8(%ebp) } 801016b2: 83 c4 10 add $0x10,%esp 801016b5: 5b pop %ebx 801016b6: 5e pop %esi 801016b7: 5d pop %ebp brelse(bp); 801016b8: e9 23 eb ff ff jmp 801001e0 <brelse> 801016bd: 8d 76 00 lea 0x0(%esi),%esi 801016c0 <idup>: { 801016c0: 55 push %ebp 801016c1: 89 e5 mov %esp,%ebp 801016c3: 53 push %ebx 801016c4: 83 ec 14 sub $0x14,%esp 801016c7: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&icache.lock); 801016ca: c7 04 24 40 1a 11 80 movl $0x80111a40,(%esp) 801016d1: e8 1a 3d 00 00 call 801053f0 <acquire> ip->ref++; 801016d6: ff 43 08 incl 0x8(%ebx) release(&icache.lock); 801016d9: c7 04 24 40 1a 11 80 movl $0x80111a40,(%esp) 801016e0: e8 ab 3d 00 00 call 80105490 <release> } 801016e5: 83 c4 14 add $0x14,%esp 801016e8: 89 d8 mov %ebx,%eax 801016ea: 5b pop %ebx 801016eb: 5d pop %ebp 801016ec: c3 ret 801016ed: 8d 76 00 lea 0x0(%esi),%esi 801016f0 <ilock>: { 801016f0: 55 push %ebp 801016f1: 89 e5 mov %esp,%ebp 801016f3: 56 push %esi 801016f4: 53 push %ebx 801016f5: 83 ec 10 sub $0x10,%esp 801016f8: 8b 5d 08 mov 0x8(%ebp),%ebx if(ip == 0 || ip->ref < 1) 801016fb: 85 db test %ebx,%ebx 801016fd: 0f 84 be 00 00 00 je 801017c1 <ilock+0xd1> 80101703: 8b 43 08 mov 0x8(%ebx),%eax 80101706: 85 c0 test %eax,%eax 80101708: 0f 8e b3 00 00 00 jle 801017c1 <ilock+0xd1> acquiresleep(&ip->lock); 8010170e: 8d 43 0c lea 0xc(%ebx),%eax 80101711: 89 04 24 mov %eax,(%esp) 80101714: e8 97 3a 00 00 call 801051b0 <acquiresleep> if(ip->valid == 0){ 80101719: 8b 73 4c mov 0x4c(%ebx),%esi 8010171c: 85 f6 test %esi,%esi 8010171e: 74 10 je 80101730 <ilock+0x40> } 80101720: 83 c4 10 add $0x10,%esp 80101723: 5b pop %ebx 80101724: 5e pop %esi 80101725: 5d pop %ebp 80101726: c3 ret 80101727: 89 f6 mov %esi,%esi 80101729: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi bp = bread(ip->dev, IBLOCK(ip->inum, sb)); 80101730: 8b 43 04 mov 0x4(%ebx),%eax 80101733: 8b 15 34 1a 11 80 mov 0x80111a34,%edx 80101739: c1 e8 03 shr $0x3,%eax 8010173c: 01 d0 add %edx,%eax 8010173e: 89 44 24 04 mov %eax,0x4(%esp) 80101742: 8b 03 mov (%ebx),%eax 80101744: 89 04 24 mov %eax,(%esp) 80101747: e8 84 e9 ff ff call 801000d0 <bread> memmove(ip->addrs, dip->addrs, sizeof(ip->addrs)); 8010174c: b9 34 00 00 00 mov $0x34,%ecx bp = bread(ip->dev, IBLOCK(ip->inum, sb)); 80101751: 89 c6 mov %eax,%esi dip = (struct dinode*)bp->data + ip->inum%IPB; 80101753: 8b 43 04 mov 0x4(%ebx),%eax 80101756: 83 e0 07 and $0x7,%eax 80101759: c1 e0 06 shl $0x6,%eax 8010175c: 8d 44 06 5c lea 0x5c(%esi,%eax,1),%eax ip->type = dip->type; 80101760: 0f bf 10 movswl (%eax),%edx memmove(ip->addrs, dip->addrs, sizeof(ip->addrs)); 80101763: 83 c0 0c add $0xc,%eax ip->type = dip->type; 80101766: 66 89 53 50 mov %dx,0x50(%ebx) ip->major = dip->major; 8010176a: 0f bf 50 f6 movswl -0xa(%eax),%edx 8010176e: 66 89 53 52 mov %dx,0x52(%ebx) ip->minor = dip->minor; 80101772: 0f bf 50 f8 movswl -0x8(%eax),%edx 80101776: 66 89 53 54 mov %dx,0x54(%ebx) ip->nlink = dip->nlink; 8010177a: 0f bf 50 fa movswl -0x6(%eax),%edx 8010177e: 66 89 53 56 mov %dx,0x56(%ebx) ip->size = dip->size; 80101782: 8b 50 fc mov -0x4(%eax),%edx 80101785: 89 53 58 mov %edx,0x58(%ebx) memmove(ip->addrs, dip->addrs, sizeof(ip->addrs)); 80101788: 89 44 24 04 mov %eax,0x4(%esp) 8010178c: 8d 43 5c lea 0x5c(%ebx),%eax 8010178f: 89 4c 24 08 mov %ecx,0x8(%esp) 80101793: 89 04 24 mov %eax,(%esp) 80101796: e8 05 3e 00 00 call 801055a0 <memmove> brelse(bp); 8010179b: 89 34 24 mov %esi,(%esp) 8010179e: e8 3d ea ff ff call 801001e0 <brelse> if(ip->type == 0) 801017a3: 66 83 7b 50 00 cmpw $0x0,0x50(%ebx) ip->valid = 1; 801017a8: c7 43 4c 01 00 00 00 movl $0x1,0x4c(%ebx) if(ip->type == 0) 801017af: 0f 85 6b ff ff ff jne 80101720 <ilock+0x30> panic("ilock: no type"); 801017b5: c7 04 24 50 81 10 80 movl $0x80108150,(%esp) 801017bc: e8 af eb ff ff call 80100370 <panic> panic("ilock"); 801017c1: c7 04 24 4a 81 10 80 movl $0x8010814a,(%esp) 801017c8: e8 a3 eb ff ff call 80100370 <panic> 801017cd: 8d 76 00 lea 0x0(%esi),%esi 801017d0 <iunlock>: { 801017d0: 55 push %ebp 801017d1: 89 e5 mov %esp,%ebp 801017d3: 83 ec 18 sub $0x18,%esp 801017d6: 89 5d f8 mov %ebx,-0x8(%ebp) 801017d9: 8b 5d 08 mov 0x8(%ebp),%ebx 801017dc: 89 75 fc mov %esi,-0x4(%ebp) if(ip == 0 || !holdingsleep(&ip->lock) || ip->ref < 1) 801017df: 85 db test %ebx,%ebx 801017e1: 74 27 je 8010180a <iunlock+0x3a> 801017e3: 8d 73 0c lea 0xc(%ebx),%esi 801017e6: 89 34 24 mov %esi,(%esp) 801017e9: e8 62 3a 00 00 call 80105250 <holdingsleep> 801017ee: 85 c0 test %eax,%eax 801017f0: 74 18 je 8010180a <iunlock+0x3a> 801017f2: 8b 43 08 mov 0x8(%ebx),%eax 801017f5: 85 c0 test %eax,%eax 801017f7: 7e 11 jle 8010180a <iunlock+0x3a> releasesleep(&ip->lock); 801017f9: 89 75 08 mov %esi,0x8(%ebp) } 801017fc: 8b 5d f8 mov -0x8(%ebp),%ebx 801017ff: 8b 75 fc mov -0x4(%ebp),%esi 80101802: 89 ec mov %ebp,%esp 80101804: 5d pop %ebp releasesleep(&ip->lock); 80101805: e9 06 3a 00 00 jmp 80105210 <releasesleep> panic("iunlock"); 8010180a: c7 04 24 5f 81 10 80 movl $0x8010815f,(%esp) 80101811: e8 5a eb ff ff call 80100370 <panic> 80101816: 8d 76 00 lea 0x0(%esi),%esi 80101819: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101820 <iput>: { 80101820: 55 push %ebp 80101821: 89 e5 mov %esp,%ebp 80101823: 83 ec 38 sub $0x38,%esp 80101826: 89 5d f4 mov %ebx,-0xc(%ebp) 80101829: 8b 5d 08 mov 0x8(%ebp),%ebx 8010182c: 89 7d fc mov %edi,-0x4(%ebp) 8010182f: 89 75 f8 mov %esi,-0x8(%ebp) acquiresleep(&ip->lock); 80101832: 8d 7b 0c lea 0xc(%ebx),%edi 80101835: 89 3c 24 mov %edi,(%esp) 80101838: e8 73 39 00 00 call 801051b0 <acquiresleep> if(ip->valid && ip->nlink == 0){ 8010183d: 8b 53 4c mov 0x4c(%ebx),%edx 80101840: 85 d2 test %edx,%edx 80101842: 74 07 je 8010184b <iput+0x2b> 80101844: 66 83 7b 56 00 cmpw $0x0,0x56(%ebx) 80101849: 74 35 je 80101880 <iput+0x60> releasesleep(&ip->lock); 8010184b: 89 3c 24 mov %edi,(%esp) 8010184e: e8 bd 39 00 00 call 80105210 <releasesleep> acquire(&icache.lock); 80101853: c7 04 24 40 1a 11 80 movl $0x80111a40,(%esp) 8010185a: e8 91 3b 00 00 call 801053f0 <acquire> ip->ref--; 8010185f: ff 4b 08 decl 0x8(%ebx) release(&icache.lock); 80101862: c7 45 08 40 1a 11 80 movl $0x80111a40,0x8(%ebp) } 80101869: 8b 5d f4 mov -0xc(%ebp),%ebx 8010186c: 8b 75 f8 mov -0x8(%ebp),%esi 8010186f: 8b 7d fc mov -0x4(%ebp),%edi 80101872: 89 ec mov %ebp,%esp 80101874: 5d pop %ebp release(&icache.lock); 80101875: e9 16 3c 00 00 jmp 80105490 <release> 8010187a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi acquire(&icache.lock); 80101880: c7 04 24 40 1a 11 80 movl $0x80111a40,(%esp) 80101887: e8 64 3b 00 00 call 801053f0 <acquire> int r = ip->ref; 8010188c: 8b 73 08 mov 0x8(%ebx),%esi release(&icache.lock); 8010188f: c7 04 24 40 1a 11 80 movl $0x80111a40,(%esp) 80101896: e8 f5 3b 00 00 call 80105490 <release> if(r == 1){ 8010189b: 4e dec %esi 8010189c: 75 ad jne 8010184b <iput+0x2b> 8010189e: 8d 8b 8c 00 00 00 lea 0x8c(%ebx),%ecx 801018a4: 89 7d e4 mov %edi,-0x1c(%ebp) 801018a7: 8d 73 5c lea 0x5c(%ebx),%esi 801018aa: 89 cf mov %ecx,%edi 801018ac: eb 09 jmp 801018b7 <iput+0x97> 801018ae: 66 90 xchg %ax,%ax 801018b0: 83 c6 04 add $0x4,%esi { int i, j; struct buf *bp; uint *a; for(i = 0; i < NDIRECT; i++){ 801018b3: 39 fe cmp %edi,%esi 801018b5: 74 19 je 801018d0 <iput+0xb0> if(ip->addrs[i]){ 801018b7: 8b 16 mov (%esi),%edx 801018b9: 85 d2 test %edx,%edx 801018bb: 74 f3 je 801018b0 <iput+0x90> bfree(ip->dev, ip->addrs[i]); 801018bd: 8b 03 mov (%ebx),%eax 801018bf: e8 5c fb ff ff call 80101420 <bfree> ip->addrs[i] = 0; 801018c4: c7 06 00 00 00 00 movl $0x0,(%esi) 801018ca: eb e4 jmp 801018b0 <iput+0x90> 801018cc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi } } if(ip->addrs[NDIRECT]){ 801018d0: 8b 83 8c 00 00 00 mov 0x8c(%ebx),%eax 801018d6: 8b 7d e4 mov -0x1c(%ebp),%edi 801018d9: 85 c0 test %eax,%eax 801018db: 75 33 jne 80101910 <iput+0xf0> brelse(bp); bfree(ip->dev, ip->addrs[NDIRECT]); ip->addrs[NDIRECT] = 0; } ip->size = 0; 801018dd: c7 43 58 00 00 00 00 movl $0x0,0x58(%ebx) iupdate(ip); 801018e4: 89 1c 24 mov %ebx,(%esp) 801018e7: e8 44 fd ff ff call 80101630 <iupdate> ip->type = 0; 801018ec: 66 c7 43 50 00 00 movw $0x0,0x50(%ebx) iupdate(ip); 801018f2: 89 1c 24 mov %ebx,(%esp) 801018f5: e8 36 fd ff ff call 80101630 <iupdate> ip->valid = 0; 801018fa: c7 43 4c 00 00 00 00 movl $0x0,0x4c(%ebx) 80101901: e9 45 ff ff ff jmp 8010184b <iput+0x2b> 80101906: 8d 76 00 lea 0x0(%esi),%esi 80101909: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi bp = bread(ip->dev, ip->addrs[NDIRECT]); 80101910: 89 44 24 04 mov %eax,0x4(%esp) 80101914: 8b 03 mov (%ebx),%eax 80101916: 89 04 24 mov %eax,(%esp) 80101919: e8 b2 e7 ff ff call 801000d0 <bread> 8010191e: 89 7d e0 mov %edi,-0x20(%ebp) 80101921: 8d 88 5c 02 00 00 lea 0x25c(%eax),%ecx 80101927: 89 45 e4 mov %eax,-0x1c(%ebp) a = (uint*)bp->data; 8010192a: 8d 70 5c lea 0x5c(%eax),%esi 8010192d: 89 cf mov %ecx,%edi 8010192f: eb 0e jmp 8010193f <iput+0x11f> 80101931: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80101938: 83 c6 04 add $0x4,%esi for(j = 0; j < NINDIRECT; j++){ 8010193b: 39 fe cmp %edi,%esi 8010193d: 74 0f je 8010194e <iput+0x12e> if(a[j]) 8010193f: 8b 16 mov (%esi),%edx 80101941: 85 d2 test %edx,%edx 80101943: 74 f3 je 80101938 <iput+0x118> bfree(ip->dev, a[j]); 80101945: 8b 03 mov (%ebx),%eax 80101947: e8 d4 fa ff ff call 80101420 <bfree> 8010194c: eb ea jmp 80101938 <iput+0x118> brelse(bp); 8010194e: 8b 45 e4 mov -0x1c(%ebp),%eax 80101951: 8b 7d e0 mov -0x20(%ebp),%edi 80101954: 89 04 24 mov %eax,(%esp) 80101957: e8 84 e8 ff ff call 801001e0 <brelse> bfree(ip->dev, ip->addrs[NDIRECT]); 8010195c: 8b 03 mov (%ebx),%eax 8010195e: 8b 93 8c 00 00 00 mov 0x8c(%ebx),%edx 80101964: e8 b7 fa ff ff call 80101420 <bfree> ip->addrs[NDIRECT] = 0; 80101969: 31 c0 xor %eax,%eax 8010196b: 89 83 8c 00 00 00 mov %eax,0x8c(%ebx) 80101971: e9 67 ff ff ff jmp 801018dd <iput+0xbd> 80101976: 8d 76 00 lea 0x0(%esi),%esi 80101979: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101980 <iunlockput>: { 80101980: 55 push %ebp 80101981: 89 e5 mov %esp,%ebp 80101983: 53 push %ebx 80101984: 83 ec 14 sub $0x14,%esp 80101987: 8b 5d 08 mov 0x8(%ebp),%ebx iunlock(ip); 8010198a: 89 1c 24 mov %ebx,(%esp) 8010198d: e8 3e fe ff ff call 801017d0 <iunlock> iput(ip); 80101992: 89 5d 08 mov %ebx,0x8(%ebp) } 80101995: 83 c4 14 add $0x14,%esp 80101998: 5b pop %ebx 80101999: 5d pop %ebp iput(ip); 8010199a: e9 81 fe ff ff jmp 80101820 <iput> 8010199f: 90 nop 801019a0 <stati>: // Copy stat information from inode. // Caller must hold ip->lock. void stati(struct inode *ip, struct stat *st) { 801019a0: 55 push %ebp 801019a1: 89 e5 mov %esp,%ebp 801019a3: 8b 55 08 mov 0x8(%ebp),%edx 801019a6: 8b 45 0c mov 0xc(%ebp),%eax st->dev = ip->dev; 801019a9: 8b 0a mov (%edx),%ecx 801019ab: 89 48 04 mov %ecx,0x4(%eax) st->ino = ip->inum; 801019ae: 8b 4a 04 mov 0x4(%edx),%ecx 801019b1: 89 48 08 mov %ecx,0x8(%eax) st->type = ip->type; 801019b4: 0f bf 4a 50 movswl 0x50(%edx),%ecx 801019b8: 66 89 08 mov %cx,(%eax) st->nlink = ip->nlink; 801019bb: 0f bf 4a 56 movswl 0x56(%edx),%ecx 801019bf: 66 89 48 0c mov %cx,0xc(%eax) st->size = ip->size; 801019c3: 8b 52 58 mov 0x58(%edx),%edx 801019c6: 89 50 10 mov %edx,0x10(%eax) } 801019c9: 5d pop %ebp 801019ca: c3 ret 801019cb: 90 nop 801019cc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801019d0 <readi>: //PAGEBREAK! // Read data from inode. // Caller must hold ip->lock. int readi(struct inode *ip, char *dst, uint off, uint n) { 801019d0: 55 push %ebp 801019d1: 89 e5 mov %esp,%ebp 801019d3: 57 push %edi 801019d4: 56 push %esi 801019d5: 53 push %ebx 801019d6: 83 ec 3c sub $0x3c,%esp 801019d9: 8b 45 0c mov 0xc(%ebp),%eax 801019dc: 8b 7d 08 mov 0x8(%ebp),%edi 801019df: 8b 75 10 mov 0x10(%ebp),%esi 801019e2: 89 45 dc mov %eax,-0x24(%ebp) 801019e5: 8b 45 14 mov 0x14(%ebp),%eax uint tot, m; struct buf *bp; if(ip->type == T_DEV){ 801019e8: 66 83 7f 50 03 cmpw $0x3,0x50(%edi) { 801019ed: 89 45 e0 mov %eax,-0x20(%ebp) if(ip->type == T_DEV){ 801019f0: 0f 84 ca 00 00 00 je 80101ac0 <readi+0xf0> 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) 801019f6: 8b 47 58 mov 0x58(%edi),%eax 801019f9: 39 c6 cmp %eax,%esi 801019fb: 0f 87 e3 00 00 00 ja 80101ae4 <readi+0x114> 80101a01: 8b 55 e0 mov -0x20(%ebp),%edx 80101a04: 01 f2 add %esi,%edx 80101a06: 0f 82 d8 00 00 00 jb 80101ae4 <readi+0x114> return -1; if(off + n > ip->size) 80101a0c: 39 d0 cmp %edx,%eax 80101a0e: 0f 82 9c 00 00 00 jb 80101ab0 <readi+0xe0> n = ip->size - off; for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ 80101a14: 8b 45 e0 mov -0x20(%ebp),%eax 80101a17: 85 c0 test %eax,%eax 80101a19: 0f 84 86 00 00 00 je 80101aa5 <readi+0xd5> 80101a1f: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp) bp = bread(ip->dev, bmap(ip, off/BSIZE)); m = min(n - tot, BSIZE - off%BSIZE); 80101a26: 89 7d d4 mov %edi,-0x2c(%ebp) 80101a29: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi bp = bread(ip->dev, bmap(ip, off/BSIZE)); 80101a30: 8b 7d d4 mov -0x2c(%ebp),%edi 80101a33: 89 f2 mov %esi,%edx 80101a35: c1 ea 09 shr $0x9,%edx 80101a38: 89 f8 mov %edi,%eax 80101a3a: e8 c1 f8 ff ff call 80101300 <bmap> 80101a3f: 89 44 24 04 mov %eax,0x4(%esp) 80101a43: 8b 07 mov (%edi),%eax 80101a45: 89 04 24 mov %eax,(%esp) 80101a48: e8 83 e6 ff ff call 801000d0 <bread> m = min(n - tot, BSIZE - off%BSIZE); 80101a4d: 8b 5d e4 mov -0x1c(%ebp),%ebx 80101a50: b9 00 02 00 00 mov $0x200,%ecx 80101a55: 8b 7d e0 mov -0x20(%ebp),%edi 80101a58: 29 df sub %ebx,%edi bp = bread(ip->dev, bmap(ip, off/BSIZE)); 80101a5a: 89 c2 mov %eax,%edx m = min(n - tot, BSIZE - off%BSIZE); 80101a5c: 89 f0 mov %esi,%eax 80101a5e: 25 ff 01 00 00 and $0x1ff,%eax 80101a63: 89 fb mov %edi,%ebx 80101a65: 29 c1 sub %eax,%ecx 80101a67: 39 f9 cmp %edi,%ecx memmove(dst, bp->data + off%BSIZE, m); 80101a69: 8b 7d dc mov -0x24(%ebp),%edi m = min(n - tot, BSIZE - off%BSIZE); 80101a6c: 0f 46 d9 cmovbe %ecx,%ebx memmove(dst, bp->data + off%BSIZE, m); 80101a6f: 8d 44 02 5c lea 0x5c(%edx,%eax,1),%eax for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ 80101a73: 01 de add %ebx,%esi memmove(dst, bp->data + off%BSIZE, m); 80101a75: 89 5c 24 08 mov %ebx,0x8(%esp) 80101a79: 89 44 24 04 mov %eax,0x4(%esp) 80101a7d: 89 3c 24 mov %edi,(%esp) 80101a80: 89 55 d8 mov %edx,-0x28(%ebp) 80101a83: e8 18 3b 00 00 call 801055a0 <memmove> brelse(bp); 80101a88: 8b 55 d8 mov -0x28(%ebp),%edx 80101a8b: 89 14 24 mov %edx,(%esp) 80101a8e: e8 4d e7 ff ff call 801001e0 <brelse> for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ 80101a93: 89 f9 mov %edi,%ecx 80101a95: 01 5d e4 add %ebx,-0x1c(%ebp) 80101a98: 01 d9 add %ebx,%ecx 80101a9a: 89 4d dc mov %ecx,-0x24(%ebp) 80101a9d: 8b 45 e4 mov -0x1c(%ebp),%eax 80101aa0: 39 45 e0 cmp %eax,-0x20(%ebp) 80101aa3: 77 8b ja 80101a30 <readi+0x60> } return n; 80101aa5: 8b 45 e0 mov -0x20(%ebp),%eax } 80101aa8: 83 c4 3c add $0x3c,%esp 80101aab: 5b pop %ebx 80101aac: 5e pop %esi 80101aad: 5f pop %edi 80101aae: 5d pop %ebp 80101aaf: c3 ret n = ip->size - off; 80101ab0: 29 f0 sub %esi,%eax 80101ab2: 89 45 e0 mov %eax,-0x20(%ebp) 80101ab5: e9 5a ff ff ff jmp 80101a14 <readi+0x44> 80101aba: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].read) 80101ac0: 0f bf 47 52 movswl 0x52(%edi),%eax 80101ac4: 66 83 f8 09 cmp $0x9,%ax 80101ac8: 77 1a ja 80101ae4 <readi+0x114> 80101aca: 8b 04 c5 c0 19 11 80 mov -0x7feee640(,%eax,8),%eax 80101ad1: 85 c0 test %eax,%eax 80101ad3: 74 0f je 80101ae4 <readi+0x114> return devsw[ip->major].read(ip, dst, n); 80101ad5: 8b 75 e0 mov -0x20(%ebp),%esi 80101ad8: 89 75 10 mov %esi,0x10(%ebp) } 80101adb: 83 c4 3c add $0x3c,%esp 80101ade: 5b pop %ebx 80101adf: 5e pop %esi 80101ae0: 5f pop %edi 80101ae1: 5d pop %ebp return devsw[ip->major].read(ip, dst, n); 80101ae2: ff e0 jmp *%eax return -1; 80101ae4: b8 ff ff ff ff mov $0xffffffff,%eax 80101ae9: eb bd jmp 80101aa8 <readi+0xd8> 80101aeb: 90 nop 80101aec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101af0 <writei>: // PAGEBREAK! // Write data to inode. // Caller must hold ip->lock. int writei(struct inode *ip, char *src, uint off, uint n) { 80101af0: 55 push %ebp 80101af1: 89 e5 mov %esp,%ebp 80101af3: 57 push %edi 80101af4: 56 push %esi 80101af5: 53 push %ebx 80101af6: 83 ec 2c sub $0x2c,%esp 80101af9: 8b 45 0c mov 0xc(%ebp),%eax 80101afc: 8b 7d 08 mov 0x8(%ebp),%edi 80101aff: 8b 75 10 mov 0x10(%ebp),%esi 80101b02: 89 45 d8 mov %eax,-0x28(%ebp) 80101b05: 8b 45 14 mov 0x14(%ebp),%eax uint tot, m; struct buf *bp; if(ip->type == T_DEV){ 80101b08: 66 83 7f 50 03 cmpw $0x3,0x50(%edi) { 80101b0d: 89 45 dc mov %eax,-0x24(%ebp) if(ip->type == T_DEV){ 80101b10: 0f 84 da 00 00 00 je 80101bf0 <writei+0x100> 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) 80101b16: 39 77 58 cmp %esi,0x58(%edi) 80101b19: 0f 82 09 01 00 00 jb 80101c28 <writei+0x138> 80101b1f: 8b 45 dc mov -0x24(%ebp),%eax 80101b22: 31 d2 xor %edx,%edx 80101b24: 01 f0 add %esi,%eax 80101b26: 0f 82 03 01 00 00 jb 80101c2f <writei+0x13f> return -1; if(off + n > MAXFILE*BSIZE) 80101b2c: 3d 00 18 01 00 cmp $0x11800,%eax 80101b31: 0f 87 f1 00 00 00 ja 80101c28 <writei+0x138> 80101b37: 85 d2 test %edx,%edx 80101b39: 0f 85 e9 00 00 00 jne 80101c28 <writei+0x138> return -1; for(tot=0; tot<n; tot+=m, off+=m, src+=m){ 80101b3f: 8b 4d dc mov -0x24(%ebp),%ecx 80101b42: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp) 80101b49: 85 c9 test %ecx,%ecx 80101b4b: 0f 84 8c 00 00 00 je 80101bdd <writei+0xed> 80101b51: 89 75 e0 mov %esi,-0x20(%ebp) 80101b54: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80101b5a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi bp = bread(ip->dev, bmap(ip, off/BSIZE)); 80101b60: 8b 5d e0 mov -0x20(%ebp),%ebx 80101b63: 89 f8 mov %edi,%eax 80101b65: 89 da mov %ebx,%edx 80101b67: c1 ea 09 shr $0x9,%edx 80101b6a: e8 91 f7 ff ff call 80101300 <bmap> 80101b6f: 89 44 24 04 mov %eax,0x4(%esp) 80101b73: 8b 07 mov (%edi),%eax 80101b75: 89 04 24 mov %eax,(%esp) 80101b78: e8 53 e5 ff ff call 801000d0 <bread> m = min(n - tot, BSIZE - off%BSIZE); 80101b7d: 8b 55 e4 mov -0x1c(%ebp),%edx 80101b80: b9 00 02 00 00 mov $0x200,%ecx 80101b85: 89 5d e0 mov %ebx,-0x20(%ebp) bp = bread(ip->dev, bmap(ip, off/BSIZE)); 80101b88: 89 c6 mov %eax,%esi m = min(n - tot, BSIZE - off%BSIZE); 80101b8a: 89 d8 mov %ebx,%eax 80101b8c: 8b 5d dc mov -0x24(%ebp),%ebx 80101b8f: 25 ff 01 00 00 and $0x1ff,%eax 80101b94: 29 c1 sub %eax,%ecx memmove(bp->data + off%BSIZE, src, m); 80101b96: 8d 44 06 5c lea 0x5c(%esi,%eax,1),%eax m = min(n - tot, BSIZE - off%BSIZE); 80101b9a: 29 d3 sub %edx,%ebx memmove(bp->data + off%BSIZE, src, m); 80101b9c: 8b 55 d8 mov -0x28(%ebp),%edx m = min(n - tot, BSIZE - off%BSIZE); 80101b9f: 39 d9 cmp %ebx,%ecx 80101ba1: 0f 46 d9 cmovbe %ecx,%ebx memmove(bp->data + off%BSIZE, src, m); 80101ba4: 89 5c 24 08 mov %ebx,0x8(%esp) 80101ba8: 89 54 24 04 mov %edx,0x4(%esp) 80101bac: 89 04 24 mov %eax,(%esp) 80101baf: e8 ec 39 00 00 call 801055a0 <memmove> log_write(bp); 80101bb4: 89 34 24 mov %esi,(%esp) 80101bb7: e8 74 12 00 00 call 80102e30 <log_write> brelse(bp); 80101bbc: 89 34 24 mov %esi,(%esp) 80101bbf: e8 1c e6 ff ff call 801001e0 <brelse> for(tot=0; tot<n; tot+=m, off+=m, src+=m){ 80101bc4: 01 5d e4 add %ebx,-0x1c(%ebp) 80101bc7: 01 5d e0 add %ebx,-0x20(%ebp) 80101bca: 01 5d d8 add %ebx,-0x28(%ebp) 80101bcd: 8b 4d e4 mov -0x1c(%ebp),%ecx 80101bd0: 39 4d dc cmp %ecx,-0x24(%ebp) 80101bd3: 77 8b ja 80101b60 <writei+0x70> 80101bd5: 8b 75 e0 mov -0x20(%ebp),%esi } if(n > 0 && off > ip->size){ 80101bd8: 3b 77 58 cmp 0x58(%edi),%esi 80101bdb: 77 3b ja 80101c18 <writei+0x128> ip->size = off; iupdate(ip); } return n; 80101bdd: 8b 45 dc mov -0x24(%ebp),%eax } 80101be0: 83 c4 2c add $0x2c,%esp 80101be3: 5b pop %ebx 80101be4: 5e pop %esi 80101be5: 5f pop %edi 80101be6: 5d pop %ebp 80101be7: c3 ret 80101be8: 90 nop 80101be9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].write) 80101bf0: 0f bf 47 52 movswl 0x52(%edi),%eax 80101bf4: 66 83 f8 09 cmp $0x9,%ax 80101bf8: 77 2e ja 80101c28 <writei+0x138> 80101bfa: 8b 04 c5 c4 19 11 80 mov -0x7feee63c(,%eax,8),%eax 80101c01: 85 c0 test %eax,%eax 80101c03: 74 23 je 80101c28 <writei+0x138> return devsw[ip->major].write(ip, src, n); 80101c05: 8b 7d dc mov -0x24(%ebp),%edi 80101c08: 89 7d 10 mov %edi,0x10(%ebp) } 80101c0b: 83 c4 2c add $0x2c,%esp 80101c0e: 5b pop %ebx 80101c0f: 5e pop %esi 80101c10: 5f pop %edi 80101c11: 5d pop %ebp return devsw[ip->major].write(ip, src, n); 80101c12: ff e0 jmp *%eax 80101c14: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi ip->size = off; 80101c18: 89 77 58 mov %esi,0x58(%edi) iupdate(ip); 80101c1b: 89 3c 24 mov %edi,(%esp) 80101c1e: e8 0d fa ff ff call 80101630 <iupdate> 80101c23: eb b8 jmp 80101bdd <writei+0xed> 80101c25: 8d 76 00 lea 0x0(%esi),%esi return -1; 80101c28: b8 ff ff ff ff mov $0xffffffff,%eax 80101c2d: eb b1 jmp 80101be0 <writei+0xf0> 80101c2f: ba 01 00 00 00 mov $0x1,%edx 80101c34: e9 f3 fe ff ff jmp 80101b2c <writei+0x3c> 80101c39: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80101c40 <namecmp>: //PAGEBREAK! // Directories int namecmp(const char *s, const char *t) { 80101c40: 55 push %ebp return strncmp(s, t, DIRSIZ); 80101c41: b8 0e 00 00 00 mov $0xe,%eax { 80101c46: 89 e5 mov %esp,%ebp 80101c48: 83 ec 18 sub $0x18,%esp return strncmp(s, t, DIRSIZ); 80101c4b: 89 44 24 08 mov %eax,0x8(%esp) 80101c4f: 8b 45 0c mov 0xc(%ebp),%eax 80101c52: 89 44 24 04 mov %eax,0x4(%esp) 80101c56: 8b 45 08 mov 0x8(%ebp),%eax 80101c59: 89 04 24 mov %eax,(%esp) 80101c5c: e8 9f 39 00 00 call 80105600 <strncmp> } 80101c61: c9 leave 80101c62: c3 ret 80101c63: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80101c69: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101c70 <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) { 80101c70: 55 push %ebp 80101c71: 89 e5 mov %esp,%ebp 80101c73: 57 push %edi 80101c74: 56 push %esi 80101c75: 53 push %ebx 80101c76: 83 ec 2c sub $0x2c,%esp 80101c79: 8b 5d 08 mov 0x8(%ebp),%ebx uint off, inum; struct dirent de; if(dp->type != T_DIR) 80101c7c: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 80101c81: 0f 85 a4 00 00 00 jne 80101d2b <dirlookup+0xbb> panic("dirlookup not DIR"); for(off = 0; off < dp->size; off += sizeof(de)){ 80101c87: 8b 43 58 mov 0x58(%ebx),%eax 80101c8a: 31 ff xor %edi,%edi 80101c8c: 8d 75 d8 lea -0x28(%ebp),%esi 80101c8f: 85 c0 test %eax,%eax 80101c91: 74 59 je 80101cec <dirlookup+0x7c> 80101c93: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80101c99: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80101ca0: b9 10 00 00 00 mov $0x10,%ecx 80101ca5: 89 4c 24 0c mov %ecx,0xc(%esp) 80101ca9: 89 7c 24 08 mov %edi,0x8(%esp) 80101cad: 89 74 24 04 mov %esi,0x4(%esp) 80101cb1: 89 1c 24 mov %ebx,(%esp) 80101cb4: e8 17 fd ff ff call 801019d0 <readi> 80101cb9: 83 f8 10 cmp $0x10,%eax 80101cbc: 75 61 jne 80101d1f <dirlookup+0xaf> panic("dirlookup read"); if(de.inum == 0) 80101cbe: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp) 80101cc3: 74 1f je 80101ce4 <dirlookup+0x74> return strncmp(s, t, DIRSIZ); 80101cc5: 8d 45 da lea -0x26(%ebp),%eax 80101cc8: ba 0e 00 00 00 mov $0xe,%edx 80101ccd: 89 44 24 04 mov %eax,0x4(%esp) 80101cd1: 8b 45 0c mov 0xc(%ebp),%eax 80101cd4: 89 54 24 08 mov %edx,0x8(%esp) 80101cd8: 89 04 24 mov %eax,(%esp) 80101cdb: e8 20 39 00 00 call 80105600 <strncmp> continue; if(namecmp(name, de.name) == 0){ 80101ce0: 85 c0 test %eax,%eax 80101ce2: 74 1c je 80101d00 <dirlookup+0x90> for(off = 0; off < dp->size; off += sizeof(de)){ 80101ce4: 83 c7 10 add $0x10,%edi 80101ce7: 3b 7b 58 cmp 0x58(%ebx),%edi 80101cea: 72 b4 jb 80101ca0 <dirlookup+0x30> return iget(dp->dev, inum); } } return 0; } 80101cec: 83 c4 2c add $0x2c,%esp return 0; 80101cef: 31 c0 xor %eax,%eax } 80101cf1: 5b pop %ebx 80101cf2: 5e pop %esi 80101cf3: 5f pop %edi 80101cf4: 5d pop %ebp 80101cf5: c3 ret 80101cf6: 8d 76 00 lea 0x0(%esi),%esi 80101cf9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi if(poff) 80101d00: 8b 45 10 mov 0x10(%ebp),%eax 80101d03: 85 c0 test %eax,%eax 80101d05: 74 05 je 80101d0c <dirlookup+0x9c> *poff = off; 80101d07: 8b 45 10 mov 0x10(%ebp),%eax 80101d0a: 89 38 mov %edi,(%eax) inum = de.inum; 80101d0c: 0f b7 55 d8 movzwl -0x28(%ebp),%edx return iget(dp->dev, inum); 80101d10: 8b 03 mov (%ebx),%eax 80101d12: e8 29 f5 ff ff call 80101240 <iget> } 80101d17: 83 c4 2c add $0x2c,%esp 80101d1a: 5b pop %ebx 80101d1b: 5e pop %esi 80101d1c: 5f pop %edi 80101d1d: 5d pop %ebp 80101d1e: c3 ret panic("dirlookup read"); 80101d1f: c7 04 24 79 81 10 80 movl $0x80108179,(%esp) 80101d26: e8 45 e6 ff ff call 80100370 <panic> panic("dirlookup not DIR"); 80101d2b: c7 04 24 67 81 10 80 movl $0x80108167,(%esp) 80101d32: e8 39 e6 ff ff call 80100370 <panic> 80101d37: 89 f6 mov %esi,%esi 80101d39: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101d40 <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) { 80101d40: 55 push %ebp 80101d41: 89 e5 mov %esp,%ebp 80101d43: 57 push %edi 80101d44: 89 cf mov %ecx,%edi 80101d46: 56 push %esi 80101d47: 53 push %ebx 80101d48: 89 c3 mov %eax,%ebx 80101d4a: 83 ec 2c sub $0x2c,%esp struct inode *ip, *next; if(*path == '/') 80101d4d: 80 38 2f cmpb $0x2f,(%eax) { 80101d50: 89 55 e0 mov %edx,-0x20(%ebp) if(*path == '/') 80101d53: 0f 84 5b 01 00 00 je 80101eb4 <namex+0x174> ip = iget(ROOTDEV, ROOTINO); else ip = idup(myproc()->cwd); 80101d59: e8 62 1c 00 00 call 801039c0 <myproc> 80101d5e: 8b 70 68 mov 0x68(%eax),%esi acquire(&icache.lock); 80101d61: c7 04 24 40 1a 11 80 movl $0x80111a40,(%esp) 80101d68: e8 83 36 00 00 call 801053f0 <acquire> ip->ref++; 80101d6d: ff 46 08 incl 0x8(%esi) release(&icache.lock); 80101d70: c7 04 24 40 1a 11 80 movl $0x80111a40,(%esp) 80101d77: e8 14 37 00 00 call 80105490 <release> 80101d7c: eb 03 jmp 80101d81 <namex+0x41> 80101d7e: 66 90 xchg %ax,%ax path++; 80101d80: 43 inc %ebx while(*path == '/') 80101d81: 0f b6 03 movzbl (%ebx),%eax 80101d84: 3c 2f cmp $0x2f,%al 80101d86: 74 f8 je 80101d80 <namex+0x40> if(*path == 0) 80101d88: 84 c0 test %al,%al 80101d8a: 0f 84 f0 00 00 00 je 80101e80 <namex+0x140> while(*path != '/' && *path != 0) 80101d90: 0f b6 03 movzbl (%ebx),%eax 80101d93: 3c 2f cmp $0x2f,%al 80101d95: 0f 84 b5 00 00 00 je 80101e50 <namex+0x110> 80101d9b: 84 c0 test %al,%al 80101d9d: 89 da mov %ebx,%edx 80101d9f: 75 13 jne 80101db4 <namex+0x74> 80101da1: e9 aa 00 00 00 jmp 80101e50 <namex+0x110> 80101da6: 8d 76 00 lea 0x0(%esi),%esi 80101da9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101db0: 84 c0 test %al,%al 80101db2: 74 08 je 80101dbc <namex+0x7c> path++; 80101db4: 42 inc %edx while(*path != '/' && *path != 0) 80101db5: 0f b6 02 movzbl (%edx),%eax 80101db8: 3c 2f cmp $0x2f,%al 80101dba: 75 f4 jne 80101db0 <namex+0x70> 80101dbc: 89 d1 mov %edx,%ecx 80101dbe: 29 d9 sub %ebx,%ecx if(len >= DIRSIZ) 80101dc0: 83 f9 0d cmp $0xd,%ecx 80101dc3: 0f 8e 8b 00 00 00 jle 80101e54 <namex+0x114> memmove(name, s, DIRSIZ); 80101dc9: b8 0e 00 00 00 mov $0xe,%eax 80101dce: 89 5c 24 04 mov %ebx,0x4(%esp) 80101dd2: 89 44 24 08 mov %eax,0x8(%esp) 80101dd6: 89 3c 24 mov %edi,(%esp) 80101dd9: 89 55 e4 mov %edx,-0x1c(%ebp) 80101ddc: e8 bf 37 00 00 call 801055a0 <memmove> path++; 80101de1: 8b 55 e4 mov -0x1c(%ebp),%edx 80101de4: 89 d3 mov %edx,%ebx while(*path == '/') 80101de6: 80 3a 2f cmpb $0x2f,(%edx) 80101de9: 75 0b jne 80101df6 <namex+0xb6> 80101deb: 90 nop 80101dec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi path++; 80101df0: 43 inc %ebx while(*path == '/') 80101df1: 80 3b 2f cmpb $0x2f,(%ebx) 80101df4: 74 fa je 80101df0 <namex+0xb0> while((path = skipelem(path, name)) != 0){ ilock(ip); 80101df6: 89 34 24 mov %esi,(%esp) 80101df9: e8 f2 f8 ff ff call 801016f0 <ilock> if(ip->type != T_DIR){ 80101dfe: 66 83 7e 50 01 cmpw $0x1,0x50(%esi) 80101e03: 0f 85 8f 00 00 00 jne 80101e98 <namex+0x158> iunlockput(ip); return 0; } if(nameiparent && *path == '\0'){ 80101e09: 8b 45 e0 mov -0x20(%ebp),%eax 80101e0c: 85 c0 test %eax,%eax 80101e0e: 74 09 je 80101e19 <namex+0xd9> 80101e10: 80 3b 00 cmpb $0x0,(%ebx) 80101e13: 0f 84 b1 00 00 00 je 80101eca <namex+0x18a> // Stop one level early. iunlock(ip); return ip; } if((next = dirlookup(ip, name, 0)) == 0){ 80101e19: 31 c9 xor %ecx,%ecx 80101e1b: 89 4c 24 08 mov %ecx,0x8(%esp) 80101e1f: 89 7c 24 04 mov %edi,0x4(%esp) 80101e23: 89 34 24 mov %esi,(%esp) 80101e26: e8 45 fe ff ff call 80101c70 <dirlookup> 80101e2b: 85 c0 test %eax,%eax 80101e2d: 74 69 je 80101e98 <namex+0x158> iunlock(ip); 80101e2f: 89 34 24 mov %esi,(%esp) 80101e32: 89 45 e4 mov %eax,-0x1c(%ebp) 80101e35: e8 96 f9 ff ff call 801017d0 <iunlock> iput(ip); 80101e3a: 89 34 24 mov %esi,(%esp) 80101e3d: e8 de f9 ff ff call 80101820 <iput> 80101e42: 8b 45 e4 mov -0x1c(%ebp),%eax 80101e45: 89 c6 mov %eax,%esi 80101e47: e9 35 ff ff ff jmp 80101d81 <namex+0x41> 80101e4c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi while(*path != '/' && *path != 0) 80101e50: 89 da mov %ebx,%edx 80101e52: 31 c9 xor %ecx,%ecx memmove(name, s, len); 80101e54: 89 4c 24 08 mov %ecx,0x8(%esp) 80101e58: 89 5c 24 04 mov %ebx,0x4(%esp) 80101e5c: 89 3c 24 mov %edi,(%esp) 80101e5f: 89 55 dc mov %edx,-0x24(%ebp) 80101e62: 89 4d e4 mov %ecx,-0x1c(%ebp) 80101e65: e8 36 37 00 00 call 801055a0 <memmove> name[len] = 0; 80101e6a: 8b 4d e4 mov -0x1c(%ebp),%ecx 80101e6d: 8b 55 dc mov -0x24(%ebp),%edx 80101e70: c6 04 0f 00 movb $0x0,(%edi,%ecx,1) 80101e74: 89 d3 mov %edx,%ebx 80101e76: e9 6b ff ff ff jmp 80101de6 <namex+0xa6> 80101e7b: 90 nop 80101e7c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return 0; } iunlockput(ip); ip = next; } if(nameiparent){ 80101e80: 8b 55 e0 mov -0x20(%ebp),%edx 80101e83: 85 d2 test %edx,%edx 80101e85: 75 55 jne 80101edc <namex+0x19c> iput(ip); return 0; } return ip; } 80101e87: 83 c4 2c add $0x2c,%esp 80101e8a: 89 f0 mov %esi,%eax 80101e8c: 5b pop %ebx 80101e8d: 5e pop %esi 80101e8e: 5f pop %edi 80101e8f: 5d pop %ebp 80101e90: c3 ret 80101e91: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi iunlock(ip); 80101e98: 89 34 24 mov %esi,(%esp) 80101e9b: e8 30 f9 ff ff call 801017d0 <iunlock> iput(ip); 80101ea0: 89 34 24 mov %esi,(%esp) return 0; 80101ea3: 31 f6 xor %esi,%esi iput(ip); 80101ea5: e8 76 f9 ff ff call 80101820 <iput> } 80101eaa: 83 c4 2c add $0x2c,%esp 80101ead: 89 f0 mov %esi,%eax 80101eaf: 5b pop %ebx 80101eb0: 5e pop %esi 80101eb1: 5f pop %edi 80101eb2: 5d pop %ebp 80101eb3: c3 ret ip = iget(ROOTDEV, ROOTINO); 80101eb4: ba 01 00 00 00 mov $0x1,%edx 80101eb9: b8 01 00 00 00 mov $0x1,%eax 80101ebe: e8 7d f3 ff ff call 80101240 <iget> 80101ec3: 89 c6 mov %eax,%esi 80101ec5: e9 b7 fe ff ff jmp 80101d81 <namex+0x41> iunlock(ip); 80101eca: 89 34 24 mov %esi,(%esp) 80101ecd: e8 fe f8 ff ff call 801017d0 <iunlock> } 80101ed2: 83 c4 2c add $0x2c,%esp 80101ed5: 89 f0 mov %esi,%eax 80101ed7: 5b pop %ebx 80101ed8: 5e pop %esi 80101ed9: 5f pop %edi 80101eda: 5d pop %ebp 80101edb: c3 ret iput(ip); 80101edc: 89 34 24 mov %esi,(%esp) return 0; 80101edf: 31 f6 xor %esi,%esi iput(ip); 80101ee1: e8 3a f9 ff ff call 80101820 <iput> return 0; 80101ee6: eb 9f jmp 80101e87 <namex+0x147> 80101ee8: 90 nop 80101ee9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80101ef0 <dirlink>: { 80101ef0: 55 push %ebp 80101ef1: 89 e5 mov %esp,%ebp 80101ef3: 57 push %edi 80101ef4: 56 push %esi 80101ef5: 53 push %ebx if((ip = dirlookup(dp, name, 0)) != 0){ 80101ef6: 31 db xor %ebx,%ebx { 80101ef8: 83 ec 2c sub $0x2c,%esp 80101efb: 8b 7d 08 mov 0x8(%ebp),%edi if((ip = dirlookup(dp, name, 0)) != 0){ 80101efe: 8b 45 0c mov 0xc(%ebp),%eax 80101f01: 89 5c 24 08 mov %ebx,0x8(%esp) 80101f05: 89 3c 24 mov %edi,(%esp) 80101f08: 89 44 24 04 mov %eax,0x4(%esp) 80101f0c: e8 5f fd ff ff call 80101c70 <dirlookup> 80101f11: 85 c0 test %eax,%eax 80101f13: 0f 85 8e 00 00 00 jne 80101fa7 <dirlink+0xb7> for(off = 0; off < dp->size; off += sizeof(de)){ 80101f19: 8b 5f 58 mov 0x58(%edi),%ebx 80101f1c: 8d 75 d8 lea -0x28(%ebp),%esi 80101f1f: 85 db test %ebx,%ebx 80101f21: 74 3a je 80101f5d <dirlink+0x6d> 80101f23: 31 db xor %ebx,%ebx 80101f25: 8d 75 d8 lea -0x28(%ebp),%esi 80101f28: eb 0e jmp 80101f38 <dirlink+0x48> 80101f2a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80101f30: 83 c3 10 add $0x10,%ebx 80101f33: 3b 5f 58 cmp 0x58(%edi),%ebx 80101f36: 73 25 jae 80101f5d <dirlink+0x6d> if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80101f38: b9 10 00 00 00 mov $0x10,%ecx 80101f3d: 89 4c 24 0c mov %ecx,0xc(%esp) 80101f41: 89 5c 24 08 mov %ebx,0x8(%esp) 80101f45: 89 74 24 04 mov %esi,0x4(%esp) 80101f49: 89 3c 24 mov %edi,(%esp) 80101f4c: e8 7f fa ff ff call 801019d0 <readi> 80101f51: 83 f8 10 cmp $0x10,%eax 80101f54: 75 60 jne 80101fb6 <dirlink+0xc6> if(de.inum == 0) 80101f56: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp) 80101f5b: 75 d3 jne 80101f30 <dirlink+0x40> strncpy(de.name, name, DIRSIZ); 80101f5d: b8 0e 00 00 00 mov $0xe,%eax 80101f62: 89 44 24 08 mov %eax,0x8(%esp) 80101f66: 8b 45 0c mov 0xc(%ebp),%eax 80101f69: 89 44 24 04 mov %eax,0x4(%esp) 80101f6d: 8d 45 da lea -0x26(%ebp),%eax 80101f70: 89 04 24 mov %eax,(%esp) 80101f73: e8 e8 36 00 00 call 80105660 <strncpy> de.inum = inum; 80101f78: 8b 45 10 mov 0x10(%ebp),%eax if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80101f7b: ba 10 00 00 00 mov $0x10,%edx 80101f80: 89 54 24 0c mov %edx,0xc(%esp) 80101f84: 89 5c 24 08 mov %ebx,0x8(%esp) 80101f88: 89 74 24 04 mov %esi,0x4(%esp) 80101f8c: 89 3c 24 mov %edi,(%esp) de.inum = inum; 80101f8f: 66 89 45 d8 mov %ax,-0x28(%ebp) if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80101f93: e8 58 fb ff ff call 80101af0 <writei> 80101f98: 83 f8 10 cmp $0x10,%eax 80101f9b: 75 25 jne 80101fc2 <dirlink+0xd2> return 0; 80101f9d: 31 c0 xor %eax,%eax } 80101f9f: 83 c4 2c add $0x2c,%esp 80101fa2: 5b pop %ebx 80101fa3: 5e pop %esi 80101fa4: 5f pop %edi 80101fa5: 5d pop %ebp 80101fa6: c3 ret iput(ip); 80101fa7: 89 04 24 mov %eax,(%esp) 80101faa: e8 71 f8 ff ff call 80101820 <iput> return -1; 80101faf: b8 ff ff ff ff mov $0xffffffff,%eax 80101fb4: eb e9 jmp 80101f9f <dirlink+0xaf> panic("dirlink read"); 80101fb6: c7 04 24 88 81 10 80 movl $0x80108188,(%esp) 80101fbd: e8 ae e3 ff ff call 80100370 <panic> panic("dirlink"); 80101fc2: c7 04 24 c6 87 10 80 movl $0x801087c6,(%esp) 80101fc9: e8 a2 e3 ff ff call 80100370 <panic> 80101fce: 66 90 xchg %ax,%ax 80101fd0 <namei>: struct inode* namei(char *path) { 80101fd0: 55 push %ebp char name[DIRSIZ]; return namex(path, 0, name); 80101fd1: 31 d2 xor %edx,%edx { 80101fd3: 89 e5 mov %esp,%ebp 80101fd5: 83 ec 18 sub $0x18,%esp return namex(path, 0, name); 80101fd8: 8b 45 08 mov 0x8(%ebp),%eax 80101fdb: 8d 4d ea lea -0x16(%ebp),%ecx 80101fde: e8 5d fd ff ff call 80101d40 <namex> } 80101fe3: c9 leave 80101fe4: c3 ret 80101fe5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101fe9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101ff0 <nameiparent>: struct inode* nameiparent(char *path, char *name) { 80101ff0: 55 push %ebp return namex(path, 1, name); 80101ff1: ba 01 00 00 00 mov $0x1,%edx { 80101ff6: 89 e5 mov %esp,%ebp return namex(path, 1, name); 80101ff8: 8b 4d 0c mov 0xc(%ebp),%ecx 80101ffb: 8b 45 08 mov 0x8(%ebp),%eax } 80101ffe: 5d pop %ebp return namex(path, 1, name); 80101fff: e9 3c fd ff ff jmp 80101d40 <namex> 80102004: 66 90 xchg %ax,%ax 80102006: 66 90 xchg %ax,%ax 80102008: 66 90 xchg %ax,%ax 8010200a: 66 90 xchg %ax,%ax 8010200c: 66 90 xchg %ax,%ax 8010200e: 66 90 xchg %ax,%ax 80102010 <idestart>: } // Start the request for b. Caller must hold idelock. static void idestart(struct buf *b) { 80102010: 55 push %ebp 80102011: 89 e5 mov %esp,%ebp 80102013: 56 push %esi 80102014: 53 push %ebx 80102015: 83 ec 10 sub $0x10,%esp if(b == 0) 80102018: 85 c0 test %eax,%eax 8010201a: 0f 84 a8 00 00 00 je 801020c8 <idestart+0xb8> panic("idestart"); if(b->blockno >= FSSIZE) 80102020: 8b 48 08 mov 0x8(%eax),%ecx 80102023: 89 c6 mov %eax,%esi 80102025: 81 f9 e7 03 00 00 cmp $0x3e7,%ecx 8010202b: 0f 87 8b 00 00 00 ja 801020bc <idestart+0xac> asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102031: bb f7 01 00 00 mov $0x1f7,%ebx 80102036: 8d 76 00 lea 0x0(%esi),%esi 80102039: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102040: 89 da mov %ebx,%edx 80102042: ec in (%dx),%al while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY) 80102043: 24 c0 and $0xc0,%al 80102045: 3c 40 cmp $0x40,%al 80102047: 75 f7 jne 80102040 <idestart+0x30> asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102049: ba f6 03 00 00 mov $0x3f6,%edx 8010204e: 31 c0 xor %eax,%eax 80102050: ee out %al,(%dx) 80102051: b0 01 mov $0x1,%al 80102053: ba f2 01 00 00 mov $0x1f2,%edx 80102058: ee out %al,(%dx) 80102059: ba f3 01 00 00 mov $0x1f3,%edx 8010205e: 88 c8 mov %cl,%al 80102060: 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); 80102061: c1 f9 08 sar $0x8,%ecx 80102064: ba f4 01 00 00 mov $0x1f4,%edx 80102069: 89 c8 mov %ecx,%eax 8010206b: ee out %al,(%dx) 8010206c: ba f5 01 00 00 mov $0x1f5,%edx 80102071: 31 c0 xor %eax,%eax 80102073: ee out %al,(%dx) outb(0x1f5, (sector >> 16) & 0xff); outb(0x1f6, 0xe0 | ((b->dev&1)<<4) | ((sector>>24)&0x0f)); 80102074: 0f b6 46 04 movzbl 0x4(%esi),%eax 80102078: ba f6 01 00 00 mov $0x1f6,%edx 8010207d: c0 e0 04 shl $0x4,%al 80102080: 24 10 and $0x10,%al 80102082: 0c e0 or $0xe0,%al 80102084: ee out %al,(%dx) if(b->flags & B_DIRTY){ 80102085: f6 06 04 testb $0x4,(%esi) 80102088: 75 16 jne 801020a0 <idestart+0x90> 8010208a: b0 20 mov $0x20,%al 8010208c: 89 da mov %ebx,%edx 8010208e: ee out %al,(%dx) outb(0x1f7, write_cmd); outsl(0x1f0, b->data, BSIZE/4); } else { outb(0x1f7, read_cmd); } } 8010208f: 83 c4 10 add $0x10,%esp 80102092: 5b pop %ebx 80102093: 5e pop %esi 80102094: 5d pop %ebp 80102095: c3 ret 80102096: 8d 76 00 lea 0x0(%esi),%esi 80102099: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801020a0: b0 30 mov $0x30,%al 801020a2: 89 da mov %ebx,%edx 801020a4: ee out %al,(%dx) asm volatile("cld; rep outsl" : 801020a5: b9 80 00 00 00 mov $0x80,%ecx outsl(0x1f0, b->data, BSIZE/4); 801020aa: 83 c6 5c add $0x5c,%esi 801020ad: ba f0 01 00 00 mov $0x1f0,%edx 801020b2: fc cld 801020b3: f3 6f rep outsl %ds:(%esi),(%dx) } 801020b5: 83 c4 10 add $0x10,%esp 801020b8: 5b pop %ebx 801020b9: 5e pop %esi 801020ba: 5d pop %ebp 801020bb: c3 ret panic("incorrect blockno"); 801020bc: c7 04 24 f4 81 10 80 movl $0x801081f4,(%esp) 801020c3: e8 a8 e2 ff ff call 80100370 <panic> panic("idestart"); 801020c8: c7 04 24 eb 81 10 80 movl $0x801081eb,(%esp) 801020cf: e8 9c e2 ff ff call 80100370 <panic> 801020d4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801020da: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 801020e0 <ideinit>: { 801020e0: 55 push %ebp initlock(&idelock, "ide"); 801020e1: ba 06 82 10 80 mov $0x80108206,%edx { 801020e6: 89 e5 mov %esp,%ebp 801020e8: 83 ec 18 sub $0x18,%esp initlock(&idelock, "ide"); 801020eb: 89 54 24 04 mov %edx,0x4(%esp) 801020ef: c7 04 24 80 b5 10 80 movl $0x8010b580,(%esp) 801020f6: e8 a5 31 00 00 call 801052a0 <initlock> ioapicenable(IRQ_IDE, ncpu - 1); 801020fb: a1 60 3d 11 80 mov 0x80113d60,%eax 80102100: c7 04 24 0e 00 00 00 movl $0xe,(%esp) 80102107: 48 dec %eax 80102108: 89 44 24 04 mov %eax,0x4(%esp) 8010210c: e8 8f 02 00 00 call 801023a0 <ioapicenable> asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102111: ba f7 01 00 00 mov $0x1f7,%edx 80102116: 8d 76 00 lea 0x0(%esi),%esi 80102119: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102120: ec in (%dx),%al while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY) 80102121: 24 c0 and $0xc0,%al 80102123: 3c 40 cmp $0x40,%al 80102125: 75 f9 jne 80102120 <ideinit+0x40> asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102127: b0 f0 mov $0xf0,%al 80102129: ba f6 01 00 00 mov $0x1f6,%edx 8010212e: ee out %al,(%dx) 8010212f: b9 e8 03 00 00 mov $0x3e8,%ecx asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102134: ba f7 01 00 00 mov $0x1f7,%edx 80102139: eb 08 jmp 80102143 <ideinit+0x63> 8010213b: 90 nop 8010213c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi for(i=0; i<1000; i++){ 80102140: 49 dec %ecx 80102141: 74 0f je 80102152 <ideinit+0x72> 80102143: ec in (%dx),%al if(inb(0x1f7) != 0){ 80102144: 84 c0 test %al,%al 80102146: 74 f8 je 80102140 <ideinit+0x60> havedisk1 = 1; 80102148: b8 01 00 00 00 mov $0x1,%eax 8010214d: a3 60 b5 10 80 mov %eax,0x8010b560 asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102152: b0 e0 mov $0xe0,%al 80102154: ba f6 01 00 00 mov $0x1f6,%edx 80102159: ee out %al,(%dx) } 8010215a: c9 leave 8010215b: c3 ret 8010215c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102160 <ideintr>: // Interrupt handler. void ideintr(void) { 80102160: 55 push %ebp 80102161: 89 e5 mov %esp,%ebp 80102163: 83 ec 28 sub $0x28,%esp struct buf *b; // First queued buffer is the active request. acquire(&idelock); 80102166: c7 04 24 80 b5 10 80 movl $0x8010b580,(%esp) { 8010216d: 89 5d f4 mov %ebx,-0xc(%ebp) 80102170: 89 75 f8 mov %esi,-0x8(%ebp) 80102173: 89 7d fc mov %edi,-0x4(%ebp) acquire(&idelock); 80102176: e8 75 32 00 00 call 801053f0 <acquire> if((b = idequeue) == 0){ 8010217b: 8b 1d 64 b5 10 80 mov 0x8010b564,%ebx 80102181: 85 db test %ebx,%ebx 80102183: 74 5c je 801021e1 <ideintr+0x81> release(&idelock); return; } idequeue = b->qnext; 80102185: 8b 43 58 mov 0x58(%ebx),%eax 80102188: a3 64 b5 10 80 mov %eax,0x8010b564 // Read data if needed. if(!(b->flags & B_DIRTY) && idewait(1) >= 0) 8010218d: 8b 0b mov (%ebx),%ecx 8010218f: f6 c1 04 test $0x4,%cl 80102192: 75 2f jne 801021c3 <ideintr+0x63> asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102194: be f7 01 00 00 mov $0x1f7,%esi 80102199: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801021a0: 89 f2 mov %esi,%edx 801021a2: ec in (%dx),%al while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY) 801021a3: 88 c2 mov %al,%dl 801021a5: 80 e2 c0 and $0xc0,%dl 801021a8: 80 fa 40 cmp $0x40,%dl 801021ab: 75 f3 jne 801021a0 <ideintr+0x40> if(checkerr && (r & (IDE_DF|IDE_ERR)) != 0) 801021ad: a8 21 test $0x21,%al 801021af: 75 12 jne 801021c3 <ideintr+0x63> insl(0x1f0, b->data, BSIZE/4); 801021b1: 8d 7b 5c lea 0x5c(%ebx),%edi asm volatile("cld; rep insl" : 801021b4: b9 80 00 00 00 mov $0x80,%ecx 801021b9: ba f0 01 00 00 mov $0x1f0,%edx 801021be: fc cld 801021bf: f3 6d rep insl (%dx),%es:(%edi) 801021c1: 8b 0b mov (%ebx),%ecx // Wake process waiting for this buf. b->flags |= B_VALID; b->flags &= ~B_DIRTY; 801021c3: 83 e1 fb and $0xfffffffb,%ecx 801021c6: 83 c9 02 or $0x2,%ecx 801021c9: 89 0b mov %ecx,(%ebx) wakeup(b); 801021cb: 89 1c 24 mov %ebx,(%esp) 801021ce: e8 dd 20 00 00 call 801042b0 <wakeup> // Start disk on next buf in queue. if(idequeue != 0) 801021d3: a1 64 b5 10 80 mov 0x8010b564,%eax 801021d8: 85 c0 test %eax,%eax 801021da: 74 05 je 801021e1 <ideintr+0x81> idestart(idequeue); 801021dc: e8 2f fe ff ff call 80102010 <idestart> release(&idelock); 801021e1: c7 04 24 80 b5 10 80 movl $0x8010b580,(%esp) 801021e8: e8 a3 32 00 00 call 80105490 <release> release(&idelock); } 801021ed: 8b 5d f4 mov -0xc(%ebp),%ebx 801021f0: 8b 75 f8 mov -0x8(%ebp),%esi 801021f3: 8b 7d fc mov -0x4(%ebp),%edi 801021f6: 89 ec mov %ebp,%esp 801021f8: 5d pop %ebp 801021f9: c3 ret 801021fa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80102200 <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) { 80102200: 55 push %ebp 80102201: 89 e5 mov %esp,%ebp 80102203: 53 push %ebx 80102204: 83 ec 14 sub $0x14,%esp 80102207: 8b 5d 08 mov 0x8(%ebp),%ebx struct buf **pp; if(!holdingsleep(&b->lock)) 8010220a: 8d 43 0c lea 0xc(%ebx),%eax 8010220d: 89 04 24 mov %eax,(%esp) 80102210: e8 3b 30 00 00 call 80105250 <holdingsleep> 80102215: 85 c0 test %eax,%eax 80102217: 0f 84 b6 00 00 00 je 801022d3 <iderw+0xd3> panic("iderw: buf not locked"); if((b->flags & (B_VALID|B_DIRTY)) == B_VALID) 8010221d: 8b 03 mov (%ebx),%eax 8010221f: 83 e0 06 and $0x6,%eax 80102222: 83 f8 02 cmp $0x2,%eax 80102225: 0f 84 9c 00 00 00 je 801022c7 <iderw+0xc7> panic("iderw: nothing to do"); if(b->dev != 0 && !havedisk1) 8010222b: 8b 4b 04 mov 0x4(%ebx),%ecx 8010222e: 85 c9 test %ecx,%ecx 80102230: 74 0e je 80102240 <iderw+0x40> 80102232: 8b 15 60 b5 10 80 mov 0x8010b560,%edx 80102238: 85 d2 test %edx,%edx 8010223a: 0f 84 9f 00 00 00 je 801022df <iderw+0xdf> panic("iderw: ide disk 1 not present"); acquire(&idelock); //DOC:acquire-lock 80102240: c7 04 24 80 b5 10 80 movl $0x8010b580,(%esp) 80102247: e8 a4 31 00 00 call 801053f0 <acquire> // Append b to idequeue. b->qnext = 0; for(pp=&idequeue; *pp; pp=&(*pp)->qnext) //DOC:insert-queue 8010224c: 8b 15 64 b5 10 80 mov 0x8010b564,%edx b->qnext = 0; 80102252: c7 43 58 00 00 00 00 movl $0x0,0x58(%ebx) for(pp=&idequeue; *pp; pp=&(*pp)->qnext) //DOC:insert-queue 80102259: 85 d2 test %edx,%edx 8010225b: 75 05 jne 80102262 <iderw+0x62> 8010225d: eb 61 jmp 801022c0 <iderw+0xc0> 8010225f: 90 nop 80102260: 89 c2 mov %eax,%edx 80102262: 8b 42 58 mov 0x58(%edx),%eax 80102265: 85 c0 test %eax,%eax 80102267: 75 f7 jne 80102260 <iderw+0x60> 80102269: 83 c2 58 add $0x58,%edx ; *pp = b; 8010226c: 89 1a mov %ebx,(%edx) // Start disk if necessary. if(idequeue == b) 8010226e: 39 1d 64 b5 10 80 cmp %ebx,0x8010b564 80102274: 75 1b jne 80102291 <iderw+0x91> 80102276: eb 38 jmp 801022b0 <iderw+0xb0> 80102278: 90 nop 80102279: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi idestart(b); // Wait for request to finish. while((b->flags & (B_VALID|B_DIRTY)) != B_VALID){ sleep(b, &idelock); 80102280: b8 80 b5 10 80 mov $0x8010b580,%eax 80102285: 89 44 24 04 mov %eax,0x4(%esp) 80102289: 89 1c 24 mov %ebx,(%esp) 8010228c: e8 3f 1e 00 00 call 801040d0 <sleep> while((b->flags & (B_VALID|B_DIRTY)) != B_VALID){ 80102291: 8b 03 mov (%ebx),%eax 80102293: 83 e0 06 and $0x6,%eax 80102296: 83 f8 02 cmp $0x2,%eax 80102299: 75 e5 jne 80102280 <iderw+0x80> } release(&idelock); 8010229b: c7 45 08 80 b5 10 80 movl $0x8010b580,0x8(%ebp) } 801022a2: 83 c4 14 add $0x14,%esp 801022a5: 5b pop %ebx 801022a6: 5d pop %ebp release(&idelock); 801022a7: e9 e4 31 00 00 jmp 80105490 <release> 801022ac: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi idestart(b); 801022b0: 89 d8 mov %ebx,%eax 801022b2: e8 59 fd ff ff call 80102010 <idestart> 801022b7: eb d8 jmp 80102291 <iderw+0x91> 801022b9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi for(pp=&idequeue; *pp; pp=&(*pp)->qnext) //DOC:insert-queue 801022c0: ba 64 b5 10 80 mov $0x8010b564,%edx 801022c5: eb a5 jmp 8010226c <iderw+0x6c> panic("iderw: nothing to do"); 801022c7: c7 04 24 20 82 10 80 movl $0x80108220,(%esp) 801022ce: e8 9d e0 ff ff call 80100370 <panic> panic("iderw: buf not locked"); 801022d3: c7 04 24 0a 82 10 80 movl $0x8010820a,(%esp) 801022da: e8 91 e0 ff ff call 80100370 <panic> panic("iderw: ide disk 1 not present"); 801022df: c7 04 24 35 82 10 80 movl $0x80108235,(%esp) 801022e6: e8 85 e0 ff ff call 80100370 <panic> 801022eb: 66 90 xchg %ax,%ax 801022ed: 66 90 xchg %ax,%ax 801022ef: 90 nop 801022f0 <ioapicinit>: ioapic->data = data; } void ioapicinit(void) { 801022f0: 55 push %ebp int i, id, maxintr; ioapic = (volatile struct ioapic*)IOAPIC; 801022f1: b8 00 00 c0 fe mov $0xfec00000,%eax { 801022f6: 89 e5 mov %esp,%ebp ioapic->reg = reg; 801022f8: ba 01 00 00 00 mov $0x1,%edx { 801022fd: 56 push %esi 801022fe: 53 push %ebx 801022ff: 83 ec 10 sub $0x10,%esp ioapic = (volatile struct ioapic*)IOAPIC; 80102302: a3 94 36 11 80 mov %eax,0x80113694 ioapic->reg = reg; 80102307: 89 15 00 00 c0 fe mov %edx,0xfec00000 return ioapic->data; 8010230d: a1 94 36 11 80 mov 0x80113694,%eax 80102312: 8b 58 10 mov 0x10(%eax),%ebx ioapic->reg = reg; 80102315: c7 00 00 00 00 00 movl $0x0,(%eax) return ioapic->data; 8010231b: 8b 0d 94 36 11 80 mov 0x80113694,%ecx maxintr = (ioapicread(REG_VER) >> 16) & 0xFF; id = ioapicread(REG_ID) >> 24; if(id != ioapicid) 80102321: 0f b6 15 c0 37 11 80 movzbl 0x801137c0,%edx maxintr = (ioapicread(REG_VER) >> 16) & 0xFF; 80102328: c1 eb 10 shr $0x10,%ebx 8010232b: 0f b6 db movzbl %bl,%ebx return ioapic->data; 8010232e: 8b 41 10 mov 0x10(%ecx),%eax id = ioapicread(REG_ID) >> 24; 80102331: c1 e8 18 shr $0x18,%eax if(id != ioapicid) 80102334: 39 c2 cmp %eax,%edx 80102336: 74 12 je 8010234a <ioapicinit+0x5a> cprintf("ioapicinit: id isn't equal to ioapicid; not a MP\n"); 80102338: c7 04 24 54 82 10 80 movl $0x80108254,(%esp) 8010233f: e8 0c e3 ff ff call 80100650 <cprintf> 80102344: 8b 0d 94 36 11 80 mov 0x80113694,%ecx 8010234a: 83 c3 21 add $0x21,%ebx { 8010234d: ba 10 00 00 00 mov $0x10,%edx 80102352: b8 20 00 00 00 mov $0x20,%eax 80102357: 89 f6 mov %esi,%esi 80102359: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi ioapic->reg = reg; 80102360: 89 11 mov %edx,(%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)); 80102362: 89 c6 mov %eax,%esi 80102364: 40 inc %eax ioapic->data = data; 80102365: 8b 0d 94 36 11 80 mov 0x80113694,%ecx ioapicwrite(REG_TABLE+2*i, INT_DISABLED | (T_IRQ0 + i)); 8010236b: 81 ce 00 00 01 00 or $0x10000,%esi ioapic->data = data; 80102371: 89 71 10 mov %esi,0x10(%ecx) 80102374: 8d 72 01 lea 0x1(%edx),%esi 80102377: 83 c2 02 add $0x2,%edx ioapic->reg = reg; 8010237a: 89 31 mov %esi,(%ecx) for(i = 0; i <= maxintr; i++){ 8010237c: 39 d8 cmp %ebx,%eax ioapic->data = data; 8010237e: 8b 0d 94 36 11 80 mov 0x80113694,%ecx 80102384: c7 41 10 00 00 00 00 movl $0x0,0x10(%ecx) for(i = 0; i <= maxintr; i++){ 8010238b: 75 d3 jne 80102360 <ioapicinit+0x70> ioapicwrite(REG_TABLE+2*i+1, 0); } } 8010238d: 83 c4 10 add $0x10,%esp 80102390: 5b pop %ebx 80102391: 5e pop %esi 80102392: 5d pop %ebp 80102393: c3 ret 80102394: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010239a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 801023a0 <ioapicenable>: void ioapicenable(int irq, int cpunum) { 801023a0: 55 push %ebp ioapic->reg = reg; 801023a1: 8b 0d 94 36 11 80 mov 0x80113694,%ecx { 801023a7: 89 e5 mov %esp,%ebp 801023a9: 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); 801023ac: 8d 50 20 lea 0x20(%eax),%edx 801023af: 8d 44 00 10 lea 0x10(%eax,%eax,1),%eax ioapic->reg = reg; 801023b3: 89 01 mov %eax,(%ecx) ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24); 801023b5: 40 inc %eax ioapic->data = data; 801023b6: 8b 0d 94 36 11 80 mov 0x80113694,%ecx 801023bc: 89 51 10 mov %edx,0x10(%ecx) ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24); 801023bf: 8b 55 0c mov 0xc(%ebp),%edx ioapic->reg = reg; 801023c2: 89 01 mov %eax,(%ecx) ioapic->data = data; 801023c4: a1 94 36 11 80 mov 0x80113694,%eax ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24); 801023c9: c1 e2 18 shl $0x18,%edx ioapic->data = data; 801023cc: 89 50 10 mov %edx,0x10(%eax) } 801023cf: 5d pop %ebp 801023d0: c3 ret 801023d1: 66 90 xchg %ax,%ax 801023d3: 66 90 xchg %ax,%ax 801023d5: 66 90 xchg %ax,%ax 801023d7: 66 90 xchg %ax,%ax 801023d9: 66 90 xchg %ax,%ax 801023db: 66 90 xchg %ax,%ax 801023dd: 66 90 xchg %ax,%ax 801023df: 90 nop 801023e0 <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) { 801023e0: 55 push %ebp 801023e1: 89 e5 mov %esp,%ebp 801023e3: 53 push %ebx 801023e4: 83 ec 14 sub $0x14,%esp 801023e7: 8b 5d 08 mov 0x8(%ebp),%ebx struct run *r; if((uint)v % PGSIZE || v < end || V2P(v) >= PHYSTOP) 801023ea: f7 c3 ff 0f 00 00 test $0xfff,%ebx 801023f0: 0f 85 80 00 00 00 jne 80102476 <kfree+0x96> 801023f6: 81 fb 08 6a 11 80 cmp $0x80116a08,%ebx 801023fc: 72 78 jb 80102476 <kfree+0x96> 801023fe: 8d 83 00 00 00 80 lea -0x80000000(%ebx),%eax 80102404: 3d ff ff ff 0d cmp $0xdffffff,%eax 80102409: 77 6b ja 80102476 <kfree+0x96> panic("kfree"); // Fill with junk to catch dangling refs. memset(v, 1, PGSIZE); 8010240b: ba 00 10 00 00 mov $0x1000,%edx 80102410: b9 01 00 00 00 mov $0x1,%ecx 80102415: 89 54 24 08 mov %edx,0x8(%esp) 80102419: 89 4c 24 04 mov %ecx,0x4(%esp) 8010241d: 89 1c 24 mov %ebx,(%esp) 80102420: e8 bb 30 00 00 call 801054e0 <memset> if(kmem.use_lock) 80102425: a1 d4 36 11 80 mov 0x801136d4,%eax 8010242a: 85 c0 test %eax,%eax 8010242c: 75 3a jne 80102468 <kfree+0x88> acquire(&kmem.lock); r = (struct run*)v; r->next = kmem.freelist; 8010242e: a1 d8 36 11 80 mov 0x801136d8,%eax 80102433: 89 03 mov %eax,(%ebx) kmem.freelist = r; if(kmem.use_lock) 80102435: a1 d4 36 11 80 mov 0x801136d4,%eax kmem.freelist = r; 8010243a: 89 1d d8 36 11 80 mov %ebx,0x801136d8 if(kmem.use_lock) 80102440: 85 c0 test %eax,%eax 80102442: 75 0c jne 80102450 <kfree+0x70> release(&kmem.lock); } 80102444: 83 c4 14 add $0x14,%esp 80102447: 5b pop %ebx 80102448: 5d pop %ebp 80102449: c3 ret 8010244a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi release(&kmem.lock); 80102450: c7 45 08 a0 36 11 80 movl $0x801136a0,0x8(%ebp) } 80102457: 83 c4 14 add $0x14,%esp 8010245a: 5b pop %ebx 8010245b: 5d pop %ebp release(&kmem.lock); 8010245c: e9 2f 30 00 00 jmp 80105490 <release> 80102461: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi acquire(&kmem.lock); 80102468: c7 04 24 a0 36 11 80 movl $0x801136a0,(%esp) 8010246f: e8 7c 2f 00 00 call 801053f0 <acquire> 80102474: eb b8 jmp 8010242e <kfree+0x4e> panic("kfree"); 80102476: c7 04 24 86 82 10 80 movl $0x80108286,(%esp) 8010247d: e8 ee de ff ff call 80100370 <panic> 80102482: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80102489: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102490 <freerange>: { 80102490: 55 push %ebp 80102491: 89 e5 mov %esp,%ebp 80102493: 56 push %esi 80102494: 53 push %ebx 80102495: 83 ec 10 sub $0x10,%esp p = (char*)PGROUNDUP((uint)vstart); 80102498: 8b 45 08 mov 0x8(%ebp),%eax { 8010249b: 8b 75 0c mov 0xc(%ebp),%esi p = (char*)PGROUNDUP((uint)vstart); 8010249e: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx 801024a4: 81 e3 00 f0 ff ff and $0xfffff000,%ebx for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 801024aa: 81 c3 00 10 00 00 add $0x1000,%ebx 801024b0: 39 de cmp %ebx,%esi 801024b2: 72 24 jb 801024d8 <freerange+0x48> 801024b4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801024ba: 8d bf 00 00 00 00 lea 0x0(%edi),%edi kfree(p); 801024c0: 8d 83 00 f0 ff ff lea -0x1000(%ebx),%eax for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 801024c6: 81 c3 00 10 00 00 add $0x1000,%ebx kfree(p); 801024cc: 89 04 24 mov %eax,(%esp) 801024cf: e8 0c ff ff ff call 801023e0 <kfree> for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 801024d4: 39 f3 cmp %esi,%ebx 801024d6: 76 e8 jbe 801024c0 <freerange+0x30> } 801024d8: 83 c4 10 add $0x10,%esp 801024db: 5b pop %ebx 801024dc: 5e pop %esi 801024dd: 5d pop %ebp 801024de: c3 ret 801024df: 90 nop 801024e0 <kinit1>: { 801024e0: 55 push %ebp initlock(&kmem.lock, "kmem"); 801024e1: b8 8c 82 10 80 mov $0x8010828c,%eax { 801024e6: 89 e5 mov %esp,%ebp 801024e8: 56 push %esi 801024e9: 53 push %ebx 801024ea: 83 ec 10 sub $0x10,%esp initlock(&kmem.lock, "kmem"); 801024ed: 89 44 24 04 mov %eax,0x4(%esp) { 801024f1: 8b 75 0c mov 0xc(%ebp),%esi initlock(&kmem.lock, "kmem"); 801024f4: c7 04 24 a0 36 11 80 movl $0x801136a0,(%esp) 801024fb: e8 a0 2d 00 00 call 801052a0 <initlock> p = (char*)PGROUNDUP((uint)vstart); 80102500: 8b 45 08 mov 0x8(%ebp),%eax kmem.use_lock = 0; 80102503: 31 d2 xor %edx,%edx 80102505: 89 15 d4 36 11 80 mov %edx,0x801136d4 p = (char*)PGROUNDUP((uint)vstart); 8010250b: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx 80102511: 81 e3 00 f0 ff ff and $0xfffff000,%ebx for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 80102517: 81 c3 00 10 00 00 add $0x1000,%ebx 8010251d: 39 de cmp %ebx,%esi 8010251f: 72 27 jb 80102548 <kinit1+0x68> 80102521: eb 0d jmp 80102530 <kinit1+0x50> 80102523: 90 nop 80102524: 90 nop 80102525: 90 nop 80102526: 90 nop 80102527: 90 nop 80102528: 90 nop 80102529: 90 nop 8010252a: 90 nop 8010252b: 90 nop 8010252c: 90 nop 8010252d: 90 nop 8010252e: 90 nop 8010252f: 90 nop kfree(p); 80102530: 8d 83 00 f0 ff ff lea -0x1000(%ebx),%eax for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 80102536: 81 c3 00 10 00 00 add $0x1000,%ebx kfree(p); 8010253c: 89 04 24 mov %eax,(%esp) 8010253f: e8 9c fe ff ff call 801023e0 <kfree> for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 80102544: 39 de cmp %ebx,%esi 80102546: 73 e8 jae 80102530 <kinit1+0x50> } 80102548: 83 c4 10 add $0x10,%esp 8010254b: 5b pop %ebx 8010254c: 5e pop %esi 8010254d: 5d pop %ebp 8010254e: c3 ret 8010254f: 90 nop 80102550 <kinit2>: { 80102550: 55 push %ebp 80102551: 89 e5 mov %esp,%ebp 80102553: 56 push %esi 80102554: 53 push %ebx 80102555: 83 ec 10 sub $0x10,%esp p = (char*)PGROUNDUP((uint)vstart); 80102558: 8b 45 08 mov 0x8(%ebp),%eax { 8010255b: 8b 75 0c mov 0xc(%ebp),%esi p = (char*)PGROUNDUP((uint)vstart); 8010255e: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx 80102564: 81 e3 00 f0 ff ff and $0xfffff000,%ebx for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 8010256a: 81 c3 00 10 00 00 add $0x1000,%ebx 80102570: 39 de cmp %ebx,%esi 80102572: 72 24 jb 80102598 <kinit2+0x48> 80102574: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010257a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi kfree(p); 80102580: 8d 83 00 f0 ff ff lea -0x1000(%ebx),%eax for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 80102586: 81 c3 00 10 00 00 add $0x1000,%ebx kfree(p); 8010258c: 89 04 24 mov %eax,(%esp) 8010258f: e8 4c fe ff ff call 801023e0 <kfree> for(; p + PGSIZE <= (char*)vend; p += PGSIZE) 80102594: 39 de cmp %ebx,%esi 80102596: 73 e8 jae 80102580 <kinit2+0x30> kmem.use_lock = 1; 80102598: b8 01 00 00 00 mov $0x1,%eax 8010259d: a3 d4 36 11 80 mov %eax,0x801136d4 } 801025a2: 83 c4 10 add $0x10,%esp 801025a5: 5b pop %ebx 801025a6: 5e pop %esi 801025a7: 5d pop %ebp 801025a8: c3 ret 801025a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801025b0 <kalloc>: char* kalloc(void) { struct run *r; if(kmem.use_lock) 801025b0: a1 d4 36 11 80 mov 0x801136d4,%eax 801025b5: 85 c0 test %eax,%eax 801025b7: 75 1f jne 801025d8 <kalloc+0x28> acquire(&kmem.lock); r = kmem.freelist; 801025b9: a1 d8 36 11 80 mov 0x801136d8,%eax if(r) 801025be: 85 c0 test %eax,%eax 801025c0: 74 0e je 801025d0 <kalloc+0x20> kmem.freelist = r->next; 801025c2: 8b 10 mov (%eax),%edx 801025c4: 89 15 d8 36 11 80 mov %edx,0x801136d8 801025ca: c3 ret 801025cb: 90 nop 801025cc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(kmem.use_lock) release(&kmem.lock); return (char*)r; } 801025d0: c3 ret 801025d1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi { 801025d8: 55 push %ebp 801025d9: 89 e5 mov %esp,%ebp 801025db: 83 ec 28 sub $0x28,%esp acquire(&kmem.lock); 801025de: c7 04 24 a0 36 11 80 movl $0x801136a0,(%esp) 801025e5: e8 06 2e 00 00 call 801053f0 <acquire> r = kmem.freelist; 801025ea: a1 d8 36 11 80 mov 0x801136d8,%eax 801025ef: 8b 15 d4 36 11 80 mov 0x801136d4,%edx if(r) 801025f5: 85 c0 test %eax,%eax 801025f7: 74 08 je 80102601 <kalloc+0x51> kmem.freelist = r->next; 801025f9: 8b 08 mov (%eax),%ecx 801025fb: 89 0d d8 36 11 80 mov %ecx,0x801136d8 if(kmem.use_lock) 80102601: 85 d2 test %edx,%edx 80102603: 74 12 je 80102617 <kalloc+0x67> release(&kmem.lock); 80102605: c7 04 24 a0 36 11 80 movl $0x801136a0,(%esp) 8010260c: 89 45 f4 mov %eax,-0xc(%ebp) 8010260f: e8 7c 2e 00 00 call 80105490 <release> return (char*)r; 80102614: 8b 45 f4 mov -0xc(%ebp),%eax } 80102617: c9 leave 80102618: c3 ret 80102619: 66 90 xchg %ax,%ax 8010261b: 66 90 xchg %ax,%ax 8010261d: 66 90 xchg %ax,%ax 8010261f: 90 nop 80102620 <kbdgetc>: asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102620: ba 64 00 00 00 mov $0x64,%edx 80102625: ec in (%dx),%al normalmap, shiftmap, ctlmap, ctlmap }; uint st, data, c; st = inb(KBSTATP); if((st & KBS_DIB) == 0) 80102626: 24 01 and $0x1,%al 80102628: 84 c0 test %al,%al 8010262a: 0f 84 d0 00 00 00 je 80102700 <kbdgetc+0xe0> { 80102630: 55 push %ebp 80102631: ba 60 00 00 00 mov $0x60,%edx 80102636: 89 e5 mov %esp,%ebp 80102638: 53 push %ebx 80102639: ec in (%dx),%al return -1; data = inb(KBDATAP); 8010263a: 0f b6 d0 movzbl %al,%edx 8010263d: 8b 1d b4 b5 10 80 mov 0x8010b5b4,%ebx if(data == 0xE0){ 80102643: 81 fa e0 00 00 00 cmp $0xe0,%edx 80102649: 0f 84 89 00 00 00 je 801026d8 <kbdgetc+0xb8> 8010264f: 89 d9 mov %ebx,%ecx 80102651: 83 e1 40 and $0x40,%ecx shift |= E0ESC; return 0; } else if(data & 0x80){ 80102654: 84 c0 test %al,%al 80102656: 78 58 js 801026b0 <kbdgetc+0x90> // Key released data = (shift & E0ESC ? data : data & 0x7F); shift &= ~(shiftcode[data] | E0ESC); return 0; } else if(shift & E0ESC){ 80102658: 85 c9 test %ecx,%ecx 8010265a: 74 08 je 80102664 <kbdgetc+0x44> // Last character was an E0 escape; or with 0x80 data |= 0x80; 8010265c: 0c 80 or $0x80,%al shift &= ~E0ESC; 8010265e: 83 e3 bf and $0xffffffbf,%ebx data |= 0x80; 80102661: 0f b6 d0 movzbl %al,%edx } shift |= shiftcode[data]; 80102664: 0f b6 8a c0 83 10 80 movzbl -0x7fef7c40(%edx),%ecx shift ^= togglecode[data]; 8010266b: 0f b6 82 c0 82 10 80 movzbl -0x7fef7d40(%edx),%eax shift |= shiftcode[data]; 80102672: 09 d9 or %ebx,%ecx shift ^= togglecode[data]; 80102674: 31 c1 xor %eax,%ecx c = charcode[shift & (CTL | SHIFT)][data]; 80102676: 89 c8 mov %ecx,%eax 80102678: 83 e0 03 and $0x3,%eax if(shift & CAPSLOCK){ 8010267b: f6 c1 08 test $0x8,%cl c = charcode[shift & (CTL | SHIFT)][data]; 8010267e: 8b 04 85 a0 82 10 80 mov -0x7fef7d60(,%eax,4),%eax shift ^= togglecode[data]; 80102685: 89 0d b4 b5 10 80 mov %ecx,0x8010b5b4 c = charcode[shift & (CTL | SHIFT)][data]; 8010268b: 0f b6 04 10 movzbl (%eax,%edx,1),%eax if(shift & CAPSLOCK){ 8010268f: 74 40 je 801026d1 <kbdgetc+0xb1> if('a' <= c && c <= 'z') 80102691: 8d 50 9f lea -0x61(%eax),%edx 80102694: 83 fa 19 cmp $0x19,%edx 80102697: 76 57 jbe 801026f0 <kbdgetc+0xd0> c += 'A' - 'a'; else if('A' <= c && c <= 'Z') 80102699: 8d 50 bf lea -0x41(%eax),%edx 8010269c: 83 fa 19 cmp $0x19,%edx 8010269f: 77 30 ja 801026d1 <kbdgetc+0xb1> c += 'a' - 'A'; 801026a1: 83 c0 20 add $0x20,%eax } return c; 801026a4: eb 2b jmp 801026d1 <kbdgetc+0xb1> 801026a6: 8d 76 00 lea 0x0(%esi),%esi 801026a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi data = (shift & E0ESC ? data : data & 0x7F); 801026b0: 85 c9 test %ecx,%ecx 801026b2: 75 05 jne 801026b9 <kbdgetc+0x99> 801026b4: 24 7f and $0x7f,%al 801026b6: 0f b6 d0 movzbl %al,%edx shift &= ~(shiftcode[data] | E0ESC); 801026b9: 0f b6 82 c0 83 10 80 movzbl -0x7fef7c40(%edx),%eax 801026c0: 0c 40 or $0x40,%al 801026c2: 0f b6 c8 movzbl %al,%ecx return 0; 801026c5: 31 c0 xor %eax,%eax shift &= ~(shiftcode[data] | E0ESC); 801026c7: f7 d1 not %ecx 801026c9: 21 d9 and %ebx,%ecx 801026cb: 89 0d b4 b5 10 80 mov %ecx,0x8010b5b4 } 801026d1: 5b pop %ebx 801026d2: 5d pop %ebp 801026d3: c3 ret 801026d4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi shift |= E0ESC; 801026d8: 83 cb 40 or $0x40,%ebx return 0; 801026db: 31 c0 xor %eax,%eax shift |= E0ESC; 801026dd: 89 1d b4 b5 10 80 mov %ebx,0x8010b5b4 } 801026e3: 5b pop %ebx 801026e4: 5d pop %ebp 801026e5: c3 ret 801026e6: 8d 76 00 lea 0x0(%esi),%esi 801026e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801026f0: 5b pop %ebx c += 'A' - 'a'; 801026f1: 83 e8 20 sub $0x20,%eax } 801026f4: 5d pop %ebp 801026f5: c3 ret 801026f6: 8d 76 00 lea 0x0(%esi),%esi 801026f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi return -1; 80102700: b8 ff ff ff ff mov $0xffffffff,%eax } 80102705: c3 ret 80102706: 8d 76 00 lea 0x0(%esi),%esi 80102709: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102710 <kbdintr>: void kbdintr(void) { 80102710: 55 push %ebp 80102711: 89 e5 mov %esp,%ebp 80102713: 83 ec 18 sub $0x18,%esp consoleintr(kbdgetc); 80102716: c7 04 24 20 26 10 80 movl $0x80102620,(%esp) 8010271d: e8 ae e0 ff ff call 801007d0 <consoleintr> } 80102722: c9 leave 80102723: c3 ret 80102724: 66 90 xchg %ax,%ax 80102726: 66 90 xchg %ax,%ax 80102728: 66 90 xchg %ax,%ax 8010272a: 66 90 xchg %ax,%ax 8010272c: 66 90 xchg %ax,%ax 8010272e: 66 90 xchg %ax,%ax 80102730 <lapicinit>: } void lapicinit(void) { if(!lapic) 80102730: a1 dc 36 11 80 mov 0x801136dc,%eax { 80102735: 55 push %ebp 80102736: 89 e5 mov %esp,%ebp if(!lapic) 80102738: 85 c0 test %eax,%eax 8010273a: 0f 84 c6 00 00 00 je 80102806 <lapicinit+0xd6> lapic[index] = value; 80102740: ba 3f 01 00 00 mov $0x13f,%edx 80102745: b9 0b 00 00 00 mov $0xb,%ecx 8010274a: 89 90 f0 00 00 00 mov %edx,0xf0(%eax) lapic[ID]; // wait for write to finish, by reading 80102750: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 80102753: 89 88 e0 03 00 00 mov %ecx,0x3e0(%eax) 80102759: b9 80 96 98 00 mov $0x989680,%ecx lapic[ID]; // wait for write to finish, by reading 8010275e: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 80102761: ba 20 00 02 00 mov $0x20020,%edx 80102766: 89 90 20 03 00 00 mov %edx,0x320(%eax) lapic[ID]; // wait for write to finish, by reading 8010276c: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 8010276f: 89 88 80 03 00 00 mov %ecx,0x380(%eax) 80102775: b9 00 00 01 00 mov $0x10000,%ecx lapic[ID]; // wait for write to finish, by reading 8010277a: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 8010277d: ba 00 00 01 00 mov $0x10000,%edx 80102782: 89 90 50 03 00 00 mov %edx,0x350(%eax) lapic[ID]; // wait for write to finish, by reading 80102788: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 8010278b: 89 88 60 03 00 00 mov %ecx,0x360(%eax) lapic[ID]; // wait for write to finish, by reading 80102791: 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) 80102794: 8b 50 30 mov 0x30(%eax),%edx 80102797: c1 ea 10 shr $0x10,%edx 8010279a: 80 fa 03 cmp $0x3,%dl 8010279d: 77 71 ja 80102810 <lapicinit+0xe0> lapic[index] = value; 8010279f: b9 33 00 00 00 mov $0x33,%ecx 801027a4: 89 88 70 03 00 00 mov %ecx,0x370(%eax) 801027aa: 31 c9 xor %ecx,%ecx lapic[ID]; // wait for write to finish, by reading 801027ac: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 801027af: 31 d2 xor %edx,%edx 801027b1: 89 90 80 02 00 00 mov %edx,0x280(%eax) lapic[ID]; // wait for write to finish, by reading 801027b7: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 801027ba: 89 88 80 02 00 00 mov %ecx,0x280(%eax) 801027c0: 31 c9 xor %ecx,%ecx lapic[ID]; // wait for write to finish, by reading 801027c2: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 801027c5: 31 d2 xor %edx,%edx 801027c7: 89 90 b0 00 00 00 mov %edx,0xb0(%eax) lapic[ID]; // wait for write to finish, by reading 801027cd: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 801027d0: 89 88 10 03 00 00 mov %ecx,0x310(%eax) lapic[ID]; // wait for write to finish, by reading 801027d6: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 801027d9: ba 00 85 08 00 mov $0x88500,%edx 801027de: 89 90 00 03 00 00 mov %edx,0x300(%eax) lapic[ID]; // wait for write to finish, by reading 801027e4: 8b 50 20 mov 0x20(%eax),%edx 801027e7: 89 f6 mov %esi,%esi 801027e9: 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) 801027f0: 8b 90 00 03 00 00 mov 0x300(%eax),%edx 801027f6: f6 c6 10 test $0x10,%dh 801027f9: 75 f5 jne 801027f0 <lapicinit+0xc0> lapic[index] = value; 801027fb: 31 d2 xor %edx,%edx 801027fd: 89 90 80 00 00 00 mov %edx,0x80(%eax) lapic[ID]; // wait for write to finish, by reading 80102803: 8b 40 20 mov 0x20(%eax),%eax ; // Enable interrupts on the APIC (but not on the processor). lapicw(TPR, 0); } 80102806: 5d pop %ebp 80102807: c3 ret 80102808: 90 nop 80102809: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi lapic[index] = value; 80102810: b9 00 00 01 00 mov $0x10000,%ecx 80102815: 89 88 40 03 00 00 mov %ecx,0x340(%eax) lapic[ID]; // wait for write to finish, by reading 8010281b: 8b 50 20 mov 0x20(%eax),%edx 8010281e: e9 7c ff ff ff jmp 8010279f <lapicinit+0x6f> 80102823: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80102829: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102830 <lapicid>: int lapicid(void) { if (!lapic) 80102830: a1 dc 36 11 80 mov 0x801136dc,%eax { 80102835: 55 push %ebp 80102836: 89 e5 mov %esp,%ebp if (!lapic) 80102838: 85 c0 test %eax,%eax 8010283a: 74 0c je 80102848 <lapicid+0x18> return 0; return lapic[ID] >> 24; 8010283c: 8b 40 20 mov 0x20(%eax),%eax } 8010283f: 5d pop %ebp return lapic[ID] >> 24; 80102840: c1 e8 18 shr $0x18,%eax } 80102843: c3 ret 80102844: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return 0; 80102848: 31 c0 xor %eax,%eax } 8010284a: 5d pop %ebp 8010284b: c3 ret 8010284c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102850 <lapiceoi>: // Acknowledge interrupt. void lapiceoi(void) { if(lapic) 80102850: a1 dc 36 11 80 mov 0x801136dc,%eax { 80102855: 55 push %ebp 80102856: 89 e5 mov %esp,%ebp if(lapic) 80102858: 85 c0 test %eax,%eax 8010285a: 74 0b je 80102867 <lapiceoi+0x17> lapic[index] = value; 8010285c: 31 d2 xor %edx,%edx 8010285e: 89 90 b0 00 00 00 mov %edx,0xb0(%eax) lapic[ID]; // wait for write to finish, by reading 80102864: 8b 40 20 mov 0x20(%eax),%eax lapicw(EOI, 0); } 80102867: 5d pop %ebp 80102868: c3 ret 80102869: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80102870 <microdelay>: // Spin for a given number of microseconds. // On real hardware would want to tune this dynamically. void microdelay(int us) { 80102870: 55 push %ebp 80102871: 89 e5 mov %esp,%ebp } 80102873: 5d pop %ebp 80102874: c3 ret 80102875: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102879: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102880 <lapicstartap>: // Start additional processor running entry code at addr. // See Appendix B of MultiProcessor Specification. void lapicstartap(uchar apicid, uint addr) { 80102880: 55 push %ebp asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102881: b0 0f mov $0xf,%al 80102883: 89 e5 mov %esp,%ebp 80102885: ba 70 00 00 00 mov $0x70,%edx 8010288a: 53 push %ebx 8010288b: 0f b6 4d 08 movzbl 0x8(%ebp),%ecx 8010288f: 8b 5d 0c mov 0xc(%ebp),%ebx 80102892: ee out %al,(%dx) 80102893: b0 0a mov $0xa,%al 80102895: ba 71 00 00 00 mov $0x71,%edx 8010289a: 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; 8010289b: 31 c0 xor %eax,%eax 8010289d: 66 a3 67 04 00 80 mov %ax,0x80000467 wrv[1] = addr >> 4; 801028a3: 89 d8 mov %ebx,%eax 801028a5: c1 e8 04 shr $0x4,%eax 801028a8: 66 a3 69 04 00 80 mov %ax,0x80000469 // "Universal startup algorithm." // Send INIT (level-triggered) interrupt to reset other CPU. lapicw(ICRHI, apicid<<24); 801028ae: c1 e1 18 shl $0x18,%ecx lapic[index] = value; 801028b1: a1 dc 36 11 80 mov 0x801136dc,%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)); 801028b6: c1 eb 0c shr $0xc,%ebx 801028b9: 81 cb 00 06 00 00 or $0x600,%ebx lapic[index] = value; 801028bf: 89 88 10 03 00 00 mov %ecx,0x310(%eax) lapic[ID]; // wait for write to finish, by reading 801028c5: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 801028c8: ba 00 c5 00 00 mov $0xc500,%edx 801028cd: 89 90 00 03 00 00 mov %edx,0x300(%eax) lapic[ID]; // wait for write to finish, by reading 801028d3: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 801028d6: ba 00 85 00 00 mov $0x8500,%edx 801028db: 89 90 00 03 00 00 mov %edx,0x300(%eax) lapic[ID]; // wait for write to finish, by reading 801028e1: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 801028e4: 89 88 10 03 00 00 mov %ecx,0x310(%eax) lapic[ID]; // wait for write to finish, by reading 801028ea: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 801028ed: 89 98 00 03 00 00 mov %ebx,0x300(%eax) lapic[ID]; // wait for write to finish, by reading 801028f3: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 801028f6: 89 88 10 03 00 00 mov %ecx,0x310(%eax) lapic[ID]; // wait for write to finish, by reading 801028fc: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 801028ff: 89 98 00 03 00 00 mov %ebx,0x300(%eax) microdelay(200); } } 80102905: 5b pop %ebx lapic[ID]; // wait for write to finish, by reading 80102906: 8b 40 20 mov 0x20(%eax),%eax } 80102909: 5d pop %ebp 8010290a: c3 ret 8010290b: 90 nop 8010290c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102910 <cmostime>: } // qemu seems to use 24-hour GWT and the values are BCD encoded void cmostime(struct rtcdate *r) { 80102910: 55 push %ebp 80102911: b0 0b mov $0xb,%al 80102913: 89 e5 mov %esp,%ebp 80102915: ba 70 00 00 00 mov $0x70,%edx 8010291a: 57 push %edi 8010291b: 56 push %esi 8010291c: 53 push %ebx 8010291d: 83 ec 5c sub $0x5c,%esp 80102920: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102921: ba 71 00 00 00 mov $0x71,%edx 80102926: ec in (%dx),%al 80102927: 24 04 and $0x4,%al asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102929: be 70 00 00 00 mov $0x70,%esi 8010292e: 88 45 b2 mov %al,-0x4e(%ebp) 80102931: 8d 7d d0 lea -0x30(%ebp),%edi 80102934: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010293a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80102940: 31 c0 xor %eax,%eax 80102942: 89 f2 mov %esi,%edx 80102944: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102945: bb 71 00 00 00 mov $0x71,%ebx 8010294a: 89 da mov %ebx,%edx 8010294c: ec in (%dx),%al 8010294d: 88 45 b7 mov %al,-0x49(%ebp) asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102950: 89 f2 mov %esi,%edx 80102952: b0 02 mov $0x2,%al 80102954: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102955: 89 da mov %ebx,%edx 80102957: ec in (%dx),%al 80102958: 88 45 b6 mov %al,-0x4a(%ebp) asm volatile("out %0,%1" : : "a" (data), "d" (port)); 8010295b: 89 f2 mov %esi,%edx 8010295d: b0 04 mov $0x4,%al 8010295f: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102960: 89 da mov %ebx,%edx 80102962: ec in (%dx),%al 80102963: 88 45 b5 mov %al,-0x4b(%ebp) asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102966: 89 f2 mov %esi,%edx 80102968: b0 07 mov $0x7,%al 8010296a: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010296b: 89 da mov %ebx,%edx 8010296d: ec in (%dx),%al 8010296e: 88 45 b4 mov %al,-0x4c(%ebp) asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102971: 89 f2 mov %esi,%edx 80102973: b0 08 mov $0x8,%al 80102975: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102976: 89 da mov %ebx,%edx 80102978: ec in (%dx),%al 80102979: 88 45 b3 mov %al,-0x4d(%ebp) asm volatile("out %0,%1" : : "a" (data), "d" (port)); 8010297c: 89 f2 mov %esi,%edx 8010297e: b0 09 mov $0x9,%al 80102980: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102981: 89 da mov %ebx,%edx 80102983: ec in (%dx),%al 80102984: 0f b6 c8 movzbl %al,%ecx asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102987: 89 f2 mov %esi,%edx 80102989: b0 0a mov $0xa,%al 8010298b: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 8010298c: 89 da mov %ebx,%edx 8010298e: 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) 8010298f: 84 c0 test %al,%al 80102991: 78 ad js 80102940 <cmostime+0x30> return inb(CMOS_RETURN); 80102993: 0f b6 45 b7 movzbl -0x49(%ebp),%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80102997: 89 f2 mov %esi,%edx 80102999: 89 4d cc mov %ecx,-0x34(%ebp) 8010299c: 89 45 b8 mov %eax,-0x48(%ebp) 8010299f: 0f b6 45 b6 movzbl -0x4a(%ebp),%eax 801029a3: 89 45 bc mov %eax,-0x44(%ebp) 801029a6: 0f b6 45 b5 movzbl -0x4b(%ebp),%eax 801029aa: 89 45 c0 mov %eax,-0x40(%ebp) 801029ad: 0f b6 45 b4 movzbl -0x4c(%ebp),%eax 801029b1: 89 45 c4 mov %eax,-0x3c(%ebp) 801029b4: 0f b6 45 b3 movzbl -0x4d(%ebp),%eax 801029b8: 89 45 c8 mov %eax,-0x38(%ebp) 801029bb: 31 c0 xor %eax,%eax 801029bd: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 801029be: 89 da mov %ebx,%edx 801029c0: ec in (%dx),%al 801029c1: 0f b6 c0 movzbl %al,%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 801029c4: 89 f2 mov %esi,%edx 801029c6: 89 45 d0 mov %eax,-0x30(%ebp) 801029c9: b0 02 mov $0x2,%al 801029cb: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 801029cc: 89 da mov %ebx,%edx 801029ce: ec in (%dx),%al 801029cf: 0f b6 c0 movzbl %al,%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 801029d2: 89 f2 mov %esi,%edx 801029d4: 89 45 d4 mov %eax,-0x2c(%ebp) 801029d7: b0 04 mov $0x4,%al 801029d9: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 801029da: 89 da mov %ebx,%edx 801029dc: ec in (%dx),%al 801029dd: 0f b6 c0 movzbl %al,%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 801029e0: 89 f2 mov %esi,%edx 801029e2: 89 45 d8 mov %eax,-0x28(%ebp) 801029e5: b0 07 mov $0x7,%al 801029e7: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 801029e8: 89 da mov %ebx,%edx 801029ea: ec in (%dx),%al 801029eb: 0f b6 c0 movzbl %al,%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 801029ee: 89 f2 mov %esi,%edx 801029f0: 89 45 dc mov %eax,-0x24(%ebp) 801029f3: b0 08 mov $0x8,%al 801029f5: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 801029f6: 89 da mov %ebx,%edx 801029f8: ec in (%dx),%al 801029f9: 0f b6 c0 movzbl %al,%eax asm volatile("out %0,%1" : : "a" (data), "d" (port)); 801029fc: 89 f2 mov %esi,%edx 801029fe: 89 45 e0 mov %eax,-0x20(%ebp) 80102a01: b0 09 mov $0x9,%al 80102a03: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80102a04: 89 da mov %ebx,%edx 80102a06: ec in (%dx),%al 80102a07: 0f b6 c0 movzbl %al,%eax 80102a0a: 89 45 e4 mov %eax,-0x1c(%ebp) continue; fill_rtcdate(&t2); if(memcmp(&t1, &t2, sizeof(t1)) == 0) 80102a0d: b8 18 00 00 00 mov $0x18,%eax 80102a12: 89 44 24 08 mov %eax,0x8(%esp) 80102a16: 8d 45 b8 lea -0x48(%ebp),%eax 80102a19: 89 7c 24 04 mov %edi,0x4(%esp) 80102a1d: 89 04 24 mov %eax,(%esp) 80102a20: e8 1b 2b 00 00 call 80105540 <memcmp> 80102a25: 85 c0 test %eax,%eax 80102a27: 0f 85 13 ff ff ff jne 80102940 <cmostime+0x30> break; } // convert if(bcd) { 80102a2d: 80 7d b2 00 cmpb $0x0,-0x4e(%ebp) 80102a31: 75 78 jne 80102aab <cmostime+0x19b> #define CONV(x) (t1.x = ((t1.x >> 4) * 10) + (t1.x & 0xf)) CONV(second); 80102a33: 8b 45 b8 mov -0x48(%ebp),%eax 80102a36: 89 c2 mov %eax,%edx 80102a38: 83 e0 0f and $0xf,%eax 80102a3b: c1 ea 04 shr $0x4,%edx 80102a3e: 8d 14 92 lea (%edx,%edx,4),%edx 80102a41: 8d 04 50 lea (%eax,%edx,2),%eax 80102a44: 89 45 b8 mov %eax,-0x48(%ebp) CONV(minute); 80102a47: 8b 45 bc mov -0x44(%ebp),%eax 80102a4a: 89 c2 mov %eax,%edx 80102a4c: 83 e0 0f and $0xf,%eax 80102a4f: c1 ea 04 shr $0x4,%edx 80102a52: 8d 14 92 lea (%edx,%edx,4),%edx 80102a55: 8d 04 50 lea (%eax,%edx,2),%eax 80102a58: 89 45 bc mov %eax,-0x44(%ebp) CONV(hour ); 80102a5b: 8b 45 c0 mov -0x40(%ebp),%eax 80102a5e: 89 c2 mov %eax,%edx 80102a60: 83 e0 0f and $0xf,%eax 80102a63: c1 ea 04 shr $0x4,%edx 80102a66: 8d 14 92 lea (%edx,%edx,4),%edx 80102a69: 8d 04 50 lea (%eax,%edx,2),%eax 80102a6c: 89 45 c0 mov %eax,-0x40(%ebp) CONV(day ); 80102a6f: 8b 45 c4 mov -0x3c(%ebp),%eax 80102a72: 89 c2 mov %eax,%edx 80102a74: 83 e0 0f and $0xf,%eax 80102a77: c1 ea 04 shr $0x4,%edx 80102a7a: 8d 14 92 lea (%edx,%edx,4),%edx 80102a7d: 8d 04 50 lea (%eax,%edx,2),%eax 80102a80: 89 45 c4 mov %eax,-0x3c(%ebp) CONV(month ); 80102a83: 8b 45 c8 mov -0x38(%ebp),%eax 80102a86: 89 c2 mov %eax,%edx 80102a88: 83 e0 0f and $0xf,%eax 80102a8b: c1 ea 04 shr $0x4,%edx 80102a8e: 8d 14 92 lea (%edx,%edx,4),%edx 80102a91: 8d 04 50 lea (%eax,%edx,2),%eax 80102a94: 89 45 c8 mov %eax,-0x38(%ebp) CONV(year ); 80102a97: 8b 45 cc mov -0x34(%ebp),%eax 80102a9a: 89 c2 mov %eax,%edx 80102a9c: 83 e0 0f and $0xf,%eax 80102a9f: c1 ea 04 shr $0x4,%edx 80102aa2: 8d 14 92 lea (%edx,%edx,4),%edx 80102aa5: 8d 04 50 lea (%eax,%edx,2),%eax 80102aa8: 89 45 cc mov %eax,-0x34(%ebp) #undef CONV } *r = t1; 80102aab: 31 c0 xor %eax,%eax 80102aad: 8b 54 05 b8 mov -0x48(%ebp,%eax,1),%edx 80102ab1: 8b 7d 08 mov 0x8(%ebp),%edi 80102ab4: 89 14 07 mov %edx,(%edi,%eax,1) 80102ab7: 83 c0 04 add $0x4,%eax 80102aba: 83 f8 18 cmp $0x18,%eax 80102abd: 72 ee jb 80102aad <cmostime+0x19d> r->year += 2000; 80102abf: 81 47 14 d0 07 00 00 addl $0x7d0,0x14(%edi) } 80102ac6: 83 c4 5c add $0x5c,%esp 80102ac9: 5b pop %ebx 80102aca: 5e pop %esi 80102acb: 5f pop %edi 80102acc: 5d pop %ebp 80102acd: c3 ret 80102ace: 66 90 xchg %ax,%ax 80102ad0 <install_trans>: static void install_trans(void) { int tail; for (tail = 0; tail < log.lh.n; tail++) { 80102ad0: 8b 15 28 37 11 80 mov 0x80113728,%edx 80102ad6: 85 d2 test %edx,%edx 80102ad8: 0f 8e 92 00 00 00 jle 80102b70 <install_trans+0xa0> { 80102ade: 55 push %ebp 80102adf: 89 e5 mov %esp,%ebp 80102ae1: 57 push %edi 80102ae2: 56 push %esi 80102ae3: 53 push %ebx for (tail = 0; tail < log.lh.n; tail++) { 80102ae4: 31 db xor %ebx,%ebx { 80102ae6: 83 ec 1c sub $0x1c,%esp 80102ae9: 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 80102af0: a1 14 37 11 80 mov 0x80113714,%eax 80102af5: 01 d8 add %ebx,%eax 80102af7: 40 inc %eax 80102af8: 89 44 24 04 mov %eax,0x4(%esp) 80102afc: a1 24 37 11 80 mov 0x80113724,%eax 80102b01: 89 04 24 mov %eax,(%esp) 80102b04: e8 c7 d5 ff ff call 801000d0 <bread> 80102b09: 89 c7 mov %eax,%edi struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst 80102b0b: 8b 04 9d 2c 37 11 80 mov -0x7feec8d4(,%ebx,4),%eax for (tail = 0; tail < log.lh.n; tail++) { 80102b12: 43 inc %ebx struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst 80102b13: 89 44 24 04 mov %eax,0x4(%esp) 80102b17: a1 24 37 11 80 mov 0x80113724,%eax 80102b1c: 89 04 24 mov %eax,(%esp) 80102b1f: e8 ac d5 ff ff call 801000d0 <bread> 80102b24: 89 c6 mov %eax,%esi memmove(dbuf->data, lbuf->data, BSIZE); // copy block to dst 80102b26: b8 00 02 00 00 mov $0x200,%eax 80102b2b: 89 44 24 08 mov %eax,0x8(%esp) 80102b2f: 8d 47 5c lea 0x5c(%edi),%eax 80102b32: 89 44 24 04 mov %eax,0x4(%esp) 80102b36: 8d 46 5c lea 0x5c(%esi),%eax 80102b39: 89 04 24 mov %eax,(%esp) 80102b3c: e8 5f 2a 00 00 call 801055a0 <memmove> bwrite(dbuf); // write dst to disk 80102b41: 89 34 24 mov %esi,(%esp) 80102b44: e8 57 d6 ff ff call 801001a0 <bwrite> brelse(lbuf); 80102b49: 89 3c 24 mov %edi,(%esp) 80102b4c: e8 8f d6 ff ff call 801001e0 <brelse> brelse(dbuf); 80102b51: 89 34 24 mov %esi,(%esp) 80102b54: e8 87 d6 ff ff call 801001e0 <brelse> for (tail = 0; tail < log.lh.n; tail++) { 80102b59: 39 1d 28 37 11 80 cmp %ebx,0x80113728 80102b5f: 7f 8f jg 80102af0 <install_trans+0x20> } } 80102b61: 83 c4 1c add $0x1c,%esp 80102b64: 5b pop %ebx 80102b65: 5e pop %esi 80102b66: 5f pop %edi 80102b67: 5d pop %ebp 80102b68: c3 ret 80102b69: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80102b70: c3 ret 80102b71: eb 0d jmp 80102b80 <write_head> 80102b73: 90 nop 80102b74: 90 nop 80102b75: 90 nop 80102b76: 90 nop 80102b77: 90 nop 80102b78: 90 nop 80102b79: 90 nop 80102b7a: 90 nop 80102b7b: 90 nop 80102b7c: 90 nop 80102b7d: 90 nop 80102b7e: 90 nop 80102b7f: 90 nop 80102b80 <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) { 80102b80: 55 push %ebp 80102b81: 89 e5 mov %esp,%ebp 80102b83: 56 push %esi 80102b84: 53 push %ebx 80102b85: 83 ec 10 sub $0x10,%esp struct buf *buf = bread(log.dev, log.start); 80102b88: a1 14 37 11 80 mov 0x80113714,%eax 80102b8d: 89 44 24 04 mov %eax,0x4(%esp) 80102b91: a1 24 37 11 80 mov 0x80113724,%eax 80102b96: 89 04 24 mov %eax,(%esp) 80102b99: e8 32 d5 ff ff call 801000d0 <bread> struct logheader *hb = (struct logheader *) (buf->data); int i; hb->n = log.lh.n; 80102b9e: 8b 1d 28 37 11 80 mov 0x80113728,%ebx for (i = 0; i < log.lh.n; i++) { 80102ba4: 85 db test %ebx,%ebx struct buf *buf = bread(log.dev, log.start); 80102ba6: 89 c6 mov %eax,%esi hb->n = log.lh.n; 80102ba8: 89 58 5c mov %ebx,0x5c(%eax) for (i = 0; i < log.lh.n; i++) { 80102bab: 7e 24 jle 80102bd1 <write_head+0x51> 80102bad: c1 e3 02 shl $0x2,%ebx 80102bb0: 31 d2 xor %edx,%edx 80102bb2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80102bb9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi hb->block[i] = log.lh.block[i]; 80102bc0: 8b 8a 2c 37 11 80 mov -0x7feec8d4(%edx),%ecx 80102bc6: 89 4c 16 60 mov %ecx,0x60(%esi,%edx,1) 80102bca: 83 c2 04 add $0x4,%edx for (i = 0; i < log.lh.n; i++) { 80102bcd: 39 da cmp %ebx,%edx 80102bcf: 75 ef jne 80102bc0 <write_head+0x40> } bwrite(buf); 80102bd1: 89 34 24 mov %esi,(%esp) 80102bd4: e8 c7 d5 ff ff call 801001a0 <bwrite> brelse(buf); 80102bd9: 89 34 24 mov %esi,(%esp) 80102bdc: e8 ff d5 ff ff call 801001e0 <brelse> } 80102be1: 83 c4 10 add $0x10,%esp 80102be4: 5b pop %ebx 80102be5: 5e pop %esi 80102be6: 5d pop %ebp 80102be7: c3 ret 80102be8: 90 nop 80102be9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80102bf0 <initlog>: { 80102bf0: 55 push %ebp initlock(&log.lock, "log"); 80102bf1: ba c0 84 10 80 mov $0x801084c0,%edx { 80102bf6: 89 e5 mov %esp,%ebp 80102bf8: 53 push %ebx 80102bf9: 83 ec 34 sub $0x34,%esp 80102bfc: 8b 5d 08 mov 0x8(%ebp),%ebx initlock(&log.lock, "log"); 80102bff: 89 54 24 04 mov %edx,0x4(%esp) 80102c03: c7 04 24 e0 36 11 80 movl $0x801136e0,(%esp) 80102c0a: e8 91 26 00 00 call 801052a0 <initlock> readsb(dev, &sb); 80102c0f: 8d 45 dc lea -0x24(%ebp),%eax 80102c12: 89 44 24 04 mov %eax,0x4(%esp) 80102c16: 89 1c 24 mov %ebx,(%esp) 80102c19: e8 b2 e7 ff ff call 801013d0 <readsb> log.start = sb.logstart; 80102c1e: 8b 45 ec mov -0x14(%ebp),%eax log.size = sb.nlog; 80102c21: 8b 55 e8 mov -0x18(%ebp),%edx struct buf *buf = bread(log.dev, log.start); 80102c24: 89 1c 24 mov %ebx,(%esp) log.dev = dev; 80102c27: 89 1d 24 37 11 80 mov %ebx,0x80113724 struct buf *buf = bread(log.dev, log.start); 80102c2d: 89 44 24 04 mov %eax,0x4(%esp) log.start = sb.logstart; 80102c31: a3 14 37 11 80 mov %eax,0x80113714 log.size = sb.nlog; 80102c36: 89 15 18 37 11 80 mov %edx,0x80113718 struct buf *buf = bread(log.dev, log.start); 80102c3c: e8 8f d4 ff ff call 801000d0 <bread> log.lh.n = lh->n; 80102c41: 8b 58 5c mov 0x5c(%eax),%ebx for (i = 0; i < log.lh.n; i++) { 80102c44: 85 db test %ebx,%ebx log.lh.n = lh->n; 80102c46: 89 1d 28 37 11 80 mov %ebx,0x80113728 for (i = 0; i < log.lh.n; i++) { 80102c4c: 7e 23 jle 80102c71 <initlog+0x81> 80102c4e: c1 e3 02 shl $0x2,%ebx 80102c51: 31 d2 xor %edx,%edx 80102c53: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80102c59: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi log.lh.block[i] = lh->block[i]; 80102c60: 8b 4c 10 60 mov 0x60(%eax,%edx,1),%ecx 80102c64: 83 c2 04 add $0x4,%edx 80102c67: 89 8a 28 37 11 80 mov %ecx,-0x7feec8d8(%edx) for (i = 0; i < log.lh.n; i++) { 80102c6d: 39 d3 cmp %edx,%ebx 80102c6f: 75 ef jne 80102c60 <initlog+0x70> brelse(buf); 80102c71: 89 04 24 mov %eax,(%esp) 80102c74: e8 67 d5 ff ff call 801001e0 <brelse> static void recover_from_log(void) { read_head(); install_trans(); // if committed, copy from log to disk 80102c79: e8 52 fe ff ff call 80102ad0 <install_trans> log.lh.n = 0; 80102c7e: 31 c0 xor %eax,%eax 80102c80: a3 28 37 11 80 mov %eax,0x80113728 write_head(); // clear the log 80102c85: e8 f6 fe ff ff call 80102b80 <write_head> } 80102c8a: 83 c4 34 add $0x34,%esp 80102c8d: 5b pop %ebx 80102c8e: 5d pop %ebp 80102c8f: c3 ret 80102c90 <begin_op>: } // called at the start of each FS system call. void begin_op(void) { 80102c90: 55 push %ebp 80102c91: 89 e5 mov %esp,%ebp 80102c93: 83 ec 18 sub $0x18,%esp acquire(&log.lock); 80102c96: c7 04 24 e0 36 11 80 movl $0x801136e0,(%esp) 80102c9d: e8 4e 27 00 00 call 801053f0 <acquire> 80102ca2: eb 19 jmp 80102cbd <begin_op+0x2d> 80102ca4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi while(1){ if(log.committing){ sleep(&log, &log.lock); 80102ca8: b8 e0 36 11 80 mov $0x801136e0,%eax 80102cad: 89 44 24 04 mov %eax,0x4(%esp) 80102cb1: c7 04 24 e0 36 11 80 movl $0x801136e0,(%esp) 80102cb8: e8 13 14 00 00 call 801040d0 <sleep> if(log.committing){ 80102cbd: 8b 15 20 37 11 80 mov 0x80113720,%edx 80102cc3: 85 d2 test %edx,%edx 80102cc5: 75 e1 jne 80102ca8 <begin_op+0x18> } else if(log.lh.n + (log.outstanding+1)*MAXOPBLOCKS > LOGSIZE){ 80102cc7: a1 1c 37 11 80 mov 0x8011371c,%eax 80102ccc: 8b 15 28 37 11 80 mov 0x80113728,%edx 80102cd2: 40 inc %eax 80102cd3: 8d 0c 80 lea (%eax,%eax,4),%ecx 80102cd6: 8d 14 4a lea (%edx,%ecx,2),%edx 80102cd9: 83 fa 1e cmp $0x1e,%edx 80102cdc: 7f ca jg 80102ca8 <begin_op+0x18> // this op might exhaust log space; wait for commit. sleep(&log, &log.lock); } else { log.outstanding += 1; release(&log.lock); 80102cde: c7 04 24 e0 36 11 80 movl $0x801136e0,(%esp) log.outstanding += 1; 80102ce5: a3 1c 37 11 80 mov %eax,0x8011371c release(&log.lock); 80102cea: e8 a1 27 00 00 call 80105490 <release> break; } } } 80102cef: c9 leave 80102cf0: c3 ret 80102cf1: eb 0d jmp 80102d00 <end_op> 80102cf3: 90 nop 80102cf4: 90 nop 80102cf5: 90 nop 80102cf6: 90 nop 80102cf7: 90 nop 80102cf8: 90 nop 80102cf9: 90 nop 80102cfa: 90 nop 80102cfb: 90 nop 80102cfc: 90 nop 80102cfd: 90 nop 80102cfe: 90 nop 80102cff: 90 nop 80102d00 <end_op>: // called at the end of each FS system call. // commits if this was the last outstanding operation. void end_op(void) { 80102d00: 55 push %ebp 80102d01: 89 e5 mov %esp,%ebp 80102d03: 57 push %edi 80102d04: 56 push %esi 80102d05: 53 push %ebx 80102d06: 83 ec 1c sub $0x1c,%esp int do_commit = 0; acquire(&log.lock); 80102d09: c7 04 24 e0 36 11 80 movl $0x801136e0,(%esp) 80102d10: e8 db 26 00 00 call 801053f0 <acquire> log.outstanding -= 1; 80102d15: a1 1c 37 11 80 mov 0x8011371c,%eax 80102d1a: 8d 58 ff lea -0x1(%eax),%ebx if(log.committing) 80102d1d: a1 20 37 11 80 mov 0x80113720,%eax log.outstanding -= 1; 80102d22: 89 1d 1c 37 11 80 mov %ebx,0x8011371c if(log.committing) 80102d28: 85 c0 test %eax,%eax 80102d2a: 0f 85 e8 00 00 00 jne 80102e18 <end_op+0x118> panic("log.committing"); if(log.outstanding == 0){ 80102d30: 85 db test %ebx,%ebx 80102d32: 0f 85 c0 00 00 00 jne 80102df8 <end_op+0xf8> do_commit = 1; log.committing = 1; 80102d38: be 01 00 00 00 mov $0x1,%esi // begin_op() may be waiting for log space, // and decrementing log.outstanding has decreased // the amount of reserved space. wakeup(&log); } release(&log.lock); 80102d3d: c7 04 24 e0 36 11 80 movl $0x801136e0,(%esp) log.committing = 1; 80102d44: 89 35 20 37 11 80 mov %esi,0x80113720 release(&log.lock); 80102d4a: e8 41 27 00 00 call 80105490 <release> } static void commit() { if (log.lh.n > 0) { 80102d4f: 8b 3d 28 37 11 80 mov 0x80113728,%edi 80102d55: 85 ff test %edi,%edi 80102d57: 0f 8e 88 00 00 00 jle 80102de5 <end_op+0xe5> struct buf *to = bread(log.dev, log.start+tail+1); // log block 80102d5d: a1 14 37 11 80 mov 0x80113714,%eax 80102d62: 01 d8 add %ebx,%eax 80102d64: 40 inc %eax 80102d65: 89 44 24 04 mov %eax,0x4(%esp) 80102d69: a1 24 37 11 80 mov 0x80113724,%eax 80102d6e: 89 04 24 mov %eax,(%esp) 80102d71: e8 5a d3 ff ff call 801000d0 <bread> 80102d76: 89 c6 mov %eax,%esi struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block 80102d78: 8b 04 9d 2c 37 11 80 mov -0x7feec8d4(,%ebx,4),%eax for (tail = 0; tail < log.lh.n; tail++) { 80102d7f: 43 inc %ebx struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block 80102d80: 89 44 24 04 mov %eax,0x4(%esp) 80102d84: a1 24 37 11 80 mov 0x80113724,%eax 80102d89: 89 04 24 mov %eax,(%esp) 80102d8c: e8 3f d3 ff ff call 801000d0 <bread> memmove(to->data, from->data, BSIZE); 80102d91: b9 00 02 00 00 mov $0x200,%ecx 80102d96: 89 4c 24 08 mov %ecx,0x8(%esp) struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block 80102d9a: 89 c7 mov %eax,%edi memmove(to->data, from->data, BSIZE); 80102d9c: 8d 40 5c lea 0x5c(%eax),%eax 80102d9f: 89 44 24 04 mov %eax,0x4(%esp) 80102da3: 8d 46 5c lea 0x5c(%esi),%eax 80102da6: 89 04 24 mov %eax,(%esp) 80102da9: e8 f2 27 00 00 call 801055a0 <memmove> bwrite(to); // write the log 80102dae: 89 34 24 mov %esi,(%esp) 80102db1: e8 ea d3 ff ff call 801001a0 <bwrite> brelse(from); 80102db6: 89 3c 24 mov %edi,(%esp) 80102db9: e8 22 d4 ff ff call 801001e0 <brelse> brelse(to); 80102dbe: 89 34 24 mov %esi,(%esp) 80102dc1: e8 1a d4 ff ff call 801001e0 <brelse> for (tail = 0; tail < log.lh.n; tail++) { 80102dc6: 3b 1d 28 37 11 80 cmp 0x80113728,%ebx 80102dcc: 7c 8f jl 80102d5d <end_op+0x5d> write_log(); // Write modified blocks from cache to log write_head(); // Write header to disk -- the real commit 80102dce: e8 ad fd ff ff call 80102b80 <write_head> install_trans(); // Now install writes to home locations 80102dd3: e8 f8 fc ff ff call 80102ad0 <install_trans> log.lh.n = 0; 80102dd8: 31 d2 xor %edx,%edx 80102dda: 89 15 28 37 11 80 mov %edx,0x80113728 write_head(); // Erase the transaction from the log 80102de0: e8 9b fd ff ff call 80102b80 <write_head> acquire(&log.lock); 80102de5: c7 04 24 e0 36 11 80 movl $0x801136e0,(%esp) 80102dec: e8 ff 25 00 00 call 801053f0 <acquire> log.committing = 0; 80102df1: 31 c0 xor %eax,%eax 80102df3: a3 20 37 11 80 mov %eax,0x80113720 wakeup(&log); 80102df8: c7 04 24 e0 36 11 80 movl $0x801136e0,(%esp) 80102dff: e8 ac 14 00 00 call 801042b0 <wakeup> release(&log.lock); 80102e04: c7 04 24 e0 36 11 80 movl $0x801136e0,(%esp) 80102e0b: e8 80 26 00 00 call 80105490 <release> } 80102e10: 83 c4 1c add $0x1c,%esp 80102e13: 5b pop %ebx 80102e14: 5e pop %esi 80102e15: 5f pop %edi 80102e16: 5d pop %ebp 80102e17: c3 ret panic("log.committing"); 80102e18: c7 04 24 c4 84 10 80 movl $0x801084c4,(%esp) 80102e1f: e8 4c d5 ff ff call 80100370 <panic> 80102e24: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80102e2a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80102e30 <log_write>: // modify bp->data[] // log_write(bp) // brelse(bp) void log_write(struct buf *b) { 80102e30: 55 push %ebp 80102e31: 89 e5 mov %esp,%ebp 80102e33: 53 push %ebx 80102e34: 83 ec 14 sub $0x14,%esp int i; if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1) 80102e37: 8b 15 28 37 11 80 mov 0x80113728,%edx { 80102e3d: 8b 5d 08 mov 0x8(%ebp),%ebx if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1) 80102e40: 83 fa 1d cmp $0x1d,%edx 80102e43: 0f 8f 95 00 00 00 jg 80102ede <log_write+0xae> 80102e49: a1 18 37 11 80 mov 0x80113718,%eax 80102e4e: 48 dec %eax 80102e4f: 39 c2 cmp %eax,%edx 80102e51: 0f 8d 87 00 00 00 jge 80102ede <log_write+0xae> panic("too big a transaction"); if (log.outstanding < 1) 80102e57: a1 1c 37 11 80 mov 0x8011371c,%eax 80102e5c: 85 c0 test %eax,%eax 80102e5e: 0f 8e 86 00 00 00 jle 80102eea <log_write+0xba> panic("log_write outside of trans"); acquire(&log.lock); 80102e64: c7 04 24 e0 36 11 80 movl $0x801136e0,(%esp) 80102e6b: e8 80 25 00 00 call 801053f0 <acquire> for (i = 0; i < log.lh.n; i++) { 80102e70: 8b 0d 28 37 11 80 mov 0x80113728,%ecx 80102e76: 83 f9 00 cmp $0x0,%ecx 80102e79: 7e 55 jle 80102ed0 <log_write+0xa0> if (log.lh.block[i] == b->blockno) // log absorbtion 80102e7b: 8b 53 08 mov 0x8(%ebx),%edx for (i = 0; i < log.lh.n; i++) { 80102e7e: 31 c0 xor %eax,%eax if (log.lh.block[i] == b->blockno) // log absorbtion 80102e80: 3b 15 2c 37 11 80 cmp 0x8011372c,%edx 80102e86: 75 11 jne 80102e99 <log_write+0x69> 80102e88: eb 36 jmp 80102ec0 <log_write+0x90> 80102e8a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80102e90: 39 14 85 2c 37 11 80 cmp %edx,-0x7feec8d4(,%eax,4) 80102e97: 74 27 je 80102ec0 <log_write+0x90> for (i = 0; i < log.lh.n; i++) { 80102e99: 40 inc %eax 80102e9a: 39 c1 cmp %eax,%ecx 80102e9c: 75 f2 jne 80102e90 <log_write+0x60> break; } log.lh.block[i] = b->blockno; 80102e9e: 89 14 85 2c 37 11 80 mov %edx,-0x7feec8d4(,%eax,4) if (i == log.lh.n) log.lh.n++; 80102ea5: 40 inc %eax 80102ea6: a3 28 37 11 80 mov %eax,0x80113728 b->flags |= B_DIRTY; // prevent eviction 80102eab: 83 0b 04 orl $0x4,(%ebx) release(&log.lock); 80102eae: c7 45 08 e0 36 11 80 movl $0x801136e0,0x8(%ebp) } 80102eb5: 83 c4 14 add $0x14,%esp 80102eb8: 5b pop %ebx 80102eb9: 5d pop %ebp release(&log.lock); 80102eba: e9 d1 25 00 00 jmp 80105490 <release> 80102ebf: 90 nop log.lh.block[i] = b->blockno; 80102ec0: 89 14 85 2c 37 11 80 mov %edx,-0x7feec8d4(,%eax,4) 80102ec7: eb e2 jmp 80102eab <log_write+0x7b> 80102ec9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80102ed0: 8b 43 08 mov 0x8(%ebx),%eax 80102ed3: a3 2c 37 11 80 mov %eax,0x8011372c if (i == log.lh.n) 80102ed8: 75 d1 jne 80102eab <log_write+0x7b> 80102eda: 31 c0 xor %eax,%eax 80102edc: eb c7 jmp 80102ea5 <log_write+0x75> panic("too big a transaction"); 80102ede: c7 04 24 d3 84 10 80 movl $0x801084d3,(%esp) 80102ee5: e8 86 d4 ff ff call 80100370 <panic> panic("log_write outside of trans"); 80102eea: c7 04 24 e9 84 10 80 movl $0x801084e9,(%esp) 80102ef1: e8 7a d4 ff ff call 80100370 <panic> 80102ef6: 66 90 xchg %ax,%ax 80102ef8: 66 90 xchg %ax,%ax 80102efa: 66 90 xchg %ax,%ax 80102efc: 66 90 xchg %ax,%ax 80102efe: 66 90 xchg %ax,%ax 80102f00 <mpenter>: } // Other CPUs jump here from entryother.S. static void mpenter(void) { 80102f00: 55 push %ebp 80102f01: 89 e5 mov %esp,%ebp 80102f03: 53 push %ebx 80102f04: 83 ec 14 sub $0x14,%esp switchkvm(); 80102f07: e8 04 4a 00 00 call 80107910 <switchkvm> seginit(); 80102f0c: e8 6f 49 00 00 call 80107880 <seginit> lapicinit(); 80102f11: e8 1a f8 ff ff call 80102730 <lapicinit> } static void mpmain(void) //called by the non-boot AP cpus { struct cpu* c = mycpu(); 80102f16: e8 05 0a 00 00 call 80103920 <mycpu> 80102f1b: 89 c3 mov %eax,%ebx cprintf("cpu%d: is witing for the \"pioneer\" cpu to finish its initialization.\n", cpuid()); 80102f1d: e8 7e 0a 00 00 call 801039a0 <cpuid> 80102f22: c7 04 24 04 85 10 80 movl $0x80108504,(%esp) 80102f29: 89 44 24 04 mov %eax,0x4(%esp) 80102f2d: e8 1e d7 ff ff call 80100650 <cprintf> idtinit(); // load idt register 80102f32: e8 89 38 00 00 call 801067c0 <idtinit> xchg(volatile uint *addr, uint newval) { uint result; // The + in "+m" denotes a read-modify-write operand. asm volatile("lock; xchgl %0, %1" : 80102f37: b8 01 00 00 00 mov $0x1,%eax 80102f3c: f0 87 83 a0 00 00 00 lock xchg %eax,0xa0(%ebx) 80102f43: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80102f49: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi xchg(&(c->started), 1); // tell startothers() we're up while(c->started != 0); // wait for the "pioneer" cpu to finish the scheduling data structures initialization 80102f50: 8b 83 a0 00 00 00 mov 0xa0(%ebx),%eax 80102f56: 85 c0 test %eax,%eax 80102f58: 75 f6 jne 80102f50 <mpenter+0x50> cprintf("cpu%d: starting %d\n", cpuid(), cpuid()); 80102f5a: e8 41 0a 00 00 call 801039a0 <cpuid> 80102f5f: 89 c3 mov %eax,%ebx 80102f61: e8 3a 0a 00 00 call 801039a0 <cpuid> 80102f66: 89 5c 24 08 mov %ebx,0x8(%esp) 80102f6a: c7 04 24 54 85 10 80 movl $0x80108554,(%esp) 80102f71: 89 44 24 04 mov %eax,0x4(%esp) 80102f75: e8 d6 d6 ff ff call 80100650 <cprintf> scheduler(); // start running processes 80102f7a: e8 b1 0e 00 00 call 80103e30 <scheduler> 80102f7f: 90 nop 80102f80 <main>: { 80102f80: 55 push %ebp kinit1(end, P2V(4*1024*1024)); // phys page allocator 80102f81: b8 00 00 40 80 mov $0x80400000,%eax { 80102f86: 89 e5 mov %esp,%ebp 80102f88: 53 push %ebx 80102f89: 83 e4 f0 and $0xfffffff0,%esp 80102f8c: 83 ec 10 sub $0x10,%esp kinit1(end, P2V(4*1024*1024)); // phys page allocator 80102f8f: 89 44 24 04 mov %eax,0x4(%esp) 80102f93: c7 04 24 08 6a 11 80 movl $0x80116a08,(%esp) 80102f9a: e8 41 f5 ff ff call 801024e0 <kinit1> kvmalloc(); // kernel page table 80102f9f: e8 3c 4e 00 00 call 80107de0 <kvmalloc> mpinit(); // detect other processors 80102fa4: e8 17 02 00 00 call 801031c0 <mpinit> lapicinit(); // interrupt controller 80102fa9: e8 82 f7 ff ff call 80102730 <lapicinit> 80102fae: 66 90 xchg %ax,%ax seginit(); // segment descriptors 80102fb0: e8 cb 48 00 00 call 80107880 <seginit> picinit(); // disable pic 80102fb5: e8 e6 03 00 00 call 801033a0 <picinit> ioapicinit(); // another interrupt controller 80102fba: e8 31 f3 ff ff call 801022f0 <ioapicinit> 80102fbf: 90 nop consoleinit(); // console hardware 80102fc0: e8 bb d9 ff ff call 80100980 <consoleinit> uartinit(); // serial port 80102fc5: e8 86 3b 00 00 call 80106b50 <uartinit> pinit(); // process table 80102fca: e8 31 09 00 00 call 80103900 <pinit> 80102fcf: 90 nop tvinit(); // trap vectors 80102fd0: e8 6b 37 00 00 call 80106740 <tvinit> binit(); // buffer cache 80102fd5: e8 66 d0 ff ff call 80100040 <binit> fileinit(); // file table 80102fda: e8 71 dd ff ff call 80100d50 <fileinit> 80102fdf: 90 nop ideinit(); // disk 80102fe0: e8 fb f0 ff ff call 801020e0 <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); 80102fe5: b8 8a 00 00 00 mov $0x8a,%eax 80102fea: 89 44 24 08 mov %eax,0x8(%esp) 80102fee: b8 8c b4 10 80 mov $0x8010b48c,%eax 80102ff3: 89 44 24 04 mov %eax,0x4(%esp) 80102ff7: c7 04 24 00 70 00 80 movl $0x80007000,(%esp) 80102ffe: e8 9d 25 00 00 call 801055a0 <memmove> for(c = cpus; c < cpus+ncpu; c++){ 80103003: a1 60 3d 11 80 mov 0x80113d60,%eax 80103008: 8d 14 80 lea (%eax,%eax,4),%edx 8010300b: 8d 04 50 lea (%eax,%edx,2),%eax 8010300e: c1 e0 04 shl $0x4,%eax 80103011: 05 e0 37 11 80 add $0x801137e0,%eax 80103016: 3d e0 37 11 80 cmp $0x801137e0,%eax 8010301b: 0f 86 86 00 00 00 jbe 801030a7 <main+0x127> 80103021: bb e0 37 11 80 mov $0x801137e0,%ebx 80103026: 8d 76 00 lea 0x0(%esi),%esi 80103029: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi if(c == mycpu()) // We've started already. 80103030: e8 eb 08 00 00 call 80103920 <mycpu> 80103035: 39 d8 cmp %ebx,%eax 80103037: 74 51 je 8010308a <main+0x10a> 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(); 80103039: e8 72 f5 ff ff call 801025b0 <kalloc> *(void**)(code-4) = stack + KSTACKSIZE; *(void(**)(void))(code-8) = mpenter; 8010303e: ba 00 2f 10 80 mov $0x80102f00,%edx *(int**)(code-12) = (void *) V2P(entrypgdir); 80103043: b9 00 a0 10 00 mov $0x10a000,%ecx *(void(**)(void))(code-8) = mpenter; 80103048: 89 15 f8 6f 00 80 mov %edx,0x80006ff8 *(int**)(code-12) = (void *) V2P(entrypgdir); 8010304e: 89 0d f4 6f 00 80 mov %ecx,0x80006ff4 *(void**)(code-4) = stack + KSTACKSIZE; 80103054: 05 00 10 00 00 add $0x1000,%eax 80103059: a3 fc 6f 00 80 mov %eax,0x80006ffc lapicstartap(c->apicid, V2P(code)); 8010305e: b8 00 70 00 00 mov $0x7000,%eax 80103063: 89 44 24 04 mov %eax,0x4(%esp) 80103067: 0f b6 03 movzbl (%ebx),%eax 8010306a: 89 04 24 mov %eax,(%esp) 8010306d: e8 0e f8 ff ff call 80102880 <lapicstartap> 80103072: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80103079: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi // wait for cpu to finish mpmain() while(c->started == 0) 80103080: 8b 83 a0 00 00 00 mov 0xa0(%ebx),%eax 80103086: 85 c0 test %eax,%eax 80103088: 74 f6 je 80103080 <main+0x100> for(c = cpus; c < cpus+ncpu; c++){ 8010308a: a1 60 3d 11 80 mov 0x80113d60,%eax 8010308f: 81 c3 b0 00 00 00 add $0xb0,%ebx 80103095: 8d 14 80 lea (%eax,%eax,4),%edx 80103098: 8d 04 50 lea (%eax,%edx,2),%eax 8010309b: c1 e0 04 shl $0x4,%eax 8010309e: 05 e0 37 11 80 add $0x801137e0,%eax 801030a3: 39 c3 cmp %eax,%ebx 801030a5: 72 89 jb 80103030 <main+0xb0> kinit2(P2V(4*1024*1024), P2V(PHYSTOP)); // must come after startothers() 801030a7: b8 00 00 00 8e mov $0x8e000000,%eax 801030ac: 89 44 24 04 mov %eax,0x4(%esp) 801030b0: c7 04 24 00 00 40 80 movl $0x80400000,(%esp) 801030b7: e8 94 f4 ff ff call 80102550 <kinit2> initSchedDS(); // initialize the data structures for the processes sceduling policies 801030bc: e8 4f 17 00 00 call 80104810 <initSchedDS> __sync_synchronize(); 801030c1: f0 83 0c 24 00 lock orl $0x0,(%esp) for(struct cpu *c = cpus; c < cpus + ncpu; ++c) //releases the non-boot AP cpus that are wating at mpmain at main.c 801030c6: a1 60 3d 11 80 mov 0x80113d60,%eax 801030cb: 8d 14 80 lea (%eax,%eax,4),%edx 801030ce: 8d 0c 50 lea (%eax,%edx,2),%ecx 801030d1: c1 e1 04 shl $0x4,%ecx 801030d4: 81 c1 e0 37 11 80 add $0x801137e0,%ecx 801030da: 81 f9 e0 37 11 80 cmp $0x801137e0,%ecx 801030e0: 76 21 jbe 80103103 <main+0x183> 801030e2: ba e0 37 11 80 mov $0x801137e0,%edx 801030e7: 31 db xor %ebx,%ebx 801030e9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801030f0: 89 d8 mov %ebx,%eax 801030f2: f0 87 82 a0 00 00 00 lock xchg %eax,0xa0(%edx) 801030f9: 81 c2 b0 00 00 00 add $0xb0,%edx 801030ff: 39 ca cmp %ecx,%edx 80103101: 72 ed jb 801030f0 <main+0x170> userinit(); // first user process 80103103: e8 08 0a 00 00 call 80103b10 <userinit> cprintf("\"pioneer\" cpu%d: starting %d\n", cpuid(), cpuid()); 80103108: e8 93 08 00 00 call 801039a0 <cpuid> 8010310d: 89 c3 mov %eax,%ebx 8010310f: e8 8c 08 00 00 call 801039a0 <cpuid> 80103114: 89 5c 24 08 mov %ebx,0x8(%esp) 80103118: c7 04 24 4a 85 10 80 movl $0x8010854a,(%esp) 8010311f: 89 44 24 04 mov %eax,0x4(%esp) 80103123: e8 28 d5 ff ff call 80100650 <cprintf> idtinit(); // load idt register 80103128: e8 93 36 00 00 call 801067c0 <idtinit> scheduler(); // start running processes 8010312d: e8 fe 0c 00 00 call 80103e30 <scheduler> 80103132: 66 90 xchg %ax,%ax 80103134: 66 90 xchg %ax,%ax 80103136: 66 90 xchg %ax,%ax 80103138: 66 90 xchg %ax,%ax 8010313a: 66 90 xchg %ax,%ax 8010313c: 66 90 xchg %ax,%ax 8010313e: 66 90 xchg %ax,%ax 80103140 <mpsearch1>: } // Look for an MP structure in the len bytes at addr. static struct mp* mpsearch1(uint a, int len) { 80103140: 55 push %ebp 80103141: 89 e5 mov %esp,%ebp 80103143: 57 push %edi 80103144: 56 push %esi uchar *e, *p, *addr; addr = P2V(a); 80103145: 8d b0 00 00 00 80 lea -0x80000000(%eax),%esi { 8010314b: 53 push %ebx e = addr+len; 8010314c: 8d 1c 16 lea (%esi,%edx,1),%ebx { 8010314f: 83 ec 1c sub $0x1c,%esp for(p = addr; p < e; p += sizeof(struct mp)) 80103152: 39 de cmp %ebx,%esi 80103154: 72 10 jb 80103166 <mpsearch1+0x26> 80103156: eb 58 jmp 801031b0 <mpsearch1+0x70> 80103158: 90 nop 80103159: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80103160: 39 d3 cmp %edx,%ebx 80103162: 89 d6 mov %edx,%esi 80103164: 76 4a jbe 801031b0 <mpsearch1+0x70> if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0) 80103166: ba 68 85 10 80 mov $0x80108568,%edx 8010316b: b8 04 00 00 00 mov $0x4,%eax 80103170: 89 54 24 04 mov %edx,0x4(%esp) 80103174: 89 44 24 08 mov %eax,0x8(%esp) 80103178: 89 34 24 mov %esi,(%esp) 8010317b: e8 c0 23 00 00 call 80105540 <memcmp> 80103180: 8d 56 10 lea 0x10(%esi),%edx 80103183: 85 c0 test %eax,%eax 80103185: 75 d9 jne 80103160 <mpsearch1+0x20> 80103187: 89 f1 mov %esi,%ecx 80103189: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi sum += addr[i]; 80103190: 0f b6 39 movzbl (%ecx),%edi 80103193: 41 inc %ecx 80103194: 01 f8 add %edi,%eax for(i=0; i<len; i++) 80103196: 39 d1 cmp %edx,%ecx 80103198: 75 f6 jne 80103190 <mpsearch1+0x50> if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0) 8010319a: 84 c0 test %al,%al 8010319c: 75 c2 jne 80103160 <mpsearch1+0x20> return (struct mp*)p; return 0; } 8010319e: 83 c4 1c add $0x1c,%esp 801031a1: 89 f0 mov %esi,%eax 801031a3: 5b pop %ebx 801031a4: 5e pop %esi 801031a5: 5f pop %edi 801031a6: 5d pop %ebp 801031a7: c3 ret 801031a8: 90 nop 801031a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801031b0: 83 c4 1c add $0x1c,%esp return 0; 801031b3: 31 f6 xor %esi,%esi } 801031b5: 5b pop %ebx 801031b6: 89 f0 mov %esi,%eax 801031b8: 5e pop %esi 801031b9: 5f pop %edi 801031ba: 5d pop %ebp 801031bb: c3 ret 801031bc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801031c0 <mpinit>: return conf; } void mpinit(void) { 801031c0: 55 push %ebp 801031c1: 89 e5 mov %esp,%ebp 801031c3: 57 push %edi 801031c4: 56 push %esi 801031c5: 53 push %ebx 801031c6: 83 ec 2c sub $0x2c,%esp if((p = ((bda[0x0F]<<8)| bda[0x0E]) << 4)){ 801031c9: 0f b6 05 0f 04 00 80 movzbl 0x8000040f,%eax 801031d0: 0f b6 15 0e 04 00 80 movzbl 0x8000040e,%edx 801031d7: c1 e0 08 shl $0x8,%eax 801031da: 09 d0 or %edx,%eax 801031dc: c1 e0 04 shl $0x4,%eax 801031df: 75 1b jne 801031fc <mpinit+0x3c> p = ((bda[0x14]<<8)|bda[0x13])*1024; 801031e1: 0f b6 05 14 04 00 80 movzbl 0x80000414,%eax 801031e8: 0f b6 15 13 04 00 80 movzbl 0x80000413,%edx 801031ef: c1 e0 08 shl $0x8,%eax 801031f2: 09 d0 or %edx,%eax 801031f4: c1 e0 0a shl $0xa,%eax if((mp = mpsearch1(p-1024, 1024))) 801031f7: 2d 00 04 00 00 sub $0x400,%eax if((mp = mpsearch1(p, 1024))) 801031fc: ba 00 04 00 00 mov $0x400,%edx 80103201: e8 3a ff ff ff call 80103140 <mpsearch1> 80103206: 85 c0 test %eax,%eax 80103208: 89 45 e4 mov %eax,-0x1c(%ebp) 8010320b: 0f 84 4f 01 00 00 je 80103360 <mpinit+0x1a0> if((mp = mpsearch()) == 0 || mp->physaddr == 0) 80103211: 8b 45 e4 mov -0x1c(%ebp),%eax 80103214: 8b 58 04 mov 0x4(%eax),%ebx 80103217: 85 db test %ebx,%ebx 80103219: 0f 84 61 01 00 00 je 80103380 <mpinit+0x1c0> if(memcmp(conf, "PCMP", 4) != 0) 8010321f: b8 04 00 00 00 mov $0x4,%eax 80103224: ba 85 85 10 80 mov $0x80108585,%edx conf = (struct mpconf*) P2V((uint) mp->physaddr); 80103229: 8d b3 00 00 00 80 lea -0x80000000(%ebx),%esi if(memcmp(conf, "PCMP", 4) != 0) 8010322f: 89 44 24 08 mov %eax,0x8(%esp) 80103233: 89 54 24 04 mov %edx,0x4(%esp) 80103237: 89 34 24 mov %esi,(%esp) 8010323a: e8 01 23 00 00 call 80105540 <memcmp> 8010323f: 85 c0 test %eax,%eax 80103241: 0f 85 39 01 00 00 jne 80103380 <mpinit+0x1c0> if(conf->version != 1 && conf->version != 4) 80103247: 0f b6 83 06 00 00 80 movzbl -0x7ffffffa(%ebx),%eax 8010324e: 3c 01 cmp $0x1,%al 80103250: 0f 95 c2 setne %dl 80103253: 3c 04 cmp $0x4,%al 80103255: 0f 95 c0 setne %al 80103258: 20 d0 and %dl,%al 8010325a: 0f 85 20 01 00 00 jne 80103380 <mpinit+0x1c0> if(sum((uchar*)conf, conf->length) != 0) 80103260: 0f b7 bb 04 00 00 80 movzwl -0x7ffffffc(%ebx),%edi for(i=0; i<len; i++) 80103267: 85 ff test %edi,%edi 80103269: 74 24 je 8010328f <mpinit+0xcf> 8010326b: 89 f0 mov %esi,%eax 8010326d: 01 f7 add %esi,%edi sum = 0; 8010326f: 31 d2 xor %edx,%edx 80103271: eb 0d jmp 80103280 <mpinit+0xc0> 80103273: 90 nop 80103274: 90 nop 80103275: 90 nop 80103276: 90 nop 80103277: 90 nop 80103278: 90 nop 80103279: 90 nop 8010327a: 90 nop 8010327b: 90 nop 8010327c: 90 nop 8010327d: 90 nop 8010327e: 90 nop 8010327f: 90 nop sum += addr[i]; 80103280: 0f b6 08 movzbl (%eax),%ecx 80103283: 40 inc %eax 80103284: 01 ca add %ecx,%edx for(i=0; i<len; i++) 80103286: 39 c7 cmp %eax,%edi 80103288: 75 f6 jne 80103280 <mpinit+0xc0> 8010328a: 84 d2 test %dl,%dl 8010328c: 0f 95 c0 setne %al struct mp *mp; struct mpconf *conf; struct mpproc *proc; struct mpioapic *ioapic; if((conf = mpconfig(&mp)) == 0) 8010328f: 85 f6 test %esi,%esi 80103291: 0f 84 e9 00 00 00 je 80103380 <mpinit+0x1c0> 80103297: 84 c0 test %al,%al 80103299: 0f 85 e1 00 00 00 jne 80103380 <mpinit+0x1c0> panic("Expect to run on an SMP"); ismp = 1; lapic = (uint*)conf->lapicaddr; 8010329f: 8b 83 24 00 00 80 mov -0x7fffffdc(%ebx),%eax for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){ 801032a5: 8d 93 2c 00 00 80 lea -0x7fffffd4(%ebx),%edx ismp = 1; 801032ab: b9 01 00 00 00 mov $0x1,%ecx lapic = (uint*)conf->lapicaddr; 801032b0: a3 dc 36 11 80 mov %eax,0x801136dc for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){ 801032b5: 0f b7 83 04 00 00 80 movzwl -0x7ffffffc(%ebx),%eax 801032bc: 01 c6 add %eax,%esi 801032be: 66 90 xchg %ax,%ax 801032c0: 39 d6 cmp %edx,%esi 801032c2: 76 23 jbe 801032e7 <mpinit+0x127> switch(*p){ 801032c4: 0f b6 02 movzbl (%edx),%eax 801032c7: 3c 04 cmp $0x4,%al 801032c9: 0f 87 c9 00 00 00 ja 80103398 <mpinit+0x1d8> 801032cf: ff 24 85 ac 85 10 80 jmp *-0x7fef7a54(,%eax,4) 801032d6: 8d 76 00 lea 0x0(%esi),%esi 801032d9: 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; 801032e0: 83 c2 08 add $0x8,%edx for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){ 801032e3: 39 d6 cmp %edx,%esi 801032e5: 77 dd ja 801032c4 <mpinit+0x104> default: ismp = 0; break; } } if(!ismp) 801032e7: 85 c9 test %ecx,%ecx 801032e9: 0f 84 9d 00 00 00 je 8010338c <mpinit+0x1cc> panic("Didn't find a suitable machine"); if(mp->imcrp){ 801032ef: 8b 45 e4 mov -0x1c(%ebp),%eax 801032f2: 80 78 0c 00 cmpb $0x0,0xc(%eax) 801032f6: 74 11 je 80103309 <mpinit+0x149> asm volatile("out %0,%1" : : "a" (data), "d" (port)); 801032f8: b0 70 mov $0x70,%al 801032fa: ba 22 00 00 00 mov $0x22,%edx 801032ff: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80103300: ba 23 00 00 00 mov $0x23,%edx 80103305: 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. 80103306: 0c 01 or $0x1,%al asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80103308: ee out %al,(%dx) } } 80103309: 83 c4 2c add $0x2c,%esp 8010330c: 5b pop %ebx 8010330d: 5e pop %esi 8010330e: 5f pop %edi 8010330f: 5d pop %ebp 80103310: c3 ret 80103311: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if(ncpu < NCPU) { 80103318: 8b 1d 60 3d 11 80 mov 0x80113d60,%ebx 8010331e: 83 fb 07 cmp $0x7,%ebx 80103321: 7f 1a jg 8010333d <mpinit+0x17d> cpus[ncpu].apicid = proc->apicid; // apicid may differ from ncpu 80103323: 0f b6 42 01 movzbl 0x1(%edx),%eax 80103327: 8d 3c 9b lea (%ebx,%ebx,4),%edi 8010332a: 8d 3c 7b lea (%ebx,%edi,2),%edi ncpu++; 8010332d: 43 inc %ebx cpus[ncpu].apicid = proc->apicid; // apicid may differ from ncpu 8010332e: c1 e7 04 shl $0x4,%edi ncpu++; 80103331: 89 1d 60 3d 11 80 mov %ebx,0x80113d60 cpus[ncpu].apicid = proc->apicid; // apicid may differ from ncpu 80103337: 88 87 e0 37 11 80 mov %al,-0x7feec820(%edi) p += sizeof(struct mpproc); 8010333d: 83 c2 14 add $0x14,%edx continue; 80103340: e9 7b ff ff ff jmp 801032c0 <mpinit+0x100> 80103345: 8d 76 00 lea 0x0(%esi),%esi ioapicid = ioapic->apicno; 80103348: 0f b6 42 01 movzbl 0x1(%edx),%eax p += sizeof(struct mpioapic); 8010334c: 83 c2 08 add $0x8,%edx ioapicid = ioapic->apicno; 8010334f: a2 c0 37 11 80 mov %al,0x801137c0 continue; 80103354: e9 67 ff ff ff jmp 801032c0 <mpinit+0x100> 80103359: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return mpsearch1(0xF0000, 0x10000); 80103360: ba 00 00 01 00 mov $0x10000,%edx 80103365: b8 00 00 0f 00 mov $0xf0000,%eax 8010336a: e8 d1 fd ff ff call 80103140 <mpsearch1> if((mp = mpsearch()) == 0 || mp->physaddr == 0) 8010336f: 85 c0 test %eax,%eax return mpsearch1(0xF0000, 0x10000); 80103371: 89 45 e4 mov %eax,-0x1c(%ebp) if((mp = mpsearch()) == 0 || mp->physaddr == 0) 80103374: 0f 85 97 fe ff ff jne 80103211 <mpinit+0x51> 8010337a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi panic("Expect to run on an SMP"); 80103380: c7 04 24 6d 85 10 80 movl $0x8010856d,(%esp) 80103387: e8 e4 cf ff ff call 80100370 <panic> panic("Didn't find a suitable machine"); 8010338c: c7 04 24 8c 85 10 80 movl $0x8010858c,(%esp) 80103393: e8 d8 cf ff ff call 80100370 <panic> ismp = 0; 80103398: 31 c9 xor %ecx,%ecx 8010339a: e9 28 ff ff ff jmp 801032c7 <mpinit+0x107> 8010339f: 90 nop 801033a0 <picinit>: #define IO_PIC2 0xA0 // Slave (IRQs 8-15) // Don't use the 8259A interrupt controllers. Xv6 assumes SMP hardware. void picinit(void) { 801033a0: 55 push %ebp 801033a1: b0 ff mov $0xff,%al 801033a3: 89 e5 mov %esp,%ebp 801033a5: ba 21 00 00 00 mov $0x21,%edx 801033aa: ee out %al,(%dx) 801033ab: ba a1 00 00 00 mov $0xa1,%edx 801033b0: ee out %al,(%dx) // mask all interrupts outb(IO_PIC1+1, 0xFF); outb(IO_PIC2+1, 0xFF); } 801033b1: 5d pop %ebp 801033b2: c3 ret 801033b3: 66 90 xchg %ax,%ax 801033b5: 66 90 xchg %ax,%ax 801033b7: 66 90 xchg %ax,%ax 801033b9: 66 90 xchg %ax,%ax 801033bb: 66 90 xchg %ax,%ax 801033bd: 66 90 xchg %ax,%ax 801033bf: 90 nop 801033c0 <pipealloc>: int writeopen; // write fd is still open }; int pipealloc(struct file **f0, struct file **f1) { 801033c0: 55 push %ebp 801033c1: 89 e5 mov %esp,%ebp 801033c3: 56 push %esi 801033c4: 53 push %ebx 801033c5: 83 ec 20 sub $0x20,%esp 801033c8: 8b 5d 08 mov 0x8(%ebp),%ebx 801033cb: 8b 75 0c mov 0xc(%ebp),%esi struct pipe *p; p = 0; *f0 = *f1 = 0; 801033ce: c7 06 00 00 00 00 movl $0x0,(%esi) 801033d4: c7 03 00 00 00 00 movl $0x0,(%ebx) if((*f0 = filealloc()) == 0 || (*f1 = filealloc()) == 0) 801033da: e8 91 d9 ff ff call 80100d70 <filealloc> 801033df: 85 c0 test %eax,%eax 801033e1: 89 03 mov %eax,(%ebx) 801033e3: 74 1b je 80103400 <pipealloc+0x40> 801033e5: e8 86 d9 ff ff call 80100d70 <filealloc> 801033ea: 85 c0 test %eax,%eax 801033ec: 89 06 mov %eax,(%esi) 801033ee: 74 30 je 80103420 <pipealloc+0x60> goto bad; if((p = (struct pipe*)kalloc()) == 0) 801033f0: e8 bb f1 ff ff call 801025b0 <kalloc> 801033f5: 85 c0 test %eax,%eax 801033f7: 75 47 jne 80103440 <pipealloc+0x80> //PAGEBREAK: 20 bad: if(p) kfree((char*)p); if(*f0) 801033f9: 8b 03 mov (%ebx),%eax 801033fb: 85 c0 test %eax,%eax 801033fd: 75 27 jne 80103426 <pipealloc+0x66> 801033ff: 90 nop fileclose(*f0); if(*f1) 80103400: 8b 06 mov (%esi),%eax 80103402: 85 c0 test %eax,%eax 80103404: 74 08 je 8010340e <pipealloc+0x4e> fileclose(*f1); 80103406: 89 04 24 mov %eax,(%esp) 80103409: e8 22 da ff ff call 80100e30 <fileclose> return -1; } 8010340e: 83 c4 20 add $0x20,%esp return -1; 80103411: b8 ff ff ff ff mov $0xffffffff,%eax } 80103416: 5b pop %ebx 80103417: 5e pop %esi 80103418: 5d pop %ebp 80103419: c3 ret 8010341a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if(*f0) 80103420: 8b 03 mov (%ebx),%eax 80103422: 85 c0 test %eax,%eax 80103424: 74 e8 je 8010340e <pipealloc+0x4e> fileclose(*f0); 80103426: 89 04 24 mov %eax,(%esp) 80103429: e8 02 da ff ff call 80100e30 <fileclose> if(*f1) 8010342e: 8b 06 mov (%esi),%eax 80103430: 85 c0 test %eax,%eax 80103432: 75 d2 jne 80103406 <pipealloc+0x46> 80103434: eb d8 jmp 8010340e <pipealloc+0x4e> 80103436: 8d 76 00 lea 0x0(%esi),%esi 80103439: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi p->readopen = 1; 80103440: ba 01 00 00 00 mov $0x1,%edx p->writeopen = 1; 80103445: b9 01 00 00 00 mov $0x1,%ecx p->readopen = 1; 8010344a: 89 90 3c 02 00 00 mov %edx,0x23c(%eax) p->nwrite = 0; 80103450: 31 d2 xor %edx,%edx p->writeopen = 1; 80103452: 89 88 40 02 00 00 mov %ecx,0x240(%eax) p->nread = 0; 80103458: 31 c9 xor %ecx,%ecx p->nwrite = 0; 8010345a: 89 90 38 02 00 00 mov %edx,0x238(%eax) initlock(&p->lock, "pipe"); 80103460: ba c0 85 10 80 mov $0x801085c0,%edx p->nread = 0; 80103465: 89 88 34 02 00 00 mov %ecx,0x234(%eax) initlock(&p->lock, "pipe"); 8010346b: 89 54 24 04 mov %edx,0x4(%esp) 8010346f: 89 04 24 mov %eax,(%esp) 80103472: 89 45 f4 mov %eax,-0xc(%ebp) 80103475: e8 26 1e 00 00 call 801052a0 <initlock> (*f0)->type = FD_PIPE; 8010347a: 8b 13 mov (%ebx),%edx (*f0)->pipe = p; 8010347c: 8b 45 f4 mov -0xc(%ebp),%eax (*f0)->type = FD_PIPE; 8010347f: c7 02 01 00 00 00 movl $0x1,(%edx) (*f0)->readable = 1; 80103485: 8b 13 mov (%ebx),%edx 80103487: c6 42 08 01 movb $0x1,0x8(%edx) (*f0)->writable = 0; 8010348b: 8b 13 mov (%ebx),%edx 8010348d: c6 42 09 00 movb $0x0,0x9(%edx) (*f0)->pipe = p; 80103491: 8b 13 mov (%ebx),%edx 80103493: 89 42 0c mov %eax,0xc(%edx) (*f1)->type = FD_PIPE; 80103496: 8b 16 mov (%esi),%edx 80103498: c7 02 01 00 00 00 movl $0x1,(%edx) (*f1)->readable = 0; 8010349e: 8b 16 mov (%esi),%edx 801034a0: c6 42 08 00 movb $0x0,0x8(%edx) (*f1)->writable = 1; 801034a4: 8b 16 mov (%esi),%edx 801034a6: c6 42 09 01 movb $0x1,0x9(%edx) (*f1)->pipe = p; 801034aa: 8b 16 mov (%esi),%edx 801034ac: 89 42 0c mov %eax,0xc(%edx) } 801034af: 83 c4 20 add $0x20,%esp return 0; 801034b2: 31 c0 xor %eax,%eax } 801034b4: 5b pop %ebx 801034b5: 5e pop %esi 801034b6: 5d pop %ebp 801034b7: c3 ret 801034b8: 90 nop 801034b9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801034c0 <pipeclose>: void pipeclose(struct pipe *p, int writable) { 801034c0: 55 push %ebp 801034c1: 89 e5 mov %esp,%ebp 801034c3: 83 ec 18 sub $0x18,%esp 801034c6: 89 5d f8 mov %ebx,-0x8(%ebp) 801034c9: 8b 5d 08 mov 0x8(%ebp),%ebx 801034cc: 89 75 fc mov %esi,-0x4(%ebp) 801034cf: 8b 75 0c mov 0xc(%ebp),%esi acquire(&p->lock); 801034d2: 89 1c 24 mov %ebx,(%esp) 801034d5: e8 16 1f 00 00 call 801053f0 <acquire> if(writable){ 801034da: 85 f6 test %esi,%esi 801034dc: 74 42 je 80103520 <pipeclose+0x60> p->writeopen = 0; 801034de: 31 f6 xor %esi,%esi wakeup(&p->nread); 801034e0: 8d 83 34 02 00 00 lea 0x234(%ebx),%eax p->writeopen = 0; 801034e6: 89 b3 40 02 00 00 mov %esi,0x240(%ebx) wakeup(&p->nread); 801034ec: 89 04 24 mov %eax,(%esp) 801034ef: e8 bc 0d 00 00 call 801042b0 <wakeup> } else { p->readopen = 0; wakeup(&p->nwrite); } if(p->readopen == 0 && p->writeopen == 0){ 801034f4: 8b 93 3c 02 00 00 mov 0x23c(%ebx),%edx 801034fa: 85 d2 test %edx,%edx 801034fc: 75 0a jne 80103508 <pipeclose+0x48> 801034fe: 8b 83 40 02 00 00 mov 0x240(%ebx),%eax 80103504: 85 c0 test %eax,%eax 80103506: 74 38 je 80103540 <pipeclose+0x80> release(&p->lock); kfree((char*)p); } else release(&p->lock); 80103508: 89 5d 08 mov %ebx,0x8(%ebp) } 8010350b: 8b 75 fc mov -0x4(%ebp),%esi 8010350e: 8b 5d f8 mov -0x8(%ebp),%ebx 80103511: 89 ec mov %ebp,%esp 80103513: 5d pop %ebp release(&p->lock); 80103514: e9 77 1f 00 00 jmp 80105490 <release> 80103519: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi p->readopen = 0; 80103520: 31 c9 xor %ecx,%ecx wakeup(&p->nwrite); 80103522: 8d 83 38 02 00 00 lea 0x238(%ebx),%eax p->readopen = 0; 80103528: 89 8b 3c 02 00 00 mov %ecx,0x23c(%ebx) wakeup(&p->nwrite); 8010352e: 89 04 24 mov %eax,(%esp) 80103531: e8 7a 0d 00 00 call 801042b0 <wakeup> 80103536: eb bc jmp 801034f4 <pipeclose+0x34> 80103538: 90 nop 80103539: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi release(&p->lock); 80103540: 89 1c 24 mov %ebx,(%esp) 80103543: e8 48 1f 00 00 call 80105490 <release> } 80103548: 8b 75 fc mov -0x4(%ebp),%esi kfree((char*)p); 8010354b: 89 5d 08 mov %ebx,0x8(%ebp) } 8010354e: 8b 5d f8 mov -0x8(%ebp),%ebx 80103551: 89 ec mov %ebp,%esp 80103553: 5d pop %ebp kfree((char*)p); 80103554: e9 87 ee ff ff jmp 801023e0 <kfree> 80103559: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80103560 <pipewrite>: //PAGEBREAK: 40 int pipewrite(struct pipe *p, char *addr, int n) { 80103560: 55 push %ebp 80103561: 89 e5 mov %esp,%ebp 80103563: 57 push %edi 80103564: 56 push %esi 80103565: 53 push %ebx 80103566: 83 ec 2c sub $0x2c,%esp 80103569: 8b 7d 08 mov 0x8(%ebp),%edi int i; acquire(&p->lock); 8010356c: 89 3c 24 mov %edi,(%esp) 8010356f: e8 7c 1e 00 00 call 801053f0 <acquire> for(i = 0; i < n; i++){ 80103574: 8b 75 10 mov 0x10(%ebp),%esi 80103577: 85 f6 test %esi,%esi 80103579: 0f 8e c7 00 00 00 jle 80103646 <pipewrite+0xe6> 8010357f: 8b 45 0c mov 0xc(%ebp),%eax while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full if(p->readopen == 0 || myproc()->killed){ release(&p->lock); return -1; } wakeup(&p->nread); 80103582: 8d b7 34 02 00 00 lea 0x234(%edi),%esi 80103588: 8b 5d 10 mov 0x10(%ebp),%ebx 8010358b: 8b 8f 38 02 00 00 mov 0x238(%edi),%ecx 80103591: 89 45 e4 mov %eax,-0x1c(%ebp) 80103594: 01 d8 add %ebx,%eax 80103596: 89 45 e0 mov %eax,-0x20(%ebp) while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full 80103599: 8b 87 34 02 00 00 mov 0x234(%edi),%eax 8010359f: 05 00 02 00 00 add $0x200,%eax 801035a4: 39 c1 cmp %eax,%ecx 801035a6: 75 6c jne 80103614 <pipewrite+0xb4> if(p->readopen == 0 || myproc()->killed){ 801035a8: 8b 87 3c 02 00 00 mov 0x23c(%edi),%eax 801035ae: 85 c0 test %eax,%eax 801035b0: 74 4d je 801035ff <pipewrite+0x9f> sleep(&p->nwrite, &p->lock); //DOC: pipewrite-sleep 801035b2: 8d 9f 38 02 00 00 lea 0x238(%edi),%ebx 801035b8: eb 39 jmp 801035f3 <pipewrite+0x93> 801035ba: 8d b6 00 00 00 00 lea 0x0(%esi),%esi wakeup(&p->nread); 801035c0: 89 34 24 mov %esi,(%esp) 801035c3: e8 e8 0c 00 00 call 801042b0 <wakeup> sleep(&p->nwrite, &p->lock); //DOC: pipewrite-sleep 801035c8: 89 7c 24 04 mov %edi,0x4(%esp) 801035cc: 89 1c 24 mov %ebx,(%esp) 801035cf: e8 fc 0a 00 00 call 801040d0 <sleep> while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full 801035d4: 8b 87 34 02 00 00 mov 0x234(%edi),%eax 801035da: 8b 97 38 02 00 00 mov 0x238(%edi),%edx 801035e0: 05 00 02 00 00 add $0x200,%eax 801035e5: 39 c2 cmp %eax,%edx 801035e7: 75 37 jne 80103620 <pipewrite+0xc0> if(p->readopen == 0 || myproc()->killed){ 801035e9: 8b 8f 3c 02 00 00 mov 0x23c(%edi),%ecx 801035ef: 85 c9 test %ecx,%ecx 801035f1: 74 0c je 801035ff <pipewrite+0x9f> 801035f3: e8 c8 03 00 00 call 801039c0 <myproc> 801035f8: 8b 50 24 mov 0x24(%eax),%edx 801035fb: 85 d2 test %edx,%edx 801035fd: 74 c1 je 801035c0 <pipewrite+0x60> release(&p->lock); 801035ff: 89 3c 24 mov %edi,(%esp) 80103602: e8 89 1e 00 00 call 80105490 <release> return -1; 80103607: 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; } 8010360c: 83 c4 2c add $0x2c,%esp 8010360f: 5b pop %ebx 80103610: 5e pop %esi 80103611: 5f pop %edi 80103612: 5d pop %ebp 80103613: c3 ret while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full 80103614: 89 ca mov %ecx,%edx 80103616: 8d 76 00 lea 0x0(%esi),%esi 80103619: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi p->data[p->nwrite++ % PIPESIZE] = addr[i]; 80103620: 8b 5d e4 mov -0x1c(%ebp),%ebx 80103623: 8d 4a 01 lea 0x1(%edx),%ecx 80103626: 81 e2 ff 01 00 00 and $0x1ff,%edx 8010362c: 89 8f 38 02 00 00 mov %ecx,0x238(%edi) 80103632: 0f b6 03 movzbl (%ebx),%eax 80103635: 43 inc %ebx for(i = 0; i < n; i++){ 80103636: 3b 5d e0 cmp -0x20(%ebp),%ebx 80103639: 89 5d e4 mov %ebx,-0x1c(%ebp) p->data[p->nwrite++ % PIPESIZE] = addr[i]; 8010363c: 88 44 17 34 mov %al,0x34(%edi,%edx,1) for(i = 0; i < n; i++){ 80103640: 0f 85 53 ff ff ff jne 80103599 <pipewrite+0x39> wakeup(&p->nread); //DOC: pipewrite-wakeup1 80103646: 8d 87 34 02 00 00 lea 0x234(%edi),%eax 8010364c: 89 04 24 mov %eax,(%esp) 8010364f: e8 5c 0c 00 00 call 801042b0 <wakeup> release(&p->lock); 80103654: 89 3c 24 mov %edi,(%esp) 80103657: e8 34 1e 00 00 call 80105490 <release> return n; 8010365c: 8b 45 10 mov 0x10(%ebp),%eax 8010365f: eb ab jmp 8010360c <pipewrite+0xac> 80103661: eb 0d jmp 80103670 <piperead> 80103663: 90 nop 80103664: 90 nop 80103665: 90 nop 80103666: 90 nop 80103667: 90 nop 80103668: 90 nop 80103669: 90 nop 8010366a: 90 nop 8010366b: 90 nop 8010366c: 90 nop 8010366d: 90 nop 8010366e: 90 nop 8010366f: 90 nop 80103670 <piperead>: int piperead(struct pipe *p, char *addr, int n) { 80103670: 55 push %ebp 80103671: 89 e5 mov %esp,%ebp 80103673: 57 push %edi 80103674: 56 push %esi 80103675: 53 push %ebx 80103676: 83 ec 1c sub $0x1c,%esp 80103679: 8b 75 08 mov 0x8(%ebp),%esi 8010367c: 8b 7d 0c mov 0xc(%ebp),%edi int i; acquire(&p->lock); 8010367f: 89 34 24 mov %esi,(%esp) 80103682: e8 69 1d 00 00 call 801053f0 <acquire> while(p->nread == p->nwrite && p->writeopen){ //DOC: pipe-empty 80103687: 8b 8e 34 02 00 00 mov 0x234(%esi),%ecx 8010368d: 3b 8e 38 02 00 00 cmp 0x238(%esi),%ecx 80103693: 75 6b jne 80103700 <piperead+0x90> 80103695: 8b 9e 40 02 00 00 mov 0x240(%esi),%ebx 8010369b: 85 db test %ebx,%ebx 8010369d: 0f 84 bd 00 00 00 je 80103760 <piperead+0xf0> if(myproc()->killed){ release(&p->lock); return -1; } sleep(&p->nread, &p->lock); //DOC: piperead-sleep 801036a3: 8d 9e 34 02 00 00 lea 0x234(%esi),%ebx 801036a9: eb 2d jmp 801036d8 <piperead+0x68> 801036ab: 90 nop 801036ac: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801036b0: 89 74 24 04 mov %esi,0x4(%esp) 801036b4: 89 1c 24 mov %ebx,(%esp) 801036b7: e8 14 0a 00 00 call 801040d0 <sleep> while(p->nread == p->nwrite && p->writeopen){ //DOC: pipe-empty 801036bc: 8b 8e 34 02 00 00 mov 0x234(%esi),%ecx 801036c2: 3b 8e 38 02 00 00 cmp 0x238(%esi),%ecx 801036c8: 75 36 jne 80103700 <piperead+0x90> 801036ca: 8b 96 40 02 00 00 mov 0x240(%esi),%edx 801036d0: 85 d2 test %edx,%edx 801036d2: 0f 84 88 00 00 00 je 80103760 <piperead+0xf0> if(myproc()->killed){ 801036d8: e8 e3 02 00 00 call 801039c0 <myproc> 801036dd: 8b 48 24 mov 0x24(%eax),%ecx 801036e0: 85 c9 test %ecx,%ecx 801036e2: 74 cc je 801036b0 <piperead+0x40> release(&p->lock); 801036e4: 89 34 24 mov %esi,(%esp) return -1; 801036e7: bb ff ff ff ff mov $0xffffffff,%ebx release(&p->lock); 801036ec: e8 9f 1d 00 00 call 80105490 <release> addr[i] = p->data[p->nread++ % PIPESIZE]; } wakeup(&p->nwrite); //DOC: piperead-wakeup release(&p->lock); return i; } 801036f1: 83 c4 1c add $0x1c,%esp 801036f4: 89 d8 mov %ebx,%eax 801036f6: 5b pop %ebx 801036f7: 5e pop %esi 801036f8: 5f pop %edi 801036f9: 5d pop %ebp 801036fa: c3 ret 801036fb: 90 nop 801036fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi for(i = 0; i < n; i++){ //DOC: piperead-copy 80103700: 8b 45 10 mov 0x10(%ebp),%eax 80103703: 85 c0 test %eax,%eax 80103705: 7e 59 jle 80103760 <piperead+0xf0> if(p->nread == p->nwrite) 80103707: 31 db xor %ebx,%ebx 80103709: eb 13 jmp 8010371e <piperead+0xae> 8010370b: 90 nop 8010370c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103710: 8b 8e 34 02 00 00 mov 0x234(%esi),%ecx 80103716: 3b 8e 38 02 00 00 cmp 0x238(%esi),%ecx 8010371c: 74 1d je 8010373b <piperead+0xcb> addr[i] = p->data[p->nread++ % PIPESIZE]; 8010371e: 8d 41 01 lea 0x1(%ecx),%eax 80103721: 81 e1 ff 01 00 00 and $0x1ff,%ecx 80103727: 89 86 34 02 00 00 mov %eax,0x234(%esi) 8010372d: 0f b6 44 0e 34 movzbl 0x34(%esi,%ecx,1),%eax 80103732: 88 04 1f mov %al,(%edi,%ebx,1) for(i = 0; i < n; i++){ //DOC: piperead-copy 80103735: 43 inc %ebx 80103736: 39 5d 10 cmp %ebx,0x10(%ebp) 80103739: 75 d5 jne 80103710 <piperead+0xa0> wakeup(&p->nwrite); //DOC: piperead-wakeup 8010373b: 8d 86 38 02 00 00 lea 0x238(%esi),%eax 80103741: 89 04 24 mov %eax,(%esp) 80103744: e8 67 0b 00 00 call 801042b0 <wakeup> release(&p->lock); 80103749: 89 34 24 mov %esi,(%esp) 8010374c: e8 3f 1d 00 00 call 80105490 <release> } 80103751: 83 c4 1c add $0x1c,%esp 80103754: 89 d8 mov %ebx,%eax 80103756: 5b pop %ebx 80103757: 5e pop %esi 80103758: 5f pop %edi 80103759: 5d pop %ebp 8010375a: c3 ret 8010375b: 90 nop 8010375c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103760: 31 db xor %ebx,%ebx 80103762: eb d7 jmp 8010373b <piperead+0xcb> 80103764: 66 90 xchg %ax,%ax 80103766: 66 90 xchg %ax,%ax 80103768: 66 90 xchg %ax,%ax 8010376a: 66 90 xchg %ax,%ax 8010376c: 66 90 xchg %ax,%ax 8010376e: 66 90 xchg %ax,%ax 80103770 <allocproc>: // If found, change state to EMBRYO and initialize // state required to run in the kernel. // Otherwise return 0. static struct proc* allocproc(void) { 80103770: 55 push %ebp 80103771: 89 e5 mov %esp,%ebp 80103773: 53 push %ebx struct proc *p; char *sp; acquire(&ptable.lock); for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103774: bb b4 3d 11 80 mov $0x80113db4,%ebx { 80103779: 83 ec 14 sub $0x14,%esp acquire(&ptable.lock); 8010377c: c7 04 24 80 3d 11 80 movl $0x80113d80,(%esp) 80103783: e8 68 1c 00 00 call 801053f0 <acquire> 80103788: eb 18 jmp 801037a2 <allocproc+0x32> 8010378a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103790: 81 c3 90 00 00 00 add $0x90,%ebx 80103796: 81 fb b4 61 11 80 cmp $0x801161b4,%ebx 8010379c: 0f 83 8e 00 00 00 jae 80103830 <allocproc+0xc0> if(p->state == UNUSED) 801037a2: 8b 43 0c mov 0xc(%ebx),%eax 801037a5: 85 c0 test %eax,%eax 801037a7: 75 e7 jne 80103790 <allocproc+0x20> release(&ptable.lock); return 0; found: p->state = EMBRYO; p->pid = nextpid++; 801037a9: a1 04 b0 10 80 mov 0x8010b004,%eax p->priority = 5; 801037ae: b9 05 00 00 00 mov $0x5,%ecx 801037b3: 89 8b 88 00 00 00 mov %ecx,0x88(%ebx) p->state = EMBRYO; 801037b9: c7 43 0c 01 00 00 00 movl $0x1,0xc(%ebx) p->pid = nextpid++; 801037c0: 8d 50 01 lea 0x1(%eax),%edx 801037c3: 89 43 10 mov %eax,0x10(%ebx) p->priority = 5; 801037c6: 31 c0 xor %eax,%eax 801037c8: 89 83 8c 00 00 00 mov %eax,0x8c(%ebx) release(&ptable.lock); 801037ce: c7 04 24 80 3d 11 80 movl $0x80113d80,(%esp) p->pid = nextpid++; 801037d5: 89 15 04 b0 10 80 mov %edx,0x8010b004 release(&ptable.lock); 801037db: e8 b0 1c 00 00 call 80105490 <release> // Allocate kernel stack. if((p->kstack = kalloc()) == 0){ 801037e0: e8 cb ed ff ff call 801025b0 <kalloc> 801037e5: 85 c0 test %eax,%eax 801037e7: 89 43 08 mov %eax,0x8(%ebx) 801037ea: 74 5a je 80103846 <allocproc+0xd6> return 0; } sp = p->kstack + KSTACKSIZE; // Leave room for trap frame. sp -= sizeof *p->tf; 801037ec: 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); 801037f2: b9 14 00 00 00 mov $0x14,%ecx sp -= sizeof *p->tf; 801037f7: 89 53 18 mov %edx,0x18(%ebx) *(uint*)sp = (uint)trapret; 801037fa: ba 2e 67 10 80 mov $0x8010672e,%edx sp -= sizeof *p->context; 801037ff: 05 9c 0f 00 00 add $0xf9c,%eax *(uint*)sp = (uint)trapret; 80103804: 89 50 14 mov %edx,0x14(%eax) memset(p->context, 0, sizeof *p->context); 80103807: 31 d2 xor %edx,%edx p->context = (struct context*)sp; 80103809: 89 43 1c mov %eax,0x1c(%ebx) memset(p->context, 0, sizeof *p->context); 8010380c: 89 4c 24 08 mov %ecx,0x8(%esp) 80103810: 89 54 24 04 mov %edx,0x4(%esp) 80103814: 89 04 24 mov %eax,(%esp) 80103817: e8 c4 1c 00 00 call 801054e0 <memset> p->context->eip = (uint)forkret; 8010381c: 8b 43 1c mov 0x1c(%ebx),%eax 8010381f: c7 40 10 60 38 10 80 movl $0x80103860,0x10(%eax) return p; } 80103826: 83 c4 14 add $0x14,%esp 80103829: 89 d8 mov %ebx,%eax 8010382b: 5b pop %ebx 8010382c: 5d pop %ebp 8010382d: c3 ret 8010382e: 66 90 xchg %ax,%ax release(&ptable.lock); 80103830: c7 04 24 80 3d 11 80 movl $0x80113d80,(%esp) return 0; 80103837: 31 db xor %ebx,%ebx release(&ptable.lock); 80103839: e8 52 1c 00 00 call 80105490 <release> } 8010383e: 83 c4 14 add $0x14,%esp 80103841: 89 d8 mov %ebx,%eax 80103843: 5b pop %ebx 80103844: 5d pop %ebp 80103845: c3 ret p->state = UNUSED; 80103846: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx) return 0; 8010384d: 31 db xor %ebx,%ebx 8010384f: eb d5 jmp 80103826 <allocproc+0xb6> 80103851: eb 0d jmp 80103860 <forkret> 80103853: 90 nop 80103854: 90 nop 80103855: 90 nop 80103856: 90 nop 80103857: 90 nop 80103858: 90 nop 80103859: 90 nop 8010385a: 90 nop 8010385b: 90 nop 8010385c: 90 nop 8010385d: 90 nop 8010385e: 90 nop 8010385f: 90 nop 80103860 <forkret>: // A fork child's very first scheduling by scheduler() // will swtch here. "Return" to user space. void forkret(void) { 80103860: 55 push %ebp 80103861: 89 e5 mov %esp,%ebp 80103863: 83 ec 18 sub $0x18,%esp static int first = 1; // Still holding ptable.lock from scheduler. release(&ptable.lock); 80103866: c7 04 24 80 3d 11 80 movl $0x80113d80,(%esp) 8010386d: e8 1e 1c 00 00 call 80105490 <release> if (first) { 80103872: 8b 15 00 b0 10 80 mov 0x8010b000,%edx 80103878: 85 d2 test %edx,%edx 8010387a: 75 04 jne 80103880 <forkret+0x20> iinit(ROOTDEV); initlog(ROOTDEV); } // Return to "caller", actually trapret (see allocproc). } 8010387c: c9 leave 8010387d: c3 ret 8010387e: 66 90 xchg %ax,%ax first = 0; 80103880: 31 c0 xor %eax,%eax iinit(ROOTDEV); 80103882: c7 04 24 01 00 00 00 movl $0x1,(%esp) first = 0; 80103889: a3 00 b0 10 80 mov %eax,0x8010b000 iinit(ROOTDEV); 8010388e: e8 1d dc ff ff call 801014b0 <iinit> initlog(ROOTDEV); 80103893: c7 04 24 01 00 00 00 movl $0x1,(%esp) 8010389a: e8 51 f3 ff ff call 80102bf0 <initlog> } 8010389f: c9 leave 801038a0: c3 ret 801038a1: eb 0d jmp 801038b0 <getAccumulator> 801038a3: 90 nop 801038a4: 90 nop 801038a5: 90 nop 801038a6: 90 nop 801038a7: 90 nop 801038a8: 90 nop 801038a9: 90 nop 801038aa: 90 nop 801038ab: 90 nop 801038ac: 90 nop 801038ad: 90 nop 801038ae: 90 nop 801038af: 90 nop 801038b0 <getAccumulator>: long long getAccumulator(struct proc *p) { 801038b0: 55 push %ebp 801038b1: 89 e5 mov %esp,%ebp return p->accumulator; 801038b3: 8b 45 08 mov 0x8(%ebp),%eax } 801038b6: 5d pop %ebp return p->accumulator; 801038b7: 8b 90 84 00 00 00 mov 0x84(%eax),%edx 801038bd: 8b 80 80 00 00 00 mov 0x80(%eax),%eax } 801038c3: c3 ret 801038c4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801038ca: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 801038d0 <add>: switch(policy){ 801038d0: a1 08 b0 10 80 mov 0x8010b008,%eax { 801038d5: 55 push %ebp 801038d6: 89 e5 mov %esp,%ebp switch(policy){ 801038d8: 83 f8 01 cmp $0x1,%eax 801038db: 74 1b je 801038f8 <add+0x28> 801038dd: 83 f8 02 cmp $0x2,%eax 801038e0: 75 0e jne 801038f0 <add+0x20> } 801038e2: 5d pop %ebp pq.put(p); 801038e3: ff 25 e0 b5 10 80 jmp *0x8010b5e0 801038e9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi } 801038f0: 5d pop %ebp 801038f1: c3 ret 801038f2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801038f8: 5d pop %ebp rrq.enqueue(p); 801038f9: ff 25 d0 b5 10 80 jmp *0x8010b5d0 801038ff: 90 nop 80103900 <pinit>: { 80103900: 55 push %ebp initlock(&ptable.lock, "ptable"); 80103901: b8 c5 85 10 80 mov $0x801085c5,%eax { 80103906: 89 e5 mov %esp,%ebp 80103908: 83 ec 18 sub $0x18,%esp initlock(&ptable.lock, "ptable"); 8010390b: 89 44 24 04 mov %eax,0x4(%esp) 8010390f: c7 04 24 80 3d 11 80 movl $0x80113d80,(%esp) 80103916: e8 85 19 00 00 call 801052a0 <initlock> } 8010391b: c9 leave 8010391c: c3 ret 8010391d: 8d 76 00 lea 0x0(%esi),%esi 80103920 <mycpu>: { 80103920: 55 push %ebp 80103921: 89 e5 mov %esp,%ebp 80103923: 56 push %esi 80103924: 53 push %ebx 80103925: 83 ec 10 sub $0x10,%esp asm volatile("pushfl; popl %0" : "=r" (eflags)); 80103928: 9c pushf 80103929: 58 pop %eax if(readeflags()&FL_IF) 8010392a: f6 c4 02 test $0x2,%ah 8010392d: 75 5b jne 8010398a <mycpu+0x6a> apicid = lapicid(); 8010392f: e8 fc ee ff ff call 80102830 <lapicid> for (i = 0; i < ncpu; ++i) { 80103934: 8b 35 60 3d 11 80 mov 0x80113d60,%esi 8010393a: 85 f6 test %esi,%esi 8010393c: 7e 40 jle 8010397e <mycpu+0x5e> if (cpus[i].apicid == apicid) 8010393e: 0f b6 15 e0 37 11 80 movzbl 0x801137e0,%edx 80103945: 39 d0 cmp %edx,%eax 80103947: 74 2e je 80103977 <mycpu+0x57> 80103949: b9 90 38 11 80 mov $0x80113890,%ecx for (i = 0; i < ncpu; ++i) { 8010394e: 31 d2 xor %edx,%edx 80103950: 42 inc %edx 80103951: 39 f2 cmp %esi,%edx 80103953: 74 29 je 8010397e <mycpu+0x5e> if (cpus[i].apicid == apicid) 80103955: 0f b6 19 movzbl (%ecx),%ebx 80103958: 81 c1 b0 00 00 00 add $0xb0,%ecx 8010395e: 39 c3 cmp %eax,%ebx 80103960: 75 ee jne 80103950 <mycpu+0x30> 80103962: 8d 04 92 lea (%edx,%edx,4),%eax 80103965: 8d 04 42 lea (%edx,%eax,2),%eax 80103968: c1 e0 04 shl $0x4,%eax 8010396b: 05 e0 37 11 80 add $0x801137e0,%eax } 80103970: 83 c4 10 add $0x10,%esp 80103973: 5b pop %ebx 80103974: 5e pop %esi 80103975: 5d pop %ebp 80103976: c3 ret if (cpus[i].apicid == apicid) 80103977: b8 e0 37 11 80 mov $0x801137e0,%eax return &cpus[i]; 8010397c: eb f2 jmp 80103970 <mycpu+0x50> panic("unknown apicid\n"); 8010397e: c7 04 24 cc 85 10 80 movl $0x801085cc,(%esp) 80103985: e8 e6 c9 ff ff call 80100370 <panic> panic("mycpu called with interrupts enabled\n"); 8010398a: c7 04 24 a8 86 10 80 movl $0x801086a8,(%esp) 80103991: e8 da c9 ff ff call 80100370 <panic> 80103996: 8d 76 00 lea 0x0(%esi),%esi 80103999: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801039a0 <cpuid>: cpuid() { 801039a0: 55 push %ebp 801039a1: 89 e5 mov %esp,%ebp 801039a3: 83 ec 08 sub $0x8,%esp return mycpu()-cpus; 801039a6: e8 75 ff ff ff call 80103920 <mycpu> } 801039ab: c9 leave return mycpu()-cpus; 801039ac: 2d e0 37 11 80 sub $0x801137e0,%eax 801039b1: c1 f8 04 sar $0x4,%eax 801039b4: 69 c0 a3 8b 2e ba imul $0xba2e8ba3,%eax,%eax } 801039ba: c3 ret 801039bb: 90 nop 801039bc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801039c0 <myproc>: myproc(void) { 801039c0: 55 push %ebp 801039c1: 89 e5 mov %esp,%ebp 801039c3: 53 push %ebx 801039c4: 83 ec 04 sub $0x4,%esp pushcli(); 801039c7: e8 44 19 00 00 call 80105310 <pushcli> c = mycpu(); 801039cc: e8 4f ff ff ff call 80103920 <mycpu> p = c->proc; 801039d1: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 801039d7: e8 74 19 00 00 call 80105350 <popcli> } 801039dc: 5a pop %edx 801039dd: 89 d8 mov %ebx,%eax 801039df: 5b pop %ebx 801039e0: 5d pop %ebp 801039e1: c3 ret 801039e2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801039e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801039f0 <setNewAcc>: void setNewAcc(struct proc* p){ 801039f0: 55 push %ebp 801039f1: 89 e5 mov %esp,%ebp 801039f3: 83 ec 28 sub $0x28,%esp 801039f6: 89 5d f4 mov %ebx,-0xc(%ebp) 801039f9: 8b 5d 08 mov 0x8(%ebp),%ebx 801039fc: 89 75 f8 mov %esi,-0x8(%ebp) 801039ff: 89 7d fc mov %edi,-0x4(%ebp) if (!(rpholder.getMinAccumulator(&p->accumulator))){ 80103a02: 8d 83 80 00 00 00 lea 0x80(%ebx),%eax 80103a08: 89 04 24 mov %eax,(%esp) 80103a0b: ff 15 c8 b5 10 80 call *0x8010b5c8 80103a11: 85 c0 test %eax,%eax 80103a13: 75 3b jne 80103a50 <setNewAcc+0x60> if (pq.isEmpty()){ 80103a15: ff 15 dc b5 10 80 call *0x8010b5dc 80103a1b: 85 c0 test %eax,%eax 80103a1d: 8d 76 00 lea 0x0(%esi),%esi 80103a20: 75 6e jne 80103a90 <setNewAcc+0xa0> p->accumulator = MIN(p->accumulator, (pq.extractMin())->accumulator); 80103a22: ff 15 e8 b5 10 80 call *0x8010b5e8 80103a28: 8b 90 84 00 00 00 mov 0x84(%eax),%edx 80103a2e: 8b 80 80 00 00 00 mov 0x80(%eax),%eax 80103a34: 89 83 80 00 00 00 mov %eax,0x80(%ebx) 80103a3a: 89 93 84 00 00 00 mov %edx,0x84(%ebx) } 80103a40: 8b 5d f4 mov -0xc(%ebp),%ebx 80103a43: 8b 75 f8 mov -0x8(%ebp),%esi 80103a46: 8b 7d fc mov -0x4(%ebp),%edi 80103a49: 89 ec mov %ebp,%esp 80103a4b: 5d pop %ebp 80103a4c: c3 ret 80103a4d: 8d 76 00 lea 0x0(%esi),%esi if (!(pq.isEmpty())){ 80103a50: ff 15 dc b5 10 80 call *0x8010b5dc 80103a56: 85 c0 test %eax,%eax 80103a58: 75 e6 jne 80103a40 <setNewAcc+0x50> p->accumulator = MIN(p->accumulator, (pq.extractMin())->accumulator); 80103a5a: 8b bb 84 00 00 00 mov 0x84(%ebx),%edi 80103a60: 8b b3 80 00 00 00 mov 0x80(%ebx),%esi 80103a66: ff 15 e8 b5 10 80 call *0x8010b5e8 80103a6c: 3b b8 84 00 00 00 cmp 0x84(%eax),%edi 80103a72: 7f ae jg 80103a22 <setNewAcc+0x32> 80103a74: 7c 08 jl 80103a7e <setNewAcc+0x8e> 80103a76: 3b b0 80 00 00 00 cmp 0x80(%eax),%esi 80103a7c: 73 a4 jae 80103a22 <setNewAcc+0x32> 80103a7e: 8b 83 80 00 00 00 mov 0x80(%ebx),%eax 80103a84: 8b 93 84 00 00 00 mov 0x84(%ebx),%edx 80103a8a: eb a8 jmp 80103a34 <setNewAcc+0x44> 80103a8c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi p->accumulator = 0; 80103a90: 31 c0 xor %eax,%eax 80103a92: 31 d2 xor %edx,%edx 80103a94: 89 83 80 00 00 00 mov %eax,0x80(%ebx) 80103a9a: 89 93 84 00 00 00 mov %edx,0x84(%ebx) 80103aa0: eb 9e jmp 80103a40 <setNewAcc+0x50> 80103aa2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80103aa9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103ab0 <wakeup1>: //PAGEBREAK! // Wake up all processes sleeping on chan. // The ptable lock must be held. static void wakeup1(void *chan) { 80103ab0: 55 push %ebp 80103ab1: 89 e5 mov %esp,%ebp 80103ab3: 56 push %esi 80103ab4: 89 c6 mov %eax,%esi 80103ab6: 53 push %ebx struct proc *p; for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103ab7: bb b4 3d 11 80 mov $0x80113db4,%ebx { 80103abc: 83 ec 10 sub $0x10,%esp 80103abf: eb 15 jmp 80103ad6 <wakeup1+0x26> 80103ac1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103ac8: 81 c3 90 00 00 00 add $0x90,%ebx 80103ace: 81 fb b4 61 11 80 cmp $0x801161b4,%ebx 80103ad4: 73 32 jae 80103b08 <wakeup1+0x58> if(p->state == SLEEPING && p->chan == chan){ 80103ad6: 8b 53 0c mov 0xc(%ebx),%edx 80103ad9: 83 fa 02 cmp $0x2,%edx 80103adc: 75 ea jne 80103ac8 <wakeup1+0x18> 80103ade: 39 73 20 cmp %esi,0x20(%ebx) 80103ae1: 75 e5 jne 80103ac8 <wakeup1+0x18> setNewAcc(p); 80103ae3: 89 1c 24 mov %ebx,(%esp) 80103ae6: e8 05 ff ff ff call 801039f0 <setNewAcc> p->state = RUNNABLE; 80103aeb: c7 43 0c 03 00 00 00 movl $0x3,0xc(%ebx) add(p); 80103af2: 89 1c 24 mov %ebx,(%esp) for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103af5: 81 c3 90 00 00 00 add $0x90,%ebx add(p); 80103afb: e8 d0 fd ff ff call 801038d0 <add> for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) 80103b00: 81 fb b4 61 11 80 cmp $0x801161b4,%ebx 80103b06: 72 ce jb 80103ad6 <wakeup1+0x26> } } 80103b08: 83 c4 10 add $0x10,%esp 80103b0b: 5b pop %ebx 80103b0c: 5e pop %esi 80103b0d: 5d pop %ebp 80103b0e: c3 ret 80103b0f: 90 nop 80103b10 <userinit>: { 80103b10: 55 push %ebp 80103b11: 89 e5 mov %esp,%ebp 80103b13: 53 push %ebx 80103b14: 83 ec 14 sub $0x14,%esp p = allocproc(); 80103b17: e8 54 fc ff ff call 80103770 <allocproc> 80103b1c: 89 c3 mov %eax,%ebx setNewAcc(p); 80103b1e: 89 04 24 mov %eax,(%esp) 80103b21: e8 ca fe ff ff call 801039f0 <setNewAcc> initproc = p; 80103b26: 89 1d b8 b5 10 80 mov %ebx,0x8010b5b8 if((p->pgdir = setupkvm()) == 0) 80103b2c: e8 2f 42 00 00 call 80107d60 <setupkvm> 80103b31: 85 c0 test %eax,%eax 80103b33: 89 43 04 mov %eax,0x4(%ebx) 80103b36: 0f 84 ef 00 00 00 je 80103c2b <userinit+0x11b> inituvm(p->pgdir, _binary_initcode_start, (int)_binary_initcode_size); 80103b3c: b9 60 b4 10 80 mov $0x8010b460,%ecx 80103b41: ba 2c 00 00 00 mov $0x2c,%edx 80103b46: 89 4c 24 04 mov %ecx,0x4(%esp) 80103b4a: 89 54 24 08 mov %edx,0x8(%esp) 80103b4e: 89 04 24 mov %eax,(%esp) 80103b51: e8 da 3e 00 00 call 80107a30 <inituvm> memset(p->tf, 0, sizeof(*p->tf)); 80103b56: b8 4c 00 00 00 mov $0x4c,%eax p->sz = PGSIZE; 80103b5b: c7 03 00 10 00 00 movl $0x1000,(%ebx) memset(p->tf, 0, sizeof(*p->tf)); 80103b61: 89 44 24 08 mov %eax,0x8(%esp) 80103b65: 31 c0 xor %eax,%eax 80103b67: 89 44 24 04 mov %eax,0x4(%esp) 80103b6b: 8b 43 18 mov 0x18(%ebx),%eax 80103b6e: 89 04 24 mov %eax,(%esp) 80103b71: e8 6a 19 00 00 call 801054e0 <memset> p->tf->cs = (SEG_UCODE << 3) | DPL_USER; 80103b76: 8b 43 18 mov 0x18(%ebx),%eax 80103b79: 66 c7 40 3c 1b 00 movw $0x1b,0x3c(%eax) p->tf->ds = (SEG_UDATA << 3) | DPL_USER; 80103b7f: 8b 43 18 mov 0x18(%ebx),%eax 80103b82: 66 c7 40 2c 23 00 movw $0x23,0x2c(%eax) p->tf->es = p->tf->ds; 80103b88: 8b 43 18 mov 0x18(%ebx),%eax 80103b8b: 8b 50 2c mov 0x2c(%eax),%edx 80103b8e: 66 89 50 28 mov %dx,0x28(%eax) p->tf->ss = p->tf->ds; 80103b92: 8b 43 18 mov 0x18(%ebx),%eax 80103b95: 8b 50 2c mov 0x2c(%eax),%edx 80103b98: 66 89 50 48 mov %dx,0x48(%eax) p->tf->eflags = FL_IF; 80103b9c: 8b 43 18 mov 0x18(%ebx),%eax 80103b9f: c7 40 40 00 02 00 00 movl $0x200,0x40(%eax) p->tf->esp = PGSIZE; 80103ba6: 8b 43 18 mov 0x18(%ebx),%eax 80103ba9: c7 40 44 00 10 00 00 movl $0x1000,0x44(%eax) p->tf->eip = 0; // beginning of initcode.S 80103bb0: 8b 43 18 mov 0x18(%ebx),%eax 80103bb3: c7 40 38 00 00 00 00 movl $0x0,0x38(%eax) safestrcpy(p->name, "initcode", sizeof(p->name)); 80103bba: b8 10 00 00 00 mov $0x10,%eax 80103bbf: 89 44 24 08 mov %eax,0x8(%esp) 80103bc3: b8 f5 85 10 80 mov $0x801085f5,%eax 80103bc8: 89 44 24 04 mov %eax,0x4(%esp) 80103bcc: 8d 43 6c lea 0x6c(%ebx),%eax 80103bcf: 89 04 24 mov %eax,(%esp) 80103bd2: e8 e9 1a 00 00 call 801056c0 <safestrcpy> p->cwd = namei("/"); 80103bd7: c7 04 24 fe 85 10 80 movl $0x801085fe,(%esp) 80103bde: e8 ed e3 ff ff call 80101fd0 <namei> 80103be3: 89 43 68 mov %eax,0x68(%ebx) acquire(&ptable.lock); 80103be6: c7 04 24 80 3d 11 80 movl $0x80113d80,(%esp) 80103bed: e8 fe 17 00 00 call 801053f0 <acquire> p->accumulator += p->priority; 80103bf2: 8b 83 88 00 00 00 mov 0x88(%ebx),%eax 80103bf8: 01 83 80 00 00 00 add %eax,0x80(%ebx) 80103bfe: 8b 93 8c 00 00 00 mov 0x8c(%ebx),%edx p->state = RUNNABLE; 80103c04: c7 43 0c 03 00 00 00 movl $0x3,0xc(%ebx) p->accumulator += p->priority; 80103c0b: 11 93 84 00 00 00 adc %edx,0x84(%ebx) add(p); 80103c11: 89 1c 24 mov %ebx,(%esp) 80103c14: e8 b7 fc ff ff call 801038d0 <add> release(&ptable.lock); 80103c19: c7 04 24 80 3d 11 80 movl $0x80113d80,(%esp) 80103c20: e8 6b 18 00 00 call 80105490 <release> } 80103c25: 83 c4 14 add $0x14,%esp 80103c28: 5b pop %ebx 80103c29: 5d pop %ebp 80103c2a: c3 ret panic("userinit: out of memory?"); 80103c2b: c7 04 24 dc 85 10 80 movl $0x801085dc,(%esp) 80103c32: e8 39 c7 ff ff call 80100370 <panic> 80103c37: 89 f6 mov %esi,%esi 80103c39: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103c40 <growproc>: { 80103c40: 55 push %ebp 80103c41: 89 e5 mov %esp,%ebp 80103c43: 56 push %esi 80103c44: 53 push %ebx 80103c45: 83 ec 10 sub $0x10,%esp 80103c48: 8b 75 08 mov 0x8(%ebp),%esi pushcli(); 80103c4b: e8 c0 16 00 00 call 80105310 <pushcli> c = mycpu(); 80103c50: e8 cb fc ff ff call 80103920 <mycpu> p = c->proc; 80103c55: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80103c5b: e8 f0 16 00 00 call 80105350 <popcli> if(n > 0){ 80103c60: 83 fe 00 cmp $0x0,%esi sz = curproc->sz; 80103c63: 8b 03 mov (%ebx),%eax if(n > 0){ 80103c65: 7f 19 jg 80103c80 <growproc+0x40> } else if(n < 0){ 80103c67: 75 37 jne 80103ca0 <growproc+0x60> curproc->sz = sz; 80103c69: 89 03 mov %eax,(%ebx) switchuvm(curproc); 80103c6b: 89 1c 24 mov %ebx,(%esp) 80103c6e: e8 bd 3c 00 00 call 80107930 <switchuvm> return 0; 80103c73: 31 c0 xor %eax,%eax } 80103c75: 83 c4 10 add $0x10,%esp 80103c78: 5b pop %ebx 80103c79: 5e pop %esi 80103c7a: 5d pop %ebp 80103c7b: c3 ret 80103c7c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if((sz = allocuvm(curproc->pgdir, sz, sz + n)) == 0) 80103c80: 01 c6 add %eax,%esi 80103c82: 89 74 24 08 mov %esi,0x8(%esp) 80103c86: 89 44 24 04 mov %eax,0x4(%esp) 80103c8a: 8b 43 04 mov 0x4(%ebx),%eax 80103c8d: 89 04 24 mov %eax,(%esp) 80103c90: e8 eb 3e 00 00 call 80107b80 <allocuvm> 80103c95: 85 c0 test %eax,%eax 80103c97: 75 d0 jne 80103c69 <growproc+0x29> return -1; 80103c99: b8 ff ff ff ff mov $0xffffffff,%eax 80103c9e: eb d5 jmp 80103c75 <growproc+0x35> if((sz = deallocuvm(curproc->pgdir, sz, sz + n)) == 0) 80103ca0: 01 c6 add %eax,%esi 80103ca2: 89 74 24 08 mov %esi,0x8(%esp) 80103ca6: 89 44 24 04 mov %eax,0x4(%esp) 80103caa: 8b 43 04 mov 0x4(%ebx),%eax 80103cad: 89 04 24 mov %eax,(%esp) 80103cb0: e8 fb 3f 00 00 call 80107cb0 <deallocuvm> 80103cb5: 85 c0 test %eax,%eax 80103cb7: 75 b0 jne 80103c69 <growproc+0x29> 80103cb9: eb de jmp 80103c99 <growproc+0x59> 80103cbb: 90 nop 80103cbc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103cc0 <fork>: { 80103cc0: 55 push %ebp 80103cc1: 89 e5 mov %esp,%ebp 80103cc3: 57 push %edi 80103cc4: 56 push %esi 80103cc5: 53 push %ebx 80103cc6: 83 ec 1c sub $0x1c,%esp pushcli(); 80103cc9: e8 42 16 00 00 call 80105310 <pushcli> c = mycpu(); 80103cce: e8 4d fc ff ff call 80103920 <mycpu> p = c->proc; 80103cd3: 8b b8 ac 00 00 00 mov 0xac(%eax),%edi popcli(); 80103cd9: e8 72 16 00 00 call 80105350 <popcli> if((np = allocproc()) == 0){ 80103cde: e8 8d fa ff ff call 80103770 <allocproc> 80103ce3: 85 c0 test %eax,%eax 80103ce5: 0f 84 e4 00 00 00 je 80103dcf <fork+0x10f> setNewAcc(np); 80103ceb: 89 04 24 mov %eax,(%esp) 80103cee: 89 c6 mov %eax,%esi 80103cf0: e8 fb fc ff ff call 801039f0 <setNewAcc> if((np->pgdir = copyuvm(curproc->pgdir, curproc->sz)) == 0){ 80103cf5: 8b 07 mov (%edi),%eax 80103cf7: 89 44 24 04 mov %eax,0x4(%esp) 80103cfb: 8b 47 04 mov 0x4(%edi),%eax 80103cfe: 89 04 24 mov %eax,(%esp) 80103d01: e8 2a 41 00 00 call 80107e30 <copyuvm> 80103d06: 85 c0 test %eax,%eax 80103d08: 89 46 04 mov %eax,0x4(%esi) 80103d0b: 0f 84 c5 00 00 00 je 80103dd6 <fork+0x116> np->sz = curproc->sz; 80103d11: 8b 07 mov (%edi),%eax np->parent = curproc; 80103d13: 89 7e 14 mov %edi,0x14(%esi) *np->tf = *curproc->tf; 80103d16: 8b 56 18 mov 0x18(%esi),%edx np->sz = curproc->sz; 80103d19: 89 06 mov %eax,(%esi) *np->tf = *curproc->tf; 80103d1b: 31 c0 xor %eax,%eax 80103d1d: 8b 4f 18 mov 0x18(%edi),%ecx 80103d20: 8b 1c 01 mov (%ecx,%eax,1),%ebx 80103d23: 89 1c 02 mov %ebx,(%edx,%eax,1) 80103d26: 83 c0 04 add $0x4,%eax 80103d29: 83 f8 4c cmp $0x4c,%eax 80103d2c: 72 f2 jb 80103d20 <fork+0x60> np->tf->eax = 0; 80103d2e: 8b 46 18 mov 0x18(%esi),%eax for(i = 0; i < NOFILE; i++) 80103d31: 31 db xor %ebx,%ebx np->tf->eax = 0; 80103d33: c7 40 1c 00 00 00 00 movl $0x0,0x1c(%eax) 80103d3a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if(curproc->ofile[i]) 80103d40: 8b 44 9f 28 mov 0x28(%edi,%ebx,4),%eax 80103d44: 85 c0 test %eax,%eax 80103d46: 74 0c je 80103d54 <fork+0x94> np->ofile[i] = filedup(curproc->ofile[i]); 80103d48: 89 04 24 mov %eax,(%esp) 80103d4b: e8 90 d0 ff ff call 80100de0 <filedup> 80103d50: 89 44 9e 28 mov %eax,0x28(%esi,%ebx,4) for(i = 0; i < NOFILE; i++) 80103d54: 43 inc %ebx 80103d55: 83 fb 10 cmp $0x10,%ebx 80103d58: 75 e6 jne 80103d40 <fork+0x80> np->cwd = idup(curproc->cwd); 80103d5a: 8b 47 68 mov 0x68(%edi),%eax safestrcpy(np->name, curproc->name, sizeof(curproc->name)); 80103d5d: 83 c7 6c add $0x6c,%edi np->cwd = idup(curproc->cwd); 80103d60: 89 04 24 mov %eax,(%esp) 80103d63: e8 58 d9 ff ff call 801016c0 <idup> 80103d68: 89 46 68 mov %eax,0x68(%esi) safestrcpy(np->name, curproc->name, sizeof(curproc->name)); 80103d6b: b8 10 00 00 00 mov $0x10,%eax 80103d70: 89 44 24 08 mov %eax,0x8(%esp) 80103d74: 8d 46 6c lea 0x6c(%esi),%eax 80103d77: 89 7c 24 04 mov %edi,0x4(%esp) 80103d7b: 89 04 24 mov %eax,(%esp) 80103d7e: e8 3d 19 00 00 call 801056c0 <safestrcpy> pid = np->pid; 80103d83: 8b 7e 10 mov 0x10(%esi),%edi acquire(&ptable.lock); 80103d86: c7 04 24 80 3d 11 80 movl $0x80113d80,(%esp) 80103d8d: e8 5e 16 00 00 call 801053f0 <acquire> np->accumulator += np->priority; 80103d92: 8b 8e 88 00 00 00 mov 0x88(%esi),%ecx 80103d98: 01 8e 80 00 00 00 add %ecx,0x80(%esi) 80103d9e: 8b 9e 8c 00 00 00 mov 0x8c(%esi),%ebx np->state = RUNNABLE; 80103da4: c7 46 0c 03 00 00 00 movl $0x3,0xc(%esi) np->accumulator += np->priority; 80103dab: 11 9e 84 00 00 00 adc %ebx,0x84(%esi) add(np); 80103db1: 89 34 24 mov %esi,(%esp) 80103db4: e8 17 fb ff ff call 801038d0 <add> release(&ptable.lock); 80103db9: c7 04 24 80 3d 11 80 movl $0x80113d80,(%esp) 80103dc0: e8 cb 16 00 00 call 80105490 <release> } 80103dc5: 83 c4 1c add $0x1c,%esp 80103dc8: 89 f8 mov %edi,%eax 80103dca: 5b pop %ebx 80103dcb: 5e pop %esi 80103dcc: 5f pop %edi 80103dcd: 5d pop %ebp 80103dce: c3 ret return -1; 80103dcf: bf ff ff ff ff mov $0xffffffff,%edi 80103dd4: eb ef jmp 80103dc5 <fork+0x105> kfree(np->kstack); 80103dd6: 8b 46 08 mov 0x8(%esi),%eax return -1; 80103dd9: bf ff ff ff ff mov $0xffffffff,%edi kfree(np->kstack); 80103dde: 89 04 24 mov %eax,(%esp) 80103de1: e8 fa e5 ff ff call 801023e0 <kfree> np->kstack = 0; 80103de6: c7 46 08 00 00 00 00 movl $0x0,0x8(%esi) np->state = UNUSED; 80103ded: c7 46 0c 00 00 00 00 movl $0x0,0xc(%esi) return -1; 80103df4: eb cf jmp 80103dc5 <fork+0x105> 80103df6: 8d 76 00 lea 0x0(%esi),%esi 80103df9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103e00 <chooseProc>: switch (policy){ 80103e00: a1 08 b0 10 80 mov 0x8010b008,%eax struct proc* chooseProc(){ 80103e05: 55 push %ebp 80103e06: 89 e5 mov %esp,%ebp switch (policy){ 80103e08: 83 f8 01 cmp $0x1,%eax 80103e0b: 74 1b je 80103e28 <chooseProc+0x28> 80103e0d: 83 f8 02 cmp $0x2,%eax 80103e10: 75 0e jne 80103e20 <chooseProc+0x20> } 80103e12: 5d pop %ebp p = pq.extractMin(); 80103e13: ff 25 e8 b5 10 80 jmp *0x8010b5e8 80103e19: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi } 80103e20: 31 c0 xor %eax,%eax 80103e22: 5d pop %ebp 80103e23: c3 ret 80103e24: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103e28: 5d pop %ebp p = rrq.dequeue(); 80103e29: ff 25 d4 b5 10 80 jmp *0x8010b5d4 80103e2f: 90 nop 80103e30 <scheduler>: { 80103e30: 55 push %ebp 80103e31: 89 e5 mov %esp,%ebp 80103e33: 57 push %edi 80103e34: 56 push %esi 80103e35: 53 push %ebx 80103e36: 83 ec 1c sub $0x1c,%esp struct cpu *c = mycpu(); 80103e39: e8 e2 fa ff ff call 80103920 <mycpu> c->proc = 0; 80103e3e: 31 d2 xor %edx,%edx struct cpu *c = mycpu(); 80103e40: 89 c6 mov %eax,%esi c->proc = 0; 80103e42: 89 90 ac 00 00 00 mov %edx,0xac(%eax) 80103e48: 8d 78 04 lea 0x4(%eax),%edi 80103e4b: 90 nop 80103e4c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi asm volatile("sti"); 80103e50: fb sti acquire(&ptable.lock); 80103e51: c7 04 24 80 3d 11 80 movl $0x80113d80,(%esp) 80103e58: e8 93 15 00 00 call 801053f0 <acquire> p =chooseProc(); 80103e5d: e8 9e ff ff ff call 80103e00 <chooseProc> if(!p){ 80103e62: 85 c0 test %eax,%eax p =chooseProc(); 80103e64: 89 c3 mov %eax,%ebx if(!p){ 80103e66: 74 31 je 80103e99 <scheduler+0x69> c->proc = p; 80103e68: 89 86 ac 00 00 00 mov %eax,0xac(%esi) switchuvm(p); 80103e6e: 89 04 24 mov %eax,(%esp) 80103e71: e8 ba 3a 00 00 call 80107930 <switchuvm> swtch(&(c->scheduler), p->context); 80103e76: 8b 43 1c mov 0x1c(%ebx),%eax p->state = RUNNING; 80103e79: c7 43 0c 04 00 00 00 movl $0x4,0xc(%ebx) swtch(&(c->scheduler), p->context); 80103e80: 89 3c 24 mov %edi,(%esp) 80103e83: 89 44 24 04 mov %eax,0x4(%esp) 80103e87: e8 8d 18 00 00 call 80105719 <swtch> switchkvm(); 80103e8c: e8 7f 3a 00 00 call 80107910 <switchkvm> c->proc = 0; 80103e91: 31 c0 xor %eax,%eax 80103e93: 89 86 ac 00 00 00 mov %eax,0xac(%esi) release(&ptable.lock); 80103e99: c7 04 24 80 3d 11 80 movl $0x80113d80,(%esp) 80103ea0: e8 eb 15 00 00 call 80105490 <release> 80103ea5: eb a9 jmp 80103e50 <scheduler+0x20> 80103ea7: 89 f6 mov %esi,%esi 80103ea9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103eb0 <sched>: { 80103eb0: 55 push %ebp 80103eb1: 89 e5 mov %esp,%ebp 80103eb3: 56 push %esi 80103eb4: 53 push %ebx 80103eb5: 83 ec 10 sub $0x10,%esp pushcli(); 80103eb8: e8 53 14 00 00 call 80105310 <pushcli> c = mycpu(); 80103ebd: e8 5e fa ff ff call 80103920 <mycpu> p = c->proc; 80103ec2: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80103ec8: e8 83 14 00 00 call 80105350 <popcli> if(!holding(&ptable.lock)) 80103ecd: c7 04 24 80 3d 11 80 movl $0x80113d80,(%esp) 80103ed4: e8 d7 14 00 00 call 801053b0 <holding> 80103ed9: 85 c0 test %eax,%eax 80103edb: 74 51 je 80103f2e <sched+0x7e> if(mycpu()->ncli != 1) 80103edd: e8 3e fa ff ff call 80103920 <mycpu> 80103ee2: 83 b8 a4 00 00 00 01 cmpl $0x1,0xa4(%eax) 80103ee9: 75 67 jne 80103f52 <sched+0xa2> if(p->state == RUNNING) 80103eeb: 8b 43 0c mov 0xc(%ebx),%eax 80103eee: 83 f8 04 cmp $0x4,%eax 80103ef1: 74 53 je 80103f46 <sched+0x96> asm volatile("pushfl; popl %0" : "=r" (eflags)); 80103ef3: 9c pushf 80103ef4: 58 pop %eax if(readeflags()&FL_IF) 80103ef5: f6 c4 02 test $0x2,%ah 80103ef8: 75 40 jne 80103f3a <sched+0x8a> intena = mycpu()->intena; 80103efa: e8 21 fa ff ff call 80103920 <mycpu> swtch(&p->context, mycpu()->scheduler); 80103eff: 83 c3 1c add $0x1c,%ebx intena = mycpu()->intena; 80103f02: 8b b0 a8 00 00 00 mov 0xa8(%eax),%esi swtch(&p->context, mycpu()->scheduler); 80103f08: e8 13 fa ff ff call 80103920 <mycpu> 80103f0d: 8b 40 04 mov 0x4(%eax),%eax 80103f10: 89 1c 24 mov %ebx,(%esp) 80103f13: 89 44 24 04 mov %eax,0x4(%esp) 80103f17: e8 fd 17 00 00 call 80105719 <swtch> mycpu()->intena = intena; 80103f1c: e8 ff f9 ff ff call 80103920 <mycpu> 80103f21: 89 b0 a8 00 00 00 mov %esi,0xa8(%eax) } 80103f27: 83 c4 10 add $0x10,%esp 80103f2a: 5b pop %ebx 80103f2b: 5e pop %esi 80103f2c: 5d pop %ebp 80103f2d: c3 ret panic("sched ptable.lock"); 80103f2e: c7 04 24 00 86 10 80 movl $0x80108600,(%esp) 80103f35: e8 36 c4 ff ff call 80100370 <panic> panic("sched interruptible"); 80103f3a: c7 04 24 2c 86 10 80 movl $0x8010862c,(%esp) 80103f41: e8 2a c4 ff ff call 80100370 <panic> panic("sched running"); 80103f46: c7 04 24 1e 86 10 80 movl $0x8010861e,(%esp) 80103f4d: e8 1e c4 ff ff call 80100370 <panic> panic("sched locks"); 80103f52: c7 04 24 12 86 10 80 movl $0x80108612,(%esp) 80103f59: e8 12 c4 ff ff call 80100370 <panic> 80103f5e: 66 90 xchg %ax,%ax 80103f60 <exit>: { 80103f60: 55 push %ebp 80103f61: 89 e5 mov %esp,%ebp 80103f63: 57 push %edi 80103f64: 56 push %esi 80103f65: 53 push %ebx 80103f66: 83 ec 1c sub $0x1c,%esp pushcli(); 80103f69: e8 a2 13 00 00 call 80105310 <pushcli> c = mycpu(); 80103f6e: e8 ad f9 ff ff call 80103920 <mycpu> p = c->proc; 80103f73: 8b b0 ac 00 00 00 mov 0xac(%eax),%esi popcli(); 80103f79: e8 d2 13 00 00 call 80105350 <popcli> curproc->status = status; 80103f7e: 8b 45 08 mov 0x8(%ebp),%eax if(curproc == initproc) 80103f81: 39 35 b8 b5 10 80 cmp %esi,0x8010b5b8 curproc->status = status; 80103f87: 89 46 7c mov %eax,0x7c(%esi) if(curproc == initproc) 80103f8a: 0f 84 b8 00 00 00 je 80104048 <exit+0xe8> 80103f90: 8d 5e 28 lea 0x28(%esi),%ebx 80103f93: 8d 7e 68 lea 0x68(%esi),%edi 80103f96: 8d 76 00 lea 0x0(%esi),%esi 80103f99: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi if(curproc->ofile[fd]){ 80103fa0: 8b 03 mov (%ebx),%eax 80103fa2: 85 c0 test %eax,%eax 80103fa4: 74 0e je 80103fb4 <exit+0x54> fileclose(curproc->ofile[fd]); 80103fa6: 89 04 24 mov %eax,(%esp) 80103fa9: e8 82 ce ff ff call 80100e30 <fileclose> curproc->ofile[fd] = 0; 80103fae: c7 03 00 00 00 00 movl $0x0,(%ebx) 80103fb4: 83 c3 04 add $0x4,%ebx for(fd = 0; fd < NOFILE; fd++){ 80103fb7: 39 df cmp %ebx,%edi 80103fb9: 75 e5 jne 80103fa0 <exit+0x40> begin_op(); 80103fbb: e8 d0 ec ff ff call 80102c90 <begin_op> iput(curproc->cwd); 80103fc0: 8b 46 68 mov 0x68(%esi),%eax for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103fc3: bb b4 3d 11 80 mov $0x80113db4,%ebx iput(curproc->cwd); 80103fc8: 89 04 24 mov %eax,(%esp) 80103fcb: e8 50 d8 ff ff call 80101820 <iput> end_op(); 80103fd0: e8 2b ed ff ff call 80102d00 <end_op> curproc->cwd = 0; 80103fd5: c7 46 68 00 00 00 00 movl $0x0,0x68(%esi) acquire(&ptable.lock); 80103fdc: c7 04 24 80 3d 11 80 movl $0x80113d80,(%esp) 80103fe3: e8 08 14 00 00 call 801053f0 <acquire> wakeup1(curproc->parent); 80103fe8: 8b 46 14 mov 0x14(%esi),%eax 80103feb: e8 c0 fa ff ff call 80103ab0 <wakeup1> 80103ff0: eb 14 jmp 80104006 <exit+0xa6> 80103ff2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80103ff8: 81 c3 90 00 00 00 add $0x90,%ebx 80103ffe: 81 fb b4 61 11 80 cmp $0x801161b4,%ebx 80104004: 73 2a jae 80104030 <exit+0xd0> if(p->parent == curproc){ 80104006: 39 73 14 cmp %esi,0x14(%ebx) 80104009: 75 ed jne 80103ff8 <exit+0x98> if(p->state == ZOMBIE) 8010400b: 8b 53 0c mov 0xc(%ebx),%edx p->parent = initproc; 8010400e: a1 b8 b5 10 80 mov 0x8010b5b8,%eax if(p->state == ZOMBIE) 80104013: 83 fa 05 cmp $0x5,%edx p->parent = initproc; 80104016: 89 43 14 mov %eax,0x14(%ebx) if(p->state == ZOMBIE) 80104019: 75 dd jne 80103ff8 <exit+0x98> for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 8010401b: 81 c3 90 00 00 00 add $0x90,%ebx wakeup1(initproc); 80104021: e8 8a fa ff ff call 80103ab0 <wakeup1> for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80104026: 81 fb b4 61 11 80 cmp $0x801161b4,%ebx 8010402c: 72 d8 jb 80104006 <exit+0xa6> 8010402e: 66 90 xchg %ax,%ax curproc->state = ZOMBIE; 80104030: c7 46 0c 05 00 00 00 movl $0x5,0xc(%esi) sched(); 80104037: e8 74 fe ff ff call 80103eb0 <sched> panic("zombie exit"); 8010403c: c7 04 24 4d 86 10 80 movl $0x8010864d,(%esp) 80104043: e8 28 c3 ff ff call 80100370 <panic> panic("init exiting"); 80104048: c7 04 24 40 86 10 80 movl $0x80108640,(%esp) 8010404f: e8 1c c3 ff ff call 80100370 <panic> 80104054: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010405a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80104060 <yield>: { 80104060: 55 push %ebp 80104061: 89 e5 mov %esp,%ebp 80104063: 53 push %ebx 80104064: 83 ec 14 sub $0x14,%esp acquire(&ptable.lock); //DOC: yieldlock 80104067: c7 04 24 80 3d 11 80 movl $0x80113d80,(%esp) 8010406e: e8 7d 13 00 00 call 801053f0 <acquire> pushcli(); 80104073: e8 98 12 00 00 call 80105310 <pushcli> c = mycpu(); 80104078: e8 a3 f8 ff ff call 80103920 <mycpu> p = c->proc; 8010407d: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80104083: e8 c8 12 00 00 call 80105350 <popcli> myproc()->state = RUNNABLE; 80104088: c7 43 0c 03 00 00 00 movl $0x3,0xc(%ebx) pushcli(); 8010408f: e8 7c 12 00 00 call 80105310 <pushcli> c = mycpu(); 80104094: e8 87 f8 ff ff call 80103920 <mycpu> p = c->proc; 80104099: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 8010409f: e8 ac 12 00 00 call 80105350 <popcli> add(myproc()); 801040a4: 89 1c 24 mov %ebx,(%esp) 801040a7: e8 24 f8 ff ff call 801038d0 <add> sched(); 801040ac: e8 ff fd ff ff call 80103eb0 <sched> release(&ptable.lock); 801040b1: c7 04 24 80 3d 11 80 movl $0x80113d80,(%esp) 801040b8: e8 d3 13 00 00 call 80105490 <release> } 801040bd: 83 c4 14 add $0x14,%esp 801040c0: 5b pop %ebx 801040c1: 5d pop %ebp 801040c2: c3 ret 801040c3: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801040c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801040d0 <sleep>: { 801040d0: 55 push %ebp 801040d1: 89 e5 mov %esp,%ebp 801040d3: 83 ec 28 sub $0x28,%esp 801040d6: 89 5d f4 mov %ebx,-0xc(%ebp) 801040d9: 89 75 f8 mov %esi,-0x8(%ebp) 801040dc: 8b 75 0c mov 0xc(%ebp),%esi 801040df: 89 7d fc mov %edi,-0x4(%ebp) 801040e2: 8b 7d 08 mov 0x8(%ebp),%edi pushcli(); 801040e5: e8 26 12 00 00 call 80105310 <pushcli> c = mycpu(); 801040ea: e8 31 f8 ff ff call 80103920 <mycpu> p = c->proc; 801040ef: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 801040f5: e8 56 12 00 00 call 80105350 <popcli> if(p == 0) 801040fa: 85 db test %ebx,%ebx 801040fc: 0f 84 8d 00 00 00 je 8010418f <sleep+0xbf> if(lk == 0) 80104102: 85 f6 test %esi,%esi 80104104: 74 7d je 80104183 <sleep+0xb3> if(lk != &ptable.lock){ //DOC: sleeplock0 80104106: 81 fe 80 3d 11 80 cmp $0x80113d80,%esi 8010410c: 74 52 je 80104160 <sleep+0x90> acquire(&ptable.lock); //DOC: sleeplock1 8010410e: c7 04 24 80 3d 11 80 movl $0x80113d80,(%esp) 80104115: e8 d6 12 00 00 call 801053f0 <acquire> release(lk); 8010411a: 89 34 24 mov %esi,(%esp) 8010411d: e8 6e 13 00 00 call 80105490 <release> p->chan = chan; 80104122: 89 7b 20 mov %edi,0x20(%ebx) p->state = SLEEPING; 80104125: c7 43 0c 02 00 00 00 movl $0x2,0xc(%ebx) sched(); 8010412c: e8 7f fd ff ff call 80103eb0 <sched> p->chan = 0; 80104131: c7 43 20 00 00 00 00 movl $0x0,0x20(%ebx) release(&ptable.lock); 80104138: c7 04 24 80 3d 11 80 movl $0x80113d80,(%esp) 8010413f: e8 4c 13 00 00 call 80105490 <release> } 80104144: 8b 5d f4 mov -0xc(%ebp),%ebx acquire(lk); 80104147: 89 75 08 mov %esi,0x8(%ebp) } 8010414a: 8b 7d fc mov -0x4(%ebp),%edi 8010414d: 8b 75 f8 mov -0x8(%ebp),%esi 80104150: 89 ec mov %ebp,%esp 80104152: 5d pop %ebp acquire(lk); 80104153: e9 98 12 00 00 jmp 801053f0 <acquire> 80104158: 90 nop 80104159: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi p->chan = chan; 80104160: 89 7b 20 mov %edi,0x20(%ebx) p->state = SLEEPING; 80104163: c7 43 0c 02 00 00 00 movl $0x2,0xc(%ebx) sched(); 8010416a: e8 41 fd ff ff call 80103eb0 <sched> p->chan = 0; 8010416f: c7 43 20 00 00 00 00 movl $0x0,0x20(%ebx) } 80104176: 8b 5d f4 mov -0xc(%ebp),%ebx 80104179: 8b 75 f8 mov -0x8(%ebp),%esi 8010417c: 8b 7d fc mov -0x4(%ebp),%edi 8010417f: 89 ec mov %ebp,%esp 80104181: 5d pop %ebp 80104182: c3 ret panic("sleep without lk"); 80104183: c7 04 24 5f 86 10 80 movl $0x8010865f,(%esp) 8010418a: e8 e1 c1 ff ff call 80100370 <panic> panic("sleep"); 8010418f: c7 04 24 59 86 10 80 movl $0x80108659,(%esp) 80104196: e8 d5 c1 ff ff call 80100370 <panic> 8010419b: 90 nop 8010419c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801041a0 <wait>: { 801041a0: 55 push %ebp 801041a1: 89 e5 mov %esp,%ebp 801041a3: 57 push %edi 801041a4: 56 push %esi 801041a5: 53 push %ebx 801041a6: 83 ec 1c sub $0x1c,%esp 801041a9: 8b 7d 08 mov 0x8(%ebp),%edi pushcli(); 801041ac: e8 5f 11 00 00 call 80105310 <pushcli> c = mycpu(); 801041b1: e8 6a f7 ff ff call 80103920 <mycpu> p = c->proc; 801041b6: 8b b0 ac 00 00 00 mov 0xac(%eax),%esi popcli(); 801041bc: e8 8f 11 00 00 call 80105350 <popcli> acquire(&ptable.lock); 801041c1: c7 04 24 80 3d 11 80 movl $0x80113d80,(%esp) 801041c8: e8 23 12 00 00 call 801053f0 <acquire> havekids = 0; 801041cd: 31 c0 xor %eax,%eax for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 801041cf: bb b4 3d 11 80 mov $0x80113db4,%ebx 801041d4: eb 18 jmp 801041ee <wait+0x4e> 801041d6: 8d 76 00 lea 0x0(%esi),%esi 801041d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801041e0: 81 c3 90 00 00 00 add $0x90,%ebx 801041e6: 81 fb b4 61 11 80 cmp $0x801161b4,%ebx 801041ec: 73 20 jae 8010420e <wait+0x6e> if(p->parent != curproc) 801041ee: 39 73 14 cmp %esi,0x14(%ebx) 801041f1: 75 ed jne 801041e0 <wait+0x40> if(p->state == ZOMBIE){ 801041f3: 8b 43 0c mov 0xc(%ebx),%eax 801041f6: 83 f8 05 cmp $0x5,%eax 801041f9: 74 35 je 80104230 <wait+0x90> for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 801041fb: 81 c3 90 00 00 00 add $0x90,%ebx havekids = 1; 80104201: b8 01 00 00 00 mov $0x1,%eax for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80104206: 81 fb b4 61 11 80 cmp $0x801161b4,%ebx 8010420c: 72 e0 jb 801041ee <wait+0x4e> if(!havekids || curproc->killed){ 8010420e: 85 c0 test %eax,%eax 80104210: 74 7d je 8010428f <wait+0xef> 80104212: 8b 56 24 mov 0x24(%esi),%edx 80104215: 85 d2 test %edx,%edx 80104217: 75 76 jne 8010428f <wait+0xef> sleep(curproc, &ptable.lock); //DOC: wait-sleep 80104219: b8 80 3d 11 80 mov $0x80113d80,%eax 8010421e: 89 44 24 04 mov %eax,0x4(%esp) 80104222: 89 34 24 mov %esi,(%esp) 80104225: e8 a6 fe ff ff call 801040d0 <sleep> havekids = 0; 8010422a: eb a1 jmp 801041cd <wait+0x2d> 8010422c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(status != 0){ 80104230: 85 ff test %edi,%edi 80104232: 74 05 je 80104239 <wait+0x99> *status = p->status; 80104234: 8b 43 7c mov 0x7c(%ebx),%eax 80104237: 89 07 mov %eax,(%edi) kfree(p->kstack); 80104239: 8b 43 08 mov 0x8(%ebx),%eax pid = p->pid; 8010423c: 8b 73 10 mov 0x10(%ebx),%esi kfree(p->kstack); 8010423f: 89 04 24 mov %eax,(%esp) 80104242: e8 99 e1 ff ff call 801023e0 <kfree> freevm(p->pgdir); 80104247: 8b 43 04 mov 0x4(%ebx),%eax p->kstack = 0; 8010424a: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx) freevm(p->pgdir); 80104251: 89 04 24 mov %eax,(%esp) 80104254: e8 87 3a 00 00 call 80107ce0 <freevm> release(&ptable.lock); 80104259: c7 04 24 80 3d 11 80 movl $0x80113d80,(%esp) p->pid = 0; 80104260: c7 43 10 00 00 00 00 movl $0x0,0x10(%ebx) p->parent = 0; 80104267: c7 43 14 00 00 00 00 movl $0x0,0x14(%ebx) p->name[0] = 0; 8010426e: c6 43 6c 00 movb $0x0,0x6c(%ebx) p->killed = 0; 80104272: c7 43 24 00 00 00 00 movl $0x0,0x24(%ebx) p->state = UNUSED; 80104279: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx) release(&ptable.lock); 80104280: e8 0b 12 00 00 call 80105490 <release> } 80104285: 83 c4 1c add $0x1c,%esp 80104288: 89 f0 mov %esi,%eax 8010428a: 5b pop %ebx 8010428b: 5e pop %esi 8010428c: 5f pop %edi 8010428d: 5d pop %ebp 8010428e: c3 ret release(&ptable.lock); 8010428f: c7 04 24 80 3d 11 80 movl $0x80113d80,(%esp) return -1; 80104296: be ff ff ff ff mov $0xffffffff,%esi release(&ptable.lock); 8010429b: e8 f0 11 00 00 call 80105490 <release> return -1; 801042a0: eb e3 jmp 80104285 <wait+0xe5> 801042a2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801042a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801042b0 <wakeup>: // Wake up all processes sleeping on chan. void wakeup(void *chan) { 801042b0: 55 push %ebp 801042b1: 89 e5 mov %esp,%ebp 801042b3: 53 push %ebx 801042b4: 83 ec 14 sub $0x14,%esp 801042b7: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&ptable.lock); 801042ba: c7 04 24 80 3d 11 80 movl $0x80113d80,(%esp) 801042c1: e8 2a 11 00 00 call 801053f0 <acquire> wakeup1(chan); 801042c6: 89 d8 mov %ebx,%eax 801042c8: e8 e3 f7 ff ff call 80103ab0 <wakeup1> release(&ptable.lock); 801042cd: c7 45 08 80 3d 11 80 movl $0x80113d80,0x8(%ebp) } 801042d4: 83 c4 14 add $0x14,%esp 801042d7: 5b pop %ebx 801042d8: 5d pop %ebp release(&ptable.lock); 801042d9: e9 b2 11 00 00 jmp 80105490 <release> 801042de: 66 90 xchg %ax,%ax 801042e0 <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) { 801042e0: 55 push %ebp 801042e1: 89 e5 mov %esp,%ebp 801042e3: 56 push %esi 801042e4: 53 push %ebx struct proc *p; acquire(&ptable.lock); for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 801042e5: bb b4 3d 11 80 mov $0x80113db4,%ebx { 801042ea: 83 ec 10 sub $0x10,%esp acquire(&ptable.lock); 801042ed: c7 04 24 80 3d 11 80 movl $0x80113d80,(%esp) { 801042f4: 8b 75 08 mov 0x8(%ebp),%esi acquire(&ptable.lock); 801042f7: e8 f4 10 00 00 call 801053f0 <acquire> 801042fc: eb 10 jmp 8010430e <kill+0x2e> 801042fe: 66 90 xchg %ax,%ax for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80104300: 81 c3 90 00 00 00 add $0x90,%ebx 80104306: 81 fb b4 61 11 80 cmp $0x801161b4,%ebx 8010430c: 73 52 jae 80104360 <kill+0x80> if(p->pid == pid){ 8010430e: 39 73 10 cmp %esi,0x10(%ebx) 80104311: 75 ed jne 80104300 <kill+0x20> p->killed = 1; // Wake process from sleep if necessary. if(p->state == SLEEPING){ 80104313: 8b 43 0c mov 0xc(%ebx),%eax p->killed = 1; 80104316: c7 43 24 01 00 00 00 movl $0x1,0x24(%ebx) if(p->state == SLEEPING){ 8010431d: 83 f8 02 cmp $0x2,%eax 80104320: 74 1e je 80104340 <kill+0x60> setNewAcc(p); p->state = RUNNABLE; add(p); } release(&ptable.lock); 80104322: c7 04 24 80 3d 11 80 movl $0x80113d80,(%esp) 80104329: e8 62 11 00 00 call 80105490 <release> return 0; } } release(&ptable.lock); return -1; } 8010432e: 83 c4 10 add $0x10,%esp return 0; 80104331: 31 c0 xor %eax,%eax } 80104333: 5b pop %ebx 80104334: 5e pop %esi 80104335: 5d pop %ebp 80104336: c3 ret 80104337: 89 f6 mov %esi,%esi 80104339: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi setNewAcc(p); 80104340: 89 1c 24 mov %ebx,(%esp) 80104343: e8 a8 f6 ff ff call 801039f0 <setNewAcc> add(p); 80104348: 89 1c 24 mov %ebx,(%esp) p->state = RUNNABLE; 8010434b: c7 43 0c 03 00 00 00 movl $0x3,0xc(%ebx) add(p); 80104352: e8 79 f5 ff ff call 801038d0 <add> 80104357: eb c9 jmp 80104322 <kill+0x42> 80104359: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi release(&ptable.lock); 80104360: c7 04 24 80 3d 11 80 movl $0x80113d80,(%esp) 80104367: e8 24 11 00 00 call 80105490 <release> } 8010436c: 83 c4 10 add $0x10,%esp return -1; 8010436f: b8 ff ff ff ff mov $0xffffffff,%eax } 80104374: 5b pop %ebx 80104375: 5e pop %esi 80104376: 5d pop %ebp 80104377: c3 ret 80104378: 90 nop 80104379: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104380 <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) { 80104380: 55 push %ebp 80104381: 89 e5 mov %esp,%ebp 80104383: 57 push %edi 80104384: 56 push %esi 80104385: 53 push %ebx int i; struct proc *p; char *state; uint pc[10]; for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 80104386: bb b4 3d 11 80 mov $0x80113db4,%ebx { 8010438b: 83 ec 4c sub $0x4c,%esp 8010438e: eb 1e jmp 801043ae <procdump+0x2e> 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"); 80104390: c7 04 24 df 89 10 80 movl $0x801089df,(%esp) 80104397: e8 b4 c2 ff ff call 80100650 <cprintf> for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 8010439c: 81 c3 90 00 00 00 add $0x90,%ebx 801043a2: 81 fb b4 61 11 80 cmp $0x801161b4,%ebx 801043a8: 0f 83 b2 00 00 00 jae 80104460 <procdump+0xe0> if(p->state == UNUSED) 801043ae: 8b 43 0c mov 0xc(%ebx),%eax 801043b1: 85 c0 test %eax,%eax 801043b3: 74 e7 je 8010439c <procdump+0x1c> if(p->state >= 0 && p->state < NELEM(states) && states[p->state]) 801043b5: 8b 43 0c mov 0xc(%ebx),%eax state = "???"; 801043b8: b8 70 86 10 80 mov $0x80108670,%eax if(p->state >= 0 && p->state < NELEM(states) && states[p->state]) 801043bd: 8b 53 0c mov 0xc(%ebx),%edx 801043c0: 83 fa 05 cmp $0x5,%edx 801043c3: 77 18 ja 801043dd <procdump+0x5d> 801043c5: 8b 53 0c mov 0xc(%ebx),%edx 801043c8: 8b 14 95 d0 86 10 80 mov -0x7fef7930(,%edx,4),%edx 801043cf: 85 d2 test %edx,%edx 801043d1: 74 0a je 801043dd <procdump+0x5d> state = states[p->state]; 801043d3: 8b 43 0c mov 0xc(%ebx),%eax 801043d6: 8b 04 85 d0 86 10 80 mov -0x7fef7930(,%eax,4),%eax cprintf("%d %s %s", p->pid, state, p->name); 801043dd: 89 44 24 08 mov %eax,0x8(%esp) 801043e1: 8b 43 10 mov 0x10(%ebx),%eax 801043e4: 8d 53 6c lea 0x6c(%ebx),%edx 801043e7: 89 54 24 0c mov %edx,0xc(%esp) 801043eb: c7 04 24 74 86 10 80 movl $0x80108674,(%esp) 801043f2: 89 44 24 04 mov %eax,0x4(%esp) 801043f6: e8 55 c2 ff ff call 80100650 <cprintf> if(p->state == SLEEPING){ 801043fb: 8b 43 0c mov 0xc(%ebx),%eax 801043fe: 83 f8 02 cmp $0x2,%eax 80104401: 75 8d jne 80104390 <procdump+0x10> getcallerpcs((uint*)p->context->ebp+2, pc); 80104403: 8d 45 c0 lea -0x40(%ebp),%eax 80104406: 89 44 24 04 mov %eax,0x4(%esp) 8010440a: 8b 43 1c mov 0x1c(%ebx),%eax 8010440d: 8d 75 c0 lea -0x40(%ebp),%esi 80104410: 8d 7d e8 lea -0x18(%ebp),%edi 80104413: 8b 40 0c mov 0xc(%eax),%eax 80104416: 83 c0 08 add $0x8,%eax 80104419: 89 04 24 mov %eax,(%esp) 8010441c: e8 9f 0e 00 00 call 801052c0 <getcallerpcs> 80104421: eb 0d jmp 80104430 <procdump+0xb0> 80104423: 90 nop 80104424: 90 nop 80104425: 90 nop 80104426: 90 nop 80104427: 90 nop 80104428: 90 nop 80104429: 90 nop 8010442a: 90 nop 8010442b: 90 nop 8010442c: 90 nop 8010442d: 90 nop 8010442e: 90 nop 8010442f: 90 nop for(i=0; i<10 && pc[i] != 0; i++) 80104430: 8b 16 mov (%esi),%edx 80104432: 85 d2 test %edx,%edx 80104434: 0f 84 56 ff ff ff je 80104390 <procdump+0x10> cprintf(" %p", pc[i]); 8010443a: 89 54 24 04 mov %edx,0x4(%esp) 8010443e: 83 c6 04 add $0x4,%esi 80104441: c7 04 24 61 80 10 80 movl $0x80108061,(%esp) 80104448: e8 03 c2 ff ff call 80100650 <cprintf> for(i=0; i<10 && pc[i] != 0; i++) 8010444d: 39 f7 cmp %esi,%edi 8010444f: 75 df jne 80104430 <procdump+0xb0> 80104451: e9 3a ff ff ff jmp 80104390 <procdump+0x10> 80104456: 8d 76 00 lea 0x0(%esi),%esi 80104459: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi } } 80104460: 83 c4 4c add $0x4c,%esp 80104463: 5b pop %ebx 80104464: 5e pop %esi 80104465: 5f pop %edi 80104466: 5d pop %ebp 80104467: c3 ret 80104468: 90 nop 80104469: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104470 <detach>: int detach(int pid) { 80104470: 55 push %ebp 80104471: 89 e5 mov %esp,%ebp 80104473: 56 push %esi 80104474: 53 push %ebx 80104475: 8b 5d 08 mov 0x8(%ebp),%ebx pushcli(); 80104478: e8 93 0e 00 00 call 80105310 <pushcli> c = mycpu(); 8010447d: e8 9e f4 ff ff call 80103920 <mycpu> p = c->proc; 80104482: 8b b0 ac 00 00 00 mov 0xac(%eax),%esi popcli(); 80104488: e8 c3 0e 00 00 call 80105350 <popcli> struct proc *p; struct proc *curproc = myproc(); for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 8010448d: ba b4 3d 11 80 mov $0x80113db4,%edx 80104492: eb 12 jmp 801044a6 <detach+0x36> 80104494: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104498: 81 c2 90 00 00 00 add $0x90,%edx 8010449e: 81 fa b4 61 11 80 cmp $0x801161b4,%edx 801044a4: 73 2a jae 801044d0 <detach+0x60> if(p->pid == pid && p->parent == curproc){ 801044a6: 39 5a 10 cmp %ebx,0x10(%edx) 801044a9: 75 ed jne 80104498 <detach+0x28> 801044ab: 39 72 14 cmp %esi,0x14(%edx) 801044ae: 75 e8 jne 80104498 <detach+0x28> p->parent = initproc; 801044b0: a1 b8 b5 10 80 mov 0x8010b5b8,%eax if(p->state == ZOMBIE) wakeup1(initproc); return 0; 801044b5: 31 db xor %ebx,%ebx p->parent = initproc; 801044b7: 89 42 14 mov %eax,0x14(%edx) if(p->state == ZOMBIE) 801044ba: 8b 52 0c mov 0xc(%edx),%edx 801044bd: 83 fa 05 cmp $0x5,%edx 801044c0: 74 19 je 801044db <detach+0x6b> } } return -1; } 801044c2: 89 d8 mov %ebx,%eax 801044c4: 5b pop %ebx 801044c5: 5e pop %esi 801044c6: 5d pop %ebp 801044c7: c3 ret 801044c8: 90 nop 801044c9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return -1; 801044d0: bb ff ff ff ff mov $0xffffffff,%ebx } 801044d5: 89 d8 mov %ebx,%eax 801044d7: 5b pop %ebx 801044d8: 5e pop %esi 801044d9: 5d pop %ebp 801044da: c3 ret wakeup1(initproc); 801044db: e8 d0 f5 ff ff call 80103ab0 <wakeup1> } 801044e0: 89 d8 mov %ebx,%eax 801044e2: 5b pop %ebx 801044e3: 5e pop %esi 801044e4: 5d pop %ebp 801044e5: c3 ret 801044e6: 66 90 xchg %ax,%ax 801044e8: 66 90 xchg %ax,%ax 801044ea: 66 90 xchg %ax,%ax 801044ec: 66 90 xchg %ax,%ax 801044ee: 66 90 xchg %ax,%ax 801044f0 <isEmptyPriorityQueue>: Proc* MapNode::dequeue() { return listOfProcs.dequeue(); } bool Map::isEmpty() { return !root; 801044f0: a1 0c b6 10 80 mov 0x8010b60c,%eax static boolean isEmptyPriorityQueue() { 801044f5: 55 push %ebp 801044f6: 89 e5 mov %esp,%ebp } 801044f8: 5d pop %ebp return !root; 801044f9: 8b 00 mov (%eax),%eax 801044fb: 85 c0 test %eax,%eax 801044fd: 0f 94 c0 sete %al 80104500: 0f b6 c0 movzbl %al,%eax } 80104503: c3 ret 80104504: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010450a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80104510 <getMinAccumulatorPriorityQueue>: return !root; 80104510: a1 0c b6 10 80 mov 0x8010b60c,%eax 80104515: 8b 10 mov (%eax),%edx return root->put(p); } bool Map::getMinKey(long long *pkey) { if(isEmpty()) 80104517: 85 d2 test %edx,%edx 80104519: 74 35 je 80104550 <getMinAccumulatorPriorityQueue+0x40> static boolean getMinAccumulatorPriorityQueue(long long* pkey) { 8010451b: 55 push %ebp 8010451c: 89 e5 mov %esp,%ebp 8010451e: 53 push %ebx 8010451f: eb 09 jmp 8010452a <getMinAccumulatorPriorityQueue+0x1a> 80104521: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi while(minNode->left) 80104528: 89 c2 mov %eax,%edx 8010452a: 8b 42 18 mov 0x18(%edx),%eax 8010452d: 85 c0 test %eax,%eax 8010452f: 75 f7 jne 80104528 <getMinAccumulatorPriorityQueue+0x18> *pkey = getMinNode()->key; 80104531: 8b 45 08 mov 0x8(%ebp),%eax 80104534: 8b 5a 04 mov 0x4(%edx),%ebx 80104537: 8b 0a mov (%edx),%ecx 80104539: 89 58 04 mov %ebx,0x4(%eax) 8010453c: 89 08 mov %ecx,(%eax) 8010453e: b8 01 00 00 00 mov $0x1,%eax } 80104543: 5b pop %ebx 80104544: 5d pop %ebp 80104545: c3 ret 80104546: 8d 76 00 lea 0x0(%esi),%esi 80104549: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi if(isEmpty()) 80104550: 31 c0 xor %eax,%eax } 80104552: c3 ret 80104553: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104559: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104560 <isEmptyRoundRobinQueue>: return !first; 80104560: a1 08 b6 10 80 mov 0x8010b608,%eax static boolean isEmptyRoundRobinQueue() { 80104565: 55 push %ebp 80104566: 89 e5 mov %esp,%ebp } 80104568: 5d pop %ebp return !first; 80104569: 8b 00 mov (%eax),%eax 8010456b: 85 c0 test %eax,%eax 8010456d: 0f 94 c0 sete %al 80104570: 0f b6 c0 movzbl %al,%eax } 80104573: c3 ret 80104574: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010457a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80104580 <enqueueRoundRobinQueue>: if(!freeLinks) 80104580: a1 00 b6 10 80 mov 0x8010b600,%eax 80104585: 85 c0 test %eax,%eax 80104587: 74 47 je 801045d0 <enqueueRoundRobinQueue+0x50> static boolean enqueueRoundRobinQueue(Proc *p) { 80104589: 55 push %ebp return roundRobinQ->enqueue(p); 8010458a: 8b 0d 08 b6 10 80 mov 0x8010b608,%ecx freeLinks = freeLinks->next; 80104590: 8b 50 04 mov 0x4(%eax),%edx static boolean enqueueRoundRobinQueue(Proc *p) { 80104593: 89 e5 mov %esp,%ebp ans->next = null; 80104595: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax) freeLinks = freeLinks->next; 8010459c: 89 15 00 b6 10 80 mov %edx,0x8010b600 ans->p = p; 801045a2: 8b 55 08 mov 0x8(%ebp),%edx 801045a5: 89 10 mov %edx,(%eax) if(isEmpty()) first = link; 801045a7: 8b 11 mov (%ecx),%edx 801045a9: 85 d2 test %edx,%edx 801045ab: 74 2b je 801045d8 <enqueueRoundRobinQueue+0x58> else last->next = link; 801045ad: 8b 51 04 mov 0x4(%ecx),%edx 801045b0: 89 42 04 mov %eax,0x4(%edx) 801045b3: eb 05 jmp 801045ba <enqueueRoundRobinQueue+0x3a> 801045b5: 8d 76 00 lea 0x0(%esi),%esi while(ans->next) 801045b8: 89 d0 mov %edx,%eax 801045ba: 8b 50 04 mov 0x4(%eax),%edx 801045bd: 85 d2 test %edx,%edx 801045bf: 75 f7 jne 801045b8 <enqueueRoundRobinQueue+0x38> last = link->getLast(); 801045c1: 89 41 04 mov %eax,0x4(%ecx) 801045c4: b8 01 00 00 00 mov $0x1,%eax } 801045c9: 5d pop %ebp 801045ca: c3 ret 801045cb: 90 nop 801045cc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(!freeLinks) 801045d0: 31 c0 xor %eax,%eax } 801045d2: c3 ret 801045d3: 90 nop 801045d4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(isEmpty()) first = link; 801045d8: 89 01 mov %eax,(%ecx) 801045da: eb de jmp 801045ba <enqueueRoundRobinQueue+0x3a> 801045dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801045e0 <dequeueRoundRobinQueue>: return roundRobinQ->dequeue(); 801045e0: 8b 0d 08 b6 10 80 mov 0x8010b608,%ecx return !first; 801045e6: 8b 11 mov (%ecx),%edx if(isEmpty()) 801045e8: 85 d2 test %edx,%edx 801045ea: 74 3c je 80104628 <dequeueRoundRobinQueue+0x48> static Proc* dequeueRoundRobinQueue() { 801045ec: 55 push %ebp 801045ed: 89 e5 mov %esp,%ebp 801045ef: 83 ec 08 sub $0x8,%esp 801045f2: 89 75 fc mov %esi,-0x4(%ebp) link->next = freeLinks; 801045f5: 8b 35 00 b6 10 80 mov 0x8010b600,%esi static Proc* dequeueRoundRobinQueue() { 801045fb: 89 5d f8 mov %ebx,-0x8(%ebp) Link *next = first->next; 801045fe: 8b 5a 04 mov 0x4(%edx),%ebx Proc *p = first->p; 80104601: 8b 02 mov (%edx),%eax link->next = freeLinks; 80104603: 89 72 04 mov %esi,0x4(%edx) freeLinks = link; 80104606: 89 15 00 b6 10 80 mov %edx,0x8010b600 if(isEmpty()) 8010460c: 85 db test %ebx,%ebx first = next; 8010460e: 89 19 mov %ebx,(%ecx) if(isEmpty()) 80104610: 75 07 jne 80104619 <dequeueRoundRobinQueue+0x39> last = null; 80104612: c7 41 04 00 00 00 00 movl $0x0,0x4(%ecx) } 80104619: 8b 5d f8 mov -0x8(%ebp),%ebx 8010461c: 8b 75 fc mov -0x4(%ebp),%esi 8010461f: 89 ec mov %ebp,%esp 80104621: 5d pop %ebp 80104622: c3 ret 80104623: 90 nop 80104624: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return null; 80104628: 31 c0 xor %eax,%eax } 8010462a: c3 ret 8010462b: 90 nop 8010462c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104630 <switchToPriorityQueuePolicyRoundRobinQueue>: if(!priorityQ->isEmpty()) 80104630: 8b 15 0c b6 10 80 mov 0x8010b60c,%edx 80104636: 31 c0 xor %eax,%eax 80104638: 8b 0a mov (%edx),%ecx 8010463a: 85 c9 test %ecx,%ecx 8010463c: 74 02 je 80104640 <switchToPriorityQueuePolicyRoundRobinQueue+0x10> } 8010463e: c3 ret 8010463f: 90 nop if(!freeNodes) 80104640: 8b 0d fc b5 10 80 mov 0x8010b5fc,%ecx 80104646: 85 c9 test %ecx,%ecx 80104648: 74 f4 je 8010463e <switchToPriorityQueuePolicyRoundRobinQueue+0xe> static boolean switchToPriorityQueuePolicyRoundRobinQueue() { 8010464a: 55 push %ebp return roundRobinQ->transfer(); 8010464b: a1 08 b6 10 80 mov 0x8010b608,%eax static boolean switchToPriorityQueuePolicyRoundRobinQueue() { 80104650: 89 e5 mov %esp,%ebp 80104652: 53 push %ebx freeNodes = freeNodes->next; 80104653: 8b 59 10 mov 0x10(%ecx),%ebx ans->key = key; 80104656: c7 01 00 00 00 00 movl $0x0,(%ecx) ans->next = null; 8010465c: c7 41 10 00 00 00 00 movl $0x0,0x10(%ecx) ans->key = key; 80104663: c7 41 04 00 00 00 00 movl $0x0,0x4(%ecx) freeNodes = freeNodes->next; 8010466a: 89 1d fc b5 10 80 mov %ebx,0x8010b5fc node->listOfProcs.first = first; 80104670: 8b 18 mov (%eax),%ebx 80104672: 89 59 08 mov %ebx,0x8(%ecx) node->listOfProcs.last = last; 80104675: 8b 58 04 mov 0x4(%eax),%ebx 80104678: 89 59 0c mov %ebx,0xc(%ecx) first = last = null; 8010467b: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax) 80104682: c7 00 00 00 00 00 movl $0x0,(%eax) priorityQ->root = node; 80104688: b8 01 00 00 00 mov $0x1,%eax 8010468d: 89 0a mov %ecx,(%edx) } 8010468f: 5b pop %ebx 80104690: 5d pop %ebp 80104691: c3 ret 80104692: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104699: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801046a0 <isEmptyRunningProcessHolder>: return !first; 801046a0: a1 04 b6 10 80 mov 0x8010b604,%eax static boolean isEmptyRunningProcessHolder() { 801046a5: 55 push %ebp 801046a6: 89 e5 mov %esp,%ebp } 801046a8: 5d pop %ebp return !first; 801046a9: 8b 00 mov (%eax),%eax 801046ab: 85 c0 test %eax,%eax 801046ad: 0f 94 c0 sete %al 801046b0: 0f b6 c0 movzbl %al,%eax } 801046b3: c3 ret 801046b4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801046ba: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 801046c0 <addRunningProcessHolder>: if(!freeLinks) 801046c0: a1 00 b6 10 80 mov 0x8010b600,%eax 801046c5: 85 c0 test %eax,%eax 801046c7: 74 47 je 80104710 <addRunningProcessHolder+0x50> static boolean addRunningProcessHolder(Proc* p) { 801046c9: 55 push %ebp return runningProcHolder->enqueue(p); 801046ca: 8b 0d 04 b6 10 80 mov 0x8010b604,%ecx freeLinks = freeLinks->next; 801046d0: 8b 50 04 mov 0x4(%eax),%edx static boolean addRunningProcessHolder(Proc* p) { 801046d3: 89 e5 mov %esp,%ebp ans->next = null; 801046d5: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax) freeLinks = freeLinks->next; 801046dc: 89 15 00 b6 10 80 mov %edx,0x8010b600 ans->p = p; 801046e2: 8b 55 08 mov 0x8(%ebp),%edx 801046e5: 89 10 mov %edx,(%eax) if(isEmpty()) first = link; 801046e7: 8b 11 mov (%ecx),%edx 801046e9: 85 d2 test %edx,%edx 801046eb: 74 2b je 80104718 <addRunningProcessHolder+0x58> else last->next = link; 801046ed: 8b 51 04 mov 0x4(%ecx),%edx 801046f0: 89 42 04 mov %eax,0x4(%edx) 801046f3: eb 05 jmp 801046fa <addRunningProcessHolder+0x3a> 801046f5: 8d 76 00 lea 0x0(%esi),%esi while(ans->next) 801046f8: 89 d0 mov %edx,%eax 801046fa: 8b 50 04 mov 0x4(%eax),%edx 801046fd: 85 d2 test %edx,%edx 801046ff: 75 f7 jne 801046f8 <addRunningProcessHolder+0x38> last = link->getLast(); 80104701: 89 41 04 mov %eax,0x4(%ecx) 80104704: b8 01 00 00 00 mov $0x1,%eax } 80104709: 5d pop %ebp 8010470a: c3 ret 8010470b: 90 nop 8010470c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(!freeLinks) 80104710: 31 c0 xor %eax,%eax } 80104712: c3 ret 80104713: 90 nop 80104714: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(isEmpty()) first = link; 80104718: 89 01 mov %eax,(%ecx) 8010471a: eb de jmp 801046fa <addRunningProcessHolder+0x3a> 8010471c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104720 <_ZL9allocNodeP4procx>: static MapNode* allocNode(Proc *p, long long key) { 80104720: 55 push %ebp 80104721: 89 e5 mov %esp,%ebp 80104723: 56 push %esi 80104724: 53 push %ebx if(!freeNodes) 80104725: 8b 1d fc b5 10 80 mov 0x8010b5fc,%ebx 8010472b: 85 db test %ebx,%ebx 8010472d: 74 4d je 8010477c <_ZL9allocNodeP4procx+0x5c> ans->key = key; 8010472f: 89 13 mov %edx,(%ebx) if(!freeLinks) 80104731: 8b 15 00 b6 10 80 mov 0x8010b600,%edx freeNodes = freeNodes->next; 80104737: 8b 73 10 mov 0x10(%ebx),%esi ans->key = key; 8010473a: 89 4b 04 mov %ecx,0x4(%ebx) ans->next = null; 8010473d: c7 43 10 00 00 00 00 movl $0x0,0x10(%ebx) if(!freeLinks) 80104744: 85 d2 test %edx,%edx freeNodes = freeNodes->next; 80104746: 89 35 fc b5 10 80 mov %esi,0x8010b5fc if(!freeLinks) 8010474c: 74 3f je 8010478d <_ZL9allocNodeP4procx+0x6d> freeLinks = freeLinks->next; 8010474e: 8b 4a 04 mov 0x4(%edx),%ecx ans->p = p; 80104751: 89 02 mov %eax,(%edx) ans->next = null; 80104753: c7 42 04 00 00 00 00 movl $0x0,0x4(%edx) if(isEmpty()) first = link; 8010475a: 8b 43 08 mov 0x8(%ebx),%eax freeLinks = freeLinks->next; 8010475d: 89 0d 00 b6 10 80 mov %ecx,0x8010b600 if(isEmpty()) first = link; 80104763: 85 c0 test %eax,%eax 80104765: 74 21 je 80104788 <_ZL9allocNodeP4procx+0x68> else last->next = link; 80104767: 8b 43 0c mov 0xc(%ebx),%eax 8010476a: 89 50 04 mov %edx,0x4(%eax) 8010476d: eb 03 jmp 80104772 <_ZL9allocNodeP4procx+0x52> 8010476f: 90 nop while(ans->next) 80104770: 89 ca mov %ecx,%edx 80104772: 8b 4a 04 mov 0x4(%edx),%ecx 80104775: 85 c9 test %ecx,%ecx 80104777: 75 f7 jne 80104770 <_ZL9allocNodeP4procx+0x50> last = link->getLast(); 80104779: 89 53 0c mov %edx,0xc(%ebx) } 8010477c: 89 d8 mov %ebx,%eax 8010477e: 5b pop %ebx 8010477f: 5e pop %esi 80104780: 5d pop %ebp 80104781: c3 ret 80104782: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if(isEmpty()) first = link; 80104788: 89 53 08 mov %edx,0x8(%ebx) 8010478b: eb e5 jmp 80104772 <_ZL9allocNodeP4procx+0x52> node->parent = node->left = node->right = null; 8010478d: c7 43 1c 00 00 00 00 movl $0x0,0x1c(%ebx) 80104794: c7 43 18 00 00 00 00 movl $0x0,0x18(%ebx) 8010479b: c7 43 14 00 00 00 00 movl $0x0,0x14(%ebx) node->next = freeNodes; 801047a2: 89 73 10 mov %esi,0x10(%ebx) freeNodes = node; 801047a5: 89 1d fc b5 10 80 mov %ebx,0x8010b5fc return null; 801047ab: 31 db xor %ebx,%ebx 801047ad: eb cd jmp 8010477c <_ZL9allocNodeP4procx+0x5c> 801047af: 90 nop 801047b0 <_ZL8mymallocj>: static char* mymalloc(uint size) { 801047b0: 55 push %ebp 801047b1: 89 e5 mov %esp,%ebp 801047b3: 53 push %ebx 801047b4: 89 c3 mov %eax,%ebx 801047b6: 83 ec 14 sub $0x14,%esp if(spaceLeft < size) { 801047b9: 8b 15 f4 b5 10 80 mov 0x8010b5f4,%edx 801047bf: 39 c2 cmp %eax,%edx 801047c1: 73 26 jae 801047e9 <_ZL8mymallocj+0x39> data = kalloc(); 801047c3: e8 e8 dd ff ff call 801025b0 <kalloc> memset(data, 0, PGSIZE); 801047c8: ba 00 10 00 00 mov $0x1000,%edx 801047cd: 31 c9 xor %ecx,%ecx 801047cf: 89 54 24 08 mov %edx,0x8(%esp) 801047d3: 89 4c 24 04 mov %ecx,0x4(%esp) 801047d7: 89 04 24 mov %eax,(%esp) data = kalloc(); 801047da: a3 f8 b5 10 80 mov %eax,0x8010b5f8 memset(data, 0, PGSIZE); 801047df: e8 fc 0c 00 00 call 801054e0 <memset> 801047e4: ba 00 10 00 00 mov $0x1000,%edx char* ans = data; 801047e9: a1 f8 b5 10 80 mov 0x8010b5f8,%eax spaceLeft -= size; 801047ee: 29 da sub %ebx,%edx 801047f0: 89 15 f4 b5 10 80 mov %edx,0x8010b5f4 data += size; 801047f6: 8d 0c 18 lea (%eax,%ebx,1),%ecx 801047f9: 89 0d f8 b5 10 80 mov %ecx,0x8010b5f8 } 801047ff: 83 c4 14 add $0x14,%esp 80104802: 5b pop %ebx 80104803: 5d pop %ebp 80104804: c3 ret 80104805: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104809: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104810 <initSchedDS>: void initSchedDS() { //called once by the "pioneer" cpu from the main function in main.c 80104810: 55 push %ebp data = null; 80104811: 31 c0 xor %eax,%eax void initSchedDS() { //called once by the "pioneer" cpu from the main function in main.c 80104813: 89 e5 mov %esp,%ebp 80104815: 53 push %ebx freeLinks = null; 80104816: bb 80 00 00 00 mov $0x80,%ebx void initSchedDS() { //called once by the "pioneer" cpu from the main function in main.c 8010481b: 83 ec 04 sub $0x4,%esp data = null; 8010481e: a3 f8 b5 10 80 mov %eax,0x8010b5f8 spaceLeft = 0u; 80104823: 31 c0 xor %eax,%eax 80104825: a3 f4 b5 10 80 mov %eax,0x8010b5f4 priorityQ = (Map*)mymalloc(sizeof(Map)); 8010482a: b8 04 00 00 00 mov $0x4,%eax 8010482f: e8 7c ff ff ff call 801047b0 <_ZL8mymallocj> 80104834: a3 0c b6 10 80 mov %eax,0x8010b60c *priorityQ = Map(); 80104839: c7 00 00 00 00 00 movl $0x0,(%eax) roundRobinQ = (LinkedList*)mymalloc(sizeof(LinkedList)); 8010483f: b8 08 00 00 00 mov $0x8,%eax 80104844: e8 67 ff ff ff call 801047b0 <_ZL8mymallocj> 80104849: a3 08 b6 10 80 mov %eax,0x8010b608 *roundRobinQ = LinkedList(); 8010484e: c7 00 00 00 00 00 movl $0x0,(%eax) 80104854: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax) runningProcHolder = (LinkedList*)mymalloc(sizeof(LinkedList)); 8010485b: b8 08 00 00 00 mov $0x8,%eax 80104860: e8 4b ff ff ff call 801047b0 <_ZL8mymallocj> 80104865: a3 04 b6 10 80 mov %eax,0x8010b604 *runningProcHolder = LinkedList(); 8010486a: c7 00 00 00 00 00 movl $0x0,(%eax) 80104870: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax) freeLinks = null; 80104877: 31 c0 xor %eax,%eax 80104879: a3 00 b6 10 80 mov %eax,0x8010b600 8010487e: 66 90 xchg %ax,%ax Link *link = (Link*)mymalloc(sizeof(Link)); 80104880: b8 08 00 00 00 mov $0x8,%eax 80104885: e8 26 ff ff ff call 801047b0 <_ZL8mymallocj> link->next = freeLinks; 8010488a: 8b 15 00 b6 10 80 mov 0x8010b600,%edx for(int i = 0; i < NPROCLIST; ++i) { 80104890: 4b dec %ebx *link = Link(); 80104891: c7 00 00 00 00 00 movl $0x0,(%eax) link->next = freeLinks; 80104897: 89 50 04 mov %edx,0x4(%eax) freeLinks = link; 8010489a: a3 00 b6 10 80 mov %eax,0x8010b600 for(int i = 0; i < NPROCLIST; ++i) { 8010489f: 75 df jne 80104880 <initSchedDS+0x70> freeNodes = null; 801048a1: 31 c0 xor %eax,%eax 801048a3: bb 80 00 00 00 mov $0x80,%ebx 801048a8: a3 fc b5 10 80 mov %eax,0x8010b5fc 801048ad: 8d 76 00 lea 0x0(%esi),%esi MapNode *node = (MapNode*)mymalloc(sizeof(MapNode)); 801048b0: b8 20 00 00 00 mov $0x20,%eax 801048b5: e8 f6 fe ff ff call 801047b0 <_ZL8mymallocj> node->next = freeNodes; 801048ba: 8b 15 fc b5 10 80 mov 0x8010b5fc,%edx for(int i = 0; i < NPROCMAP; ++i) { 801048c0: 4b dec %ebx *node = MapNode(); 801048c1: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax) 801048c8: c7 40 0c 00 00 00 00 movl $0x0,0xc(%eax) 801048cf: c7 40 14 00 00 00 00 movl $0x0,0x14(%eax) 801048d6: c7 40 18 00 00 00 00 movl $0x0,0x18(%eax) 801048dd: c7 40 1c 00 00 00 00 movl $0x0,0x1c(%eax) node->next = freeNodes; 801048e4: 89 50 10 mov %edx,0x10(%eax) freeNodes = node; 801048e7: a3 fc b5 10 80 mov %eax,0x8010b5fc for(int i = 0; i < NPROCMAP; ++i) { 801048ec: 75 c2 jne 801048b0 <initSchedDS+0xa0> pq.isEmpty = isEmptyPriorityQueue; 801048ee: b8 f0 44 10 80 mov $0x801044f0,%eax pq.put = putPriorityQueue; 801048f3: ba b0 4e 10 80 mov $0x80104eb0,%edx pq.isEmpty = isEmptyPriorityQueue; 801048f8: a3 dc b5 10 80 mov %eax,0x8010b5dc pq.switchToRoundRobinPolicy = switchToRoundRobinPolicyPriorityQueue; 801048fd: b8 70 50 10 80 mov $0x80105070,%eax pq.getMinAccumulator = getMinAccumulatorPriorityQueue; 80104902: b9 10 45 10 80 mov $0x80104510,%ecx pq.switchToRoundRobinPolicy = switchToRoundRobinPolicyPriorityQueue; 80104907: a3 ec b5 10 80 mov %eax,0x8010b5ec pq.extractProc = extractProcPriorityQueue; 8010490c: b8 50 51 10 80 mov $0x80105150,%eax pq.extractMin = extractMinPriorityQueue; 80104911: bb d0 4f 10 80 mov $0x80104fd0,%ebx pq.extractProc = extractProcPriorityQueue; 80104916: a3 f0 b5 10 80 mov %eax,0x8010b5f0 rrq.isEmpty = isEmptyRoundRobinQueue; 8010491b: b8 60 45 10 80 mov $0x80104560,%eax 80104920: a3 cc b5 10 80 mov %eax,0x8010b5cc rrq.enqueue = enqueueRoundRobinQueue; 80104925: b8 80 45 10 80 mov $0x80104580,%eax 8010492a: a3 d0 b5 10 80 mov %eax,0x8010b5d0 rrq.dequeue = dequeueRoundRobinQueue; 8010492f: b8 e0 45 10 80 mov $0x801045e0,%eax 80104934: a3 d4 b5 10 80 mov %eax,0x8010b5d4 rrq.switchToPriorityQueuePolicy = switchToPriorityQueuePolicyRoundRobinQueue; 80104939: b8 30 46 10 80 mov $0x80104630,%eax pq.put = putPriorityQueue; 8010493e: 89 15 e0 b5 10 80 mov %edx,0x8010b5e0 rpholder.isEmpty = isEmptyRunningProcessHolder; 80104944: ba a0 46 10 80 mov $0x801046a0,%edx pq.getMinAccumulator = getMinAccumulatorPriorityQueue; 80104949: 89 0d e4 b5 10 80 mov %ecx,0x8010b5e4 rpholder.add = addRunningProcessHolder; 8010494f: b9 c0 46 10 80 mov $0x801046c0,%ecx pq.extractMin = extractMinPriorityQueue; 80104954: 89 1d e8 b5 10 80 mov %ebx,0x8010b5e8 rpholder.remove = removeRunningProcessHolder; 8010495a: bb 70 4b 10 80 mov $0x80104b70,%ebx rrq.switchToPriorityQueuePolicy = switchToPriorityQueuePolicyRoundRobinQueue; 8010495f: a3 d8 b5 10 80 mov %eax,0x8010b5d8 rpholder.getMinAccumulator = getMinAccumulatorRunningProcessHolder; 80104964: b8 70 4c 10 80 mov $0x80104c70,%eax rpholder.remove = removeRunningProcessHolder; 80104969: 89 1d c4 b5 10 80 mov %ebx,0x8010b5c4 rpholder.isEmpty = isEmptyRunningProcessHolder; 8010496f: 89 15 bc b5 10 80 mov %edx,0x8010b5bc rpholder.add = addRunningProcessHolder; 80104975: 89 0d c0 b5 10 80 mov %ecx,0x8010b5c0 rpholder.getMinAccumulator = getMinAccumulatorRunningProcessHolder; 8010497b: a3 c8 b5 10 80 mov %eax,0x8010b5c8 } 80104980: 58 pop %eax 80104981: 5b pop %ebx 80104982: 5d pop %ebp 80104983: c3 ret 80104984: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010498a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80104990 <_ZN4Link7getLastEv>: Link* Link::getLast() { 80104990: 55 push %ebp 80104991: 89 e5 mov %esp,%ebp 80104993: 8b 45 08 mov 0x8(%ebp),%eax 80104996: eb 0a jmp 801049a2 <_ZN4Link7getLastEv+0x12> 80104998: 90 nop 80104999: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801049a0: 89 d0 mov %edx,%eax while(ans->next) 801049a2: 8b 50 04 mov 0x4(%eax),%edx 801049a5: 85 d2 test %edx,%edx 801049a7: 75 f7 jne 801049a0 <_ZN4Link7getLastEv+0x10> } 801049a9: 5d pop %ebp 801049aa: c3 ret 801049ab: 90 nop 801049ac: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801049b0 <_ZN10LinkedList7isEmptyEv>: bool LinkedList::isEmpty() { 801049b0: 55 push %ebp 801049b1: 89 e5 mov %esp,%ebp return !first; 801049b3: 8b 45 08 mov 0x8(%ebp),%eax } 801049b6: 5d pop %ebp return !first; 801049b7: 8b 00 mov (%eax),%eax 801049b9: 85 c0 test %eax,%eax 801049bb: 0f 94 c0 sete %al } 801049be: c3 ret 801049bf: 90 nop 801049c0 <_ZN10LinkedList6appendEP4Link>: void LinkedList::append(Link *link) { 801049c0: 55 push %ebp 801049c1: 89 e5 mov %esp,%ebp 801049c3: 8b 55 0c mov 0xc(%ebp),%edx 801049c6: 8b 4d 08 mov 0x8(%ebp),%ecx if(!link) 801049c9: 85 d2 test %edx,%edx 801049cb: 74 1f je 801049ec <_ZN10LinkedList6appendEP4Link+0x2c> if(isEmpty()) first = link; 801049cd: 8b 01 mov (%ecx),%eax 801049cf: 85 c0 test %eax,%eax 801049d1: 74 1d je 801049f0 <_ZN10LinkedList6appendEP4Link+0x30> else last->next = link; 801049d3: 8b 41 04 mov 0x4(%ecx),%eax 801049d6: 89 50 04 mov %edx,0x4(%eax) 801049d9: eb 07 jmp 801049e2 <_ZN10LinkedList6appendEP4Link+0x22> 801049db: 90 nop 801049dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi while(ans->next) 801049e0: 89 c2 mov %eax,%edx 801049e2: 8b 42 04 mov 0x4(%edx),%eax 801049e5: 85 c0 test %eax,%eax 801049e7: 75 f7 jne 801049e0 <_ZN10LinkedList6appendEP4Link+0x20> last = link->getLast(); 801049e9: 89 51 04 mov %edx,0x4(%ecx) } 801049ec: 5d pop %ebp 801049ed: c3 ret 801049ee: 66 90 xchg %ax,%ax if(isEmpty()) first = link; 801049f0: 89 11 mov %edx,(%ecx) 801049f2: eb ee jmp 801049e2 <_ZN10LinkedList6appendEP4Link+0x22> 801049f4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801049fa: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80104a00 <_ZN10LinkedList7enqueueEP4proc>: if(!freeLinks) 80104a00: a1 00 b6 10 80 mov 0x8010b600,%eax bool LinkedList::enqueue(Proc *p) { 80104a05: 55 push %ebp 80104a06: 89 e5 mov %esp,%ebp 80104a08: 8b 4d 08 mov 0x8(%ebp),%ecx if(!freeLinks) 80104a0b: 85 c0 test %eax,%eax 80104a0d: 74 41 je 80104a50 <_ZN10LinkedList7enqueueEP4proc+0x50> freeLinks = freeLinks->next; 80104a0f: 8b 50 04 mov 0x4(%eax),%edx ans->next = null; 80104a12: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax) freeLinks = freeLinks->next; 80104a19: 89 15 00 b6 10 80 mov %edx,0x8010b600 ans->p = p; 80104a1f: 8b 55 0c mov 0xc(%ebp),%edx 80104a22: 89 10 mov %edx,(%eax) if(isEmpty()) first = link; 80104a24: 8b 11 mov (%ecx),%edx 80104a26: 85 d2 test %edx,%edx 80104a28: 74 2e je 80104a58 <_ZN10LinkedList7enqueueEP4proc+0x58> else last->next = link; 80104a2a: 8b 51 04 mov 0x4(%ecx),%edx 80104a2d: 89 42 04 mov %eax,0x4(%edx) 80104a30: eb 08 jmp 80104a3a <_ZN10LinkedList7enqueueEP4proc+0x3a> 80104a32: 8d b6 00 00 00 00 lea 0x0(%esi),%esi while(ans->next) 80104a38: 89 d0 mov %edx,%eax 80104a3a: 8b 50 04 mov 0x4(%eax),%edx 80104a3d: 85 d2 test %edx,%edx 80104a3f: 75 f7 jne 80104a38 <_ZN10LinkedList7enqueueEP4proc+0x38> last = link->getLast(); 80104a41: 89 41 04 mov %eax,0x4(%ecx) return true; 80104a44: b0 01 mov $0x1,%al } 80104a46: 5d pop %ebp 80104a47: c3 ret 80104a48: 90 nop 80104a49: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return false; 80104a50: 31 c0 xor %eax,%eax } 80104a52: 5d pop %ebp 80104a53: c3 ret 80104a54: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(isEmpty()) first = link; 80104a58: 89 01 mov %eax,(%ecx) 80104a5a: eb de jmp 80104a3a <_ZN10LinkedList7enqueueEP4proc+0x3a> 80104a5c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104a60 <_ZN10LinkedList7dequeueEv>: Proc* LinkedList::dequeue() { 80104a60: 55 push %ebp 80104a61: 89 e5 mov %esp,%ebp 80104a63: 83 ec 08 sub $0x8,%esp 80104a66: 8b 4d 08 mov 0x8(%ebp),%ecx 80104a69: 89 5d f8 mov %ebx,-0x8(%ebp) 80104a6c: 89 75 fc mov %esi,-0x4(%ebp) return !first; 80104a6f: 8b 11 mov (%ecx),%edx if(isEmpty()) 80104a71: 85 d2 test %edx,%edx 80104a73: 74 2b je 80104aa0 <_ZN10LinkedList7dequeueEv+0x40> Link *next = first->next; 80104a75: 8b 5a 04 mov 0x4(%edx),%ebx link->next = freeLinks; 80104a78: 8b 35 00 b6 10 80 mov 0x8010b600,%esi Proc *p = first->p; 80104a7e: 8b 02 mov (%edx),%eax freeLinks = link; 80104a80: 89 15 00 b6 10 80 mov %edx,0x8010b600 if(isEmpty()) 80104a86: 85 db test %ebx,%ebx link->next = freeLinks; 80104a88: 89 72 04 mov %esi,0x4(%edx) first = next; 80104a8b: 89 19 mov %ebx,(%ecx) if(isEmpty()) 80104a8d: 75 07 jne 80104a96 <_ZN10LinkedList7dequeueEv+0x36> last = null; 80104a8f: c7 41 04 00 00 00 00 movl $0x0,0x4(%ecx) } 80104a96: 8b 5d f8 mov -0x8(%ebp),%ebx 80104a99: 8b 75 fc mov -0x4(%ebp),%esi 80104a9c: 89 ec mov %ebp,%esp 80104a9e: 5d pop %ebp 80104a9f: c3 ret return null; 80104aa0: 31 c0 xor %eax,%eax 80104aa2: eb f2 jmp 80104a96 <_ZN10LinkedList7dequeueEv+0x36> 80104aa4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104aaa: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80104ab0 <_ZN10LinkedList6removeEP4proc>: bool LinkedList::remove(Proc *p) { 80104ab0: 55 push %ebp 80104ab1: 89 e5 mov %esp,%ebp 80104ab3: 56 push %esi 80104ab4: 8b 75 08 mov 0x8(%ebp),%esi 80104ab7: 53 push %ebx 80104ab8: 8b 4d 0c mov 0xc(%ebp),%ecx return !first; 80104abb: 8b 1e mov (%esi),%ebx if(isEmpty()) 80104abd: 85 db test %ebx,%ebx 80104abf: 74 2f je 80104af0 <_ZN10LinkedList6removeEP4proc+0x40> if(first->p == p) { 80104ac1: 39 0b cmp %ecx,(%ebx) 80104ac3: 8b 53 04 mov 0x4(%ebx),%edx 80104ac6: 74 70 je 80104b38 <_ZN10LinkedList6removeEP4proc+0x88> while(cur) { 80104ac8: 85 d2 test %edx,%edx 80104aca: 74 24 je 80104af0 <_ZN10LinkedList6removeEP4proc+0x40> if(cur->p == p) { 80104acc: 3b 0a cmp (%edx),%ecx 80104ace: 66 90 xchg %ax,%ax 80104ad0: 75 0c jne 80104ade <_ZN10LinkedList6removeEP4proc+0x2e> 80104ad2: eb 2c jmp 80104b00 <_ZN10LinkedList6removeEP4proc+0x50> 80104ad4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104ad8: 39 08 cmp %ecx,(%eax) 80104ada: 74 34 je 80104b10 <_ZN10LinkedList6removeEP4proc+0x60> 80104adc: 89 c2 mov %eax,%edx cur = cur->next; 80104ade: 8b 42 04 mov 0x4(%edx),%eax while(cur) { 80104ae1: 85 c0 test %eax,%eax 80104ae3: 75 f3 jne 80104ad8 <_ZN10LinkedList6removeEP4proc+0x28> } 80104ae5: 5b pop %ebx 80104ae6: 5e pop %esi 80104ae7: 5d pop %ebp 80104ae8: c3 ret 80104ae9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104af0: 5b pop %ebx return false; 80104af1: 31 c0 xor %eax,%eax } 80104af3: 5e pop %esi 80104af4: 5d pop %ebp 80104af5: c3 ret 80104af6: 8d 76 00 lea 0x0(%esi),%esi 80104af9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi if(cur->p == p) { 80104b00: 89 d0 mov %edx,%eax 80104b02: 89 da mov %ebx,%edx 80104b04: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104b0a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi prev->next = cur->next; 80104b10: 8b 48 04 mov 0x4(%eax),%ecx 80104b13: 89 4a 04 mov %ecx,0x4(%edx) if(!(cur->next)) //removes the last link 80104b16: 8b 48 04 mov 0x4(%eax),%ecx 80104b19: 85 c9 test %ecx,%ecx 80104b1b: 74 43 je 80104b60 <_ZN10LinkedList6removeEP4proc+0xb0> link->next = freeLinks; 80104b1d: 8b 15 00 b6 10 80 mov 0x8010b600,%edx freeLinks = link; 80104b23: a3 00 b6 10 80 mov %eax,0x8010b600 link->next = freeLinks; 80104b28: 89 50 04 mov %edx,0x4(%eax) return true; 80104b2b: b0 01 mov $0x1,%al } 80104b2d: 5b pop %ebx 80104b2e: 5e pop %esi 80104b2f: 5d pop %ebp 80104b30: c3 ret 80104b31: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi link->next = freeLinks; 80104b38: a1 00 b6 10 80 mov 0x8010b600,%eax if(isEmpty()) 80104b3d: 85 d2 test %edx,%edx freeLinks = link; 80104b3f: 89 1d 00 b6 10 80 mov %ebx,0x8010b600 link->next = freeLinks; 80104b45: 89 43 04 mov %eax,0x4(%ebx) return true; 80104b48: b0 01 mov $0x1,%al first = next; 80104b4a: 89 16 mov %edx,(%esi) if(isEmpty()) 80104b4c: 75 97 jne 80104ae5 <_ZN10LinkedList6removeEP4proc+0x35> last = null; 80104b4e: c7 46 04 00 00 00 00 movl $0x0,0x4(%esi) 80104b55: eb 8e jmp 80104ae5 <_ZN10LinkedList6removeEP4proc+0x35> 80104b57: 89 f6 mov %esi,%esi 80104b59: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi last = prev; 80104b60: 89 56 04 mov %edx,0x4(%esi) 80104b63: eb b8 jmp 80104b1d <_ZN10LinkedList6removeEP4proc+0x6d> 80104b65: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104b69: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104b70 <removeRunningProcessHolder>: static boolean removeRunningProcessHolder(Proc* p) { 80104b70: 55 push %ebp 80104b71: 89 e5 mov %esp,%ebp 80104b73: 83 ec 08 sub $0x8,%esp return runningProcHolder->remove(p); 80104b76: 8b 45 08 mov 0x8(%ebp),%eax 80104b79: 89 44 24 04 mov %eax,0x4(%esp) 80104b7d: a1 04 b6 10 80 mov 0x8010b604,%eax 80104b82: 89 04 24 mov %eax,(%esp) 80104b85: e8 26 ff ff ff call 80104ab0 <_ZN10LinkedList6removeEP4proc> } 80104b8a: c9 leave return runningProcHolder->remove(p); 80104b8b: 0f b6 c0 movzbl %al,%eax } 80104b8e: c3 ret 80104b8f: 90 nop 80104b90 <_ZN10LinkedList8transferEv>: if(!priorityQ->isEmpty()) 80104b90: 8b 15 0c b6 10 80 mov 0x8010b60c,%edx return false; 80104b96: 31 c0 xor %eax,%eax bool LinkedList::transfer() { 80104b98: 55 push %ebp 80104b99: 89 e5 mov %esp,%ebp 80104b9b: 53 push %ebx 80104b9c: 8b 5d 08 mov 0x8(%ebp),%ebx if(!priorityQ->isEmpty()) 80104b9f: 8b 0a mov (%edx),%ecx 80104ba1: 85 c9 test %ecx,%ecx 80104ba3: 74 0b je 80104bb0 <_ZN10LinkedList8transferEv+0x20> } 80104ba5: 5b pop %ebx 80104ba6: 5d pop %ebp 80104ba7: c3 ret 80104ba8: 90 nop 80104ba9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if(!freeNodes) 80104bb0: 8b 0d fc b5 10 80 mov 0x8010b5fc,%ecx 80104bb6: 85 c9 test %ecx,%ecx 80104bb8: 74 eb je 80104ba5 <_ZN10LinkedList8transferEv+0x15> freeNodes = freeNodes->next; 80104bba: 8b 41 10 mov 0x10(%ecx),%eax ans->key = key; 80104bbd: c7 01 00 00 00 00 movl $0x0,(%ecx) ans->next = null; 80104bc3: c7 41 10 00 00 00 00 movl $0x0,0x10(%ecx) ans->key = key; 80104bca: c7 41 04 00 00 00 00 movl $0x0,0x4(%ecx) freeNodes = freeNodes->next; 80104bd1: a3 fc b5 10 80 mov %eax,0x8010b5fc node->listOfProcs.first = first; 80104bd6: 8b 03 mov (%ebx),%eax 80104bd8: 89 41 08 mov %eax,0x8(%ecx) node->listOfProcs.last = last; 80104bdb: 8b 43 04 mov 0x4(%ebx),%eax 80104bde: 89 41 0c mov %eax,0xc(%ecx) return true; 80104be1: b0 01 mov $0x1,%al first = last = null; 80104be3: c7 43 04 00 00 00 00 movl $0x0,0x4(%ebx) 80104bea: c7 03 00 00 00 00 movl $0x0,(%ebx) priorityQ->root = node; 80104bf0: 89 0a mov %ecx,(%edx) } 80104bf2: 5b pop %ebx 80104bf3: 5d pop %ebp 80104bf4: c3 ret 80104bf5: 90 nop 80104bf6: 8d 76 00 lea 0x0(%esi),%esi 80104bf9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104c00 <_ZN10LinkedList9getMinKeyEPx>: bool LinkedList::getMinKey(long long *pkey) { 80104c00: 55 push %ebp 80104c01: 31 c0 xor %eax,%eax 80104c03: 89 e5 mov %esp,%ebp 80104c05: 57 push %edi 80104c06: 56 push %esi 80104c07: 53 push %ebx 80104c08: 83 ec 1c sub $0x1c,%esp 80104c0b: 8b 7d 08 mov 0x8(%ebp),%edi return !first; 80104c0e: 8b 17 mov (%edi),%edx if(isEmpty()) 80104c10: 85 d2 test %edx,%edx 80104c12: 74 41 je 80104c55 <_ZN10LinkedList9getMinKeyEPx+0x55> long long minKey = getAccumulator(first->p); 80104c14: 8b 02 mov (%edx),%eax 80104c16: 89 04 24 mov %eax,(%esp) 80104c19: e8 92 ec ff ff call 801038b0 <getAccumulator> forEach([&](Proc *p) { 80104c1e: 8b 3f mov (%edi),%edi void append(Link *link); //appends the given list to the queue. No allocations always succeeds. template<typename Func> void forEach(const Func& accept) { //for-each loop. gets a function that applies the procin each link node. Link *link = first; while(link) { 80104c20: 85 ff test %edi,%edi long long minKey = getAccumulator(first->p); 80104c22: 89 c6 mov %eax,%esi 80104c24: 89 d3 mov %edx,%ebx 80104c26: 74 23 je 80104c4b <_ZN10LinkedList9getMinKeyEPx+0x4b> 80104c28: 90 nop 80104c29: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi long long key = getAccumulator(p); 80104c30: 8b 07 mov (%edi),%eax 80104c32: 89 04 24 mov %eax,(%esp) 80104c35: e8 76 ec ff ff call 801038b0 <getAccumulator> 80104c3a: 39 d3 cmp %edx,%ebx 80104c3c: 7c 06 jl 80104c44 <_ZN10LinkedList9getMinKeyEPx+0x44> 80104c3e: 7f 20 jg 80104c60 <_ZN10LinkedList9getMinKeyEPx+0x60> 80104c40: 39 c6 cmp %eax,%esi 80104c42: 77 1c ja 80104c60 <_ZN10LinkedList9getMinKeyEPx+0x60> accept(link->p); link = link->next; 80104c44: 8b 7f 04 mov 0x4(%edi),%edi while(link) { 80104c47: 85 ff test %edi,%edi 80104c49: 75 e5 jne 80104c30 <_ZN10LinkedList9getMinKeyEPx+0x30> *pkey = minKey; 80104c4b: 8b 45 0c mov 0xc(%ebp),%eax 80104c4e: 89 30 mov %esi,(%eax) 80104c50: 89 58 04 mov %ebx,0x4(%eax) return true; 80104c53: b0 01 mov $0x1,%al } 80104c55: 83 c4 1c add $0x1c,%esp 80104c58: 5b pop %ebx 80104c59: 5e pop %esi 80104c5a: 5f pop %edi 80104c5b: 5d pop %ebp 80104c5c: c3 ret 80104c5d: 8d 76 00 lea 0x0(%esi),%esi link = link->next; 80104c60: 8b 7f 04 mov 0x4(%edi),%edi 80104c63: 89 c6 mov %eax,%esi 80104c65: 89 d3 mov %edx,%ebx while(link) { 80104c67: 85 ff test %edi,%edi 80104c69: 75 c5 jne 80104c30 <_ZN10LinkedList9getMinKeyEPx+0x30> 80104c6b: eb de jmp 80104c4b <_ZN10LinkedList9getMinKeyEPx+0x4b> 80104c6d: 8d 76 00 lea 0x0(%esi),%esi 80104c70 <getMinAccumulatorRunningProcessHolder>: static boolean getMinAccumulatorRunningProcessHolder(long long *pkey) { 80104c70: 55 push %ebp 80104c71: 89 e5 mov %esp,%ebp 80104c73: 83 ec 18 sub $0x18,%esp return runningProcHolder->getMinKey(pkey); 80104c76: 8b 45 08 mov 0x8(%ebp),%eax 80104c79: 89 44 24 04 mov %eax,0x4(%esp) 80104c7d: a1 04 b6 10 80 mov 0x8010b604,%eax 80104c82: 89 04 24 mov %eax,(%esp) 80104c85: e8 76 ff ff ff call 80104c00 <_ZN10LinkedList9getMinKeyEPx> } 80104c8a: c9 leave return runningProcHolder->getMinKey(pkey); 80104c8b: 0f b6 c0 movzbl %al,%eax } 80104c8e: c3 ret 80104c8f: 90 nop 80104c90 <_ZN7MapNode7isEmptyEv>: bool MapNode::isEmpty() { 80104c90: 55 push %ebp 80104c91: 89 e5 mov %esp,%ebp return !first; 80104c93: 8b 45 08 mov 0x8(%ebp),%eax } 80104c96: 5d pop %ebp return !first; 80104c97: 8b 40 08 mov 0x8(%eax),%eax 80104c9a: 85 c0 test %eax,%eax 80104c9c: 0f 94 c0 sete %al } 80104c9f: c3 ret 80104ca0 <_ZN7MapNode3putEP4proc>: bool MapNode::put(Proc *p) { //we can not use recursion, since the stack of xv6 is too small.... 80104ca0: 55 push %ebp 80104ca1: 89 e5 mov %esp,%ebp 80104ca3: 57 push %edi 80104ca4: 56 push %esi 80104ca5: 53 push %ebx 80104ca6: 83 ec 2c sub $0x2c,%esp long long key = getAccumulator(p); 80104ca9: 8b 45 0c mov 0xc(%ebp),%eax bool MapNode::put(Proc *p) { //we can not use recursion, since the stack of xv6 is too small.... 80104cac: 8b 5d 08 mov 0x8(%ebp),%ebx long long key = getAccumulator(p); 80104caf: 89 04 24 mov %eax,(%esp) 80104cb2: e8 f9 eb ff ff call 801038b0 <getAccumulator> 80104cb7: 89 d1 mov %edx,%ecx 80104cb9: 89 45 e4 mov %eax,-0x1c(%ebp) 80104cbc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(key == node->key) 80104cc0: 8b 13 mov (%ebx),%edx 80104cc2: 8b 7d e4 mov -0x1c(%ebp),%edi 80104cc5: 8b 43 04 mov 0x4(%ebx),%eax 80104cc8: 31 d7 xor %edx,%edi 80104cca: 89 fe mov %edi,%esi 80104ccc: 89 c7 mov %eax,%edi 80104cce: 31 cf xor %ecx,%edi 80104cd0: 09 fe or %edi,%esi 80104cd2: 74 4c je 80104d20 <_ZN7MapNode3putEP4proc+0x80> else if(key < node->key) { //left 80104cd4: 39 c8 cmp %ecx,%eax 80104cd6: 7c 20 jl 80104cf8 <_ZN7MapNode3putEP4proc+0x58> 80104cd8: 7f 08 jg 80104ce2 <_ZN7MapNode3putEP4proc+0x42> 80104cda: 3b 55 e4 cmp -0x1c(%ebp),%edx 80104cdd: 8d 76 00 lea 0x0(%esi),%esi 80104ce0: 76 16 jbe 80104cf8 <_ZN7MapNode3putEP4proc+0x58> if(node->left) 80104ce2: 8b 43 18 mov 0x18(%ebx),%eax 80104ce5: 85 c0 test %eax,%eax 80104ce7: 0f 84 83 00 00 00 je 80104d70 <_ZN7MapNode3putEP4proc+0xd0> bool MapNode::put(Proc *p) { //we can not use recursion, since the stack of xv6 is too small.... 80104ced: 89 c3 mov %eax,%ebx 80104cef: eb cf jmp 80104cc0 <_ZN7MapNode3putEP4proc+0x20> 80104cf1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if(node->right) 80104cf8: 8b 43 1c mov 0x1c(%ebx),%eax 80104cfb: 85 c0 test %eax,%eax 80104cfd: 75 ee jne 80104ced <_ZN7MapNode3putEP4proc+0x4d> 80104cff: 8b 75 e4 mov -0x1c(%ebp),%esi node->right = allocNode(p, key); 80104d02: 8b 45 0c mov 0xc(%ebp),%eax 80104d05: 89 f2 mov %esi,%edx 80104d07: e8 14 fa ff ff call 80104720 <_ZL9allocNodeP4procx> if(node->right) { 80104d0c: 85 c0 test %eax,%eax node->right = allocNode(p, key); 80104d0e: 89 43 1c mov %eax,0x1c(%ebx) if(node->right) { 80104d11: 74 71 je 80104d84 <_ZN7MapNode3putEP4proc+0xe4> node->right->parent = node; 80104d13: 89 58 14 mov %ebx,0x14(%eax) } 80104d16: 83 c4 2c add $0x2c,%esp return true; 80104d19: b0 01 mov $0x1,%al } 80104d1b: 5b pop %ebx 80104d1c: 5e pop %esi 80104d1d: 5f pop %edi 80104d1e: 5d pop %ebp 80104d1f: c3 ret if(!freeLinks) 80104d20: a1 00 b6 10 80 mov 0x8010b600,%eax 80104d25: 85 c0 test %eax,%eax 80104d27: 74 5b je 80104d84 <_ZN7MapNode3putEP4proc+0xe4> ans->p = p; 80104d29: 8b 75 0c mov 0xc(%ebp),%esi freeLinks = freeLinks->next; 80104d2c: 8b 50 04 mov 0x4(%eax),%edx ans->next = null; 80104d2f: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax) ans->p = p; 80104d36: 89 30 mov %esi,(%eax) freeLinks = freeLinks->next; 80104d38: 89 15 00 b6 10 80 mov %edx,0x8010b600 if(isEmpty()) first = link; 80104d3e: 8b 53 08 mov 0x8(%ebx),%edx 80104d41: 85 d2 test %edx,%edx 80104d43: 74 4b je 80104d90 <_ZN7MapNode3putEP4proc+0xf0> else last->next = link; 80104d45: 8b 53 0c mov 0xc(%ebx),%edx 80104d48: 89 42 04 mov %eax,0x4(%edx) 80104d4b: eb 05 jmp 80104d52 <_ZN7MapNode3putEP4proc+0xb2> 80104d4d: 8d 76 00 lea 0x0(%esi),%esi while(ans->next) 80104d50: 89 d0 mov %edx,%eax 80104d52: 8b 50 04 mov 0x4(%eax),%edx 80104d55: 85 d2 test %edx,%edx 80104d57: 75 f7 jne 80104d50 <_ZN7MapNode3putEP4proc+0xb0> last = link->getLast(); 80104d59: 89 43 0c mov %eax,0xc(%ebx) } 80104d5c: 83 c4 2c add $0x2c,%esp return true; 80104d5f: b0 01 mov $0x1,%al } 80104d61: 5b pop %ebx 80104d62: 5e pop %esi 80104d63: 5f pop %edi 80104d64: 5d pop %ebp 80104d65: c3 ret 80104d66: 8d 76 00 lea 0x0(%esi),%esi 80104d69: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104d70: 8b 75 e4 mov -0x1c(%ebp),%esi node->left = allocNode(p, key); 80104d73: 8b 45 0c mov 0xc(%ebp),%eax 80104d76: 89 f2 mov %esi,%edx 80104d78: e8 a3 f9 ff ff call 80104720 <_ZL9allocNodeP4procx> if(node->left) { 80104d7d: 85 c0 test %eax,%eax node->left = allocNode(p, key); 80104d7f: 89 43 18 mov %eax,0x18(%ebx) if(node->left) { 80104d82: 75 8f jne 80104d13 <_ZN7MapNode3putEP4proc+0x73> } 80104d84: 83 c4 2c add $0x2c,%esp return false; 80104d87: 31 c0 xor %eax,%eax } 80104d89: 5b pop %ebx 80104d8a: 5e pop %esi 80104d8b: 5f pop %edi 80104d8c: 5d pop %ebp 80104d8d: c3 ret 80104d8e: 66 90 xchg %ax,%ax if(isEmpty()) first = link; 80104d90: 89 43 08 mov %eax,0x8(%ebx) 80104d93: eb bd jmp 80104d52 <_ZN7MapNode3putEP4proc+0xb2> 80104d95: 90 nop 80104d96: 8d 76 00 lea 0x0(%esi),%esi 80104d99: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104da0 <_ZN7MapNode10getMinNodeEv>: MapNode* MapNode::getMinNode() { //no recursion. 80104da0: 55 push %ebp 80104da1: 89 e5 mov %esp,%ebp 80104da3: 8b 45 08 mov 0x8(%ebp),%eax 80104da6: eb 0a jmp 80104db2 <_ZN7MapNode10getMinNodeEv+0x12> 80104da8: 90 nop 80104da9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104db0: 89 d0 mov %edx,%eax while(minNode->left) 80104db2: 8b 50 18 mov 0x18(%eax),%edx 80104db5: 85 d2 test %edx,%edx 80104db7: 75 f7 jne 80104db0 <_ZN7MapNode10getMinNodeEv+0x10> } 80104db9: 5d pop %ebp 80104dba: c3 ret 80104dbb: 90 nop 80104dbc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104dc0 <_ZN7MapNode9getMinKeyEPx>: void MapNode::getMinKey(long long *pkey) { 80104dc0: 55 push %ebp 80104dc1: 89 e5 mov %esp,%ebp 80104dc3: 8b 55 08 mov 0x8(%ebp),%edx 80104dc6: 53 push %ebx 80104dc7: eb 09 jmp 80104dd2 <_ZN7MapNode9getMinKeyEPx+0x12> 80104dc9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi while(minNode->left) 80104dd0: 89 c2 mov %eax,%edx 80104dd2: 8b 42 18 mov 0x18(%edx),%eax 80104dd5: 85 c0 test %eax,%eax 80104dd7: 75 f7 jne 80104dd0 <_ZN7MapNode9getMinKeyEPx+0x10> *pkey = getMinNode()->key; 80104dd9: 8b 5a 04 mov 0x4(%edx),%ebx 80104ddc: 8b 45 0c mov 0xc(%ebp),%eax 80104ddf: 8b 0a mov (%edx),%ecx 80104de1: 89 58 04 mov %ebx,0x4(%eax) 80104de4: 89 08 mov %ecx,(%eax) } 80104de6: 5b pop %ebx 80104de7: 5d pop %ebp 80104de8: c3 ret 80104de9: 90 nop 80104dea: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104df0 <_ZN7MapNode7dequeueEv>: Proc* MapNode::dequeue() { 80104df0: 55 push %ebp 80104df1: 89 e5 mov %esp,%ebp 80104df3: 83 ec 08 sub $0x8,%esp 80104df6: 8b 4d 08 mov 0x8(%ebp),%ecx 80104df9: 89 5d f8 mov %ebx,-0x8(%ebp) 80104dfc: 89 75 fc mov %esi,-0x4(%ebp) return !first; 80104dff: 8b 51 08 mov 0x8(%ecx),%edx if(isEmpty()) 80104e02: 85 d2 test %edx,%edx 80104e04: 74 32 je 80104e38 <_ZN7MapNode7dequeueEv+0x48> Link *next = first->next; 80104e06: 8b 5a 04 mov 0x4(%edx),%ebx link->next = freeLinks; 80104e09: 8b 35 00 b6 10 80 mov 0x8010b600,%esi Proc *p = first->p; 80104e0f: 8b 02 mov (%edx),%eax freeLinks = link; 80104e11: 89 15 00 b6 10 80 mov %edx,0x8010b600 if(isEmpty()) 80104e17: 85 db test %ebx,%ebx link->next = freeLinks; 80104e19: 89 72 04 mov %esi,0x4(%edx) first = next; 80104e1c: 89 59 08 mov %ebx,0x8(%ecx) if(isEmpty()) 80104e1f: 75 07 jne 80104e28 <_ZN7MapNode7dequeueEv+0x38> last = null; 80104e21: c7 41 0c 00 00 00 00 movl $0x0,0xc(%ecx) } 80104e28: 8b 5d f8 mov -0x8(%ebp),%ebx 80104e2b: 8b 75 fc mov -0x4(%ebp),%esi 80104e2e: 89 ec mov %ebp,%esp 80104e30: 5d pop %ebp 80104e31: c3 ret 80104e32: 8d b6 00 00 00 00 lea 0x0(%esi),%esi return null; 80104e38: 31 c0 xor %eax,%eax return listOfProcs.dequeue(); 80104e3a: eb ec jmp 80104e28 <_ZN7MapNode7dequeueEv+0x38> 80104e3c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104e40 <_ZN3Map7isEmptyEv>: bool Map::isEmpty() { 80104e40: 55 push %ebp 80104e41: 89 e5 mov %esp,%ebp return !root; 80104e43: 8b 45 08 mov 0x8(%ebp),%eax } 80104e46: 5d pop %ebp return !root; 80104e47: 8b 00 mov (%eax),%eax 80104e49: 85 c0 test %eax,%eax 80104e4b: 0f 94 c0 sete %al } 80104e4e: c3 ret 80104e4f: 90 nop 80104e50 <_ZN3Map3putEP4proc>: bool Map::put(Proc *p) { 80104e50: 55 push %ebp 80104e51: 89 e5 mov %esp,%ebp 80104e53: 83 ec 18 sub $0x18,%esp 80104e56: 89 5d f8 mov %ebx,-0x8(%ebp) 80104e59: 8b 5d 0c mov 0xc(%ebp),%ebx 80104e5c: 89 75 fc mov %esi,-0x4(%ebp) 80104e5f: 8b 75 08 mov 0x8(%ebp),%esi long long key = getAccumulator(p); 80104e62: 89 1c 24 mov %ebx,(%esp) 80104e65: e8 46 ea ff ff call 801038b0 <getAccumulator> return !root; 80104e6a: 8b 0e mov (%esi),%ecx if(isEmpty()) { 80104e6c: 85 c9 test %ecx,%ecx 80104e6e: 74 18 je 80104e88 <_ZN3Map3putEP4proc+0x38> return root->put(p); 80104e70: 89 5d 0c mov %ebx,0xc(%ebp) } 80104e73: 8b 75 fc mov -0x4(%ebp),%esi return root->put(p); 80104e76: 89 4d 08 mov %ecx,0x8(%ebp) } 80104e79: 8b 5d f8 mov -0x8(%ebp),%ebx 80104e7c: 89 ec mov %ebp,%esp 80104e7e: 5d pop %ebp return root->put(p); 80104e7f: e9 1c fe ff ff jmp 80104ca0 <_ZN7MapNode3putEP4proc> 80104e84: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi root = allocNode(p, key); 80104e88: 89 d1 mov %edx,%ecx 80104e8a: 89 c2 mov %eax,%edx 80104e8c: 89 d8 mov %ebx,%eax 80104e8e: e8 8d f8 ff ff call 80104720 <_ZL9allocNodeP4procx> 80104e93: 89 06 mov %eax,(%esi) return !isEmpty(); 80104e95: 85 c0 test %eax,%eax 80104e97: 0f 95 c0 setne %al } 80104e9a: 8b 5d f8 mov -0x8(%ebp),%ebx 80104e9d: 8b 75 fc mov -0x4(%ebp),%esi 80104ea0: 89 ec mov %ebp,%esp 80104ea2: 5d pop %ebp 80104ea3: c3 ret 80104ea4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104eaa: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80104eb0 <putPriorityQueue>: static boolean putPriorityQueue(Proc* p) { 80104eb0: 55 push %ebp 80104eb1: 89 e5 mov %esp,%ebp 80104eb3: 83 ec 18 sub $0x18,%esp return priorityQ->put(p); 80104eb6: 8b 45 08 mov 0x8(%ebp),%eax 80104eb9: 89 44 24 04 mov %eax,0x4(%esp) 80104ebd: a1 0c b6 10 80 mov 0x8010b60c,%eax 80104ec2: 89 04 24 mov %eax,(%esp) 80104ec5: e8 86 ff ff ff call 80104e50 <_ZN3Map3putEP4proc> } 80104eca: c9 leave return priorityQ->put(p); 80104ecb: 0f b6 c0 movzbl %al,%eax } 80104ece: c3 ret 80104ecf: 90 nop 80104ed0 <_ZN3Map9getMinKeyEPx>: bool Map::getMinKey(long long *pkey) { 80104ed0: 55 push %ebp 80104ed1: 89 e5 mov %esp,%ebp return !root; 80104ed3: 8b 45 08 mov 0x8(%ebp),%eax bool Map::getMinKey(long long *pkey) { 80104ed6: 53 push %ebx return !root; 80104ed7: 8b 10 mov (%eax),%edx if(isEmpty()) 80104ed9: 85 d2 test %edx,%edx 80104edb: 75 05 jne 80104ee2 <_ZN3Map9getMinKeyEPx+0x12> 80104edd: eb 21 jmp 80104f00 <_ZN3Map9getMinKeyEPx+0x30> 80104edf: 90 nop while(minNode->left) 80104ee0: 89 c2 mov %eax,%edx 80104ee2: 8b 42 18 mov 0x18(%edx),%eax 80104ee5: 85 c0 test %eax,%eax 80104ee7: 75 f7 jne 80104ee0 <_ZN3Map9getMinKeyEPx+0x10> *pkey = getMinNode()->key; 80104ee9: 8b 45 0c mov 0xc(%ebp),%eax 80104eec: 8b 5a 04 mov 0x4(%edx),%ebx 80104eef: 8b 0a mov (%edx),%ecx 80104ef1: 89 58 04 mov %ebx,0x4(%eax) 80104ef4: 89 08 mov %ecx,(%eax) return false; root->getMinKey(pkey); return true; 80104ef6: b0 01 mov $0x1,%al } 80104ef8: 5b pop %ebx 80104ef9: 5d pop %ebp 80104efa: c3 ret 80104efb: 90 nop 80104efc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104f00: 5b pop %ebx return false; 80104f01: 31 c0 xor %eax,%eax } 80104f03: 5d pop %ebp 80104f04: c3 ret 80104f05: 90 nop 80104f06: 8d 76 00 lea 0x0(%esi),%esi 80104f09: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104f10 <_ZN3Map10extractMinEv>: Proc* Map::extractMin() { 80104f10: 55 push %ebp 80104f11: 89 e5 mov %esp,%ebp 80104f13: 57 push %edi 80104f14: 56 push %esi 80104f15: 8b 75 08 mov 0x8(%ebp),%esi 80104f18: 53 push %ebx return !root; 80104f19: 8b 1e mov (%esi),%ebx if(isEmpty()) 80104f1b: 85 db test %ebx,%ebx 80104f1d: 0f 84 a5 00 00 00 je 80104fc8 <_ZN3Map10extractMinEv+0xb8> 80104f23: 89 da mov %ebx,%edx 80104f25: eb 0b jmp 80104f32 <_ZN3Map10extractMinEv+0x22> 80104f27: 89 f6 mov %esi,%esi 80104f29: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi while(minNode->left) 80104f30: 89 c2 mov %eax,%edx 80104f32: 8b 42 18 mov 0x18(%edx),%eax 80104f35: 85 c0 test %eax,%eax 80104f37: 75 f7 jne 80104f30 <_ZN3Map10extractMinEv+0x20> return !first; 80104f39: 8b 4a 08 mov 0x8(%edx),%ecx if(isEmpty()) 80104f3c: 85 c9 test %ecx,%ecx 80104f3e: 74 70 je 80104fb0 <_ZN3Map10extractMinEv+0xa0> Link *next = first->next; 80104f40: 8b 59 04 mov 0x4(%ecx),%ebx link->next = freeLinks; 80104f43: 8b 3d 00 b6 10 80 mov 0x8010b600,%edi Proc *p = first->p; 80104f49: 8b 01 mov (%ecx),%eax freeLinks = link; 80104f4b: 89 0d 00 b6 10 80 mov %ecx,0x8010b600 if(isEmpty()) 80104f51: 85 db test %ebx,%ebx link->next = freeLinks; 80104f53: 89 79 04 mov %edi,0x4(%ecx) first = next; 80104f56: 89 5a 08 mov %ebx,0x8(%edx) if(isEmpty()) 80104f59: 74 05 je 80104f60 <_ZN3Map10extractMinEv+0x50> } deallocNode(minNode); } return p; } 80104f5b: 5b pop %ebx 80104f5c: 5e pop %esi 80104f5d: 5f pop %edi 80104f5e: 5d pop %ebp 80104f5f: c3 ret last = null; 80104f60: c7 42 0c 00 00 00 00 movl $0x0,0xc(%edx) 80104f67: 8b 4a 1c mov 0x1c(%edx),%ecx 80104f6a: 8b 1e mov (%esi),%ebx if(minNode == root) { 80104f6c: 39 da cmp %ebx,%edx 80104f6e: 74 49 je 80104fb9 <_ZN3Map10extractMinEv+0xa9> MapNode *parent = minNode->parent; 80104f70: 8b 5a 14 mov 0x14(%edx),%ebx parent->left = minNode->right; 80104f73: 89 4b 18 mov %ecx,0x18(%ebx) if(minNode->right) 80104f76: 8b 4a 1c mov 0x1c(%edx),%ecx 80104f79: 85 c9 test %ecx,%ecx 80104f7b: 74 03 je 80104f80 <_ZN3Map10extractMinEv+0x70> minNode->right->parent = parent; 80104f7d: 89 59 14 mov %ebx,0x14(%ecx) node->next = freeNodes; 80104f80: 8b 0d fc b5 10 80 mov 0x8010b5fc,%ecx node->parent = node->left = node->right = null; 80104f86: c7 42 1c 00 00 00 00 movl $0x0,0x1c(%edx) 80104f8d: c7 42 18 00 00 00 00 movl $0x0,0x18(%edx) 80104f94: c7 42 14 00 00 00 00 movl $0x0,0x14(%edx) node->next = freeNodes; 80104f9b: 89 4a 10 mov %ecx,0x10(%edx) } 80104f9e: 5b pop %ebx freeNodes = node; 80104f9f: 89 15 fc b5 10 80 mov %edx,0x8010b5fc } 80104fa5: 5e pop %esi 80104fa6: 5f pop %edi 80104fa7: 5d pop %ebp 80104fa8: c3 ret 80104fa9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return null; 80104fb0: 31 c0 xor %eax,%eax if(minNode == root) { 80104fb2: 39 da cmp %ebx,%edx 80104fb4: 8b 4a 1c mov 0x1c(%edx),%ecx 80104fb7: 75 b7 jne 80104f70 <_ZN3Map10extractMinEv+0x60> if(!isEmpty()) 80104fb9: 85 c9 test %ecx,%ecx root = minNode->right; 80104fbb: 89 0e mov %ecx,(%esi) if(!isEmpty()) 80104fbd: 74 c1 je 80104f80 <_ZN3Map10extractMinEv+0x70> root->parent = null; 80104fbf: c7 41 14 00 00 00 00 movl $0x0,0x14(%ecx) 80104fc6: eb b8 jmp 80104f80 <_ZN3Map10extractMinEv+0x70> return null; 80104fc8: 31 c0 xor %eax,%eax 80104fca: eb 8f jmp 80104f5b <_ZN3Map10extractMinEv+0x4b> 80104fcc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104fd0 <extractMinPriorityQueue>: static Proc* extractMinPriorityQueue() { 80104fd0: 55 push %ebp 80104fd1: 89 e5 mov %esp,%ebp 80104fd3: 83 ec 04 sub $0x4,%esp return priorityQ->extractMin(); 80104fd6: a1 0c b6 10 80 mov 0x8010b60c,%eax 80104fdb: 89 04 24 mov %eax,(%esp) 80104fde: e8 2d ff ff ff call 80104f10 <_ZN3Map10extractMinEv> } 80104fe3: c9 leave 80104fe4: c3 ret 80104fe5: 90 nop 80104fe6: 8d 76 00 lea 0x0(%esi),%esi 80104fe9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104ff0 <_ZN3Map8transferEv.part.1>: bool Map::transfer() { 80104ff0: 55 push %ebp 80104ff1: 89 e5 mov %esp,%ebp 80104ff3: 56 push %esi 80104ff4: 53 push %ebx 80104ff5: 89 c3 mov %eax,%ebx 80104ff7: 83 ec 04 sub $0x4,%esp 80104ffa: eb 16 jmp 80105012 <_ZN3Map8transferEv.part.1+0x22> 80104ffc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(!roundRobinQ->isEmpty()) return false; while(!isEmpty()) { Proc* p = extractMin(); 80105000: 89 1c 24 mov %ebx,(%esp) 80105003: e8 08 ff ff ff call 80104f10 <_ZN3Map10extractMinEv> if(!freeLinks) 80105008: 8b 15 00 b6 10 80 mov 0x8010b600,%edx 8010500e: 85 d2 test %edx,%edx 80105010: 75 0e jne 80105020 <_ZN3Map8transferEv.part.1+0x30> while(!isEmpty()) { 80105012: 8b 03 mov (%ebx),%eax 80105014: 85 c0 test %eax,%eax 80105016: 75 e8 jne 80105000 <_ZN3Map8transferEv.part.1+0x10> roundRobinQ->enqueue(p); //should succeed. } return true; } 80105018: 5a pop %edx 80105019: b0 01 mov $0x1,%al 8010501b: 5b pop %ebx 8010501c: 5e pop %esi 8010501d: 5d pop %ebp 8010501e: c3 ret 8010501f: 90 nop freeLinks = freeLinks->next; 80105020: 8b 72 04 mov 0x4(%edx),%esi roundRobinQ->enqueue(p); //should succeed. 80105023: 8b 0d 08 b6 10 80 mov 0x8010b608,%ecx ans->next = null; 80105029: c7 42 04 00 00 00 00 movl $0x0,0x4(%edx) ans->p = p; 80105030: 89 02 mov %eax,(%edx) freeLinks = freeLinks->next; 80105032: 89 35 00 b6 10 80 mov %esi,0x8010b600 if(isEmpty()) first = link; 80105038: 8b 31 mov (%ecx),%esi 8010503a: 85 f6 test %esi,%esi 8010503c: 74 22 je 80105060 <_ZN3Map8transferEv.part.1+0x70> else last->next = link; 8010503e: 8b 41 04 mov 0x4(%ecx),%eax 80105041: 89 50 04 mov %edx,0x4(%eax) 80105044: eb 0c jmp 80105052 <_ZN3Map8transferEv.part.1+0x62> 80105046: 8d 76 00 lea 0x0(%esi),%esi 80105049: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi while(ans->next) 80105050: 89 c2 mov %eax,%edx 80105052: 8b 42 04 mov 0x4(%edx),%eax 80105055: 85 c0 test %eax,%eax 80105057: 75 f7 jne 80105050 <_ZN3Map8transferEv.part.1+0x60> last = link->getLast(); 80105059: 89 51 04 mov %edx,0x4(%ecx) 8010505c: eb b4 jmp 80105012 <_ZN3Map8transferEv.part.1+0x22> 8010505e: 66 90 xchg %ax,%ax if(isEmpty()) first = link; 80105060: 89 11 mov %edx,(%ecx) 80105062: eb ee jmp 80105052 <_ZN3Map8transferEv.part.1+0x62> 80105064: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010506a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80105070 <switchToRoundRobinPolicyPriorityQueue>: if(!roundRobinQ->isEmpty()) 80105070: 8b 15 08 b6 10 80 mov 0x8010b608,%edx 80105076: 8b 02 mov (%edx),%eax 80105078: 85 c0 test %eax,%eax 8010507a: 74 04 je 80105080 <switchToRoundRobinPolicyPriorityQueue+0x10> 8010507c: 31 c0 xor %eax,%eax } 8010507e: c3 ret 8010507f: 90 nop 80105080: a1 0c b6 10 80 mov 0x8010b60c,%eax static boolean switchToRoundRobinPolicyPriorityQueue() { 80105085: 55 push %ebp 80105086: 89 e5 mov %esp,%ebp 80105088: e8 63 ff ff ff call 80104ff0 <_ZN3Map8transferEv.part.1> } 8010508d: 5d pop %ebp 8010508e: 0f b6 c0 movzbl %al,%eax 80105091: c3 ret 80105092: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80105099: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801050a0 <_ZN3Map8transferEv>: return !first; 801050a0: 8b 15 08 b6 10 80 mov 0x8010b608,%edx bool Map::transfer() { 801050a6: 55 push %ebp 801050a7: 89 e5 mov %esp,%ebp 801050a9: 8b 45 08 mov 0x8(%ebp),%eax if(!roundRobinQ->isEmpty()) 801050ac: 8b 12 mov (%edx),%edx 801050ae: 85 d2 test %edx,%edx 801050b0: 74 0e je 801050c0 <_ZN3Map8transferEv+0x20> } 801050b2: 31 c0 xor %eax,%eax 801050b4: 5d pop %ebp 801050b5: c3 ret 801050b6: 8d 76 00 lea 0x0(%esi),%esi 801050b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801050c0: 5d pop %ebp 801050c1: e9 2a ff ff ff jmp 80104ff0 <_ZN3Map8transferEv.part.1> 801050c6: 8d 76 00 lea 0x0(%esi),%esi 801050c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801050d0 <_ZN3Map11extractProcEP4proc>: bool Map::extractProc(Proc *p) { 801050d0: 55 push %ebp 801050d1: 89 e5 mov %esp,%ebp 801050d3: 56 push %esi 801050d4: 53 push %ebx 801050d5: 83 ec 30 sub $0x30,%esp if(!freeNodes) 801050d8: 8b 15 fc b5 10 80 mov 0x8010b5fc,%edx bool Map::extractProc(Proc *p) { 801050de: 8b 5d 08 mov 0x8(%ebp),%ebx 801050e1: 8b 75 0c mov 0xc(%ebp),%esi if(!freeNodes) 801050e4: 85 d2 test %edx,%edx 801050e6: 74 50 je 80105138 <_ZN3Map11extractProcEP4proc+0x68> MapNode *next, *parent, *left, *right; }; class Map { public: Map(): root(null) {} 801050e8: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) return false; bool ans = false; 801050ef: c6 45 e7 00 movb $0x0,-0x19(%ebp) 801050f3: eb 13 jmp 80105108 <_ZN3Map11extractProcEP4proc+0x38> 801050f5: 8d 76 00 lea 0x0(%esi),%esi Map tempMap; while(!isEmpty()) { Proc *otherP = extractMin(); 801050f8: 89 1c 24 mov %ebx,(%esp) 801050fb: e8 10 fe ff ff call 80104f10 <_ZN3Map10extractMinEv> if(otherP != p) 80105100: 39 f0 cmp %esi,%eax 80105102: 75 1c jne 80105120 <_ZN3Map11extractProcEP4proc+0x50> tempMap.put(otherP); //should scucceed. else ans = true; 80105104: c6 45 e7 01 movb $0x1,-0x19(%ebp) while(!isEmpty()) { 80105108: 8b 03 mov (%ebx),%eax 8010510a: 85 c0 test %eax,%eax 8010510c: 75 ea jne 801050f8 <_ZN3Map11extractProcEP4proc+0x28> } root = tempMap.root; 8010510e: 8b 45 f4 mov -0xc(%ebp),%eax 80105111: 89 03 mov %eax,(%ebx) return ans; } 80105113: 0f b6 45 e7 movzbl -0x19(%ebp),%eax 80105117: 83 c4 30 add $0x30,%esp 8010511a: 5b pop %ebx 8010511b: 5e pop %esi 8010511c: 5d pop %ebp 8010511d: c3 ret 8010511e: 66 90 xchg %ax,%ax tempMap.put(otherP); //should scucceed. 80105120: 89 44 24 04 mov %eax,0x4(%esp) 80105124: 8d 45 f4 lea -0xc(%ebp),%eax 80105127: 89 04 24 mov %eax,(%esp) 8010512a: e8 21 fd ff ff call 80104e50 <_ZN3Map3putEP4proc> 8010512f: eb d7 jmp 80105108 <_ZN3Map11extractProcEP4proc+0x38> 80105131: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return false; 80105138: c6 45 e7 00 movb $0x0,-0x19(%ebp) } 8010513c: 0f b6 45 e7 movzbl -0x19(%ebp),%eax 80105140: 83 c4 30 add $0x30,%esp 80105143: 5b pop %ebx 80105144: 5e pop %esi 80105145: 5d pop %ebp 80105146: c3 ret 80105147: 89 f6 mov %esi,%esi 80105149: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105150 <extractProcPriorityQueue>: static boolean extractProcPriorityQueue(Proc *p) { 80105150: 55 push %ebp 80105151: 89 e5 mov %esp,%ebp 80105153: 83 ec 18 sub $0x18,%esp return priorityQ->extractProc(p); 80105156: 8b 45 08 mov 0x8(%ebp),%eax 80105159: 89 44 24 04 mov %eax,0x4(%esp) 8010515d: a1 0c b6 10 80 mov 0x8010b60c,%eax 80105162: 89 04 24 mov %eax,(%esp) 80105165: e8 66 ff ff ff call 801050d0 <_ZN3Map11extractProcEP4proc> } 8010516a: c9 leave return priorityQ->extractProc(p); 8010516b: 0f b6 c0 movzbl %al,%eax } 8010516e: c3 ret 8010516f: 90 nop 80105170 <initsleeplock>: #include "spinlock.h" #include "sleeplock.h" void initsleeplock(struct sleeplock *lk, char *name) { 80105170: 55 push %ebp initlock(&lk->lk, "sleep lock"); 80105171: b8 e8 86 10 80 mov $0x801086e8,%eax { 80105176: 89 e5 mov %esp,%ebp 80105178: 53 push %ebx 80105179: 83 ec 14 sub $0x14,%esp 8010517c: 8b 5d 08 mov 0x8(%ebp),%ebx initlock(&lk->lk, "sleep lock"); 8010517f: 89 44 24 04 mov %eax,0x4(%esp) 80105183: 8d 43 04 lea 0x4(%ebx),%eax 80105186: 89 04 24 mov %eax,(%esp) 80105189: e8 12 01 00 00 call 801052a0 <initlock> lk->name = name; 8010518e: 8b 45 0c mov 0xc(%ebp),%eax lk->locked = 0; 80105191: c7 03 00 00 00 00 movl $0x0,(%ebx) lk->pid = 0; 80105197: c7 43 3c 00 00 00 00 movl $0x0,0x3c(%ebx) lk->name = name; 8010519e: 89 43 38 mov %eax,0x38(%ebx) } 801051a1: 83 c4 14 add $0x14,%esp 801051a4: 5b pop %ebx 801051a5: 5d pop %ebp 801051a6: c3 ret 801051a7: 89 f6 mov %esi,%esi 801051a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801051b0 <acquiresleep>: void acquiresleep(struct sleeplock *lk) { 801051b0: 55 push %ebp 801051b1: 89 e5 mov %esp,%ebp 801051b3: 56 push %esi 801051b4: 53 push %ebx 801051b5: 83 ec 10 sub $0x10,%esp 801051b8: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&lk->lk); 801051bb: 8d 73 04 lea 0x4(%ebx),%esi 801051be: 89 34 24 mov %esi,(%esp) 801051c1: e8 2a 02 00 00 call 801053f0 <acquire> while (lk->locked) { 801051c6: 8b 13 mov (%ebx),%edx 801051c8: 85 d2 test %edx,%edx 801051ca: 74 16 je 801051e2 <acquiresleep+0x32> 801051cc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi sleep(lk, &lk->lk); 801051d0: 89 74 24 04 mov %esi,0x4(%esp) 801051d4: 89 1c 24 mov %ebx,(%esp) 801051d7: e8 f4 ee ff ff call 801040d0 <sleep> while (lk->locked) { 801051dc: 8b 03 mov (%ebx),%eax 801051de: 85 c0 test %eax,%eax 801051e0: 75 ee jne 801051d0 <acquiresleep+0x20> } lk->locked = 1; 801051e2: c7 03 01 00 00 00 movl $0x1,(%ebx) lk->pid = myproc()->pid; 801051e8: e8 d3 e7 ff ff call 801039c0 <myproc> 801051ed: 8b 40 10 mov 0x10(%eax),%eax 801051f0: 89 43 3c mov %eax,0x3c(%ebx) release(&lk->lk); 801051f3: 89 75 08 mov %esi,0x8(%ebp) } 801051f6: 83 c4 10 add $0x10,%esp 801051f9: 5b pop %ebx 801051fa: 5e pop %esi 801051fb: 5d pop %ebp release(&lk->lk); 801051fc: e9 8f 02 00 00 jmp 80105490 <release> 80105201: eb 0d jmp 80105210 <releasesleep> 80105203: 90 nop 80105204: 90 nop 80105205: 90 nop 80105206: 90 nop 80105207: 90 nop 80105208: 90 nop 80105209: 90 nop 8010520a: 90 nop 8010520b: 90 nop 8010520c: 90 nop 8010520d: 90 nop 8010520e: 90 nop 8010520f: 90 nop 80105210 <releasesleep>: void releasesleep(struct sleeplock *lk) { 80105210: 55 push %ebp 80105211: 89 e5 mov %esp,%ebp 80105213: 83 ec 18 sub $0x18,%esp 80105216: 89 5d f8 mov %ebx,-0x8(%ebp) 80105219: 8b 5d 08 mov 0x8(%ebp),%ebx 8010521c: 89 75 fc mov %esi,-0x4(%ebp) acquire(&lk->lk); 8010521f: 8d 73 04 lea 0x4(%ebx),%esi 80105222: 89 34 24 mov %esi,(%esp) 80105225: e8 c6 01 00 00 call 801053f0 <acquire> lk->locked = 0; 8010522a: c7 03 00 00 00 00 movl $0x0,(%ebx) lk->pid = 0; 80105230: c7 43 3c 00 00 00 00 movl $0x0,0x3c(%ebx) wakeup(lk); 80105237: 89 1c 24 mov %ebx,(%esp) 8010523a: e8 71 f0 ff ff call 801042b0 <wakeup> release(&lk->lk); } 8010523f: 8b 5d f8 mov -0x8(%ebp),%ebx release(&lk->lk); 80105242: 89 75 08 mov %esi,0x8(%ebp) } 80105245: 8b 75 fc mov -0x4(%ebp),%esi 80105248: 89 ec mov %ebp,%esp 8010524a: 5d pop %ebp release(&lk->lk); 8010524b: e9 40 02 00 00 jmp 80105490 <release> 80105250 <holdingsleep>: int holdingsleep(struct sleeplock *lk) { 80105250: 55 push %ebp 80105251: 89 e5 mov %esp,%ebp 80105253: 83 ec 28 sub $0x28,%esp 80105256: 89 5d f4 mov %ebx,-0xc(%ebp) 80105259: 8b 5d 08 mov 0x8(%ebp),%ebx 8010525c: 89 7d fc mov %edi,-0x4(%ebp) 8010525f: 89 75 f8 mov %esi,-0x8(%ebp) 80105262: 31 f6 xor %esi,%esi int r; acquire(&lk->lk); 80105264: 8d 7b 04 lea 0x4(%ebx),%edi 80105267: 89 3c 24 mov %edi,(%esp) 8010526a: e8 81 01 00 00 call 801053f0 <acquire> r = lk->locked && (lk->pid == myproc()->pid); 8010526f: 8b 03 mov (%ebx),%eax 80105271: 85 c0 test %eax,%eax 80105273: 74 11 je 80105286 <holdingsleep+0x36> 80105275: 8b 5b 3c mov 0x3c(%ebx),%ebx 80105278: e8 43 e7 ff ff call 801039c0 <myproc> 8010527d: 39 58 10 cmp %ebx,0x10(%eax) 80105280: 0f 94 c0 sete %al 80105283: 0f b6 f0 movzbl %al,%esi release(&lk->lk); 80105286: 89 3c 24 mov %edi,(%esp) 80105289: e8 02 02 00 00 call 80105490 <release> return r; } 8010528e: 89 f0 mov %esi,%eax 80105290: 8b 5d f4 mov -0xc(%ebp),%ebx 80105293: 8b 75 f8 mov -0x8(%ebp),%esi 80105296: 8b 7d fc mov -0x4(%ebp),%edi 80105299: 89 ec mov %ebp,%esp 8010529b: 5d pop %ebp 8010529c: c3 ret 8010529d: 66 90 xchg %ax,%ax 8010529f: 90 nop 801052a0 <initlock>: #include "proc.h" #include "spinlock.h" void initlock(struct spinlock *lk, char *name) { 801052a0: 55 push %ebp 801052a1: 89 e5 mov %esp,%ebp 801052a3: 8b 45 08 mov 0x8(%ebp),%eax lk->name = name; 801052a6: 8b 55 0c mov 0xc(%ebp),%edx lk->locked = 0; 801052a9: c7 00 00 00 00 00 movl $0x0,(%eax) lk->name = name; 801052af: 89 50 04 mov %edx,0x4(%eax) lk->cpu = 0; 801052b2: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax) } 801052b9: 5d pop %ebp 801052ba: c3 ret 801052bb: 90 nop 801052bc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801052c0 <getcallerpcs>: } // Record the current call stack in pcs[] by following the %ebp chain. void getcallerpcs(void *v, uint pcs[]) { 801052c0: 55 push %ebp uint *ebp; int i; ebp = (uint*)v - 2; for(i = 0; i < 10; i++){ 801052c1: 31 d2 xor %edx,%edx { 801052c3: 89 e5 mov %esp,%ebp ebp = (uint*)v - 2; 801052c5: 8b 45 08 mov 0x8(%ebp),%eax { 801052c8: 8b 4d 0c mov 0xc(%ebp),%ecx 801052cb: 53 push %ebx ebp = (uint*)v - 2; 801052cc: 83 e8 08 sub $0x8,%eax 801052cf: 90 nop if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff) 801052d0: 8d 98 00 00 00 80 lea -0x80000000(%eax),%ebx 801052d6: 81 fb fe ff ff 7f cmp $0x7ffffffe,%ebx 801052dc: 77 12 ja 801052f0 <getcallerpcs+0x30> break; pcs[i] = ebp[1]; // saved %eip 801052de: 8b 58 04 mov 0x4(%eax),%ebx 801052e1: 89 1c 91 mov %ebx,(%ecx,%edx,4) for(i = 0; i < 10; i++){ 801052e4: 42 inc %edx 801052e5: 83 fa 0a cmp $0xa,%edx ebp = (uint*)ebp[0]; // saved %ebp 801052e8: 8b 00 mov (%eax),%eax for(i = 0; i < 10; i++){ 801052ea: 75 e4 jne 801052d0 <getcallerpcs+0x10> } for(; i < 10; i++) pcs[i] = 0; } 801052ec: 5b pop %ebx 801052ed: 5d pop %ebp 801052ee: c3 ret 801052ef: 90 nop 801052f0: 8d 04 91 lea (%ecx,%edx,4),%eax 801052f3: 83 c1 28 add $0x28,%ecx 801052f6: 8d 76 00 lea 0x0(%esi),%esi 801052f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi pcs[i] = 0; 80105300: c7 00 00 00 00 00 movl $0x0,(%eax) 80105306: 83 c0 04 add $0x4,%eax for(; i < 10; i++) 80105309: 39 c1 cmp %eax,%ecx 8010530b: 75 f3 jne 80105300 <getcallerpcs+0x40> } 8010530d: 5b pop %ebx 8010530e: 5d pop %ebp 8010530f: c3 ret 80105310 <pushcli>: // it takes two popcli to undo two pushcli. Also, if interrupts // are off, then pushcli, popcli leaves them off. void pushcli(void) { 80105310: 55 push %ebp 80105311: 89 e5 mov %esp,%ebp 80105313: 53 push %ebx 80105314: 83 ec 04 sub $0x4,%esp 80105317: 9c pushf 80105318: 5b pop %ebx asm volatile("cli"); 80105319: fa cli int eflags; eflags = readeflags(); cli(); if(mycpu()->ncli == 0) 8010531a: e8 01 e6 ff ff call 80103920 <mycpu> 8010531f: 8b 90 a4 00 00 00 mov 0xa4(%eax),%edx 80105325: 85 d2 test %edx,%edx 80105327: 75 11 jne 8010533a <pushcli+0x2a> mycpu()->intena = eflags & FL_IF; 80105329: e8 f2 e5 ff ff call 80103920 <mycpu> 8010532e: 81 e3 00 02 00 00 and $0x200,%ebx 80105334: 89 98 a8 00 00 00 mov %ebx,0xa8(%eax) mycpu()->ncli += 1; 8010533a: e8 e1 e5 ff ff call 80103920 <mycpu> 8010533f: ff 80 a4 00 00 00 incl 0xa4(%eax) } 80105345: 58 pop %eax 80105346: 5b pop %ebx 80105347: 5d pop %ebp 80105348: c3 ret 80105349: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80105350 <popcli>: void popcli(void) { 80105350: 55 push %ebp 80105351: 89 e5 mov %esp,%ebp 80105353: 83 ec 18 sub $0x18,%esp asm volatile("pushfl; popl %0" : "=r" (eflags)); 80105356: 9c pushf 80105357: 58 pop %eax if(readeflags()&FL_IF) 80105358: f6 c4 02 test $0x2,%ah 8010535b: 75 35 jne 80105392 <popcli+0x42> panic("popcli - interruptible"); if(--mycpu()->ncli < 0) 8010535d: e8 be e5 ff ff call 80103920 <mycpu> 80105362: ff 88 a4 00 00 00 decl 0xa4(%eax) 80105368: 78 34 js 8010539e <popcli+0x4e> panic("popcli"); if(mycpu()->ncli == 0 && mycpu()->intena) 8010536a: e8 b1 e5 ff ff call 80103920 <mycpu> 8010536f: 8b 90 a4 00 00 00 mov 0xa4(%eax),%edx 80105375: 85 d2 test %edx,%edx 80105377: 74 07 je 80105380 <popcli+0x30> sti(); } 80105379: c9 leave 8010537a: c3 ret 8010537b: 90 nop 8010537c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(mycpu()->ncli == 0 && mycpu()->intena) 80105380: e8 9b e5 ff ff call 80103920 <mycpu> 80105385: 8b 80 a8 00 00 00 mov 0xa8(%eax),%eax 8010538b: 85 c0 test %eax,%eax 8010538d: 74 ea je 80105379 <popcli+0x29> asm volatile("sti"); 8010538f: fb sti } 80105390: c9 leave 80105391: c3 ret panic("popcli - interruptible"); 80105392: c7 04 24 f3 86 10 80 movl $0x801086f3,(%esp) 80105399: e8 d2 af ff ff call 80100370 <panic> panic("popcli"); 8010539e: c7 04 24 0a 87 10 80 movl $0x8010870a,(%esp) 801053a5: e8 c6 af ff ff call 80100370 <panic> 801053aa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801053b0 <holding>: { 801053b0: 55 push %ebp 801053b1: 89 e5 mov %esp,%ebp 801053b3: 83 ec 08 sub $0x8,%esp 801053b6: 89 75 fc mov %esi,-0x4(%ebp) 801053b9: 8b 75 08 mov 0x8(%ebp),%esi 801053bc: 89 5d f8 mov %ebx,-0x8(%ebp) 801053bf: 31 db xor %ebx,%ebx pushcli(); 801053c1: e8 4a ff ff ff call 80105310 <pushcli> r = lock->locked && lock->cpu == mycpu(); 801053c6: 8b 06 mov (%esi),%eax 801053c8: 85 c0 test %eax,%eax 801053ca: 74 10 je 801053dc <holding+0x2c> 801053cc: 8b 5e 08 mov 0x8(%esi),%ebx 801053cf: e8 4c e5 ff ff call 80103920 <mycpu> 801053d4: 39 c3 cmp %eax,%ebx 801053d6: 0f 94 c3 sete %bl 801053d9: 0f b6 db movzbl %bl,%ebx popcli(); 801053dc: e8 6f ff ff ff call 80105350 <popcli> } 801053e1: 89 d8 mov %ebx,%eax 801053e3: 8b 75 fc mov -0x4(%ebp),%esi 801053e6: 8b 5d f8 mov -0x8(%ebp),%ebx 801053e9: 89 ec mov %ebp,%esp 801053eb: 5d pop %ebp 801053ec: c3 ret 801053ed: 8d 76 00 lea 0x0(%esi),%esi 801053f0 <acquire>: { 801053f0: 55 push %ebp 801053f1: 89 e5 mov %esp,%ebp 801053f3: 56 push %esi 801053f4: 53 push %ebx 801053f5: 83 ec 10 sub $0x10,%esp pushcli(); // disable interrupts to avoid deadlock. 801053f8: e8 13 ff ff ff call 80105310 <pushcli> if(holding(lk)) 801053fd: 8b 5d 08 mov 0x8(%ebp),%ebx 80105400: 89 1c 24 mov %ebx,(%esp) 80105403: e8 a8 ff ff ff call 801053b0 <holding> 80105408: 85 c0 test %eax,%eax 8010540a: 75 78 jne 80105484 <acquire+0x94> 8010540c: 89 c6 mov %eax,%esi asm volatile("lock; xchgl %0, %1" : 8010540e: ba 01 00 00 00 mov $0x1,%edx 80105413: eb 06 jmp 8010541b <acquire+0x2b> 80105415: 8d 76 00 lea 0x0(%esi),%esi 80105418: 8b 5d 08 mov 0x8(%ebp),%ebx 8010541b: 89 d0 mov %edx,%eax 8010541d: f0 87 03 lock xchg %eax,(%ebx) while(xchg(&lk->locked, 1) != 0) 80105420: 85 c0 test %eax,%eax 80105422: 75 f4 jne 80105418 <acquire+0x28> __sync_synchronize(); 80105424: f0 83 0c 24 00 lock orl $0x0,(%esp) lk->cpu = mycpu(); 80105429: 8b 5d 08 mov 0x8(%ebp),%ebx 8010542c: e8 ef e4 ff ff call 80103920 <mycpu> getcallerpcs(&lk, lk->pcs); 80105431: 8d 53 0c lea 0xc(%ebx),%edx lk->cpu = mycpu(); 80105434: 89 43 08 mov %eax,0x8(%ebx) ebp = (uint*)v - 2; 80105437: 89 e8 mov %ebp,%eax 80105439: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff) 80105440: 8d 88 00 00 00 80 lea -0x80000000(%eax),%ecx 80105446: 81 f9 fe ff ff 7f cmp $0x7ffffffe,%ecx 8010544c: 77 1a ja 80105468 <acquire+0x78> pcs[i] = ebp[1]; // saved %eip 8010544e: 8b 48 04 mov 0x4(%eax),%ecx 80105451: 89 0c b2 mov %ecx,(%edx,%esi,4) for(i = 0; i < 10; i++){ 80105454: 46 inc %esi 80105455: 83 fe 0a cmp $0xa,%esi ebp = (uint*)ebp[0]; // saved %ebp 80105458: 8b 00 mov (%eax),%eax for(i = 0; i < 10; i++){ 8010545a: 75 e4 jne 80105440 <acquire+0x50> } 8010545c: 83 c4 10 add $0x10,%esp 8010545f: 5b pop %ebx 80105460: 5e pop %esi 80105461: 5d pop %ebp 80105462: c3 ret 80105463: 90 nop 80105464: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80105468: 8d 04 b2 lea (%edx,%esi,4),%eax 8010546b: 83 c2 28 add $0x28,%edx 8010546e: 66 90 xchg %ax,%ax pcs[i] = 0; 80105470: c7 00 00 00 00 00 movl $0x0,(%eax) 80105476: 83 c0 04 add $0x4,%eax for(; i < 10; i++) 80105479: 39 d0 cmp %edx,%eax 8010547b: 75 f3 jne 80105470 <acquire+0x80> } 8010547d: 83 c4 10 add $0x10,%esp 80105480: 5b pop %ebx 80105481: 5e pop %esi 80105482: 5d pop %ebp 80105483: c3 ret panic("acquire"); 80105484: c7 04 24 11 87 10 80 movl $0x80108711,(%esp) 8010548b: e8 e0 ae ff ff call 80100370 <panic> 80105490 <release>: { 80105490: 55 push %ebp 80105491: 89 e5 mov %esp,%ebp 80105493: 53 push %ebx 80105494: 83 ec 14 sub $0x14,%esp 80105497: 8b 5d 08 mov 0x8(%ebp),%ebx if(!holding(lk)) 8010549a: 89 1c 24 mov %ebx,(%esp) 8010549d: e8 0e ff ff ff call 801053b0 <holding> 801054a2: 85 c0 test %eax,%eax 801054a4: 74 23 je 801054c9 <release+0x39> lk->pcs[0] = 0; 801054a6: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx) lk->cpu = 0; 801054ad: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx) __sync_synchronize(); 801054b4: f0 83 0c 24 00 lock orl $0x0,(%esp) asm volatile("movl $0, %0" : "+m" (lk->locked) : ); 801054b9: c7 03 00 00 00 00 movl $0x0,(%ebx) } 801054bf: 83 c4 14 add $0x14,%esp 801054c2: 5b pop %ebx 801054c3: 5d pop %ebp popcli(); 801054c4: e9 87 fe ff ff jmp 80105350 <popcli> panic("release"); 801054c9: c7 04 24 19 87 10 80 movl $0x80108719,(%esp) 801054d0: e8 9b ae ff ff call 80100370 <panic> 801054d5: 66 90 xchg %ax,%ax 801054d7: 66 90 xchg %ax,%ax 801054d9: 66 90 xchg %ax,%ax 801054db: 66 90 xchg %ax,%ax 801054dd: 66 90 xchg %ax,%ax 801054df: 90 nop 801054e0 <memset>: #include "types.h" #include "x86.h" void* memset(void *dst, int c, uint n) { 801054e0: 55 push %ebp 801054e1: 89 e5 mov %esp,%ebp 801054e3: 83 ec 08 sub $0x8,%esp 801054e6: 8b 55 08 mov 0x8(%ebp),%edx 801054e9: 89 5d f8 mov %ebx,-0x8(%ebp) 801054ec: 8b 4d 10 mov 0x10(%ebp),%ecx 801054ef: 89 7d fc mov %edi,-0x4(%ebp) if ((int)dst%4 == 0 && n%4 == 0){ 801054f2: f6 c2 03 test $0x3,%dl 801054f5: 75 05 jne 801054fc <memset+0x1c> 801054f7: f6 c1 03 test $0x3,%cl 801054fa: 74 14 je 80105510 <memset+0x30> asm volatile("cld; rep stosb" : 801054fc: 89 d7 mov %edx,%edi 801054fe: 8b 45 0c mov 0xc(%ebp),%eax 80105501: fc cld 80105502: 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; } 80105504: 8b 5d f8 mov -0x8(%ebp),%ebx 80105507: 89 d0 mov %edx,%eax 80105509: 8b 7d fc mov -0x4(%ebp),%edi 8010550c: 89 ec mov %ebp,%esp 8010550e: 5d pop %ebp 8010550f: c3 ret c &= 0xFF; 80105510: 0f b6 7d 0c movzbl 0xc(%ebp),%edi stosl(dst, (c<<24)|(c<<16)|(c<<8)|c, n/4); 80105514: c1 e9 02 shr $0x2,%ecx 80105517: 89 f8 mov %edi,%eax 80105519: 89 fb mov %edi,%ebx 8010551b: c1 e0 18 shl $0x18,%eax 8010551e: c1 e3 10 shl $0x10,%ebx 80105521: 09 d8 or %ebx,%eax 80105523: 09 f8 or %edi,%eax 80105525: c1 e7 08 shl $0x8,%edi 80105528: 09 f8 or %edi,%eax asm volatile("cld; rep stosl" : 8010552a: 89 d7 mov %edx,%edi 8010552c: fc cld 8010552d: f3 ab rep stos %eax,%es:(%edi) } 8010552f: 8b 5d f8 mov -0x8(%ebp),%ebx 80105532: 89 d0 mov %edx,%eax 80105534: 8b 7d fc mov -0x4(%ebp),%edi 80105537: 89 ec mov %ebp,%esp 80105539: 5d pop %ebp 8010553a: c3 ret 8010553b: 90 nop 8010553c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80105540 <memcmp>: int memcmp(const void *v1, const void *v2, uint n) { 80105540: 55 push %ebp 80105541: 89 e5 mov %esp,%ebp 80105543: 57 push %edi 80105544: 8b 7d 0c mov 0xc(%ebp),%edi 80105547: 56 push %esi 80105548: 8b 75 08 mov 0x8(%ebp),%esi 8010554b: 53 push %ebx 8010554c: 8b 5d 10 mov 0x10(%ebp),%ebx const uchar *s1, *s2; s1 = v1; s2 = v2; while(n-- > 0){ 8010554f: 85 db test %ebx,%ebx 80105551: 74 27 je 8010557a <memcmp+0x3a> if(*s1 != *s2) 80105553: 0f b6 16 movzbl (%esi),%edx 80105556: 0f b6 0f movzbl (%edi),%ecx 80105559: 38 d1 cmp %dl,%cl 8010555b: 75 2b jne 80105588 <memcmp+0x48> 8010555d: b8 01 00 00 00 mov $0x1,%eax 80105562: eb 12 jmp 80105576 <memcmp+0x36> 80105564: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80105568: 0f b6 14 06 movzbl (%esi,%eax,1),%edx 8010556c: 40 inc %eax 8010556d: 0f b6 4c 07 ff movzbl -0x1(%edi,%eax,1),%ecx 80105572: 38 ca cmp %cl,%dl 80105574: 75 12 jne 80105588 <memcmp+0x48> while(n-- > 0){ 80105576: 39 d8 cmp %ebx,%eax 80105578: 75 ee jne 80105568 <memcmp+0x28> return *s1 - *s2; s1++, s2++; } return 0; } 8010557a: 5b pop %ebx return 0; 8010557b: 31 c0 xor %eax,%eax } 8010557d: 5e pop %esi 8010557e: 5f pop %edi 8010557f: 5d pop %ebp 80105580: c3 ret 80105581: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80105588: 5b pop %ebx return *s1 - *s2; 80105589: 0f b6 c2 movzbl %dl,%eax 8010558c: 29 c8 sub %ecx,%eax } 8010558e: 5e pop %esi 8010558f: 5f pop %edi 80105590: 5d pop %ebp 80105591: c3 ret 80105592: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80105599: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801055a0 <memmove>: void* memmove(void *dst, const void *src, uint n) { 801055a0: 55 push %ebp 801055a1: 89 e5 mov %esp,%ebp 801055a3: 56 push %esi 801055a4: 8b 45 08 mov 0x8(%ebp),%eax 801055a7: 53 push %ebx 801055a8: 8b 5d 0c mov 0xc(%ebp),%ebx 801055ab: 8b 75 10 mov 0x10(%ebp),%esi const char *s; char *d; s = src; d = dst; if(s < d && s + n > d){ 801055ae: 39 c3 cmp %eax,%ebx 801055b0: 73 26 jae 801055d8 <memmove+0x38> 801055b2: 8d 0c 33 lea (%ebx,%esi,1),%ecx 801055b5: 39 c8 cmp %ecx,%eax 801055b7: 73 1f jae 801055d8 <memmove+0x38> s += n; d += n; while(n-- > 0) 801055b9: 85 f6 test %esi,%esi 801055bb: 8d 56 ff lea -0x1(%esi),%edx 801055be: 74 0d je 801055cd <memmove+0x2d> *--d = *--s; 801055c0: 0f b6 0c 13 movzbl (%ebx,%edx,1),%ecx 801055c4: 88 0c 10 mov %cl,(%eax,%edx,1) while(n-- > 0) 801055c7: 4a dec %edx 801055c8: 83 fa ff cmp $0xffffffff,%edx 801055cb: 75 f3 jne 801055c0 <memmove+0x20> } else while(n-- > 0) *d++ = *s++; return dst; } 801055cd: 5b pop %ebx 801055ce: 5e pop %esi 801055cf: 5d pop %ebp 801055d0: c3 ret 801055d1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi while(n-- > 0) 801055d8: 31 d2 xor %edx,%edx 801055da: 85 f6 test %esi,%esi 801055dc: 74 ef je 801055cd <memmove+0x2d> 801055de: 66 90 xchg %ax,%ax *d++ = *s++; 801055e0: 0f b6 0c 13 movzbl (%ebx,%edx,1),%ecx 801055e4: 88 0c 10 mov %cl,(%eax,%edx,1) 801055e7: 42 inc %edx while(n-- > 0) 801055e8: 39 d6 cmp %edx,%esi 801055ea: 75 f4 jne 801055e0 <memmove+0x40> } 801055ec: 5b pop %ebx 801055ed: 5e pop %esi 801055ee: 5d pop %ebp 801055ef: c3 ret 801055f0 <memcpy>: // memcpy exists to placate GCC. Use memmove. void* memcpy(void *dst, const void *src, uint n) { 801055f0: 55 push %ebp 801055f1: 89 e5 mov %esp,%ebp return memmove(dst, src, n); } 801055f3: 5d pop %ebp return memmove(dst, src, n); 801055f4: eb aa jmp 801055a0 <memmove> 801055f6: 8d 76 00 lea 0x0(%esi),%esi 801055f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105600 <strncmp>: int strncmp(const char *p, const char *q, uint n) { 80105600: 55 push %ebp 80105601: 89 e5 mov %esp,%ebp 80105603: 57 push %edi 80105604: 8b 7d 10 mov 0x10(%ebp),%edi 80105607: 56 push %esi 80105608: 8b 75 0c mov 0xc(%ebp),%esi 8010560b: 53 push %ebx 8010560c: 8b 5d 08 mov 0x8(%ebp),%ebx while(n > 0 && *p && *p == *q) 8010560f: 85 ff test %edi,%edi 80105611: 74 2d je 80105640 <strncmp+0x40> 80105613: 0f b6 03 movzbl (%ebx),%eax 80105616: 0f b6 0e movzbl (%esi),%ecx 80105619: 84 c0 test %al,%al 8010561b: 74 37 je 80105654 <strncmp+0x54> 8010561d: 38 c1 cmp %al,%cl 8010561f: 75 33 jne 80105654 <strncmp+0x54> 80105621: 01 f7 add %esi,%edi 80105623: eb 13 jmp 80105638 <strncmp+0x38> 80105625: 8d 76 00 lea 0x0(%esi),%esi 80105628: 0f b6 03 movzbl (%ebx),%eax 8010562b: 84 c0 test %al,%al 8010562d: 74 21 je 80105650 <strncmp+0x50> 8010562f: 0f b6 0a movzbl (%edx),%ecx 80105632: 89 d6 mov %edx,%esi 80105634: 38 c8 cmp %cl,%al 80105636: 75 1c jne 80105654 <strncmp+0x54> n--, p++, q++; 80105638: 8d 56 01 lea 0x1(%esi),%edx 8010563b: 43 inc %ebx while(n > 0 && *p && *p == *q) 8010563c: 39 fa cmp %edi,%edx 8010563e: 75 e8 jne 80105628 <strncmp+0x28> if(n == 0) return 0; return (uchar)*p - (uchar)*q; } 80105640: 5b pop %ebx return 0; 80105641: 31 c0 xor %eax,%eax } 80105643: 5e pop %esi 80105644: 5f pop %edi 80105645: 5d pop %ebp 80105646: c3 ret 80105647: 89 f6 mov %esi,%esi 80105649: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105650: 0f b6 4e 01 movzbl 0x1(%esi),%ecx 80105654: 5b pop %ebx return (uchar)*p - (uchar)*q; 80105655: 29 c8 sub %ecx,%eax } 80105657: 5e pop %esi 80105658: 5f pop %edi 80105659: 5d pop %ebp 8010565a: c3 ret 8010565b: 90 nop 8010565c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80105660 <strncpy>: char* strncpy(char *s, const char *t, int n) { 80105660: 55 push %ebp 80105661: 89 e5 mov %esp,%ebp 80105663: 8b 45 08 mov 0x8(%ebp),%eax 80105666: 56 push %esi 80105667: 8b 4d 10 mov 0x10(%ebp),%ecx 8010566a: 53 push %ebx 8010566b: 8b 75 0c mov 0xc(%ebp),%esi char *os; os = s; while(n-- > 0 && (*s++ = *t++) != 0) 8010566e: 89 c2 mov %eax,%edx 80105670: eb 15 jmp 80105687 <strncpy+0x27> 80105672: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80105678: 46 inc %esi 80105679: 0f b6 4e ff movzbl -0x1(%esi),%ecx 8010567d: 42 inc %edx 8010567e: 84 c9 test %cl,%cl 80105680: 88 4a ff mov %cl,-0x1(%edx) 80105683: 74 09 je 8010568e <strncpy+0x2e> 80105685: 89 d9 mov %ebx,%ecx 80105687: 85 c9 test %ecx,%ecx 80105689: 8d 59 ff lea -0x1(%ecx),%ebx 8010568c: 7f ea jg 80105678 <strncpy+0x18> ; while(n-- > 0) 8010568e: 31 c9 xor %ecx,%ecx 80105690: 85 db test %ebx,%ebx 80105692: 7e 19 jle 801056ad <strncpy+0x4d> 80105694: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010569a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi *s++ = 0; 801056a0: c6 04 0a 00 movb $0x0,(%edx,%ecx,1) 801056a4: 89 de mov %ebx,%esi 801056a6: 41 inc %ecx 801056a7: 29 ce sub %ecx,%esi while(n-- > 0) 801056a9: 85 f6 test %esi,%esi 801056ab: 7f f3 jg 801056a0 <strncpy+0x40> return os; } 801056ad: 5b pop %ebx 801056ae: 5e pop %esi 801056af: 5d pop %ebp 801056b0: c3 ret 801056b1: eb 0d jmp 801056c0 <safestrcpy> 801056b3: 90 nop 801056b4: 90 nop 801056b5: 90 nop 801056b6: 90 nop 801056b7: 90 nop 801056b8: 90 nop 801056b9: 90 nop 801056ba: 90 nop 801056bb: 90 nop 801056bc: 90 nop 801056bd: 90 nop 801056be: 90 nop 801056bf: 90 nop 801056c0 <safestrcpy>: // Like strncpy but guaranteed to NUL-terminate. char* safestrcpy(char *s, const char *t, int n) { 801056c0: 55 push %ebp 801056c1: 89 e5 mov %esp,%ebp 801056c3: 8b 4d 10 mov 0x10(%ebp),%ecx 801056c6: 56 push %esi 801056c7: 8b 45 08 mov 0x8(%ebp),%eax 801056ca: 53 push %ebx 801056cb: 8b 55 0c mov 0xc(%ebp),%edx char *os; os = s; if(n <= 0) 801056ce: 85 c9 test %ecx,%ecx 801056d0: 7e 22 jle 801056f4 <safestrcpy+0x34> 801056d2: 8d 74 0a ff lea -0x1(%edx,%ecx,1),%esi 801056d6: 89 c1 mov %eax,%ecx 801056d8: eb 13 jmp 801056ed <safestrcpy+0x2d> 801056da: 8d b6 00 00 00 00 lea 0x0(%esi),%esi return os; while(--n > 0 && (*s++ = *t++) != 0) 801056e0: 42 inc %edx 801056e1: 0f b6 5a ff movzbl -0x1(%edx),%ebx 801056e5: 41 inc %ecx 801056e6: 84 db test %bl,%bl 801056e8: 88 59 ff mov %bl,-0x1(%ecx) 801056eb: 74 04 je 801056f1 <safestrcpy+0x31> 801056ed: 39 f2 cmp %esi,%edx 801056ef: 75 ef jne 801056e0 <safestrcpy+0x20> ; *s = 0; 801056f1: c6 01 00 movb $0x0,(%ecx) return os; } 801056f4: 5b pop %ebx 801056f5: 5e pop %esi 801056f6: 5d pop %ebp 801056f7: c3 ret 801056f8: 90 nop 801056f9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80105700 <strlen>: int strlen(const char *s) { 80105700: 55 push %ebp int n; for(n = 0; s[n]; n++) 80105701: 31 c0 xor %eax,%eax { 80105703: 89 e5 mov %esp,%ebp 80105705: 8b 55 08 mov 0x8(%ebp),%edx for(n = 0; s[n]; n++) 80105708: 80 3a 00 cmpb $0x0,(%edx) 8010570b: 74 0a je 80105717 <strlen+0x17> 8010570d: 8d 76 00 lea 0x0(%esi),%esi 80105710: 40 inc %eax 80105711: 80 3c 02 00 cmpb $0x0,(%edx,%eax,1) 80105715: 75 f9 jne 80105710 <strlen+0x10> ; return n; } 80105717: 5d pop %ebp 80105718: c3 ret 80105719 <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 80105719: 8b 44 24 04 mov 0x4(%esp),%eax movl 8(%esp), %edx 8010571d: 8b 54 24 08 mov 0x8(%esp),%edx # Save old callee-saved registers pushl %ebp 80105721: 55 push %ebp pushl %ebx 80105722: 53 push %ebx pushl %esi 80105723: 56 push %esi pushl %edi 80105724: 57 push %edi # Switch stacks movl %esp, (%eax) 80105725: 89 20 mov %esp,(%eax) movl %edx, %esp 80105727: 89 d4 mov %edx,%esp # Load new callee-saved registers popl %edi 80105729: 5f pop %edi popl %esi 8010572a: 5e pop %esi popl %ebx 8010572b: 5b pop %ebx popl %ebp 8010572c: 5d pop %ebp ret 8010572d: c3 ret 8010572e: 66 90 xchg %ax,%ax 80105730 <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) { 80105730: 55 push %ebp 80105731: 89 e5 mov %esp,%ebp 80105733: 53 push %ebx 80105734: 83 ec 04 sub $0x4,%esp 80105737: 8b 5d 08 mov 0x8(%ebp),%ebx struct proc *curproc = myproc(); 8010573a: e8 81 e2 ff ff call 801039c0 <myproc> if(addr >= curproc->sz || addr+4 > curproc->sz) 8010573f: 8b 00 mov (%eax),%eax 80105741: 39 d8 cmp %ebx,%eax 80105743: 76 1b jbe 80105760 <fetchint+0x30> 80105745: 8d 53 04 lea 0x4(%ebx),%edx 80105748: 39 d0 cmp %edx,%eax 8010574a: 72 14 jb 80105760 <fetchint+0x30> return -1; *ip = *(int*)(addr); 8010574c: 8b 45 0c mov 0xc(%ebp),%eax 8010574f: 8b 13 mov (%ebx),%edx 80105751: 89 10 mov %edx,(%eax) return 0; 80105753: 31 c0 xor %eax,%eax } 80105755: 5a pop %edx 80105756: 5b pop %ebx 80105757: 5d pop %ebp 80105758: c3 ret 80105759: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80105760: b8 ff ff ff ff mov $0xffffffff,%eax 80105765: eb ee jmp 80105755 <fetchint+0x25> 80105767: 89 f6 mov %esi,%esi 80105769: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105770 <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) { 80105770: 55 push %ebp 80105771: 89 e5 mov %esp,%ebp 80105773: 53 push %ebx 80105774: 83 ec 04 sub $0x4,%esp 80105777: 8b 5d 08 mov 0x8(%ebp),%ebx char *s, *ep; struct proc *curproc = myproc(); 8010577a: e8 41 e2 ff ff call 801039c0 <myproc> if(addr >= curproc->sz) 8010577f: 39 18 cmp %ebx,(%eax) 80105781: 76 27 jbe 801057aa <fetchstr+0x3a> return -1; *pp = (char*)addr; 80105783: 8b 4d 0c mov 0xc(%ebp),%ecx 80105786: 89 da mov %ebx,%edx 80105788: 89 19 mov %ebx,(%ecx) ep = (char*)curproc->sz; 8010578a: 8b 00 mov (%eax),%eax for(s = *pp; s < ep; s++){ 8010578c: 39 c3 cmp %eax,%ebx 8010578e: 73 1a jae 801057aa <fetchstr+0x3a> if(*s == 0) 80105790: 80 3b 00 cmpb $0x0,(%ebx) 80105793: 75 10 jne 801057a5 <fetchstr+0x35> 80105795: eb 29 jmp 801057c0 <fetchstr+0x50> 80105797: 89 f6 mov %esi,%esi 80105799: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801057a0: 80 3a 00 cmpb $0x0,(%edx) 801057a3: 74 13 je 801057b8 <fetchstr+0x48> for(s = *pp; s < ep; s++){ 801057a5: 42 inc %edx 801057a6: 39 d0 cmp %edx,%eax 801057a8: 77 f6 ja 801057a0 <fetchstr+0x30> return -1; 801057aa: b8 ff ff ff ff mov $0xffffffff,%eax return s - *pp; } return -1; } 801057af: 5a pop %edx 801057b0: 5b pop %ebx 801057b1: 5d pop %ebp 801057b2: c3 ret 801057b3: 90 nop 801057b4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801057b8: 89 d0 mov %edx,%eax 801057ba: 5a pop %edx 801057bb: 29 d8 sub %ebx,%eax 801057bd: 5b pop %ebx 801057be: 5d pop %ebp 801057bf: c3 ret if(*s == 0) 801057c0: 31 c0 xor %eax,%eax return s - *pp; 801057c2: eb eb jmp 801057af <fetchstr+0x3f> 801057c4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801057ca: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 801057d0 <argint>: // Fetch the nth 32-bit system call argument. int argint(int n, int *ip) { 801057d0: 55 push %ebp 801057d1: 89 e5 mov %esp,%ebp 801057d3: 56 push %esi 801057d4: 53 push %ebx return fetchint((myproc()->tf->esp) + 4 + 4*n, ip); 801057d5: e8 e6 e1 ff ff call 801039c0 <myproc> 801057da: 8b 55 08 mov 0x8(%ebp),%edx 801057dd: 8b 40 18 mov 0x18(%eax),%eax 801057e0: 8b 40 44 mov 0x44(%eax),%eax 801057e3: 8d 1c 90 lea (%eax,%edx,4),%ebx struct proc *curproc = myproc(); 801057e6: e8 d5 e1 ff ff call 801039c0 <myproc> return fetchint((myproc()->tf->esp) + 4 + 4*n, ip); 801057eb: 8d 73 04 lea 0x4(%ebx),%esi if(addr >= curproc->sz || addr+4 > curproc->sz) 801057ee: 8b 00 mov (%eax),%eax 801057f0: 39 c6 cmp %eax,%esi 801057f2: 73 1c jae 80105810 <argint+0x40> 801057f4: 8d 53 08 lea 0x8(%ebx),%edx 801057f7: 39 d0 cmp %edx,%eax 801057f9: 72 15 jb 80105810 <argint+0x40> *ip = *(int*)(addr); 801057fb: 8b 45 0c mov 0xc(%ebp),%eax 801057fe: 8b 53 04 mov 0x4(%ebx),%edx 80105801: 89 10 mov %edx,(%eax) return 0; 80105803: 31 c0 xor %eax,%eax } 80105805: 5b pop %ebx 80105806: 5e pop %esi 80105807: 5d pop %ebp 80105808: c3 ret 80105809: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80105810: b8 ff ff ff ff mov $0xffffffff,%eax return fetchint((myproc()->tf->esp) + 4 + 4*n, ip); 80105815: eb ee jmp 80105805 <argint+0x35> 80105817: 89 f6 mov %esi,%esi 80105819: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105820 <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) { 80105820: 55 push %ebp 80105821: 89 e5 mov %esp,%ebp 80105823: 56 push %esi 80105824: 53 push %ebx 80105825: 83 ec 20 sub $0x20,%esp 80105828: 8b 5d 10 mov 0x10(%ebp),%ebx int i; struct proc *curproc = myproc(); 8010582b: e8 90 e1 ff ff call 801039c0 <myproc> 80105830: 89 c6 mov %eax,%esi if(argint(n, &i) < 0) 80105832: 8d 45 f4 lea -0xc(%ebp),%eax 80105835: 89 44 24 04 mov %eax,0x4(%esp) 80105839: 8b 45 08 mov 0x8(%ebp),%eax 8010583c: 89 04 24 mov %eax,(%esp) 8010583f: e8 8c ff ff ff call 801057d0 <argint> return -1; if(size < 0 || (uint)i >= curproc->sz || (uint)i+size > curproc->sz) 80105844: c1 e8 1f shr $0x1f,%eax 80105847: 84 c0 test %al,%al 80105849: 75 2d jne 80105878 <argptr+0x58> 8010584b: 89 d8 mov %ebx,%eax 8010584d: c1 e8 1f shr $0x1f,%eax 80105850: 84 c0 test %al,%al 80105852: 75 24 jne 80105878 <argptr+0x58> 80105854: 8b 16 mov (%esi),%edx 80105856: 8b 45 f4 mov -0xc(%ebp),%eax 80105859: 39 c2 cmp %eax,%edx 8010585b: 76 1b jbe 80105878 <argptr+0x58> 8010585d: 01 c3 add %eax,%ebx 8010585f: 39 da cmp %ebx,%edx 80105861: 72 15 jb 80105878 <argptr+0x58> return -1; *pp = (char*)i; 80105863: 8b 55 0c mov 0xc(%ebp),%edx 80105866: 89 02 mov %eax,(%edx) return 0; 80105868: 31 c0 xor %eax,%eax } 8010586a: 83 c4 20 add $0x20,%esp 8010586d: 5b pop %ebx 8010586e: 5e pop %esi 8010586f: 5d pop %ebp 80105870: c3 ret 80105871: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80105878: b8 ff ff ff ff mov $0xffffffff,%eax 8010587d: eb eb jmp 8010586a <argptr+0x4a> 8010587f: 90 nop 80105880 <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) { 80105880: 55 push %ebp 80105881: 89 e5 mov %esp,%ebp 80105883: 83 ec 28 sub $0x28,%esp int addr; if(argint(n, &addr) < 0) 80105886: 8d 45 f4 lea -0xc(%ebp),%eax 80105889: 89 44 24 04 mov %eax,0x4(%esp) 8010588d: 8b 45 08 mov 0x8(%ebp),%eax 80105890: 89 04 24 mov %eax,(%esp) 80105893: e8 38 ff ff ff call 801057d0 <argint> 80105898: 85 c0 test %eax,%eax 8010589a: 78 14 js 801058b0 <argstr+0x30> return -1; return fetchstr(addr, pp); 8010589c: 8b 45 0c mov 0xc(%ebp),%eax 8010589f: 89 44 24 04 mov %eax,0x4(%esp) 801058a3: 8b 45 f4 mov -0xc(%ebp),%eax 801058a6: 89 04 24 mov %eax,(%esp) 801058a9: e8 c2 fe ff ff call 80105770 <fetchstr> } 801058ae: c9 leave 801058af: c3 ret return -1; 801058b0: b8 ff ff ff ff mov $0xffffffff,%eax } 801058b5: c9 leave 801058b6: c3 ret 801058b7: 89 f6 mov %esi,%esi 801058b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801058c0 <syscall>: [SYS_priority]sys_priority, }; void syscall(void) { 801058c0: 55 push %ebp 801058c1: 89 e5 mov %esp,%ebp 801058c3: 53 push %ebx 801058c4: 83 ec 14 sub $0x14,%esp int num; struct proc *curproc = myproc(); 801058c7: e8 f4 e0 ff ff call 801039c0 <myproc> 801058cc: 89 c3 mov %eax,%ebx num = curproc->tf->eax; 801058ce: 8b 40 18 mov 0x18(%eax),%eax 801058d1: 8b 40 1c mov 0x1c(%eax),%eax if(num > 0 && num < NELEM(syscalls) && syscalls[num]) { 801058d4: 8d 50 ff lea -0x1(%eax),%edx 801058d7: 83 fa 16 cmp $0x16,%edx 801058da: 77 1c ja 801058f8 <syscall+0x38> 801058dc: 8b 14 85 40 87 10 80 mov -0x7fef78c0(,%eax,4),%edx 801058e3: 85 d2 test %edx,%edx 801058e5: 74 11 je 801058f8 <syscall+0x38> curproc->tf->eax = syscalls[num](); 801058e7: ff d2 call *%edx 801058e9: 8b 53 18 mov 0x18(%ebx),%edx 801058ec: 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; } } 801058ef: 83 c4 14 add $0x14,%esp 801058f2: 5b pop %ebx 801058f3: 5d pop %ebp 801058f4: c3 ret 801058f5: 8d 76 00 lea 0x0(%esi),%esi cprintf("%d %s: unknown sys call %d\n", 801058f8: 89 44 24 0c mov %eax,0xc(%esp) curproc->pid, curproc->name, num); 801058fc: 8d 43 6c lea 0x6c(%ebx),%eax 801058ff: 89 44 24 08 mov %eax,0x8(%esp) cprintf("%d %s: unknown sys call %d\n", 80105903: 8b 43 10 mov 0x10(%ebx),%eax 80105906: c7 04 24 21 87 10 80 movl $0x80108721,(%esp) 8010590d: 89 44 24 04 mov %eax,0x4(%esp) 80105911: e8 3a ad ff ff call 80100650 <cprintf> curproc->tf->eax = -1; 80105916: 8b 43 18 mov 0x18(%ebx),%eax 80105919: c7 40 1c ff ff ff ff movl $0xffffffff,0x1c(%eax) } 80105920: 83 c4 14 add $0x14,%esp 80105923: 5b pop %ebx 80105924: 5d pop %ebp 80105925: c3 ret 80105926: 66 90 xchg %ax,%ax 80105928: 66 90 xchg %ax,%ax 8010592a: 66 90 xchg %ax,%ax 8010592c: 66 90 xchg %ax,%ax 8010592e: 66 90 xchg %ax,%ax 80105930 <create>: return -1; } static struct inode* create(char *path, short type, short major, short minor) { 80105930: 55 push %ebp 80105931: 0f bf d2 movswl %dx,%edx 80105934: 89 e5 mov %esp,%ebp 80105936: 83 ec 58 sub $0x58,%esp 80105939: 89 7d fc mov %edi,-0x4(%ebp) 8010593c: 0f bf 7d 08 movswl 0x8(%ebp),%edi 80105940: 0f bf c9 movswl %cx,%ecx uint off; struct inode *ip, *dp; char name[DIRSIZ]; if((dp = nameiparent(path, name)) == 0) 80105943: 89 04 24 mov %eax,(%esp) { 80105946: 89 5d f4 mov %ebx,-0xc(%ebp) 80105949: 89 75 f8 mov %esi,-0x8(%ebp) 8010594c: 89 7d bc mov %edi,-0x44(%ebp) if((dp = nameiparent(path, name)) == 0) 8010594f: 8d 7d da lea -0x26(%ebp),%edi 80105952: 89 7c 24 04 mov %edi,0x4(%esp) { 80105956: 89 55 c4 mov %edx,-0x3c(%ebp) 80105959: 89 4d c0 mov %ecx,-0x40(%ebp) if((dp = nameiparent(path, name)) == 0) 8010595c: e8 8f c6 ff ff call 80101ff0 <nameiparent> 80105961: 85 c0 test %eax,%eax 80105963: 0f 84 4f 01 00 00 je 80105ab8 <create+0x188> return 0; ilock(dp); 80105969: 89 04 24 mov %eax,(%esp) 8010596c: 89 c3 mov %eax,%ebx 8010596e: e8 7d bd ff ff call 801016f0 <ilock> if((ip = dirlookup(dp, name, &off)) != 0){ 80105973: 8d 45 d4 lea -0x2c(%ebp),%eax 80105976: 89 44 24 08 mov %eax,0x8(%esp) 8010597a: 89 7c 24 04 mov %edi,0x4(%esp) 8010597e: 89 1c 24 mov %ebx,(%esp) 80105981: e8 ea c2 ff ff call 80101c70 <dirlookup> 80105986: 85 c0 test %eax,%eax 80105988: 89 c6 mov %eax,%esi 8010598a: 74 34 je 801059c0 <create+0x90> iunlockput(dp); 8010598c: 89 1c 24 mov %ebx,(%esp) 8010598f: e8 ec bf ff ff call 80101980 <iunlockput> ilock(ip); 80105994: 89 34 24 mov %esi,(%esp) 80105997: e8 54 bd ff ff call 801016f0 <ilock> if(type == T_FILE && ip->type == T_FILE) 8010599c: 83 7d c4 02 cmpl $0x2,-0x3c(%ebp) 801059a0: 0f 85 9a 00 00 00 jne 80105a40 <create+0x110> 801059a6: 66 83 7e 50 02 cmpw $0x2,0x50(%esi) 801059ab: 0f 85 8f 00 00 00 jne 80105a40 <create+0x110> panic("create: dirlink"); iunlockput(dp); return ip; } 801059b1: 89 f0 mov %esi,%eax 801059b3: 8b 5d f4 mov -0xc(%ebp),%ebx 801059b6: 8b 75 f8 mov -0x8(%ebp),%esi 801059b9: 8b 7d fc mov -0x4(%ebp),%edi 801059bc: 89 ec mov %ebp,%esp 801059be: 5d pop %ebp 801059bf: c3 ret if((ip = ialloc(dp->dev, type)) == 0) 801059c0: 8b 45 c4 mov -0x3c(%ebp),%eax 801059c3: 89 44 24 04 mov %eax,0x4(%esp) 801059c7: 8b 03 mov (%ebx),%eax 801059c9: 89 04 24 mov %eax,(%esp) 801059cc: e8 9f bb ff ff call 80101570 <ialloc> 801059d1: 85 c0 test %eax,%eax 801059d3: 89 c6 mov %eax,%esi 801059d5: 0f 84 f0 00 00 00 je 80105acb <create+0x19b> ilock(ip); 801059db: 89 04 24 mov %eax,(%esp) 801059de: e8 0d bd ff ff call 801016f0 <ilock> ip->major = major; 801059e3: 8b 45 c0 mov -0x40(%ebp),%eax ip->nlink = 1; 801059e6: 66 c7 46 56 01 00 movw $0x1,0x56(%esi) ip->major = major; 801059ec: 66 89 46 52 mov %ax,0x52(%esi) ip->minor = minor; 801059f0: 8b 45 bc mov -0x44(%ebp),%eax 801059f3: 66 89 46 54 mov %ax,0x54(%esi) iupdate(ip); 801059f7: 89 34 24 mov %esi,(%esp) 801059fa: e8 31 bc ff ff call 80101630 <iupdate> if(type == T_DIR){ // Create . and .. entries. 801059ff: 83 7d c4 01 cmpl $0x1,-0x3c(%ebp) 80105a03: 74 5b je 80105a60 <create+0x130> if(dirlink(dp, name, ip->inum) < 0) 80105a05: 8b 46 04 mov 0x4(%esi),%eax 80105a08: 89 7c 24 04 mov %edi,0x4(%esp) 80105a0c: 89 1c 24 mov %ebx,(%esp) 80105a0f: 89 44 24 08 mov %eax,0x8(%esp) 80105a13: e8 d8 c4 ff ff call 80101ef0 <dirlink> 80105a18: 85 c0 test %eax,%eax 80105a1a: 0f 88 9f 00 00 00 js 80105abf <create+0x18f> iunlockput(dp); 80105a20: 89 1c 24 mov %ebx,(%esp) 80105a23: e8 58 bf ff ff call 80101980 <iunlockput> } 80105a28: 89 f0 mov %esi,%eax 80105a2a: 8b 5d f4 mov -0xc(%ebp),%ebx 80105a2d: 8b 75 f8 mov -0x8(%ebp),%esi 80105a30: 8b 7d fc mov -0x4(%ebp),%edi 80105a33: 89 ec mov %ebp,%esp 80105a35: 5d pop %ebp 80105a36: c3 ret 80105a37: 89 f6 mov %esi,%esi 80105a39: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi iunlockput(ip); 80105a40: 89 34 24 mov %esi,(%esp) return 0; 80105a43: 31 f6 xor %esi,%esi iunlockput(ip); 80105a45: e8 36 bf ff ff call 80101980 <iunlockput> } 80105a4a: 89 f0 mov %esi,%eax 80105a4c: 8b 5d f4 mov -0xc(%ebp),%ebx 80105a4f: 8b 75 f8 mov -0x8(%ebp),%esi 80105a52: 8b 7d fc mov -0x4(%ebp),%edi 80105a55: 89 ec mov %ebp,%esp 80105a57: 5d pop %ebp 80105a58: c3 ret 80105a59: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi dp->nlink++; // for ".." 80105a60: 66 ff 43 56 incw 0x56(%ebx) iupdate(dp); 80105a64: 89 1c 24 mov %ebx,(%esp) 80105a67: e8 c4 bb ff ff call 80101630 <iupdate> if(dirlink(ip, ".", ip->inum) < 0 || dirlink(ip, "..", dp->inum) < 0) 80105a6c: 8b 46 04 mov 0x4(%esi),%eax 80105a6f: ba bc 87 10 80 mov $0x801087bc,%edx 80105a74: 89 54 24 04 mov %edx,0x4(%esp) 80105a78: 89 34 24 mov %esi,(%esp) 80105a7b: 89 44 24 08 mov %eax,0x8(%esp) 80105a7f: e8 6c c4 ff ff call 80101ef0 <dirlink> 80105a84: 85 c0 test %eax,%eax 80105a86: 78 20 js 80105aa8 <create+0x178> 80105a88: 8b 43 04 mov 0x4(%ebx),%eax 80105a8b: 89 34 24 mov %esi,(%esp) 80105a8e: 89 44 24 08 mov %eax,0x8(%esp) 80105a92: b8 bb 87 10 80 mov $0x801087bb,%eax 80105a97: 89 44 24 04 mov %eax,0x4(%esp) 80105a9b: e8 50 c4 ff ff call 80101ef0 <dirlink> 80105aa0: 85 c0 test %eax,%eax 80105aa2: 0f 89 5d ff ff ff jns 80105a05 <create+0xd5> panic("create dots"); 80105aa8: c7 04 24 af 87 10 80 movl $0x801087af,(%esp) 80105aaf: e8 bc a8 ff ff call 80100370 <panic> 80105ab4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return 0; 80105ab8: 31 f6 xor %esi,%esi 80105aba: e9 f2 fe ff ff jmp 801059b1 <create+0x81> panic("create: dirlink"); 80105abf: c7 04 24 be 87 10 80 movl $0x801087be,(%esp) 80105ac6: e8 a5 a8 ff ff call 80100370 <panic> panic("create: ialloc"); 80105acb: c7 04 24 a0 87 10 80 movl $0x801087a0,(%esp) 80105ad2: e8 99 a8 ff ff call 80100370 <panic> 80105ad7: 89 f6 mov %esi,%esi 80105ad9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105ae0 <argfd.constprop.0>: argfd(int n, int *pfd, struct file **pf) 80105ae0: 55 push %ebp 80105ae1: 89 e5 mov %esp,%ebp 80105ae3: 56 push %esi 80105ae4: 89 d6 mov %edx,%esi 80105ae6: 53 push %ebx 80105ae7: 89 c3 mov %eax,%ebx 80105ae9: 83 ec 20 sub $0x20,%esp if(argint(n, &fd) < 0) 80105aec: 8d 45 f4 lea -0xc(%ebp),%eax 80105aef: 89 44 24 04 mov %eax,0x4(%esp) 80105af3: c7 04 24 00 00 00 00 movl $0x0,(%esp) 80105afa: e8 d1 fc ff ff call 801057d0 <argint> 80105aff: 85 c0 test %eax,%eax 80105b01: 78 2d js 80105b30 <argfd.constprop.0+0x50> if(fd < 0 || fd >= NOFILE || (f=myproc()->ofile[fd]) == 0) 80105b03: 83 7d f4 0f cmpl $0xf,-0xc(%ebp) 80105b07: 77 27 ja 80105b30 <argfd.constprop.0+0x50> 80105b09: e8 b2 de ff ff call 801039c0 <myproc> 80105b0e: 8b 55 f4 mov -0xc(%ebp),%edx 80105b11: 8b 44 90 28 mov 0x28(%eax,%edx,4),%eax 80105b15: 85 c0 test %eax,%eax 80105b17: 74 17 je 80105b30 <argfd.constprop.0+0x50> if(pfd) 80105b19: 85 db test %ebx,%ebx 80105b1b: 74 02 je 80105b1f <argfd.constprop.0+0x3f> *pfd = fd; 80105b1d: 89 13 mov %edx,(%ebx) *pf = f; 80105b1f: 89 06 mov %eax,(%esi) return 0; 80105b21: 31 c0 xor %eax,%eax } 80105b23: 83 c4 20 add $0x20,%esp 80105b26: 5b pop %ebx 80105b27: 5e pop %esi 80105b28: 5d pop %ebp 80105b29: c3 ret 80105b2a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi return -1; 80105b30: b8 ff ff ff ff mov $0xffffffff,%eax 80105b35: eb ec jmp 80105b23 <argfd.constprop.0+0x43> 80105b37: 89 f6 mov %esi,%esi 80105b39: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105b40 <sys_dup>: { 80105b40: 55 push %ebp if(argfd(0, 0, &f) < 0) 80105b41: 31 c0 xor %eax,%eax { 80105b43: 89 e5 mov %esp,%ebp 80105b45: 56 push %esi 80105b46: 53 push %ebx 80105b47: 83 ec 20 sub $0x20,%esp if(argfd(0, 0, &f) < 0) 80105b4a: 8d 55 f4 lea -0xc(%ebp),%edx 80105b4d: e8 8e ff ff ff call 80105ae0 <argfd.constprop.0> 80105b52: 85 c0 test %eax,%eax 80105b54: 78 3a js 80105b90 <sys_dup+0x50> if((fd=fdalloc(f)) < 0) 80105b56: 8b 75 f4 mov -0xc(%ebp),%esi for(fd = 0; fd < NOFILE; fd++){ 80105b59: 31 db xor %ebx,%ebx struct proc *curproc = myproc(); 80105b5b: e8 60 de ff ff call 801039c0 <myproc> 80105b60: eb 0c jmp 80105b6e <sys_dup+0x2e> 80105b62: 8d b6 00 00 00 00 lea 0x0(%esi),%esi for(fd = 0; fd < NOFILE; fd++){ 80105b68: 43 inc %ebx 80105b69: 83 fb 10 cmp $0x10,%ebx 80105b6c: 74 22 je 80105b90 <sys_dup+0x50> if(curproc->ofile[fd] == 0){ 80105b6e: 8b 54 98 28 mov 0x28(%eax,%ebx,4),%edx 80105b72: 85 d2 test %edx,%edx 80105b74: 75 f2 jne 80105b68 <sys_dup+0x28> curproc->ofile[fd] = f; 80105b76: 89 74 98 28 mov %esi,0x28(%eax,%ebx,4) filedup(f); 80105b7a: 8b 45 f4 mov -0xc(%ebp),%eax 80105b7d: 89 04 24 mov %eax,(%esp) 80105b80: e8 5b b2 ff ff call 80100de0 <filedup> } 80105b85: 83 c4 20 add $0x20,%esp 80105b88: 89 d8 mov %ebx,%eax 80105b8a: 5b pop %ebx 80105b8b: 5e pop %esi 80105b8c: 5d pop %ebp 80105b8d: c3 ret 80105b8e: 66 90 xchg %ax,%ax 80105b90: 83 c4 20 add $0x20,%esp return -1; 80105b93: bb ff ff ff ff mov $0xffffffff,%ebx } 80105b98: 89 d8 mov %ebx,%eax 80105b9a: 5b pop %ebx 80105b9b: 5e pop %esi 80105b9c: 5d pop %ebp 80105b9d: c3 ret 80105b9e: 66 90 xchg %ax,%ax 80105ba0 <sys_read>: { 80105ba0: 55 push %ebp if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) 80105ba1: 31 c0 xor %eax,%eax { 80105ba3: 89 e5 mov %esp,%ebp 80105ba5: 83 ec 28 sub $0x28,%esp if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) 80105ba8: 8d 55 ec lea -0x14(%ebp),%edx 80105bab: e8 30 ff ff ff call 80105ae0 <argfd.constprop.0> 80105bb0: 85 c0 test %eax,%eax 80105bb2: 78 54 js 80105c08 <sys_read+0x68> 80105bb4: 8d 45 f0 lea -0x10(%ebp),%eax 80105bb7: 89 44 24 04 mov %eax,0x4(%esp) 80105bbb: c7 04 24 02 00 00 00 movl $0x2,(%esp) 80105bc2: e8 09 fc ff ff call 801057d0 <argint> 80105bc7: 85 c0 test %eax,%eax 80105bc9: 78 3d js 80105c08 <sys_read+0x68> 80105bcb: 8b 45 f0 mov -0x10(%ebp),%eax 80105bce: c7 04 24 01 00 00 00 movl $0x1,(%esp) 80105bd5: 89 44 24 08 mov %eax,0x8(%esp) 80105bd9: 8d 45 f4 lea -0xc(%ebp),%eax 80105bdc: 89 44 24 04 mov %eax,0x4(%esp) 80105be0: e8 3b fc ff ff call 80105820 <argptr> 80105be5: 85 c0 test %eax,%eax 80105be7: 78 1f js 80105c08 <sys_read+0x68> return fileread(f, p, n); 80105be9: 8b 45 f0 mov -0x10(%ebp),%eax 80105bec: 89 44 24 08 mov %eax,0x8(%esp) 80105bf0: 8b 45 f4 mov -0xc(%ebp),%eax 80105bf3: 89 44 24 04 mov %eax,0x4(%esp) 80105bf7: 8b 45 ec mov -0x14(%ebp),%eax 80105bfa: 89 04 24 mov %eax,(%esp) 80105bfd: e8 5e b3 ff ff call 80100f60 <fileread> } 80105c02: c9 leave 80105c03: c3 ret 80105c04: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80105c08: b8 ff ff ff ff mov $0xffffffff,%eax } 80105c0d: c9 leave 80105c0e: c3 ret 80105c0f: 90 nop 80105c10 <sys_write>: { 80105c10: 55 push %ebp if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) 80105c11: 31 c0 xor %eax,%eax { 80105c13: 89 e5 mov %esp,%ebp 80105c15: 83 ec 28 sub $0x28,%esp if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) 80105c18: 8d 55 ec lea -0x14(%ebp),%edx 80105c1b: e8 c0 fe ff ff call 80105ae0 <argfd.constprop.0> 80105c20: 85 c0 test %eax,%eax 80105c22: 78 54 js 80105c78 <sys_write+0x68> 80105c24: 8d 45 f0 lea -0x10(%ebp),%eax 80105c27: 89 44 24 04 mov %eax,0x4(%esp) 80105c2b: c7 04 24 02 00 00 00 movl $0x2,(%esp) 80105c32: e8 99 fb ff ff call 801057d0 <argint> 80105c37: 85 c0 test %eax,%eax 80105c39: 78 3d js 80105c78 <sys_write+0x68> 80105c3b: 8b 45 f0 mov -0x10(%ebp),%eax 80105c3e: c7 04 24 01 00 00 00 movl $0x1,(%esp) 80105c45: 89 44 24 08 mov %eax,0x8(%esp) 80105c49: 8d 45 f4 lea -0xc(%ebp),%eax 80105c4c: 89 44 24 04 mov %eax,0x4(%esp) 80105c50: e8 cb fb ff ff call 80105820 <argptr> 80105c55: 85 c0 test %eax,%eax 80105c57: 78 1f js 80105c78 <sys_write+0x68> return filewrite(f, p, n); 80105c59: 8b 45 f0 mov -0x10(%ebp),%eax 80105c5c: 89 44 24 08 mov %eax,0x8(%esp) 80105c60: 8b 45 f4 mov -0xc(%ebp),%eax 80105c63: 89 44 24 04 mov %eax,0x4(%esp) 80105c67: 8b 45 ec mov -0x14(%ebp),%eax 80105c6a: 89 04 24 mov %eax,(%esp) 80105c6d: e8 9e b3 ff ff call 80101010 <filewrite> } 80105c72: c9 leave 80105c73: c3 ret 80105c74: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80105c78: b8 ff ff ff ff mov $0xffffffff,%eax } 80105c7d: c9 leave 80105c7e: c3 ret 80105c7f: 90 nop 80105c80 <sys_close>: { 80105c80: 55 push %ebp 80105c81: 89 e5 mov %esp,%ebp 80105c83: 83 ec 28 sub $0x28,%esp if(argfd(0, &fd, &f) < 0) 80105c86: 8d 55 f4 lea -0xc(%ebp),%edx 80105c89: 8d 45 f0 lea -0x10(%ebp),%eax 80105c8c: e8 4f fe ff ff call 80105ae0 <argfd.constprop.0> 80105c91: 85 c0 test %eax,%eax 80105c93: 78 23 js 80105cb8 <sys_close+0x38> myproc()->ofile[fd] = 0; 80105c95: e8 26 dd ff ff call 801039c0 <myproc> 80105c9a: 8b 55 f0 mov -0x10(%ebp),%edx 80105c9d: 31 c9 xor %ecx,%ecx 80105c9f: 89 4c 90 28 mov %ecx,0x28(%eax,%edx,4) fileclose(f); 80105ca3: 8b 45 f4 mov -0xc(%ebp),%eax 80105ca6: 89 04 24 mov %eax,(%esp) 80105ca9: e8 82 b1 ff ff call 80100e30 <fileclose> return 0; 80105cae: 31 c0 xor %eax,%eax } 80105cb0: c9 leave 80105cb1: c3 ret 80105cb2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi return -1; 80105cb8: b8 ff ff ff ff mov $0xffffffff,%eax } 80105cbd: c9 leave 80105cbe: c3 ret 80105cbf: 90 nop 80105cc0 <sys_fstat>: { 80105cc0: 55 push %ebp if(argfd(0, 0, &f) < 0 || argptr(1, (void*)&st, sizeof(*st)) < 0) 80105cc1: 31 c0 xor %eax,%eax { 80105cc3: 89 e5 mov %esp,%ebp 80105cc5: 83 ec 28 sub $0x28,%esp if(argfd(0, 0, &f) < 0 || argptr(1, (void*)&st, sizeof(*st)) < 0) 80105cc8: 8d 55 f0 lea -0x10(%ebp),%edx 80105ccb: e8 10 fe ff ff call 80105ae0 <argfd.constprop.0> 80105cd0: 85 c0 test %eax,%eax 80105cd2: 78 3c js 80105d10 <sys_fstat+0x50> 80105cd4: b8 14 00 00 00 mov $0x14,%eax 80105cd9: 89 44 24 08 mov %eax,0x8(%esp) 80105cdd: 8d 45 f4 lea -0xc(%ebp),%eax 80105ce0: 89 44 24 04 mov %eax,0x4(%esp) 80105ce4: c7 04 24 01 00 00 00 movl $0x1,(%esp) 80105ceb: e8 30 fb ff ff call 80105820 <argptr> 80105cf0: 85 c0 test %eax,%eax 80105cf2: 78 1c js 80105d10 <sys_fstat+0x50> return filestat(f, st); 80105cf4: 8b 45 f4 mov -0xc(%ebp),%eax 80105cf7: 89 44 24 04 mov %eax,0x4(%esp) 80105cfb: 8b 45 f0 mov -0x10(%ebp),%eax 80105cfe: 89 04 24 mov %eax,(%esp) 80105d01: e8 0a b2 ff ff call 80100f10 <filestat> } 80105d06: c9 leave 80105d07: c3 ret 80105d08: 90 nop 80105d09: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80105d10: b8 ff ff ff ff mov $0xffffffff,%eax } 80105d15: c9 leave 80105d16: c3 ret 80105d17: 89 f6 mov %esi,%esi 80105d19: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105d20 <sys_link>: { 80105d20: 55 push %ebp 80105d21: 89 e5 mov %esp,%ebp 80105d23: 57 push %edi 80105d24: 56 push %esi 80105d25: 53 push %ebx 80105d26: 83 ec 3c sub $0x3c,%esp if(argstr(0, &old) < 0 || argstr(1, &new) < 0) 80105d29: 8d 45 d4 lea -0x2c(%ebp),%eax 80105d2c: 89 44 24 04 mov %eax,0x4(%esp) 80105d30: c7 04 24 00 00 00 00 movl $0x0,(%esp) 80105d37: e8 44 fb ff ff call 80105880 <argstr> 80105d3c: 85 c0 test %eax,%eax 80105d3e: 0f 88 e5 00 00 00 js 80105e29 <sys_link+0x109> 80105d44: 8d 45 d0 lea -0x30(%ebp),%eax 80105d47: 89 44 24 04 mov %eax,0x4(%esp) 80105d4b: c7 04 24 01 00 00 00 movl $0x1,(%esp) 80105d52: e8 29 fb ff ff call 80105880 <argstr> 80105d57: 85 c0 test %eax,%eax 80105d59: 0f 88 ca 00 00 00 js 80105e29 <sys_link+0x109> begin_op(); 80105d5f: e8 2c cf ff ff call 80102c90 <begin_op> if((ip = namei(old)) == 0){ 80105d64: 8b 45 d4 mov -0x2c(%ebp),%eax 80105d67: 89 04 24 mov %eax,(%esp) 80105d6a: e8 61 c2 ff ff call 80101fd0 <namei> 80105d6f: 85 c0 test %eax,%eax 80105d71: 89 c3 mov %eax,%ebx 80105d73: 0f 84 ab 00 00 00 je 80105e24 <sys_link+0x104> ilock(ip); 80105d79: 89 04 24 mov %eax,(%esp) 80105d7c: e8 6f b9 ff ff call 801016f0 <ilock> if(ip->type == T_DIR){ 80105d81: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 80105d86: 0f 84 90 00 00 00 je 80105e1c <sys_link+0xfc> ip->nlink++; 80105d8c: 66 ff 43 56 incw 0x56(%ebx) if((dp = nameiparent(new, name)) == 0) 80105d90: 8d 7d da lea -0x26(%ebp),%edi iupdate(ip); 80105d93: 89 1c 24 mov %ebx,(%esp) 80105d96: e8 95 b8 ff ff call 80101630 <iupdate> iunlock(ip); 80105d9b: 89 1c 24 mov %ebx,(%esp) 80105d9e: e8 2d ba ff ff call 801017d0 <iunlock> if((dp = nameiparent(new, name)) == 0) 80105da3: 8b 45 d0 mov -0x30(%ebp),%eax 80105da6: 89 7c 24 04 mov %edi,0x4(%esp) 80105daa: 89 04 24 mov %eax,(%esp) 80105dad: e8 3e c2 ff ff call 80101ff0 <nameiparent> 80105db2: 85 c0 test %eax,%eax 80105db4: 89 c6 mov %eax,%esi 80105db6: 74 50 je 80105e08 <sys_link+0xe8> ilock(dp); 80105db8: 89 04 24 mov %eax,(%esp) 80105dbb: e8 30 b9 ff ff call 801016f0 <ilock> if(dp->dev != ip->dev || dirlink(dp, name, ip->inum) < 0){ 80105dc0: 8b 03 mov (%ebx),%eax 80105dc2: 39 06 cmp %eax,(%esi) 80105dc4: 75 3a jne 80105e00 <sys_link+0xe0> 80105dc6: 8b 43 04 mov 0x4(%ebx),%eax 80105dc9: 89 7c 24 04 mov %edi,0x4(%esp) 80105dcd: 89 34 24 mov %esi,(%esp) 80105dd0: 89 44 24 08 mov %eax,0x8(%esp) 80105dd4: e8 17 c1 ff ff call 80101ef0 <dirlink> 80105dd9: 85 c0 test %eax,%eax 80105ddb: 78 23 js 80105e00 <sys_link+0xe0> iunlockput(dp); 80105ddd: 89 34 24 mov %esi,(%esp) 80105de0: e8 9b bb ff ff call 80101980 <iunlockput> iput(ip); 80105de5: 89 1c 24 mov %ebx,(%esp) 80105de8: e8 33 ba ff ff call 80101820 <iput> end_op(); 80105ded: e8 0e cf ff ff call 80102d00 <end_op> } 80105df2: 83 c4 3c add $0x3c,%esp return 0; 80105df5: 31 c0 xor %eax,%eax } 80105df7: 5b pop %ebx 80105df8: 5e pop %esi 80105df9: 5f pop %edi 80105dfa: 5d pop %ebp 80105dfb: c3 ret 80105dfc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi iunlockput(dp); 80105e00: 89 34 24 mov %esi,(%esp) 80105e03: e8 78 bb ff ff call 80101980 <iunlockput> ilock(ip); 80105e08: 89 1c 24 mov %ebx,(%esp) 80105e0b: e8 e0 b8 ff ff call 801016f0 <ilock> ip->nlink--; 80105e10: 66 ff 4b 56 decw 0x56(%ebx) iupdate(ip); 80105e14: 89 1c 24 mov %ebx,(%esp) 80105e17: e8 14 b8 ff ff call 80101630 <iupdate> iunlockput(ip); 80105e1c: 89 1c 24 mov %ebx,(%esp) 80105e1f: e8 5c bb ff ff call 80101980 <iunlockput> end_op(); 80105e24: e8 d7 ce ff ff call 80102d00 <end_op> } 80105e29: 83 c4 3c add $0x3c,%esp return -1; 80105e2c: b8 ff ff ff ff mov $0xffffffff,%eax } 80105e31: 5b pop %ebx 80105e32: 5e pop %esi 80105e33: 5f pop %edi 80105e34: 5d pop %ebp 80105e35: c3 ret 80105e36: 8d 76 00 lea 0x0(%esi),%esi 80105e39: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105e40 <sys_unlink>: { 80105e40: 55 push %ebp 80105e41: 89 e5 mov %esp,%ebp 80105e43: 57 push %edi 80105e44: 56 push %esi 80105e45: 53 push %ebx 80105e46: 83 ec 5c sub $0x5c,%esp if(argstr(0, &path) < 0) 80105e49: 8d 45 c0 lea -0x40(%ebp),%eax 80105e4c: 89 44 24 04 mov %eax,0x4(%esp) 80105e50: c7 04 24 00 00 00 00 movl $0x0,(%esp) 80105e57: e8 24 fa ff ff call 80105880 <argstr> 80105e5c: 85 c0 test %eax,%eax 80105e5e: 0f 88 68 01 00 00 js 80105fcc <sys_unlink+0x18c> begin_op(); 80105e64: e8 27 ce ff ff call 80102c90 <begin_op> if((dp = nameiparent(path, name)) == 0){ 80105e69: 8b 45 c0 mov -0x40(%ebp),%eax 80105e6c: 8d 5d ca lea -0x36(%ebp),%ebx 80105e6f: 89 5c 24 04 mov %ebx,0x4(%esp) 80105e73: 89 04 24 mov %eax,(%esp) 80105e76: e8 75 c1 ff ff call 80101ff0 <nameiparent> 80105e7b: 85 c0 test %eax,%eax 80105e7d: 89 c6 mov %eax,%esi 80105e7f: 0f 84 42 01 00 00 je 80105fc7 <sys_unlink+0x187> ilock(dp); 80105e85: 89 04 24 mov %eax,(%esp) 80105e88: e8 63 b8 ff ff call 801016f0 <ilock> if(namecmp(name, ".") == 0 || namecmp(name, "..") == 0) 80105e8d: b8 bc 87 10 80 mov $0x801087bc,%eax 80105e92: 89 44 24 04 mov %eax,0x4(%esp) 80105e96: 89 1c 24 mov %ebx,(%esp) 80105e99: e8 a2 bd ff ff call 80101c40 <namecmp> 80105e9e: 85 c0 test %eax,%eax 80105ea0: 0f 84 19 01 00 00 je 80105fbf <sys_unlink+0x17f> 80105ea6: b8 bb 87 10 80 mov $0x801087bb,%eax 80105eab: 89 44 24 04 mov %eax,0x4(%esp) 80105eaf: 89 1c 24 mov %ebx,(%esp) 80105eb2: e8 89 bd ff ff call 80101c40 <namecmp> 80105eb7: 85 c0 test %eax,%eax 80105eb9: 0f 84 00 01 00 00 je 80105fbf <sys_unlink+0x17f> if((ip = dirlookup(dp, name, &off)) == 0) 80105ebf: 8d 45 c4 lea -0x3c(%ebp),%eax 80105ec2: 89 5c 24 04 mov %ebx,0x4(%esp) 80105ec6: 89 44 24 08 mov %eax,0x8(%esp) 80105eca: 89 34 24 mov %esi,(%esp) 80105ecd: e8 9e bd ff ff call 80101c70 <dirlookup> 80105ed2: 85 c0 test %eax,%eax 80105ed4: 89 c3 mov %eax,%ebx 80105ed6: 0f 84 e3 00 00 00 je 80105fbf <sys_unlink+0x17f> ilock(ip); 80105edc: 89 04 24 mov %eax,(%esp) 80105edf: e8 0c b8 ff ff call 801016f0 <ilock> if(ip->nlink < 1) 80105ee4: 66 83 7b 56 00 cmpw $0x0,0x56(%ebx) 80105ee9: 0f 8e 0e 01 00 00 jle 80105ffd <sys_unlink+0x1bd> if(ip->type == T_DIR && !isdirempty(ip)){ 80105eef: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 80105ef4: 8d 7d d8 lea -0x28(%ebp),%edi 80105ef7: 74 77 je 80105f70 <sys_unlink+0x130> memset(&de, 0, sizeof(de)); 80105ef9: 31 d2 xor %edx,%edx 80105efb: b8 10 00 00 00 mov $0x10,%eax 80105f00: 89 54 24 04 mov %edx,0x4(%esp) 80105f04: 89 44 24 08 mov %eax,0x8(%esp) 80105f08: 89 3c 24 mov %edi,(%esp) 80105f0b: e8 d0 f5 ff ff call 801054e0 <memset> if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80105f10: 8b 45 c4 mov -0x3c(%ebp),%eax 80105f13: b9 10 00 00 00 mov $0x10,%ecx 80105f18: 89 4c 24 0c mov %ecx,0xc(%esp) 80105f1c: 89 7c 24 04 mov %edi,0x4(%esp) 80105f20: 89 34 24 mov %esi,(%esp) 80105f23: 89 44 24 08 mov %eax,0x8(%esp) 80105f27: e8 c4 bb ff ff call 80101af0 <writei> 80105f2c: 83 f8 10 cmp $0x10,%eax 80105f2f: 0f 85 d4 00 00 00 jne 80106009 <sys_unlink+0x1c9> if(ip->type == T_DIR){ 80105f35: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 80105f3a: 0f 84 a0 00 00 00 je 80105fe0 <sys_unlink+0x1a0> iunlockput(dp); 80105f40: 89 34 24 mov %esi,(%esp) 80105f43: e8 38 ba ff ff call 80101980 <iunlockput> ip->nlink--; 80105f48: 66 ff 4b 56 decw 0x56(%ebx) iupdate(ip); 80105f4c: 89 1c 24 mov %ebx,(%esp) 80105f4f: e8 dc b6 ff ff call 80101630 <iupdate> iunlockput(ip); 80105f54: 89 1c 24 mov %ebx,(%esp) 80105f57: e8 24 ba ff ff call 80101980 <iunlockput> end_op(); 80105f5c: e8 9f cd ff ff call 80102d00 <end_op> } 80105f61: 83 c4 5c add $0x5c,%esp return 0; 80105f64: 31 c0 xor %eax,%eax } 80105f66: 5b pop %ebx 80105f67: 5e pop %esi 80105f68: 5f pop %edi 80105f69: 5d pop %ebp 80105f6a: c3 ret 80105f6b: 90 nop 80105f6c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi for(off=2*sizeof(de); off<dp->size; off+=sizeof(de)){ 80105f70: 83 7b 58 20 cmpl $0x20,0x58(%ebx) 80105f74: 76 83 jbe 80105ef9 <sys_unlink+0xb9> 80105f76: ba 20 00 00 00 mov $0x20,%edx 80105f7b: eb 0f jmp 80105f8c <sys_unlink+0x14c> 80105f7d: 8d 76 00 lea 0x0(%esi),%esi 80105f80: 83 c2 10 add $0x10,%edx 80105f83: 3b 53 58 cmp 0x58(%ebx),%edx 80105f86: 0f 83 6d ff ff ff jae 80105ef9 <sys_unlink+0xb9> if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) 80105f8c: b8 10 00 00 00 mov $0x10,%eax 80105f91: 89 54 24 08 mov %edx,0x8(%esp) 80105f95: 89 44 24 0c mov %eax,0xc(%esp) 80105f99: 89 7c 24 04 mov %edi,0x4(%esp) 80105f9d: 89 1c 24 mov %ebx,(%esp) 80105fa0: 89 55 b4 mov %edx,-0x4c(%ebp) 80105fa3: e8 28 ba ff ff call 801019d0 <readi> 80105fa8: 8b 55 b4 mov -0x4c(%ebp),%edx 80105fab: 83 f8 10 cmp $0x10,%eax 80105fae: 75 41 jne 80105ff1 <sys_unlink+0x1b1> if(de.inum != 0) 80105fb0: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp) 80105fb5: 74 c9 je 80105f80 <sys_unlink+0x140> iunlockput(ip); 80105fb7: 89 1c 24 mov %ebx,(%esp) 80105fba: e8 c1 b9 ff ff call 80101980 <iunlockput> iunlockput(dp); 80105fbf: 89 34 24 mov %esi,(%esp) 80105fc2: e8 b9 b9 ff ff call 80101980 <iunlockput> end_op(); 80105fc7: e8 34 cd ff ff call 80102d00 <end_op> } 80105fcc: 83 c4 5c add $0x5c,%esp return -1; 80105fcf: b8 ff ff ff ff mov $0xffffffff,%eax } 80105fd4: 5b pop %ebx 80105fd5: 5e pop %esi 80105fd6: 5f pop %edi 80105fd7: 5d pop %ebp 80105fd8: c3 ret 80105fd9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi dp->nlink--; 80105fe0: 66 ff 4e 56 decw 0x56(%esi) iupdate(dp); 80105fe4: 89 34 24 mov %esi,(%esp) 80105fe7: e8 44 b6 ff ff call 80101630 <iupdate> 80105fec: e9 4f ff ff ff jmp 80105f40 <sys_unlink+0x100> panic("isdirempty: readi"); 80105ff1: c7 04 24 e0 87 10 80 movl $0x801087e0,(%esp) 80105ff8: e8 73 a3 ff ff call 80100370 <panic> panic("unlink: nlink < 1"); 80105ffd: c7 04 24 ce 87 10 80 movl $0x801087ce,(%esp) 80106004: e8 67 a3 ff ff call 80100370 <panic> panic("unlink: writei"); 80106009: c7 04 24 f2 87 10 80 movl $0x801087f2,(%esp) 80106010: e8 5b a3 ff ff call 80100370 <panic> 80106015: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80106019: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106020 <sys_open>: int sys_open(void) { 80106020: 55 push %ebp 80106021: 89 e5 mov %esp,%ebp 80106023: 57 push %edi 80106024: 56 push %esi 80106025: 53 push %ebx 80106026: 83 ec 2c sub $0x2c,%esp char *path; int fd, omode; struct file *f; struct inode *ip; if(argstr(0, &path) < 0 || argint(1, &omode) < 0) 80106029: 8d 45 e0 lea -0x20(%ebp),%eax 8010602c: 89 44 24 04 mov %eax,0x4(%esp) 80106030: c7 04 24 00 00 00 00 movl $0x0,(%esp) 80106037: e8 44 f8 ff ff call 80105880 <argstr> 8010603c: 85 c0 test %eax,%eax 8010603e: 0f 88 e9 00 00 00 js 8010612d <sys_open+0x10d> 80106044: 8d 45 e4 lea -0x1c(%ebp),%eax 80106047: 89 44 24 04 mov %eax,0x4(%esp) 8010604b: c7 04 24 01 00 00 00 movl $0x1,(%esp) 80106052: e8 79 f7 ff ff call 801057d0 <argint> 80106057: 85 c0 test %eax,%eax 80106059: 0f 88 ce 00 00 00 js 8010612d <sys_open+0x10d> return -1; begin_op(); 8010605f: e8 2c cc ff ff call 80102c90 <begin_op> if(omode & O_CREATE){ 80106064: f6 45 e5 02 testb $0x2,-0x1b(%ebp) 80106068: 0f 85 9a 00 00 00 jne 80106108 <sys_open+0xe8> if(ip == 0){ end_op(); return -1; } } else { if((ip = namei(path)) == 0){ 8010606e: 8b 45 e0 mov -0x20(%ebp),%eax 80106071: 89 04 24 mov %eax,(%esp) 80106074: e8 57 bf ff ff call 80101fd0 <namei> 80106079: 85 c0 test %eax,%eax 8010607b: 89 c6 mov %eax,%esi 8010607d: 0f 84 a5 00 00 00 je 80106128 <sys_open+0x108> end_op(); return -1; } ilock(ip); 80106083: 89 04 24 mov %eax,(%esp) 80106086: e8 65 b6 ff ff call 801016f0 <ilock> if(ip->type == T_DIR && omode != O_RDONLY){ 8010608b: 66 83 7e 50 01 cmpw $0x1,0x50(%esi) 80106090: 0f 84 a2 00 00 00 je 80106138 <sys_open+0x118> end_op(); return -1; } } if((f = filealloc()) == 0 || (fd = fdalloc(f)) < 0){ 80106096: e8 d5 ac ff ff call 80100d70 <filealloc> 8010609b: 85 c0 test %eax,%eax 8010609d: 89 c7 mov %eax,%edi 8010609f: 0f 84 9e 00 00 00 je 80106143 <sys_open+0x123> struct proc *curproc = myproc(); 801060a5: e8 16 d9 ff ff call 801039c0 <myproc> for(fd = 0; fd < NOFILE; fd++){ 801060aa: 31 db xor %ebx,%ebx 801060ac: eb 0c jmp 801060ba <sys_open+0x9a> 801060ae: 66 90 xchg %ax,%ax 801060b0: 43 inc %ebx 801060b1: 83 fb 10 cmp $0x10,%ebx 801060b4: 0f 84 96 00 00 00 je 80106150 <sys_open+0x130> if(curproc->ofile[fd] == 0){ 801060ba: 8b 54 98 28 mov 0x28(%eax,%ebx,4),%edx 801060be: 85 d2 test %edx,%edx 801060c0: 75 ee jne 801060b0 <sys_open+0x90> curproc->ofile[fd] = f; 801060c2: 89 7c 98 28 mov %edi,0x28(%eax,%ebx,4) fileclose(f); iunlockput(ip); end_op(); return -1; } iunlock(ip); 801060c6: 89 34 24 mov %esi,(%esp) 801060c9: e8 02 b7 ff ff call 801017d0 <iunlock> end_op(); 801060ce: e8 2d cc ff ff call 80102d00 <end_op> f->type = FD_INODE; 801060d3: c7 07 02 00 00 00 movl $0x2,(%edi) f->ip = ip; f->off = 0; f->readable = !(omode & O_WRONLY); 801060d9: 8b 55 e4 mov -0x1c(%ebp),%edx f->ip = ip; 801060dc: 89 77 10 mov %esi,0x10(%edi) f->off = 0; 801060df: c7 47 14 00 00 00 00 movl $0x0,0x14(%edi) f->readable = !(omode & O_WRONLY); 801060e6: 89 d0 mov %edx,%eax 801060e8: f7 d0 not %eax 801060ea: 83 e0 01 and $0x1,%eax f->writable = (omode & O_WRONLY) || (omode & O_RDWR); 801060ed: f6 c2 03 test $0x3,%dl f->readable = !(omode & O_WRONLY); 801060f0: 88 47 08 mov %al,0x8(%edi) f->writable = (omode & O_WRONLY) || (omode & O_RDWR); 801060f3: 0f 95 47 09 setne 0x9(%edi) return fd; } 801060f7: 83 c4 2c add $0x2c,%esp 801060fa: 89 d8 mov %ebx,%eax 801060fc: 5b pop %ebx 801060fd: 5e pop %esi 801060fe: 5f pop %edi 801060ff: 5d pop %ebp 80106100: c3 ret 80106101: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi ip = create(path, T_FILE, 0, 0); 80106108: 8b 45 e0 mov -0x20(%ebp),%eax 8010610b: 31 c9 xor %ecx,%ecx 8010610d: ba 02 00 00 00 mov $0x2,%edx 80106112: c7 04 24 00 00 00 00 movl $0x0,(%esp) 80106119: e8 12 f8 ff ff call 80105930 <create> if(ip == 0){ 8010611e: 85 c0 test %eax,%eax ip = create(path, T_FILE, 0, 0); 80106120: 89 c6 mov %eax,%esi if(ip == 0){ 80106122: 0f 85 6e ff ff ff jne 80106096 <sys_open+0x76> end_op(); 80106128: e8 d3 cb ff ff call 80102d00 <end_op> return -1; 8010612d: bb ff ff ff ff mov $0xffffffff,%ebx 80106132: eb c3 jmp 801060f7 <sys_open+0xd7> 80106134: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(ip->type == T_DIR && omode != O_RDONLY){ 80106138: 8b 4d e4 mov -0x1c(%ebp),%ecx 8010613b: 85 c9 test %ecx,%ecx 8010613d: 0f 84 53 ff ff ff je 80106096 <sys_open+0x76> iunlockput(ip); 80106143: 89 34 24 mov %esi,(%esp) 80106146: e8 35 b8 ff ff call 80101980 <iunlockput> 8010614b: eb db jmp 80106128 <sys_open+0x108> 8010614d: 8d 76 00 lea 0x0(%esi),%esi fileclose(f); 80106150: 89 3c 24 mov %edi,(%esp) 80106153: e8 d8 ac ff ff call 80100e30 <fileclose> 80106158: eb e9 jmp 80106143 <sys_open+0x123> 8010615a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106160 <sys_mkdir>: int sys_mkdir(void) { 80106160: 55 push %ebp 80106161: 89 e5 mov %esp,%ebp 80106163: 83 ec 28 sub $0x28,%esp char *path; struct inode *ip; begin_op(); 80106166: e8 25 cb ff ff call 80102c90 <begin_op> if(argstr(0, &path) < 0 || (ip = create(path, T_DIR, 0, 0)) == 0){ 8010616b: 8d 45 f4 lea -0xc(%ebp),%eax 8010616e: 89 44 24 04 mov %eax,0x4(%esp) 80106172: c7 04 24 00 00 00 00 movl $0x0,(%esp) 80106179: e8 02 f7 ff ff call 80105880 <argstr> 8010617e: 85 c0 test %eax,%eax 80106180: 78 2e js 801061b0 <sys_mkdir+0x50> 80106182: 8b 45 f4 mov -0xc(%ebp),%eax 80106185: 31 c9 xor %ecx,%ecx 80106187: ba 01 00 00 00 mov $0x1,%edx 8010618c: c7 04 24 00 00 00 00 movl $0x0,(%esp) 80106193: e8 98 f7 ff ff call 80105930 <create> 80106198: 85 c0 test %eax,%eax 8010619a: 74 14 je 801061b0 <sys_mkdir+0x50> end_op(); return -1; } iunlockput(ip); 8010619c: 89 04 24 mov %eax,(%esp) 8010619f: e8 dc b7 ff ff call 80101980 <iunlockput> end_op(); 801061a4: e8 57 cb ff ff call 80102d00 <end_op> return 0; 801061a9: 31 c0 xor %eax,%eax } 801061ab: c9 leave 801061ac: c3 ret 801061ad: 8d 76 00 lea 0x0(%esi),%esi end_op(); 801061b0: e8 4b cb ff ff call 80102d00 <end_op> return -1; 801061b5: b8 ff ff ff ff mov $0xffffffff,%eax } 801061ba: c9 leave 801061bb: c3 ret 801061bc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801061c0 <sys_mknod>: int sys_mknod(void) { 801061c0: 55 push %ebp 801061c1: 89 e5 mov %esp,%ebp 801061c3: 83 ec 28 sub $0x28,%esp struct inode *ip; char *path; int major, minor; begin_op(); 801061c6: e8 c5 ca ff ff call 80102c90 <begin_op> if((argstr(0, &path)) < 0 || 801061cb: 8d 45 ec lea -0x14(%ebp),%eax 801061ce: 89 44 24 04 mov %eax,0x4(%esp) 801061d2: c7 04 24 00 00 00 00 movl $0x0,(%esp) 801061d9: e8 a2 f6 ff ff call 80105880 <argstr> 801061de: 85 c0 test %eax,%eax 801061e0: 78 5e js 80106240 <sys_mknod+0x80> argint(1, &major) < 0 || 801061e2: 8d 45 f0 lea -0x10(%ebp),%eax 801061e5: 89 44 24 04 mov %eax,0x4(%esp) 801061e9: c7 04 24 01 00 00 00 movl $0x1,(%esp) 801061f0: e8 db f5 ff ff call 801057d0 <argint> if((argstr(0, &path)) < 0 || 801061f5: 85 c0 test %eax,%eax 801061f7: 78 47 js 80106240 <sys_mknod+0x80> argint(2, &minor) < 0 || 801061f9: 8d 45 f4 lea -0xc(%ebp),%eax 801061fc: 89 44 24 04 mov %eax,0x4(%esp) 80106200: c7 04 24 02 00 00 00 movl $0x2,(%esp) 80106207: e8 c4 f5 ff ff call 801057d0 <argint> argint(1, &major) < 0 || 8010620c: 85 c0 test %eax,%eax 8010620e: 78 30 js 80106240 <sys_mknod+0x80> (ip = create(path, T_DEV, major, minor)) == 0){ 80106210: 0f bf 45 f4 movswl -0xc(%ebp),%eax argint(2, &minor) < 0 || 80106214: ba 03 00 00 00 mov $0x3,%edx (ip = create(path, T_DEV, major, minor)) == 0){ 80106219: 0f bf 4d f0 movswl -0x10(%ebp),%ecx 8010621d: 89 04 24 mov %eax,(%esp) argint(2, &minor) < 0 || 80106220: 8b 45 ec mov -0x14(%ebp),%eax 80106223: e8 08 f7 ff ff call 80105930 <create> 80106228: 85 c0 test %eax,%eax 8010622a: 74 14 je 80106240 <sys_mknod+0x80> end_op(); return -1; } iunlockput(ip); 8010622c: 89 04 24 mov %eax,(%esp) 8010622f: e8 4c b7 ff ff call 80101980 <iunlockput> end_op(); 80106234: e8 c7 ca ff ff call 80102d00 <end_op> return 0; 80106239: 31 c0 xor %eax,%eax } 8010623b: c9 leave 8010623c: c3 ret 8010623d: 8d 76 00 lea 0x0(%esi),%esi end_op(); 80106240: e8 bb ca ff ff call 80102d00 <end_op> return -1; 80106245: b8 ff ff ff ff mov $0xffffffff,%eax } 8010624a: c9 leave 8010624b: c3 ret 8010624c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80106250 <sys_chdir>: int sys_chdir(void) { 80106250: 55 push %ebp 80106251: 89 e5 mov %esp,%ebp 80106253: 56 push %esi 80106254: 53 push %ebx 80106255: 83 ec 20 sub $0x20,%esp char *path; struct inode *ip; struct proc *curproc = myproc(); 80106258: e8 63 d7 ff ff call 801039c0 <myproc> 8010625d: 89 c6 mov %eax,%esi begin_op(); 8010625f: e8 2c ca ff ff call 80102c90 <begin_op> if(argstr(0, &path) < 0 || (ip = namei(path)) == 0){ 80106264: 8d 45 f4 lea -0xc(%ebp),%eax 80106267: 89 44 24 04 mov %eax,0x4(%esp) 8010626b: c7 04 24 00 00 00 00 movl $0x0,(%esp) 80106272: e8 09 f6 ff ff call 80105880 <argstr> 80106277: 85 c0 test %eax,%eax 80106279: 78 4a js 801062c5 <sys_chdir+0x75> 8010627b: 8b 45 f4 mov -0xc(%ebp),%eax 8010627e: 89 04 24 mov %eax,(%esp) 80106281: e8 4a bd ff ff call 80101fd0 <namei> 80106286: 85 c0 test %eax,%eax 80106288: 89 c3 mov %eax,%ebx 8010628a: 74 39 je 801062c5 <sys_chdir+0x75> end_op(); return -1; } ilock(ip); 8010628c: 89 04 24 mov %eax,(%esp) 8010628f: e8 5c b4 ff ff call 801016f0 <ilock> if(ip->type != T_DIR){ 80106294: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) iunlockput(ip); 80106299: 89 1c 24 mov %ebx,(%esp) if(ip->type != T_DIR){ 8010629c: 75 22 jne 801062c0 <sys_chdir+0x70> end_op(); return -1; } iunlock(ip); 8010629e: e8 2d b5 ff ff call 801017d0 <iunlock> iput(curproc->cwd); 801062a3: 8b 46 68 mov 0x68(%esi),%eax 801062a6: 89 04 24 mov %eax,(%esp) 801062a9: e8 72 b5 ff ff call 80101820 <iput> end_op(); 801062ae: e8 4d ca ff ff call 80102d00 <end_op> curproc->cwd = ip; return 0; 801062b3: 31 c0 xor %eax,%eax curproc->cwd = ip; 801062b5: 89 5e 68 mov %ebx,0x68(%esi) } 801062b8: 83 c4 20 add $0x20,%esp 801062bb: 5b pop %ebx 801062bc: 5e pop %esi 801062bd: 5d pop %ebp 801062be: c3 ret 801062bf: 90 nop iunlockput(ip); 801062c0: e8 bb b6 ff ff call 80101980 <iunlockput> end_op(); 801062c5: e8 36 ca ff ff call 80102d00 <end_op> return -1; 801062ca: b8 ff ff ff ff mov $0xffffffff,%eax 801062cf: eb e7 jmp 801062b8 <sys_chdir+0x68> 801062d1: eb 0d jmp 801062e0 <sys_exec> 801062d3: 90 nop 801062d4: 90 nop 801062d5: 90 nop 801062d6: 90 nop 801062d7: 90 nop 801062d8: 90 nop 801062d9: 90 nop 801062da: 90 nop 801062db: 90 nop 801062dc: 90 nop 801062dd: 90 nop 801062de: 90 nop 801062df: 90 nop 801062e0 <sys_exec>: int sys_exec(void) { 801062e0: 55 push %ebp 801062e1: 89 e5 mov %esp,%ebp 801062e3: 57 push %edi 801062e4: 56 push %esi 801062e5: 53 push %ebx 801062e6: 81 ec ac 00 00 00 sub $0xac,%esp char *path, *argv[MAXARG]; int i; uint uargv, uarg; if(argstr(0, &path) < 0 || argint(1, (int*)&uargv) < 0){ 801062ec: 8d 85 5c ff ff ff lea -0xa4(%ebp),%eax 801062f2: 89 44 24 04 mov %eax,0x4(%esp) 801062f6: c7 04 24 00 00 00 00 movl $0x0,(%esp) 801062fd: e8 7e f5 ff ff call 80105880 <argstr> 80106302: 85 c0 test %eax,%eax 80106304: 0f 88 8e 00 00 00 js 80106398 <sys_exec+0xb8> 8010630a: 8d 85 60 ff ff ff lea -0xa0(%ebp),%eax 80106310: 89 44 24 04 mov %eax,0x4(%esp) 80106314: c7 04 24 01 00 00 00 movl $0x1,(%esp) 8010631b: e8 b0 f4 ff ff call 801057d0 <argint> 80106320: 85 c0 test %eax,%eax 80106322: 78 74 js 80106398 <sys_exec+0xb8> return -1; } memset(argv, 0, sizeof(argv)); 80106324: ba 80 00 00 00 mov $0x80,%edx 80106329: 31 c9 xor %ecx,%ecx 8010632b: 8d 85 68 ff ff ff lea -0x98(%ebp),%eax for(i=0;; i++){ 80106331: 31 db xor %ebx,%ebx memset(argv, 0, sizeof(argv)); 80106333: 89 54 24 08 mov %edx,0x8(%esp) 80106337: 8d bd 64 ff ff ff lea -0x9c(%ebp),%edi 8010633d: 89 4c 24 04 mov %ecx,0x4(%esp) 80106341: 89 04 24 mov %eax,(%esp) 80106344: e8 97 f1 ff ff call 801054e0 <memset> 80106349: eb 2e jmp 80106379 <sys_exec+0x99> 8010634b: 90 nop 8010634c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(i >= NELEM(argv)) return -1; if(fetchint(uargv+4*i, (int*)&uarg) < 0) return -1; if(uarg == 0){ 80106350: 8b 85 64 ff ff ff mov -0x9c(%ebp),%eax 80106356: 85 c0 test %eax,%eax 80106358: 74 56 je 801063b0 <sys_exec+0xd0> argv[i] = 0; break; } if(fetchstr(uarg, &argv[i]) < 0) 8010635a: 8d 8d 68 ff ff ff lea -0x98(%ebp),%ecx 80106360: 8d 14 31 lea (%ecx,%esi,1),%edx 80106363: 89 54 24 04 mov %edx,0x4(%esp) 80106367: 89 04 24 mov %eax,(%esp) 8010636a: e8 01 f4 ff ff call 80105770 <fetchstr> 8010636f: 85 c0 test %eax,%eax 80106371: 78 25 js 80106398 <sys_exec+0xb8> for(i=0;; i++){ 80106373: 43 inc %ebx if(i >= NELEM(argv)) 80106374: 83 fb 20 cmp $0x20,%ebx 80106377: 74 1f je 80106398 <sys_exec+0xb8> if(fetchint(uargv+4*i, (int*)&uarg) < 0) 80106379: 8b 85 60 ff ff ff mov -0xa0(%ebp),%eax 8010637f: 8d 34 9d 00 00 00 00 lea 0x0(,%ebx,4),%esi 80106386: 89 7c 24 04 mov %edi,0x4(%esp) 8010638a: 01 f0 add %esi,%eax 8010638c: 89 04 24 mov %eax,(%esp) 8010638f: e8 9c f3 ff ff call 80105730 <fetchint> 80106394: 85 c0 test %eax,%eax 80106396: 79 b8 jns 80106350 <sys_exec+0x70> return -1; } return exec(path, argv); } 80106398: 81 c4 ac 00 00 00 add $0xac,%esp return -1; 8010639e: b8 ff ff ff ff mov $0xffffffff,%eax } 801063a3: 5b pop %ebx 801063a4: 5e pop %esi 801063a5: 5f pop %edi 801063a6: 5d pop %ebp 801063a7: c3 ret 801063a8: 90 nop 801063a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi argv[i] = 0; 801063b0: 31 c0 xor %eax,%eax 801063b2: 89 84 9d 68 ff ff ff mov %eax,-0x98(%ebp,%ebx,4) return exec(path, argv); 801063b9: 8d 85 68 ff ff ff lea -0x98(%ebp),%eax 801063bf: 89 44 24 04 mov %eax,0x4(%esp) 801063c3: 8b 85 5c ff ff ff mov -0xa4(%ebp),%eax 801063c9: 89 04 24 mov %eax,(%esp) 801063cc: e8 ff a5 ff ff call 801009d0 <exec> } 801063d1: 81 c4 ac 00 00 00 add $0xac,%esp 801063d7: 5b pop %ebx 801063d8: 5e pop %esi 801063d9: 5f pop %edi 801063da: 5d pop %ebp 801063db: c3 ret 801063dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801063e0 <sys_pipe>: int sys_pipe(void) { 801063e0: 55 push %ebp 801063e1: 89 e5 mov %esp,%ebp 801063e3: 57 push %edi int *fd; struct file *rf, *wf; int fd0, fd1; if(argptr(0, (void*)&fd, 2*sizeof(fd[0])) < 0) 801063e4: bf 08 00 00 00 mov $0x8,%edi { 801063e9: 56 push %esi 801063ea: 53 push %ebx 801063eb: 83 ec 2c sub $0x2c,%esp if(argptr(0, (void*)&fd, 2*sizeof(fd[0])) < 0) 801063ee: 8d 45 dc lea -0x24(%ebp),%eax 801063f1: 89 7c 24 08 mov %edi,0x8(%esp) 801063f5: 89 44 24 04 mov %eax,0x4(%esp) 801063f9: c7 04 24 00 00 00 00 movl $0x0,(%esp) 80106400: e8 1b f4 ff ff call 80105820 <argptr> 80106405: 85 c0 test %eax,%eax 80106407: 0f 88 a9 00 00 00 js 801064b6 <sys_pipe+0xd6> return -1; if(pipealloc(&rf, &wf) < 0) 8010640d: 8d 45 e4 lea -0x1c(%ebp),%eax 80106410: 89 44 24 04 mov %eax,0x4(%esp) 80106414: 8d 45 e0 lea -0x20(%ebp),%eax 80106417: 89 04 24 mov %eax,(%esp) 8010641a: e8 a1 cf ff ff call 801033c0 <pipealloc> 8010641f: 85 c0 test %eax,%eax 80106421: 0f 88 8f 00 00 00 js 801064b6 <sys_pipe+0xd6> return -1; fd0 = -1; if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){ 80106427: 8b 7d e0 mov -0x20(%ebp),%edi for(fd = 0; fd < NOFILE; fd++){ 8010642a: 31 db xor %ebx,%ebx struct proc *curproc = myproc(); 8010642c: e8 8f d5 ff ff call 801039c0 <myproc> 80106431: eb 0b jmp 8010643e <sys_pipe+0x5e> 80106433: 90 nop 80106434: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi for(fd = 0; fd < NOFILE; fd++){ 80106438: 43 inc %ebx 80106439: 83 fb 10 cmp $0x10,%ebx 8010643c: 74 62 je 801064a0 <sys_pipe+0xc0> if(curproc->ofile[fd] == 0){ 8010643e: 8b 74 98 28 mov 0x28(%eax,%ebx,4),%esi 80106442: 85 f6 test %esi,%esi 80106444: 75 f2 jne 80106438 <sys_pipe+0x58> curproc->ofile[fd] = f; 80106446: 8d 73 08 lea 0x8(%ebx),%esi 80106449: 89 7c b0 08 mov %edi,0x8(%eax,%esi,4) if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){ 8010644d: 8b 7d e4 mov -0x1c(%ebp),%edi struct proc *curproc = myproc(); 80106450: e8 6b d5 ff ff call 801039c0 <myproc> for(fd = 0; fd < NOFILE; fd++){ 80106455: 31 d2 xor %edx,%edx 80106457: eb 0d jmp 80106466 <sys_pipe+0x86> 80106459: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106460: 42 inc %edx 80106461: 83 fa 10 cmp $0x10,%edx 80106464: 74 2a je 80106490 <sys_pipe+0xb0> if(curproc->ofile[fd] == 0){ 80106466: 8b 4c 90 28 mov 0x28(%eax,%edx,4),%ecx 8010646a: 85 c9 test %ecx,%ecx 8010646c: 75 f2 jne 80106460 <sys_pipe+0x80> curproc->ofile[fd] = f; 8010646e: 89 7c 90 28 mov %edi,0x28(%eax,%edx,4) myproc()->ofile[fd0] = 0; fileclose(rf); fileclose(wf); return -1; } fd[0] = fd0; 80106472: 8b 45 dc mov -0x24(%ebp),%eax 80106475: 89 18 mov %ebx,(%eax) fd[1] = fd1; 80106477: 8b 45 dc mov -0x24(%ebp),%eax 8010647a: 89 50 04 mov %edx,0x4(%eax) return 0; 8010647d: 31 c0 xor %eax,%eax } 8010647f: 83 c4 2c add $0x2c,%esp 80106482: 5b pop %ebx 80106483: 5e pop %esi 80106484: 5f pop %edi 80106485: 5d pop %ebp 80106486: c3 ret 80106487: 89 f6 mov %esi,%esi 80106489: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi myproc()->ofile[fd0] = 0; 80106490: e8 2b d5 ff ff call 801039c0 <myproc> 80106495: 31 d2 xor %edx,%edx 80106497: 89 54 b0 08 mov %edx,0x8(%eax,%esi,4) 8010649b: 90 nop 8010649c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi fileclose(rf); 801064a0: 8b 45 e0 mov -0x20(%ebp),%eax 801064a3: 89 04 24 mov %eax,(%esp) 801064a6: e8 85 a9 ff ff call 80100e30 <fileclose> fileclose(wf); 801064ab: 8b 45 e4 mov -0x1c(%ebp),%eax 801064ae: 89 04 24 mov %eax,(%esp) 801064b1: e8 7a a9 ff ff call 80100e30 <fileclose> return -1; 801064b6: b8 ff ff ff ff mov $0xffffffff,%eax 801064bb: eb c2 jmp 8010647f <sys_pipe+0x9f> 801064bd: 66 90 xchg %ax,%ax 801064bf: 90 nop 801064c0 <sys_fork>: #include "mmu.h" #include "proc.h" int sys_fork(void) { 801064c0: 55 push %ebp 801064c1: 89 e5 mov %esp,%ebp return fork(); } 801064c3: 5d pop %ebp return fork(); 801064c4: e9 f7 d7 ff ff jmp 80103cc0 <fork> 801064c9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801064d0 <sys_exit>: int sys_exit(void) { 801064d0: 55 push %ebp 801064d1: 89 e5 mov %esp,%ebp 801064d3: 83 ec 28 sub $0x28,%esp int status; if(argint(0, &status) < 0) 801064d6: 8d 45 f4 lea -0xc(%ebp),%eax 801064d9: 89 44 24 04 mov %eax,0x4(%esp) 801064dd: c7 04 24 00 00 00 00 movl $0x0,(%esp) 801064e4: e8 e7 f2 ff ff call 801057d0 <argint> 801064e9: 85 c0 test %eax,%eax 801064eb: 78 13 js 80106500 <sys_exit+0x30> return -1; exit(status); 801064ed: 8b 45 f4 mov -0xc(%ebp),%eax 801064f0: 89 04 24 mov %eax,(%esp) 801064f3: e8 68 da ff ff call 80103f60 <exit> return 0; 801064f8: 31 c0 xor %eax,%eax } 801064fa: c9 leave 801064fb: c3 ret 801064fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80106500: b8 ff ff ff ff mov $0xffffffff,%eax } 80106505: c9 leave 80106506: c3 ret 80106507: 89 f6 mov %esi,%esi 80106509: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106510 <sys_wait>: int sys_wait(void) { 80106510: 55 push %ebp 80106511: 89 e5 mov %esp,%ebp 80106513: 83 ec 28 sub $0x28,%esp int status; if(argint(0, &status) < 0) 80106516: 8d 45 f4 lea -0xc(%ebp),%eax 80106519: 89 44 24 04 mov %eax,0x4(%esp) 8010651d: c7 04 24 00 00 00 00 movl $0x0,(%esp) 80106524: e8 a7 f2 ff ff call 801057d0 <argint> 80106529: 85 c0 test %eax,%eax 8010652b: 78 13 js 80106540 <sys_wait+0x30> return -1; wait((int*)status); 8010652d: 8b 45 f4 mov -0xc(%ebp),%eax 80106530: 89 04 24 mov %eax,(%esp) 80106533: e8 68 dc ff ff call 801041a0 <wait> return 0; 80106538: 31 c0 xor %eax,%eax } 8010653a: c9 leave 8010653b: c3 ret 8010653c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80106540: b8 ff ff ff ff mov $0xffffffff,%eax } 80106545: c9 leave 80106546: c3 ret 80106547: 89 f6 mov %esi,%esi 80106549: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106550 <sys_kill>: int sys_kill(void) { 80106550: 55 push %ebp 80106551: 89 e5 mov %esp,%ebp 80106553: 83 ec 28 sub $0x28,%esp int pid; if(argint(0, &pid) < 0) 80106556: 8d 45 f4 lea -0xc(%ebp),%eax 80106559: 89 44 24 04 mov %eax,0x4(%esp) 8010655d: c7 04 24 00 00 00 00 movl $0x0,(%esp) 80106564: e8 67 f2 ff ff call 801057d0 <argint> 80106569: 85 c0 test %eax,%eax 8010656b: 78 13 js 80106580 <sys_kill+0x30> return -1; return kill(pid); 8010656d: 8b 45 f4 mov -0xc(%ebp),%eax 80106570: 89 04 24 mov %eax,(%esp) 80106573: e8 68 dd ff ff call 801042e0 <kill> } 80106578: c9 leave 80106579: c3 ret 8010657a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi return -1; 80106580: b8 ff ff ff ff mov $0xffffffff,%eax } 80106585: c9 leave 80106586: c3 ret 80106587: 89 f6 mov %esi,%esi 80106589: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106590 <sys_getpid>: int sys_getpid(void) { 80106590: 55 push %ebp 80106591: 89 e5 mov %esp,%ebp 80106593: 83 ec 08 sub $0x8,%esp return myproc()->pid; 80106596: e8 25 d4 ff ff call 801039c0 <myproc> 8010659b: 8b 40 10 mov 0x10(%eax),%eax } 8010659e: c9 leave 8010659f: c3 ret 801065a0 <sys_sbrk>: int sys_sbrk(void) { 801065a0: 55 push %ebp 801065a1: 89 e5 mov %esp,%ebp 801065a3: 53 push %ebx 801065a4: 83 ec 24 sub $0x24,%esp int addr; int n; if(argint(0, &n) < 0) 801065a7: 8d 45 f4 lea -0xc(%ebp),%eax 801065aa: 89 44 24 04 mov %eax,0x4(%esp) 801065ae: c7 04 24 00 00 00 00 movl $0x0,(%esp) 801065b5: e8 16 f2 ff ff call 801057d0 <argint> 801065ba: 85 c0 test %eax,%eax 801065bc: 78 22 js 801065e0 <sys_sbrk+0x40> return -1; addr = myproc()->sz; 801065be: e8 fd d3 ff ff call 801039c0 <myproc> 801065c3: 8b 18 mov (%eax),%ebx if(growproc(n) < 0) 801065c5: 8b 45 f4 mov -0xc(%ebp),%eax 801065c8: 89 04 24 mov %eax,(%esp) 801065cb: e8 70 d6 ff ff call 80103c40 <growproc> 801065d0: 85 c0 test %eax,%eax 801065d2: 78 0c js 801065e0 <sys_sbrk+0x40> return -1; return addr; } 801065d4: 83 c4 24 add $0x24,%esp 801065d7: 89 d8 mov %ebx,%eax 801065d9: 5b pop %ebx 801065da: 5d pop %ebp 801065db: c3 ret 801065dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return -1; 801065e0: bb ff ff ff ff mov $0xffffffff,%ebx 801065e5: eb ed jmp 801065d4 <sys_sbrk+0x34> 801065e7: 89 f6 mov %esi,%esi 801065e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801065f0 <sys_sleep>: int sys_sleep(void) { 801065f0: 55 push %ebp 801065f1: 89 e5 mov %esp,%ebp 801065f3: 53 push %ebx 801065f4: 83 ec 24 sub $0x24,%esp int n; uint ticks0; if(argint(0, &n) < 0) 801065f7: 8d 45 f4 lea -0xc(%ebp),%eax 801065fa: 89 44 24 04 mov %eax,0x4(%esp) 801065fe: c7 04 24 00 00 00 00 movl $0x0,(%esp) 80106605: e8 c6 f1 ff ff call 801057d0 <argint> 8010660a: 85 c0 test %eax,%eax 8010660c: 78 7e js 8010668c <sys_sleep+0x9c> return -1; acquire(&tickslock); 8010660e: c7 04 24 c0 61 11 80 movl $0x801161c0,(%esp) 80106615: e8 d6 ed ff ff call 801053f0 <acquire> ticks0 = ticks; while(ticks - ticks0 < n){ 8010661a: 8b 4d f4 mov -0xc(%ebp),%ecx ticks0 = ticks; 8010661d: 8b 1d 00 6a 11 80 mov 0x80116a00,%ebx while(ticks - ticks0 < n){ 80106623: 85 c9 test %ecx,%ecx 80106625: 75 2a jne 80106651 <sys_sleep+0x61> 80106627: eb 4f jmp 80106678 <sys_sleep+0x88> 80106629: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if(myproc()->killed){ release(&tickslock); return -1; } sleep(&ticks, &tickslock); 80106630: b8 c0 61 11 80 mov $0x801161c0,%eax 80106635: 89 44 24 04 mov %eax,0x4(%esp) 80106639: c7 04 24 00 6a 11 80 movl $0x80116a00,(%esp) 80106640: e8 8b da ff ff call 801040d0 <sleep> while(ticks - ticks0 < n){ 80106645: a1 00 6a 11 80 mov 0x80116a00,%eax 8010664a: 29 d8 sub %ebx,%eax 8010664c: 3b 45 f4 cmp -0xc(%ebp),%eax 8010664f: 73 27 jae 80106678 <sys_sleep+0x88> if(myproc()->killed){ 80106651: e8 6a d3 ff ff call 801039c0 <myproc> 80106656: 8b 50 24 mov 0x24(%eax),%edx 80106659: 85 d2 test %edx,%edx 8010665b: 74 d3 je 80106630 <sys_sleep+0x40> release(&tickslock); 8010665d: c7 04 24 c0 61 11 80 movl $0x801161c0,(%esp) 80106664: e8 27 ee ff ff call 80105490 <release> } release(&tickslock); return 0; } 80106669: 83 c4 24 add $0x24,%esp return -1; 8010666c: b8 ff ff ff ff mov $0xffffffff,%eax } 80106671: 5b pop %ebx 80106672: 5d pop %ebp 80106673: c3 ret 80106674: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi release(&tickslock); 80106678: c7 04 24 c0 61 11 80 movl $0x801161c0,(%esp) 8010667f: e8 0c ee ff ff call 80105490 <release> return 0; 80106684: 31 c0 xor %eax,%eax } 80106686: 83 c4 24 add $0x24,%esp 80106689: 5b pop %ebx 8010668a: 5d pop %ebp 8010668b: c3 ret return -1; 8010668c: b8 ff ff ff ff mov $0xffffffff,%eax 80106691: eb f3 jmp 80106686 <sys_sleep+0x96> 80106693: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80106699: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801066a0 <sys_uptime>: // return how many clock tick interrupts have occurred // since start. int sys_uptime(void) { 801066a0: 55 push %ebp 801066a1: 89 e5 mov %esp,%ebp 801066a3: 53 push %ebx 801066a4: 83 ec 14 sub $0x14,%esp uint xticks; acquire(&tickslock); 801066a7: c7 04 24 c0 61 11 80 movl $0x801161c0,(%esp) 801066ae: e8 3d ed ff ff call 801053f0 <acquire> xticks = ticks; 801066b3: 8b 1d 00 6a 11 80 mov 0x80116a00,%ebx release(&tickslock); 801066b9: c7 04 24 c0 61 11 80 movl $0x801161c0,(%esp) 801066c0: e8 cb ed ff ff call 80105490 <release> return xticks; } 801066c5: 83 c4 14 add $0x14,%esp 801066c8: 89 d8 mov %ebx,%eax 801066ca: 5b pop %ebx 801066cb: 5d pop %ebp 801066cc: c3 ret 801066cd: 8d 76 00 lea 0x0(%esi),%esi 801066d0 <sys_detach>: int sys_detach(void) { 801066d0: 55 push %ebp 801066d1: 89 e5 mov %esp,%ebp 801066d3: 83 ec 28 sub $0x28,%esp int pid; if(argint(0, &pid) < 0) 801066d6: 8d 45 f4 lea -0xc(%ebp),%eax 801066d9: 89 44 24 04 mov %eax,0x4(%esp) 801066dd: c7 04 24 00 00 00 00 movl $0x0,(%esp) 801066e4: e8 e7 f0 ff ff call 801057d0 <argint> 801066e9: 85 c0 test %eax,%eax 801066eb: 78 13 js 80106700 <sys_detach+0x30> return -1; return detach(pid); 801066ed: 8b 45 f4 mov -0xc(%ebp),%eax 801066f0: 89 04 24 mov %eax,(%esp) 801066f3: e8 78 dd ff ff call 80104470 <detach> } 801066f8: c9 leave 801066f9: c3 ret 801066fa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi return -1; 80106700: b8 ff ff ff ff mov $0xffffffff,%eax } 80106705: c9 leave 80106706: c3 ret 80106707: 89 f6 mov %esi,%esi 80106709: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106710 <sys_priority>: 80106710: 55 push %ebp 80106711: 89 e5 mov %esp,%ebp 80106713: 5d pop %ebp 80106714: eb ba jmp 801066d0 <sys_detach> 80106716 <alltraps>: # vectors.S sends all traps here. .globl alltraps alltraps: # Build trap frame. pushl %ds 80106716: 1e push %ds pushl %es 80106717: 06 push %es pushl %fs 80106718: 0f a0 push %fs pushl %gs 8010671a: 0f a8 push %gs pushal 8010671c: 60 pusha # Set up data segments. movw $(SEG_KDATA<<3), %ax 8010671d: 66 b8 10 00 mov $0x10,%ax movw %ax, %ds 80106721: 8e d8 mov %eax,%ds movw %ax, %es 80106723: 8e c0 mov %eax,%es # Call trap(tf), where tf=%esp pushl %esp 80106725: 54 push %esp call trap 80106726: e8 c5 00 00 00 call 801067f0 <trap> addl $4, %esp 8010672b: 83 c4 04 add $0x4,%esp 8010672e <trapret>: # Return falls through to trapret... .globl trapret trapret: popal 8010672e: 61 popa popl %gs 8010672f: 0f a9 pop %gs popl %fs 80106731: 0f a1 pop %fs popl %es 80106733: 07 pop %es popl %ds 80106734: 1f pop %ds addl $0x8, %esp # trapno and errcode 80106735: 83 c4 08 add $0x8,%esp iret 80106738: cf iret 80106739: 66 90 xchg %ax,%ax 8010673b: 66 90 xchg %ax,%ax 8010673d: 66 90 xchg %ax,%ax 8010673f: 90 nop 80106740 <tvinit>: struct spinlock tickslock; uint ticks; void tvinit(void) { 80106740: 55 push %ebp int i; for(i = 0; i < 256; i++) 80106741: 31 c0 xor %eax,%eax { 80106743: 89 e5 mov %esp,%ebp 80106745: 83 ec 18 sub $0x18,%esp 80106748: 90 nop 80106749: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi SETGATE(idt[i], 0, SEG_KCODE<<3, vectors[i], 0); 80106750: 8b 14 85 0c b0 10 80 mov -0x7fef4ff4(,%eax,4),%edx 80106757: b9 08 00 00 8e mov $0x8e000008,%ecx 8010675c: 89 0c c5 02 62 11 80 mov %ecx,-0x7fee9dfe(,%eax,8) 80106763: 66 89 14 c5 00 62 11 mov %dx,-0x7fee9e00(,%eax,8) 8010676a: 80 8010676b: c1 ea 10 shr $0x10,%edx 8010676e: 66 89 14 c5 06 62 11 mov %dx,-0x7fee9dfa(,%eax,8) 80106775: 80 for(i = 0; i < 256; i++) 80106776: 40 inc %eax 80106777: 3d 00 01 00 00 cmp $0x100,%eax 8010677c: 75 d2 jne 80106750 <tvinit+0x10> SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER); 8010677e: a1 0c b1 10 80 mov 0x8010b10c,%eax initlock(&tickslock, "time"); 80106783: b9 01 88 10 80 mov $0x80108801,%ecx SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER); 80106788: ba 08 00 00 ef mov $0xef000008,%edx initlock(&tickslock, "time"); 8010678d: 89 4c 24 04 mov %ecx,0x4(%esp) 80106791: c7 04 24 c0 61 11 80 movl $0x801161c0,(%esp) SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER); 80106798: 89 15 02 64 11 80 mov %edx,0x80116402 8010679e: 66 a3 00 64 11 80 mov %ax,0x80116400 801067a4: c1 e8 10 shr $0x10,%eax 801067a7: 66 a3 06 64 11 80 mov %ax,0x80116406 initlock(&tickslock, "time"); 801067ad: e8 ee ea ff ff call 801052a0 <initlock> } 801067b2: c9 leave 801067b3: c3 ret 801067b4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801067ba: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 801067c0 <idtinit>: void idtinit(void) { 801067c0: 55 push %ebp pd[1] = (uint)p; 801067c1: b8 00 62 11 80 mov $0x80116200,%eax 801067c6: 89 e5 mov %esp,%ebp 801067c8: 0f b7 d0 movzwl %ax,%edx pd[2] = (uint)p >> 16; 801067cb: c1 e8 10 shr $0x10,%eax 801067ce: 83 ec 10 sub $0x10,%esp pd[0] = size-1; 801067d1: 66 c7 45 fa ff 07 movw $0x7ff,-0x6(%ebp) pd[1] = (uint)p; 801067d7: 66 89 55 fc mov %dx,-0x4(%ebp) pd[2] = (uint)p >> 16; 801067db: 66 89 45 fe mov %ax,-0x2(%ebp) asm volatile("lidt (%0)" : : "r" (pd)); 801067df: 8d 45 fa lea -0x6(%ebp),%eax 801067e2: 0f 01 18 lidtl (%eax) lidt(idt, sizeof(idt)); } 801067e5: c9 leave 801067e6: c3 ret 801067e7: 89 f6 mov %esi,%esi 801067e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801067f0 <trap>: //PAGEBREAK: 41 void trap(struct trapframe *tf) { 801067f0: 55 push %ebp 801067f1: 89 e5 mov %esp,%ebp 801067f3: 83 ec 48 sub $0x48,%esp 801067f6: 89 5d f4 mov %ebx,-0xc(%ebp) 801067f9: 8b 5d 08 mov 0x8(%ebp),%ebx 801067fc: 89 75 f8 mov %esi,-0x8(%ebp) 801067ff: 89 7d fc mov %edi,-0x4(%ebp) if(tf->trapno == T_SYSCALL){ 80106802: 8b 43 30 mov 0x30(%ebx),%eax 80106805: 83 f8 40 cmp $0x40,%eax 80106808: 0f 84 02 01 00 00 je 80106910 <trap+0x120> if(myproc()->killed) exit(0); return; } switch(tf->trapno){ 8010680e: 83 e8 20 sub $0x20,%eax 80106811: 83 f8 1f cmp $0x1f,%eax 80106814: 77 0a ja 80106820 <trap+0x30> 80106816: ff 24 85 a8 88 10 80 jmp *-0x7fef7758(,%eax,4) 8010681d: 8d 76 00 lea 0x0(%esi),%esi lapiceoi(); break; //PAGEBREAK: 13 default: if(myproc() == 0 || (tf->cs&3) == 0){ 80106820: e8 9b d1 ff ff call 801039c0 <myproc> 80106825: 8b 7b 38 mov 0x38(%ebx),%edi 80106828: 85 c0 test %eax,%eax 8010682a: 0f 84 5f 02 00 00 je 80106a8f <trap+0x29f> 80106830: f6 43 3c 03 testb $0x3,0x3c(%ebx) 80106834: 0f 84 55 02 00 00 je 80106a8f <trap+0x29f> static inline uint rcr2(void) { uint val; asm volatile("movl %%cr2,%0" : "=r" (val)); 8010683a: 0f 20 d1 mov %cr2,%ecx 8010683d: 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 " 80106840: e8 5b d1 ff ff call 801039a0 <cpuid> 80106845: 8b 73 30 mov 0x30(%ebx),%esi 80106848: 89 45 dc mov %eax,-0x24(%ebp) 8010684b: 8b 43 34 mov 0x34(%ebx),%eax 8010684e: 89 45 e4 mov %eax,-0x1c(%ebp) "eip 0x%x addr 0x%x--kill proc\n", myproc()->pid, myproc()->name, tf->trapno, 80106851: e8 6a d1 ff ff call 801039c0 <myproc> 80106856: 89 45 e0 mov %eax,-0x20(%ebp) 80106859: e8 62 d1 ff ff call 801039c0 <myproc> cprintf("pid %d %s: trap %d err %d on cpu %d " 8010685e: 8b 55 dc mov -0x24(%ebp),%edx 80106861: 89 74 24 0c mov %esi,0xc(%esp) myproc()->pid, myproc()->name, tf->trapno, 80106865: 8b 75 e0 mov -0x20(%ebp),%esi cprintf("pid %d %s: trap %d err %d on cpu %d " 80106868: 8b 4d d8 mov -0x28(%ebp),%ecx 8010686b: 89 7c 24 18 mov %edi,0x18(%esp) 8010686f: 89 54 24 14 mov %edx,0x14(%esp) 80106873: 8b 55 e4 mov -0x1c(%ebp),%edx myproc()->pid, myproc()->name, tf->trapno, 80106876: 83 c6 6c add $0x6c,%esi cprintf("pid %d %s: trap %d err %d on cpu %d " 80106879: 89 4c 24 1c mov %ecx,0x1c(%esp) myproc()->pid, myproc()->name, tf->trapno, 8010687d: 89 74 24 08 mov %esi,0x8(%esp) cprintf("pid %d %s: trap %d err %d on cpu %d " 80106881: 89 54 24 10 mov %edx,0x10(%esp) 80106885: 8b 40 10 mov 0x10(%eax),%eax 80106888: c7 04 24 64 88 10 80 movl $0x80108864,(%esp) 8010688f: 89 44 24 04 mov %eax,0x4(%esp) 80106893: e8 b8 9d ff ff call 80100650 <cprintf> tf->err, cpuid(), tf->eip, rcr2()); myproc()->killed = 1; 80106898: e8 23 d1 ff ff call 801039c0 <myproc> 8010689d: 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) 801068a4: e8 17 d1 ff ff call 801039c0 <myproc> 801068a9: 85 c0 test %eax,%eax 801068ab: 74 1b je 801068c8 <trap+0xd8> 801068ad: e8 0e d1 ff ff call 801039c0 <myproc> 801068b2: 8b 50 24 mov 0x24(%eax),%edx 801068b5: 85 d2 test %edx,%edx 801068b7: 74 0f je 801068c8 <trap+0xd8> 801068b9: 8b 43 3c mov 0x3c(%ebx),%eax 801068bc: 83 e0 03 and $0x3,%eax 801068bf: 83 f8 03 cmp $0x3,%eax 801068c2: 0f 84 80 01 00 00 je 80106a48 <trap+0x258> exit(0); // 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 && 801068c8: e8 f3 d0 ff ff call 801039c0 <myproc> 801068cd: 85 c0 test %eax,%eax 801068cf: 74 0d je 801068de <trap+0xee> 801068d1: e8 ea d0 ff ff call 801039c0 <myproc> 801068d6: 8b 40 0c mov 0xc(%eax),%eax 801068d9: 83 f8 04 cmp $0x4,%eax 801068dc: 74 7a je 80106958 <trap+0x168> 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) 801068de: e8 dd d0 ff ff call 801039c0 <myproc> 801068e3: 85 c0 test %eax,%eax 801068e5: 74 17 je 801068fe <trap+0x10e> 801068e7: e8 d4 d0 ff ff call 801039c0 <myproc> 801068ec: 8b 40 24 mov 0x24(%eax),%eax 801068ef: 85 c0 test %eax,%eax 801068f1: 74 0b je 801068fe <trap+0x10e> 801068f3: 8b 43 3c mov 0x3c(%ebx),%eax 801068f6: 83 e0 03 and $0x3,%eax 801068f9: 83 f8 03 cmp $0x3,%eax 801068fc: 74 3b je 80106939 <trap+0x149> exit(0); } 801068fe: 8b 5d f4 mov -0xc(%ebp),%ebx 80106901: 8b 75 f8 mov -0x8(%ebp),%esi 80106904: 8b 7d fc mov -0x4(%ebp),%edi 80106907: 89 ec mov %ebp,%esp 80106909: 5d pop %ebp 8010690a: c3 ret 8010690b: 90 nop 8010690c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(myproc()->killed) 80106910: e8 ab d0 ff ff call 801039c0 <myproc> 80106915: 8b 70 24 mov 0x24(%eax),%esi 80106918: 85 f6 test %esi,%esi 8010691a: 0f 85 10 01 00 00 jne 80106a30 <trap+0x240> myproc()->tf = tf; 80106920: e8 9b d0 ff ff call 801039c0 <myproc> 80106925: 89 58 18 mov %ebx,0x18(%eax) syscall(); 80106928: e8 93 ef ff ff call 801058c0 <syscall> if(myproc()->killed) 8010692d: e8 8e d0 ff ff call 801039c0 <myproc> 80106932: 8b 48 24 mov 0x24(%eax),%ecx 80106935: 85 c9 test %ecx,%ecx 80106937: 74 c5 je 801068fe <trap+0x10e> exit(0); 80106939: c7 45 08 00 00 00 00 movl $0x0,0x8(%ebp) } 80106940: 8b 5d f4 mov -0xc(%ebp),%ebx 80106943: 8b 75 f8 mov -0x8(%ebp),%esi 80106946: 8b 7d fc mov -0x4(%ebp),%edi 80106949: 89 ec mov %ebp,%esp 8010694b: 5d pop %ebp exit(0); 8010694c: e9 0f d6 ff ff jmp 80103f60 <exit> 80106951: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if(myproc() && myproc()->state == RUNNING && 80106958: 83 7b 30 20 cmpl $0x20,0x30(%ebx) 8010695c: 75 80 jne 801068de <trap+0xee> yield(); 8010695e: e8 fd d6 ff ff call 80104060 <yield> 80106963: e9 76 ff ff ff jmp 801068de <trap+0xee> 80106968: 90 nop 80106969: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if(cpuid() == 0){ 80106970: e8 2b d0 ff ff call 801039a0 <cpuid> 80106975: 85 c0 test %eax,%eax 80106977: 0f 84 e3 00 00 00 je 80106a60 <trap+0x270> 8010697d: 8d 76 00 lea 0x0(%esi),%esi lapiceoi(); 80106980: e8 cb be ff ff call 80102850 <lapiceoi> if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER) 80106985: e8 36 d0 ff ff call 801039c0 <myproc> 8010698a: 85 c0 test %eax,%eax 8010698c: 0f 85 1b ff ff ff jne 801068ad <trap+0xbd> 80106992: e9 31 ff ff ff jmp 801068c8 <trap+0xd8> 80106997: 89 f6 mov %esi,%esi 80106999: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi kbdintr(); 801069a0: e8 6b bd ff ff call 80102710 <kbdintr> lapiceoi(); 801069a5: e8 a6 be ff ff call 80102850 <lapiceoi> if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER) 801069aa: e8 11 d0 ff ff call 801039c0 <myproc> 801069af: 85 c0 test %eax,%eax 801069b1: 0f 85 f6 fe ff ff jne 801068ad <trap+0xbd> 801069b7: e9 0c ff ff ff jmp 801068c8 <trap+0xd8> 801069bc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi uartintr(); 801069c0: e8 6b 02 00 00 call 80106c30 <uartintr> lapiceoi(); 801069c5: e8 86 be ff ff call 80102850 <lapiceoi> if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER) 801069ca: e8 f1 cf ff ff call 801039c0 <myproc> 801069cf: 85 c0 test %eax,%eax 801069d1: 0f 85 d6 fe ff ff jne 801068ad <trap+0xbd> 801069d7: e9 ec fe ff ff jmp 801068c8 <trap+0xd8> 801069dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi cprintf("cpu%d: spurious interrupt at %x:%x\n", 801069e0: 8b 7b 38 mov 0x38(%ebx),%edi 801069e3: 0f b7 73 3c movzwl 0x3c(%ebx),%esi 801069e7: e8 b4 cf ff ff call 801039a0 <cpuid> 801069ec: c7 04 24 0c 88 10 80 movl $0x8010880c,(%esp) 801069f3: 89 7c 24 0c mov %edi,0xc(%esp) 801069f7: 89 74 24 08 mov %esi,0x8(%esp) 801069fb: 89 44 24 04 mov %eax,0x4(%esp) 801069ff: e8 4c 9c ff ff call 80100650 <cprintf> lapiceoi(); 80106a04: e8 47 be ff ff call 80102850 <lapiceoi> if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER) 80106a09: e8 b2 cf ff ff call 801039c0 <myproc> 80106a0e: 85 c0 test %eax,%eax 80106a10: 0f 85 97 fe ff ff jne 801068ad <trap+0xbd> 80106a16: e9 ad fe ff ff jmp 801068c8 <trap+0xd8> 80106a1b: 90 nop 80106a1c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi ideintr(); 80106a20: e8 3b b7 ff ff call 80102160 <ideintr> 80106a25: e9 53 ff ff ff jmp 8010697d <trap+0x18d> 80106a2a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi exit(0); 80106a30: c7 04 24 00 00 00 00 movl $0x0,(%esp) 80106a37: e8 24 d5 ff ff call 80103f60 <exit> 80106a3c: e9 df fe ff ff jmp 80106920 <trap+0x130> 80106a41: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi exit(0); 80106a48: c7 04 24 00 00 00 00 movl $0x0,(%esp) 80106a4f: e8 0c d5 ff ff call 80103f60 <exit> 80106a54: e9 6f fe ff ff jmp 801068c8 <trap+0xd8> 80106a59: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi acquire(&tickslock); 80106a60: c7 04 24 c0 61 11 80 movl $0x801161c0,(%esp) 80106a67: e8 84 e9 ff ff call 801053f0 <acquire> wakeup(&ticks); 80106a6c: c7 04 24 00 6a 11 80 movl $0x80116a00,(%esp) ticks++; 80106a73: ff 05 00 6a 11 80 incl 0x80116a00 wakeup(&ticks); 80106a79: e8 32 d8 ff ff call 801042b0 <wakeup> release(&tickslock); 80106a7e: c7 04 24 c0 61 11 80 movl $0x801161c0,(%esp) 80106a85: e8 06 ea ff ff call 80105490 <release> 80106a8a: e9 ee fe ff ff jmp 8010697d <trap+0x18d> 80106a8f: 0f 20 d6 mov %cr2,%esi cprintf("unexpected trap %d from cpu %d eip %x (cr2=0x%x)\n", 80106a92: e8 09 cf ff ff call 801039a0 <cpuid> 80106a97: 89 74 24 10 mov %esi,0x10(%esp) 80106a9b: 89 7c 24 0c mov %edi,0xc(%esp) 80106a9f: 89 44 24 08 mov %eax,0x8(%esp) 80106aa3: 8b 43 30 mov 0x30(%ebx),%eax 80106aa6: c7 04 24 30 88 10 80 movl $0x80108830,(%esp) 80106aad: 89 44 24 04 mov %eax,0x4(%esp) 80106ab1: e8 9a 9b ff ff call 80100650 <cprintf> panic("trap"); 80106ab6: c7 04 24 06 88 10 80 movl $0x80108806,(%esp) 80106abd: e8 ae 98 ff ff call 80100370 <panic> 80106ac2: 66 90 xchg %ax,%ax 80106ac4: 66 90 xchg %ax,%ax 80106ac6: 66 90 xchg %ax,%ax 80106ac8: 66 90 xchg %ax,%ax 80106aca: 66 90 xchg %ax,%ax 80106acc: 66 90 xchg %ax,%ax 80106ace: 66 90 xchg %ax,%ax 80106ad0 <uartgetc>: } static int uartgetc(void) { if(!uart) 80106ad0: a1 10 b6 10 80 mov 0x8010b610,%eax { 80106ad5: 55 push %ebp 80106ad6: 89 e5 mov %esp,%ebp if(!uart) 80106ad8: 85 c0 test %eax,%eax 80106ada: 74 1c je 80106af8 <uartgetc+0x28> asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80106adc: ba fd 03 00 00 mov $0x3fd,%edx 80106ae1: ec in (%dx),%al return -1; if(!(inb(COM1+5) & 0x01)) 80106ae2: 24 01 and $0x1,%al 80106ae4: 84 c0 test %al,%al 80106ae6: 74 10 je 80106af8 <uartgetc+0x28> 80106ae8: ba f8 03 00 00 mov $0x3f8,%edx 80106aed: ec in (%dx),%al return -1; return inb(COM1+0); 80106aee: 0f b6 c0 movzbl %al,%eax } 80106af1: 5d pop %ebp 80106af2: c3 ret 80106af3: 90 nop 80106af4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80106af8: b8 ff ff ff ff mov $0xffffffff,%eax } 80106afd: 5d pop %ebp 80106afe: c3 ret 80106aff: 90 nop 80106b00 <uartputc.part.0>: uartputc(int c) 80106b00: 55 push %ebp 80106b01: 89 e5 mov %esp,%ebp 80106b03: 56 push %esi 80106b04: be fd 03 00 00 mov $0x3fd,%esi 80106b09: 53 push %ebx 80106b0a: bb 80 00 00 00 mov $0x80,%ebx 80106b0f: 83 ec 20 sub $0x20,%esp 80106b12: 89 45 f4 mov %eax,-0xc(%ebp) 80106b15: eb 18 jmp 80106b2f <uartputc.part.0+0x2f> 80106b17: 89 f6 mov %esi,%esi 80106b19: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi microdelay(10); 80106b20: c7 04 24 0a 00 00 00 movl $0xa,(%esp) 80106b27: e8 44 bd ff ff call 80102870 <microdelay> for(i = 0; i < 128 && !(inb(COM1+5) & 0x20); i++) 80106b2c: 4b dec %ebx 80106b2d: 74 09 je 80106b38 <uartputc.part.0+0x38> 80106b2f: 89 f2 mov %esi,%edx 80106b31: ec in (%dx),%al 80106b32: 24 20 and $0x20,%al 80106b34: 84 c0 test %al,%al 80106b36: 74 e8 je 80106b20 <uartputc.part.0+0x20> asm volatile("out %0,%1" : : "a" (data), "d" (port)); 80106b38: ba f8 03 00 00 mov $0x3f8,%edx 80106b3d: 0f b6 45 f4 movzbl -0xc(%ebp),%eax 80106b41: ee out %al,(%dx) } 80106b42: 83 c4 20 add $0x20,%esp 80106b45: 5b pop %ebx 80106b46: 5e pop %esi 80106b47: 5d pop %ebp 80106b48: c3 ret 80106b49: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106b50 <uartinit>: { 80106b50: 55 push %ebp 80106b51: 31 c9 xor %ecx,%ecx 80106b53: 89 e5 mov %esp,%ebp 80106b55: 88 c8 mov %cl,%al 80106b57: 57 push %edi 80106b58: 56 push %esi 80106b59: 53 push %ebx 80106b5a: bb fa 03 00 00 mov $0x3fa,%ebx 80106b5f: 83 ec 1c sub $0x1c,%esp 80106b62: 89 da mov %ebx,%edx 80106b64: ee out %al,(%dx) 80106b65: bf fb 03 00 00 mov $0x3fb,%edi 80106b6a: b0 80 mov $0x80,%al 80106b6c: 89 fa mov %edi,%edx 80106b6e: ee out %al,(%dx) 80106b6f: b0 0c mov $0xc,%al 80106b71: ba f8 03 00 00 mov $0x3f8,%edx 80106b76: ee out %al,(%dx) 80106b77: be f9 03 00 00 mov $0x3f9,%esi 80106b7c: 88 c8 mov %cl,%al 80106b7e: 89 f2 mov %esi,%edx 80106b80: ee out %al,(%dx) 80106b81: b0 03 mov $0x3,%al 80106b83: 89 fa mov %edi,%edx 80106b85: ee out %al,(%dx) 80106b86: ba fc 03 00 00 mov $0x3fc,%edx 80106b8b: 88 c8 mov %cl,%al 80106b8d: ee out %al,(%dx) 80106b8e: b0 01 mov $0x1,%al 80106b90: 89 f2 mov %esi,%edx 80106b92: ee out %al,(%dx) asm volatile("in %1,%0" : "=a" (data) : "d" (port)); 80106b93: ba fd 03 00 00 mov $0x3fd,%edx 80106b98: ec in (%dx),%al if(inb(COM1+5) == 0xFF) 80106b99: fe c0 inc %al 80106b9b: 74 52 je 80106bef <uartinit+0x9f> uart = 1; 80106b9d: b9 01 00 00 00 mov $0x1,%ecx 80106ba2: 89 da mov %ebx,%edx 80106ba4: 89 0d 10 b6 10 80 mov %ecx,0x8010b610 80106baa: ec in (%dx),%al 80106bab: ba f8 03 00 00 mov $0x3f8,%edx 80106bb0: ec in (%dx),%al ioapicenable(IRQ_COM1, 0); 80106bb1: 31 db xor %ebx,%ebx 80106bb3: 89 5c 24 04 mov %ebx,0x4(%esp) for(p="xv6...\n"; *p; p++) 80106bb7: bb 28 89 10 80 mov $0x80108928,%ebx ioapicenable(IRQ_COM1, 0); 80106bbc: c7 04 24 04 00 00 00 movl $0x4,(%esp) 80106bc3: e8 d8 b7 ff ff call 801023a0 <ioapicenable> for(p="xv6...\n"; *p; p++) 80106bc8: b8 78 00 00 00 mov $0x78,%eax 80106bcd: eb 09 jmp 80106bd8 <uartinit+0x88> 80106bcf: 90 nop 80106bd0: 43 inc %ebx 80106bd1: 0f be 03 movsbl (%ebx),%eax 80106bd4: 84 c0 test %al,%al 80106bd6: 74 17 je 80106bef <uartinit+0x9f> if(!uart) 80106bd8: 8b 15 10 b6 10 80 mov 0x8010b610,%edx 80106bde: 85 d2 test %edx,%edx 80106be0: 74 ee je 80106bd0 <uartinit+0x80> for(p="xv6...\n"; *p; p++) 80106be2: 43 inc %ebx 80106be3: e8 18 ff ff ff call 80106b00 <uartputc.part.0> 80106be8: 0f be 03 movsbl (%ebx),%eax 80106beb: 84 c0 test %al,%al 80106bed: 75 e9 jne 80106bd8 <uartinit+0x88> } 80106bef: 83 c4 1c add $0x1c,%esp 80106bf2: 5b pop %ebx 80106bf3: 5e pop %esi 80106bf4: 5f pop %edi 80106bf5: 5d pop %ebp 80106bf6: c3 ret 80106bf7: 89 f6 mov %esi,%esi 80106bf9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106c00 <uartputc>: if(!uart) 80106c00: 8b 15 10 b6 10 80 mov 0x8010b610,%edx { 80106c06: 55 push %ebp 80106c07: 89 e5 mov %esp,%ebp 80106c09: 8b 45 08 mov 0x8(%ebp),%eax if(!uart) 80106c0c: 85 d2 test %edx,%edx 80106c0e: 74 10 je 80106c20 <uartputc+0x20> } 80106c10: 5d pop %ebp 80106c11: e9 ea fe ff ff jmp 80106b00 <uartputc.part.0> 80106c16: 8d 76 00 lea 0x0(%esi),%esi 80106c19: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106c20: 5d pop %ebp 80106c21: c3 ret 80106c22: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106c29: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106c30 <uartintr>: void uartintr(void) { 80106c30: 55 push %ebp 80106c31: 89 e5 mov %esp,%ebp 80106c33: 83 ec 18 sub $0x18,%esp consoleintr(uartgetc); 80106c36: c7 04 24 d0 6a 10 80 movl $0x80106ad0,(%esp) 80106c3d: e8 8e 9b ff ff call 801007d0 <consoleintr> } 80106c42: c9 leave 80106c43: c3 ret 80106c44 <vector0>: # generated by vectors.pl - do not edit # handlers .globl alltraps .globl vector0 vector0: pushl $0 80106c44: 6a 00 push $0x0 pushl $0 80106c46: 6a 00 push $0x0 jmp alltraps 80106c48: e9 c9 fa ff ff jmp 80106716 <alltraps> 80106c4d <vector1>: .globl vector1 vector1: pushl $0 80106c4d: 6a 00 push $0x0 pushl $1 80106c4f: 6a 01 push $0x1 jmp alltraps 80106c51: e9 c0 fa ff ff jmp 80106716 <alltraps> 80106c56 <vector2>: .globl vector2 vector2: pushl $0 80106c56: 6a 00 push $0x0 pushl $2 80106c58: 6a 02 push $0x2 jmp alltraps 80106c5a: e9 b7 fa ff ff jmp 80106716 <alltraps> 80106c5f <vector3>: .globl vector3 vector3: pushl $0 80106c5f: 6a 00 push $0x0 pushl $3 80106c61: 6a 03 push $0x3 jmp alltraps 80106c63: e9 ae fa ff ff jmp 80106716 <alltraps> 80106c68 <vector4>: .globl vector4 vector4: pushl $0 80106c68: 6a 00 push $0x0 pushl $4 80106c6a: 6a 04 push $0x4 jmp alltraps 80106c6c: e9 a5 fa ff ff jmp 80106716 <alltraps> 80106c71 <vector5>: .globl vector5 vector5: pushl $0 80106c71: 6a 00 push $0x0 pushl $5 80106c73: 6a 05 push $0x5 jmp alltraps 80106c75: e9 9c fa ff ff jmp 80106716 <alltraps> 80106c7a <vector6>: .globl vector6 vector6: pushl $0 80106c7a: 6a 00 push $0x0 pushl $6 80106c7c: 6a 06 push $0x6 jmp alltraps 80106c7e: e9 93 fa ff ff jmp 80106716 <alltraps> 80106c83 <vector7>: .globl vector7 vector7: pushl $0 80106c83: 6a 00 push $0x0 pushl $7 80106c85: 6a 07 push $0x7 jmp alltraps 80106c87: e9 8a fa ff ff jmp 80106716 <alltraps> 80106c8c <vector8>: .globl vector8 vector8: pushl $8 80106c8c: 6a 08 push $0x8 jmp alltraps 80106c8e: e9 83 fa ff ff jmp 80106716 <alltraps> 80106c93 <vector9>: .globl vector9 vector9: pushl $0 80106c93: 6a 00 push $0x0 pushl $9 80106c95: 6a 09 push $0x9 jmp alltraps 80106c97: e9 7a fa ff ff jmp 80106716 <alltraps> 80106c9c <vector10>: .globl vector10 vector10: pushl $10 80106c9c: 6a 0a push $0xa jmp alltraps 80106c9e: e9 73 fa ff ff jmp 80106716 <alltraps> 80106ca3 <vector11>: .globl vector11 vector11: pushl $11 80106ca3: 6a 0b push $0xb jmp alltraps 80106ca5: e9 6c fa ff ff jmp 80106716 <alltraps> 80106caa <vector12>: .globl vector12 vector12: pushl $12 80106caa: 6a 0c push $0xc jmp alltraps 80106cac: e9 65 fa ff ff jmp 80106716 <alltraps> 80106cb1 <vector13>: .globl vector13 vector13: pushl $13 80106cb1: 6a 0d push $0xd jmp alltraps 80106cb3: e9 5e fa ff ff jmp 80106716 <alltraps> 80106cb8 <vector14>: .globl vector14 vector14: pushl $14 80106cb8: 6a 0e push $0xe jmp alltraps 80106cba: e9 57 fa ff ff jmp 80106716 <alltraps> 80106cbf <vector15>: .globl vector15 vector15: pushl $0 80106cbf: 6a 00 push $0x0 pushl $15 80106cc1: 6a 0f push $0xf jmp alltraps 80106cc3: e9 4e fa ff ff jmp 80106716 <alltraps> 80106cc8 <vector16>: .globl vector16 vector16: pushl $0 80106cc8: 6a 00 push $0x0 pushl $16 80106cca: 6a 10 push $0x10 jmp alltraps 80106ccc: e9 45 fa ff ff jmp 80106716 <alltraps> 80106cd1 <vector17>: .globl vector17 vector17: pushl $17 80106cd1: 6a 11 push $0x11 jmp alltraps 80106cd3: e9 3e fa ff ff jmp 80106716 <alltraps> 80106cd8 <vector18>: .globl vector18 vector18: pushl $0 80106cd8: 6a 00 push $0x0 pushl $18 80106cda: 6a 12 push $0x12 jmp alltraps 80106cdc: e9 35 fa ff ff jmp 80106716 <alltraps> 80106ce1 <vector19>: .globl vector19 vector19: pushl $0 80106ce1: 6a 00 push $0x0 pushl $19 80106ce3: 6a 13 push $0x13 jmp alltraps 80106ce5: e9 2c fa ff ff jmp 80106716 <alltraps> 80106cea <vector20>: .globl vector20 vector20: pushl $0 80106cea: 6a 00 push $0x0 pushl $20 80106cec: 6a 14 push $0x14 jmp alltraps 80106cee: e9 23 fa ff ff jmp 80106716 <alltraps> 80106cf3 <vector21>: .globl vector21 vector21: pushl $0 80106cf3: 6a 00 push $0x0 pushl $21 80106cf5: 6a 15 push $0x15 jmp alltraps 80106cf7: e9 1a fa ff ff jmp 80106716 <alltraps> 80106cfc <vector22>: .globl vector22 vector22: pushl $0 80106cfc: 6a 00 push $0x0 pushl $22 80106cfe: 6a 16 push $0x16 jmp alltraps 80106d00: e9 11 fa ff ff jmp 80106716 <alltraps> 80106d05 <vector23>: .globl vector23 vector23: pushl $0 80106d05: 6a 00 push $0x0 pushl $23 80106d07: 6a 17 push $0x17 jmp alltraps 80106d09: e9 08 fa ff ff jmp 80106716 <alltraps> 80106d0e <vector24>: .globl vector24 vector24: pushl $0 80106d0e: 6a 00 push $0x0 pushl $24 80106d10: 6a 18 push $0x18 jmp alltraps 80106d12: e9 ff f9 ff ff jmp 80106716 <alltraps> 80106d17 <vector25>: .globl vector25 vector25: pushl $0 80106d17: 6a 00 push $0x0 pushl $25 80106d19: 6a 19 push $0x19 jmp alltraps 80106d1b: e9 f6 f9 ff ff jmp 80106716 <alltraps> 80106d20 <vector26>: .globl vector26 vector26: pushl $0 80106d20: 6a 00 push $0x0 pushl $26 80106d22: 6a 1a push $0x1a jmp alltraps 80106d24: e9 ed f9 ff ff jmp 80106716 <alltraps> 80106d29 <vector27>: .globl vector27 vector27: pushl $0 80106d29: 6a 00 push $0x0 pushl $27 80106d2b: 6a 1b push $0x1b jmp alltraps 80106d2d: e9 e4 f9 ff ff jmp 80106716 <alltraps> 80106d32 <vector28>: .globl vector28 vector28: pushl $0 80106d32: 6a 00 push $0x0 pushl $28 80106d34: 6a 1c push $0x1c jmp alltraps 80106d36: e9 db f9 ff ff jmp 80106716 <alltraps> 80106d3b <vector29>: .globl vector29 vector29: pushl $0 80106d3b: 6a 00 push $0x0 pushl $29 80106d3d: 6a 1d push $0x1d jmp alltraps 80106d3f: e9 d2 f9 ff ff jmp 80106716 <alltraps> 80106d44 <vector30>: .globl vector30 vector30: pushl $0 80106d44: 6a 00 push $0x0 pushl $30 80106d46: 6a 1e push $0x1e jmp alltraps 80106d48: e9 c9 f9 ff ff jmp 80106716 <alltraps> 80106d4d <vector31>: .globl vector31 vector31: pushl $0 80106d4d: 6a 00 push $0x0 pushl $31 80106d4f: 6a 1f push $0x1f jmp alltraps 80106d51: e9 c0 f9 ff ff jmp 80106716 <alltraps> 80106d56 <vector32>: .globl vector32 vector32: pushl $0 80106d56: 6a 00 push $0x0 pushl $32 80106d58: 6a 20 push $0x20 jmp alltraps 80106d5a: e9 b7 f9 ff ff jmp 80106716 <alltraps> 80106d5f <vector33>: .globl vector33 vector33: pushl $0 80106d5f: 6a 00 push $0x0 pushl $33 80106d61: 6a 21 push $0x21 jmp alltraps 80106d63: e9 ae f9 ff ff jmp 80106716 <alltraps> 80106d68 <vector34>: .globl vector34 vector34: pushl $0 80106d68: 6a 00 push $0x0 pushl $34 80106d6a: 6a 22 push $0x22 jmp alltraps 80106d6c: e9 a5 f9 ff ff jmp 80106716 <alltraps> 80106d71 <vector35>: .globl vector35 vector35: pushl $0 80106d71: 6a 00 push $0x0 pushl $35 80106d73: 6a 23 push $0x23 jmp alltraps 80106d75: e9 9c f9 ff ff jmp 80106716 <alltraps> 80106d7a <vector36>: .globl vector36 vector36: pushl $0 80106d7a: 6a 00 push $0x0 pushl $36 80106d7c: 6a 24 push $0x24 jmp alltraps 80106d7e: e9 93 f9 ff ff jmp 80106716 <alltraps> 80106d83 <vector37>: .globl vector37 vector37: pushl $0 80106d83: 6a 00 push $0x0 pushl $37 80106d85: 6a 25 push $0x25 jmp alltraps 80106d87: e9 8a f9 ff ff jmp 80106716 <alltraps> 80106d8c <vector38>: .globl vector38 vector38: pushl $0 80106d8c: 6a 00 push $0x0 pushl $38 80106d8e: 6a 26 push $0x26 jmp alltraps 80106d90: e9 81 f9 ff ff jmp 80106716 <alltraps> 80106d95 <vector39>: .globl vector39 vector39: pushl $0 80106d95: 6a 00 push $0x0 pushl $39 80106d97: 6a 27 push $0x27 jmp alltraps 80106d99: e9 78 f9 ff ff jmp 80106716 <alltraps> 80106d9e <vector40>: .globl vector40 vector40: pushl $0 80106d9e: 6a 00 push $0x0 pushl $40 80106da0: 6a 28 push $0x28 jmp alltraps 80106da2: e9 6f f9 ff ff jmp 80106716 <alltraps> 80106da7 <vector41>: .globl vector41 vector41: pushl $0 80106da7: 6a 00 push $0x0 pushl $41 80106da9: 6a 29 push $0x29 jmp alltraps 80106dab: e9 66 f9 ff ff jmp 80106716 <alltraps> 80106db0 <vector42>: .globl vector42 vector42: pushl $0 80106db0: 6a 00 push $0x0 pushl $42 80106db2: 6a 2a push $0x2a jmp alltraps 80106db4: e9 5d f9 ff ff jmp 80106716 <alltraps> 80106db9 <vector43>: .globl vector43 vector43: pushl $0 80106db9: 6a 00 push $0x0 pushl $43 80106dbb: 6a 2b push $0x2b jmp alltraps 80106dbd: e9 54 f9 ff ff jmp 80106716 <alltraps> 80106dc2 <vector44>: .globl vector44 vector44: pushl $0 80106dc2: 6a 00 push $0x0 pushl $44 80106dc4: 6a 2c push $0x2c jmp alltraps 80106dc6: e9 4b f9 ff ff jmp 80106716 <alltraps> 80106dcb <vector45>: .globl vector45 vector45: pushl $0 80106dcb: 6a 00 push $0x0 pushl $45 80106dcd: 6a 2d push $0x2d jmp alltraps 80106dcf: e9 42 f9 ff ff jmp 80106716 <alltraps> 80106dd4 <vector46>: .globl vector46 vector46: pushl $0 80106dd4: 6a 00 push $0x0 pushl $46 80106dd6: 6a 2e push $0x2e jmp alltraps 80106dd8: e9 39 f9 ff ff jmp 80106716 <alltraps> 80106ddd <vector47>: .globl vector47 vector47: pushl $0 80106ddd: 6a 00 push $0x0 pushl $47 80106ddf: 6a 2f push $0x2f jmp alltraps 80106de1: e9 30 f9 ff ff jmp 80106716 <alltraps> 80106de6 <vector48>: .globl vector48 vector48: pushl $0 80106de6: 6a 00 push $0x0 pushl $48 80106de8: 6a 30 push $0x30 jmp alltraps 80106dea: e9 27 f9 ff ff jmp 80106716 <alltraps> 80106def <vector49>: .globl vector49 vector49: pushl $0 80106def: 6a 00 push $0x0 pushl $49 80106df1: 6a 31 push $0x31 jmp alltraps 80106df3: e9 1e f9 ff ff jmp 80106716 <alltraps> 80106df8 <vector50>: .globl vector50 vector50: pushl $0 80106df8: 6a 00 push $0x0 pushl $50 80106dfa: 6a 32 push $0x32 jmp alltraps 80106dfc: e9 15 f9 ff ff jmp 80106716 <alltraps> 80106e01 <vector51>: .globl vector51 vector51: pushl $0 80106e01: 6a 00 push $0x0 pushl $51 80106e03: 6a 33 push $0x33 jmp alltraps 80106e05: e9 0c f9 ff ff jmp 80106716 <alltraps> 80106e0a <vector52>: .globl vector52 vector52: pushl $0 80106e0a: 6a 00 push $0x0 pushl $52 80106e0c: 6a 34 push $0x34 jmp alltraps 80106e0e: e9 03 f9 ff ff jmp 80106716 <alltraps> 80106e13 <vector53>: .globl vector53 vector53: pushl $0 80106e13: 6a 00 push $0x0 pushl $53 80106e15: 6a 35 push $0x35 jmp alltraps 80106e17: e9 fa f8 ff ff jmp 80106716 <alltraps> 80106e1c <vector54>: .globl vector54 vector54: pushl $0 80106e1c: 6a 00 push $0x0 pushl $54 80106e1e: 6a 36 push $0x36 jmp alltraps 80106e20: e9 f1 f8 ff ff jmp 80106716 <alltraps> 80106e25 <vector55>: .globl vector55 vector55: pushl $0 80106e25: 6a 00 push $0x0 pushl $55 80106e27: 6a 37 push $0x37 jmp alltraps 80106e29: e9 e8 f8 ff ff jmp 80106716 <alltraps> 80106e2e <vector56>: .globl vector56 vector56: pushl $0 80106e2e: 6a 00 push $0x0 pushl $56 80106e30: 6a 38 push $0x38 jmp alltraps 80106e32: e9 df f8 ff ff jmp 80106716 <alltraps> 80106e37 <vector57>: .globl vector57 vector57: pushl $0 80106e37: 6a 00 push $0x0 pushl $57 80106e39: 6a 39 push $0x39 jmp alltraps 80106e3b: e9 d6 f8 ff ff jmp 80106716 <alltraps> 80106e40 <vector58>: .globl vector58 vector58: pushl $0 80106e40: 6a 00 push $0x0 pushl $58 80106e42: 6a 3a push $0x3a jmp alltraps 80106e44: e9 cd f8 ff ff jmp 80106716 <alltraps> 80106e49 <vector59>: .globl vector59 vector59: pushl $0 80106e49: 6a 00 push $0x0 pushl $59 80106e4b: 6a 3b push $0x3b jmp alltraps 80106e4d: e9 c4 f8 ff ff jmp 80106716 <alltraps> 80106e52 <vector60>: .globl vector60 vector60: pushl $0 80106e52: 6a 00 push $0x0 pushl $60 80106e54: 6a 3c push $0x3c jmp alltraps 80106e56: e9 bb f8 ff ff jmp 80106716 <alltraps> 80106e5b <vector61>: .globl vector61 vector61: pushl $0 80106e5b: 6a 00 push $0x0 pushl $61 80106e5d: 6a 3d push $0x3d jmp alltraps 80106e5f: e9 b2 f8 ff ff jmp 80106716 <alltraps> 80106e64 <vector62>: .globl vector62 vector62: pushl $0 80106e64: 6a 00 push $0x0 pushl $62 80106e66: 6a 3e push $0x3e jmp alltraps 80106e68: e9 a9 f8 ff ff jmp 80106716 <alltraps> 80106e6d <vector63>: .globl vector63 vector63: pushl $0 80106e6d: 6a 00 push $0x0 pushl $63 80106e6f: 6a 3f push $0x3f jmp alltraps 80106e71: e9 a0 f8 ff ff jmp 80106716 <alltraps> 80106e76 <vector64>: .globl vector64 vector64: pushl $0 80106e76: 6a 00 push $0x0 pushl $64 80106e78: 6a 40 push $0x40 jmp alltraps 80106e7a: e9 97 f8 ff ff jmp 80106716 <alltraps> 80106e7f <vector65>: .globl vector65 vector65: pushl $0 80106e7f: 6a 00 push $0x0 pushl $65 80106e81: 6a 41 push $0x41 jmp alltraps 80106e83: e9 8e f8 ff ff jmp 80106716 <alltraps> 80106e88 <vector66>: .globl vector66 vector66: pushl $0 80106e88: 6a 00 push $0x0 pushl $66 80106e8a: 6a 42 push $0x42 jmp alltraps 80106e8c: e9 85 f8 ff ff jmp 80106716 <alltraps> 80106e91 <vector67>: .globl vector67 vector67: pushl $0 80106e91: 6a 00 push $0x0 pushl $67 80106e93: 6a 43 push $0x43 jmp alltraps 80106e95: e9 7c f8 ff ff jmp 80106716 <alltraps> 80106e9a <vector68>: .globl vector68 vector68: pushl $0 80106e9a: 6a 00 push $0x0 pushl $68 80106e9c: 6a 44 push $0x44 jmp alltraps 80106e9e: e9 73 f8 ff ff jmp 80106716 <alltraps> 80106ea3 <vector69>: .globl vector69 vector69: pushl $0 80106ea3: 6a 00 push $0x0 pushl $69 80106ea5: 6a 45 push $0x45 jmp alltraps 80106ea7: e9 6a f8 ff ff jmp 80106716 <alltraps> 80106eac <vector70>: .globl vector70 vector70: pushl $0 80106eac: 6a 00 push $0x0 pushl $70 80106eae: 6a 46 push $0x46 jmp alltraps 80106eb0: e9 61 f8 ff ff jmp 80106716 <alltraps> 80106eb5 <vector71>: .globl vector71 vector71: pushl $0 80106eb5: 6a 00 push $0x0 pushl $71 80106eb7: 6a 47 push $0x47 jmp alltraps 80106eb9: e9 58 f8 ff ff jmp 80106716 <alltraps> 80106ebe <vector72>: .globl vector72 vector72: pushl $0 80106ebe: 6a 00 push $0x0 pushl $72 80106ec0: 6a 48 push $0x48 jmp alltraps 80106ec2: e9 4f f8 ff ff jmp 80106716 <alltraps> 80106ec7 <vector73>: .globl vector73 vector73: pushl $0 80106ec7: 6a 00 push $0x0 pushl $73 80106ec9: 6a 49 push $0x49 jmp alltraps 80106ecb: e9 46 f8 ff ff jmp 80106716 <alltraps> 80106ed0 <vector74>: .globl vector74 vector74: pushl $0 80106ed0: 6a 00 push $0x0 pushl $74 80106ed2: 6a 4a push $0x4a jmp alltraps 80106ed4: e9 3d f8 ff ff jmp 80106716 <alltraps> 80106ed9 <vector75>: .globl vector75 vector75: pushl $0 80106ed9: 6a 00 push $0x0 pushl $75 80106edb: 6a 4b push $0x4b jmp alltraps 80106edd: e9 34 f8 ff ff jmp 80106716 <alltraps> 80106ee2 <vector76>: .globl vector76 vector76: pushl $0 80106ee2: 6a 00 push $0x0 pushl $76 80106ee4: 6a 4c push $0x4c jmp alltraps 80106ee6: e9 2b f8 ff ff jmp 80106716 <alltraps> 80106eeb <vector77>: .globl vector77 vector77: pushl $0 80106eeb: 6a 00 push $0x0 pushl $77 80106eed: 6a 4d push $0x4d jmp alltraps 80106eef: e9 22 f8 ff ff jmp 80106716 <alltraps> 80106ef4 <vector78>: .globl vector78 vector78: pushl $0 80106ef4: 6a 00 push $0x0 pushl $78 80106ef6: 6a 4e push $0x4e jmp alltraps 80106ef8: e9 19 f8 ff ff jmp 80106716 <alltraps> 80106efd <vector79>: .globl vector79 vector79: pushl $0 80106efd: 6a 00 push $0x0 pushl $79 80106eff: 6a 4f push $0x4f jmp alltraps 80106f01: e9 10 f8 ff ff jmp 80106716 <alltraps> 80106f06 <vector80>: .globl vector80 vector80: pushl $0 80106f06: 6a 00 push $0x0 pushl $80 80106f08: 6a 50 push $0x50 jmp alltraps 80106f0a: e9 07 f8 ff ff jmp 80106716 <alltraps> 80106f0f <vector81>: .globl vector81 vector81: pushl $0 80106f0f: 6a 00 push $0x0 pushl $81 80106f11: 6a 51 push $0x51 jmp alltraps 80106f13: e9 fe f7 ff ff jmp 80106716 <alltraps> 80106f18 <vector82>: .globl vector82 vector82: pushl $0 80106f18: 6a 00 push $0x0 pushl $82 80106f1a: 6a 52 push $0x52 jmp alltraps 80106f1c: e9 f5 f7 ff ff jmp 80106716 <alltraps> 80106f21 <vector83>: .globl vector83 vector83: pushl $0 80106f21: 6a 00 push $0x0 pushl $83 80106f23: 6a 53 push $0x53 jmp alltraps 80106f25: e9 ec f7 ff ff jmp 80106716 <alltraps> 80106f2a <vector84>: .globl vector84 vector84: pushl $0 80106f2a: 6a 00 push $0x0 pushl $84 80106f2c: 6a 54 push $0x54 jmp alltraps 80106f2e: e9 e3 f7 ff ff jmp 80106716 <alltraps> 80106f33 <vector85>: .globl vector85 vector85: pushl $0 80106f33: 6a 00 push $0x0 pushl $85 80106f35: 6a 55 push $0x55 jmp alltraps 80106f37: e9 da f7 ff ff jmp 80106716 <alltraps> 80106f3c <vector86>: .globl vector86 vector86: pushl $0 80106f3c: 6a 00 push $0x0 pushl $86 80106f3e: 6a 56 push $0x56 jmp alltraps 80106f40: e9 d1 f7 ff ff jmp 80106716 <alltraps> 80106f45 <vector87>: .globl vector87 vector87: pushl $0 80106f45: 6a 00 push $0x0 pushl $87 80106f47: 6a 57 push $0x57 jmp alltraps 80106f49: e9 c8 f7 ff ff jmp 80106716 <alltraps> 80106f4e <vector88>: .globl vector88 vector88: pushl $0 80106f4e: 6a 00 push $0x0 pushl $88 80106f50: 6a 58 push $0x58 jmp alltraps 80106f52: e9 bf f7 ff ff jmp 80106716 <alltraps> 80106f57 <vector89>: .globl vector89 vector89: pushl $0 80106f57: 6a 00 push $0x0 pushl $89 80106f59: 6a 59 push $0x59 jmp alltraps 80106f5b: e9 b6 f7 ff ff jmp 80106716 <alltraps> 80106f60 <vector90>: .globl vector90 vector90: pushl $0 80106f60: 6a 00 push $0x0 pushl $90 80106f62: 6a 5a push $0x5a jmp alltraps 80106f64: e9 ad f7 ff ff jmp 80106716 <alltraps> 80106f69 <vector91>: .globl vector91 vector91: pushl $0 80106f69: 6a 00 push $0x0 pushl $91 80106f6b: 6a 5b push $0x5b jmp alltraps 80106f6d: e9 a4 f7 ff ff jmp 80106716 <alltraps> 80106f72 <vector92>: .globl vector92 vector92: pushl $0 80106f72: 6a 00 push $0x0 pushl $92 80106f74: 6a 5c push $0x5c jmp alltraps 80106f76: e9 9b f7 ff ff jmp 80106716 <alltraps> 80106f7b <vector93>: .globl vector93 vector93: pushl $0 80106f7b: 6a 00 push $0x0 pushl $93 80106f7d: 6a 5d push $0x5d jmp alltraps 80106f7f: e9 92 f7 ff ff jmp 80106716 <alltraps> 80106f84 <vector94>: .globl vector94 vector94: pushl $0 80106f84: 6a 00 push $0x0 pushl $94 80106f86: 6a 5e push $0x5e jmp alltraps 80106f88: e9 89 f7 ff ff jmp 80106716 <alltraps> 80106f8d <vector95>: .globl vector95 vector95: pushl $0 80106f8d: 6a 00 push $0x0 pushl $95 80106f8f: 6a 5f push $0x5f jmp alltraps 80106f91: e9 80 f7 ff ff jmp 80106716 <alltraps> 80106f96 <vector96>: .globl vector96 vector96: pushl $0 80106f96: 6a 00 push $0x0 pushl $96 80106f98: 6a 60 push $0x60 jmp alltraps 80106f9a: e9 77 f7 ff ff jmp 80106716 <alltraps> 80106f9f <vector97>: .globl vector97 vector97: pushl $0 80106f9f: 6a 00 push $0x0 pushl $97 80106fa1: 6a 61 push $0x61 jmp alltraps 80106fa3: e9 6e f7 ff ff jmp 80106716 <alltraps> 80106fa8 <vector98>: .globl vector98 vector98: pushl $0 80106fa8: 6a 00 push $0x0 pushl $98 80106faa: 6a 62 push $0x62 jmp alltraps 80106fac: e9 65 f7 ff ff jmp 80106716 <alltraps> 80106fb1 <vector99>: .globl vector99 vector99: pushl $0 80106fb1: 6a 00 push $0x0 pushl $99 80106fb3: 6a 63 push $0x63 jmp alltraps 80106fb5: e9 5c f7 ff ff jmp 80106716 <alltraps> 80106fba <vector100>: .globl vector100 vector100: pushl $0 80106fba: 6a 00 push $0x0 pushl $100 80106fbc: 6a 64 push $0x64 jmp alltraps 80106fbe: e9 53 f7 ff ff jmp 80106716 <alltraps> 80106fc3 <vector101>: .globl vector101 vector101: pushl $0 80106fc3: 6a 00 push $0x0 pushl $101 80106fc5: 6a 65 push $0x65 jmp alltraps 80106fc7: e9 4a f7 ff ff jmp 80106716 <alltraps> 80106fcc <vector102>: .globl vector102 vector102: pushl $0 80106fcc: 6a 00 push $0x0 pushl $102 80106fce: 6a 66 push $0x66 jmp alltraps 80106fd0: e9 41 f7 ff ff jmp 80106716 <alltraps> 80106fd5 <vector103>: .globl vector103 vector103: pushl $0 80106fd5: 6a 00 push $0x0 pushl $103 80106fd7: 6a 67 push $0x67 jmp alltraps 80106fd9: e9 38 f7 ff ff jmp 80106716 <alltraps> 80106fde <vector104>: .globl vector104 vector104: pushl $0 80106fde: 6a 00 push $0x0 pushl $104 80106fe0: 6a 68 push $0x68 jmp alltraps 80106fe2: e9 2f f7 ff ff jmp 80106716 <alltraps> 80106fe7 <vector105>: .globl vector105 vector105: pushl $0 80106fe7: 6a 00 push $0x0 pushl $105 80106fe9: 6a 69 push $0x69 jmp alltraps 80106feb: e9 26 f7 ff ff jmp 80106716 <alltraps> 80106ff0 <vector106>: .globl vector106 vector106: pushl $0 80106ff0: 6a 00 push $0x0 pushl $106 80106ff2: 6a 6a push $0x6a jmp alltraps 80106ff4: e9 1d f7 ff ff jmp 80106716 <alltraps> 80106ff9 <vector107>: .globl vector107 vector107: pushl $0 80106ff9: 6a 00 push $0x0 pushl $107 80106ffb: 6a 6b push $0x6b jmp alltraps 80106ffd: e9 14 f7 ff ff jmp 80106716 <alltraps> 80107002 <vector108>: .globl vector108 vector108: pushl $0 80107002: 6a 00 push $0x0 pushl $108 80107004: 6a 6c push $0x6c jmp alltraps 80107006: e9 0b f7 ff ff jmp 80106716 <alltraps> 8010700b <vector109>: .globl vector109 vector109: pushl $0 8010700b: 6a 00 push $0x0 pushl $109 8010700d: 6a 6d push $0x6d jmp alltraps 8010700f: e9 02 f7 ff ff jmp 80106716 <alltraps> 80107014 <vector110>: .globl vector110 vector110: pushl $0 80107014: 6a 00 push $0x0 pushl $110 80107016: 6a 6e push $0x6e jmp alltraps 80107018: e9 f9 f6 ff ff jmp 80106716 <alltraps> 8010701d <vector111>: .globl vector111 vector111: pushl $0 8010701d: 6a 00 push $0x0 pushl $111 8010701f: 6a 6f push $0x6f jmp alltraps 80107021: e9 f0 f6 ff ff jmp 80106716 <alltraps> 80107026 <vector112>: .globl vector112 vector112: pushl $0 80107026: 6a 00 push $0x0 pushl $112 80107028: 6a 70 push $0x70 jmp alltraps 8010702a: e9 e7 f6 ff ff jmp 80106716 <alltraps> 8010702f <vector113>: .globl vector113 vector113: pushl $0 8010702f: 6a 00 push $0x0 pushl $113 80107031: 6a 71 push $0x71 jmp alltraps 80107033: e9 de f6 ff ff jmp 80106716 <alltraps> 80107038 <vector114>: .globl vector114 vector114: pushl $0 80107038: 6a 00 push $0x0 pushl $114 8010703a: 6a 72 push $0x72 jmp alltraps 8010703c: e9 d5 f6 ff ff jmp 80106716 <alltraps> 80107041 <vector115>: .globl vector115 vector115: pushl $0 80107041: 6a 00 push $0x0 pushl $115 80107043: 6a 73 push $0x73 jmp alltraps 80107045: e9 cc f6 ff ff jmp 80106716 <alltraps> 8010704a <vector116>: .globl vector116 vector116: pushl $0 8010704a: 6a 00 push $0x0 pushl $116 8010704c: 6a 74 push $0x74 jmp alltraps 8010704e: e9 c3 f6 ff ff jmp 80106716 <alltraps> 80107053 <vector117>: .globl vector117 vector117: pushl $0 80107053: 6a 00 push $0x0 pushl $117 80107055: 6a 75 push $0x75 jmp alltraps 80107057: e9 ba f6 ff ff jmp 80106716 <alltraps> 8010705c <vector118>: .globl vector118 vector118: pushl $0 8010705c: 6a 00 push $0x0 pushl $118 8010705e: 6a 76 push $0x76 jmp alltraps 80107060: e9 b1 f6 ff ff jmp 80106716 <alltraps> 80107065 <vector119>: .globl vector119 vector119: pushl $0 80107065: 6a 00 push $0x0 pushl $119 80107067: 6a 77 push $0x77 jmp alltraps 80107069: e9 a8 f6 ff ff jmp 80106716 <alltraps> 8010706e <vector120>: .globl vector120 vector120: pushl $0 8010706e: 6a 00 push $0x0 pushl $120 80107070: 6a 78 push $0x78 jmp alltraps 80107072: e9 9f f6 ff ff jmp 80106716 <alltraps> 80107077 <vector121>: .globl vector121 vector121: pushl $0 80107077: 6a 00 push $0x0 pushl $121 80107079: 6a 79 push $0x79 jmp alltraps 8010707b: e9 96 f6 ff ff jmp 80106716 <alltraps> 80107080 <vector122>: .globl vector122 vector122: pushl $0 80107080: 6a 00 push $0x0 pushl $122 80107082: 6a 7a push $0x7a jmp alltraps 80107084: e9 8d f6 ff ff jmp 80106716 <alltraps> 80107089 <vector123>: .globl vector123 vector123: pushl $0 80107089: 6a 00 push $0x0 pushl $123 8010708b: 6a 7b push $0x7b jmp alltraps 8010708d: e9 84 f6 ff ff jmp 80106716 <alltraps> 80107092 <vector124>: .globl vector124 vector124: pushl $0 80107092: 6a 00 push $0x0 pushl $124 80107094: 6a 7c push $0x7c jmp alltraps 80107096: e9 7b f6 ff ff jmp 80106716 <alltraps> 8010709b <vector125>: .globl vector125 vector125: pushl $0 8010709b: 6a 00 push $0x0 pushl $125 8010709d: 6a 7d push $0x7d jmp alltraps 8010709f: e9 72 f6 ff ff jmp 80106716 <alltraps> 801070a4 <vector126>: .globl vector126 vector126: pushl $0 801070a4: 6a 00 push $0x0 pushl $126 801070a6: 6a 7e push $0x7e jmp alltraps 801070a8: e9 69 f6 ff ff jmp 80106716 <alltraps> 801070ad <vector127>: .globl vector127 vector127: pushl $0 801070ad: 6a 00 push $0x0 pushl $127 801070af: 6a 7f push $0x7f jmp alltraps 801070b1: e9 60 f6 ff ff jmp 80106716 <alltraps> 801070b6 <vector128>: .globl vector128 vector128: pushl $0 801070b6: 6a 00 push $0x0 pushl $128 801070b8: 68 80 00 00 00 push $0x80 jmp alltraps 801070bd: e9 54 f6 ff ff jmp 80106716 <alltraps> 801070c2 <vector129>: .globl vector129 vector129: pushl $0 801070c2: 6a 00 push $0x0 pushl $129 801070c4: 68 81 00 00 00 push $0x81 jmp alltraps 801070c9: e9 48 f6 ff ff jmp 80106716 <alltraps> 801070ce <vector130>: .globl vector130 vector130: pushl $0 801070ce: 6a 00 push $0x0 pushl $130 801070d0: 68 82 00 00 00 push $0x82 jmp alltraps 801070d5: e9 3c f6 ff ff jmp 80106716 <alltraps> 801070da <vector131>: .globl vector131 vector131: pushl $0 801070da: 6a 00 push $0x0 pushl $131 801070dc: 68 83 00 00 00 push $0x83 jmp alltraps 801070e1: e9 30 f6 ff ff jmp 80106716 <alltraps> 801070e6 <vector132>: .globl vector132 vector132: pushl $0 801070e6: 6a 00 push $0x0 pushl $132 801070e8: 68 84 00 00 00 push $0x84 jmp alltraps 801070ed: e9 24 f6 ff ff jmp 80106716 <alltraps> 801070f2 <vector133>: .globl vector133 vector133: pushl $0 801070f2: 6a 00 push $0x0 pushl $133 801070f4: 68 85 00 00 00 push $0x85 jmp alltraps 801070f9: e9 18 f6 ff ff jmp 80106716 <alltraps> 801070fe <vector134>: .globl vector134 vector134: pushl $0 801070fe: 6a 00 push $0x0 pushl $134 80107100: 68 86 00 00 00 push $0x86 jmp alltraps 80107105: e9 0c f6 ff ff jmp 80106716 <alltraps> 8010710a <vector135>: .globl vector135 vector135: pushl $0 8010710a: 6a 00 push $0x0 pushl $135 8010710c: 68 87 00 00 00 push $0x87 jmp alltraps 80107111: e9 00 f6 ff ff jmp 80106716 <alltraps> 80107116 <vector136>: .globl vector136 vector136: pushl $0 80107116: 6a 00 push $0x0 pushl $136 80107118: 68 88 00 00 00 push $0x88 jmp alltraps 8010711d: e9 f4 f5 ff ff jmp 80106716 <alltraps> 80107122 <vector137>: .globl vector137 vector137: pushl $0 80107122: 6a 00 push $0x0 pushl $137 80107124: 68 89 00 00 00 push $0x89 jmp alltraps 80107129: e9 e8 f5 ff ff jmp 80106716 <alltraps> 8010712e <vector138>: .globl vector138 vector138: pushl $0 8010712e: 6a 00 push $0x0 pushl $138 80107130: 68 8a 00 00 00 push $0x8a jmp alltraps 80107135: e9 dc f5 ff ff jmp 80106716 <alltraps> 8010713a <vector139>: .globl vector139 vector139: pushl $0 8010713a: 6a 00 push $0x0 pushl $139 8010713c: 68 8b 00 00 00 push $0x8b jmp alltraps 80107141: e9 d0 f5 ff ff jmp 80106716 <alltraps> 80107146 <vector140>: .globl vector140 vector140: pushl $0 80107146: 6a 00 push $0x0 pushl $140 80107148: 68 8c 00 00 00 push $0x8c jmp alltraps 8010714d: e9 c4 f5 ff ff jmp 80106716 <alltraps> 80107152 <vector141>: .globl vector141 vector141: pushl $0 80107152: 6a 00 push $0x0 pushl $141 80107154: 68 8d 00 00 00 push $0x8d jmp alltraps 80107159: e9 b8 f5 ff ff jmp 80106716 <alltraps> 8010715e <vector142>: .globl vector142 vector142: pushl $0 8010715e: 6a 00 push $0x0 pushl $142 80107160: 68 8e 00 00 00 push $0x8e jmp alltraps 80107165: e9 ac f5 ff ff jmp 80106716 <alltraps> 8010716a <vector143>: .globl vector143 vector143: pushl $0 8010716a: 6a 00 push $0x0 pushl $143 8010716c: 68 8f 00 00 00 push $0x8f jmp alltraps 80107171: e9 a0 f5 ff ff jmp 80106716 <alltraps> 80107176 <vector144>: .globl vector144 vector144: pushl $0 80107176: 6a 00 push $0x0 pushl $144 80107178: 68 90 00 00 00 push $0x90 jmp alltraps 8010717d: e9 94 f5 ff ff jmp 80106716 <alltraps> 80107182 <vector145>: .globl vector145 vector145: pushl $0 80107182: 6a 00 push $0x0 pushl $145 80107184: 68 91 00 00 00 push $0x91 jmp alltraps 80107189: e9 88 f5 ff ff jmp 80106716 <alltraps> 8010718e <vector146>: .globl vector146 vector146: pushl $0 8010718e: 6a 00 push $0x0 pushl $146 80107190: 68 92 00 00 00 push $0x92 jmp alltraps 80107195: e9 7c f5 ff ff jmp 80106716 <alltraps> 8010719a <vector147>: .globl vector147 vector147: pushl $0 8010719a: 6a 00 push $0x0 pushl $147 8010719c: 68 93 00 00 00 push $0x93 jmp alltraps 801071a1: e9 70 f5 ff ff jmp 80106716 <alltraps> 801071a6 <vector148>: .globl vector148 vector148: pushl $0 801071a6: 6a 00 push $0x0 pushl $148 801071a8: 68 94 00 00 00 push $0x94 jmp alltraps 801071ad: e9 64 f5 ff ff jmp 80106716 <alltraps> 801071b2 <vector149>: .globl vector149 vector149: pushl $0 801071b2: 6a 00 push $0x0 pushl $149 801071b4: 68 95 00 00 00 push $0x95 jmp alltraps 801071b9: e9 58 f5 ff ff jmp 80106716 <alltraps> 801071be <vector150>: .globl vector150 vector150: pushl $0 801071be: 6a 00 push $0x0 pushl $150 801071c0: 68 96 00 00 00 push $0x96 jmp alltraps 801071c5: e9 4c f5 ff ff jmp 80106716 <alltraps> 801071ca <vector151>: .globl vector151 vector151: pushl $0 801071ca: 6a 00 push $0x0 pushl $151 801071cc: 68 97 00 00 00 push $0x97 jmp alltraps 801071d1: e9 40 f5 ff ff jmp 80106716 <alltraps> 801071d6 <vector152>: .globl vector152 vector152: pushl $0 801071d6: 6a 00 push $0x0 pushl $152 801071d8: 68 98 00 00 00 push $0x98 jmp alltraps 801071dd: e9 34 f5 ff ff jmp 80106716 <alltraps> 801071e2 <vector153>: .globl vector153 vector153: pushl $0 801071e2: 6a 00 push $0x0 pushl $153 801071e4: 68 99 00 00 00 push $0x99 jmp alltraps 801071e9: e9 28 f5 ff ff jmp 80106716 <alltraps> 801071ee <vector154>: .globl vector154 vector154: pushl $0 801071ee: 6a 00 push $0x0 pushl $154 801071f0: 68 9a 00 00 00 push $0x9a jmp alltraps 801071f5: e9 1c f5 ff ff jmp 80106716 <alltraps> 801071fa <vector155>: .globl vector155 vector155: pushl $0 801071fa: 6a 00 push $0x0 pushl $155 801071fc: 68 9b 00 00 00 push $0x9b jmp alltraps 80107201: e9 10 f5 ff ff jmp 80106716 <alltraps> 80107206 <vector156>: .globl vector156 vector156: pushl $0 80107206: 6a 00 push $0x0 pushl $156 80107208: 68 9c 00 00 00 push $0x9c jmp alltraps 8010720d: e9 04 f5 ff ff jmp 80106716 <alltraps> 80107212 <vector157>: .globl vector157 vector157: pushl $0 80107212: 6a 00 push $0x0 pushl $157 80107214: 68 9d 00 00 00 push $0x9d jmp alltraps 80107219: e9 f8 f4 ff ff jmp 80106716 <alltraps> 8010721e <vector158>: .globl vector158 vector158: pushl $0 8010721e: 6a 00 push $0x0 pushl $158 80107220: 68 9e 00 00 00 push $0x9e jmp alltraps 80107225: e9 ec f4 ff ff jmp 80106716 <alltraps> 8010722a <vector159>: .globl vector159 vector159: pushl $0 8010722a: 6a 00 push $0x0 pushl $159 8010722c: 68 9f 00 00 00 push $0x9f jmp alltraps 80107231: e9 e0 f4 ff ff jmp 80106716 <alltraps> 80107236 <vector160>: .globl vector160 vector160: pushl $0 80107236: 6a 00 push $0x0 pushl $160 80107238: 68 a0 00 00 00 push $0xa0 jmp alltraps 8010723d: e9 d4 f4 ff ff jmp 80106716 <alltraps> 80107242 <vector161>: .globl vector161 vector161: pushl $0 80107242: 6a 00 push $0x0 pushl $161 80107244: 68 a1 00 00 00 push $0xa1 jmp alltraps 80107249: e9 c8 f4 ff ff jmp 80106716 <alltraps> 8010724e <vector162>: .globl vector162 vector162: pushl $0 8010724e: 6a 00 push $0x0 pushl $162 80107250: 68 a2 00 00 00 push $0xa2 jmp alltraps 80107255: e9 bc f4 ff ff jmp 80106716 <alltraps> 8010725a <vector163>: .globl vector163 vector163: pushl $0 8010725a: 6a 00 push $0x0 pushl $163 8010725c: 68 a3 00 00 00 push $0xa3 jmp alltraps 80107261: e9 b0 f4 ff ff jmp 80106716 <alltraps> 80107266 <vector164>: .globl vector164 vector164: pushl $0 80107266: 6a 00 push $0x0 pushl $164 80107268: 68 a4 00 00 00 push $0xa4 jmp alltraps 8010726d: e9 a4 f4 ff ff jmp 80106716 <alltraps> 80107272 <vector165>: .globl vector165 vector165: pushl $0 80107272: 6a 00 push $0x0 pushl $165 80107274: 68 a5 00 00 00 push $0xa5 jmp alltraps 80107279: e9 98 f4 ff ff jmp 80106716 <alltraps> 8010727e <vector166>: .globl vector166 vector166: pushl $0 8010727e: 6a 00 push $0x0 pushl $166 80107280: 68 a6 00 00 00 push $0xa6 jmp alltraps 80107285: e9 8c f4 ff ff jmp 80106716 <alltraps> 8010728a <vector167>: .globl vector167 vector167: pushl $0 8010728a: 6a 00 push $0x0 pushl $167 8010728c: 68 a7 00 00 00 push $0xa7 jmp alltraps 80107291: e9 80 f4 ff ff jmp 80106716 <alltraps> 80107296 <vector168>: .globl vector168 vector168: pushl $0 80107296: 6a 00 push $0x0 pushl $168 80107298: 68 a8 00 00 00 push $0xa8 jmp alltraps 8010729d: e9 74 f4 ff ff jmp 80106716 <alltraps> 801072a2 <vector169>: .globl vector169 vector169: pushl $0 801072a2: 6a 00 push $0x0 pushl $169 801072a4: 68 a9 00 00 00 push $0xa9 jmp alltraps 801072a9: e9 68 f4 ff ff jmp 80106716 <alltraps> 801072ae <vector170>: .globl vector170 vector170: pushl $0 801072ae: 6a 00 push $0x0 pushl $170 801072b0: 68 aa 00 00 00 push $0xaa jmp alltraps 801072b5: e9 5c f4 ff ff jmp 80106716 <alltraps> 801072ba <vector171>: .globl vector171 vector171: pushl $0 801072ba: 6a 00 push $0x0 pushl $171 801072bc: 68 ab 00 00 00 push $0xab jmp alltraps 801072c1: e9 50 f4 ff ff jmp 80106716 <alltraps> 801072c6 <vector172>: .globl vector172 vector172: pushl $0 801072c6: 6a 00 push $0x0 pushl $172 801072c8: 68 ac 00 00 00 push $0xac jmp alltraps 801072cd: e9 44 f4 ff ff jmp 80106716 <alltraps> 801072d2 <vector173>: .globl vector173 vector173: pushl $0 801072d2: 6a 00 push $0x0 pushl $173 801072d4: 68 ad 00 00 00 push $0xad jmp alltraps 801072d9: e9 38 f4 ff ff jmp 80106716 <alltraps> 801072de <vector174>: .globl vector174 vector174: pushl $0 801072de: 6a 00 push $0x0 pushl $174 801072e0: 68 ae 00 00 00 push $0xae jmp alltraps 801072e5: e9 2c f4 ff ff jmp 80106716 <alltraps> 801072ea <vector175>: .globl vector175 vector175: pushl $0 801072ea: 6a 00 push $0x0 pushl $175 801072ec: 68 af 00 00 00 push $0xaf jmp alltraps 801072f1: e9 20 f4 ff ff jmp 80106716 <alltraps> 801072f6 <vector176>: .globl vector176 vector176: pushl $0 801072f6: 6a 00 push $0x0 pushl $176 801072f8: 68 b0 00 00 00 push $0xb0 jmp alltraps 801072fd: e9 14 f4 ff ff jmp 80106716 <alltraps> 80107302 <vector177>: .globl vector177 vector177: pushl $0 80107302: 6a 00 push $0x0 pushl $177 80107304: 68 b1 00 00 00 push $0xb1 jmp alltraps 80107309: e9 08 f4 ff ff jmp 80106716 <alltraps> 8010730e <vector178>: .globl vector178 vector178: pushl $0 8010730e: 6a 00 push $0x0 pushl $178 80107310: 68 b2 00 00 00 push $0xb2 jmp alltraps 80107315: e9 fc f3 ff ff jmp 80106716 <alltraps> 8010731a <vector179>: .globl vector179 vector179: pushl $0 8010731a: 6a 00 push $0x0 pushl $179 8010731c: 68 b3 00 00 00 push $0xb3 jmp alltraps 80107321: e9 f0 f3 ff ff jmp 80106716 <alltraps> 80107326 <vector180>: .globl vector180 vector180: pushl $0 80107326: 6a 00 push $0x0 pushl $180 80107328: 68 b4 00 00 00 push $0xb4 jmp alltraps 8010732d: e9 e4 f3 ff ff jmp 80106716 <alltraps> 80107332 <vector181>: .globl vector181 vector181: pushl $0 80107332: 6a 00 push $0x0 pushl $181 80107334: 68 b5 00 00 00 push $0xb5 jmp alltraps 80107339: e9 d8 f3 ff ff jmp 80106716 <alltraps> 8010733e <vector182>: .globl vector182 vector182: pushl $0 8010733e: 6a 00 push $0x0 pushl $182 80107340: 68 b6 00 00 00 push $0xb6 jmp alltraps 80107345: e9 cc f3 ff ff jmp 80106716 <alltraps> 8010734a <vector183>: .globl vector183 vector183: pushl $0 8010734a: 6a 00 push $0x0 pushl $183 8010734c: 68 b7 00 00 00 push $0xb7 jmp alltraps 80107351: e9 c0 f3 ff ff jmp 80106716 <alltraps> 80107356 <vector184>: .globl vector184 vector184: pushl $0 80107356: 6a 00 push $0x0 pushl $184 80107358: 68 b8 00 00 00 push $0xb8 jmp alltraps 8010735d: e9 b4 f3 ff ff jmp 80106716 <alltraps> 80107362 <vector185>: .globl vector185 vector185: pushl $0 80107362: 6a 00 push $0x0 pushl $185 80107364: 68 b9 00 00 00 push $0xb9 jmp alltraps 80107369: e9 a8 f3 ff ff jmp 80106716 <alltraps> 8010736e <vector186>: .globl vector186 vector186: pushl $0 8010736e: 6a 00 push $0x0 pushl $186 80107370: 68 ba 00 00 00 push $0xba jmp alltraps 80107375: e9 9c f3 ff ff jmp 80106716 <alltraps> 8010737a <vector187>: .globl vector187 vector187: pushl $0 8010737a: 6a 00 push $0x0 pushl $187 8010737c: 68 bb 00 00 00 push $0xbb jmp alltraps 80107381: e9 90 f3 ff ff jmp 80106716 <alltraps> 80107386 <vector188>: .globl vector188 vector188: pushl $0 80107386: 6a 00 push $0x0 pushl $188 80107388: 68 bc 00 00 00 push $0xbc jmp alltraps 8010738d: e9 84 f3 ff ff jmp 80106716 <alltraps> 80107392 <vector189>: .globl vector189 vector189: pushl $0 80107392: 6a 00 push $0x0 pushl $189 80107394: 68 bd 00 00 00 push $0xbd jmp alltraps 80107399: e9 78 f3 ff ff jmp 80106716 <alltraps> 8010739e <vector190>: .globl vector190 vector190: pushl $0 8010739e: 6a 00 push $0x0 pushl $190 801073a0: 68 be 00 00 00 push $0xbe jmp alltraps 801073a5: e9 6c f3 ff ff jmp 80106716 <alltraps> 801073aa <vector191>: .globl vector191 vector191: pushl $0 801073aa: 6a 00 push $0x0 pushl $191 801073ac: 68 bf 00 00 00 push $0xbf jmp alltraps 801073b1: e9 60 f3 ff ff jmp 80106716 <alltraps> 801073b6 <vector192>: .globl vector192 vector192: pushl $0 801073b6: 6a 00 push $0x0 pushl $192 801073b8: 68 c0 00 00 00 push $0xc0 jmp alltraps 801073bd: e9 54 f3 ff ff jmp 80106716 <alltraps> 801073c2 <vector193>: .globl vector193 vector193: pushl $0 801073c2: 6a 00 push $0x0 pushl $193 801073c4: 68 c1 00 00 00 push $0xc1 jmp alltraps 801073c9: e9 48 f3 ff ff jmp 80106716 <alltraps> 801073ce <vector194>: .globl vector194 vector194: pushl $0 801073ce: 6a 00 push $0x0 pushl $194 801073d0: 68 c2 00 00 00 push $0xc2 jmp alltraps 801073d5: e9 3c f3 ff ff jmp 80106716 <alltraps> 801073da <vector195>: .globl vector195 vector195: pushl $0 801073da: 6a 00 push $0x0 pushl $195 801073dc: 68 c3 00 00 00 push $0xc3 jmp alltraps 801073e1: e9 30 f3 ff ff jmp 80106716 <alltraps> 801073e6 <vector196>: .globl vector196 vector196: pushl $0 801073e6: 6a 00 push $0x0 pushl $196 801073e8: 68 c4 00 00 00 push $0xc4 jmp alltraps 801073ed: e9 24 f3 ff ff jmp 80106716 <alltraps> 801073f2 <vector197>: .globl vector197 vector197: pushl $0 801073f2: 6a 00 push $0x0 pushl $197 801073f4: 68 c5 00 00 00 push $0xc5 jmp alltraps 801073f9: e9 18 f3 ff ff jmp 80106716 <alltraps> 801073fe <vector198>: .globl vector198 vector198: pushl $0 801073fe: 6a 00 push $0x0 pushl $198 80107400: 68 c6 00 00 00 push $0xc6 jmp alltraps 80107405: e9 0c f3 ff ff jmp 80106716 <alltraps> 8010740a <vector199>: .globl vector199 vector199: pushl $0 8010740a: 6a 00 push $0x0 pushl $199 8010740c: 68 c7 00 00 00 push $0xc7 jmp alltraps 80107411: e9 00 f3 ff ff jmp 80106716 <alltraps> 80107416 <vector200>: .globl vector200 vector200: pushl $0 80107416: 6a 00 push $0x0 pushl $200 80107418: 68 c8 00 00 00 push $0xc8 jmp alltraps 8010741d: e9 f4 f2 ff ff jmp 80106716 <alltraps> 80107422 <vector201>: .globl vector201 vector201: pushl $0 80107422: 6a 00 push $0x0 pushl $201 80107424: 68 c9 00 00 00 push $0xc9 jmp alltraps 80107429: e9 e8 f2 ff ff jmp 80106716 <alltraps> 8010742e <vector202>: .globl vector202 vector202: pushl $0 8010742e: 6a 00 push $0x0 pushl $202 80107430: 68 ca 00 00 00 push $0xca jmp alltraps 80107435: e9 dc f2 ff ff jmp 80106716 <alltraps> 8010743a <vector203>: .globl vector203 vector203: pushl $0 8010743a: 6a 00 push $0x0 pushl $203 8010743c: 68 cb 00 00 00 push $0xcb jmp alltraps 80107441: e9 d0 f2 ff ff jmp 80106716 <alltraps> 80107446 <vector204>: .globl vector204 vector204: pushl $0 80107446: 6a 00 push $0x0 pushl $204 80107448: 68 cc 00 00 00 push $0xcc jmp alltraps 8010744d: e9 c4 f2 ff ff jmp 80106716 <alltraps> 80107452 <vector205>: .globl vector205 vector205: pushl $0 80107452: 6a 00 push $0x0 pushl $205 80107454: 68 cd 00 00 00 push $0xcd jmp alltraps 80107459: e9 b8 f2 ff ff jmp 80106716 <alltraps> 8010745e <vector206>: .globl vector206 vector206: pushl $0 8010745e: 6a 00 push $0x0 pushl $206 80107460: 68 ce 00 00 00 push $0xce jmp alltraps 80107465: e9 ac f2 ff ff jmp 80106716 <alltraps> 8010746a <vector207>: .globl vector207 vector207: pushl $0 8010746a: 6a 00 push $0x0 pushl $207 8010746c: 68 cf 00 00 00 push $0xcf jmp alltraps 80107471: e9 a0 f2 ff ff jmp 80106716 <alltraps> 80107476 <vector208>: .globl vector208 vector208: pushl $0 80107476: 6a 00 push $0x0 pushl $208 80107478: 68 d0 00 00 00 push $0xd0 jmp alltraps 8010747d: e9 94 f2 ff ff jmp 80106716 <alltraps> 80107482 <vector209>: .globl vector209 vector209: pushl $0 80107482: 6a 00 push $0x0 pushl $209 80107484: 68 d1 00 00 00 push $0xd1 jmp alltraps 80107489: e9 88 f2 ff ff jmp 80106716 <alltraps> 8010748e <vector210>: .globl vector210 vector210: pushl $0 8010748e: 6a 00 push $0x0 pushl $210 80107490: 68 d2 00 00 00 push $0xd2 jmp alltraps 80107495: e9 7c f2 ff ff jmp 80106716 <alltraps> 8010749a <vector211>: .globl vector211 vector211: pushl $0 8010749a: 6a 00 push $0x0 pushl $211 8010749c: 68 d3 00 00 00 push $0xd3 jmp alltraps 801074a1: e9 70 f2 ff ff jmp 80106716 <alltraps> 801074a6 <vector212>: .globl vector212 vector212: pushl $0 801074a6: 6a 00 push $0x0 pushl $212 801074a8: 68 d4 00 00 00 push $0xd4 jmp alltraps 801074ad: e9 64 f2 ff ff jmp 80106716 <alltraps> 801074b2 <vector213>: .globl vector213 vector213: pushl $0 801074b2: 6a 00 push $0x0 pushl $213 801074b4: 68 d5 00 00 00 push $0xd5 jmp alltraps 801074b9: e9 58 f2 ff ff jmp 80106716 <alltraps> 801074be <vector214>: .globl vector214 vector214: pushl $0 801074be: 6a 00 push $0x0 pushl $214 801074c0: 68 d6 00 00 00 push $0xd6 jmp alltraps 801074c5: e9 4c f2 ff ff jmp 80106716 <alltraps> 801074ca <vector215>: .globl vector215 vector215: pushl $0 801074ca: 6a 00 push $0x0 pushl $215 801074cc: 68 d7 00 00 00 push $0xd7 jmp alltraps 801074d1: e9 40 f2 ff ff jmp 80106716 <alltraps> 801074d6 <vector216>: .globl vector216 vector216: pushl $0 801074d6: 6a 00 push $0x0 pushl $216 801074d8: 68 d8 00 00 00 push $0xd8 jmp alltraps 801074dd: e9 34 f2 ff ff jmp 80106716 <alltraps> 801074e2 <vector217>: .globl vector217 vector217: pushl $0 801074e2: 6a 00 push $0x0 pushl $217 801074e4: 68 d9 00 00 00 push $0xd9 jmp alltraps 801074e9: e9 28 f2 ff ff jmp 80106716 <alltraps> 801074ee <vector218>: .globl vector218 vector218: pushl $0 801074ee: 6a 00 push $0x0 pushl $218 801074f0: 68 da 00 00 00 push $0xda jmp alltraps 801074f5: e9 1c f2 ff ff jmp 80106716 <alltraps> 801074fa <vector219>: .globl vector219 vector219: pushl $0 801074fa: 6a 00 push $0x0 pushl $219 801074fc: 68 db 00 00 00 push $0xdb jmp alltraps 80107501: e9 10 f2 ff ff jmp 80106716 <alltraps> 80107506 <vector220>: .globl vector220 vector220: pushl $0 80107506: 6a 00 push $0x0 pushl $220 80107508: 68 dc 00 00 00 push $0xdc jmp alltraps 8010750d: e9 04 f2 ff ff jmp 80106716 <alltraps> 80107512 <vector221>: .globl vector221 vector221: pushl $0 80107512: 6a 00 push $0x0 pushl $221 80107514: 68 dd 00 00 00 push $0xdd jmp alltraps 80107519: e9 f8 f1 ff ff jmp 80106716 <alltraps> 8010751e <vector222>: .globl vector222 vector222: pushl $0 8010751e: 6a 00 push $0x0 pushl $222 80107520: 68 de 00 00 00 push $0xde jmp alltraps 80107525: e9 ec f1 ff ff jmp 80106716 <alltraps> 8010752a <vector223>: .globl vector223 vector223: pushl $0 8010752a: 6a 00 push $0x0 pushl $223 8010752c: 68 df 00 00 00 push $0xdf jmp alltraps 80107531: e9 e0 f1 ff ff jmp 80106716 <alltraps> 80107536 <vector224>: .globl vector224 vector224: pushl $0 80107536: 6a 00 push $0x0 pushl $224 80107538: 68 e0 00 00 00 push $0xe0 jmp alltraps 8010753d: e9 d4 f1 ff ff jmp 80106716 <alltraps> 80107542 <vector225>: .globl vector225 vector225: pushl $0 80107542: 6a 00 push $0x0 pushl $225 80107544: 68 e1 00 00 00 push $0xe1 jmp alltraps 80107549: e9 c8 f1 ff ff jmp 80106716 <alltraps> 8010754e <vector226>: .globl vector226 vector226: pushl $0 8010754e: 6a 00 push $0x0 pushl $226 80107550: 68 e2 00 00 00 push $0xe2 jmp alltraps 80107555: e9 bc f1 ff ff jmp 80106716 <alltraps> 8010755a <vector227>: .globl vector227 vector227: pushl $0 8010755a: 6a 00 push $0x0 pushl $227 8010755c: 68 e3 00 00 00 push $0xe3 jmp alltraps 80107561: e9 b0 f1 ff ff jmp 80106716 <alltraps> 80107566 <vector228>: .globl vector228 vector228: pushl $0 80107566: 6a 00 push $0x0 pushl $228 80107568: 68 e4 00 00 00 push $0xe4 jmp alltraps 8010756d: e9 a4 f1 ff ff jmp 80106716 <alltraps> 80107572 <vector229>: .globl vector229 vector229: pushl $0 80107572: 6a 00 push $0x0 pushl $229 80107574: 68 e5 00 00 00 push $0xe5 jmp alltraps 80107579: e9 98 f1 ff ff jmp 80106716 <alltraps> 8010757e <vector230>: .globl vector230 vector230: pushl $0 8010757e: 6a 00 push $0x0 pushl $230 80107580: 68 e6 00 00 00 push $0xe6 jmp alltraps 80107585: e9 8c f1 ff ff jmp 80106716 <alltraps> 8010758a <vector231>: .globl vector231 vector231: pushl $0 8010758a: 6a 00 push $0x0 pushl $231 8010758c: 68 e7 00 00 00 push $0xe7 jmp alltraps 80107591: e9 80 f1 ff ff jmp 80106716 <alltraps> 80107596 <vector232>: .globl vector232 vector232: pushl $0 80107596: 6a 00 push $0x0 pushl $232 80107598: 68 e8 00 00 00 push $0xe8 jmp alltraps 8010759d: e9 74 f1 ff ff jmp 80106716 <alltraps> 801075a2 <vector233>: .globl vector233 vector233: pushl $0 801075a2: 6a 00 push $0x0 pushl $233 801075a4: 68 e9 00 00 00 push $0xe9 jmp alltraps 801075a9: e9 68 f1 ff ff jmp 80106716 <alltraps> 801075ae <vector234>: .globl vector234 vector234: pushl $0 801075ae: 6a 00 push $0x0 pushl $234 801075b0: 68 ea 00 00 00 push $0xea jmp alltraps 801075b5: e9 5c f1 ff ff jmp 80106716 <alltraps> 801075ba <vector235>: .globl vector235 vector235: pushl $0 801075ba: 6a 00 push $0x0 pushl $235 801075bc: 68 eb 00 00 00 push $0xeb jmp alltraps 801075c1: e9 50 f1 ff ff jmp 80106716 <alltraps> 801075c6 <vector236>: .globl vector236 vector236: pushl $0 801075c6: 6a 00 push $0x0 pushl $236 801075c8: 68 ec 00 00 00 push $0xec jmp alltraps 801075cd: e9 44 f1 ff ff jmp 80106716 <alltraps> 801075d2 <vector237>: .globl vector237 vector237: pushl $0 801075d2: 6a 00 push $0x0 pushl $237 801075d4: 68 ed 00 00 00 push $0xed jmp alltraps 801075d9: e9 38 f1 ff ff jmp 80106716 <alltraps> 801075de <vector238>: .globl vector238 vector238: pushl $0 801075de: 6a 00 push $0x0 pushl $238 801075e0: 68 ee 00 00 00 push $0xee jmp alltraps 801075e5: e9 2c f1 ff ff jmp 80106716 <alltraps> 801075ea <vector239>: .globl vector239 vector239: pushl $0 801075ea: 6a 00 push $0x0 pushl $239 801075ec: 68 ef 00 00 00 push $0xef jmp alltraps 801075f1: e9 20 f1 ff ff jmp 80106716 <alltraps> 801075f6 <vector240>: .globl vector240 vector240: pushl $0 801075f6: 6a 00 push $0x0 pushl $240 801075f8: 68 f0 00 00 00 push $0xf0 jmp alltraps 801075fd: e9 14 f1 ff ff jmp 80106716 <alltraps> 80107602 <vector241>: .globl vector241 vector241: pushl $0 80107602: 6a 00 push $0x0 pushl $241 80107604: 68 f1 00 00 00 push $0xf1 jmp alltraps 80107609: e9 08 f1 ff ff jmp 80106716 <alltraps> 8010760e <vector242>: .globl vector242 vector242: pushl $0 8010760e: 6a 00 push $0x0 pushl $242 80107610: 68 f2 00 00 00 push $0xf2 jmp alltraps 80107615: e9 fc f0 ff ff jmp 80106716 <alltraps> 8010761a <vector243>: .globl vector243 vector243: pushl $0 8010761a: 6a 00 push $0x0 pushl $243 8010761c: 68 f3 00 00 00 push $0xf3 jmp alltraps 80107621: e9 f0 f0 ff ff jmp 80106716 <alltraps> 80107626 <vector244>: .globl vector244 vector244: pushl $0 80107626: 6a 00 push $0x0 pushl $244 80107628: 68 f4 00 00 00 push $0xf4 jmp alltraps 8010762d: e9 e4 f0 ff ff jmp 80106716 <alltraps> 80107632 <vector245>: .globl vector245 vector245: pushl $0 80107632: 6a 00 push $0x0 pushl $245 80107634: 68 f5 00 00 00 push $0xf5 jmp alltraps 80107639: e9 d8 f0 ff ff jmp 80106716 <alltraps> 8010763e <vector246>: .globl vector246 vector246: pushl $0 8010763e: 6a 00 push $0x0 pushl $246 80107640: 68 f6 00 00 00 push $0xf6 jmp alltraps 80107645: e9 cc f0 ff ff jmp 80106716 <alltraps> 8010764a <vector247>: .globl vector247 vector247: pushl $0 8010764a: 6a 00 push $0x0 pushl $247 8010764c: 68 f7 00 00 00 push $0xf7 jmp alltraps 80107651: e9 c0 f0 ff ff jmp 80106716 <alltraps> 80107656 <vector248>: .globl vector248 vector248: pushl $0 80107656: 6a 00 push $0x0 pushl $248 80107658: 68 f8 00 00 00 push $0xf8 jmp alltraps 8010765d: e9 b4 f0 ff ff jmp 80106716 <alltraps> 80107662 <vector249>: .globl vector249 vector249: pushl $0 80107662: 6a 00 push $0x0 pushl $249 80107664: 68 f9 00 00 00 push $0xf9 jmp alltraps 80107669: e9 a8 f0 ff ff jmp 80106716 <alltraps> 8010766e <vector250>: .globl vector250 vector250: pushl $0 8010766e: 6a 00 push $0x0 pushl $250 80107670: 68 fa 00 00 00 push $0xfa jmp alltraps 80107675: e9 9c f0 ff ff jmp 80106716 <alltraps> 8010767a <vector251>: .globl vector251 vector251: pushl $0 8010767a: 6a 00 push $0x0 pushl $251 8010767c: 68 fb 00 00 00 push $0xfb jmp alltraps 80107681: e9 90 f0 ff ff jmp 80106716 <alltraps> 80107686 <vector252>: .globl vector252 vector252: pushl $0 80107686: 6a 00 push $0x0 pushl $252 80107688: 68 fc 00 00 00 push $0xfc jmp alltraps 8010768d: e9 84 f0 ff ff jmp 80106716 <alltraps> 80107692 <vector253>: .globl vector253 vector253: pushl $0 80107692: 6a 00 push $0x0 pushl $253 80107694: 68 fd 00 00 00 push $0xfd jmp alltraps 80107699: e9 78 f0 ff ff jmp 80106716 <alltraps> 8010769e <vector254>: .globl vector254 vector254: pushl $0 8010769e: 6a 00 push $0x0 pushl $254 801076a0: 68 fe 00 00 00 push $0xfe jmp alltraps 801076a5: e9 6c f0 ff ff jmp 80106716 <alltraps> 801076aa <vector255>: .globl vector255 vector255: pushl $0 801076aa: 6a 00 push $0x0 pushl $255 801076ac: 68 ff 00 00 00 push $0xff jmp alltraps 801076b1: e9 60 f0 ff ff jmp 80106716 <alltraps> 801076b6: 66 90 xchg %ax,%ax 801076b8: 66 90 xchg %ax,%ax 801076ba: 66 90 xchg %ax,%ax 801076bc: 66 90 xchg %ax,%ax 801076be: 66 90 xchg %ax,%ax 801076c0 <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) { 801076c0: 55 push %ebp 801076c1: 89 e5 mov %esp,%ebp 801076c3: 83 ec 28 sub $0x28,%esp 801076c6: 89 5d f4 mov %ebx,-0xc(%ebp) pde_t *pde; pte_t *pgtab; pde = &pgdir[PDX(va)]; 801076c9: 89 d3 mov %edx,%ebx 801076cb: c1 eb 16 shr $0x16,%ebx { 801076ce: 89 75 f8 mov %esi,-0x8(%ebp) pde = &pgdir[PDX(va)]; 801076d1: 8d 34 98 lea (%eax,%ebx,4),%esi { 801076d4: 89 7d fc mov %edi,-0x4(%ebp) 801076d7: 89 d7 mov %edx,%edi if(*pde & PTE_P){ 801076d9: 8b 06 mov (%esi),%eax 801076db: a8 01 test $0x1,%al 801076dd: 74 29 je 80107708 <walkpgdir+0x48> pgtab = (pte_t*)P2V(PTE_ADDR(*pde)); 801076df: 25 00 f0 ff ff and $0xfffff000,%eax 801076e4: 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)]; 801076ea: c1 ef 0a shr $0xa,%edi } 801076ed: 8b 75 f8 mov -0x8(%ebp),%esi return &pgtab[PTX(va)]; 801076f0: 89 fa mov %edi,%edx } 801076f2: 8b 7d fc mov -0x4(%ebp),%edi return &pgtab[PTX(va)]; 801076f5: 81 e2 fc 0f 00 00 and $0xffc,%edx 801076fb: 8d 04 13 lea (%ebx,%edx,1),%eax } 801076fe: 8b 5d f4 mov -0xc(%ebp),%ebx 80107701: 89 ec mov %ebp,%esp 80107703: 5d pop %ebp 80107704: c3 ret 80107705: 8d 76 00 lea 0x0(%esi),%esi if(!alloc || (pgtab = (pte_t*)kalloc()) == 0) 80107708: 85 c9 test %ecx,%ecx 8010770a: 74 34 je 80107740 <walkpgdir+0x80> 8010770c: e8 9f ae ff ff call 801025b0 <kalloc> 80107711: 85 c0 test %eax,%eax 80107713: 89 c3 mov %eax,%ebx 80107715: 74 29 je 80107740 <walkpgdir+0x80> memset(pgtab, 0, PGSIZE); 80107717: b8 00 10 00 00 mov $0x1000,%eax 8010771c: 31 d2 xor %edx,%edx 8010771e: 89 44 24 08 mov %eax,0x8(%esp) 80107722: 89 54 24 04 mov %edx,0x4(%esp) 80107726: 89 1c 24 mov %ebx,(%esp) 80107729: e8 b2 dd ff ff call 801054e0 <memset> *pde = V2P(pgtab) | PTE_P | PTE_W | PTE_U; 8010772e: 8d 83 00 00 00 80 lea -0x80000000(%ebx),%eax 80107734: 83 c8 07 or $0x7,%eax 80107737: 89 06 mov %eax,(%esi) 80107739: eb af jmp 801076ea <walkpgdir+0x2a> 8010773b: 90 nop 8010773c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi } 80107740: 8b 5d f4 mov -0xc(%ebp),%ebx return 0; 80107743: 31 c0 xor %eax,%eax } 80107745: 8b 75 f8 mov -0x8(%ebp),%esi 80107748: 8b 7d fc mov -0x4(%ebp),%edi 8010774b: 89 ec mov %ebp,%esp 8010774d: 5d pop %ebp 8010774e: c3 ret 8010774f: 90 nop 80107750 <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) { 80107750: 55 push %ebp 80107751: 89 e5 mov %esp,%ebp 80107753: 57 push %edi 80107754: 56 push %esi 80107755: 53 push %ebx char *a, *last; pte_t *pte; a = (char*)PGROUNDDOWN((uint)va); 80107756: 89 d3 mov %edx,%ebx { 80107758: 83 ec 2c sub $0x2c,%esp a = (char*)PGROUNDDOWN((uint)va); 8010775b: 81 e3 00 f0 ff ff and $0xfffff000,%ebx { 80107761: 89 45 e4 mov %eax,-0x1c(%ebp) last = (char*)PGROUNDDOWN(((uint)va) + size - 1); 80107764: 8d 44 0a ff lea -0x1(%edx,%ecx,1),%eax 80107768: 8b 7d 08 mov 0x8(%ebp),%edi 8010776b: 25 00 f0 ff ff and $0xfffff000,%eax 80107770: 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; 80107773: 8b 45 0c mov 0xc(%ebp),%eax 80107776: 29 df sub %ebx,%edi 80107778: 83 c8 01 or $0x1,%eax 8010777b: 89 45 dc mov %eax,-0x24(%ebp) 8010777e: eb 17 jmp 80107797 <mappages+0x47> if(*pte & PTE_P) 80107780: f6 00 01 testb $0x1,(%eax) 80107783: 75 45 jne 801077ca <mappages+0x7a> *pte = pa | perm | PTE_P; 80107785: 8b 55 dc mov -0x24(%ebp),%edx 80107788: 09 d6 or %edx,%esi if(a == last) 8010778a: 3b 5d e0 cmp -0x20(%ebp),%ebx *pte = pa | perm | PTE_P; 8010778d: 89 30 mov %esi,(%eax) if(a == last) 8010778f: 74 2f je 801077c0 <mappages+0x70> break; a += PGSIZE; 80107791: 81 c3 00 10 00 00 add $0x1000,%ebx if((pte = walkpgdir(pgdir, a, 1)) == 0) 80107797: 8b 45 e4 mov -0x1c(%ebp),%eax 8010779a: b9 01 00 00 00 mov $0x1,%ecx 8010779f: 89 da mov %ebx,%edx 801077a1: 8d 34 3b lea (%ebx,%edi,1),%esi 801077a4: e8 17 ff ff ff call 801076c0 <walkpgdir> 801077a9: 85 c0 test %eax,%eax 801077ab: 75 d3 jne 80107780 <mappages+0x30> pa += PGSIZE; } return 0; } 801077ad: 83 c4 2c add $0x2c,%esp return -1; 801077b0: b8 ff ff ff ff mov $0xffffffff,%eax } 801077b5: 5b pop %ebx 801077b6: 5e pop %esi 801077b7: 5f pop %edi 801077b8: 5d pop %ebp 801077b9: c3 ret 801077ba: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801077c0: 83 c4 2c add $0x2c,%esp return 0; 801077c3: 31 c0 xor %eax,%eax } 801077c5: 5b pop %ebx 801077c6: 5e pop %esi 801077c7: 5f pop %edi 801077c8: 5d pop %ebp 801077c9: c3 ret panic("remap"); 801077ca: c7 04 24 30 89 10 80 movl $0x80108930,(%esp) 801077d1: e8 9a 8b ff ff call 80100370 <panic> 801077d6: 8d 76 00 lea 0x0(%esi),%esi 801077d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801077e0 <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) 801077e0: 55 push %ebp 801077e1: 89 e5 mov %esp,%ebp 801077e3: 57 push %edi 801077e4: 89 c7 mov %eax,%edi 801077e6: 56 push %esi 801077e7: 53 push %ebx uint a, pa; if(newsz >= oldsz) return oldsz; a = PGROUNDUP(newsz); 801077e8: 8d 99 ff 0f 00 00 lea 0xfff(%ecx),%ebx deallocuvm(pde_t *pgdir, uint oldsz, uint newsz) 801077ee: 83 ec 2c sub $0x2c,%esp a = PGROUNDUP(newsz); 801077f1: 81 e3 00 f0 ff ff and $0xfffff000,%ebx for(; a < oldsz; a += PGSIZE){ 801077f7: 39 d3 cmp %edx,%ebx deallocuvm(pde_t *pgdir, uint oldsz, uint newsz) 801077f9: 89 4d e0 mov %ecx,-0x20(%ebp) for(; a < oldsz; a += PGSIZE){ 801077fc: 73 62 jae 80107860 <deallocuvm.part.0+0x80> 801077fe: 89 d6 mov %edx,%esi 80107800: eb 39 jmp 8010783b <deallocuvm.part.0+0x5b> 80107802: 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){ 80107808: 8b 10 mov (%eax),%edx 8010780a: f6 c2 01 test $0x1,%dl 8010780d: 74 22 je 80107831 <deallocuvm.part.0+0x51> pa = PTE_ADDR(*pte); if(pa == 0) 8010780f: 81 e2 00 f0 ff ff and $0xfffff000,%edx 80107815: 74 54 je 8010786b <deallocuvm.part.0+0x8b> panic("kfree"); char *v = P2V(pa); 80107817: 81 c2 00 00 00 80 add $0x80000000,%edx kfree(v); 8010781d: 89 14 24 mov %edx,(%esp) 80107820: 89 45 e4 mov %eax,-0x1c(%ebp) 80107823: e8 b8 ab ff ff call 801023e0 <kfree> *pte = 0; 80107828: 8b 45 e4 mov -0x1c(%ebp),%eax 8010782b: c7 00 00 00 00 00 movl $0x0,(%eax) for(; a < oldsz; a += PGSIZE){ 80107831: 81 c3 00 10 00 00 add $0x1000,%ebx 80107837: 39 f3 cmp %esi,%ebx 80107839: 73 25 jae 80107860 <deallocuvm.part.0+0x80> pte = walkpgdir(pgdir, (char*)a, 0); 8010783b: 31 c9 xor %ecx,%ecx 8010783d: 89 da mov %ebx,%edx 8010783f: 89 f8 mov %edi,%eax 80107841: e8 7a fe ff ff call 801076c0 <walkpgdir> if(!pte) 80107846: 85 c0 test %eax,%eax 80107848: 75 be jne 80107808 <deallocuvm.part.0+0x28> a = PGADDR(PDX(a) + 1, 0, 0) - PGSIZE; 8010784a: 81 e3 00 00 c0 ff and $0xffc00000,%ebx 80107850: 81 c3 00 f0 3f 00 add $0x3ff000,%ebx for(; a < oldsz; a += PGSIZE){ 80107856: 81 c3 00 10 00 00 add $0x1000,%ebx 8010785c: 39 f3 cmp %esi,%ebx 8010785e: 72 db jb 8010783b <deallocuvm.part.0+0x5b> } } return newsz; } 80107860: 8b 45 e0 mov -0x20(%ebp),%eax 80107863: 83 c4 2c add $0x2c,%esp 80107866: 5b pop %ebx 80107867: 5e pop %esi 80107868: 5f pop %edi 80107869: 5d pop %ebp 8010786a: c3 ret panic("kfree"); 8010786b: c7 04 24 86 82 10 80 movl $0x80108286,(%esp) 80107872: e8 f9 8a ff ff call 80100370 <panic> 80107877: 89 f6 mov %esi,%esi 80107879: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80107880 <seginit>: { 80107880: 55 push %ebp 80107881: 89 e5 mov %esp,%ebp 80107883: 83 ec 18 sub $0x18,%esp c = &cpus[cpuid()]; 80107886: e8 15 c1 ff ff call 801039a0 <cpuid> c->gdt[SEG_KCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, 0); 8010788b: b9 00 9a cf 00 mov $0xcf9a00,%ecx pd[0] = size-1; 80107890: 66 c7 45 f2 2f 00 movw $0x2f,-0xe(%ebp) 80107896: 8d 14 80 lea (%eax,%eax,4),%edx 80107899: 8d 04 50 lea (%eax,%edx,2),%eax 8010789c: ba ff ff 00 00 mov $0xffff,%edx 801078a1: c1 e0 04 shl $0x4,%eax 801078a4: 89 90 58 38 11 80 mov %edx,-0x7feec7a8(%eax) c->gdt[SEG_KDATA] = SEG(STA_W, 0, 0xffffffff, 0); 801078aa: ba ff ff 00 00 mov $0xffff,%edx c->gdt[SEG_KCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, 0); 801078af: 89 88 5c 38 11 80 mov %ecx,-0x7feec7a4(%eax) c->gdt[SEG_KDATA] = SEG(STA_W, 0, 0xffffffff, 0); 801078b5: b9 00 92 cf 00 mov $0xcf9200,%ecx 801078ba: 89 90 60 38 11 80 mov %edx,-0x7feec7a0(%eax) c->gdt[SEG_UCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, DPL_USER); 801078c0: ba ff ff 00 00 mov $0xffff,%edx c->gdt[SEG_KDATA] = SEG(STA_W, 0, 0xffffffff, 0); 801078c5: 89 88 64 38 11 80 mov %ecx,-0x7feec79c(%eax) c->gdt[SEG_UCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, DPL_USER); 801078cb: b9 00 fa cf 00 mov $0xcffa00,%ecx 801078d0: 89 90 68 38 11 80 mov %edx,-0x7feec798(%eax) c->gdt[SEG_UDATA] = SEG(STA_W, 0, 0xffffffff, DPL_USER); 801078d6: ba ff ff 00 00 mov $0xffff,%edx c->gdt[SEG_UCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, DPL_USER); 801078db: 89 88 6c 38 11 80 mov %ecx,-0x7feec794(%eax) c->gdt[SEG_UDATA] = SEG(STA_W, 0, 0xffffffff, DPL_USER); 801078e1: b9 00 f2 cf 00 mov $0xcff200,%ecx 801078e6: 89 90 70 38 11 80 mov %edx,-0x7feec790(%eax) 801078ec: 89 88 74 38 11 80 mov %ecx,-0x7feec78c(%eax) lgdt(c->gdt, sizeof(c->gdt)); 801078f2: 05 50 38 11 80 add $0x80113850,%eax pd[1] = (uint)p; 801078f7: 0f b7 d0 movzwl %ax,%edx pd[2] = (uint)p >> 16; 801078fa: c1 e8 10 shr $0x10,%eax pd[1] = (uint)p; 801078fd: 66 89 55 f4 mov %dx,-0xc(%ebp) pd[2] = (uint)p >> 16; 80107901: 66 89 45 f6 mov %ax,-0xa(%ebp) asm volatile("lgdt (%0)" : : "r" (pd)); 80107905: 8d 45 f2 lea -0xe(%ebp),%eax 80107908: 0f 01 10 lgdtl (%eax) } 8010790b: c9 leave 8010790c: c3 ret 8010790d: 8d 76 00 lea 0x0(%esi),%esi 80107910 <switchkvm>: lcr3(V2P(kpgdir)); // switch to the kernel page table 80107910: a1 04 6a 11 80 mov 0x80116a04,%eax { 80107915: 55 push %ebp 80107916: 89 e5 mov %esp,%ebp lcr3(V2P(kpgdir)); // switch to the kernel page table 80107918: 05 00 00 00 80 add $0x80000000,%eax } static inline void lcr3(uint val) { asm volatile("movl %0,%%cr3" : : "r" (val)); 8010791d: 0f 22 d8 mov %eax,%cr3 } 80107920: 5d pop %ebp 80107921: c3 ret 80107922: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80107929: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80107930 <switchuvm>: { 80107930: 55 push %ebp 80107931: 89 e5 mov %esp,%ebp 80107933: 57 push %edi 80107934: 56 push %esi 80107935: 53 push %ebx 80107936: 83 ec 2c sub $0x2c,%esp 80107939: 8b 5d 08 mov 0x8(%ebp),%ebx if(p == 0) 8010793c: 85 db test %ebx,%ebx 8010793e: 0f 84 c5 00 00 00 je 80107a09 <switchuvm+0xd9> if(p->kstack == 0) 80107944: 8b 7b 08 mov 0x8(%ebx),%edi 80107947: 85 ff test %edi,%edi 80107949: 0f 84 d2 00 00 00 je 80107a21 <switchuvm+0xf1> if(p->pgdir == 0) 8010794f: 8b 73 04 mov 0x4(%ebx),%esi 80107952: 85 f6 test %esi,%esi 80107954: 0f 84 bb 00 00 00 je 80107a15 <switchuvm+0xe5> pushcli(); 8010795a: e8 b1 d9 ff ff call 80105310 <pushcli> mycpu()->gdt[SEG_TSS] = SEG16(STS_T32A, &mycpu()->ts, 8010795f: e8 bc bf ff ff call 80103920 <mycpu> 80107964: 89 c6 mov %eax,%esi 80107966: e8 b5 bf ff ff call 80103920 <mycpu> 8010796b: 89 c7 mov %eax,%edi 8010796d: e8 ae bf ff ff call 80103920 <mycpu> 80107972: 83 c7 08 add $0x8,%edi 80107975: 89 45 e4 mov %eax,-0x1c(%ebp) 80107978: e8 a3 bf ff ff call 80103920 <mycpu> 8010797d: 8b 4d e4 mov -0x1c(%ebp),%ecx 80107980: ba 67 00 00 00 mov $0x67,%edx 80107985: 66 89 96 98 00 00 00 mov %dx,0x98(%esi) 8010798c: 66 89 be 9a 00 00 00 mov %di,0x9a(%esi) 80107993: 83 c1 08 add $0x8,%ecx 80107996: c1 e9 10 shr $0x10,%ecx 80107999: 83 c0 08 add $0x8,%eax 8010799c: 88 8e 9c 00 00 00 mov %cl,0x9c(%esi) 801079a2: c1 e8 18 shr $0x18,%eax 801079a5: b9 99 40 00 00 mov $0x4099,%ecx 801079aa: 66 89 8e 9d 00 00 00 mov %cx,0x9d(%esi) 801079b1: 88 86 9f 00 00 00 mov %al,0x9f(%esi) mycpu()->gdt[SEG_TSS].s = 0; 801079b7: e8 64 bf ff ff call 80103920 <mycpu> 801079bc: 80 a0 9d 00 00 00 ef andb $0xef,0x9d(%eax) mycpu()->ts.ss0 = SEG_KDATA << 3; 801079c3: e8 58 bf ff ff call 80103920 <mycpu> 801079c8: 66 c7 40 10 10 00 movw $0x10,0x10(%eax) mycpu()->ts.esp0 = (uint)p->kstack + KSTACKSIZE; 801079ce: 8b 73 08 mov 0x8(%ebx),%esi 801079d1: e8 4a bf ff ff call 80103920 <mycpu> 801079d6: 81 c6 00 10 00 00 add $0x1000,%esi 801079dc: 89 70 0c mov %esi,0xc(%eax) mycpu()->ts.iomb = (ushort) 0xFFFF; 801079df: e8 3c bf ff ff call 80103920 <mycpu> 801079e4: 66 c7 40 6e ff ff movw $0xffff,0x6e(%eax) asm volatile("ltr %0" : : "r" (sel)); 801079ea: b8 28 00 00 00 mov $0x28,%eax 801079ef: 0f 00 d8 ltr %ax lcr3(V2P(p->pgdir)); // switch to process's address space 801079f2: 8b 43 04 mov 0x4(%ebx),%eax 801079f5: 05 00 00 00 80 add $0x80000000,%eax asm volatile("movl %0,%%cr3" : : "r" (val)); 801079fa: 0f 22 d8 mov %eax,%cr3 } 801079fd: 83 c4 2c add $0x2c,%esp 80107a00: 5b pop %ebx 80107a01: 5e pop %esi 80107a02: 5f pop %edi 80107a03: 5d pop %ebp popcli(); 80107a04: e9 47 d9 ff ff jmp 80105350 <popcli> panic("switchuvm: no process"); 80107a09: c7 04 24 36 89 10 80 movl $0x80108936,(%esp) 80107a10: e8 5b 89 ff ff call 80100370 <panic> panic("switchuvm: no pgdir"); 80107a15: c7 04 24 61 89 10 80 movl $0x80108961,(%esp) 80107a1c: e8 4f 89 ff ff call 80100370 <panic> panic("switchuvm: no kstack"); 80107a21: c7 04 24 4c 89 10 80 movl $0x8010894c,(%esp) 80107a28: e8 43 89 ff ff call 80100370 <panic> 80107a2d: 8d 76 00 lea 0x0(%esi),%esi 80107a30 <inituvm>: { 80107a30: 55 push %ebp 80107a31: 89 e5 mov %esp,%ebp 80107a33: 83 ec 38 sub $0x38,%esp 80107a36: 89 75 f8 mov %esi,-0x8(%ebp) 80107a39: 8b 75 10 mov 0x10(%ebp),%esi 80107a3c: 8b 45 08 mov 0x8(%ebp),%eax 80107a3f: 89 7d fc mov %edi,-0x4(%ebp) 80107a42: 8b 7d 0c mov 0xc(%ebp),%edi 80107a45: 89 5d f4 mov %ebx,-0xc(%ebp) if(sz >= PGSIZE) 80107a48: 81 fe ff 0f 00 00 cmp $0xfff,%esi { 80107a4e: 89 45 e4 mov %eax,-0x1c(%ebp) if(sz >= PGSIZE) 80107a51: 77 59 ja 80107aac <inituvm+0x7c> mem = kalloc(); 80107a53: e8 58 ab ff ff call 801025b0 <kalloc> memset(mem, 0, PGSIZE); 80107a58: 31 d2 xor %edx,%edx 80107a5a: 89 54 24 04 mov %edx,0x4(%esp) mem = kalloc(); 80107a5e: 89 c3 mov %eax,%ebx memset(mem, 0, PGSIZE); 80107a60: b8 00 10 00 00 mov $0x1000,%eax 80107a65: 89 1c 24 mov %ebx,(%esp) 80107a68: 89 44 24 08 mov %eax,0x8(%esp) 80107a6c: e8 6f da ff ff call 801054e0 <memset> mappages(pgdir, 0, PGSIZE, V2P(mem), PTE_W|PTE_U); 80107a71: 8d 83 00 00 00 80 lea -0x80000000(%ebx),%eax 80107a77: b9 06 00 00 00 mov $0x6,%ecx 80107a7c: 89 04 24 mov %eax,(%esp) 80107a7f: 8b 45 e4 mov -0x1c(%ebp),%eax 80107a82: 31 d2 xor %edx,%edx 80107a84: 89 4c 24 04 mov %ecx,0x4(%esp) 80107a88: b9 00 10 00 00 mov $0x1000,%ecx 80107a8d: e8 be fc ff ff call 80107750 <mappages> memmove(mem, init, sz); 80107a92: 89 75 10 mov %esi,0x10(%ebp) } 80107a95: 8b 75 f8 mov -0x8(%ebp),%esi memmove(mem, init, sz); 80107a98: 89 7d 0c mov %edi,0xc(%ebp) } 80107a9b: 8b 7d fc mov -0x4(%ebp),%edi memmove(mem, init, sz); 80107a9e: 89 5d 08 mov %ebx,0x8(%ebp) } 80107aa1: 8b 5d f4 mov -0xc(%ebp),%ebx 80107aa4: 89 ec mov %ebp,%esp 80107aa6: 5d pop %ebp memmove(mem, init, sz); 80107aa7: e9 f4 da ff ff jmp 801055a0 <memmove> panic("inituvm: more than a page"); 80107aac: c7 04 24 75 89 10 80 movl $0x80108975,(%esp) 80107ab3: e8 b8 88 ff ff call 80100370 <panic> 80107ab8: 90 nop 80107ab9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80107ac0 <loaduvm>: { 80107ac0: 55 push %ebp 80107ac1: 89 e5 mov %esp,%ebp 80107ac3: 57 push %edi 80107ac4: 56 push %esi 80107ac5: 53 push %ebx 80107ac6: 83 ec 1c sub $0x1c,%esp if((uint) addr % PGSIZE != 0) 80107ac9: f7 45 0c ff 0f 00 00 testl $0xfff,0xc(%ebp) 80107ad0: 0f 85 98 00 00 00 jne 80107b6e <loaduvm+0xae> for(i = 0; i < sz; i += PGSIZE){ 80107ad6: 8b 75 18 mov 0x18(%ebp),%esi 80107ad9: 31 db xor %ebx,%ebx 80107adb: 85 f6 test %esi,%esi 80107add: 75 1a jne 80107af9 <loaduvm+0x39> 80107adf: eb 77 jmp 80107b58 <loaduvm+0x98> 80107ae1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80107ae8: 81 c3 00 10 00 00 add $0x1000,%ebx 80107aee: 81 ee 00 10 00 00 sub $0x1000,%esi 80107af4: 39 5d 18 cmp %ebx,0x18(%ebp) 80107af7: 76 5f jbe 80107b58 <loaduvm+0x98> if((pte = walkpgdir(pgdir, addr+i, 0)) == 0) 80107af9: 8b 55 0c mov 0xc(%ebp),%edx 80107afc: 31 c9 xor %ecx,%ecx 80107afe: 8b 45 08 mov 0x8(%ebp),%eax 80107b01: 01 da add %ebx,%edx 80107b03: e8 b8 fb ff ff call 801076c0 <walkpgdir> 80107b08: 85 c0 test %eax,%eax 80107b0a: 74 56 je 80107b62 <loaduvm+0xa2> pa = PTE_ADDR(*pte); 80107b0c: 8b 00 mov (%eax),%eax if(sz - i < PGSIZE) 80107b0e: bf 00 10 00 00 mov $0x1000,%edi if(readi(ip, P2V(pa), offset+i, n) != n) 80107b13: 8b 4d 14 mov 0x14(%ebp),%ecx pa = PTE_ADDR(*pte); 80107b16: 25 00 f0 ff ff and $0xfffff000,%eax if(sz - i < PGSIZE) 80107b1b: 81 fe ff 0f 00 00 cmp $0xfff,%esi 80107b21: 0f 46 fe cmovbe %esi,%edi if(readi(ip, P2V(pa), offset+i, n) != n) 80107b24: 05 00 00 00 80 add $0x80000000,%eax 80107b29: 89 44 24 04 mov %eax,0x4(%esp) 80107b2d: 8b 45 10 mov 0x10(%ebp),%eax 80107b30: 01 d9 add %ebx,%ecx 80107b32: 89 7c 24 0c mov %edi,0xc(%esp) 80107b36: 89 4c 24 08 mov %ecx,0x8(%esp) 80107b3a: 89 04 24 mov %eax,(%esp) 80107b3d: e8 8e 9e ff ff call 801019d0 <readi> 80107b42: 39 f8 cmp %edi,%eax 80107b44: 74 a2 je 80107ae8 <loaduvm+0x28> } 80107b46: 83 c4 1c add $0x1c,%esp return -1; 80107b49: b8 ff ff ff ff mov $0xffffffff,%eax } 80107b4e: 5b pop %ebx 80107b4f: 5e pop %esi 80107b50: 5f pop %edi 80107b51: 5d pop %ebp 80107b52: c3 ret 80107b53: 90 nop 80107b54: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80107b58: 83 c4 1c add $0x1c,%esp return 0; 80107b5b: 31 c0 xor %eax,%eax } 80107b5d: 5b pop %ebx 80107b5e: 5e pop %esi 80107b5f: 5f pop %edi 80107b60: 5d pop %ebp 80107b61: c3 ret panic("loaduvm: address should exist"); 80107b62: c7 04 24 8f 89 10 80 movl $0x8010898f,(%esp) 80107b69: e8 02 88 ff ff call 80100370 <panic> panic("loaduvm: addr must be page aligned"); 80107b6e: c7 04 24 30 8a 10 80 movl $0x80108a30,(%esp) 80107b75: e8 f6 87 ff ff call 80100370 <panic> 80107b7a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80107b80 <allocuvm>: { 80107b80: 55 push %ebp 80107b81: 89 e5 mov %esp,%ebp 80107b83: 57 push %edi 80107b84: 56 push %esi 80107b85: 53 push %ebx 80107b86: 83 ec 2c sub $0x2c,%esp if(newsz >= KERNBASE) 80107b89: 8b 7d 10 mov 0x10(%ebp),%edi 80107b8c: 85 ff test %edi,%edi 80107b8e: 0f 88 91 00 00 00 js 80107c25 <allocuvm+0xa5> if(newsz < oldsz) 80107b94: 3b 7d 0c cmp 0xc(%ebp),%edi 80107b97: 0f 82 9b 00 00 00 jb 80107c38 <allocuvm+0xb8> a = PGROUNDUP(oldsz); 80107b9d: 8b 45 0c mov 0xc(%ebp),%eax 80107ba0: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx 80107ba6: 81 e3 00 f0 ff ff and $0xfffff000,%ebx for(; a < newsz; a += PGSIZE){ 80107bac: 39 5d 10 cmp %ebx,0x10(%ebp) 80107baf: 0f 86 86 00 00 00 jbe 80107c3b <allocuvm+0xbb> 80107bb5: 89 7d e4 mov %edi,-0x1c(%ebp) 80107bb8: 8b 7d 08 mov 0x8(%ebp),%edi 80107bbb: eb 49 jmp 80107c06 <allocuvm+0x86> 80107bbd: 8d 76 00 lea 0x0(%esi),%esi memset(mem, 0, PGSIZE); 80107bc0: 31 d2 xor %edx,%edx 80107bc2: b8 00 10 00 00 mov $0x1000,%eax 80107bc7: 89 54 24 04 mov %edx,0x4(%esp) 80107bcb: 89 44 24 08 mov %eax,0x8(%esp) 80107bcf: 89 34 24 mov %esi,(%esp) 80107bd2: e8 09 d9 ff ff call 801054e0 <memset> if(mappages(pgdir, (char*)a, PGSIZE, V2P(mem), PTE_W|PTE_U) < 0){ 80107bd7: b9 06 00 00 00 mov $0x6,%ecx 80107bdc: 89 da mov %ebx,%edx 80107bde: 8d 86 00 00 00 80 lea -0x80000000(%esi),%eax 80107be4: 89 4c 24 04 mov %ecx,0x4(%esp) 80107be8: b9 00 10 00 00 mov $0x1000,%ecx 80107bed: 89 04 24 mov %eax,(%esp) 80107bf0: 89 f8 mov %edi,%eax 80107bf2: e8 59 fb ff ff call 80107750 <mappages> 80107bf7: 85 c0 test %eax,%eax 80107bf9: 78 4d js 80107c48 <allocuvm+0xc8> for(; a < newsz; a += PGSIZE){ 80107bfb: 81 c3 00 10 00 00 add $0x1000,%ebx 80107c01: 39 5d 10 cmp %ebx,0x10(%ebp) 80107c04: 76 7a jbe 80107c80 <allocuvm+0x100> mem = kalloc(); 80107c06: e8 a5 a9 ff ff call 801025b0 <kalloc> if(mem == 0){ 80107c0b: 85 c0 test %eax,%eax mem = kalloc(); 80107c0d: 89 c6 mov %eax,%esi if(mem == 0){ 80107c0f: 75 af jne 80107bc0 <allocuvm+0x40> cprintf("allocuvm out of memory\n"); 80107c11: c7 04 24 ad 89 10 80 movl $0x801089ad,(%esp) 80107c18: e8 33 8a ff ff call 80100650 <cprintf> if(newsz >= oldsz) 80107c1d: 8b 45 0c mov 0xc(%ebp),%eax 80107c20: 39 45 10 cmp %eax,0x10(%ebp) 80107c23: 77 6b ja 80107c90 <allocuvm+0x110> } 80107c25: 83 c4 2c add $0x2c,%esp return 0; 80107c28: 31 ff xor %edi,%edi } 80107c2a: 5b pop %ebx 80107c2b: 89 f8 mov %edi,%eax 80107c2d: 5e pop %esi 80107c2e: 5f pop %edi 80107c2f: 5d pop %ebp 80107c30: c3 ret 80107c31: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return oldsz; 80107c38: 8b 7d 0c mov 0xc(%ebp),%edi } 80107c3b: 83 c4 2c add $0x2c,%esp 80107c3e: 89 f8 mov %edi,%eax 80107c40: 5b pop %ebx 80107c41: 5e pop %esi 80107c42: 5f pop %edi 80107c43: 5d pop %ebp 80107c44: c3 ret 80107c45: 8d 76 00 lea 0x0(%esi),%esi cprintf("allocuvm out of memory (2)\n"); 80107c48: c7 04 24 c5 89 10 80 movl $0x801089c5,(%esp) 80107c4f: e8 fc 89 ff ff call 80100650 <cprintf> if(newsz >= oldsz) 80107c54: 8b 45 0c mov 0xc(%ebp),%eax 80107c57: 39 45 10 cmp %eax,0x10(%ebp) 80107c5a: 76 0d jbe 80107c69 <allocuvm+0xe9> 80107c5c: 89 c1 mov %eax,%ecx 80107c5e: 8b 55 10 mov 0x10(%ebp),%edx 80107c61: 8b 45 08 mov 0x8(%ebp),%eax 80107c64: e8 77 fb ff ff call 801077e0 <deallocuvm.part.0> kfree(mem); 80107c69: 89 34 24 mov %esi,(%esp) return 0; 80107c6c: 31 ff xor %edi,%edi kfree(mem); 80107c6e: e8 6d a7 ff ff call 801023e0 <kfree> } 80107c73: 83 c4 2c add $0x2c,%esp 80107c76: 89 f8 mov %edi,%eax 80107c78: 5b pop %ebx 80107c79: 5e pop %esi 80107c7a: 5f pop %edi 80107c7b: 5d pop %ebp 80107c7c: c3 ret 80107c7d: 8d 76 00 lea 0x0(%esi),%esi 80107c80: 8b 7d e4 mov -0x1c(%ebp),%edi 80107c83: 83 c4 2c add $0x2c,%esp 80107c86: 5b pop %ebx 80107c87: 5e pop %esi 80107c88: 89 f8 mov %edi,%eax 80107c8a: 5f pop %edi 80107c8b: 5d pop %ebp 80107c8c: c3 ret 80107c8d: 8d 76 00 lea 0x0(%esi),%esi 80107c90: 89 c1 mov %eax,%ecx 80107c92: 8b 55 10 mov 0x10(%ebp),%edx return 0; 80107c95: 31 ff xor %edi,%edi 80107c97: 8b 45 08 mov 0x8(%ebp),%eax 80107c9a: e8 41 fb ff ff call 801077e0 <deallocuvm.part.0> 80107c9f: eb 9a jmp 80107c3b <allocuvm+0xbb> 80107ca1: eb 0d jmp 80107cb0 <deallocuvm> 80107ca3: 90 nop 80107ca4: 90 nop 80107ca5: 90 nop 80107ca6: 90 nop 80107ca7: 90 nop 80107ca8: 90 nop 80107ca9: 90 nop 80107caa: 90 nop 80107cab: 90 nop 80107cac: 90 nop 80107cad: 90 nop 80107cae: 90 nop 80107caf: 90 nop 80107cb0 <deallocuvm>: { 80107cb0: 55 push %ebp 80107cb1: 89 e5 mov %esp,%ebp 80107cb3: 8b 55 0c mov 0xc(%ebp),%edx 80107cb6: 8b 4d 10 mov 0x10(%ebp),%ecx 80107cb9: 8b 45 08 mov 0x8(%ebp),%eax if(newsz >= oldsz) 80107cbc: 39 d1 cmp %edx,%ecx 80107cbe: 73 10 jae 80107cd0 <deallocuvm+0x20> } 80107cc0: 5d pop %ebp 80107cc1: e9 1a fb ff ff jmp 801077e0 <deallocuvm.part.0> 80107cc6: 8d 76 00 lea 0x0(%esi),%esi 80107cc9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80107cd0: 89 d0 mov %edx,%eax 80107cd2: 5d pop %ebp 80107cd3: c3 ret 80107cd4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80107cda: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80107ce0 <freevm>: // Free a page table and all the physical memory pages // in the user part. void freevm(pde_t *pgdir) { 80107ce0: 55 push %ebp 80107ce1: 89 e5 mov %esp,%ebp 80107ce3: 57 push %edi 80107ce4: 56 push %esi 80107ce5: 53 push %ebx 80107ce6: 83 ec 1c sub $0x1c,%esp 80107ce9: 8b 75 08 mov 0x8(%ebp),%esi uint i; if(pgdir == 0) 80107cec: 85 f6 test %esi,%esi 80107cee: 74 55 je 80107d45 <freevm+0x65> 80107cf0: 31 c9 xor %ecx,%ecx 80107cf2: ba 00 00 00 80 mov $0x80000000,%edx 80107cf7: 89 f0 mov %esi,%eax 80107cf9: 89 f3 mov %esi,%ebx 80107cfb: e8 e0 fa ff ff call 801077e0 <deallocuvm.part.0> 80107d00: 8d be 00 10 00 00 lea 0x1000(%esi),%edi 80107d06: eb 0f jmp 80107d17 <freevm+0x37> 80107d08: 90 nop 80107d09: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80107d10: 83 c3 04 add $0x4,%ebx panic("freevm: no pgdir"); deallocuvm(pgdir, KERNBASE, 0); for(i = 0; i < NPDENTRIES; i++){ 80107d13: 39 fb cmp %edi,%ebx 80107d15: 74 1f je 80107d36 <freevm+0x56> if(pgdir[i] & PTE_P){ 80107d17: 8b 03 mov (%ebx),%eax 80107d19: a8 01 test $0x1,%al 80107d1b: 74 f3 je 80107d10 <freevm+0x30> char * v = P2V(PTE_ADDR(pgdir[i])); 80107d1d: 25 00 f0 ff ff and $0xfffff000,%eax 80107d22: 83 c3 04 add $0x4,%ebx 80107d25: 05 00 00 00 80 add $0x80000000,%eax kfree(v); 80107d2a: 89 04 24 mov %eax,(%esp) 80107d2d: e8 ae a6 ff ff call 801023e0 <kfree> for(i = 0; i < NPDENTRIES; i++){ 80107d32: 39 fb cmp %edi,%ebx 80107d34: 75 e1 jne 80107d17 <freevm+0x37> } } kfree((char*)pgdir); 80107d36: 89 75 08 mov %esi,0x8(%ebp) } 80107d39: 83 c4 1c add $0x1c,%esp 80107d3c: 5b pop %ebx 80107d3d: 5e pop %esi 80107d3e: 5f pop %edi 80107d3f: 5d pop %ebp kfree((char*)pgdir); 80107d40: e9 9b a6 ff ff jmp 801023e0 <kfree> panic("freevm: no pgdir"); 80107d45: c7 04 24 e1 89 10 80 movl $0x801089e1,(%esp) 80107d4c: e8 1f 86 ff ff call 80100370 <panic> 80107d51: eb 0d jmp 80107d60 <setupkvm> 80107d53: 90 nop 80107d54: 90 nop 80107d55: 90 nop 80107d56: 90 nop 80107d57: 90 nop 80107d58: 90 nop 80107d59: 90 nop 80107d5a: 90 nop 80107d5b: 90 nop 80107d5c: 90 nop 80107d5d: 90 nop 80107d5e: 90 nop 80107d5f: 90 nop 80107d60 <setupkvm>: { 80107d60: 55 push %ebp 80107d61: 89 e5 mov %esp,%ebp 80107d63: 56 push %esi 80107d64: 53 push %ebx 80107d65: 83 ec 10 sub $0x10,%esp if((pgdir = (pde_t*)kalloc()) == 0) 80107d68: e8 43 a8 ff ff call 801025b0 <kalloc> 80107d6d: 85 c0 test %eax,%eax 80107d6f: 89 c6 mov %eax,%esi 80107d71: 74 46 je 80107db9 <setupkvm+0x59> memset(pgdir, 0, PGSIZE); 80107d73: b8 00 10 00 00 mov $0x1000,%eax 80107d78: 31 d2 xor %edx,%edx 80107d7a: 89 44 24 08 mov %eax,0x8(%esp) for(k = kmap; k < &kmap[NELEM(kmap)]; k++) 80107d7e: bb 20 b4 10 80 mov $0x8010b420,%ebx memset(pgdir, 0, PGSIZE); 80107d83: 89 54 24 04 mov %edx,0x4(%esp) 80107d87: 89 34 24 mov %esi,(%esp) 80107d8a: e8 51 d7 ff ff call 801054e0 <memset> if(mappages(pgdir, k->virt, k->phys_end - k->phys_start, 80107d8f: 8b 53 0c mov 0xc(%ebx),%edx (uint)k->phys_start, k->perm) < 0) { 80107d92: 8b 43 04 mov 0x4(%ebx),%eax if(mappages(pgdir, k->virt, k->phys_end - k->phys_start, 80107d95: 8b 4b 08 mov 0x8(%ebx),%ecx 80107d98: 89 54 24 04 mov %edx,0x4(%esp) 80107d9c: 8b 13 mov (%ebx),%edx 80107d9e: 89 04 24 mov %eax,(%esp) 80107da1: 29 c1 sub %eax,%ecx 80107da3: 89 f0 mov %esi,%eax 80107da5: e8 a6 f9 ff ff call 80107750 <mappages> 80107daa: 85 c0 test %eax,%eax 80107dac: 78 1a js 80107dc8 <setupkvm+0x68> for(k = kmap; k < &kmap[NELEM(kmap)]; k++) 80107dae: 83 c3 10 add $0x10,%ebx 80107db1: 81 fb 60 b4 10 80 cmp $0x8010b460,%ebx 80107db7: 75 d6 jne 80107d8f <setupkvm+0x2f> } 80107db9: 83 c4 10 add $0x10,%esp 80107dbc: 89 f0 mov %esi,%eax 80107dbe: 5b pop %ebx 80107dbf: 5e pop %esi 80107dc0: 5d pop %ebp 80107dc1: c3 ret 80107dc2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi freevm(pgdir); 80107dc8: 89 34 24 mov %esi,(%esp) return 0; 80107dcb: 31 f6 xor %esi,%esi freevm(pgdir); 80107dcd: e8 0e ff ff ff call 80107ce0 <freevm> } 80107dd2: 83 c4 10 add $0x10,%esp 80107dd5: 89 f0 mov %esi,%eax 80107dd7: 5b pop %ebx 80107dd8: 5e pop %esi 80107dd9: 5d pop %ebp 80107dda: c3 ret 80107ddb: 90 nop 80107ddc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80107de0 <kvmalloc>: { 80107de0: 55 push %ebp 80107de1: 89 e5 mov %esp,%ebp 80107de3: 83 ec 08 sub $0x8,%esp kpgdir = setupkvm(); 80107de6: e8 75 ff ff ff call 80107d60 <setupkvm> 80107deb: a3 04 6a 11 80 mov %eax,0x80116a04 lcr3(V2P(kpgdir)); // switch to the kernel page table 80107df0: 05 00 00 00 80 add $0x80000000,%eax 80107df5: 0f 22 d8 mov %eax,%cr3 } 80107df8: c9 leave 80107df9: c3 ret 80107dfa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80107e00 <clearpteu>: // Clear PTE_U on a page. Used to create an inaccessible // page beneath the user stack. void clearpteu(pde_t *pgdir, char *uva) { 80107e00: 55 push %ebp pte_t *pte; pte = walkpgdir(pgdir, uva, 0); 80107e01: 31 c9 xor %ecx,%ecx { 80107e03: 89 e5 mov %esp,%ebp 80107e05: 83 ec 18 sub $0x18,%esp pte = walkpgdir(pgdir, uva, 0); 80107e08: 8b 55 0c mov 0xc(%ebp),%edx 80107e0b: 8b 45 08 mov 0x8(%ebp),%eax 80107e0e: e8 ad f8 ff ff call 801076c0 <walkpgdir> if(pte == 0) 80107e13: 85 c0 test %eax,%eax 80107e15: 74 05 je 80107e1c <clearpteu+0x1c> panic("clearpteu"); *pte &= ~PTE_U; 80107e17: 83 20 fb andl $0xfffffffb,(%eax) } 80107e1a: c9 leave 80107e1b: c3 ret panic("clearpteu"); 80107e1c: c7 04 24 f2 89 10 80 movl $0x801089f2,(%esp) 80107e23: e8 48 85 ff ff call 80100370 <panic> 80107e28: 90 nop 80107e29: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80107e30 <copyuvm>: // Given a parent process's page table, create a copy // of it for a child. pde_t* copyuvm(pde_t *pgdir, uint sz) { 80107e30: 55 push %ebp 80107e31: 89 e5 mov %esp,%ebp 80107e33: 57 push %edi 80107e34: 56 push %esi 80107e35: 53 push %ebx 80107e36: 83 ec 2c sub $0x2c,%esp pde_t *d; pte_t *pte; uint pa, i, flags; char *mem; if((d = setupkvm()) == 0) 80107e39: e8 22 ff ff ff call 80107d60 <setupkvm> 80107e3e: 85 c0 test %eax,%eax 80107e40: 89 45 e0 mov %eax,-0x20(%ebp) 80107e43: 0f 84 a3 00 00 00 je 80107eec <copyuvm+0xbc> return 0; for(i = 0; i < sz; i += PGSIZE){ 80107e49: 8b 55 0c mov 0xc(%ebp),%edx 80107e4c: 85 d2 test %edx,%edx 80107e4e: 0f 84 98 00 00 00 je 80107eec <copyuvm+0xbc> 80107e54: 31 ff xor %edi,%edi 80107e56: eb 50 jmp 80107ea8 <copyuvm+0x78> 80107e58: 90 nop 80107e59: 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); 80107e60: b8 00 10 00 00 mov $0x1000,%eax 80107e65: 89 44 24 08 mov %eax,0x8(%esp) 80107e69: 8b 45 e4 mov -0x1c(%ebp),%eax 80107e6c: 89 34 24 mov %esi,(%esp) 80107e6f: 05 00 00 00 80 add $0x80000000,%eax 80107e74: 89 44 24 04 mov %eax,0x4(%esp) 80107e78: e8 23 d7 ff ff call 801055a0 <memmove> if(mappages(d, (void*)i, PGSIZE, V2P(mem), flags) < 0) { 80107e7d: 8d 86 00 00 00 80 lea -0x80000000(%esi),%eax 80107e83: b9 00 10 00 00 mov $0x1000,%ecx 80107e88: 89 04 24 mov %eax,(%esp) 80107e8b: 8b 45 e0 mov -0x20(%ebp),%eax 80107e8e: 89 fa mov %edi,%edx 80107e90: 89 5c 24 04 mov %ebx,0x4(%esp) 80107e94: e8 b7 f8 ff ff call 80107750 <mappages> 80107e99: 85 c0 test %eax,%eax 80107e9b: 78 63 js 80107f00 <copyuvm+0xd0> for(i = 0; i < sz; i += PGSIZE){ 80107e9d: 81 c7 00 10 00 00 add $0x1000,%edi 80107ea3: 39 7d 0c cmp %edi,0xc(%ebp) 80107ea6: 76 44 jbe 80107eec <copyuvm+0xbc> if((pte = walkpgdir(pgdir, (void *) i, 0)) == 0) 80107ea8: 8b 45 08 mov 0x8(%ebp),%eax 80107eab: 31 c9 xor %ecx,%ecx 80107ead: 89 fa mov %edi,%edx 80107eaf: e8 0c f8 ff ff call 801076c0 <walkpgdir> 80107eb4: 85 c0 test %eax,%eax 80107eb6: 74 5e je 80107f16 <copyuvm+0xe6> if(!(*pte & PTE_P)) 80107eb8: 8b 18 mov (%eax),%ebx 80107eba: f6 c3 01 test $0x1,%bl 80107ebd: 74 4b je 80107f0a <copyuvm+0xda> pa = PTE_ADDR(*pte); 80107ebf: 89 d8 mov %ebx,%eax flags = PTE_FLAGS(*pte); 80107ec1: 81 e3 ff 0f 00 00 and $0xfff,%ebx pa = PTE_ADDR(*pte); 80107ec7: 25 00 f0 ff ff and $0xfffff000,%eax 80107ecc: 89 45 e4 mov %eax,-0x1c(%ebp) if((mem = kalloc()) == 0) 80107ecf: e8 dc a6 ff ff call 801025b0 <kalloc> 80107ed4: 85 c0 test %eax,%eax 80107ed6: 89 c6 mov %eax,%esi 80107ed8: 75 86 jne 80107e60 <copyuvm+0x30> } } return d; bad: freevm(d); 80107eda: 8b 45 e0 mov -0x20(%ebp),%eax 80107edd: 89 04 24 mov %eax,(%esp) 80107ee0: e8 fb fd ff ff call 80107ce0 <freevm> return 0; 80107ee5: c7 45 e0 00 00 00 00 movl $0x0,-0x20(%ebp) } 80107eec: 8b 45 e0 mov -0x20(%ebp),%eax 80107eef: 83 c4 2c add $0x2c,%esp 80107ef2: 5b pop %ebx 80107ef3: 5e pop %esi 80107ef4: 5f pop %edi 80107ef5: 5d pop %ebp 80107ef6: c3 ret 80107ef7: 89 f6 mov %esi,%esi 80107ef9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi kfree(mem); 80107f00: 89 34 24 mov %esi,(%esp) 80107f03: e8 d8 a4 ff ff call 801023e0 <kfree> goto bad; 80107f08: eb d0 jmp 80107eda <copyuvm+0xaa> panic("copyuvm: page not present"); 80107f0a: c7 04 24 16 8a 10 80 movl $0x80108a16,(%esp) 80107f11: e8 5a 84 ff ff call 80100370 <panic> panic("copyuvm: pte should exist"); 80107f16: c7 04 24 fc 89 10 80 movl $0x801089fc,(%esp) 80107f1d: e8 4e 84 ff ff call 80100370 <panic> 80107f22: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80107f29: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80107f30 <uva2ka>: //PAGEBREAK! // Map user virtual address to kernel address. char* uva2ka(pde_t *pgdir, char *uva) { 80107f30: 55 push %ebp pte_t *pte; pte = walkpgdir(pgdir, uva, 0); 80107f31: 31 c9 xor %ecx,%ecx { 80107f33: 89 e5 mov %esp,%ebp 80107f35: 83 ec 08 sub $0x8,%esp pte = walkpgdir(pgdir, uva, 0); 80107f38: 8b 55 0c mov 0xc(%ebp),%edx 80107f3b: 8b 45 08 mov 0x8(%ebp),%eax 80107f3e: e8 7d f7 ff ff call 801076c0 <walkpgdir> if((*pte & PTE_P) == 0) 80107f43: 8b 00 mov (%eax),%eax return 0; if((*pte & PTE_U) == 0) 80107f45: 89 c2 mov %eax,%edx 80107f47: 83 e2 05 and $0x5,%edx 80107f4a: 83 fa 05 cmp $0x5,%edx 80107f4d: 75 11 jne 80107f60 <uva2ka+0x30> return 0; return (char*)P2V(PTE_ADDR(*pte)); 80107f4f: 25 00 f0 ff ff and $0xfffff000,%eax 80107f54: 05 00 00 00 80 add $0x80000000,%eax } 80107f59: c9 leave 80107f5a: c3 ret 80107f5b: 90 nop 80107f5c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return 0; 80107f60: 31 c0 xor %eax,%eax } 80107f62: c9 leave 80107f63: c3 ret 80107f64: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80107f6a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80107f70 <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) { 80107f70: 55 push %ebp 80107f71: 89 e5 mov %esp,%ebp 80107f73: 57 push %edi 80107f74: 56 push %esi 80107f75: 53 push %ebx 80107f76: 83 ec 2c sub $0x2c,%esp 80107f79: 8b 75 14 mov 0x14(%ebp),%esi 80107f7c: 8b 5d 0c mov 0xc(%ebp),%ebx char *buf, *pa0; uint n, va0; buf = (char*)p; while(len > 0){ 80107f7f: 85 f6 test %esi,%esi 80107f81: 74 75 je 80107ff8 <copyout+0x88> 80107f83: 89 da mov %ebx,%edx 80107f85: eb 3f jmp 80107fc6 <copyout+0x56> 80107f87: 89 f6 mov %esi,%esi 80107f89: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi va0 = (uint)PGROUNDDOWN(va); pa0 = uva2ka(pgdir, (char*)va0); if(pa0 == 0) return -1; n = PGSIZE - (va - va0); 80107f90: 8b 55 e4 mov -0x1c(%ebp),%edx 80107f93: 89 df mov %ebx,%edi if(n > len) n = len; memmove(pa0 + (va - va0), buf, n); 80107f95: 8b 4d 10 mov 0x10(%ebp),%ecx n = PGSIZE - (va - va0); 80107f98: 29 d7 sub %edx,%edi 80107f9a: 81 c7 00 10 00 00 add $0x1000,%edi 80107fa0: 39 f7 cmp %esi,%edi 80107fa2: 0f 47 fe cmova %esi,%edi memmove(pa0 + (va - va0), buf, n); 80107fa5: 29 da sub %ebx,%edx 80107fa7: 01 c2 add %eax,%edx 80107fa9: 89 14 24 mov %edx,(%esp) 80107fac: 89 7c 24 08 mov %edi,0x8(%esp) 80107fb0: 89 4c 24 04 mov %ecx,0x4(%esp) 80107fb4: e8 e7 d5 ff ff call 801055a0 <memmove> len -= n; buf += n; va = va0 + PGSIZE; 80107fb9: 8d 93 00 10 00 00 lea 0x1000(%ebx),%edx buf += n; 80107fbf: 01 7d 10 add %edi,0x10(%ebp) while(len > 0){ 80107fc2: 29 fe sub %edi,%esi 80107fc4: 74 32 je 80107ff8 <copyout+0x88> pa0 = uva2ka(pgdir, (char*)va0); 80107fc6: 8b 45 08 mov 0x8(%ebp),%eax va0 = (uint)PGROUNDDOWN(va); 80107fc9: 89 d3 mov %edx,%ebx 80107fcb: 81 e3 00 f0 ff ff and $0xfffff000,%ebx pa0 = uva2ka(pgdir, (char*)va0); 80107fd1: 89 5c 24 04 mov %ebx,0x4(%esp) va0 = (uint)PGROUNDDOWN(va); 80107fd5: 89 55 e4 mov %edx,-0x1c(%ebp) pa0 = uva2ka(pgdir, (char*)va0); 80107fd8: 89 04 24 mov %eax,(%esp) 80107fdb: e8 50 ff ff ff call 80107f30 <uva2ka> if(pa0 == 0) 80107fe0: 85 c0 test %eax,%eax 80107fe2: 75 ac jne 80107f90 <copyout+0x20> } return 0; } 80107fe4: 83 c4 2c add $0x2c,%esp return -1; 80107fe7: b8 ff ff ff ff mov $0xffffffff,%eax } 80107fec: 5b pop %ebx 80107fed: 5e pop %esi 80107fee: 5f pop %edi 80107fef: 5d pop %ebp 80107ff0: c3 ret 80107ff1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80107ff8: 83 c4 2c add $0x2c,%esp return 0; 80107ffb: 31 c0 xor %eax,%eax } 80107ffd: 5b pop %ebx 80107ffe: 5e pop %esi 80107fff: 5f pop %edi 80108000: 5d pop %ebp 80108001: c3 ret
programs/oeis/046/A046092.asm
neoneye/loda
22
103302
; A046092: 4 times triangular numbers: a(n) = 2*n*(n+1). ; 0,4,12,24,40,60,84,112,144,180,220,264,312,364,420,480,544,612,684,760,840,924,1012,1104,1200,1300,1404,1512,1624,1740,1860,1984,2112,2244,2380,2520,2664,2812,2964,3120,3280,3444,3612,3784,3960,4140,4324,4512,4704,4900,5100,5304,5512,5724,5940,6160,6384,6612,6844,7080,7320,7564,7812,8064,8320,8580,8844,9112,9384,9660,9940,10224,10512,10804,11100,11400,11704,12012,12324,12640,12960,13284,13612,13944,14280,14620,14964,15312,15664,16020,16380,16744,17112,17484,17860,18240,18624,19012,19404,19800 sub $1,$0 bin $1,2 mul $1,4 mov $0,$1
test/Fail/Polarity-pragma-for-defined-name.agda
cruhland/agda
1,989
4999
{-# OPTIONS --warning=error #-} A : Set₁ A = Set {-# POLARITY A #-}
oeis/277/A277372.asm
neoneye/loda-programs
11
21945
; A277372: a(n) = Sum_{k=1..n} binomial(n,n-k)*n^(n-k)*n!/(n-k)!. ; Submitted by <NAME> ; 0,1,10,141,2584,58745,1602576,51165205,1874935168,77644293201,3588075308800,183111507687581,10230243235200000,621111794820235849,40722033570202507264,2867494972696071121125,215840579093024990396416,17294837586403146090259745,1469799445329208661211021312 mov $1,1 mov $3,$0 mov $4,1 lpb $3 mul $1,$3 mul $4,$3 add $1,$4 mul $1,$3 mul $2,$0 mov $4,0 add $5,1 div $1,$5 add $2,$1 sub $3,1 lpe mov $0,$2 div $0,2
support/MinGW/lib/gcc/mingw32/9.2.0/adainclude/g-sechas.adb
orb-zhuchen/Orb
0
20537
------------------------------------------------------------------------------ -- -- -- GNAT LIBRARY COMPONENTS -- -- -- -- G N A T . S E C U R E _ H A S H E S -- -- -- -- B o d y -- -- -- -- Copyright (C) 2009-2019, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with System; use System; with Interfaces; use Interfaces; package body GNAT.Secure_Hashes is Hex_Digit : constant array (Stream_Element range 0 .. 15) of Character := "0123456789abcdef"; type Fill_Buffer_Access is access procedure (M : in out Message_State; S : String; First : Natural; Last : out Natural); -- A procedure to transfer data from S, starting at First, into M's block -- buffer until either the block buffer is full or all data from S has been -- consumed. procedure Fill_Buffer_Copy (M : in out Message_State; S : String; First : Natural; Last : out Natural); -- Transfer procedure which just copies data from S to M procedure Fill_Buffer_Swap (M : in out Message_State; S : String; First : Natural; Last : out Natural); -- Transfer procedure which swaps bytes from S when copying into M. S must -- have even length. Note that the swapping is performed considering pairs -- starting at S'First, even if S'First /= First (that is, if -- First = S'First then the first copied byte is always S (S'First + 1), -- and if First = S'First + 1 then the first copied byte is always -- S (S'First). procedure To_String (SEA : Stream_Element_Array; S : out String); -- Return the hexadecimal representation of SEA ---------------------- -- Fill_Buffer_Copy -- ---------------------- procedure Fill_Buffer_Copy (M : in out Message_State; S : String; First : Natural; Last : out Natural) is Buf_String : String (M.Buffer'Range); for Buf_String'Address use M.Buffer'Address; pragma Import (Ada, Buf_String); Length : constant Natural := Natural'Min (M.Block_Length - M.Last, S'Last - First + 1); begin pragma Assert (Length > 0); Buf_String (M.Last + 1 .. M.Last + Length) := S (First .. First + Length - 1); M.Last := M.Last + Length; Last := First + Length - 1; end Fill_Buffer_Copy; ---------------------- -- Fill_Buffer_Swap -- ---------------------- procedure Fill_Buffer_Swap (M : in out Message_State; S : String; First : Natural; Last : out Natural) is pragma Assert (S'Length mod 2 = 0); Length : constant Natural := Natural'Min (M.Block_Length - M.Last, S'Last - First + 1); begin Last := First; while Last - First < Length loop M.Buffer (M.Last + 1 + Last - First) := (if (Last - S'First) mod 2 = 0 then S (Last + 1) else S (Last - 1)); Last := Last + 1; end loop; M.Last := M.Last + Length; Last := First + Length - 1; end Fill_Buffer_Swap; --------------- -- To_String -- --------------- procedure To_String (SEA : Stream_Element_Array; S : out String) is pragma Assert (S'Length = 2 * SEA'Length); begin for J in SEA'Range loop declare S_J : constant Natural := 1 + Natural (J - SEA'First) * 2; begin S (S_J) := Hex_Digit (SEA (J) / 16); S (S_J + 1) := Hex_Digit (SEA (J) mod 16); end; end loop; end To_String; ------- -- H -- ------- package body H is procedure Update (C : in out Context; S : String; Fill_Buffer : Fill_Buffer_Access); -- Internal common routine for all Update procedures procedure Final (C : Context; Hash_Bits : out Ada.Streams.Stream_Element_Array); -- Perform final hashing operations (data padding) and extract the -- (possibly truncated) state of C into Hash_Bits. ------------ -- Digest -- ------------ function Digest (C : Context) return Message_Digest is Hash_Bits : Stream_Element_Array (1 .. Stream_Element_Offset (Hash_Length)); begin Final (C, Hash_Bits); return MD : Message_Digest do To_String (Hash_Bits, MD); end return; end Digest; function Digest (S : String) return Message_Digest is C : Context; begin Update (C, S); return Digest (C); end Digest; function Digest (A : Stream_Element_Array) return Message_Digest is C : Context; begin Update (C, A); return Digest (C); end Digest; function Digest (C : Context) return Binary_Message_Digest is Hash_Bits : Stream_Element_Array (1 .. Stream_Element_Offset (Hash_Length)); begin Final (C, Hash_Bits); return Hash_Bits; end Digest; function Digest (S : String) return Binary_Message_Digest is C : Context; begin Update (C, S); return Digest (C); end Digest; function Digest (A : Stream_Element_Array) return Binary_Message_Digest is C : Context; begin Update (C, A); return Digest (C); end Digest; ----------- -- Final -- ----------- -- Once a complete message has been processed, it is padded with one 1 -- bit followed by enough 0 bits so that the last block is 2 * Word'Size -- bits short of being completed. The last 2 * Word'Size bits are set to -- the message size in bits (excluding padding). procedure Final (C : Context; Hash_Bits : out Stream_Element_Array) is FC : Context := C; Zeroes : Natural; -- Number of 0 bytes in padding Message_Length : Unsigned_64 := FC.M_State.Length; -- Message length in bytes Size_Length : constant Natural := 2 * Hash_State.Word'Size / 8; -- Length in bytes of the size representation begin Zeroes := (Block_Length - 1 - Size_Length - FC.M_State.Last) mod FC.M_State.Block_Length; declare Pad : String (1 .. 1 + Zeroes + Size_Length) := (1 => Character'Val (128), others => ASCII.NUL); Index : Natural; First_Index : Natural; begin First_Index := (if Hash_Bit_Order = Low_Order_First then Pad'Last - Size_Length + 1 else Pad'Last); Index := First_Index; while Message_Length > 0 loop if Index = First_Index then -- Message_Length is in bytes, but we need to store it as -- a bit count. Pad (Index) := Character'Val (Shift_Left (Message_Length and 16#1f#, 3)); Message_Length := Shift_Right (Message_Length, 5); else Pad (Index) := Character'Val (Message_Length and 16#ff#); Message_Length := Shift_Right (Message_Length, 8); end if; Index := Index + (if Hash_Bit_Order = Low_Order_First then 1 else -1); end loop; Update (FC, Pad); end; pragma Assert (FC.M_State.Last = 0); Hash_State.To_Hash (FC.H_State, Hash_Bits); -- HMAC case: hash outer pad if C.KL /= 0 then declare Outer_C : Context; Opad : Stream_Element_Array := (1 .. Stream_Element_Offset (Block_Length) => 16#5c#); begin for J in C.Key'Range loop Opad (J) := Opad (J) xor C.Key (J); end loop; Update (Outer_C, Opad); Update (Outer_C, Hash_Bits); Final (Outer_C, Hash_Bits); end; end if; end Final; -------------------------- -- HMAC_Initial_Context -- -------------------------- function HMAC_Initial_Context (Key : String) return Context is begin if Key'Length = 0 then raise Constraint_Error with "null key"; end if; return C : Context (KL => (if Key'Length <= Key_Length'Last then Key'Length else Stream_Element_Offset (Hash_Length))) do -- Set Key (if longer than block length, first hash it) if C.KL = Key'Length then declare SK : String (1 .. Key'Length); for SK'Address use C.Key'Address; pragma Import (Ada, SK); begin SK := Key; end; else C.Key := Digest (Key); end if; -- Hash inner pad declare Ipad : Stream_Element_Array := (1 .. Stream_Element_Offset (Block_Length) => 16#36#); begin for J in C.Key'Range loop Ipad (J) := Ipad (J) xor C.Key (J); end loop; Update (C, Ipad); end; end return; end HMAC_Initial_Context; ---------- -- Read -- ---------- procedure Read (Stream : in out Hash_Stream; Item : out Stream_Element_Array; Last : out Stream_Element_Offset) is pragma Unreferenced (Stream, Item, Last); begin raise Program_Error with "Hash_Stream is write-only"; end Read; ------------ -- Update -- ------------ procedure Update (C : in out Context; S : String; Fill_Buffer : Fill_Buffer_Access) is Last : Natural; begin C.M_State.Length := C.M_State.Length + S'Length; Last := S'First - 1; while Last < S'Last loop Fill_Buffer (C.M_State, S, Last + 1, Last); if C.M_State.Last = Block_Length then Transform (C.H_State, C.M_State); C.M_State.Last := 0; end if; end loop; end Update; ------------ -- Update -- ------------ procedure Update (C : in out Context; Input : String) is begin Update (C, Input, Fill_Buffer_Copy'Access); end Update; ------------ -- Update -- ------------ procedure Update (C : in out Context; Input : Stream_Element_Array) is S : String (1 .. Input'Length); for S'Address use Input'Address; pragma Import (Ada, S); begin Update (C, S, Fill_Buffer_Copy'Access); end Update; ----------------- -- Wide_Update -- ----------------- procedure Wide_Update (C : in out Context; Input : Wide_String) is S : String (1 .. 2 * Input'Length); for S'Address use Input'Address; pragma Import (Ada, S); begin Update (C, S, (if System.Default_Bit_Order /= Low_Order_First then Fill_Buffer_Swap'Access else Fill_Buffer_Copy'Access)); end Wide_Update; ----------------- -- Wide_Digest -- ----------------- function Wide_Digest (W : Wide_String) return Message_Digest is C : Context; begin Wide_Update (C, W); return Digest (C); end Wide_Digest; function Wide_Digest (W : Wide_String) return Binary_Message_Digest is C : Context; begin Wide_Update (C, W); return Digest (C); end Wide_Digest; ----------- -- Write -- ----------- procedure Write (Stream : in out Hash_Stream; Item : Stream_Element_Array) is begin Update (Stream.C.all, Item); end Write; end H; ------------------------- -- Hash_Function_State -- ------------------------- package body Hash_Function_State is ------------- -- To_Hash -- ------------- procedure To_Hash (H : State; H_Bits : out Stream_Element_Array) is Hash_Words : constant Natural := H'Size / Word'Size; Result : State (1 .. Hash_Words) := H (H'Last - Hash_Words + 1 .. H'Last); R_SEA : Stream_Element_Array (1 .. Result'Size / 8); for R_SEA'Address use Result'Address; pragma Import (Ada, R_SEA); begin if System.Default_Bit_Order /= Hash_Bit_Order then for J in Result'Range loop Swap (Result (J)'Address); end loop; end if; -- Return truncated hash pragma Assert (H_Bits'Length <= R_SEA'Length); H_Bits := R_SEA (R_SEA'First .. R_SEA'First + H_Bits'Length - 1); end To_Hash; end Hash_Function_State; end GNAT.Secure_Hashes;
grammar/Model.g4
ToddFincannon/antlr4-vensim
0
1321
grammar Model; import Expr; // A Vensim model is a sequence of equations and subscript ranges. model: ( subscriptRange | equation )+ ; // A subscript range definition names subscripts in a dimension. subscriptRange : ( ( Id ':' ( subscriptList | subscriptSequence | expr ) subscriptMappingList? ) | ( Id '<->' Id ) ) '|' ; subscriptSequence : '(' Id '-' Id ')' ; subscriptMappingList : '->' subscriptMapping ( ',' subscriptMapping )* ; subscriptMapping : Id | '(' Id ':' subscriptList ')' ; // An equation has a left-hand side and a right-hand side. // The RHS is a formula expression, a constant list, or a Vensim lookup. // The RHS is empty for data equations. equation : lhs ( ( ':=' | '==' | '=' ) ( expr | constList ) | lookup )? '|' ; lhs : Id ( '[' subscriptList ']' )? ':INTERPOLATE:'? ( ':EXCEPT:' '[' subscriptList ']' ( ',' '[' subscriptList ']' )* )? ; // The lexer strips some tokens we are not interested in. // The character encoding is given at the start of a Vensim file. // The units and documentation sections and group markings are skipped for now. // Line continuation characters and the sketch must be stripped by a preprocessor. Encoding : '{' [A-Za-z0-9-]+ '}' -> skip ; Group : '****' .*? '|' -> skip ; UnitsDoc : '~' ~'|'* -> skip ;
software/hal/hpl/STM32/drivers/dma2d/stm32-dma2d-interrupt.adb
TUM-EI-RCS/StratoX
12
22998
<filename>software/hal/hpl/STM32/drivers/dma2d/stm32-dma2d-interrupt.adb<gh_stars>10-100 ------------------------------------------------------------------------------ -- -- -- Copyright (C) 2015, AdaCore -- -- -- -- 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 STMicroelectronics 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 -- -- 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. -- -- -- ------------------------------------------------------------------------------ with Ada.Interrupts.Names; with STM32_SVD.DMA2D; use STM32_SVD.DMA2D; package body STM32.DMA2D.Interrupt is procedure DMA2D_Start; procedure DMA2D_Wait; protected Sync is entry Wait; procedure Start_Transfer; procedure Interrupt; pragma Attach_Handler (Interrupt, Ada.Interrupts.Names.DMA2D_Interrupt); private Ready : Boolean := True; Error : Boolean := False; end Sync; ---------- -- Sync -- ---------- protected body Sync is ---------- -- Wait -- ---------- entry Wait when Ready is begin null; end Wait; -------------------- -- Start_Transfer -- -------------------- procedure Start_Transfer is begin pragma Assert (Ready); Ready := False; Error := False; DMA2D_Periph.CR.CEIE := True; DMA2D_Periph.CR.TCIE := True; DMA2D_Periph.CR.TEIE := True; DMA2D_Periph.CR.START := True; end Start_Transfer; --------------- -- Interrupt -- --------------- procedure Interrupt is begin if DMA2D_Periph.ISR.CEIF or DMA2D_Periph.ISR.TEIF then -- Conf or transfer error DMA2D_Periph.IFCR.CCEIF := True; DMA2D_Periph.IFCR.CTEIF := True; Error := True; Ready := True; elsif DMA2D_Periph.ISR.TCIF then -- Transfer completed DMA2D_Periph.IFCR.CTCIF := True; Error := False; Ready := True; else -- Unexpected interrupt. pragma Assert (False); end if; end Interrupt; end Sync; ----------------- -- DMA2D_Start -- ----------------- procedure DMA2D_Start is begin Sync.Start_Transfer; end DMA2D_Start; ---------------- -- DMA2D_Wait -- ---------------- procedure DMA2D_Wait is begin Sync.Wait; end DMA2D_Wait; ---------------- -- Initialize -- ---------------- procedure Initialize is begin DMA2D_Init (Init => DMA2D_Start'Access, Wait => DMA2D_Wait'Access); end Initialize; end STM32.DMA2D.Interrupt;
libsrc/rs232/osca/rs232_params.asm
grancier/z180
0
6253
; ; z88dk RS232 Function ; ; OSCA version ; ; unsigned char rs232_params(unsigned char param, unsigned char parity) ; ; Specify the serial interface parameters ; ; $Id: rs232_params.asm,v 1.3 2016/06/23 20:15:37 dom Exp $ SECTION code_clib PUBLIC rs232_params PUBLIC _rs232_params INCLUDE "osca.def" rs232_params: _rs232_params: pop bc pop hl pop de push de push hl push bc ; ; handle parity xor a cp l jr nz,parityset ; no parity ? ld hl,1 ; RS_ERR_NOT_INITIALIZED ret ; sorry, MARK/SPACE options ; not available parityset: ; handle bits number ld a,$f0 ; mask bit related flags and l jr z,noextra ld hl,1 ; RS_ERR_NOT_INITIALIZED ret noextra: ; baud rate ld a,$0f and e cp $0d jr z,avail cp $0e jr z,avail ld hl,3 ; RS_ERR_BAUD_NOT_AVAIL ret avail: sub $0d ; 0=57600; 1=115200 out (sys_baud_rate),a ld hl,0 ; RS_ERR_OK ret
Categories/Object/Initial.agda
copumpkin/categories
98
1121
{-# OPTIONS --universe-polymorphism #-} open import Categories.Category module Categories.Object.Initial {o ℓ e} (C : Category o ℓ e) where open Category C open import Level record Initial : Set (o ⊔ ℓ ⊔ e) where field ⊥ : Obj ! : ∀ {A} → (⊥ ⇒ A) .!-unique : ∀ {A} → (f : ⊥ ⇒ A) → ! ≡ f .!-unique₂ : ∀ {A} → (f g : ⊥ ⇒ A) → f ≡ g !-unique₂ f g = begin f ↑⟨ !-unique f ⟩ ! ↓⟨ !-unique g ⟩ g ∎ where open HomReasoning .⊥-id : (f : ⊥ ⇒ ⊥) → f ≡ id ⊥-id f = !-unique₂ f id import Categories.Morphisms open Categories.Morphisms C open Initial .to-⊥-is-Epi : ∀ {A : Obj} {i : Initial} → (f : A ⇒ ⊥ i) → Epi f to-⊥-is-Epi {_} {i} f = helper where helper : ∀ {C : Obj} → (g h : ⊥ i ⇒ C) → g ∘ f ≡ h ∘ f → g ≡ h helper g h _ = !-unique₂ i g h
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c3/c32001d.ada
best08618/asylo
7
21797
-- C32001D.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- CHECK THAT IN MULTIPLE OBJECT DECLARATIONS FOR ACCESS TYPES, THE -- SUBTYPE INDICATION AND THE INITIALIZATION EXPRESSIONS ARE EVALUATED -- ONCE FOR EACH NAMED OBJECT THAT IS DECLARED AND THE SUBTYPE -- INDICATION IS EVALUATED FIRST. ALSO, CHECK THAT THE EVALUATIONS -- YIELD THE SAME RESULT AS A SEQUENCE OF SINGLE OBJECT DECLARATIONS. -- RJW 7/16/86 WITH REPORT; USE REPORT; PROCEDURE C32001D IS TYPE ARR IS ARRAY (1 .. 2) OF INTEGER; BUMP : ARR := (0, 0); F1 : ARR; FUNCTION F (I : INTEGER) RETURN INTEGER IS BEGIN BUMP (I) := BUMP (I) + 1; F1 (I) := BUMP (I); RETURN BUMP (I); END F; FUNCTION G (I : INTEGER) RETURN INTEGER IS BEGIN BUMP (I) := BUMP (I) + 1; RETURN BUMP (I); END G; BEGIN TEST ("C32001D", "CHECK THAT IN MULTIPLE OBJECT DECLARATIONS " & "FOR ACCESS TYPES, THE SUBTYPE INDICATION " & "AND THE INITIALIZATION EXPRESSIONS ARE " & "EVALUATED ONCE FOR EACH NAMED OBJECT THAT " & "IS DECLARED AND THE SUBTYPE INDICATION IS " & "EVALUATED FIRST. ALSO, CHECK THAT THE " & "EVALUATIONS YIELD THE SAME RESULT AS A " & "SEQUENCE OF SINGLE OBJECT DECLARATIONS" ); DECLARE TYPE CELL (SIZE : INTEGER) IS RECORD VALUE : INTEGER; END RECORD; TYPE LINK IS ACCESS CELL; L1, L2 : LINK (F (1)) := NEW CELL'(F1 (1), G (1)); CL1, CL2 : CONSTANT LINK (F (2)) := NEW CELL'(F1 (2), G (2)); PROCEDURE CHECK (L : LINK; V1, V2 : INTEGER; S : STRING) IS BEGIN IF L.SIZE /= V1 THEN FAILED ( S & ".SIZE INITIALIZED INCORRECTLY TO " & INTEGER'IMAGE (L.SIZE)); END IF; IF L.VALUE /= V2 THEN FAILED ( S & ".VALUE INITIALIZED INCORRECTLY TO " & INTEGER'IMAGE (L.VALUE)); END IF; END CHECK; BEGIN CHECK (L1, 1, 2, "L1"); CHECK (L2, 3, 4, "L2"); CHECK (CL1, 1, 2, "CL1"); CHECK (CL2, 3, 4, "CL2"); END; RESULT; END C32001D;
src/charmap.asm
Amjad50/rtc3test
19
171566
charmap "0", $00 charmap "1", $01 charmap "2", $02 charmap "3", $03 charmap "4", $04 charmap "5", $05 charmap "6", $06 charmap "7", $07 charmap "8", $08 charmap "9", $09 charmap "A", $0A charmap "B", $0B charmap "C", $0C charmap "D", $0D charmap "E", $0E charmap "F", $0F charmap "G", $10 charmap "H", $11 charmap "I", $12 charmap "J", $13 charmap "K", $14 charmap "L", $15 charmap "M", $16 charmap "N", $17 charmap "O", $18 charmap "P", $19 charmap "Q", $1A charmap "R", $1B charmap "S", $1C charmap "T", $1D charmap "U", $1E charmap "V", $1F charmap "W", $20 charmap "X", $21 charmap "Y", $22 charmap "Z", $23 charmap "a", $24 charmap "b", $25 charmap "c", $26 charmap "d", $27 charmap "e", $28 charmap "f", $29 charmap "g", $2A charmap "h", $2B charmap "i", $2C charmap "j", $2D charmap "k", $2E charmap "l", $2F charmap "m", $30 charmap "n", $31 charmap "o", $32 charmap "p", $33 charmap "q", $34 charmap "r", $35 charmap "s", $36 charmap "t", $37 charmap "u", $38 charmap "v", $39 charmap "w", $3A charmap "x", $3B charmap "y", $3C charmap "z", $3D charmap ".", $3E charmap " ", $3F charmap ">", $C0 ;arrow pointing right charmap "*", $C1 ;A button charmap ":", $C2 charmap "/", $C3 charmap "-", $C4 charmap "@", $FF ;string terminator ; colors GREEN EQU $40 RED EQU $80
src/main/antlr/CommonLexerRules.g4
matthew-c21/antlr-calc
0
4170
<filename>src/main/antlr/CommonLexerRules.g4<gh_stars>0 lexer grammar CommonLexerRules; fragment DIGIT: [0-9]; fragment ID_START: [a-zA-Z_] ; fragment ID_PART: ID_START | DIGIT ; ID: ID_START ID_PART* ; INT: DIGIT+; fragment BASE_FLOAT: DIGIT* '.' DIGIT+ ; fragment EXP_FLOAT: ([1-9] | DIGIT? '.' DIGIT+) ('e'|'E') (ADD | SUB)? INT ; FLOAT: BASE_FLOAT | EXP_FLOAT ; MUL: '*' ; DIV: '/' ; ADD: '+' ; SUB: '-' ; ASSIGN: '=' ; LPAR: '(' ; RPAR: ')' ; NEWLINE: '\n' ; WS: [ \t] -> skip ;
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_607.asm
ljhsiun2/medusa
9
104945
<gh_stars>1-10 .global s_prepare_buffers s_prepare_buffers: push %r13 push %r15 push %r9 push %rbx push %rcx push %rdi push %rsi lea addresses_normal_ht+0x58ce, %rsi lea addresses_UC_ht+0xb14e, %rdi nop nop and %r9, %r9 mov $107, %rcx rep movsq and $33601, %r13 lea addresses_normal_ht+0xfb4e, %r15 nop nop nop sub $25164, %r13 movb (%r15), %r9b nop nop nop nop nop cmp %rdi, %rdi lea addresses_WT_ht+0x80e, %r9 nop nop nop nop nop and %rbx, %rbx movb (%r9), %r15b nop nop nop nop nop and %r9, %r9 pop %rsi pop %rdi pop %rcx pop %rbx pop %r9 pop %r15 pop %r13 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r15 push %rbp push %rdi push %rdx push %rsi // Store lea addresses_US+0xf24e, %rdi add $32038, %rdx mov $0x5152535455565758, %rbp movq %rbp, %xmm6 vmovups %ymm6, (%rdi) nop nop and %r15, %r15 // Store lea addresses_RW+0x1594e, %r11 add $562, %rdi mov $0x5152535455565758, %rdx movq %rdx, %xmm3 movups %xmm3, (%r11) nop nop nop nop nop xor $12167, %r12 // Faulty Load lea addresses_RW+0x1f14e, %rdx nop add $32911, %rsi mov (%rdx), %r11w lea oracles, %r15 and $0xff, %r11 shlq $12, %r11 mov (%r15,%r11,1), %r11 pop %rsi pop %rdx pop %rdi pop %rbp pop %r15 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 8, 'size': 32, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 11, 'size': 16, 'same': False, 'NT': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': True, 'NT': False}} <gen_prepare_buffer> {'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 11, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 8, 'size': 1, 'same': False, 'NT': True}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 4, 'size': 1, 'same': False, 'NT': False}} {'32': 21829} 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 */
src/register-indirect-jump.asm
hirohito-protagonist/hla-learn-adventure
0
29776
<reponame>hirohito-protagonist/hla-learn-adventure ; Assembly code emitted by HLA compiler ; Version 2.16 build 4413 (prototype) ; HLA compiler written by <NAME> ; NASM compatible output bits 32 %define ExceptionPtr__hla_ [dword fs:0] global QuitMain__hla_ global DfltExHndlr__hla_ global _HLAMain global HWexcept__hla_ global start section .text code align=16 extern STDOUT_PUTI32 extern STDOUT_NEWLN extern DefaultExceptionHandler__hla_ extern abstract__hla_ extern HardwareException__hla_ extern BuildExcepts__hla_ extern STDOUT_PUTS extern STDIN_GETI32 extern Raise__hla_ extern shortDfltExcept__hla_ %define exception__hla_1906 Raise__hla_ section .text ;/* HWexcept__hla_ gets called when Windows raises the exception. */ ; procedure HWexcept__hla_ HWexcept__hla_: jmp HardwareException__hla_ ;HWexcept__hla_ endp ; procedure DfltExHndlr__hla_ DfltExHndlr__hla_: jmp DefaultExceptionHandler__hla_ ;DfltExHndlr__hla_ endp ; procedure _HLAMain _HLAMain: nop ; procedure start start: ;start endp call BuildExcepts__hla_ ; push dword 0 db 06ah ; db 00h ; ; push ebp db 055h ; ; push ebp db 055h ; ; lea ebp, [esp+4] db 08dh ; db 06ch ; db 024h ; db 04h ; ; push strict dword exception__hla_1890 db 068h ; dd exception__hla_1890 ; push ebp db 055h ; ;/* fs: */ db 064h ; ; mov ebp, [0] db 08bh ; db 02dh ; dd 00h ; push dword [ebp+8] db 0ffh ; db 075h ; db 08h ; ; mov ebp, [esp+4] db 08bh ; db 06ch ; db 024h ; db 04h ; ; push strict dword HWexcept__hla_ db 068h ; dd HWexcept__hla_ ;/* fs: */ db 064h ; ; push dword [0] db 0ffh ; db 035h ; dd 00h ;/* fs: */ db 064h ; ; mov [0], esp db 089h ; db 025h ; dd 00h ; push strict dword str__hla_1891 db 068h ; dd str__hla_1891 call STDOUT_PUTS ; push eax db 050h ; call STDIN_GETI32 ; mov [i__hla_1885], eax db 0a3h ; dd (i__hla_1885+0) ; pop eax db 058h ; ; mov eax, [i__hla_1885] db 0a1h ; dd (i__hla_1885+0) ; cmp eax, 1 db 083h ; db 0f8h ; db 01h ; jnae false__hla_1900 ; cmp eax, 10 db 083h ; db 0f8h ; db 0ah ; jnbe false__hla_1900 ; mov ebx, GoodInput__hla_1902 db 0bbh ; dd (GoodInput__hla_1902+0) jmp endif__hla_1900 false__hla_1900: ; mov ebx, valRange__hla_1903 db 0bbh ; dd (valRange__hla_1903+0) endif__hla_1900: ;/* fs: */ db 064h ; ; mov esp, [0] db 08bh ; db 025h ; dd 00h ;/* fs: */ db 064h ; ; pop dword [0] db 08fh ; db 05h ; dd 00h ; add esp, 8 db 083h ; db 0c4h ; db 08h ; ; pop ebp db 05dh ; ; add esp, 4 db 083h ; db 0c4h ; db 04h ; jmp endtry__hla_1889 exception__hla_1890: ; cmp eax, 20 db 083h ; db 0f8h ; db 014h ; jne exception__hla_1904 ; mov ebx, convError__hla_1905 db 0bbh ; dd (convError__hla_1905+0) jmp endtry__hla_1889 exception__hla_1904: ; cmp eax, 8 db 083h ; db 0f8h ; db 08h ; jne exception__hla_1906 ; mov ebx, valRange__hla_1903 db 0bbh ; dd (valRange__hla_1903+0) endtry__hla_1889: ; jmp ebx db 0ffh ; db 0e3h ; mod-reg-r/m valRange__hla_1903: ; push strict dword str__hla_1907 db 068h ; dd str__hla_1907 call STDOUT_PUTS call STDOUT_NEWLN jmp Done__hla_1908 convError__hla_1905: ; push strict dword str__hla_1909 db 068h ; dd str__hla_1909 call STDOUT_PUTS call STDOUT_NEWLN jmp Done__hla_1908 GoodInput__hla_1902: ; push strict dword str__hla_1910 db 068h ; dd str__hla_1910 call STDOUT_PUTS ; push dword [i__hla_1885] db 0ffh ; db 035h ; dd i__hla_1885 call STDOUT_PUTI32 call STDOUT_NEWLN Done__hla_1908: QuitMain__hla_: ; push dword 0 db 06ah ; db 00h ; ; call [__imp__ExitProcess@4] db 0ffh ; db 015h ; dd __imp__ExitProcess@4 ;_HLAMain endp section .text align (4) len__hla_1891 dd 016h dd 016h str__hla_1891: db "Integer from 0 to 10: " db 0 db 0 align (4) len__hla_1907 dd 01bh dd 01bh str__hla_1907: db "Value is out of range 1..10" db 0 align (4) len__hla_1909 dd 011h dd 011h str__hla_1909: db "Wrong input chars" db 0 db 0 db 0 align (4) len__hla_1910 dd 0ch dd 0ch str__hla_1910: db "Your number " db 0 db 0 db 0 db 0 section .data data align=16 extern MainPgmCoroutine__hla_ extern __imp__MessageBoxA@16 extern __imp__ExitProcess@4 align (4) i__hla_1885 times 4 db 0
message/generation/swift-mt-generation/repository/SR2018/grammars/SwiftMtParser_MT535.g4
Yanick-Salzmann/message-converter-c
0
7375
grammar SwiftMtParser_MT535; @lexer::header { #include "repository/ISwiftMtParser.h" #include "SwiftMtMessage.pb.h" #include <vector> #include <string> #include "BaseErrorListener.h" } @parser::header { #include "repository/ISwiftMtParser.h" #include "SwiftMtMessage.pb.h" #include <vector> #include <string> #include "BaseErrorListener.h" #include "SwiftMtParser_MT535Lexer.h" } @parser::members { public: typedef SwiftMtParser_MT535Lexer tLexer; typedef SwiftMtParser_MT535Parser tParser; private: std::vector<std::string> _errors; public: [[nodiscard]] const std::vector<std::string>& errors() const { return _errors; } private: class DefaultErrorListener : public antlr4::BaseErrorListener { private: std::vector<std::string>& _errors; public: explicit DefaultErrorListener(std::vector<std::string>& errors) : _errors(errors) { } void syntaxError(Recognizer *recognizer, antlr4::Token * offendingSymbol, size_t line, size_t charPositionInLine, const std::string &msg, std::exception_ptr e) override { _errors.push_back(msg); } }; DefaultErrorListener _error_listener { _errors }; public: class Helper : public ISwiftMtParser { public: bool parse_message(const std::string& message, std::vector<std::string>& errors, SwiftMtMessage& out_message) override { antlr4::ANTLRInputStream stream{message}; tLexer lexer{&stream}; antlr4::CommonTokenStream token_stream{&lexer}; tParser parser{&token_stream}; return parser.process(errors, out_message); } }; private: SwiftMtMessage _message_builder{}; bool process(std::vector<std::string>& errors, SwiftMtMessage& out_message) { _errors.clear(); removeErrorListeners(); addErrorListener(&_error_listener); _message_builder = SwiftMtMessage{}; message(); if(!_errors.empty()) { errors.insert(errors.end(), _errors.begin(), _errors.end()); return false; } out_message = _message_builder; return true; } public: [[nodiscard]] SwiftMtMessage parsed_message() const { return _message_builder; } } message : bh ah uh? mt tr? EOF; bh : TAG_BH bh_content RBRACE ; bh_content : ~(RBRACE)+ ; ah : TAG_AH ah_content RBRACE ; ah_content : ~( RBRACE )+ ; uh : TAG_UH sys_block RBRACE ; tr : TAG_TR sys_block RBRACE ; sys_block : sys_element+ ; sys_element : LBRACE sys_element_key COLON sys_element_content RBRACE ; sys_element_key : ~( COLON | RBRACE )+ ; sys_element_content : ~( RBRACE )+ ; mt returns [message::definition::swift::mt::MessageText elem] @after { _message_builder.mutable_msg_text()->MergeFrom($elem); } : TAG_MT seq_A seq_B* MT_END; seq_A returns [message::definition::swift::mt::Sequence elem] @init { $elem.set_tag("A"); } : fld_16R_A { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16R_A.fld); } fld_28E_A { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_28E_A.fld); } fld_13a_A? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_13a_A.fld); } fld_20C_A { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_20C_A.fld); } fld_23G_A { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_23G_A.fld); } fld_98a_A+ { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_98a_A.fld); } fld_22F_A+ { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_22F_A.fld); } seq_A1* { $elem.mutable_objects()->Add()->mutable_sequence()->MergeFrom($seq_A1.elem); } fld_95a_A* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_95a_A.fld); } fld_97a_A { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_97a_A.fld); } fld_17B_A+ { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_17B_A.fld); } fld_16S_A { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16S_A.fld); } ; seq_A1 returns [message::definition::swift::mt::Sequence elem] @init { $elem.set_tag("A1"); } : fld_16R_A1 { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16R_A1.fld); } fld_13a_A1? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_13a_A1.fld); } fld_20C_A1 { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_20C_A1.fld); } fld_16S_A1 { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16S_A1.fld); } ; seq_B returns [message::definition::swift::mt::Sequence elem] @init { $elem.set_tag("B"); } : fld_16R_B { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16R_B.fld); } fld_95a_B* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_95a_B.fld); } fld_97a_B? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_97a_B.fld); } fld_94a_B* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_94a_B.fld); } fld_17B_B? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_17B_B.fld); } seq_B1* { $elem.mutable_objects()->Add()->mutable_sequence()->MergeFrom($seq_B1.elem); } ; seq_B1 returns [message::definition::swift::mt::Sequence elem] @init { $elem.set_tag("B1"); } : fld_16R_B1 { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16R_B1.fld); } fld_35B_B1 { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_35B_B1.fld); } seq_B1a? { $elem.mutable_objects()->Add()->mutable_sequence()->MergeFrom($seq_B1a.elem); } fld_22H_B1? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_22H_B1.fld); } fld_90a_B1? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_90a_B1.fld); } fld_94B_B1? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_94B_B1.fld); } fld_98a_B1? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_98a_B1.fld); } fld_93B_B1+ { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_93B_B1.fld); } seq_B1b* { $elem.mutable_objects()->Add()->mutable_sequence()->MergeFrom($seq_B1b.elem); } ; seq_B1a returns [message::definition::swift::mt::Sequence elem] @init { $elem.set_tag("B1a"); } : fld_16R_B1a { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16R_B1a.fld); } fld_94a_B1a* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_94a_B1a.fld); } fld_22F_B1a* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_22F_B1a.fld); } fld_12a_B1a* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_12a_B1a.fld); } fld_11A_B1a? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_11A_B1a.fld); } fld_98A_B1a* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_98A_B1a.fld); } fld_92A_B1a* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_92A_B1a.fld); } fld_13a_B1a* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_13a_B1a.fld); } fld_17B_B1a* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_17B_B1a.fld); } fld_90a_B1a* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_90a_B1a.fld); } fld_36B_B1a* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_36B_B1a.fld); } fld_35B_B1a* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_35B_B1a.fld); } fld_70E_B1a? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_70E_B1a.fld); } fld_16S_B1a { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16S_B1a.fld); } ; seq_B1b returns [message::definition::swift::mt::Sequence elem] @init { $elem.set_tag("B1b"); } : fld_16R_B1b { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16R_B1b.fld); } fld_93a_B1b+ { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_93a_B1b.fld); } fld_22a_B1b? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_22a_B1b.fld); } fld_94a_B1b* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_94a_B1b.fld); } fld_90a_B1b? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_90a_B1b.fld); } fld_98a_B1b? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_98a_B1b.fld); } fld_99A_B1b? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_99A_B1b.fld); } fld_19A_B1b* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_19A_B1b.fld); } fld_92B_B1b? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_92B_B1b.fld); } fld_70C_B1b? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_70C_B1b.fld); } ; fld_16R_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16R"); } : START_OF_FIELD '16R:' ~(START_OF_FIELD)+; fld_28E_A returns [message::definition::swift::mt::Field fld] : fld_28E_A_E { $fld.MergeFrom($fld_28E_A_E.fld); } ; fld_13a_A returns [message::definition::swift::mt::Field fld] : fld_13a_A_A { $fld.MergeFrom($fld_13a_A_A.fld); } | fld_13a_A_J { $fld.MergeFrom($fld_13a_A_J.fld); } ; fld_20C_A returns [message::definition::swift::mt::Field fld] : fld_20C_A_C { $fld.MergeFrom($fld_20C_A_C.fld); } ; fld_23G_A returns [message::definition::swift::mt::Field fld] : fld_23G_A_G { $fld.MergeFrom($fld_23G_A_G.fld); } ; fld_98a_A returns [message::definition::swift::mt::Field fld] : fld_98a_A_A { $fld.MergeFrom($fld_98a_A_A.fld); } | fld_98a_A_C { $fld.MergeFrom($fld_98a_A_C.fld); } | fld_98a_A_E { $fld.MergeFrom($fld_98a_A_E.fld); } ; fld_22F_A returns [message::definition::swift::mt::Field fld] : fld_22F_A_F { $fld.MergeFrom($fld_22F_A_F.fld); } ; fld_16R_A1 returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16R"); } : START_OF_FIELD '16R:' ~(START_OF_FIELD)+; fld_13a_A1 returns [message::definition::swift::mt::Field fld] : fld_13a_A1_A { $fld.MergeFrom($fld_13a_A1_A.fld); } | fld_13a_A1_B { $fld.MergeFrom($fld_13a_A1_B.fld); } ; fld_20C_A1 returns [message::definition::swift::mt::Field fld] : fld_20C_A1_C { $fld.MergeFrom($fld_20C_A1_C.fld); } ; fld_16S_A1 returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16S"); } : START_OF_FIELD '16S:' ~(START_OF_FIELD)+; fld_95a_A returns [message::definition::swift::mt::Field fld] : fld_95a_A_L { $fld.MergeFrom($fld_95a_A_L.fld); } | fld_95a_A_P { $fld.MergeFrom($fld_95a_A_P.fld); } | fld_95a_A_R { $fld.MergeFrom($fld_95a_A_R.fld); } ; fld_97a_A returns [message::definition::swift::mt::Field fld] : fld_97a_A_A { $fld.MergeFrom($fld_97a_A_A.fld); } | fld_97a_A_B { $fld.MergeFrom($fld_97a_A_B.fld); } ; fld_17B_A returns [message::definition::swift::mt::Field fld] : fld_17B_A_B { $fld.MergeFrom($fld_17B_A_B.fld); } ; fld_16S_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16S"); } : START_OF_FIELD '16S:' ~(START_OF_FIELD)+; fld_16R_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16R"); } : START_OF_FIELD '16R:' ~(START_OF_FIELD)+; fld_95a_B returns [message::definition::swift::mt::Field fld] : fld_95a_B_L { $fld.MergeFrom($fld_95a_B_L.fld); } | fld_95a_B_P { $fld.MergeFrom($fld_95a_B_P.fld); } | fld_95a_B_R { $fld.MergeFrom($fld_95a_B_R.fld); } ; fld_97a_B returns [message::definition::swift::mt::Field fld] : fld_97a_B_A { $fld.MergeFrom($fld_97a_B_A.fld); } | fld_97a_B_B { $fld.MergeFrom($fld_97a_B_B.fld); } ; fld_94a_B returns [message::definition::swift::mt::Field fld] : fld_94a_B_B { $fld.MergeFrom($fld_94a_B_B.fld); } | fld_94a_B_C { $fld.MergeFrom($fld_94a_B_C.fld); } | fld_94a_B_F { $fld.MergeFrom($fld_94a_B_F.fld); } | fld_94a_B_L { $fld.MergeFrom($fld_94a_B_L.fld); } ; fld_17B_B returns [message::definition::swift::mt::Field fld] : fld_17B_B_B { $fld.MergeFrom($fld_17B_B_B.fld); } ; fld_16R_B1 returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16R"); } : START_OF_FIELD '16R:' ~(START_OF_FIELD)+; fld_35B_B1 returns [message::definition::swift::mt::Field fld] : fld_35B_B1_B { $fld.MergeFrom($fld_35B_B1_B.fld); } ; fld_16R_B1a returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16R"); } : START_OF_FIELD '16R:' ~(START_OF_FIELD)+; fld_94a_B1a returns [message::definition::swift::mt::Field fld] : fld_94a_B1a_B { $fld.MergeFrom($fld_94a_B1a_B.fld); } | fld_94a_B1a_D { $fld.MergeFrom($fld_94a_B1a_D.fld); } ; fld_22F_B1a returns [message::definition::swift::mt::Field fld] : fld_22F_B1a_F { $fld.MergeFrom($fld_22F_B1a_F.fld); } ; fld_12a_B1a returns [message::definition::swift::mt::Field fld] : fld_12a_B1a_A { $fld.MergeFrom($fld_12a_B1a_A.fld); } | fld_12a_B1a_B { $fld.MergeFrom($fld_12a_B1a_B.fld); } | fld_12a_B1a_C { $fld.MergeFrom($fld_12a_B1a_C.fld); } ; fld_11A_B1a returns [message::definition::swift::mt::Field fld] : fld_11A_B1a_A { $fld.MergeFrom($fld_11A_B1a_A.fld); } ; fld_98A_B1a returns [message::definition::swift::mt::Field fld] : fld_98A_B1a_A { $fld.MergeFrom($fld_98A_B1a_A.fld); } ; fld_92A_B1a returns [message::definition::swift::mt::Field fld] : fld_92A_B1a_A { $fld.MergeFrom($fld_92A_B1a_A.fld); } ; fld_13a_B1a returns [message::definition::swift::mt::Field fld] : fld_13a_B1a_A { $fld.MergeFrom($fld_13a_B1a_A.fld); } | fld_13a_B1a_B { $fld.MergeFrom($fld_13a_B1a_B.fld); } | fld_13a_B1a_K { $fld.MergeFrom($fld_13a_B1a_K.fld); } ; fld_17B_B1a returns [message::definition::swift::mt::Field fld] : fld_17B_B1a_B { $fld.MergeFrom($fld_17B_B1a_B.fld); } ; fld_90a_B1a returns [message::definition::swift::mt::Field fld] : fld_90a_B1a_A { $fld.MergeFrom($fld_90a_B1a_A.fld); } | fld_90a_B1a_B { $fld.MergeFrom($fld_90a_B1a_B.fld); } ; fld_36B_B1a returns [message::definition::swift::mt::Field fld] : fld_36B_B1a_B { $fld.MergeFrom($fld_36B_B1a_B.fld); } ; fld_35B_B1a returns [message::definition::swift::mt::Field fld] : fld_35B_B1a_B { $fld.MergeFrom($fld_35B_B1a_B.fld); } ; fld_70E_B1a returns [message::definition::swift::mt::Field fld] : fld_70E_B1a_E { $fld.MergeFrom($fld_70E_B1a_E.fld); } ; fld_16S_B1a returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16S"); } : START_OF_FIELD '16S:' ~(START_OF_FIELD)+; fld_22H_B1 returns [message::definition::swift::mt::Field fld] : fld_22H_B1_H { $fld.MergeFrom($fld_22H_B1_H.fld); } ; fld_90a_B1 returns [message::definition::swift::mt::Field fld] : fld_90a_B1_A { $fld.MergeFrom($fld_90a_B1_A.fld); } | fld_90a_B1_B { $fld.MergeFrom($fld_90a_B1_B.fld); } | fld_90a_B1_E { $fld.MergeFrom($fld_90a_B1_E.fld); } ; fld_94B_B1 returns [message::definition::swift::mt::Field fld] : fld_94B_B1_B { $fld.MergeFrom($fld_94B_B1_B.fld); } ; fld_98a_B1 returns [message::definition::swift::mt::Field fld] : fld_98a_B1_A { $fld.MergeFrom($fld_98a_B1_A.fld); } | fld_98a_B1_C { $fld.MergeFrom($fld_98a_B1_C.fld); } ; fld_93B_B1 returns [message::definition::swift::mt::Field fld] : fld_93B_B1_B { $fld.MergeFrom($fld_93B_B1_B.fld); } ; fld_16R_B1b returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16R"); } : START_OF_FIELD '16R:' ~(START_OF_FIELD)+; fld_93a_B1b returns [message::definition::swift::mt::Field fld] : fld_93a_B1b_B { $fld.MergeFrom($fld_93a_B1b_B.fld); } | fld_93a_B1b_C { $fld.MergeFrom($fld_93a_B1b_C.fld); } ; fld_22a_B1b returns [message::definition::swift::mt::Field fld] : fld_22a_B1b_F { $fld.MergeFrom($fld_22a_B1b_F.fld); } | fld_22a_B1b_H { $fld.MergeFrom($fld_22a_B1b_H.fld); } ; fld_94a_B1b returns [message::definition::swift::mt::Field fld] : fld_94a_B1b_B { $fld.MergeFrom($fld_94a_B1b_B.fld); } | fld_94a_B1b_C { $fld.MergeFrom($fld_94a_B1b_C.fld); } | fld_94a_B1b_F { $fld.MergeFrom($fld_94a_B1b_F.fld); } | fld_94a_B1b_L { $fld.MergeFrom($fld_94a_B1b_L.fld); } ; fld_90a_B1b returns [message::definition::swift::mt::Field fld] : fld_90a_B1b_A { $fld.MergeFrom($fld_90a_B1b_A.fld); } | fld_90a_B1b_B { $fld.MergeFrom($fld_90a_B1b_B.fld); } | fld_90a_B1b_E { $fld.MergeFrom($fld_90a_B1b_E.fld); } ; fld_98a_B1b returns [message::definition::swift::mt::Field fld] : fld_98a_B1b_A { $fld.MergeFrom($fld_98a_B1b_A.fld); } | fld_98a_B1b_C { $fld.MergeFrom($fld_98a_B1b_C.fld); } ; fld_99A_B1b returns [message::definition::swift::mt::Field fld] : fld_99A_B1b_A { $fld.MergeFrom($fld_99A_B1b_A.fld); } ; fld_19A_B1b returns [message::definition::swift::mt::Field fld] : fld_19A_B1b_A { $fld.MergeFrom($fld_19A_B1b_A.fld); } ; fld_92B_B1b returns [message::definition::swift::mt::Field fld] : fld_92B_B1b_B { $fld.MergeFrom($fld_92B_B1b_B.fld); } ; fld_70C_B1b returns [message::definition::swift::mt::Field fld] : fld_70C_B1b_C { $fld.MergeFrom($fld_70C_B1b_C.fld); } ; fld_28E_A_E returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("28E"); }: START_OF_FIELD '28E:' ~(START_OF_FIELD)+ ; fld_13a_A_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("13A"); }: START_OF_FIELD '13A:' ~(START_OF_FIELD)+ ; fld_13a_A_J returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("13J"); }: START_OF_FIELD '13J:' ~(START_OF_FIELD)+ ; fld_20C_A_C returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("20C"); }: START_OF_FIELD '20C:' ~(START_OF_FIELD)+ ; fld_23G_A_G returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("23G"); }: START_OF_FIELD '23G:' ~(START_OF_FIELD)+ ; fld_98a_A_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("98A"); }: START_OF_FIELD '98A:' ~(START_OF_FIELD)+ ; fld_98a_A_C returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("98C"); }: START_OF_FIELD '98C:' ~(START_OF_FIELD)+ ; fld_98a_A_E returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("98E"); }: START_OF_FIELD '98E:' ~(START_OF_FIELD)+ ; fld_22F_A_F returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("22F"); }: START_OF_FIELD '22F:' ~(START_OF_FIELD)+ ; fld_13a_A1_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("13A"); }: START_OF_FIELD '13A:' ~(START_OF_FIELD)+ ; fld_13a_A1_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("13B"); }: START_OF_FIELD '13B:' ~(START_OF_FIELD)+ ; fld_20C_A1_C returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("20C"); }: START_OF_FIELD '20C:' ~(START_OF_FIELD)+ ; fld_95a_A_L returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("95L"); }: START_OF_FIELD '95L:' ~(START_OF_FIELD)+ ; fld_95a_A_P returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("95P"); }: START_OF_FIELD '95P:' ~(START_OF_FIELD)+ ; fld_95a_A_R returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("95R"); }: START_OF_FIELD '95R:' ~(START_OF_FIELD)+ ; fld_97a_A_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("97A"); }: START_OF_FIELD '97A:' ~(START_OF_FIELD)+ ; fld_97a_A_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("97B"); }: START_OF_FIELD '97B:' ~(START_OF_FIELD)+ ; fld_17B_A_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("17B"); }: START_OF_FIELD '17B:' ~(START_OF_FIELD)+ ; fld_95a_B_L returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("95L"); }: START_OF_FIELD '95L:' ~(START_OF_FIELD)+ ; fld_95a_B_P returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("95P"); }: START_OF_FIELD '95P:' ~(START_OF_FIELD)+ ; fld_95a_B_R returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("95R"); }: START_OF_FIELD '95R:' ~(START_OF_FIELD)+ ; fld_97a_B_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("97A"); }: START_OF_FIELD '97A:' ~(START_OF_FIELD)+ ; fld_97a_B_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("97B"); }: START_OF_FIELD '97B:' ~(START_OF_FIELD)+ ; fld_94a_B_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("94B"); }: START_OF_FIELD '94B:' ~(START_OF_FIELD)+ ; fld_94a_B_C returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("94C"); }: START_OF_FIELD '94C:' ~(START_OF_FIELD)+ ; fld_94a_B_F returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("94F"); }: START_OF_FIELD '94F:' ~(START_OF_FIELD)+ ; fld_94a_B_L returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("94L"); }: START_OF_FIELD '94L:' ~(START_OF_FIELD)+ ; fld_17B_B_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("17B"); }: START_OF_FIELD '17B:' ~(START_OF_FIELD)+ ; fld_35B_B1_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("35B"); }: START_OF_FIELD '35B:' ~(START_OF_FIELD)+ ; fld_94a_B1a_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("94B"); }: START_OF_FIELD '94B:' ~(START_OF_FIELD)+ ; fld_94a_B1a_D returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("94D"); }: START_OF_FIELD '94D:' ~(START_OF_FIELD)+ ; fld_22F_B1a_F returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("22F"); }: START_OF_FIELD '22F:' ~(START_OF_FIELD)+ ; fld_12a_B1a_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("12A"); }: START_OF_FIELD '12A:' ~(START_OF_FIELD)+ ; fld_12a_B1a_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("12B"); }: START_OF_FIELD '12B:' ~(START_OF_FIELD)+ ; fld_12a_B1a_C returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("12C"); }: START_OF_FIELD '12C:' ~(START_OF_FIELD)+ ; fld_11A_B1a_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("11A"); }: START_OF_FIELD '11A:' ~(START_OF_FIELD)+ ; fld_98A_B1a_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("98A"); }: START_OF_FIELD '98A:' ~(START_OF_FIELD)+ ; fld_92A_B1a_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("92A"); }: START_OF_FIELD '92A:' ~(START_OF_FIELD)+ ; fld_13a_B1a_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("13A"); }: START_OF_FIELD '13A:' ~(START_OF_FIELD)+ ; fld_13a_B1a_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("13B"); }: START_OF_FIELD '13B:' ~(START_OF_FIELD)+ ; fld_13a_B1a_K returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("13K"); }: START_OF_FIELD '13K:' ~(START_OF_FIELD)+ ; fld_17B_B1a_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("17B"); }: START_OF_FIELD '17B:' ~(START_OF_FIELD)+ ; fld_90a_B1a_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("90A"); }: START_OF_FIELD '90A:' ~(START_OF_FIELD)+ ; fld_90a_B1a_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("90B"); }: START_OF_FIELD '90B:' ~(START_OF_FIELD)+ ; fld_36B_B1a_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("36B"); }: START_OF_FIELD '36B:' ~(START_OF_FIELD)+ ; fld_35B_B1a_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("35B"); }: START_OF_FIELD '35B:' ~(START_OF_FIELD)+ ; fld_70E_B1a_E returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("70E"); }: START_OF_FIELD '70E:' ~(START_OF_FIELD)+ ; fld_22H_B1_H returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("22H"); }: START_OF_FIELD '22H:' ~(START_OF_FIELD)+ ; fld_90a_B1_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("90A"); }: START_OF_FIELD '90A:' ~(START_OF_FIELD)+ ; fld_90a_B1_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("90B"); }: START_OF_FIELD '90B:' ~(START_OF_FIELD)+ ; fld_90a_B1_E returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("90E"); }: START_OF_FIELD '90E:' ~(START_OF_FIELD)+ ; fld_94B_B1_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("94B"); }: START_OF_FIELD '94B:' ~(START_OF_FIELD)+ ; fld_98a_B1_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("98A"); }: START_OF_FIELD '98A:' ~(START_OF_FIELD)+ ; fld_98a_B1_C returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("98C"); }: START_OF_FIELD '98C:' ~(START_OF_FIELD)+ ; fld_93B_B1_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("93B"); }: START_OF_FIELD '93B:' ~(START_OF_FIELD)+ ; fld_93a_B1b_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("93B"); }: START_OF_FIELD '93B:' ~(START_OF_FIELD)+ ; fld_93a_B1b_C returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("93C"); }: START_OF_FIELD '93C:' ~(START_OF_FIELD)+ ; fld_22a_B1b_F returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("22F"); }: START_OF_FIELD '22F:' ~(START_OF_FIELD)+ ; fld_22a_B1b_H returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("22H"); }: START_OF_FIELD '22H:' ~(START_OF_FIELD)+ ; fld_94a_B1b_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("94B"); }: START_OF_FIELD '94B:' ~(START_OF_FIELD)+ ; fld_94a_B1b_C returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("94C"); }: START_OF_FIELD '94C:' ~(START_OF_FIELD)+ ; fld_94a_B1b_F returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("94F"); }: START_OF_FIELD '94F:' ~(START_OF_FIELD)+ ; fld_94a_B1b_L returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("94L"); }: START_OF_FIELD '94L:' ~(START_OF_FIELD)+ ; fld_90a_B1b_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("90A"); }: START_OF_FIELD '90A:' ~(START_OF_FIELD)+ ; fld_90a_B1b_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("90B"); }: START_OF_FIELD '90B:' ~(START_OF_FIELD)+ ; fld_90a_B1b_E returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("90E"); }: START_OF_FIELD '90E:' ~(START_OF_FIELD)+ ; fld_98a_B1b_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("98A"); }: START_OF_FIELD '98A:' ~(START_OF_FIELD)+ ; fld_98a_B1b_C returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("98C"); }: START_OF_FIELD '98C:' ~(START_OF_FIELD)+ ; fld_99A_B1b_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("99A"); }: START_OF_FIELD '99A:' ~(START_OF_FIELD)+ ; fld_19A_B1b_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("19A"); }: START_OF_FIELD '19A:' ~(START_OF_FIELD)+ ; fld_92B_B1b_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("92B"); }: START_OF_FIELD '92B:' ~(START_OF_FIELD)+ ; fld_70C_B1b_C returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("70C"); }: START_OF_FIELD '70C:' ~(START_OF_FIELD)+ ; TAG_BH : '{1:' ; TAG_AH : '{2:' ; TAG_UH : '{3:' ; TAG_MT : '{4:' ; TAG_TR : '{5:' ; MT_END : '-}'; LBRACE : '{'; RBRACE : '}' ; COLON : ':'; START_OF_FIELD : '\r'? '\n:' ; ANY : . ;
Web/asm/examples/Reflection (LCD).asm
visrealm/vrcpu
102
172235
<gh_stars>100-1000 DISPLAY_MODE = LCD_CMD_DISPLAY | LCD_CMD_DISPLAY_ON SCROLL_LEFT = LCD_CMD_SHIFT | LCD_CMD_SHIFT_DISPLAY | LCD_CMD_SHIFT_LEFT SCROLL_RIGHT = LCD_CMD_SHIFT | LCD_CMD_SHIFT_DISPLAY | LCD_CMD_SHIFT_RIGHT NEXTLINE = LCD_CMD_SET_DRAM_ADDR | 40 lcc #LCD_INITIALIZE lcc #DISPLAY_MODE start: clra lcc #LCD_CMD_CLEAR call buildCustomCharacters lcc #LCD_CMD_SET_DRAM_ADDR data Ra, helloStr call printStr lcc #NEXTLINE data Ra, unsideDnStr call printStr clr Rb data Ra, 4 .scrollRight: lcc #SCROLL_RIGHT inc Rb cmp Ra jnz .scrollRight .scrollLeft: lcc #SCROLL_LEFT dec Rb jnz .scrollLeft jmp .scrollRight buildCustomCharacters: lcc #LCD_CMD_SET_CGRAM_ADDR data Rb, (charDataEnd - charData) data Rc, charData .addLine: lod Ra, Rc lcd Ra inc Rc dec Rb jnz .addLine ret printStr: mov Rc, Ra .nextChar: lod Ra, Rc tst Ra jz .done lcd Ra inc Rc jmp .nextChar .done: ret helloStr: #str "Hello World!\0" unsideDnStr: #d104 0x08010202032004030502060700 charData: #d64 0x001111111f111111 ; H #d64 0x000e101f110e0000 ; e #d64 0x000e04040404040c ; l #d64 0x000e1111110e0000 ; o #d64 0x000a151515111111 ; W #d64 0x0010101019160000 ; r #d64 0x000f1111130d0101 ; d #d64 0x0004000004040404 ; ! charDataEnd:
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c5/c52104k.ada
best08618/asylo
7
29686
-- C52104K.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- CHECK THAT LENGTHS MUST MATCH IN ARRAY AND SLICE ASSIGNMENTS. -- MORE SPECIFICALLY, TEST THAT ATTEMPTED ASSIGNMENTS BETWEEN -- ARRAYS WITH NON-MATCHING LENGTHS LEAVE THE DESTINATION ARRAY -- INTACT AND CAUSE CONSTRAINT_ERROR TO BE RAISED. -- (OVERLAPS BETWEEN THE OPERANDS OF THE ASSIGNMENT STATEMENT -- ARE TREATED ELSEWHERE.) -- DIVISION C : NON-NULL LENGTHS NOT DETERMINABLE STATICALLY. -- RM 07/20/81 -- SPS 3/22/83 WITH REPORT; PROCEDURE C52104K IS USE REPORT ; BEGIN TEST( "C52104K" , "CHECK THAT IN ARRAY ASSIGNMENTS AND IN SLICE" & " ASSIGNMENTS THE LENGTHS MUST MATCH" ); -- IN THIS TEST WE CAN'T USE AGGREGATE ASSIGNMENT (EXCEPT WHEN -- THE AGGREGATES ARE STRING LITERALS); THEREFORE: -- -- (1) ARRAYS WILL BE INITIALIZED BY INDIVIDUAL ASSIGNMENTS; -- (2) CAN'T USE NON-NULL CONSTANT ARRAYS. -- WE ASSUME THAT IN AN ARRAY_TYPE_DEFINITION THE INDEX PORTION -- AND THE COMPONENT_TYPE PORTION ARE FUNCTIONALLY ORTHOGONAL -- ALSO AT THE IMPLEMENTATION LEVEL, I.E. THAT THE CORRECTNESS -- OF THE ACCESSING MECHANISM FOR ARRAYS DOES NOT DEPEND ON -- COMPONENT_TYPE. ACCORDINGLY WE ARE TESTING FOR SOME BUT -- NOT ALL KINDS OF COMPONENT_TYPE. (COMPONENT_TYPES INCLUDED: -- INTEGER , CHARACTER , BOOLEAN .) -- CASES DISTINGUISHED: ( 8 SELECTED CASES ARE IMPLEMENTED) -- -- ( THE 8 SELECTIONS ARE THE 5-CASE -- SERIES 10-11-12-13-14 FOLLOWED -- BY 7 , 8 , 9 (IN THIS ORDER). ) -- -- -- ( EACH DIVISION COMPRISES 3 FILES, -- COVERING RESPECTIVELY THE FIRST -- 3 , NEXT 2 , AND LAST 3 OF THE 8 -- SELECTIONS FOR THE DIVISION.) -- -- -- (1..6) (DO NOT APPLY TO NON-MATCHING OBJECTS, SINCE WE WANT -- THE OBJECTS TO HAVE THE S A M E BASE TYPE.) -- -- -- (7) UNSLICED OBJECTS OF THE PREDEFINED TYPE 'STRING' (BY -- THEMSELVES). -- -- -- (8) SLICED OBJECTS OF THE PREDEFINED TYPE 'STRING' , WITH -- STRING LITERALS. -- -- -- (9) SLICED OBJECTS OF THE PREDEFINED TYPE 'STRING' (BY -- THEMSELVES). -- -- -- (-) CONSTRAINABLE TYPES: ONLY SUBTESTS 2, 3, 4, 5, 6 -- WILL BE REPLICATED -- AS SUBTESTS 10, 11, 12, 13, 14 . -- -- -- (10) MULTIDIMENSIONAL ARRAY OBJECTS WHOSE TYPEMARKS WERE -- DEFINED USING THE "BOX" COMPOUND SYMBOL. -- (TWO-DIMENSIONAL ARRAYS OF INTEGERS.) -- -- -- (11) UNSLICED ONE-DIMENSIONAL ARRAY OBJECTS WHOSE TYPEMARKS -- WERE DEFINED USING THE "BOX" SYMBOL -- AND FOR WHICH THE COMPONENT TYPE IS NOT 'CHARACTER' . -- ((ONE-DIMENSIONAL) ARRAYS OF INTEGERS.) -- -- -- (12) SLICED ONE-DIMENSIONAL ARRAY OBJECTS WHOSE TYPEMARKS -- WERE DEFINED USING THE "BOX" SYMBOL -- AND FOR WHICH THE COMPONENT TYPE IS NOT 'CHARACTER' . -- ((ONE-DIMENSIONAL) ARRAYS OF BOOLEANS.) -- -- -- (13) UNSLICED ONE-DIMENSIONAL ARRAY OBJECTS WHOSE TYPEMARKS -- WERE DEFINED USING THE "BOX" SYMBOL -- AND FOR WHICH THE COMPONENT TYPE IS 'CHARACTER' . -- -- (STRING LITERALS ARE THE ONLY AGGREGATES WE ARE USING -- IN THIS TEST. TO FORCE SLIDING, THE LOWER LIMIT IMPLIED -- BY THE TYPEMARK WILL NOT BE 1 .) -- -- -- (14) SLICED ONE-DIMENSIONAL ARRAY OBJECTS WHOSE TYPEMARKS -- WERE DEFINED USING THE "BOX" SYMBOL -- AND FOR WHICH THE COMPONENT TYPE IS 'CHARACTER' . -- -- -- -- (-) SPECIAL CASES: NULL ARRAYS....... TREATED IN DIVISION B. -- SUPERLONG ARRAYS.. (TREATED FOR DYNAMIC -- ARRAYS ONLY, -- DIVISIONS C AND D .) -- -- -- (-) THE STATIC-ARRAY COUNTERPARTS OF THESE TESTS ARE IN DI- -- VISIONS A (FOR NON-NULL ARRAYS) AND B (FOR NULL ARRAYS). -- -- ------------------------------------------------------------------- -- (1..6: NOT APPLICABLE) -- -- ------------------------------------------------------------------- -- (10) MULTIDIMENSIONAL ARRAY OBJECTS WHOSE TYPEMARKS WERE -- DEFINED USING THE "BOX" COMPOUND SYMBOL. -- (TWO-DIMENSIONAL ARRAYS OF INTEGERS.) DECLARE TYPE TABOX0 IS ARRAY( INTEGER RANGE <> , INTEGER RANGE <> ) OF INTEGER ; SUBTYPE TABOX01 IS TABOX0( IDENT_INT(1)..IDENT_INT(5) , IDENT_INT(0)..IDENT_INT(7) ); SUBTYPE TABOX02 IS TABOX0( IDENT_INT(0)..IDENT_INT(5) , IDENT_INT(2)..IDENT_INT(9) ); ARRX01 : TABOX01 ; ARRX02 : TABOX02 ; BEGIN -- INITIALIZATION OF RHS ARRAY: FOR I IN IDENT_INT(1)..IDENT_INT(5) LOOP FOR J IN IDENT_INT(0)..IDENT_INT(7) LOOP ARRX01( I , J ) := I * I * J ; END LOOP; END LOOP; -- INITIALIZATION OF LHS ARRAY: FOR I IN IDENT_INT(0)..IDENT_INT(5) LOOP FOR J IN IDENT_INT(2)..IDENT_INT(9) LOOP ARRX02( I , J ) := I * I * J * 3 ; END LOOP; END LOOP; -- ARRAY ASSIGNMENT: ARRX02 := ARRX01 ; FAILED( "EXCEPTION NOT RAISED - SUBTEST 10" ); EXCEPTION WHEN CONSTRAINT_ERROR => -- CHECKING THE VALUES AFTER THE ARRAY ASSIGNMENT: FOR I IN IDENT_INT(0)..IDENT_INT(5) LOOP FOR J IN IDENT_INT(2)..IDENT_INT(9) LOOP IF ARRX02( I , J ) /= I * I * J * 3 THEN FAILED( "ORIG. VALUE ALTERED (10)" ); END IF; END LOOP; END LOOP; WHEN OTHERS => FAILED( "WRONG EXCEPTION RAISED - SUBTEST 10" ); END ; ------------------------------------------------------------------- -- (11) UNSLICED ONE-DIMENSIONAL ARRAY OBJECTS WHOSE TYPEMARKS -- WERE DEFINED USING THE "BOX" SYMBOL -- AND FOR WHICH THE COMPONENT TYPE IS NOT 'CHARACTER' . -- ((ONE-DIMENSIONAL) ARRAYS OF INTEGERS.) DECLARE TYPE TABOX1 IS ARRAY( INTEGER RANGE <> ) OF INTEGER ; SUBTYPE TABOX11 IS TABOX1( IDENT_INT(1)..IDENT_INT(5) ) ; ARRX11 : TABOX11 ; ARRX12 : TABOX1( IDENT_INT(6)..IDENT_INT(9) ); BEGIN -- INITIALIZATION OF RHS ARRAY: FOR I IN IDENT_INT(1)..IDENT_INT(5) LOOP ARRX11( I ) := I * I ; END LOOP; -- INITIALIZATION OF LHS ARRAY: FOR I IN IDENT_INT(6)..IDENT_INT(9) LOOP ARRX12( I ) := I * I * 3 ; END LOOP; -- ARRAY ASSIGNMENT: ARRX12 := ARRX11 ; FAILED( "EXCEPTION NOT RAISED - SUBTEST 11" ); EXCEPTION WHEN CONSTRAINT_ERROR => -- CHECKING THE VALUES AFTER THE ARRAY ASSIGNMENT: FOR I IN IDENT_INT(6)..IDENT_INT(9) LOOP IF ARRX12( I ) /= I * I * 3 THEN FAILED( "ORIG. VALUE ALTERED (11)" ); END IF; END LOOP; WHEN OTHERS => FAILED( "WRONG EXCEPTION RAISED - SUBTEST 11" ); END ; ------------------------------------------------------------------- -- (12) SLICED ONE-DIMENSIONAL ARRAY OBJECTS WHOSE TYPEMARKS -- WERE DEFINED USING THE "BOX" SYMBOL -- AND FOR WHICH THE COMPONENT TYPE IS NOT 'CHARACTER' . -- ((ONE-DIMENSIONAL) ARRAYS OF BOOLEANS.) DECLARE TYPE TABOX5 IS ARRAY( INTEGER RANGE <> ) OF BOOLEAN ; SUBTYPE TABOX51 IS TABOX5( IDENT_INT(1)..IDENT_INT(5) ); ARRX51 : TABOX51 ; ARRX52 : TABOX5( IDENT_INT(5)..IDENT_INT(9) ); BEGIN -- INITIALIZATION OF LHS ARRAY: FOR I IN IDENT_INT(5)..IDENT_INT(9) LOOP ARRX52( I ) := FALSE ; END LOOP; -- INITIALIZATION OF RHS ARRAY: FOR I IN IDENT_INT(1)..IDENT_INT(5) LOOP ARRX51( I ) := TRUE ; END LOOP; -- SLICE ASSIGNMENT: ARRX52( IDENT_INT(6)..IDENT_INT(9) ) := ARRX51( IDENT_INT(3)..IDENT_INT(3) ) ; FAILED( "EXCEPTION NOT RAISED (12)" ); EXCEPTION WHEN CONSTRAINT_ERROR => -- CHECKING THE VALUES AFTER THE SLICE ASSIGNMENT: FOR I IN IDENT_INT(5)..IDENT_INT(9) LOOP IF ARRX52( I ) /= FALSE THEN FAILED( "LHS ARRAY ALTERED ( 12 ) " ); END IF; END LOOP; WHEN OTHERS => FAILED( "EXCEPTION RAISED - SUBTEST 12" ); END ; ------------------------------------------------------------------- RESULT ; END C52104K;
examples/instance-arguments/08-higherOrder.agda
asr/agda-kanso
1
12394
<filename>examples/instance-arguments/08-higherOrder.agda module 08-higherOrder where explicitize : ∀ {A : Set} {B : A → Set} → ({{x : A}} → B x) → (x : A) → B x explicitize f x = f {{x}} implicitize : ∀ {A : Set} {B : A → Set} → ((x : A) → B x) → {{x : A}} → B x implicitize f {{x}} = f x data T : Set where tt : T test = explicitize (λ {{t : T}} → t)
Gramaticas/Expr.g4
cor14095/proyecto1Compis
0
1078
grammar Expr; //KeyWords CLASS : 'class'; STRUCT : 'struct'; TRUE : 'true'; FALSE : 'false'; INT : 'int'; IF : 'if'; ELSE : 'else'; WHILE : 'while'; RETURN : 'return'; CHAR : 'char'; BOOLEAN : 'boolean'; VOID : 'void'; SCAN : 'scan'; PRINT : 'print'; //Characters fragment LETTER: ('a'..'z' | 'A'..'Z'); //\f\s las quite de WS WS: [ \t\r\n]+ -> channel(HIDDEN);//Whitespace declaration fragment DIGIT: ('0'..'9'); CHR : '\''(LETTER|DIGIT|' '|EXC|'"'|'#'|'$'|'%'|'^'|'&'|'*'|LPARENT|RPARENT|PLUS|'_'|MINUS|'?'|'\''|'.'|','|'<'|'>'|':'|';'|'`'|'~'|'@'|'\"') '\''; ID: LETTER(DIGIT|LETTER)*; NUM: (DIGIT)+; STRING: '\"'(LETTER|DIGIT|' '|EXC|'"'|'#'|'$'|'%'|'^'|'&'|'*'|LPARENT|RPARENT|PLUS|'_'|MINUS|'?'|'\''|'.'|','|'<'|'>'|':'|';'|'`'|'~'|'@'|'\"'|[\\s])+'\"'; COMMENT: '//'(~('\r'|'\n'))*{skip();}; COMA: ','; AND: '&&'; OR:'||'; LBRACE: '{'; RBRACE: '}'; DOTCOMMA: ';'; RCORCH: ']'; LCORCH: '['; LPARENT: '('; RPARENT: ')'; EQ: '='; DOT: '.'; PLUS: '+'; MINUS: '-'; EXC: '!'; AST: '*'; SLSH: '/'; PRCNT: '%'; MTHAN: '>'; LTHAN: '<'; EQMTHAN: '>='; EQLTHAN: '<='; EQEQ: '=='; NOTEQ: '!='; program: CLASS ID LBRACE (declaration)* RBRACE; declaration: structDeclaration | varDeclaration | methodDeclaration; varDeclaration: varType ID DOTCOMMA | varType ID LCORCH NUM RCORCH DOTCOMMA ; structDeclaration: STRUCT ID LBRACE (varDeclaration)* RBRACE;//Ambito +1 varType: (INT | CHAR | BOOLEAN | (STRUCT ID) | structDeclaration | VOID); methodDeclaration: methodType ID LPARENT (parameter(COMA parameter)*)? RPARENT block; methodType: INT | CHAR | BOOLEAN | VOID; parameter: parameterType ID | parameterType ID LCORCH RCORCH; parameterType: INT | CHAR | BOOLEAN ; block: LBRACE (varDeclaration)* (statement)* RBRACE ; statement: myIf | returnBlock | whileBlock | methodCall DOTCOMMA | assignation | expression DOTCOMMA | print; assignation: location EQ (expression | scan ) DOTCOMMA ; whileBlock: WHILE LPARENT expression RPARENT block ; returnBlock: RETURN (nExpression) DOTCOMMA ; //scan y print print: PRINT LPARENT ( STRING | location ) RPARENT DOTCOMMA; scan: SCAN LPARENT RPARENT; myIf: IF LPARENT expression RPARENT block(ELSE block)?; location: declaredVariable | dotLocation; dotLocation: variable ( DOT location) | arrayVariable ( DOT location); declaredVariable: variable | arrayVariable; variable: ID; arrayVariable: ID LCORCH expression RCORCH ; expressionInP: LPARENT expression RPARENT ; //jerarquia de operaciones nExpression: expression | ; expression: andExpression | expression OR andExpression; andExpression: equalsExpression | andExpression AND equalsExpression; equalsExpression: relationExpression | equalsExpression eq_op relationExpression; relationExpression: addSubsExpression | relationExpression rel_op addSubsExpression; addSubsExpression: mulDivExpression | addSubsExpression as_op mulDivExpression; mulDivExpression: prExpression | mulDivExpression md_op prExpression; prExpression: basicExpression | prExpression pr_op basicExpression; basicExpression: LPARENT (INT|CHAR) RPARENT basic | MINUS basic | EXC basic | basic; basic : expressionInP | location | methodCall | literal; arg: expression; methodCall: ID LPARENT (arg(COMA arg)*)? RPARENT; //operadores as_op : PLUS | MINUS; md_op: AST | SLSH ; pr_op: PRCNT; rel_op: LTHAN | MTHAN | EQLTHAN | EQMTHAN ; eq_op: EQEQ | NOTEQ; cond_op: AND | OR; literal: int_literal | char_literal | bool_literal; int_literal: NUM; char_literal: CHR; bool_literal: TRUE | FALSE;
src/call_on_stack-msvc-win32.asm
qgymib/call_on_stack
0
244421
.model flat .code _call_on_stack__asm PROC push ebp mov ebp, esp sub esp, 8h ; backup callee saved registers push esi push edi ; backup stack mov esi, esp mov edi, ebp ; get func and arg mov eax, DWORD PTR 12[ebp] mov ecx, DWORD PTR 16[ebp] ; switch stack mov esp, DWORD PTR 8[ebp] mov ebp, esp ; func(arg) push ecx call eax ; restore stack mov esp, esi mov ebp, edi ; restore callee saved registers pop edi pop esi ; leave add esp, 8h pop ebp ret _call_on_stack__asm ENDP END
src/hott/truncation/elim.agda
pcapriotti/agda-base
20
11724
<reponame>pcapriotti/agda-base<gh_stars>10-100 {-# OPTIONS --without-K #-} module hott.truncation.elim where open import sum open import equality open import function open import hott.equivalence open import hott.level open import hott.loop open import hott.truncation.core open import hott.truncation.equality open import hott.univalence open import sets.nat open import sets.unit is-null : ∀ {i j}{X : Set i}{Y : Set j} → Y → (X → Y) → Set _ is-null y f = ∀ x → y ≡ f x is-null-level : ∀ {i j}{X : Set i}{Y : Set j} → h 2 Y → (y : Y)(f : X → Y) → h 1 (is-null y f) is-null-level hY y f = Π-level λ x → hY y (f x) compose-is-null : ∀ {i j k}{X : Set i}{Y : Set j}{Z : Set k} → (y : Y)(f : X → Y)(g : Y → Z) → is-null y f → is-null (g y) (g ∘ f) compose-is-null y f g c y' = ap g (c y') Null : ∀ {i j} → ℕ → Set i → Set j → Set _ Null n X Y = Σ (X → Y) λ f → (x : X) → is-null (refl' n (f x)) (mapΩ n f) -- connected components Conn : ∀ {i}{X : Set i}(n : ℕ) → Trunc n X → Set _ Conn {X = X} n c = Σ X λ x → [ x ] ≡ c map-conn : ∀ {i j}{X : Set i}{Y : Set j}(n : ℕ) → (c : Trunc n X) → (X → Y) → (Conn n c → Y) map-conn n c f (x , p) = f x conn-decomp : ∀ {i}{X : Set i}(n : ℕ) → Σ (Trunc n X) (Conn n) ≅ X conn-decomp {X = X} n = total-iso [_] conn-connected : ∀ {i}{X : Set i}(n : ℕ)(c : Trunc n X) → contr (Trunc n (Conn n c)) conn-connected {X = X} n c = φ c , lem c where φ' : (x : X) → Trunc n (Conn n [ x ]) φ' x = [ x , refl ] φ : (c : Trunc n X) → Trunc n (Conn n c) φ = Trunc-dep-elim n (λ c → Trunc n (Conn n c)) (λ _ → Trunc-level n) φ' lem' : (c : Trunc n X)(a : Conn n c) → φ c ≡ [ a ] lem' .([ x ]) (x , refl) = Trunc-dep-elim-β n (λ c → Trunc n (Conn n c)) (λ _ → Trunc-level n) φ' x lem : (c : Trunc n X)(a : Trunc n (Conn n c)) → φ c ≡ a lem c = Trunc-dep-elim n (λ a → φ c ≡ a) (λ a → h↑ (Trunc-level n) (φ c) a) (lem' c) -- main result module CM {i j} n (X : Set i)(Y : Set j) (hY : h (n + 2) Y) where cm' : Y → Null n X Y cm' y = (λ _ → y) , (λ x p → sym (mapΩ-const n y x p)) cm : (Trunc (suc n) X → Y) → Null n X Y cm f = (λ x → f [ x ]) , λ x → subst₂ (is-null) (mapΩ-refl n f) (eq x) (compose-is-null (refl' n [ x ]) (mapΩ n [_]) (mapΩ n f) (λ p → h1⇒prop (Ω-level n hT) _ _)) where f' : X → Y f' x = f [ x ] eq' : (x : X)(p : Ω n x) → mapΩ n f (mapΩ n [_] p) ≡ mapΩ n f' p eq' x p = mapΩ-hom n [_] f p eq : (x : X) → mapΩ n f ∘ mapΩ n [_] ≡ mapΩ n f' eq x = funext (eq' x) hT : h (n + 1) (Trunc (suc n) X) hT = subst (λ m → h m (Trunc (suc n) X)) (+-commutativity 1 n) (Trunc-level (suc n)) Trunc-elim' : ∀ {i j} n (X : Set i)(Y : Set j) → h (n + 2) Y → (Trunc (suc n) X → Y) ≅ Null n X Y null-connected : ∀ {i j} n {X : Set i}{Y : Set j} → contr (Trunc (suc n) X) → h (n + 2) Y → (f : X → Y) → ((x : X) → is-null (refl' n (f x)) (mapΩ n f {x})) → (x : X) → is-null (f x) f null-connected zero hX hY f c x₀ x₁ = c x₀ x₁ null-connected (suc n) {X} hX hY f c x₀ x₁ = φ (trunc-equality (suc n) (h1⇒prop (h↑ hX) _ _)) where ap-null : (x y : X)(p : x ≡ y) → is-null (refl' n (ap f p)) (mapΩ n (ap f) {p}) ap-null x .x refl = c x φ : Trunc (suc n) (x₀ ≡ x₁) → f x₀ ≡ f x₁ φ = invert (Trunc-elim' n (x₀ ≡ x₁) (f x₀ ≡ f x₁) (hY _ _)) ( ap f , ap-null x₀ x₁ ) Trunc-elim-connected : ∀ {i j} n (X : Set i)(Y : Set j) → contr (Trunc (suc n) X) → h (n + 2) Y → Y ≅ Null n X Y Trunc-elim-connected n X Y hX hY = ≈⇒≅ (cm' , cm-equiv' (proj₁ hX)) where open CM n X Y hY module _ (x₀ : X) where g : Null n X Y → Y g (f , c) = f x₀ α : (y : Y) → g (cm' y) ≡ y α y = refl β : (x : Null n X Y) → cm' (g x) ≡ x β (f , c) = unapΣ ( (funext λ x → null-connected n hX hY f c _ _) , h1⇒prop (Π-level λ x → is-null-level (Ω-level n hY) _ _) _ _) f-iso : Y ≅ Null n X Y f-iso = iso cm' g α β cm-equiv : X → weak-equiv cm' cm-equiv x₀ = proj₂ (≅⇒≈ (f-iso x₀)) cm-equiv' : Trunc (suc n) X → weak-equiv cm' cm-equiv' = invert (Trunc-elim-iso (suc n) X (weak-equiv cm') (h! (weak-equiv-h1 cm'))) cm-equiv abstract Trunc-elim'₀ : ∀ {i j} n (X : Set i)(Y : Set j) → h (n + 2) Y → (Trunc (suc n) X → Y) ≅ Null n X Y Trunc-elim'₀ n X Y hY = begin (Trunc (suc n) X → Y) ≅⟨ ( Π-ap-iso refl≅ λ c → Trunc-elim-connected n _ _ (conn-connected (suc n) c) hY) ⟩ ((c : Trunc (suc n) X) → Null n (Conn (suc n) c) Y) ≅⟨ ΠΣ-swap-iso ⟩ ( Σ ((c : Trunc (suc n) X) → Conn (suc n) c → Y) λ f → ((c : Trunc (suc n) X) → (x : Conn (suc n) c) → is-null _ (mapΩ n (f c))) ) ≅⟨ sym≅ ( Σ-ap-iso (curry-iso (λ _ _ → Y)) λ f → curry-iso λ c x → is-null _ (mapΩ n (λ x' → f (c , x'))) ) ⟩ ( Σ ((Σ (Trunc (suc n) X) λ c → Conn (suc n) c) → Y) λ f → (((x' : (Σ (Trunc (suc n) X) λ c → Conn (suc n) c)) → is-null _ (mapΩ n (λ x → f (proj₁ x' , x))))) ) ≅⟨ ( Σ-ap-iso' (→-ap-iso (conn-decomp (suc n)) refl≅) λ f → Π-ap-iso (conn-decomp (suc n)) λ x → refl≅ ) ⟩ ( Σ (X → Y) λ f → (((x : X) → is-null _ (mapΩ n (λ x → f (proj₁ x)) {x , refl}))) ) ≅⟨ ( Σ-ap-iso refl≅ λ f → Π-ap-iso refl≅ λ x → lem f x ) ⟩ Null n X Y ∎ where open ≅-Reasoning lem : (f : X → Y) (x : X) → is-null (refl' n (f x)) (mapΩ n (map-conn (suc n) [ x ] f) {x , refl}) ≅ is-null (refl' n (f x)) (mapΩ n f {x}) lem f x = ≡⇒≅ (ap (is-null (refl' n (f x))) (funext hom)) ·≅ sym≅ is-const-equiv where π : Conn (suc n) [ x ] → X π = proj₁ hom : (p : Ω n (x , refl)) → mapΩ n (map-conn (suc n) [ x ] f) p ≡ mapΩ n f (mapΩ n proj₁ p) hom p = sym (mapΩ-hom n proj₁ f p) φ : Ω n {Conn (suc n) [ x ]} (x , refl) ≅ Ω n x φ = loop-sum n λ a → Trunc-level (suc n) _ _ is-const-equiv : is-null {X = Ω n x} (refl' n (f x)) (mapΩ n f {x}) ≅ is-null {X = Ω n {Conn (suc n) [ x ]} (x , refl)} (refl' n (f x)) (mapΩ n f ∘ mapΩ n proj₁) is-const-equiv = Π-ap-iso (sym≅ φ) λ p → refl≅ Trunc-elim'-β₀ : ∀ {i j n}{X : Set i}{Y : Set j} (hY : h (n + 2) Y) → (f : Trunc (suc n) X → Y) → proj₁ (apply (Trunc-elim'₀ n X Y hY) f) ≡ (λ x → f [ x ]) Trunc-elim'-β₀ hY f = refl Trunc-elim'-β : ∀ {i j n}{X : Set i}{Y : Set j} (hY : h (n + 2) Y) → (f : Trunc (suc n) X → Y) → apply (Trunc-elim'₀ n X Y hY) f ≡ CM.cm n X Y hY f Trunc-elim'-β {n = n} hY f = unapΣ ( Trunc-elim'-β₀ hY f , h1⇒prop (Π-level λ x → is-null-level (Ω-level n hY) _ _) _ _ ) Trunc-elim' n X Y hY = ≈⇒≅ (cm , cm-we) where open CM n X Y hY cm-eq : apply (Trunc-elim'₀ n X Y hY) ≡ cm cm-eq = funext (Trunc-elim'-β hY) cm-we : weak-equiv cm cm-we = subst weak-equiv cm-eq (proj₂ (≅⇒≈ (Trunc-elim'₀ n X Y hY))) -- example Repr : ∀ {i} → Set i → Set _ Repr {i} A = Σ (Trunc 2 A → Set i) λ hom → (a : A) → hom [ a ] ≅ (a ≡ a) Braiding : ∀ {i} → Set i → Set _ Braiding A = {a : A}(p q : a ≡ a) → p · q ≡ q · p braiding-repr : ∀ {i}{A : Set i} → h 3 A → Braiding A → Repr A braiding-repr {i}{A} hA γ = (λ c → proj₁ (hom c)) , λ a → ≡⇒≅ (ap proj₁ (hom-β a)) where eq : A → Set _ eq a = (a ≡ a) hom' : A → Type _ 2 hom' a = eq a , hA a a type-eq-iso : ∀ {n}{X Y : Type i n} → (X ≡ Y) ≅ (proj₁ X ≈ proj₁ Y) type-eq-iso {n}{X}{Y} = begin (X ≡ Y) ≅⟨ sym≅ Σ-split-iso ⟩ (Σ (proj₁ X ≡ proj₁ Y) λ p → subst (h n) p (proj₂ X) ≡ proj₂ Y) ≅⟨ (Σ-ap-iso refl≅ λ p → contr-⊤-iso (hn-h1 n _ _ _)) ⟩ ((proj₁ X ≡ proj₁ Y) × ⊤) ≅⟨ ×-right-unit ⟩ (proj₁ X ≡ proj₁ Y) ≅⟨ uni-iso ⟩ (proj₁ X ≈ proj₁ Y) ∎ where open ≅-Reasoning type-eq : ∀ {n}{X : Type i n}{p : X ≡ X} → ((x : proj₁ X) → coerce (ap proj₁ p) x ≡ x) → p ≡ refl type-eq f = invert≅ (iso≡ type-eq-iso) (unapΣ ( funext f , h1⇒prop (weak-equiv-h1 _) _ _)) ap-eq : {a b : A}(p : a ≡ b)(q : a ≡ a) → coerce (ap proj₁ (ap hom' p)) q ≡ sym p · q · p ap-eq refl q = sym (left-unit q) hom-null : (a : A) → is-null refl (mapΩ 1 hom' {a}) hom-null a p = sym (type-eq λ q → ap-eq p q · ap (λ z → z · p) (γ (sym p) q) · associativity q (sym p) p · ap (λ z → q · z) (right-inverse p) · left-unit q) hom-iso : (Trunc 2 A → Type i 2) ≅ Null 1 A (Type i 2) hom-iso = Trunc-elim' 1 A (Type i 2) type-level hom : Trunc 2 A → Type _ 2 hom = invert hom-iso (hom' , hom-null) hom-β : (a : A) → hom [ a ] ≡ hom' a hom-β a = funext-inv (ap proj₁ (_≅_.iso₂ hom-iso (hom' , hom-null))) a
connect.scpt
deoxilix/dotxilix
0
2972
<reponame>deoxilix/dotxilix<filename>connect.scpt tell application "Tunnelblick" connect "raj" get state of first configuration where name = "raj" repeat until result = "CONNECTED" delay 1 get state of first configuration where name = "raj" end repeat end tell