text stringlengths 1 1.05M |
|---|
Name: ys_rpro.asm
Type: file
Size: 162959
Last-Modified: '2016-05-13T04:51:16Z'
SHA-1: D3C031D2663C16DA5F475BFAA7B6BA119BAE1688
Description: null
|
SECTION code_clib
SECTION code_l_sdcc
PUBLIC ____sdcc_4_or_src_mbc_mhl_dst_deix
____sdcc_4_or_src_mbc_mhl_dst_deix:
IFDEF __SDCC_IX
push ix
ELSE
push iy
ENDIF
ex (sp),hl
add hl,de
ex de,hl
pop hl
ld a,(bc)
or (hl)
ld (de),a
inc bc
inc de
inc hl
ld a,(bc)
or (hl)
ld (de),a
inc bc
inc de
inc hl
ld a,(bc)
or (hl)
ld (de),a
inc bc
inc de
inc hl
ld a,(bc)
or (hl)
ld (de),a
inc hl
ret
|
/*
//@HEADER
// ************************************************************************
//
// KokkosKernels 0.9: Linear Algebra and Graph Kernels
// Copyright 2017 Sandia Corporation
//
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain rights in this software.
//
// 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 Corporation nor the names of the
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "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 SANDIA CORPORATION OR THE
// 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.
//
// Questions? Contact Siva Rajamanickam (srajama@sandia.gov)
//
// ************************************************************************
//@HEADER
*/
#define KOKKOSKERNELS_IMPL_COMPILE_LIBRARY true
#include "KokkosKernels_config.h"
#if defined (KOKKOSKERNELS_INST_KOKKOS_COMPLEX_FLOAT_) \
&& defined (KOKKOSKERNELS_INST_LAYOUTRIGHT) \
&& defined (KOKKOSKERNELS_INST_EXECSPACE_THREADS) \
&& defined (KOKKOSKERNELS_INST_MEMSPACE_HBWSPACE)
#include "KokkosBlas2_gemv_spec.hpp"
namespace KokkosBlas {
namespace Impl {
KOKKOSBLAS2_GEMV_ETI_SPEC_INST(Kokkos::complex<float>, Kokkos::LayoutRight, Kokkos::Threads, Kokkos::Experimental::HBWSpace)
} // Impl
} // KokkosBlas
#endif
|
;
; ZX IF1 & Microdrive functions
;
; char* if1_getname(char *location);
;
; Picks a file name from the specified location
;
; $Id: if1_getname.asm,v 1.4 2017-01-03 01:40:06 aralbrec Exp $
;
SECTION code_clib
PUBLIC if1_getname
PUBLIC _if1_getname
if1_getname:
_if1_getname:
; __FASTCALL__
; pop bc ; ret addr
; pop hl ; location
; push hl
; push bc
ld de,tempmdvname
push de
ld bc,10
ldir
push de
pop hl
previous: dec hl
ld a,(hl)
cp ' '
jr z,previous
inc hl
ld (hl),0
pop hl ; pointer to temp name
ret
SECTION bss_clib
tempmdvname: defs 11
|
//===-- BPFInstPrinter.cpp - Convert BPF MCInst to asm syntax -------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This class prints an BPF MCInst to a .s file.
//
//===----------------------------------------------------------------------===//
#include "BPF.h"
#include "BPFInstPrinter.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCInst.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/FormattedStream.h"
using namespace llvm;
#define DEBUG_TYPE "asm-printer"
// Include the auto-generated portion of the assembly writer.
#include "BPFGenAsmWriter.inc"
void BPFInstPrinter::printInst(const MCInst *MI, raw_ostream &O,
StringRef Annot, const MCSubtargetInfo &STI) {
printInstruction(MI, O);
printAnnotation(O, Annot);
}
static void printExpr(const MCExpr *Expr, raw_ostream &O) {
#ifndef NDEBUG
const MCSymbolRefExpr *SRE;
if (const MCBinaryExpr *BE = dyn_cast<MCBinaryExpr>(Expr))
SRE = dyn_cast<MCSymbolRefExpr>(BE->getLHS());
else
SRE = dyn_cast<MCSymbolRefExpr>(Expr);
assert(SRE && "Unexpected MCExpr type.");
MCSymbolRefExpr::VariantKind Kind = SRE->getKind();
assert(Kind == MCSymbolRefExpr::VK_None);
#endif
O << *Expr;
}
void BPFInstPrinter::printOperand(const MCInst *MI, unsigned OpNo,
raw_ostream &O, const char *Modifier) {
assert((Modifier == 0 || Modifier[0] == 0) && "No modifiers supported");
const MCOperand &Op = MI->getOperand(OpNo);
if (Op.isReg()) {
O << getRegisterName(Op.getReg());
} else if (Op.isImm()) {
O << (int32_t)Op.getImm();
} else {
assert(Op.isExpr() && "Expected an expression");
printExpr(Op.getExpr(), O);
}
}
void BPFInstPrinter::printMemOperand(const MCInst *MI, int OpNo, raw_ostream &O,
const char *Modifier) {
const MCOperand &RegOp = MI->getOperand(OpNo);
const MCOperand &OffsetOp = MI->getOperand(OpNo + 1);
// register
assert(RegOp.isReg() && "Register operand not a register");
O << getRegisterName(RegOp.getReg());
// offset
if (OffsetOp.isImm()) {
auto Imm = OffsetOp.getImm();
if (Imm >= 0)
O << " + " << formatDec(Imm);
else
O << " - " << formatDec(-Imm);
} else {
assert(0 && "Expected an immediate");
}
}
void BPFInstPrinter::printImm64Operand(const MCInst *MI, unsigned OpNo,
raw_ostream &O) {
const MCOperand &Op = MI->getOperand(OpNo);
if (Op.isImm())
O << (uint64_t)Op.getImm();
else
O << Op;
}
|
; A273766: Number of active (ON,black) cells in n-th stage of growth of two-dimensional cellular automaton defined by "Rule 913", based on the 5-celled von Neumann neighborhood.
; 1,4,17,48,81,121,169,225,289,361,441,529,625,729,841,961,1089,1225,1369,1521,1681,1849,2025,2209,2401,2601,2809,3025,3249,3481,3721,3969,4225,4489,4761,5041,5329,5625,5929,6241,6561,6889,7225,7569,7921,8281,8649,9025,9409,9801,10201,10609,11025,11449,11881,12321,12769,13225,13689,14161,14641,15129,15625,16129,16641,17161,17689,18225,18769,19321,19881,20449,21025,21609,22201,22801,23409,24025,24649,25281,25921,26569,27225,27889,28561,29241,29929,30625,31329,32041,32761,33489,34225,34969,35721
mov $3,$0
mov $4,$0
mul $0,2
add $0,16
mov $2,$3
add $3,4
mul $3,$2
mov $6,$0
mov $0,1
lpb $3
mul $3,2
trn $3,$6
lpb $6
sub $6,1
lpe
lpe
add $3,$0
mov $1,$3
mov $5,$4
mul $5,$4
mov $7,$5
mul $7,3
add $1,$7
mov $0,$1
|
// ===========================================================================
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
// Matrix Example for Kick Assembler adapted for k64ass
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
module matrixop {
def vec_sum(a,b) {
val size = a.size < b.size ? a.size : b.size
var res = []
for(i = 0;i < size;i++) {
res = res + (a.get(i) + b.get(i))
}
eval res
}
def vec_scalar(a,b) {
if (a.size != b.size) error "Cannot apply scalar product: the vectors must have same size"
var sp = 0
val size = a.size
for(i = 0;i < size;i++) sp = sp + a.get(i) * b.get(i)
eval sp
}
def matrix_id(size) {
var mat = []
for(r = 0;r < size;r++) {
var row = []
dup size row = row + 0
row.set(r,1)
mat = mat + row
}
eval mat
}
def matrix_make(a11,a12,a21,a22) {
eval [[a11,a12],[a21,a22]]
}
def matrix_make(a11,a12,a13,a21,a22,a23,a31,a32,a33) {
eval [[a11,a12,a13],[a21,a22,a23],[a31,a32,a33]]
}
def matrix_col(m,c) {
if (c >= m.size) error "Cannot apply matrix column extraction: the column index must be less than the matrix's size"
var col = []
val size = m.size
for(r = 0;r < size;r++) {
col = col + m.get(r).get(c)
}
eval col
}
def matrix_vec_mul(m,v) {
if (m.size != v.size) error "Cannot apply matrix/vector product: the matrice and vector must have same size"
var row = []
val size = m.size
for(c = 0;c < size;c++) {
val v1 = m.get(c)
row = row + vec_scalar(v1,v)
}
eval row
}
def matrix_matrix_mul(a,b) {
if (a.size != b.size) error "Cannot apply matrix/matrix product: the matrices must have same size"
val size = a.size
var mat = []
for(r = 0;r < size;r++) {
var row = []
for(c = 0;c < size;c++) {
val v1 = a.get(r)
val v2 = matrix_col(b,c)
row = row + vec_scalar(v1,v2)
}
mat = mat + row
}
eval mat
}
def matrix_3rot(xr,yr,zr) {
val d1 = cos(xr)
val d2 = sin(xr)
val d3 = cos(yr)
val d4 = sin(yr)
val d5 = cos(zr)
val d6 = sin(zr)
eval [ [ d5 * d3, d5 * d4 * d2 - d6 * d1, d5 * d4 * d1 + d6 * d2, 0 ],
[ d6 * d3, d6 * d4 * d2 + d5 * d1, d6 * d4 * d1 - d5 * d2, 0 ],
[ -d4, d3 * d2, d3 * d1, 0 ],
[ 0,0,0,1 ]
]
}
def matrix_3scale(sx,sy,sz) {
eval [ [ sx,0,0,0 ],
[ 0,sy,0,0 ],
[ 0,0,sz,0 ],
[ 0,0,0,1 ]
]
}
def matrix_3move(mx,my,mz) {
eval [ [ 1,0,0,mx ],
[ 0,1,0,my ],
[ 0,0,1,mz ],
[ 0,0,0,1 ]
]
}
def matrix_3per(p) {
eval [ [ 1,0,0,0 ],
[ 0,1,0,0 ],
[ 0,0,0,0 ],
[ 0,0,1 / p,0 ]
]
}
}
def macro BasicUpstart(address) {
.word upstartEnd // link address
.word 10 // line num
.byte $9e // sys
.text address.toString
.byte 0
upstartEnd:
.word 0 // empty link signals the end of the program
}
.pc = $0801 "Basic Upstart"
BasicUpstart($4000)
//----------------------------------------------------------
//----------------------------------------------------------
// Pre Calculated Vector
//----------------------------------------------------------
//----------------------------------------------------------
.pc = $4000 "Main Program"
sei
lda #<irq1
sta $0314
lda #>irq1
sta $0315
asl $d019
lda #$7b
sta $dc0d
lda #$81
sta $d01a
lda #$1b
sta $d011
lda #$20
sta $d012
lda #$00
sta $d020
sta $d021
jsr InitSprites
cli
jmp _
//----------------------------------------------------------
irq1:
asl $d019
inc $d020
ldx frameNr
jsr PlaceSprites
inc frameNr
lda #0
sta $d020
pla
tay
pla
tax
pla
rti
frameNr: .byte 0
InitSprites:
lda #$ff // Turn on Sprites
sta $d015
lda #$00 // Set single color
sta $d01c
lda #$00 // No x and y expansion
sta $d017
sta $d01d
ldx #7
loop:
lda #$f // Set sprite color
sta $d027,x
lda #$0fc0/$40 // Set sprite image
sta $07f8,x
dex
bpl loop
rts
PlaceSprites:
for (i=0; i<8;i++) {
lda cubeCoords+i*$200,x
sta $d000+i*2
lda cubeCoords+$100+i*$200,x
sta $d001+i*2
}
rts
//-----------------------------------------------------------------------------------------
// Objects
//-----------------------------------------------------------------------------------------
val Cube = [[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]]
//------------------------------------------------------------------------------------------
// Macro for doing the precalculation
//-----------------------------------------------------------------------------------------
def toRadians(d) { eval 2 * 3.14 * d / 360 }
def PrecalcObject(object, animLength, nrOfXrot, nrOfYrot, nrOfZrot) {
// Rotate the coordinate and place the coordinates of each frams in a list
var frames = []
for(frameNr=0; frameNr<animLength;frameNr++) {
// Set up the transform matrix
val aX = toRadians(frameNr*360*nrOfXrot/animLength)
val aY = toRadians(frameNr*360*nrOfYrot/animLength)
val aZ = toRadians(frameNr*360*nrOfZrot/animLength)
val zp = 2.5 // z coordinate for the projection plane
val sm = matrixop::matrix_3scale(120,120,0)
val mm = matrixop::matrix_3move(0,0,zp+5)
val rm = matrixop::matrix_3rot(aX,aY,aZ)
val pm = matrixop::matrix_3per(zp)
val m = matrixop::matrix_matrix_mul(matrixop::matrix_matrix_mul(matrixop::matrix_matrix_mul(sm,pm),mm),rm)
// Transform the coordinates
var coords = []
for (i=0; i<object.size; i++) {
val v = matrixop::matrix_vec_mul(m,object.get(i))
coords = coords + v / v.get(3)
}
frames = frames + coords
}
// Dump the list to the memory
for (coordNr=0; coordNr<object.size; coordNr++) {
for (xy=0;xy<2; xy++) {
.byte [i <- [0 .. animLength - 1] || $80+round(frames.get(i).get(coordNr).get(xy)) ]
}
}
}
//-------------------------------------------------------------------------------
// The vector data
//-----------------------------------------------------------------------------------------
.align $100
cubeCoords:
eval PrecalcObject(Cube,256,2,-1,1)
//-------------------------------------------------------------------------------
// Sprite bob
//-----------------------------------------------------------------------------------------
.pc = $0fc0 "Sprite data"
.byte %01110000, %00000000, %00000000
.byte %11111000, %00000000, %00000000
.byte %11111000, %00000000, %00000000
.byte %01110000, %00000000, %00000000
.byte %00000000, %00000000, %00000000
.byte %00000000, %00000000, %00000000
.byte %00000000, %00000000, %00000000
.byte %00000000, %00000000, %00000000
.byte %00000000, %00000000, %00000000
.byte %00000000, %00000000, %00000000
.byte %00000000, %00000000, %00000000
.byte %00000000, %00000000, %00000000
.byte %00000000, %00000000, %00000000
.byte %00000000, %00000000, %00000000
.byte %00000000, %00000000, %00000000
.byte %00000000, %00000000, %00000000
.byte %00000000, %00000000, %00000000
.byte %00000000, %00000000, %00000000
.byte %00000000, %00000000, %00000000
.byte %00000000, %00000000, %00000000
.byte %00000000, %00000000, %00000000
|
;*
;* CW : Character Windows
;*
;* syd_tail.asm : trailer file for all SYD drivers
sEnd DRV
|
;
; MSX basic graphics routines
; by Stefano Bodrato, December 2007
;
XLIB respixel
XREF COORDS
INCLUDE "graphics/grafix.inc"
LIB msxbasic
INCLUDE "#msxbasic.def"
;
; $Id: respixl.asm,v 1.1 2007/12/18 09:00:44 stefano Exp $
;
; ******************************************************************
;
; Clear pixel at (x,y) coordinate.
;
;
;
.respixel
ld a,l
cp maxy
ret nc ; y0 out of range
push bc
push ix
ld (COORDS),hl
ld b,0
ld c,h
ld (GRPACX),bc
ld d,b
ld e,l
ld (GRPACY),de
ld hl,0F3E9h ; fore color
ld a,(hl)
push af
ld a,(0F3EBh) ; border (for bck color)
;;ld a,bcolor
ld (hl),a
ld (ATRBYT),a
push hl
ld ix,DOPSET
call msxbasic
pop hl
pop af
ld (hl),a
ld (ATRBYT),a
pop ix
pop bc
ret
|
SECTION code_fp_math48
PUBLIC ilogb
EXTERN cm48_sccz80_ilogb
defc ilogb = cm48_sccz80_ilogb
|
code
proc Options_Event 8 0
ADDRFP4 4
INDIRI4
CNSTI4 3
EQI4 $70
ADDRGP4 $69
JUMPV
LABELV $70
ADDRLP4 0
ADDRFP4 0
INDIRP4
CNSTI4 8
ADDP4
INDIRI4
ASGNI4
ADDRLP4 0
INDIRI4
CNSTI4 10
LTI4 $72
ADDRLP4 0
INDIRI4
CNSTI4 14
GTI4 $72
ADDRLP4 0
INDIRI4
CNSTI4 2
LSHI4
ADDRGP4 $80-40
ADDP4
INDIRP4
JUMPV
lit
align 4
LABELV $80
address $75
address $76
address $77
address $78
address $79
code
LABELV $75
ADDRGP4 UI_GraphicsOptionsMenu
CALLV
pop
ADDRGP4 $73
JUMPV
LABELV $76
ADDRGP4 UI_DisplayOptionsMenu
CALLV
pop
ADDRGP4 $73
JUMPV
LABELV $77
ADDRGP4 UI_SoundOptionsMenu
CALLV
pop
ADDRGP4 $73
JUMPV
LABELV $78
ADDRGP4 UI_NetworkOptionsMenu
CALLV
pop
ADDRGP4 $73
JUMPV
LABELV $79
ADDRGP4 UI_PopMenu
CALLV
pop
LABELV $72
LABELV $73
LABELV $69
endproc Options_Event 8 0
export SystemConfig_Cache
proc SystemConfig_Cache 0 4
ADDRGP4 $83
ARGP4
ADDRGP4 trap_R_RegisterShaderNoMip
CALLI4
pop
ADDRGP4 $84
ARGP4
ADDRGP4 trap_R_RegisterShaderNoMip
CALLI4
pop
ADDRGP4 $85
ARGP4
ADDRGP4 trap_R_RegisterShaderNoMip
CALLI4
pop
ADDRGP4 $86
ARGP4
ADDRGP4 trap_R_RegisterShaderNoMip
CALLI4
pop
LABELV $82
endproc SystemConfig_Cache 0 4
export Options_MenuInit
proc Options_MenuInit 3088 12
ADDRGP4 s_options
ARGP4
CNSTI4 0
ARGI4
CNSTU4 912
ARGU4
ADDRGP4 qk_memset
CALLP4
pop
ADDRGP4 SystemConfig_Cache
CALLV
pop
ADDRGP4 s_options+276
CNSTI4 1
ASGNI4
ADDRLP4 4
ARGP4
ADDRGP4 trap_GetClientState
CALLV
pop
ADDRLP4 4
INDIRI4
CNSTI4 5
LTI4 $89
ADDRGP4 s_options+280
CNSTI4 0
ASGNI4
ADDRGP4 $90
JUMPV
LABELV $89
ADDRGP4 s_options+280
CNSTI4 1
ASGNI4
LABELV $90
ADDRGP4 s_options+288
CNSTI4 10
ASGNI4
ADDRGP4 s_options+288+44
CNSTU4 8
ASGNU4
ADDRGP4 s_options+288+12
CNSTI4 320
ASGNI4
ADDRGP4 s_options+288+16
CNSTI4 16
ASGNI4
ADDRGP4 s_options+288+60
ADDRGP4 $102
ASGNP4
ADDRGP4 s_options+288+68
ADDRGP4 color_white
ASGNP4
ADDRGP4 s_options+288+64
CNSTI4 1
ASGNI4
ADDRGP4 s_options+360
CNSTI4 6
ASGNI4
ADDRGP4 s_options+360+4
ADDRGP4 $83
ASGNP4
ADDRGP4 s_options+360+44
CNSTU4 16384
ASGNU4
ADDRGP4 s_options+360+12
CNSTI4 8
ASGNI4
ADDRGP4 s_options+360+16
CNSTI4 76
ASGNI4
ADDRGP4 s_options+360+76
CNSTI4 256
ASGNI4
ADDRGP4 s_options+360+80
CNSTI4 334
ASGNI4
ADDRGP4 s_options+448
CNSTI4 6
ASGNI4
ADDRGP4 s_options+448+4
ADDRGP4 $84
ASGNP4
ADDRGP4 s_options+448+44
CNSTU4 16384
ASGNU4
ADDRGP4 s_options+448+12
CNSTI4 376
ASGNI4
ADDRGP4 s_options+448+16
CNSTI4 76
ASGNI4
ADDRGP4 s_options+448+76
CNSTI4 256
ASGNI4
ADDRGP4 s_options+448+80
CNSTI4 334
ASGNI4
ADDRLP4 0
CNSTI4 168
ASGNI4
ADDRGP4 s_options+536
CNSTI4 9
ASGNI4
ADDRGP4 s_options+536+44
CNSTU4 264
ASGNU4
ADDRGP4 s_options+536+48
ADDRGP4 Options_Event
ASGNP4
ADDRGP4 s_options+536+8
CNSTI4 10
ASGNI4
ADDRGP4 s_options+536+12
CNSTI4 320
ASGNI4
ADDRGP4 s_options+536+16
ADDRLP4 0
INDIRI4
ASGNI4
ADDRGP4 s_options+536+60
ADDRGP4 $146
ASGNP4
ADDRGP4 s_options+536+68
ADDRGP4 color_red
ASGNP4
ADDRGP4 s_options+536+64
CNSTI4 1
ASGNI4
ADDRLP4 0
ADDRLP4 0
INDIRI4
CNSTI4 34
ADDI4
ASGNI4
ADDRGP4 s_options+608
CNSTI4 9
ASGNI4
ADDRGP4 s_options+608+44
CNSTU4 264
ASGNU4
ADDRGP4 s_options+608+48
ADDRGP4 Options_Event
ASGNP4
ADDRGP4 s_options+608+8
CNSTI4 11
ASGNI4
ADDRGP4 s_options+608+12
CNSTI4 320
ASGNI4
ADDRGP4 s_options+608+16
ADDRLP4 0
INDIRI4
ASGNI4
ADDRGP4 s_options+608+60
ADDRGP4 $164
ASGNP4
ADDRGP4 s_options+608+68
ADDRGP4 color_red
ASGNP4
ADDRGP4 s_options+608+64
CNSTI4 1
ASGNI4
ADDRLP4 0
ADDRLP4 0
INDIRI4
CNSTI4 34
ADDI4
ASGNI4
ADDRGP4 s_options+680
CNSTI4 9
ASGNI4
ADDRGP4 s_options+680+44
CNSTU4 264
ASGNU4
ADDRGP4 s_options+680+48
ADDRGP4 Options_Event
ASGNP4
ADDRGP4 s_options+680+8
CNSTI4 12
ASGNI4
ADDRGP4 s_options+680+12
CNSTI4 320
ASGNI4
ADDRGP4 s_options+680+16
ADDRLP4 0
INDIRI4
ASGNI4
ADDRGP4 s_options+680+60
ADDRGP4 $182
ASGNP4
ADDRGP4 s_options+680+68
ADDRGP4 color_red
ASGNP4
ADDRGP4 s_options+680+64
CNSTI4 1
ASGNI4
ADDRLP4 0
ADDRLP4 0
INDIRI4
CNSTI4 34
ADDI4
ASGNI4
ADDRGP4 s_options+752
CNSTI4 9
ASGNI4
ADDRGP4 s_options+752+44
CNSTU4 264
ASGNU4
ADDRGP4 s_options+752+48
ADDRGP4 Options_Event
ASGNP4
ADDRGP4 s_options+752+8
CNSTI4 13
ASGNI4
ADDRGP4 s_options+752+12
CNSTI4 320
ASGNI4
ADDRGP4 s_options+752+16
ADDRLP4 0
INDIRI4
ASGNI4
ADDRGP4 s_options+752+60
ADDRGP4 $200
ASGNP4
ADDRGP4 s_options+752+68
ADDRGP4 color_red
ASGNP4
ADDRGP4 s_options+752+64
CNSTI4 1
ASGNI4
ADDRGP4 s_options+824
CNSTI4 6
ASGNI4
ADDRGP4 s_options+824+4
ADDRGP4 $85
ASGNP4
ADDRGP4 s_options+824+44
CNSTU4 260
ASGNU4
ADDRGP4 s_options+824+48
ADDRGP4 Options_Event
ASGNP4
ADDRGP4 s_options+824+8
CNSTI4 14
ASGNI4
ADDRGP4 s_options+824+12
CNSTI4 0
ASGNI4
ADDRGP4 s_options+824+16
CNSTI4 416
ASGNI4
ADDRGP4 s_options+824+76
CNSTI4 128
ASGNI4
ADDRGP4 s_options+824+80
CNSTI4 64
ASGNI4
ADDRGP4 s_options+824+60
ADDRGP4 $86
ASGNP4
ADDRGP4 s_options
ARGP4
ADDRGP4 s_options+288
ARGP4
ADDRGP4 Menu_AddItem
CALLV
pop
ADDRGP4 s_options
ARGP4
ADDRGP4 s_options+360
ARGP4
ADDRGP4 Menu_AddItem
CALLV
pop
ADDRGP4 s_options
ARGP4
ADDRGP4 s_options+448
ARGP4
ADDRGP4 Menu_AddItem
CALLV
pop
ADDRGP4 s_options
ARGP4
ADDRGP4 s_options+536
ARGP4
ADDRGP4 Menu_AddItem
CALLV
pop
ADDRGP4 s_options
ARGP4
ADDRGP4 s_options+608
ARGP4
ADDRGP4 Menu_AddItem
CALLV
pop
ADDRGP4 s_options
ARGP4
ADDRGP4 s_options+680
ARGP4
ADDRGP4 Menu_AddItem
CALLV
pop
ADDRGP4 s_options
ARGP4
ADDRGP4 s_options+752
ARGP4
ADDRGP4 Menu_AddItem
CALLV
pop
ADDRGP4 s_options
ARGP4
ADDRGP4 s_options+824
ARGP4
ADDRGP4 Menu_AddItem
CALLV
pop
LABELV $87
endproc Options_MenuInit 3088 12
export UI_SystemConfigMenu
proc UI_SystemConfigMenu 0 4
ADDRGP4 Options_MenuInit
CALLV
pop
ADDRGP4 s_options
ARGP4
ADDRGP4 UI_PushMenu
CALLV
pop
LABELV $232
endproc UI_SystemConfigMenu 0 4
bss
align 4
LABELV s_options
skip 912
import UI_RankStatusMenu
import RankStatus_Cache
import UI_SignupMenu
import Signup_Cache
import UI_LoginMenu
import Login_Cache
import UI_RankingsMenu
import Rankings_Cache
import Rankings_DrawPassword
import Rankings_DrawName
import Rankings_DrawText
import UI_InitGameinfo
import UI_SPUnlockMedals_f
import UI_SPUnlock_f
import UI_GetAwardLevel
import UI_LogAwardData
import UI_NewGame
import UI_GetCurrentGame
import UI_CanShowTierVideo
import UI_ShowTierVideo
import UI_TierCompleted
import UI_SetBestScore
import UI_GetBestScore
import UI_GetNumBots
import UI_GetBotInfoByName
import UI_GetBotInfoByNumber
import UI_GetNumSPTiers
import UI_GetNumSPArenas
import UI_GetNumArenas
import UI_GetSpecialArenaInfo
import UI_GetArenaInfoByMap
import UI_GetArenaInfoByNumber
import UI_NetworkOptionsMenu
import UI_NetworkOptionsMenu_Cache
import UI_SoundOptionsMenu
import UI_SoundOptionsMenu_Cache
import UI_DisplayOptionsMenu
import UI_DisplayOptionsMenu_Cache
import UI_SaveConfigMenu
import UI_SaveConfigMenu_Cache
import UI_LoadConfigMenu
import UI_LoadConfig_Cache
import UI_TeamOrdersMenu_Cache
import UI_TeamOrdersMenu_f
import UI_TeamOrdersMenu
import UI_RemoveBotsMenu
import UI_RemoveBots_Cache
import UI_AddBotsMenu
import UI_AddBots_Cache
import trap_SetPbClStatus
import trap_VerifyCDKey
import trap_SetCDKey
import trap_GetCDKey
import trap_MemoryRemaining
import trap_LAN_GetPingInfo
import trap_LAN_GetPing
import trap_LAN_ClearPing
import trap_LAN_ServerStatus
import trap_LAN_GetPingQueueCount
import trap_LAN_GetServerInfo
import trap_LAN_GetServerAddressString
import trap_LAN_GetServerCount
import trap_GetConfigString
import trap_GetGlconfig
import trap_GetClientState
import trap_GetClipboardData
import trap_Key_SetCatcher
import trap_Key_GetCatcher
import trap_Key_ClearStates
import trap_Key_SetOverstrikeMode
import trap_Key_GetOverstrikeMode
import trap_Key_IsDown
import trap_Key_SetBinding
import trap_Key_GetBindingBuf
import trap_Key_KeynumToStringBuf
import trap_S_RegisterSound
import trap_S_StartLocalSound
import trap_CM_LerpTag
import trap_UpdateScreen
import trap_R_DrawStretchPic
import trap_R_SetColor
import trap_R_RenderScene
import trap_R_AddLightToScene
import trap_R_AddPolyToScene
import trap_R_AddRefEntityToScene
import trap_R_ClearScene
import trap_R_RegisterShaderNoMip
import trap_R_RegisterSkin
import trap_R_RegisterModel
import trap_FS_Seek
import trap_FS_GetFileList
import trap_FS_FCloseFile
import trap_FS_Write
import trap_FS_Read
import trap_FS_FOpenFile
import trap_Cmd_ExecuteText
import trap_Argv
import trap_Argc
import trap_Cvar_InfoStringBuffer
import trap_Cvar_Create
import trap_Cvar_Reset
import trap_Cvar_SetValue
import trap_Cvar_VariableStringBuffer
import trap_Cvar_VariableValue
import trap_Cvar_Set
import trap_Cvar_Update
import trap_Cvar_Register
import trap_Milliseconds
import trap_Error
import trap_Print
import UI_SPSkillMenu_Cache
import UI_SPSkillMenu
import UI_SPPostgameMenu_f
import UI_SPPostgameMenu_Cache
import UI_SPArena_Start
import UI_SPLevelMenu_ReInit
import UI_SPLevelMenu_f
import UI_SPLevelMenu
import UI_SPLevelMenu_Cache
import uis
import m_entersound
import UI_StartDemoLoop
import UI_Cvar_VariableString
import UI_Argv
import UI_ForceMenuOff
import UI_PopMenu
import UI_PushMenu
import UI_SetActiveMenu
import UI_IsFullscreen
import UI_DrawTextBox
import UI_AdjustFrom640
import UI_CursorInRect
import UI_DrawChar
import UI_DrawString
import UI_ProportionalStringWidth
import UI_DrawProportionalString_AutoWrapped
import UI_DrawProportionalString
import UI_ProportionalSizeScale
import UI_DrawBannerString
import UI_LerpColor
import UI_SetColor
import UI_UpdateScreen
import UI_DrawRect
import UI_FillRect
import UI_DrawHandlePic
import UI_DrawNamedPic
import UI_ClampCvar
import UI_ConsoleCommand
import UI_Refresh
import UI_MouseEvent
import UI_KeyEvent
import UI_Shutdown
import UI_Init
import UI_RegisterClientModelname
import UI_PlayerInfo_SetInfo
import UI_PlayerInfo_SetModel
import UI_DrawPlayer
import DriverInfo_Cache
import GraphicsOptions_Cache
import UI_GraphicsOptionsMenu
import ServerInfo_Cache
import UI_ServerInfoMenu
import UI_BotSelectMenu_Cache
import UI_BotSelectMenu
import ServerOptions_Cache
import StartServer_Cache
import UI_StartServerMenu
import ArenaServers_Cache
import UI_ArenaServersMenu
import SpecifyServer_Cache
import UI_SpecifyServerMenu
import SpecifyLeague_Cache
import UI_SpecifyLeagueMenu
import Preferences_Cache
import UI_PreferencesMenu
import PlayerSettings_Cache
import UI_PlayerSettingsMenu
import PlayerModel_Cache
import UI_PlayerModelMenu
import UI_CDKeyMenu_f
import UI_CDKeyMenu_Cache
import UI_CDKeyMenu
import UI_ModsMenu_Cache
import UI_ModsMenu
import UI_CinematicsMenu_Cache
import UI_CinematicsMenu_f
import UI_CinematicsMenu
import Demos_Cache
import UI_DemosMenu
import Controls_Cache
import UI_ControlsMenu
import UI_DrawConnectScreen
import TeamMain_Cache
import UI_TeamMainMenu
import UI_SetupMenu
import UI_SetupMenu_Cache
import UI_Message
import UI_ConfirmMenu_Style
import UI_ConfirmMenu
import ConfirmMenu_Cache
import UI_InGameMenu
import InGame_Cache
import UI_CreditMenu
import UI_UpdateCvars
import UI_RegisterCvars
import UI_MainMenu
import MainMenu_Cache
import MenuField_Key
import MenuField_Draw
import MenuField_Init
import MField_Draw
import MField_CharEvent
import MField_KeyDownEvent
import MField_Clear
import ui_medalSounds
import ui_medalPicNames
import ui_medalNames
import text_color_highlight
import text_color_normal
import text_color_disabled
import listbar_color
import list_color
import name_color
import color_dim
import color_red
import color_orange
import color_blue
import color_yellow
import color_white
import color_black
import menu_dim_color
import menu_black_color
import menu_red_color
import menu_highlight_color
import menu_dark_color
import menu_grayed_color
import menu_text_color
import weaponChangeSound
import menu_null_sound
import menu_buzz_sound
import menu_out_sound
import menu_move_sound
import menu_in_sound
import ScrollList_Key
import ScrollList_Draw
import Bitmap_Draw
import Bitmap_Init
import Menu_DefaultKey
import Menu_SetCursorToItem
import Menu_SetCursor
import Menu_ActivateItem
import Menu_ItemAtCursor
import Menu_Draw
import Menu_AdjustCursor
import Menu_AddItem
import Menu_Focus
import Menu_Cache
import ui_ioq3
import ui_cdkeychecked
import ui_cdkey
import ui_server16
import ui_server15
import ui_server14
import ui_server13
import ui_server12
import ui_server11
import ui_server10
import ui_server9
import ui_server8
import ui_server7
import ui_server6
import ui_server5
import ui_server4
import ui_server3
import ui_server2
import ui_server1
import ui_marks
import ui_drawCrosshairNames
import ui_drawCrosshair
import ui_brassTime
import ui_browserShowEmpty
import ui_browserShowFull
import ui_browserSortKey
import ui_browserGameType
import ui_browserMaster
import ui_spSelection
import ui_spSkill
import ui_spVideos
import ui_spAwards
import ui_spScores5
import ui_spScores4
import ui_spScores3
import ui_spScores2
import ui_spScores1
import ui_botsFile
import ui_arenasFile
import ui_ctf_friendly
import ui_ctf_timelimit
import ui_ctf_capturelimit
import ui_team_friendly
import ui_team_timelimit
import ui_team_fraglimit
import ui_tourney_timelimit
import ui_tourney_fraglimit
import ui_ffa_timelimit
import ui_ffa_fraglimit
import BG_PlayerTouchesItem
import BG_PlayerStateToEntityStateExtraPolate
import BG_PlayerStateToEntityState
import BG_TouchJumpPad
import BG_AddPredictableEventToPlayerstate
import BG_EvaluateTrajectoryDelta
import BG_EvaluateTrajectory
import BG_CanItemBeGrabbed
import BG_FindItemForHoldable
import BG_FindItemForPowerup
import BG_FindItemForWeapon
import BG_FindItem
import bg_numItems
import bg_itemlist
import Pmove
import PM_UpdateViewAngles
import Com_Printf
import Com_Error
import Info_NextPair
import Info_Validate
import Info_SetValueForKey_Big
import Info_SetValueForKey
import Info_RemoveKey_Big
import Info_RemoveKey
import Info_ValueForKey
import Com_TruncateLongString
import va
import Q_CountChar
import Q_CleanStr
import Q_PrintStrlen
import Q_strcat
import Q_strncpyz
import Q_stristr
import Q_strupr
import Q_strlwr
import Q_stricmpn
import Q_strncmp
import Q_stricmp
import Q_isintegral
import Q_isanumber
import Q_isalpha
import Q_isupper
import Q_islower
import Q_isprint
import Com_RandomBytes
import Com_SkipCharset
import Com_SkipTokens
import Com_sprintf
import Com_HexStrToInt
import Parse3DMatrix
import Parse2DMatrix
import Parse1DMatrix
import SkipRestOfLine
import SkipBracedSection
import COM_MatchToken
import COM_ParseWarning
import COM_ParseError
import COM_Compress
import COM_ParseExt
import COM_Parse
import COM_GetCurrentParseLine
import COM_BeginParseSession
import COM_DefaultExtension
import COM_CompareExtension
import COM_StripExtension
import COM_GetExtension
import COM_SkipPath
import Com_Clamp
import PerpendicularVector
import AngleVectors
import MatrixMultiply
import MakeNormalVectors
import RotateAroundDirection
import RotatePointAroundVector
import ProjectPointOnPlane
import PlaneFromPoints
import AngleDelta
import AngleNormalize180
import AngleNormalize360
import AnglesSubtract
import AngleSubtract
import LerpAngle
import AngleMod
import BoundsIntersectPoint
import BoundsIntersectSphere
import BoundsIntersect
import BoxOnPlaneSide
import SetPlaneSignbits
import AxisCopy
import AxisClear
import AnglesToAxis
import vectoangles
import Q_crandom
import Q_random
import Q_rand
import Q_acos
import Q_log2
import VectorRotate
import Vector4Scale
import VectorNormalize2
import VectorNormalize
import CrossProduct
import VectorInverse
import VectorNormalizeFast
import DistanceSquared
import Distance
import VectorLengthSquared
import VectorLength
import VectorCompare
import AddPointToBounds
import ClearBounds
import RadiusFromBounds
import NormalizeColor
import ColorBytes4
import ColorBytes3
import _VectorMA
import _VectorScale
import _VectorCopy
import _VectorAdd
import _VectorSubtract
import _DotProduct
import ByteToDir
import DirToByte
import ClampShort
import ClampChar
import Q_rsqrt
import Q_fabs
import Q_isnan
import axisDefault
import vec3_origin
import g_color_table
import colorDkGrey
import colorMdGrey
import colorLtGrey
import colorWhite
import colorCyan
import colorMagenta
import colorYellow
import colorBlue
import colorGreen
import colorRed
import colorBlack
import bytedirs
import Hunk_AllocDebug
import FloatSwap
import LongSwap
import ShortSwap
import CopyLongSwap
import CopyShortSwap
import qk_acos
import qk_fabs
import qk_abs
import qk_tan
import qk_atan2
import qk_cos
import qk_sin
import qk_sqrt
import qk_floor
import qk_ceil
import qk_memcpy
import qk_memset
import qk_memmove
import qk_sscanf
import qk_vsnprintf
import qk_strtol
import qk_atoi
import qk_strtod
import qk_atof
import qk_toupper
import qk_tolower
import qk_strncpy
import qk_strstr
import qk_strrchr
import qk_strchr
import qk_strcmp
import qk_strcpy
import qk_strcat
import qk_strlen
import qk_rand
import qk_srand
import qk_qsort
lit
align 1
LABELV $200
byte 1 78
byte 1 69
byte 1 84
byte 1 87
byte 1 79
byte 1 82
byte 1 75
byte 1 0
align 1
LABELV $182
byte 1 83
byte 1 79
byte 1 85
byte 1 78
byte 1 68
byte 1 0
align 1
LABELV $164
byte 1 68
byte 1 73
byte 1 83
byte 1 80
byte 1 76
byte 1 65
byte 1 89
byte 1 0
align 1
LABELV $146
byte 1 71
byte 1 82
byte 1 65
byte 1 80
byte 1 72
byte 1 73
byte 1 67
byte 1 83
byte 1 0
align 1
LABELV $102
byte 1 83
byte 1 89
byte 1 83
byte 1 84
byte 1 69
byte 1 77
byte 1 32
byte 1 83
byte 1 69
byte 1 84
byte 1 85
byte 1 80
byte 1 0
align 1
LABELV $86
byte 1 109
byte 1 101
byte 1 110
byte 1 117
byte 1 47
byte 1 97
byte 1 114
byte 1 116
byte 1 47
byte 1 98
byte 1 97
byte 1 99
byte 1 107
byte 1 95
byte 1 49
byte 1 0
align 1
LABELV $85
byte 1 109
byte 1 101
byte 1 110
byte 1 117
byte 1 47
byte 1 97
byte 1 114
byte 1 116
byte 1 47
byte 1 98
byte 1 97
byte 1 99
byte 1 107
byte 1 95
byte 1 48
byte 1 0
align 1
LABELV $84
byte 1 109
byte 1 101
byte 1 110
byte 1 117
byte 1 47
byte 1 97
byte 1 114
byte 1 116
byte 1 47
byte 1 102
byte 1 114
byte 1 97
byte 1 109
byte 1 101
byte 1 49
byte 1 95
byte 1 114
byte 1 0
align 1
LABELV $83
byte 1 109
byte 1 101
byte 1 110
byte 1 117
byte 1 47
byte 1 97
byte 1 114
byte 1 116
byte 1 47
byte 1 102
byte 1 114
byte 1 97
byte 1 109
byte 1 101
byte 1 50
byte 1 95
byte 1 108
byte 1 0
|
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>:
8010000c: 0f 20 e0 mov %cr4,%eax
8010000f: 83 c8 10 or $0x10,%eax
80100012: 0f 22 e0 mov %eax,%cr4
80100015: b8 00 a0 10 00 mov $0x10a000,%eax
8010001a: 0f 22 d8 mov %eax,%cr3
8010001d: 0f 20 c0 mov %cr0,%eax
80100020: 0d 00 00 01 80 or $0x80010000,%eax
80100025: 0f 22 c0 mov %eax,%cr0
80100028: bc 00 c6 10 80 mov $0x8010c600,%esp
8010002d: b8 90 31 10 80 mov $0x80103190,%eax
80100032: ff e0 jmp *%eax
80100034: 66 90 xchg %ax,%ax
80100036: 66 90 xchg %ax,%ax
80100038: 66 90 xchg %ax,%ax
8010003a: 66 90 xchg %ax,%ax
8010003c: 66 90 xchg %ax,%ax
8010003e: 66 90 xchg %ax,%ax
80100040 <binit>:
struct buf head;
} bcache;
void
binit(void)
{
80100040: 55 push %ebp
80100041: 89 e5 mov %esp,%ebp
80100043: 53 push %ebx
//PAGEBREAK!
// Create linked list of buffers
bcache.head.prev = &bcache.head;
bcache.head.next = &bcache.head;
for(b = bcache.buf; b < bcache.buf+NBUF; b++){
80100044: bb 34 c6 10 80 mov $0x8010c634,%ebx
struct buf head;
} bcache;
void
binit(void)
{
80100049: 83 ec 0c sub $0xc,%esp
struct buf *b;
initlock(&bcache.lock, "bcache");
8010004c: 68 a0 76 10 80 push $0x801076a0
80100051: 68 00 c6 10 80 push $0x8010c600
80100056: e8 65 48 00 00 call 801048c0 <initlock>
//PAGEBREAK!
// Create linked list of buffers
bcache.head.prev = &bcache.head;
8010005b: c7 05 4c 0d 11 80 fc movl $0x80110cfc,0x80110d4c
80100062: 0c 11 80
bcache.head.next = &bcache.head;
80100065: c7 05 50 0d 11 80 fc movl $0x80110cfc,0x80110d50
8010006c: 0c 11 80
8010006f: 83 c4 10 add $0x10,%esp
80100072: ba fc 0c 11 80 mov $0x80110cfc,%edx
80100077: eb 09 jmp 80100082 <binit+0x42>
80100079: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80100080: 89 c3 mov %eax,%ebx
for(b = bcache.buf; b < bcache.buf+NBUF; b++){
b->next = bcache.head.next;
b->prev = &bcache.head;
initsleeplock(&b->lock, "buffer");
80100082: 8d 43 0c lea 0xc(%ebx),%eax
80100085: 83 ec 08 sub $0x8,%esp
//PAGEBREAK!
// Create linked list of buffers
bcache.head.prev = &bcache.head;
bcache.head.next = &bcache.head;
for(b = bcache.buf; b < bcache.buf+NBUF; b++){
b->next = bcache.head.next;
80100088: 89 53 54 mov %edx,0x54(%ebx)
b->prev = &bcache.head;
8010008b: c7 43 50 fc 0c 11 80 movl $0x80110cfc,0x50(%ebx)
initsleeplock(&b->lock, "buffer");
80100092: 68 a7 76 10 80 push $0x801076a7
80100097: 50 push %eax
80100098: e8 f3 46 00 00 call 80104790 <initsleeplock>
bcache.head.next->prev = b;
8010009d: a1 50 0d 11 80 mov 0x80110d50,%eax
//PAGEBREAK!
// Create linked list of buffers
bcache.head.prev = &bcache.head;
bcache.head.next = &bcache.head;
for(b = bcache.buf; b < bcache.buf+NBUF; b++){
801000a2: 83 c4 10 add $0x10,%esp
801000a5: 89 da mov %ebx,%edx
b->next = bcache.head.next;
b->prev = &bcache.head;
initsleeplock(&b->lock, "buffer");
bcache.head.next->prev = b;
801000a7: 89 58 50 mov %ebx,0x50(%eax)
//PAGEBREAK!
// Create linked list of buffers
bcache.head.prev = &bcache.head;
bcache.head.next = &bcache.head;
for(b = bcache.buf; b < bcache.buf+NBUF; b++){
801000aa: 8d 83 5c 02 00 00 lea 0x25c(%ebx),%eax
b->next = bcache.head.next;
b->prev = &bcache.head;
initsleeplock(&b->lock, "buffer");
bcache.head.next->prev = b;
bcache.head.next = b;
801000b0: 89 1d 50 0d 11 80 mov %ebx,0x80110d50
//PAGEBREAK!
// Create linked list of buffers
bcache.head.prev = &bcache.head;
bcache.head.next = &bcache.head;
for(b = bcache.buf; b < bcache.buf+NBUF; b++){
801000b6: 3d fc 0c 11 80 cmp $0x80110cfc,%eax
801000bb: 75 c3 jne 80100080 <binit+0x40>
b->prev = &bcache.head;
initsleeplock(&b->lock, "buffer");
bcache.head.next->prev = b;
bcache.head.next = b;
}
}
801000bd: 8b 5d fc mov -0x4(%ebp),%ebx
801000c0: c9 leave
801000c1: c3 ret
801000c2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
801000c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801000d0 <bread>:
}
// Return a locked buf with the contents of the indicated block.
struct buf*
bread(uint dev, uint blockno)
{
801000d0: 55 push %ebp
801000d1: 89 e5 mov %esp,%ebp
801000d3: 57 push %edi
801000d4: 56 push %esi
801000d5: 53 push %ebx
801000d6: 83 ec 18 sub $0x18,%esp
801000d9: 8b 75 08 mov 0x8(%ebp),%esi
801000dc: 8b 7d 0c mov 0xc(%ebp),%edi
static struct buf*
bget(uint dev, uint blockno)
{
struct buf *b;
acquire(&bcache.lock);
801000df: 68 00 c6 10 80 push $0x8010c600
801000e4: e8 37 49 00 00 call 80104a20 <acquire>
// Is the block already cached?
for(b = bcache.head.next; b != &bcache.head; b = b->next){
801000e9: 8b 1d 50 0d 11 80 mov 0x80110d50,%ebx
801000ef: 83 c4 10 add $0x10,%esp
801000f2: 81 fb fc 0c 11 80 cmp $0x80110cfc,%ebx
801000f8: 75 11 jne 8010010b <bread+0x3b>
801000fa: eb 24 jmp 80100120 <bread+0x50>
801000fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80100100: 8b 5b 54 mov 0x54(%ebx),%ebx
80100103: 81 fb fc 0c 11 80 cmp $0x80110cfc,%ebx
80100109: 74 15 je 80100120 <bread+0x50>
if(b->dev == dev && b->blockno == blockno){
8010010b: 3b 73 04 cmp 0x4(%ebx),%esi
8010010e: 75 f0 jne 80100100 <bread+0x30>
80100110: 3b 7b 08 cmp 0x8(%ebx),%edi
80100113: 75 eb jne 80100100 <bread+0x30>
b->refcnt++;
80100115: 83 43 4c 01 addl $0x1,0x4c(%ebx)
80100119: eb 3f jmp 8010015a <bread+0x8a>
8010011b: 90 nop
8010011c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
}
// Not cached; recycle an unused buffer.
// Even if refcnt==0, B_DIRTY indicates a buffer is in use
// because log.c has modified it but not yet committed it.
for(b = bcache.head.prev; b != &bcache.head; b = b->prev){
80100120: 8b 1d 4c 0d 11 80 mov 0x80110d4c,%ebx
80100126: 81 fb fc 0c 11 80 cmp $0x80110cfc,%ebx
8010012c: 75 0d jne 8010013b <bread+0x6b>
8010012e: eb 60 jmp 80100190 <bread+0xc0>
80100130: 8b 5b 50 mov 0x50(%ebx),%ebx
80100133: 81 fb fc 0c 11 80 cmp $0x80110cfc,%ebx
80100139: 74 55 je 80100190 <bread+0xc0>
if(b->refcnt == 0 && (b->flags & B_DIRTY) == 0) {
8010013b: 8b 43 4c mov 0x4c(%ebx),%eax
8010013e: 85 c0 test %eax,%eax
80100140: 75 ee jne 80100130 <bread+0x60>
80100142: f6 03 04 testb $0x4,(%ebx)
80100145: 75 e9 jne 80100130 <bread+0x60>
b->dev = dev;
80100147: 89 73 04 mov %esi,0x4(%ebx)
b->blockno = blockno;
8010014a: 89 7b 08 mov %edi,0x8(%ebx)
b->flags = 0;
8010014d: c7 03 00 00 00 00 movl $0x0,(%ebx)
b->refcnt = 1;
80100153: c7 43 4c 01 00 00 00 movl $0x1,0x4c(%ebx)
release(&bcache.lock);
8010015a: 83 ec 0c sub $0xc,%esp
8010015d: 68 00 c6 10 80 push $0x8010c600
80100162: e8 69 49 00 00 call 80104ad0 <release>
acquiresleep(&b->lock);
80100167: 8d 43 0c lea 0xc(%ebx),%eax
8010016a: 89 04 24 mov %eax,(%esp)
8010016d: e8 5e 46 00 00 call 801047d0 <acquiresleep>
80100172: 83 c4 10 add $0x10,%esp
bread(uint dev, uint blockno)
{
struct buf *b;
b = bget(dev, blockno);
if((b->flags & B_VALID) == 0) {
80100175: f6 03 02 testb $0x2,(%ebx)
80100178: 75 0c jne 80100186 <bread+0xb6>
iderw(b);
8010017a: 83 ec 0c sub $0xc,%esp
8010017d: 53 push %ebx
8010017e: e8 9d 22 00 00 call 80102420 <iderw>
80100183: 83 c4 10 add $0x10,%esp
}
return b;
}
80100186: 8d 65 f4 lea -0xc(%ebp),%esp
80100189: 89 d8 mov %ebx,%eax
8010018b: 5b pop %ebx
8010018c: 5e pop %esi
8010018d: 5f pop %edi
8010018e: 5d pop %ebp
8010018f: c3 ret
release(&bcache.lock);
acquiresleep(&b->lock);
return b;
}
}
panic("bget: no buffers");
80100190: 83 ec 0c sub $0xc,%esp
80100193: 68 ae 76 10 80 push $0x801076ae
80100198: e8 d3 01 00 00 call 80100370 <panic>
8010019d: 8d 76 00 lea 0x0(%esi),%esi
801001a0 <bwrite>:
}
// Write b's contents to disk. Must be locked.
void
bwrite(struct buf *b)
{
801001a0: 55 push %ebp
801001a1: 89 e5 mov %esp,%ebp
801001a3: 53 push %ebx
801001a4: 83 ec 10 sub $0x10,%esp
801001a7: 8b 5d 08 mov 0x8(%ebp),%ebx
if(!holdingsleep(&b->lock))
801001aa: 8d 43 0c lea 0xc(%ebx),%eax
801001ad: 50 push %eax
801001ae: e8 bd 46 00 00 call 80104870 <holdingsleep>
801001b3: 83 c4 10 add $0x10,%esp
801001b6: 85 c0 test %eax,%eax
801001b8: 74 0f je 801001c9 <bwrite+0x29>
panic("bwrite");
b->flags |= B_DIRTY;
801001ba: 83 0b 04 orl $0x4,(%ebx)
iderw(b);
801001bd: 89 5d 08 mov %ebx,0x8(%ebp)
}
801001c0: 8b 5d fc mov -0x4(%ebp),%ebx
801001c3: c9 leave
bwrite(struct buf *b)
{
if(!holdingsleep(&b->lock))
panic("bwrite");
b->flags |= B_DIRTY;
iderw(b);
801001c4: e9 57 22 00 00 jmp 80102420 <iderw>
// Write b's contents to disk. Must be locked.
void
bwrite(struct buf *b)
{
if(!holdingsleep(&b->lock))
panic("bwrite");
801001c9: 83 ec 0c sub $0xc,%esp
801001cc: 68 bf 76 10 80 push $0x801076bf
801001d1: e8 9a 01 00 00 call 80100370 <panic>
801001d6: 8d 76 00 lea 0x0(%esi),%esi
801001d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801001e0 <brelse>:
// Release a locked buffer.
// Move to the head of the MRU list.
void
brelse(struct buf *b)
{
801001e0: 55 push %ebp
801001e1: 89 e5 mov %esp,%ebp
801001e3: 56 push %esi
801001e4: 53 push %ebx
801001e5: 8b 5d 08 mov 0x8(%ebp),%ebx
if(!holdingsleep(&b->lock))
801001e8: 83 ec 0c sub $0xc,%esp
801001eb: 8d 73 0c lea 0xc(%ebx),%esi
801001ee: 56 push %esi
801001ef: e8 7c 46 00 00 call 80104870 <holdingsleep>
801001f4: 83 c4 10 add $0x10,%esp
801001f7: 85 c0 test %eax,%eax
801001f9: 74 66 je 80100261 <brelse+0x81>
panic("brelse");
releasesleep(&b->lock);
801001fb: 83 ec 0c sub $0xc,%esp
801001fe: 56 push %esi
801001ff: e8 2c 46 00 00 call 80104830 <releasesleep>
acquire(&bcache.lock);
80100204: c7 04 24 00 c6 10 80 movl $0x8010c600,(%esp)
8010020b: e8 10 48 00 00 call 80104a20 <acquire>
b->refcnt--;
80100210: 8b 43 4c mov 0x4c(%ebx),%eax
if (b->refcnt == 0) {
80100213: 83 c4 10 add $0x10,%esp
panic("brelse");
releasesleep(&b->lock);
acquire(&bcache.lock);
b->refcnt--;
80100216: 83 e8 01 sub $0x1,%eax
if (b->refcnt == 0) {
80100219: 85 c0 test %eax,%eax
panic("brelse");
releasesleep(&b->lock);
acquire(&bcache.lock);
b->refcnt--;
8010021b: 89 43 4c mov %eax,0x4c(%ebx)
if (b->refcnt == 0) {
8010021e: 75 2f jne 8010024f <brelse+0x6f>
// no one is waiting for it.
b->next->prev = b->prev;
80100220: 8b 43 54 mov 0x54(%ebx),%eax
80100223: 8b 53 50 mov 0x50(%ebx),%edx
80100226: 89 50 50 mov %edx,0x50(%eax)
b->prev->next = b->next;
80100229: 8b 43 50 mov 0x50(%ebx),%eax
8010022c: 8b 53 54 mov 0x54(%ebx),%edx
8010022f: 89 50 54 mov %edx,0x54(%eax)
b->next = bcache.head.next;
80100232: a1 50 0d 11 80 mov 0x80110d50,%eax
b->prev = &bcache.head;
80100237: c7 43 50 fc 0c 11 80 movl $0x80110cfc,0x50(%ebx)
b->refcnt--;
if (b->refcnt == 0) {
// no one is waiting for it.
b->next->prev = b->prev;
b->prev->next = b->next;
b->next = bcache.head.next;
8010023e: 89 43 54 mov %eax,0x54(%ebx)
b->prev = &bcache.head;
bcache.head.next->prev = b;
80100241: a1 50 0d 11 80 mov 0x80110d50,%eax
80100246: 89 58 50 mov %ebx,0x50(%eax)
bcache.head.next = b;
80100249: 89 1d 50 0d 11 80 mov %ebx,0x80110d50
}
release(&bcache.lock);
8010024f: c7 45 08 00 c6 10 80 movl $0x8010c600,0x8(%ebp)
}
80100256: 8d 65 f8 lea -0x8(%ebp),%esp
80100259: 5b pop %ebx
8010025a: 5e pop %esi
8010025b: 5d pop %ebp
b->prev = &bcache.head;
bcache.head.next->prev = b;
bcache.head.next = b;
}
release(&bcache.lock);
8010025c: e9 6f 48 00 00 jmp 80104ad0 <release>
// Move to the head of the MRU list.
void
brelse(struct buf *b)
{
if(!holdingsleep(&b->lock))
panic("brelse");
80100261: 83 ec 0c sub $0xc,%esp
80100264: 68 c6 76 10 80 push $0x801076c6
80100269: e8 02 01 00 00 call 80100370 <panic>
8010026e: 66 90 xchg %ax,%ax
80100270 <consoleread>:
}
}
int
consoleread(struct inode *ip, char *dst, int n)
{
80100270: 55 push %ebp
80100271: 89 e5 mov %esp,%ebp
80100273: 57 push %edi
80100274: 56 push %esi
80100275: 53 push %ebx
80100276: 83 ec 28 sub $0x28,%esp
80100279: 8b 7d 08 mov 0x8(%ebp),%edi
8010027c: 8b 75 0c mov 0xc(%ebp),%esi
uint target;
int c;
iunlock(ip);
8010027f: 57 push %edi
80100280: e8 fb 17 00 00 call 80101a80 <iunlock>
target = n;
acquire(&cons.lock);
80100285: c7 04 24 60 b5 10 80 movl $0x8010b560,(%esp)
8010028c: e8 8f 47 00 00 call 80104a20 <acquire>
while(n > 0){
80100291: 8b 5d 10 mov 0x10(%ebp),%ebx
80100294: 83 c4 10 add $0x10,%esp
80100297: 31 c0 xor %eax,%eax
80100299: 85 db test %ebx,%ebx
8010029b: 0f 8e 9a 00 00 00 jle 8010033b <consoleread+0xcb>
while(input.r == input.w){
801002a1: a1 e0 0f 11 80 mov 0x80110fe0,%eax
801002a6: 3b 05 e4 0f 11 80 cmp 0x80110fe4,%eax
801002ac: 74 24 je 801002d2 <consoleread+0x62>
801002ae: eb 58 jmp 80100308 <consoleread+0x98>
if(myproc()->killed){
release(&cons.lock);
ilock(ip);
return -1;
}
sleep(&input.r, &cons.lock);
801002b0: 83 ec 08 sub $0x8,%esp
801002b3: 68 60 b5 10 80 push $0x8010b560
801002b8: 68 e0 0f 11 80 push $0x80110fe0
801002bd: e8 ae 3d 00 00 call 80104070 <sleep>
iunlock(ip);
target = n;
acquire(&cons.lock);
while(n > 0){
while(input.r == input.w){
801002c2: a1 e0 0f 11 80 mov 0x80110fe0,%eax
801002c7: 83 c4 10 add $0x10,%esp
801002ca: 3b 05 e4 0f 11 80 cmp 0x80110fe4,%eax
801002d0: 75 36 jne 80100308 <consoleread+0x98>
if(myproc()->killed){
801002d2: e8 e9 37 00 00 call 80103ac0 <myproc>
801002d7: 8b 40 24 mov 0x24(%eax),%eax
801002da: 85 c0 test %eax,%eax
801002dc: 74 d2 je 801002b0 <consoleread+0x40>
release(&cons.lock);
801002de: 83 ec 0c sub $0xc,%esp
801002e1: 68 60 b5 10 80 push $0x8010b560
801002e6: e8 e5 47 00 00 call 80104ad0 <release>
ilock(ip);
801002eb: 89 3c 24 mov %edi,(%esp)
801002ee: e8 ad 16 00 00 call 801019a0 <ilock>
return -1;
801002f3: 83 c4 10 add $0x10,%esp
801002f6: b8 ff ff ff ff mov $0xffffffff,%eax
}
release(&cons.lock);
ilock(ip);
return target - n;
}
801002fb: 8d 65 f4 lea -0xc(%ebp),%esp
801002fe: 5b pop %ebx
801002ff: 5e pop %esi
80100300: 5f pop %edi
80100301: 5d pop %ebp
80100302: c3 ret
80100303: 90 nop
80100304: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
ilock(ip);
return -1;
}
sleep(&input.r, &cons.lock);
}
c = input.buf[input.r++ % INPUT_BUF];
80100308: 8d 50 01 lea 0x1(%eax),%edx
8010030b: 89 15 e0 0f 11 80 mov %edx,0x80110fe0
80100311: 89 c2 mov %eax,%edx
80100313: 83 e2 7f and $0x7f,%edx
80100316: 0f be 92 60 0f 11 80 movsbl -0x7feef0a0(%edx),%edx
if(c == C('D')){ // EOF
8010031d: 83 fa 04 cmp $0x4,%edx
80100320: 74 39 je 8010035b <consoleread+0xeb>
// caller gets a 0-byte result.
input.r--;
}
break;
}
*dst++ = c;
80100322: 83 c6 01 add $0x1,%esi
--n;
80100325: 83 eb 01 sub $0x1,%ebx
if(c == '\n')
80100328: 83 fa 0a cmp $0xa,%edx
// caller gets a 0-byte result.
input.r--;
}
break;
}
*dst++ = c;
8010032b: 88 56 ff mov %dl,-0x1(%esi)
--n;
if(c == '\n')
8010032e: 74 35 je 80100365 <consoleread+0xf5>
int c;
iunlock(ip);
target = n;
acquire(&cons.lock);
while(n > 0){
80100330: 85 db test %ebx,%ebx
80100332: 0f 85 69 ff ff ff jne 801002a1 <consoleread+0x31>
80100338: 8b 45 10 mov 0x10(%ebp),%eax
*dst++ = c;
--n;
if(c == '\n')
break;
}
release(&cons.lock);
8010033b: 83 ec 0c sub $0xc,%esp
8010033e: 89 45 e4 mov %eax,-0x1c(%ebp)
80100341: 68 60 b5 10 80 push $0x8010b560
80100346: e8 85 47 00 00 call 80104ad0 <release>
ilock(ip);
8010034b: 89 3c 24 mov %edi,(%esp)
8010034e: e8 4d 16 00 00 call 801019a0 <ilock>
return target - n;
80100353: 83 c4 10 add $0x10,%esp
80100356: 8b 45 e4 mov -0x1c(%ebp),%eax
80100359: eb a0 jmp 801002fb <consoleread+0x8b>
}
sleep(&input.r, &cons.lock);
}
c = input.buf[input.r++ % INPUT_BUF];
if(c == C('D')){ // EOF
if(n < target){
8010035b: 39 5d 10 cmp %ebx,0x10(%ebp)
8010035e: 76 05 jbe 80100365 <consoleread+0xf5>
// Save ^D for next time, to make sure
// caller gets a 0-byte result.
input.r--;
80100360: a3 e0 0f 11 80 mov %eax,0x80110fe0
80100365: 8b 45 10 mov 0x10(%ebp),%eax
80100368: 29 d8 sub %ebx,%eax
8010036a: eb cf jmp 8010033b <consoleread+0xcb>
8010036c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80100370 <panic>:
release(&cons.lock);
}
void
panic(char *s)
{
80100370: 55 push %ebp
80100371: 89 e5 mov %esp,%ebp
80100373: 56 push %esi
80100374: 53 push %ebx
80100375: 83 ec 30 sub $0x30,%esp
}
static inline void
cli(void)
{
asm volatile("cli");
80100378: fa cli
int i;
uint pcs[10];
cli();
cons.locking = 0;
80100379: c7 05 94 b5 10 80 00 movl $0x0,0x8010b594
80100380: 00 00 00
// use lapiccpunum so that we can call panic from mycpu()
cprintf("lapicid %d: panic: ", lapicid());
cprintf(s);
cprintf("\n");
getcallerpcs(&s, pcs);
80100383: 8d 5d d0 lea -0x30(%ebp),%ebx
80100386: 8d 75 f8 lea -0x8(%ebp),%esi
uint pcs[10];
cli();
cons.locking = 0;
// use lapiccpunum so that we can call panic from mycpu()
cprintf("lapicid %d: panic: ", lapicid());
80100389: e8 92 26 00 00 call 80102a20 <lapicid>
8010038e: 83 ec 08 sub $0x8,%esp
80100391: 50 push %eax
80100392: 68 cd 76 10 80 push $0x801076cd
80100397: e8 c4 02 00 00 call 80100660 <cprintf>
cprintf(s);
8010039c: 58 pop %eax
8010039d: ff 75 08 pushl 0x8(%ebp)
801003a0: e8 bb 02 00 00 call 80100660 <cprintf>
cprintf("\n");
801003a5: c7 04 24 53 81 10 80 movl $0x80108153,(%esp)
801003ac: e8 af 02 00 00 call 80100660 <cprintf>
getcallerpcs(&s, pcs);
801003b1: 5a pop %edx
801003b2: 8d 45 08 lea 0x8(%ebp),%eax
801003b5: 59 pop %ecx
801003b6: 53 push %ebx
801003b7: 50 push %eax
801003b8: e8 23 45 00 00 call 801048e0 <getcallerpcs>
801003bd: 83 c4 10 add $0x10,%esp
for(i=0; i<10; i++)
cprintf(" %p", pcs[i]);
801003c0: 83 ec 08 sub $0x8,%esp
801003c3: ff 33 pushl (%ebx)
801003c5: 83 c3 04 add $0x4,%ebx
801003c8: 68 e1 76 10 80 push $0x801076e1
801003cd: e8 8e 02 00 00 call 80100660 <cprintf>
// use lapiccpunum so that we can call panic from mycpu()
cprintf("lapicid %d: panic: ", lapicid());
cprintf(s);
cprintf("\n");
getcallerpcs(&s, pcs);
for(i=0; i<10; i++)
801003d2: 83 c4 10 add $0x10,%esp
801003d5: 39 f3 cmp %esi,%ebx
801003d7: 75 e7 jne 801003c0 <panic+0x50>
cprintf(" %p", pcs[i]);
panicked = 1; // freeze other CPU
801003d9: c7 05 98 b5 10 80 01 movl $0x1,0x8010b598
801003e0: 00 00 00
801003e3: eb fe jmp 801003e3 <panic+0x73>
801003e5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801003e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801003f0 <consputc>:
}
void
consputc(int c)
{
if(panicked){
801003f0: 8b 15 98 b5 10 80 mov 0x8010b598,%edx
801003f6: 85 d2 test %edx,%edx
801003f8: 74 06 je 80100400 <consputc+0x10>
801003fa: fa cli
801003fb: eb fe jmp 801003fb <consputc+0xb>
801003fd: 8d 76 00 lea 0x0(%esi),%esi
crt[pos] = ' ' | 0x0700;
}
void
consputc(int c)
{
80100400: 55 push %ebp
80100401: 89 e5 mov %esp,%ebp
80100403: 57 push %edi
80100404: 56 push %esi
80100405: 53 push %ebx
80100406: 89 c3 mov %eax,%ebx
80100408: 83 ec 0c sub $0xc,%esp
cli();
for(;;)
;
}
if(c == BACKSPACE){
8010040b: 3d 00 01 00 00 cmp $0x100,%eax
80100410: 0f 84 b8 00 00 00 je 801004ce <consputc+0xde>
uartputc('\b'); uartputc(' '); uartputc('\b');
} else
uartputc(c);
80100416: 83 ec 0c sub $0xc,%esp
80100419: 50 push %eax
8010041a: e8 31 5e 00 00 call 80106250 <uartputc>
8010041f: 83 c4 10 add $0x10,%esp
}
static inline void
outb(ushort port, uchar data)
{
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80100422: bf d4 03 00 00 mov $0x3d4,%edi
80100427: b8 0e 00 00 00 mov $0xe,%eax
8010042c: 89 fa mov %edi,%edx
8010042e: ee out %al,(%dx)
static inline uchar
inb(ushort port)
{
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
8010042f: be d5 03 00 00 mov $0x3d5,%esi
80100434: 89 f2 mov %esi,%edx
80100436: ec in (%dx),%al
{
int pos;
// Cursor position: col + 80*row.
outb(CRTPORT, 14);
pos = inb(CRTPORT+1) << 8;
80100437: 0f b6 c0 movzbl %al,%eax
}
static inline void
outb(ushort port, uchar data)
{
asm volatile("out %0,%1" : : "a" (data), "d" (port));
8010043a: 89 fa mov %edi,%edx
8010043c: c1 e0 08 shl $0x8,%eax
8010043f: 89 c1 mov %eax,%ecx
80100441: b8 0f 00 00 00 mov $0xf,%eax
80100446: ee out %al,(%dx)
static inline uchar
inb(ushort port)
{
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80100447: 89 f2 mov %esi,%edx
80100449: ec in (%dx),%al
outb(CRTPORT, 15);
pos |= inb(CRTPORT+1);
8010044a: 0f b6 c0 movzbl %al,%eax
8010044d: 09 c8 or %ecx,%eax
if(c == '\n')
8010044f: 83 fb 0a cmp $0xa,%ebx
80100452: 0f 84 0b 01 00 00 je 80100563 <consputc+0x173>
pos += 80 - pos%80;
else if(c == BACKSPACE){
80100458: 81 fb 00 01 00 00 cmp $0x100,%ebx
8010045e: 0f 84 e6 00 00 00 je 8010054a <consputc+0x15a>
if(pos > 0) --pos;
} else
crt[pos++] = (c&0xff) | 0x0700; // black on white
80100464: 0f b6 d3 movzbl %bl,%edx
80100467: 8d 78 01 lea 0x1(%eax),%edi
8010046a: 80 ce 07 or $0x7,%dh
8010046d: 66 89 94 00 00 80 0b mov %dx,-0x7ff48000(%eax,%eax,1)
80100474: 80
if(pos < 0 || pos > 25*80)
80100475: 81 ff d0 07 00 00 cmp $0x7d0,%edi
8010047b: 0f 8f bc 00 00 00 jg 8010053d <consputc+0x14d>
panic("pos under/overflow");
if((pos/80) >= 24){ // Scroll up.
80100481: 81 ff 7f 07 00 00 cmp $0x77f,%edi
80100487: 7f 6f jg 801004f8 <consputc+0x108>
80100489: 89 f8 mov %edi,%eax
8010048b: 8d 8c 3f 00 80 0b 80 lea -0x7ff48000(%edi,%edi,1),%ecx
80100492: 89 fb mov %edi,%ebx
80100494: c1 e8 08 shr $0x8,%eax
80100497: 89 c6 mov %eax,%esi
}
static inline void
outb(ushort port, uchar data)
{
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80100499: bf d4 03 00 00 mov $0x3d4,%edi
8010049e: b8 0e 00 00 00 mov $0xe,%eax
801004a3: 89 fa mov %edi,%edx
801004a5: ee out %al,(%dx)
801004a6: ba d5 03 00 00 mov $0x3d5,%edx
801004ab: 89 f0 mov %esi,%eax
801004ad: ee out %al,(%dx)
801004ae: b8 0f 00 00 00 mov $0xf,%eax
801004b3: 89 fa mov %edi,%edx
801004b5: ee out %al,(%dx)
801004b6: ba d5 03 00 00 mov $0x3d5,%edx
801004bb: 89 d8 mov %ebx,%eax
801004bd: ee out %al,(%dx)
outb(CRTPORT, 14);
outb(CRTPORT+1, pos>>8);
outb(CRTPORT, 15);
outb(CRTPORT+1, pos);
crt[pos] = ' ' | 0x0700;
801004be: b8 20 07 00 00 mov $0x720,%eax
801004c3: 66 89 01 mov %ax,(%ecx)
if(c == BACKSPACE){
uartputc('\b'); uartputc(' '); uartputc('\b');
} else
uartputc(c);
cgaputc(c);
}
801004c6: 8d 65 f4 lea -0xc(%ebp),%esp
801004c9: 5b pop %ebx
801004ca: 5e pop %esi
801004cb: 5f pop %edi
801004cc: 5d pop %ebp
801004cd: c3 ret
for(;;)
;
}
if(c == BACKSPACE){
uartputc('\b'); uartputc(' '); uartputc('\b');
801004ce: 83 ec 0c sub $0xc,%esp
801004d1: 6a 08 push $0x8
801004d3: e8 78 5d 00 00 call 80106250 <uartputc>
801004d8: c7 04 24 20 00 00 00 movl $0x20,(%esp)
801004df: e8 6c 5d 00 00 call 80106250 <uartputc>
801004e4: c7 04 24 08 00 00 00 movl $0x8,(%esp)
801004eb: e8 60 5d 00 00 call 80106250 <uartputc>
801004f0: 83 c4 10 add $0x10,%esp
801004f3: e9 2a ff ff ff jmp 80100422 <consputc+0x32>
if(pos < 0 || pos > 25*80)
panic("pos under/overflow");
if((pos/80) >= 24){ // Scroll up.
memmove(crt, crt+80, sizeof(crt[0])*23*80);
801004f8: 83 ec 04 sub $0x4,%esp
pos -= 80;
801004fb: 8d 5f b0 lea -0x50(%edi),%ebx
if(pos < 0 || pos > 25*80)
panic("pos under/overflow");
if((pos/80) >= 24){ // Scroll up.
memmove(crt, crt+80, sizeof(crt[0])*23*80);
801004fe: 68 60 0e 00 00 push $0xe60
80100503: 68 a0 80 0b 80 push $0x800b80a0
80100508: 68 00 80 0b 80 push $0x800b8000
pos -= 80;
memset(crt+pos, 0, sizeof(crt[0])*(24*80 - pos));
8010050d: 8d b4 1b 00 80 0b 80 lea -0x7ff48000(%ebx,%ebx,1),%esi
if(pos < 0 || pos > 25*80)
panic("pos under/overflow");
if((pos/80) >= 24){ // Scroll up.
memmove(crt, crt+80, sizeof(crt[0])*23*80);
80100514: e8 b7 46 00 00 call 80104bd0 <memmove>
pos -= 80;
memset(crt+pos, 0, sizeof(crt[0])*(24*80 - pos));
80100519: b8 80 07 00 00 mov $0x780,%eax
8010051e: 83 c4 0c add $0xc,%esp
80100521: 29 d8 sub %ebx,%eax
80100523: 01 c0 add %eax,%eax
80100525: 50 push %eax
80100526: 6a 00 push $0x0
80100528: 56 push %esi
80100529: e8 f2 45 00 00 call 80104b20 <memset>
8010052e: 89 f1 mov %esi,%ecx
80100530: 83 c4 10 add $0x10,%esp
80100533: be 07 00 00 00 mov $0x7,%esi
80100538: e9 5c ff ff ff jmp 80100499 <consputc+0xa9>
if(pos > 0) --pos;
} else
crt[pos++] = (c&0xff) | 0x0700; // black on white
if(pos < 0 || pos > 25*80)
panic("pos under/overflow");
8010053d: 83 ec 0c sub $0xc,%esp
80100540: 68 e5 76 10 80 push $0x801076e5
80100545: e8 26 fe ff ff call 80100370 <panic>
pos |= inb(CRTPORT+1);
if(c == '\n')
pos += 80 - pos%80;
else if(c == BACKSPACE){
if(pos > 0) --pos;
8010054a: 85 c0 test %eax,%eax
8010054c: 8d 78 ff lea -0x1(%eax),%edi
8010054f: 0f 85 20 ff ff ff jne 80100475 <consputc+0x85>
80100555: b9 00 80 0b 80 mov $0x800b8000,%ecx
8010055a: 31 db xor %ebx,%ebx
8010055c: 31 f6 xor %esi,%esi
8010055e: e9 36 ff ff ff jmp 80100499 <consputc+0xa9>
pos = inb(CRTPORT+1) << 8;
outb(CRTPORT, 15);
pos |= inb(CRTPORT+1);
if(c == '\n')
pos += 80 - pos%80;
80100563: ba 67 66 66 66 mov $0x66666667,%edx
80100568: f7 ea imul %edx
8010056a: 89 d0 mov %edx,%eax
8010056c: c1 e8 05 shr $0x5,%eax
8010056f: 8d 04 80 lea (%eax,%eax,4),%eax
80100572: c1 e0 04 shl $0x4,%eax
80100575: 8d 78 50 lea 0x50(%eax),%edi
80100578: e9 f8 fe ff ff jmp 80100475 <consputc+0x85>
8010057d: 8d 76 00 lea 0x0(%esi),%esi
80100580 <printint>:
int locking;
} cons;
static void
printint(int xx, int base, int sign)
{
80100580: 55 push %ebp
80100581: 89 e5 mov %esp,%ebp
80100583: 57 push %edi
80100584: 56 push %esi
80100585: 53 push %ebx
80100586: 89 d6 mov %edx,%esi
80100588: 83 ec 2c sub $0x2c,%esp
static char digits[] = "0123456789abcdef";
char buf[16];
int i;
uint x;
if(sign && (sign = xx < 0))
8010058b: 85 c9 test %ecx,%ecx
int locking;
} cons;
static void
printint(int xx, int base, int sign)
{
8010058d: 89 4d d4 mov %ecx,-0x2c(%ebp)
static char digits[] = "0123456789abcdef";
char buf[16];
int i;
uint x;
if(sign && (sign = xx < 0))
80100590: 74 0c je 8010059e <printint+0x1e>
80100592: 89 c7 mov %eax,%edi
80100594: c1 ef 1f shr $0x1f,%edi
80100597: 85 c0 test %eax,%eax
80100599: 89 7d d4 mov %edi,-0x2c(%ebp)
8010059c: 78 51 js 801005ef <printint+0x6f>
x = -xx;
else
x = xx;
i = 0;
8010059e: 31 ff xor %edi,%edi
801005a0: 8d 5d d7 lea -0x29(%ebp),%ebx
801005a3: eb 05 jmp 801005aa <printint+0x2a>
801005a5: 8d 76 00 lea 0x0(%esi),%esi
do{
buf[i++] = digits[x % base];
801005a8: 89 cf mov %ecx,%edi
801005aa: 31 d2 xor %edx,%edx
801005ac: 8d 4f 01 lea 0x1(%edi),%ecx
801005af: f7 f6 div %esi
801005b1: 0f b6 92 10 77 10 80 movzbl -0x7fef88f0(%edx),%edx
}while((x /= base) != 0);
801005b8: 85 c0 test %eax,%eax
else
x = xx;
i = 0;
do{
buf[i++] = digits[x % base];
801005ba: 88 14 0b mov %dl,(%ebx,%ecx,1)
}while((x /= base) != 0);
801005bd: 75 e9 jne 801005a8 <printint+0x28>
if(sign)
801005bf: 8b 45 d4 mov -0x2c(%ebp),%eax
801005c2: 85 c0 test %eax,%eax
801005c4: 74 08 je 801005ce <printint+0x4e>
buf[i++] = '-';
801005c6: c6 44 0d d8 2d movb $0x2d,-0x28(%ebp,%ecx,1)
801005cb: 8d 4f 02 lea 0x2(%edi),%ecx
801005ce: 8d 74 0d d7 lea -0x29(%ebp,%ecx,1),%esi
801005d2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
while(--i >= 0)
consputc(buf[i]);
801005d8: 0f be 06 movsbl (%esi),%eax
801005db: 83 ee 01 sub $0x1,%esi
801005de: e8 0d fe ff ff call 801003f0 <consputc>
}while((x /= base) != 0);
if(sign)
buf[i++] = '-';
while(--i >= 0)
801005e3: 39 de cmp %ebx,%esi
801005e5: 75 f1 jne 801005d8 <printint+0x58>
consputc(buf[i]);
}
801005e7: 83 c4 2c add $0x2c,%esp
801005ea: 5b pop %ebx
801005eb: 5e pop %esi
801005ec: 5f pop %edi
801005ed: 5d pop %ebp
801005ee: c3 ret
char buf[16];
int i;
uint x;
if(sign && (sign = xx < 0))
x = -xx;
801005ef: f7 d8 neg %eax
801005f1: eb ab jmp 8010059e <printint+0x1e>
801005f3: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801005f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80100600 <consolewrite>:
return target - n;
}
int
consolewrite(struct inode *ip, char *buf, int n)
{
80100600: 55 push %ebp
80100601: 89 e5 mov %esp,%ebp
80100603: 57 push %edi
80100604: 56 push %esi
80100605: 53 push %ebx
80100606: 83 ec 18 sub $0x18,%esp
int i;
iunlock(ip);
80100609: ff 75 08 pushl 0x8(%ebp)
return target - n;
}
int
consolewrite(struct inode *ip, char *buf, int n)
{
8010060c: 8b 75 10 mov 0x10(%ebp),%esi
int i;
iunlock(ip);
8010060f: e8 6c 14 00 00 call 80101a80 <iunlock>
acquire(&cons.lock);
80100614: c7 04 24 60 b5 10 80 movl $0x8010b560,(%esp)
8010061b: e8 00 44 00 00 call 80104a20 <acquire>
80100620: 8b 7d 0c mov 0xc(%ebp),%edi
for(i = 0; i < n; i++)
80100623: 83 c4 10 add $0x10,%esp
80100626: 85 f6 test %esi,%esi
80100628: 8d 1c 37 lea (%edi,%esi,1),%ebx
8010062b: 7e 12 jle 8010063f <consolewrite+0x3f>
8010062d: 8d 76 00 lea 0x0(%esi),%esi
consputc(buf[i] & 0xff);
80100630: 0f b6 07 movzbl (%edi),%eax
80100633: 83 c7 01 add $0x1,%edi
80100636: e8 b5 fd ff ff call 801003f0 <consputc>
{
int i;
iunlock(ip);
acquire(&cons.lock);
for(i = 0; i < n; i++)
8010063b: 39 df cmp %ebx,%edi
8010063d: 75 f1 jne 80100630 <consolewrite+0x30>
consputc(buf[i] & 0xff);
release(&cons.lock);
8010063f: 83 ec 0c sub $0xc,%esp
80100642: 68 60 b5 10 80 push $0x8010b560
80100647: e8 84 44 00 00 call 80104ad0 <release>
ilock(ip);
8010064c: 58 pop %eax
8010064d: ff 75 08 pushl 0x8(%ebp)
80100650: e8 4b 13 00 00 call 801019a0 <ilock>
return n;
}
80100655: 8d 65 f4 lea -0xc(%ebp),%esp
80100658: 89 f0 mov %esi,%eax
8010065a: 5b pop %ebx
8010065b: 5e pop %esi
8010065c: 5f pop %edi
8010065d: 5d pop %ebp
8010065e: c3 ret
8010065f: 90 nop
80100660 <cprintf>:
//PAGEBREAK: 50
// Print to the console. only understands %d, %x, %p, %s.
void
cprintf(char *fmt, ...)
{
80100660: 55 push %ebp
80100661: 89 e5 mov %esp,%ebp
80100663: 57 push %edi
80100664: 56 push %esi
80100665: 53 push %ebx
80100666: 83 ec 1c sub $0x1c,%esp
int i, c, locking;
uint *argp;
char *s;
locking = cons.locking;
80100669: a1 94 b5 10 80 mov 0x8010b594,%eax
if(locking)
8010066e: 85 c0 test %eax,%eax
{
int i, c, locking;
uint *argp;
char *s;
locking = cons.locking;
80100670: 89 45 e0 mov %eax,-0x20(%ebp)
if(locking)
80100673: 0f 85 47 01 00 00 jne 801007c0 <cprintf+0x160>
acquire(&cons.lock);
if (fmt == 0)
80100679: 8b 45 08 mov 0x8(%ebp),%eax
8010067c: 85 c0 test %eax,%eax
8010067e: 89 c1 mov %eax,%ecx
80100680: 0f 84 4f 01 00 00 je 801007d5 <cprintf+0x175>
panic("null fmt");
argp = (uint*)(void*)(&fmt + 1);
for(i = 0; (c = fmt[i] & 0xff) != 0; i++){
80100686: 0f b6 00 movzbl (%eax),%eax
80100689: 31 db xor %ebx,%ebx
8010068b: 8d 75 0c lea 0xc(%ebp),%esi
8010068e: 89 cf mov %ecx,%edi
80100690: 85 c0 test %eax,%eax
80100692: 75 55 jne 801006e9 <cprintf+0x89>
80100694: eb 68 jmp 801006fe <cprintf+0x9e>
80100696: 8d 76 00 lea 0x0(%esi),%esi
80100699: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
if(c != '%'){
consputc(c);
continue;
}
c = fmt[++i] & 0xff;
801006a0: 83 c3 01 add $0x1,%ebx
801006a3: 0f b6 14 1f movzbl (%edi,%ebx,1),%edx
if(c == 0)
801006a7: 85 d2 test %edx,%edx
801006a9: 74 53 je 801006fe <cprintf+0x9e>
break;
switch(c){
801006ab: 83 fa 70 cmp $0x70,%edx
801006ae: 74 7a je 8010072a <cprintf+0xca>
801006b0: 7f 6e jg 80100720 <cprintf+0xc0>
801006b2: 83 fa 25 cmp $0x25,%edx
801006b5: 0f 84 ad 00 00 00 je 80100768 <cprintf+0x108>
801006bb: 83 fa 64 cmp $0x64,%edx
801006be: 0f 85 84 00 00 00 jne 80100748 <cprintf+0xe8>
case 'd':
printint(*argp++, 10, 1);
801006c4: 8d 46 04 lea 0x4(%esi),%eax
801006c7: b9 01 00 00 00 mov $0x1,%ecx
801006cc: ba 0a 00 00 00 mov $0xa,%edx
801006d1: 89 45 e4 mov %eax,-0x1c(%ebp)
801006d4: 8b 06 mov (%esi),%eax
801006d6: e8 a5 fe ff ff call 80100580 <printint>
801006db: 8b 75 e4 mov -0x1c(%ebp),%esi
if (fmt == 0)
panic("null fmt");
argp = (uint*)(void*)(&fmt + 1);
for(i = 0; (c = fmt[i] & 0xff) != 0; i++){
801006de: 83 c3 01 add $0x1,%ebx
801006e1: 0f b6 04 1f movzbl (%edi,%ebx,1),%eax
801006e5: 85 c0 test %eax,%eax
801006e7: 74 15 je 801006fe <cprintf+0x9e>
if(c != '%'){
801006e9: 83 f8 25 cmp $0x25,%eax
801006ec: 74 b2 je 801006a0 <cprintf+0x40>
s = "(null)";
for(; *s; s++)
consputc(*s);
break;
case '%':
consputc('%');
801006ee: e8 fd fc ff ff call 801003f0 <consputc>
if (fmt == 0)
panic("null fmt");
argp = (uint*)(void*)(&fmt + 1);
for(i = 0; (c = fmt[i] & 0xff) != 0; i++){
801006f3: 83 c3 01 add $0x1,%ebx
801006f6: 0f b6 04 1f movzbl (%edi,%ebx,1),%eax
801006fa: 85 c0 test %eax,%eax
801006fc: 75 eb jne 801006e9 <cprintf+0x89>
consputc(c);
break;
}
}
if(locking)
801006fe: 8b 45 e0 mov -0x20(%ebp),%eax
80100701: 85 c0 test %eax,%eax
80100703: 74 10 je 80100715 <cprintf+0xb5>
release(&cons.lock);
80100705: 83 ec 0c sub $0xc,%esp
80100708: 68 60 b5 10 80 push $0x8010b560
8010070d: e8 be 43 00 00 call 80104ad0 <release>
80100712: 83 c4 10 add $0x10,%esp
}
80100715: 8d 65 f4 lea -0xc(%ebp),%esp
80100718: 5b pop %ebx
80100719: 5e pop %esi
8010071a: 5f pop %edi
8010071b: 5d pop %ebp
8010071c: c3 ret
8010071d: 8d 76 00 lea 0x0(%esi),%esi
continue;
}
c = fmt[++i] & 0xff;
if(c == 0)
break;
switch(c){
80100720: 83 fa 73 cmp $0x73,%edx
80100723: 74 5b je 80100780 <cprintf+0x120>
80100725: 83 fa 78 cmp $0x78,%edx
80100728: 75 1e jne 80100748 <cprintf+0xe8>
case 'd':
printint(*argp++, 10, 1);
break;
case 'x':
case 'p':
printint(*argp++, 16, 0);
8010072a: 8d 46 04 lea 0x4(%esi),%eax
8010072d: 31 c9 xor %ecx,%ecx
8010072f: ba 10 00 00 00 mov $0x10,%edx
80100734: 89 45 e4 mov %eax,-0x1c(%ebp)
80100737: 8b 06 mov (%esi),%eax
80100739: e8 42 fe ff ff call 80100580 <printint>
8010073e: 8b 75 e4 mov -0x1c(%ebp),%esi
break;
80100741: eb 9b jmp 801006de <cprintf+0x7e>
80100743: 90 nop
80100744: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
case '%':
consputc('%');
break;
default:
// Print unknown % sequence to draw attention.
consputc('%');
80100748: b8 25 00 00 00 mov $0x25,%eax
8010074d: 89 55 e4 mov %edx,-0x1c(%ebp)
80100750: e8 9b fc ff ff call 801003f0 <consputc>
consputc(c);
80100755: 8b 55 e4 mov -0x1c(%ebp),%edx
80100758: 89 d0 mov %edx,%eax
8010075a: e8 91 fc ff ff call 801003f0 <consputc>
break;
8010075f: e9 7a ff ff ff jmp 801006de <cprintf+0x7e>
80100764: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
s = "(null)";
for(; *s; s++)
consputc(*s);
break;
case '%':
consputc('%');
80100768: b8 25 00 00 00 mov $0x25,%eax
8010076d: e8 7e fc ff ff call 801003f0 <consputc>
80100772: e9 7c ff ff ff jmp 801006f3 <cprintf+0x93>
80100777: 89 f6 mov %esi,%esi
80100779: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
case 'x':
case 'p':
printint(*argp++, 16, 0);
break;
case 's':
if((s = (char*)*argp++) == 0)
80100780: 8d 46 04 lea 0x4(%esi),%eax
80100783: 8b 36 mov (%esi),%esi
80100785: 89 45 e4 mov %eax,-0x1c(%ebp)
s = "(null)";
80100788: b8 f8 76 10 80 mov $0x801076f8,%eax
8010078d: 85 f6 test %esi,%esi
8010078f: 0f 44 f0 cmove %eax,%esi
for(; *s; s++)
80100792: 0f be 06 movsbl (%esi),%eax
80100795: 84 c0 test %al,%al
80100797: 74 16 je 801007af <cprintf+0x14f>
80100799: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
801007a0: 83 c6 01 add $0x1,%esi
consputc(*s);
801007a3: e8 48 fc ff ff call 801003f0 <consputc>
printint(*argp++, 16, 0);
break;
case 's':
if((s = (char*)*argp++) == 0)
s = "(null)";
for(; *s; s++)
801007a8: 0f be 06 movsbl (%esi),%eax
801007ab: 84 c0 test %al,%al
801007ad: 75 f1 jne 801007a0 <cprintf+0x140>
case 'x':
case 'p':
printint(*argp++, 16, 0);
break;
case 's':
if((s = (char*)*argp++) == 0)
801007af: 8b 75 e4 mov -0x1c(%ebp),%esi
801007b2: e9 27 ff ff ff jmp 801006de <cprintf+0x7e>
801007b7: 89 f6 mov %esi,%esi
801007b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
uint *argp;
char *s;
locking = cons.locking;
if(locking)
acquire(&cons.lock);
801007c0: 83 ec 0c sub $0xc,%esp
801007c3: 68 60 b5 10 80 push $0x8010b560
801007c8: e8 53 42 00 00 call 80104a20 <acquire>
801007cd: 83 c4 10 add $0x10,%esp
801007d0: e9 a4 fe ff ff jmp 80100679 <cprintf+0x19>
if (fmt == 0)
panic("null fmt");
801007d5: 83 ec 0c sub $0xc,%esp
801007d8: 68 ff 76 10 80 push $0x801076ff
801007dd: e8 8e fb ff ff call 80100370 <panic>
801007e2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
801007e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801007f0 <InsertNewCmd>:
char temp_buf[MAX_MEMORY][INPUT_BUF];
void
InsertNewCmd()
{
801007f0: 55 push %ebp
int i = input.w % INPUT_BUF , temp_cur = history.cmd_count % 5;
801007f1: ba 67 66 66 66 mov $0x66666667,%edx
char temp_buf[MAX_MEMORY][INPUT_BUF];
void
InsertNewCmd()
{
801007f6: 89 e5 mov %esp,%ebp
801007f8: 57 push %edi
801007f9: 56 push %esi
801007fa: 53 push %ebx
801007fb: 83 ec 10 sub $0x10,%esp
int i = input.w % INPUT_BUF , temp_cur = history.cmd_count % 5;
801007fe: 8b 0d 34 b5 10 80 mov 0x8010b534,%ecx
80100804: 8b 1d e4 0f 11 80 mov 0x80110fe4,%ebx
int j = 0;
memset(temp_buf[temp_cur] ,'\0' ,INPUT_BUF * sizeof(char));
8010080a: 68 80 00 00 00 push $0x80
8010080f: 6a 00 push $0x0
char temp_buf[MAX_MEMORY][INPUT_BUF];
void
InsertNewCmd()
{
int i = input.w % INPUT_BUF , temp_cur = history.cmd_count % 5;
80100811: 89 c8 mov %ecx,%eax
80100813: 83 e3 7f and $0x7f,%ebx
80100816: f7 ea imul %edx
80100818: 89 c8 mov %ecx,%eax
8010081a: c1 f8 1f sar $0x1f,%eax
8010081d: 89 d6 mov %edx,%esi
8010081f: d1 fe sar %esi
80100821: 29 c6 sub %eax,%esi
80100823: 8d 04 b6 lea (%esi,%esi,4),%eax
80100826: 89 ce mov %ecx,%esi
80100828: 29 c6 sub %eax,%esi
int j = 0;
memset(temp_buf[temp_cur] ,'\0' ,INPUT_BUF * sizeof(char));
8010082a: c1 e6 07 shl $0x7,%esi
8010082d: 8d be 00 10 11 80 lea -0x7feef000(%esi),%edi
80100833: 57 push %edi
80100834: e8 e7 42 00 00 call 80104b20 <memset>
while( i != ((input.e - 1)%INPUT_BUF)){
80100839: a1 e8 0f 11 80 mov 0x80110fe8,%eax
8010083e: 83 c4 10 add $0x10,%esp
80100841: 8d 48 ff lea -0x1(%eax),%ecx
80100844: 31 c0 xor %eax,%eax
80100846: 83 e1 7f and $0x7f,%ecx
80100849: 39 d9 cmp %ebx,%ecx
8010084b: 74 1e je 8010086b <InsertNewCmd+0x7b>
8010084d: 8d 76 00 lea 0x0(%esi),%esi
temp_buf[temp_cur][j] = input.buf[i];
80100850: 0f b6 93 60 0f 11 80 movzbl -0x7feef0a0(%ebx),%edx
j++;
i = (i + 1) % INPUT_BUF;
80100857: 83 c3 01 add $0x1,%ebx
8010085a: 83 e3 7f and $0x7f,%ebx
{
int i = input.w % INPUT_BUF , temp_cur = history.cmd_count % 5;
int j = 0;
memset(temp_buf[temp_cur] ,'\0' ,INPUT_BUF * sizeof(char));
while( i != ((input.e - 1)%INPUT_BUF)){
temp_buf[temp_cur][j] = input.buf[i];
8010085d: 88 94 06 00 10 11 80 mov %dl,-0x7feef000(%esi,%eax,1)
j++;
80100864: 83 c0 01 add $0x1,%eax
InsertNewCmd()
{
int i = input.w % INPUT_BUF , temp_cur = history.cmd_count % 5;
int j = 0;
memset(temp_buf[temp_cur] ,'\0' ,INPUT_BUF * sizeof(char));
while( i != ((input.e - 1)%INPUT_BUF)){
80100867: 39 cb cmp %ecx,%ebx
80100869: 75 e5 jne 80100850 <InsertNewCmd+0x60>
8010086b: ba 30 b5 10 80 mov $0x8010b530,%edx
temp_buf[temp_cur][j] = input.buf[i];
j++;
i = (i + 1) % INPUT_BUF;
}
for(int i = 4 ; i > 0 ; i--){
history.PervCmd[i] = history.PervCmd[i-1];
80100870: 8b 4a fc mov -0x4(%edx),%ecx
80100873: 83 ea 04 sub $0x4,%edx
80100876: 89 4a 04 mov %ecx,0x4(%edx)
history.size[i] = history.size[i-1];
80100879: 8b 4a 1c mov 0x1c(%edx),%ecx
8010087c: 89 4a 20 mov %ecx,0x20(%edx)
while( i != ((input.e - 1)%INPUT_BUF)){
temp_buf[temp_cur][j] = input.buf[i];
j++;
i = (i + 1) % INPUT_BUF;
}
for(int i = 4 ; i > 0 ; i--){
8010087f: 81 fa 20 b5 10 80 cmp $0x8010b520,%edx
80100885: 75 e9 jne 80100870 <InsertNewCmd+0x80>
history.PervCmd[i] = history.PervCmd[i-1];
history.size[i] = history.size[i-1];
}
history.PervCmd[0] = temp_buf[temp_cur];
80100887: 89 3d 20 b5 10 80 mov %edi,0x8010b520
history.size[0] = j;
8010088d: a3 3c b5 10 80 mov %eax,0x8010b53c
}
80100892: 8d 65 f4 lea -0xc(%ebp),%esp
80100895: 5b pop %ebx
80100896: 5e pop %esi
80100897: 5f pop %edi
80100898: 5d pop %ebp
80100899: c3 ret
8010089a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801008a0 <killLine>:
void
killLine()
{
while(input.e != input.w &&
801008a0: a1 e8 0f 11 80 mov 0x80110fe8,%eax
801008a5: 3b 05 e4 0f 11 80 cmp 0x80110fe4,%eax
801008ab: 74 51 je 801008fe <killLine+0x5e>
input.buf[(input.e-1) % INPUT_BUF] != '\n'){
801008ad: 83 e8 01 sub $0x1,%eax
801008b0: 89 c2 mov %eax,%edx
801008b2: 83 e2 7f and $0x7f,%edx
}
void
killLine()
{
while(input.e != input.w &&
801008b5: 80 ba 60 0f 11 80 0a cmpb $0xa,-0x7feef0a0(%edx)
801008bc: 74 40 je 801008fe <killLine+0x5e>
history.size[0] = j;
}
void
killLine()
{
801008be: 55 push %ebp
801008bf: 89 e5 mov %esp,%ebp
801008c1: 83 ec 08 sub $0x8,%esp
801008c4: eb 1b jmp 801008e1 <killLine+0x41>
801008c6: 8d 76 00 lea 0x0(%esi),%esi
801008c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
while(input.e != input.w &&
input.buf[(input.e-1) % INPUT_BUF] != '\n'){
801008d0: 83 e8 01 sub $0x1,%eax
801008d3: 89 c2 mov %eax,%edx
801008d5: 83 e2 7f and $0x7f,%edx
}
void
killLine()
{
while(input.e != input.w &&
801008d8: 80 ba 60 0f 11 80 0a cmpb $0xa,-0x7feef0a0(%edx)
801008df: 74 1c je 801008fd <killLine+0x5d>
input.buf[(input.e-1) % INPUT_BUF] != '\n'){
input.e--;
801008e1: a3 e8 0f 11 80 mov %eax,0x80110fe8
consputc(BACKSPACE);
801008e6: b8 00 01 00 00 mov $0x100,%eax
801008eb: e8 00 fb ff ff call 801003f0 <consputc>
}
void
killLine()
{
while(input.e != input.w &&
801008f0: a1 e8 0f 11 80 mov 0x80110fe8,%eax
801008f5: 3b 05 e4 0f 11 80 cmp 0x80110fe4,%eax
801008fb: 75 d3 jne 801008d0 <killLine+0x30>
input.buf[(input.e-1) % INPUT_BUF] != '\n'){
input.e--;
consputc(BACKSPACE);
}
}
801008fd: c9 leave
801008fe: f3 c3 repz ret
80100900 <fillBuf>:
void
fillBuf()
{
80100900: 55 push %ebp
80100901: 89 e5 mov %esp,%ebp
80100903: 56 push %esi
80100904: 53 push %ebx
killLine();
80100905: e8 96 ff ff ff call 801008a0 <killLine>
for(int i = 0; i < history.size[history.cursor] ; i++)
8010090a: 8b 15 38 b5 10 80 mov 0x8010b538,%edx
80100910: 8b 1c 95 3c b5 10 80 mov -0x7fef4ac4(,%edx,4),%ebx
80100917: 85 db test %ebx,%ebx
80100919: 7e 31 jle 8010094c <fillBuf+0x4c>
8010091b: a1 e8 0f 11 80 mov 0x80110fe8,%eax
80100920: 8b 34 95 20 b5 10 80 mov -0x7fef4ae0(,%edx,4),%esi
80100927: 01 c3 add %eax,%ebx
input.buf[input.e++ % INPUT_BUF] = history.PervCmd[history.cursor][i];
80100929: 29 c6 sub %eax,%esi
8010092b: 90 nop
8010092c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80100930: 8d 50 01 lea 0x1(%eax),%edx
80100933: 89 15 e8 0f 11 80 mov %edx,0x80110fe8
80100939: 0f b6 0c 30 movzbl (%eax,%esi,1),%ecx
8010093d: 83 e0 7f and $0x7f,%eax
void
fillBuf()
{
killLine();
for(int i = 0; i < history.size[history.cursor] ; i++)
80100940: 39 da cmp %ebx,%edx
input.buf[input.e++ % INPUT_BUF] = history.PervCmd[history.cursor][i];
80100942: 88 88 60 0f 11 80 mov %cl,-0x7feef0a0(%eax)
80100948: 89 d0 mov %edx,%eax
void
fillBuf()
{
killLine();
for(int i = 0; i < history.size[history.cursor] ; i++)
8010094a: 75 e4 jne 80100930 <fillBuf+0x30>
input.buf[input.e++ % INPUT_BUF] = history.PervCmd[history.cursor][i];
}
8010094c: 5b pop %ebx
8010094d: 5e pop %esi
8010094e: 5d pop %ebp
8010094f: c3 ret
80100950 <IncCursor>:
void
IncCursor()
{
if (history.cursor == 4)
80100950: 8b 0d 38 b5 10 80 mov 0x8010b538,%ecx
input.buf[input.e++ % INPUT_BUF] = history.PervCmd[history.cursor][i];
}
void
IncCursor()
{
80100956: 55 push %ebp
80100957: 89 e5 mov %esp,%ebp
if (history.cursor == 4)
80100959: 83 f9 04 cmp $0x4,%ecx
8010095c: 74 2a je 80100988 <IncCursor+0x38>
return;
history.cursor = (history.cursor + 1) % 5;
8010095e: 83 c1 01 add $0x1,%ecx
80100961: ba 67 66 66 66 mov $0x66666667,%edx
80100966: 89 c8 mov %ecx,%eax
80100968: f7 ea imul %edx
8010096a: 89 c8 mov %ecx,%eax
8010096c: c1 f8 1f sar $0x1f,%eax
8010096f: d1 fa sar %edx
80100971: 29 c2 sub %eax,%edx
80100973: 8d 04 92 lea (%edx,%edx,4),%eax
80100976: 29 c1 sub %eax,%ecx
if ( history.cursor == history.cmd_count)
80100978: 3b 0d 34 b5 10 80 cmp 0x8010b534,%ecx
void
IncCursor()
{
if (history.cursor == 4)
return;
history.cursor = (history.cursor + 1) % 5;
8010097e: 89 ca mov %ecx,%edx
80100980: 89 0d 38 b5 10 80 mov %ecx,0x8010b538
if ( history.cursor == history.cmd_count)
80100986: 74 08 je 80100990 <IncCursor+0x40>
history.cursor = history.cmd_count - 1;
}
80100988: 5d pop %ebp
80100989: c3 ret
8010098a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
{
if (history.cursor == 4)
return;
history.cursor = (history.cursor + 1) % 5;
if ( history.cursor == history.cmd_count)
history.cursor = history.cmd_count - 1;
80100990: 83 ea 01 sub $0x1,%edx
80100993: 89 15 38 b5 10 80 mov %edx,0x8010b538
}
80100999: 5d pop %ebp
8010099a: c3 ret
8010099b: 90 nop
8010099c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801009a0 <DecCursor>:
void
DecCursor()
{
if ( history.cursor < 0)
801009a0: a1 38 b5 10 80 mov 0x8010b538,%eax
history.cursor = history.cmd_count - 1;
}
void
DecCursor()
{
801009a5: 55 push %ebp
801009a6: 89 e5 mov %esp,%ebp
if ( history.cursor < 0)
801009a8: 85 c0 test %eax,%eax
801009aa: 78 08 js 801009b4 <DecCursor+0x14>
return;
history.cursor = history.cursor - 1;
801009ac: 83 e8 01 sub $0x1,%eax
801009af: a3 38 b5 10 80 mov %eax,0x8010b538
}
801009b4: 5d pop %ebp
801009b5: c3 ret
801009b6: 8d 76 00 lea 0x0(%esi),%esi
801009b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801009c0 <printInput>:
void
printInput()
{
801009c0: 55 push %ebp
801009c1: 89 e5 mov %esp,%ebp
801009c3: 53 push %ebx
801009c4: 83 ec 04 sub $0x4,%esp
int i = input.w % INPUT_BUF;
801009c7: 8b 1d e4 0f 11 80 mov 0x80110fe4,%ebx
801009cd: eb 10 jmp 801009df <printInput+0x1f>
801009cf: 90 nop
while( i != (input.e % INPUT_BUF)){
consputc(input.buf[i]);
801009d0: 0f be 83 60 0f 11 80 movsbl -0x7feef0a0(%ebx),%eax
i = (i + 1) % INPUT_BUF;
801009d7: 83 c3 01 add $0x1,%ebx
void
printInput()
{
int i = input.w % INPUT_BUF;
while( i != (input.e % INPUT_BUF)){
consputc(input.buf[i]);
801009da: e8 11 fa ff ff call 801003f0 <consputc>
void
printInput()
{
int i = input.w % INPUT_BUF;
while( i != (input.e % INPUT_BUF)){
801009df: a1 e8 0f 11 80 mov 0x80110fe8,%eax
}
void
printInput()
{
int i = input.w % INPUT_BUF;
801009e4: 83 e3 7f and $0x7f,%ebx
while( i != (input.e % INPUT_BUF)){
801009e7: 83 e0 7f and $0x7f,%eax
801009ea: 39 d8 cmp %ebx,%eax
801009ec: 75 e2 jne 801009d0 <printInput+0x10>
consputc(input.buf[i]);
i = (i + 1) % INPUT_BUF;
}
}
801009ee: 83 c4 04 add $0x4,%esp
801009f1: 5b pop %ebx
801009f2: 5d pop %ebp
801009f3: c3 ret
801009f4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801009fa: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
80100a00 <KeyDownPressed.part.0>:
KeyDownPressed()
{
if ( history.cmd_count == 0)
return;
if (history.cursor == -1){
80100a00: a1 38 b5 10 80 mov 0x8010b538,%eax
80100a05: 83 f8 ff cmp $0xffffffff,%eax
80100a08: 74 1e je 80100a28 <KeyDownPressed.part.0+0x28>
fillBuf();
printInput();
}
void
KeyDownPressed()
80100a0a: 55 push %ebp
80100a0b: 89 e5 mov %esp,%ebp
80100a0d: 83 ec 08 sub $0x8,%esp
}
void
DecCursor()
{
if ( history.cursor < 0)
80100a10: 85 c0 test %eax,%eax
80100a12: 78 08 js 80100a1c <KeyDownPressed.part.0+0x1c>
return;
history.cursor = history.cursor - 1;
80100a14: 83 e8 01 sub $0x1,%eax
80100a17: a3 38 b5 10 80 mov %eax,0x8010b538
killLine();
return;
}
DecCursor();
fillBuf();
80100a1c: e8 df fe ff ff call 80100900 <fillBuf>
printInput();
}
80100a21: c9 leave
return;
}
DecCursor();
fillBuf();
printInput();
80100a22: eb 9c jmp 801009c0 <printInput>
80100a24: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
{
if ( history.cmd_count == 0)
return;
if (history.cursor == -1){
killLine();
80100a28: e9 73 fe ff ff jmp 801008a0 <killLine>
80100a2d: 8d 76 00 lea 0x0(%esi),%esi
80100a30 <KeyUpPressed>:
}
}
void
KeyUpPressed()
{
80100a30: 55 push %ebp
80100a31: 89 e5 mov %esp,%ebp
80100a33: 53 push %ebx
80100a34: 83 ec 04 sub $0x4,%esp
if ( history.cmd_count == 0)
80100a37: 8b 1d 34 b5 10 80 mov 0x8010b534,%ebx
80100a3d: 85 db test %ebx,%ebx
80100a3f: 74 3f je 80100a80 <KeyUpPressed+0x50>
}
void
IncCursor()
{
if (history.cursor == 4)
80100a41: 8b 0d 38 b5 10 80 mov 0x8010b538,%ecx
80100a47: 83 f9 04 cmp $0x4,%ecx
80100a4a: 74 24 je 80100a70 <KeyUpPressed+0x40>
return;
history.cursor = (history.cursor + 1) % 5;
80100a4c: 83 c1 01 add $0x1,%ecx
80100a4f: ba 67 66 66 66 mov $0x66666667,%edx
80100a54: 89 c8 mov %ecx,%eax
80100a56: f7 ea imul %edx
80100a58: 89 c8 mov %ecx,%eax
80100a5a: c1 f8 1f sar $0x1f,%eax
80100a5d: d1 fa sar %edx
80100a5f: 29 c2 sub %eax,%edx
80100a61: 8d 04 92 lea (%edx,%edx,4),%eax
80100a64: 29 c1 sub %eax,%ecx
if ( history.cursor == history.cmd_count)
80100a66: 39 cb cmp %ecx,%ebx
80100a68: 74 26 je 80100a90 <KeyUpPressed+0x60>
void
IncCursor()
{
if (history.cursor == 4)
return;
history.cursor = (history.cursor + 1) % 5;
80100a6a: 89 0d 38 b5 10 80 mov %ecx,0x8010b538
{
if ( history.cmd_count == 0)
return;
IncCursor();
fillBuf();
80100a70: e8 8b fe ff ff call 80100900 <fillBuf>
printInput();
}
80100a75: 83 c4 04 add $0x4,%esp
80100a78: 5b pop %ebx
80100a79: 5d pop %ebp
if ( history.cmd_count == 0)
return;
IncCursor();
fillBuf();
printInput();
80100a7a: e9 41 ff ff ff jmp 801009c0 <printInput>
80100a7f: 90 nop
}
80100a80: 83 c4 04 add $0x4,%esp
80100a83: 5b pop %ebx
80100a84: 5d pop %ebp
80100a85: c3 ret
80100a86: 8d 76 00 lea 0x0(%esi),%esi
80100a89: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
{
if (history.cursor == 4)
return;
history.cursor = (history.cursor + 1) % 5;
if ( history.cursor == history.cmd_count)
history.cursor = history.cmd_count - 1;
80100a90: 83 eb 01 sub $0x1,%ebx
80100a93: 89 1d 38 b5 10 80 mov %ebx,0x8010b538
{
if ( history.cmd_count == 0)
return;
IncCursor();
fillBuf();
80100a99: e8 62 fe ff ff call 80100900 <fillBuf>
printInput();
}
80100a9e: 83 c4 04 add $0x4,%esp
80100aa1: 5b pop %ebx
80100aa2: 5d pop %ebp
if ( history.cmd_count == 0)
return;
IncCursor();
fillBuf();
printInput();
80100aa3: e9 18 ff ff ff jmp 801009c0 <printInput>
80100aa8: 90 nop
80100aa9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80100ab0 <KeyDownPressed>:
}
void
KeyDownPressed()
{
if ( history.cmd_count == 0)
80100ab0: a1 34 b5 10 80 mov 0x8010b534,%eax
printInput();
}
void
KeyDownPressed()
{
80100ab5: 55 push %ebp
80100ab6: 89 e5 mov %esp,%ebp
if ( history.cmd_count == 0)
80100ab8: 85 c0 test %eax,%eax
80100aba: 74 0c je 80100ac8 <KeyDownPressed+0x18>
}
DecCursor();
fillBuf();
printInput();
}
80100abc: 5d pop %ebp
80100abd: e9 3e ff ff ff jmp 80100a00 <KeyDownPressed.part.0>
80100ac2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80100ac8: 5d pop %ebp
80100ac9: c3 ret
80100aca: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80100ad0 <consoleintr>:
void
consoleintr(int (*getc)(void))
{
80100ad0: 55 push %ebp
80100ad1: 89 e5 mov %esp,%ebp
80100ad3: 57 push %edi
80100ad4: 56 push %esi
80100ad5: 53 push %ebx
int c, doprocdump = 0;
80100ad6: 31 ff xor %edi,%edi
printInput();
}
void
consoleintr(int (*getc)(void))
{
80100ad8: 83 ec 18 sub $0x18,%esp
80100adb: 8b 75 08 mov 0x8(%ebp),%esi
int c, doprocdump = 0;
acquire(&cons.lock);
80100ade: 68 60 b5 10 80 push $0x8010b560
80100ae3: e8 38 3f 00 00 call 80104a20 <acquire>
while((c = getc()) >= 0){
80100ae8: 83 c4 10 add $0x10,%esp
80100aeb: 90 nop
80100aec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80100af0: ff d6 call *%esi
80100af2: 85 c0 test %eax,%eax
80100af4: 89 c3 mov %eax,%ebx
80100af6: 0f 88 dc 00 00 00 js 80100bd8 <consoleintr+0x108>
switch(c){
80100afc: 83 fb 15 cmp $0x15,%ebx
80100aff: 0f 84 1b 01 00 00 je 80100c20 <consoleintr+0x150>
80100b05: 0f 8e f5 00 00 00 jle 80100c00 <consoleintr+0x130>
80100b0b: 81 fb e2 00 00 00 cmp $0xe2,%ebx
80100b11: 0f 84 69 01 00 00 je 80100c80 <consoleintr+0x1b0>
80100b17: 81 fb e3 00 00 00 cmp $0xe3,%ebx
80100b1d: 0f 84 3d 01 00 00 je 80100c60 <consoleintr+0x190>
80100b23: 83 fb 7f cmp $0x7f,%ebx
80100b26: 0f 84 04 01 00 00 je 80100c30 <consoleintr+0x160>
case (KEY_DN) :
KeyDownPressed();
break;
default:
if(c != 0 && input.e-input.r < INPUT_BUF){
80100b2c: 85 db test %ebx,%ebx
80100b2e: 74 c0 je 80100af0 <consoleintr+0x20>
80100b30: a1 e8 0f 11 80 mov 0x80110fe8,%eax
80100b35: 89 c2 mov %eax,%edx
80100b37: 2b 15 e0 0f 11 80 sub 0x80110fe0,%edx
80100b3d: 83 fa 7f cmp $0x7f,%edx
80100b40: 77 ae ja 80100af0 <consoleintr+0x20>
c = (c == '\r') ? '\n' : c;
input.buf[input.e++ % INPUT_BUF] = c;
80100b42: 8d 50 01 lea 0x1(%eax),%edx
80100b45: 83 e0 7f and $0x7f,%eax
case (KEY_DN) :
KeyDownPressed();
break;
default:
if(c != 0 && input.e-input.r < INPUT_BUF){
c = (c == '\r') ? '\n' : c;
80100b48: 83 fb 0d cmp $0xd,%ebx
input.buf[input.e++ % INPUT_BUF] = c;
80100b4b: 89 15 e8 0f 11 80 mov %edx,0x80110fe8
case (KEY_DN) :
KeyDownPressed();
break;
default:
if(c != 0 && input.e-input.r < INPUT_BUF){
c = (c == '\r') ? '\n' : c;
80100b51: 0f 84 49 01 00 00 je 80100ca0 <consoleintr+0x1d0>
input.buf[input.e++ % INPUT_BUF] = c;
80100b57: 88 98 60 0f 11 80 mov %bl,-0x7feef0a0(%eax)
consputc(c);
80100b5d: 89 d8 mov %ebx,%eax
80100b5f: e8 8c f8 ff ff call 801003f0 <consputc>
if(c == '\n' || c == C('D') || input.e == input.r+INPUT_BUF){
80100b64: 83 fb 0a cmp $0xa,%ebx
80100b67: 0f 84 44 01 00 00 je 80100cb1 <consoleintr+0x1e1>
80100b6d: 83 fb 04 cmp $0x4,%ebx
80100b70: 0f 84 3b 01 00 00 je 80100cb1 <consoleintr+0x1e1>
80100b76: a1 e0 0f 11 80 mov 0x80110fe0,%eax
80100b7b: 83 e8 80 sub $0xffffff80,%eax
80100b7e: 39 05 e8 0f 11 80 cmp %eax,0x80110fe8
80100b84: 0f 85 66 ff ff ff jne 80100af0 <consoleintr+0x20>
if ( (input.e - input.w) != 1) {
80100b8a: 89 c2 mov %eax,%edx
80100b8c: 2b 15 e4 0f 11 80 sub 0x80110fe4,%edx
80100b92: 83 fa 01 cmp $0x1,%edx
80100b95: 74 1b je 80100bb2 <consoleintr+0xe2>
InsertNewCmd();
80100b97: e8 54 fc ff ff call 801007f0 <InsertNewCmd>
history.cmd_count++;
80100b9c: 83 05 34 b5 10 80 01 addl $0x1,0x8010b534
80100ba3: a1 e8 0f 11 80 mov 0x80110fe8,%eax
history.cursor = -1;
80100ba8: c7 05 38 b5 10 80 ff movl $0xffffffff,0x8010b538
80100baf: ff ff ff
}
input.w = input.e;
wakeup(&input.r);
80100bb2: 83 ec 0c sub $0xc,%esp
if ( (input.e - input.w) != 1) {
InsertNewCmd();
history.cmd_count++;
history.cursor = -1;
}
input.w = input.e;
80100bb5: a3 e4 0f 11 80 mov %eax,0x80110fe4
wakeup(&input.r);
80100bba: 68 e0 0f 11 80 push $0x80110fe0
80100bbf: e8 6c 36 00 00 call 80104230 <wakeup>
80100bc4: 83 c4 10 add $0x10,%esp
void
consoleintr(int (*getc)(void))
{
int c, doprocdump = 0;
acquire(&cons.lock);
while((c = getc()) >= 0){
80100bc7: ff d6 call *%esi
80100bc9: 85 c0 test %eax,%eax
80100bcb: 89 c3 mov %eax,%ebx
80100bcd: 0f 89 29 ff ff ff jns 80100afc <consoleintr+0x2c>
80100bd3: 90 nop
80100bd4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
}
}
break;
}
}
release(&cons.lock);
80100bd8: 83 ec 0c sub $0xc,%esp
80100bdb: 68 60 b5 10 80 push $0x8010b560
80100be0: e8 eb 3e 00 00 call 80104ad0 <release>
if(doprocdump) {
80100be5: 83 c4 10 add $0x10,%esp
80100be8: 85 ff test %edi,%edi
80100bea: 0f 85 a0 00 00 00 jne 80100c90 <consoleintr+0x1c0>
procdump(); // now call procdump() wo. cons.lock held
}
}
80100bf0: 8d 65 f4 lea -0xc(%ebp),%esp
80100bf3: 5b pop %ebx
80100bf4: 5e pop %esi
80100bf5: 5f pop %edi
80100bf6: 5d pop %ebp
80100bf7: c3 ret
80100bf8: 90 nop
80100bf9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
consoleintr(int (*getc)(void))
{
int c, doprocdump = 0;
acquire(&cons.lock);
while((c = getc()) >= 0){
switch(c){
80100c00: 83 fb 08 cmp $0x8,%ebx
80100c03: 74 2b je 80100c30 <consoleintr+0x160>
80100c05: 83 fb 10 cmp $0x10,%ebx
80100c08: 0f 85 1e ff ff ff jne 80100b2c <consoleintr+0x5c>
case C('P'): // Process listing.
// procdump() locks cons.lock indirectly; invoke later
doprocdump = 1;
80100c0e: bf 01 00 00 00 mov $0x1,%edi
80100c13: e9 d8 fe ff ff jmp 80100af0 <consoleintr+0x20>
80100c18: 90 nop
80100c19: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
break;
case C('U'): // Kill line.
killLine();
80100c20: e8 7b fc ff ff call 801008a0 <killLine>
break;
80100c25: e9 c6 fe ff ff jmp 80100af0 <consoleintr+0x20>
80100c2a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
case C('H'): case '\x7f': // Backspace
if(input.e != input.w){
80100c30: a1 e8 0f 11 80 mov 0x80110fe8,%eax
80100c35: 3b 05 e4 0f 11 80 cmp 0x80110fe4,%eax
80100c3b: 0f 84 af fe ff ff je 80100af0 <consoleintr+0x20>
input.e--;
80100c41: 83 e8 01 sub $0x1,%eax
80100c44: a3 e8 0f 11 80 mov %eax,0x80110fe8
consputc(BACKSPACE);
80100c49: b8 00 01 00 00 mov $0x100,%eax
80100c4e: e8 9d f7 ff ff call 801003f0 <consputc>
80100c53: e9 98 fe ff ff jmp 80100af0 <consoleintr+0x20>
80100c58: 90 nop
80100c59: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
}
void
KeyDownPressed()
{
if ( history.cmd_count == 0)
80100c60: a1 34 b5 10 80 mov 0x8010b534,%eax
80100c65: 85 c0 test %eax,%eax
80100c67: 0f 84 83 fe ff ff je 80100af0 <consoleintr+0x20>
80100c6d: e8 8e fd ff ff call 80100a00 <KeyDownPressed.part.0>
80100c72: e9 79 fe ff ff jmp 80100af0 <consoleintr+0x20>
80100c77: 89 f6 mov %esi,%esi
80100c79: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
consputc(BACKSPACE);
}
break;
case (KEY_UP) :
KeyUpPressed();
80100c80: e8 ab fd ff ff call 80100a30 <KeyUpPressed>
break;
80100c85: e9 66 fe ff ff jmp 80100af0 <consoleintr+0x20>
80100c8a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
}
release(&cons.lock);
if(doprocdump) {
procdump(); // now call procdump() wo. cons.lock held
}
}
80100c90: 8d 65 f4 lea -0xc(%ebp),%esp
80100c93: 5b pop %ebx
80100c94: 5e pop %esi
80100c95: 5f pop %edi
80100c96: 5d pop %ebp
break;
}
}
release(&cons.lock);
if(doprocdump) {
procdump(); // now call procdump() wo. cons.lock held
80100c97: e9 84 36 00 00 jmp 80104320 <procdump>
80100c9c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
KeyDownPressed();
break;
default:
if(c != 0 && input.e-input.r < INPUT_BUF){
c = (c == '\r') ? '\n' : c;
input.buf[input.e++ % INPUT_BUF] = c;
80100ca0: c6 80 60 0f 11 80 0a movb $0xa,-0x7feef0a0(%eax)
consputc(c);
80100ca7: b8 0a 00 00 00 mov $0xa,%eax
80100cac: e8 3f f7 ff ff call 801003f0 <consputc>
80100cb1: a1 e8 0f 11 80 mov 0x80110fe8,%eax
if(c == '\n' || c == C('D') || input.e == input.r+INPUT_BUF){
if ( (input.e - input.w) != 1) {
80100cb6: 89 c2 mov %eax,%edx
80100cb8: 2b 15 e4 0f 11 80 sub 0x80110fe4,%edx
80100cbe: 83 fa 01 cmp $0x1,%edx
80100cc1: 0f 85 d0 fe ff ff jne 80100b97 <consoleintr+0xc7>
80100cc7: e9 e6 fe ff ff jmp 80100bb2 <consoleintr+0xe2>
80100ccc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80100cd0 <consoleinit>:
return n;
}
void
consoleinit(void)
{
80100cd0: 55 push %ebp
80100cd1: 89 e5 mov %esp,%ebp
80100cd3: 83 ec 10 sub $0x10,%esp
initlock(&cons.lock, "console");
80100cd6: 68 08 77 10 80 push $0x80107708
80100cdb: 68 60 b5 10 80 push $0x8010b560
80100ce0: e8 db 3b 00 00 call 801048c0 <initlock>
devsw[CONSOLE].write = consolewrite;
devsw[CONSOLE].read = consoleread;
cons.locking = 1;
ioapicenable(IRQ_KBD, 0);
80100ce5: 58 pop %eax
80100ce6: 5a pop %edx
80100ce7: 6a 00 push $0x0
80100ce9: 6a 01 push $0x1
void
consoleinit(void)
{
initlock(&cons.lock, "console");
devsw[CONSOLE].write = consolewrite;
80100ceb: c7 05 2c 1c 11 80 00 movl $0x80100600,0x80111c2c
80100cf2: 06 10 80
devsw[CONSOLE].read = consoleread;
80100cf5: c7 05 28 1c 11 80 70 movl $0x80100270,0x80111c28
80100cfc: 02 10 80
cons.locking = 1;
80100cff: c7 05 94 b5 10 80 01 movl $0x1,0x8010b594
80100d06: 00 00 00
ioapicenable(IRQ_KBD, 0);
80100d09: e8 c2 18 00 00 call 801025d0 <ioapicenable>
}
80100d0e: 83 c4 10 add $0x10,%esp
80100d11: c9 leave
80100d12: c3 ret
80100d13: 66 90 xchg %ax,%ax
80100d15: 66 90 xchg %ax,%ax
80100d17: 66 90 xchg %ax,%ax
80100d19: 66 90 xchg %ax,%ax
80100d1b: 66 90 xchg %ax,%ax
80100d1d: 66 90 xchg %ax,%ax
80100d1f: 90 nop
80100d20 <exec>:
#include "defs.h"
#include "x86.h"
#include "elf.h"
int exec(char *path, char **argv)
{
80100d20: 55 push %ebp
80100d21: 89 e5 mov %esp,%ebp
80100d23: 57 push %edi
80100d24: 56 push %esi
80100d25: 53 push %ebx
80100d26: 81 ec 0c 01 00 00 sub $0x10c,%esp
uint argc, sz, sp, ustack[3 + MAXARG + 1];
struct elfhdr elf;
struct inode *ip;
struct proghdr ph;
pde_t *pgdir, *oldpgdir;
struct proc *curproc = myproc();
80100d2c: e8 8f 2d 00 00 call 80103ac0 <myproc>
80100d31: 89 85 f4 fe ff ff mov %eax,-0x10c(%ebp)
begin_op();
80100d37: e8 44 21 00 00 call 80102e80 <begin_op>
if ((ip = namei(path)) == 0)
80100d3c: 83 ec 0c sub $0xc,%esp
80100d3f: ff 75 08 pushl 0x8(%ebp)
80100d42: e8 a9 14 00 00 call 801021f0 <namei>
80100d47: 83 c4 10 add $0x10,%esp
80100d4a: 85 c0 test %eax,%eax
80100d4c: 0f 84 9c 01 00 00 je 80100eee <exec+0x1ce>
{
end_op();
cprintf("exec: fail\n");
return -1;
}
ilock(ip);
80100d52: 83 ec 0c sub $0xc,%esp
80100d55: 89 c3 mov %eax,%ebx
80100d57: 50 push %eax
80100d58: e8 43 0c 00 00 call 801019a0 <ilock>
pgdir = 0;
// Check ELF header
if (readi(ip, (char *)&elf, 0, sizeof(elf)) != sizeof(elf))
80100d5d: 8d 85 24 ff ff ff lea -0xdc(%ebp),%eax
80100d63: 6a 34 push $0x34
80100d65: 6a 00 push $0x0
80100d67: 50 push %eax
80100d68: 53 push %ebx
80100d69: e8 12 0f 00 00 call 80101c80 <readi>
80100d6e: 83 c4 20 add $0x20,%esp
80100d71: 83 f8 34 cmp $0x34,%eax
80100d74: 74 22 je 80100d98 <exec+0x78>
bad:
if (pgdir)
freevm(pgdir);
if (ip)
{
iunlockput(ip);
80100d76: 83 ec 0c sub $0xc,%esp
80100d79: 53 push %ebx
80100d7a: e8 b1 0e 00 00 call 80101c30 <iunlockput>
end_op();
80100d7f: e8 6c 21 00 00 call 80102ef0 <end_op>
80100d84: 83 c4 10 add $0x10,%esp
}
return -1;
80100d87: b8 ff ff ff ff mov $0xffffffff,%eax
}
80100d8c: 8d 65 f4 lea -0xc(%ebp),%esp
80100d8f: 5b pop %ebx
80100d90: 5e pop %esi
80100d91: 5f pop %edi
80100d92: 5d pop %ebp
80100d93: c3 ret
80100d94: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
pgdir = 0;
// Check ELF header
if (readi(ip, (char *)&elf, 0, sizeof(elf)) != sizeof(elf))
goto bad;
if (elf.magic != ELF_MAGIC)
80100d98: 81 bd 24 ff ff ff 7f cmpl $0x464c457f,-0xdc(%ebp)
80100d9f: 45 4c 46
80100da2: 75 d2 jne 80100d76 <exec+0x56>
goto bad;
if ((pgdir = setupkvm()) == 0)
80100da4: e8 37 66 00 00 call 801073e0 <setupkvm>
80100da9: 85 c0 test %eax,%eax
80100dab: 89 85 f0 fe ff ff mov %eax,-0x110(%ebp)
80100db1: 74 c3 je 80100d76 <exec+0x56>
goto bad;
// Load program into memory.
sz = 0;
for (i = 0, off = elf.phoff; i < elf.phnum; i++, off += sizeof(ph))
80100db3: 66 83 bd 50 ff ff ff cmpw $0x0,-0xb0(%ebp)
80100dba: 00
80100dbb: 8b b5 40 ff ff ff mov -0xc0(%ebp),%esi
80100dc1: c7 85 ec fe ff ff 00 movl $0x0,-0x114(%ebp)
80100dc8: 00 00 00
80100dcb: 0f 84 c5 00 00 00 je 80100e96 <exec+0x176>
80100dd1: 31 ff xor %edi,%edi
80100dd3: eb 18 jmp 80100ded <exec+0xcd>
80100dd5: 8d 76 00 lea 0x0(%esi),%esi
80100dd8: 0f b7 85 50 ff ff ff movzwl -0xb0(%ebp),%eax
80100ddf: 83 c7 01 add $0x1,%edi
80100de2: 83 c6 20 add $0x20,%esi
80100de5: 39 f8 cmp %edi,%eax
80100de7: 0f 8e a9 00 00 00 jle 80100e96 <exec+0x176>
{
if (readi(ip, (char *)&ph, off, sizeof(ph)) != sizeof(ph))
80100ded: 8d 85 04 ff ff ff lea -0xfc(%ebp),%eax
80100df3: 6a 20 push $0x20
80100df5: 56 push %esi
80100df6: 50 push %eax
80100df7: 53 push %ebx
80100df8: e8 83 0e 00 00 call 80101c80 <readi>
80100dfd: 83 c4 10 add $0x10,%esp
80100e00: 83 f8 20 cmp $0x20,%eax
80100e03: 75 7b jne 80100e80 <exec+0x160>
goto bad;
if (ph.type != ELF_PROG_LOAD)
80100e05: 83 bd 04 ff ff ff 01 cmpl $0x1,-0xfc(%ebp)
80100e0c: 75 ca jne 80100dd8 <exec+0xb8>
continue;
if (ph.memsz < ph.filesz)
80100e0e: 8b 85 18 ff ff ff mov -0xe8(%ebp),%eax
80100e14: 3b 85 14 ff ff ff cmp -0xec(%ebp),%eax
80100e1a: 72 64 jb 80100e80 <exec+0x160>
goto bad;
if (ph.vaddr + ph.memsz < ph.vaddr)
80100e1c: 03 85 0c ff ff ff add -0xf4(%ebp),%eax
80100e22: 72 5c jb 80100e80 <exec+0x160>
goto bad;
if ((sz = allocuvm(pgdir, sz, ph.vaddr + ph.memsz)) == 0)
80100e24: 83 ec 04 sub $0x4,%esp
80100e27: 50 push %eax
80100e28: ff b5 ec fe ff ff pushl -0x114(%ebp)
80100e2e: ff b5 f0 fe ff ff pushl -0x110(%ebp)
80100e34: e8 f7 63 00 00 call 80107230 <allocuvm>
80100e39: 83 c4 10 add $0x10,%esp
80100e3c: 85 c0 test %eax,%eax
80100e3e: 89 85 ec fe ff ff mov %eax,-0x114(%ebp)
80100e44: 74 3a je 80100e80 <exec+0x160>
goto bad;
if (ph.vaddr % PGSIZE != 0)
80100e46: 8b 85 0c ff ff ff mov -0xf4(%ebp),%eax
80100e4c: a9 ff 0f 00 00 test $0xfff,%eax
80100e51: 75 2d jne 80100e80 <exec+0x160>
goto bad;
if (loaduvm(pgdir, (char *)ph.vaddr, ip, ph.off, ph.filesz) < 0)
80100e53: 83 ec 0c sub $0xc,%esp
80100e56: ff b5 14 ff ff ff pushl -0xec(%ebp)
80100e5c: ff b5 08 ff ff ff pushl -0xf8(%ebp)
80100e62: 53 push %ebx
80100e63: 50 push %eax
80100e64: ff b5 f0 fe ff ff pushl -0x110(%ebp)
80100e6a: e8 01 63 00 00 call 80107170 <loaduvm>
80100e6f: 83 c4 20 add $0x20,%esp
80100e72: 85 c0 test %eax,%eax
80100e74: 0f 89 5e ff ff ff jns 80100dd8 <exec+0xb8>
80100e7a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
freevm(oldpgdir);
return 0;
bad:
if (pgdir)
freevm(pgdir);
80100e80: 83 ec 0c sub $0xc,%esp
80100e83: ff b5 f0 fe ff ff pushl -0x110(%ebp)
80100e89: e8 d2 64 00 00 call 80107360 <freevm>
80100e8e: 83 c4 10 add $0x10,%esp
80100e91: e9 e0 fe ff ff jmp 80100d76 <exec+0x56>
if (ph.vaddr % PGSIZE != 0)
goto bad;
if (loaduvm(pgdir, (char *)ph.vaddr, ip, ph.off, ph.filesz) < 0)
goto bad;
}
iunlockput(ip);
80100e96: 83 ec 0c sub $0xc,%esp
80100e99: 53 push %ebx
80100e9a: e8 91 0d 00 00 call 80101c30 <iunlockput>
end_op();
80100e9f: e8 4c 20 00 00 call 80102ef0 <end_op>
ip = 0;
// Allocate two pages at the next page boundary.
// Make the first inaccessible. Use the second as the user stack.
sz = PGROUNDUP(sz);
80100ea4: 8b 85 ec fe ff ff mov -0x114(%ebp),%eax
if ((sz = allocuvm(pgdir, sz, sz + 2 * PGSIZE)) == 0)
80100eaa: 83 c4 0c add $0xc,%esp
end_op();
ip = 0;
// Allocate two pages at the next page boundary.
// Make the first inaccessible. Use the second as the user stack.
sz = PGROUNDUP(sz);
80100ead: 05 ff 0f 00 00 add $0xfff,%eax
80100eb2: 25 00 f0 ff ff and $0xfffff000,%eax
if ((sz = allocuvm(pgdir, sz, sz + 2 * PGSIZE)) == 0)
80100eb7: 8d 90 00 20 00 00 lea 0x2000(%eax),%edx
80100ebd: 52 push %edx
80100ebe: 50 push %eax
80100ebf: ff b5 f0 fe ff ff pushl -0x110(%ebp)
80100ec5: e8 66 63 00 00 call 80107230 <allocuvm>
80100eca: 83 c4 10 add $0x10,%esp
80100ecd: 85 c0 test %eax,%eax
80100ecf: 89 c6 mov %eax,%esi
80100ed1: 75 3a jne 80100f0d <exec+0x1ed>
freevm(oldpgdir);
return 0;
bad:
if (pgdir)
freevm(pgdir);
80100ed3: 83 ec 0c sub $0xc,%esp
80100ed6: ff b5 f0 fe ff ff pushl -0x110(%ebp)
80100edc: e8 7f 64 00 00 call 80107360 <freevm>
80100ee1: 83 c4 10 add $0x10,%esp
if (ip)
{
iunlockput(ip);
end_op();
}
return -1;
80100ee4: b8 ff ff ff ff mov $0xffffffff,%eax
80100ee9: e9 9e fe ff ff jmp 80100d8c <exec+0x6c>
begin_op();
if ((ip = namei(path)) == 0)
{
end_op();
80100eee: e8 fd 1f 00 00 call 80102ef0 <end_op>
cprintf("exec: fail\n");
80100ef3: 83 ec 0c sub $0xc,%esp
80100ef6: 68 21 77 10 80 push $0x80107721
80100efb: e8 60 f7 ff ff call 80100660 <cprintf>
return -1;
80100f00: 83 c4 10 add $0x10,%esp
80100f03: b8 ff ff ff ff mov $0xffffffff,%eax
80100f08: e9 7f fe ff ff jmp 80100d8c <exec+0x6c>
// Allocate two pages at the next page boundary.
// Make the first inaccessible. Use the second as the user stack.
sz = PGROUNDUP(sz);
if ((sz = allocuvm(pgdir, sz, sz + 2 * PGSIZE)) == 0)
goto bad;
clearpteu(pgdir, (char *)(sz - 2 * PGSIZE));
80100f0d: 8d 80 00 e0 ff ff lea -0x2000(%eax),%eax
80100f13: 83 ec 08 sub $0x8,%esp
sp = sz;
// Push argument strings, prepare rest of stack in ustack.
for (argc = 0; argv[argc]; argc++)
80100f16: 31 ff xor %edi,%edi
80100f18: 89 f3 mov %esi,%ebx
// Allocate two pages at the next page boundary.
// Make the first inaccessible. Use the second as the user stack.
sz = PGROUNDUP(sz);
if ((sz = allocuvm(pgdir, sz, sz + 2 * PGSIZE)) == 0)
goto bad;
clearpteu(pgdir, (char *)(sz - 2 * PGSIZE));
80100f1a: 50 push %eax
80100f1b: ff b5 f0 fe ff ff pushl -0x110(%ebp)
80100f21: e8 5a 65 00 00 call 80107480 <clearpteu>
sp = sz;
// Push argument strings, prepare rest of stack in ustack.
for (argc = 0; argv[argc]; argc++)
80100f26: 8b 45 0c mov 0xc(%ebp),%eax
80100f29: 83 c4 10 add $0x10,%esp
80100f2c: 8d 95 58 ff ff ff lea -0xa8(%ebp),%edx
80100f32: 8b 00 mov (%eax),%eax
80100f34: 85 c0 test %eax,%eax
80100f36: 74 79 je 80100fb1 <exec+0x291>
80100f38: 89 b5 ec fe ff ff mov %esi,-0x114(%ebp)
80100f3e: 8b b5 f0 fe ff ff mov -0x110(%ebp),%esi
80100f44: eb 13 jmp 80100f59 <exec+0x239>
80100f46: 8d 76 00 lea 0x0(%esi),%esi
80100f49: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
{
if (argc >= MAXARG)
80100f50: 83 ff 20 cmp $0x20,%edi
80100f53: 0f 84 7a ff ff ff je 80100ed3 <exec+0x1b3>
goto bad;
sp = (sp - (strlen(argv[argc]) + 1)) & ~3;
80100f59: 83 ec 0c sub $0xc,%esp
80100f5c: 50 push %eax
80100f5d: e8 fe 3d 00 00 call 80104d60 <strlen>
80100f62: f7 d0 not %eax
80100f64: 01 c3 add %eax,%ebx
if (copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0)
80100f66: 8b 45 0c mov 0xc(%ebp),%eax
80100f69: 5a pop %edx
// Push argument strings, prepare rest of stack in ustack.
for (argc = 0; argv[argc]; argc++)
{
if (argc >= MAXARG)
goto bad;
sp = (sp - (strlen(argv[argc]) + 1)) & ~3;
80100f6a: 83 e3 fc and $0xfffffffc,%ebx
if (copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0)
80100f6d: ff 34 b8 pushl (%eax,%edi,4)
80100f70: e8 eb 3d 00 00 call 80104d60 <strlen>
80100f75: 83 c0 01 add $0x1,%eax
80100f78: 50 push %eax
80100f79: 8b 45 0c mov 0xc(%ebp),%eax
80100f7c: ff 34 b8 pushl (%eax,%edi,4)
80100f7f: 53 push %ebx
80100f80: 56 push %esi
80100f81: e8 6a 66 00 00 call 801075f0 <copyout>
80100f86: 83 c4 20 add $0x20,%esp
80100f89: 85 c0 test %eax,%eax
80100f8b: 0f 88 42 ff ff ff js 80100ed3 <exec+0x1b3>
goto bad;
clearpteu(pgdir, (char *)(sz - 2 * PGSIZE));
sp = sz;
// Push argument strings, prepare rest of stack in ustack.
for (argc = 0; argv[argc]; argc++)
80100f91: 8b 45 0c mov 0xc(%ebp),%eax
if (argc >= MAXARG)
goto bad;
sp = (sp - (strlen(argv[argc]) + 1)) & ~3;
if (copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0)
goto bad;
ustack[3 + argc] = sp;
80100f94: 89 9c bd 64 ff ff ff mov %ebx,-0x9c(%ebp,%edi,4)
goto bad;
clearpteu(pgdir, (char *)(sz - 2 * PGSIZE));
sp = sz;
// Push argument strings, prepare rest of stack in ustack.
for (argc = 0; argv[argc]; argc++)
80100f9b: 83 c7 01 add $0x1,%edi
if (argc >= MAXARG)
goto bad;
sp = (sp - (strlen(argv[argc]) + 1)) & ~3;
if (copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0)
goto bad;
ustack[3 + argc] = sp;
80100f9e: 8d 95 58 ff ff ff lea -0xa8(%ebp),%edx
goto bad;
clearpteu(pgdir, (char *)(sz - 2 * PGSIZE));
sp = sz;
// Push argument strings, prepare rest of stack in ustack.
for (argc = 0; argv[argc]; argc++)
80100fa4: 8b 04 b8 mov (%eax,%edi,4),%eax
80100fa7: 85 c0 test %eax,%eax
80100fa9: 75 a5 jne 80100f50 <exec+0x230>
80100fab: 8b b5 ec fe ff ff mov -0x114(%ebp),%esi
}
ustack[3 + argc] = 0;
ustack[0] = 0xffffffff; // fake return PC
ustack[1] = argc;
ustack[2] = sp - (argc + 1) * 4; // argv pointer
80100fb1: 8d 04 bd 04 00 00 00 lea 0x4(,%edi,4),%eax
80100fb8: 89 d9 mov %ebx,%ecx
sp = (sp - (strlen(argv[argc]) + 1)) & ~3;
if (copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0)
goto bad;
ustack[3 + argc] = sp;
}
ustack[3 + argc] = 0;
80100fba: c7 84 bd 64 ff ff ff movl $0x0,-0x9c(%ebp,%edi,4)
80100fc1: 00 00 00 00
ustack[0] = 0xffffffff; // fake return PC
80100fc5: c7 85 58 ff ff ff ff movl $0xffffffff,-0xa8(%ebp)
80100fcc: ff ff ff
ustack[1] = argc;
80100fcf: 89 bd 5c ff ff ff mov %edi,-0xa4(%ebp)
ustack[2] = sp - (argc + 1) * 4; // argv pointer
80100fd5: 29 c1 sub %eax,%ecx
sp -= (3 + argc + 1) * 4;
80100fd7: 83 c0 0c add $0xc,%eax
80100fda: 29 c3 sub %eax,%ebx
if (copyout(pgdir, sp, ustack, (3 + argc + 1) * 4) < 0)
80100fdc: 50 push %eax
80100fdd: 52 push %edx
80100fde: 53 push %ebx
80100fdf: ff b5 f0 fe ff ff pushl -0x110(%ebp)
}
ustack[3 + argc] = 0;
ustack[0] = 0xffffffff; // fake return PC
ustack[1] = argc;
ustack[2] = sp - (argc + 1) * 4; // argv pointer
80100fe5: 89 8d 60 ff ff ff mov %ecx,-0xa0(%ebp)
sp -= (3 + argc + 1) * 4;
if (copyout(pgdir, sp, ustack, (3 + argc + 1) * 4) < 0)
80100feb: e8 00 66 00 00 call 801075f0 <copyout>
80100ff0: 83 c4 10 add $0x10,%esp
80100ff3: 85 c0 test %eax,%eax
80100ff5: 0f 88 d8 fe ff ff js 80100ed3 <exec+0x1b3>
goto bad;
// Save program name for debugging.
for (last = s = path; *s; s++)
80100ffb: 8b 45 08 mov 0x8(%ebp),%eax
80100ffe: 0f b6 10 movzbl (%eax),%edx
80101001: 84 d2 test %dl,%dl
80101003: 74 19 je 8010101e <exec+0x2fe>
80101005: 8b 4d 08 mov 0x8(%ebp),%ecx
80101008: 83 c0 01 add $0x1,%eax
if (*s == '/')
last = s + 1;
8010100b: 80 fa 2f cmp $0x2f,%dl
sp -= (3 + argc + 1) * 4;
if (copyout(pgdir, sp, ustack, (3 + argc + 1) * 4) < 0)
goto bad;
// Save program name for debugging.
for (last = s = path; *s; s++)
8010100e: 0f b6 10 movzbl (%eax),%edx
if (*s == '/')
last = s + 1;
80101011: 0f 44 c8 cmove %eax,%ecx
80101014: 83 c0 01 add $0x1,%eax
sp -= (3 + argc + 1) * 4;
if (copyout(pgdir, sp, ustack, (3 + argc + 1) * 4) < 0)
goto bad;
// Save program name for debugging.
for (last = s = path; *s; s++)
80101017: 84 d2 test %dl,%dl
80101019: 75 f0 jne 8010100b <exec+0x2eb>
8010101b: 89 4d 08 mov %ecx,0x8(%ebp)
if (*s == '/')
last = s + 1;
safestrcpy(curproc->name, last, sizeof(curproc->name));
8010101e: 8b bd f4 fe ff ff mov -0x10c(%ebp),%edi
80101024: 50 push %eax
80101025: 6a 10 push $0x10
80101027: ff 75 08 pushl 0x8(%ebp)
8010102a: 89 f8 mov %edi,%eax
8010102c: 83 c0 6c add $0x6c,%eax
8010102f: 50 push %eax
80101030: e8 eb 3c 00 00 call 80104d20 <safestrcpy>
// Commit to the user image.
oldpgdir = curproc->pgdir;
curproc->pgdir = pgdir;
80101035: 8b 8d f0 fe ff ff mov -0x110(%ebp),%ecx
if (*s == '/')
last = s + 1;
safestrcpy(curproc->name, last, sizeof(curproc->name));
// Commit to the user image.
oldpgdir = curproc->pgdir;
8010103b: 89 f8 mov %edi,%eax
8010103d: 8b 7f 04 mov 0x4(%edi),%edi
curproc->pgdir = pgdir;
curproc->sz = sz;
80101040: 89 30 mov %esi,(%eax)
last = s + 1;
safestrcpy(curproc->name, last, sizeof(curproc->name));
// Commit to the user image.
oldpgdir = curproc->pgdir;
curproc->pgdir = pgdir;
80101042: 89 48 04 mov %ecx,0x4(%eax)
curproc->sz = sz;
curproc->tf->eip = elf.entry; // main
80101045: 89 c1 mov %eax,%ecx
80101047: 8b 95 3c ff ff ff mov -0xc4(%ebp),%edx
8010104d: 8b 40 18 mov 0x18(%eax),%eax
80101050: 89 50 38 mov %edx,0x38(%eax)
curproc->tf->esp = sp;
80101053: 8b 41 18 mov 0x18(%ecx),%eax
80101056: 89 58 44 mov %ebx,0x44(%eax)
switchuvm(curproc);
80101059: 89 0c 24 mov %ecx,(%esp)
8010105c: e8 7f 5f 00 00 call 80106fe0 <switchuvm>
freevm(oldpgdir);
80101061: 89 3c 24 mov %edi,(%esp)
80101064: e8 f7 62 00 00 call 80107360 <freevm>
return 0;
80101069: 83 c4 10 add $0x10,%esp
8010106c: 31 c0 xor %eax,%eax
8010106e: e9 19 fd ff ff jmp 80100d8c <exec+0x6c>
80101073: 66 90 xchg %ax,%ax
80101075: 66 90 xchg %ax,%ax
80101077: 66 90 xchg %ax,%ax
80101079: 66 90 xchg %ax,%ax
8010107b: 66 90 xchg %ax,%ax
8010107d: 66 90 xchg %ax,%ax
8010107f: 90 nop
80101080 <fileinit>:
struct file file[NFILE];
} ftable;
void
fileinit(void)
{
80101080: 55 push %ebp
80101081: 89 e5 mov %esp,%ebp
80101083: 83 ec 10 sub $0x10,%esp
initlock(&ftable.lock, "ftable");
80101086: 68 2d 77 10 80 push $0x8010772d
8010108b: 68 80 12 11 80 push $0x80111280
80101090: e8 2b 38 00 00 call 801048c0 <initlock>
}
80101095: 83 c4 10 add $0x10,%esp
80101098: c9 leave
80101099: c3 ret
8010109a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801010a0 <filealloc>:
// Allocate a file structure.
struct file*
filealloc(void)
{
801010a0: 55 push %ebp
801010a1: 89 e5 mov %esp,%ebp
801010a3: 53 push %ebx
struct file *f;
acquire(&ftable.lock);
for(f = ftable.file; f < ftable.file + NFILE; f++){
801010a4: bb b4 12 11 80 mov $0x801112b4,%ebx
}
// Allocate a file structure.
struct file*
filealloc(void)
{
801010a9: 83 ec 10 sub $0x10,%esp
struct file *f;
acquire(&ftable.lock);
801010ac: 68 80 12 11 80 push $0x80111280
801010b1: e8 6a 39 00 00 call 80104a20 <acquire>
801010b6: 83 c4 10 add $0x10,%esp
801010b9: eb 10 jmp 801010cb <filealloc+0x2b>
801010bb: 90 nop
801010bc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
for(f = ftable.file; f < ftable.file + NFILE; f++){
801010c0: 83 c3 18 add $0x18,%ebx
801010c3: 81 fb 14 1c 11 80 cmp $0x80111c14,%ebx
801010c9: 74 25 je 801010f0 <filealloc+0x50>
if(f->ref == 0){
801010cb: 8b 43 04 mov 0x4(%ebx),%eax
801010ce: 85 c0 test %eax,%eax
801010d0: 75 ee jne 801010c0 <filealloc+0x20>
f->ref = 1;
release(&ftable.lock);
801010d2: 83 ec 0c sub $0xc,%esp
struct file *f;
acquire(&ftable.lock);
for(f = ftable.file; f < ftable.file + NFILE; f++){
if(f->ref == 0){
f->ref = 1;
801010d5: c7 43 04 01 00 00 00 movl $0x1,0x4(%ebx)
release(&ftable.lock);
801010dc: 68 80 12 11 80 push $0x80111280
801010e1: e8 ea 39 00 00 call 80104ad0 <release>
return f;
801010e6: 89 d8 mov %ebx,%eax
801010e8: 83 c4 10 add $0x10,%esp
}
}
release(&ftable.lock);
return 0;
}
801010eb: 8b 5d fc mov -0x4(%ebp),%ebx
801010ee: c9 leave
801010ef: c3 ret
f->ref = 1;
release(&ftable.lock);
return f;
}
}
release(&ftable.lock);
801010f0: 83 ec 0c sub $0xc,%esp
801010f3: 68 80 12 11 80 push $0x80111280
801010f8: e8 d3 39 00 00 call 80104ad0 <release>
return 0;
801010fd: 83 c4 10 add $0x10,%esp
80101100: 31 c0 xor %eax,%eax
}
80101102: 8b 5d fc mov -0x4(%ebp),%ebx
80101105: c9 leave
80101106: c3 ret
80101107: 89 f6 mov %esi,%esi
80101109: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80101110 <filedup>:
// Increment ref count for file f.
struct file*
filedup(struct file *f)
{
80101110: 55 push %ebp
80101111: 89 e5 mov %esp,%ebp
80101113: 53 push %ebx
80101114: 83 ec 10 sub $0x10,%esp
80101117: 8b 5d 08 mov 0x8(%ebp),%ebx
acquire(&ftable.lock);
8010111a: 68 80 12 11 80 push $0x80111280
8010111f: e8 fc 38 00 00 call 80104a20 <acquire>
if(f->ref < 1)
80101124: 8b 43 04 mov 0x4(%ebx),%eax
80101127: 83 c4 10 add $0x10,%esp
8010112a: 85 c0 test %eax,%eax
8010112c: 7e 1a jle 80101148 <filedup+0x38>
panic("filedup");
f->ref++;
8010112e: 83 c0 01 add $0x1,%eax
release(&ftable.lock);
80101131: 83 ec 0c sub $0xc,%esp
filedup(struct file *f)
{
acquire(&ftable.lock);
if(f->ref < 1)
panic("filedup");
f->ref++;
80101134: 89 43 04 mov %eax,0x4(%ebx)
release(&ftable.lock);
80101137: 68 80 12 11 80 push $0x80111280
8010113c: e8 8f 39 00 00 call 80104ad0 <release>
return f;
}
80101141: 89 d8 mov %ebx,%eax
80101143: 8b 5d fc mov -0x4(%ebp),%ebx
80101146: c9 leave
80101147: c3 ret
struct file*
filedup(struct file *f)
{
acquire(&ftable.lock);
if(f->ref < 1)
panic("filedup");
80101148: 83 ec 0c sub $0xc,%esp
8010114b: 68 34 77 10 80 push $0x80107734
80101150: e8 1b f2 ff ff call 80100370 <panic>
80101155: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80101159: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80101160 <fileclose>:
}
// Close file f. (Decrement ref count, close when reaches 0.)
void
fileclose(struct file *f)
{
80101160: 55 push %ebp
80101161: 89 e5 mov %esp,%ebp
80101163: 57 push %edi
80101164: 56 push %esi
80101165: 53 push %ebx
80101166: 83 ec 28 sub $0x28,%esp
80101169: 8b 7d 08 mov 0x8(%ebp),%edi
struct file ff;
acquire(&ftable.lock);
8010116c: 68 80 12 11 80 push $0x80111280
80101171: e8 aa 38 00 00 call 80104a20 <acquire>
if(f->ref < 1)
80101176: 8b 47 04 mov 0x4(%edi),%eax
80101179: 83 c4 10 add $0x10,%esp
8010117c: 85 c0 test %eax,%eax
8010117e: 0f 8e 9b 00 00 00 jle 8010121f <fileclose+0xbf>
panic("fileclose");
if(--f->ref > 0){
80101184: 83 e8 01 sub $0x1,%eax
80101187: 85 c0 test %eax,%eax
80101189: 89 47 04 mov %eax,0x4(%edi)
8010118c: 74 1a je 801011a8 <fileclose+0x48>
release(&ftable.lock);
8010118e: c7 45 08 80 12 11 80 movl $0x80111280,0x8(%ebp)
else if(ff.type == FD_INODE){
begin_op();
iput(ff.ip);
end_op();
}
}
80101195: 8d 65 f4 lea -0xc(%ebp),%esp
80101198: 5b pop %ebx
80101199: 5e pop %esi
8010119a: 5f pop %edi
8010119b: 5d pop %ebp
acquire(&ftable.lock);
if(f->ref < 1)
panic("fileclose");
if(--f->ref > 0){
release(&ftable.lock);
8010119c: e9 2f 39 00 00 jmp 80104ad0 <release>
801011a1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
return;
}
ff = *f;
801011a8: 0f b6 47 09 movzbl 0x9(%edi),%eax
801011ac: 8b 1f mov (%edi),%ebx
f->ref = 0;
f->type = FD_NONE;
release(&ftable.lock);
801011ae: 83 ec 0c sub $0xc,%esp
panic("fileclose");
if(--f->ref > 0){
release(&ftable.lock);
return;
}
ff = *f;
801011b1: 8b 77 0c mov 0xc(%edi),%esi
f->ref = 0;
f->type = FD_NONE;
801011b4: c7 07 00 00 00 00 movl $0x0,(%edi)
panic("fileclose");
if(--f->ref > 0){
release(&ftable.lock);
return;
}
ff = *f;
801011ba: 88 45 e7 mov %al,-0x19(%ebp)
801011bd: 8b 47 10 mov 0x10(%edi),%eax
f->ref = 0;
f->type = FD_NONE;
release(&ftable.lock);
801011c0: 68 80 12 11 80 push $0x80111280
panic("fileclose");
if(--f->ref > 0){
release(&ftable.lock);
return;
}
ff = *f;
801011c5: 89 45 e0 mov %eax,-0x20(%ebp)
f->ref = 0;
f->type = FD_NONE;
release(&ftable.lock);
801011c8: e8 03 39 00 00 call 80104ad0 <release>
if(ff.type == FD_PIPE)
801011cd: 83 c4 10 add $0x10,%esp
801011d0: 83 fb 01 cmp $0x1,%ebx
801011d3: 74 13 je 801011e8 <fileclose+0x88>
pipeclose(ff.pipe, ff.writable);
else if(ff.type == FD_INODE){
801011d5: 83 fb 02 cmp $0x2,%ebx
801011d8: 74 26 je 80101200 <fileclose+0xa0>
begin_op();
iput(ff.ip);
end_op();
}
}
801011da: 8d 65 f4 lea -0xc(%ebp),%esp
801011dd: 5b pop %ebx
801011de: 5e pop %esi
801011df: 5f pop %edi
801011e0: 5d pop %ebp
801011e1: c3 ret
801011e2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
f->ref = 0;
f->type = FD_NONE;
release(&ftable.lock);
if(ff.type == FD_PIPE)
pipeclose(ff.pipe, ff.writable);
801011e8: 0f be 5d e7 movsbl -0x19(%ebp),%ebx
801011ec: 83 ec 08 sub $0x8,%esp
801011ef: 53 push %ebx
801011f0: 56 push %esi
801011f1: e8 2a 24 00 00 call 80103620 <pipeclose>
801011f6: 83 c4 10 add $0x10,%esp
801011f9: eb df jmp 801011da <fileclose+0x7a>
801011fb: 90 nop
801011fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
else if(ff.type == FD_INODE){
begin_op();
80101200: e8 7b 1c 00 00 call 80102e80 <begin_op>
iput(ff.ip);
80101205: 83 ec 0c sub $0xc,%esp
80101208: ff 75 e0 pushl -0x20(%ebp)
8010120b: e8 c0 08 00 00 call 80101ad0 <iput>
end_op();
80101210: 83 c4 10 add $0x10,%esp
}
}
80101213: 8d 65 f4 lea -0xc(%ebp),%esp
80101216: 5b pop %ebx
80101217: 5e pop %esi
80101218: 5f pop %edi
80101219: 5d pop %ebp
if(ff.type == FD_PIPE)
pipeclose(ff.pipe, ff.writable);
else if(ff.type == FD_INODE){
begin_op();
iput(ff.ip);
end_op();
8010121a: e9 d1 1c 00 00 jmp 80102ef0 <end_op>
{
struct file ff;
acquire(&ftable.lock);
if(f->ref < 1)
panic("fileclose");
8010121f: 83 ec 0c sub $0xc,%esp
80101222: 68 3c 77 10 80 push $0x8010773c
80101227: e8 44 f1 ff ff call 80100370 <panic>
8010122c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80101230 <filestat>:
}
// Get metadata about file f.
int
filestat(struct file *f, struct stat *st)
{
80101230: 55 push %ebp
80101231: 89 e5 mov %esp,%ebp
80101233: 53 push %ebx
80101234: 83 ec 04 sub $0x4,%esp
80101237: 8b 5d 08 mov 0x8(%ebp),%ebx
if(f->type == FD_INODE){
8010123a: 83 3b 02 cmpl $0x2,(%ebx)
8010123d: 75 31 jne 80101270 <filestat+0x40>
ilock(f->ip);
8010123f: 83 ec 0c sub $0xc,%esp
80101242: ff 73 10 pushl 0x10(%ebx)
80101245: e8 56 07 00 00 call 801019a0 <ilock>
stati(f->ip, st);
8010124a: 58 pop %eax
8010124b: 5a pop %edx
8010124c: ff 75 0c pushl 0xc(%ebp)
8010124f: ff 73 10 pushl 0x10(%ebx)
80101252: e8 f9 09 00 00 call 80101c50 <stati>
iunlock(f->ip);
80101257: 59 pop %ecx
80101258: ff 73 10 pushl 0x10(%ebx)
8010125b: e8 20 08 00 00 call 80101a80 <iunlock>
return 0;
80101260: 83 c4 10 add $0x10,%esp
80101263: 31 c0 xor %eax,%eax
}
return -1;
}
80101265: 8b 5d fc mov -0x4(%ebp),%ebx
80101268: c9 leave
80101269: c3 ret
8010126a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
ilock(f->ip);
stati(f->ip, st);
iunlock(f->ip);
return 0;
}
return -1;
80101270: b8 ff ff ff ff mov $0xffffffff,%eax
}
80101275: 8b 5d fc mov -0x4(%ebp),%ebx
80101278: c9 leave
80101279: c3 ret
8010127a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80101280 <fileread>:
// Read from file f.
int
fileread(struct file *f, char *addr, int n)
{
80101280: 55 push %ebp
80101281: 89 e5 mov %esp,%ebp
80101283: 57 push %edi
80101284: 56 push %esi
80101285: 53 push %ebx
80101286: 83 ec 0c sub $0xc,%esp
80101289: 8b 5d 08 mov 0x8(%ebp),%ebx
8010128c: 8b 75 0c mov 0xc(%ebp),%esi
8010128f: 8b 7d 10 mov 0x10(%ebp),%edi
int r;
if(f->readable == 0)
80101292: 80 7b 08 00 cmpb $0x0,0x8(%ebx)
80101296: 74 60 je 801012f8 <fileread+0x78>
return -1;
if(f->type == FD_PIPE)
80101298: 8b 03 mov (%ebx),%eax
8010129a: 83 f8 01 cmp $0x1,%eax
8010129d: 74 41 je 801012e0 <fileread+0x60>
return piperead(f->pipe, addr, n);
if(f->type == FD_INODE){
8010129f: 83 f8 02 cmp $0x2,%eax
801012a2: 75 5b jne 801012ff <fileread+0x7f>
ilock(f->ip);
801012a4: 83 ec 0c sub $0xc,%esp
801012a7: ff 73 10 pushl 0x10(%ebx)
801012aa: e8 f1 06 00 00 call 801019a0 <ilock>
if((r = readi(f->ip, addr, f->off, n)) > 0)
801012af: 57 push %edi
801012b0: ff 73 14 pushl 0x14(%ebx)
801012b3: 56 push %esi
801012b4: ff 73 10 pushl 0x10(%ebx)
801012b7: e8 c4 09 00 00 call 80101c80 <readi>
801012bc: 83 c4 20 add $0x20,%esp
801012bf: 85 c0 test %eax,%eax
801012c1: 89 c6 mov %eax,%esi
801012c3: 7e 03 jle 801012c8 <fileread+0x48>
f->off += r;
801012c5: 01 43 14 add %eax,0x14(%ebx)
iunlock(f->ip);
801012c8: 83 ec 0c sub $0xc,%esp
801012cb: ff 73 10 pushl 0x10(%ebx)
801012ce: e8 ad 07 00 00 call 80101a80 <iunlock>
return r;
801012d3: 83 c4 10 add $0x10,%esp
return -1;
if(f->type == FD_PIPE)
return piperead(f->pipe, addr, n);
if(f->type == FD_INODE){
ilock(f->ip);
if((r = readi(f->ip, addr, f->off, n)) > 0)
801012d6: 89 f0 mov %esi,%eax
f->off += r;
iunlock(f->ip);
return r;
}
panic("fileread");
}
801012d8: 8d 65 f4 lea -0xc(%ebp),%esp
801012db: 5b pop %ebx
801012dc: 5e pop %esi
801012dd: 5f pop %edi
801012de: 5d pop %ebp
801012df: c3 ret
int r;
if(f->readable == 0)
return -1;
if(f->type == FD_PIPE)
return piperead(f->pipe, addr, n);
801012e0: 8b 43 0c mov 0xc(%ebx),%eax
801012e3: 89 45 08 mov %eax,0x8(%ebp)
f->off += r;
iunlock(f->ip);
return r;
}
panic("fileread");
}
801012e6: 8d 65 f4 lea -0xc(%ebp),%esp
801012e9: 5b pop %ebx
801012ea: 5e pop %esi
801012eb: 5f pop %edi
801012ec: 5d pop %ebp
int r;
if(f->readable == 0)
return -1;
if(f->type == FD_PIPE)
return piperead(f->pipe, addr, n);
801012ed: e9 ce 24 00 00 jmp 801037c0 <piperead>
801012f2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
fileread(struct file *f, char *addr, int n)
{
int r;
if(f->readable == 0)
return -1;
801012f8: b8 ff ff ff ff mov $0xffffffff,%eax
801012fd: eb d9 jmp 801012d8 <fileread+0x58>
if((r = readi(f->ip, addr, f->off, n)) > 0)
f->off += r;
iunlock(f->ip);
return r;
}
panic("fileread");
801012ff: 83 ec 0c sub $0xc,%esp
80101302: 68 46 77 10 80 push $0x80107746
80101307: e8 64 f0 ff ff call 80100370 <panic>
8010130c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80101310 <filewrite>:
//PAGEBREAK!
// Write to file f.
int
filewrite(struct file *f, char *addr, int n)
{
80101310: 55 push %ebp
80101311: 89 e5 mov %esp,%ebp
80101313: 57 push %edi
80101314: 56 push %esi
80101315: 53 push %ebx
80101316: 83 ec 1c sub $0x1c,%esp
80101319: 8b 75 08 mov 0x8(%ebp),%esi
8010131c: 8b 45 0c mov 0xc(%ebp),%eax
int r;
if(f->writable == 0)
8010131f: 80 7e 09 00 cmpb $0x0,0x9(%esi)
//PAGEBREAK!
// Write to file f.
int
filewrite(struct file *f, char *addr, int n)
{
80101323: 89 45 dc mov %eax,-0x24(%ebp)
80101326: 8b 45 10 mov 0x10(%ebp),%eax
80101329: 89 45 e4 mov %eax,-0x1c(%ebp)
int r;
if(f->writable == 0)
8010132c: 0f 84 aa 00 00 00 je 801013dc <filewrite+0xcc>
return -1;
if(f->type == FD_PIPE)
80101332: 8b 06 mov (%esi),%eax
80101334: 83 f8 01 cmp $0x1,%eax
80101337: 0f 84 c2 00 00 00 je 801013ff <filewrite+0xef>
return pipewrite(f->pipe, addr, n);
if(f->type == FD_INODE){
8010133d: 83 f8 02 cmp $0x2,%eax
80101340: 0f 85 d8 00 00 00 jne 8010141e <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){
80101346: 8b 45 e4 mov -0x1c(%ebp),%eax
80101349: 31 ff xor %edi,%edi
8010134b: 85 c0 test %eax,%eax
8010134d: 7f 34 jg 80101383 <filewrite+0x73>
8010134f: e9 9c 00 00 00 jmp 801013f0 <filewrite+0xe0>
80101354: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
n1 = max;
begin_op();
ilock(f->ip);
if ((r = writei(f->ip, addr + i, f->off, n1)) > 0)
f->off += r;
80101358: 01 46 14 add %eax,0x14(%esi)
iunlock(f->ip);
8010135b: 83 ec 0c sub $0xc,%esp
8010135e: ff 76 10 pushl 0x10(%esi)
n1 = max;
begin_op();
ilock(f->ip);
if ((r = writei(f->ip, addr + i, f->off, n1)) > 0)
f->off += r;
80101361: 89 45 e0 mov %eax,-0x20(%ebp)
iunlock(f->ip);
80101364: e8 17 07 00 00 call 80101a80 <iunlock>
end_op();
80101369: e8 82 1b 00 00 call 80102ef0 <end_op>
8010136e: 8b 45 e0 mov -0x20(%ebp),%eax
80101371: 83 c4 10 add $0x10,%esp
if(r < 0)
break;
if(r != n1)
80101374: 39 d8 cmp %ebx,%eax
80101376: 0f 85 95 00 00 00 jne 80101411 <filewrite+0x101>
panic("short filewrite");
i += r;
8010137c: 01 c7 add %eax,%edi
// 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){
8010137e: 39 7d e4 cmp %edi,-0x1c(%ebp)
80101381: 7e 6d jle 801013f0 <filewrite+0xe0>
int n1 = n - i;
80101383: 8b 5d e4 mov -0x1c(%ebp),%ebx
80101386: b8 00 06 00 00 mov $0x600,%eax
8010138b: 29 fb sub %edi,%ebx
8010138d: 81 fb 00 06 00 00 cmp $0x600,%ebx
80101393: 0f 4f d8 cmovg %eax,%ebx
if(n1 > max)
n1 = max;
begin_op();
80101396: e8 e5 1a 00 00 call 80102e80 <begin_op>
ilock(f->ip);
8010139b: 83 ec 0c sub $0xc,%esp
8010139e: ff 76 10 pushl 0x10(%esi)
801013a1: e8 fa 05 00 00 call 801019a0 <ilock>
if ((r = writei(f->ip, addr + i, f->off, n1)) > 0)
801013a6: 8b 45 dc mov -0x24(%ebp),%eax
801013a9: 53 push %ebx
801013aa: ff 76 14 pushl 0x14(%esi)
801013ad: 01 f8 add %edi,%eax
801013af: 50 push %eax
801013b0: ff 76 10 pushl 0x10(%esi)
801013b3: e8 c8 09 00 00 call 80101d80 <writei>
801013b8: 83 c4 20 add $0x20,%esp
801013bb: 85 c0 test %eax,%eax
801013bd: 7f 99 jg 80101358 <filewrite+0x48>
f->off += r;
iunlock(f->ip);
801013bf: 83 ec 0c sub $0xc,%esp
801013c2: ff 76 10 pushl 0x10(%esi)
801013c5: 89 45 e0 mov %eax,-0x20(%ebp)
801013c8: e8 b3 06 00 00 call 80101a80 <iunlock>
end_op();
801013cd: e8 1e 1b 00 00 call 80102ef0 <end_op>
if(r < 0)
801013d2: 8b 45 e0 mov -0x20(%ebp),%eax
801013d5: 83 c4 10 add $0x10,%esp
801013d8: 85 c0 test %eax,%eax
801013da: 74 98 je 80101374 <filewrite+0x64>
i += r;
}
return i == n ? n : -1;
}
panic("filewrite");
}
801013dc: 8d 65 f4 lea -0xc(%ebp),%esp
break;
if(r != n1)
panic("short filewrite");
i += r;
}
return i == n ? n : -1;
801013df: b8 ff ff ff ff mov $0xffffffff,%eax
}
panic("filewrite");
}
801013e4: 5b pop %ebx
801013e5: 5e pop %esi
801013e6: 5f pop %edi
801013e7: 5d pop %ebp
801013e8: c3 ret
801013e9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
break;
if(r != n1)
panic("short filewrite");
i += r;
}
return i == n ? n : -1;
801013f0: 3b 7d e4 cmp -0x1c(%ebp),%edi
801013f3: 75 e7 jne 801013dc <filewrite+0xcc>
}
panic("filewrite");
}
801013f5: 8d 65 f4 lea -0xc(%ebp),%esp
801013f8: 89 f8 mov %edi,%eax
801013fa: 5b pop %ebx
801013fb: 5e pop %esi
801013fc: 5f pop %edi
801013fd: 5d pop %ebp
801013fe: c3 ret
int r;
if(f->writable == 0)
return -1;
if(f->type == FD_PIPE)
return pipewrite(f->pipe, addr, n);
801013ff: 8b 46 0c mov 0xc(%esi),%eax
80101402: 89 45 08 mov %eax,0x8(%ebp)
i += r;
}
return i == n ? n : -1;
}
panic("filewrite");
}
80101405: 8d 65 f4 lea -0xc(%ebp),%esp
80101408: 5b pop %ebx
80101409: 5e pop %esi
8010140a: 5f pop %edi
8010140b: 5d pop %ebp
int r;
if(f->writable == 0)
return -1;
if(f->type == FD_PIPE)
return pipewrite(f->pipe, addr, n);
8010140c: e9 af 22 00 00 jmp 801036c0 <pipewrite>
end_op();
if(r < 0)
break;
if(r != n1)
panic("short filewrite");
80101411: 83 ec 0c sub $0xc,%esp
80101414: 68 4f 77 10 80 push $0x8010774f
80101419: e8 52 ef ff ff call 80100370 <panic>
i += r;
}
return i == n ? n : -1;
}
panic("filewrite");
8010141e: 83 ec 0c sub $0xc,%esp
80101421: 68 55 77 10 80 push $0x80107755
80101426: e8 45 ef ff ff call 80100370 <panic>
8010142b: 66 90 xchg %ax,%ax
8010142d: 66 90 xchg %ax,%ax
8010142f: 90 nop
80101430 <balloc>:
// Blocks.
// Allocate a zeroed disk block.
static uint
balloc(uint dev)
{
80101430: 55 push %ebp
80101431: 89 e5 mov %esp,%ebp
80101433: 57 push %edi
80101434: 56 push %esi
80101435: 53 push %ebx
80101436: 83 ec 1c sub $0x1c,%esp
int b, bi, m;
struct buf *bp;
bp = 0;
for(b = 0; b < sb.size; b += BPB){
80101439: 8b 0d 80 1c 11 80 mov 0x80111c80,%ecx
// Blocks.
// Allocate a zeroed disk block.
static uint
balloc(uint dev)
{
8010143f: 89 45 d8 mov %eax,-0x28(%ebp)
int b, bi, m;
struct buf *bp;
bp = 0;
for(b = 0; b < sb.size; b += BPB){
80101442: 85 c9 test %ecx,%ecx
80101444: 0f 84 85 00 00 00 je 801014cf <balloc+0x9f>
8010144a: c7 45 dc 00 00 00 00 movl $0x0,-0x24(%ebp)
bp = bread(dev, BBLOCK(b, sb));
80101451: 8b 75 dc mov -0x24(%ebp),%esi
80101454: 83 ec 08 sub $0x8,%esp
80101457: 89 f0 mov %esi,%eax
80101459: c1 f8 0c sar $0xc,%eax
8010145c: 03 05 98 1c 11 80 add 0x80111c98,%eax
80101462: 50 push %eax
80101463: ff 75 d8 pushl -0x28(%ebp)
80101466: e8 65 ec ff ff call 801000d0 <bread>
8010146b: 89 45 e4 mov %eax,-0x1c(%ebp)
8010146e: a1 80 1c 11 80 mov 0x80111c80,%eax
80101473: 83 c4 10 add $0x10,%esp
80101476: 89 45 e0 mov %eax,-0x20(%ebp)
for(bi = 0; bi < BPB && b + bi < sb.size; bi++){
80101479: 31 c0 xor %eax,%eax
8010147b: eb 2d jmp 801014aa <balloc+0x7a>
8010147d: 8d 76 00 lea 0x0(%esi),%esi
m = 1 << (bi % 8);
80101480: 89 c1 mov %eax,%ecx
80101482: ba 01 00 00 00 mov $0x1,%edx
if((bp->data[bi/8] & m) == 0){ // Is block free?
80101487: 8b 5d e4 mov -0x1c(%ebp),%ebx
bp = 0;
for(b = 0; b < sb.size; b += BPB){
bp = bread(dev, BBLOCK(b, sb));
for(bi = 0; bi < BPB && b + bi < sb.size; bi++){
m = 1 << (bi % 8);
8010148a: 83 e1 07 and $0x7,%ecx
8010148d: d3 e2 shl %cl,%edx
if((bp->data[bi/8] & m) == 0){ // Is block free?
8010148f: 89 c1 mov %eax,%ecx
80101491: c1 f9 03 sar $0x3,%ecx
80101494: 0f b6 7c 0b 5c movzbl 0x5c(%ebx,%ecx,1),%edi
80101499: 85 d7 test %edx,%edi
8010149b: 74 43 je 801014e0 <balloc+0xb0>
struct buf *bp;
bp = 0;
for(b = 0; b < sb.size; b += BPB){
bp = bread(dev, BBLOCK(b, sb));
for(bi = 0; bi < BPB && b + bi < sb.size; bi++){
8010149d: 83 c0 01 add $0x1,%eax
801014a0: 83 c6 01 add $0x1,%esi
801014a3: 3d 00 10 00 00 cmp $0x1000,%eax
801014a8: 74 05 je 801014af <balloc+0x7f>
801014aa: 3b 75 e0 cmp -0x20(%ebp),%esi
801014ad: 72 d1 jb 80101480 <balloc+0x50>
brelse(bp);
bzero(dev, b + bi);
return b + bi;
}
}
brelse(bp);
801014af: 83 ec 0c sub $0xc,%esp
801014b2: ff 75 e4 pushl -0x1c(%ebp)
801014b5: e8 26 ed ff ff call 801001e0 <brelse>
{
int b, bi, m;
struct buf *bp;
bp = 0;
for(b = 0; b < sb.size; b += BPB){
801014ba: 81 45 dc 00 10 00 00 addl $0x1000,-0x24(%ebp)
801014c1: 83 c4 10 add $0x10,%esp
801014c4: 8b 45 dc mov -0x24(%ebp),%eax
801014c7: 39 05 80 1c 11 80 cmp %eax,0x80111c80
801014cd: 77 82 ja 80101451 <balloc+0x21>
return b + bi;
}
}
brelse(bp);
}
panic("balloc: out of blocks");
801014cf: 83 ec 0c sub $0xc,%esp
801014d2: 68 5f 77 10 80 push $0x8010775f
801014d7: e8 94 ee ff ff call 80100370 <panic>
801014dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
for(b = 0; b < sb.size; b += BPB){
bp = bread(dev, BBLOCK(b, sb));
for(bi = 0; bi < BPB && b + bi < sb.size; bi++){
m = 1 << (bi % 8);
if((bp->data[bi/8] & m) == 0){ // Is block free?
bp->data[bi/8] |= m; // Mark block in use.
801014e0: 09 fa or %edi,%edx
801014e2: 8b 7d e4 mov -0x1c(%ebp),%edi
log_write(bp);
801014e5: 83 ec 0c sub $0xc,%esp
for(b = 0; b < sb.size; b += BPB){
bp = bread(dev, BBLOCK(b, sb));
for(bi = 0; bi < BPB && b + bi < sb.size; bi++){
m = 1 << (bi % 8);
if((bp->data[bi/8] & m) == 0){ // Is block free?
bp->data[bi/8] |= m; // Mark block in use.
801014e8: 88 54 0f 5c mov %dl,0x5c(%edi,%ecx,1)
log_write(bp);
801014ec: 57 push %edi
801014ed: e8 6e 1b 00 00 call 80103060 <log_write>
brelse(bp);
801014f2: 89 3c 24 mov %edi,(%esp)
801014f5: e8 e6 ec ff ff call 801001e0 <brelse>
static void
bzero(int dev, int bno)
{
struct buf *bp;
bp = bread(dev, bno);
801014fa: 58 pop %eax
801014fb: 5a pop %edx
801014fc: 56 push %esi
801014fd: ff 75 d8 pushl -0x28(%ebp)
80101500: e8 cb eb ff ff call 801000d0 <bread>
80101505: 89 c3 mov %eax,%ebx
memset(bp->data, 0, BSIZE);
80101507: 8d 40 5c lea 0x5c(%eax),%eax
8010150a: 83 c4 0c add $0xc,%esp
8010150d: 68 00 02 00 00 push $0x200
80101512: 6a 00 push $0x0
80101514: 50 push %eax
80101515: e8 06 36 00 00 call 80104b20 <memset>
log_write(bp);
8010151a: 89 1c 24 mov %ebx,(%esp)
8010151d: e8 3e 1b 00 00 call 80103060 <log_write>
brelse(bp);
80101522: 89 1c 24 mov %ebx,(%esp)
80101525: e8 b6 ec ff ff call 801001e0 <brelse>
}
}
brelse(bp);
}
panic("balloc: out of blocks");
}
8010152a: 8d 65 f4 lea -0xc(%ebp),%esp
8010152d: 89 f0 mov %esi,%eax
8010152f: 5b pop %ebx
80101530: 5e pop %esi
80101531: 5f pop %edi
80101532: 5d pop %ebp
80101533: c3 ret
80101534: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
8010153a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
80101540 <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)
{
80101540: 55 push %ebp
80101541: 89 e5 mov %esp,%ebp
80101543: 57 push %edi
80101544: 56 push %esi
80101545: 53 push %ebx
80101546: 89 c7 mov %eax,%edi
struct inode *ip, *empty;
acquire(&icache.lock);
// Is the inode already cached?
empty = 0;
80101548: 31 f6 xor %esi,%esi
for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){
8010154a: bb d4 1c 11 80 mov $0x80111cd4,%ebx
// 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)
{
8010154f: 83 ec 28 sub $0x28,%esp
80101552: 89 55 e4 mov %edx,-0x1c(%ebp)
struct inode *ip, *empty;
acquire(&icache.lock);
80101555: 68 a0 1c 11 80 push $0x80111ca0
8010155a: e8 c1 34 00 00 call 80104a20 <acquire>
8010155f: 83 c4 10 add $0x10,%esp
// Is the inode already cached?
empty = 0;
for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){
80101562: 8b 55 e4 mov -0x1c(%ebp),%edx
80101565: eb 1b jmp 80101582 <iget+0x42>
80101567: 89 f6 mov %esi,%esi
80101569: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){
ip->ref++;
release(&icache.lock);
return ip;
}
if(empty == 0 && ip->ref == 0) // Remember empty slot.
80101570: 85 f6 test %esi,%esi
80101572: 74 44 je 801015b8 <iget+0x78>
acquire(&icache.lock);
// Is the inode already cached?
empty = 0;
for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){
80101574: 81 c3 90 00 00 00 add $0x90,%ebx
8010157a: 81 fb f4 38 11 80 cmp $0x801138f4,%ebx
80101580: 74 4e je 801015d0 <iget+0x90>
if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){
80101582: 8b 4b 08 mov 0x8(%ebx),%ecx
80101585: 85 c9 test %ecx,%ecx
80101587: 7e e7 jle 80101570 <iget+0x30>
80101589: 39 3b cmp %edi,(%ebx)
8010158b: 75 e3 jne 80101570 <iget+0x30>
8010158d: 39 53 04 cmp %edx,0x4(%ebx)
80101590: 75 de jne 80101570 <iget+0x30>
ip->ref++;
release(&icache.lock);
80101592: 83 ec 0c sub $0xc,%esp
// Is the inode already cached?
empty = 0;
for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){
if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){
ip->ref++;
80101595: 83 c1 01 add $0x1,%ecx
release(&icache.lock);
return ip;
80101598: 89 de mov %ebx,%esi
// Is the inode already cached?
empty = 0;
for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){
if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){
ip->ref++;
release(&icache.lock);
8010159a: 68 a0 1c 11 80 push $0x80111ca0
// Is the inode already cached?
empty = 0;
for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){
if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){
ip->ref++;
8010159f: 89 4b 08 mov %ecx,0x8(%ebx)
release(&icache.lock);
801015a2: e8 29 35 00 00 call 80104ad0 <release>
return ip;
801015a7: 83 c4 10 add $0x10,%esp
ip->ref = 1;
ip->valid = 0;
release(&icache.lock);
return ip;
}
801015aa: 8d 65 f4 lea -0xc(%ebp),%esp
801015ad: 89 f0 mov %esi,%eax
801015af: 5b pop %ebx
801015b0: 5e pop %esi
801015b1: 5f pop %edi
801015b2: 5d pop %ebp
801015b3: c3 ret
801015b4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){
ip->ref++;
release(&icache.lock);
return ip;
}
if(empty == 0 && ip->ref == 0) // Remember empty slot.
801015b8: 85 c9 test %ecx,%ecx
801015ba: 0f 44 f3 cmove %ebx,%esi
acquire(&icache.lock);
// Is the inode already cached?
empty = 0;
for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){
801015bd: 81 c3 90 00 00 00 add $0x90,%ebx
801015c3: 81 fb f4 38 11 80 cmp $0x801138f4,%ebx
801015c9: 75 b7 jne 80101582 <iget+0x42>
801015cb: 90 nop
801015cc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
if(empty == 0 && ip->ref == 0) // Remember empty slot.
empty = ip;
}
// Recycle an inode cache entry.
if(empty == 0)
801015d0: 85 f6 test %esi,%esi
801015d2: 74 2d je 80101601 <iget+0xc1>
ip = empty;
ip->dev = dev;
ip->inum = inum;
ip->ref = 1;
ip->valid = 0;
release(&icache.lock);
801015d4: 83 ec 0c sub $0xc,%esp
// Recycle an inode cache entry.
if(empty == 0)
panic("iget: no inodes");
ip = empty;
ip->dev = dev;
801015d7: 89 3e mov %edi,(%esi)
ip->inum = inum;
801015d9: 89 56 04 mov %edx,0x4(%esi)
ip->ref = 1;
801015dc: c7 46 08 01 00 00 00 movl $0x1,0x8(%esi)
ip->valid = 0;
801015e3: c7 46 4c 00 00 00 00 movl $0x0,0x4c(%esi)
release(&icache.lock);
801015ea: 68 a0 1c 11 80 push $0x80111ca0
801015ef: e8 dc 34 00 00 call 80104ad0 <release>
return ip;
801015f4: 83 c4 10 add $0x10,%esp
}
801015f7: 8d 65 f4 lea -0xc(%ebp),%esp
801015fa: 89 f0 mov %esi,%eax
801015fc: 5b pop %ebx
801015fd: 5e pop %esi
801015fe: 5f pop %edi
801015ff: 5d pop %ebp
80101600: c3 ret
empty = ip;
}
// Recycle an inode cache entry.
if(empty == 0)
panic("iget: no inodes");
80101601: 83 ec 0c sub $0xc,%esp
80101604: 68 75 77 10 80 push $0x80107775
80101609: e8 62 ed ff ff call 80100370 <panic>
8010160e: 66 90 xchg %ax,%ax
80101610 <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)
{
80101610: 55 push %ebp
80101611: 89 e5 mov %esp,%ebp
80101613: 57 push %edi
80101614: 56 push %esi
80101615: 53 push %ebx
80101616: 89 c6 mov %eax,%esi
80101618: 83 ec 1c sub $0x1c,%esp
uint addr, *a;
struct buf *bp;
if(bn < NDIRECT){
8010161b: 83 fa 0b cmp $0xb,%edx
8010161e: 77 18 ja 80101638 <bmap+0x28>
80101620: 8d 1c 90 lea (%eax,%edx,4),%ebx
if((addr = ip->addrs[bn]) == 0)
80101623: 8b 43 5c mov 0x5c(%ebx),%eax
80101626: 85 c0 test %eax,%eax
80101628: 74 76 je 801016a0 <bmap+0x90>
brelse(bp);
return addr;
}
panic("bmap: out of range");
}
8010162a: 8d 65 f4 lea -0xc(%ebp),%esp
8010162d: 5b pop %ebx
8010162e: 5e pop %esi
8010162f: 5f pop %edi
80101630: 5d pop %ebp
80101631: c3 ret
80101632: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
if(bn < NDIRECT){
if((addr = ip->addrs[bn]) == 0)
ip->addrs[bn] = addr = balloc(ip->dev);
return addr;
}
bn -= NDIRECT;
80101638: 8d 5a f4 lea -0xc(%edx),%ebx
if(bn < NINDIRECT){
8010163b: 83 fb 7f cmp $0x7f,%ebx
8010163e: 0f 87 83 00 00 00 ja 801016c7 <bmap+0xb7>
// Load indirect block, allocating if necessary.
if((addr = ip->addrs[NDIRECT]) == 0)
80101644: 8b 80 8c 00 00 00 mov 0x8c(%eax),%eax
8010164a: 85 c0 test %eax,%eax
8010164c: 74 6a je 801016b8 <bmap+0xa8>
ip->addrs[NDIRECT] = addr = balloc(ip->dev);
bp = bread(ip->dev, addr);
8010164e: 83 ec 08 sub $0x8,%esp
80101651: 50 push %eax
80101652: ff 36 pushl (%esi)
80101654: e8 77 ea ff ff call 801000d0 <bread>
a = (uint*)bp->data;
if((addr = a[bn]) == 0){
80101659: 8d 54 98 5c lea 0x5c(%eax,%ebx,4),%edx
8010165d: 83 c4 10 add $0x10,%esp
if(bn < NINDIRECT){
// Load indirect block, allocating if necessary.
if((addr = ip->addrs[NDIRECT]) == 0)
ip->addrs[NDIRECT] = addr = balloc(ip->dev);
bp = bread(ip->dev, addr);
80101660: 89 c7 mov %eax,%edi
a = (uint*)bp->data;
if((addr = a[bn]) == 0){
80101662: 8b 1a mov (%edx),%ebx
80101664: 85 db test %ebx,%ebx
80101666: 75 1d jne 80101685 <bmap+0x75>
a[bn] = addr = balloc(ip->dev);
80101668: 8b 06 mov (%esi),%eax
8010166a: 89 55 e4 mov %edx,-0x1c(%ebp)
8010166d: e8 be fd ff ff call 80101430 <balloc>
80101672: 8b 55 e4 mov -0x1c(%ebp),%edx
log_write(bp);
80101675: 83 ec 0c sub $0xc,%esp
if((addr = ip->addrs[NDIRECT]) == 0)
ip->addrs[NDIRECT] = addr = balloc(ip->dev);
bp = bread(ip->dev, addr);
a = (uint*)bp->data;
if((addr = a[bn]) == 0){
a[bn] = addr = balloc(ip->dev);
80101678: 89 c3 mov %eax,%ebx
8010167a: 89 02 mov %eax,(%edx)
log_write(bp);
8010167c: 57 push %edi
8010167d: e8 de 19 00 00 call 80103060 <log_write>
80101682: 83 c4 10 add $0x10,%esp
}
brelse(bp);
80101685: 83 ec 0c sub $0xc,%esp
80101688: 57 push %edi
80101689: e8 52 eb ff ff call 801001e0 <brelse>
8010168e: 83 c4 10 add $0x10,%esp
return addr;
}
panic("bmap: out of range");
}
80101691: 8d 65 f4 lea -0xc(%ebp),%esp
a = (uint*)bp->data;
if((addr = a[bn]) == 0){
a[bn] = addr = balloc(ip->dev);
log_write(bp);
}
brelse(bp);
80101694: 89 d8 mov %ebx,%eax
return addr;
}
panic("bmap: out of range");
}
80101696: 5b pop %ebx
80101697: 5e pop %esi
80101698: 5f pop %edi
80101699: 5d pop %ebp
8010169a: c3 ret
8010169b: 90 nop
8010169c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
uint addr, *a;
struct buf *bp;
if(bn < NDIRECT){
if((addr = ip->addrs[bn]) == 0)
ip->addrs[bn] = addr = balloc(ip->dev);
801016a0: 8b 06 mov (%esi),%eax
801016a2: e8 89 fd ff ff call 80101430 <balloc>
801016a7: 89 43 5c mov %eax,0x5c(%ebx)
brelse(bp);
return addr;
}
panic("bmap: out of range");
}
801016aa: 8d 65 f4 lea -0xc(%ebp),%esp
801016ad: 5b pop %ebx
801016ae: 5e pop %esi
801016af: 5f pop %edi
801016b0: 5d pop %ebp
801016b1: c3 ret
801016b2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
bn -= NDIRECT;
if(bn < NINDIRECT){
// Load indirect block, allocating if necessary.
if((addr = ip->addrs[NDIRECT]) == 0)
ip->addrs[NDIRECT] = addr = balloc(ip->dev);
801016b8: 8b 06 mov (%esi),%eax
801016ba: e8 71 fd ff ff call 80101430 <balloc>
801016bf: 89 86 8c 00 00 00 mov %eax,0x8c(%esi)
801016c5: eb 87 jmp 8010164e <bmap+0x3e>
}
brelse(bp);
return addr;
}
panic("bmap: out of range");
801016c7: 83 ec 0c sub $0xc,%esp
801016ca: 68 85 77 10 80 push $0x80107785
801016cf: e8 9c ec ff ff call 80100370 <panic>
801016d4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801016da: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
801016e0 <readsb>:
struct superblock sb;
// Read the super block.
void
readsb(int dev, struct superblock *sb)
{
801016e0: 55 push %ebp
801016e1: 89 e5 mov %esp,%ebp
801016e3: 56 push %esi
801016e4: 53 push %ebx
801016e5: 8b 75 0c mov 0xc(%ebp),%esi
struct buf *bp;
bp = bread(dev, 1);
801016e8: 83 ec 08 sub $0x8,%esp
801016eb: 6a 01 push $0x1
801016ed: ff 75 08 pushl 0x8(%ebp)
801016f0: e8 db e9 ff ff call 801000d0 <bread>
801016f5: 89 c3 mov %eax,%ebx
memmove(sb, bp->data, sizeof(*sb));
801016f7: 8d 40 5c lea 0x5c(%eax),%eax
801016fa: 83 c4 0c add $0xc,%esp
801016fd: 6a 1c push $0x1c
801016ff: 50 push %eax
80101700: 56 push %esi
80101701: e8 ca 34 00 00 call 80104bd0 <memmove>
brelse(bp);
80101706: 89 5d 08 mov %ebx,0x8(%ebp)
80101709: 83 c4 10 add $0x10,%esp
}
8010170c: 8d 65 f8 lea -0x8(%ebp),%esp
8010170f: 5b pop %ebx
80101710: 5e pop %esi
80101711: 5d pop %ebp
{
struct buf *bp;
bp = bread(dev, 1);
memmove(sb, bp->data, sizeof(*sb));
brelse(bp);
80101712: e9 c9 ea ff ff jmp 801001e0 <brelse>
80101717: 89 f6 mov %esi,%esi
80101719: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80101720 <bfree>:
}
// Free a disk block.
static void
bfree(int dev, uint b)
{
80101720: 55 push %ebp
80101721: 89 e5 mov %esp,%ebp
80101723: 56 push %esi
80101724: 53 push %ebx
80101725: 89 d3 mov %edx,%ebx
80101727: 89 c6 mov %eax,%esi
struct buf *bp;
int bi, m;
readsb(dev, &sb);
80101729: 83 ec 08 sub $0x8,%esp
8010172c: 68 80 1c 11 80 push $0x80111c80
80101731: 50 push %eax
80101732: e8 a9 ff ff ff call 801016e0 <readsb>
bp = bread(dev, BBLOCK(b, sb));
80101737: 58 pop %eax
80101738: 5a pop %edx
80101739: 89 da mov %ebx,%edx
8010173b: c1 ea 0c shr $0xc,%edx
8010173e: 03 15 98 1c 11 80 add 0x80111c98,%edx
80101744: 52 push %edx
80101745: 56 push %esi
80101746: e8 85 e9 ff ff call 801000d0 <bread>
bi = b % BPB;
m = 1 << (bi % 8);
8010174b: 89 d9 mov %ebx,%ecx
if((bp->data[bi/8] & m) == 0)
8010174d: 81 e3 ff 0f 00 00 and $0xfff,%ebx
int bi, m;
readsb(dev, &sb);
bp = bread(dev, BBLOCK(b, sb));
bi = b % BPB;
m = 1 << (bi % 8);
80101753: ba 01 00 00 00 mov $0x1,%edx
80101758: 83 e1 07 and $0x7,%ecx
if((bp->data[bi/8] & m) == 0)
8010175b: c1 fb 03 sar $0x3,%ebx
8010175e: 83 c4 10 add $0x10,%esp
int bi, m;
readsb(dev, &sb);
bp = bread(dev, BBLOCK(b, sb));
bi = b % BPB;
m = 1 << (bi % 8);
80101761: d3 e2 shl %cl,%edx
if((bp->data[bi/8] & m) == 0)
80101763: 0f b6 4c 18 5c movzbl 0x5c(%eax,%ebx,1),%ecx
80101768: 85 d1 test %edx,%ecx
8010176a: 74 27 je 80101793 <bfree+0x73>
8010176c: 89 c6 mov %eax,%esi
panic("freeing free block");
bp->data[bi/8] &= ~m;
8010176e: f7 d2 not %edx
80101770: 89 c8 mov %ecx,%eax
log_write(bp);
80101772: 83 ec 0c sub $0xc,%esp
bp = bread(dev, BBLOCK(b, sb));
bi = b % BPB;
m = 1 << (bi % 8);
if((bp->data[bi/8] & m) == 0)
panic("freeing free block");
bp->data[bi/8] &= ~m;
80101775: 21 d0 and %edx,%eax
80101777: 88 44 1e 5c mov %al,0x5c(%esi,%ebx,1)
log_write(bp);
8010177b: 56 push %esi
8010177c: e8 df 18 00 00 call 80103060 <log_write>
brelse(bp);
80101781: 89 34 24 mov %esi,(%esp)
80101784: e8 57 ea ff ff call 801001e0 <brelse>
}
80101789: 83 c4 10 add $0x10,%esp
8010178c: 8d 65 f8 lea -0x8(%ebp),%esp
8010178f: 5b pop %ebx
80101790: 5e pop %esi
80101791: 5d pop %ebp
80101792: c3 ret
readsb(dev, &sb);
bp = bread(dev, BBLOCK(b, sb));
bi = b % BPB;
m = 1 << (bi % 8);
if((bp->data[bi/8] & m) == 0)
panic("freeing free block");
80101793: 83 ec 0c sub $0xc,%esp
80101796: 68 98 77 10 80 push $0x80107798
8010179b: e8 d0 eb ff ff call 80100370 <panic>
801017a0 <iinit>:
struct inode inode[NINODE];
} icache;
void
iinit(int dev)
{
801017a0: 55 push %ebp
801017a1: 89 e5 mov %esp,%ebp
801017a3: 53 push %ebx
801017a4: bb e0 1c 11 80 mov $0x80111ce0,%ebx
801017a9: 83 ec 0c sub $0xc,%esp
int i = 0;
initlock(&icache.lock, "icache");
801017ac: 68 ab 77 10 80 push $0x801077ab
801017b1: 68 a0 1c 11 80 push $0x80111ca0
801017b6: e8 05 31 00 00 call 801048c0 <initlock>
801017bb: 83 c4 10 add $0x10,%esp
801017be: 66 90 xchg %ax,%ax
for(i = 0; i < NINODE; i++) {
initsleeplock(&icache.inode[i].lock, "inode");
801017c0: 83 ec 08 sub $0x8,%esp
801017c3: 68 b2 77 10 80 push $0x801077b2
801017c8: 53 push %ebx
801017c9: 81 c3 90 00 00 00 add $0x90,%ebx
801017cf: e8 bc 2f 00 00 call 80104790 <initsleeplock>
iinit(int dev)
{
int i = 0;
initlock(&icache.lock, "icache");
for(i = 0; i < NINODE; i++) {
801017d4: 83 c4 10 add $0x10,%esp
801017d7: 81 fb 00 39 11 80 cmp $0x80113900,%ebx
801017dd: 75 e1 jne 801017c0 <iinit+0x20>
initsleeplock(&icache.inode[i].lock, "inode");
}
readsb(dev, &sb);
801017df: 83 ec 08 sub $0x8,%esp
801017e2: 68 80 1c 11 80 push $0x80111c80
801017e7: ff 75 08 pushl 0x8(%ebp)
801017ea: e8 f1 fe ff ff call 801016e0 <readsb>
cprintf("sb: size %d nblocks %d ninodes %d nlog %d logstart %d\
801017ef: ff 35 98 1c 11 80 pushl 0x80111c98
801017f5: ff 35 94 1c 11 80 pushl 0x80111c94
801017fb: ff 35 90 1c 11 80 pushl 0x80111c90
80101801: ff 35 8c 1c 11 80 pushl 0x80111c8c
80101807: ff 35 88 1c 11 80 pushl 0x80111c88
8010180d: ff 35 84 1c 11 80 pushl 0x80111c84
80101813: ff 35 80 1c 11 80 pushl 0x80111c80
80101819: 68 18 78 10 80 push $0x80107818
8010181e: e8 3d ee ff ff call 80100660 <cprintf>
inodestart %d bmap start %d\n", sb.size, sb.nblocks,
sb.ninodes, sb.nlog, sb.logstart, sb.inodestart,
sb.bmapstart);
}
80101823: 83 c4 30 add $0x30,%esp
80101826: 8b 5d fc mov -0x4(%ebp),%ebx
80101829: c9 leave
8010182a: c3 ret
8010182b: 90 nop
8010182c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80101830 <ialloc>:
// Allocate an inode on device dev.
// Mark it as allocated by giving it type type.
// Returns an unlocked but allocated and referenced inode.
struct inode*
ialloc(uint dev, short type)
{
80101830: 55 push %ebp
80101831: 89 e5 mov %esp,%ebp
80101833: 57 push %edi
80101834: 56 push %esi
80101835: 53 push %ebx
80101836: 83 ec 1c sub $0x1c,%esp
int inum;
struct buf *bp;
struct dinode *dip;
for(inum = 1; inum < sb.ninodes; inum++){
80101839: 83 3d 88 1c 11 80 01 cmpl $0x1,0x80111c88
// Allocate an inode on device dev.
// Mark it as allocated by giving it type type.
// Returns an unlocked but allocated and referenced inode.
struct inode*
ialloc(uint dev, short type)
{
80101840: 8b 45 0c mov 0xc(%ebp),%eax
80101843: 8b 75 08 mov 0x8(%ebp),%esi
80101846: 89 45 e4 mov %eax,-0x1c(%ebp)
int inum;
struct buf *bp;
struct dinode *dip;
for(inum = 1; inum < sb.ninodes; inum++){
80101849: 0f 86 91 00 00 00 jbe 801018e0 <ialloc+0xb0>
8010184f: bb 01 00 00 00 mov $0x1,%ebx
80101854: eb 21 jmp 80101877 <ialloc+0x47>
80101856: 8d 76 00 lea 0x0(%esi),%esi
80101859: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
dip->type = type;
log_write(bp); // mark it allocated on the disk
brelse(bp);
return iget(dev, inum);
}
brelse(bp);
80101860: 83 ec 0c sub $0xc,%esp
{
int inum;
struct buf *bp;
struct dinode *dip;
for(inum = 1; inum < sb.ninodes; inum++){
80101863: 83 c3 01 add $0x1,%ebx
dip->type = type;
log_write(bp); // mark it allocated on the disk
brelse(bp);
return iget(dev, inum);
}
brelse(bp);
80101866: 57 push %edi
80101867: e8 74 e9 ff ff call 801001e0 <brelse>
{
int inum;
struct buf *bp;
struct dinode *dip;
for(inum = 1; inum < sb.ninodes; inum++){
8010186c: 83 c4 10 add $0x10,%esp
8010186f: 39 1d 88 1c 11 80 cmp %ebx,0x80111c88
80101875: 76 69 jbe 801018e0 <ialloc+0xb0>
bp = bread(dev, IBLOCK(inum, sb));
80101877: 89 d8 mov %ebx,%eax
80101879: 83 ec 08 sub $0x8,%esp
8010187c: c1 e8 03 shr $0x3,%eax
8010187f: 03 05 94 1c 11 80 add 0x80111c94,%eax
80101885: 50 push %eax
80101886: 56 push %esi
80101887: e8 44 e8 ff ff call 801000d0 <bread>
8010188c: 89 c7 mov %eax,%edi
dip = (struct dinode*)bp->data + inum%IPB;
8010188e: 89 d8 mov %ebx,%eax
if(dip->type == 0){ // a free inode
80101890: 83 c4 10 add $0x10,%esp
struct buf *bp;
struct dinode *dip;
for(inum = 1; inum < sb.ninodes; inum++){
bp = bread(dev, IBLOCK(inum, sb));
dip = (struct dinode*)bp->data + inum%IPB;
80101893: 83 e0 07 and $0x7,%eax
80101896: c1 e0 06 shl $0x6,%eax
80101899: 8d 4c 07 5c lea 0x5c(%edi,%eax,1),%ecx
if(dip->type == 0){ // a free inode
8010189d: 66 83 39 00 cmpw $0x0,(%ecx)
801018a1: 75 bd jne 80101860 <ialloc+0x30>
memset(dip, 0, sizeof(*dip));
801018a3: 83 ec 04 sub $0x4,%esp
801018a6: 89 4d e0 mov %ecx,-0x20(%ebp)
801018a9: 6a 40 push $0x40
801018ab: 6a 00 push $0x0
801018ad: 51 push %ecx
801018ae: e8 6d 32 00 00 call 80104b20 <memset>
dip->type = type;
801018b3: 0f b7 45 e4 movzwl -0x1c(%ebp),%eax
801018b7: 8b 4d e0 mov -0x20(%ebp),%ecx
801018ba: 66 89 01 mov %ax,(%ecx)
log_write(bp); // mark it allocated on the disk
801018bd: 89 3c 24 mov %edi,(%esp)
801018c0: e8 9b 17 00 00 call 80103060 <log_write>
brelse(bp);
801018c5: 89 3c 24 mov %edi,(%esp)
801018c8: e8 13 e9 ff ff call 801001e0 <brelse>
return iget(dev, inum);
801018cd: 83 c4 10 add $0x10,%esp
}
brelse(bp);
}
panic("ialloc: no inodes");
}
801018d0: 8d 65 f4 lea -0xc(%ebp),%esp
if(dip->type == 0){ // a free inode
memset(dip, 0, sizeof(*dip));
dip->type = type;
log_write(bp); // mark it allocated on the disk
brelse(bp);
return iget(dev, inum);
801018d3: 89 da mov %ebx,%edx
801018d5: 89 f0 mov %esi,%eax
}
brelse(bp);
}
panic("ialloc: no inodes");
}
801018d7: 5b pop %ebx
801018d8: 5e pop %esi
801018d9: 5f pop %edi
801018da: 5d pop %ebp
if(dip->type == 0){ // a free inode
memset(dip, 0, sizeof(*dip));
dip->type = type;
log_write(bp); // mark it allocated on the disk
brelse(bp);
return iget(dev, inum);
801018db: e9 60 fc ff ff jmp 80101540 <iget>
}
brelse(bp);
}
panic("ialloc: no inodes");
801018e0: 83 ec 0c sub $0xc,%esp
801018e3: 68 b8 77 10 80 push $0x801077b8
801018e8: e8 83 ea ff ff call 80100370 <panic>
801018ed: 8d 76 00 lea 0x0(%esi),%esi
801018f0 <iupdate>:
// Must be called after every change to an ip->xxx field
// that lives on disk, since i-node cache is write-through.
// Caller must hold ip->lock.
void
iupdate(struct inode *ip)
{
801018f0: 55 push %ebp
801018f1: 89 e5 mov %esp,%ebp
801018f3: 56 push %esi
801018f4: 53 push %ebx
801018f5: 8b 5d 08 mov 0x8(%ebp),%ebx
struct buf *bp;
struct dinode *dip;
bp = bread(ip->dev, IBLOCK(ip->inum, sb));
801018f8: 83 ec 08 sub $0x8,%esp
801018fb: 8b 43 04 mov 0x4(%ebx),%eax
dip->type = ip->type;
dip->major = ip->major;
dip->minor = ip->minor;
dip->nlink = ip->nlink;
dip->size = ip->size;
memmove(dip->addrs, ip->addrs, sizeof(ip->addrs));
801018fe: 83 c3 5c add $0x5c,%ebx
iupdate(struct inode *ip)
{
struct buf *bp;
struct dinode *dip;
bp = bread(ip->dev, IBLOCK(ip->inum, sb));
80101901: c1 e8 03 shr $0x3,%eax
80101904: 03 05 94 1c 11 80 add 0x80111c94,%eax
8010190a: 50 push %eax
8010190b: ff 73 a4 pushl -0x5c(%ebx)
8010190e: e8 bd e7 ff ff call 801000d0 <bread>
80101913: 89 c6 mov %eax,%esi
dip = (struct dinode*)bp->data + ip->inum%IPB;
80101915: 8b 43 a8 mov -0x58(%ebx),%eax
dip->type = ip->type;
80101918: 0f b7 53 f4 movzwl -0xc(%ebx),%edx
dip->major = ip->major;
dip->minor = ip->minor;
dip->nlink = ip->nlink;
dip->size = ip->size;
memmove(dip->addrs, ip->addrs, sizeof(ip->addrs));
8010191c: 83 c4 0c add $0xc,%esp
{
struct buf *bp;
struct dinode *dip;
bp = bread(ip->dev, IBLOCK(ip->inum, sb));
dip = (struct dinode*)bp->data + ip->inum%IPB;
8010191f: 83 e0 07 and $0x7,%eax
80101922: c1 e0 06 shl $0x6,%eax
80101925: 8d 44 06 5c lea 0x5c(%esi,%eax,1),%eax
dip->type = ip->type;
80101929: 66 89 10 mov %dx,(%eax)
dip->major = ip->major;
8010192c: 0f b7 53 f6 movzwl -0xa(%ebx),%edx
dip->minor = ip->minor;
dip->nlink = ip->nlink;
dip->size = ip->size;
memmove(dip->addrs, ip->addrs, sizeof(ip->addrs));
80101930: 83 c0 0c add $0xc,%eax
struct dinode *dip;
bp = bread(ip->dev, IBLOCK(ip->inum, sb));
dip = (struct dinode*)bp->data + ip->inum%IPB;
dip->type = ip->type;
dip->major = ip->major;
80101933: 66 89 50 f6 mov %dx,-0xa(%eax)
dip->minor = ip->minor;
80101937: 0f b7 53 f8 movzwl -0x8(%ebx),%edx
8010193b: 66 89 50 f8 mov %dx,-0x8(%eax)
dip->nlink = ip->nlink;
8010193f: 0f b7 53 fa movzwl -0x6(%ebx),%edx
80101943: 66 89 50 fa mov %dx,-0x6(%eax)
dip->size = ip->size;
80101947: 8b 53 fc mov -0x4(%ebx),%edx
8010194a: 89 50 fc mov %edx,-0x4(%eax)
memmove(dip->addrs, ip->addrs, sizeof(ip->addrs));
8010194d: 6a 34 push $0x34
8010194f: 53 push %ebx
80101950: 50 push %eax
80101951: e8 7a 32 00 00 call 80104bd0 <memmove>
log_write(bp);
80101956: 89 34 24 mov %esi,(%esp)
80101959: e8 02 17 00 00 call 80103060 <log_write>
brelse(bp);
8010195e: 89 75 08 mov %esi,0x8(%ebp)
80101961: 83 c4 10 add $0x10,%esp
}
80101964: 8d 65 f8 lea -0x8(%ebp),%esp
80101967: 5b pop %ebx
80101968: 5e pop %esi
80101969: 5d pop %ebp
dip->minor = ip->minor;
dip->nlink = ip->nlink;
dip->size = ip->size;
memmove(dip->addrs, ip->addrs, sizeof(ip->addrs));
log_write(bp);
brelse(bp);
8010196a: e9 71 e8 ff ff jmp 801001e0 <brelse>
8010196f: 90 nop
80101970 <idup>:
// Increment reference count for ip.
// Returns ip to enable ip = idup(ip1) idiom.
struct inode*
idup(struct inode *ip)
{
80101970: 55 push %ebp
80101971: 89 e5 mov %esp,%ebp
80101973: 53 push %ebx
80101974: 83 ec 10 sub $0x10,%esp
80101977: 8b 5d 08 mov 0x8(%ebp),%ebx
acquire(&icache.lock);
8010197a: 68 a0 1c 11 80 push $0x80111ca0
8010197f: e8 9c 30 00 00 call 80104a20 <acquire>
ip->ref++;
80101984: 83 43 08 01 addl $0x1,0x8(%ebx)
release(&icache.lock);
80101988: c7 04 24 a0 1c 11 80 movl $0x80111ca0,(%esp)
8010198f: e8 3c 31 00 00 call 80104ad0 <release>
return ip;
}
80101994: 89 d8 mov %ebx,%eax
80101996: 8b 5d fc mov -0x4(%ebp),%ebx
80101999: c9 leave
8010199a: c3 ret
8010199b: 90 nop
8010199c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801019a0 <ilock>:
// Lock the given inode.
// Reads the inode from disk if necessary.
void
ilock(struct inode *ip)
{
801019a0: 55 push %ebp
801019a1: 89 e5 mov %esp,%ebp
801019a3: 56 push %esi
801019a4: 53 push %ebx
801019a5: 8b 5d 08 mov 0x8(%ebp),%ebx
struct buf *bp;
struct dinode *dip;
if(ip == 0 || ip->ref < 1)
801019a8: 85 db test %ebx,%ebx
801019aa: 0f 84 b7 00 00 00 je 80101a67 <ilock+0xc7>
801019b0: 8b 53 08 mov 0x8(%ebx),%edx
801019b3: 85 d2 test %edx,%edx
801019b5: 0f 8e ac 00 00 00 jle 80101a67 <ilock+0xc7>
panic("ilock");
acquiresleep(&ip->lock);
801019bb: 8d 43 0c lea 0xc(%ebx),%eax
801019be: 83 ec 0c sub $0xc,%esp
801019c1: 50 push %eax
801019c2: e8 09 2e 00 00 call 801047d0 <acquiresleep>
if(ip->valid == 0){
801019c7: 8b 43 4c mov 0x4c(%ebx),%eax
801019ca: 83 c4 10 add $0x10,%esp
801019cd: 85 c0 test %eax,%eax
801019cf: 74 0f je 801019e0 <ilock+0x40>
brelse(bp);
ip->valid = 1;
if(ip->type == 0)
panic("ilock: no type");
}
}
801019d1: 8d 65 f8 lea -0x8(%ebp),%esp
801019d4: 5b pop %ebx
801019d5: 5e pop %esi
801019d6: 5d pop %ebp
801019d7: c3 ret
801019d8: 90 nop
801019d9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
panic("ilock");
acquiresleep(&ip->lock);
if(ip->valid == 0){
bp = bread(ip->dev, IBLOCK(ip->inum, sb));
801019e0: 8b 43 04 mov 0x4(%ebx),%eax
801019e3: 83 ec 08 sub $0x8,%esp
801019e6: c1 e8 03 shr $0x3,%eax
801019e9: 03 05 94 1c 11 80 add 0x80111c94,%eax
801019ef: 50 push %eax
801019f0: ff 33 pushl (%ebx)
801019f2: e8 d9 e6 ff ff call 801000d0 <bread>
801019f7: 89 c6 mov %eax,%esi
dip = (struct dinode*)bp->data + ip->inum%IPB;
801019f9: 8b 43 04 mov 0x4(%ebx),%eax
ip->type = dip->type;
ip->major = dip->major;
ip->minor = dip->minor;
ip->nlink = dip->nlink;
ip->size = dip->size;
memmove(ip->addrs, dip->addrs, sizeof(ip->addrs));
801019fc: 83 c4 0c add $0xc,%esp
acquiresleep(&ip->lock);
if(ip->valid == 0){
bp = bread(ip->dev, IBLOCK(ip->inum, sb));
dip = (struct dinode*)bp->data + ip->inum%IPB;
801019ff: 83 e0 07 and $0x7,%eax
80101a02: c1 e0 06 shl $0x6,%eax
80101a05: 8d 44 06 5c lea 0x5c(%esi,%eax,1),%eax
ip->type = dip->type;
80101a09: 0f b7 10 movzwl (%eax),%edx
ip->major = dip->major;
ip->minor = dip->minor;
ip->nlink = dip->nlink;
ip->size = dip->size;
memmove(ip->addrs, dip->addrs, sizeof(ip->addrs));
80101a0c: 83 c0 0c add $0xc,%eax
acquiresleep(&ip->lock);
if(ip->valid == 0){
bp = bread(ip->dev, IBLOCK(ip->inum, sb));
dip = (struct dinode*)bp->data + ip->inum%IPB;
ip->type = dip->type;
80101a0f: 66 89 53 50 mov %dx,0x50(%ebx)
ip->major = dip->major;
80101a13: 0f b7 50 f6 movzwl -0xa(%eax),%edx
80101a17: 66 89 53 52 mov %dx,0x52(%ebx)
ip->minor = dip->minor;
80101a1b: 0f b7 50 f8 movzwl -0x8(%eax),%edx
80101a1f: 66 89 53 54 mov %dx,0x54(%ebx)
ip->nlink = dip->nlink;
80101a23: 0f b7 50 fa movzwl -0x6(%eax),%edx
80101a27: 66 89 53 56 mov %dx,0x56(%ebx)
ip->size = dip->size;
80101a2b: 8b 50 fc mov -0x4(%eax),%edx
80101a2e: 89 53 58 mov %edx,0x58(%ebx)
memmove(ip->addrs, dip->addrs, sizeof(ip->addrs));
80101a31: 6a 34 push $0x34
80101a33: 50 push %eax
80101a34: 8d 43 5c lea 0x5c(%ebx),%eax
80101a37: 50 push %eax
80101a38: e8 93 31 00 00 call 80104bd0 <memmove>
brelse(bp);
80101a3d: 89 34 24 mov %esi,(%esp)
80101a40: e8 9b e7 ff ff call 801001e0 <brelse>
ip->valid = 1;
if(ip->type == 0)
80101a45: 83 c4 10 add $0x10,%esp
80101a48: 66 83 7b 50 00 cmpw $0x0,0x50(%ebx)
ip->minor = dip->minor;
ip->nlink = dip->nlink;
ip->size = dip->size;
memmove(ip->addrs, dip->addrs, sizeof(ip->addrs));
brelse(bp);
ip->valid = 1;
80101a4d: c7 43 4c 01 00 00 00 movl $0x1,0x4c(%ebx)
if(ip->type == 0)
80101a54: 0f 85 77 ff ff ff jne 801019d1 <ilock+0x31>
panic("ilock: no type");
80101a5a: 83 ec 0c sub $0xc,%esp
80101a5d: 68 d0 77 10 80 push $0x801077d0
80101a62: e8 09 e9 ff ff call 80100370 <panic>
{
struct buf *bp;
struct dinode *dip;
if(ip == 0 || ip->ref < 1)
panic("ilock");
80101a67: 83 ec 0c sub $0xc,%esp
80101a6a: 68 ca 77 10 80 push $0x801077ca
80101a6f: e8 fc e8 ff ff call 80100370 <panic>
80101a74: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80101a7a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
80101a80 <iunlock>:
}
// Unlock the given inode.
void
iunlock(struct inode *ip)
{
80101a80: 55 push %ebp
80101a81: 89 e5 mov %esp,%ebp
80101a83: 56 push %esi
80101a84: 53 push %ebx
80101a85: 8b 5d 08 mov 0x8(%ebp),%ebx
if(ip == 0 || !holdingsleep(&ip->lock) || ip->ref < 1)
80101a88: 85 db test %ebx,%ebx
80101a8a: 74 28 je 80101ab4 <iunlock+0x34>
80101a8c: 8d 73 0c lea 0xc(%ebx),%esi
80101a8f: 83 ec 0c sub $0xc,%esp
80101a92: 56 push %esi
80101a93: e8 d8 2d 00 00 call 80104870 <holdingsleep>
80101a98: 83 c4 10 add $0x10,%esp
80101a9b: 85 c0 test %eax,%eax
80101a9d: 74 15 je 80101ab4 <iunlock+0x34>
80101a9f: 8b 43 08 mov 0x8(%ebx),%eax
80101aa2: 85 c0 test %eax,%eax
80101aa4: 7e 0e jle 80101ab4 <iunlock+0x34>
panic("iunlock");
releasesleep(&ip->lock);
80101aa6: 89 75 08 mov %esi,0x8(%ebp)
}
80101aa9: 8d 65 f8 lea -0x8(%ebp),%esp
80101aac: 5b pop %ebx
80101aad: 5e pop %esi
80101aae: 5d pop %ebp
iunlock(struct inode *ip)
{
if(ip == 0 || !holdingsleep(&ip->lock) || ip->ref < 1)
panic("iunlock");
releasesleep(&ip->lock);
80101aaf: e9 7c 2d 00 00 jmp 80104830 <releasesleep>
// Unlock the given inode.
void
iunlock(struct inode *ip)
{
if(ip == 0 || !holdingsleep(&ip->lock) || ip->ref < 1)
panic("iunlock");
80101ab4: 83 ec 0c sub $0xc,%esp
80101ab7: 68 df 77 10 80 push $0x801077df
80101abc: e8 af e8 ff ff call 80100370 <panic>
80101ac1: eb 0d jmp 80101ad0 <iput>
80101ac3: 90 nop
80101ac4: 90 nop
80101ac5: 90 nop
80101ac6: 90 nop
80101ac7: 90 nop
80101ac8: 90 nop
80101ac9: 90 nop
80101aca: 90 nop
80101acb: 90 nop
80101acc: 90 nop
80101acd: 90 nop
80101ace: 90 nop
80101acf: 90 nop
80101ad0 <iput>:
// to it, free the inode (and its content) on disk.
// All calls to iput() must be inside a transaction in
// case it has to free the inode.
void
iput(struct inode *ip)
{
80101ad0: 55 push %ebp
80101ad1: 89 e5 mov %esp,%ebp
80101ad3: 57 push %edi
80101ad4: 56 push %esi
80101ad5: 53 push %ebx
80101ad6: 83 ec 28 sub $0x28,%esp
80101ad9: 8b 75 08 mov 0x8(%ebp),%esi
acquiresleep(&ip->lock);
80101adc: 8d 7e 0c lea 0xc(%esi),%edi
80101adf: 57 push %edi
80101ae0: e8 eb 2c 00 00 call 801047d0 <acquiresleep>
if(ip->valid && ip->nlink == 0){
80101ae5: 8b 56 4c mov 0x4c(%esi),%edx
80101ae8: 83 c4 10 add $0x10,%esp
80101aeb: 85 d2 test %edx,%edx
80101aed: 74 07 je 80101af6 <iput+0x26>
80101aef: 66 83 7e 56 00 cmpw $0x0,0x56(%esi)
80101af4: 74 32 je 80101b28 <iput+0x58>
ip->type = 0;
iupdate(ip);
ip->valid = 0;
}
}
releasesleep(&ip->lock);
80101af6: 83 ec 0c sub $0xc,%esp
80101af9: 57 push %edi
80101afa: e8 31 2d 00 00 call 80104830 <releasesleep>
acquire(&icache.lock);
80101aff: c7 04 24 a0 1c 11 80 movl $0x80111ca0,(%esp)
80101b06: e8 15 2f 00 00 call 80104a20 <acquire>
ip->ref--;
80101b0b: 83 6e 08 01 subl $0x1,0x8(%esi)
release(&icache.lock);
80101b0f: 83 c4 10 add $0x10,%esp
80101b12: c7 45 08 a0 1c 11 80 movl $0x80111ca0,0x8(%ebp)
}
80101b19: 8d 65 f4 lea -0xc(%ebp),%esp
80101b1c: 5b pop %ebx
80101b1d: 5e pop %esi
80101b1e: 5f pop %edi
80101b1f: 5d pop %ebp
}
releasesleep(&ip->lock);
acquire(&icache.lock);
ip->ref--;
release(&icache.lock);
80101b20: e9 ab 2f 00 00 jmp 80104ad0 <release>
80101b25: 8d 76 00 lea 0x0(%esi),%esi
void
iput(struct inode *ip)
{
acquiresleep(&ip->lock);
if(ip->valid && ip->nlink == 0){
acquire(&icache.lock);
80101b28: 83 ec 0c sub $0xc,%esp
80101b2b: 68 a0 1c 11 80 push $0x80111ca0
80101b30: e8 eb 2e 00 00 call 80104a20 <acquire>
int r = ip->ref;
80101b35: 8b 5e 08 mov 0x8(%esi),%ebx
release(&icache.lock);
80101b38: c7 04 24 a0 1c 11 80 movl $0x80111ca0,(%esp)
80101b3f: e8 8c 2f 00 00 call 80104ad0 <release>
if(r == 1){
80101b44: 83 c4 10 add $0x10,%esp
80101b47: 83 fb 01 cmp $0x1,%ebx
80101b4a: 75 aa jne 80101af6 <iput+0x26>
80101b4c: 8d 8e 8c 00 00 00 lea 0x8c(%esi),%ecx
80101b52: 89 7d e4 mov %edi,-0x1c(%ebp)
80101b55: 8d 5e 5c lea 0x5c(%esi),%ebx
80101b58: 89 cf mov %ecx,%edi
80101b5a: eb 0b jmp 80101b67 <iput+0x97>
80101b5c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80101b60: 83 c3 04 add $0x4,%ebx
{
int i, j;
struct buf *bp;
uint *a;
for(i = 0; i < NDIRECT; i++){
80101b63: 39 fb cmp %edi,%ebx
80101b65: 74 19 je 80101b80 <iput+0xb0>
if(ip->addrs[i]){
80101b67: 8b 13 mov (%ebx),%edx
80101b69: 85 d2 test %edx,%edx
80101b6b: 74 f3 je 80101b60 <iput+0x90>
bfree(ip->dev, ip->addrs[i]);
80101b6d: 8b 06 mov (%esi),%eax
80101b6f: e8 ac fb ff ff call 80101720 <bfree>
ip->addrs[i] = 0;
80101b74: c7 03 00 00 00 00 movl $0x0,(%ebx)
80101b7a: eb e4 jmp 80101b60 <iput+0x90>
80101b7c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
}
}
if(ip->addrs[NDIRECT]){
80101b80: 8b 86 8c 00 00 00 mov 0x8c(%esi),%eax
80101b86: 8b 7d e4 mov -0x1c(%ebp),%edi
80101b89: 85 c0 test %eax,%eax
80101b8b: 75 33 jne 80101bc0 <iput+0xf0>
bfree(ip->dev, ip->addrs[NDIRECT]);
ip->addrs[NDIRECT] = 0;
}
ip->size = 0;
iupdate(ip);
80101b8d: 83 ec 0c sub $0xc,%esp
brelse(bp);
bfree(ip->dev, ip->addrs[NDIRECT]);
ip->addrs[NDIRECT] = 0;
}
ip->size = 0;
80101b90: c7 46 58 00 00 00 00 movl $0x0,0x58(%esi)
iupdate(ip);
80101b97: 56 push %esi
80101b98: e8 53 fd ff ff call 801018f0 <iupdate>
int r = ip->ref;
release(&icache.lock);
if(r == 1){
// inode has no links and no other references: truncate and free.
itrunc(ip);
ip->type = 0;
80101b9d: 31 c0 xor %eax,%eax
80101b9f: 66 89 46 50 mov %ax,0x50(%esi)
iupdate(ip);
80101ba3: 89 34 24 mov %esi,(%esp)
80101ba6: e8 45 fd ff ff call 801018f0 <iupdate>
ip->valid = 0;
80101bab: c7 46 4c 00 00 00 00 movl $0x0,0x4c(%esi)
80101bb2: 83 c4 10 add $0x10,%esp
80101bb5: e9 3c ff ff ff jmp 80101af6 <iput+0x26>
80101bba: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
ip->addrs[i] = 0;
}
}
if(ip->addrs[NDIRECT]){
bp = bread(ip->dev, ip->addrs[NDIRECT]);
80101bc0: 83 ec 08 sub $0x8,%esp
80101bc3: 50 push %eax
80101bc4: ff 36 pushl (%esi)
80101bc6: e8 05 e5 ff ff call 801000d0 <bread>
80101bcb: 8d 88 5c 02 00 00 lea 0x25c(%eax),%ecx
80101bd1: 89 7d e0 mov %edi,-0x20(%ebp)
80101bd4: 89 45 e4 mov %eax,-0x1c(%ebp)
a = (uint*)bp->data;
80101bd7: 8d 58 5c lea 0x5c(%eax),%ebx
80101bda: 83 c4 10 add $0x10,%esp
80101bdd: 89 cf mov %ecx,%edi
80101bdf: eb 0e jmp 80101bef <iput+0x11f>
80101be1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80101be8: 83 c3 04 add $0x4,%ebx
for(j = 0; j < NINDIRECT; j++){
80101beb: 39 fb cmp %edi,%ebx
80101bed: 74 0f je 80101bfe <iput+0x12e>
if(a[j])
80101bef: 8b 13 mov (%ebx),%edx
80101bf1: 85 d2 test %edx,%edx
80101bf3: 74 f3 je 80101be8 <iput+0x118>
bfree(ip->dev, a[j]);
80101bf5: 8b 06 mov (%esi),%eax
80101bf7: e8 24 fb ff ff call 80101720 <bfree>
80101bfc: eb ea jmp 80101be8 <iput+0x118>
}
brelse(bp);
80101bfe: 83 ec 0c sub $0xc,%esp
80101c01: ff 75 e4 pushl -0x1c(%ebp)
80101c04: 8b 7d e0 mov -0x20(%ebp),%edi
80101c07: e8 d4 e5 ff ff call 801001e0 <brelse>
bfree(ip->dev, ip->addrs[NDIRECT]);
80101c0c: 8b 96 8c 00 00 00 mov 0x8c(%esi),%edx
80101c12: 8b 06 mov (%esi),%eax
80101c14: e8 07 fb ff ff call 80101720 <bfree>
ip->addrs[NDIRECT] = 0;
80101c19: c7 86 8c 00 00 00 00 movl $0x0,0x8c(%esi)
80101c20: 00 00 00
80101c23: 83 c4 10 add $0x10,%esp
80101c26: e9 62 ff ff ff jmp 80101b8d <iput+0xbd>
80101c2b: 90 nop
80101c2c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80101c30 <iunlockput>:
}
// Common idiom: unlock, then put.
void
iunlockput(struct inode *ip)
{
80101c30: 55 push %ebp
80101c31: 89 e5 mov %esp,%ebp
80101c33: 53 push %ebx
80101c34: 83 ec 10 sub $0x10,%esp
80101c37: 8b 5d 08 mov 0x8(%ebp),%ebx
iunlock(ip);
80101c3a: 53 push %ebx
80101c3b: e8 40 fe ff ff call 80101a80 <iunlock>
iput(ip);
80101c40: 89 5d 08 mov %ebx,0x8(%ebp)
80101c43: 83 c4 10 add $0x10,%esp
}
80101c46: 8b 5d fc mov -0x4(%ebp),%ebx
80101c49: c9 leave
// Common idiom: unlock, then put.
void
iunlockput(struct inode *ip)
{
iunlock(ip);
iput(ip);
80101c4a: e9 81 fe ff ff jmp 80101ad0 <iput>
80101c4f: 90 nop
80101c50 <stati>:
// Copy stat information from inode.
// Caller must hold ip->lock.
void
stati(struct inode *ip, struct stat *st)
{
80101c50: 55 push %ebp
80101c51: 89 e5 mov %esp,%ebp
80101c53: 8b 55 08 mov 0x8(%ebp),%edx
80101c56: 8b 45 0c mov 0xc(%ebp),%eax
st->dev = ip->dev;
80101c59: 8b 0a mov (%edx),%ecx
80101c5b: 89 48 04 mov %ecx,0x4(%eax)
st->ino = ip->inum;
80101c5e: 8b 4a 04 mov 0x4(%edx),%ecx
80101c61: 89 48 08 mov %ecx,0x8(%eax)
st->type = ip->type;
80101c64: 0f b7 4a 50 movzwl 0x50(%edx),%ecx
80101c68: 66 89 08 mov %cx,(%eax)
st->nlink = ip->nlink;
80101c6b: 0f b7 4a 56 movzwl 0x56(%edx),%ecx
80101c6f: 66 89 48 0c mov %cx,0xc(%eax)
st->size = ip->size;
80101c73: 8b 52 58 mov 0x58(%edx),%edx
80101c76: 89 50 10 mov %edx,0x10(%eax)
}
80101c79: 5d pop %ebp
80101c7a: c3 ret
80101c7b: 90 nop
80101c7c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80101c80 <readi>:
//PAGEBREAK!
// Read data from inode.
// Caller must hold ip->lock.
int
readi(struct inode *ip, char *dst, uint off, uint n)
{
80101c80: 55 push %ebp
80101c81: 89 e5 mov %esp,%ebp
80101c83: 57 push %edi
80101c84: 56 push %esi
80101c85: 53 push %ebx
80101c86: 83 ec 1c sub $0x1c,%esp
80101c89: 8b 45 08 mov 0x8(%ebp),%eax
80101c8c: 8b 7d 0c mov 0xc(%ebp),%edi
80101c8f: 8b 75 10 mov 0x10(%ebp),%esi
uint tot, m;
struct buf *bp;
if(ip->type == T_DEV){
80101c92: 66 83 78 50 03 cmpw $0x3,0x50(%eax)
//PAGEBREAK!
// Read data from inode.
// Caller must hold ip->lock.
int
readi(struct inode *ip, char *dst, uint off, uint n)
{
80101c97: 89 7d e0 mov %edi,-0x20(%ebp)
80101c9a: 8b 7d 14 mov 0x14(%ebp),%edi
80101c9d: 89 45 d8 mov %eax,-0x28(%ebp)
80101ca0: 89 7d e4 mov %edi,-0x1c(%ebp)
uint tot, m;
struct buf *bp;
if(ip->type == T_DEV){
80101ca3: 0f 84 a7 00 00 00 je 80101d50 <readi+0xd0>
if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].read)
return -1;
return devsw[ip->major].read(ip, dst, n);
}
if(off > ip->size || off + n < off)
80101ca9: 8b 45 d8 mov -0x28(%ebp),%eax
80101cac: 8b 40 58 mov 0x58(%eax),%eax
80101caf: 39 f0 cmp %esi,%eax
80101cb1: 0f 82 c1 00 00 00 jb 80101d78 <readi+0xf8>
80101cb7: 8b 7d e4 mov -0x1c(%ebp),%edi
80101cba: 89 fa mov %edi,%edx
80101cbc: 01 f2 add %esi,%edx
80101cbe: 0f 82 b4 00 00 00 jb 80101d78 <readi+0xf8>
return -1;
if(off + n > ip->size)
n = ip->size - off;
80101cc4: 89 c1 mov %eax,%ecx
80101cc6: 29 f1 sub %esi,%ecx
80101cc8: 39 d0 cmp %edx,%eax
80101cca: 0f 43 cf cmovae %edi,%ecx
for(tot=0; tot<n; tot+=m, off+=m, dst+=m){
80101ccd: 31 ff xor %edi,%edi
80101ccf: 85 c9 test %ecx,%ecx
}
if(off > ip->size || off + n < off)
return -1;
if(off + n > ip->size)
n = ip->size - off;
80101cd1: 89 4d e4 mov %ecx,-0x1c(%ebp)
for(tot=0; tot<n; tot+=m, off+=m, dst+=m){
80101cd4: 74 6d je 80101d43 <readi+0xc3>
80101cd6: 8d 76 00 lea 0x0(%esi),%esi
80101cd9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
bp = bread(ip->dev, bmap(ip, off/BSIZE));
80101ce0: 8b 5d d8 mov -0x28(%ebp),%ebx
80101ce3: 89 f2 mov %esi,%edx
80101ce5: c1 ea 09 shr $0x9,%edx
80101ce8: 89 d8 mov %ebx,%eax
80101cea: e8 21 f9 ff ff call 80101610 <bmap>
80101cef: 83 ec 08 sub $0x8,%esp
80101cf2: 50 push %eax
80101cf3: ff 33 pushl (%ebx)
m = min(n - tot, BSIZE - off%BSIZE);
80101cf5: bb 00 02 00 00 mov $0x200,%ebx
return -1;
if(off + n > ip->size)
n = ip->size - off;
for(tot=0; tot<n; tot+=m, off+=m, dst+=m){
bp = bread(ip->dev, bmap(ip, off/BSIZE));
80101cfa: e8 d1 e3 ff ff call 801000d0 <bread>
80101cff: 89 c2 mov %eax,%edx
m = min(n - tot, BSIZE - off%BSIZE);
80101d01: 8b 45 e4 mov -0x1c(%ebp),%eax
80101d04: 89 f1 mov %esi,%ecx
80101d06: 81 e1 ff 01 00 00 and $0x1ff,%ecx
80101d0c: 83 c4 0c add $0xc,%esp
memmove(dst, bp->data + off%BSIZE, m);
80101d0f: 89 55 dc mov %edx,-0x24(%ebp)
if(off + n > ip->size)
n = ip->size - off;
for(tot=0; tot<n; tot+=m, off+=m, dst+=m){
bp = bread(ip->dev, bmap(ip, off/BSIZE));
m = min(n - tot, BSIZE - off%BSIZE);
80101d12: 29 cb sub %ecx,%ebx
80101d14: 29 f8 sub %edi,%eax
80101d16: 39 c3 cmp %eax,%ebx
80101d18: 0f 47 d8 cmova %eax,%ebx
memmove(dst, bp->data + off%BSIZE, m);
80101d1b: 8d 44 0a 5c lea 0x5c(%edx,%ecx,1),%eax
80101d1f: 53 push %ebx
if(off > ip->size || off + n < off)
return -1;
if(off + n > ip->size)
n = ip->size - off;
for(tot=0; tot<n; tot+=m, off+=m, dst+=m){
80101d20: 01 df add %ebx,%edi
80101d22: 01 de add %ebx,%esi
bp = bread(ip->dev, bmap(ip, off/BSIZE));
m = min(n - tot, BSIZE - off%BSIZE);
memmove(dst, bp->data + off%BSIZE, m);
80101d24: 50 push %eax
80101d25: ff 75 e0 pushl -0x20(%ebp)
80101d28: e8 a3 2e 00 00 call 80104bd0 <memmove>
brelse(bp);
80101d2d: 8b 55 dc mov -0x24(%ebp),%edx
80101d30: 89 14 24 mov %edx,(%esp)
80101d33: e8 a8 e4 ff ff call 801001e0 <brelse>
if(off > ip->size || off + n < off)
return -1;
if(off + n > ip->size)
n = ip->size - off;
for(tot=0; tot<n; tot+=m, off+=m, dst+=m){
80101d38: 01 5d e0 add %ebx,-0x20(%ebp)
80101d3b: 83 c4 10 add $0x10,%esp
80101d3e: 39 7d e4 cmp %edi,-0x1c(%ebp)
80101d41: 77 9d ja 80101ce0 <readi+0x60>
bp = bread(ip->dev, bmap(ip, off/BSIZE));
m = min(n - tot, BSIZE - off%BSIZE);
memmove(dst, bp->data + off%BSIZE, m);
brelse(bp);
}
return n;
80101d43: 8b 45 e4 mov -0x1c(%ebp),%eax
}
80101d46: 8d 65 f4 lea -0xc(%ebp),%esp
80101d49: 5b pop %ebx
80101d4a: 5e pop %esi
80101d4b: 5f pop %edi
80101d4c: 5d pop %ebp
80101d4d: c3 ret
80101d4e: 66 90 xchg %ax,%ax
{
uint tot, m;
struct buf *bp;
if(ip->type == T_DEV){
if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].read)
80101d50: 0f bf 40 52 movswl 0x52(%eax),%eax
80101d54: 66 83 f8 09 cmp $0x9,%ax
80101d58: 77 1e ja 80101d78 <readi+0xf8>
80101d5a: 8b 04 c5 20 1c 11 80 mov -0x7feee3e0(,%eax,8),%eax
80101d61: 85 c0 test %eax,%eax
80101d63: 74 13 je 80101d78 <readi+0xf8>
return -1;
return devsw[ip->major].read(ip, dst, n);
80101d65: 89 7d 10 mov %edi,0x10(%ebp)
m = min(n - tot, BSIZE - off%BSIZE);
memmove(dst, bp->data + off%BSIZE, m);
brelse(bp);
}
return n;
}
80101d68: 8d 65 f4 lea -0xc(%ebp),%esp
80101d6b: 5b pop %ebx
80101d6c: 5e pop %esi
80101d6d: 5f pop %edi
80101d6e: 5d pop %ebp
struct buf *bp;
if(ip->type == T_DEV){
if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].read)
return -1;
return devsw[ip->major].read(ip, dst, n);
80101d6f: ff e0 jmp *%eax
80101d71: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
uint tot, m;
struct buf *bp;
if(ip->type == T_DEV){
if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].read)
return -1;
80101d78: b8 ff ff ff ff mov $0xffffffff,%eax
80101d7d: eb c7 jmp 80101d46 <readi+0xc6>
80101d7f: 90 nop
80101d80 <writei>:
// PAGEBREAK!
// Write data to inode.
// Caller must hold ip->lock.
int
writei(struct inode *ip, char *src, uint off, uint n)
{
80101d80: 55 push %ebp
80101d81: 89 e5 mov %esp,%ebp
80101d83: 57 push %edi
80101d84: 56 push %esi
80101d85: 53 push %ebx
80101d86: 83 ec 1c sub $0x1c,%esp
80101d89: 8b 45 08 mov 0x8(%ebp),%eax
80101d8c: 8b 75 0c mov 0xc(%ebp),%esi
80101d8f: 8b 7d 14 mov 0x14(%ebp),%edi
uint tot, m;
struct buf *bp;
if(ip->type == T_DEV){
80101d92: 66 83 78 50 03 cmpw $0x3,0x50(%eax)
// PAGEBREAK!
// Write data to inode.
// Caller must hold ip->lock.
int
writei(struct inode *ip, char *src, uint off, uint n)
{
80101d97: 89 75 dc mov %esi,-0x24(%ebp)
80101d9a: 89 45 d8 mov %eax,-0x28(%ebp)
80101d9d: 8b 75 10 mov 0x10(%ebp),%esi
80101da0: 89 7d e0 mov %edi,-0x20(%ebp)
uint tot, m;
struct buf *bp;
if(ip->type == T_DEV){
80101da3: 0f 84 b7 00 00 00 je 80101e60 <writei+0xe0>
if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].write)
return -1;
return devsw[ip->major].write(ip, src, n);
}
if(off > ip->size || off + n < off)
80101da9: 8b 45 d8 mov -0x28(%ebp),%eax
80101dac: 39 70 58 cmp %esi,0x58(%eax)
80101daf: 0f 82 eb 00 00 00 jb 80101ea0 <writei+0x120>
80101db5: 8b 7d e0 mov -0x20(%ebp),%edi
80101db8: 89 f8 mov %edi,%eax
80101dba: 01 f0 add %esi,%eax
return -1;
if(off + n > MAXFILE*BSIZE)
80101dbc: 3d 00 18 01 00 cmp $0x11800,%eax
80101dc1: 0f 87 d9 00 00 00 ja 80101ea0 <writei+0x120>
80101dc7: 39 c6 cmp %eax,%esi
80101dc9: 0f 87 d1 00 00 00 ja 80101ea0 <writei+0x120>
return -1;
for(tot=0; tot<n; tot+=m, off+=m, src+=m){
80101dcf: 85 ff test %edi,%edi
80101dd1: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp)
80101dd8: 74 78 je 80101e52 <writei+0xd2>
80101dda: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
bp = bread(ip->dev, bmap(ip, off/BSIZE));
80101de0: 8b 7d d8 mov -0x28(%ebp),%edi
80101de3: 89 f2 mov %esi,%edx
m = min(n - tot, BSIZE - off%BSIZE);
80101de5: bb 00 02 00 00 mov $0x200,%ebx
return -1;
if(off + n > MAXFILE*BSIZE)
return -1;
for(tot=0; tot<n; tot+=m, off+=m, src+=m){
bp = bread(ip->dev, bmap(ip, off/BSIZE));
80101dea: c1 ea 09 shr $0x9,%edx
80101ded: 89 f8 mov %edi,%eax
80101def: e8 1c f8 ff ff call 80101610 <bmap>
80101df4: 83 ec 08 sub $0x8,%esp
80101df7: 50 push %eax
80101df8: ff 37 pushl (%edi)
80101dfa: e8 d1 e2 ff ff call 801000d0 <bread>
80101dff: 89 c7 mov %eax,%edi
m = min(n - tot, BSIZE - off%BSIZE);
80101e01: 8b 45 e0 mov -0x20(%ebp),%eax
80101e04: 2b 45 e4 sub -0x1c(%ebp),%eax
80101e07: 89 f1 mov %esi,%ecx
80101e09: 83 c4 0c add $0xc,%esp
80101e0c: 81 e1 ff 01 00 00 and $0x1ff,%ecx
80101e12: 29 cb sub %ecx,%ebx
80101e14: 39 c3 cmp %eax,%ebx
80101e16: 0f 47 d8 cmova %eax,%ebx
memmove(bp->data + off%BSIZE, src, m);
80101e19: 8d 44 0f 5c lea 0x5c(%edi,%ecx,1),%eax
80101e1d: 53 push %ebx
80101e1e: ff 75 dc pushl -0x24(%ebp)
if(off > ip->size || off + n < off)
return -1;
if(off + n > MAXFILE*BSIZE)
return -1;
for(tot=0; tot<n; tot+=m, off+=m, src+=m){
80101e21: 01 de add %ebx,%esi
bp = bread(ip->dev, bmap(ip, off/BSIZE));
m = min(n - tot, BSIZE - off%BSIZE);
memmove(bp->data + off%BSIZE, src, m);
80101e23: 50 push %eax
80101e24: e8 a7 2d 00 00 call 80104bd0 <memmove>
log_write(bp);
80101e29: 89 3c 24 mov %edi,(%esp)
80101e2c: e8 2f 12 00 00 call 80103060 <log_write>
brelse(bp);
80101e31: 89 3c 24 mov %edi,(%esp)
80101e34: e8 a7 e3 ff ff call 801001e0 <brelse>
if(off > ip->size || off + n < off)
return -1;
if(off + n > MAXFILE*BSIZE)
return -1;
for(tot=0; tot<n; tot+=m, off+=m, src+=m){
80101e39: 01 5d e4 add %ebx,-0x1c(%ebp)
80101e3c: 01 5d dc add %ebx,-0x24(%ebp)
80101e3f: 83 c4 10 add $0x10,%esp
80101e42: 8b 55 e4 mov -0x1c(%ebp),%edx
80101e45: 39 55 e0 cmp %edx,-0x20(%ebp)
80101e48: 77 96 ja 80101de0 <writei+0x60>
memmove(bp->data + off%BSIZE, src, m);
log_write(bp);
brelse(bp);
}
if(n > 0 && off > ip->size){
80101e4a: 8b 45 d8 mov -0x28(%ebp),%eax
80101e4d: 3b 70 58 cmp 0x58(%eax),%esi
80101e50: 77 36 ja 80101e88 <writei+0x108>
ip->size = off;
iupdate(ip);
}
return n;
80101e52: 8b 45 e0 mov -0x20(%ebp),%eax
}
80101e55: 8d 65 f4 lea -0xc(%ebp),%esp
80101e58: 5b pop %ebx
80101e59: 5e pop %esi
80101e5a: 5f pop %edi
80101e5b: 5d pop %ebp
80101e5c: c3 ret
80101e5d: 8d 76 00 lea 0x0(%esi),%esi
{
uint tot, m;
struct buf *bp;
if(ip->type == T_DEV){
if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].write)
80101e60: 0f bf 40 52 movswl 0x52(%eax),%eax
80101e64: 66 83 f8 09 cmp $0x9,%ax
80101e68: 77 36 ja 80101ea0 <writei+0x120>
80101e6a: 8b 04 c5 24 1c 11 80 mov -0x7feee3dc(,%eax,8),%eax
80101e71: 85 c0 test %eax,%eax
80101e73: 74 2b je 80101ea0 <writei+0x120>
return -1;
return devsw[ip->major].write(ip, src, n);
80101e75: 89 7d 10 mov %edi,0x10(%ebp)
if(n > 0 && off > ip->size){
ip->size = off;
iupdate(ip);
}
return n;
}
80101e78: 8d 65 f4 lea -0xc(%ebp),%esp
80101e7b: 5b pop %ebx
80101e7c: 5e pop %esi
80101e7d: 5f pop %edi
80101e7e: 5d pop %ebp
struct buf *bp;
if(ip->type == T_DEV){
if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].write)
return -1;
return devsw[ip->major].write(ip, src, n);
80101e7f: ff e0 jmp *%eax
80101e81: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
log_write(bp);
brelse(bp);
}
if(n > 0 && off > ip->size){
ip->size = off;
80101e88: 8b 45 d8 mov -0x28(%ebp),%eax
iupdate(ip);
80101e8b: 83 ec 0c sub $0xc,%esp
log_write(bp);
brelse(bp);
}
if(n > 0 && off > ip->size){
ip->size = off;
80101e8e: 89 70 58 mov %esi,0x58(%eax)
iupdate(ip);
80101e91: 50 push %eax
80101e92: e8 59 fa ff ff call 801018f0 <iupdate>
80101e97: 83 c4 10 add $0x10,%esp
80101e9a: eb b6 jmp 80101e52 <writei+0xd2>
80101e9c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
uint tot, m;
struct buf *bp;
if(ip->type == T_DEV){
if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].write)
return -1;
80101ea0: b8 ff ff ff ff mov $0xffffffff,%eax
80101ea5: eb ae jmp 80101e55 <writei+0xd5>
80101ea7: 89 f6 mov %esi,%esi
80101ea9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80101eb0 <namecmp>:
//PAGEBREAK!
// Directories
int
namecmp(const char *s, const char *t)
{
80101eb0: 55 push %ebp
80101eb1: 89 e5 mov %esp,%ebp
80101eb3: 83 ec 0c sub $0xc,%esp
return strncmp(s, t, DIRSIZ);
80101eb6: 6a 0e push $0xe
80101eb8: ff 75 0c pushl 0xc(%ebp)
80101ebb: ff 75 08 pushl 0x8(%ebp)
80101ebe: e8 8d 2d 00 00 call 80104c50 <strncmp>
}
80101ec3: c9 leave
80101ec4: c3 ret
80101ec5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80101ec9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80101ed0 <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)
{
80101ed0: 55 push %ebp
80101ed1: 89 e5 mov %esp,%ebp
80101ed3: 57 push %edi
80101ed4: 56 push %esi
80101ed5: 53 push %ebx
80101ed6: 83 ec 1c sub $0x1c,%esp
80101ed9: 8b 5d 08 mov 0x8(%ebp),%ebx
uint off, inum;
struct dirent de;
if(dp->type != T_DIR)
80101edc: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx)
80101ee1: 0f 85 80 00 00 00 jne 80101f67 <dirlookup+0x97>
panic("dirlookup not DIR");
for(off = 0; off < dp->size; off += sizeof(de)){
80101ee7: 8b 53 58 mov 0x58(%ebx),%edx
80101eea: 31 ff xor %edi,%edi
80101eec: 8d 75 d8 lea -0x28(%ebp),%esi
80101eef: 85 d2 test %edx,%edx
80101ef1: 75 0d jne 80101f00 <dirlookup+0x30>
80101ef3: eb 5b jmp 80101f50 <dirlookup+0x80>
80101ef5: 8d 76 00 lea 0x0(%esi),%esi
80101ef8: 83 c7 10 add $0x10,%edi
80101efb: 39 7b 58 cmp %edi,0x58(%ebx)
80101efe: 76 50 jbe 80101f50 <dirlookup+0x80>
if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
80101f00: 6a 10 push $0x10
80101f02: 57 push %edi
80101f03: 56 push %esi
80101f04: 53 push %ebx
80101f05: e8 76 fd ff ff call 80101c80 <readi>
80101f0a: 83 c4 10 add $0x10,%esp
80101f0d: 83 f8 10 cmp $0x10,%eax
80101f10: 75 48 jne 80101f5a <dirlookup+0x8a>
panic("dirlookup read");
if(de.inum == 0)
80101f12: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp)
80101f17: 74 df je 80101ef8 <dirlookup+0x28>
// Directories
int
namecmp(const char *s, const char *t)
{
return strncmp(s, t, DIRSIZ);
80101f19: 8d 45 da lea -0x26(%ebp),%eax
80101f1c: 83 ec 04 sub $0x4,%esp
80101f1f: 6a 0e push $0xe
80101f21: 50 push %eax
80101f22: ff 75 0c pushl 0xc(%ebp)
80101f25: e8 26 2d 00 00 call 80104c50 <strncmp>
for(off = 0; off < dp->size; off += sizeof(de)){
if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
panic("dirlookup read");
if(de.inum == 0)
continue;
if(namecmp(name, de.name) == 0){
80101f2a: 83 c4 10 add $0x10,%esp
80101f2d: 85 c0 test %eax,%eax
80101f2f: 75 c7 jne 80101ef8 <dirlookup+0x28>
// entry matches path element
if(poff)
80101f31: 8b 45 10 mov 0x10(%ebp),%eax
80101f34: 85 c0 test %eax,%eax
80101f36: 74 05 je 80101f3d <dirlookup+0x6d>
*poff = off;
80101f38: 8b 45 10 mov 0x10(%ebp),%eax
80101f3b: 89 38 mov %edi,(%eax)
inum = de.inum;
return iget(dp->dev, inum);
80101f3d: 0f b7 55 d8 movzwl -0x28(%ebp),%edx
80101f41: 8b 03 mov (%ebx),%eax
80101f43: e8 f8 f5 ff ff call 80101540 <iget>
}
}
return 0;
}
80101f48: 8d 65 f4 lea -0xc(%ebp),%esp
80101f4b: 5b pop %ebx
80101f4c: 5e pop %esi
80101f4d: 5f pop %edi
80101f4e: 5d pop %ebp
80101f4f: c3 ret
80101f50: 8d 65 f4 lea -0xc(%ebp),%esp
inum = de.inum;
return iget(dp->dev, inum);
}
}
return 0;
80101f53: 31 c0 xor %eax,%eax
}
80101f55: 5b pop %ebx
80101f56: 5e pop %esi
80101f57: 5f pop %edi
80101f58: 5d pop %ebp
80101f59: c3 ret
if(dp->type != T_DIR)
panic("dirlookup not DIR");
for(off = 0; off < dp->size; off += sizeof(de)){
if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
panic("dirlookup read");
80101f5a: 83 ec 0c sub $0xc,%esp
80101f5d: 68 f9 77 10 80 push $0x801077f9
80101f62: e8 09 e4 ff ff call 80100370 <panic>
{
uint off, inum;
struct dirent de;
if(dp->type != T_DIR)
panic("dirlookup not DIR");
80101f67: 83 ec 0c sub $0xc,%esp
80101f6a: 68 e7 77 10 80 push $0x801077e7
80101f6f: e8 fc e3 ff ff call 80100370 <panic>
80101f74: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80101f7a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
80101f80 <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)
{
80101f80: 55 push %ebp
80101f81: 89 e5 mov %esp,%ebp
80101f83: 57 push %edi
80101f84: 56 push %esi
80101f85: 53 push %ebx
80101f86: 89 cf mov %ecx,%edi
80101f88: 89 c3 mov %eax,%ebx
80101f8a: 83 ec 1c sub $0x1c,%esp
struct inode *ip, *next;
if(*path == '/')
80101f8d: 80 38 2f cmpb $0x2f,(%eax)
// 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)
{
80101f90: 89 55 e0 mov %edx,-0x20(%ebp)
struct inode *ip, *next;
if(*path == '/')
80101f93: 0f 84 53 01 00 00 je 801020ec <namex+0x16c>
ip = iget(ROOTDEV, ROOTINO);
else
ip = idup(myproc()->cwd);
80101f99: e8 22 1b 00 00 call 80103ac0 <myproc>
// Increment reference count for ip.
// Returns ip to enable ip = idup(ip1) idiom.
struct inode*
idup(struct inode *ip)
{
acquire(&icache.lock);
80101f9e: 83 ec 0c sub $0xc,%esp
struct inode *ip, *next;
if(*path == '/')
ip = iget(ROOTDEV, ROOTINO);
else
ip = idup(myproc()->cwd);
80101fa1: 8b 70 68 mov 0x68(%eax),%esi
// Increment reference count for ip.
// Returns ip to enable ip = idup(ip1) idiom.
struct inode*
idup(struct inode *ip)
{
acquire(&icache.lock);
80101fa4: 68 a0 1c 11 80 push $0x80111ca0
80101fa9: e8 72 2a 00 00 call 80104a20 <acquire>
ip->ref++;
80101fae: 83 46 08 01 addl $0x1,0x8(%esi)
release(&icache.lock);
80101fb2: c7 04 24 a0 1c 11 80 movl $0x80111ca0,(%esp)
80101fb9: e8 12 2b 00 00 call 80104ad0 <release>
80101fbe: 83 c4 10 add $0x10,%esp
80101fc1: eb 08 jmp 80101fcb <namex+0x4b>
80101fc3: 90 nop
80101fc4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
{
char *s;
int len;
while(*path == '/')
path++;
80101fc8: 83 c3 01 add $0x1,%ebx
skipelem(char *path, char *name)
{
char *s;
int len;
while(*path == '/')
80101fcb: 0f b6 03 movzbl (%ebx),%eax
80101fce: 3c 2f cmp $0x2f,%al
80101fd0: 74 f6 je 80101fc8 <namex+0x48>
path++;
if(*path == 0)
80101fd2: 84 c0 test %al,%al
80101fd4: 0f 84 e3 00 00 00 je 801020bd <namex+0x13d>
return 0;
s = path;
while(*path != '/' && *path != 0)
80101fda: 0f b6 03 movzbl (%ebx),%eax
80101fdd: 89 da mov %ebx,%edx
80101fdf: 84 c0 test %al,%al
80101fe1: 0f 84 ac 00 00 00 je 80102093 <namex+0x113>
80101fe7: 3c 2f cmp $0x2f,%al
80101fe9: 75 09 jne 80101ff4 <namex+0x74>
80101feb: e9 a3 00 00 00 jmp 80102093 <namex+0x113>
80101ff0: 84 c0 test %al,%al
80101ff2: 74 0a je 80101ffe <namex+0x7e>
path++;
80101ff4: 83 c2 01 add $0x1,%edx
while(*path == '/')
path++;
if(*path == 0)
return 0;
s = path;
while(*path != '/' && *path != 0)
80101ff7: 0f b6 02 movzbl (%edx),%eax
80101ffa: 3c 2f cmp $0x2f,%al
80101ffc: 75 f2 jne 80101ff0 <namex+0x70>
80101ffe: 89 d1 mov %edx,%ecx
80102000: 29 d9 sub %ebx,%ecx
path++;
len = path - s;
if(len >= DIRSIZ)
80102002: 83 f9 0d cmp $0xd,%ecx
80102005: 0f 8e 8d 00 00 00 jle 80102098 <namex+0x118>
memmove(name, s, DIRSIZ);
8010200b: 83 ec 04 sub $0x4,%esp
8010200e: 89 55 e4 mov %edx,-0x1c(%ebp)
80102011: 6a 0e push $0xe
80102013: 53 push %ebx
80102014: 57 push %edi
80102015: e8 b6 2b 00 00 call 80104bd0 <memmove>
path++;
if(*path == 0)
return 0;
s = path;
while(*path != '/' && *path != 0)
path++;
8010201a: 8b 55 e4 mov -0x1c(%ebp),%edx
len = path - s;
if(len >= DIRSIZ)
memmove(name, s, DIRSIZ);
8010201d: 83 c4 10 add $0x10,%esp
path++;
if(*path == 0)
return 0;
s = path;
while(*path != '/' && *path != 0)
path++;
80102020: 89 d3 mov %edx,%ebx
memmove(name, s, DIRSIZ);
else {
memmove(name, s, len);
name[len] = 0;
}
while(*path == '/')
80102022: 80 3a 2f cmpb $0x2f,(%edx)
80102025: 75 11 jne 80102038 <namex+0xb8>
80102027: 89 f6 mov %esi,%esi
80102029: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
path++;
80102030: 83 c3 01 add $0x1,%ebx
memmove(name, s, DIRSIZ);
else {
memmove(name, s, len);
name[len] = 0;
}
while(*path == '/')
80102033: 80 3b 2f cmpb $0x2f,(%ebx)
80102036: 74 f8 je 80102030 <namex+0xb0>
ip = iget(ROOTDEV, ROOTINO);
else
ip = idup(myproc()->cwd);
while((path = skipelem(path, name)) != 0){
ilock(ip);
80102038: 83 ec 0c sub $0xc,%esp
8010203b: 56 push %esi
8010203c: e8 5f f9 ff ff call 801019a0 <ilock>
if(ip->type != T_DIR){
80102041: 83 c4 10 add $0x10,%esp
80102044: 66 83 7e 50 01 cmpw $0x1,0x50(%esi)
80102049: 0f 85 7f 00 00 00 jne 801020ce <namex+0x14e>
iunlockput(ip);
return 0;
}
if(nameiparent && *path == '\0'){
8010204f: 8b 55 e0 mov -0x20(%ebp),%edx
80102052: 85 d2 test %edx,%edx
80102054: 74 09 je 8010205f <namex+0xdf>
80102056: 80 3b 00 cmpb $0x0,(%ebx)
80102059: 0f 84 a3 00 00 00 je 80102102 <namex+0x182>
// Stop one level early.
iunlock(ip);
return ip;
}
if((next = dirlookup(ip, name, 0)) == 0){
8010205f: 83 ec 04 sub $0x4,%esp
80102062: 6a 00 push $0x0
80102064: 57 push %edi
80102065: 56 push %esi
80102066: e8 65 fe ff ff call 80101ed0 <dirlookup>
8010206b: 83 c4 10 add $0x10,%esp
8010206e: 85 c0 test %eax,%eax
80102070: 74 5c je 801020ce <namex+0x14e>
// Common idiom: unlock, then put.
void
iunlockput(struct inode *ip)
{
iunlock(ip);
80102072: 83 ec 0c sub $0xc,%esp
80102075: 89 45 e4 mov %eax,-0x1c(%ebp)
80102078: 56 push %esi
80102079: e8 02 fa ff ff call 80101a80 <iunlock>
iput(ip);
8010207e: 89 34 24 mov %esi,(%esp)
80102081: e8 4a fa ff ff call 80101ad0 <iput>
80102086: 8b 45 e4 mov -0x1c(%ebp),%eax
80102089: 83 c4 10 add $0x10,%esp
8010208c: 89 c6 mov %eax,%esi
8010208e: e9 38 ff ff ff jmp 80101fcb <namex+0x4b>
while(*path == '/')
path++;
if(*path == 0)
return 0;
s = path;
while(*path != '/' && *path != 0)
80102093: 31 c9 xor %ecx,%ecx
80102095: 8d 76 00 lea 0x0(%esi),%esi
path++;
len = path - s;
if(len >= DIRSIZ)
memmove(name, s, DIRSIZ);
else {
memmove(name, s, len);
80102098: 83 ec 04 sub $0x4,%esp
8010209b: 89 55 dc mov %edx,-0x24(%ebp)
8010209e: 89 4d e4 mov %ecx,-0x1c(%ebp)
801020a1: 51 push %ecx
801020a2: 53 push %ebx
801020a3: 57 push %edi
801020a4: e8 27 2b 00 00 call 80104bd0 <memmove>
name[len] = 0;
801020a9: 8b 4d e4 mov -0x1c(%ebp),%ecx
801020ac: 8b 55 dc mov -0x24(%ebp),%edx
801020af: 83 c4 10 add $0x10,%esp
801020b2: c6 04 0f 00 movb $0x0,(%edi,%ecx,1)
801020b6: 89 d3 mov %edx,%ebx
801020b8: e9 65 ff ff ff jmp 80102022 <namex+0xa2>
return 0;
}
iunlockput(ip);
ip = next;
}
if(nameiparent){
801020bd: 8b 45 e0 mov -0x20(%ebp),%eax
801020c0: 85 c0 test %eax,%eax
801020c2: 75 54 jne 80102118 <namex+0x198>
801020c4: 89 f0 mov %esi,%eax
iput(ip);
return 0;
}
return ip;
}
801020c6: 8d 65 f4 lea -0xc(%ebp),%esp
801020c9: 5b pop %ebx
801020ca: 5e pop %esi
801020cb: 5f pop %edi
801020cc: 5d pop %ebp
801020cd: c3 ret
// Common idiom: unlock, then put.
void
iunlockput(struct inode *ip)
{
iunlock(ip);
801020ce: 83 ec 0c sub $0xc,%esp
801020d1: 56 push %esi
801020d2: e8 a9 f9 ff ff call 80101a80 <iunlock>
iput(ip);
801020d7: 89 34 24 mov %esi,(%esp)
801020da: e8 f1 f9 ff ff call 80101ad0 <iput>
iunlock(ip);
return ip;
}
if((next = dirlookup(ip, name, 0)) == 0){
iunlockput(ip);
return 0;
801020df: 83 c4 10 add $0x10,%esp
if(nameiparent){
iput(ip);
return 0;
}
return ip;
}
801020e2: 8d 65 f4 lea -0xc(%ebp),%esp
iunlock(ip);
return ip;
}
if((next = dirlookup(ip, name, 0)) == 0){
iunlockput(ip);
return 0;
801020e5: 31 c0 xor %eax,%eax
if(nameiparent){
iput(ip);
return 0;
}
return ip;
}
801020e7: 5b pop %ebx
801020e8: 5e pop %esi
801020e9: 5f pop %edi
801020ea: 5d pop %ebp
801020eb: c3 ret
namex(char *path, int nameiparent, char *name)
{
struct inode *ip, *next;
if(*path == '/')
ip = iget(ROOTDEV, ROOTINO);
801020ec: ba 01 00 00 00 mov $0x1,%edx
801020f1: b8 01 00 00 00 mov $0x1,%eax
801020f6: e8 45 f4 ff ff call 80101540 <iget>
801020fb: 89 c6 mov %eax,%esi
801020fd: e9 c9 fe ff ff jmp 80101fcb <namex+0x4b>
iunlockput(ip);
return 0;
}
if(nameiparent && *path == '\0'){
// Stop one level early.
iunlock(ip);
80102102: 83 ec 0c sub $0xc,%esp
80102105: 56 push %esi
80102106: e8 75 f9 ff ff call 80101a80 <iunlock>
return ip;
8010210b: 83 c4 10 add $0x10,%esp
if(nameiparent){
iput(ip);
return 0;
}
return ip;
}
8010210e: 8d 65 f4 lea -0xc(%ebp),%esp
return 0;
}
if(nameiparent && *path == '\0'){
// Stop one level early.
iunlock(ip);
return ip;
80102111: 89 f0 mov %esi,%eax
if(nameiparent){
iput(ip);
return 0;
}
return ip;
}
80102113: 5b pop %ebx
80102114: 5e pop %esi
80102115: 5f pop %edi
80102116: 5d pop %ebp
80102117: c3 ret
}
iunlockput(ip);
ip = next;
}
if(nameiparent){
iput(ip);
80102118: 83 ec 0c sub $0xc,%esp
8010211b: 56 push %esi
8010211c: e8 af f9 ff ff call 80101ad0 <iput>
return 0;
80102121: 83 c4 10 add $0x10,%esp
80102124: 31 c0 xor %eax,%eax
80102126: eb 9e jmp 801020c6 <namex+0x146>
80102128: 90 nop
80102129: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80102130 <dirlink>:
}
// Write a new directory entry (name, inum) into the directory dp.
int
dirlink(struct inode *dp, char *name, uint inum)
{
80102130: 55 push %ebp
80102131: 89 e5 mov %esp,%ebp
80102133: 57 push %edi
80102134: 56 push %esi
80102135: 53 push %ebx
80102136: 83 ec 20 sub $0x20,%esp
80102139: 8b 5d 08 mov 0x8(%ebp),%ebx
int off;
struct dirent de;
struct inode *ip;
// Check that name is not present.
if((ip = dirlookup(dp, name, 0)) != 0){
8010213c: 6a 00 push $0x0
8010213e: ff 75 0c pushl 0xc(%ebp)
80102141: 53 push %ebx
80102142: e8 89 fd ff ff call 80101ed0 <dirlookup>
80102147: 83 c4 10 add $0x10,%esp
8010214a: 85 c0 test %eax,%eax
8010214c: 75 67 jne 801021b5 <dirlink+0x85>
iput(ip);
return -1;
}
// Look for an empty dirent.
for(off = 0; off < dp->size; off += sizeof(de)){
8010214e: 8b 7b 58 mov 0x58(%ebx),%edi
80102151: 8d 75 d8 lea -0x28(%ebp),%esi
80102154: 85 ff test %edi,%edi
80102156: 74 29 je 80102181 <dirlink+0x51>
80102158: 31 ff xor %edi,%edi
8010215a: 8d 75 d8 lea -0x28(%ebp),%esi
8010215d: eb 09 jmp 80102168 <dirlink+0x38>
8010215f: 90 nop
80102160: 83 c7 10 add $0x10,%edi
80102163: 39 7b 58 cmp %edi,0x58(%ebx)
80102166: 76 19 jbe 80102181 <dirlink+0x51>
if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
80102168: 6a 10 push $0x10
8010216a: 57 push %edi
8010216b: 56 push %esi
8010216c: 53 push %ebx
8010216d: e8 0e fb ff ff call 80101c80 <readi>
80102172: 83 c4 10 add $0x10,%esp
80102175: 83 f8 10 cmp $0x10,%eax
80102178: 75 4e jne 801021c8 <dirlink+0x98>
panic("dirlink read");
if(de.inum == 0)
8010217a: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp)
8010217f: 75 df jne 80102160 <dirlink+0x30>
break;
}
strncpy(de.name, name, DIRSIZ);
80102181: 8d 45 da lea -0x26(%ebp),%eax
80102184: 83 ec 04 sub $0x4,%esp
80102187: 6a 0e push $0xe
80102189: ff 75 0c pushl 0xc(%ebp)
8010218c: 50 push %eax
8010218d: e8 2e 2b 00 00 call 80104cc0 <strncpy>
de.inum = inum;
80102192: 8b 45 10 mov 0x10(%ebp),%eax
if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
80102195: 6a 10 push $0x10
80102197: 57 push %edi
80102198: 56 push %esi
80102199: 53 push %ebx
if(de.inum == 0)
break;
}
strncpy(de.name, name, DIRSIZ);
de.inum = inum;
8010219a: 66 89 45 d8 mov %ax,-0x28(%ebp)
if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
8010219e: e8 dd fb ff ff call 80101d80 <writei>
801021a3: 83 c4 20 add $0x20,%esp
801021a6: 83 f8 10 cmp $0x10,%eax
801021a9: 75 2a jne 801021d5 <dirlink+0xa5>
panic("dirlink");
return 0;
801021ab: 31 c0 xor %eax,%eax
}
801021ad: 8d 65 f4 lea -0xc(%ebp),%esp
801021b0: 5b pop %ebx
801021b1: 5e pop %esi
801021b2: 5f pop %edi
801021b3: 5d pop %ebp
801021b4: c3 ret
struct dirent de;
struct inode *ip;
// Check that name is not present.
if((ip = dirlookup(dp, name, 0)) != 0){
iput(ip);
801021b5: 83 ec 0c sub $0xc,%esp
801021b8: 50 push %eax
801021b9: e8 12 f9 ff ff call 80101ad0 <iput>
return -1;
801021be: 83 c4 10 add $0x10,%esp
801021c1: b8 ff ff ff ff mov $0xffffffff,%eax
801021c6: eb e5 jmp 801021ad <dirlink+0x7d>
}
// Look for an empty dirent.
for(off = 0; off < dp->size; off += sizeof(de)){
if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
panic("dirlink read");
801021c8: 83 ec 0c sub $0xc,%esp
801021cb: 68 08 78 10 80 push $0x80107808
801021d0: e8 9b e1 ff ff call 80100370 <panic>
}
strncpy(de.name, name, DIRSIZ);
de.inum = inum;
if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
panic("dirlink");
801021d5: 83 ec 0c sub $0xc,%esp
801021d8: 68 0e 7f 10 80 push $0x80107f0e
801021dd: e8 8e e1 ff ff call 80100370 <panic>
801021e2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
801021e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801021f0 <namei>:
return ip;
}
struct inode*
namei(char *path)
{
801021f0: 55 push %ebp
char name[DIRSIZ];
return namex(path, 0, name);
801021f1: 31 d2 xor %edx,%edx
return ip;
}
struct inode*
namei(char *path)
{
801021f3: 89 e5 mov %esp,%ebp
801021f5: 83 ec 18 sub $0x18,%esp
char name[DIRSIZ];
return namex(path, 0, name);
801021f8: 8b 45 08 mov 0x8(%ebp),%eax
801021fb: 8d 4d ea lea -0x16(%ebp),%ecx
801021fe: e8 7d fd ff ff call 80101f80 <namex>
}
80102203: c9 leave
80102204: c3 ret
80102205: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80102209: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80102210 <nameiparent>:
struct inode*
nameiparent(char *path, char *name)
{
80102210: 55 push %ebp
return namex(path, 1, name);
80102211: ba 01 00 00 00 mov $0x1,%edx
return namex(path, 0, name);
}
struct inode*
nameiparent(char *path, char *name)
{
80102216: 89 e5 mov %esp,%ebp
return namex(path, 1, name);
80102218: 8b 4d 0c mov 0xc(%ebp),%ecx
8010221b: 8b 45 08 mov 0x8(%ebp),%eax
}
8010221e: 5d pop %ebp
}
struct inode*
nameiparent(char *path, char *name)
{
return namex(path, 1, name);
8010221f: e9 5c fd ff ff jmp 80101f80 <namex>
80102224: 66 90 xchg %ax,%ax
80102226: 66 90 xchg %ax,%ax
80102228: 66 90 xchg %ax,%ax
8010222a: 66 90 xchg %ax,%ax
8010222c: 66 90 xchg %ax,%ax
8010222e: 66 90 xchg %ax,%ax
80102230 <idestart>:
}
// Start the request for b. Caller must hold idelock.
static void
idestart(struct buf *b)
{
80102230: 55 push %ebp
if(b == 0)
80102231: 85 c0 test %eax,%eax
}
// Start the request for b. Caller must hold idelock.
static void
idestart(struct buf *b)
{
80102233: 89 e5 mov %esp,%ebp
80102235: 56 push %esi
80102236: 53 push %ebx
if(b == 0)
80102237: 0f 84 ad 00 00 00 je 801022ea <idestart+0xba>
panic("idestart");
if(b->blockno >= FSSIZE)
8010223d: 8b 58 08 mov 0x8(%eax),%ebx
80102240: 89 c1 mov %eax,%ecx
80102242: 81 fb e7 03 00 00 cmp $0x3e7,%ebx
80102248: 0f 87 8f 00 00 00 ja 801022dd <idestart+0xad>
static inline uchar
inb(ushort port)
{
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
8010224e: ba f7 01 00 00 mov $0x1f7,%edx
80102253: 90 nop
80102254: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80102258: ec in (%dx),%al
static int
idewait(int checkerr)
{
int r;
while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY)
80102259: 83 e0 c0 and $0xffffffc0,%eax
8010225c: 3c 40 cmp $0x40,%al
8010225e: 75 f8 jne 80102258 <idestart+0x28>
}
static inline void
outb(ushort port, uchar data)
{
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102260: 31 f6 xor %esi,%esi
80102262: ba f6 03 00 00 mov $0x3f6,%edx
80102267: 89 f0 mov %esi,%eax
80102269: ee out %al,(%dx)
8010226a: ba f2 01 00 00 mov $0x1f2,%edx
8010226f: b8 01 00 00 00 mov $0x1,%eax
80102274: ee out %al,(%dx)
80102275: ba f3 01 00 00 mov $0x1f3,%edx
8010227a: 89 d8 mov %ebx,%eax
8010227c: ee out %al,(%dx)
8010227d: 89 d8 mov %ebx,%eax
8010227f: ba f4 01 00 00 mov $0x1f4,%edx
80102284: c1 f8 08 sar $0x8,%eax
80102287: ee out %al,(%dx)
80102288: ba f5 01 00 00 mov $0x1f5,%edx
8010228d: 89 f0 mov %esi,%eax
8010228f: ee out %al,(%dx)
80102290: 0f b6 41 04 movzbl 0x4(%ecx),%eax
80102294: ba f6 01 00 00 mov $0x1f6,%edx
80102299: 83 e0 01 and $0x1,%eax
8010229c: c1 e0 04 shl $0x4,%eax
8010229f: 83 c8 e0 or $0xffffffe0,%eax
801022a2: ee out %al,(%dx)
outb(0x1f2, sector_per_block); // number of sectors
outb(0x1f3, sector & 0xff);
outb(0x1f4, (sector >> 8) & 0xff);
outb(0x1f5, (sector >> 16) & 0xff);
outb(0x1f6, 0xe0 | ((b->dev&1)<<4) | ((sector>>24)&0x0f));
if(b->flags & B_DIRTY){
801022a3: f6 01 04 testb $0x4,(%ecx)
801022a6: ba f7 01 00 00 mov $0x1f7,%edx
801022ab: 75 13 jne 801022c0 <idestart+0x90>
801022ad: b8 20 00 00 00 mov $0x20,%eax
801022b2: ee out %al,(%dx)
outb(0x1f7, write_cmd);
outsl(0x1f0, b->data, BSIZE/4);
} else {
outb(0x1f7, read_cmd);
}
}
801022b3: 8d 65 f8 lea -0x8(%ebp),%esp
801022b6: 5b pop %ebx
801022b7: 5e pop %esi
801022b8: 5d pop %ebp
801022b9: c3 ret
801022ba: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801022c0: b8 30 00 00 00 mov $0x30,%eax
801022c5: ee out %al,(%dx)
}
static inline void
outsl(int port, const void *addr, int cnt)
{
asm volatile("cld; rep outsl" :
801022c6: ba f0 01 00 00 mov $0x1f0,%edx
outb(0x1f4, (sector >> 8) & 0xff);
outb(0x1f5, (sector >> 16) & 0xff);
outb(0x1f6, 0xe0 | ((b->dev&1)<<4) | ((sector>>24)&0x0f));
if(b->flags & B_DIRTY){
outb(0x1f7, write_cmd);
outsl(0x1f0, b->data, BSIZE/4);
801022cb: 8d 71 5c lea 0x5c(%ecx),%esi
801022ce: b9 80 00 00 00 mov $0x80,%ecx
801022d3: fc cld
801022d4: f3 6f rep outsl %ds:(%esi),(%dx)
} else {
outb(0x1f7, read_cmd);
}
}
801022d6: 8d 65 f8 lea -0x8(%ebp),%esp
801022d9: 5b pop %ebx
801022da: 5e pop %esi
801022db: 5d pop %ebp
801022dc: c3 ret
idestart(struct buf *b)
{
if(b == 0)
panic("idestart");
if(b->blockno >= FSSIZE)
panic("incorrect blockno");
801022dd: 83 ec 0c sub $0xc,%esp
801022e0: 68 74 78 10 80 push $0x80107874
801022e5: e8 86 e0 ff ff call 80100370 <panic>
// Start the request for b. Caller must hold idelock.
static void
idestart(struct buf *b)
{
if(b == 0)
panic("idestart");
801022ea: 83 ec 0c sub $0xc,%esp
801022ed: 68 6b 78 10 80 push $0x8010786b
801022f2: e8 79 e0 ff ff call 80100370 <panic>
801022f7: 89 f6 mov %esi,%esi
801022f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80102300 <ideinit>:
return 0;
}
void
ideinit(void)
{
80102300: 55 push %ebp
80102301: 89 e5 mov %esp,%ebp
80102303: 83 ec 10 sub $0x10,%esp
int i;
initlock(&idelock, "ide");
80102306: 68 86 78 10 80 push $0x80107886
8010230b: 68 c0 b5 10 80 push $0x8010b5c0
80102310: e8 ab 25 00 00 call 801048c0 <initlock>
ioapicenable(IRQ_IDE, ncpu - 1);
80102315: 58 pop %eax
80102316: a1 c0 3f 11 80 mov 0x80113fc0,%eax
8010231b: 5a pop %edx
8010231c: 83 e8 01 sub $0x1,%eax
8010231f: 50 push %eax
80102320: 6a 0e push $0xe
80102322: e8 a9 02 00 00 call 801025d0 <ioapicenable>
80102327: 83 c4 10 add $0x10,%esp
static inline uchar
inb(ushort port)
{
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
8010232a: ba f7 01 00 00 mov $0x1f7,%edx
8010232f: 90 nop
80102330: ec in (%dx),%al
static int
idewait(int checkerr)
{
int r;
while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY)
80102331: 83 e0 c0 and $0xffffffc0,%eax
80102334: 3c 40 cmp $0x40,%al
80102336: 75 f8 jne 80102330 <ideinit+0x30>
}
static inline void
outb(ushort port, uchar data)
{
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102338: ba f6 01 00 00 mov $0x1f6,%edx
8010233d: b8 f0 ff ff ff mov $0xfffffff0,%eax
80102342: ee out %al,(%dx)
80102343: b9 e8 03 00 00 mov $0x3e8,%ecx
static inline uchar
inb(ushort port)
{
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102348: ba f7 01 00 00 mov $0x1f7,%edx
8010234d: eb 06 jmp 80102355 <ideinit+0x55>
8010234f: 90 nop
ioapicenable(IRQ_IDE, ncpu - 1);
idewait(0);
// Check if disk 1 is present
outb(0x1f6, 0xe0 | (1<<4));
for(i=0; i<1000; i++){
80102350: 83 e9 01 sub $0x1,%ecx
80102353: 74 0f je 80102364 <ideinit+0x64>
80102355: ec in (%dx),%al
if(inb(0x1f7) != 0){
80102356: 84 c0 test %al,%al
80102358: 74 f6 je 80102350 <ideinit+0x50>
havedisk1 = 1;
8010235a: c7 05 a0 b5 10 80 01 movl $0x1,0x8010b5a0
80102361: 00 00 00
}
static inline void
outb(ushort port, uchar data)
{
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102364: ba f6 01 00 00 mov $0x1f6,%edx
80102369: b8 e0 ff ff ff mov $0xffffffe0,%eax
8010236e: ee out %al,(%dx)
}
}
// Switch back to disk 0.
outb(0x1f6, 0xe0 | (0<<4));
}
8010236f: c9 leave
80102370: c3 ret
80102371: eb 0d jmp 80102380 <ideintr>
80102373: 90 nop
80102374: 90 nop
80102375: 90 nop
80102376: 90 nop
80102377: 90 nop
80102378: 90 nop
80102379: 90 nop
8010237a: 90 nop
8010237b: 90 nop
8010237c: 90 nop
8010237d: 90 nop
8010237e: 90 nop
8010237f: 90 nop
80102380 <ideintr>:
}
// Interrupt handler.
void
ideintr(void)
{
80102380: 55 push %ebp
80102381: 89 e5 mov %esp,%ebp
80102383: 57 push %edi
80102384: 56 push %esi
80102385: 53 push %ebx
80102386: 83 ec 18 sub $0x18,%esp
struct buf *b;
// First queued buffer is the active request.
acquire(&idelock);
80102389: 68 c0 b5 10 80 push $0x8010b5c0
8010238e: e8 8d 26 00 00 call 80104a20 <acquire>
if((b = idequeue) == 0){
80102393: 8b 1d a4 b5 10 80 mov 0x8010b5a4,%ebx
80102399: 83 c4 10 add $0x10,%esp
8010239c: 85 db test %ebx,%ebx
8010239e: 74 34 je 801023d4 <ideintr+0x54>
release(&idelock);
return;
}
idequeue = b->qnext;
801023a0: 8b 43 58 mov 0x58(%ebx),%eax
801023a3: a3 a4 b5 10 80 mov %eax,0x8010b5a4
// Read data if needed.
if(!(b->flags & B_DIRTY) && idewait(1) >= 0)
801023a8: 8b 33 mov (%ebx),%esi
801023aa: f7 c6 04 00 00 00 test $0x4,%esi
801023b0: 74 3e je 801023f0 <ideintr+0x70>
insl(0x1f0, b->data, BSIZE/4);
// Wake process waiting for this buf.
b->flags |= B_VALID;
b->flags &= ~B_DIRTY;
801023b2: 83 e6 fb and $0xfffffffb,%esi
wakeup(b);
801023b5: 83 ec 0c sub $0xc,%esp
if(!(b->flags & B_DIRTY) && idewait(1) >= 0)
insl(0x1f0, b->data, BSIZE/4);
// Wake process waiting for this buf.
b->flags |= B_VALID;
b->flags &= ~B_DIRTY;
801023b8: 83 ce 02 or $0x2,%esi
801023bb: 89 33 mov %esi,(%ebx)
wakeup(b);
801023bd: 53 push %ebx
801023be: e8 6d 1e 00 00 call 80104230 <wakeup>
// Start disk on next buf in queue.
if(idequeue != 0)
801023c3: a1 a4 b5 10 80 mov 0x8010b5a4,%eax
801023c8: 83 c4 10 add $0x10,%esp
801023cb: 85 c0 test %eax,%eax
801023cd: 74 05 je 801023d4 <ideintr+0x54>
idestart(idequeue);
801023cf: e8 5c fe ff ff call 80102230 <idestart>
// First queued buffer is the active request.
acquire(&idelock);
if((b = idequeue) == 0){
release(&idelock);
801023d4: 83 ec 0c sub $0xc,%esp
801023d7: 68 c0 b5 10 80 push $0x8010b5c0
801023dc: e8 ef 26 00 00 call 80104ad0 <release>
// Start disk on next buf in queue.
if(idequeue != 0)
idestart(idequeue);
release(&idelock);
}
801023e1: 8d 65 f4 lea -0xc(%ebp),%esp
801023e4: 5b pop %ebx
801023e5: 5e pop %esi
801023e6: 5f pop %edi
801023e7: 5d pop %ebp
801023e8: c3 ret
801023e9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
static inline uchar
inb(ushort port)
{
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
801023f0: ba f7 01 00 00 mov $0x1f7,%edx
801023f5: 8d 76 00 lea 0x0(%esi),%esi
801023f8: ec in (%dx),%al
static int
idewait(int checkerr)
{
int r;
while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY)
801023f9: 89 c1 mov %eax,%ecx
801023fb: 83 e1 c0 and $0xffffffc0,%ecx
801023fe: 80 f9 40 cmp $0x40,%cl
80102401: 75 f5 jne 801023f8 <ideintr+0x78>
;
if(checkerr && (r & (IDE_DF|IDE_ERR)) != 0)
80102403: a8 21 test $0x21,%al
80102405: 75 ab jne 801023b2 <ideintr+0x32>
}
idequeue = b->qnext;
// Read data if needed.
if(!(b->flags & B_DIRTY) && idewait(1) >= 0)
insl(0x1f0, b->data, BSIZE/4);
80102407: 8d 7b 5c lea 0x5c(%ebx),%edi
}
static inline void
insl(int port, void *addr, int cnt)
{
asm volatile("cld; rep insl" :
8010240a: b9 80 00 00 00 mov $0x80,%ecx
8010240f: ba f0 01 00 00 mov $0x1f0,%edx
80102414: fc cld
80102415: f3 6d rep insl (%dx),%es:(%edi)
80102417: 8b 33 mov (%ebx),%esi
80102419: eb 97 jmp 801023b2 <ideintr+0x32>
8010241b: 90 nop
8010241c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80102420 <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)
{
80102420: 55 push %ebp
80102421: 89 e5 mov %esp,%ebp
80102423: 53 push %ebx
80102424: 83 ec 10 sub $0x10,%esp
80102427: 8b 5d 08 mov 0x8(%ebp),%ebx
struct buf **pp;
if(!holdingsleep(&b->lock))
8010242a: 8d 43 0c lea 0xc(%ebx),%eax
8010242d: 50 push %eax
8010242e: e8 3d 24 00 00 call 80104870 <holdingsleep>
80102433: 83 c4 10 add $0x10,%esp
80102436: 85 c0 test %eax,%eax
80102438: 0f 84 ad 00 00 00 je 801024eb <iderw+0xcb>
panic("iderw: buf not locked");
if((b->flags & (B_VALID|B_DIRTY)) == B_VALID)
8010243e: 8b 03 mov (%ebx),%eax
80102440: 83 e0 06 and $0x6,%eax
80102443: 83 f8 02 cmp $0x2,%eax
80102446: 0f 84 b9 00 00 00 je 80102505 <iderw+0xe5>
panic("iderw: nothing to do");
if(b->dev != 0 && !havedisk1)
8010244c: 8b 53 04 mov 0x4(%ebx),%edx
8010244f: 85 d2 test %edx,%edx
80102451: 74 0d je 80102460 <iderw+0x40>
80102453: a1 a0 b5 10 80 mov 0x8010b5a0,%eax
80102458: 85 c0 test %eax,%eax
8010245a: 0f 84 98 00 00 00 je 801024f8 <iderw+0xd8>
panic("iderw: ide disk 1 not present");
acquire(&idelock); //DOC:acquire-lock
80102460: 83 ec 0c sub $0xc,%esp
80102463: 68 c0 b5 10 80 push $0x8010b5c0
80102468: e8 b3 25 00 00 call 80104a20 <acquire>
// Append b to idequeue.
b->qnext = 0;
for(pp=&idequeue; *pp; pp=&(*pp)->qnext) //DOC:insert-queue
8010246d: 8b 15 a4 b5 10 80 mov 0x8010b5a4,%edx
80102473: 83 c4 10 add $0x10,%esp
panic("iderw: ide disk 1 not present");
acquire(&idelock); //DOC:acquire-lock
// Append b to idequeue.
b->qnext = 0;
80102476: c7 43 58 00 00 00 00 movl $0x0,0x58(%ebx)
for(pp=&idequeue; *pp; pp=&(*pp)->qnext) //DOC:insert-queue
8010247d: 85 d2 test %edx,%edx
8010247f: 75 09 jne 8010248a <iderw+0x6a>
80102481: eb 58 jmp 801024db <iderw+0xbb>
80102483: 90 nop
80102484: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80102488: 89 c2 mov %eax,%edx
8010248a: 8b 42 58 mov 0x58(%edx),%eax
8010248d: 85 c0 test %eax,%eax
8010248f: 75 f7 jne 80102488 <iderw+0x68>
80102491: 83 c2 58 add $0x58,%edx
;
*pp = b;
80102494: 89 1a mov %ebx,(%edx)
// Start disk if necessary.
if(idequeue == b)
80102496: 3b 1d a4 b5 10 80 cmp 0x8010b5a4,%ebx
8010249c: 74 44 je 801024e2 <iderw+0xc2>
idestart(b);
// Wait for request to finish.
while((b->flags & (B_VALID|B_DIRTY)) != B_VALID){
8010249e: 8b 03 mov (%ebx),%eax
801024a0: 83 e0 06 and $0x6,%eax
801024a3: 83 f8 02 cmp $0x2,%eax
801024a6: 74 23 je 801024cb <iderw+0xab>
801024a8: 90 nop
801024a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
sleep(b, &idelock);
801024b0: 83 ec 08 sub $0x8,%esp
801024b3: 68 c0 b5 10 80 push $0x8010b5c0
801024b8: 53 push %ebx
801024b9: e8 b2 1b 00 00 call 80104070 <sleep>
// Start disk if necessary.
if(idequeue == b)
idestart(b);
// Wait for request to finish.
while((b->flags & (B_VALID|B_DIRTY)) != B_VALID){
801024be: 8b 03 mov (%ebx),%eax
801024c0: 83 c4 10 add $0x10,%esp
801024c3: 83 e0 06 and $0x6,%eax
801024c6: 83 f8 02 cmp $0x2,%eax
801024c9: 75 e5 jne 801024b0 <iderw+0x90>
sleep(b, &idelock);
}
release(&idelock);
801024cb: c7 45 08 c0 b5 10 80 movl $0x8010b5c0,0x8(%ebp)
}
801024d2: 8b 5d fc mov -0x4(%ebp),%ebx
801024d5: c9 leave
while((b->flags & (B_VALID|B_DIRTY)) != B_VALID){
sleep(b, &idelock);
}
release(&idelock);
801024d6: e9 f5 25 00 00 jmp 80104ad0 <release>
acquire(&idelock); //DOC:acquire-lock
// Append b to idequeue.
b->qnext = 0;
for(pp=&idequeue; *pp; pp=&(*pp)->qnext) //DOC:insert-queue
801024db: ba a4 b5 10 80 mov $0x8010b5a4,%edx
801024e0: eb b2 jmp 80102494 <iderw+0x74>
;
*pp = b;
// Start disk if necessary.
if(idequeue == b)
idestart(b);
801024e2: 89 d8 mov %ebx,%eax
801024e4: e8 47 fd ff ff call 80102230 <idestart>
801024e9: eb b3 jmp 8010249e <iderw+0x7e>
iderw(struct buf *b)
{
struct buf **pp;
if(!holdingsleep(&b->lock))
panic("iderw: buf not locked");
801024eb: 83 ec 0c sub $0xc,%esp
801024ee: 68 8a 78 10 80 push $0x8010788a
801024f3: e8 78 de ff ff call 80100370 <panic>
if((b->flags & (B_VALID|B_DIRTY)) == B_VALID)
panic("iderw: nothing to do");
if(b->dev != 0 && !havedisk1)
panic("iderw: ide disk 1 not present");
801024f8: 83 ec 0c sub $0xc,%esp
801024fb: 68 b5 78 10 80 push $0x801078b5
80102500: e8 6b de ff ff call 80100370 <panic>
struct buf **pp;
if(!holdingsleep(&b->lock))
panic("iderw: buf not locked");
if((b->flags & (B_VALID|B_DIRTY)) == B_VALID)
panic("iderw: nothing to do");
80102505: 83 ec 0c sub $0xc,%esp
80102508: 68 a0 78 10 80 push $0x801078a0
8010250d: e8 5e de ff ff call 80100370 <panic>
80102512: 66 90 xchg %ax,%ax
80102514: 66 90 xchg %ax,%ax
80102516: 66 90 xchg %ax,%ax
80102518: 66 90 xchg %ax,%ax
8010251a: 66 90 xchg %ax,%ax
8010251c: 66 90 xchg %ax,%ax
8010251e: 66 90 xchg %ax,%ax
80102520 <ioapicinit>:
ioapic->data = data;
}
void
ioapicinit(void)
{
80102520: 55 push %ebp
int i, id, maxintr;
ioapic = (volatile struct ioapic*)IOAPIC;
80102521: c7 05 f4 38 11 80 00 movl $0xfec00000,0x801138f4
80102528: 00 c0 fe
ioapic->data = data;
}
void
ioapicinit(void)
{
8010252b: 89 e5 mov %esp,%ebp
8010252d: 56 push %esi
8010252e: 53 push %ebx
};
static uint
ioapicread(int reg)
{
ioapic->reg = reg;
8010252f: c7 05 00 00 c0 fe 01 movl $0x1,0xfec00000
80102536: 00 00 00
return ioapic->data;
80102539: 8b 15 f4 38 11 80 mov 0x801138f4,%edx
8010253f: 8b 72 10 mov 0x10(%edx),%esi
};
static uint
ioapicread(int reg)
{
ioapic->reg = reg;
80102542: c7 02 00 00 00 00 movl $0x0,(%edx)
return ioapic->data;
80102548: 8b 0d f4 38 11 80 mov 0x801138f4,%ecx
int i, id, maxintr;
ioapic = (volatile struct ioapic*)IOAPIC;
maxintr = (ioapicread(REG_VER) >> 16) & 0xFF;
id = ioapicread(REG_ID) >> 24;
if(id != ioapicid)
8010254e: 0f b6 15 20 3a 11 80 movzbl 0x80113a20,%edx
ioapicinit(void)
{
int i, id, maxintr;
ioapic = (volatile struct ioapic*)IOAPIC;
maxintr = (ioapicread(REG_VER) >> 16) & 0xFF;
80102555: 89 f0 mov %esi,%eax
80102557: c1 e8 10 shr $0x10,%eax
8010255a: 0f b6 f0 movzbl %al,%esi
static uint
ioapicread(int reg)
{
ioapic->reg = reg;
return ioapic->data;
8010255d: 8b 41 10 mov 0x10(%ecx),%eax
int i, id, maxintr;
ioapic = (volatile struct ioapic*)IOAPIC;
maxintr = (ioapicread(REG_VER) >> 16) & 0xFF;
id = ioapicread(REG_ID) >> 24;
if(id != ioapicid)
80102560: c1 e8 18 shr $0x18,%eax
80102563: 39 d0 cmp %edx,%eax
80102565: 74 16 je 8010257d <ioapicinit+0x5d>
cprintf("ioapicinit: id isn't equal to ioapicid; not a MP\n");
80102567: 83 ec 0c sub $0xc,%esp
8010256a: 68 d4 78 10 80 push $0x801078d4
8010256f: e8 ec e0 ff ff call 80100660 <cprintf>
80102574: 8b 0d f4 38 11 80 mov 0x801138f4,%ecx
8010257a: 83 c4 10 add $0x10,%esp
8010257d: 83 c6 21 add $0x21,%esi
ioapic->data = data;
}
void
ioapicinit(void)
{
80102580: ba 10 00 00 00 mov $0x10,%edx
80102585: b8 20 00 00 00 mov $0x20,%eax
8010258a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
}
static void
ioapicwrite(int reg, uint data)
{
ioapic->reg = reg;
80102590: 89 11 mov %edx,(%ecx)
ioapic->data = data;
80102592: 8b 0d f4 38 11 80 mov 0x801138f4,%ecx
cprintf("ioapicinit: id isn't equal to ioapicid; not a MP\n");
// 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));
80102598: 89 c3 mov %eax,%ebx
8010259a: 81 cb 00 00 01 00 or $0x10000,%ebx
801025a0: 83 c0 01 add $0x1,%eax
static void
ioapicwrite(int reg, uint data)
{
ioapic->reg = reg;
ioapic->data = data;
801025a3: 89 59 10 mov %ebx,0x10(%ecx)
801025a6: 8d 5a 01 lea 0x1(%edx),%ebx
801025a9: 83 c2 02 add $0x2,%edx
if(id != ioapicid)
cprintf("ioapicinit: id isn't equal to ioapicid; not a MP\n");
// Mark all interrupts edge-triggered, active high, disabled,
// and not routed to any CPUs.
for(i = 0; i <= maxintr; i++){
801025ac: 39 f0 cmp %esi,%eax
}
static void
ioapicwrite(int reg, uint data)
{
ioapic->reg = reg;
801025ae: 89 19 mov %ebx,(%ecx)
ioapic->data = data;
801025b0: 8b 0d f4 38 11 80 mov 0x801138f4,%ecx
801025b6: c7 41 10 00 00 00 00 movl $0x0,0x10(%ecx)
if(id != ioapicid)
cprintf("ioapicinit: id isn't equal to ioapicid; not a MP\n");
// Mark all interrupts edge-triggered, active high, disabled,
// and not routed to any CPUs.
for(i = 0; i <= maxintr; i++){
801025bd: 75 d1 jne 80102590 <ioapicinit+0x70>
ioapicwrite(REG_TABLE+2*i, INT_DISABLED | (T_IRQ0 + i));
ioapicwrite(REG_TABLE+2*i+1, 0);
}
}
801025bf: 8d 65 f8 lea -0x8(%ebp),%esp
801025c2: 5b pop %ebx
801025c3: 5e pop %esi
801025c4: 5d pop %ebp
801025c5: c3 ret
801025c6: 8d 76 00 lea 0x0(%esi),%esi
801025c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801025d0 <ioapicenable>:
void
ioapicenable(int irq, int cpunum)
{
801025d0: 55 push %ebp
}
static void
ioapicwrite(int reg, uint data)
{
ioapic->reg = reg;
801025d1: 8b 0d f4 38 11 80 mov 0x801138f4,%ecx
}
}
void
ioapicenable(int irq, int cpunum)
{
801025d7: 89 e5 mov %esp,%ebp
801025d9: 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);
801025dc: 8d 50 20 lea 0x20(%eax),%edx
801025df: 8d 44 00 10 lea 0x10(%eax,%eax,1),%eax
}
static void
ioapicwrite(int reg, uint data)
{
ioapic->reg = reg;
801025e3: 89 01 mov %eax,(%ecx)
ioapic->data = data;
801025e5: 8b 0d f4 38 11 80 mov 0x801138f4,%ecx
}
static void
ioapicwrite(int reg, uint data)
{
ioapic->reg = reg;
801025eb: 83 c0 01 add $0x1,%eax
ioapic->data = data;
801025ee: 89 51 10 mov %edx,0x10(%ecx)
{
// 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);
ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24);
801025f1: 8b 55 0c mov 0xc(%ebp),%edx
}
static void
ioapicwrite(int reg, uint data)
{
ioapic->reg = reg;
801025f4: 89 01 mov %eax,(%ecx)
ioapic->data = data;
801025f6: a1 f4 38 11 80 mov 0x801138f4,%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);
ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24);
801025fb: c1 e2 18 shl $0x18,%edx
static void
ioapicwrite(int reg, uint data)
{
ioapic->reg = reg;
ioapic->data = data;
801025fe: 89 50 10 mov %edx,0x10(%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);
ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24);
}
80102601: 5d pop %ebp
80102602: c3 ret
80102603: 66 90 xchg %ax,%ax
80102605: 66 90 xchg %ax,%ax
80102607: 66 90 xchg %ax,%ax
80102609: 66 90 xchg %ax,%ax
8010260b: 66 90 xchg %ax,%ax
8010260d: 66 90 xchg %ax,%ax
8010260f: 90 nop
80102610 <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)
{
80102610: 55 push %ebp
80102611: 89 e5 mov %esp,%ebp
80102613: 53 push %ebx
80102614: 83 ec 04 sub $0x4,%esp
80102617: 8b 5d 08 mov 0x8(%ebp),%ebx
struct run *r;
if((uint)v % PGSIZE || v < end || V2P(v) >= PHYSTOP)
8010261a: f7 c3 ff 0f 00 00 test $0xfff,%ebx
80102620: 75 70 jne 80102692 <kfree+0x82>
80102622: 81 fb 68 69 11 80 cmp $0x80116968,%ebx
80102628: 72 68 jb 80102692 <kfree+0x82>
8010262a: 8d 83 00 00 00 80 lea -0x80000000(%ebx),%eax
80102630: 3d ff ff ff 0d cmp $0xdffffff,%eax
80102635: 77 5b ja 80102692 <kfree+0x82>
panic("kfree");
// Fill with junk to catch dangling refs.
memset(v, 1, PGSIZE);
80102637: 83 ec 04 sub $0x4,%esp
8010263a: 68 00 10 00 00 push $0x1000
8010263f: 6a 01 push $0x1
80102641: 53 push %ebx
80102642: e8 d9 24 00 00 call 80104b20 <memset>
if(kmem.use_lock)
80102647: 8b 15 34 39 11 80 mov 0x80113934,%edx
8010264d: 83 c4 10 add $0x10,%esp
80102650: 85 d2 test %edx,%edx
80102652: 75 2c jne 80102680 <kfree+0x70>
acquire(&kmem.lock);
r = (struct run*)v;
r->next = kmem.freelist;
80102654: a1 38 39 11 80 mov 0x80113938,%eax
80102659: 89 03 mov %eax,(%ebx)
kmem.freelist = r;
if(kmem.use_lock)
8010265b: a1 34 39 11 80 mov 0x80113934,%eax
if(kmem.use_lock)
acquire(&kmem.lock);
r = (struct run*)v;
r->next = kmem.freelist;
kmem.freelist = r;
80102660: 89 1d 38 39 11 80 mov %ebx,0x80113938
if(kmem.use_lock)
80102666: 85 c0 test %eax,%eax
80102668: 75 06 jne 80102670 <kfree+0x60>
release(&kmem.lock);
}
8010266a: 8b 5d fc mov -0x4(%ebp),%ebx
8010266d: c9 leave
8010266e: c3 ret
8010266f: 90 nop
acquire(&kmem.lock);
r = (struct run*)v;
r->next = kmem.freelist;
kmem.freelist = r;
if(kmem.use_lock)
release(&kmem.lock);
80102670: c7 45 08 00 39 11 80 movl $0x80113900,0x8(%ebp)
}
80102677: 8b 5d fc mov -0x4(%ebp),%ebx
8010267a: c9 leave
acquire(&kmem.lock);
r = (struct run*)v;
r->next = kmem.freelist;
kmem.freelist = r;
if(kmem.use_lock)
release(&kmem.lock);
8010267b: e9 50 24 00 00 jmp 80104ad0 <release>
// Fill with junk to catch dangling refs.
memset(v, 1, PGSIZE);
if(kmem.use_lock)
acquire(&kmem.lock);
80102680: 83 ec 0c sub $0xc,%esp
80102683: 68 00 39 11 80 push $0x80113900
80102688: e8 93 23 00 00 call 80104a20 <acquire>
8010268d: 83 c4 10 add $0x10,%esp
80102690: eb c2 jmp 80102654 <kfree+0x44>
kfree(char *v)
{
struct run *r;
if((uint)v % PGSIZE || v < end || V2P(v) >= PHYSTOP)
panic("kfree");
80102692: 83 ec 0c sub $0xc,%esp
80102695: 68 06 79 10 80 push $0x80107906
8010269a: e8 d1 dc ff ff call 80100370 <panic>
8010269f: 90 nop
801026a0 <freerange>:
kmem.use_lock = 1;
}
void
freerange(void *vstart, void *vend)
{
801026a0: 55 push %ebp
801026a1: 89 e5 mov %esp,%ebp
801026a3: 56 push %esi
801026a4: 53 push %ebx
char *p;
p = (char*)PGROUNDUP((uint)vstart);
801026a5: 8b 45 08 mov 0x8(%ebp),%eax
kmem.use_lock = 1;
}
void
freerange(void *vstart, void *vend)
{
801026a8: 8b 75 0c mov 0xc(%ebp),%esi
char *p;
p = (char*)PGROUNDUP((uint)vstart);
801026ab: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx
801026b1: 81 e3 00 f0 ff ff and $0xfffff000,%ebx
for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
801026b7: 81 c3 00 10 00 00 add $0x1000,%ebx
801026bd: 39 de cmp %ebx,%esi
801026bf: 72 23 jb 801026e4 <freerange+0x44>
801026c1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
kfree(p);
801026c8: 8d 83 00 f0 ff ff lea -0x1000(%ebx),%eax
801026ce: 83 ec 0c sub $0xc,%esp
void
freerange(void *vstart, void *vend)
{
char *p;
p = (char*)PGROUNDUP((uint)vstart);
for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
801026d1: 81 c3 00 10 00 00 add $0x1000,%ebx
kfree(p);
801026d7: 50 push %eax
801026d8: e8 33 ff ff ff call 80102610 <kfree>
void
freerange(void *vstart, void *vend)
{
char *p;
p = (char*)PGROUNDUP((uint)vstart);
for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
801026dd: 83 c4 10 add $0x10,%esp
801026e0: 39 f3 cmp %esi,%ebx
801026e2: 76 e4 jbe 801026c8 <freerange+0x28>
kfree(p);
}
801026e4: 8d 65 f8 lea -0x8(%ebp),%esp
801026e7: 5b pop %ebx
801026e8: 5e pop %esi
801026e9: 5d pop %ebp
801026ea: c3 ret
801026eb: 90 nop
801026ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801026f0 <kinit1>:
// the pages mapped by entrypgdir on free list.
// 2. main() calls kinit2() with the rest of the physical pages
// after installing a full page table that maps them on all cores.
void
kinit1(void *vstart, void *vend)
{
801026f0: 55 push %ebp
801026f1: 89 e5 mov %esp,%ebp
801026f3: 56 push %esi
801026f4: 53 push %ebx
801026f5: 8b 75 0c mov 0xc(%ebp),%esi
initlock(&kmem.lock, "kmem");
801026f8: 83 ec 08 sub $0x8,%esp
801026fb: 68 0c 79 10 80 push $0x8010790c
80102700: 68 00 39 11 80 push $0x80113900
80102705: e8 b6 21 00 00 call 801048c0 <initlock>
void
freerange(void *vstart, void *vend)
{
char *p;
p = (char*)PGROUNDUP((uint)vstart);
8010270a: 8b 45 08 mov 0x8(%ebp),%eax
for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
8010270d: 83 c4 10 add $0x10,%esp
// after installing a full page table that maps them on all cores.
void
kinit1(void *vstart, void *vend)
{
initlock(&kmem.lock, "kmem");
kmem.use_lock = 0;
80102710: c7 05 34 39 11 80 00 movl $0x0,0x80113934
80102717: 00 00 00
void
freerange(void *vstart, void *vend)
{
char *p;
p = (char*)PGROUNDUP((uint)vstart);
8010271a: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx
80102720: 81 e3 00 f0 ff ff and $0xfffff000,%ebx
for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
80102726: 81 c3 00 10 00 00 add $0x1000,%ebx
8010272c: 39 de cmp %ebx,%esi
8010272e: 72 1c jb 8010274c <kinit1+0x5c>
kfree(p);
80102730: 8d 83 00 f0 ff ff lea -0x1000(%ebx),%eax
80102736: 83 ec 0c sub $0xc,%esp
void
freerange(void *vstart, void *vend)
{
char *p;
p = (char*)PGROUNDUP((uint)vstart);
for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
80102739: 81 c3 00 10 00 00 add $0x1000,%ebx
kfree(p);
8010273f: 50 push %eax
80102740: e8 cb fe ff ff call 80102610 <kfree>
void
freerange(void *vstart, void *vend)
{
char *p;
p = (char*)PGROUNDUP((uint)vstart);
for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
80102745: 83 c4 10 add $0x10,%esp
80102748: 39 de cmp %ebx,%esi
8010274a: 73 e4 jae 80102730 <kinit1+0x40>
kinit1(void *vstart, void *vend)
{
initlock(&kmem.lock, "kmem");
kmem.use_lock = 0;
freerange(vstart, vend);
}
8010274c: 8d 65 f8 lea -0x8(%ebp),%esp
8010274f: 5b pop %ebx
80102750: 5e pop %esi
80102751: 5d pop %ebp
80102752: c3 ret
80102753: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80102759: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80102760 <kinit2>:
void
kinit2(void *vstart, void *vend)
{
80102760: 55 push %ebp
80102761: 89 e5 mov %esp,%ebp
80102763: 56 push %esi
80102764: 53 push %ebx
void
freerange(void *vstart, void *vend)
{
char *p;
p = (char*)PGROUNDUP((uint)vstart);
80102765: 8b 45 08 mov 0x8(%ebp),%eax
freerange(vstart, vend);
}
void
kinit2(void *vstart, void *vend)
{
80102768: 8b 75 0c mov 0xc(%ebp),%esi
void
freerange(void *vstart, void *vend)
{
char *p;
p = (char*)PGROUNDUP((uint)vstart);
8010276b: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx
80102771: 81 e3 00 f0 ff ff and $0xfffff000,%ebx
for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
80102777: 81 c3 00 10 00 00 add $0x1000,%ebx
8010277d: 39 de cmp %ebx,%esi
8010277f: 72 23 jb 801027a4 <kinit2+0x44>
80102781: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
kfree(p);
80102788: 8d 83 00 f0 ff ff lea -0x1000(%ebx),%eax
8010278e: 83 ec 0c sub $0xc,%esp
void
freerange(void *vstart, void *vend)
{
char *p;
p = (char*)PGROUNDUP((uint)vstart);
for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
80102791: 81 c3 00 10 00 00 add $0x1000,%ebx
kfree(p);
80102797: 50 push %eax
80102798: e8 73 fe ff ff call 80102610 <kfree>
void
freerange(void *vstart, void *vend)
{
char *p;
p = (char*)PGROUNDUP((uint)vstart);
for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
8010279d: 83 c4 10 add $0x10,%esp
801027a0: 39 de cmp %ebx,%esi
801027a2: 73 e4 jae 80102788 <kinit2+0x28>
void
kinit2(void *vstart, void *vend)
{
freerange(vstart, vend);
kmem.use_lock = 1;
801027a4: c7 05 34 39 11 80 01 movl $0x1,0x80113934
801027ab: 00 00 00
}
801027ae: 8d 65 f8 lea -0x8(%ebp),%esp
801027b1: 5b pop %ebx
801027b2: 5e pop %esi
801027b3: 5d pop %ebp
801027b4: c3 ret
801027b5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801027b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801027c0 <kalloc>:
// Allocate one 4096-byte page of physical memory.
// Returns a pointer that the kernel can use.
// Returns 0 if the memory cannot be allocated.
char*
kalloc(void)
{
801027c0: 55 push %ebp
801027c1: 89 e5 mov %esp,%ebp
801027c3: 53 push %ebx
801027c4: 83 ec 04 sub $0x4,%esp
struct run *r;
if(kmem.use_lock)
801027c7: a1 34 39 11 80 mov 0x80113934,%eax
801027cc: 85 c0 test %eax,%eax
801027ce: 75 30 jne 80102800 <kalloc+0x40>
acquire(&kmem.lock);
r = kmem.freelist;
801027d0: 8b 1d 38 39 11 80 mov 0x80113938,%ebx
if(r)
801027d6: 85 db test %ebx,%ebx
801027d8: 74 1c je 801027f6 <kalloc+0x36>
kmem.freelist = r->next;
801027da: 8b 13 mov (%ebx),%edx
801027dc: 89 15 38 39 11 80 mov %edx,0x80113938
if(kmem.use_lock)
801027e2: 85 c0 test %eax,%eax
801027e4: 74 10 je 801027f6 <kalloc+0x36>
release(&kmem.lock);
801027e6: 83 ec 0c sub $0xc,%esp
801027e9: 68 00 39 11 80 push $0x80113900
801027ee: e8 dd 22 00 00 call 80104ad0 <release>
801027f3: 83 c4 10 add $0x10,%esp
return (char*)r;
}
801027f6: 89 d8 mov %ebx,%eax
801027f8: 8b 5d fc mov -0x4(%ebp),%ebx
801027fb: c9 leave
801027fc: c3 ret
801027fd: 8d 76 00 lea 0x0(%esi),%esi
kalloc(void)
{
struct run *r;
if(kmem.use_lock)
acquire(&kmem.lock);
80102800: 83 ec 0c sub $0xc,%esp
80102803: 68 00 39 11 80 push $0x80113900
80102808: e8 13 22 00 00 call 80104a20 <acquire>
r = kmem.freelist;
8010280d: 8b 1d 38 39 11 80 mov 0x80113938,%ebx
if(r)
80102813: 83 c4 10 add $0x10,%esp
80102816: a1 34 39 11 80 mov 0x80113934,%eax
8010281b: 85 db test %ebx,%ebx
8010281d: 75 bb jne 801027da <kalloc+0x1a>
8010281f: eb c1 jmp 801027e2 <kalloc+0x22>
80102821: 66 90 xchg %ax,%ax
80102823: 66 90 xchg %ax,%ax
80102825: 66 90 xchg %ax,%ax
80102827: 66 90 xchg %ax,%ax
80102829: 66 90 xchg %ax,%ax
8010282b: 66 90 xchg %ax,%ax
8010282d: 66 90 xchg %ax,%ax
8010282f: 90 nop
80102830 <kbdgetc>:
#include "defs.h"
#include "kbd.h"
int
kbdgetc(void)
{
80102830: 55 push %ebp
static inline uchar
inb(ushort port)
{
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102831: ba 64 00 00 00 mov $0x64,%edx
80102836: 89 e5 mov %esp,%ebp
80102838: ec in (%dx),%al
normalmap, shiftmap, ctlmap, ctlmap
};
uint st, data, c;
st = inb(KBSTATP);
if((st & KBS_DIB) == 0)
80102839: a8 01 test $0x1,%al
8010283b: 0f 84 af 00 00 00 je 801028f0 <kbdgetc+0xc0>
80102841: ba 60 00 00 00 mov $0x60,%edx
80102846: ec in (%dx),%al
return -1;
data = inb(KBDATAP);
80102847: 0f b6 d0 movzbl %al,%edx
if(data == 0xE0){
8010284a: 81 fa e0 00 00 00 cmp $0xe0,%edx
80102850: 74 7e je 801028d0 <kbdgetc+0xa0>
shift |= E0ESC;
return 0;
} else if(data & 0x80){
80102852: 84 c0 test %al,%al
// Key released
data = (shift & E0ESC ? data : data & 0x7F);
80102854: 8b 0d f4 b5 10 80 mov 0x8010b5f4,%ecx
data = inb(KBDATAP);
if(data == 0xE0){
shift |= E0ESC;
return 0;
} else if(data & 0x80){
8010285a: 79 24 jns 80102880 <kbdgetc+0x50>
// Key released
data = (shift & E0ESC ? data : data & 0x7F);
8010285c: f6 c1 40 test $0x40,%cl
8010285f: 75 05 jne 80102866 <kbdgetc+0x36>
80102861: 89 c2 mov %eax,%edx
80102863: 83 e2 7f and $0x7f,%edx
shift &= ~(shiftcode[data] | E0ESC);
80102866: 0f b6 82 40 7a 10 80 movzbl -0x7fef85c0(%edx),%eax
8010286d: 83 c8 40 or $0x40,%eax
80102870: 0f b6 c0 movzbl %al,%eax
80102873: f7 d0 not %eax
80102875: 21 c8 and %ecx,%eax
80102877: a3 f4 b5 10 80 mov %eax,0x8010b5f4
return 0;
8010287c: 31 c0 xor %eax,%eax
c += 'A' - 'a';
else if('A' <= c && c <= 'Z')
c += 'a' - 'A';
}
return c;
}
8010287e: 5d pop %ebp
8010287f: c3 ret
} else if(data & 0x80){
// Key released
data = (shift & E0ESC ? data : data & 0x7F);
shift &= ~(shiftcode[data] | E0ESC);
return 0;
} else if(shift & E0ESC){
80102880: f6 c1 40 test $0x40,%cl
80102883: 74 09 je 8010288e <kbdgetc+0x5e>
// Last character was an E0 escape; or with 0x80
data |= 0x80;
80102885: 83 c8 80 or $0xffffff80,%eax
shift &= ~E0ESC;
80102888: 83 e1 bf and $0xffffffbf,%ecx
data = (shift & E0ESC ? data : data & 0x7F);
shift &= ~(shiftcode[data] | E0ESC);
return 0;
} else if(shift & E0ESC){
// Last character was an E0 escape; or with 0x80
data |= 0x80;
8010288b: 0f b6 d0 movzbl %al,%edx
shift &= ~E0ESC;
}
shift |= shiftcode[data];
shift ^= togglecode[data];
8010288e: 0f b6 82 40 7a 10 80 movzbl -0x7fef85c0(%edx),%eax
80102895: 09 c1 or %eax,%ecx
80102897: 0f b6 82 40 79 10 80 movzbl -0x7fef86c0(%edx),%eax
8010289e: 31 c1 xor %eax,%ecx
c = charcode[shift & (CTL | SHIFT)][data];
801028a0: 89 c8 mov %ecx,%eax
data |= 0x80;
shift &= ~E0ESC;
}
shift |= shiftcode[data];
shift ^= togglecode[data];
801028a2: 89 0d f4 b5 10 80 mov %ecx,0x8010b5f4
c = charcode[shift & (CTL | SHIFT)][data];
801028a8: 83 e0 03 and $0x3,%eax
if(shift & CAPSLOCK){
801028ab: 83 e1 08 and $0x8,%ecx
shift &= ~E0ESC;
}
shift |= shiftcode[data];
shift ^= togglecode[data];
c = charcode[shift & (CTL | SHIFT)][data];
801028ae: 8b 04 85 20 79 10 80 mov -0x7fef86e0(,%eax,4),%eax
801028b5: 0f b6 04 10 movzbl (%eax,%edx,1),%eax
if(shift & CAPSLOCK){
801028b9: 74 c3 je 8010287e <kbdgetc+0x4e>
if('a' <= c && c <= 'z')
801028bb: 8d 50 9f lea -0x61(%eax),%edx
801028be: 83 fa 19 cmp $0x19,%edx
801028c1: 77 1d ja 801028e0 <kbdgetc+0xb0>
c += 'A' - 'a';
801028c3: 83 e8 20 sub $0x20,%eax
else if('A' <= c && c <= 'Z')
c += 'a' - 'A';
}
return c;
}
801028c6: 5d pop %ebp
801028c7: c3 ret
801028c8: 90 nop
801028c9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
return -1;
data = inb(KBDATAP);
if(data == 0xE0){
shift |= E0ESC;
return 0;
801028d0: 31 c0 xor %eax,%eax
if((st & KBS_DIB) == 0)
return -1;
data = inb(KBDATAP);
if(data == 0xE0){
shift |= E0ESC;
801028d2: 83 0d f4 b5 10 80 40 orl $0x40,0x8010b5f4
c += 'A' - 'a';
else if('A' <= c && c <= 'Z')
c += 'a' - 'A';
}
return c;
}
801028d9: 5d pop %ebp
801028da: c3 ret
801028db: 90 nop
801028dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
shift ^= togglecode[data];
c = charcode[shift & (CTL | SHIFT)][data];
if(shift & CAPSLOCK){
if('a' <= c && c <= 'z')
c += 'A' - 'a';
else if('A' <= c && c <= 'Z')
801028e0: 8d 48 bf lea -0x41(%eax),%ecx
c += 'a' - 'A';
801028e3: 8d 50 20 lea 0x20(%eax),%edx
}
return c;
}
801028e6: 5d pop %ebp
c = charcode[shift & (CTL | SHIFT)][data];
if(shift & CAPSLOCK){
if('a' <= c && c <= 'z')
c += 'A' - 'a';
else if('A' <= c && c <= 'Z')
c += 'a' - 'A';
801028e7: 83 f9 19 cmp $0x19,%ecx
801028ea: 0f 46 c2 cmovbe %edx,%eax
}
return c;
}
801028ed: c3 ret
801028ee: 66 90 xchg %ax,%ax
};
uint st, data, c;
st = inb(KBSTATP);
if((st & KBS_DIB) == 0)
return -1;
801028f0: b8 ff ff ff ff mov $0xffffffff,%eax
c += 'A' - 'a';
else if('A' <= c && c <= 'Z')
c += 'a' - 'A';
}
return c;
}
801028f5: 5d pop %ebp
801028f6: c3 ret
801028f7: 89 f6 mov %esi,%esi
801028f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80102900 <kbdintr>:
void
kbdintr(void)
{
80102900: 55 push %ebp
80102901: 89 e5 mov %esp,%ebp
80102903: 83 ec 14 sub $0x14,%esp
consoleintr(kbdgetc);
80102906: 68 30 28 10 80 push $0x80102830
8010290b: e8 c0 e1 ff ff call 80100ad0 <consoleintr>
}
80102910: 83 c4 10 add $0x10,%esp
80102913: c9 leave
80102914: c3 ret
80102915: 66 90 xchg %ax,%ax
80102917: 66 90 xchg %ax,%ax
80102919: 66 90 xchg %ax,%ax
8010291b: 66 90 xchg %ax,%ax
8010291d: 66 90 xchg %ax,%ax
8010291f: 90 nop
80102920 <lapicinit>:
}
void
lapicinit(void)
{
if(!lapic)
80102920: a1 3c 39 11 80 mov 0x8011393c,%eax
lapic[ID]; // wait for write to finish, by reading
}
void
lapicinit(void)
{
80102925: 55 push %ebp
80102926: 89 e5 mov %esp,%ebp
if(!lapic)
80102928: 85 c0 test %eax,%eax
8010292a: 0f 84 c8 00 00 00 je 801029f8 <lapicinit+0xd8>
//PAGEBREAK!
static void
lapicw(int index, int value)
{
lapic[index] = value;
80102930: c7 80 f0 00 00 00 3f movl $0x13f,0xf0(%eax)
80102937: 01 00 00
lapic[ID]; // wait for write to finish, by reading
8010293a: 8b 50 20 mov 0x20(%eax),%edx
//PAGEBREAK!
static void
lapicw(int index, int value)
{
lapic[index] = value;
8010293d: c7 80 e0 03 00 00 0b movl $0xb,0x3e0(%eax)
80102944: 00 00 00
lapic[ID]; // wait for write to finish, by reading
80102947: 8b 50 20 mov 0x20(%eax),%edx
//PAGEBREAK!
static void
lapicw(int index, int value)
{
lapic[index] = value;
8010294a: c7 80 20 03 00 00 20 movl $0x20020,0x320(%eax)
80102951: 00 02 00
lapic[ID]; // wait for write to finish, by reading
80102954: 8b 50 20 mov 0x20(%eax),%edx
//PAGEBREAK!
static void
lapicw(int index, int value)
{
lapic[index] = value;
80102957: c7 80 80 03 00 00 80 movl $0x989680,0x380(%eax)
8010295e: 96 98 00
lapic[ID]; // wait for write to finish, by reading
80102961: 8b 50 20 mov 0x20(%eax),%edx
//PAGEBREAK!
static void
lapicw(int index, int value)
{
lapic[index] = value;
80102964: c7 80 50 03 00 00 00 movl $0x10000,0x350(%eax)
8010296b: 00 01 00
lapic[ID]; // wait for write to finish, by reading
8010296e: 8b 50 20 mov 0x20(%eax),%edx
//PAGEBREAK!
static void
lapicw(int index, int value)
{
lapic[index] = value;
80102971: c7 80 60 03 00 00 00 movl $0x10000,0x360(%eax)
80102978: 00 01 00
lapic[ID]; // wait for write to finish, by reading
8010297b: 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)
8010297e: 8b 50 30 mov 0x30(%eax),%edx
80102981: c1 ea 10 shr $0x10,%edx
80102984: 80 fa 03 cmp $0x3,%dl
80102987: 77 77 ja 80102a00 <lapicinit+0xe0>
//PAGEBREAK!
static void
lapicw(int index, int value)
{
lapic[index] = value;
80102989: c7 80 70 03 00 00 33 movl $0x33,0x370(%eax)
80102990: 00 00 00
lapic[ID]; // wait for write to finish, by reading
80102993: 8b 50 20 mov 0x20(%eax),%edx
//PAGEBREAK!
static void
lapicw(int index, int value)
{
lapic[index] = value;
80102996: c7 80 80 02 00 00 00 movl $0x0,0x280(%eax)
8010299d: 00 00 00
lapic[ID]; // wait for write to finish, by reading
801029a0: 8b 50 20 mov 0x20(%eax),%edx
//PAGEBREAK!
static void
lapicw(int index, int value)
{
lapic[index] = value;
801029a3: c7 80 80 02 00 00 00 movl $0x0,0x280(%eax)
801029aa: 00 00 00
lapic[ID]; // wait for write to finish, by reading
801029ad: 8b 50 20 mov 0x20(%eax),%edx
//PAGEBREAK!
static void
lapicw(int index, int value)
{
lapic[index] = value;
801029b0: c7 80 b0 00 00 00 00 movl $0x0,0xb0(%eax)
801029b7: 00 00 00
lapic[ID]; // wait for write to finish, by reading
801029ba: 8b 50 20 mov 0x20(%eax),%edx
//PAGEBREAK!
static void
lapicw(int index, int value)
{
lapic[index] = value;
801029bd: c7 80 10 03 00 00 00 movl $0x0,0x310(%eax)
801029c4: 00 00 00
lapic[ID]; // wait for write to finish, by reading
801029c7: 8b 50 20 mov 0x20(%eax),%edx
//PAGEBREAK!
static void
lapicw(int index, int value)
{
lapic[index] = value;
801029ca: c7 80 00 03 00 00 00 movl $0x88500,0x300(%eax)
801029d1: 85 08 00
lapic[ID]; // wait for write to finish, by reading
801029d4: 8b 50 20 mov 0x20(%eax),%edx
801029d7: 89 f6 mov %esi,%esi
801029d9: 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)
801029e0: 8b 90 00 03 00 00 mov 0x300(%eax),%edx
801029e6: 80 e6 10 and $0x10,%dh
801029e9: 75 f5 jne 801029e0 <lapicinit+0xc0>
//PAGEBREAK!
static void
lapicw(int index, int value)
{
lapic[index] = value;
801029eb: c7 80 80 00 00 00 00 movl $0x0,0x80(%eax)
801029f2: 00 00 00
lapic[ID]; // wait for write to finish, by reading
801029f5: 8b 40 20 mov 0x20(%eax),%eax
while(lapic[ICRLO] & DELIVS)
;
// Enable interrupts on the APIC (but not on the processor).
lapicw(TPR, 0);
}
801029f8: 5d pop %ebp
801029f9: c3 ret
801029fa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
//PAGEBREAK!
static void
lapicw(int index, int value)
{
lapic[index] = value;
80102a00: c7 80 40 03 00 00 00 movl $0x10000,0x340(%eax)
80102a07: 00 01 00
lapic[ID]; // wait for write to finish, by reading
80102a0a: 8b 50 20 mov 0x20(%eax),%edx
80102a0d: e9 77 ff ff ff jmp 80102989 <lapicinit+0x69>
80102a12: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80102a19: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80102a20 <lapicid>:
}
int
lapicid(void)
{
if (!lapic)
80102a20: a1 3c 39 11 80 mov 0x8011393c,%eax
lapicw(TPR, 0);
}
int
lapicid(void)
{
80102a25: 55 push %ebp
80102a26: 89 e5 mov %esp,%ebp
if (!lapic)
80102a28: 85 c0 test %eax,%eax
80102a2a: 74 0c je 80102a38 <lapicid+0x18>
return 0;
return lapic[ID] >> 24;
80102a2c: 8b 40 20 mov 0x20(%eax),%eax
}
80102a2f: 5d pop %ebp
int
lapicid(void)
{
if (!lapic)
return 0;
return lapic[ID] >> 24;
80102a30: c1 e8 18 shr $0x18,%eax
}
80102a33: c3 ret
80102a34: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
int
lapicid(void)
{
if (!lapic)
return 0;
80102a38: 31 c0 xor %eax,%eax
return lapic[ID] >> 24;
}
80102a3a: 5d pop %ebp
80102a3b: c3 ret
80102a3c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80102a40 <lapiceoi>:
// Acknowledge interrupt.
void
lapiceoi(void)
{
if(lapic)
80102a40: a1 3c 39 11 80 mov 0x8011393c,%eax
}
// Acknowledge interrupt.
void
lapiceoi(void)
{
80102a45: 55 push %ebp
80102a46: 89 e5 mov %esp,%ebp
if(lapic)
80102a48: 85 c0 test %eax,%eax
80102a4a: 74 0d je 80102a59 <lapiceoi+0x19>
//PAGEBREAK!
static void
lapicw(int index, int value)
{
lapic[index] = value;
80102a4c: c7 80 b0 00 00 00 00 movl $0x0,0xb0(%eax)
80102a53: 00 00 00
lapic[ID]; // wait for write to finish, by reading
80102a56: 8b 40 20 mov 0x20(%eax),%eax
void
lapiceoi(void)
{
if(lapic)
lapicw(EOI, 0);
}
80102a59: 5d pop %ebp
80102a5a: c3 ret
80102a5b: 90 nop
80102a5c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80102a60 <microdelay>:
// Spin for a given number of microseconds.
// On real hardware would want to tune this dynamically.
void
microdelay(int us)
{
80102a60: 55 push %ebp
80102a61: 89 e5 mov %esp,%ebp
}
80102a63: 5d pop %ebp
80102a64: c3 ret
80102a65: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80102a69: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80102a70 <lapicstartap>:
// Start additional processor running entry code at addr.
// See Appendix B of MultiProcessor Specification.
void
lapicstartap(uchar apicid, uint addr)
{
80102a70: 55 push %ebp
}
static inline void
outb(ushort port, uchar data)
{
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102a71: ba 70 00 00 00 mov $0x70,%edx
80102a76: b8 0f 00 00 00 mov $0xf,%eax
80102a7b: 89 e5 mov %esp,%ebp
80102a7d: 53 push %ebx
80102a7e: 8b 4d 0c mov 0xc(%ebp),%ecx
80102a81: 8b 5d 08 mov 0x8(%ebp),%ebx
80102a84: ee out %al,(%dx)
80102a85: ba 71 00 00 00 mov $0x71,%edx
80102a8a: b8 0a 00 00 00 mov $0xa,%eax
80102a8f: 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;
80102a90: 31 c0 xor %eax,%eax
//PAGEBREAK!
static void
lapicw(int index, int value)
{
lapic[index] = value;
80102a92: c1 e3 18 shl $0x18,%ebx
// 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;
80102a95: 66 a3 67 04 00 80 mov %ax,0x80000467
wrv[1] = addr >> 4;
80102a9b: 89 c8 mov %ecx,%eax
// when it is in the halted state due to an INIT. So the second
// should be ignored, but it is part of the official Intel algorithm.
// Bochs complains about the second one. Too bad for Bochs.
for(i = 0; i < 2; i++){
lapicw(ICRHI, apicid<<24);
lapicw(ICRLO, STARTUP | (addr>>12));
80102a9d: c1 e9 0c shr $0xc,%ecx
// 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;
wrv[1] = addr >> 4;
80102aa0: c1 e8 04 shr $0x4,%eax
//PAGEBREAK!
static void
lapicw(int index, int value)
{
lapic[index] = value;
80102aa3: 89 da mov %ebx,%edx
// 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));
80102aa5: 80 cd 06 or $0x6,%ch
// 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;
wrv[1] = addr >> 4;
80102aa8: 66 a3 69 04 00 80 mov %ax,0x80000469
//PAGEBREAK!
static void
lapicw(int index, int value)
{
lapic[index] = value;
80102aae: a1 3c 39 11 80 mov 0x8011393c,%eax
80102ab3: 89 98 10 03 00 00 mov %ebx,0x310(%eax)
lapic[ID]; // wait for write to finish, by reading
80102ab9: 8b 58 20 mov 0x20(%eax),%ebx
//PAGEBREAK!
static void
lapicw(int index, int value)
{
lapic[index] = value;
80102abc: c7 80 00 03 00 00 00 movl $0xc500,0x300(%eax)
80102ac3: c5 00 00
lapic[ID]; // wait for write to finish, by reading
80102ac6: 8b 58 20 mov 0x20(%eax),%ebx
//PAGEBREAK!
static void
lapicw(int index, int value)
{
lapic[index] = value;
80102ac9: c7 80 00 03 00 00 00 movl $0x8500,0x300(%eax)
80102ad0: 85 00 00
lapic[ID]; // wait for write to finish, by reading
80102ad3: 8b 58 20 mov 0x20(%eax),%ebx
//PAGEBREAK!
static void
lapicw(int index, int value)
{
lapic[index] = value;
80102ad6: 89 90 10 03 00 00 mov %edx,0x310(%eax)
lapic[ID]; // wait for write to finish, by reading
80102adc: 8b 58 20 mov 0x20(%eax),%ebx
//PAGEBREAK!
static void
lapicw(int index, int value)
{
lapic[index] = value;
80102adf: 89 88 00 03 00 00 mov %ecx,0x300(%eax)
lapic[ID]; // wait for write to finish, by reading
80102ae5: 8b 58 20 mov 0x20(%eax),%ebx
//PAGEBREAK!
static void
lapicw(int index, int value)
{
lapic[index] = value;
80102ae8: 89 90 10 03 00 00 mov %edx,0x310(%eax)
lapic[ID]; // wait for write to finish, by reading
80102aee: 8b 50 20 mov 0x20(%eax),%edx
//PAGEBREAK!
static void
lapicw(int index, int value)
{
lapic[index] = value;
80102af1: 89 88 00 03 00 00 mov %ecx,0x300(%eax)
lapic[ID]; // wait for write to finish, by reading
80102af7: 8b 40 20 mov 0x20(%eax),%eax
for(i = 0; i < 2; i++){
lapicw(ICRHI, apicid<<24);
lapicw(ICRLO, STARTUP | (addr>>12));
microdelay(200);
}
}
80102afa: 5b pop %ebx
80102afb: 5d pop %ebp
80102afc: c3 ret
80102afd: 8d 76 00 lea 0x0(%esi),%esi
80102b00 <cmostime>:
}
// qemu seems to use 24-hour GWT and the values are BCD encoded
void
cmostime(struct rtcdate *r)
{
80102b00: 55 push %ebp
80102b01: ba 70 00 00 00 mov $0x70,%edx
80102b06: b8 0b 00 00 00 mov $0xb,%eax
80102b0b: 89 e5 mov %esp,%ebp
80102b0d: 57 push %edi
80102b0e: 56 push %esi
80102b0f: 53 push %ebx
80102b10: 83 ec 4c sub $0x4c,%esp
80102b13: ee out %al,(%dx)
static inline uchar
inb(ushort port)
{
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102b14: ba 71 00 00 00 mov $0x71,%edx
80102b19: ec in (%dx),%al
80102b1a: 83 e0 04 and $0x4,%eax
80102b1d: 8d 75 d0 lea -0x30(%ebp),%esi
}
static inline void
outb(ushort port, uchar data)
{
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102b20: 31 db xor %ebx,%ebx
80102b22: 88 45 b7 mov %al,-0x49(%ebp)
80102b25: bf 70 00 00 00 mov $0x70,%edi
80102b2a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80102b30: 89 d8 mov %ebx,%eax
80102b32: 89 fa mov %edi,%edx
80102b34: ee out %al,(%dx)
static inline uchar
inb(ushort port)
{
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102b35: b9 71 00 00 00 mov $0x71,%ecx
80102b3a: 89 ca mov %ecx,%edx
80102b3c: ec in (%dx),%al
}
static void
fill_rtcdate(struct rtcdate *r)
{
r->second = cmos_read(SECS);
80102b3d: 0f b6 c0 movzbl %al,%eax
}
static inline void
outb(ushort port, uchar data)
{
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102b40: 89 fa mov %edi,%edx
80102b42: 89 45 b8 mov %eax,-0x48(%ebp)
80102b45: b8 02 00 00 00 mov $0x2,%eax
80102b4a: ee out %al,(%dx)
static inline uchar
inb(ushort port)
{
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102b4b: 89 ca mov %ecx,%edx
80102b4d: ec in (%dx),%al
r->minute = cmos_read(MINS);
80102b4e: 0f b6 c0 movzbl %al,%eax
}
static inline void
outb(ushort port, uchar data)
{
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102b51: 89 fa mov %edi,%edx
80102b53: 89 45 bc mov %eax,-0x44(%ebp)
80102b56: b8 04 00 00 00 mov $0x4,%eax
80102b5b: ee out %al,(%dx)
static inline uchar
inb(ushort port)
{
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102b5c: 89 ca mov %ecx,%edx
80102b5e: ec in (%dx),%al
r->hour = cmos_read(HOURS);
80102b5f: 0f b6 c0 movzbl %al,%eax
}
static inline void
outb(ushort port, uchar data)
{
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102b62: 89 fa mov %edi,%edx
80102b64: 89 45 c0 mov %eax,-0x40(%ebp)
80102b67: b8 07 00 00 00 mov $0x7,%eax
80102b6c: ee out %al,(%dx)
static inline uchar
inb(ushort port)
{
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102b6d: 89 ca mov %ecx,%edx
80102b6f: ec in (%dx),%al
r->day = cmos_read(DAY);
80102b70: 0f b6 c0 movzbl %al,%eax
}
static inline void
outb(ushort port, uchar data)
{
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102b73: 89 fa mov %edi,%edx
80102b75: 89 45 c4 mov %eax,-0x3c(%ebp)
80102b78: b8 08 00 00 00 mov $0x8,%eax
80102b7d: ee out %al,(%dx)
static inline uchar
inb(ushort port)
{
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102b7e: 89 ca mov %ecx,%edx
80102b80: ec in (%dx),%al
r->month = cmos_read(MONTH);
80102b81: 0f b6 c0 movzbl %al,%eax
}
static inline void
outb(ushort port, uchar data)
{
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102b84: 89 fa mov %edi,%edx
80102b86: 89 45 c8 mov %eax,-0x38(%ebp)
80102b89: b8 09 00 00 00 mov $0x9,%eax
80102b8e: ee out %al,(%dx)
static inline uchar
inb(ushort port)
{
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102b8f: 89 ca mov %ecx,%edx
80102b91: ec in (%dx),%al
r->year = cmos_read(YEAR);
80102b92: 0f b6 c0 movzbl %al,%eax
}
static inline void
outb(ushort port, uchar data)
{
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102b95: 89 fa mov %edi,%edx
80102b97: 89 45 cc mov %eax,-0x34(%ebp)
80102b9a: b8 0a 00 00 00 mov $0xa,%eax
80102b9f: ee out %al,(%dx)
static inline uchar
inb(ushort port)
{
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102ba0: 89 ca mov %ecx,%edx
80102ba2: 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)
80102ba3: 84 c0 test %al,%al
80102ba5: 78 89 js 80102b30 <cmostime+0x30>
}
static inline void
outb(ushort port, uchar data)
{
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102ba7: 89 d8 mov %ebx,%eax
80102ba9: 89 fa mov %edi,%edx
80102bab: ee out %al,(%dx)
static inline uchar
inb(ushort port)
{
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102bac: 89 ca mov %ecx,%edx
80102bae: ec in (%dx),%al
}
static void
fill_rtcdate(struct rtcdate *r)
{
r->second = cmos_read(SECS);
80102baf: 0f b6 c0 movzbl %al,%eax
}
static inline void
outb(ushort port, uchar data)
{
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102bb2: 89 fa mov %edi,%edx
80102bb4: 89 45 d0 mov %eax,-0x30(%ebp)
80102bb7: b8 02 00 00 00 mov $0x2,%eax
80102bbc: ee out %al,(%dx)
static inline uchar
inb(ushort port)
{
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102bbd: 89 ca mov %ecx,%edx
80102bbf: ec in (%dx),%al
r->minute = cmos_read(MINS);
80102bc0: 0f b6 c0 movzbl %al,%eax
}
static inline void
outb(ushort port, uchar data)
{
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102bc3: 89 fa mov %edi,%edx
80102bc5: 89 45 d4 mov %eax,-0x2c(%ebp)
80102bc8: b8 04 00 00 00 mov $0x4,%eax
80102bcd: ee out %al,(%dx)
static inline uchar
inb(ushort port)
{
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102bce: 89 ca mov %ecx,%edx
80102bd0: ec in (%dx),%al
r->hour = cmos_read(HOURS);
80102bd1: 0f b6 c0 movzbl %al,%eax
}
static inline void
outb(ushort port, uchar data)
{
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102bd4: 89 fa mov %edi,%edx
80102bd6: 89 45 d8 mov %eax,-0x28(%ebp)
80102bd9: b8 07 00 00 00 mov $0x7,%eax
80102bde: ee out %al,(%dx)
static inline uchar
inb(ushort port)
{
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102bdf: 89 ca mov %ecx,%edx
80102be1: ec in (%dx),%al
r->day = cmos_read(DAY);
80102be2: 0f b6 c0 movzbl %al,%eax
}
static inline void
outb(ushort port, uchar data)
{
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102be5: 89 fa mov %edi,%edx
80102be7: 89 45 dc mov %eax,-0x24(%ebp)
80102bea: b8 08 00 00 00 mov $0x8,%eax
80102bef: ee out %al,(%dx)
static inline uchar
inb(ushort port)
{
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102bf0: 89 ca mov %ecx,%edx
80102bf2: ec in (%dx),%al
r->month = cmos_read(MONTH);
80102bf3: 0f b6 c0 movzbl %al,%eax
}
static inline void
outb(ushort port, uchar data)
{
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102bf6: 89 fa mov %edi,%edx
80102bf8: 89 45 e0 mov %eax,-0x20(%ebp)
80102bfb: b8 09 00 00 00 mov $0x9,%eax
80102c00: ee out %al,(%dx)
static inline uchar
inb(ushort port)
{
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102c01: 89 ca mov %ecx,%edx
80102c03: ec in (%dx),%al
r->year = cmos_read(YEAR);
80102c04: 0f b6 c0 movzbl %al,%eax
for(;;) {
fill_rtcdate(&t1);
if(cmos_read(CMOS_STATA) & CMOS_UIP)
continue;
fill_rtcdate(&t2);
if(memcmp(&t1, &t2, sizeof(t1)) == 0)
80102c07: 83 ec 04 sub $0x4,%esp
r->second = cmos_read(SECS);
r->minute = cmos_read(MINS);
r->hour = cmos_read(HOURS);
r->day = cmos_read(DAY);
r->month = cmos_read(MONTH);
r->year = cmos_read(YEAR);
80102c0a: 89 45 e4 mov %eax,-0x1c(%ebp)
for(;;) {
fill_rtcdate(&t1);
if(cmos_read(CMOS_STATA) & CMOS_UIP)
continue;
fill_rtcdate(&t2);
if(memcmp(&t1, &t2, sizeof(t1)) == 0)
80102c0d: 8d 45 b8 lea -0x48(%ebp),%eax
80102c10: 6a 18 push $0x18
80102c12: 56 push %esi
80102c13: 50 push %eax
80102c14: e8 57 1f 00 00 call 80104b70 <memcmp>
80102c19: 83 c4 10 add $0x10,%esp
80102c1c: 85 c0 test %eax,%eax
80102c1e: 0f 85 0c ff ff ff jne 80102b30 <cmostime+0x30>
break;
}
// convert
if(bcd) {
80102c24: 80 7d b7 00 cmpb $0x0,-0x49(%ebp)
80102c28: 75 78 jne 80102ca2 <cmostime+0x1a2>
#define CONV(x) (t1.x = ((t1.x >> 4) * 10) + (t1.x & 0xf))
CONV(second);
80102c2a: 8b 45 b8 mov -0x48(%ebp),%eax
80102c2d: 89 c2 mov %eax,%edx
80102c2f: 83 e0 0f and $0xf,%eax
80102c32: c1 ea 04 shr $0x4,%edx
80102c35: 8d 14 92 lea (%edx,%edx,4),%edx
80102c38: 8d 04 50 lea (%eax,%edx,2),%eax
80102c3b: 89 45 b8 mov %eax,-0x48(%ebp)
CONV(minute);
80102c3e: 8b 45 bc mov -0x44(%ebp),%eax
80102c41: 89 c2 mov %eax,%edx
80102c43: 83 e0 0f and $0xf,%eax
80102c46: c1 ea 04 shr $0x4,%edx
80102c49: 8d 14 92 lea (%edx,%edx,4),%edx
80102c4c: 8d 04 50 lea (%eax,%edx,2),%eax
80102c4f: 89 45 bc mov %eax,-0x44(%ebp)
CONV(hour );
80102c52: 8b 45 c0 mov -0x40(%ebp),%eax
80102c55: 89 c2 mov %eax,%edx
80102c57: 83 e0 0f and $0xf,%eax
80102c5a: c1 ea 04 shr $0x4,%edx
80102c5d: 8d 14 92 lea (%edx,%edx,4),%edx
80102c60: 8d 04 50 lea (%eax,%edx,2),%eax
80102c63: 89 45 c0 mov %eax,-0x40(%ebp)
CONV(day );
80102c66: 8b 45 c4 mov -0x3c(%ebp),%eax
80102c69: 89 c2 mov %eax,%edx
80102c6b: 83 e0 0f and $0xf,%eax
80102c6e: c1 ea 04 shr $0x4,%edx
80102c71: 8d 14 92 lea (%edx,%edx,4),%edx
80102c74: 8d 04 50 lea (%eax,%edx,2),%eax
80102c77: 89 45 c4 mov %eax,-0x3c(%ebp)
CONV(month );
80102c7a: 8b 45 c8 mov -0x38(%ebp),%eax
80102c7d: 89 c2 mov %eax,%edx
80102c7f: 83 e0 0f and $0xf,%eax
80102c82: c1 ea 04 shr $0x4,%edx
80102c85: 8d 14 92 lea (%edx,%edx,4),%edx
80102c88: 8d 04 50 lea (%eax,%edx,2),%eax
80102c8b: 89 45 c8 mov %eax,-0x38(%ebp)
CONV(year );
80102c8e: 8b 45 cc mov -0x34(%ebp),%eax
80102c91: 89 c2 mov %eax,%edx
80102c93: 83 e0 0f and $0xf,%eax
80102c96: c1 ea 04 shr $0x4,%edx
80102c99: 8d 14 92 lea (%edx,%edx,4),%edx
80102c9c: 8d 04 50 lea (%eax,%edx,2),%eax
80102c9f: 89 45 cc mov %eax,-0x34(%ebp)
#undef CONV
}
*r = t1;
80102ca2: 8b 75 08 mov 0x8(%ebp),%esi
80102ca5: 8b 45 b8 mov -0x48(%ebp),%eax
80102ca8: 89 06 mov %eax,(%esi)
80102caa: 8b 45 bc mov -0x44(%ebp),%eax
80102cad: 89 46 04 mov %eax,0x4(%esi)
80102cb0: 8b 45 c0 mov -0x40(%ebp),%eax
80102cb3: 89 46 08 mov %eax,0x8(%esi)
80102cb6: 8b 45 c4 mov -0x3c(%ebp),%eax
80102cb9: 89 46 0c mov %eax,0xc(%esi)
80102cbc: 8b 45 c8 mov -0x38(%ebp),%eax
80102cbf: 89 46 10 mov %eax,0x10(%esi)
80102cc2: 8b 45 cc mov -0x34(%ebp),%eax
80102cc5: 89 46 14 mov %eax,0x14(%esi)
r->year += 2000;
80102cc8: 81 46 14 d0 07 00 00 addl $0x7d0,0x14(%esi)
}
80102ccf: 8d 65 f4 lea -0xc(%ebp),%esp
80102cd2: 5b pop %ebx
80102cd3: 5e pop %esi
80102cd4: 5f pop %edi
80102cd5: 5d pop %ebp
80102cd6: c3 ret
80102cd7: 66 90 xchg %ax,%ax
80102cd9: 66 90 xchg %ax,%ax
80102cdb: 66 90 xchg %ax,%ax
80102cdd: 66 90 xchg %ax,%ax
80102cdf: 90 nop
80102ce0 <install_trans>:
static void
install_trans(void)
{
int tail;
for (tail = 0; tail < log.lh.n; tail++) {
80102ce0: 8b 0d 88 39 11 80 mov 0x80113988,%ecx
80102ce6: 85 c9 test %ecx,%ecx
80102ce8: 0f 8e 85 00 00 00 jle 80102d73 <install_trans+0x93>
}
// Copy committed blocks from log to their home location
static void
install_trans(void)
{
80102cee: 55 push %ebp
80102cef: 89 e5 mov %esp,%ebp
80102cf1: 57 push %edi
80102cf2: 56 push %esi
80102cf3: 53 push %ebx
80102cf4: 31 db xor %ebx,%ebx
80102cf6: 83 ec 0c sub $0xc,%esp
80102cf9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
int tail;
for (tail = 0; tail < log.lh.n; tail++) {
struct buf *lbuf = bread(log.dev, log.start+tail+1); // read log block
80102d00: a1 74 39 11 80 mov 0x80113974,%eax
80102d05: 83 ec 08 sub $0x8,%esp
80102d08: 01 d8 add %ebx,%eax
80102d0a: 83 c0 01 add $0x1,%eax
80102d0d: 50 push %eax
80102d0e: ff 35 84 39 11 80 pushl 0x80113984
80102d14: e8 b7 d3 ff ff call 801000d0 <bread>
80102d19: 89 c7 mov %eax,%edi
struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst
80102d1b: 58 pop %eax
80102d1c: 5a pop %edx
80102d1d: ff 34 9d 8c 39 11 80 pushl -0x7feec674(,%ebx,4)
80102d24: ff 35 84 39 11 80 pushl 0x80113984
static void
install_trans(void)
{
int tail;
for (tail = 0; tail < log.lh.n; tail++) {
80102d2a: 83 c3 01 add $0x1,%ebx
struct buf *lbuf = bread(log.dev, log.start+tail+1); // read log block
struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst
80102d2d: e8 9e d3 ff ff call 801000d0 <bread>
80102d32: 89 c6 mov %eax,%esi
memmove(dbuf->data, lbuf->data, BSIZE); // copy block to dst
80102d34: 8d 47 5c lea 0x5c(%edi),%eax
80102d37: 83 c4 0c add $0xc,%esp
80102d3a: 68 00 02 00 00 push $0x200
80102d3f: 50 push %eax
80102d40: 8d 46 5c lea 0x5c(%esi),%eax
80102d43: 50 push %eax
80102d44: e8 87 1e 00 00 call 80104bd0 <memmove>
bwrite(dbuf); // write dst to disk
80102d49: 89 34 24 mov %esi,(%esp)
80102d4c: e8 4f d4 ff ff call 801001a0 <bwrite>
brelse(lbuf);
80102d51: 89 3c 24 mov %edi,(%esp)
80102d54: e8 87 d4 ff ff call 801001e0 <brelse>
brelse(dbuf);
80102d59: 89 34 24 mov %esi,(%esp)
80102d5c: e8 7f d4 ff ff call 801001e0 <brelse>
static void
install_trans(void)
{
int tail;
for (tail = 0; tail < log.lh.n; tail++) {
80102d61: 83 c4 10 add $0x10,%esp
80102d64: 39 1d 88 39 11 80 cmp %ebx,0x80113988
80102d6a: 7f 94 jg 80102d00 <install_trans+0x20>
memmove(dbuf->data, lbuf->data, BSIZE); // copy block to dst
bwrite(dbuf); // write dst to disk
brelse(lbuf);
brelse(dbuf);
}
}
80102d6c: 8d 65 f4 lea -0xc(%ebp),%esp
80102d6f: 5b pop %ebx
80102d70: 5e pop %esi
80102d71: 5f pop %edi
80102d72: 5d pop %ebp
80102d73: f3 c3 repz ret
80102d75: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80102d79: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80102d80 <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)
{
80102d80: 55 push %ebp
80102d81: 89 e5 mov %esp,%ebp
80102d83: 53 push %ebx
80102d84: 83 ec 0c sub $0xc,%esp
struct buf *buf = bread(log.dev, log.start);
80102d87: ff 35 74 39 11 80 pushl 0x80113974
80102d8d: ff 35 84 39 11 80 pushl 0x80113984
80102d93: e8 38 d3 ff ff call 801000d0 <bread>
struct logheader *hb = (struct logheader *) (buf->data);
int i;
hb->n = log.lh.n;
80102d98: 8b 0d 88 39 11 80 mov 0x80113988,%ecx
for (i = 0; i < log.lh.n; i++) {
80102d9e: 83 c4 10 add $0x10,%esp
// This is the true point at which the
// current transaction commits.
static void
write_head(void)
{
struct buf *buf = bread(log.dev, log.start);
80102da1: 89 c3 mov %eax,%ebx
struct logheader *hb = (struct logheader *) (buf->data);
int i;
hb->n = log.lh.n;
for (i = 0; i < log.lh.n; i++) {
80102da3: 85 c9 test %ecx,%ecx
write_head(void)
{
struct buf *buf = bread(log.dev, log.start);
struct logheader *hb = (struct logheader *) (buf->data);
int i;
hb->n = log.lh.n;
80102da5: 89 48 5c mov %ecx,0x5c(%eax)
for (i = 0; i < log.lh.n; i++) {
80102da8: 7e 1f jle 80102dc9 <write_head+0x49>
80102daa: 8d 04 8d 00 00 00 00 lea 0x0(,%ecx,4),%eax
80102db1: 31 d2 xor %edx,%edx
80102db3: 90 nop
80102db4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
hb->block[i] = log.lh.block[i];
80102db8: 8b 8a 8c 39 11 80 mov -0x7feec674(%edx),%ecx
80102dbe: 89 4c 13 60 mov %ecx,0x60(%ebx,%edx,1)
80102dc2: 83 c2 04 add $0x4,%edx
{
struct buf *buf = bread(log.dev, log.start);
struct logheader *hb = (struct logheader *) (buf->data);
int i;
hb->n = log.lh.n;
for (i = 0; i < log.lh.n; i++) {
80102dc5: 39 c2 cmp %eax,%edx
80102dc7: 75 ef jne 80102db8 <write_head+0x38>
hb->block[i] = log.lh.block[i];
}
bwrite(buf);
80102dc9: 83 ec 0c sub $0xc,%esp
80102dcc: 53 push %ebx
80102dcd: e8 ce d3 ff ff call 801001a0 <bwrite>
brelse(buf);
80102dd2: 89 1c 24 mov %ebx,(%esp)
80102dd5: e8 06 d4 ff ff call 801001e0 <brelse>
}
80102dda: 8b 5d fc mov -0x4(%ebp),%ebx
80102ddd: c9 leave
80102dde: c3 ret
80102ddf: 90 nop
80102de0 <initlog>:
static void recover_from_log(void);
static void commit();
void
initlog(int dev)
{
80102de0: 55 push %ebp
80102de1: 89 e5 mov %esp,%ebp
80102de3: 53 push %ebx
80102de4: 83 ec 2c sub $0x2c,%esp
80102de7: 8b 5d 08 mov 0x8(%ebp),%ebx
if (sizeof(struct logheader) >= BSIZE)
panic("initlog: too big logheader");
struct superblock sb;
initlock(&log.lock, "log");
80102dea: 68 40 7b 10 80 push $0x80107b40
80102def: 68 40 39 11 80 push $0x80113940
80102df4: e8 c7 1a 00 00 call 801048c0 <initlock>
readsb(dev, &sb);
80102df9: 58 pop %eax
80102dfa: 8d 45 dc lea -0x24(%ebp),%eax
80102dfd: 5a pop %edx
80102dfe: 50 push %eax
80102dff: 53 push %ebx
80102e00: e8 db e8 ff ff call 801016e0 <readsb>
log.start = sb.logstart;
log.size = sb.nlog;
80102e05: 8b 55 e8 mov -0x18(%ebp),%edx
panic("initlog: too big logheader");
struct superblock sb;
initlock(&log.lock, "log");
readsb(dev, &sb);
log.start = sb.logstart;
80102e08: 8b 45 ec mov -0x14(%ebp),%eax
// Read the log header from disk into the in-memory log header
static void
read_head(void)
{
struct buf *buf = bread(log.dev, log.start);
80102e0b: 59 pop %ecx
struct superblock sb;
initlock(&log.lock, "log");
readsb(dev, &sb);
log.start = sb.logstart;
log.size = sb.nlog;
log.dev = dev;
80102e0c: 89 1d 84 39 11 80 mov %ebx,0x80113984
struct superblock sb;
initlock(&log.lock, "log");
readsb(dev, &sb);
log.start = sb.logstart;
log.size = sb.nlog;
80102e12: 89 15 78 39 11 80 mov %edx,0x80113978
panic("initlog: too big logheader");
struct superblock sb;
initlock(&log.lock, "log");
readsb(dev, &sb);
log.start = sb.logstart;
80102e18: a3 74 39 11 80 mov %eax,0x80113974
// Read the log header from disk into the in-memory log header
static void
read_head(void)
{
struct buf *buf = bread(log.dev, log.start);
80102e1d: 5a pop %edx
80102e1e: 50 push %eax
80102e1f: 53 push %ebx
80102e20: e8 ab d2 ff ff call 801000d0 <bread>
struct logheader *lh = (struct logheader *) (buf->data);
int i;
log.lh.n = lh->n;
80102e25: 8b 48 5c mov 0x5c(%eax),%ecx
for (i = 0; i < log.lh.n; i++) {
80102e28: 83 c4 10 add $0x10,%esp
80102e2b: 85 c9 test %ecx,%ecx
read_head(void)
{
struct buf *buf = bread(log.dev, log.start);
struct logheader *lh = (struct logheader *) (buf->data);
int i;
log.lh.n = lh->n;
80102e2d: 89 0d 88 39 11 80 mov %ecx,0x80113988
for (i = 0; i < log.lh.n; i++) {
80102e33: 7e 1c jle 80102e51 <initlog+0x71>
80102e35: 8d 1c 8d 00 00 00 00 lea 0x0(,%ecx,4),%ebx
80102e3c: 31 d2 xor %edx,%edx
80102e3e: 66 90 xchg %ax,%ax
log.lh.block[i] = lh->block[i];
80102e40: 8b 4c 10 60 mov 0x60(%eax,%edx,1),%ecx
80102e44: 83 c2 04 add $0x4,%edx
80102e47: 89 8a 88 39 11 80 mov %ecx,-0x7feec678(%edx)
{
struct buf *buf = bread(log.dev, log.start);
struct logheader *lh = (struct logheader *) (buf->data);
int i;
log.lh.n = lh->n;
for (i = 0; i < log.lh.n; i++) {
80102e4d: 39 da cmp %ebx,%edx
80102e4f: 75 ef jne 80102e40 <initlog+0x60>
log.lh.block[i] = lh->block[i];
}
brelse(buf);
80102e51: 83 ec 0c sub $0xc,%esp
80102e54: 50 push %eax
80102e55: e8 86 d3 ff ff call 801001e0 <brelse>
static void
recover_from_log(void)
{
read_head();
install_trans(); // if committed, copy from log to disk
80102e5a: e8 81 fe ff ff call 80102ce0 <install_trans>
log.lh.n = 0;
80102e5f: c7 05 88 39 11 80 00 movl $0x0,0x80113988
80102e66: 00 00 00
write_head(); // clear the log
80102e69: e8 12 ff ff ff call 80102d80 <write_head>
readsb(dev, &sb);
log.start = sb.logstart;
log.size = sb.nlog;
log.dev = dev;
recover_from_log();
}
80102e6e: 8b 5d fc mov -0x4(%ebp),%ebx
80102e71: c9 leave
80102e72: c3 ret
80102e73: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80102e79: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80102e80 <begin_op>:
}
// called at the start of each FS system call.
void
begin_op(void)
{
80102e80: 55 push %ebp
80102e81: 89 e5 mov %esp,%ebp
80102e83: 83 ec 14 sub $0x14,%esp
acquire(&log.lock);
80102e86: 68 40 39 11 80 push $0x80113940
80102e8b: e8 90 1b 00 00 call 80104a20 <acquire>
80102e90: 83 c4 10 add $0x10,%esp
80102e93: eb 18 jmp 80102ead <begin_op+0x2d>
80102e95: 8d 76 00 lea 0x0(%esi),%esi
while(1){
if(log.committing){
sleep(&log, &log.lock);
80102e98: 83 ec 08 sub $0x8,%esp
80102e9b: 68 40 39 11 80 push $0x80113940
80102ea0: 68 40 39 11 80 push $0x80113940
80102ea5: e8 c6 11 00 00 call 80104070 <sleep>
80102eaa: 83 c4 10 add $0x10,%esp
void
begin_op(void)
{
acquire(&log.lock);
while(1){
if(log.committing){
80102ead: a1 80 39 11 80 mov 0x80113980,%eax
80102eb2: 85 c0 test %eax,%eax
80102eb4: 75 e2 jne 80102e98 <begin_op+0x18>
sleep(&log, &log.lock);
} else if(log.lh.n + (log.outstanding+1)*MAXOPBLOCKS > LOGSIZE){
80102eb6: a1 7c 39 11 80 mov 0x8011397c,%eax
80102ebb: 8b 15 88 39 11 80 mov 0x80113988,%edx
80102ec1: 83 c0 01 add $0x1,%eax
80102ec4: 8d 0c 80 lea (%eax,%eax,4),%ecx
80102ec7: 8d 14 4a lea (%edx,%ecx,2),%edx
80102eca: 83 fa 1e cmp $0x1e,%edx
80102ecd: 7f c9 jg 80102e98 <begin_op+0x18>
// this op might exhaust log space; wait for commit.
sleep(&log, &log.lock);
} else {
log.outstanding += 1;
release(&log.lock);
80102ecf: 83 ec 0c sub $0xc,%esp
sleep(&log, &log.lock);
} else if(log.lh.n + (log.outstanding+1)*MAXOPBLOCKS > LOGSIZE){
// this op might exhaust log space; wait for commit.
sleep(&log, &log.lock);
} else {
log.outstanding += 1;
80102ed2: a3 7c 39 11 80 mov %eax,0x8011397c
release(&log.lock);
80102ed7: 68 40 39 11 80 push $0x80113940
80102edc: e8 ef 1b 00 00 call 80104ad0 <release>
break;
}
}
}
80102ee1: 83 c4 10 add $0x10,%esp
80102ee4: c9 leave
80102ee5: c3 ret
80102ee6: 8d 76 00 lea 0x0(%esi),%esi
80102ee9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80102ef0 <end_op>:
// called at the end of each FS system call.
// commits if this was the last outstanding operation.
void
end_op(void)
{
80102ef0: 55 push %ebp
80102ef1: 89 e5 mov %esp,%ebp
80102ef3: 57 push %edi
80102ef4: 56 push %esi
80102ef5: 53 push %ebx
80102ef6: 83 ec 18 sub $0x18,%esp
int do_commit = 0;
acquire(&log.lock);
80102ef9: 68 40 39 11 80 push $0x80113940
80102efe: e8 1d 1b 00 00 call 80104a20 <acquire>
log.outstanding -= 1;
80102f03: a1 7c 39 11 80 mov 0x8011397c,%eax
if(log.committing)
80102f08: 8b 1d 80 39 11 80 mov 0x80113980,%ebx
80102f0e: 83 c4 10 add $0x10,%esp
end_op(void)
{
int do_commit = 0;
acquire(&log.lock);
log.outstanding -= 1;
80102f11: 83 e8 01 sub $0x1,%eax
if(log.committing)
80102f14: 85 db test %ebx,%ebx
end_op(void)
{
int do_commit = 0;
acquire(&log.lock);
log.outstanding -= 1;
80102f16: a3 7c 39 11 80 mov %eax,0x8011397c
if(log.committing)
80102f1b: 0f 85 23 01 00 00 jne 80103044 <end_op+0x154>
panic("log.committing");
if(log.outstanding == 0){
80102f21: 85 c0 test %eax,%eax
80102f23: 0f 85 f7 00 00 00 jne 80103020 <end_op+0x130>
// begin_op() may be waiting for log space,
// and decrementing log.outstanding has decreased
// the amount of reserved space.
wakeup(&log);
}
release(&log.lock);
80102f29: 83 ec 0c sub $0xc,%esp
log.outstanding -= 1;
if(log.committing)
panic("log.committing");
if(log.outstanding == 0){
do_commit = 1;
log.committing = 1;
80102f2c: c7 05 80 39 11 80 01 movl $0x1,0x80113980
80102f33: 00 00 00
}
static void
commit()
{
if (log.lh.n > 0) {
80102f36: 31 db xor %ebx,%ebx
// begin_op() may be waiting for log space,
// and decrementing log.outstanding has decreased
// the amount of reserved space.
wakeup(&log);
}
release(&log.lock);
80102f38: 68 40 39 11 80 push $0x80113940
80102f3d: e8 8e 1b 00 00 call 80104ad0 <release>
}
static void
commit()
{
if (log.lh.n > 0) {
80102f42: 8b 0d 88 39 11 80 mov 0x80113988,%ecx
80102f48: 83 c4 10 add $0x10,%esp
80102f4b: 85 c9 test %ecx,%ecx
80102f4d: 0f 8e 8a 00 00 00 jle 80102fdd <end_op+0xed>
80102f53: 90 nop
80102f54: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
write_log(void)
{
int tail;
for (tail = 0; tail < log.lh.n; tail++) {
struct buf *to = bread(log.dev, log.start+tail+1); // log block
80102f58: a1 74 39 11 80 mov 0x80113974,%eax
80102f5d: 83 ec 08 sub $0x8,%esp
80102f60: 01 d8 add %ebx,%eax
80102f62: 83 c0 01 add $0x1,%eax
80102f65: 50 push %eax
80102f66: ff 35 84 39 11 80 pushl 0x80113984
80102f6c: e8 5f d1 ff ff call 801000d0 <bread>
80102f71: 89 c6 mov %eax,%esi
struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block
80102f73: 58 pop %eax
80102f74: 5a pop %edx
80102f75: ff 34 9d 8c 39 11 80 pushl -0x7feec674(,%ebx,4)
80102f7c: ff 35 84 39 11 80 pushl 0x80113984
static void
write_log(void)
{
int tail;
for (tail = 0; tail < log.lh.n; tail++) {
80102f82: 83 c3 01 add $0x1,%ebx
struct buf *to = bread(log.dev, log.start+tail+1); // log block
struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block
80102f85: e8 46 d1 ff ff call 801000d0 <bread>
80102f8a: 89 c7 mov %eax,%edi
memmove(to->data, from->data, BSIZE);
80102f8c: 8d 40 5c lea 0x5c(%eax),%eax
80102f8f: 83 c4 0c add $0xc,%esp
80102f92: 68 00 02 00 00 push $0x200
80102f97: 50 push %eax
80102f98: 8d 46 5c lea 0x5c(%esi),%eax
80102f9b: 50 push %eax
80102f9c: e8 2f 1c 00 00 call 80104bd0 <memmove>
bwrite(to); // write the log
80102fa1: 89 34 24 mov %esi,(%esp)
80102fa4: e8 f7 d1 ff ff call 801001a0 <bwrite>
brelse(from);
80102fa9: 89 3c 24 mov %edi,(%esp)
80102fac: e8 2f d2 ff ff call 801001e0 <brelse>
brelse(to);
80102fb1: 89 34 24 mov %esi,(%esp)
80102fb4: e8 27 d2 ff ff call 801001e0 <brelse>
static void
write_log(void)
{
int tail;
for (tail = 0; tail < log.lh.n; tail++) {
80102fb9: 83 c4 10 add $0x10,%esp
80102fbc: 3b 1d 88 39 11 80 cmp 0x80113988,%ebx
80102fc2: 7c 94 jl 80102f58 <end_op+0x68>
static void
commit()
{
if (log.lh.n > 0) {
write_log(); // Write modified blocks from cache to log
write_head(); // Write header to disk -- the real commit
80102fc4: e8 b7 fd ff ff call 80102d80 <write_head>
install_trans(); // Now install writes to home locations
80102fc9: e8 12 fd ff ff call 80102ce0 <install_trans>
log.lh.n = 0;
80102fce: c7 05 88 39 11 80 00 movl $0x0,0x80113988
80102fd5: 00 00 00
write_head(); // Erase the transaction from the log
80102fd8: e8 a3 fd ff ff call 80102d80 <write_head>
if(do_commit){
// call commit w/o holding locks, since not allowed
// to sleep with locks.
commit();
acquire(&log.lock);
80102fdd: 83 ec 0c sub $0xc,%esp
80102fe0: 68 40 39 11 80 push $0x80113940
80102fe5: e8 36 1a 00 00 call 80104a20 <acquire>
log.committing = 0;
wakeup(&log);
80102fea: c7 04 24 40 39 11 80 movl $0x80113940,(%esp)
if(do_commit){
// call commit w/o holding locks, since not allowed
// to sleep with locks.
commit();
acquire(&log.lock);
log.committing = 0;
80102ff1: c7 05 80 39 11 80 00 movl $0x0,0x80113980
80102ff8: 00 00 00
wakeup(&log);
80102ffb: e8 30 12 00 00 call 80104230 <wakeup>
release(&log.lock);
80103000: c7 04 24 40 39 11 80 movl $0x80113940,(%esp)
80103007: e8 c4 1a 00 00 call 80104ad0 <release>
8010300c: 83 c4 10 add $0x10,%esp
}
}
8010300f: 8d 65 f4 lea -0xc(%ebp),%esp
80103012: 5b pop %ebx
80103013: 5e pop %esi
80103014: 5f pop %edi
80103015: 5d pop %ebp
80103016: c3 ret
80103017: 89 f6 mov %esi,%esi
80103019: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
log.committing = 1;
} else {
// begin_op() may be waiting for log space,
// and decrementing log.outstanding has decreased
// the amount of reserved space.
wakeup(&log);
80103020: 83 ec 0c sub $0xc,%esp
80103023: 68 40 39 11 80 push $0x80113940
80103028: e8 03 12 00 00 call 80104230 <wakeup>
}
release(&log.lock);
8010302d: c7 04 24 40 39 11 80 movl $0x80113940,(%esp)
80103034: e8 97 1a 00 00 call 80104ad0 <release>
80103039: 83 c4 10 add $0x10,%esp
acquire(&log.lock);
log.committing = 0;
wakeup(&log);
release(&log.lock);
}
}
8010303c: 8d 65 f4 lea -0xc(%ebp),%esp
8010303f: 5b pop %ebx
80103040: 5e pop %esi
80103041: 5f pop %edi
80103042: 5d pop %ebp
80103043: c3 ret
int do_commit = 0;
acquire(&log.lock);
log.outstanding -= 1;
if(log.committing)
panic("log.committing");
80103044: 83 ec 0c sub $0xc,%esp
80103047: 68 44 7b 10 80 push $0x80107b44
8010304c: e8 1f d3 ff ff call 80100370 <panic>
80103051: eb 0d jmp 80103060 <log_write>
80103053: 90 nop
80103054: 90 nop
80103055: 90 nop
80103056: 90 nop
80103057: 90 nop
80103058: 90 nop
80103059: 90 nop
8010305a: 90 nop
8010305b: 90 nop
8010305c: 90 nop
8010305d: 90 nop
8010305e: 90 nop
8010305f: 90 nop
80103060 <log_write>:
// modify bp->data[]
// log_write(bp)
// brelse(bp)
void
log_write(struct buf *b)
{
80103060: 55 push %ebp
80103061: 89 e5 mov %esp,%ebp
80103063: 53 push %ebx
80103064: 83 ec 04 sub $0x4,%esp
int i;
if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1)
80103067: 8b 15 88 39 11 80 mov 0x80113988,%edx
// modify bp->data[]
// log_write(bp)
// brelse(bp)
void
log_write(struct buf *b)
{
8010306d: 8b 5d 08 mov 0x8(%ebp),%ebx
int i;
if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1)
80103070: 83 fa 1d cmp $0x1d,%edx
80103073: 0f 8f 97 00 00 00 jg 80103110 <log_write+0xb0>
80103079: a1 78 39 11 80 mov 0x80113978,%eax
8010307e: 83 e8 01 sub $0x1,%eax
80103081: 39 c2 cmp %eax,%edx
80103083: 0f 8d 87 00 00 00 jge 80103110 <log_write+0xb0>
panic("too big a transaction");
if (log.outstanding < 1)
80103089: a1 7c 39 11 80 mov 0x8011397c,%eax
8010308e: 85 c0 test %eax,%eax
80103090: 0f 8e 87 00 00 00 jle 8010311d <log_write+0xbd>
panic("log_write outside of trans");
acquire(&log.lock);
80103096: 83 ec 0c sub $0xc,%esp
80103099: 68 40 39 11 80 push $0x80113940
8010309e: e8 7d 19 00 00 call 80104a20 <acquire>
for (i = 0; i < log.lh.n; i++) {
801030a3: 8b 15 88 39 11 80 mov 0x80113988,%edx
801030a9: 83 c4 10 add $0x10,%esp
801030ac: 83 fa 00 cmp $0x0,%edx
801030af: 7e 50 jle 80103101 <log_write+0xa1>
if (log.lh.block[i] == b->blockno) // log absorbtion
801030b1: 8b 4b 08 mov 0x8(%ebx),%ecx
panic("too big a transaction");
if (log.outstanding < 1)
panic("log_write outside of trans");
acquire(&log.lock);
for (i = 0; i < log.lh.n; i++) {
801030b4: 31 c0 xor %eax,%eax
if (log.lh.block[i] == b->blockno) // log absorbtion
801030b6: 3b 0d 8c 39 11 80 cmp 0x8011398c,%ecx
801030bc: 75 0b jne 801030c9 <log_write+0x69>
801030be: eb 38 jmp 801030f8 <log_write+0x98>
801030c0: 39 0c 85 8c 39 11 80 cmp %ecx,-0x7feec674(,%eax,4)
801030c7: 74 2f je 801030f8 <log_write+0x98>
panic("too big a transaction");
if (log.outstanding < 1)
panic("log_write outside of trans");
acquire(&log.lock);
for (i = 0; i < log.lh.n; i++) {
801030c9: 83 c0 01 add $0x1,%eax
801030cc: 39 d0 cmp %edx,%eax
801030ce: 75 f0 jne 801030c0 <log_write+0x60>
if (log.lh.block[i] == b->blockno) // log absorbtion
break;
}
log.lh.block[i] = b->blockno;
801030d0: 89 0c 95 8c 39 11 80 mov %ecx,-0x7feec674(,%edx,4)
if (i == log.lh.n)
log.lh.n++;
801030d7: 83 c2 01 add $0x1,%edx
801030da: 89 15 88 39 11 80 mov %edx,0x80113988
b->flags |= B_DIRTY; // prevent eviction
801030e0: 83 0b 04 orl $0x4,(%ebx)
release(&log.lock);
801030e3: c7 45 08 40 39 11 80 movl $0x80113940,0x8(%ebp)
}
801030ea: 8b 5d fc mov -0x4(%ebp),%ebx
801030ed: c9 leave
}
log.lh.block[i] = b->blockno;
if (i == log.lh.n)
log.lh.n++;
b->flags |= B_DIRTY; // prevent eviction
release(&log.lock);
801030ee: e9 dd 19 00 00 jmp 80104ad0 <release>
801030f3: 90 nop
801030f4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
acquire(&log.lock);
for (i = 0; i < log.lh.n; i++) {
if (log.lh.block[i] == b->blockno) // log absorbtion
break;
}
log.lh.block[i] = b->blockno;
801030f8: 89 0c 85 8c 39 11 80 mov %ecx,-0x7feec674(,%eax,4)
801030ff: eb df jmp 801030e0 <log_write+0x80>
80103101: 8b 43 08 mov 0x8(%ebx),%eax
80103104: a3 8c 39 11 80 mov %eax,0x8011398c
if (i == log.lh.n)
80103109: 75 d5 jne 801030e0 <log_write+0x80>
8010310b: eb ca jmp 801030d7 <log_write+0x77>
8010310d: 8d 76 00 lea 0x0(%esi),%esi
log_write(struct buf *b)
{
int i;
if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1)
panic("too big a transaction");
80103110: 83 ec 0c sub $0xc,%esp
80103113: 68 53 7b 10 80 push $0x80107b53
80103118: e8 53 d2 ff ff call 80100370 <panic>
if (log.outstanding < 1)
panic("log_write outside of trans");
8010311d: 83 ec 0c sub $0xc,%esp
80103120: 68 69 7b 10 80 push $0x80107b69
80103125: e8 46 d2 ff ff call 80100370 <panic>
8010312a: 66 90 xchg %ax,%ax
8010312c: 66 90 xchg %ax,%ax
8010312e: 66 90 xchg %ax,%ax
80103130 <mpmain>:
}
// Common CPU setup code.
static void
mpmain(void)
{
80103130: 55 push %ebp
80103131: 89 e5 mov %esp,%ebp
80103133: 53 push %ebx
80103134: 83 ec 04 sub $0x4,%esp
cprintf("cpu%d: starting %d\n", cpuid(), cpuid());
80103137: e8 64 09 00 00 call 80103aa0 <cpuid>
8010313c: 89 c3 mov %eax,%ebx
8010313e: e8 5d 09 00 00 call 80103aa0 <cpuid>
80103143: 83 ec 04 sub $0x4,%esp
80103146: 53 push %ebx
80103147: 50 push %eax
80103148: 68 84 7b 10 80 push $0x80107b84
8010314d: e8 0e d5 ff ff call 80100660 <cprintf>
idtinit(); // load idt register
80103152: e8 49 2d 00 00 call 80105ea0 <idtinit>
xchg(&(mycpu()->started), 1); // tell startothers() we're up
80103157: e8 c4 08 00 00 call 80103a20 <mycpu>
8010315c: 89 c2 mov %eax,%edx
xchg(volatile uint *addr, uint newval)
{
uint result;
// The + in "+m" denotes a read-modify-write operand.
asm volatile("lock; xchgl %0, %1" :
8010315e: b8 01 00 00 00 mov $0x1,%eax
80103163: f0 87 82 a0 00 00 00 lock xchg %eax,0xa0(%edx)
scheduler(); // start running processes
8010316a: e8 11 0c 00 00 call 80103d80 <scheduler>
8010316f: 90 nop
80103170 <mpenter>:
}
// Other CPUs jump here from entryother.S.
static void
mpenter(void)
{
80103170: 55 push %ebp
80103171: 89 e5 mov %esp,%ebp
80103173: 83 ec 08 sub $0x8,%esp
switchkvm();
80103176: e8 45 3e 00 00 call 80106fc0 <switchkvm>
seginit();
8010317b: e8 40 3d 00 00 call 80106ec0 <seginit>
lapicinit();
80103180: e8 9b f7 ff ff call 80102920 <lapicinit>
mpmain();
80103185: e8 a6 ff ff ff call 80103130 <mpmain>
8010318a: 66 90 xchg %ax,%ax
8010318c: 66 90 xchg %ax,%ax
8010318e: 66 90 xchg %ax,%ax
80103190 <main>:
// Bootstrap processor starts running C code here.
// Allocate a real stack and switch to it, first
// doing some setup required for memory allocator to work.
int
main(void)
{
80103190: 8d 4c 24 04 lea 0x4(%esp),%ecx
80103194: 83 e4 f0 and $0xfffffff0,%esp
80103197: ff 71 fc pushl -0x4(%ecx)
8010319a: 55 push %ebp
8010319b: 89 e5 mov %esp,%ebp
8010319d: 53 push %ebx
8010319e: 51 push %ecx
// 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);
for(c = cpus; c < cpus+ncpu; c++){
8010319f: bb 40 3a 11 80 mov $0x80113a40,%ebx
// Allocate a real stack and switch to it, first
// doing some setup required for memory allocator to work.
int
main(void)
{
kinit1(end, P2V(4*1024*1024)); // phys page allocator
801031a4: 83 ec 08 sub $0x8,%esp
801031a7: 68 00 00 40 80 push $0x80400000
801031ac: 68 68 69 11 80 push $0x80116968
801031b1: e8 3a f5 ff ff call 801026f0 <kinit1>
kvmalloc(); // kernel page table
801031b6: e8 a5 42 00 00 call 80107460 <kvmalloc>
mpinit(); // detect other processors
801031bb: e8 70 01 00 00 call 80103330 <mpinit>
lapicinit(); // interrupt controller
801031c0: e8 5b f7 ff ff call 80102920 <lapicinit>
seginit(); // segment descriptors
801031c5: e8 f6 3c 00 00 call 80106ec0 <seginit>
picinit(); // disable pic
801031ca: e8 31 03 00 00 call 80103500 <picinit>
ioapicinit(); // another interrupt controller
801031cf: e8 4c f3 ff ff call 80102520 <ioapicinit>
consoleinit(); // console hardware
801031d4: e8 f7 da ff ff call 80100cd0 <consoleinit>
uartinit(); // serial port
801031d9: e8 b2 2f 00 00 call 80106190 <uartinit>
pinit(); // process table
801031de: e8 1d 08 00 00 call 80103a00 <pinit>
tvinit(); // trap vectors
801031e3: e8 18 2c 00 00 call 80105e00 <tvinit>
binit(); // buffer cache
801031e8: e8 53 ce ff ff call 80100040 <binit>
fileinit(); // file table
801031ed: e8 8e de ff ff call 80101080 <fileinit>
ideinit(); // disk
801031f2: e8 09 f1 ff ff call 80102300 <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);
801031f7: 83 c4 0c add $0xc,%esp
801031fa: 68 8a 00 00 00 push $0x8a
801031ff: 68 8c b4 10 80 push $0x8010b48c
80103204: 68 00 70 00 80 push $0x80007000
80103209: e8 c2 19 00 00 call 80104bd0 <memmove>
for(c = cpus; c < cpus+ncpu; c++){
8010320e: 69 05 c0 3f 11 80 b0 imul $0xb0,0x80113fc0,%eax
80103215: 00 00 00
80103218: 83 c4 10 add $0x10,%esp
8010321b: 05 40 3a 11 80 add $0x80113a40,%eax
80103220: 39 d8 cmp %ebx,%eax
80103222: 76 6f jbe 80103293 <main+0x103>
80103224: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
if(c == mycpu()) // We've started already.
80103228: e8 f3 07 00 00 call 80103a20 <mycpu>
8010322d: 39 d8 cmp %ebx,%eax
8010322f: 74 49 je 8010327a <main+0xea>
continue;
// Tell entryother.S what stack to use, where to enter, and what
// pgdir to use. We cannot use kpgdir yet, because the AP processor
// is running in low memory, so we use entrypgdir for the APs too.
stack = kalloc();
80103231: e8 8a f5 ff ff call 801027c0 <kalloc>
*(void**)(code-4) = stack + KSTACKSIZE;
80103236: 05 00 10 00 00 add $0x1000,%eax
*(void(**)(void))(code-8) = mpenter;
8010323b: c7 05 f8 6f 00 80 70 movl $0x80103170,0x80006ff8
80103242: 31 10 80
*(int**)(code-12) = (void *) V2P(entrypgdir);
80103245: c7 05 f4 6f 00 80 00 movl $0x10a000,0x80006ff4
8010324c: a0 10 00
// 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();
*(void**)(code-4) = stack + KSTACKSIZE;
8010324f: a3 fc 6f 00 80 mov %eax,0x80006ffc
*(void(**)(void))(code-8) = mpenter;
*(int**)(code-12) = (void *) V2P(entrypgdir);
lapicstartap(c->apicid, V2P(code));
80103254: 0f b6 03 movzbl (%ebx),%eax
80103257: 83 ec 08 sub $0x8,%esp
8010325a: 68 00 70 00 00 push $0x7000
8010325f: 50 push %eax
80103260: e8 0b f8 ff ff call 80102a70 <lapicstartap>
80103265: 83 c4 10 add $0x10,%esp
80103268: 90 nop
80103269: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
// wait for cpu to finish mpmain()
while(c->started == 0)
80103270: 8b 83 a0 00 00 00 mov 0xa0(%ebx),%eax
80103276: 85 c0 test %eax,%eax
80103278: 74 f6 je 80103270 <main+0xe0>
// 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);
for(c = cpus; c < cpus+ncpu; c++){
8010327a: 69 05 c0 3f 11 80 b0 imul $0xb0,0x80113fc0,%eax
80103281: 00 00 00
80103284: 81 c3 b0 00 00 00 add $0xb0,%ebx
8010328a: 05 40 3a 11 80 add $0x80113a40,%eax
8010328f: 39 c3 cmp %eax,%ebx
80103291: 72 95 jb 80103228 <main+0x98>
tvinit(); // trap vectors
binit(); // buffer cache
fileinit(); // file table
ideinit(); // disk
startothers(); // start other processors
kinit2(P2V(4*1024*1024), P2V(PHYSTOP)); // must come after startothers()
80103293: 83 ec 08 sub $0x8,%esp
80103296: 68 00 00 00 8e push $0x8e000000
8010329b: 68 00 00 40 80 push $0x80400000
801032a0: e8 bb f4 ff ff call 80102760 <kinit2>
userinit(); // first user process
801032a5: e8 46 08 00 00 call 80103af0 <userinit>
mpmain(); // finish this processor's setup
801032aa: e8 81 fe ff ff call 80103130 <mpmain>
801032af: 90 nop
801032b0 <mpsearch1>:
}
// Look for an MP structure in the len bytes at addr.
static struct mp*
mpsearch1(uint a, int len)
{
801032b0: 55 push %ebp
801032b1: 89 e5 mov %esp,%ebp
801032b3: 57 push %edi
801032b4: 56 push %esi
uchar *e, *p, *addr;
addr = P2V(a);
801032b5: 8d b0 00 00 00 80 lea -0x80000000(%eax),%esi
}
// Look for an MP structure in the len bytes at addr.
static struct mp*
mpsearch1(uint a, int len)
{
801032bb: 53 push %ebx
uchar *e, *p, *addr;
addr = P2V(a);
e = addr+len;
801032bc: 8d 1c 16 lea (%esi,%edx,1),%ebx
}
// Look for an MP structure in the len bytes at addr.
static struct mp*
mpsearch1(uint a, int len)
{
801032bf: 83 ec 0c sub $0xc,%esp
uchar *e, *p, *addr;
addr = P2V(a);
e = addr+len;
for(p = addr; p < e; p += sizeof(struct mp))
801032c2: 39 de cmp %ebx,%esi
801032c4: 73 48 jae 8010330e <mpsearch1+0x5e>
801032c6: 8d 76 00 lea 0x0(%esi),%esi
801032c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0)
801032d0: 83 ec 04 sub $0x4,%esp
801032d3: 8d 7e 10 lea 0x10(%esi),%edi
801032d6: 6a 04 push $0x4
801032d8: 68 98 7b 10 80 push $0x80107b98
801032dd: 56 push %esi
801032de: e8 8d 18 00 00 call 80104b70 <memcmp>
801032e3: 83 c4 10 add $0x10,%esp
801032e6: 85 c0 test %eax,%eax
801032e8: 75 1e jne 80103308 <mpsearch1+0x58>
801032ea: 8d 7e 10 lea 0x10(%esi),%edi
801032ed: 89 f2 mov %esi,%edx
801032ef: 31 c9 xor %ecx,%ecx
801032f1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
{
int i, sum;
sum = 0;
for(i=0; i<len; i++)
sum += addr[i];
801032f8: 0f b6 02 movzbl (%edx),%eax
801032fb: 83 c2 01 add $0x1,%edx
801032fe: 01 c1 add %eax,%ecx
sum(uchar *addr, int len)
{
int i, sum;
sum = 0;
for(i=0; i<len; i++)
80103300: 39 fa cmp %edi,%edx
80103302: 75 f4 jne 801032f8 <mpsearch1+0x48>
uchar *e, *p, *addr;
addr = P2V(a);
e = addr+len;
for(p = addr; p < e; p += sizeof(struct mp))
if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0)
80103304: 84 c9 test %cl,%cl
80103306: 74 10 je 80103318 <mpsearch1+0x68>
{
uchar *e, *p, *addr;
addr = P2V(a);
e = addr+len;
for(p = addr; p < e; p += sizeof(struct mp))
80103308: 39 fb cmp %edi,%ebx
8010330a: 89 fe mov %edi,%esi
8010330c: 77 c2 ja 801032d0 <mpsearch1+0x20>
if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0)
return (struct mp*)p;
return 0;
}
8010330e: 8d 65 f4 lea -0xc(%ebp),%esp
addr = P2V(a);
e = addr+len;
for(p = addr; p < e; p += sizeof(struct mp))
if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0)
return (struct mp*)p;
return 0;
80103311: 31 c0 xor %eax,%eax
}
80103313: 5b pop %ebx
80103314: 5e pop %esi
80103315: 5f pop %edi
80103316: 5d pop %ebp
80103317: c3 ret
80103318: 8d 65 f4 lea -0xc(%ebp),%esp
8010331b: 89 f0 mov %esi,%eax
8010331d: 5b pop %ebx
8010331e: 5e pop %esi
8010331f: 5f pop %edi
80103320: 5d pop %ebp
80103321: c3 ret
80103322: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80103329: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80103330 <mpinit>:
return conf;
}
void
mpinit(void)
{
80103330: 55 push %ebp
80103331: 89 e5 mov %esp,%ebp
80103333: 57 push %edi
80103334: 56 push %esi
80103335: 53 push %ebx
80103336: 83 ec 1c sub $0x1c,%esp
uchar *bda;
uint p;
struct mp *mp;
bda = (uchar *) P2V(0x400);
if((p = ((bda[0x0F]<<8)| bda[0x0E]) << 4)){
80103339: 0f b6 05 0f 04 00 80 movzbl 0x8000040f,%eax
80103340: 0f b6 15 0e 04 00 80 movzbl 0x8000040e,%edx
80103347: c1 e0 08 shl $0x8,%eax
8010334a: 09 d0 or %edx,%eax
8010334c: c1 e0 04 shl $0x4,%eax
8010334f: 85 c0 test %eax,%eax
80103351: 75 1b jne 8010336e <mpinit+0x3e>
if((mp = mpsearch1(p, 1024)))
return mp;
} else {
p = ((bda[0x14]<<8)|bda[0x13])*1024;
if((mp = mpsearch1(p-1024, 1024)))
80103353: 0f b6 05 14 04 00 80 movzbl 0x80000414,%eax
8010335a: 0f b6 15 13 04 00 80 movzbl 0x80000413,%edx
80103361: c1 e0 08 shl $0x8,%eax
80103364: 09 d0 or %edx,%eax
80103366: c1 e0 0a shl $0xa,%eax
80103369: 2d 00 04 00 00 sub $0x400,%eax
uint p;
struct mp *mp;
bda = (uchar *) P2V(0x400);
if((p = ((bda[0x0F]<<8)| bda[0x0E]) << 4)){
if((mp = mpsearch1(p, 1024)))
8010336e: ba 00 04 00 00 mov $0x400,%edx
80103373: e8 38 ff ff ff call 801032b0 <mpsearch1>
80103378: 85 c0 test %eax,%eax
8010337a: 89 45 e4 mov %eax,-0x1c(%ebp)
8010337d: 0f 84 37 01 00 00 je 801034ba <mpinit+0x18a>
mpconfig(struct mp **pmp)
{
struct mpconf *conf;
struct mp *mp;
if((mp = mpsearch()) == 0 || mp->physaddr == 0)
80103383: 8b 45 e4 mov -0x1c(%ebp),%eax
80103386: 8b 58 04 mov 0x4(%eax),%ebx
80103389: 85 db test %ebx,%ebx
8010338b: 0f 84 43 01 00 00 je 801034d4 <mpinit+0x1a4>
return 0;
conf = (struct mpconf*) P2V((uint) mp->physaddr);
80103391: 8d b3 00 00 00 80 lea -0x80000000(%ebx),%esi
if(memcmp(conf, "PCMP", 4) != 0)
80103397: 83 ec 04 sub $0x4,%esp
8010339a: 6a 04 push $0x4
8010339c: 68 9d 7b 10 80 push $0x80107b9d
801033a1: 56 push %esi
801033a2: e8 c9 17 00 00 call 80104b70 <memcmp>
801033a7: 83 c4 10 add $0x10,%esp
801033aa: 85 c0 test %eax,%eax
801033ac: 0f 85 22 01 00 00 jne 801034d4 <mpinit+0x1a4>
return 0;
if(conf->version != 1 && conf->version != 4)
801033b2: 0f b6 83 06 00 00 80 movzbl -0x7ffffffa(%ebx),%eax
801033b9: 3c 01 cmp $0x1,%al
801033bb: 74 08 je 801033c5 <mpinit+0x95>
801033bd: 3c 04 cmp $0x4,%al
801033bf: 0f 85 0f 01 00 00 jne 801034d4 <mpinit+0x1a4>
return 0;
if(sum((uchar*)conf, conf->length) != 0)
801033c5: 0f b7 bb 04 00 00 80 movzwl -0x7ffffffc(%ebx),%edi
sum(uchar *addr, int len)
{
int i, sum;
sum = 0;
for(i=0; i<len; i++)
801033cc: 85 ff test %edi,%edi
801033ce: 74 21 je 801033f1 <mpinit+0xc1>
801033d0: 31 d2 xor %edx,%edx
801033d2: 31 c0 xor %eax,%eax
801033d4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
sum += addr[i];
801033d8: 0f b6 8c 03 00 00 00 movzbl -0x80000000(%ebx,%eax,1),%ecx
801033df: 80
sum(uchar *addr, int len)
{
int i, sum;
sum = 0;
for(i=0; i<len; i++)
801033e0: 83 c0 01 add $0x1,%eax
sum += addr[i];
801033e3: 01 ca add %ecx,%edx
sum(uchar *addr, int len)
{
int i, sum;
sum = 0;
for(i=0; i<len; i++)
801033e5: 39 c7 cmp %eax,%edi
801033e7: 75 ef jne 801033d8 <mpinit+0xa8>
conf = (struct mpconf*) P2V((uint) mp->physaddr);
if(memcmp(conf, "PCMP", 4) != 0)
return 0;
if(conf->version != 1 && conf->version != 4)
return 0;
if(sum((uchar*)conf, conf->length) != 0)
801033e9: 84 d2 test %dl,%dl
801033eb: 0f 85 e3 00 00 00 jne 801034d4 <mpinit+0x1a4>
struct mp *mp;
struct mpconf *conf;
struct mpproc *proc;
struct mpioapic *ioapic;
if((conf = mpconfig(&mp)) == 0)
801033f1: 85 f6 test %esi,%esi
801033f3: 0f 84 db 00 00 00 je 801034d4 <mpinit+0x1a4>
panic("Expect to run on an SMP");
ismp = 1;
lapic = (uint*)conf->lapicaddr;
801033f9: 8b 83 24 00 00 80 mov -0x7fffffdc(%ebx),%eax
801033ff: a3 3c 39 11 80 mov %eax,0x8011393c
for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){
80103404: 0f b7 93 04 00 00 80 movzwl -0x7ffffffc(%ebx),%edx
8010340b: 8d 83 2c 00 00 80 lea -0x7fffffd4(%ebx),%eax
struct mpproc *proc;
struct mpioapic *ioapic;
if((conf = mpconfig(&mp)) == 0)
panic("Expect to run on an SMP");
ismp = 1;
80103411: bb 01 00 00 00 mov $0x1,%ebx
lapic = (uint*)conf->lapicaddr;
for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){
80103416: 01 d6 add %edx,%esi
80103418: 90 nop
80103419: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80103420: 39 c6 cmp %eax,%esi
80103422: 76 23 jbe 80103447 <mpinit+0x117>
80103424: 0f b6 10 movzbl (%eax),%edx
switch(*p){
80103427: 80 fa 04 cmp $0x4,%dl
8010342a: 0f 87 c0 00 00 00 ja 801034f0 <mpinit+0x1c0>
80103430: ff 24 95 dc 7b 10 80 jmp *-0x7fef8424(,%edx,4)
80103437: 89 f6 mov %esi,%esi
80103439: 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;
80103440: 83 c0 08 add $0x8,%eax
if((conf = mpconfig(&mp)) == 0)
panic("Expect to run on an SMP");
ismp = 1;
lapic = (uint*)conf->lapicaddr;
for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){
80103443: 39 c6 cmp %eax,%esi
80103445: 77 dd ja 80103424 <mpinit+0xf4>
default:
ismp = 0;
break;
}
}
if(!ismp)
80103447: 85 db test %ebx,%ebx
80103449: 0f 84 92 00 00 00 je 801034e1 <mpinit+0x1b1>
panic("Didn't find a suitable machine");
if(mp->imcrp){
8010344f: 8b 45 e4 mov -0x1c(%ebp),%eax
80103452: 80 78 0c 00 cmpb $0x0,0xc(%eax)
80103456: 74 15 je 8010346d <mpinit+0x13d>
}
static inline void
outb(ushort port, uchar data)
{
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80103458: ba 22 00 00 00 mov $0x22,%edx
8010345d: b8 70 00 00 00 mov $0x70,%eax
80103462: ee out %al,(%dx)
static inline uchar
inb(ushort port)
{
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80103463: ba 23 00 00 00 mov $0x23,%edx
80103468: ec in (%dx),%al
}
static inline void
outb(ushort port, uchar data)
{
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80103469: 83 c8 01 or $0x1,%eax
8010346c: ee out %al,(%dx)
// 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.
}
}
8010346d: 8d 65 f4 lea -0xc(%ebp),%esp
80103470: 5b pop %ebx
80103471: 5e pop %esi
80103472: 5f pop %edi
80103473: 5d pop %ebp
80103474: c3 ret
80103475: 8d 76 00 lea 0x0(%esi),%esi
lapic = (uint*)conf->lapicaddr;
for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){
switch(*p){
case MPPROC:
proc = (struct mpproc*)p;
if(ncpu < NCPU) {
80103478: 8b 0d c0 3f 11 80 mov 0x80113fc0,%ecx
8010347e: 83 f9 07 cmp $0x7,%ecx
80103481: 7f 19 jg 8010349c <mpinit+0x16c>
cpus[ncpu].apicid = proc->apicid; // apicid may differ from ncpu
80103483: 0f b6 50 01 movzbl 0x1(%eax),%edx
80103487: 69 f9 b0 00 00 00 imul $0xb0,%ecx,%edi
ncpu++;
8010348d: 83 c1 01 add $0x1,%ecx
80103490: 89 0d c0 3f 11 80 mov %ecx,0x80113fc0
for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){
switch(*p){
case MPPROC:
proc = (struct mpproc*)p;
if(ncpu < NCPU) {
cpus[ncpu].apicid = proc->apicid; // apicid may differ from ncpu
80103496: 88 97 40 3a 11 80 mov %dl,-0x7feec5c0(%edi)
ncpu++;
}
p += sizeof(struct mpproc);
8010349c: 83 c0 14 add $0x14,%eax
continue;
8010349f: e9 7c ff ff ff jmp 80103420 <mpinit+0xf0>
801034a4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
case MPIOAPIC:
ioapic = (struct mpioapic*)p;
ioapicid = ioapic->apicno;
801034a8: 0f b6 50 01 movzbl 0x1(%eax),%edx
p += sizeof(struct mpioapic);
801034ac: 83 c0 08 add $0x8,%eax
}
p += sizeof(struct mpproc);
continue;
case MPIOAPIC:
ioapic = (struct mpioapic*)p;
ioapicid = ioapic->apicno;
801034af: 88 15 20 3a 11 80 mov %dl,0x80113a20
p += sizeof(struct mpioapic);
continue;
801034b5: e9 66 ff ff ff jmp 80103420 <mpinit+0xf0>
} else {
p = ((bda[0x14]<<8)|bda[0x13])*1024;
if((mp = mpsearch1(p-1024, 1024)))
return mp;
}
return mpsearch1(0xF0000, 0x10000);
801034ba: ba 00 00 01 00 mov $0x10000,%edx
801034bf: b8 00 00 0f 00 mov $0xf0000,%eax
801034c4: e8 e7 fd ff ff call 801032b0 <mpsearch1>
mpconfig(struct mp **pmp)
{
struct mpconf *conf;
struct mp *mp;
if((mp = mpsearch()) == 0 || mp->physaddr == 0)
801034c9: 85 c0 test %eax,%eax
} else {
p = ((bda[0x14]<<8)|bda[0x13])*1024;
if((mp = mpsearch1(p-1024, 1024)))
return mp;
}
return mpsearch1(0xF0000, 0x10000);
801034cb: 89 45 e4 mov %eax,-0x1c(%ebp)
mpconfig(struct mp **pmp)
{
struct mpconf *conf;
struct mp *mp;
if((mp = mpsearch()) == 0 || mp->physaddr == 0)
801034ce: 0f 85 af fe ff ff jne 80103383 <mpinit+0x53>
struct mpconf *conf;
struct mpproc *proc;
struct mpioapic *ioapic;
if((conf = mpconfig(&mp)) == 0)
panic("Expect to run on an SMP");
801034d4: 83 ec 0c sub $0xc,%esp
801034d7: 68 a2 7b 10 80 push $0x80107ba2
801034dc: e8 8f ce ff ff call 80100370 <panic>
ismp = 0;
break;
}
}
if(!ismp)
panic("Didn't find a suitable machine");
801034e1: 83 ec 0c sub $0xc,%esp
801034e4: 68 bc 7b 10 80 push $0x80107bbc
801034e9: e8 82 ce ff ff call 80100370 <panic>
801034ee: 66 90 xchg %ax,%ax
case MPIOINTR:
case MPLINTR:
p += 8;
continue;
default:
ismp = 0;
801034f0: 31 db xor %ebx,%ebx
801034f2: e9 30 ff ff ff jmp 80103427 <mpinit+0xf7>
801034f7: 66 90 xchg %ax,%ax
801034f9: 66 90 xchg %ax,%ax
801034fb: 66 90 xchg %ax,%ax
801034fd: 66 90 xchg %ax,%ax
801034ff: 90 nop
80103500 <picinit>:
80103500: 55 push %ebp
80103501: ba 21 00 00 00 mov $0x21,%edx
80103506: b8 ff ff ff ff mov $0xffffffff,%eax
8010350b: 89 e5 mov %esp,%ebp
8010350d: ee out %al,(%dx)
8010350e: ba a1 00 00 00 mov $0xa1,%edx
80103513: ee out %al,(%dx)
80103514: 5d pop %ebp
80103515: c3 ret
80103516: 66 90 xchg %ax,%ax
80103518: 66 90 xchg %ax,%ax
8010351a: 66 90 xchg %ax,%ax
8010351c: 66 90 xchg %ax,%ax
8010351e: 66 90 xchg %ax,%ax
80103520 <pipealloc>:
int writeopen; // write fd is still open
};
int
pipealloc(struct file **f0, struct file **f1)
{
80103520: 55 push %ebp
80103521: 89 e5 mov %esp,%ebp
80103523: 57 push %edi
80103524: 56 push %esi
80103525: 53 push %ebx
80103526: 83 ec 0c sub $0xc,%esp
80103529: 8b 75 08 mov 0x8(%ebp),%esi
8010352c: 8b 5d 0c mov 0xc(%ebp),%ebx
struct pipe *p;
p = 0;
*f0 = *f1 = 0;
8010352f: c7 03 00 00 00 00 movl $0x0,(%ebx)
80103535: c7 06 00 00 00 00 movl $0x0,(%esi)
if((*f0 = filealloc()) == 0 || (*f1 = filealloc()) == 0)
8010353b: e8 60 db ff ff call 801010a0 <filealloc>
80103540: 85 c0 test %eax,%eax
80103542: 89 06 mov %eax,(%esi)
80103544: 0f 84 a8 00 00 00 je 801035f2 <pipealloc+0xd2>
8010354a: e8 51 db ff ff call 801010a0 <filealloc>
8010354f: 85 c0 test %eax,%eax
80103551: 89 03 mov %eax,(%ebx)
80103553: 0f 84 87 00 00 00 je 801035e0 <pipealloc+0xc0>
goto bad;
if((p = (struct pipe*)kalloc()) == 0)
80103559: e8 62 f2 ff ff call 801027c0 <kalloc>
8010355e: 85 c0 test %eax,%eax
80103560: 89 c7 mov %eax,%edi
80103562: 0f 84 b0 00 00 00 je 80103618 <pipealloc+0xf8>
goto bad;
p->readopen = 1;
p->writeopen = 1;
p->nwrite = 0;
p->nread = 0;
initlock(&p->lock, "pipe");
80103568: 83 ec 08 sub $0x8,%esp
*f0 = *f1 = 0;
if((*f0 = filealloc()) == 0 || (*f1 = filealloc()) == 0)
goto bad;
if((p = (struct pipe*)kalloc()) == 0)
goto bad;
p->readopen = 1;
8010356b: c7 80 3c 02 00 00 01 movl $0x1,0x23c(%eax)
80103572: 00 00 00
p->writeopen = 1;
80103575: c7 80 40 02 00 00 01 movl $0x1,0x240(%eax)
8010357c: 00 00 00
p->nwrite = 0;
8010357f: c7 80 38 02 00 00 00 movl $0x0,0x238(%eax)
80103586: 00 00 00
p->nread = 0;
80103589: c7 80 34 02 00 00 00 movl $0x0,0x234(%eax)
80103590: 00 00 00
initlock(&p->lock, "pipe");
80103593: 68 f0 7b 10 80 push $0x80107bf0
80103598: 50 push %eax
80103599: e8 22 13 00 00 call 801048c0 <initlock>
(*f0)->type = FD_PIPE;
8010359e: 8b 06 mov (%esi),%eax
(*f0)->pipe = p;
(*f1)->type = FD_PIPE;
(*f1)->readable = 0;
(*f1)->writable = 1;
(*f1)->pipe = p;
return 0;
801035a0: 83 c4 10 add $0x10,%esp
p->readopen = 1;
p->writeopen = 1;
p->nwrite = 0;
p->nread = 0;
initlock(&p->lock, "pipe");
(*f0)->type = FD_PIPE;
801035a3: c7 00 01 00 00 00 movl $0x1,(%eax)
(*f0)->readable = 1;
801035a9: 8b 06 mov (%esi),%eax
801035ab: c6 40 08 01 movb $0x1,0x8(%eax)
(*f0)->writable = 0;
801035af: 8b 06 mov (%esi),%eax
801035b1: c6 40 09 00 movb $0x0,0x9(%eax)
(*f0)->pipe = p;
801035b5: 8b 06 mov (%esi),%eax
801035b7: 89 78 0c mov %edi,0xc(%eax)
(*f1)->type = FD_PIPE;
801035ba: 8b 03 mov (%ebx),%eax
801035bc: c7 00 01 00 00 00 movl $0x1,(%eax)
(*f1)->readable = 0;
801035c2: 8b 03 mov (%ebx),%eax
801035c4: c6 40 08 00 movb $0x0,0x8(%eax)
(*f1)->writable = 1;
801035c8: 8b 03 mov (%ebx),%eax
801035ca: c6 40 09 01 movb $0x1,0x9(%eax)
(*f1)->pipe = p;
801035ce: 8b 03 mov (%ebx),%eax
801035d0: 89 78 0c mov %edi,0xc(%eax)
if(*f0)
fileclose(*f0);
if(*f1)
fileclose(*f1);
return -1;
}
801035d3: 8d 65 f4 lea -0xc(%ebp),%esp
(*f0)->pipe = p;
(*f1)->type = FD_PIPE;
(*f1)->readable = 0;
(*f1)->writable = 1;
(*f1)->pipe = p;
return 0;
801035d6: 31 c0 xor %eax,%eax
if(*f0)
fileclose(*f0);
if(*f1)
fileclose(*f1);
return -1;
}
801035d8: 5b pop %ebx
801035d9: 5e pop %esi
801035da: 5f pop %edi
801035db: 5d pop %ebp
801035dc: c3 ret
801035dd: 8d 76 00 lea 0x0(%esi),%esi
//PAGEBREAK: 20
bad:
if(p)
kfree((char*)p);
if(*f0)
801035e0: 8b 06 mov (%esi),%eax
801035e2: 85 c0 test %eax,%eax
801035e4: 74 1e je 80103604 <pipealloc+0xe4>
fileclose(*f0);
801035e6: 83 ec 0c sub $0xc,%esp
801035e9: 50 push %eax
801035ea: e8 71 db ff ff call 80101160 <fileclose>
801035ef: 83 c4 10 add $0x10,%esp
if(*f1)
801035f2: 8b 03 mov (%ebx),%eax
801035f4: 85 c0 test %eax,%eax
801035f6: 74 0c je 80103604 <pipealloc+0xe4>
fileclose(*f1);
801035f8: 83 ec 0c sub $0xc,%esp
801035fb: 50 push %eax
801035fc: e8 5f db ff ff call 80101160 <fileclose>
80103601: 83 c4 10 add $0x10,%esp
return -1;
}
80103604: 8d 65 f4 lea -0xc(%ebp),%esp
kfree((char*)p);
if(*f0)
fileclose(*f0);
if(*f1)
fileclose(*f1);
return -1;
80103607: b8 ff ff ff ff mov $0xffffffff,%eax
}
8010360c: 5b pop %ebx
8010360d: 5e pop %esi
8010360e: 5f pop %edi
8010360f: 5d pop %ebp
80103610: c3 ret
80103611: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
//PAGEBREAK: 20
bad:
if(p)
kfree((char*)p);
if(*f0)
80103618: 8b 06 mov (%esi),%eax
8010361a: 85 c0 test %eax,%eax
8010361c: 75 c8 jne 801035e6 <pipealloc+0xc6>
8010361e: eb d2 jmp 801035f2 <pipealloc+0xd2>
80103620 <pipeclose>:
return -1;
}
void
pipeclose(struct pipe *p, int writable)
{
80103620: 55 push %ebp
80103621: 89 e5 mov %esp,%ebp
80103623: 56 push %esi
80103624: 53 push %ebx
80103625: 8b 5d 08 mov 0x8(%ebp),%ebx
80103628: 8b 75 0c mov 0xc(%ebp),%esi
acquire(&p->lock);
8010362b: 83 ec 0c sub $0xc,%esp
8010362e: 53 push %ebx
8010362f: e8 ec 13 00 00 call 80104a20 <acquire>
if(writable){
80103634: 83 c4 10 add $0x10,%esp
80103637: 85 f6 test %esi,%esi
80103639: 74 45 je 80103680 <pipeclose+0x60>
p->writeopen = 0;
wakeup(&p->nread);
8010363b: 8d 83 34 02 00 00 lea 0x234(%ebx),%eax
80103641: 83 ec 0c sub $0xc,%esp
void
pipeclose(struct pipe *p, int writable)
{
acquire(&p->lock);
if(writable){
p->writeopen = 0;
80103644: c7 83 40 02 00 00 00 movl $0x0,0x240(%ebx)
8010364b: 00 00 00
wakeup(&p->nread);
8010364e: 50 push %eax
8010364f: e8 dc 0b 00 00 call 80104230 <wakeup>
80103654: 83 c4 10 add $0x10,%esp
} else {
p->readopen = 0;
wakeup(&p->nwrite);
}
if(p->readopen == 0 && p->writeopen == 0){
80103657: 8b 93 3c 02 00 00 mov 0x23c(%ebx),%edx
8010365d: 85 d2 test %edx,%edx
8010365f: 75 0a jne 8010366b <pipeclose+0x4b>
80103661: 8b 83 40 02 00 00 mov 0x240(%ebx),%eax
80103667: 85 c0 test %eax,%eax
80103669: 74 35 je 801036a0 <pipeclose+0x80>
release(&p->lock);
kfree((char*)p);
} else
release(&p->lock);
8010366b: 89 5d 08 mov %ebx,0x8(%ebp)
}
8010366e: 8d 65 f8 lea -0x8(%ebp),%esp
80103671: 5b pop %ebx
80103672: 5e pop %esi
80103673: 5d pop %ebp
}
if(p->readopen == 0 && p->writeopen == 0){
release(&p->lock);
kfree((char*)p);
} else
release(&p->lock);
80103674: e9 57 14 00 00 jmp 80104ad0 <release>
80103679: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
if(writable){
p->writeopen = 0;
wakeup(&p->nread);
} else {
p->readopen = 0;
wakeup(&p->nwrite);
80103680: 8d 83 38 02 00 00 lea 0x238(%ebx),%eax
80103686: 83 ec 0c sub $0xc,%esp
acquire(&p->lock);
if(writable){
p->writeopen = 0;
wakeup(&p->nread);
} else {
p->readopen = 0;
80103689: c7 83 3c 02 00 00 00 movl $0x0,0x23c(%ebx)
80103690: 00 00 00
wakeup(&p->nwrite);
80103693: 50 push %eax
80103694: e8 97 0b 00 00 call 80104230 <wakeup>
80103699: 83 c4 10 add $0x10,%esp
8010369c: eb b9 jmp 80103657 <pipeclose+0x37>
8010369e: 66 90 xchg %ax,%ax
}
if(p->readopen == 0 && p->writeopen == 0){
release(&p->lock);
801036a0: 83 ec 0c sub $0xc,%esp
801036a3: 53 push %ebx
801036a4: e8 27 14 00 00 call 80104ad0 <release>
kfree((char*)p);
801036a9: 89 5d 08 mov %ebx,0x8(%ebp)
801036ac: 83 c4 10 add $0x10,%esp
} else
release(&p->lock);
}
801036af: 8d 65 f8 lea -0x8(%ebp),%esp
801036b2: 5b pop %ebx
801036b3: 5e pop %esi
801036b4: 5d pop %ebp
p->readopen = 0;
wakeup(&p->nwrite);
}
if(p->readopen == 0 && p->writeopen == 0){
release(&p->lock);
kfree((char*)p);
801036b5: e9 56 ef ff ff jmp 80102610 <kfree>
801036ba: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801036c0 <pipewrite>:
}
//PAGEBREAK: 40
int
pipewrite(struct pipe *p, char *addr, int n)
{
801036c0: 55 push %ebp
801036c1: 89 e5 mov %esp,%ebp
801036c3: 57 push %edi
801036c4: 56 push %esi
801036c5: 53 push %ebx
801036c6: 83 ec 28 sub $0x28,%esp
801036c9: 8b 5d 08 mov 0x8(%ebp),%ebx
int i;
acquire(&p->lock);
801036cc: 53 push %ebx
801036cd: e8 4e 13 00 00 call 80104a20 <acquire>
for(i = 0; i < n; i++){
801036d2: 8b 45 10 mov 0x10(%ebp),%eax
801036d5: 83 c4 10 add $0x10,%esp
801036d8: 85 c0 test %eax,%eax
801036da: 0f 8e b9 00 00 00 jle 80103799 <pipewrite+0xd9>
801036e0: 8b 4d 0c mov 0xc(%ebp),%ecx
801036e3: 8b 83 38 02 00 00 mov 0x238(%ebx),%eax
while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full
if(p->readopen == 0 || myproc()->killed){
release(&p->lock);
return -1;
}
wakeup(&p->nread);
801036e9: 8d bb 34 02 00 00 lea 0x234(%ebx),%edi
sleep(&p->nwrite, &p->lock); //DOC: pipewrite-sleep
801036ef: 8d b3 38 02 00 00 lea 0x238(%ebx),%esi
801036f5: 89 4d e4 mov %ecx,-0x1c(%ebp)
801036f8: 03 4d 10 add 0x10(%ebp),%ecx
801036fb: 89 4d e0 mov %ecx,-0x20(%ebp)
{
int i;
acquire(&p->lock);
for(i = 0; i < n; i++){
while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full
801036fe: 8b 8b 34 02 00 00 mov 0x234(%ebx),%ecx
80103704: 8d 91 00 02 00 00 lea 0x200(%ecx),%edx
8010370a: 39 d0 cmp %edx,%eax
8010370c: 74 38 je 80103746 <pipewrite+0x86>
8010370e: eb 59 jmp 80103769 <pipewrite+0xa9>
if(p->readopen == 0 || myproc()->killed){
80103710: e8 ab 03 00 00 call 80103ac0 <myproc>
80103715: 8b 48 24 mov 0x24(%eax),%ecx
80103718: 85 c9 test %ecx,%ecx
8010371a: 75 34 jne 80103750 <pipewrite+0x90>
release(&p->lock);
return -1;
}
wakeup(&p->nread);
8010371c: 83 ec 0c sub $0xc,%esp
8010371f: 57 push %edi
80103720: e8 0b 0b 00 00 call 80104230 <wakeup>
sleep(&p->nwrite, &p->lock); //DOC: pipewrite-sleep
80103725: 58 pop %eax
80103726: 5a pop %edx
80103727: 53 push %ebx
80103728: 56 push %esi
80103729: e8 42 09 00 00 call 80104070 <sleep>
{
int i;
acquire(&p->lock);
for(i = 0; i < n; i++){
while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full
8010372e: 8b 83 34 02 00 00 mov 0x234(%ebx),%eax
80103734: 8b 93 38 02 00 00 mov 0x238(%ebx),%edx
8010373a: 83 c4 10 add $0x10,%esp
8010373d: 05 00 02 00 00 add $0x200,%eax
80103742: 39 c2 cmp %eax,%edx
80103744: 75 2a jne 80103770 <pipewrite+0xb0>
if(p->readopen == 0 || myproc()->killed){
80103746: 8b 83 3c 02 00 00 mov 0x23c(%ebx),%eax
8010374c: 85 c0 test %eax,%eax
8010374e: 75 c0 jne 80103710 <pipewrite+0x50>
release(&p->lock);
80103750: 83 ec 0c sub $0xc,%esp
80103753: 53 push %ebx
80103754: e8 77 13 00 00 call 80104ad0 <release>
return -1;
80103759: 83 c4 10 add $0x10,%esp
8010375c: 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;
}
80103761: 8d 65 f4 lea -0xc(%ebp),%esp
80103764: 5b pop %ebx
80103765: 5e pop %esi
80103766: 5f pop %edi
80103767: 5d pop %ebp
80103768: c3 ret
{
int i;
acquire(&p->lock);
for(i = 0; i < n; i++){
while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full
80103769: 89 c2 mov %eax,%edx
8010376b: 90 nop
8010376c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
return -1;
}
wakeup(&p->nread);
sleep(&p->nwrite, &p->lock); //DOC: pipewrite-sleep
}
p->data[p->nwrite++ % PIPESIZE] = addr[i];
80103770: 8b 4d e4 mov -0x1c(%ebp),%ecx
80103773: 8d 42 01 lea 0x1(%edx),%eax
80103776: 83 45 e4 01 addl $0x1,-0x1c(%ebp)
8010377a: 81 e2 ff 01 00 00 and $0x1ff,%edx
80103780: 89 83 38 02 00 00 mov %eax,0x238(%ebx)
80103786: 0f b6 09 movzbl (%ecx),%ecx
80103789: 88 4c 13 34 mov %cl,0x34(%ebx,%edx,1)
8010378d: 8b 4d e4 mov -0x1c(%ebp),%ecx
pipewrite(struct pipe *p, char *addr, int n)
{
int i;
acquire(&p->lock);
for(i = 0; i < n; i++){
80103790: 3b 4d e0 cmp -0x20(%ebp),%ecx
80103793: 0f 85 65 ff ff ff jne 801036fe <pipewrite+0x3e>
wakeup(&p->nread);
sleep(&p->nwrite, &p->lock); //DOC: pipewrite-sleep
}
p->data[p->nwrite++ % PIPESIZE] = addr[i];
}
wakeup(&p->nread); //DOC: pipewrite-wakeup1
80103799: 8d 83 34 02 00 00 lea 0x234(%ebx),%eax
8010379f: 83 ec 0c sub $0xc,%esp
801037a2: 50 push %eax
801037a3: e8 88 0a 00 00 call 80104230 <wakeup>
release(&p->lock);
801037a8: 89 1c 24 mov %ebx,(%esp)
801037ab: e8 20 13 00 00 call 80104ad0 <release>
return n;
801037b0: 83 c4 10 add $0x10,%esp
801037b3: 8b 45 10 mov 0x10(%ebp),%eax
801037b6: eb a9 jmp 80103761 <pipewrite+0xa1>
801037b8: 90 nop
801037b9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
801037c0 <piperead>:
}
int
piperead(struct pipe *p, char *addr, int n)
{
801037c0: 55 push %ebp
801037c1: 89 e5 mov %esp,%ebp
801037c3: 57 push %edi
801037c4: 56 push %esi
801037c5: 53 push %ebx
801037c6: 83 ec 18 sub $0x18,%esp
801037c9: 8b 5d 08 mov 0x8(%ebp),%ebx
801037cc: 8b 7d 0c mov 0xc(%ebp),%edi
int i;
acquire(&p->lock);
801037cf: 53 push %ebx
801037d0: e8 4b 12 00 00 call 80104a20 <acquire>
while(p->nread == p->nwrite && p->writeopen){ //DOC: pipe-empty
801037d5: 83 c4 10 add $0x10,%esp
801037d8: 8b 83 34 02 00 00 mov 0x234(%ebx),%eax
801037de: 39 83 38 02 00 00 cmp %eax,0x238(%ebx)
801037e4: 75 6a jne 80103850 <piperead+0x90>
801037e6: 8b b3 40 02 00 00 mov 0x240(%ebx),%esi
801037ec: 85 f6 test %esi,%esi
801037ee: 0f 84 cc 00 00 00 je 801038c0 <piperead+0x100>
if(myproc()->killed){
release(&p->lock);
return -1;
}
sleep(&p->nread, &p->lock); //DOC: piperead-sleep
801037f4: 8d b3 34 02 00 00 lea 0x234(%ebx),%esi
801037fa: eb 2d jmp 80103829 <piperead+0x69>
801037fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80103800: 83 ec 08 sub $0x8,%esp
80103803: 53 push %ebx
80103804: 56 push %esi
80103805: e8 66 08 00 00 call 80104070 <sleep>
piperead(struct pipe *p, char *addr, int n)
{
int i;
acquire(&p->lock);
while(p->nread == p->nwrite && p->writeopen){ //DOC: pipe-empty
8010380a: 83 c4 10 add $0x10,%esp
8010380d: 8b 83 38 02 00 00 mov 0x238(%ebx),%eax
80103813: 39 83 34 02 00 00 cmp %eax,0x234(%ebx)
80103819: 75 35 jne 80103850 <piperead+0x90>
8010381b: 8b 93 40 02 00 00 mov 0x240(%ebx),%edx
80103821: 85 d2 test %edx,%edx
80103823: 0f 84 97 00 00 00 je 801038c0 <piperead+0x100>
if(myproc()->killed){
80103829: e8 92 02 00 00 call 80103ac0 <myproc>
8010382e: 8b 48 24 mov 0x24(%eax),%ecx
80103831: 85 c9 test %ecx,%ecx
80103833: 74 cb je 80103800 <piperead+0x40>
release(&p->lock);
80103835: 83 ec 0c sub $0xc,%esp
80103838: 53 push %ebx
80103839: e8 92 12 00 00 call 80104ad0 <release>
return -1;
8010383e: 83 c4 10 add $0x10,%esp
addr[i] = p->data[p->nread++ % PIPESIZE];
}
wakeup(&p->nwrite); //DOC: piperead-wakeup
release(&p->lock);
return i;
}
80103841: 8d 65 f4 lea -0xc(%ebp),%esp
acquire(&p->lock);
while(p->nread == p->nwrite && p->writeopen){ //DOC: pipe-empty
if(myproc()->killed){
release(&p->lock);
return -1;
80103844: b8 ff ff ff ff mov $0xffffffff,%eax
addr[i] = p->data[p->nread++ % PIPESIZE];
}
wakeup(&p->nwrite); //DOC: piperead-wakeup
release(&p->lock);
return i;
}
80103849: 5b pop %ebx
8010384a: 5e pop %esi
8010384b: 5f pop %edi
8010384c: 5d pop %ebp
8010384d: c3 ret
8010384e: 66 90 xchg %ax,%ax
release(&p->lock);
return -1;
}
sleep(&p->nread, &p->lock); //DOC: piperead-sleep
}
for(i = 0; i < n; i++){ //DOC: piperead-copy
80103850: 8b 45 10 mov 0x10(%ebp),%eax
80103853: 85 c0 test %eax,%eax
80103855: 7e 69 jle 801038c0 <piperead+0x100>
if(p->nread == p->nwrite)
80103857: 8b 83 34 02 00 00 mov 0x234(%ebx),%eax
8010385d: 31 c9 xor %ecx,%ecx
8010385f: eb 15 jmp 80103876 <piperead+0xb6>
80103861: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80103868: 8b 83 34 02 00 00 mov 0x234(%ebx),%eax
8010386e: 3b 83 38 02 00 00 cmp 0x238(%ebx),%eax
80103874: 74 5a je 801038d0 <piperead+0x110>
break;
addr[i] = p->data[p->nread++ % PIPESIZE];
80103876: 8d 70 01 lea 0x1(%eax),%esi
80103879: 25 ff 01 00 00 and $0x1ff,%eax
8010387e: 89 b3 34 02 00 00 mov %esi,0x234(%ebx)
80103884: 0f b6 44 03 34 movzbl 0x34(%ebx,%eax,1),%eax
80103889: 88 04 0f mov %al,(%edi,%ecx,1)
release(&p->lock);
return -1;
}
sleep(&p->nread, &p->lock); //DOC: piperead-sleep
}
for(i = 0; i < n; i++){ //DOC: piperead-copy
8010388c: 83 c1 01 add $0x1,%ecx
8010388f: 39 4d 10 cmp %ecx,0x10(%ebp)
80103892: 75 d4 jne 80103868 <piperead+0xa8>
if(p->nread == p->nwrite)
break;
addr[i] = p->data[p->nread++ % PIPESIZE];
}
wakeup(&p->nwrite); //DOC: piperead-wakeup
80103894: 8d 83 38 02 00 00 lea 0x238(%ebx),%eax
8010389a: 83 ec 0c sub $0xc,%esp
8010389d: 50 push %eax
8010389e: e8 8d 09 00 00 call 80104230 <wakeup>
release(&p->lock);
801038a3: 89 1c 24 mov %ebx,(%esp)
801038a6: e8 25 12 00 00 call 80104ad0 <release>
return i;
801038ab: 8b 45 10 mov 0x10(%ebp),%eax
801038ae: 83 c4 10 add $0x10,%esp
}
801038b1: 8d 65 f4 lea -0xc(%ebp),%esp
801038b4: 5b pop %ebx
801038b5: 5e pop %esi
801038b6: 5f pop %edi
801038b7: 5d pop %ebp
801038b8: c3 ret
801038b9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
release(&p->lock);
return -1;
}
sleep(&p->nread, &p->lock); //DOC: piperead-sleep
}
for(i = 0; i < n; i++){ //DOC: piperead-copy
801038c0: c7 45 10 00 00 00 00 movl $0x0,0x10(%ebp)
801038c7: eb cb jmp 80103894 <piperead+0xd4>
801038c9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
801038d0: 89 4d 10 mov %ecx,0x10(%ebp)
801038d3: eb bf jmp 80103894 <piperead+0xd4>
801038d5: 66 90 xchg %ax,%ax
801038d7: 66 90 xchg %ax,%ax
801038d9: 66 90 xchg %ax,%ax
801038db: 66 90 xchg %ax,%ax
801038dd: 66 90 xchg %ax,%ax
801038df: 90 nop
801038e0 <allocproc>:
// If found, change state to EMBRYO and initialize
// state required to run in the kernel.
// Otherwise return 0.
static struct proc *
allocproc(void)
{
801038e0: 55 push %ebp
801038e1: 89 e5 mov %esp,%ebp
801038e3: 53 push %ebx
struct proc *p;
char *sp;
acquire(&ptable.lock);
for (p = ptable.proc; p < &ptable.proc[NPROC]; p++)
801038e4: bb 14 40 11 80 mov $0x80114014,%ebx
// If found, change state to EMBRYO and initialize
// state required to run in the kernel.
// Otherwise return 0.
static struct proc *
allocproc(void)
{
801038e9: 83 ec 10 sub $0x10,%esp
struct proc *p;
char *sp;
acquire(&ptable.lock);
801038ec: 68 e0 3f 11 80 push $0x80113fe0
801038f1: e8 2a 11 00 00 call 80104a20 <acquire>
801038f6: 83 c4 10 add $0x10,%esp
801038f9: eb 13 jmp 8010390e <allocproc+0x2e>
801038fb: 90 nop
801038fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
for (p = ptable.proc; p < &ptable.proc[NPROC]; p++)
80103900: 81 c3 84 00 00 00 add $0x84,%ebx
80103906: 81 fb 14 61 11 80 cmp $0x80116114,%ebx
8010390c: 74 7a je 80103988 <allocproc+0xa8>
if (p->state == UNUSED)
8010390e: 8b 43 0c mov 0xc(%ebx),%eax
80103911: 85 c0 test %eax,%eax
80103913: 75 eb jne 80103900 <allocproc+0x20>
release(&ptable.lock);
return 0;
found:
p->state = EMBRYO;
p->pid = nextpid++;
80103915: a1 04 b0 10 80 mov 0x8010b004,%eax
release(&ptable.lock);
8010391a: 83 ec 0c sub $0xc,%esp
release(&ptable.lock);
return 0;
found:
p->state = EMBRYO;
8010391d: c7 43 0c 01 00 00 00 movl $0x1,0xc(%ebx)
p->pid = nextpid++;
release(&ptable.lock);
80103924: 68 e0 3f 11 80 push $0x80113fe0
release(&ptable.lock);
return 0;
found:
p->state = EMBRYO;
p->pid = nextpid++;
80103929: 8d 50 01 lea 0x1(%eax),%edx
8010392c: 89 43 10 mov %eax,0x10(%ebx)
8010392f: 89 15 04 b0 10 80 mov %edx,0x8010b004
release(&ptable.lock);
80103935: e8 96 11 00 00 call 80104ad0 <release>
// Allocate kernel stack.
if ((p->kstack = kalloc()) == 0)
8010393a: e8 81 ee ff ff call 801027c0 <kalloc>
8010393f: 83 c4 10 add $0x10,%esp
80103942: 85 c0 test %eax,%eax
80103944: 89 43 08 mov %eax,0x8(%ebx)
80103947: 74 56 je 8010399f <allocproc+0xbf>
return 0;
}
sp = p->kstack + KSTACKSIZE;
// Leave room for trap frame.
sp -= sizeof *p->tf;
80103949: 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);
8010394f: 83 ec 04 sub $0x4,%esp
// Set up new context to start executing at forkret,
// which returns to trapret.
sp -= 4;
*(uint *)sp = (uint)trapret;
sp -= sizeof *p->context;
80103952: 05 9c 0f 00 00 add $0xf9c,%eax
return 0;
}
sp = p->kstack + KSTACKSIZE;
// Leave room for trap frame.
sp -= sizeof *p->tf;
80103957: 89 53 18 mov %edx,0x18(%ebx)
p->tf = (struct trapframe *)sp;
// Set up new context to start executing at forkret,
// which returns to trapret.
sp -= 4;
*(uint *)sp = (uint)trapret;
8010395a: c7 40 14 ea 5d 10 80 movl $0x80105dea,0x14(%eax)
sp -= sizeof *p->context;
p->context = (struct context *)sp;
memset(p->context, 0, sizeof *p->context);
80103961: 6a 14 push $0x14
80103963: 6a 00 push $0x0
80103965: 50 push %eax
// which returns to trapret.
sp -= 4;
*(uint *)sp = (uint)trapret;
sp -= sizeof *p->context;
p->context = (struct context *)sp;
80103966: 89 43 1c mov %eax,0x1c(%ebx)
memset(p->context, 0, sizeof *p->context);
80103969: e8 b2 11 00 00 call 80104b20 <memset>
p->context->eip = (uint)forkret;
8010396e: 8b 43 1c mov 0x1c(%ebx),%eax
return p;
80103971: 83 c4 10 add $0x10,%esp
*(uint *)sp = (uint)trapret;
sp -= sizeof *p->context;
p->context = (struct context *)sp;
memset(p->context, 0, sizeof *p->context);
p->context->eip = (uint)forkret;
80103974: c7 40 10 b0 39 10 80 movl $0x801039b0,0x10(%eax)
return p;
8010397b: 89 d8 mov %ebx,%eax
}
8010397d: 8b 5d fc mov -0x4(%ebp),%ebx
80103980: c9 leave
80103981: c3 ret
80103982: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
for (p = ptable.proc; p < &ptable.proc[NPROC]; p++)
if (p->state == UNUSED)
goto found;
release(&ptable.lock);
80103988: 83 ec 0c sub $0xc,%esp
8010398b: 68 e0 3f 11 80 push $0x80113fe0
80103990: e8 3b 11 00 00 call 80104ad0 <release>
return 0;
80103995: 83 c4 10 add $0x10,%esp
80103998: 31 c0 xor %eax,%eax
p->context = (struct context *)sp;
memset(p->context, 0, sizeof *p->context);
p->context->eip = (uint)forkret;
return p;
}
8010399a: 8b 5d fc mov -0x4(%ebp),%ebx
8010399d: c9 leave
8010399e: c3 ret
release(&ptable.lock);
// Allocate kernel stack.
if ((p->kstack = kalloc()) == 0)
{
p->state = UNUSED;
8010399f: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx)
return 0;
801039a6: eb d5 jmp 8010397d <allocproc+0x9d>
801039a8: 90 nop
801039a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
801039b0 <forkret>:
}
// A fork child's very first scheduling by scheduler()
// will swtch here. "Return" to user space.
void forkret(void)
{
801039b0: 55 push %ebp
801039b1: 89 e5 mov %esp,%ebp
801039b3: 83 ec 14 sub $0x14,%esp
static int first = 1;
// Still holding ptable.lock from scheduler.
release(&ptable.lock);
801039b6: 68 e0 3f 11 80 push $0x80113fe0
801039bb: e8 10 11 00 00 call 80104ad0 <release>
if (first)
801039c0: a1 00 b0 10 80 mov 0x8010b000,%eax
801039c5: 83 c4 10 add $0x10,%esp
801039c8: 85 c0 test %eax,%eax
801039ca: 75 04 jne 801039d0 <forkret+0x20>
iinit(ROOTDEV);
initlog(ROOTDEV);
}
// Return to "caller", actually trapret (see allocproc).
}
801039cc: c9 leave
801039cd: c3 ret
801039ce: 66 90 xchg %ax,%ax
{
// Some initialization functions must be run in the context
// of a regular process (e.g., they call sleep), and thus cannot
// be run from main().
first = 0;
iinit(ROOTDEV);
801039d0: 83 ec 0c sub $0xc,%esp
if (first)
{
// Some initialization functions must be run in the context
// of a regular process (e.g., they call sleep), and thus cannot
// be run from main().
first = 0;
801039d3: c7 05 00 b0 10 80 00 movl $0x0,0x8010b000
801039da: 00 00 00
iinit(ROOTDEV);
801039dd: 6a 01 push $0x1
801039df: e8 bc dd ff ff call 801017a0 <iinit>
initlog(ROOTDEV);
801039e4: c7 04 24 01 00 00 00 movl $0x1,(%esp)
801039eb: e8 f0 f3 ff ff call 80102de0 <initlog>
801039f0: 83 c4 10 add $0x10,%esp
}
// Return to "caller", actually trapret (see allocproc).
}
801039f3: c9 leave
801039f4: c3 ret
801039f5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801039f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80103a00 <pinit>:
extern void trapret(void);
static void wakeup1(void *chan);
void pinit(void)
{
80103a00: 55 push %ebp
80103a01: 89 e5 mov %esp,%ebp
80103a03: 83 ec 10 sub $0x10,%esp
initlock(&ptable.lock, "ptable");
80103a06: 68 f5 7b 10 80 push $0x80107bf5
80103a0b: 68 e0 3f 11 80 push $0x80113fe0
80103a10: e8 ab 0e 00 00 call 801048c0 <initlock>
}
80103a15: 83 c4 10 add $0x10,%esp
80103a18: c9 leave
80103a19: c3 ret
80103a1a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80103a20 <mycpu>:
// Must be called with interrupts disabled to avoid the caller being
// rescheduled between reading lapicid and running through the loop.
struct cpu *
mycpu(void)
{
80103a20: 55 push %ebp
80103a21: 89 e5 mov %esp,%ebp
80103a23: 56 push %esi
80103a24: 53 push %ebx
static inline uint
readeflags(void)
{
uint eflags;
asm volatile("pushfl; popl %0" : "=r" (eflags));
80103a25: 9c pushf
80103a26: 58 pop %eax
int apicid, i;
if (readeflags() & FL_IF)
80103a27: f6 c4 02 test $0x2,%ah
80103a2a: 75 5b jne 80103a87 <mycpu+0x67>
panic("mycpu called with interrupts enabled\n");
apicid = lapicid();
80103a2c: e8 ef ef ff ff call 80102a20 <lapicid>
// APIC IDs are not guaranteed to be contiguous. Maybe we should have
// a reverse map, or reserve a register to store &cpus[i].
for (i = 0; i < ncpu; ++i)
80103a31: 8b 35 c0 3f 11 80 mov 0x80113fc0,%esi
80103a37: 85 f6 test %esi,%esi
80103a39: 7e 3f jle 80103a7a <mycpu+0x5a>
{
if (cpus[i].apicid == apicid)
80103a3b: 0f b6 15 40 3a 11 80 movzbl 0x80113a40,%edx
80103a42: 39 d0 cmp %edx,%eax
80103a44: 74 30 je 80103a76 <mycpu+0x56>
80103a46: b9 f0 3a 11 80 mov $0x80113af0,%ecx
80103a4b: 31 d2 xor %edx,%edx
80103a4d: 8d 76 00 lea 0x0(%esi),%esi
panic("mycpu called with interrupts enabled\n");
apicid = lapicid();
// APIC IDs are not guaranteed to be contiguous. Maybe we should have
// a reverse map, or reserve a register to store &cpus[i].
for (i = 0; i < ncpu; ++i)
80103a50: 83 c2 01 add $0x1,%edx
80103a53: 39 f2 cmp %esi,%edx
80103a55: 74 23 je 80103a7a <mycpu+0x5a>
{
if (cpus[i].apicid == apicid)
80103a57: 0f b6 19 movzbl (%ecx),%ebx
80103a5a: 81 c1 b0 00 00 00 add $0xb0,%ecx
80103a60: 39 d8 cmp %ebx,%eax
80103a62: 75 ec jne 80103a50 <mycpu+0x30>
return &cpus[i];
80103a64: 69 c2 b0 00 00 00 imul $0xb0,%edx,%eax
}
panic("unknown apicid\n");
}
80103a6a: 8d 65 f8 lea -0x8(%ebp),%esp
80103a6d: 5b pop %ebx
// APIC IDs are not guaranteed to be contiguous. Maybe we should have
// a reverse map, or reserve a register to store &cpus[i].
for (i = 0; i < ncpu; ++i)
{
if (cpus[i].apicid == apicid)
return &cpus[i];
80103a6e: 05 40 3a 11 80 add $0x80113a40,%eax
}
panic("unknown apicid\n");
}
80103a73: 5e pop %esi
80103a74: 5d pop %ebp
80103a75: c3 ret
panic("mycpu called with interrupts enabled\n");
apicid = lapicid();
// APIC IDs are not guaranteed to be contiguous. Maybe we should have
// a reverse map, or reserve a register to store &cpus[i].
for (i = 0; i < ncpu; ++i)
80103a76: 31 d2 xor %edx,%edx
80103a78: eb ea jmp 80103a64 <mycpu+0x44>
{
if (cpus[i].apicid == apicid)
return &cpus[i];
}
panic("unknown apicid\n");
80103a7a: 83 ec 0c sub $0xc,%esp
80103a7d: 68 fc 7b 10 80 push $0x80107bfc
80103a82: e8 e9 c8 ff ff call 80100370 <panic>
mycpu(void)
{
int apicid, i;
if (readeflags() & FL_IF)
panic("mycpu called with interrupts enabled\n");
80103a87: 83 ec 0c sub $0xc,%esp
80103a8a: 68 c4 7d 10 80 push $0x80107dc4
80103a8f: e8 dc c8 ff ff call 80100370 <panic>
80103a94: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80103a9a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
80103aa0 <cpuid>:
initlock(&ptable.lock, "ptable");
}
// Must be called with interrupts disabled
int cpuid()
{
80103aa0: 55 push %ebp
80103aa1: 89 e5 mov %esp,%ebp
80103aa3: 83 ec 08 sub $0x8,%esp
return mycpu() - cpus;
80103aa6: e8 75 ff ff ff call 80103a20 <mycpu>
80103aab: 2d 40 3a 11 80 sub $0x80113a40,%eax
}
80103ab0: c9 leave
}
// Must be called with interrupts disabled
int cpuid()
{
return mycpu() - cpus;
80103ab1: c1 f8 04 sar $0x4,%eax
80103ab4: 69 c0 a3 8b 2e ba imul $0xba2e8ba3,%eax,%eax
}
80103aba: c3 ret
80103abb: 90 nop
80103abc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80103ac0 <myproc>:
// Disable interrupts so that we are not rescheduled
// while reading proc from the cpu structure
struct proc *
myproc(void)
{
80103ac0: 55 push %ebp
80103ac1: 89 e5 mov %esp,%ebp
80103ac3: 53 push %ebx
80103ac4: 83 ec 04 sub $0x4,%esp
struct cpu *c;
struct proc *p;
pushcli();
80103ac7: e8 74 0e 00 00 call 80104940 <pushcli>
c = mycpu();
80103acc: e8 4f ff ff ff call 80103a20 <mycpu>
p = c->proc;
80103ad1: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx
popcli();
80103ad7: e8 a4 0e 00 00 call 80104980 <popcli>
return p;
}
80103adc: 83 c4 04 add $0x4,%esp
80103adf: 89 d8 mov %ebx,%eax
80103ae1: 5b pop %ebx
80103ae2: 5d pop %ebp
80103ae3: c3 ret
80103ae4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80103aea: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
80103af0 <userinit>:
}
//PAGEBREAK: 32
// Set up first user process.
void userinit(void)
{
80103af0: 55 push %ebp
80103af1: 89 e5 mov %esp,%ebp
80103af3: 53 push %ebx
80103af4: 83 ec 04 sub $0x4,%esp
struct proc *p;
extern char _binary_initcode_start[], _binary_initcode_size[];
p = allocproc();
80103af7: e8 e4 fd ff ff call 801038e0 <allocproc>
80103afc: 89 c3 mov %eax,%ebx
initproc = p;
80103afe: a3 f8 b5 10 80 mov %eax,0x8010b5f8
if ((p->pgdir = setupkvm()) == 0)
80103b03: e8 d8 38 00 00 call 801073e0 <setupkvm>
80103b08: 85 c0 test %eax,%eax
80103b0a: 89 43 04 mov %eax,0x4(%ebx)
80103b0d: 0f 84 bd 00 00 00 je 80103bd0 <userinit+0xe0>
panic("userinit: out of memory?");
inituvm(p->pgdir, _binary_initcode_start, (int)_binary_initcode_size);
80103b13: 83 ec 04 sub $0x4,%esp
80103b16: 68 2c 00 00 00 push $0x2c
80103b1b: 68 60 b4 10 80 push $0x8010b460
80103b20: 50 push %eax
80103b21: e8 ca 35 00 00 call 801070f0 <inituvm>
p->sz = PGSIZE;
memset(p->tf, 0, sizeof(*p->tf));
80103b26: 83 c4 0c add $0xc,%esp
initproc = p;
if ((p->pgdir = setupkvm()) == 0)
panic("userinit: out of memory?");
inituvm(p->pgdir, _binary_initcode_start, (int)_binary_initcode_size);
p->sz = PGSIZE;
80103b29: c7 03 00 10 00 00 movl $0x1000,(%ebx)
memset(p->tf, 0, sizeof(*p->tf));
80103b2f: 6a 4c push $0x4c
80103b31: 6a 00 push $0x0
80103b33: ff 73 18 pushl 0x18(%ebx)
80103b36: e8 e5 0f 00 00 call 80104b20 <memset>
p->tf->cs = (SEG_UCODE << 3) | DPL_USER;
80103b3b: 8b 43 18 mov 0x18(%ebx),%eax
80103b3e: ba 1b 00 00 00 mov $0x1b,%edx
p->tf->ds = (SEG_UDATA << 3) | DPL_USER;
80103b43: b9 23 00 00 00 mov $0x23,%ecx
p->tf->ss = p->tf->ds;
p->tf->eflags = FL_IF;
p->tf->esp = PGSIZE;
p->tf->eip = 0; // beginning of initcode.S
safestrcpy(p->name, "initcode", sizeof(p->name));
80103b48: 83 c4 0c add $0xc,%esp
if ((p->pgdir = setupkvm()) == 0)
panic("userinit: out of memory?");
inituvm(p->pgdir, _binary_initcode_start, (int)_binary_initcode_size);
p->sz = PGSIZE;
memset(p->tf, 0, sizeof(*p->tf));
p->tf->cs = (SEG_UCODE << 3) | DPL_USER;
80103b4b: 66 89 50 3c mov %dx,0x3c(%eax)
p->tf->ds = (SEG_UDATA << 3) | DPL_USER;
80103b4f: 8b 43 18 mov 0x18(%ebx),%eax
80103b52: 66 89 48 2c mov %cx,0x2c(%eax)
p->tf->es = p->tf->ds;
80103b56: 8b 43 18 mov 0x18(%ebx),%eax
80103b59: 0f b7 50 2c movzwl 0x2c(%eax),%edx
80103b5d: 66 89 50 28 mov %dx,0x28(%eax)
p->tf->ss = p->tf->ds;
80103b61: 8b 43 18 mov 0x18(%ebx),%eax
80103b64: 0f b7 50 2c movzwl 0x2c(%eax),%edx
80103b68: 66 89 50 48 mov %dx,0x48(%eax)
p->tf->eflags = FL_IF;
80103b6c: 8b 43 18 mov 0x18(%ebx),%eax
80103b6f: c7 40 40 00 02 00 00 movl $0x200,0x40(%eax)
p->tf->esp = PGSIZE;
80103b76: 8b 43 18 mov 0x18(%ebx),%eax
80103b79: c7 40 44 00 10 00 00 movl $0x1000,0x44(%eax)
p->tf->eip = 0; // beginning of initcode.S
80103b80: 8b 43 18 mov 0x18(%ebx),%eax
80103b83: c7 40 38 00 00 00 00 movl $0x0,0x38(%eax)
safestrcpy(p->name, "initcode", sizeof(p->name));
80103b8a: 8d 43 6c lea 0x6c(%ebx),%eax
80103b8d: 6a 10 push $0x10
80103b8f: 68 25 7c 10 80 push $0x80107c25
80103b94: 50 push %eax
80103b95: e8 86 11 00 00 call 80104d20 <safestrcpy>
p->cwd = namei("/");
80103b9a: c7 04 24 2e 7c 10 80 movl $0x80107c2e,(%esp)
80103ba1: e8 4a e6 ff ff call 801021f0 <namei>
80103ba6: 89 43 68 mov %eax,0x68(%ebx)
// this assignment to p->state lets other cores
// run this process. the acquire forces the above
// writes to be visible, and the lock is also needed
// because the assignment might not be atomic.
acquire(&ptable.lock);
80103ba9: c7 04 24 e0 3f 11 80 movl $0x80113fe0,(%esp)
80103bb0: e8 6b 0e 00 00 call 80104a20 <acquire>
p->state = RUNNABLE;
80103bb5: c7 43 0c 03 00 00 00 movl $0x3,0xc(%ebx)
release(&ptable.lock);
80103bbc: c7 04 24 e0 3f 11 80 movl $0x80113fe0,(%esp)
80103bc3: e8 08 0f 00 00 call 80104ad0 <release>
}
80103bc8: 83 c4 10 add $0x10,%esp
80103bcb: 8b 5d fc mov -0x4(%ebp),%ebx
80103bce: c9 leave
80103bcf: c3 ret
p = allocproc();
initproc = p;
if ((p->pgdir = setupkvm()) == 0)
panic("userinit: out of memory?");
80103bd0: 83 ec 0c sub $0xc,%esp
80103bd3: 68 0c 7c 10 80 push $0x80107c0c
80103bd8: e8 93 c7 ff ff call 80100370 <panic>
80103bdd: 8d 76 00 lea 0x0(%esi),%esi
80103be0 <growproc>:
}
// Grow current process's memory by n bytes.
// Return 0 on success, -1 on failure.
int growproc(int n)
{
80103be0: 55 push %ebp
80103be1: 89 e5 mov %esp,%ebp
80103be3: 56 push %esi
80103be4: 53 push %ebx
80103be5: 8b 75 08 mov 0x8(%ebp),%esi
struct proc *
myproc(void)
{
struct cpu *c;
struct proc *p;
pushcli();
80103be8: e8 53 0d 00 00 call 80104940 <pushcli>
c = mycpu();
80103bed: e8 2e fe ff ff call 80103a20 <mycpu>
p = c->proc;
80103bf2: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx
popcli();
80103bf8: e8 83 0d 00 00 call 80104980 <popcli>
{
uint sz;
struct proc *curproc = myproc();
sz = curproc->sz;
if (n > 0)
80103bfd: 83 fe 00 cmp $0x0,%esi
int growproc(int n)
{
uint sz;
struct proc *curproc = myproc();
sz = curproc->sz;
80103c00: 8b 03 mov (%ebx),%eax
if (n > 0)
80103c02: 7e 34 jle 80103c38 <growproc+0x58>
{
if ((sz = allocuvm(curproc->pgdir, sz, sz + n)) == 0)
80103c04: 83 ec 04 sub $0x4,%esp
80103c07: 01 c6 add %eax,%esi
80103c09: 56 push %esi
80103c0a: 50 push %eax
80103c0b: ff 73 04 pushl 0x4(%ebx)
80103c0e: e8 1d 36 00 00 call 80107230 <allocuvm>
80103c13: 83 c4 10 add $0x10,%esp
80103c16: 85 c0 test %eax,%eax
80103c18: 74 36 je 80103c50 <growproc+0x70>
{
if ((sz = deallocuvm(curproc->pgdir, sz, sz + n)) == 0)
return -1;
}
curproc->sz = sz;
switchuvm(curproc);
80103c1a: 83 ec 0c sub $0xc,%esp
else if (n < 0)
{
if ((sz = deallocuvm(curproc->pgdir, sz, sz + n)) == 0)
return -1;
}
curproc->sz = sz;
80103c1d: 89 03 mov %eax,(%ebx)
switchuvm(curproc);
80103c1f: 53 push %ebx
80103c20: e8 bb 33 00 00 call 80106fe0 <switchuvm>
return 0;
80103c25: 83 c4 10 add $0x10,%esp
80103c28: 31 c0 xor %eax,%eax
}
80103c2a: 8d 65 f8 lea -0x8(%ebp),%esp
80103c2d: 5b pop %ebx
80103c2e: 5e pop %esi
80103c2f: 5d pop %ebp
80103c30: c3 ret
80103c31: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
if (n > 0)
{
if ((sz = allocuvm(curproc->pgdir, sz, sz + n)) == 0)
return -1;
}
else if (n < 0)
80103c38: 74 e0 je 80103c1a <growproc+0x3a>
{
if ((sz = deallocuvm(curproc->pgdir, sz, sz + n)) == 0)
80103c3a: 83 ec 04 sub $0x4,%esp
80103c3d: 01 c6 add %eax,%esi
80103c3f: 56 push %esi
80103c40: 50 push %eax
80103c41: ff 73 04 pushl 0x4(%ebx)
80103c44: e8 e7 36 00 00 call 80107330 <deallocuvm>
80103c49: 83 c4 10 add $0x10,%esp
80103c4c: 85 c0 test %eax,%eax
80103c4e: 75 ca jne 80103c1a <growproc+0x3a>
sz = curproc->sz;
if (n > 0)
{
if ((sz = allocuvm(curproc->pgdir, sz, sz + n)) == 0)
return -1;
80103c50: b8 ff ff ff ff mov $0xffffffff,%eax
80103c55: eb d3 jmp 80103c2a <growproc+0x4a>
80103c57: 89 f6 mov %esi,%esi
80103c59: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80103c60 <fork>:
// Create a new process copying p as the parent.
// Sets up stack to return as if from system call.
// Caller must set state of returned proc to RUNNABLE.
int fork(void)
{
80103c60: 55 push %ebp
80103c61: 89 e5 mov %esp,%ebp
80103c63: 57 push %edi
80103c64: 56 push %esi
80103c65: 53 push %ebx
80103c66: 83 ec 1c sub $0x1c,%esp
struct proc *
myproc(void)
{
struct cpu *c;
struct proc *p;
pushcli();
80103c69: e8 d2 0c 00 00 call 80104940 <pushcli>
c = mycpu();
80103c6e: e8 ad fd ff ff call 80103a20 <mycpu>
p = c->proc;
80103c73: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx
popcli();
80103c79: e8 02 0d 00 00 call 80104980 <popcli>
int i, pid;
struct proc *np;
struct proc *curproc = myproc();
// Allocate process.
if ((np = allocproc()) == 0)
80103c7e: e8 5d fc ff ff call 801038e0 <allocproc>
80103c83: 85 c0 test %eax,%eax
80103c85: 89 c7 mov %eax,%edi
80103c87: 89 45 e4 mov %eax,-0x1c(%ebp)
80103c8a: 0f 84 b5 00 00 00 je 80103d45 <fork+0xe5>
{
return -1;
}
// Copy process state from proc.
if ((np->pgdir = copyuvm(curproc->pgdir, curproc->sz)) == 0)
80103c90: 83 ec 08 sub $0x8,%esp
80103c93: ff 33 pushl (%ebx)
80103c95: ff 73 04 pushl 0x4(%ebx)
80103c98: e8 13 38 00 00 call 801074b0 <copyuvm>
80103c9d: 83 c4 10 add $0x10,%esp
80103ca0: 85 c0 test %eax,%eax
80103ca2: 89 47 04 mov %eax,0x4(%edi)
80103ca5: 0f 84 a1 00 00 00 je 80103d4c <fork+0xec>
kfree(np->kstack);
np->kstack = 0;
np->state = UNUSED;
return -1;
}
np->sz = curproc->sz;
80103cab: 8b 03 mov (%ebx),%eax
80103cad: 8b 4d e4 mov -0x1c(%ebp),%ecx
80103cb0: 89 01 mov %eax,(%ecx)
np->parent = curproc;
80103cb2: 89 59 14 mov %ebx,0x14(%ecx)
*np->tf = *curproc->tf;
80103cb5: 89 c8 mov %ecx,%eax
80103cb7: 8b 79 18 mov 0x18(%ecx),%edi
80103cba: 8b 73 18 mov 0x18(%ebx),%esi
80103cbd: b9 13 00 00 00 mov $0x13,%ecx
80103cc2: f3 a5 rep movsl %ds:(%esi),%es:(%edi)
// Clear %eax so that fork returns 0 in the child.
np->tf->eax = 0;
for (i = 0; i < NOFILE; i++)
80103cc4: 31 f6 xor %esi,%esi
np->sz = curproc->sz;
np->parent = curproc;
*np->tf = *curproc->tf;
// Clear %eax so that fork returns 0 in the child.
np->tf->eax = 0;
80103cc6: 8b 40 18 mov 0x18(%eax),%eax
80103cc9: c7 40 1c 00 00 00 00 movl $0x0,0x1c(%eax)
for (i = 0; i < NOFILE; i++)
if (curproc->ofile[i])
80103cd0: 8b 44 b3 28 mov 0x28(%ebx,%esi,4),%eax
80103cd4: 85 c0 test %eax,%eax
80103cd6: 74 13 je 80103ceb <fork+0x8b>
np->ofile[i] = filedup(curproc->ofile[i]);
80103cd8: 83 ec 0c sub $0xc,%esp
80103cdb: 50 push %eax
80103cdc: e8 2f d4 ff ff call 80101110 <filedup>
80103ce1: 8b 55 e4 mov -0x1c(%ebp),%edx
80103ce4: 83 c4 10 add $0x10,%esp
80103ce7: 89 44 b2 28 mov %eax,0x28(%edx,%esi,4)
*np->tf = *curproc->tf;
// Clear %eax so that fork returns 0 in the child.
np->tf->eax = 0;
for (i = 0; i < NOFILE; i++)
80103ceb: 83 c6 01 add $0x1,%esi
80103cee: 83 fe 10 cmp $0x10,%esi
80103cf1: 75 dd jne 80103cd0 <fork+0x70>
if (curproc->ofile[i])
np->ofile[i] = filedup(curproc->ofile[i]);
np->cwd = idup(curproc->cwd);
80103cf3: 83 ec 0c sub $0xc,%esp
80103cf6: ff 73 68 pushl 0x68(%ebx)
safestrcpy(np->name, curproc->name, sizeof(curproc->name));
80103cf9: 83 c3 6c add $0x6c,%ebx
np->tf->eax = 0;
for (i = 0; i < NOFILE; i++)
if (curproc->ofile[i])
np->ofile[i] = filedup(curproc->ofile[i]);
np->cwd = idup(curproc->cwd);
80103cfc: e8 6f dc ff ff call 80101970 <idup>
80103d01: 8b 7d e4 mov -0x1c(%ebp),%edi
safestrcpy(np->name, curproc->name, sizeof(curproc->name));
80103d04: 83 c4 0c add $0xc,%esp
np->tf->eax = 0;
for (i = 0; i < NOFILE; i++)
if (curproc->ofile[i])
np->ofile[i] = filedup(curproc->ofile[i]);
np->cwd = idup(curproc->cwd);
80103d07: 89 47 68 mov %eax,0x68(%edi)
safestrcpy(np->name, curproc->name, sizeof(curproc->name));
80103d0a: 8d 47 6c lea 0x6c(%edi),%eax
80103d0d: 6a 10 push $0x10
80103d0f: 53 push %ebx
80103d10: 50 push %eax
80103d11: e8 0a 10 00 00 call 80104d20 <safestrcpy>
pid = np->pid;
80103d16: 8b 5f 10 mov 0x10(%edi),%ebx
acquire(&ptable.lock);
80103d19: c7 04 24 e0 3f 11 80 movl $0x80113fe0,(%esp)
80103d20: e8 fb 0c 00 00 call 80104a20 <acquire>
np->state = RUNNABLE;
80103d25: c7 47 0c 03 00 00 00 movl $0x3,0xc(%edi)
release(&ptable.lock);
80103d2c: c7 04 24 e0 3f 11 80 movl $0x80113fe0,(%esp)
80103d33: e8 98 0d 00 00 call 80104ad0 <release>
return pid;
80103d38: 83 c4 10 add $0x10,%esp
80103d3b: 89 d8 mov %ebx,%eax
}
80103d3d: 8d 65 f4 lea -0xc(%ebp),%esp
80103d40: 5b pop %ebx
80103d41: 5e pop %esi
80103d42: 5f pop %edi
80103d43: 5d pop %ebp
80103d44: c3 ret
struct proc *curproc = myproc();
// Allocate process.
if ((np = allocproc()) == 0)
{
return -1;
80103d45: b8 ff ff ff ff mov $0xffffffff,%eax
80103d4a: eb f1 jmp 80103d3d <fork+0xdd>
}
// Copy process state from proc.
if ((np->pgdir = copyuvm(curproc->pgdir, curproc->sz)) == 0)
{
kfree(np->kstack);
80103d4c: 8b 7d e4 mov -0x1c(%ebp),%edi
80103d4f: 83 ec 0c sub $0xc,%esp
80103d52: ff 77 08 pushl 0x8(%edi)
80103d55: e8 b6 e8 ff ff call 80102610 <kfree>
np->kstack = 0;
80103d5a: c7 47 08 00 00 00 00 movl $0x0,0x8(%edi)
np->state = UNUSED;
80103d61: c7 47 0c 00 00 00 00 movl $0x0,0xc(%edi)
return -1;
80103d68: 83 c4 10 add $0x10,%esp
80103d6b: b8 ff ff ff ff mov $0xffffffff,%eax
80103d70: eb cb jmp 80103d3d <fork+0xdd>
80103d72: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80103d79: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80103d80 <scheduler>:
// - choose a process to run
// - swtch to start running that process
// - eventually that process transfers control
// via swtch back to the scheduler.
void scheduler(void)
{
80103d80: 55 push %ebp
80103d81: 89 e5 mov %esp,%ebp
80103d83: 57 push %edi
80103d84: 56 push %esi
80103d85: 53 push %ebx
80103d86: 83 ec 0c sub $0xc,%esp
struct proc *p;
struct cpu *c = mycpu();
80103d89: e8 92 fc ff ff call 80103a20 <mycpu>
80103d8e: 8d 78 04 lea 0x4(%eax),%edi
80103d91: 89 c6 mov %eax,%esi
c->proc = 0;
80103d93: c7 80 ac 00 00 00 00 movl $0x0,0xac(%eax)
80103d9a: 00 00 00
80103d9d: 8d 76 00 lea 0x0(%esi),%esi
}
static inline void
sti(void)
{
asm volatile("sti");
80103da0: fb sti
{
// Enable interrupts on this processor.
sti();
// Loop over process table looking for process to run.
acquire(&ptable.lock);
80103da1: 83 ec 0c sub $0xc,%esp
for (p = ptable.proc; p < &ptable.proc[NPROC]; p++)
80103da4: bb 14 40 11 80 mov $0x80114014,%ebx
{
// Enable interrupts on this processor.
sti();
// Loop over process table looking for process to run.
acquire(&ptable.lock);
80103da9: 68 e0 3f 11 80 push $0x80113fe0
80103dae: e8 6d 0c 00 00 call 80104a20 <acquire>
80103db3: 83 c4 10 add $0x10,%esp
80103db6: eb 16 jmp 80103dce <scheduler+0x4e>
80103db8: 90 nop
80103db9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
for (p = ptable.proc; p < &ptable.proc[NPROC]; p++)
80103dc0: 81 c3 84 00 00 00 add $0x84,%ebx
80103dc6: 81 fb 14 61 11 80 cmp $0x80116114,%ebx
80103dcc: 74 4a je 80103e18 <scheduler+0x98>
{
if (p->state != RUNNABLE)
80103dce: 83 7b 0c 03 cmpl $0x3,0xc(%ebx)
80103dd2: 75 ec jne 80103dc0 <scheduler+0x40>
// Switch to chosen process. It is the process's job
// to release ptable.lock and then reacquire it
// before jumping back to us.
c->proc = p;
switchuvm(p);
80103dd4: 83 ec 0c sub $0xc,%esp
continue;
// Switch to chosen process. It is the process's job
// to release ptable.lock and then reacquire it
// before jumping back to us.
c->proc = p;
80103dd7: 89 9e ac 00 00 00 mov %ebx,0xac(%esi)
switchuvm(p);
80103ddd: 53 push %ebx
// Enable interrupts on this processor.
sti();
// Loop over process table looking for process to run.
acquire(&ptable.lock);
for (p = ptable.proc; p < &ptable.proc[NPROC]; p++)
80103dde: 81 c3 84 00 00 00 add $0x84,%ebx
// Switch to chosen process. It is the process's job
// to release ptable.lock and then reacquire it
// before jumping back to us.
c->proc = p;
switchuvm(p);
80103de4: e8 f7 31 00 00 call 80106fe0 <switchuvm>
p->state = RUNNING;
swtch(&(c->scheduler), p->context);
80103de9: 58 pop %eax
80103dea: 5a pop %edx
80103deb: ff 73 98 pushl -0x68(%ebx)
80103dee: 57 push %edi
// Switch to chosen process. It is the process's job
// to release ptable.lock and then reacquire it
// before jumping back to us.
c->proc = p;
switchuvm(p);
p->state = RUNNING;
80103def: c7 43 88 04 00 00 00 movl $0x4,-0x78(%ebx)
swtch(&(c->scheduler), p->context);
80103df6: e8 80 0f 00 00 call 80104d7b <swtch>
switchkvm();
80103dfb: e8 c0 31 00 00 call 80106fc0 <switchkvm>
// Process is done running for now.
// It should have changed its p->state before coming back.
c->proc = 0;
80103e00: 83 c4 10 add $0x10,%esp
// Enable interrupts on this processor.
sti();
// Loop over process table looking for process to run.
acquire(&ptable.lock);
for (p = ptable.proc; p < &ptable.proc[NPROC]; p++)
80103e03: 81 fb 14 61 11 80 cmp $0x80116114,%ebx
swtch(&(c->scheduler), p->context);
switchkvm();
// Process is done running for now.
// It should have changed its p->state before coming back.
c->proc = 0;
80103e09: c7 86 ac 00 00 00 00 movl $0x0,0xac(%esi)
80103e10: 00 00 00
// Enable interrupts on this processor.
sti();
// Loop over process table looking for process to run.
acquire(&ptable.lock);
for (p = ptable.proc; p < &ptable.proc[NPROC]; p++)
80103e13: 75 b9 jne 80103dce <scheduler+0x4e>
80103e15: 8d 76 00 lea 0x0(%esi),%esi
// Process is done running for now.
// It should have changed its p->state before coming back.
c->proc = 0;
}
release(&ptable.lock);
80103e18: 83 ec 0c sub $0xc,%esp
80103e1b: 68 e0 3f 11 80 push $0x80113fe0
80103e20: e8 ab 0c 00 00 call 80104ad0 <release>
}
80103e25: 83 c4 10 add $0x10,%esp
80103e28: e9 73 ff ff ff jmp 80103da0 <scheduler+0x20>
80103e2d: 8d 76 00 lea 0x0(%esi),%esi
80103e30 <sched>:
// kernel thread, not this CPU. It should
// be proc->intena and proc->ncli, but that would
// break in the few places where a lock is held but
// there's no process.
void sched(void)
{
80103e30: 55 push %ebp
80103e31: 89 e5 mov %esp,%ebp
80103e33: 56 push %esi
80103e34: 53 push %ebx
struct proc *
myproc(void)
{
struct cpu *c;
struct proc *p;
pushcli();
80103e35: e8 06 0b 00 00 call 80104940 <pushcli>
c = mycpu();
80103e3a: e8 e1 fb ff ff call 80103a20 <mycpu>
p = c->proc;
80103e3f: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx
popcli();
80103e45: e8 36 0b 00 00 call 80104980 <popcli>
void sched(void)
{
int intena;
struct proc *p = myproc();
if (!holding(&ptable.lock))
80103e4a: 83 ec 0c sub $0xc,%esp
80103e4d: 68 e0 3f 11 80 push $0x80113fe0
80103e52: e8 99 0b 00 00 call 801049f0 <holding>
80103e57: 83 c4 10 add $0x10,%esp
80103e5a: 85 c0 test %eax,%eax
80103e5c: 74 4f je 80103ead <sched+0x7d>
panic("sched ptable.lock");
if (mycpu()->ncli != 1)
80103e5e: e8 bd fb ff ff call 80103a20 <mycpu>
80103e63: 83 b8 a4 00 00 00 01 cmpl $0x1,0xa4(%eax)
80103e6a: 75 68 jne 80103ed4 <sched+0xa4>
panic("sched locks");
if (p->state == RUNNING)
80103e6c: 83 7b 0c 04 cmpl $0x4,0xc(%ebx)
80103e70: 74 55 je 80103ec7 <sched+0x97>
static inline uint
readeflags(void)
{
uint eflags;
asm volatile("pushfl; popl %0" : "=r" (eflags));
80103e72: 9c pushf
80103e73: 58 pop %eax
panic("sched running");
if (readeflags() & FL_IF)
80103e74: f6 c4 02 test $0x2,%ah
80103e77: 75 41 jne 80103eba <sched+0x8a>
panic("sched interruptible");
intena = mycpu()->intena;
80103e79: e8 a2 fb ff ff call 80103a20 <mycpu>
swtch(&p->context, mycpu()->scheduler);
80103e7e: 83 c3 1c add $0x1c,%ebx
panic("sched locks");
if (p->state == RUNNING)
panic("sched running");
if (readeflags() & FL_IF)
panic("sched interruptible");
intena = mycpu()->intena;
80103e81: 8b b0 a8 00 00 00 mov 0xa8(%eax),%esi
swtch(&p->context, mycpu()->scheduler);
80103e87: e8 94 fb ff ff call 80103a20 <mycpu>
80103e8c: 83 ec 08 sub $0x8,%esp
80103e8f: ff 70 04 pushl 0x4(%eax)
80103e92: 53 push %ebx
80103e93: e8 e3 0e 00 00 call 80104d7b <swtch>
mycpu()->intena = intena;
80103e98: e8 83 fb ff ff call 80103a20 <mycpu>
}
80103e9d: 83 c4 10 add $0x10,%esp
panic("sched running");
if (readeflags() & FL_IF)
panic("sched interruptible");
intena = mycpu()->intena;
swtch(&p->context, mycpu()->scheduler);
mycpu()->intena = intena;
80103ea0: 89 b0 a8 00 00 00 mov %esi,0xa8(%eax)
}
80103ea6: 8d 65 f8 lea -0x8(%ebp),%esp
80103ea9: 5b pop %ebx
80103eaa: 5e pop %esi
80103eab: 5d pop %ebp
80103eac: c3 ret
{
int intena;
struct proc *p = myproc();
if (!holding(&ptable.lock))
panic("sched ptable.lock");
80103ead: 83 ec 0c sub $0xc,%esp
80103eb0: 68 30 7c 10 80 push $0x80107c30
80103eb5: e8 b6 c4 ff ff call 80100370 <panic>
if (mycpu()->ncli != 1)
panic("sched locks");
if (p->state == RUNNING)
panic("sched running");
if (readeflags() & FL_IF)
panic("sched interruptible");
80103eba: 83 ec 0c sub $0xc,%esp
80103ebd: 68 5c 7c 10 80 push $0x80107c5c
80103ec2: e8 a9 c4 ff ff call 80100370 <panic>
if (!holding(&ptable.lock))
panic("sched ptable.lock");
if (mycpu()->ncli != 1)
panic("sched locks");
if (p->state == RUNNING)
panic("sched running");
80103ec7: 83 ec 0c sub $0xc,%esp
80103eca: 68 4e 7c 10 80 push $0x80107c4e
80103ecf: e8 9c c4 ff ff call 80100370 <panic>
struct proc *p = myproc();
if (!holding(&ptable.lock))
panic("sched ptable.lock");
if (mycpu()->ncli != 1)
panic("sched locks");
80103ed4: 83 ec 0c sub $0xc,%esp
80103ed7: 68 42 7c 10 80 push $0x80107c42
80103edc: e8 8f c4 ff ff call 80100370 <panic>
80103ee1: eb 0d jmp 80103ef0 <exit>
80103ee3: 90 nop
80103ee4: 90 nop
80103ee5: 90 nop
80103ee6: 90 nop
80103ee7: 90 nop
80103ee8: 90 nop
80103ee9: 90 nop
80103eea: 90 nop
80103eeb: 90 nop
80103eec: 90 nop
80103eed: 90 nop
80103eee: 90 nop
80103eef: 90 nop
80103ef0 <exit>:
// Exit the current process. Does not return.
// An exited process remains in the zombie state
// until its parent calls wait() to find out it exited.
void exit(void)
{
80103ef0: 55 push %ebp
80103ef1: 89 e5 mov %esp,%ebp
80103ef3: 57 push %edi
80103ef4: 56 push %esi
80103ef5: 53 push %ebx
80103ef6: 83 ec 0c sub $0xc,%esp
struct proc *
myproc(void)
{
struct cpu *c;
struct proc *p;
pushcli();
80103ef9: e8 42 0a 00 00 call 80104940 <pushcli>
c = mycpu();
80103efe: e8 1d fb ff ff call 80103a20 <mycpu>
p = c->proc;
80103f03: 8b b0 ac 00 00 00 mov 0xac(%eax),%esi
popcli();
80103f09: e8 72 0a 00 00 call 80104980 <popcli>
{
struct proc *curproc = myproc();
struct proc *p;
int fd;
if (curproc == initproc)
80103f0e: 39 35 f8 b5 10 80 cmp %esi,0x8010b5f8
80103f14: 8d 5e 28 lea 0x28(%esi),%ebx
80103f17: 8d 7e 68 lea 0x68(%esi),%edi
80103f1a: 0f 84 f1 00 00 00 je 80104011 <exit+0x121>
panic("init exiting");
// Close all open files.
for (fd = 0; fd < NOFILE; fd++)
{
if (curproc->ofile[fd])
80103f20: 8b 03 mov (%ebx),%eax
80103f22: 85 c0 test %eax,%eax
80103f24: 74 12 je 80103f38 <exit+0x48>
{
fileclose(curproc->ofile[fd]);
80103f26: 83 ec 0c sub $0xc,%esp
80103f29: 50 push %eax
80103f2a: e8 31 d2 ff ff call 80101160 <fileclose>
curproc->ofile[fd] = 0;
80103f2f: c7 03 00 00 00 00 movl $0x0,(%ebx)
80103f35: 83 c4 10 add $0x10,%esp
80103f38: 83 c3 04 add $0x4,%ebx
if (curproc == initproc)
panic("init exiting");
// Close all open files.
for (fd = 0; fd < NOFILE; fd++)
80103f3b: 39 df cmp %ebx,%edi
80103f3d: 75 e1 jne 80103f20 <exit+0x30>
fileclose(curproc->ofile[fd]);
curproc->ofile[fd] = 0;
}
}
begin_op();
80103f3f: e8 3c ef ff ff call 80102e80 <begin_op>
iput(curproc->cwd);
80103f44: 83 ec 0c sub $0xc,%esp
80103f47: ff 76 68 pushl 0x68(%esi)
80103f4a: e8 81 db ff ff call 80101ad0 <iput>
end_op();
80103f4f: e8 9c ef ff ff call 80102ef0 <end_op>
curproc->cwd = 0;
80103f54: c7 46 68 00 00 00 00 movl $0x0,0x68(%esi)
acquire(&ptable.lock);
80103f5b: c7 04 24 e0 3f 11 80 movl $0x80113fe0,(%esp)
80103f62: e8 b9 0a 00 00 call 80104a20 <acquire>
// Parent might be sleeping in wait().
wakeup1(curproc->parent);
80103f67: 8b 56 14 mov 0x14(%esi),%edx
80103f6a: 83 c4 10 add $0x10,%esp
static void
wakeup1(void *chan)
{
struct proc *p;
for (p = ptable.proc; p < &ptable.proc[NPROC]; p++)
80103f6d: b8 14 40 11 80 mov $0x80114014,%eax
80103f72: eb 10 jmp 80103f84 <exit+0x94>
80103f74: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80103f78: 05 84 00 00 00 add $0x84,%eax
80103f7d: 3d 14 61 11 80 cmp $0x80116114,%eax
80103f82: 74 1e je 80103fa2 <exit+0xb2>
if (p->state == SLEEPING && p->chan == chan)
80103f84: 83 78 0c 02 cmpl $0x2,0xc(%eax)
80103f88: 75 ee jne 80103f78 <exit+0x88>
80103f8a: 3b 50 20 cmp 0x20(%eax),%edx
80103f8d: 75 e9 jne 80103f78 <exit+0x88>
p->state = RUNNABLE;
80103f8f: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax)
static void
wakeup1(void *chan)
{
struct proc *p;
for (p = ptable.proc; p < &ptable.proc[NPROC]; p++)
80103f96: 05 84 00 00 00 add $0x84,%eax
80103f9b: 3d 14 61 11 80 cmp $0x80116114,%eax
80103fa0: 75 e2 jne 80103f84 <exit+0x94>
// Pass abandoned children to init.
for (p = ptable.proc; p < &ptable.proc[NPROC]; p++)
{
if (p->parent == curproc)
{
p->parent = initproc;
80103fa2: 8b 0d f8 b5 10 80 mov 0x8010b5f8,%ecx
80103fa8: ba 14 40 11 80 mov $0x80114014,%edx
80103fad: eb 0f jmp 80103fbe <exit+0xce>
80103faf: 90 nop
// Parent might be sleeping in wait().
wakeup1(curproc->parent);
// Pass abandoned children to init.
for (p = ptable.proc; p < &ptable.proc[NPROC]; p++)
80103fb0: 81 c2 84 00 00 00 add $0x84,%edx
80103fb6: 81 fa 14 61 11 80 cmp $0x80116114,%edx
80103fbc: 74 3a je 80103ff8 <exit+0x108>
{
if (p->parent == curproc)
80103fbe: 39 72 14 cmp %esi,0x14(%edx)
80103fc1: 75 ed jne 80103fb0 <exit+0xc0>
{
p->parent = initproc;
if (p->state == ZOMBIE)
80103fc3: 83 7a 0c 05 cmpl $0x5,0xc(%edx)
// Pass abandoned children to init.
for (p = ptable.proc; p < &ptable.proc[NPROC]; p++)
{
if (p->parent == curproc)
{
p->parent = initproc;
80103fc7: 89 4a 14 mov %ecx,0x14(%edx)
if (p->state == ZOMBIE)
80103fca: 75 e4 jne 80103fb0 <exit+0xc0>
80103fcc: b8 14 40 11 80 mov $0x80114014,%eax
80103fd1: eb 11 jmp 80103fe4 <exit+0xf4>
80103fd3: 90 nop
80103fd4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
static void
wakeup1(void *chan)
{
struct proc *p;
for (p = ptable.proc; p < &ptable.proc[NPROC]; p++)
80103fd8: 05 84 00 00 00 add $0x84,%eax
80103fdd: 3d 14 61 11 80 cmp $0x80116114,%eax
80103fe2: 74 cc je 80103fb0 <exit+0xc0>
if (p->state == SLEEPING && p->chan == chan)
80103fe4: 83 78 0c 02 cmpl $0x2,0xc(%eax)
80103fe8: 75 ee jne 80103fd8 <exit+0xe8>
80103fea: 3b 48 20 cmp 0x20(%eax),%ecx
80103fed: 75 e9 jne 80103fd8 <exit+0xe8>
p->state = RUNNABLE;
80103fef: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax)
80103ff6: eb e0 jmp 80103fd8 <exit+0xe8>
wakeup1(initproc);
}
}
// Jump into the scheduler, never to return.
curproc->state = ZOMBIE;
80103ff8: c7 46 0c 05 00 00 00 movl $0x5,0xc(%esi)
sched();
80103fff: e8 2c fe ff ff call 80103e30 <sched>
panic("zombie exit");
80104004: 83 ec 0c sub $0xc,%esp
80104007: 68 7d 7c 10 80 push $0x80107c7d
8010400c: e8 5f c3 ff ff call 80100370 <panic>
struct proc *curproc = myproc();
struct proc *p;
int fd;
if (curproc == initproc)
panic("init exiting");
80104011: 83 ec 0c sub $0xc,%esp
80104014: 68 70 7c 10 80 push $0x80107c70
80104019: e8 52 c3 ff ff call 80100370 <panic>
8010401e: 66 90 xchg %ax,%ax
80104020 <yield>:
mycpu()->intena = intena;
}
// Give up the CPU for one scheduling round.
void yield(void)
{
80104020: 55 push %ebp
80104021: 89 e5 mov %esp,%ebp
80104023: 53 push %ebx
80104024: 83 ec 10 sub $0x10,%esp
acquire(&ptable.lock); //DOC: yieldlock
80104027: 68 e0 3f 11 80 push $0x80113fe0
8010402c: e8 ef 09 00 00 call 80104a20 <acquire>
struct proc *
myproc(void)
{
struct cpu *c;
struct proc *p;
pushcli();
80104031: e8 0a 09 00 00 call 80104940 <pushcli>
c = mycpu();
80104036: e8 e5 f9 ff ff call 80103a20 <mycpu>
p = c->proc;
8010403b: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx
popcli();
80104041: e8 3a 09 00 00 call 80104980 <popcli>
// Give up the CPU for one scheduling round.
void yield(void)
{
acquire(&ptable.lock); //DOC: yieldlock
myproc()->state = RUNNABLE;
80104046: c7 43 0c 03 00 00 00 movl $0x3,0xc(%ebx)
sched();
8010404d: e8 de fd ff ff call 80103e30 <sched>
release(&ptable.lock);
80104052: c7 04 24 e0 3f 11 80 movl $0x80113fe0,(%esp)
80104059: e8 72 0a 00 00 call 80104ad0 <release>
}
8010405e: 83 c4 10 add $0x10,%esp
80104061: 8b 5d fc mov -0x4(%ebp),%ebx
80104064: c9 leave
80104065: c3 ret
80104066: 8d 76 00 lea 0x0(%esi),%esi
80104069: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104070 <sleep>:
}
// Atomically release lock and sleep on chan.
// Reacquires lock when awakened.
void sleep(void *chan, struct spinlock *lk)
{
80104070: 55 push %ebp
80104071: 89 e5 mov %esp,%ebp
80104073: 57 push %edi
80104074: 56 push %esi
80104075: 53 push %ebx
80104076: 83 ec 0c sub $0xc,%esp
80104079: 8b 7d 08 mov 0x8(%ebp),%edi
8010407c: 8b 75 0c mov 0xc(%ebp),%esi
struct proc *
myproc(void)
{
struct cpu *c;
struct proc *p;
pushcli();
8010407f: e8 bc 08 00 00 call 80104940 <pushcli>
c = mycpu();
80104084: e8 97 f9 ff ff call 80103a20 <mycpu>
p = c->proc;
80104089: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx
popcli();
8010408f: e8 ec 08 00 00 call 80104980 <popcli>
// Reacquires lock when awakened.
void sleep(void *chan, struct spinlock *lk)
{
struct proc *p = myproc();
if (p == 0)
80104094: 85 db test %ebx,%ebx
80104096: 0f 84 87 00 00 00 je 80104123 <sleep+0xb3>
panic("sleep");
if (lk == 0)
8010409c: 85 f6 test %esi,%esi
8010409e: 74 76 je 80104116 <sleep+0xa6>
// change p->state and then call sched.
// Once we hold ptable.lock, we can be
// guaranteed that we won't miss any wakeup
// (wakeup runs with ptable.lock locked),
// so it's okay to release lk.
if (lk != &ptable.lock)
801040a0: 81 fe e0 3f 11 80 cmp $0x80113fe0,%esi
801040a6: 74 50 je 801040f8 <sleep+0x88>
{ //DOC: sleeplock0
acquire(&ptable.lock); //DOC: sleeplock1
801040a8: 83 ec 0c sub $0xc,%esp
801040ab: 68 e0 3f 11 80 push $0x80113fe0
801040b0: e8 6b 09 00 00 call 80104a20 <acquire>
release(lk);
801040b5: 89 34 24 mov %esi,(%esp)
801040b8: e8 13 0a 00 00 call 80104ad0 <release>
}
// Go to sleep.
p->chan = chan;
801040bd: 89 7b 20 mov %edi,0x20(%ebx)
p->state = SLEEPING;
801040c0: c7 43 0c 02 00 00 00 movl $0x2,0xc(%ebx)
sched();
801040c7: e8 64 fd ff ff call 80103e30 <sched>
// Tidy up.
p->chan = 0;
801040cc: c7 43 20 00 00 00 00 movl $0x0,0x20(%ebx)
// Reacquire original lock.
if (lk != &ptable.lock)
{ //DOC: sleeplock2
release(&ptable.lock);
801040d3: c7 04 24 e0 3f 11 80 movl $0x80113fe0,(%esp)
801040da: e8 f1 09 00 00 call 80104ad0 <release>
acquire(lk);
801040df: 89 75 08 mov %esi,0x8(%ebp)
801040e2: 83 c4 10 add $0x10,%esp
}
}
801040e5: 8d 65 f4 lea -0xc(%ebp),%esp
801040e8: 5b pop %ebx
801040e9: 5e pop %esi
801040ea: 5f pop %edi
801040eb: 5d pop %ebp
// Reacquire original lock.
if (lk != &ptable.lock)
{ //DOC: sleeplock2
release(&ptable.lock);
acquire(lk);
801040ec: e9 2f 09 00 00 jmp 80104a20 <acquire>
801040f1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
{ //DOC: sleeplock0
acquire(&ptable.lock); //DOC: sleeplock1
release(lk);
}
// Go to sleep.
p->chan = chan;
801040f8: 89 7b 20 mov %edi,0x20(%ebx)
p->state = SLEEPING;
801040fb: c7 43 0c 02 00 00 00 movl $0x2,0xc(%ebx)
sched();
80104102: e8 29 fd ff ff call 80103e30 <sched>
// Tidy up.
p->chan = 0;
80104107: c7 43 20 00 00 00 00 movl $0x0,0x20(%ebx)
if (lk != &ptable.lock)
{ //DOC: sleeplock2
release(&ptable.lock);
acquire(lk);
}
}
8010410e: 8d 65 f4 lea -0xc(%ebp),%esp
80104111: 5b pop %ebx
80104112: 5e pop %esi
80104113: 5f pop %edi
80104114: 5d pop %ebp
80104115: c3 ret
if (p == 0)
panic("sleep");
if (lk == 0)
panic("sleep without lk");
80104116: 83 ec 0c sub $0xc,%esp
80104119: 68 8f 7c 10 80 push $0x80107c8f
8010411e: e8 4d c2 ff ff call 80100370 <panic>
void sleep(void *chan, struct spinlock *lk)
{
struct proc *p = myproc();
if (p == 0)
panic("sleep");
80104123: 83 ec 0c sub $0xc,%esp
80104126: 68 89 7c 10 80 push $0x80107c89
8010412b: e8 40 c2 ff ff call 80100370 <panic>
80104130 <wait>:
}
// Wait for a child process to exit and return its pid.
// Return -1 if this process has no children.
int wait(void)
{
80104130: 55 push %ebp
80104131: 89 e5 mov %esp,%ebp
80104133: 56 push %esi
80104134: 53 push %ebx
struct proc *
myproc(void)
{
struct cpu *c;
struct proc *p;
pushcli();
80104135: e8 06 08 00 00 call 80104940 <pushcli>
c = mycpu();
8010413a: e8 e1 f8 ff ff call 80103a20 <mycpu>
p = c->proc;
8010413f: 8b b0 ac 00 00 00 mov 0xac(%eax),%esi
popcli();
80104145: e8 36 08 00 00 call 80104980 <popcli>
{
struct proc *p;
int havekids, pid;
struct proc *curproc = myproc();
acquire(&ptable.lock);
8010414a: 83 ec 0c sub $0xc,%esp
8010414d: 68 e0 3f 11 80 push $0x80113fe0
80104152: e8 c9 08 00 00 call 80104a20 <acquire>
80104157: 83 c4 10 add $0x10,%esp
for (;;)
{
// Scan through table looking for exited children.
havekids = 0;
8010415a: 31 c0 xor %eax,%eax
for (p = ptable.proc; p < &ptable.proc[NPROC]; p++)
8010415c: bb 14 40 11 80 mov $0x80114014,%ebx
80104161: eb 13 jmp 80104176 <wait+0x46>
80104163: 90 nop
80104164: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80104168: 81 c3 84 00 00 00 add $0x84,%ebx
8010416e: 81 fb 14 61 11 80 cmp $0x80116114,%ebx
80104174: 74 22 je 80104198 <wait+0x68>
{
if (p->parent != curproc)
80104176: 39 73 14 cmp %esi,0x14(%ebx)
80104179: 75 ed jne 80104168 <wait+0x38>
continue;
havekids = 1;
if (p->state == ZOMBIE)
8010417b: 83 7b 0c 05 cmpl $0x5,0xc(%ebx)
8010417f: 74 35 je 801041b6 <wait+0x86>
acquire(&ptable.lock);
for (;;)
{
// Scan through table looking for exited children.
havekids = 0;
for (p = ptable.proc; p < &ptable.proc[NPROC]; p++)
80104181: 81 c3 84 00 00 00 add $0x84,%ebx
{
if (p->parent != curproc)
continue;
havekids = 1;
80104187: b8 01 00 00 00 mov $0x1,%eax
acquire(&ptable.lock);
for (;;)
{
// Scan through table looking for exited children.
havekids = 0;
for (p = ptable.proc; p < &ptable.proc[NPROC]; p++)
8010418c: 81 fb 14 61 11 80 cmp $0x80116114,%ebx
80104192: 75 e2 jne 80104176 <wait+0x46>
80104194: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
return pid;
}
}
// No point waiting if we don't have any children.
if (!havekids || curproc->killed)
80104198: 85 c0 test %eax,%eax
8010419a: 74 70 je 8010420c <wait+0xdc>
8010419c: 8b 46 24 mov 0x24(%esi),%eax
8010419f: 85 c0 test %eax,%eax
801041a1: 75 69 jne 8010420c <wait+0xdc>
release(&ptable.lock);
return -1;
}
// Wait for children to exit. (See wakeup1 call in proc_exit.)
sleep(curproc, &ptable.lock); //DOC: wait-sleep
801041a3: 83 ec 08 sub $0x8,%esp
801041a6: 68 e0 3f 11 80 push $0x80113fe0
801041ab: 56 push %esi
801041ac: e8 bf fe ff ff call 80104070 <sleep>
}
801041b1: 83 c4 10 add $0x10,%esp
801041b4: eb a4 jmp 8010415a <wait+0x2a>
havekids = 1;
if (p->state == ZOMBIE)
{
// Found one.
pid = p->pid;
kfree(p->kstack);
801041b6: 83 ec 0c sub $0xc,%esp
801041b9: ff 73 08 pushl 0x8(%ebx)
continue;
havekids = 1;
if (p->state == ZOMBIE)
{
// Found one.
pid = p->pid;
801041bc: 8b 73 10 mov 0x10(%ebx),%esi
kfree(p->kstack);
801041bf: e8 4c e4 ff ff call 80102610 <kfree>
p->kstack = 0;
freevm(p->pgdir);
801041c4: 5a pop %edx
801041c5: ff 73 04 pushl 0x4(%ebx)
if (p->state == ZOMBIE)
{
// Found one.
pid = p->pid;
kfree(p->kstack);
p->kstack = 0;
801041c8: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx)
freevm(p->pgdir);
801041cf: e8 8c 31 00 00 call 80107360 <freevm>
p->pid = 0;
801041d4: c7 43 10 00 00 00 00 movl $0x0,0x10(%ebx)
p->parent = 0;
801041db: c7 43 14 00 00 00 00 movl $0x0,0x14(%ebx)
p->name[0] = 0;
801041e2: c6 43 6c 00 movb $0x0,0x6c(%ebx)
p->killed = 0;
801041e6: c7 43 24 00 00 00 00 movl $0x0,0x24(%ebx)
p->state = UNUSED;
801041ed: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx)
release(&ptable.lock);
801041f4: c7 04 24 e0 3f 11 80 movl $0x80113fe0,(%esp)
801041fb: e8 d0 08 00 00 call 80104ad0 <release>
return pid;
80104200: 83 c4 10 add $0x10,%esp
}
// Wait for children to exit. (See wakeup1 call in proc_exit.)
sleep(curproc, &ptable.lock); //DOC: wait-sleep
}
}
80104203: 8d 65 f8 lea -0x8(%ebp),%esp
p->parent = 0;
p->name[0] = 0;
p->killed = 0;
p->state = UNUSED;
release(&ptable.lock);
return pid;
80104206: 89 f0 mov %esi,%eax
}
// Wait for children to exit. (See wakeup1 call in proc_exit.)
sleep(curproc, &ptable.lock); //DOC: wait-sleep
}
}
80104208: 5b pop %ebx
80104209: 5e pop %esi
8010420a: 5d pop %ebp
8010420b: c3 ret
}
// No point waiting if we don't have any children.
if (!havekids || curproc->killed)
{
release(&ptable.lock);
8010420c: 83 ec 0c sub $0xc,%esp
8010420f: 68 e0 3f 11 80 push $0x80113fe0
80104214: e8 b7 08 00 00 call 80104ad0 <release>
return -1;
80104219: 83 c4 10 add $0x10,%esp
}
// Wait for children to exit. (See wakeup1 call in proc_exit.)
sleep(curproc, &ptable.lock); //DOC: wait-sleep
}
}
8010421c: 8d 65 f8 lea -0x8(%ebp),%esp
// No point waiting if we don't have any children.
if (!havekids || curproc->killed)
{
release(&ptable.lock);
return -1;
8010421f: b8 ff ff ff ff mov $0xffffffff,%eax
}
// Wait for children to exit. (See wakeup1 call in proc_exit.)
sleep(curproc, &ptable.lock); //DOC: wait-sleep
}
}
80104224: 5b pop %ebx
80104225: 5e pop %esi
80104226: 5d pop %ebp
80104227: c3 ret
80104228: 90 nop
80104229: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80104230 <wakeup>:
p->state = RUNNABLE;
}
// Wake up all processes sleeping on chan.
void wakeup(void *chan)
{
80104230: 55 push %ebp
80104231: 89 e5 mov %esp,%ebp
80104233: 53 push %ebx
80104234: 83 ec 10 sub $0x10,%esp
80104237: 8b 5d 08 mov 0x8(%ebp),%ebx
acquire(&ptable.lock);
8010423a: 68 e0 3f 11 80 push $0x80113fe0
8010423f: e8 dc 07 00 00 call 80104a20 <acquire>
80104244: 83 c4 10 add $0x10,%esp
static void
wakeup1(void *chan)
{
struct proc *p;
for (p = ptable.proc; p < &ptable.proc[NPROC]; p++)
80104247: b8 14 40 11 80 mov $0x80114014,%eax
8010424c: eb 0e jmp 8010425c <wakeup+0x2c>
8010424e: 66 90 xchg %ax,%ax
80104250: 05 84 00 00 00 add $0x84,%eax
80104255: 3d 14 61 11 80 cmp $0x80116114,%eax
8010425a: 74 1e je 8010427a <wakeup+0x4a>
if (p->state == SLEEPING && p->chan == chan)
8010425c: 83 78 0c 02 cmpl $0x2,0xc(%eax)
80104260: 75 ee jne 80104250 <wakeup+0x20>
80104262: 3b 58 20 cmp 0x20(%eax),%ebx
80104265: 75 e9 jne 80104250 <wakeup+0x20>
p->state = RUNNABLE;
80104267: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax)
static void
wakeup1(void *chan)
{
struct proc *p;
for (p = ptable.proc; p < &ptable.proc[NPROC]; p++)
8010426e: 05 84 00 00 00 add $0x84,%eax
80104273: 3d 14 61 11 80 cmp $0x80116114,%eax
80104278: 75 e2 jne 8010425c <wakeup+0x2c>
// Wake up all processes sleeping on chan.
void wakeup(void *chan)
{
acquire(&ptable.lock);
wakeup1(chan);
release(&ptable.lock);
8010427a: c7 45 08 e0 3f 11 80 movl $0x80113fe0,0x8(%ebp)
}
80104281: 8b 5d fc mov -0x4(%ebp),%ebx
80104284: c9 leave
// Wake up all processes sleeping on chan.
void wakeup(void *chan)
{
acquire(&ptable.lock);
wakeup1(chan);
release(&ptable.lock);
80104285: e9 46 08 00 00 jmp 80104ad0 <release>
8010428a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80104290 <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)
{
80104290: 55 push %ebp
80104291: 89 e5 mov %esp,%ebp
80104293: 53 push %ebx
80104294: 83 ec 10 sub $0x10,%esp
80104297: 8b 5d 08 mov 0x8(%ebp),%ebx
struct proc *p;
acquire(&ptable.lock);
8010429a: 68 e0 3f 11 80 push $0x80113fe0
8010429f: e8 7c 07 00 00 call 80104a20 <acquire>
801042a4: 83 c4 10 add $0x10,%esp
for (p = ptable.proc; p < &ptable.proc[NPROC]; p++)
801042a7: b8 14 40 11 80 mov $0x80114014,%eax
801042ac: eb 0e jmp 801042bc <kill+0x2c>
801042ae: 66 90 xchg %ax,%ax
801042b0: 05 84 00 00 00 add $0x84,%eax
801042b5: 3d 14 61 11 80 cmp $0x80116114,%eax
801042ba: 74 3c je 801042f8 <kill+0x68>
{
if (p->pid == pid)
801042bc: 39 58 10 cmp %ebx,0x10(%eax)
801042bf: 75 ef jne 801042b0 <kill+0x20>
{
p->killed = 1;
// Wake process from sleep if necessary.
if (p->state == SLEEPING)
801042c1: 83 78 0c 02 cmpl $0x2,0xc(%eax)
acquire(&ptable.lock);
for (p = ptable.proc; p < &ptable.proc[NPROC]; p++)
{
if (p->pid == pid)
{
p->killed = 1;
801042c5: c7 40 24 01 00 00 00 movl $0x1,0x24(%eax)
// Wake process from sleep if necessary.
if (p->state == SLEEPING)
801042cc: 74 1a je 801042e8 <kill+0x58>
p->state = RUNNABLE;
release(&ptable.lock);
801042ce: 83 ec 0c sub $0xc,%esp
801042d1: 68 e0 3f 11 80 push $0x80113fe0
801042d6: e8 f5 07 00 00 call 80104ad0 <release>
return 0;
801042db: 83 c4 10 add $0x10,%esp
801042de: 31 c0 xor %eax,%eax
}
}
release(&ptable.lock);
return -1;
}
801042e0: 8b 5d fc mov -0x4(%ebp),%ebx
801042e3: c9 leave
801042e4: c3 ret
801042e5: 8d 76 00 lea 0x0(%esi),%esi
if (p->pid == pid)
{
p->killed = 1;
// Wake process from sleep if necessary.
if (p->state == SLEEPING)
p->state = RUNNABLE;
801042e8: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax)
801042ef: eb dd jmp 801042ce <kill+0x3e>
801042f1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
release(&ptable.lock);
return 0;
}
}
release(&ptable.lock);
801042f8: 83 ec 0c sub $0xc,%esp
801042fb: 68 e0 3f 11 80 push $0x80113fe0
80104300: e8 cb 07 00 00 call 80104ad0 <release>
return -1;
80104305: 83 c4 10 add $0x10,%esp
80104308: b8 ff ff ff ff mov $0xffffffff,%eax
}
8010430d: 8b 5d fc mov -0x4(%ebp),%ebx
80104310: c9 leave
80104311: c3 ret
80104312: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80104319: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104320 <procdump>:
//PAGEBREAK: 36
// 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)
{
80104320: 55 push %ebp
80104321: 89 e5 mov %esp,%ebp
80104323: 57 push %edi
80104324: 56 push %esi
80104325: 53 push %ebx
80104326: 8d 75 e8 lea -0x18(%ebp),%esi
80104329: bb 80 40 11 80 mov $0x80114080,%ebx
8010432e: 83 ec 3c sub $0x3c,%esp
80104331: eb 27 jmp 8010435a <procdump+0x3a>
80104333: 90 nop
80104334: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
{
getcallerpcs((uint *)p->context->ebp + 2, pc);
for (i = 0; i < 10 && pc[i] != 0; i++)
cprintf(" %p", pc[i]);
}
cprintf("\n");
80104338: 83 ec 0c sub $0xc,%esp
8010433b: 68 53 81 10 80 push $0x80108153
80104340: e8 1b c3 ff ff call 80100660 <cprintf>
80104345: 83 c4 10 add $0x10,%esp
80104348: 81 c3 84 00 00 00 add $0x84,%ebx
int i;
struct proc *p;
char *state;
uint pc[10];
for (p = ptable.proc; p < &ptable.proc[NPROC]; p++)
8010434e: 81 fb 80 61 11 80 cmp $0x80116180,%ebx
80104354: 0f 84 7e 00 00 00 je 801043d8 <procdump+0xb8>
{
if (p->state == UNUSED)
8010435a: 8b 43 a0 mov -0x60(%ebx),%eax
8010435d: 85 c0 test %eax,%eax
8010435f: 74 e7 je 80104348 <procdump+0x28>
continue;
if (p->state >= 0 && p->state < NELEM(states) && states[p->state])
80104361: 83 f8 05 cmp $0x5,%eax
state = states[p->state];
else
state = "???";
80104364: ba a0 7c 10 80 mov $0x80107ca0,%edx
for (p = ptable.proc; p < &ptable.proc[NPROC]; p++)
{
if (p->state == UNUSED)
continue;
if (p->state >= 0 && p->state < NELEM(states) && states[p->state])
80104369: 77 11 ja 8010437c <procdump+0x5c>
8010436b: 8b 14 85 24 7e 10 80 mov -0x7fef81dc(,%eax,4),%edx
state = states[p->state];
else
state = "???";
80104372: b8 a0 7c 10 80 mov $0x80107ca0,%eax
80104377: 85 d2 test %edx,%edx
80104379: 0f 44 d0 cmove %eax,%edx
cprintf("%d %s %s", p->pid, state, p->name);
8010437c: 53 push %ebx
8010437d: 52 push %edx
8010437e: ff 73 a4 pushl -0x5c(%ebx)
80104381: 68 a4 7c 10 80 push $0x80107ca4
80104386: e8 d5 c2 ff ff call 80100660 <cprintf>
if (p->state == SLEEPING)
8010438b: 83 c4 10 add $0x10,%esp
8010438e: 83 7b a0 02 cmpl $0x2,-0x60(%ebx)
80104392: 75 a4 jne 80104338 <procdump+0x18>
{
getcallerpcs((uint *)p->context->ebp + 2, pc);
80104394: 8d 45 c0 lea -0x40(%ebp),%eax
80104397: 83 ec 08 sub $0x8,%esp
8010439a: 8d 7d c0 lea -0x40(%ebp),%edi
8010439d: 50 push %eax
8010439e: 8b 43 b0 mov -0x50(%ebx),%eax
801043a1: 8b 40 0c mov 0xc(%eax),%eax
801043a4: 83 c0 08 add $0x8,%eax
801043a7: 50 push %eax
801043a8: e8 33 05 00 00 call 801048e0 <getcallerpcs>
801043ad: 83 c4 10 add $0x10,%esp
for (i = 0; i < 10 && pc[i] != 0; i++)
801043b0: 8b 17 mov (%edi),%edx
801043b2: 85 d2 test %edx,%edx
801043b4: 74 82 je 80104338 <procdump+0x18>
cprintf(" %p", pc[i]);
801043b6: 83 ec 08 sub $0x8,%esp
801043b9: 83 c7 04 add $0x4,%edi
801043bc: 52 push %edx
801043bd: 68 e1 76 10 80 push $0x801076e1
801043c2: e8 99 c2 ff ff call 80100660 <cprintf>
state = "???";
cprintf("%d %s %s", p->pid, state, p->name);
if (p->state == SLEEPING)
{
getcallerpcs((uint *)p->context->ebp + 2, pc);
for (i = 0; i < 10 && pc[i] != 0; i++)
801043c7: 83 c4 10 add $0x10,%esp
801043ca: 39 f7 cmp %esi,%edi
801043cc: 75 e2 jne 801043b0 <procdump+0x90>
801043ce: e9 65 ff ff ff jmp 80104338 <procdump+0x18>
801043d3: 90 nop
801043d4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
cprintf(" %p", pc[i]);
}
cprintf("\n");
}
}
801043d8: 8d 65 f4 lea -0xc(%ebp),%esp
801043db: 5b pop %ebx
801043dc: 5e pop %esi
801043dd: 5f pop %edi
801043de: 5d pop %ebp
801043df: c3 ret
801043e0 <printProcess>:
void printProcess(struct proc *p)
{
801043e0: 55 push %ebp
801043e1: 89 e5 mov %esp,%ebp
801043e3: 53 push %ebx
801043e4: 83 ec 0c sub $0xc,%esp
801043e7: 8b 5d 08 mov 0x8(%ebp),%ebx
cprintf("name : %s\n", p->name);
801043ea: 8d 43 6c lea 0x6c(%ebx),%eax
801043ed: 50 push %eax
801043ee: 68 ad 7c 10 80 push $0x80107cad
801043f3: e8 68 c2 ff ff call 80100660 <cprintf>
cprintf("PID : %d\n", p->pid);
801043f8: 58 pop %eax
801043f9: 5a pop %edx
801043fa: ff 73 10 pushl 0x10(%ebx)
801043fd: 68 b9 7c 10 80 push $0x80107cb9
80104402: e8 59 c2 ff ff call 80100660 <cprintf>
cprintf("PPID : %d\n", p->parent->pid);
80104407: 59 pop %ecx
80104408: 58 pop %eax
80104409: 8b 43 14 mov 0x14(%ebx),%eax
8010440c: ff 70 10 pushl 0x10(%eax)
8010440f: 68 b8 7c 10 80 push $0x80107cb8
80104414: e8 47 c2 ff ff call 80100660 <cprintf>
switch (p->state)
80104419: 83 c4 10 add $0x10,%esp
8010441c: 83 7b 0c 05 cmpl $0x5,0xc(%ebx)
80104420: 77 6e ja 80104490 <printProcess+0xb0>
80104422: 8b 43 0c mov 0xc(%ebx),%eax
80104425: ff 24 85 0c 7e 10 80 jmp *-0x7fef81f4(,%eax,4)
8010442c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
break;
case 3:
cprintf("state : RUNNABLE\n");
break;
case 4:
cprintf("state : RUNNING\n");
80104430: c7 45 08 07 7d 10 80 movl $0x80107d07,0x8(%ebp)
break;
case 5:
cprintf("state : ZOMBIE\n");
break;
}
}
80104437: 8b 5d fc mov -0x4(%ebp),%ebx
8010443a: c9 leave
break;
case 3:
cprintf("state : RUNNABLE\n");
break;
case 4:
cprintf("state : RUNNING\n");
8010443b: e9 20 c2 ff ff jmp 80100660 <cprintf>
break;
case 5:
cprintf("state : ZOMBIE\n");
80104440: c7 45 08 18 7d 10 80 movl $0x80107d18,0x8(%ebp)
break;
}
}
80104447: 8b 5d fc mov -0x4(%ebp),%ebx
8010444a: c9 leave
break;
case 4:
cprintf("state : RUNNING\n");
break;
case 5:
cprintf("state : ZOMBIE\n");
8010444b: e9 10 c2 ff ff jmp 80100660 <cprintf>
cprintf("PID : %d\n", p->pid);
cprintf("PPID : %d\n", p->parent->pid);
switch (p->state)
{
case 0:
cprintf("state : UNUSED\n");
80104450: c7 45 08 c3 7c 10 80 movl $0x80107cc3,0x8(%ebp)
break;
case 5:
cprintf("state : ZOMBIE\n");
break;
}
}
80104457: 8b 5d fc mov -0x4(%ebp),%ebx
8010445a: c9 leave
cprintf("PID : %d\n", p->pid);
cprintf("PPID : %d\n", p->parent->pid);
switch (p->state)
{
case 0:
cprintf("state : UNUSED\n");
8010445b: e9 00 c2 ff ff jmp 80100660 <cprintf>
break;
case 1:
cprintf("state : EMBRYO\n");
80104460: c7 45 08 d3 7c 10 80 movl $0x80107cd3,0x8(%ebp)
break;
case 5:
cprintf("state : ZOMBIE\n");
break;
}
}
80104467: 8b 5d fc mov -0x4(%ebp),%ebx
8010446a: c9 leave
{
case 0:
cprintf("state : UNUSED\n");
break;
case 1:
cprintf("state : EMBRYO\n");
8010446b: e9 f0 c1 ff ff jmp 80100660 <cprintf>
break;
case 2:
cprintf("state : SLEEPING\n");
80104470: c7 45 08 e3 7c 10 80 movl $0x80107ce3,0x8(%ebp)
break;
case 5:
cprintf("state : ZOMBIE\n");
break;
}
}
80104477: 8b 5d fc mov -0x4(%ebp),%ebx
8010447a: c9 leave
break;
case 1:
cprintf("state : EMBRYO\n");
break;
case 2:
cprintf("state : SLEEPING\n");
8010447b: e9 e0 c1 ff ff jmp 80100660 <cprintf>
break;
case 3:
cprintf("state : RUNNABLE\n");
80104480: c7 45 08 f5 7c 10 80 movl $0x80107cf5,0x8(%ebp)
break;
case 5:
cprintf("state : ZOMBIE\n");
break;
}
}
80104487: 8b 5d fc mov -0x4(%ebp),%ebx
8010448a: c9 leave
break;
case 2:
cprintf("state : SLEEPING\n");
break;
case 3:
cprintf("state : RUNNABLE\n");
8010448b: e9 d0 c1 ff ff jmp 80100660 <cprintf>
break;
case 5:
cprintf("state : ZOMBIE\n");
break;
}
}
80104490: 8b 5d fc mov -0x4(%ebp),%ebx
80104493: c9 leave
80104494: c3 ret
80104495: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80104499: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801044a0 <getprocs>:
int getprocs(void)
{
801044a0: 55 push %ebp
801044a1: 89 e5 mov %esp,%ebp
801044a3: 53 push %ebx
struct proc *p;
cprintf("\n-----------------------------\n");
for (p = ptable.proc; p < &ptable.proc[NPROC]; p++)
801044a4: bb 14 40 11 80 mov $0x80114014,%ebx
break;
}
}
int getprocs(void)
{
801044a9: 83 ec 10 sub $0x10,%esp
struct proc *p;
cprintf("\n-----------------------------\n");
801044ac: 68 ec 7d 10 80 push $0x80107dec
801044b1: e8 aa c1 ff ff call 80100660 <cprintf>
801044b6: 83 c4 10 add $0x10,%esp
801044b9: eb 13 jmp 801044ce <getprocs+0x2e>
801044bb: 90 nop
801044bc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
for (p = ptable.proc; p < &ptable.proc[NPROC]; p++)
801044c0: 81 c3 84 00 00 00 add $0x84,%ebx
801044c6: 81 fb 14 61 11 80 cmp $0x80116114,%ebx
801044cc: 74 2d je 801044fb <getprocs+0x5b>
{
if (p->pid == 0)
801044ce: 8b 43 10 mov 0x10(%ebx),%eax
801044d1: 85 c0 test %eax,%eax
801044d3: 74 eb je 801044c0 <getprocs+0x20>
continue;
printProcess(p);
801044d5: 83 ec 0c sub $0xc,%esp
801044d8: 53 push %ebx
int getprocs(void)
{
struct proc *p;
cprintf("\n-----------------------------\n");
for (p = ptable.proc; p < &ptable.proc[NPROC]; p++)
801044d9: 81 c3 84 00 00 00 add $0x84,%ebx
{
if (p->pid == 0)
continue;
printProcess(p);
801044df: e8 fc fe ff ff call 801043e0 <printProcess>
cprintf("\n-----------------------------\n");
801044e4: c7 04 24 ec 7d 10 80 movl $0x80107dec,(%esp)
801044eb: e8 70 c1 ff ff call 80100660 <cprintf>
801044f0: 83 c4 10 add $0x10,%esp
int getprocs(void)
{
struct proc *p;
cprintf("\n-----------------------------\n");
for (p = ptable.proc; p < &ptable.proc[NPROC]; p++)
801044f3: 81 fb 14 61 11 80 cmp $0x80116114,%ebx
801044f9: 75 d3 jne 801044ce <getprocs+0x2e>
continue;
printProcess(p);
cprintf("\n-----------------------------\n");
}
return 23;
}
801044fb: b8 17 00 00 00 mov $0x17,%eax
80104500: 8b 5d fc mov -0x4(%ebp),%ebx
80104503: c9 leave
80104504: c3 ret
80104505: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80104509: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104510 <printstack>:
int printstack(void)
{
80104510: 55 push %ebp
80104511: 89 e5 mov %esp,%ebp
80104513: 53 push %ebx
80104514: 83 ec 04 sub $0x4,%esp
struct proc *
myproc(void)
{
struct cpu *c;
struct proc *p;
pushcli();
80104517: e8 24 04 00 00 call 80104940 <pushcli>
c = mycpu();
8010451c: e8 ff f4 ff ff call 80103a20 <mycpu>
p = c->proc;
80104521: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx
popcli();
80104527: e8 54 04 00 00 call 80104980 <popcli>
}
int printstack(void)
{
struct proc *process = myproc();
cprintf("eax:%x\n", &(process->tf->eax));
8010452c: 83 ec 08 sub $0x8,%esp
8010452f: 8b 43 18 mov 0x18(%ebx),%eax
80104532: 83 c0 1c add $0x1c,%eax
80104535: 50 push %eax
80104536: 68 28 7d 10 80 push $0x80107d28
8010453b: e8 20 c1 ff ff call 80100660 <cprintf>
cprintf("ebx:%x\n", &(process->tf->ebx));
80104540: 58 pop %eax
80104541: 8b 43 18 mov 0x18(%ebx),%eax
80104544: 5a pop %edx
80104545: 83 c0 10 add $0x10,%eax
80104548: 50 push %eax
80104549: 68 30 7d 10 80 push $0x80107d30
8010454e: e8 0d c1 ff ff call 80100660 <cprintf>
cprintf("ecx:%x\n", &(process->tf->ecx));
80104553: 59 pop %ecx
80104554: 58 pop %eax
80104555: 8b 43 18 mov 0x18(%ebx),%eax
80104558: 83 c0 18 add $0x18,%eax
8010455b: 50 push %eax
8010455c: 68 38 7d 10 80 push $0x80107d38
80104561: e8 fa c0 ff ff call 80100660 <cprintf>
cprintf("edx:%x\n", &(process->tf->edx));
80104566: 58 pop %eax
80104567: 8b 43 18 mov 0x18(%ebx),%eax
8010456a: 5a pop %edx
8010456b: 83 c0 14 add $0x14,%eax
8010456e: 50 push %eax
8010456f: 68 40 7d 10 80 push $0x80107d40
80104574: e8 e7 c0 ff ff call 80100660 <cprintf>
cprintf("esi:%x\n", &(process->tf->esi));
80104579: 59 pop %ecx
8010457a: 58 pop %eax
8010457b: 8b 43 18 mov 0x18(%ebx),%eax
8010457e: 83 c0 04 add $0x4,%eax
80104581: 50 push %eax
80104582: 68 48 7d 10 80 push $0x80107d48
80104587: e8 d4 c0 ff ff call 80100660 <cprintf>
cprintf("edi:%x\n", &(process->tf->edi));
8010458c: 58 pop %eax
8010458d: 5a pop %edx
8010458e: ff 73 18 pushl 0x18(%ebx)
80104591: 68 50 7d 10 80 push $0x80107d50
80104596: e8 c5 c0 ff ff call 80100660 <cprintf>
cprintf("ebp:%x\n", &(process->tf->ebp));
8010459b: 59 pop %ecx
8010459c: 58 pop %eax
8010459d: 8b 43 18 mov 0x18(%ebx),%eax
801045a0: 83 c0 08 add $0x8,%eax
801045a3: 50 push %eax
801045a4: 68 58 7d 10 80 push $0x80107d58
801045a9: e8 b2 c0 ff ff call 80100660 <cprintf>
cprintf("err:%x\n", &(process->tf->err));
801045ae: 58 pop %eax
801045af: 8b 43 18 mov 0x18(%ebx),%eax
801045b2: 5a pop %edx
801045b3: 83 c0 34 add $0x34,%eax
801045b6: 50 push %eax
801045b7: 68 60 7d 10 80 push $0x80107d60
801045bc: e8 9f c0 ff ff call 80100660 <cprintf>
cprintf("eip:%x\n", &(process->tf->eip));
801045c1: 59 pop %ecx
801045c2: 58 pop %eax
801045c3: 8b 43 18 mov 0x18(%ebx),%eax
801045c6: 83 c0 38 add $0x38,%eax
801045c9: 50 push %eax
801045ca: 68 68 7d 10 80 push $0x80107d68
801045cf: e8 8c c0 ff ff call 80100660 <cprintf>
cprintf("esp:%x\n", &(process->tf->esp));
801045d4: 58 pop %eax
801045d5: 8b 43 18 mov 0x18(%ebx),%eax
801045d8: 5a pop %edx
801045d9: 83 c0 44 add $0x44,%eax
801045dc: 50 push %eax
801045dd: 68 70 7d 10 80 push $0x80107d70
801045e2: e8 79 c0 ff ff call 80100660 <cprintf>
cprintf("eflags:%x\n", &(process->tf->eflags));
801045e7: 59 pop %ecx
801045e8: 58 pop %eax
801045e9: 8b 43 18 mov 0x18(%ebx),%eax
801045ec: 83 c0 40 add $0x40,%eax
801045ef: 50 push %eax
801045f0: 68 78 7d 10 80 push $0x80107d78
801045f5: e8 66 c0 ff ff call 80100660 <cprintf>
return 24;
}
801045fa: b8 18 00 00 00 mov $0x18,%eax
801045ff: 8b 5d fc mov -0x4(%ebp),%ebx
80104602: c9 leave
80104603: c3 ret
80104604: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
8010460a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
80104610 <clone>:
// Create a new thread
int clone(void (*fcn)(void *), void *arg, void *stack)
{
80104610: 55 push %ebp
80104611: 89 e5 mov %esp,%ebp
80104613: 57 push %edi
80104614: 56 push %esi
80104615: 53 push %ebx
80104616: 83 ec 1c sub $0x1c,%esp
80104619: 8b 55 10 mov 0x10(%ebp),%edx
if ((uint)stack % PGSIZE != 0 || (uint)stack + PGSIZE > (proc->sz))
8010461c: f7 c2 ff 0f 00 00 test $0xfff,%edx
80104622: 0f 85 09 01 00 00 jne 80104731 <clone+0x121>
80104628: 65 a1 04 00 00 00 mov %gs:0x4,%eax
8010462e: 8d 8a 00 10 00 00 lea 0x1000(%edx),%ecx
80104634: 89 55 e4 mov %edx,-0x1c(%ebp)
80104637: 3b 08 cmp (%eax),%ecx
80104639: 0f 87 f2 00 00 00 ja 80104731 <clone+0x121>
int i, pid;
struct proc *np;
// Allocate process.
if ((np = allocproc()) == 0)
8010463f: e8 9c f2 ff ff call 801038e0 <allocproc>
80104644: 85 c0 test %eax,%eax
80104646: 89 c3 mov %eax,%ebx
80104648: 0f 84 e3 00 00 00 je 80104731 <clone+0x121>
return -1;
// Copy process state from p.
np->pgdir = proc->pgdir;
8010464e: 65 a1 04 00 00 00 mov %gs:0x4,%eax
np->sz = proc->sz;
np->parent = proc;
*np->tf = *proc->tf;
80104654: 8b 7b 18 mov 0x18(%ebx),%edi
// Clear %eax so that fork returns 0 in the child.
np->tf->eax = 0;
np->ustack = stack;
80104657: 8b 55 e4 mov -0x1c(%ebp),%edx
// Allocate process.
if ((np = allocproc()) == 0)
return -1;
// Copy process state from p.
np->pgdir = proc->pgdir;
8010465a: 8b 48 04 mov 0x4(%eax),%ecx
8010465d: 89 4b 04 mov %ecx,0x4(%ebx)
np->sz = proc->sz;
80104660: 8b 00 mov (%eax),%eax
np->parent = proc;
*np->tf = *proc->tf;
80104662: b9 13 00 00 00 mov $0x13,%ecx
if ((np = allocproc()) == 0)
return -1;
// Copy process state from p.
np->pgdir = proc->pgdir;
np->sz = proc->sz;
80104667: 89 03 mov %eax,(%ebx)
np->parent = proc;
80104669: 65 a1 04 00 00 00 mov %gs:0x4,%eax
8010466f: 89 43 14 mov %eax,0x14(%ebx)
*np->tf = *proc->tf;
80104672: 8b 70 18 mov 0x18(%eax),%esi
80104675: f3 a5 rep movsl %ds:(%esi),%es:(%edi)
*((uint *)(stack + PGSIZE - sizeof(uint))) = (uint)arg;
*((uint *)(stack + PGSIZE - 2 * sizeof(uint))) = 0xffffffff;
np->tf->esp = (uint)stack + PGSIZE - 2 * sizeof(uint);
np->tf->eip = (uint)fcn;
for (i = 0; i < NOFILE; i++)
80104677: 31 f6 xor %esi,%esi
np->sz = proc->sz;
np->parent = proc;
*np->tf = *proc->tf;
// Clear %eax so that fork returns 0 in the child.
np->tf->eax = 0;
80104679: 8b 43 18 mov 0x18(%ebx),%eax
8010467c: c7 40 1c 00 00 00 00 movl $0x0,0x1c(%eax)
np->ustack = stack;
*((uint *)(stack + PGSIZE - sizeof(uint))) = (uint)arg;
80104683: 8b 45 0c mov 0xc(%ebp),%eax
*np->tf = *proc->tf;
// Clear %eax so that fork returns 0 in the child.
np->tf->eax = 0;
np->ustack = stack;
80104686: 89 53 7c mov %edx,0x7c(%ebx)
*((uint *)(stack + PGSIZE - sizeof(uint))) = (uint)arg;
*((uint *)(stack + PGSIZE - 2 * sizeof(uint))) = 0xffffffff;
80104689: c7 82 f8 0f 00 00 ff movl $0xffffffff,0xff8(%edx)
80104690: ff ff ff
np->tf->esp = (uint)stack + PGSIZE - 2 * sizeof(uint);
80104693: 81 c2 f8 0f 00 00 add $0xff8,%edx
// Clear %eax so that fork returns 0 in the child.
np->tf->eax = 0;
np->ustack = stack;
*((uint *)(stack + PGSIZE - sizeof(uint))) = (uint)arg;
80104699: 89 42 04 mov %eax,0x4(%edx)
*((uint *)(stack + PGSIZE - 2 * sizeof(uint))) = 0xffffffff;
np->tf->esp = (uint)stack + PGSIZE - 2 * sizeof(uint);
8010469c: 8b 43 18 mov 0x18(%ebx),%eax
8010469f: 89 50 44 mov %edx,0x44(%eax)
np->tf->eip = (uint)fcn;
801046a2: 8b 55 08 mov 0x8(%ebp),%edx
801046a5: 8b 43 18 mov 0x18(%ebx),%eax
801046a8: 89 50 38 mov %edx,0x38(%eax)
801046ab: 65 8b 15 04 00 00 00 mov %gs:0x4,%edx
801046b2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
for (i = 0; i < NOFILE; i++)
if (proc->ofile[i])
801046b8: 8b 44 b2 28 mov 0x28(%edx,%esi,4),%eax
801046bc: 85 c0 test %eax,%eax
801046be: 74 17 je 801046d7 <clone+0xc7>
np->ofile[i] = filedup(proc->ofile[i]);
801046c0: 83 ec 0c sub $0xc,%esp
801046c3: 50 push %eax
801046c4: e8 47 ca ff ff call 80101110 <filedup>
801046c9: 89 44 b3 28 mov %eax,0x28(%ebx,%esi,4)
801046cd: 65 8b 15 04 00 00 00 mov %gs:0x4,%edx
801046d4: 83 c4 10 add $0x10,%esp
*((uint *)(stack + PGSIZE - sizeof(uint))) = (uint)arg;
*((uint *)(stack + PGSIZE - 2 * sizeof(uint))) = 0xffffffff;
np->tf->esp = (uint)stack + PGSIZE - 2 * sizeof(uint);
np->tf->eip = (uint)fcn;
for (i = 0; i < NOFILE; i++)
801046d7: 83 c6 01 add $0x1,%esi
801046da: 83 fe 10 cmp $0x10,%esi
801046dd: 75 d9 jne 801046b8 <clone+0xa8>
if (proc->ofile[i])
np->ofile[i] = filedup(proc->ofile[i]);
np->cwd = idup(proc->cwd);
801046df: 83 ec 0c sub $0xc,%esp
801046e2: ff 72 68 pushl 0x68(%edx)
801046e5: e8 86 d2 ff ff call 80101970 <idup>
801046ea: 89 43 68 mov %eax,0x68(%ebx)
pid = np->pid;
np->state = RUNNABLE;
safestrcpy(np->name, proc->name, sizeof(proc->name));
801046ed: 65 a1 04 00 00 00 mov %gs:0x4,%eax
801046f3: 83 c4 0c add $0xc,%esp
for (i = 0; i < NOFILE; i++)
if (proc->ofile[i])
np->ofile[i] = filedup(proc->ofile[i]);
np->cwd = idup(proc->cwd);
pid = np->pid;
801046f6: 8b 73 10 mov 0x10(%ebx),%esi
np->state = RUNNABLE;
801046f9: c7 43 0c 03 00 00 00 movl $0x3,0xc(%ebx)
safestrcpy(np->name, proc->name, sizeof(proc->name));
80104700: 6a 10 push $0x10
80104702: 83 c0 6c add $0x6c,%eax
80104705: 50 push %eax
80104706: 8d 43 6c lea 0x6c(%ebx),%eax
80104709: 50 push %eax
8010470a: e8 11 06 00 00 call 80104d20 <safestrcpy>
np->reference_count = proc->reference_count;
8010470f: 65 a1 04 00 00 00 mov %gs:0x4,%eax
*(np->reference_count) = *(np->reference_count) + 1;
return pid;
80104715: 83 c4 10 add $0x10,%esp
pid = np->pid;
np->state = RUNNABLE;
safestrcpy(np->name, proc->name, sizeof(proc->name));
np->reference_count = proc->reference_count;
80104718: 8b 80 80 00 00 00 mov 0x80(%eax),%eax
8010471e: 89 83 80 00 00 00 mov %eax,0x80(%ebx)
*(np->reference_count) = *(np->reference_count) + 1;
80104724: 83 00 01 addl $0x1,(%eax)
return pid;
}
80104727: 8d 65 f4 lea -0xc(%ebp),%esp
np->state = RUNNABLE;
safestrcpy(np->name, proc->name, sizeof(proc->name));
np->reference_count = proc->reference_count;
*(np->reference_count) = *(np->reference_count) + 1;
return pid;
8010472a: 89 f0 mov %esi,%eax
}
8010472c: 5b pop %ebx
8010472d: 5e pop %esi
8010472e: 5f pop %edi
8010472f: 5d pop %ebp
80104730: c3 ret
80104731: 8d 65 f4 lea -0xc(%ebp),%esp
// Create a new thread
int clone(void (*fcn)(void *), void *arg, void *stack)
{
if ((uint)stack % PGSIZE != 0 || (uint)stack + PGSIZE > (proc->sz))
{
return -1;
80104734: b8 ff ff ff ff mov $0xffffffff,%eax
safestrcpy(np->name, proc->name, sizeof(proc->name));
np->reference_count = proc->reference_count;
*(np->reference_count) = *(np->reference_count) + 1;
return pid;
}
80104739: 5b pop %ebx
8010473a: 5e pop %esi
8010473b: 5f pop %edi
8010473c: 5d pop %ebp
8010473d: c3 ret
8010473e: 66 90 xchg %ax,%ax
80104740 <thread_create>:
int thread_create(void (*start_routine)(void *), void *arg)
{
80104740: 55 push %ebp
80104741: 89 e5 mov %esp,%ebp
80104743: 83 ec 08 sub $0x8,%esp
void *stack = kalloc();
80104746: e8 75 e0 ff ff call 801027c0 <kalloc>
if (!stack)
8010474b: 85 c0 test %eax,%eax
8010474d: 74 22 je 80104771 <thread_create+0x31>
{
cprintf("Error: malloc failed\n");
exit();
}
if ((uint)stack % PGSIZE)
8010474f: 89 c2 mov %eax,%edx
80104751: 81 e2 ff 0f 00 00 and $0xfff,%edx
80104757: 74 07 je 80104760 <thread_create+0x20>
{
stack = stack + (4096 - (uint)stack % PGSIZE);
80104759: 29 d0 sub %edx,%eax
8010475b: 05 00 10 00 00 add $0x1000,%eax
}
return clone(start_routine, arg, stack);
80104760: 83 ec 04 sub $0x4,%esp
80104763: 50 push %eax
80104764: ff 75 0c pushl 0xc(%ebp)
80104767: ff 75 08 pushl 0x8(%ebp)
8010476a: e8 a1 fe ff ff call 80104610 <clone>
}
8010476f: c9 leave
80104770: c3 ret
int thread_create(void (*start_routine)(void *), void *arg)
{
void *stack = kalloc();
if (!stack)
{
cprintf("Error: malloc failed\n");
80104771: 83 ec 0c sub $0xc,%esp
80104774: 68 83 7d 10 80 push $0x80107d83
80104779: e8 e2 be ff ff call 80100660 <cprintf>
exit();
8010477e: e8 6d f7 ff ff call 80103ef0 <exit>
80104783: 66 90 xchg %ax,%ax
80104785: 66 90 xchg %ax,%ax
80104787: 66 90 xchg %ax,%ax
80104789: 66 90 xchg %ax,%ax
8010478b: 66 90 xchg %ax,%ax
8010478d: 66 90 xchg %ax,%ax
8010478f: 90 nop
80104790 <initsleeplock>:
#include "spinlock.h"
#include "sleeplock.h"
void
initsleeplock(struct sleeplock *lk, char *name)
{
80104790: 55 push %ebp
80104791: 89 e5 mov %esp,%ebp
80104793: 53 push %ebx
80104794: 83 ec 0c sub $0xc,%esp
80104797: 8b 5d 08 mov 0x8(%ebp),%ebx
initlock(&lk->lk, "sleep lock");
8010479a: 68 3c 7e 10 80 push $0x80107e3c
8010479f: 8d 43 04 lea 0x4(%ebx),%eax
801047a2: 50 push %eax
801047a3: e8 18 01 00 00 call 801048c0 <initlock>
lk->name = name;
801047a8: 8b 45 0c mov 0xc(%ebp),%eax
lk->locked = 0;
801047ab: c7 03 00 00 00 00 movl $0x0,(%ebx)
lk->pid = 0;
}
801047b1: 83 c4 10 add $0x10,%esp
initsleeplock(struct sleeplock *lk, char *name)
{
initlock(&lk->lk, "sleep lock");
lk->name = name;
lk->locked = 0;
lk->pid = 0;
801047b4: c7 43 3c 00 00 00 00 movl $0x0,0x3c(%ebx)
void
initsleeplock(struct sleeplock *lk, char *name)
{
initlock(&lk->lk, "sleep lock");
lk->name = name;
801047bb: 89 43 38 mov %eax,0x38(%ebx)
lk->locked = 0;
lk->pid = 0;
}
801047be: 8b 5d fc mov -0x4(%ebp),%ebx
801047c1: c9 leave
801047c2: c3 ret
801047c3: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801047c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801047d0 <acquiresleep>:
void
acquiresleep(struct sleeplock *lk)
{
801047d0: 55 push %ebp
801047d1: 89 e5 mov %esp,%ebp
801047d3: 56 push %esi
801047d4: 53 push %ebx
801047d5: 8b 5d 08 mov 0x8(%ebp),%ebx
acquire(&lk->lk);
801047d8: 83 ec 0c sub $0xc,%esp
801047db: 8d 73 04 lea 0x4(%ebx),%esi
801047de: 56 push %esi
801047df: e8 3c 02 00 00 call 80104a20 <acquire>
while (lk->locked) {
801047e4: 8b 13 mov (%ebx),%edx
801047e6: 83 c4 10 add $0x10,%esp
801047e9: 85 d2 test %edx,%edx
801047eb: 74 16 je 80104803 <acquiresleep+0x33>
801047ed: 8d 76 00 lea 0x0(%esi),%esi
sleep(lk, &lk->lk);
801047f0: 83 ec 08 sub $0x8,%esp
801047f3: 56 push %esi
801047f4: 53 push %ebx
801047f5: e8 76 f8 ff ff call 80104070 <sleep>
void
acquiresleep(struct sleeplock *lk)
{
acquire(&lk->lk);
while (lk->locked) {
801047fa: 8b 03 mov (%ebx),%eax
801047fc: 83 c4 10 add $0x10,%esp
801047ff: 85 c0 test %eax,%eax
80104801: 75 ed jne 801047f0 <acquiresleep+0x20>
sleep(lk, &lk->lk);
}
lk->locked = 1;
80104803: c7 03 01 00 00 00 movl $0x1,(%ebx)
lk->pid = myproc()->pid;
80104809: e8 b2 f2 ff ff call 80103ac0 <myproc>
8010480e: 8b 40 10 mov 0x10(%eax),%eax
80104811: 89 43 3c mov %eax,0x3c(%ebx)
release(&lk->lk);
80104814: 89 75 08 mov %esi,0x8(%ebp)
}
80104817: 8d 65 f8 lea -0x8(%ebp),%esp
8010481a: 5b pop %ebx
8010481b: 5e pop %esi
8010481c: 5d pop %ebp
while (lk->locked) {
sleep(lk, &lk->lk);
}
lk->locked = 1;
lk->pid = myproc()->pid;
release(&lk->lk);
8010481d: e9 ae 02 00 00 jmp 80104ad0 <release>
80104822: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80104829: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104830 <releasesleep>:
}
void
releasesleep(struct sleeplock *lk)
{
80104830: 55 push %ebp
80104831: 89 e5 mov %esp,%ebp
80104833: 56 push %esi
80104834: 53 push %ebx
80104835: 8b 5d 08 mov 0x8(%ebp),%ebx
acquire(&lk->lk);
80104838: 83 ec 0c sub $0xc,%esp
8010483b: 8d 73 04 lea 0x4(%ebx),%esi
8010483e: 56 push %esi
8010483f: e8 dc 01 00 00 call 80104a20 <acquire>
lk->locked = 0;
80104844: c7 03 00 00 00 00 movl $0x0,(%ebx)
lk->pid = 0;
8010484a: c7 43 3c 00 00 00 00 movl $0x0,0x3c(%ebx)
wakeup(lk);
80104851: 89 1c 24 mov %ebx,(%esp)
80104854: e8 d7 f9 ff ff call 80104230 <wakeup>
release(&lk->lk);
80104859: 89 75 08 mov %esi,0x8(%ebp)
8010485c: 83 c4 10 add $0x10,%esp
}
8010485f: 8d 65 f8 lea -0x8(%ebp),%esp
80104862: 5b pop %ebx
80104863: 5e pop %esi
80104864: 5d pop %ebp
{
acquire(&lk->lk);
lk->locked = 0;
lk->pid = 0;
wakeup(lk);
release(&lk->lk);
80104865: e9 66 02 00 00 jmp 80104ad0 <release>
8010486a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80104870 <holdingsleep>:
}
int
holdingsleep(struct sleeplock *lk)
{
80104870: 55 push %ebp
80104871: 89 e5 mov %esp,%ebp
80104873: 57 push %edi
80104874: 56 push %esi
80104875: 53 push %ebx
80104876: 31 ff xor %edi,%edi
80104878: 83 ec 18 sub $0x18,%esp
8010487b: 8b 5d 08 mov 0x8(%ebp),%ebx
int r;
acquire(&lk->lk);
8010487e: 8d 73 04 lea 0x4(%ebx),%esi
80104881: 56 push %esi
80104882: e8 99 01 00 00 call 80104a20 <acquire>
r = lk->locked && (lk->pid == myproc()->pid);
80104887: 8b 03 mov (%ebx),%eax
80104889: 83 c4 10 add $0x10,%esp
8010488c: 85 c0 test %eax,%eax
8010488e: 74 13 je 801048a3 <holdingsleep+0x33>
80104890: 8b 5b 3c mov 0x3c(%ebx),%ebx
80104893: e8 28 f2 ff ff call 80103ac0 <myproc>
80104898: 39 58 10 cmp %ebx,0x10(%eax)
8010489b: 0f 94 c0 sete %al
8010489e: 0f b6 c0 movzbl %al,%eax
801048a1: 89 c7 mov %eax,%edi
release(&lk->lk);
801048a3: 83 ec 0c sub $0xc,%esp
801048a6: 56 push %esi
801048a7: e8 24 02 00 00 call 80104ad0 <release>
return r;
}
801048ac: 8d 65 f4 lea -0xc(%ebp),%esp
801048af: 89 f8 mov %edi,%eax
801048b1: 5b pop %ebx
801048b2: 5e pop %esi
801048b3: 5f pop %edi
801048b4: 5d pop %ebp
801048b5: c3 ret
801048b6: 66 90 xchg %ax,%ax
801048b8: 66 90 xchg %ax,%ax
801048ba: 66 90 xchg %ax,%ax
801048bc: 66 90 xchg %ax,%ax
801048be: 66 90 xchg %ax,%ax
801048c0 <initlock>:
#include "proc.h"
#include "spinlock.h"
void
initlock(struct spinlock *lk, char *name)
{
801048c0: 55 push %ebp
801048c1: 89 e5 mov %esp,%ebp
801048c3: 8b 45 08 mov 0x8(%ebp),%eax
lk->name = name;
801048c6: 8b 55 0c mov 0xc(%ebp),%edx
lk->locked = 0;
801048c9: c7 00 00 00 00 00 movl $0x0,(%eax)
#include "spinlock.h"
void
initlock(struct spinlock *lk, char *name)
{
lk->name = name;
801048cf: 89 50 04 mov %edx,0x4(%eax)
lk->locked = 0;
lk->cpu = 0;
801048d2: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax)
}
801048d9: 5d pop %ebp
801048da: c3 ret
801048db: 90 nop
801048dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801048e0 <getcallerpcs>:
}
// Record the current call stack in pcs[] by following the %ebp chain.
void
getcallerpcs(void *v, uint pcs[])
{
801048e0: 55 push %ebp
801048e1: 89 e5 mov %esp,%ebp
801048e3: 53 push %ebx
uint *ebp;
int i;
ebp = (uint*)v - 2;
801048e4: 8b 45 08 mov 0x8(%ebp),%eax
}
// Record the current call stack in pcs[] by following the %ebp chain.
void
getcallerpcs(void *v, uint pcs[])
{
801048e7: 8b 4d 0c mov 0xc(%ebp),%ecx
uint *ebp;
int i;
ebp = (uint*)v - 2;
801048ea: 8d 50 f8 lea -0x8(%eax),%edx
for(i = 0; i < 10; i++){
801048ed: 31 c0 xor %eax,%eax
801048ef: 90 nop
if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff)
801048f0: 8d 9a 00 00 00 80 lea -0x80000000(%edx),%ebx
801048f6: 81 fb fe ff ff 7f cmp $0x7ffffffe,%ebx
801048fc: 77 1a ja 80104918 <getcallerpcs+0x38>
break;
pcs[i] = ebp[1]; // saved %eip
801048fe: 8b 5a 04 mov 0x4(%edx),%ebx
80104901: 89 1c 81 mov %ebx,(%ecx,%eax,4)
{
uint *ebp;
int i;
ebp = (uint*)v - 2;
for(i = 0; i < 10; i++){
80104904: 83 c0 01 add $0x1,%eax
if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff)
break;
pcs[i] = ebp[1]; // saved %eip
ebp = (uint*)ebp[0]; // saved %ebp
80104907: 8b 12 mov (%edx),%edx
{
uint *ebp;
int i;
ebp = (uint*)v - 2;
for(i = 0; i < 10; i++){
80104909: 83 f8 0a cmp $0xa,%eax
8010490c: 75 e2 jne 801048f0 <getcallerpcs+0x10>
pcs[i] = ebp[1]; // saved %eip
ebp = (uint*)ebp[0]; // saved %ebp
}
for(; i < 10; i++)
pcs[i] = 0;
}
8010490e: 5b pop %ebx
8010490f: 5d pop %ebp
80104910: c3 ret
80104911: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
break;
pcs[i] = ebp[1]; // saved %eip
ebp = (uint*)ebp[0]; // saved %ebp
}
for(; i < 10; i++)
pcs[i] = 0;
80104918: c7 04 81 00 00 00 00 movl $0x0,(%ecx,%eax,4)
if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff)
break;
pcs[i] = ebp[1]; // saved %eip
ebp = (uint*)ebp[0]; // saved %ebp
}
for(; i < 10; i++)
8010491f: 83 c0 01 add $0x1,%eax
80104922: 83 f8 0a cmp $0xa,%eax
80104925: 74 e7 je 8010490e <getcallerpcs+0x2e>
pcs[i] = 0;
80104927: c7 04 81 00 00 00 00 movl $0x0,(%ecx,%eax,4)
if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff)
break;
pcs[i] = ebp[1]; // saved %eip
ebp = (uint*)ebp[0]; // saved %ebp
}
for(; i < 10; i++)
8010492e: 83 c0 01 add $0x1,%eax
80104931: 83 f8 0a cmp $0xa,%eax
80104934: 75 e2 jne 80104918 <getcallerpcs+0x38>
80104936: eb d6 jmp 8010490e <getcallerpcs+0x2e>
80104938: 90 nop
80104939: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80104940 <pushcli>:
// it takes two popcli to undo two pushcli. Also, if interrupts
// are off, then pushcli, popcli leaves them off.
void
pushcli(void)
{
80104940: 55 push %ebp
80104941: 89 e5 mov %esp,%ebp
80104943: 53 push %ebx
80104944: 83 ec 04 sub $0x4,%esp
80104947: 9c pushf
80104948: 5b pop %ebx
}
static inline void
cli(void)
{
asm volatile("cli");
80104949: fa cli
int eflags;
eflags = readeflags();
cli();
if(mycpu()->ncli == 0)
8010494a: e8 d1 f0 ff ff call 80103a20 <mycpu>
8010494f: 8b 80 a4 00 00 00 mov 0xa4(%eax),%eax
80104955: 85 c0 test %eax,%eax
80104957: 75 11 jne 8010496a <pushcli+0x2a>
mycpu()->intena = eflags & FL_IF;
80104959: 81 e3 00 02 00 00 and $0x200,%ebx
8010495f: e8 bc f0 ff ff call 80103a20 <mycpu>
80104964: 89 98 a8 00 00 00 mov %ebx,0xa8(%eax)
mycpu()->ncli += 1;
8010496a: e8 b1 f0 ff ff call 80103a20 <mycpu>
8010496f: 83 80 a4 00 00 00 01 addl $0x1,0xa4(%eax)
}
80104976: 83 c4 04 add $0x4,%esp
80104979: 5b pop %ebx
8010497a: 5d pop %ebp
8010497b: c3 ret
8010497c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80104980 <popcli>:
void
popcli(void)
{
80104980: 55 push %ebp
80104981: 89 e5 mov %esp,%ebp
80104983: 83 ec 08 sub $0x8,%esp
static inline uint
readeflags(void)
{
uint eflags;
asm volatile("pushfl; popl %0" : "=r" (eflags));
80104986: 9c pushf
80104987: 58 pop %eax
if(readeflags()&FL_IF)
80104988: f6 c4 02 test $0x2,%ah
8010498b: 75 52 jne 801049df <popcli+0x5f>
panic("popcli - interruptible");
if(--mycpu()->ncli < 0)
8010498d: e8 8e f0 ff ff call 80103a20 <mycpu>
80104992: 8b 88 a4 00 00 00 mov 0xa4(%eax),%ecx
80104998: 8d 51 ff lea -0x1(%ecx),%edx
8010499b: 85 d2 test %edx,%edx
8010499d: 89 90 a4 00 00 00 mov %edx,0xa4(%eax)
801049a3: 78 2d js 801049d2 <popcli+0x52>
panic("popcli");
if(mycpu()->ncli == 0 && mycpu()->intena)
801049a5: e8 76 f0 ff ff call 80103a20 <mycpu>
801049aa: 8b 90 a4 00 00 00 mov 0xa4(%eax),%edx
801049b0: 85 d2 test %edx,%edx
801049b2: 74 0c je 801049c0 <popcli+0x40>
sti();
}
801049b4: c9 leave
801049b5: c3 ret
801049b6: 8d 76 00 lea 0x0(%esi),%esi
801049b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
{
if(readeflags()&FL_IF)
panic("popcli - interruptible");
if(--mycpu()->ncli < 0)
panic("popcli");
if(mycpu()->ncli == 0 && mycpu()->intena)
801049c0: e8 5b f0 ff ff call 80103a20 <mycpu>
801049c5: 8b 80 a8 00 00 00 mov 0xa8(%eax),%eax
801049cb: 85 c0 test %eax,%eax
801049cd: 74 e5 je 801049b4 <popcli+0x34>
}
static inline void
sti(void)
{
asm volatile("sti");
801049cf: fb sti
sti();
}
801049d0: c9 leave
801049d1: c3 ret
popcli(void)
{
if(readeflags()&FL_IF)
panic("popcli - interruptible");
if(--mycpu()->ncli < 0)
panic("popcli");
801049d2: 83 ec 0c sub $0xc,%esp
801049d5: 68 5e 7e 10 80 push $0x80107e5e
801049da: e8 91 b9 ff ff call 80100370 <panic>
void
popcli(void)
{
if(readeflags()&FL_IF)
panic("popcli - interruptible");
801049df: 83 ec 0c sub $0xc,%esp
801049e2: 68 47 7e 10 80 push $0x80107e47
801049e7: e8 84 b9 ff ff call 80100370 <panic>
801049ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801049f0 <holding>:
}
// Check whether this cpu is holding the lock.
int
holding(struct spinlock *lock)
{
801049f0: 55 push %ebp
801049f1: 89 e5 mov %esp,%ebp
801049f3: 56 push %esi
801049f4: 53 push %ebx
801049f5: 8b 75 08 mov 0x8(%ebp),%esi
801049f8: 31 db xor %ebx,%ebx
int r;
pushcli();
801049fa: e8 41 ff ff ff call 80104940 <pushcli>
r = lock->locked && lock->cpu == mycpu();
801049ff: 8b 06 mov (%esi),%eax
80104a01: 85 c0 test %eax,%eax
80104a03: 74 10 je 80104a15 <holding+0x25>
80104a05: 8b 5e 08 mov 0x8(%esi),%ebx
80104a08: e8 13 f0 ff ff call 80103a20 <mycpu>
80104a0d: 39 c3 cmp %eax,%ebx
80104a0f: 0f 94 c3 sete %bl
80104a12: 0f b6 db movzbl %bl,%ebx
popcli();
80104a15: e8 66 ff ff ff call 80104980 <popcli>
return r;
}
80104a1a: 89 d8 mov %ebx,%eax
80104a1c: 5b pop %ebx
80104a1d: 5e pop %esi
80104a1e: 5d pop %ebp
80104a1f: c3 ret
80104a20 <acquire>:
// Loops (spins) until the lock is acquired.
// Holding a lock for a long time may cause
// other CPUs to waste time spinning to acquire it.
void
acquire(struct spinlock *lk)
{
80104a20: 55 push %ebp
80104a21: 89 e5 mov %esp,%ebp
80104a23: 53 push %ebx
80104a24: 83 ec 04 sub $0x4,%esp
pushcli(); // disable interrupts to avoid deadlock.
80104a27: e8 14 ff ff ff call 80104940 <pushcli>
if(holding(lk))
80104a2c: 8b 5d 08 mov 0x8(%ebp),%ebx
80104a2f: 83 ec 0c sub $0xc,%esp
80104a32: 53 push %ebx
80104a33: e8 b8 ff ff ff call 801049f0 <holding>
80104a38: 83 c4 10 add $0x10,%esp
80104a3b: 85 c0 test %eax,%eax
80104a3d: 0f 85 7d 00 00 00 jne 80104ac0 <acquire+0xa0>
xchg(volatile uint *addr, uint newval)
{
uint result;
// The + in "+m" denotes a read-modify-write operand.
asm volatile("lock; xchgl %0, %1" :
80104a43: ba 01 00 00 00 mov $0x1,%edx
80104a48: eb 09 jmp 80104a53 <acquire+0x33>
80104a4a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80104a50: 8b 5d 08 mov 0x8(%ebp),%ebx
80104a53: 89 d0 mov %edx,%eax
80104a55: f0 87 03 lock xchg %eax,(%ebx)
panic("acquire");
// The xchg is atomic.
while(xchg(&lk->locked, 1) != 0)
80104a58: 85 c0 test %eax,%eax
80104a5a: 75 f4 jne 80104a50 <acquire+0x30>
;
// Tell the C compiler and the processor to not move loads or stores
// past this point, to ensure that the critical section's memory
// references happen after the lock is acquired.
__sync_synchronize();
80104a5c: f0 83 0c 24 00 lock orl $0x0,(%esp)
// Record info about lock acquisition for debugging.
lk->cpu = mycpu();
80104a61: 8b 5d 08 mov 0x8(%ebp),%ebx
80104a64: e8 b7 ef ff ff call 80103a20 <mycpu>
getcallerpcs(void *v, uint pcs[])
{
uint *ebp;
int i;
ebp = (uint*)v - 2;
80104a69: 89 ea mov %ebp,%edx
// references happen after the lock is acquired.
__sync_synchronize();
// Record info about lock acquisition for debugging.
lk->cpu = mycpu();
getcallerpcs(&lk, lk->pcs);
80104a6b: 8d 4b 0c lea 0xc(%ebx),%ecx
// past this point, to ensure that the critical section's memory
// references happen after the lock is acquired.
__sync_synchronize();
// Record info about lock acquisition for debugging.
lk->cpu = mycpu();
80104a6e: 89 43 08 mov %eax,0x8(%ebx)
{
uint *ebp;
int i;
ebp = (uint*)v - 2;
for(i = 0; i < 10; i++){
80104a71: 31 c0 xor %eax,%eax
80104a73: 90 nop
80104a74: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff)
80104a78: 8d 9a 00 00 00 80 lea -0x80000000(%edx),%ebx
80104a7e: 81 fb fe ff ff 7f cmp $0x7ffffffe,%ebx
80104a84: 77 1a ja 80104aa0 <acquire+0x80>
break;
pcs[i] = ebp[1]; // saved %eip
80104a86: 8b 5a 04 mov 0x4(%edx),%ebx
80104a89: 89 1c 81 mov %ebx,(%ecx,%eax,4)
{
uint *ebp;
int i;
ebp = (uint*)v - 2;
for(i = 0; i < 10; i++){
80104a8c: 83 c0 01 add $0x1,%eax
if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff)
break;
pcs[i] = ebp[1]; // saved %eip
ebp = (uint*)ebp[0]; // saved %ebp
80104a8f: 8b 12 mov (%edx),%edx
{
uint *ebp;
int i;
ebp = (uint*)v - 2;
for(i = 0; i < 10; i++){
80104a91: 83 f8 0a cmp $0xa,%eax
80104a94: 75 e2 jne 80104a78 <acquire+0x58>
__sync_synchronize();
// Record info about lock acquisition for debugging.
lk->cpu = mycpu();
getcallerpcs(&lk, lk->pcs);
}
80104a96: 8b 5d fc mov -0x4(%ebp),%ebx
80104a99: c9 leave
80104a9a: c3 ret
80104a9b: 90 nop
80104a9c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
break;
pcs[i] = ebp[1]; // saved %eip
ebp = (uint*)ebp[0]; // saved %ebp
}
for(; i < 10; i++)
pcs[i] = 0;
80104aa0: c7 04 81 00 00 00 00 movl $0x0,(%ecx,%eax,4)
if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff)
break;
pcs[i] = ebp[1]; // saved %eip
ebp = (uint*)ebp[0]; // saved %ebp
}
for(; i < 10; i++)
80104aa7: 83 c0 01 add $0x1,%eax
80104aaa: 83 f8 0a cmp $0xa,%eax
80104aad: 74 e7 je 80104a96 <acquire+0x76>
pcs[i] = 0;
80104aaf: c7 04 81 00 00 00 00 movl $0x0,(%ecx,%eax,4)
if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff)
break;
pcs[i] = ebp[1]; // saved %eip
ebp = (uint*)ebp[0]; // saved %ebp
}
for(; i < 10; i++)
80104ab6: 83 c0 01 add $0x1,%eax
80104ab9: 83 f8 0a cmp $0xa,%eax
80104abc: 75 e2 jne 80104aa0 <acquire+0x80>
80104abe: eb d6 jmp 80104a96 <acquire+0x76>
void
acquire(struct spinlock *lk)
{
pushcli(); // disable interrupts to avoid deadlock.
if(holding(lk))
panic("acquire");
80104ac0: 83 ec 0c sub $0xc,%esp
80104ac3: 68 65 7e 10 80 push $0x80107e65
80104ac8: e8 a3 b8 ff ff call 80100370 <panic>
80104acd: 8d 76 00 lea 0x0(%esi),%esi
80104ad0 <release>:
}
// Release the lock.
void
release(struct spinlock *lk)
{
80104ad0: 55 push %ebp
80104ad1: 89 e5 mov %esp,%ebp
80104ad3: 53 push %ebx
80104ad4: 83 ec 10 sub $0x10,%esp
80104ad7: 8b 5d 08 mov 0x8(%ebp),%ebx
if(!holding(lk))
80104ada: 53 push %ebx
80104adb: e8 10 ff ff ff call 801049f0 <holding>
80104ae0: 83 c4 10 add $0x10,%esp
80104ae3: 85 c0 test %eax,%eax
80104ae5: 74 22 je 80104b09 <release+0x39>
panic("release");
lk->pcs[0] = 0;
80104ae7: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx)
lk->cpu = 0;
80104aee: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx)
// Tell the C compiler and the processor to not move loads or stores
// past this point, to ensure that all the stores in the critical
// section are visible to other cores before the lock is released.
// Both the C compiler and the hardware may re-order loads and
// stores; __sync_synchronize() tells them both not to.
__sync_synchronize();
80104af5: f0 83 0c 24 00 lock orl $0x0,(%esp)
// Release the lock, equivalent to lk->locked = 0.
// This code can't use a C assignment, since it might
// not be atomic. A real OS would use C atomics here.
asm volatile("movl $0, %0" : "+m" (lk->locked) : );
80104afa: c7 03 00 00 00 00 movl $0x0,(%ebx)
popcli();
}
80104b00: 8b 5d fc mov -0x4(%ebp),%ebx
80104b03: c9 leave
// Release the lock, equivalent to lk->locked = 0.
// This code can't use a C assignment, since it might
// not be atomic. A real OS would use C atomics here.
asm volatile("movl $0, %0" : "+m" (lk->locked) : );
popcli();
80104b04: e9 77 fe ff ff jmp 80104980 <popcli>
// Release the lock.
void
release(struct spinlock *lk)
{
if(!holding(lk))
panic("release");
80104b09: 83 ec 0c sub $0xc,%esp
80104b0c: 68 6d 7e 10 80 push $0x80107e6d
80104b11: e8 5a b8 ff ff call 80100370 <panic>
80104b16: 66 90 xchg %ax,%ax
80104b18: 66 90 xchg %ax,%ax
80104b1a: 66 90 xchg %ax,%ax
80104b1c: 66 90 xchg %ax,%ax
80104b1e: 66 90 xchg %ax,%ax
80104b20 <memset>:
80104b20: 55 push %ebp
80104b21: 89 e5 mov %esp,%ebp
80104b23: 57 push %edi
80104b24: 53 push %ebx
80104b25: 8b 55 08 mov 0x8(%ebp),%edx
80104b28: 8b 4d 10 mov 0x10(%ebp),%ecx
80104b2b: f6 c2 03 test $0x3,%dl
80104b2e: 75 05 jne 80104b35 <memset+0x15>
80104b30: f6 c1 03 test $0x3,%cl
80104b33: 74 13 je 80104b48 <memset+0x28>
80104b35: 89 d7 mov %edx,%edi
80104b37: 8b 45 0c mov 0xc(%ebp),%eax
80104b3a: fc cld
80104b3b: f3 aa rep stos %al,%es:(%edi)
80104b3d: 5b pop %ebx
80104b3e: 89 d0 mov %edx,%eax
80104b40: 5f pop %edi
80104b41: 5d pop %ebp
80104b42: c3 ret
80104b43: 90 nop
80104b44: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80104b48: 0f b6 7d 0c movzbl 0xc(%ebp),%edi
80104b4c: c1 e9 02 shr $0x2,%ecx
80104b4f: 89 fb mov %edi,%ebx
80104b51: 89 f8 mov %edi,%eax
80104b53: c1 e3 18 shl $0x18,%ebx
80104b56: c1 e0 10 shl $0x10,%eax
80104b59: 09 d8 or %ebx,%eax
80104b5b: 09 f8 or %edi,%eax
80104b5d: c1 e7 08 shl $0x8,%edi
80104b60: 09 f8 or %edi,%eax
80104b62: 89 d7 mov %edx,%edi
80104b64: fc cld
80104b65: f3 ab rep stos %eax,%es:(%edi)
80104b67: 5b pop %ebx
80104b68: 89 d0 mov %edx,%eax
80104b6a: 5f pop %edi
80104b6b: 5d pop %ebp
80104b6c: c3 ret
80104b6d: 8d 76 00 lea 0x0(%esi),%esi
80104b70 <memcmp>:
80104b70: 55 push %ebp
80104b71: 89 e5 mov %esp,%ebp
80104b73: 57 push %edi
80104b74: 56 push %esi
80104b75: 8b 45 10 mov 0x10(%ebp),%eax
80104b78: 53 push %ebx
80104b79: 8b 75 0c mov 0xc(%ebp),%esi
80104b7c: 8b 5d 08 mov 0x8(%ebp),%ebx
80104b7f: 85 c0 test %eax,%eax
80104b81: 74 29 je 80104bac <memcmp+0x3c>
80104b83: 0f b6 13 movzbl (%ebx),%edx
80104b86: 0f b6 0e movzbl (%esi),%ecx
80104b89: 38 d1 cmp %dl,%cl
80104b8b: 75 2b jne 80104bb8 <memcmp+0x48>
80104b8d: 8d 78 ff lea -0x1(%eax),%edi
80104b90: 31 c0 xor %eax,%eax
80104b92: eb 14 jmp 80104ba8 <memcmp+0x38>
80104b94: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80104b98: 0f b6 54 03 01 movzbl 0x1(%ebx,%eax,1),%edx
80104b9d: 83 c0 01 add $0x1,%eax
80104ba0: 0f b6 0c 06 movzbl (%esi,%eax,1),%ecx
80104ba4: 38 ca cmp %cl,%dl
80104ba6: 75 10 jne 80104bb8 <memcmp+0x48>
80104ba8: 39 f8 cmp %edi,%eax
80104baa: 75 ec jne 80104b98 <memcmp+0x28>
80104bac: 5b pop %ebx
80104bad: 31 c0 xor %eax,%eax
80104baf: 5e pop %esi
80104bb0: 5f pop %edi
80104bb1: 5d pop %ebp
80104bb2: c3 ret
80104bb3: 90 nop
80104bb4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80104bb8: 0f b6 c2 movzbl %dl,%eax
80104bbb: 5b pop %ebx
80104bbc: 29 c8 sub %ecx,%eax
80104bbe: 5e pop %esi
80104bbf: 5f pop %edi
80104bc0: 5d pop %ebp
80104bc1: c3 ret
80104bc2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80104bc9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104bd0 <memmove>:
80104bd0: 55 push %ebp
80104bd1: 89 e5 mov %esp,%ebp
80104bd3: 56 push %esi
80104bd4: 53 push %ebx
80104bd5: 8b 45 08 mov 0x8(%ebp),%eax
80104bd8: 8b 75 0c mov 0xc(%ebp),%esi
80104bdb: 8b 5d 10 mov 0x10(%ebp),%ebx
80104bde: 39 c6 cmp %eax,%esi
80104be0: 73 2e jae 80104c10 <memmove+0x40>
80104be2: 8d 0c 1e lea (%esi,%ebx,1),%ecx
80104be5: 39 c8 cmp %ecx,%eax
80104be7: 73 27 jae 80104c10 <memmove+0x40>
80104be9: 85 db test %ebx,%ebx
80104beb: 8d 53 ff lea -0x1(%ebx),%edx
80104bee: 74 17 je 80104c07 <memmove+0x37>
80104bf0: 29 d9 sub %ebx,%ecx
80104bf2: 89 cb mov %ecx,%ebx
80104bf4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80104bf8: 0f b6 0c 13 movzbl (%ebx,%edx,1),%ecx
80104bfc: 88 0c 10 mov %cl,(%eax,%edx,1)
80104bff: 83 ea 01 sub $0x1,%edx
80104c02: 83 fa ff cmp $0xffffffff,%edx
80104c05: 75 f1 jne 80104bf8 <memmove+0x28>
80104c07: 5b pop %ebx
80104c08: 5e pop %esi
80104c09: 5d pop %ebp
80104c0a: c3 ret
80104c0b: 90 nop
80104c0c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80104c10: 31 d2 xor %edx,%edx
80104c12: 85 db test %ebx,%ebx
80104c14: 74 f1 je 80104c07 <memmove+0x37>
80104c16: 8d 76 00 lea 0x0(%esi),%esi
80104c19: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104c20: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx
80104c24: 88 0c 10 mov %cl,(%eax,%edx,1)
80104c27: 83 c2 01 add $0x1,%edx
80104c2a: 39 d3 cmp %edx,%ebx
80104c2c: 75 f2 jne 80104c20 <memmove+0x50>
80104c2e: 5b pop %ebx
80104c2f: 5e pop %esi
80104c30: 5d pop %ebp
80104c31: c3 ret
80104c32: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80104c39: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104c40 <memcpy>:
80104c40: 55 push %ebp
80104c41: 89 e5 mov %esp,%ebp
80104c43: 5d pop %ebp
80104c44: eb 8a jmp 80104bd0 <memmove>
80104c46: 8d 76 00 lea 0x0(%esi),%esi
80104c49: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104c50 <strncmp>:
80104c50: 55 push %ebp
80104c51: 89 e5 mov %esp,%ebp
80104c53: 57 push %edi
80104c54: 56 push %esi
80104c55: 8b 4d 10 mov 0x10(%ebp),%ecx
80104c58: 53 push %ebx
80104c59: 8b 7d 08 mov 0x8(%ebp),%edi
80104c5c: 8b 75 0c mov 0xc(%ebp),%esi
80104c5f: 85 c9 test %ecx,%ecx
80104c61: 74 37 je 80104c9a <strncmp+0x4a>
80104c63: 0f b6 17 movzbl (%edi),%edx
80104c66: 0f b6 1e movzbl (%esi),%ebx
80104c69: 84 d2 test %dl,%dl
80104c6b: 74 3f je 80104cac <strncmp+0x5c>
80104c6d: 38 d3 cmp %dl,%bl
80104c6f: 75 3b jne 80104cac <strncmp+0x5c>
80104c71: 8d 47 01 lea 0x1(%edi),%eax
80104c74: 01 cf add %ecx,%edi
80104c76: eb 1b jmp 80104c93 <strncmp+0x43>
80104c78: 90 nop
80104c79: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80104c80: 0f b6 10 movzbl (%eax),%edx
80104c83: 84 d2 test %dl,%dl
80104c85: 74 21 je 80104ca8 <strncmp+0x58>
80104c87: 0f b6 19 movzbl (%ecx),%ebx
80104c8a: 83 c0 01 add $0x1,%eax
80104c8d: 89 ce mov %ecx,%esi
80104c8f: 38 da cmp %bl,%dl
80104c91: 75 19 jne 80104cac <strncmp+0x5c>
80104c93: 39 c7 cmp %eax,%edi
80104c95: 8d 4e 01 lea 0x1(%esi),%ecx
80104c98: 75 e6 jne 80104c80 <strncmp+0x30>
80104c9a: 5b pop %ebx
80104c9b: 31 c0 xor %eax,%eax
80104c9d: 5e pop %esi
80104c9e: 5f pop %edi
80104c9f: 5d pop %ebp
80104ca0: c3 ret
80104ca1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80104ca8: 0f b6 5e 01 movzbl 0x1(%esi),%ebx
80104cac: 0f b6 c2 movzbl %dl,%eax
80104caf: 29 d8 sub %ebx,%eax
80104cb1: 5b pop %ebx
80104cb2: 5e pop %esi
80104cb3: 5f pop %edi
80104cb4: 5d pop %ebp
80104cb5: c3 ret
80104cb6: 8d 76 00 lea 0x0(%esi),%esi
80104cb9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104cc0 <strncpy>:
80104cc0: 55 push %ebp
80104cc1: 89 e5 mov %esp,%ebp
80104cc3: 56 push %esi
80104cc4: 53 push %ebx
80104cc5: 8b 45 08 mov 0x8(%ebp),%eax
80104cc8: 8b 5d 0c mov 0xc(%ebp),%ebx
80104ccb: 8b 4d 10 mov 0x10(%ebp),%ecx
80104cce: 89 c2 mov %eax,%edx
80104cd0: eb 19 jmp 80104ceb <strncpy+0x2b>
80104cd2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80104cd8: 83 c3 01 add $0x1,%ebx
80104cdb: 0f b6 4b ff movzbl -0x1(%ebx),%ecx
80104cdf: 83 c2 01 add $0x1,%edx
80104ce2: 84 c9 test %cl,%cl
80104ce4: 88 4a ff mov %cl,-0x1(%edx)
80104ce7: 74 09 je 80104cf2 <strncpy+0x32>
80104ce9: 89 f1 mov %esi,%ecx
80104ceb: 85 c9 test %ecx,%ecx
80104ced: 8d 71 ff lea -0x1(%ecx),%esi
80104cf0: 7f e6 jg 80104cd8 <strncpy+0x18>
80104cf2: 31 c9 xor %ecx,%ecx
80104cf4: 85 f6 test %esi,%esi
80104cf6: 7e 17 jle 80104d0f <strncpy+0x4f>
80104cf8: 90 nop
80104cf9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80104d00: c6 04 0a 00 movb $0x0,(%edx,%ecx,1)
80104d04: 89 f3 mov %esi,%ebx
80104d06: 83 c1 01 add $0x1,%ecx
80104d09: 29 cb sub %ecx,%ebx
80104d0b: 85 db test %ebx,%ebx
80104d0d: 7f f1 jg 80104d00 <strncpy+0x40>
80104d0f: 5b pop %ebx
80104d10: 5e pop %esi
80104d11: 5d pop %ebp
80104d12: c3 ret
80104d13: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80104d19: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104d20 <safestrcpy>:
80104d20: 55 push %ebp
80104d21: 89 e5 mov %esp,%ebp
80104d23: 56 push %esi
80104d24: 53 push %ebx
80104d25: 8b 4d 10 mov 0x10(%ebp),%ecx
80104d28: 8b 45 08 mov 0x8(%ebp),%eax
80104d2b: 8b 55 0c mov 0xc(%ebp),%edx
80104d2e: 85 c9 test %ecx,%ecx
80104d30: 7e 26 jle 80104d58 <safestrcpy+0x38>
80104d32: 8d 74 0a ff lea -0x1(%edx,%ecx,1),%esi
80104d36: 89 c1 mov %eax,%ecx
80104d38: eb 17 jmp 80104d51 <safestrcpy+0x31>
80104d3a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80104d40: 83 c2 01 add $0x1,%edx
80104d43: 0f b6 5a ff movzbl -0x1(%edx),%ebx
80104d47: 83 c1 01 add $0x1,%ecx
80104d4a: 84 db test %bl,%bl
80104d4c: 88 59 ff mov %bl,-0x1(%ecx)
80104d4f: 74 04 je 80104d55 <safestrcpy+0x35>
80104d51: 39 f2 cmp %esi,%edx
80104d53: 75 eb jne 80104d40 <safestrcpy+0x20>
80104d55: c6 01 00 movb $0x0,(%ecx)
80104d58: 5b pop %ebx
80104d59: 5e pop %esi
80104d5a: 5d pop %ebp
80104d5b: c3 ret
80104d5c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80104d60 <strlen>:
80104d60: 55 push %ebp
80104d61: 31 c0 xor %eax,%eax
80104d63: 89 e5 mov %esp,%ebp
80104d65: 8b 55 08 mov 0x8(%ebp),%edx
80104d68: 80 3a 00 cmpb $0x0,(%edx)
80104d6b: 74 0c je 80104d79 <strlen+0x19>
80104d6d: 8d 76 00 lea 0x0(%esi),%esi
80104d70: 83 c0 01 add $0x1,%eax
80104d73: 80 3c 02 00 cmpb $0x0,(%edx,%eax,1)
80104d77: 75 f7 jne 80104d70 <strlen+0x10>
80104d79: 5d pop %ebp
80104d7a: c3 ret
80104d7b <swtch>:
80104d7b: 8b 44 24 04 mov 0x4(%esp),%eax
80104d7f: 8b 54 24 08 mov 0x8(%esp),%edx
80104d83: 55 push %ebp
80104d84: 53 push %ebx
80104d85: 56 push %esi
80104d86: 57 push %edi
80104d87: 89 20 mov %esp,(%eax)
80104d89: 89 d4 mov %edx,%esp
80104d8b: 5f pop %edi
80104d8c: 5e pop %esi
80104d8d: 5b pop %ebx
80104d8e: 5d pop %ebp
80104d8f: c3 ret
80104d90 <fetchint>:
// library system call function. The saved user %esp points
// 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)
{
80104d90: 55 push %ebp
80104d91: 89 e5 mov %esp,%ebp
80104d93: 53 push %ebx
80104d94: 83 ec 04 sub $0x4,%esp
80104d97: 8b 5d 08 mov 0x8(%ebp),%ebx
struct proc *curproc = myproc();
80104d9a: e8 21 ed ff ff call 80103ac0 <myproc>
if (addr >= curproc->sz || addr + 4 > curproc->sz)
80104d9f: 8b 00 mov (%eax),%eax
80104da1: 39 d8 cmp %ebx,%eax
80104da3: 76 1b jbe 80104dc0 <fetchint+0x30>
80104da5: 8d 53 04 lea 0x4(%ebx),%edx
80104da8: 39 d0 cmp %edx,%eax
80104daa: 72 14 jb 80104dc0 <fetchint+0x30>
return -1;
*ip = *(int *)(addr);
80104dac: 8b 45 0c mov 0xc(%ebp),%eax
80104daf: 8b 13 mov (%ebx),%edx
80104db1: 89 10 mov %edx,(%eax)
return 0;
80104db3: 31 c0 xor %eax,%eax
}
80104db5: 83 c4 04 add $0x4,%esp
80104db8: 5b pop %ebx
80104db9: 5d pop %ebp
80104dba: c3 ret
80104dbb: 90 nop
80104dbc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
int fetchint(uint addr, int *ip)
{
struct proc *curproc = myproc();
if (addr >= curproc->sz || addr + 4 > curproc->sz)
return -1;
80104dc0: b8 ff ff ff ff mov $0xffffffff,%eax
80104dc5: eb ee jmp 80104db5 <fetchint+0x25>
80104dc7: 89 f6 mov %esi,%esi
80104dc9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104dd0 <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)
{
80104dd0: 55 push %ebp
80104dd1: 89 e5 mov %esp,%ebp
80104dd3: 53 push %ebx
80104dd4: 83 ec 04 sub $0x4,%esp
80104dd7: 8b 5d 08 mov 0x8(%ebp),%ebx
char *s, *ep;
struct proc *curproc = myproc();
80104dda: e8 e1 ec ff ff call 80103ac0 <myproc>
if (addr >= curproc->sz)
80104ddf: 39 18 cmp %ebx,(%eax)
80104de1: 76 29 jbe 80104e0c <fetchstr+0x3c>
return -1;
*pp = (char *)addr;
80104de3: 8b 4d 0c mov 0xc(%ebp),%ecx
80104de6: 89 da mov %ebx,%edx
80104de8: 89 19 mov %ebx,(%ecx)
ep = (char *)curproc->sz;
80104dea: 8b 00 mov (%eax),%eax
for (s = *pp; s < ep; s++)
80104dec: 39 c3 cmp %eax,%ebx
80104dee: 73 1c jae 80104e0c <fetchstr+0x3c>
{
if (*s == 0)
80104df0: 80 3b 00 cmpb $0x0,(%ebx)
80104df3: 75 10 jne 80104e05 <fetchstr+0x35>
80104df5: eb 29 jmp 80104e20 <fetchstr+0x50>
80104df7: 89 f6 mov %esi,%esi
80104df9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104e00: 80 3a 00 cmpb $0x0,(%edx)
80104e03: 74 1b je 80104e20 <fetchstr+0x50>
if (addr >= curproc->sz)
return -1;
*pp = (char *)addr;
ep = (char *)curproc->sz;
for (s = *pp; s < ep; s++)
80104e05: 83 c2 01 add $0x1,%edx
80104e08: 39 d0 cmp %edx,%eax
80104e0a: 77 f4 ja 80104e00 <fetchstr+0x30>
{
if (*s == 0)
return s - *pp;
}
return -1;
}
80104e0c: 83 c4 04 add $0x4,%esp
{
char *s, *ep;
struct proc *curproc = myproc();
if (addr >= curproc->sz)
return -1;
80104e0f: b8 ff ff ff ff mov $0xffffffff,%eax
{
if (*s == 0)
return s - *pp;
}
return -1;
}
80104e14: 5b pop %ebx
80104e15: 5d pop %ebp
80104e16: c3 ret
80104e17: 89 f6 mov %esi,%esi
80104e19: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104e20: 83 c4 04 add $0x4,%esp
*pp = (char *)addr;
ep = (char *)curproc->sz;
for (s = *pp; s < ep; s++)
{
if (*s == 0)
return s - *pp;
80104e23: 89 d0 mov %edx,%eax
80104e25: 29 d8 sub %ebx,%eax
}
return -1;
}
80104e27: 5b pop %ebx
80104e28: 5d pop %ebp
80104e29: c3 ret
80104e2a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80104e30 <argint>:
// Fetch the nth 32-bit system call argument.
int argint(int n, int *ip)
{
80104e30: 55 push %ebp
80104e31: 89 e5 mov %esp,%ebp
80104e33: 56 push %esi
80104e34: 53 push %ebx
return fetchint((myproc()->tf->esp) + 4 + 4 * n, ip);
80104e35: e8 86 ec ff ff call 80103ac0 <myproc>
80104e3a: 8b 40 18 mov 0x18(%eax),%eax
80104e3d: 8b 55 08 mov 0x8(%ebp),%edx
80104e40: 8b 40 44 mov 0x44(%eax),%eax
80104e43: 8d 1c 90 lea (%eax,%edx,4),%ebx
// 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)
{
struct proc *curproc = myproc();
80104e46: e8 75 ec ff ff call 80103ac0 <myproc>
if (addr >= curproc->sz || addr + 4 > curproc->sz)
80104e4b: 8b 00 mov (%eax),%eax
}
// Fetch the nth 32-bit system call argument.
int argint(int n, int *ip)
{
return fetchint((myproc()->tf->esp) + 4 + 4 * n, ip);
80104e4d: 8d 73 04 lea 0x4(%ebx),%esi
// Fetch the int at addr from the current process.
int fetchint(uint addr, int *ip)
{
struct proc *curproc = myproc();
if (addr >= curproc->sz || addr + 4 > curproc->sz)
80104e50: 39 c6 cmp %eax,%esi
80104e52: 73 1c jae 80104e70 <argint+0x40>
80104e54: 8d 53 08 lea 0x8(%ebx),%edx
80104e57: 39 d0 cmp %edx,%eax
80104e59: 72 15 jb 80104e70 <argint+0x40>
return -1;
*ip = *(int *)(addr);
80104e5b: 8b 45 0c mov 0xc(%ebp),%eax
80104e5e: 8b 53 04 mov 0x4(%ebx),%edx
80104e61: 89 10 mov %edx,(%eax)
return 0;
80104e63: 31 c0 xor %eax,%eax
// Fetch the nth 32-bit system call argument.
int argint(int n, int *ip)
{
return fetchint((myproc()->tf->esp) + 4 + 4 * n, ip);
}
80104e65: 5b pop %ebx
80104e66: 5e pop %esi
80104e67: 5d pop %ebp
80104e68: c3 ret
80104e69: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
int fetchint(uint addr, int *ip)
{
struct proc *curproc = myproc();
if (addr >= curproc->sz || addr + 4 > curproc->sz)
return -1;
80104e70: b8 ff ff ff ff mov $0xffffffff,%eax
80104e75: eb ee jmp 80104e65 <argint+0x35>
80104e77: 89 f6 mov %esi,%esi
80104e79: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104e80 <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)
{
80104e80: 55 push %ebp
80104e81: 89 e5 mov %esp,%ebp
80104e83: 56 push %esi
80104e84: 53 push %ebx
80104e85: 83 ec 10 sub $0x10,%esp
80104e88: 8b 5d 10 mov 0x10(%ebp),%ebx
int i;
struct proc *curproc = myproc();
80104e8b: e8 30 ec ff ff call 80103ac0 <myproc>
80104e90: 89 c6 mov %eax,%esi
if (argint(n, &i) < 0)
80104e92: 8d 45 f4 lea -0xc(%ebp),%eax
80104e95: 83 ec 08 sub $0x8,%esp
80104e98: 50 push %eax
80104e99: ff 75 08 pushl 0x8(%ebp)
80104e9c: e8 8f ff ff ff call 80104e30 <argint>
return -1;
if (size < 0 || (uint)i >= curproc->sz || (uint)i + size > curproc->sz)
80104ea1: c1 e8 1f shr $0x1f,%eax
80104ea4: 83 c4 10 add $0x10,%esp
80104ea7: 84 c0 test %al,%al
80104ea9: 75 2d jne 80104ed8 <argptr+0x58>
80104eab: 89 d8 mov %ebx,%eax
80104ead: c1 e8 1f shr $0x1f,%eax
80104eb0: 84 c0 test %al,%al
80104eb2: 75 24 jne 80104ed8 <argptr+0x58>
80104eb4: 8b 16 mov (%esi),%edx
80104eb6: 8b 45 f4 mov -0xc(%ebp),%eax
80104eb9: 39 c2 cmp %eax,%edx
80104ebb: 76 1b jbe 80104ed8 <argptr+0x58>
80104ebd: 01 c3 add %eax,%ebx
80104ebf: 39 da cmp %ebx,%edx
80104ec1: 72 15 jb 80104ed8 <argptr+0x58>
return -1;
*pp = (char *)i;
80104ec3: 8b 55 0c mov 0xc(%ebp),%edx
80104ec6: 89 02 mov %eax,(%edx)
return 0;
80104ec8: 31 c0 xor %eax,%eax
}
80104eca: 8d 65 f8 lea -0x8(%ebp),%esp
80104ecd: 5b pop %ebx
80104ece: 5e pop %esi
80104ecf: 5d pop %ebp
80104ed0: c3 ret
80104ed1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
struct proc *curproc = myproc();
if (argint(n, &i) < 0)
return -1;
if (size < 0 || (uint)i >= curproc->sz || (uint)i + size > curproc->sz)
return -1;
80104ed8: b8 ff ff ff ff mov $0xffffffff,%eax
80104edd: eb eb jmp 80104eca <argptr+0x4a>
80104edf: 90 nop
80104ee0 <argstr>:
// Fetch the nth word-sized system call argument as a string pointer.
// 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)
{
80104ee0: 55 push %ebp
80104ee1: 89 e5 mov %esp,%ebp
80104ee3: 83 ec 20 sub $0x20,%esp
int addr;
if (argint(n, &addr) < 0)
80104ee6: 8d 45 f4 lea -0xc(%ebp),%eax
80104ee9: 50 push %eax
80104eea: ff 75 08 pushl 0x8(%ebp)
80104eed: e8 3e ff ff ff call 80104e30 <argint>
80104ef2: 83 c4 10 add $0x10,%esp
80104ef5: 85 c0 test %eax,%eax
80104ef7: 78 17 js 80104f10 <argstr+0x30>
return -1;
return fetchstr(addr, pp);
80104ef9: 83 ec 08 sub $0x8,%esp
80104efc: ff 75 0c pushl 0xc(%ebp)
80104eff: ff 75 f4 pushl -0xc(%ebp)
80104f02: e8 c9 fe ff ff call 80104dd0 <fetchstr>
80104f07: 83 c4 10 add $0x10,%esp
}
80104f0a: c9 leave
80104f0b: c3 ret
80104f0c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
// between this check and being used by the kernel.)
int argstr(int n, char **pp)
{
int addr;
if (argint(n, &addr) < 0)
return -1;
80104f10: b8 ff ff ff ff mov $0xffffffff,%eax
return fetchstr(addr, pp);
}
80104f15: c9 leave
80104f16: c3 ret
80104f17: 89 f6 mov %esi,%esi
80104f19: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80104f20 <syscall>:
[SYS_printstack] sys_printstack,
[SYS_thread_create] sys_thread_create,
};
void syscall(void)
{
80104f20: 55 push %ebp
80104f21: 89 e5 mov %esp,%ebp
80104f23: 56 push %esi
80104f24: 53 push %ebx
80104f25: 83 ec 10 sub $0x10,%esp
int num;
struct proc *curproc = myproc();
80104f28: e8 93 eb ff ff call 80103ac0 <myproc>
num = curproc->tf->eax;
80104f2d: 8b 58 18 mov 0x18(%eax),%ebx
};
void syscall(void)
{
int num;
struct proc *curproc = myproc();
80104f30: 89 c6 mov %eax,%esi
num = curproc->tf->eax;
80104f32: 8b 43 1c mov 0x1c(%ebx),%eax
if (num == 22)
80104f35: 83 f8 16 cmp $0x16,%eax
80104f38: 74 36 je 80104f70 <syscall+0x50>
{
int arg = 0;
argint(0, &arg);
curproc->tf->eax = sys_incNum(arg);
}
else if (num > 0 && num < NELEM(syscalls) && syscalls[num])
80104f3a: 8d 50 ff lea -0x1(%eax),%edx
80104f3d: 83 fa 18 cmp $0x18,%edx
80104f40: 77 1e ja 80104f60 <syscall+0x40>
80104f42: 8b 04 85 80 7e 10 80 mov -0x7fef8180(,%eax,4),%eax
80104f49: 85 c0 test %eax,%eax
80104f4b: 74 13 je 80104f60 <syscall+0x40>
{
curproc->tf->eax = syscalls[num]();
80104f4d: ff d0 call *%eax
80104f4f: 89 43 1c mov %eax,0x1c(%ebx)
}
else
{
curproc->tf->eax = -1;
}
}
80104f52: 8d 65 f8 lea -0x8(%ebp),%esp
80104f55: 5b pop %ebx
80104f56: 5e pop %esi
80104f57: 5d pop %ebp
80104f58: c3 ret
80104f59: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
{
curproc->tf->eax = syscalls[num]();
}
else
{
curproc->tf->eax = -1;
80104f60: c7 43 1c ff ff ff ff movl $0xffffffff,0x1c(%ebx)
}
}
80104f67: 8d 65 f8 lea -0x8(%ebp),%esp
80104f6a: 5b pop %ebx
80104f6b: 5e pop %esi
80104f6c: 5d pop %ebp
80104f6d: c3 ret
80104f6e: 66 90 xchg %ax,%ax
struct proc *curproc = myproc();
num = curproc->tf->eax;
if (num == 22)
{
int arg = 0;
argint(0, &arg);
80104f70: 8d 45 f4 lea -0xc(%ebp),%eax
80104f73: 83 ec 08 sub $0x8,%esp
int num;
struct proc *curproc = myproc();
num = curproc->tf->eax;
if (num == 22)
{
int arg = 0;
80104f76: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
argint(0, &arg);
80104f7d: 50 push %eax
80104f7e: 6a 00 push $0x0
80104f80: e8 ab fe ff ff call 80104e30 <argint>
curproc->tf->eax = sys_incNum(arg);
80104f85: 58 pop %eax
80104f86: 8b 5e 18 mov 0x18(%esi),%ebx
80104f89: ff 75 f4 pushl -0xc(%ebp)
80104f8c: e8 af 0d 00 00 call 80105d40 <sys_incNum>
80104f91: 83 c4 10 add $0x10,%esp
80104f94: 89 43 1c mov %eax,0x1c(%ebx)
80104f97: eb ce jmp 80104f67 <syscall+0x47>
80104f99: 66 90 xchg %ax,%ax
80104f9b: 66 90 xchg %ax,%ax
80104f9d: 66 90 xchg %ax,%ax
80104f9f: 90 nop
80104fa0 <create>:
return -1;
}
static struct inode*
create(char *path, short type, short major, short minor)
{
80104fa0: 55 push %ebp
80104fa1: 89 e5 mov %esp,%ebp
80104fa3: 57 push %edi
80104fa4: 56 push %esi
80104fa5: 53 push %ebx
uint off;
struct inode *ip, *dp;
char name[DIRSIZ];
if((dp = nameiparent(path, name)) == 0)
80104fa6: 8d 75 da lea -0x26(%ebp),%esi
return -1;
}
static struct inode*
create(char *path, short type, short major, short minor)
{
80104fa9: 83 ec 44 sub $0x44,%esp
80104fac: 89 4d c0 mov %ecx,-0x40(%ebp)
80104faf: 8b 4d 08 mov 0x8(%ebp),%ecx
uint off;
struct inode *ip, *dp;
char name[DIRSIZ];
if((dp = nameiparent(path, name)) == 0)
80104fb2: 56 push %esi
80104fb3: 50 push %eax
return -1;
}
static struct inode*
create(char *path, short type, short major, short minor)
{
80104fb4: 89 55 c4 mov %edx,-0x3c(%ebp)
80104fb7: 89 4d bc mov %ecx,-0x44(%ebp)
uint off;
struct inode *ip, *dp;
char name[DIRSIZ];
if((dp = nameiparent(path, name)) == 0)
80104fba: e8 51 d2 ff ff call 80102210 <nameiparent>
80104fbf: 83 c4 10 add $0x10,%esp
80104fc2: 85 c0 test %eax,%eax
80104fc4: 0f 84 f6 00 00 00 je 801050c0 <create+0x120>
return 0;
ilock(dp);
80104fca: 83 ec 0c sub $0xc,%esp
80104fcd: 89 c7 mov %eax,%edi
80104fcf: 50 push %eax
80104fd0: e8 cb c9 ff ff call 801019a0 <ilock>
if((ip = dirlookup(dp, name, &off)) != 0){
80104fd5: 8d 45 d4 lea -0x2c(%ebp),%eax
80104fd8: 83 c4 0c add $0xc,%esp
80104fdb: 50 push %eax
80104fdc: 56 push %esi
80104fdd: 57 push %edi
80104fde: e8 ed ce ff ff call 80101ed0 <dirlookup>
80104fe3: 83 c4 10 add $0x10,%esp
80104fe6: 85 c0 test %eax,%eax
80104fe8: 89 c3 mov %eax,%ebx
80104fea: 74 54 je 80105040 <create+0xa0>
iunlockput(dp);
80104fec: 83 ec 0c sub $0xc,%esp
80104fef: 57 push %edi
80104ff0: e8 3b cc ff ff call 80101c30 <iunlockput>
ilock(ip);
80104ff5: 89 1c 24 mov %ebx,(%esp)
80104ff8: e8 a3 c9 ff ff call 801019a0 <ilock>
if(type == T_FILE && ip->type == T_FILE)
80104ffd: 83 c4 10 add $0x10,%esp
80105000: 66 83 7d c4 02 cmpw $0x2,-0x3c(%ebp)
80105005: 75 19 jne 80105020 <create+0x80>
80105007: 66 83 7b 50 02 cmpw $0x2,0x50(%ebx)
8010500c: 89 d8 mov %ebx,%eax
8010500e: 75 10 jne 80105020 <create+0x80>
panic("create: dirlink");
iunlockput(dp);
return ip;
}
80105010: 8d 65 f4 lea -0xc(%ebp),%esp
80105013: 5b pop %ebx
80105014: 5e pop %esi
80105015: 5f pop %edi
80105016: 5d pop %ebp
80105017: c3 ret
80105018: 90 nop
80105019: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
if((ip = dirlookup(dp, name, &off)) != 0){
iunlockput(dp);
ilock(ip);
if(type == T_FILE && ip->type == T_FILE)
return ip;
iunlockput(ip);
80105020: 83 ec 0c sub $0xc,%esp
80105023: 53 push %ebx
80105024: e8 07 cc ff ff call 80101c30 <iunlockput>
return 0;
80105029: 83 c4 10 add $0x10,%esp
panic("create: dirlink");
iunlockput(dp);
return ip;
}
8010502c: 8d 65 f4 lea -0xc(%ebp),%esp
iunlockput(dp);
ilock(ip);
if(type == T_FILE && ip->type == T_FILE)
return ip;
iunlockput(ip);
return 0;
8010502f: 31 c0 xor %eax,%eax
panic("create: dirlink");
iunlockput(dp);
return ip;
}
80105031: 5b pop %ebx
80105032: 5e pop %esi
80105033: 5f pop %edi
80105034: 5d pop %ebp
80105035: c3 ret
80105036: 8d 76 00 lea 0x0(%esi),%esi
80105039: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
return ip;
iunlockput(ip);
return 0;
}
if((ip = ialloc(dp->dev, type)) == 0)
80105040: 0f bf 45 c4 movswl -0x3c(%ebp),%eax
80105044: 83 ec 08 sub $0x8,%esp
80105047: 50 push %eax
80105048: ff 37 pushl (%edi)
8010504a: e8 e1 c7 ff ff call 80101830 <ialloc>
8010504f: 83 c4 10 add $0x10,%esp
80105052: 85 c0 test %eax,%eax
80105054: 89 c3 mov %eax,%ebx
80105056: 0f 84 cc 00 00 00 je 80105128 <create+0x188>
panic("create: ialloc");
ilock(ip);
8010505c: 83 ec 0c sub $0xc,%esp
8010505f: 50 push %eax
80105060: e8 3b c9 ff ff call 801019a0 <ilock>
ip->major = major;
80105065: 0f b7 45 c0 movzwl -0x40(%ebp),%eax
80105069: 66 89 43 52 mov %ax,0x52(%ebx)
ip->minor = minor;
8010506d: 0f b7 45 bc movzwl -0x44(%ebp),%eax
80105071: 66 89 43 54 mov %ax,0x54(%ebx)
ip->nlink = 1;
80105075: b8 01 00 00 00 mov $0x1,%eax
8010507a: 66 89 43 56 mov %ax,0x56(%ebx)
iupdate(ip);
8010507e: 89 1c 24 mov %ebx,(%esp)
80105081: e8 6a c8 ff ff call 801018f0 <iupdate>
if(type == T_DIR){ // Create . and .. entries.
80105086: 83 c4 10 add $0x10,%esp
80105089: 66 83 7d c4 01 cmpw $0x1,-0x3c(%ebp)
8010508e: 74 40 je 801050d0 <create+0x130>
// No ip->nlink++ for ".": avoid cyclic ref count.
if(dirlink(ip, ".", ip->inum) < 0 || dirlink(ip, "..", dp->inum) < 0)
panic("create dots");
}
if(dirlink(dp, name, ip->inum) < 0)
80105090: 83 ec 04 sub $0x4,%esp
80105093: ff 73 04 pushl 0x4(%ebx)
80105096: 56 push %esi
80105097: 57 push %edi
80105098: e8 93 d0 ff ff call 80102130 <dirlink>
8010509d: 83 c4 10 add $0x10,%esp
801050a0: 85 c0 test %eax,%eax
801050a2: 78 77 js 8010511b <create+0x17b>
panic("create: dirlink");
iunlockput(dp);
801050a4: 83 ec 0c sub $0xc,%esp
801050a7: 57 push %edi
801050a8: e8 83 cb ff ff call 80101c30 <iunlockput>
return ip;
801050ad: 83 c4 10 add $0x10,%esp
}
801050b0: 8d 65 f4 lea -0xc(%ebp),%esp
if(dirlink(dp, name, ip->inum) < 0)
panic("create: dirlink");
iunlockput(dp);
return ip;
801050b3: 89 d8 mov %ebx,%eax
}
801050b5: 5b pop %ebx
801050b6: 5e pop %esi
801050b7: 5f pop %edi
801050b8: 5d pop %ebp
801050b9: c3 ret
801050ba: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
uint off;
struct inode *ip, *dp;
char name[DIRSIZ];
if((dp = nameiparent(path, name)) == 0)
return 0;
801050c0: 31 c0 xor %eax,%eax
801050c2: e9 49 ff ff ff jmp 80105010 <create+0x70>
801050c7: 89 f6 mov %esi,%esi
801050c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
ip->minor = minor;
ip->nlink = 1;
iupdate(ip);
if(type == T_DIR){ // Create . and .. entries.
dp->nlink++; // for ".."
801050d0: 66 83 47 56 01 addw $0x1,0x56(%edi)
iupdate(dp);
801050d5: 83 ec 0c sub $0xc,%esp
801050d8: 57 push %edi
801050d9: e8 12 c8 ff ff call 801018f0 <iupdate>
// No ip->nlink++ for ".": avoid cyclic ref count.
if(dirlink(ip, ".", ip->inum) < 0 || dirlink(ip, "..", dp->inum) < 0)
801050de: 83 c4 0c add $0xc,%esp
801050e1: ff 73 04 pushl 0x4(%ebx)
801050e4: 68 04 7f 10 80 push $0x80107f04
801050e9: 53 push %ebx
801050ea: e8 41 d0 ff ff call 80102130 <dirlink>
801050ef: 83 c4 10 add $0x10,%esp
801050f2: 85 c0 test %eax,%eax
801050f4: 78 18 js 8010510e <create+0x16e>
801050f6: 83 ec 04 sub $0x4,%esp
801050f9: ff 77 04 pushl 0x4(%edi)
801050fc: 68 03 7f 10 80 push $0x80107f03
80105101: 53 push %ebx
80105102: e8 29 d0 ff ff call 80102130 <dirlink>
80105107: 83 c4 10 add $0x10,%esp
8010510a: 85 c0 test %eax,%eax
8010510c: 79 82 jns 80105090 <create+0xf0>
panic("create dots");
8010510e: 83 ec 0c sub $0xc,%esp
80105111: 68 f7 7e 10 80 push $0x80107ef7
80105116: e8 55 b2 ff ff call 80100370 <panic>
}
if(dirlink(dp, name, ip->inum) < 0)
panic("create: dirlink");
8010511b: 83 ec 0c sub $0xc,%esp
8010511e: 68 06 7f 10 80 push $0x80107f06
80105123: e8 48 b2 ff ff call 80100370 <panic>
iunlockput(ip);
return 0;
}
if((ip = ialloc(dp->dev, type)) == 0)
panic("create: ialloc");
80105128: 83 ec 0c sub $0xc,%esp
8010512b: 68 e8 7e 10 80 push $0x80107ee8
80105130: e8 3b b2 ff ff call 80100370 <panic>
80105135: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80105139: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80105140 <argfd.constprop.0>:
#include "fcntl.h"
// Fetch the nth word-sized system call argument as a file descriptor
// and return both the descriptor and the corresponding struct file.
static int
argfd(int n, int *pfd, struct file **pf)
80105140: 55 push %ebp
80105141: 89 e5 mov %esp,%ebp
80105143: 56 push %esi
80105144: 53 push %ebx
80105145: 89 c6 mov %eax,%esi
{
int fd;
struct file *f;
if(argint(n, &fd) < 0)
80105147: 8d 45 f4 lea -0xc(%ebp),%eax
#include "fcntl.h"
// Fetch the nth word-sized system call argument as a file descriptor
// and return both the descriptor and the corresponding struct file.
static int
argfd(int n, int *pfd, struct file **pf)
8010514a: 89 d3 mov %edx,%ebx
8010514c: 83 ec 18 sub $0x18,%esp
{
int fd;
struct file *f;
if(argint(n, &fd) < 0)
8010514f: 50 push %eax
80105150: 6a 00 push $0x0
80105152: e8 d9 fc ff ff call 80104e30 <argint>
80105157: 83 c4 10 add $0x10,%esp
8010515a: 85 c0 test %eax,%eax
8010515c: 78 32 js 80105190 <argfd.constprop.0+0x50>
return -1;
if(fd < 0 || fd >= NOFILE || (f=myproc()->ofile[fd]) == 0)
8010515e: 83 7d f4 0f cmpl $0xf,-0xc(%ebp)
80105162: 77 2c ja 80105190 <argfd.constprop.0+0x50>
80105164: e8 57 e9 ff ff call 80103ac0 <myproc>
80105169: 8b 55 f4 mov -0xc(%ebp),%edx
8010516c: 8b 44 90 28 mov 0x28(%eax,%edx,4),%eax
80105170: 85 c0 test %eax,%eax
80105172: 74 1c je 80105190 <argfd.constprop.0+0x50>
return -1;
if(pfd)
80105174: 85 f6 test %esi,%esi
80105176: 74 02 je 8010517a <argfd.constprop.0+0x3a>
*pfd = fd;
80105178: 89 16 mov %edx,(%esi)
if(pf)
8010517a: 85 db test %ebx,%ebx
8010517c: 74 22 je 801051a0 <argfd.constprop.0+0x60>
*pf = f;
8010517e: 89 03 mov %eax,(%ebx)
return 0;
80105180: 31 c0 xor %eax,%eax
}
80105182: 8d 65 f8 lea -0x8(%ebp),%esp
80105185: 5b pop %ebx
80105186: 5e pop %esi
80105187: 5d pop %ebp
80105188: c3 ret
80105189: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80105190: 8d 65 f8 lea -0x8(%ebp),%esp
{
int fd;
struct file *f;
if(argint(n, &fd) < 0)
return -1;
80105193: b8 ff ff ff ff mov $0xffffffff,%eax
if(pfd)
*pfd = fd;
if(pf)
*pf = f;
return 0;
}
80105198: 5b pop %ebx
80105199: 5e pop %esi
8010519a: 5d pop %ebp
8010519b: c3 ret
8010519c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
return -1;
if(pfd)
*pfd = fd;
if(pf)
*pf = f;
return 0;
801051a0: 31 c0 xor %eax,%eax
801051a2: eb de jmp 80105182 <argfd.constprop.0+0x42>
801051a4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801051aa: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
801051b0 <sys_dup>:
return -1;
}
int
sys_dup(void)
{
801051b0: 55 push %ebp
struct file *f;
int fd;
if(argfd(0, 0, &f) < 0)
801051b1: 31 c0 xor %eax,%eax
return -1;
}
int
sys_dup(void)
{
801051b3: 89 e5 mov %esp,%ebp
801051b5: 56 push %esi
801051b6: 53 push %ebx
struct file *f;
int fd;
if(argfd(0, 0, &f) < 0)
801051b7: 8d 55 f4 lea -0xc(%ebp),%edx
return -1;
}
int
sys_dup(void)
{
801051ba: 83 ec 10 sub $0x10,%esp
struct file *f;
int fd;
if(argfd(0, 0, &f) < 0)
801051bd: e8 7e ff ff ff call 80105140 <argfd.constprop.0>
801051c2: 85 c0 test %eax,%eax
801051c4: 78 1a js 801051e0 <sys_dup+0x30>
fdalloc(struct file *f)
{
int fd;
struct proc *curproc = myproc();
for(fd = 0; fd < NOFILE; fd++){
801051c6: 31 db xor %ebx,%ebx
struct file *f;
int fd;
if(argfd(0, 0, &f) < 0)
return -1;
if((fd=fdalloc(f)) < 0)
801051c8: 8b 75 f4 mov -0xc(%ebp),%esi
// Takes over file reference from caller on success.
static int
fdalloc(struct file *f)
{
int fd;
struct proc *curproc = myproc();
801051cb: e8 f0 e8 ff ff call 80103ac0 <myproc>
for(fd = 0; fd < NOFILE; fd++){
if(curproc->ofile[fd] == 0){
801051d0: 8b 54 98 28 mov 0x28(%eax,%ebx,4),%edx
801051d4: 85 d2 test %edx,%edx
801051d6: 74 18 je 801051f0 <sys_dup+0x40>
fdalloc(struct file *f)
{
int fd;
struct proc *curproc = myproc();
for(fd = 0; fd < NOFILE; fd++){
801051d8: 83 c3 01 add $0x1,%ebx
801051db: 83 fb 10 cmp $0x10,%ebx
801051de: 75 f0 jne 801051d0 <sys_dup+0x20>
return -1;
if((fd=fdalloc(f)) < 0)
return -1;
filedup(f);
return fd;
}
801051e0: 8d 65 f8 lea -0x8(%ebp),%esp
{
struct file *f;
int fd;
if(argfd(0, 0, &f) < 0)
return -1;
801051e3: b8 ff ff ff ff mov $0xffffffff,%eax
if((fd=fdalloc(f)) < 0)
return -1;
filedup(f);
return fd;
}
801051e8: 5b pop %ebx
801051e9: 5e pop %esi
801051ea: 5d pop %ebp
801051eb: c3 ret
801051ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
int fd;
struct proc *curproc = myproc();
for(fd = 0; fd < NOFILE; fd++){
if(curproc->ofile[fd] == 0){
curproc->ofile[fd] = f;
801051f0: 89 74 98 28 mov %esi,0x28(%eax,%ebx,4)
if(argfd(0, 0, &f) < 0)
return -1;
if((fd=fdalloc(f)) < 0)
return -1;
filedup(f);
801051f4: 83 ec 0c sub $0xc,%esp
801051f7: ff 75 f4 pushl -0xc(%ebp)
801051fa: e8 11 bf ff ff call 80101110 <filedup>
return fd;
801051ff: 83 c4 10 add $0x10,%esp
}
80105202: 8d 65 f8 lea -0x8(%ebp),%esp
if(argfd(0, 0, &f) < 0)
return -1;
if((fd=fdalloc(f)) < 0)
return -1;
filedup(f);
return fd;
80105205: 89 d8 mov %ebx,%eax
}
80105207: 5b pop %ebx
80105208: 5e pop %esi
80105209: 5d pop %ebp
8010520a: c3 ret
8010520b: 90 nop
8010520c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80105210 <sys_read>:
int
sys_read(void)
{
80105210: 55 push %ebp
struct file *f;
int n;
char *p;
if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0)
80105211: 31 c0 xor %eax,%eax
return fd;
}
int
sys_read(void)
{
80105213: 89 e5 mov %esp,%ebp
80105215: 83 ec 18 sub $0x18,%esp
struct file *f;
int n;
char *p;
if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0)
80105218: 8d 55 ec lea -0x14(%ebp),%edx
8010521b: e8 20 ff ff ff call 80105140 <argfd.constprop.0>
80105220: 85 c0 test %eax,%eax
80105222: 78 4c js 80105270 <sys_read+0x60>
80105224: 8d 45 f0 lea -0x10(%ebp),%eax
80105227: 83 ec 08 sub $0x8,%esp
8010522a: 50 push %eax
8010522b: 6a 02 push $0x2
8010522d: e8 fe fb ff ff call 80104e30 <argint>
80105232: 83 c4 10 add $0x10,%esp
80105235: 85 c0 test %eax,%eax
80105237: 78 37 js 80105270 <sys_read+0x60>
80105239: 8d 45 f4 lea -0xc(%ebp),%eax
8010523c: 83 ec 04 sub $0x4,%esp
8010523f: ff 75 f0 pushl -0x10(%ebp)
80105242: 50 push %eax
80105243: 6a 01 push $0x1
80105245: e8 36 fc ff ff call 80104e80 <argptr>
8010524a: 83 c4 10 add $0x10,%esp
8010524d: 85 c0 test %eax,%eax
8010524f: 78 1f js 80105270 <sys_read+0x60>
return -1;
return fileread(f, p, n);
80105251: 83 ec 04 sub $0x4,%esp
80105254: ff 75 f0 pushl -0x10(%ebp)
80105257: ff 75 f4 pushl -0xc(%ebp)
8010525a: ff 75 ec pushl -0x14(%ebp)
8010525d: e8 1e c0 ff ff call 80101280 <fileread>
80105262: 83 c4 10 add $0x10,%esp
}
80105265: c9 leave
80105266: c3 ret
80105267: 89 f6 mov %esi,%esi
80105269: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
struct file *f;
int n;
char *p;
if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0)
return -1;
80105270: b8 ff ff ff ff mov $0xffffffff,%eax
return fileread(f, p, n);
}
80105275: c9 leave
80105276: c3 ret
80105277: 89 f6 mov %esi,%esi
80105279: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80105280 <sys_write>:
int
sys_write(void)
{
80105280: 55 push %ebp
struct file *f;
int n;
char *p;
if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0)
80105281: 31 c0 xor %eax,%eax
return fileread(f, p, n);
}
int
sys_write(void)
{
80105283: 89 e5 mov %esp,%ebp
80105285: 83 ec 18 sub $0x18,%esp
struct file *f;
int n;
char *p;
if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0)
80105288: 8d 55 ec lea -0x14(%ebp),%edx
8010528b: e8 b0 fe ff ff call 80105140 <argfd.constprop.0>
80105290: 85 c0 test %eax,%eax
80105292: 78 4c js 801052e0 <sys_write+0x60>
80105294: 8d 45 f0 lea -0x10(%ebp),%eax
80105297: 83 ec 08 sub $0x8,%esp
8010529a: 50 push %eax
8010529b: 6a 02 push $0x2
8010529d: e8 8e fb ff ff call 80104e30 <argint>
801052a2: 83 c4 10 add $0x10,%esp
801052a5: 85 c0 test %eax,%eax
801052a7: 78 37 js 801052e0 <sys_write+0x60>
801052a9: 8d 45 f4 lea -0xc(%ebp),%eax
801052ac: 83 ec 04 sub $0x4,%esp
801052af: ff 75 f0 pushl -0x10(%ebp)
801052b2: 50 push %eax
801052b3: 6a 01 push $0x1
801052b5: e8 c6 fb ff ff call 80104e80 <argptr>
801052ba: 83 c4 10 add $0x10,%esp
801052bd: 85 c0 test %eax,%eax
801052bf: 78 1f js 801052e0 <sys_write+0x60>
return -1;
return filewrite(f, p, n);
801052c1: 83 ec 04 sub $0x4,%esp
801052c4: ff 75 f0 pushl -0x10(%ebp)
801052c7: ff 75 f4 pushl -0xc(%ebp)
801052ca: ff 75 ec pushl -0x14(%ebp)
801052cd: e8 3e c0 ff ff call 80101310 <filewrite>
801052d2: 83 c4 10 add $0x10,%esp
}
801052d5: c9 leave
801052d6: c3 ret
801052d7: 89 f6 mov %esi,%esi
801052d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
struct file *f;
int n;
char *p;
if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0)
return -1;
801052e0: b8 ff ff ff ff mov $0xffffffff,%eax
return filewrite(f, p, n);
}
801052e5: c9 leave
801052e6: c3 ret
801052e7: 89 f6 mov %esi,%esi
801052e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801052f0 <sys_close>:
int
sys_close(void)
{
801052f0: 55 push %ebp
801052f1: 89 e5 mov %esp,%ebp
801052f3: 83 ec 18 sub $0x18,%esp
int fd;
struct file *f;
if(argfd(0, &fd, &f) < 0)
801052f6: 8d 55 f4 lea -0xc(%ebp),%edx
801052f9: 8d 45 f0 lea -0x10(%ebp),%eax
801052fc: e8 3f fe ff ff call 80105140 <argfd.constprop.0>
80105301: 85 c0 test %eax,%eax
80105303: 78 2b js 80105330 <sys_close+0x40>
return -1;
myproc()->ofile[fd] = 0;
80105305: e8 b6 e7 ff ff call 80103ac0 <myproc>
8010530a: 8b 55 f0 mov -0x10(%ebp),%edx
fileclose(f);
8010530d: 83 ec 0c sub $0xc,%esp
int fd;
struct file *f;
if(argfd(0, &fd, &f) < 0)
return -1;
myproc()->ofile[fd] = 0;
80105310: c7 44 90 28 00 00 00 movl $0x0,0x28(%eax,%edx,4)
80105317: 00
fileclose(f);
80105318: ff 75 f4 pushl -0xc(%ebp)
8010531b: e8 40 be ff ff call 80101160 <fileclose>
return 0;
80105320: 83 c4 10 add $0x10,%esp
80105323: 31 c0 xor %eax,%eax
}
80105325: c9 leave
80105326: c3 ret
80105327: 89 f6 mov %esi,%esi
80105329: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
{
int fd;
struct file *f;
if(argfd(0, &fd, &f) < 0)
return -1;
80105330: b8 ff ff ff ff mov $0xffffffff,%eax
myproc()->ofile[fd] = 0;
fileclose(f);
return 0;
}
80105335: c9 leave
80105336: c3 ret
80105337: 89 f6 mov %esi,%esi
80105339: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80105340 <sys_fstat>:
int
sys_fstat(void)
{
80105340: 55 push %ebp
struct file *f;
struct stat *st;
if(argfd(0, 0, &f) < 0 || argptr(1, (void*)&st, sizeof(*st)) < 0)
80105341: 31 c0 xor %eax,%eax
return 0;
}
int
sys_fstat(void)
{
80105343: 89 e5 mov %esp,%ebp
80105345: 83 ec 18 sub $0x18,%esp
struct file *f;
struct stat *st;
if(argfd(0, 0, &f) < 0 || argptr(1, (void*)&st, sizeof(*st)) < 0)
80105348: 8d 55 f0 lea -0x10(%ebp),%edx
8010534b: e8 f0 fd ff ff call 80105140 <argfd.constprop.0>
80105350: 85 c0 test %eax,%eax
80105352: 78 2c js 80105380 <sys_fstat+0x40>
80105354: 8d 45 f4 lea -0xc(%ebp),%eax
80105357: 83 ec 04 sub $0x4,%esp
8010535a: 6a 14 push $0x14
8010535c: 50 push %eax
8010535d: 6a 01 push $0x1
8010535f: e8 1c fb ff ff call 80104e80 <argptr>
80105364: 83 c4 10 add $0x10,%esp
80105367: 85 c0 test %eax,%eax
80105369: 78 15 js 80105380 <sys_fstat+0x40>
return -1;
return filestat(f, st);
8010536b: 83 ec 08 sub $0x8,%esp
8010536e: ff 75 f4 pushl -0xc(%ebp)
80105371: ff 75 f0 pushl -0x10(%ebp)
80105374: e8 b7 be ff ff call 80101230 <filestat>
80105379: 83 c4 10 add $0x10,%esp
}
8010537c: c9 leave
8010537d: c3 ret
8010537e: 66 90 xchg %ax,%ax
{
struct file *f;
struct stat *st;
if(argfd(0, 0, &f) < 0 || argptr(1, (void*)&st, sizeof(*st)) < 0)
return -1;
80105380: b8 ff ff ff ff mov $0xffffffff,%eax
return filestat(f, st);
}
80105385: c9 leave
80105386: c3 ret
80105387: 89 f6 mov %esi,%esi
80105389: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80105390 <sys_link>:
// Create the path new as a link to the same inode as old.
int
sys_link(void)
{
80105390: 55 push %ebp
80105391: 89 e5 mov %esp,%ebp
80105393: 57 push %edi
80105394: 56 push %esi
80105395: 53 push %ebx
char name[DIRSIZ], *new, *old;
struct inode *dp, *ip;
if(argstr(0, &old) < 0 || argstr(1, &new) < 0)
80105396: 8d 45 d4 lea -0x2c(%ebp),%eax
}
// Create the path new as a link to the same inode as old.
int
sys_link(void)
{
80105399: 83 ec 34 sub $0x34,%esp
char name[DIRSIZ], *new, *old;
struct inode *dp, *ip;
if(argstr(0, &old) < 0 || argstr(1, &new) < 0)
8010539c: 50 push %eax
8010539d: 6a 00 push $0x0
8010539f: e8 3c fb ff ff call 80104ee0 <argstr>
801053a4: 83 c4 10 add $0x10,%esp
801053a7: 85 c0 test %eax,%eax
801053a9: 0f 88 fb 00 00 00 js 801054aa <sys_link+0x11a>
801053af: 8d 45 d0 lea -0x30(%ebp),%eax
801053b2: 83 ec 08 sub $0x8,%esp
801053b5: 50 push %eax
801053b6: 6a 01 push $0x1
801053b8: e8 23 fb ff ff call 80104ee0 <argstr>
801053bd: 83 c4 10 add $0x10,%esp
801053c0: 85 c0 test %eax,%eax
801053c2: 0f 88 e2 00 00 00 js 801054aa <sys_link+0x11a>
return -1;
begin_op();
801053c8: e8 b3 da ff ff call 80102e80 <begin_op>
if((ip = namei(old)) == 0){
801053cd: 83 ec 0c sub $0xc,%esp
801053d0: ff 75 d4 pushl -0x2c(%ebp)
801053d3: e8 18 ce ff ff call 801021f0 <namei>
801053d8: 83 c4 10 add $0x10,%esp
801053db: 85 c0 test %eax,%eax
801053dd: 89 c3 mov %eax,%ebx
801053df: 0f 84 f3 00 00 00 je 801054d8 <sys_link+0x148>
end_op();
return -1;
}
ilock(ip);
801053e5: 83 ec 0c sub $0xc,%esp
801053e8: 50 push %eax
801053e9: e8 b2 c5 ff ff call 801019a0 <ilock>
if(ip->type == T_DIR){
801053ee: 83 c4 10 add $0x10,%esp
801053f1: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx)
801053f6: 0f 84 c4 00 00 00 je 801054c0 <sys_link+0x130>
iunlockput(ip);
end_op();
return -1;
}
ip->nlink++;
801053fc: 66 83 43 56 01 addw $0x1,0x56(%ebx)
iupdate(ip);
80105401: 83 ec 0c sub $0xc,%esp
iunlock(ip);
if((dp = nameiparent(new, name)) == 0)
80105404: 8d 7d da lea -0x26(%ebp),%edi
end_op();
return -1;
}
ip->nlink++;
iupdate(ip);
80105407: 53 push %ebx
80105408: e8 e3 c4 ff ff call 801018f0 <iupdate>
iunlock(ip);
8010540d: 89 1c 24 mov %ebx,(%esp)
80105410: e8 6b c6 ff ff call 80101a80 <iunlock>
if((dp = nameiparent(new, name)) == 0)
80105415: 58 pop %eax
80105416: 5a pop %edx
80105417: 57 push %edi
80105418: ff 75 d0 pushl -0x30(%ebp)
8010541b: e8 f0 cd ff ff call 80102210 <nameiparent>
80105420: 83 c4 10 add $0x10,%esp
80105423: 85 c0 test %eax,%eax
80105425: 89 c6 mov %eax,%esi
80105427: 74 5b je 80105484 <sys_link+0xf4>
goto bad;
ilock(dp);
80105429: 83 ec 0c sub $0xc,%esp
8010542c: 50 push %eax
8010542d: e8 6e c5 ff ff call 801019a0 <ilock>
if(dp->dev != ip->dev || dirlink(dp, name, ip->inum) < 0){
80105432: 83 c4 10 add $0x10,%esp
80105435: 8b 03 mov (%ebx),%eax
80105437: 39 06 cmp %eax,(%esi)
80105439: 75 3d jne 80105478 <sys_link+0xe8>
8010543b: 83 ec 04 sub $0x4,%esp
8010543e: ff 73 04 pushl 0x4(%ebx)
80105441: 57 push %edi
80105442: 56 push %esi
80105443: e8 e8 cc ff ff call 80102130 <dirlink>
80105448: 83 c4 10 add $0x10,%esp
8010544b: 85 c0 test %eax,%eax
8010544d: 78 29 js 80105478 <sys_link+0xe8>
iunlockput(dp);
goto bad;
}
iunlockput(dp);
8010544f: 83 ec 0c sub $0xc,%esp
80105452: 56 push %esi
80105453: e8 d8 c7 ff ff call 80101c30 <iunlockput>
iput(ip);
80105458: 89 1c 24 mov %ebx,(%esp)
8010545b: e8 70 c6 ff ff call 80101ad0 <iput>
end_op();
80105460: e8 8b da ff ff call 80102ef0 <end_op>
return 0;
80105465: 83 c4 10 add $0x10,%esp
80105468: 31 c0 xor %eax,%eax
ip->nlink--;
iupdate(ip);
iunlockput(ip);
end_op();
return -1;
}
8010546a: 8d 65 f4 lea -0xc(%ebp),%esp
8010546d: 5b pop %ebx
8010546e: 5e pop %esi
8010546f: 5f pop %edi
80105470: 5d pop %ebp
80105471: c3 ret
80105472: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
if((dp = nameiparent(new, name)) == 0)
goto bad;
ilock(dp);
if(dp->dev != ip->dev || dirlink(dp, name, ip->inum) < 0){
iunlockput(dp);
80105478: 83 ec 0c sub $0xc,%esp
8010547b: 56 push %esi
8010547c: e8 af c7 ff ff call 80101c30 <iunlockput>
goto bad;
80105481: 83 c4 10 add $0x10,%esp
end_op();
return 0;
bad:
ilock(ip);
80105484: 83 ec 0c sub $0xc,%esp
80105487: 53 push %ebx
80105488: e8 13 c5 ff ff call 801019a0 <ilock>
ip->nlink--;
8010548d: 66 83 6b 56 01 subw $0x1,0x56(%ebx)
iupdate(ip);
80105492: 89 1c 24 mov %ebx,(%esp)
80105495: e8 56 c4 ff ff call 801018f0 <iupdate>
iunlockput(ip);
8010549a: 89 1c 24 mov %ebx,(%esp)
8010549d: e8 8e c7 ff ff call 80101c30 <iunlockput>
end_op();
801054a2: e8 49 da ff ff call 80102ef0 <end_op>
return -1;
801054a7: 83 c4 10 add $0x10,%esp
}
801054aa: 8d 65 f4 lea -0xc(%ebp),%esp
ilock(ip);
ip->nlink--;
iupdate(ip);
iunlockput(ip);
end_op();
return -1;
801054ad: b8 ff ff ff ff mov $0xffffffff,%eax
}
801054b2: 5b pop %ebx
801054b3: 5e pop %esi
801054b4: 5f pop %edi
801054b5: 5d pop %ebp
801054b6: c3 ret
801054b7: 89 f6 mov %esi,%esi
801054b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
return -1;
}
ilock(ip);
if(ip->type == T_DIR){
iunlockput(ip);
801054c0: 83 ec 0c sub $0xc,%esp
801054c3: 53 push %ebx
801054c4: e8 67 c7 ff ff call 80101c30 <iunlockput>
end_op();
801054c9: e8 22 da ff ff call 80102ef0 <end_op>
return -1;
801054ce: 83 c4 10 add $0x10,%esp
801054d1: b8 ff ff ff ff mov $0xffffffff,%eax
801054d6: eb 92 jmp 8010546a <sys_link+0xda>
if(argstr(0, &old) < 0 || argstr(1, &new) < 0)
return -1;
begin_op();
if((ip = namei(old)) == 0){
end_op();
801054d8: e8 13 da ff ff call 80102ef0 <end_op>
return -1;
801054dd: b8 ff ff ff ff mov $0xffffffff,%eax
801054e2: eb 86 jmp 8010546a <sys_link+0xda>
801054e4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801054ea: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
801054f0 <sys_unlink>:
}
//PAGEBREAK!
int
sys_unlink(void)
{
801054f0: 55 push %ebp
801054f1: 89 e5 mov %esp,%ebp
801054f3: 57 push %edi
801054f4: 56 push %esi
801054f5: 53 push %ebx
struct inode *ip, *dp;
struct dirent de;
char name[DIRSIZ], *path;
uint off;
if(argstr(0, &path) < 0)
801054f6: 8d 45 c0 lea -0x40(%ebp),%eax
}
//PAGEBREAK!
int
sys_unlink(void)
{
801054f9: 83 ec 54 sub $0x54,%esp
struct inode *ip, *dp;
struct dirent de;
char name[DIRSIZ], *path;
uint off;
if(argstr(0, &path) < 0)
801054fc: 50 push %eax
801054fd: 6a 00 push $0x0
801054ff: e8 dc f9 ff ff call 80104ee0 <argstr>
80105504: 83 c4 10 add $0x10,%esp
80105507: 85 c0 test %eax,%eax
80105509: 0f 88 82 01 00 00 js 80105691 <sys_unlink+0x1a1>
return -1;
begin_op();
if((dp = nameiparent(path, name)) == 0){
8010550f: 8d 5d ca lea -0x36(%ebp),%ebx
uint off;
if(argstr(0, &path) < 0)
return -1;
begin_op();
80105512: e8 69 d9 ff ff call 80102e80 <begin_op>
if((dp = nameiparent(path, name)) == 0){
80105517: 83 ec 08 sub $0x8,%esp
8010551a: 53 push %ebx
8010551b: ff 75 c0 pushl -0x40(%ebp)
8010551e: e8 ed cc ff ff call 80102210 <nameiparent>
80105523: 83 c4 10 add $0x10,%esp
80105526: 85 c0 test %eax,%eax
80105528: 89 45 b4 mov %eax,-0x4c(%ebp)
8010552b: 0f 84 6a 01 00 00 je 8010569b <sys_unlink+0x1ab>
end_op();
return -1;
}
ilock(dp);
80105531: 8b 75 b4 mov -0x4c(%ebp),%esi
80105534: 83 ec 0c sub $0xc,%esp
80105537: 56 push %esi
80105538: e8 63 c4 ff ff call 801019a0 <ilock>
// Cannot unlink "." or "..".
if(namecmp(name, ".") == 0 || namecmp(name, "..") == 0)
8010553d: 58 pop %eax
8010553e: 5a pop %edx
8010553f: 68 04 7f 10 80 push $0x80107f04
80105544: 53 push %ebx
80105545: e8 66 c9 ff ff call 80101eb0 <namecmp>
8010554a: 83 c4 10 add $0x10,%esp
8010554d: 85 c0 test %eax,%eax
8010554f: 0f 84 fc 00 00 00 je 80105651 <sys_unlink+0x161>
80105555: 83 ec 08 sub $0x8,%esp
80105558: 68 03 7f 10 80 push $0x80107f03
8010555d: 53 push %ebx
8010555e: e8 4d c9 ff ff call 80101eb0 <namecmp>
80105563: 83 c4 10 add $0x10,%esp
80105566: 85 c0 test %eax,%eax
80105568: 0f 84 e3 00 00 00 je 80105651 <sys_unlink+0x161>
goto bad;
if((ip = dirlookup(dp, name, &off)) == 0)
8010556e: 8d 45 c4 lea -0x3c(%ebp),%eax
80105571: 83 ec 04 sub $0x4,%esp
80105574: 50 push %eax
80105575: 53 push %ebx
80105576: 56 push %esi
80105577: e8 54 c9 ff ff call 80101ed0 <dirlookup>
8010557c: 83 c4 10 add $0x10,%esp
8010557f: 85 c0 test %eax,%eax
80105581: 89 c3 mov %eax,%ebx
80105583: 0f 84 c8 00 00 00 je 80105651 <sys_unlink+0x161>
goto bad;
ilock(ip);
80105589: 83 ec 0c sub $0xc,%esp
8010558c: 50 push %eax
8010558d: e8 0e c4 ff ff call 801019a0 <ilock>
if(ip->nlink < 1)
80105592: 83 c4 10 add $0x10,%esp
80105595: 66 83 7b 56 00 cmpw $0x0,0x56(%ebx)
8010559a: 0f 8e 24 01 00 00 jle 801056c4 <sys_unlink+0x1d4>
panic("unlink: nlink < 1");
if(ip->type == T_DIR && !isdirempty(ip)){
801055a0: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx)
801055a5: 8d 75 d8 lea -0x28(%ebp),%esi
801055a8: 74 66 je 80105610 <sys_unlink+0x120>
iunlockput(ip);
goto bad;
}
memset(&de, 0, sizeof(de));
801055aa: 83 ec 04 sub $0x4,%esp
801055ad: 6a 10 push $0x10
801055af: 6a 00 push $0x0
801055b1: 56 push %esi
801055b2: e8 69 f5 ff ff call 80104b20 <memset>
if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
801055b7: 6a 10 push $0x10
801055b9: ff 75 c4 pushl -0x3c(%ebp)
801055bc: 56 push %esi
801055bd: ff 75 b4 pushl -0x4c(%ebp)
801055c0: e8 bb c7 ff ff call 80101d80 <writei>
801055c5: 83 c4 20 add $0x20,%esp
801055c8: 83 f8 10 cmp $0x10,%eax
801055cb: 0f 85 e6 00 00 00 jne 801056b7 <sys_unlink+0x1c7>
panic("unlink: writei");
if(ip->type == T_DIR){
801055d1: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx)
801055d6: 0f 84 9c 00 00 00 je 80105678 <sys_unlink+0x188>
dp->nlink--;
iupdate(dp);
}
iunlockput(dp);
801055dc: 83 ec 0c sub $0xc,%esp
801055df: ff 75 b4 pushl -0x4c(%ebp)
801055e2: e8 49 c6 ff ff call 80101c30 <iunlockput>
ip->nlink--;
801055e7: 66 83 6b 56 01 subw $0x1,0x56(%ebx)
iupdate(ip);
801055ec: 89 1c 24 mov %ebx,(%esp)
801055ef: e8 fc c2 ff ff call 801018f0 <iupdate>
iunlockput(ip);
801055f4: 89 1c 24 mov %ebx,(%esp)
801055f7: e8 34 c6 ff ff call 80101c30 <iunlockput>
end_op();
801055fc: e8 ef d8 ff ff call 80102ef0 <end_op>
return 0;
80105601: 83 c4 10 add $0x10,%esp
80105604: 31 c0 xor %eax,%eax
bad:
iunlockput(dp);
end_op();
return -1;
}
80105606: 8d 65 f4 lea -0xc(%ebp),%esp
80105609: 5b pop %ebx
8010560a: 5e pop %esi
8010560b: 5f pop %edi
8010560c: 5d pop %ebp
8010560d: c3 ret
8010560e: 66 90 xchg %ax,%ax
isdirempty(struct inode *dp)
{
int off;
struct dirent de;
for(off=2*sizeof(de); off<dp->size; off+=sizeof(de)){
80105610: 83 7b 58 20 cmpl $0x20,0x58(%ebx)
80105614: 76 94 jbe 801055aa <sys_unlink+0xba>
80105616: bf 20 00 00 00 mov $0x20,%edi
8010561b: eb 0f jmp 8010562c <sys_unlink+0x13c>
8010561d: 8d 76 00 lea 0x0(%esi),%esi
80105620: 83 c7 10 add $0x10,%edi
80105623: 3b 7b 58 cmp 0x58(%ebx),%edi
80105626: 0f 83 7e ff ff ff jae 801055aa <sys_unlink+0xba>
if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
8010562c: 6a 10 push $0x10
8010562e: 57 push %edi
8010562f: 56 push %esi
80105630: 53 push %ebx
80105631: e8 4a c6 ff ff call 80101c80 <readi>
80105636: 83 c4 10 add $0x10,%esp
80105639: 83 f8 10 cmp $0x10,%eax
8010563c: 75 6c jne 801056aa <sys_unlink+0x1ba>
panic("isdirempty: readi");
if(de.inum != 0)
8010563e: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp)
80105643: 74 db je 80105620 <sys_unlink+0x130>
ilock(ip);
if(ip->nlink < 1)
panic("unlink: nlink < 1");
if(ip->type == T_DIR && !isdirempty(ip)){
iunlockput(ip);
80105645: 83 ec 0c sub $0xc,%esp
80105648: 53 push %ebx
80105649: e8 e2 c5 ff ff call 80101c30 <iunlockput>
goto bad;
8010564e: 83 c4 10 add $0x10,%esp
end_op();
return 0;
bad:
iunlockput(dp);
80105651: 83 ec 0c sub $0xc,%esp
80105654: ff 75 b4 pushl -0x4c(%ebp)
80105657: e8 d4 c5 ff ff call 80101c30 <iunlockput>
end_op();
8010565c: e8 8f d8 ff ff call 80102ef0 <end_op>
return -1;
80105661: 83 c4 10 add $0x10,%esp
}
80105664: 8d 65 f4 lea -0xc(%ebp),%esp
return 0;
bad:
iunlockput(dp);
end_op();
return -1;
80105667: b8 ff ff ff ff mov $0xffffffff,%eax
}
8010566c: 5b pop %ebx
8010566d: 5e pop %esi
8010566e: 5f pop %edi
8010566f: 5d pop %ebp
80105670: c3 ret
80105671: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
memset(&de, 0, sizeof(de));
if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
panic("unlink: writei");
if(ip->type == T_DIR){
dp->nlink--;
80105678: 8b 45 b4 mov -0x4c(%ebp),%eax
iupdate(dp);
8010567b: 83 ec 0c sub $0xc,%esp
memset(&de, 0, sizeof(de));
if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
panic("unlink: writei");
if(ip->type == T_DIR){
dp->nlink--;
8010567e: 66 83 68 56 01 subw $0x1,0x56(%eax)
iupdate(dp);
80105683: 50 push %eax
80105684: e8 67 c2 ff ff call 801018f0 <iupdate>
80105689: 83 c4 10 add $0x10,%esp
8010568c: e9 4b ff ff ff jmp 801055dc <sys_unlink+0xec>
struct dirent de;
char name[DIRSIZ], *path;
uint off;
if(argstr(0, &path) < 0)
return -1;
80105691: b8 ff ff ff ff mov $0xffffffff,%eax
80105696: e9 6b ff ff ff jmp 80105606 <sys_unlink+0x116>
begin_op();
if((dp = nameiparent(path, name)) == 0){
end_op();
8010569b: e8 50 d8 ff ff call 80102ef0 <end_op>
return -1;
801056a0: b8 ff ff ff ff mov $0xffffffff,%eax
801056a5: e9 5c ff ff ff jmp 80105606 <sys_unlink+0x116>
int off;
struct dirent de;
for(off=2*sizeof(de); off<dp->size; off+=sizeof(de)){
if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
panic("isdirempty: readi");
801056aa: 83 ec 0c sub $0xc,%esp
801056ad: 68 28 7f 10 80 push $0x80107f28
801056b2: e8 b9 ac ff ff call 80100370 <panic>
goto bad;
}
memset(&de, 0, sizeof(de));
if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
panic("unlink: writei");
801056b7: 83 ec 0c sub $0xc,%esp
801056ba: 68 3a 7f 10 80 push $0x80107f3a
801056bf: e8 ac ac ff ff call 80100370 <panic>
if((ip = dirlookup(dp, name, &off)) == 0)
goto bad;
ilock(ip);
if(ip->nlink < 1)
panic("unlink: nlink < 1");
801056c4: 83 ec 0c sub $0xc,%esp
801056c7: 68 16 7f 10 80 push $0x80107f16
801056cc: e8 9f ac ff ff call 80100370 <panic>
801056d1: eb 0d jmp 801056e0 <sys_open>
801056d3: 90 nop
801056d4: 90 nop
801056d5: 90 nop
801056d6: 90 nop
801056d7: 90 nop
801056d8: 90 nop
801056d9: 90 nop
801056da: 90 nop
801056db: 90 nop
801056dc: 90 nop
801056dd: 90 nop
801056de: 90 nop
801056df: 90 nop
801056e0 <sys_open>:
return ip;
}
int
sys_open(void)
{
801056e0: 55 push %ebp
801056e1: 89 e5 mov %esp,%ebp
801056e3: 57 push %edi
801056e4: 56 push %esi
801056e5: 53 push %ebx
char *path;
int fd, omode;
struct file *f;
struct inode *ip;
if(argstr(0, &path) < 0 || argint(1, &omode) < 0)
801056e6: 8d 45 e0 lea -0x20(%ebp),%eax
return ip;
}
int
sys_open(void)
{
801056e9: 83 ec 24 sub $0x24,%esp
char *path;
int fd, omode;
struct file *f;
struct inode *ip;
if(argstr(0, &path) < 0 || argint(1, &omode) < 0)
801056ec: 50 push %eax
801056ed: 6a 00 push $0x0
801056ef: e8 ec f7 ff ff call 80104ee0 <argstr>
801056f4: 83 c4 10 add $0x10,%esp
801056f7: 85 c0 test %eax,%eax
801056f9: 0f 88 9e 00 00 00 js 8010579d <sys_open+0xbd>
801056ff: 8d 45 e4 lea -0x1c(%ebp),%eax
80105702: 83 ec 08 sub $0x8,%esp
80105705: 50 push %eax
80105706: 6a 01 push $0x1
80105708: e8 23 f7 ff ff call 80104e30 <argint>
8010570d: 83 c4 10 add $0x10,%esp
80105710: 85 c0 test %eax,%eax
80105712: 0f 88 85 00 00 00 js 8010579d <sys_open+0xbd>
return -1;
begin_op();
80105718: e8 63 d7 ff ff call 80102e80 <begin_op>
if(omode & O_CREATE){
8010571d: f6 45 e5 02 testb $0x2,-0x1b(%ebp)
80105721: 0f 85 89 00 00 00 jne 801057b0 <sys_open+0xd0>
if(ip == 0){
end_op();
return -1;
}
} else {
if((ip = namei(path)) == 0){
80105727: 83 ec 0c sub $0xc,%esp
8010572a: ff 75 e0 pushl -0x20(%ebp)
8010572d: e8 be ca ff ff call 801021f0 <namei>
80105732: 83 c4 10 add $0x10,%esp
80105735: 85 c0 test %eax,%eax
80105737: 89 c6 mov %eax,%esi
80105739: 0f 84 8e 00 00 00 je 801057cd <sys_open+0xed>
end_op();
return -1;
}
ilock(ip);
8010573f: 83 ec 0c sub $0xc,%esp
80105742: 50 push %eax
80105743: e8 58 c2 ff ff call 801019a0 <ilock>
if(ip->type == T_DIR && omode != O_RDONLY){
80105748: 83 c4 10 add $0x10,%esp
8010574b: 66 83 7e 50 01 cmpw $0x1,0x50(%esi)
80105750: 0f 84 d2 00 00 00 je 80105828 <sys_open+0x148>
end_op();
return -1;
}
}
if((f = filealloc()) == 0 || (fd = fdalloc(f)) < 0){
80105756: e8 45 b9 ff ff call 801010a0 <filealloc>
8010575b: 85 c0 test %eax,%eax
8010575d: 89 c7 mov %eax,%edi
8010575f: 74 2b je 8010578c <sys_open+0xac>
fdalloc(struct file *f)
{
int fd;
struct proc *curproc = myproc();
for(fd = 0; fd < NOFILE; fd++){
80105761: 31 db xor %ebx,%ebx
// Takes over file reference from caller on success.
static int
fdalloc(struct file *f)
{
int fd;
struct proc *curproc = myproc();
80105763: e8 58 e3 ff ff call 80103ac0 <myproc>
80105768: 90 nop
80105769: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
for(fd = 0; fd < NOFILE; fd++){
if(curproc->ofile[fd] == 0){
80105770: 8b 54 98 28 mov 0x28(%eax,%ebx,4),%edx
80105774: 85 d2 test %edx,%edx
80105776: 74 68 je 801057e0 <sys_open+0x100>
fdalloc(struct file *f)
{
int fd;
struct proc *curproc = myproc();
for(fd = 0; fd < NOFILE; fd++){
80105778: 83 c3 01 add $0x1,%ebx
8010577b: 83 fb 10 cmp $0x10,%ebx
8010577e: 75 f0 jne 80105770 <sys_open+0x90>
}
}
if((f = filealloc()) == 0 || (fd = fdalloc(f)) < 0){
if(f)
fileclose(f);
80105780: 83 ec 0c sub $0xc,%esp
80105783: 57 push %edi
80105784: e8 d7 b9 ff ff call 80101160 <fileclose>
80105789: 83 c4 10 add $0x10,%esp
iunlockput(ip);
8010578c: 83 ec 0c sub $0xc,%esp
8010578f: 56 push %esi
80105790: e8 9b c4 ff ff call 80101c30 <iunlockput>
end_op();
80105795: e8 56 d7 ff ff call 80102ef0 <end_op>
return -1;
8010579a: 83 c4 10 add $0x10,%esp
f->ip = ip;
f->off = 0;
f->readable = !(omode & O_WRONLY);
f->writable = (omode & O_WRONLY) || (omode & O_RDWR);
return fd;
}
8010579d: 8d 65 f4 lea -0xc(%ebp),%esp
if((f = filealloc()) == 0 || (fd = fdalloc(f)) < 0){
if(f)
fileclose(f);
iunlockput(ip);
end_op();
return -1;
801057a0: b8 ff ff ff ff mov $0xffffffff,%eax
f->ip = ip;
f->off = 0;
f->readable = !(omode & O_WRONLY);
f->writable = (omode & O_WRONLY) || (omode & O_RDWR);
return fd;
}
801057a5: 5b pop %ebx
801057a6: 5e pop %esi
801057a7: 5f pop %edi
801057a8: 5d pop %ebp
801057a9: c3 ret
801057aa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
return -1;
begin_op();
if(omode & O_CREATE){
ip = create(path, T_FILE, 0, 0);
801057b0: 83 ec 0c sub $0xc,%esp
801057b3: 8b 45 e0 mov -0x20(%ebp),%eax
801057b6: 31 c9 xor %ecx,%ecx
801057b8: 6a 00 push $0x0
801057ba: ba 02 00 00 00 mov $0x2,%edx
801057bf: e8 dc f7 ff ff call 80104fa0 <create>
if(ip == 0){
801057c4: 83 c4 10 add $0x10,%esp
801057c7: 85 c0 test %eax,%eax
return -1;
begin_op();
if(omode & O_CREATE){
ip = create(path, T_FILE, 0, 0);
801057c9: 89 c6 mov %eax,%esi
if(ip == 0){
801057cb: 75 89 jne 80105756 <sys_open+0x76>
end_op();
801057cd: e8 1e d7 ff ff call 80102ef0 <end_op>
return -1;
801057d2: b8 ff ff ff ff mov $0xffffffff,%eax
801057d7: eb 43 jmp 8010581c <sys_open+0x13c>
801057d9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
fileclose(f);
iunlockput(ip);
end_op();
return -1;
}
iunlock(ip);
801057e0: 83 ec 0c sub $0xc,%esp
int fd;
struct proc *curproc = myproc();
for(fd = 0; fd < NOFILE; fd++){
if(curproc->ofile[fd] == 0){
curproc->ofile[fd] = f;
801057e3: 89 7c 98 28 mov %edi,0x28(%eax,%ebx,4)
fileclose(f);
iunlockput(ip);
end_op();
return -1;
}
iunlock(ip);
801057e7: 56 push %esi
801057e8: e8 93 c2 ff ff call 80101a80 <iunlock>
end_op();
801057ed: e8 fe d6 ff ff call 80102ef0 <end_op>
f->type = FD_INODE;
801057f2: c7 07 02 00 00 00 movl $0x2,(%edi)
f->ip = ip;
f->off = 0;
f->readable = !(omode & O_WRONLY);
801057f8: 8b 55 e4 mov -0x1c(%ebp),%edx
f->writable = (omode & O_WRONLY) || (omode & O_RDWR);
801057fb: 83 c4 10 add $0x10,%esp
}
iunlock(ip);
end_op();
f->type = FD_INODE;
f->ip = ip;
801057fe: 89 77 10 mov %esi,0x10(%edi)
f->off = 0;
80105801: c7 47 14 00 00 00 00 movl $0x0,0x14(%edi)
f->readable = !(omode & O_WRONLY);
80105808: 89 d0 mov %edx,%eax
8010580a: 83 e0 01 and $0x1,%eax
8010580d: 83 f0 01 xor $0x1,%eax
f->writable = (omode & O_WRONLY) || (omode & O_RDWR);
80105810: 83 e2 03 and $0x3,%edx
end_op();
f->type = FD_INODE;
f->ip = ip;
f->off = 0;
f->readable = !(omode & O_WRONLY);
80105813: 88 47 08 mov %al,0x8(%edi)
f->writable = (omode & O_WRONLY) || (omode & O_RDWR);
80105816: 0f 95 47 09 setne 0x9(%edi)
return fd;
8010581a: 89 d8 mov %ebx,%eax
}
8010581c: 8d 65 f4 lea -0xc(%ebp),%esp
8010581f: 5b pop %ebx
80105820: 5e pop %esi
80105821: 5f pop %edi
80105822: 5d pop %ebp
80105823: c3 ret
80105824: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
if((ip = namei(path)) == 0){
end_op();
return -1;
}
ilock(ip);
if(ip->type == T_DIR && omode != O_RDONLY){
80105828: 8b 4d e4 mov -0x1c(%ebp),%ecx
8010582b: 85 c9 test %ecx,%ecx
8010582d: 0f 84 23 ff ff ff je 80105756 <sys_open+0x76>
80105833: e9 54 ff ff ff jmp 8010578c <sys_open+0xac>
80105838: 90 nop
80105839: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80105840 <sys_mkdir>:
return fd;
}
int
sys_mkdir(void)
{
80105840: 55 push %ebp
80105841: 89 e5 mov %esp,%ebp
80105843: 83 ec 18 sub $0x18,%esp
char *path;
struct inode *ip;
begin_op();
80105846: e8 35 d6 ff ff call 80102e80 <begin_op>
if(argstr(0, &path) < 0 || (ip = create(path, T_DIR, 0, 0)) == 0){
8010584b: 8d 45 f4 lea -0xc(%ebp),%eax
8010584e: 83 ec 08 sub $0x8,%esp
80105851: 50 push %eax
80105852: 6a 00 push $0x0
80105854: e8 87 f6 ff ff call 80104ee0 <argstr>
80105859: 83 c4 10 add $0x10,%esp
8010585c: 85 c0 test %eax,%eax
8010585e: 78 30 js 80105890 <sys_mkdir+0x50>
80105860: 83 ec 0c sub $0xc,%esp
80105863: 8b 45 f4 mov -0xc(%ebp),%eax
80105866: 31 c9 xor %ecx,%ecx
80105868: 6a 00 push $0x0
8010586a: ba 01 00 00 00 mov $0x1,%edx
8010586f: e8 2c f7 ff ff call 80104fa0 <create>
80105874: 83 c4 10 add $0x10,%esp
80105877: 85 c0 test %eax,%eax
80105879: 74 15 je 80105890 <sys_mkdir+0x50>
end_op();
return -1;
}
iunlockput(ip);
8010587b: 83 ec 0c sub $0xc,%esp
8010587e: 50 push %eax
8010587f: e8 ac c3 ff ff call 80101c30 <iunlockput>
end_op();
80105884: e8 67 d6 ff ff call 80102ef0 <end_op>
return 0;
80105889: 83 c4 10 add $0x10,%esp
8010588c: 31 c0 xor %eax,%eax
}
8010588e: c9 leave
8010588f: c3 ret
char *path;
struct inode *ip;
begin_op();
if(argstr(0, &path) < 0 || (ip = create(path, T_DIR, 0, 0)) == 0){
end_op();
80105890: e8 5b d6 ff ff call 80102ef0 <end_op>
return -1;
80105895: b8 ff ff ff ff mov $0xffffffff,%eax
}
iunlockput(ip);
end_op();
return 0;
}
8010589a: c9 leave
8010589b: c3 ret
8010589c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801058a0 <sys_mknod>:
int
sys_mknod(void)
{
801058a0: 55 push %ebp
801058a1: 89 e5 mov %esp,%ebp
801058a3: 83 ec 18 sub $0x18,%esp
struct inode *ip;
char *path;
int major, minor;
begin_op();
801058a6: e8 d5 d5 ff ff call 80102e80 <begin_op>
if((argstr(0, &path)) < 0 ||
801058ab: 8d 45 ec lea -0x14(%ebp),%eax
801058ae: 83 ec 08 sub $0x8,%esp
801058b1: 50 push %eax
801058b2: 6a 00 push $0x0
801058b4: e8 27 f6 ff ff call 80104ee0 <argstr>
801058b9: 83 c4 10 add $0x10,%esp
801058bc: 85 c0 test %eax,%eax
801058be: 78 60 js 80105920 <sys_mknod+0x80>
argint(1, &major) < 0 ||
801058c0: 8d 45 f0 lea -0x10(%ebp),%eax
801058c3: 83 ec 08 sub $0x8,%esp
801058c6: 50 push %eax
801058c7: 6a 01 push $0x1
801058c9: e8 62 f5 ff ff call 80104e30 <argint>
struct inode *ip;
char *path;
int major, minor;
begin_op();
if((argstr(0, &path)) < 0 ||
801058ce: 83 c4 10 add $0x10,%esp
801058d1: 85 c0 test %eax,%eax
801058d3: 78 4b js 80105920 <sys_mknod+0x80>
argint(1, &major) < 0 ||
argint(2, &minor) < 0 ||
801058d5: 8d 45 f4 lea -0xc(%ebp),%eax
801058d8: 83 ec 08 sub $0x8,%esp
801058db: 50 push %eax
801058dc: 6a 02 push $0x2
801058de: e8 4d f5 ff ff call 80104e30 <argint>
char *path;
int major, minor;
begin_op();
if((argstr(0, &path)) < 0 ||
argint(1, &major) < 0 ||
801058e3: 83 c4 10 add $0x10,%esp
801058e6: 85 c0 test %eax,%eax
801058e8: 78 36 js 80105920 <sys_mknod+0x80>
argint(2, &minor) < 0 ||
801058ea: 0f bf 45 f4 movswl -0xc(%ebp),%eax
801058ee: 83 ec 0c sub $0xc,%esp
801058f1: 0f bf 4d f0 movswl -0x10(%ebp),%ecx
801058f5: ba 03 00 00 00 mov $0x3,%edx
801058fa: 50 push %eax
801058fb: 8b 45 ec mov -0x14(%ebp),%eax
801058fe: e8 9d f6 ff ff call 80104fa0 <create>
80105903: 83 c4 10 add $0x10,%esp
80105906: 85 c0 test %eax,%eax
80105908: 74 16 je 80105920 <sys_mknod+0x80>
(ip = create(path, T_DEV, major, minor)) == 0){
end_op();
return -1;
}
iunlockput(ip);
8010590a: 83 ec 0c sub $0xc,%esp
8010590d: 50 push %eax
8010590e: e8 1d c3 ff ff call 80101c30 <iunlockput>
end_op();
80105913: e8 d8 d5 ff ff call 80102ef0 <end_op>
return 0;
80105918: 83 c4 10 add $0x10,%esp
8010591b: 31 c0 xor %eax,%eax
}
8010591d: c9 leave
8010591e: c3 ret
8010591f: 90 nop
begin_op();
if((argstr(0, &path)) < 0 ||
argint(1, &major) < 0 ||
argint(2, &minor) < 0 ||
(ip = create(path, T_DEV, major, minor)) == 0){
end_op();
80105920: e8 cb d5 ff ff call 80102ef0 <end_op>
return -1;
80105925: b8 ff ff ff ff mov $0xffffffff,%eax
}
iunlockput(ip);
end_op();
return 0;
}
8010592a: c9 leave
8010592b: c3 ret
8010592c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80105930 <sys_chdir>:
int
sys_chdir(void)
{
80105930: 55 push %ebp
80105931: 89 e5 mov %esp,%ebp
80105933: 56 push %esi
80105934: 53 push %ebx
80105935: 83 ec 10 sub $0x10,%esp
char *path;
struct inode *ip;
struct proc *curproc = myproc();
80105938: e8 83 e1 ff ff call 80103ac0 <myproc>
8010593d: 89 c6 mov %eax,%esi
begin_op();
8010593f: e8 3c d5 ff ff call 80102e80 <begin_op>
if(argstr(0, &path) < 0 || (ip = namei(path)) == 0){
80105944: 8d 45 f4 lea -0xc(%ebp),%eax
80105947: 83 ec 08 sub $0x8,%esp
8010594a: 50 push %eax
8010594b: 6a 00 push $0x0
8010594d: e8 8e f5 ff ff call 80104ee0 <argstr>
80105952: 83 c4 10 add $0x10,%esp
80105955: 85 c0 test %eax,%eax
80105957: 78 77 js 801059d0 <sys_chdir+0xa0>
80105959: 83 ec 0c sub $0xc,%esp
8010595c: ff 75 f4 pushl -0xc(%ebp)
8010595f: e8 8c c8 ff ff call 801021f0 <namei>
80105964: 83 c4 10 add $0x10,%esp
80105967: 85 c0 test %eax,%eax
80105969: 89 c3 mov %eax,%ebx
8010596b: 74 63 je 801059d0 <sys_chdir+0xa0>
end_op();
return -1;
}
ilock(ip);
8010596d: 83 ec 0c sub $0xc,%esp
80105970: 50 push %eax
80105971: e8 2a c0 ff ff call 801019a0 <ilock>
if(ip->type != T_DIR){
80105976: 83 c4 10 add $0x10,%esp
80105979: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx)
8010597e: 75 30 jne 801059b0 <sys_chdir+0x80>
iunlockput(ip);
end_op();
return -1;
}
iunlock(ip);
80105980: 83 ec 0c sub $0xc,%esp
80105983: 53 push %ebx
80105984: e8 f7 c0 ff ff call 80101a80 <iunlock>
iput(curproc->cwd);
80105989: 58 pop %eax
8010598a: ff 76 68 pushl 0x68(%esi)
8010598d: e8 3e c1 ff ff call 80101ad0 <iput>
end_op();
80105992: e8 59 d5 ff ff call 80102ef0 <end_op>
curproc->cwd = ip;
80105997: 89 5e 68 mov %ebx,0x68(%esi)
return 0;
8010599a: 83 c4 10 add $0x10,%esp
8010599d: 31 c0 xor %eax,%eax
}
8010599f: 8d 65 f8 lea -0x8(%ebp),%esp
801059a2: 5b pop %ebx
801059a3: 5e pop %esi
801059a4: 5d pop %ebp
801059a5: c3 ret
801059a6: 8d 76 00 lea 0x0(%esi),%esi
801059a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
end_op();
return -1;
}
ilock(ip);
if(ip->type != T_DIR){
iunlockput(ip);
801059b0: 83 ec 0c sub $0xc,%esp
801059b3: 53 push %ebx
801059b4: e8 77 c2 ff ff call 80101c30 <iunlockput>
end_op();
801059b9: e8 32 d5 ff ff call 80102ef0 <end_op>
return -1;
801059be: 83 c4 10 add $0x10,%esp
801059c1: b8 ff ff ff ff mov $0xffffffff,%eax
801059c6: eb d7 jmp 8010599f <sys_chdir+0x6f>
801059c8: 90 nop
801059c9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
struct inode *ip;
struct proc *curproc = myproc();
begin_op();
if(argstr(0, &path) < 0 || (ip = namei(path)) == 0){
end_op();
801059d0: e8 1b d5 ff ff call 80102ef0 <end_op>
return -1;
801059d5: b8 ff ff ff ff mov $0xffffffff,%eax
801059da: eb c3 jmp 8010599f <sys_chdir+0x6f>
801059dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801059e0 <sys_exec>:
return 0;
}
int
sys_exec(void)
{
801059e0: 55 push %ebp
801059e1: 89 e5 mov %esp,%ebp
801059e3: 57 push %edi
801059e4: 56 push %esi
801059e5: 53 push %ebx
char *path, *argv[MAXARG];
int i;
uint uargv, uarg;
if(argstr(0, &path) < 0 || argint(1, (int*)&uargv) < 0){
801059e6: 8d 85 5c ff ff ff lea -0xa4(%ebp),%eax
return 0;
}
int
sys_exec(void)
{
801059ec: 81 ec a4 00 00 00 sub $0xa4,%esp
char *path, *argv[MAXARG];
int i;
uint uargv, uarg;
if(argstr(0, &path) < 0 || argint(1, (int*)&uargv) < 0){
801059f2: 50 push %eax
801059f3: 6a 00 push $0x0
801059f5: e8 e6 f4 ff ff call 80104ee0 <argstr>
801059fa: 83 c4 10 add $0x10,%esp
801059fd: 85 c0 test %eax,%eax
801059ff: 78 7f js 80105a80 <sys_exec+0xa0>
80105a01: 8d 85 60 ff ff ff lea -0xa0(%ebp),%eax
80105a07: 83 ec 08 sub $0x8,%esp
80105a0a: 50 push %eax
80105a0b: 6a 01 push $0x1
80105a0d: e8 1e f4 ff ff call 80104e30 <argint>
80105a12: 83 c4 10 add $0x10,%esp
80105a15: 85 c0 test %eax,%eax
80105a17: 78 67 js 80105a80 <sys_exec+0xa0>
return -1;
}
memset(argv, 0, sizeof(argv));
80105a19: 8d 85 68 ff ff ff lea -0x98(%ebp),%eax
80105a1f: 83 ec 04 sub $0x4,%esp
80105a22: 8d b5 68 ff ff ff lea -0x98(%ebp),%esi
80105a28: 68 80 00 00 00 push $0x80
80105a2d: 6a 00 push $0x0
80105a2f: 8d bd 64 ff ff ff lea -0x9c(%ebp),%edi
80105a35: 50 push %eax
80105a36: 31 db xor %ebx,%ebx
80105a38: e8 e3 f0 ff ff call 80104b20 <memset>
80105a3d: 83 c4 10 add $0x10,%esp
for(i=0;; i++){
if(i >= NELEM(argv))
return -1;
if(fetchint(uargv+4*i, (int*)&uarg) < 0)
80105a40: 8b 85 60 ff ff ff mov -0xa0(%ebp),%eax
80105a46: 83 ec 08 sub $0x8,%esp
80105a49: 57 push %edi
80105a4a: 8d 04 98 lea (%eax,%ebx,4),%eax
80105a4d: 50 push %eax
80105a4e: e8 3d f3 ff ff call 80104d90 <fetchint>
80105a53: 83 c4 10 add $0x10,%esp
80105a56: 85 c0 test %eax,%eax
80105a58: 78 26 js 80105a80 <sys_exec+0xa0>
return -1;
if(uarg == 0){
80105a5a: 8b 85 64 ff ff ff mov -0x9c(%ebp),%eax
80105a60: 85 c0 test %eax,%eax
80105a62: 74 2c je 80105a90 <sys_exec+0xb0>
argv[i] = 0;
break;
}
if(fetchstr(uarg, &argv[i]) < 0)
80105a64: 83 ec 08 sub $0x8,%esp
80105a67: 56 push %esi
80105a68: 50 push %eax
80105a69: e8 62 f3 ff ff call 80104dd0 <fetchstr>
80105a6e: 83 c4 10 add $0x10,%esp
80105a71: 85 c0 test %eax,%eax
80105a73: 78 0b js 80105a80 <sys_exec+0xa0>
if(argstr(0, &path) < 0 || argint(1, (int*)&uargv) < 0){
return -1;
}
memset(argv, 0, sizeof(argv));
for(i=0;; i++){
80105a75: 83 c3 01 add $0x1,%ebx
80105a78: 83 c6 04 add $0x4,%esi
if(i >= NELEM(argv))
80105a7b: 83 fb 20 cmp $0x20,%ebx
80105a7e: 75 c0 jne 80105a40 <sys_exec+0x60>
}
if(fetchstr(uarg, &argv[i]) < 0)
return -1;
}
return exec(path, argv);
}
80105a80: 8d 65 f4 lea -0xc(%ebp),%esp
char *path, *argv[MAXARG];
int i;
uint uargv, uarg;
if(argstr(0, &path) < 0 || argint(1, (int*)&uargv) < 0){
return -1;
80105a83: b8 ff ff ff ff mov $0xffffffff,%eax
}
if(fetchstr(uarg, &argv[i]) < 0)
return -1;
}
return exec(path, argv);
}
80105a88: 5b pop %ebx
80105a89: 5e pop %esi
80105a8a: 5f pop %edi
80105a8b: 5d pop %ebp
80105a8c: c3 ret
80105a8d: 8d 76 00 lea 0x0(%esi),%esi
break;
}
if(fetchstr(uarg, &argv[i]) < 0)
return -1;
}
return exec(path, argv);
80105a90: 8d 85 68 ff ff ff lea -0x98(%ebp),%eax
80105a96: 83 ec 08 sub $0x8,%esp
if(i >= NELEM(argv))
return -1;
if(fetchint(uargv+4*i, (int*)&uarg) < 0)
return -1;
if(uarg == 0){
argv[i] = 0;
80105a99: c7 84 9d 68 ff ff ff movl $0x0,-0x98(%ebp,%ebx,4)
80105aa0: 00 00 00 00
break;
}
if(fetchstr(uarg, &argv[i]) < 0)
return -1;
}
return exec(path, argv);
80105aa4: 50 push %eax
80105aa5: ff b5 5c ff ff ff pushl -0xa4(%ebp)
80105aab: e8 70 b2 ff ff call 80100d20 <exec>
80105ab0: 83 c4 10 add $0x10,%esp
}
80105ab3: 8d 65 f4 lea -0xc(%ebp),%esp
80105ab6: 5b pop %ebx
80105ab7: 5e pop %esi
80105ab8: 5f pop %edi
80105ab9: 5d pop %ebp
80105aba: c3 ret
80105abb: 90 nop
80105abc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80105ac0 <sys_pipe>:
int
sys_pipe(void)
{
80105ac0: 55 push %ebp
80105ac1: 89 e5 mov %esp,%ebp
80105ac3: 57 push %edi
80105ac4: 56 push %esi
80105ac5: 53 push %ebx
int *fd;
struct file *rf, *wf;
int fd0, fd1;
if(argptr(0, (void*)&fd, 2*sizeof(fd[0])) < 0)
80105ac6: 8d 45 dc lea -0x24(%ebp),%eax
return exec(path, argv);
}
int
sys_pipe(void)
{
80105ac9: 83 ec 20 sub $0x20,%esp
int *fd;
struct file *rf, *wf;
int fd0, fd1;
if(argptr(0, (void*)&fd, 2*sizeof(fd[0])) < 0)
80105acc: 6a 08 push $0x8
80105ace: 50 push %eax
80105acf: 6a 00 push $0x0
80105ad1: e8 aa f3 ff ff call 80104e80 <argptr>
80105ad6: 83 c4 10 add $0x10,%esp
80105ad9: 85 c0 test %eax,%eax
80105adb: 78 4a js 80105b27 <sys_pipe+0x67>
return -1;
if(pipealloc(&rf, &wf) < 0)
80105add: 8d 45 e4 lea -0x1c(%ebp),%eax
80105ae0: 83 ec 08 sub $0x8,%esp
80105ae3: 50 push %eax
80105ae4: 8d 45 e0 lea -0x20(%ebp),%eax
80105ae7: 50 push %eax
80105ae8: e8 33 da ff ff call 80103520 <pipealloc>
80105aed: 83 c4 10 add $0x10,%esp
80105af0: 85 c0 test %eax,%eax
80105af2: 78 33 js 80105b27 <sys_pipe+0x67>
fdalloc(struct file *f)
{
int fd;
struct proc *curproc = myproc();
for(fd = 0; fd < NOFILE; fd++){
80105af4: 31 db xor %ebx,%ebx
if(argptr(0, (void*)&fd, 2*sizeof(fd[0])) < 0)
return -1;
if(pipealloc(&rf, &wf) < 0)
return -1;
fd0 = -1;
if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){
80105af6: 8b 7d e0 mov -0x20(%ebp),%edi
// Takes over file reference from caller on success.
static int
fdalloc(struct file *f)
{
int fd;
struct proc *curproc = myproc();
80105af9: e8 c2 df ff ff call 80103ac0 <myproc>
80105afe: 66 90 xchg %ax,%ax
for(fd = 0; fd < NOFILE; fd++){
if(curproc->ofile[fd] == 0){
80105b00: 8b 74 98 28 mov 0x28(%eax,%ebx,4),%esi
80105b04: 85 f6 test %esi,%esi
80105b06: 74 30 je 80105b38 <sys_pipe+0x78>
fdalloc(struct file *f)
{
int fd;
struct proc *curproc = myproc();
for(fd = 0; fd < NOFILE; fd++){
80105b08: 83 c3 01 add $0x1,%ebx
80105b0b: 83 fb 10 cmp $0x10,%ebx
80105b0e: 75 f0 jne 80105b00 <sys_pipe+0x40>
return -1;
fd0 = -1;
if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){
if(fd0 >= 0)
myproc()->ofile[fd0] = 0;
fileclose(rf);
80105b10: 83 ec 0c sub $0xc,%esp
80105b13: ff 75 e0 pushl -0x20(%ebp)
80105b16: e8 45 b6 ff ff call 80101160 <fileclose>
fileclose(wf);
80105b1b: 58 pop %eax
80105b1c: ff 75 e4 pushl -0x1c(%ebp)
80105b1f: e8 3c b6 ff ff call 80101160 <fileclose>
return -1;
80105b24: 83 c4 10 add $0x10,%esp
}
fd[0] = fd0;
fd[1] = fd1;
return 0;
}
80105b27: 8d 65 f4 lea -0xc(%ebp),%esp
if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){
if(fd0 >= 0)
myproc()->ofile[fd0] = 0;
fileclose(rf);
fileclose(wf);
return -1;
80105b2a: b8 ff ff ff ff mov $0xffffffff,%eax
}
fd[0] = fd0;
fd[1] = fd1;
return 0;
}
80105b2f: 5b pop %ebx
80105b30: 5e pop %esi
80105b31: 5f pop %edi
80105b32: 5d pop %ebp
80105b33: c3 ret
80105b34: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
int fd;
struct proc *curproc = myproc();
for(fd = 0; fd < NOFILE; fd++){
if(curproc->ofile[fd] == 0){
curproc->ofile[fd] = f;
80105b38: 8d 73 08 lea 0x8(%ebx),%esi
80105b3b: 89 7c b0 08 mov %edi,0x8(%eax,%esi,4)
if(argptr(0, (void*)&fd, 2*sizeof(fd[0])) < 0)
return -1;
if(pipealloc(&rf, &wf) < 0)
return -1;
fd0 = -1;
if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){
80105b3f: 8b 7d e4 mov -0x1c(%ebp),%edi
// Takes over file reference from caller on success.
static int
fdalloc(struct file *f)
{
int fd;
struct proc *curproc = myproc();
80105b42: e8 79 df ff ff call 80103ac0 <myproc>
for(fd = 0; fd < NOFILE; fd++){
80105b47: 31 d2 xor %edx,%edx
80105b49: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
if(curproc->ofile[fd] == 0){
80105b50: 8b 4c 90 28 mov 0x28(%eax,%edx,4),%ecx
80105b54: 85 c9 test %ecx,%ecx
80105b56: 74 18 je 80105b70 <sys_pipe+0xb0>
fdalloc(struct file *f)
{
int fd;
struct proc *curproc = myproc();
for(fd = 0; fd < NOFILE; fd++){
80105b58: 83 c2 01 add $0x1,%edx
80105b5b: 83 fa 10 cmp $0x10,%edx
80105b5e: 75 f0 jne 80105b50 <sys_pipe+0x90>
if(pipealloc(&rf, &wf) < 0)
return -1;
fd0 = -1;
if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){
if(fd0 >= 0)
myproc()->ofile[fd0] = 0;
80105b60: e8 5b df ff ff call 80103ac0 <myproc>
80105b65: c7 44 b0 08 00 00 00 movl $0x0,0x8(%eax,%esi,4)
80105b6c: 00
80105b6d: eb a1 jmp 80105b10 <sys_pipe+0x50>
80105b6f: 90 nop
int fd;
struct proc *curproc = myproc();
for(fd = 0; fd < NOFILE; fd++){
if(curproc->ofile[fd] == 0){
curproc->ofile[fd] = f;
80105b70: 89 7c 90 28 mov %edi,0x28(%eax,%edx,4)
myproc()->ofile[fd0] = 0;
fileclose(rf);
fileclose(wf);
return -1;
}
fd[0] = fd0;
80105b74: 8b 45 dc mov -0x24(%ebp),%eax
80105b77: 89 18 mov %ebx,(%eax)
fd[1] = fd1;
80105b79: 8b 45 dc mov -0x24(%ebp),%eax
80105b7c: 89 50 04 mov %edx,0x4(%eax)
return 0;
}
80105b7f: 8d 65 f4 lea -0xc(%ebp),%esp
fileclose(wf);
return -1;
}
fd[0] = fd0;
fd[1] = fd1;
return 0;
80105b82: 31 c0 xor %eax,%eax
}
80105b84: 5b pop %ebx
80105b85: 5e pop %esi
80105b86: 5f pop %edi
80105b87: 5d pop %ebp
80105b88: c3 ret
80105b89: 66 90 xchg %ax,%ax
80105b8b: 66 90 xchg %ax,%ax
80105b8d: 66 90 xchg %ax,%ax
80105b8f: 90 nop
80105b90 <sys_fork>:
#include "memlayout.h"
#include "mmu.h"
#include "proc.h"
int sys_fork(void)
{
80105b90: 55 push %ebp
80105b91: 89 e5 mov %esp,%ebp
return fork();
}
80105b93: 5d pop %ebp
#include "mmu.h"
#include "proc.h"
int sys_fork(void)
{
return fork();
80105b94: e9 c7 e0 ff ff jmp 80103c60 <fork>
80105b99: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80105ba0 <sys_exit>:
}
int sys_exit(void)
{
80105ba0: 55 push %ebp
80105ba1: 89 e5 mov %esp,%ebp
80105ba3: 83 ec 08 sub $0x8,%esp
exit();
80105ba6: e8 45 e3 ff ff call 80103ef0 <exit>
return 0; // not reached
}
80105bab: 31 c0 xor %eax,%eax
80105bad: c9 leave
80105bae: c3 ret
80105baf: 90 nop
80105bb0 <sys_wait>:
int sys_wait(void)
{
80105bb0: 55 push %ebp
80105bb1: 89 e5 mov %esp,%ebp
return wait();
}
80105bb3: 5d pop %ebp
return 0; // not reached
}
int sys_wait(void)
{
return wait();
80105bb4: e9 77 e5 ff ff jmp 80104130 <wait>
80105bb9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80105bc0 <sys_kill>:
}
int sys_kill(void)
{
80105bc0: 55 push %ebp
80105bc1: 89 e5 mov %esp,%ebp
80105bc3: 83 ec 20 sub $0x20,%esp
int pid;
if (argint(0, &pid) < 0)
80105bc6: 8d 45 f4 lea -0xc(%ebp),%eax
80105bc9: 50 push %eax
80105bca: 6a 00 push $0x0
80105bcc: e8 5f f2 ff ff call 80104e30 <argint>
80105bd1: 83 c4 10 add $0x10,%esp
80105bd4: 85 c0 test %eax,%eax
80105bd6: 78 18 js 80105bf0 <sys_kill+0x30>
return -1;
return kill(pid);
80105bd8: 83 ec 0c sub $0xc,%esp
80105bdb: ff 75 f4 pushl -0xc(%ebp)
80105bde: e8 ad e6 ff ff call 80104290 <kill>
80105be3: 83 c4 10 add $0x10,%esp
}
80105be6: c9 leave
80105be7: c3 ret
80105be8: 90 nop
80105be9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
int sys_kill(void)
{
int pid;
if (argint(0, &pid) < 0)
return -1;
80105bf0: b8 ff ff ff ff mov $0xffffffff,%eax
return kill(pid);
}
80105bf5: c9 leave
80105bf6: c3 ret
80105bf7: 89 f6 mov %esi,%esi
80105bf9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80105c00 <sys_getpid>:
int sys_getpid(void)
{
80105c00: 55 push %ebp
80105c01: 89 e5 mov %esp,%ebp
80105c03: 83 ec 08 sub $0x8,%esp
return myproc()->pid;
80105c06: e8 b5 de ff ff call 80103ac0 <myproc>
80105c0b: 8b 40 10 mov 0x10(%eax),%eax
}
80105c0e: c9 leave
80105c0f: c3 ret
80105c10 <sys_sbrk>:
int sys_sbrk(void)
{
80105c10: 55 push %ebp
80105c11: 89 e5 mov %esp,%ebp
80105c13: 53 push %ebx
int addr;
int n;
if (argint(0, &n) < 0)
80105c14: 8d 45 f4 lea -0xc(%ebp),%eax
{
return myproc()->pid;
}
int sys_sbrk(void)
{
80105c17: 83 ec 1c sub $0x1c,%esp
int addr;
int n;
if (argint(0, &n) < 0)
80105c1a: 50 push %eax
80105c1b: 6a 00 push $0x0
80105c1d: e8 0e f2 ff ff call 80104e30 <argint>
80105c22: 83 c4 10 add $0x10,%esp
80105c25: 85 c0 test %eax,%eax
80105c27: 78 27 js 80105c50 <sys_sbrk+0x40>
return -1;
addr = myproc()->sz;
80105c29: e8 92 de ff ff call 80103ac0 <myproc>
if (growproc(n) < 0)
80105c2e: 83 ec 0c sub $0xc,%esp
int addr;
int n;
if (argint(0, &n) < 0)
return -1;
addr = myproc()->sz;
80105c31: 8b 18 mov (%eax),%ebx
if (growproc(n) < 0)
80105c33: ff 75 f4 pushl -0xc(%ebp)
80105c36: e8 a5 df ff ff call 80103be0 <growproc>
80105c3b: 83 c4 10 add $0x10,%esp
80105c3e: 85 c0 test %eax,%eax
80105c40: 78 0e js 80105c50 <sys_sbrk+0x40>
return -1;
return addr;
80105c42: 89 d8 mov %ebx,%eax
}
80105c44: 8b 5d fc mov -0x4(%ebp),%ebx
80105c47: c9 leave
80105c48: c3 ret
80105c49: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
{
int addr;
int n;
if (argint(0, &n) < 0)
return -1;
80105c50: b8 ff ff ff ff mov $0xffffffff,%eax
80105c55: eb ed jmp 80105c44 <sys_sbrk+0x34>
80105c57: 89 f6 mov %esi,%esi
80105c59: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80105c60 <sys_sleep>:
return -1;
return addr;
}
int sys_sleep(void)
{
80105c60: 55 push %ebp
80105c61: 89 e5 mov %esp,%ebp
80105c63: 53 push %ebx
int n;
uint ticks0;
if (argint(0, &n) < 0)
80105c64: 8d 45 f4 lea -0xc(%ebp),%eax
return -1;
return addr;
}
int sys_sleep(void)
{
80105c67: 83 ec 1c sub $0x1c,%esp
int n;
uint ticks0;
if (argint(0, &n) < 0)
80105c6a: 50 push %eax
80105c6b: 6a 00 push $0x0
80105c6d: e8 be f1 ff ff call 80104e30 <argint>
80105c72: 83 c4 10 add $0x10,%esp
80105c75: 85 c0 test %eax,%eax
80105c77: 0f 88 8a 00 00 00 js 80105d07 <sys_sleep+0xa7>
return -1;
acquire(&tickslock);
80105c7d: 83 ec 0c sub $0xc,%esp
80105c80: 68 20 61 11 80 push $0x80116120
80105c85: e8 96 ed ff ff call 80104a20 <acquire>
ticks0 = ticks;
while (ticks - ticks0 < n)
80105c8a: 8b 55 f4 mov -0xc(%ebp),%edx
80105c8d: 83 c4 10 add $0x10,%esp
uint ticks0;
if (argint(0, &n) < 0)
return -1;
acquire(&tickslock);
ticks0 = ticks;
80105c90: 8b 1d 60 69 11 80 mov 0x80116960,%ebx
while (ticks - ticks0 < n)
80105c96: 85 d2 test %edx,%edx
80105c98: 75 27 jne 80105cc1 <sys_sleep+0x61>
80105c9a: eb 54 jmp 80105cf0 <sys_sleep+0x90>
80105c9c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
if (myproc()->killed)
{
release(&tickslock);
return -1;
}
sleep(&ticks, &tickslock);
80105ca0: 83 ec 08 sub $0x8,%esp
80105ca3: 68 20 61 11 80 push $0x80116120
80105ca8: 68 60 69 11 80 push $0x80116960
80105cad: e8 be e3 ff ff call 80104070 <sleep>
if (argint(0, &n) < 0)
return -1;
acquire(&tickslock);
ticks0 = ticks;
while (ticks - ticks0 < n)
80105cb2: a1 60 69 11 80 mov 0x80116960,%eax
80105cb7: 83 c4 10 add $0x10,%esp
80105cba: 29 d8 sub %ebx,%eax
80105cbc: 3b 45 f4 cmp -0xc(%ebp),%eax
80105cbf: 73 2f jae 80105cf0 <sys_sleep+0x90>
{
if (myproc()->killed)
80105cc1: e8 fa dd ff ff call 80103ac0 <myproc>
80105cc6: 8b 40 24 mov 0x24(%eax),%eax
80105cc9: 85 c0 test %eax,%eax
80105ccb: 74 d3 je 80105ca0 <sys_sleep+0x40>
{
release(&tickslock);
80105ccd: 83 ec 0c sub $0xc,%esp
80105cd0: 68 20 61 11 80 push $0x80116120
80105cd5: e8 f6 ed ff ff call 80104ad0 <release>
return -1;
80105cda: 83 c4 10 add $0x10,%esp
80105cdd: b8 ff ff ff ff mov $0xffffffff,%eax
}
sleep(&ticks, &tickslock);
}
release(&tickslock);
return 0;
}
80105ce2: 8b 5d fc mov -0x4(%ebp),%ebx
80105ce5: c9 leave
80105ce6: c3 ret
80105ce7: 89 f6 mov %esi,%esi
80105ce9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
release(&tickslock);
return -1;
}
sleep(&ticks, &tickslock);
}
release(&tickslock);
80105cf0: 83 ec 0c sub $0xc,%esp
80105cf3: 68 20 61 11 80 push $0x80116120
80105cf8: e8 d3 ed ff ff call 80104ad0 <release>
return 0;
80105cfd: 83 c4 10 add $0x10,%esp
80105d00: 31 c0 xor %eax,%eax
}
80105d02: 8b 5d fc mov -0x4(%ebp),%ebx
80105d05: c9 leave
80105d06: c3 ret
{
int n;
uint ticks0;
if (argint(0, &n) < 0)
return -1;
80105d07: b8 ff ff ff ff mov $0xffffffff,%eax
80105d0c: eb d4 jmp 80105ce2 <sys_sleep+0x82>
80105d0e: 66 90 xchg %ax,%ax
80105d10 <sys_uptime>:
}
// return how many clock tick interrupts have occurred
// since start.
int sys_uptime(void)
{
80105d10: 55 push %ebp
80105d11: 89 e5 mov %esp,%ebp
80105d13: 53 push %ebx
80105d14: 83 ec 10 sub $0x10,%esp
uint xticks;
acquire(&tickslock);
80105d17: 68 20 61 11 80 push $0x80116120
80105d1c: e8 ff ec ff ff call 80104a20 <acquire>
xticks = ticks;
80105d21: 8b 1d 60 69 11 80 mov 0x80116960,%ebx
release(&tickslock);
80105d27: c7 04 24 20 61 11 80 movl $0x80116120,(%esp)
80105d2e: e8 9d ed ff ff call 80104ad0 <release>
return xticks;
}
80105d33: 89 d8 mov %ebx,%eax
80105d35: 8b 5d fc mov -0x4(%ebp),%ebx
80105d38: c9 leave
80105d39: c3 ret
80105d3a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80105d40 <sys_incNum>:
int sys_incNum(int num)
{
80105d40: 55 push %ebp
80105d41: 89 e5 mov %esp,%ebp
80105d43: 83 ec 08 sub $0x8,%esp
struct proc *curproc = myproc();
80105d46: e8 75 dd ff ff call 80103ac0 <myproc>
cprintf("increased and print in kernel surface %d\n", curproc->tf->ebx + 1);
80105d4b: 8b 40 18 mov 0x18(%eax),%eax
80105d4e: 83 ec 08 sub $0x8,%esp
80105d51: 8b 40 10 mov 0x10(%eax),%eax
80105d54: 83 c0 01 add $0x1,%eax
80105d57: 50 push %eax
80105d58: 68 4c 7f 10 80 push $0x80107f4c
80105d5d: e8 fe a8 ff ff call 80100660 <cprintf>
return 22;
}
80105d62: b8 16 00 00 00 mov $0x16,%eax
80105d67: c9 leave
80105d68: c3 ret
80105d69: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80105d70 <sys_getprocs>:
int sys_getprocs()
{
80105d70: 55 push %ebp
80105d71: 89 e5 mov %esp,%ebp
return getprocs();
}
80105d73: 5d pop %ebp
return 22;
}
int sys_getprocs()
{
return getprocs();
80105d74: e9 27 e7 ff ff jmp 801044a0 <getprocs>
80105d79: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80105d80 <sys_printstack>:
}
int sys_printstack()
{
80105d80: 55 push %ebp
80105d81: 89 e5 mov %esp,%ebp
return printstack();
}
80105d83: 5d pop %ebp
return getprocs();
}
int sys_printstack()
{
return printstack();
80105d84: e9 87 e7 ff ff jmp 80104510 <printstack>
80105d89: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80105d90 <sys_thread_create>:
}
int sys_thread_create()
{
80105d90: 55 push %ebp
80105d91: 89 e5 mov %esp,%ebp
80105d93: 83 ec 1c sub $0x1c,%esp
void (*fcn)(void *), *arg, *stack;
argptr(0, (void *)&fcn, sizeof(void (*)(void *)));
80105d96: 8d 45 ec lea -0x14(%ebp),%eax
80105d99: 6a 04 push $0x4
80105d9b: 50 push %eax
80105d9c: 6a 00 push $0x0
80105d9e: e8 dd f0 ff ff call 80104e80 <argptr>
argptr(1, (void *)&arg, sizeof(void *));
80105da3: 8d 45 f0 lea -0x10(%ebp),%eax
80105da6: 83 c4 0c add $0xc,%esp
80105da9: 6a 04 push $0x4
80105dab: 50 push %eax
80105dac: 6a 01 push $0x1
80105dae: e8 cd f0 ff ff call 80104e80 <argptr>
argptr(2, (void *)&stack, sizeof(void *));
80105db3: 8d 45 f4 lea -0xc(%ebp),%eax
80105db6: 83 c4 0c add $0xc,%esp
80105db9: 6a 04 push $0x4
80105dbb: 50 push %eax
80105dbc: 6a 02 push $0x2
80105dbe: e8 bd f0 ff ff call 80104e80 <argptr>
return thread_create(fcn, arg);
80105dc3: 58 pop %eax
80105dc4: 5a pop %edx
80105dc5: ff 75 f0 pushl -0x10(%ebp)
80105dc8: ff 75 ec pushl -0x14(%ebp)
80105dcb: e8 70 e9 ff ff call 80104740 <thread_create>
80105dd0: c9 leave
80105dd1: c3 ret
80105dd2 <alltraps>:
80105dd2: 1e push %ds
80105dd3: 06 push %es
80105dd4: 0f a0 push %fs
80105dd6: 0f a8 push %gs
80105dd8: 60 pusha
80105dd9: 66 b8 10 00 mov $0x10,%ax
80105ddd: 8e d8 mov %eax,%ds
80105ddf: 8e c0 mov %eax,%es
80105de1: 54 push %esp
80105de2: e8 e9 00 00 00 call 80105ed0 <trap>
80105de7: 83 c4 04 add $0x4,%esp
80105dea <trapret>:
80105dea: 61 popa
80105deb: 0f a9 pop %gs
80105ded: 0f a1 pop %fs
80105def: 07 pop %es
80105df0: 1f pop %ds
80105df1: 83 c4 08 add $0x8,%esp
80105df4: cf iret
80105df5: 66 90 xchg %ax,%ax
80105df7: 66 90 xchg %ax,%ax
80105df9: 66 90 xchg %ax,%ax
80105dfb: 66 90 xchg %ax,%ax
80105dfd: 66 90 xchg %ax,%ax
80105dff: 90 nop
80105e00 <tvinit>:
void
tvinit(void)
{
int i;
for(i = 0; i < 256; i++)
80105e00: 31 c0 xor %eax,%eax
80105e02: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
SETGATE(idt[i], 0, SEG_KCODE<<3, vectors[i], 0);
80105e08: 8b 14 85 08 b0 10 80 mov -0x7fef4ff8(,%eax,4),%edx
80105e0f: b9 08 00 00 00 mov $0x8,%ecx
80105e14: c6 04 c5 64 61 11 80 movb $0x0,-0x7fee9e9c(,%eax,8)
80105e1b: 00
80105e1c: 66 89 0c c5 62 61 11 mov %cx,-0x7fee9e9e(,%eax,8)
80105e23: 80
80105e24: c6 04 c5 65 61 11 80 movb $0x8e,-0x7fee9e9b(,%eax,8)
80105e2b: 8e
80105e2c: 66 89 14 c5 60 61 11 mov %dx,-0x7fee9ea0(,%eax,8)
80105e33: 80
80105e34: c1 ea 10 shr $0x10,%edx
80105e37: 66 89 14 c5 66 61 11 mov %dx,-0x7fee9e9a(,%eax,8)
80105e3e: 80
void
tvinit(void)
{
int i;
for(i = 0; i < 256; i++)
80105e3f: 83 c0 01 add $0x1,%eax
80105e42: 3d 00 01 00 00 cmp $0x100,%eax
80105e47: 75 bf jne 80105e08 <tvinit+0x8>
struct spinlock tickslock;
uint ticks;
void
tvinit(void)
{
80105e49: 55 push %ebp
int i;
for(i = 0; i < 256; i++)
SETGATE(idt[i], 0, SEG_KCODE<<3, vectors[i], 0);
SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER);
80105e4a: ba 08 00 00 00 mov $0x8,%edx
struct spinlock tickslock;
uint ticks;
void
tvinit(void)
{
80105e4f: 89 e5 mov %esp,%ebp
80105e51: 83 ec 10 sub $0x10,%esp
int i;
for(i = 0; i < 256; i++)
SETGATE(idt[i], 0, SEG_KCODE<<3, vectors[i], 0);
SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER);
80105e54: a1 08 b1 10 80 mov 0x8010b108,%eax
initlock(&tickslock, "time");
80105e59: 68 76 7f 10 80 push $0x80107f76
80105e5e: 68 20 61 11 80 push $0x80116120
{
int i;
for(i = 0; i < 256; i++)
SETGATE(idt[i], 0, SEG_KCODE<<3, vectors[i], 0);
SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER);
80105e63: 66 89 15 62 63 11 80 mov %dx,0x80116362
80105e6a: c6 05 64 63 11 80 00 movb $0x0,0x80116364
80105e71: 66 a3 60 63 11 80 mov %ax,0x80116360
80105e77: c1 e8 10 shr $0x10,%eax
80105e7a: c6 05 65 63 11 80 ef movb $0xef,0x80116365
80105e81: 66 a3 66 63 11 80 mov %ax,0x80116366
initlock(&tickslock, "time");
80105e87: e8 34 ea ff ff call 801048c0 <initlock>
}
80105e8c: 83 c4 10 add $0x10,%esp
80105e8f: c9 leave
80105e90: c3 ret
80105e91: eb 0d jmp 80105ea0 <idtinit>
80105e93: 90 nop
80105e94: 90 nop
80105e95: 90 nop
80105e96: 90 nop
80105e97: 90 nop
80105e98: 90 nop
80105e99: 90 nop
80105e9a: 90 nop
80105e9b: 90 nop
80105e9c: 90 nop
80105e9d: 90 nop
80105e9e: 90 nop
80105e9f: 90 nop
80105ea0 <idtinit>:
void
idtinit(void)
{
80105ea0: 55 push %ebp
static inline void
lidt(struct gatedesc *p, int size)
{
volatile ushort pd[3];
pd[0] = size-1;
80105ea1: b8 ff 07 00 00 mov $0x7ff,%eax
80105ea6: 89 e5 mov %esp,%ebp
80105ea8: 83 ec 10 sub $0x10,%esp
80105eab: 66 89 45 fa mov %ax,-0x6(%ebp)
pd[1] = (uint)p;
80105eaf: b8 60 61 11 80 mov $0x80116160,%eax
80105eb4: 66 89 45 fc mov %ax,-0x4(%ebp)
pd[2] = (uint)p >> 16;
80105eb8: c1 e8 10 shr $0x10,%eax
80105ebb: 66 89 45 fe mov %ax,-0x2(%ebp)
asm volatile("lidt (%0)" : : "r" (pd));
80105ebf: 8d 45 fa lea -0x6(%ebp),%eax
80105ec2: 0f 01 18 lidtl (%eax)
lidt(idt, sizeof(idt));
}
80105ec5: c9 leave
80105ec6: c3 ret
80105ec7: 89 f6 mov %esi,%esi
80105ec9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80105ed0 <trap>:
//PAGEBREAK: 41
void
trap(struct trapframe *tf)
{
80105ed0: 55 push %ebp
80105ed1: 89 e5 mov %esp,%ebp
80105ed3: 57 push %edi
80105ed4: 56 push %esi
80105ed5: 53 push %ebx
80105ed6: 83 ec 1c sub $0x1c,%esp
80105ed9: 8b 7d 08 mov 0x8(%ebp),%edi
if(tf->trapno == T_SYSCALL){
80105edc: 8b 47 30 mov 0x30(%edi),%eax
80105edf: 83 f8 40 cmp $0x40,%eax
80105ee2: 0f 84 88 01 00 00 je 80106070 <trap+0x1a0>
if(myproc()->killed)
exit();
return;
}
switch(tf->trapno){
80105ee8: 83 e8 20 sub $0x20,%eax
80105eeb: 83 f8 1f cmp $0x1f,%eax
80105eee: 77 10 ja 80105f00 <trap+0x30>
80105ef0: ff 24 85 1c 80 10 80 jmp *-0x7fef7fe4(,%eax,4)
80105ef7: 89 f6 mov %esi,%esi
80105ef9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
lapiceoi();
break;
//PAGEBREAK: 13
default:
if(myproc() == 0 || (tf->cs&3) == 0){
80105f00: e8 bb db ff ff call 80103ac0 <myproc>
80105f05: 85 c0 test %eax,%eax
80105f07: 0f 84 d7 01 00 00 je 801060e4 <trap+0x214>
80105f0d: f6 47 3c 03 testb $0x3,0x3c(%edi)
80105f11: 0f 84 cd 01 00 00 je 801060e4 <trap+0x214>
static inline uint
rcr2(void)
{
uint val;
asm volatile("movl %%cr2,%0" : "=r" (val));
80105f17: 0f 20 d1 mov %cr2,%ecx
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 "
80105f1a: 8b 57 38 mov 0x38(%edi),%edx
80105f1d: 89 4d d8 mov %ecx,-0x28(%ebp)
80105f20: 89 55 dc mov %edx,-0x24(%ebp)
80105f23: e8 78 db ff ff call 80103aa0 <cpuid>
80105f28: 8b 77 34 mov 0x34(%edi),%esi
80105f2b: 8b 5f 30 mov 0x30(%edi),%ebx
80105f2e: 89 45 e4 mov %eax,-0x1c(%ebp)
"eip 0x%x addr 0x%x--kill proc\n",
myproc()->pid, myproc()->name, tf->trapno,
80105f31: e8 8a db ff ff call 80103ac0 <myproc>
80105f36: 89 45 e0 mov %eax,-0x20(%ebp)
80105f39: e8 82 db ff ff call 80103ac0 <myproc>
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 "
80105f3e: 8b 4d d8 mov -0x28(%ebp),%ecx
80105f41: 8b 55 dc mov -0x24(%ebp),%edx
80105f44: 51 push %ecx
80105f45: 52 push %edx
"eip 0x%x addr 0x%x--kill proc\n",
myproc()->pid, myproc()->name, tf->trapno,
80105f46: 8b 55 e0 mov -0x20(%ebp),%edx
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 "
80105f49: ff 75 e4 pushl -0x1c(%ebp)
80105f4c: 56 push %esi
80105f4d: 53 push %ebx
"eip 0x%x addr 0x%x--kill proc\n",
myproc()->pid, myproc()->name, tf->trapno,
80105f4e: 83 c2 6c add $0x6c,%edx
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 "
80105f51: 52 push %edx
80105f52: ff 70 10 pushl 0x10(%eax)
80105f55: 68 d8 7f 10 80 push $0x80107fd8
80105f5a: e8 01 a7 ff ff call 80100660 <cprintf>
"eip 0x%x addr 0x%x--kill proc\n",
myproc()->pid, myproc()->name, tf->trapno,
tf->err, cpuid(), tf->eip, rcr2());
myproc()->killed = 1;
80105f5f: 83 c4 20 add $0x20,%esp
80105f62: e8 59 db ff ff call 80103ac0 <myproc>
80105f67: c7 40 24 01 00 00 00 movl $0x1,0x24(%eax)
80105f6e: 66 90 xchg %ax,%ax
}
// 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)
80105f70: e8 4b db ff ff call 80103ac0 <myproc>
80105f75: 85 c0 test %eax,%eax
80105f77: 74 0c je 80105f85 <trap+0xb5>
80105f79: e8 42 db ff ff call 80103ac0 <myproc>
80105f7e: 8b 50 24 mov 0x24(%eax),%edx
80105f81: 85 d2 test %edx,%edx
80105f83: 75 4b jne 80105fd0 <trap+0x100>
exit();
// Force process to give up CPU on clock tick.
// If interrupts were on while locks held, would need to check nlock.
if(myproc() && myproc()->state == RUNNING &&
80105f85: e8 36 db ff ff call 80103ac0 <myproc>
80105f8a: 85 c0 test %eax,%eax
80105f8c: 74 0b je 80105f99 <trap+0xc9>
80105f8e: e8 2d db ff ff call 80103ac0 <myproc>
80105f93: 83 78 0c 04 cmpl $0x4,0xc(%eax)
80105f97: 74 4f je 80105fe8 <trap+0x118>
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)
80105f99: e8 22 db ff ff call 80103ac0 <myproc>
80105f9e: 85 c0 test %eax,%eax
80105fa0: 74 1d je 80105fbf <trap+0xef>
80105fa2: e8 19 db ff ff call 80103ac0 <myproc>
80105fa7: 8b 40 24 mov 0x24(%eax),%eax
80105faa: 85 c0 test %eax,%eax
80105fac: 74 11 je 80105fbf <trap+0xef>
80105fae: 0f b7 47 3c movzwl 0x3c(%edi),%eax
80105fb2: 83 e0 03 and $0x3,%eax
80105fb5: 66 83 f8 03 cmp $0x3,%ax
80105fb9: 0f 84 da 00 00 00 je 80106099 <trap+0x1c9>
exit();
}
80105fbf: 8d 65 f4 lea -0xc(%ebp),%esp
80105fc2: 5b pop %ebx
80105fc3: 5e pop %esi
80105fc4: 5f pop %edi
80105fc5: 5d pop %ebp
80105fc6: c3 ret
80105fc7: 89 f6 mov %esi,%esi
80105fc9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
}
// 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)
80105fd0: 0f b7 47 3c movzwl 0x3c(%edi),%eax
80105fd4: 83 e0 03 and $0x3,%eax
80105fd7: 66 83 f8 03 cmp $0x3,%ax
80105fdb: 75 a8 jne 80105f85 <trap+0xb5>
exit();
80105fdd: e8 0e df ff ff call 80103ef0 <exit>
80105fe2: eb a1 jmp 80105f85 <trap+0xb5>
80105fe4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
// 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 &&
80105fe8: 83 7f 30 20 cmpl $0x20,0x30(%edi)
80105fec: 75 ab jne 80105f99 <trap+0xc9>
tf->trapno == T_IRQ0+IRQ_TIMER)
yield();
80105fee: e8 2d e0 ff ff call 80104020 <yield>
80105ff3: eb a4 jmp 80105f99 <trap+0xc9>
80105ff5: 8d 76 00 lea 0x0(%esi),%esi
return;
}
switch(tf->trapno){
case T_IRQ0 + IRQ_TIMER:
if(cpuid() == 0){
80105ff8: e8 a3 da ff ff call 80103aa0 <cpuid>
80105ffd: 85 c0 test %eax,%eax
80105fff: 0f 84 ab 00 00 00 je 801060b0 <trap+0x1e0>
}
lapiceoi();
break;
case T_IRQ0 + IRQ_IDE:
ideintr();
lapiceoi();
80106005: e8 36 ca ff ff call 80102a40 <lapiceoi>
break;
8010600a: e9 61 ff ff ff jmp 80105f70 <trap+0xa0>
8010600f: 90 nop
case T_IRQ0 + IRQ_IDE+1:
// Bochs generates spurious IDE1 interrupts.
break;
case T_IRQ0 + IRQ_KBD:
kbdintr();
80106010: e8 eb c8 ff ff call 80102900 <kbdintr>
lapiceoi();
80106015: e8 26 ca ff ff call 80102a40 <lapiceoi>
break;
8010601a: e9 51 ff ff ff jmp 80105f70 <trap+0xa0>
8010601f: 90 nop
case T_IRQ0 + IRQ_COM1:
uartintr();
80106020: e8 5b 02 00 00 call 80106280 <uartintr>
lapiceoi();
80106025: e8 16 ca ff ff call 80102a40 <lapiceoi>
break;
8010602a: e9 41 ff ff ff jmp 80105f70 <trap+0xa0>
8010602f: 90 nop
case T_IRQ0 + 7:
case T_IRQ0 + IRQ_SPURIOUS:
cprintf("cpu%d: spurious interrupt at %x:%x\n",
80106030: 0f b7 5f 3c movzwl 0x3c(%edi),%ebx
80106034: 8b 77 38 mov 0x38(%edi),%esi
80106037: e8 64 da ff ff call 80103aa0 <cpuid>
8010603c: 56 push %esi
8010603d: 53 push %ebx
8010603e: 50 push %eax
8010603f: 68 80 7f 10 80 push $0x80107f80
80106044: e8 17 a6 ff ff call 80100660 <cprintf>
cpuid(), tf->cs, tf->eip);
lapiceoi();
80106049: e8 f2 c9 ff ff call 80102a40 <lapiceoi>
break;
8010604e: 83 c4 10 add $0x10,%esp
80106051: e9 1a ff ff ff jmp 80105f70 <trap+0xa0>
80106056: 8d 76 00 lea 0x0(%esi),%esi
80106059: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
release(&tickslock);
}
lapiceoi();
break;
case T_IRQ0 + IRQ_IDE:
ideintr();
80106060: e8 1b c3 ff ff call 80102380 <ideintr>
80106065: eb 9e jmp 80106005 <trap+0x135>
80106067: 89 f6 mov %esi,%esi
80106069: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
//PAGEBREAK: 41
void
trap(struct trapframe *tf)
{
if(tf->trapno == T_SYSCALL){
if(myproc()->killed)
80106070: e8 4b da ff ff call 80103ac0 <myproc>
80106075: 8b 58 24 mov 0x24(%eax),%ebx
80106078: 85 db test %ebx,%ebx
8010607a: 75 2c jne 801060a8 <trap+0x1d8>
exit();
myproc()->tf = tf;
8010607c: e8 3f da ff ff call 80103ac0 <myproc>
80106081: 89 78 18 mov %edi,0x18(%eax)
syscall();
80106084: e8 97 ee ff ff call 80104f20 <syscall>
if(myproc()->killed)
80106089: e8 32 da ff ff call 80103ac0 <myproc>
8010608e: 8b 48 24 mov 0x24(%eax),%ecx
80106091: 85 c9 test %ecx,%ecx
80106093: 0f 84 26 ff ff ff je 80105fbf <trap+0xef>
yield();
// Check if the process has been killed since we yielded
if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER)
exit();
}
80106099: 8d 65 f4 lea -0xc(%ebp),%esp
8010609c: 5b pop %ebx
8010609d: 5e pop %esi
8010609e: 5f pop %edi
8010609f: 5d pop %ebp
if(myproc()->killed)
exit();
myproc()->tf = tf;
syscall();
if(myproc()->killed)
exit();
801060a0: e9 4b de ff ff jmp 80103ef0 <exit>
801060a5: 8d 76 00 lea 0x0(%esi),%esi
void
trap(struct trapframe *tf)
{
if(tf->trapno == T_SYSCALL){
if(myproc()->killed)
exit();
801060a8: e8 43 de ff ff call 80103ef0 <exit>
801060ad: eb cd jmp 8010607c <trap+0x1ac>
801060af: 90 nop
}
switch(tf->trapno){
case T_IRQ0 + IRQ_TIMER:
if(cpuid() == 0){
acquire(&tickslock);
801060b0: 83 ec 0c sub $0xc,%esp
801060b3: 68 20 61 11 80 push $0x80116120
801060b8: e8 63 e9 ff ff call 80104a20 <acquire>
ticks++;
wakeup(&ticks);
801060bd: c7 04 24 60 69 11 80 movl $0x80116960,(%esp)
switch(tf->trapno){
case T_IRQ0 + IRQ_TIMER:
if(cpuid() == 0){
acquire(&tickslock);
ticks++;
801060c4: 83 05 60 69 11 80 01 addl $0x1,0x80116960
wakeup(&ticks);
801060cb: e8 60 e1 ff ff call 80104230 <wakeup>
release(&tickslock);
801060d0: c7 04 24 20 61 11 80 movl $0x80116120,(%esp)
801060d7: e8 f4 e9 ff ff call 80104ad0 <release>
801060dc: 83 c4 10 add $0x10,%esp
801060df: e9 21 ff ff ff jmp 80106005 <trap+0x135>
801060e4: 0f 20 d6 mov %cr2,%esi
//PAGEBREAK: 13
default:
if(myproc() == 0 || (tf->cs&3) == 0){
// In kernel, it must be our mistake.
cprintf("unexpected trap %d from cpu %d eip %x (cr2=0x%x)\n",
801060e7: 8b 5f 38 mov 0x38(%edi),%ebx
801060ea: e8 b1 d9 ff ff call 80103aa0 <cpuid>
801060ef: 83 ec 0c sub $0xc,%esp
801060f2: 56 push %esi
801060f3: 53 push %ebx
801060f4: 50 push %eax
801060f5: ff 77 30 pushl 0x30(%edi)
801060f8: 68 a4 7f 10 80 push $0x80107fa4
801060fd: e8 5e a5 ff ff call 80100660 <cprintf>
tf->trapno, cpuid(), tf->eip, rcr2());
panic("trap");
80106102: 83 c4 14 add $0x14,%esp
80106105: 68 7b 7f 10 80 push $0x80107f7b
8010610a: e8 61 a2 ff ff call 80100370 <panic>
8010610f: 90 nop
80106110 <uartgetc>:
}
static int
uartgetc(void)
{
if(!uart)
80106110: a1 fc b5 10 80 mov 0x8010b5fc,%eax
outb(COM1+0, c);
}
static int
uartgetc(void)
{
80106115: 55 push %ebp
80106116: 89 e5 mov %esp,%ebp
if(!uart)
80106118: 85 c0 test %eax,%eax
8010611a: 74 1c je 80106138 <uartgetc+0x28>
static inline uchar
inb(ushort port)
{
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
8010611c: ba fd 03 00 00 mov $0x3fd,%edx
80106121: ec in (%dx),%al
return -1;
if(!(inb(COM1+5) & 0x01))
80106122: a8 01 test $0x1,%al
80106124: 74 12 je 80106138 <uartgetc+0x28>
80106126: ba f8 03 00 00 mov $0x3f8,%edx
8010612b: ec in (%dx),%al
return -1;
return inb(COM1+0);
8010612c: 0f b6 c0 movzbl %al,%eax
}
8010612f: 5d pop %ebp
80106130: c3 ret
80106131: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
static int
uartgetc(void)
{
if(!uart)
return -1;
80106138: b8 ff ff ff ff mov $0xffffffff,%eax
if(!(inb(COM1+5) & 0x01))
return -1;
return inb(COM1+0);
}
8010613d: 5d pop %ebp
8010613e: c3 ret
8010613f: 90 nop
80106140 <uartputc.part.0>:
for(p="xv6...\n"; *p; p++)
uartputc(*p);
}
void
uartputc(int c)
80106140: 55 push %ebp
80106141: 89 e5 mov %esp,%ebp
80106143: 57 push %edi
80106144: 56 push %esi
80106145: 53 push %ebx
80106146: 89 c7 mov %eax,%edi
80106148: bb 80 00 00 00 mov $0x80,%ebx
8010614d: be fd 03 00 00 mov $0x3fd,%esi
80106152: 83 ec 0c sub $0xc,%esp
80106155: eb 1b jmp 80106172 <uartputc.part.0+0x32>
80106157: 89 f6 mov %esi,%esi
80106159: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
int i;
if(!uart)
return;
for(i = 0; i < 128 && !(inb(COM1+5) & 0x20); i++)
microdelay(10);
80106160: 83 ec 0c sub $0xc,%esp
80106163: 6a 0a push $0xa
80106165: e8 f6 c8 ff ff call 80102a60 <microdelay>
{
int i;
if(!uart)
return;
for(i = 0; i < 128 && !(inb(COM1+5) & 0x20); i++)
8010616a: 83 c4 10 add $0x10,%esp
8010616d: 83 eb 01 sub $0x1,%ebx
80106170: 74 07 je 80106179 <uartputc.part.0+0x39>
80106172: 89 f2 mov %esi,%edx
80106174: ec in (%dx),%al
80106175: a8 20 test $0x20,%al
80106177: 74 e7 je 80106160 <uartputc.part.0+0x20>
}
static inline void
outb(ushort port, uchar data)
{
asm volatile("out %0,%1" : : "a" (data), "d" (port));
80106179: ba f8 03 00 00 mov $0x3f8,%edx
8010617e: 89 f8 mov %edi,%eax
80106180: ee out %al,(%dx)
microdelay(10);
outb(COM1+0, c);
}
80106181: 8d 65 f4 lea -0xc(%ebp),%esp
80106184: 5b pop %ebx
80106185: 5e pop %esi
80106186: 5f pop %edi
80106187: 5d pop %ebp
80106188: c3 ret
80106189: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80106190 <uartinit>:
static int uart; // is there a uart?
void
uartinit(void)
{
80106190: 55 push %ebp
80106191: 31 c9 xor %ecx,%ecx
80106193: 89 c8 mov %ecx,%eax
80106195: 89 e5 mov %esp,%ebp
80106197: 57 push %edi
80106198: 56 push %esi
80106199: 53 push %ebx
8010619a: bb fa 03 00 00 mov $0x3fa,%ebx
8010619f: 89 da mov %ebx,%edx
801061a1: 83 ec 0c sub $0xc,%esp
801061a4: ee out %al,(%dx)
801061a5: bf fb 03 00 00 mov $0x3fb,%edi
801061aa: b8 80 ff ff ff mov $0xffffff80,%eax
801061af: 89 fa mov %edi,%edx
801061b1: ee out %al,(%dx)
801061b2: b8 0c 00 00 00 mov $0xc,%eax
801061b7: ba f8 03 00 00 mov $0x3f8,%edx
801061bc: ee out %al,(%dx)
801061bd: be f9 03 00 00 mov $0x3f9,%esi
801061c2: 89 c8 mov %ecx,%eax
801061c4: 89 f2 mov %esi,%edx
801061c6: ee out %al,(%dx)
801061c7: b8 03 00 00 00 mov $0x3,%eax
801061cc: 89 fa mov %edi,%edx
801061ce: ee out %al,(%dx)
801061cf: ba fc 03 00 00 mov $0x3fc,%edx
801061d4: 89 c8 mov %ecx,%eax
801061d6: ee out %al,(%dx)
801061d7: b8 01 00 00 00 mov $0x1,%eax
801061dc: 89 f2 mov %esi,%edx
801061de: ee out %al,(%dx)
static inline uchar
inb(ushort port)
{
uchar data;
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
801061df: ba fd 03 00 00 mov $0x3fd,%edx
801061e4: ec in (%dx),%al
outb(COM1+3, 0x03); // Lock divisor, 8 data bits.
outb(COM1+4, 0);
outb(COM1+1, 0x01); // Enable receive interrupts.
// If status is 0xFF, no serial port.
if(inb(COM1+5) == 0xFF)
801061e5: 3c ff cmp $0xff,%al
801061e7: 74 5a je 80106243 <uartinit+0xb3>
return;
uart = 1;
801061e9: c7 05 fc b5 10 80 01 movl $0x1,0x8010b5fc
801061f0: 00 00 00
801061f3: 89 da mov %ebx,%edx
801061f5: ec in (%dx),%al
801061f6: ba f8 03 00 00 mov $0x3f8,%edx
801061fb: ec in (%dx),%al
// Acknowledge pre-existing interrupt conditions;
// enable interrupts.
inb(COM1+2);
inb(COM1+0);
ioapicenable(IRQ_COM1, 0);
801061fc: 83 ec 08 sub $0x8,%esp
801061ff: bb 9c 80 10 80 mov $0x8010809c,%ebx
80106204: 6a 00 push $0x0
80106206: 6a 04 push $0x4
80106208: e8 c3 c3 ff ff call 801025d0 <ioapicenable>
8010620d: 83 c4 10 add $0x10,%esp
80106210: b8 78 00 00 00 mov $0x78,%eax
80106215: eb 13 jmp 8010622a <uartinit+0x9a>
80106217: 89 f6 mov %esi,%esi
80106219: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
// Announce that we're here.
for(p="xv6...\n"; *p; p++)
80106220: 83 c3 01 add $0x1,%ebx
80106223: 0f be 03 movsbl (%ebx),%eax
80106226: 84 c0 test %al,%al
80106228: 74 19 je 80106243 <uartinit+0xb3>
void
uartputc(int c)
{
int i;
if(!uart)
8010622a: 8b 15 fc b5 10 80 mov 0x8010b5fc,%edx
80106230: 85 d2 test %edx,%edx
80106232: 74 ec je 80106220 <uartinit+0x90>
inb(COM1+2);
inb(COM1+0);
ioapicenable(IRQ_COM1, 0);
// Announce that we're here.
for(p="xv6...\n"; *p; p++)
80106234: 83 c3 01 add $0x1,%ebx
80106237: e8 04 ff ff ff call 80106140 <uartputc.part.0>
8010623c: 0f be 03 movsbl (%ebx),%eax
8010623f: 84 c0 test %al,%al
80106241: 75 e7 jne 8010622a <uartinit+0x9a>
uartputc(*p);
}
80106243: 8d 65 f4 lea -0xc(%ebp),%esp
80106246: 5b pop %ebx
80106247: 5e pop %esi
80106248: 5f pop %edi
80106249: 5d pop %ebp
8010624a: c3 ret
8010624b: 90 nop
8010624c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80106250 <uartputc>:
void
uartputc(int c)
{
int i;
if(!uart)
80106250: 8b 15 fc b5 10 80 mov 0x8010b5fc,%edx
uartputc(*p);
}
void
uartputc(int c)
{
80106256: 55 push %ebp
80106257: 89 e5 mov %esp,%ebp
int i;
if(!uart)
80106259: 85 d2 test %edx,%edx
uartputc(*p);
}
void
uartputc(int c)
{
8010625b: 8b 45 08 mov 0x8(%ebp),%eax
int i;
if(!uart)
8010625e: 74 10 je 80106270 <uartputc+0x20>
return;
for(i = 0; i < 128 && !(inb(COM1+5) & 0x20); i++)
microdelay(10);
outb(COM1+0, c);
}
80106260: 5d pop %ebp
80106261: e9 da fe ff ff jmp 80106140 <uartputc.part.0>
80106266: 8d 76 00 lea 0x0(%esi),%esi
80106269: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80106270: 5d pop %ebp
80106271: c3 ret
80106272: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80106279: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80106280 <uartintr>:
return inb(COM1+0);
}
void
uartintr(void)
{
80106280: 55 push %ebp
80106281: 89 e5 mov %esp,%ebp
80106283: 83 ec 14 sub $0x14,%esp
consoleintr(uartgetc);
80106286: 68 10 61 10 80 push $0x80106110
8010628b: e8 40 a8 ff ff call 80100ad0 <consoleintr>
}
80106290: 83 c4 10 add $0x10,%esp
80106293: c9 leave
80106294: c3 ret
80106295 <vector0>:
80106295: 6a 00 push $0x0
80106297: 6a 00 push $0x0
80106299: e9 34 fb ff ff jmp 80105dd2 <alltraps>
8010629e <vector1>:
8010629e: 6a 00 push $0x0
801062a0: 6a 01 push $0x1
801062a2: e9 2b fb ff ff jmp 80105dd2 <alltraps>
801062a7 <vector2>:
801062a7: 6a 00 push $0x0
801062a9: 6a 02 push $0x2
801062ab: e9 22 fb ff ff jmp 80105dd2 <alltraps>
801062b0 <vector3>:
801062b0: 6a 00 push $0x0
801062b2: 6a 03 push $0x3
801062b4: e9 19 fb ff ff jmp 80105dd2 <alltraps>
801062b9 <vector4>:
801062b9: 6a 00 push $0x0
801062bb: 6a 04 push $0x4
801062bd: e9 10 fb ff ff jmp 80105dd2 <alltraps>
801062c2 <vector5>:
801062c2: 6a 00 push $0x0
801062c4: 6a 05 push $0x5
801062c6: e9 07 fb ff ff jmp 80105dd2 <alltraps>
801062cb <vector6>:
801062cb: 6a 00 push $0x0
801062cd: 6a 06 push $0x6
801062cf: e9 fe fa ff ff jmp 80105dd2 <alltraps>
801062d4 <vector7>:
801062d4: 6a 00 push $0x0
801062d6: 6a 07 push $0x7
801062d8: e9 f5 fa ff ff jmp 80105dd2 <alltraps>
801062dd <vector8>:
801062dd: 6a 08 push $0x8
801062df: e9 ee fa ff ff jmp 80105dd2 <alltraps>
801062e4 <vector9>:
801062e4: 6a 00 push $0x0
801062e6: 6a 09 push $0x9
801062e8: e9 e5 fa ff ff jmp 80105dd2 <alltraps>
801062ed <vector10>:
801062ed: 6a 0a push $0xa
801062ef: e9 de fa ff ff jmp 80105dd2 <alltraps>
801062f4 <vector11>:
801062f4: 6a 0b push $0xb
801062f6: e9 d7 fa ff ff jmp 80105dd2 <alltraps>
801062fb <vector12>:
801062fb: 6a 0c push $0xc
801062fd: e9 d0 fa ff ff jmp 80105dd2 <alltraps>
80106302 <vector13>:
80106302: 6a 0d push $0xd
80106304: e9 c9 fa ff ff jmp 80105dd2 <alltraps>
80106309 <vector14>:
80106309: 6a 0e push $0xe
8010630b: e9 c2 fa ff ff jmp 80105dd2 <alltraps>
80106310 <vector15>:
80106310: 6a 00 push $0x0
80106312: 6a 0f push $0xf
80106314: e9 b9 fa ff ff jmp 80105dd2 <alltraps>
80106319 <vector16>:
80106319: 6a 00 push $0x0
8010631b: 6a 10 push $0x10
8010631d: e9 b0 fa ff ff jmp 80105dd2 <alltraps>
80106322 <vector17>:
80106322: 6a 11 push $0x11
80106324: e9 a9 fa ff ff jmp 80105dd2 <alltraps>
80106329 <vector18>:
80106329: 6a 00 push $0x0
8010632b: 6a 12 push $0x12
8010632d: e9 a0 fa ff ff jmp 80105dd2 <alltraps>
80106332 <vector19>:
80106332: 6a 00 push $0x0
80106334: 6a 13 push $0x13
80106336: e9 97 fa ff ff jmp 80105dd2 <alltraps>
8010633b <vector20>:
8010633b: 6a 00 push $0x0
8010633d: 6a 14 push $0x14
8010633f: e9 8e fa ff ff jmp 80105dd2 <alltraps>
80106344 <vector21>:
80106344: 6a 00 push $0x0
80106346: 6a 15 push $0x15
80106348: e9 85 fa ff ff jmp 80105dd2 <alltraps>
8010634d <vector22>:
8010634d: 6a 00 push $0x0
8010634f: 6a 16 push $0x16
80106351: e9 7c fa ff ff jmp 80105dd2 <alltraps>
80106356 <vector23>:
80106356: 6a 00 push $0x0
80106358: 6a 17 push $0x17
8010635a: e9 73 fa ff ff jmp 80105dd2 <alltraps>
8010635f <vector24>:
8010635f: 6a 00 push $0x0
80106361: 6a 18 push $0x18
80106363: e9 6a fa ff ff jmp 80105dd2 <alltraps>
80106368 <vector25>:
80106368: 6a 00 push $0x0
8010636a: 6a 19 push $0x19
8010636c: e9 61 fa ff ff jmp 80105dd2 <alltraps>
80106371 <vector26>:
80106371: 6a 00 push $0x0
80106373: 6a 1a push $0x1a
80106375: e9 58 fa ff ff jmp 80105dd2 <alltraps>
8010637a <vector27>:
8010637a: 6a 00 push $0x0
8010637c: 6a 1b push $0x1b
8010637e: e9 4f fa ff ff jmp 80105dd2 <alltraps>
80106383 <vector28>:
80106383: 6a 00 push $0x0
80106385: 6a 1c push $0x1c
80106387: e9 46 fa ff ff jmp 80105dd2 <alltraps>
8010638c <vector29>:
8010638c: 6a 00 push $0x0
8010638e: 6a 1d push $0x1d
80106390: e9 3d fa ff ff jmp 80105dd2 <alltraps>
80106395 <vector30>:
80106395: 6a 00 push $0x0
80106397: 6a 1e push $0x1e
80106399: e9 34 fa ff ff jmp 80105dd2 <alltraps>
8010639e <vector31>:
8010639e: 6a 00 push $0x0
801063a0: 6a 1f push $0x1f
801063a2: e9 2b fa ff ff jmp 80105dd2 <alltraps>
801063a7 <vector32>:
801063a7: 6a 00 push $0x0
801063a9: 6a 20 push $0x20
801063ab: e9 22 fa ff ff jmp 80105dd2 <alltraps>
801063b0 <vector33>:
801063b0: 6a 00 push $0x0
801063b2: 6a 21 push $0x21
801063b4: e9 19 fa ff ff jmp 80105dd2 <alltraps>
801063b9 <vector34>:
801063b9: 6a 00 push $0x0
801063bb: 6a 22 push $0x22
801063bd: e9 10 fa ff ff jmp 80105dd2 <alltraps>
801063c2 <vector35>:
801063c2: 6a 00 push $0x0
801063c4: 6a 23 push $0x23
801063c6: e9 07 fa ff ff jmp 80105dd2 <alltraps>
801063cb <vector36>:
801063cb: 6a 00 push $0x0
801063cd: 6a 24 push $0x24
801063cf: e9 fe f9 ff ff jmp 80105dd2 <alltraps>
801063d4 <vector37>:
801063d4: 6a 00 push $0x0
801063d6: 6a 25 push $0x25
801063d8: e9 f5 f9 ff ff jmp 80105dd2 <alltraps>
801063dd <vector38>:
801063dd: 6a 00 push $0x0
801063df: 6a 26 push $0x26
801063e1: e9 ec f9 ff ff jmp 80105dd2 <alltraps>
801063e6 <vector39>:
801063e6: 6a 00 push $0x0
801063e8: 6a 27 push $0x27
801063ea: e9 e3 f9 ff ff jmp 80105dd2 <alltraps>
801063ef <vector40>:
801063ef: 6a 00 push $0x0
801063f1: 6a 28 push $0x28
801063f3: e9 da f9 ff ff jmp 80105dd2 <alltraps>
801063f8 <vector41>:
801063f8: 6a 00 push $0x0
801063fa: 6a 29 push $0x29
801063fc: e9 d1 f9 ff ff jmp 80105dd2 <alltraps>
80106401 <vector42>:
80106401: 6a 00 push $0x0
80106403: 6a 2a push $0x2a
80106405: e9 c8 f9 ff ff jmp 80105dd2 <alltraps>
8010640a <vector43>:
8010640a: 6a 00 push $0x0
8010640c: 6a 2b push $0x2b
8010640e: e9 bf f9 ff ff jmp 80105dd2 <alltraps>
80106413 <vector44>:
80106413: 6a 00 push $0x0
80106415: 6a 2c push $0x2c
80106417: e9 b6 f9 ff ff jmp 80105dd2 <alltraps>
8010641c <vector45>:
8010641c: 6a 00 push $0x0
8010641e: 6a 2d push $0x2d
80106420: e9 ad f9 ff ff jmp 80105dd2 <alltraps>
80106425 <vector46>:
80106425: 6a 00 push $0x0
80106427: 6a 2e push $0x2e
80106429: e9 a4 f9 ff ff jmp 80105dd2 <alltraps>
8010642e <vector47>:
8010642e: 6a 00 push $0x0
80106430: 6a 2f push $0x2f
80106432: e9 9b f9 ff ff jmp 80105dd2 <alltraps>
80106437 <vector48>:
80106437: 6a 00 push $0x0
80106439: 6a 30 push $0x30
8010643b: e9 92 f9 ff ff jmp 80105dd2 <alltraps>
80106440 <vector49>:
80106440: 6a 00 push $0x0
80106442: 6a 31 push $0x31
80106444: e9 89 f9 ff ff jmp 80105dd2 <alltraps>
80106449 <vector50>:
80106449: 6a 00 push $0x0
8010644b: 6a 32 push $0x32
8010644d: e9 80 f9 ff ff jmp 80105dd2 <alltraps>
80106452 <vector51>:
80106452: 6a 00 push $0x0
80106454: 6a 33 push $0x33
80106456: e9 77 f9 ff ff jmp 80105dd2 <alltraps>
8010645b <vector52>:
8010645b: 6a 00 push $0x0
8010645d: 6a 34 push $0x34
8010645f: e9 6e f9 ff ff jmp 80105dd2 <alltraps>
80106464 <vector53>:
80106464: 6a 00 push $0x0
80106466: 6a 35 push $0x35
80106468: e9 65 f9 ff ff jmp 80105dd2 <alltraps>
8010646d <vector54>:
8010646d: 6a 00 push $0x0
8010646f: 6a 36 push $0x36
80106471: e9 5c f9 ff ff jmp 80105dd2 <alltraps>
80106476 <vector55>:
80106476: 6a 00 push $0x0
80106478: 6a 37 push $0x37
8010647a: e9 53 f9 ff ff jmp 80105dd2 <alltraps>
8010647f <vector56>:
8010647f: 6a 00 push $0x0
80106481: 6a 38 push $0x38
80106483: e9 4a f9 ff ff jmp 80105dd2 <alltraps>
80106488 <vector57>:
80106488: 6a 00 push $0x0
8010648a: 6a 39 push $0x39
8010648c: e9 41 f9 ff ff jmp 80105dd2 <alltraps>
80106491 <vector58>:
80106491: 6a 00 push $0x0
80106493: 6a 3a push $0x3a
80106495: e9 38 f9 ff ff jmp 80105dd2 <alltraps>
8010649a <vector59>:
8010649a: 6a 00 push $0x0
8010649c: 6a 3b push $0x3b
8010649e: e9 2f f9 ff ff jmp 80105dd2 <alltraps>
801064a3 <vector60>:
801064a3: 6a 00 push $0x0
801064a5: 6a 3c push $0x3c
801064a7: e9 26 f9 ff ff jmp 80105dd2 <alltraps>
801064ac <vector61>:
801064ac: 6a 00 push $0x0
801064ae: 6a 3d push $0x3d
801064b0: e9 1d f9 ff ff jmp 80105dd2 <alltraps>
801064b5 <vector62>:
801064b5: 6a 00 push $0x0
801064b7: 6a 3e push $0x3e
801064b9: e9 14 f9 ff ff jmp 80105dd2 <alltraps>
801064be <vector63>:
801064be: 6a 00 push $0x0
801064c0: 6a 3f push $0x3f
801064c2: e9 0b f9 ff ff jmp 80105dd2 <alltraps>
801064c7 <vector64>:
801064c7: 6a 00 push $0x0
801064c9: 6a 40 push $0x40
801064cb: e9 02 f9 ff ff jmp 80105dd2 <alltraps>
801064d0 <vector65>:
801064d0: 6a 00 push $0x0
801064d2: 6a 41 push $0x41
801064d4: e9 f9 f8 ff ff jmp 80105dd2 <alltraps>
801064d9 <vector66>:
801064d9: 6a 00 push $0x0
801064db: 6a 42 push $0x42
801064dd: e9 f0 f8 ff ff jmp 80105dd2 <alltraps>
801064e2 <vector67>:
801064e2: 6a 00 push $0x0
801064e4: 6a 43 push $0x43
801064e6: e9 e7 f8 ff ff jmp 80105dd2 <alltraps>
801064eb <vector68>:
801064eb: 6a 00 push $0x0
801064ed: 6a 44 push $0x44
801064ef: e9 de f8 ff ff jmp 80105dd2 <alltraps>
801064f4 <vector69>:
801064f4: 6a 00 push $0x0
801064f6: 6a 45 push $0x45
801064f8: e9 d5 f8 ff ff jmp 80105dd2 <alltraps>
801064fd <vector70>:
801064fd: 6a 00 push $0x0
801064ff: 6a 46 push $0x46
80106501: e9 cc f8 ff ff jmp 80105dd2 <alltraps>
80106506 <vector71>:
80106506: 6a 00 push $0x0
80106508: 6a 47 push $0x47
8010650a: e9 c3 f8 ff ff jmp 80105dd2 <alltraps>
8010650f <vector72>:
8010650f: 6a 00 push $0x0
80106511: 6a 48 push $0x48
80106513: e9 ba f8 ff ff jmp 80105dd2 <alltraps>
80106518 <vector73>:
80106518: 6a 00 push $0x0
8010651a: 6a 49 push $0x49
8010651c: e9 b1 f8 ff ff jmp 80105dd2 <alltraps>
80106521 <vector74>:
80106521: 6a 00 push $0x0
80106523: 6a 4a push $0x4a
80106525: e9 a8 f8 ff ff jmp 80105dd2 <alltraps>
8010652a <vector75>:
8010652a: 6a 00 push $0x0
8010652c: 6a 4b push $0x4b
8010652e: e9 9f f8 ff ff jmp 80105dd2 <alltraps>
80106533 <vector76>:
80106533: 6a 00 push $0x0
80106535: 6a 4c push $0x4c
80106537: e9 96 f8 ff ff jmp 80105dd2 <alltraps>
8010653c <vector77>:
8010653c: 6a 00 push $0x0
8010653e: 6a 4d push $0x4d
80106540: e9 8d f8 ff ff jmp 80105dd2 <alltraps>
80106545 <vector78>:
80106545: 6a 00 push $0x0
80106547: 6a 4e push $0x4e
80106549: e9 84 f8 ff ff jmp 80105dd2 <alltraps>
8010654e <vector79>:
8010654e: 6a 00 push $0x0
80106550: 6a 4f push $0x4f
80106552: e9 7b f8 ff ff jmp 80105dd2 <alltraps>
80106557 <vector80>:
80106557: 6a 00 push $0x0
80106559: 6a 50 push $0x50
8010655b: e9 72 f8 ff ff jmp 80105dd2 <alltraps>
80106560 <vector81>:
80106560: 6a 00 push $0x0
80106562: 6a 51 push $0x51
80106564: e9 69 f8 ff ff jmp 80105dd2 <alltraps>
80106569 <vector82>:
80106569: 6a 00 push $0x0
8010656b: 6a 52 push $0x52
8010656d: e9 60 f8 ff ff jmp 80105dd2 <alltraps>
80106572 <vector83>:
80106572: 6a 00 push $0x0
80106574: 6a 53 push $0x53
80106576: e9 57 f8 ff ff jmp 80105dd2 <alltraps>
8010657b <vector84>:
8010657b: 6a 00 push $0x0
8010657d: 6a 54 push $0x54
8010657f: e9 4e f8 ff ff jmp 80105dd2 <alltraps>
80106584 <vector85>:
80106584: 6a 00 push $0x0
80106586: 6a 55 push $0x55
80106588: e9 45 f8 ff ff jmp 80105dd2 <alltraps>
8010658d <vector86>:
8010658d: 6a 00 push $0x0
8010658f: 6a 56 push $0x56
80106591: e9 3c f8 ff ff jmp 80105dd2 <alltraps>
80106596 <vector87>:
80106596: 6a 00 push $0x0
80106598: 6a 57 push $0x57
8010659a: e9 33 f8 ff ff jmp 80105dd2 <alltraps>
8010659f <vector88>:
8010659f: 6a 00 push $0x0
801065a1: 6a 58 push $0x58
801065a3: e9 2a f8 ff ff jmp 80105dd2 <alltraps>
801065a8 <vector89>:
801065a8: 6a 00 push $0x0
801065aa: 6a 59 push $0x59
801065ac: e9 21 f8 ff ff jmp 80105dd2 <alltraps>
801065b1 <vector90>:
801065b1: 6a 00 push $0x0
801065b3: 6a 5a push $0x5a
801065b5: e9 18 f8 ff ff jmp 80105dd2 <alltraps>
801065ba <vector91>:
801065ba: 6a 00 push $0x0
801065bc: 6a 5b push $0x5b
801065be: e9 0f f8 ff ff jmp 80105dd2 <alltraps>
801065c3 <vector92>:
801065c3: 6a 00 push $0x0
801065c5: 6a 5c push $0x5c
801065c7: e9 06 f8 ff ff jmp 80105dd2 <alltraps>
801065cc <vector93>:
801065cc: 6a 00 push $0x0
801065ce: 6a 5d push $0x5d
801065d0: e9 fd f7 ff ff jmp 80105dd2 <alltraps>
801065d5 <vector94>:
801065d5: 6a 00 push $0x0
801065d7: 6a 5e push $0x5e
801065d9: e9 f4 f7 ff ff jmp 80105dd2 <alltraps>
801065de <vector95>:
801065de: 6a 00 push $0x0
801065e0: 6a 5f push $0x5f
801065e2: e9 eb f7 ff ff jmp 80105dd2 <alltraps>
801065e7 <vector96>:
801065e7: 6a 00 push $0x0
801065e9: 6a 60 push $0x60
801065eb: e9 e2 f7 ff ff jmp 80105dd2 <alltraps>
801065f0 <vector97>:
801065f0: 6a 00 push $0x0
801065f2: 6a 61 push $0x61
801065f4: e9 d9 f7 ff ff jmp 80105dd2 <alltraps>
801065f9 <vector98>:
801065f9: 6a 00 push $0x0
801065fb: 6a 62 push $0x62
801065fd: e9 d0 f7 ff ff jmp 80105dd2 <alltraps>
80106602 <vector99>:
80106602: 6a 00 push $0x0
80106604: 6a 63 push $0x63
80106606: e9 c7 f7 ff ff jmp 80105dd2 <alltraps>
8010660b <vector100>:
8010660b: 6a 00 push $0x0
8010660d: 6a 64 push $0x64
8010660f: e9 be f7 ff ff jmp 80105dd2 <alltraps>
80106614 <vector101>:
80106614: 6a 00 push $0x0
80106616: 6a 65 push $0x65
80106618: e9 b5 f7 ff ff jmp 80105dd2 <alltraps>
8010661d <vector102>:
8010661d: 6a 00 push $0x0
8010661f: 6a 66 push $0x66
80106621: e9 ac f7 ff ff jmp 80105dd2 <alltraps>
80106626 <vector103>:
80106626: 6a 00 push $0x0
80106628: 6a 67 push $0x67
8010662a: e9 a3 f7 ff ff jmp 80105dd2 <alltraps>
8010662f <vector104>:
8010662f: 6a 00 push $0x0
80106631: 6a 68 push $0x68
80106633: e9 9a f7 ff ff jmp 80105dd2 <alltraps>
80106638 <vector105>:
80106638: 6a 00 push $0x0
8010663a: 6a 69 push $0x69
8010663c: e9 91 f7 ff ff jmp 80105dd2 <alltraps>
80106641 <vector106>:
80106641: 6a 00 push $0x0
80106643: 6a 6a push $0x6a
80106645: e9 88 f7 ff ff jmp 80105dd2 <alltraps>
8010664a <vector107>:
8010664a: 6a 00 push $0x0
8010664c: 6a 6b push $0x6b
8010664e: e9 7f f7 ff ff jmp 80105dd2 <alltraps>
80106653 <vector108>:
80106653: 6a 00 push $0x0
80106655: 6a 6c push $0x6c
80106657: e9 76 f7 ff ff jmp 80105dd2 <alltraps>
8010665c <vector109>:
8010665c: 6a 00 push $0x0
8010665e: 6a 6d push $0x6d
80106660: e9 6d f7 ff ff jmp 80105dd2 <alltraps>
80106665 <vector110>:
80106665: 6a 00 push $0x0
80106667: 6a 6e push $0x6e
80106669: e9 64 f7 ff ff jmp 80105dd2 <alltraps>
8010666e <vector111>:
8010666e: 6a 00 push $0x0
80106670: 6a 6f push $0x6f
80106672: e9 5b f7 ff ff jmp 80105dd2 <alltraps>
80106677 <vector112>:
80106677: 6a 00 push $0x0
80106679: 6a 70 push $0x70
8010667b: e9 52 f7 ff ff jmp 80105dd2 <alltraps>
80106680 <vector113>:
80106680: 6a 00 push $0x0
80106682: 6a 71 push $0x71
80106684: e9 49 f7 ff ff jmp 80105dd2 <alltraps>
80106689 <vector114>:
80106689: 6a 00 push $0x0
8010668b: 6a 72 push $0x72
8010668d: e9 40 f7 ff ff jmp 80105dd2 <alltraps>
80106692 <vector115>:
80106692: 6a 00 push $0x0
80106694: 6a 73 push $0x73
80106696: e9 37 f7 ff ff jmp 80105dd2 <alltraps>
8010669b <vector116>:
8010669b: 6a 00 push $0x0
8010669d: 6a 74 push $0x74
8010669f: e9 2e f7 ff ff jmp 80105dd2 <alltraps>
801066a4 <vector117>:
801066a4: 6a 00 push $0x0
801066a6: 6a 75 push $0x75
801066a8: e9 25 f7 ff ff jmp 80105dd2 <alltraps>
801066ad <vector118>:
801066ad: 6a 00 push $0x0
801066af: 6a 76 push $0x76
801066b1: e9 1c f7 ff ff jmp 80105dd2 <alltraps>
801066b6 <vector119>:
801066b6: 6a 00 push $0x0
801066b8: 6a 77 push $0x77
801066ba: e9 13 f7 ff ff jmp 80105dd2 <alltraps>
801066bf <vector120>:
801066bf: 6a 00 push $0x0
801066c1: 6a 78 push $0x78
801066c3: e9 0a f7 ff ff jmp 80105dd2 <alltraps>
801066c8 <vector121>:
801066c8: 6a 00 push $0x0
801066ca: 6a 79 push $0x79
801066cc: e9 01 f7 ff ff jmp 80105dd2 <alltraps>
801066d1 <vector122>:
801066d1: 6a 00 push $0x0
801066d3: 6a 7a push $0x7a
801066d5: e9 f8 f6 ff ff jmp 80105dd2 <alltraps>
801066da <vector123>:
801066da: 6a 00 push $0x0
801066dc: 6a 7b push $0x7b
801066de: e9 ef f6 ff ff jmp 80105dd2 <alltraps>
801066e3 <vector124>:
801066e3: 6a 00 push $0x0
801066e5: 6a 7c push $0x7c
801066e7: e9 e6 f6 ff ff jmp 80105dd2 <alltraps>
801066ec <vector125>:
801066ec: 6a 00 push $0x0
801066ee: 6a 7d push $0x7d
801066f0: e9 dd f6 ff ff jmp 80105dd2 <alltraps>
801066f5 <vector126>:
801066f5: 6a 00 push $0x0
801066f7: 6a 7e push $0x7e
801066f9: e9 d4 f6 ff ff jmp 80105dd2 <alltraps>
801066fe <vector127>:
801066fe: 6a 00 push $0x0
80106700: 6a 7f push $0x7f
80106702: e9 cb f6 ff ff jmp 80105dd2 <alltraps>
80106707 <vector128>:
80106707: 6a 00 push $0x0
80106709: 68 80 00 00 00 push $0x80
8010670e: e9 bf f6 ff ff jmp 80105dd2 <alltraps>
80106713 <vector129>:
80106713: 6a 00 push $0x0
80106715: 68 81 00 00 00 push $0x81
8010671a: e9 b3 f6 ff ff jmp 80105dd2 <alltraps>
8010671f <vector130>:
8010671f: 6a 00 push $0x0
80106721: 68 82 00 00 00 push $0x82
80106726: e9 a7 f6 ff ff jmp 80105dd2 <alltraps>
8010672b <vector131>:
8010672b: 6a 00 push $0x0
8010672d: 68 83 00 00 00 push $0x83
80106732: e9 9b f6 ff ff jmp 80105dd2 <alltraps>
80106737 <vector132>:
80106737: 6a 00 push $0x0
80106739: 68 84 00 00 00 push $0x84
8010673e: e9 8f f6 ff ff jmp 80105dd2 <alltraps>
80106743 <vector133>:
80106743: 6a 00 push $0x0
80106745: 68 85 00 00 00 push $0x85
8010674a: e9 83 f6 ff ff jmp 80105dd2 <alltraps>
8010674f <vector134>:
8010674f: 6a 00 push $0x0
80106751: 68 86 00 00 00 push $0x86
80106756: e9 77 f6 ff ff jmp 80105dd2 <alltraps>
8010675b <vector135>:
8010675b: 6a 00 push $0x0
8010675d: 68 87 00 00 00 push $0x87
80106762: e9 6b f6 ff ff jmp 80105dd2 <alltraps>
80106767 <vector136>:
80106767: 6a 00 push $0x0
80106769: 68 88 00 00 00 push $0x88
8010676e: e9 5f f6 ff ff jmp 80105dd2 <alltraps>
80106773 <vector137>:
80106773: 6a 00 push $0x0
80106775: 68 89 00 00 00 push $0x89
8010677a: e9 53 f6 ff ff jmp 80105dd2 <alltraps>
8010677f <vector138>:
8010677f: 6a 00 push $0x0
80106781: 68 8a 00 00 00 push $0x8a
80106786: e9 47 f6 ff ff jmp 80105dd2 <alltraps>
8010678b <vector139>:
8010678b: 6a 00 push $0x0
8010678d: 68 8b 00 00 00 push $0x8b
80106792: e9 3b f6 ff ff jmp 80105dd2 <alltraps>
80106797 <vector140>:
80106797: 6a 00 push $0x0
80106799: 68 8c 00 00 00 push $0x8c
8010679e: e9 2f f6 ff ff jmp 80105dd2 <alltraps>
801067a3 <vector141>:
801067a3: 6a 00 push $0x0
801067a5: 68 8d 00 00 00 push $0x8d
801067aa: e9 23 f6 ff ff jmp 80105dd2 <alltraps>
801067af <vector142>:
801067af: 6a 00 push $0x0
801067b1: 68 8e 00 00 00 push $0x8e
801067b6: e9 17 f6 ff ff jmp 80105dd2 <alltraps>
801067bb <vector143>:
801067bb: 6a 00 push $0x0
801067bd: 68 8f 00 00 00 push $0x8f
801067c2: e9 0b f6 ff ff jmp 80105dd2 <alltraps>
801067c7 <vector144>:
801067c7: 6a 00 push $0x0
801067c9: 68 90 00 00 00 push $0x90
801067ce: e9 ff f5 ff ff jmp 80105dd2 <alltraps>
801067d3 <vector145>:
801067d3: 6a 00 push $0x0
801067d5: 68 91 00 00 00 push $0x91
801067da: e9 f3 f5 ff ff jmp 80105dd2 <alltraps>
801067df <vector146>:
801067df: 6a 00 push $0x0
801067e1: 68 92 00 00 00 push $0x92
801067e6: e9 e7 f5 ff ff jmp 80105dd2 <alltraps>
801067eb <vector147>:
801067eb: 6a 00 push $0x0
801067ed: 68 93 00 00 00 push $0x93
801067f2: e9 db f5 ff ff jmp 80105dd2 <alltraps>
801067f7 <vector148>:
801067f7: 6a 00 push $0x0
801067f9: 68 94 00 00 00 push $0x94
801067fe: e9 cf f5 ff ff jmp 80105dd2 <alltraps>
80106803 <vector149>:
80106803: 6a 00 push $0x0
80106805: 68 95 00 00 00 push $0x95
8010680a: e9 c3 f5 ff ff jmp 80105dd2 <alltraps>
8010680f <vector150>:
8010680f: 6a 00 push $0x0
80106811: 68 96 00 00 00 push $0x96
80106816: e9 b7 f5 ff ff jmp 80105dd2 <alltraps>
8010681b <vector151>:
8010681b: 6a 00 push $0x0
8010681d: 68 97 00 00 00 push $0x97
80106822: e9 ab f5 ff ff jmp 80105dd2 <alltraps>
80106827 <vector152>:
80106827: 6a 00 push $0x0
80106829: 68 98 00 00 00 push $0x98
8010682e: e9 9f f5 ff ff jmp 80105dd2 <alltraps>
80106833 <vector153>:
80106833: 6a 00 push $0x0
80106835: 68 99 00 00 00 push $0x99
8010683a: e9 93 f5 ff ff jmp 80105dd2 <alltraps>
8010683f <vector154>:
8010683f: 6a 00 push $0x0
80106841: 68 9a 00 00 00 push $0x9a
80106846: e9 87 f5 ff ff jmp 80105dd2 <alltraps>
8010684b <vector155>:
8010684b: 6a 00 push $0x0
8010684d: 68 9b 00 00 00 push $0x9b
80106852: e9 7b f5 ff ff jmp 80105dd2 <alltraps>
80106857 <vector156>:
80106857: 6a 00 push $0x0
80106859: 68 9c 00 00 00 push $0x9c
8010685e: e9 6f f5 ff ff jmp 80105dd2 <alltraps>
80106863 <vector157>:
80106863: 6a 00 push $0x0
80106865: 68 9d 00 00 00 push $0x9d
8010686a: e9 63 f5 ff ff jmp 80105dd2 <alltraps>
8010686f <vector158>:
8010686f: 6a 00 push $0x0
80106871: 68 9e 00 00 00 push $0x9e
80106876: e9 57 f5 ff ff jmp 80105dd2 <alltraps>
8010687b <vector159>:
8010687b: 6a 00 push $0x0
8010687d: 68 9f 00 00 00 push $0x9f
80106882: e9 4b f5 ff ff jmp 80105dd2 <alltraps>
80106887 <vector160>:
80106887: 6a 00 push $0x0
80106889: 68 a0 00 00 00 push $0xa0
8010688e: e9 3f f5 ff ff jmp 80105dd2 <alltraps>
80106893 <vector161>:
80106893: 6a 00 push $0x0
80106895: 68 a1 00 00 00 push $0xa1
8010689a: e9 33 f5 ff ff jmp 80105dd2 <alltraps>
8010689f <vector162>:
8010689f: 6a 00 push $0x0
801068a1: 68 a2 00 00 00 push $0xa2
801068a6: e9 27 f5 ff ff jmp 80105dd2 <alltraps>
801068ab <vector163>:
801068ab: 6a 00 push $0x0
801068ad: 68 a3 00 00 00 push $0xa3
801068b2: e9 1b f5 ff ff jmp 80105dd2 <alltraps>
801068b7 <vector164>:
801068b7: 6a 00 push $0x0
801068b9: 68 a4 00 00 00 push $0xa4
801068be: e9 0f f5 ff ff jmp 80105dd2 <alltraps>
801068c3 <vector165>:
801068c3: 6a 00 push $0x0
801068c5: 68 a5 00 00 00 push $0xa5
801068ca: e9 03 f5 ff ff jmp 80105dd2 <alltraps>
801068cf <vector166>:
801068cf: 6a 00 push $0x0
801068d1: 68 a6 00 00 00 push $0xa6
801068d6: e9 f7 f4 ff ff jmp 80105dd2 <alltraps>
801068db <vector167>:
801068db: 6a 00 push $0x0
801068dd: 68 a7 00 00 00 push $0xa7
801068e2: e9 eb f4 ff ff jmp 80105dd2 <alltraps>
801068e7 <vector168>:
801068e7: 6a 00 push $0x0
801068e9: 68 a8 00 00 00 push $0xa8
801068ee: e9 df f4 ff ff jmp 80105dd2 <alltraps>
801068f3 <vector169>:
801068f3: 6a 00 push $0x0
801068f5: 68 a9 00 00 00 push $0xa9
801068fa: e9 d3 f4 ff ff jmp 80105dd2 <alltraps>
801068ff <vector170>:
801068ff: 6a 00 push $0x0
80106901: 68 aa 00 00 00 push $0xaa
80106906: e9 c7 f4 ff ff jmp 80105dd2 <alltraps>
8010690b <vector171>:
8010690b: 6a 00 push $0x0
8010690d: 68 ab 00 00 00 push $0xab
80106912: e9 bb f4 ff ff jmp 80105dd2 <alltraps>
80106917 <vector172>:
80106917: 6a 00 push $0x0
80106919: 68 ac 00 00 00 push $0xac
8010691e: e9 af f4 ff ff jmp 80105dd2 <alltraps>
80106923 <vector173>:
80106923: 6a 00 push $0x0
80106925: 68 ad 00 00 00 push $0xad
8010692a: e9 a3 f4 ff ff jmp 80105dd2 <alltraps>
8010692f <vector174>:
8010692f: 6a 00 push $0x0
80106931: 68 ae 00 00 00 push $0xae
80106936: e9 97 f4 ff ff jmp 80105dd2 <alltraps>
8010693b <vector175>:
8010693b: 6a 00 push $0x0
8010693d: 68 af 00 00 00 push $0xaf
80106942: e9 8b f4 ff ff jmp 80105dd2 <alltraps>
80106947 <vector176>:
80106947: 6a 00 push $0x0
80106949: 68 b0 00 00 00 push $0xb0
8010694e: e9 7f f4 ff ff jmp 80105dd2 <alltraps>
80106953 <vector177>:
80106953: 6a 00 push $0x0
80106955: 68 b1 00 00 00 push $0xb1
8010695a: e9 73 f4 ff ff jmp 80105dd2 <alltraps>
8010695f <vector178>:
8010695f: 6a 00 push $0x0
80106961: 68 b2 00 00 00 push $0xb2
80106966: e9 67 f4 ff ff jmp 80105dd2 <alltraps>
8010696b <vector179>:
8010696b: 6a 00 push $0x0
8010696d: 68 b3 00 00 00 push $0xb3
80106972: e9 5b f4 ff ff jmp 80105dd2 <alltraps>
80106977 <vector180>:
80106977: 6a 00 push $0x0
80106979: 68 b4 00 00 00 push $0xb4
8010697e: e9 4f f4 ff ff jmp 80105dd2 <alltraps>
80106983 <vector181>:
80106983: 6a 00 push $0x0
80106985: 68 b5 00 00 00 push $0xb5
8010698a: e9 43 f4 ff ff jmp 80105dd2 <alltraps>
8010698f <vector182>:
8010698f: 6a 00 push $0x0
80106991: 68 b6 00 00 00 push $0xb6
80106996: e9 37 f4 ff ff jmp 80105dd2 <alltraps>
8010699b <vector183>:
8010699b: 6a 00 push $0x0
8010699d: 68 b7 00 00 00 push $0xb7
801069a2: e9 2b f4 ff ff jmp 80105dd2 <alltraps>
801069a7 <vector184>:
801069a7: 6a 00 push $0x0
801069a9: 68 b8 00 00 00 push $0xb8
801069ae: e9 1f f4 ff ff jmp 80105dd2 <alltraps>
801069b3 <vector185>:
801069b3: 6a 00 push $0x0
801069b5: 68 b9 00 00 00 push $0xb9
801069ba: e9 13 f4 ff ff jmp 80105dd2 <alltraps>
801069bf <vector186>:
801069bf: 6a 00 push $0x0
801069c1: 68 ba 00 00 00 push $0xba
801069c6: e9 07 f4 ff ff jmp 80105dd2 <alltraps>
801069cb <vector187>:
801069cb: 6a 00 push $0x0
801069cd: 68 bb 00 00 00 push $0xbb
801069d2: e9 fb f3 ff ff jmp 80105dd2 <alltraps>
801069d7 <vector188>:
801069d7: 6a 00 push $0x0
801069d9: 68 bc 00 00 00 push $0xbc
801069de: e9 ef f3 ff ff jmp 80105dd2 <alltraps>
801069e3 <vector189>:
801069e3: 6a 00 push $0x0
801069e5: 68 bd 00 00 00 push $0xbd
801069ea: e9 e3 f3 ff ff jmp 80105dd2 <alltraps>
801069ef <vector190>:
801069ef: 6a 00 push $0x0
801069f1: 68 be 00 00 00 push $0xbe
801069f6: e9 d7 f3 ff ff jmp 80105dd2 <alltraps>
801069fb <vector191>:
801069fb: 6a 00 push $0x0
801069fd: 68 bf 00 00 00 push $0xbf
80106a02: e9 cb f3 ff ff jmp 80105dd2 <alltraps>
80106a07 <vector192>:
80106a07: 6a 00 push $0x0
80106a09: 68 c0 00 00 00 push $0xc0
80106a0e: e9 bf f3 ff ff jmp 80105dd2 <alltraps>
80106a13 <vector193>:
80106a13: 6a 00 push $0x0
80106a15: 68 c1 00 00 00 push $0xc1
80106a1a: e9 b3 f3 ff ff jmp 80105dd2 <alltraps>
80106a1f <vector194>:
80106a1f: 6a 00 push $0x0
80106a21: 68 c2 00 00 00 push $0xc2
80106a26: e9 a7 f3 ff ff jmp 80105dd2 <alltraps>
80106a2b <vector195>:
80106a2b: 6a 00 push $0x0
80106a2d: 68 c3 00 00 00 push $0xc3
80106a32: e9 9b f3 ff ff jmp 80105dd2 <alltraps>
80106a37 <vector196>:
80106a37: 6a 00 push $0x0
80106a39: 68 c4 00 00 00 push $0xc4
80106a3e: e9 8f f3 ff ff jmp 80105dd2 <alltraps>
80106a43 <vector197>:
80106a43: 6a 00 push $0x0
80106a45: 68 c5 00 00 00 push $0xc5
80106a4a: e9 83 f3 ff ff jmp 80105dd2 <alltraps>
80106a4f <vector198>:
80106a4f: 6a 00 push $0x0
80106a51: 68 c6 00 00 00 push $0xc6
80106a56: e9 77 f3 ff ff jmp 80105dd2 <alltraps>
80106a5b <vector199>:
80106a5b: 6a 00 push $0x0
80106a5d: 68 c7 00 00 00 push $0xc7
80106a62: e9 6b f3 ff ff jmp 80105dd2 <alltraps>
80106a67 <vector200>:
80106a67: 6a 00 push $0x0
80106a69: 68 c8 00 00 00 push $0xc8
80106a6e: e9 5f f3 ff ff jmp 80105dd2 <alltraps>
80106a73 <vector201>:
80106a73: 6a 00 push $0x0
80106a75: 68 c9 00 00 00 push $0xc9
80106a7a: e9 53 f3 ff ff jmp 80105dd2 <alltraps>
80106a7f <vector202>:
80106a7f: 6a 00 push $0x0
80106a81: 68 ca 00 00 00 push $0xca
80106a86: e9 47 f3 ff ff jmp 80105dd2 <alltraps>
80106a8b <vector203>:
80106a8b: 6a 00 push $0x0
80106a8d: 68 cb 00 00 00 push $0xcb
80106a92: e9 3b f3 ff ff jmp 80105dd2 <alltraps>
80106a97 <vector204>:
80106a97: 6a 00 push $0x0
80106a99: 68 cc 00 00 00 push $0xcc
80106a9e: e9 2f f3 ff ff jmp 80105dd2 <alltraps>
80106aa3 <vector205>:
80106aa3: 6a 00 push $0x0
80106aa5: 68 cd 00 00 00 push $0xcd
80106aaa: e9 23 f3 ff ff jmp 80105dd2 <alltraps>
80106aaf <vector206>:
80106aaf: 6a 00 push $0x0
80106ab1: 68 ce 00 00 00 push $0xce
80106ab6: e9 17 f3 ff ff jmp 80105dd2 <alltraps>
80106abb <vector207>:
80106abb: 6a 00 push $0x0
80106abd: 68 cf 00 00 00 push $0xcf
80106ac2: e9 0b f3 ff ff jmp 80105dd2 <alltraps>
80106ac7 <vector208>:
80106ac7: 6a 00 push $0x0
80106ac9: 68 d0 00 00 00 push $0xd0
80106ace: e9 ff f2 ff ff jmp 80105dd2 <alltraps>
80106ad3 <vector209>:
80106ad3: 6a 00 push $0x0
80106ad5: 68 d1 00 00 00 push $0xd1
80106ada: e9 f3 f2 ff ff jmp 80105dd2 <alltraps>
80106adf <vector210>:
80106adf: 6a 00 push $0x0
80106ae1: 68 d2 00 00 00 push $0xd2
80106ae6: e9 e7 f2 ff ff jmp 80105dd2 <alltraps>
80106aeb <vector211>:
80106aeb: 6a 00 push $0x0
80106aed: 68 d3 00 00 00 push $0xd3
80106af2: e9 db f2 ff ff jmp 80105dd2 <alltraps>
80106af7 <vector212>:
80106af7: 6a 00 push $0x0
80106af9: 68 d4 00 00 00 push $0xd4
80106afe: e9 cf f2 ff ff jmp 80105dd2 <alltraps>
80106b03 <vector213>:
80106b03: 6a 00 push $0x0
80106b05: 68 d5 00 00 00 push $0xd5
80106b0a: e9 c3 f2 ff ff jmp 80105dd2 <alltraps>
80106b0f <vector214>:
80106b0f: 6a 00 push $0x0
80106b11: 68 d6 00 00 00 push $0xd6
80106b16: e9 b7 f2 ff ff jmp 80105dd2 <alltraps>
80106b1b <vector215>:
80106b1b: 6a 00 push $0x0
80106b1d: 68 d7 00 00 00 push $0xd7
80106b22: e9 ab f2 ff ff jmp 80105dd2 <alltraps>
80106b27 <vector216>:
80106b27: 6a 00 push $0x0
80106b29: 68 d8 00 00 00 push $0xd8
80106b2e: e9 9f f2 ff ff jmp 80105dd2 <alltraps>
80106b33 <vector217>:
80106b33: 6a 00 push $0x0
80106b35: 68 d9 00 00 00 push $0xd9
80106b3a: e9 93 f2 ff ff jmp 80105dd2 <alltraps>
80106b3f <vector218>:
80106b3f: 6a 00 push $0x0
80106b41: 68 da 00 00 00 push $0xda
80106b46: e9 87 f2 ff ff jmp 80105dd2 <alltraps>
80106b4b <vector219>:
80106b4b: 6a 00 push $0x0
80106b4d: 68 db 00 00 00 push $0xdb
80106b52: e9 7b f2 ff ff jmp 80105dd2 <alltraps>
80106b57 <vector220>:
80106b57: 6a 00 push $0x0
80106b59: 68 dc 00 00 00 push $0xdc
80106b5e: e9 6f f2 ff ff jmp 80105dd2 <alltraps>
80106b63 <vector221>:
80106b63: 6a 00 push $0x0
80106b65: 68 dd 00 00 00 push $0xdd
80106b6a: e9 63 f2 ff ff jmp 80105dd2 <alltraps>
80106b6f <vector222>:
80106b6f: 6a 00 push $0x0
80106b71: 68 de 00 00 00 push $0xde
80106b76: e9 57 f2 ff ff jmp 80105dd2 <alltraps>
80106b7b <vector223>:
80106b7b: 6a 00 push $0x0
80106b7d: 68 df 00 00 00 push $0xdf
80106b82: e9 4b f2 ff ff jmp 80105dd2 <alltraps>
80106b87 <vector224>:
80106b87: 6a 00 push $0x0
80106b89: 68 e0 00 00 00 push $0xe0
80106b8e: e9 3f f2 ff ff jmp 80105dd2 <alltraps>
80106b93 <vector225>:
80106b93: 6a 00 push $0x0
80106b95: 68 e1 00 00 00 push $0xe1
80106b9a: e9 33 f2 ff ff jmp 80105dd2 <alltraps>
80106b9f <vector226>:
80106b9f: 6a 00 push $0x0
80106ba1: 68 e2 00 00 00 push $0xe2
80106ba6: e9 27 f2 ff ff jmp 80105dd2 <alltraps>
80106bab <vector227>:
80106bab: 6a 00 push $0x0
80106bad: 68 e3 00 00 00 push $0xe3
80106bb2: e9 1b f2 ff ff jmp 80105dd2 <alltraps>
80106bb7 <vector228>:
80106bb7: 6a 00 push $0x0
80106bb9: 68 e4 00 00 00 push $0xe4
80106bbe: e9 0f f2 ff ff jmp 80105dd2 <alltraps>
80106bc3 <vector229>:
80106bc3: 6a 00 push $0x0
80106bc5: 68 e5 00 00 00 push $0xe5
80106bca: e9 03 f2 ff ff jmp 80105dd2 <alltraps>
80106bcf <vector230>:
80106bcf: 6a 00 push $0x0
80106bd1: 68 e6 00 00 00 push $0xe6
80106bd6: e9 f7 f1 ff ff jmp 80105dd2 <alltraps>
80106bdb <vector231>:
80106bdb: 6a 00 push $0x0
80106bdd: 68 e7 00 00 00 push $0xe7
80106be2: e9 eb f1 ff ff jmp 80105dd2 <alltraps>
80106be7 <vector232>:
80106be7: 6a 00 push $0x0
80106be9: 68 e8 00 00 00 push $0xe8
80106bee: e9 df f1 ff ff jmp 80105dd2 <alltraps>
80106bf3 <vector233>:
80106bf3: 6a 00 push $0x0
80106bf5: 68 e9 00 00 00 push $0xe9
80106bfa: e9 d3 f1 ff ff jmp 80105dd2 <alltraps>
80106bff <vector234>:
80106bff: 6a 00 push $0x0
80106c01: 68 ea 00 00 00 push $0xea
80106c06: e9 c7 f1 ff ff jmp 80105dd2 <alltraps>
80106c0b <vector235>:
80106c0b: 6a 00 push $0x0
80106c0d: 68 eb 00 00 00 push $0xeb
80106c12: e9 bb f1 ff ff jmp 80105dd2 <alltraps>
80106c17 <vector236>:
80106c17: 6a 00 push $0x0
80106c19: 68 ec 00 00 00 push $0xec
80106c1e: e9 af f1 ff ff jmp 80105dd2 <alltraps>
80106c23 <vector237>:
80106c23: 6a 00 push $0x0
80106c25: 68 ed 00 00 00 push $0xed
80106c2a: e9 a3 f1 ff ff jmp 80105dd2 <alltraps>
80106c2f <vector238>:
80106c2f: 6a 00 push $0x0
80106c31: 68 ee 00 00 00 push $0xee
80106c36: e9 97 f1 ff ff jmp 80105dd2 <alltraps>
80106c3b <vector239>:
80106c3b: 6a 00 push $0x0
80106c3d: 68 ef 00 00 00 push $0xef
80106c42: e9 8b f1 ff ff jmp 80105dd2 <alltraps>
80106c47 <vector240>:
80106c47: 6a 00 push $0x0
80106c49: 68 f0 00 00 00 push $0xf0
80106c4e: e9 7f f1 ff ff jmp 80105dd2 <alltraps>
80106c53 <vector241>:
80106c53: 6a 00 push $0x0
80106c55: 68 f1 00 00 00 push $0xf1
80106c5a: e9 73 f1 ff ff jmp 80105dd2 <alltraps>
80106c5f <vector242>:
80106c5f: 6a 00 push $0x0
80106c61: 68 f2 00 00 00 push $0xf2
80106c66: e9 67 f1 ff ff jmp 80105dd2 <alltraps>
80106c6b <vector243>:
80106c6b: 6a 00 push $0x0
80106c6d: 68 f3 00 00 00 push $0xf3
80106c72: e9 5b f1 ff ff jmp 80105dd2 <alltraps>
80106c77 <vector244>:
80106c77: 6a 00 push $0x0
80106c79: 68 f4 00 00 00 push $0xf4
80106c7e: e9 4f f1 ff ff jmp 80105dd2 <alltraps>
80106c83 <vector245>:
80106c83: 6a 00 push $0x0
80106c85: 68 f5 00 00 00 push $0xf5
80106c8a: e9 43 f1 ff ff jmp 80105dd2 <alltraps>
80106c8f <vector246>:
80106c8f: 6a 00 push $0x0
80106c91: 68 f6 00 00 00 push $0xf6
80106c96: e9 37 f1 ff ff jmp 80105dd2 <alltraps>
80106c9b <vector247>:
80106c9b: 6a 00 push $0x0
80106c9d: 68 f7 00 00 00 push $0xf7
80106ca2: e9 2b f1 ff ff jmp 80105dd2 <alltraps>
80106ca7 <vector248>:
80106ca7: 6a 00 push $0x0
80106ca9: 68 f8 00 00 00 push $0xf8
80106cae: e9 1f f1 ff ff jmp 80105dd2 <alltraps>
80106cb3 <vector249>:
80106cb3: 6a 00 push $0x0
80106cb5: 68 f9 00 00 00 push $0xf9
80106cba: e9 13 f1 ff ff jmp 80105dd2 <alltraps>
80106cbf <vector250>:
80106cbf: 6a 00 push $0x0
80106cc1: 68 fa 00 00 00 push $0xfa
80106cc6: e9 07 f1 ff ff jmp 80105dd2 <alltraps>
80106ccb <vector251>:
80106ccb: 6a 00 push $0x0
80106ccd: 68 fb 00 00 00 push $0xfb
80106cd2: e9 fb f0 ff ff jmp 80105dd2 <alltraps>
80106cd7 <vector252>:
80106cd7: 6a 00 push $0x0
80106cd9: 68 fc 00 00 00 push $0xfc
80106cde: e9 ef f0 ff ff jmp 80105dd2 <alltraps>
80106ce3 <vector253>:
80106ce3: 6a 00 push $0x0
80106ce5: 68 fd 00 00 00 push $0xfd
80106cea: e9 e3 f0 ff ff jmp 80105dd2 <alltraps>
80106cef <vector254>:
80106cef: 6a 00 push $0x0
80106cf1: 68 fe 00 00 00 push $0xfe
80106cf6: e9 d7 f0 ff ff jmp 80105dd2 <alltraps>
80106cfb <vector255>:
80106cfb: 6a 00 push $0x0
80106cfd: 68 ff 00 00 00 push $0xff
80106d02: e9 cb f0 ff ff jmp 80105dd2 <alltraps>
80106d07: 66 90 xchg %ax,%ax
80106d09: 66 90 xchg %ax,%ax
80106d0b: 66 90 xchg %ax,%ax
80106d0d: 66 90 xchg %ax,%ax
80106d0f: 90 nop
80106d10 <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)
{
80106d10: 55 push %ebp
80106d11: 89 e5 mov %esp,%ebp
80106d13: 57 push %edi
80106d14: 56 push %esi
80106d15: 53 push %ebx
80106d16: 89 d3 mov %edx,%ebx
pde_t *pde;
pte_t *pgtab;
pde = &pgdir[PDX(va)];
80106d18: c1 ea 16 shr $0x16,%edx
80106d1b: 8d 3c 90 lea (%eax,%edx,4),%edi
// 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)
{
80106d1e: 83 ec 0c sub $0xc,%esp
pde_t *pde;
pte_t *pgtab;
pde = &pgdir[PDX(va)];
if(*pde & PTE_P){
80106d21: 8b 07 mov (%edi),%eax
80106d23: a8 01 test $0x1,%al
80106d25: 74 29 je 80106d50 <walkpgdir+0x40>
pgtab = (pte_t*)P2V(PTE_ADDR(*pde));
80106d27: 25 00 f0 ff ff and $0xfffff000,%eax
80106d2c: 8d b0 00 00 00 80 lea -0x80000000(%eax),%esi
// 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)];
}
80106d32: 8d 65 f4 lea -0xc(%ebp),%esp
// 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)];
80106d35: c1 eb 0a shr $0xa,%ebx
80106d38: 81 e3 fc 0f 00 00 and $0xffc,%ebx
80106d3e: 8d 04 1e lea (%esi,%ebx,1),%eax
}
80106d41: 5b pop %ebx
80106d42: 5e pop %esi
80106d43: 5f pop %edi
80106d44: 5d pop %ebp
80106d45: c3 ret
80106d46: 8d 76 00 lea 0x0(%esi),%esi
80106d49: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
pde = &pgdir[PDX(va)];
if(*pde & PTE_P){
pgtab = (pte_t*)P2V(PTE_ADDR(*pde));
} else {
if(!alloc || (pgtab = (pte_t*)kalloc()) == 0)
80106d50: 85 c9 test %ecx,%ecx
80106d52: 74 2c je 80106d80 <walkpgdir+0x70>
80106d54: e8 67 ba ff ff call 801027c0 <kalloc>
80106d59: 85 c0 test %eax,%eax
80106d5b: 89 c6 mov %eax,%esi
80106d5d: 74 21 je 80106d80 <walkpgdir+0x70>
return 0;
// Make sure all those PTE_P bits are zero.
memset(pgtab, 0, PGSIZE);
80106d5f: 83 ec 04 sub $0x4,%esp
80106d62: 68 00 10 00 00 push $0x1000
80106d67: 6a 00 push $0x0
80106d69: 50 push %eax
80106d6a: e8 b1 dd ff ff call 80104b20 <memset>
// 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;
80106d6f: 8d 86 00 00 00 80 lea -0x80000000(%esi),%eax
80106d75: 83 c4 10 add $0x10,%esp
80106d78: 83 c8 07 or $0x7,%eax
80106d7b: 89 07 mov %eax,(%edi)
80106d7d: eb b3 jmp 80106d32 <walkpgdir+0x22>
80106d7f: 90 nop
}
return &pgtab[PTX(va)];
}
80106d80: 8d 65 f4 lea -0xc(%ebp),%esp
pde = &pgdir[PDX(va)];
if(*pde & PTE_P){
pgtab = (pte_t*)P2V(PTE_ADDR(*pde));
} else {
if(!alloc || (pgtab = (pte_t*)kalloc()) == 0)
return 0;
80106d83: 31 c0 xor %eax,%eax
// 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)];
}
80106d85: 5b pop %ebx
80106d86: 5e pop %esi
80106d87: 5f pop %edi
80106d88: 5d pop %ebp
80106d89: c3 ret
80106d8a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80106d90 <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)
{
80106d90: 55 push %ebp
80106d91: 89 e5 mov %esp,%ebp
80106d93: 57 push %edi
80106d94: 56 push %esi
80106d95: 53 push %ebx
char *a, *last;
pte_t *pte;
a = (char*)PGROUNDDOWN((uint)va);
80106d96: 89 d3 mov %edx,%ebx
80106d98: 81 e3 00 f0 ff ff and $0xfffff000,%ebx
// 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)
{
80106d9e: 83 ec 1c sub $0x1c,%esp
80106da1: 89 45 e4 mov %eax,-0x1c(%ebp)
char *a, *last;
pte_t *pte;
a = (char*)PGROUNDDOWN((uint)va);
last = (char*)PGROUNDDOWN(((uint)va) + size - 1);
80106da4: 8d 44 0a ff lea -0x1(%edx,%ecx,1),%eax
80106da8: 8b 7d 08 mov 0x8(%ebp),%edi
80106dab: 25 00 f0 ff ff and $0xfffff000,%eax
80106db0: 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;
80106db3: 8b 45 0c mov 0xc(%ebp),%eax
80106db6: 29 df sub %ebx,%edi
80106db8: 83 c8 01 or $0x1,%eax
80106dbb: 89 45 dc mov %eax,-0x24(%ebp)
80106dbe: eb 15 jmp 80106dd5 <mappages+0x45>
a = (char*)PGROUNDDOWN((uint)va);
last = (char*)PGROUNDDOWN(((uint)va) + size - 1);
for(;;){
if((pte = walkpgdir(pgdir, a, 1)) == 0)
return -1;
if(*pte & PTE_P)
80106dc0: f6 00 01 testb $0x1,(%eax)
80106dc3: 75 45 jne 80106e0a <mappages+0x7a>
panic("remap");
*pte = pa | perm | PTE_P;
80106dc5: 0b 75 dc or -0x24(%ebp),%esi
if(a == last)
80106dc8: 3b 5d e0 cmp -0x20(%ebp),%ebx
for(;;){
if((pte = walkpgdir(pgdir, a, 1)) == 0)
return -1;
if(*pte & PTE_P)
panic("remap");
*pte = pa | perm | PTE_P;
80106dcb: 89 30 mov %esi,(%eax)
if(a == last)
80106dcd: 74 31 je 80106e00 <mappages+0x70>
break;
a += PGSIZE;
80106dcf: 81 c3 00 10 00 00 add $0x1000,%ebx
pte_t *pte;
a = (char*)PGROUNDDOWN((uint)va);
last = (char*)PGROUNDDOWN(((uint)va) + size - 1);
for(;;){
if((pte = walkpgdir(pgdir, a, 1)) == 0)
80106dd5: 8b 45 e4 mov -0x1c(%ebp),%eax
80106dd8: b9 01 00 00 00 mov $0x1,%ecx
80106ddd: 89 da mov %ebx,%edx
80106ddf: 8d 34 3b lea (%ebx,%edi,1),%esi
80106de2: e8 29 ff ff ff call 80106d10 <walkpgdir>
80106de7: 85 c0 test %eax,%eax
80106de9: 75 d5 jne 80106dc0 <mappages+0x30>
break;
a += PGSIZE;
pa += PGSIZE;
}
return 0;
}
80106deb: 8d 65 f4 lea -0xc(%ebp),%esp
a = (char*)PGROUNDDOWN((uint)va);
last = (char*)PGROUNDDOWN(((uint)va) + size - 1);
for(;;){
if((pte = walkpgdir(pgdir, a, 1)) == 0)
return -1;
80106dee: b8 ff ff ff ff mov $0xffffffff,%eax
break;
a += PGSIZE;
pa += PGSIZE;
}
return 0;
}
80106df3: 5b pop %ebx
80106df4: 5e pop %esi
80106df5: 5f pop %edi
80106df6: 5d pop %ebp
80106df7: c3 ret
80106df8: 90 nop
80106df9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80106e00: 8d 65 f4 lea -0xc(%ebp),%esp
if(a == last)
break;
a += PGSIZE;
pa += PGSIZE;
}
return 0;
80106e03: 31 c0 xor %eax,%eax
}
80106e05: 5b pop %ebx
80106e06: 5e pop %esi
80106e07: 5f pop %edi
80106e08: 5d pop %ebp
80106e09: c3 ret
last = (char*)PGROUNDDOWN(((uint)va) + size - 1);
for(;;){
if((pte = walkpgdir(pgdir, a, 1)) == 0)
return -1;
if(*pte & PTE_P)
panic("remap");
80106e0a: 83 ec 0c sub $0xc,%esp
80106e0d: 68 a4 80 10 80 push $0x801080a4
80106e12: e8 59 95 ff ff call 80100370 <panic>
80106e17: 89 f6 mov %esi,%esi
80106e19: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80106e20 <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)
80106e20: 55 push %ebp
80106e21: 89 e5 mov %esp,%ebp
80106e23: 57 push %edi
80106e24: 56 push %esi
80106e25: 53 push %ebx
uint a, pa;
if(newsz >= oldsz)
return oldsz;
a = PGROUNDUP(newsz);
80106e26: 8d 99 ff 0f 00 00 lea 0xfff(%ecx),%ebx
// 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)
80106e2c: 89 c7 mov %eax,%edi
uint a, pa;
if(newsz >= oldsz)
return oldsz;
a = PGROUNDUP(newsz);
80106e2e: 81 e3 00 f0 ff ff and $0xfffff000,%ebx
// 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)
80106e34: 83 ec 1c sub $0x1c,%esp
80106e37: 89 4d e0 mov %ecx,-0x20(%ebp)
if(newsz >= oldsz)
return oldsz;
a = PGROUNDUP(newsz);
for(; a < oldsz; a += PGSIZE){
80106e3a: 39 d3 cmp %edx,%ebx
80106e3c: 73 66 jae 80106ea4 <deallocuvm.part.0+0x84>
80106e3e: 89 d6 mov %edx,%esi
80106e40: eb 3d jmp 80106e7f <deallocuvm.part.0+0x5f>
80106e42: 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){
80106e48: 8b 10 mov (%eax),%edx
80106e4a: f6 c2 01 test $0x1,%dl
80106e4d: 74 26 je 80106e75 <deallocuvm.part.0+0x55>
pa = PTE_ADDR(*pte);
if(pa == 0)
80106e4f: 81 e2 00 f0 ff ff and $0xfffff000,%edx
80106e55: 74 58 je 80106eaf <deallocuvm.part.0+0x8f>
panic("kfree");
char *v = P2V(pa);
kfree(v);
80106e57: 83 ec 0c sub $0xc,%esp
80106e5a: 81 c2 00 00 00 80 add $0x80000000,%edx
80106e60: 89 45 e4 mov %eax,-0x1c(%ebp)
80106e63: 52 push %edx
80106e64: e8 a7 b7 ff ff call 80102610 <kfree>
*pte = 0;
80106e69: 8b 45 e4 mov -0x1c(%ebp),%eax
80106e6c: 83 c4 10 add $0x10,%esp
80106e6f: c7 00 00 00 00 00 movl $0x0,(%eax)
if(newsz >= oldsz)
return oldsz;
a = PGROUNDUP(newsz);
for(; a < oldsz; a += PGSIZE){
80106e75: 81 c3 00 10 00 00 add $0x1000,%ebx
80106e7b: 39 f3 cmp %esi,%ebx
80106e7d: 73 25 jae 80106ea4 <deallocuvm.part.0+0x84>
pte = walkpgdir(pgdir, (char*)a, 0);
80106e7f: 31 c9 xor %ecx,%ecx
80106e81: 89 da mov %ebx,%edx
80106e83: 89 f8 mov %edi,%eax
80106e85: e8 86 fe ff ff call 80106d10 <walkpgdir>
if(!pte)
80106e8a: 85 c0 test %eax,%eax
80106e8c: 75 ba jne 80106e48 <deallocuvm.part.0+0x28>
a = PGADDR(PDX(a) + 1, 0, 0) - PGSIZE;
80106e8e: 81 e3 00 00 c0 ff and $0xffc00000,%ebx
80106e94: 81 c3 00 f0 3f 00 add $0x3ff000,%ebx
if(newsz >= oldsz)
return oldsz;
a = PGROUNDUP(newsz);
for(; a < oldsz; a += PGSIZE){
80106e9a: 81 c3 00 10 00 00 add $0x1000,%ebx
80106ea0: 39 f3 cmp %esi,%ebx
80106ea2: 72 db jb 80106e7f <deallocuvm.part.0+0x5f>
kfree(v);
*pte = 0;
}
}
return newsz;
}
80106ea4: 8b 45 e0 mov -0x20(%ebp),%eax
80106ea7: 8d 65 f4 lea -0xc(%ebp),%esp
80106eaa: 5b pop %ebx
80106eab: 5e pop %esi
80106eac: 5f pop %edi
80106ead: 5d pop %ebp
80106eae: c3 ret
if(!pte)
a = PGADDR(PDX(a) + 1, 0, 0) - PGSIZE;
else if((*pte & PTE_P) != 0){
pa = PTE_ADDR(*pte);
if(pa == 0)
panic("kfree");
80106eaf: 83 ec 0c sub $0xc,%esp
80106eb2: 68 06 79 10 80 push $0x80107906
80106eb7: e8 b4 94 ff ff call 80100370 <panic>
80106ebc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80106ec0 <seginit>:
// Set up CPU's kernel segment descriptors.
// Run once on entry on each CPU.
void
seginit(void)
{
80106ec0: 55 push %ebp
80106ec1: 89 e5 mov %esp,%ebp
80106ec3: 83 ec 18 sub $0x18,%esp
// Map "logical" addresses to virtual addresses using identity map.
// Cannot share a CODE descriptor for both kernel and user
// because it would have to have DPL_USR, but the CPU forbids
// an interrupt from CPL=0 to DPL=3.
c = &cpus[cpuid()];
80106ec6: e8 d5 cb ff ff call 80103aa0 <cpuid>
c->gdt[SEG_KCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, 0);
80106ecb: 69 c0 b0 00 00 00 imul $0xb0,%eax,%eax
80106ed1: 31 c9 xor %ecx,%ecx
80106ed3: ba ff ff ff ff mov $0xffffffff,%edx
80106ed8: 66 89 90 b8 3a 11 80 mov %dx,-0x7feec548(%eax)
80106edf: 66 89 88 ba 3a 11 80 mov %cx,-0x7feec546(%eax)
c->gdt[SEG_KDATA] = SEG(STA_W, 0, 0xffffffff, 0);
80106ee6: ba ff ff ff ff mov $0xffffffff,%edx
80106eeb: 31 c9 xor %ecx,%ecx
80106eed: 66 89 90 c0 3a 11 80 mov %dx,-0x7feec540(%eax)
c->gdt[SEG_UCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, DPL_USER);
80106ef4: ba ff ff ff ff mov $0xffffffff,%edx
// Cannot share a CODE descriptor for both kernel and user
// because it would have to have DPL_USR, but the CPU forbids
// an interrupt from CPL=0 to DPL=3.
c = &cpus[cpuid()];
c->gdt[SEG_KCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, 0);
c->gdt[SEG_KDATA] = SEG(STA_W, 0, 0xffffffff, 0);
80106ef9: 66 89 88 c2 3a 11 80 mov %cx,-0x7feec53e(%eax)
c->gdt[SEG_UCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, DPL_USER);
80106f00: 31 c9 xor %ecx,%ecx
80106f02: 66 89 90 c8 3a 11 80 mov %dx,-0x7feec538(%eax)
80106f09: 66 89 88 ca 3a 11 80 mov %cx,-0x7feec536(%eax)
c->gdt[SEG_UDATA] = SEG(STA_W, 0, 0xffffffff, DPL_USER);
80106f10: ba ff ff ff ff mov $0xffffffff,%edx
80106f15: 31 c9 xor %ecx,%ecx
80106f17: 66 89 90 d0 3a 11 80 mov %dx,-0x7feec530(%eax)
// Map "logical" addresses to virtual addresses using identity map.
// Cannot share a CODE descriptor for both kernel and user
// because it would have to have DPL_USR, but the CPU forbids
// an interrupt from CPL=0 to DPL=3.
c = &cpus[cpuid()];
c->gdt[SEG_KCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, 0);
80106f1e: c6 80 bc 3a 11 80 00 movb $0x0,-0x7feec544(%eax)
static inline void
lgdt(struct segdesc *p, int size)
{
volatile ushort pd[3];
pd[0] = size-1;
80106f25: ba 2f 00 00 00 mov $0x2f,%edx
80106f2a: c6 80 bd 3a 11 80 9a movb $0x9a,-0x7feec543(%eax)
80106f31: c6 80 be 3a 11 80 cf movb $0xcf,-0x7feec542(%eax)
80106f38: c6 80 bf 3a 11 80 00 movb $0x0,-0x7feec541(%eax)
c->gdt[SEG_KDATA] = SEG(STA_W, 0, 0xffffffff, 0);
80106f3f: c6 80 c4 3a 11 80 00 movb $0x0,-0x7feec53c(%eax)
80106f46: c6 80 c5 3a 11 80 92 movb $0x92,-0x7feec53b(%eax)
80106f4d: c6 80 c6 3a 11 80 cf movb $0xcf,-0x7feec53a(%eax)
80106f54: c6 80 c7 3a 11 80 00 movb $0x0,-0x7feec539(%eax)
c->gdt[SEG_UCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, DPL_USER);
80106f5b: c6 80 cc 3a 11 80 00 movb $0x0,-0x7feec534(%eax)
80106f62: c6 80 cd 3a 11 80 fa movb $0xfa,-0x7feec533(%eax)
80106f69: c6 80 ce 3a 11 80 cf movb $0xcf,-0x7feec532(%eax)
80106f70: c6 80 cf 3a 11 80 00 movb $0x0,-0x7feec531(%eax)
c->gdt[SEG_UDATA] = SEG(STA_W, 0, 0xffffffff, DPL_USER);
80106f77: 66 89 88 d2 3a 11 80 mov %cx,-0x7feec52e(%eax)
80106f7e: c6 80 d4 3a 11 80 00 movb $0x0,-0x7feec52c(%eax)
80106f85: c6 80 d5 3a 11 80 f2 movb $0xf2,-0x7feec52b(%eax)
80106f8c: c6 80 d6 3a 11 80 cf movb $0xcf,-0x7feec52a(%eax)
80106f93: c6 80 d7 3a 11 80 00 movb $0x0,-0x7feec529(%eax)
lgdt(c->gdt, sizeof(c->gdt));
80106f9a: 05 b0 3a 11 80 add $0x80113ab0,%eax
80106f9f: 66 89 55 f2 mov %dx,-0xe(%ebp)
pd[1] = (uint)p;
80106fa3: 66 89 45 f4 mov %ax,-0xc(%ebp)
pd[2] = (uint)p >> 16;
80106fa7: c1 e8 10 shr $0x10,%eax
80106faa: 66 89 45 f6 mov %ax,-0xa(%ebp)
asm volatile("lgdt (%0)" : : "r" (pd));
80106fae: 8d 45 f2 lea -0xe(%ebp),%eax
80106fb1: 0f 01 10 lgdtl (%eax)
}
80106fb4: c9 leave
80106fb5: c3 ret
80106fb6: 8d 76 00 lea 0x0(%esi),%esi
80106fb9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80106fc0 <switchkvm>:
}
static inline void
lcr3(uint val)
{
asm volatile("movl %0,%%cr3" : : "r" (val));
80106fc0: a1 64 69 11 80 mov 0x80116964,%eax
// Switch h/w page table register to the kernel-only page table,
// for when no process is running.
void
switchkvm(void)
{
80106fc5: 55 push %ebp
80106fc6: 89 e5 mov %esp,%ebp
80106fc8: 05 00 00 00 80 add $0x80000000,%eax
80106fcd: 0f 22 d8 mov %eax,%cr3
lcr3(V2P(kpgdir)); // switch to the kernel page table
}
80106fd0: 5d pop %ebp
80106fd1: c3 ret
80106fd2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80106fd9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80106fe0 <switchuvm>:
// Switch TSS and h/w page table to correspond to process p.
void
switchuvm(struct proc *p)
{
80106fe0: 55 push %ebp
80106fe1: 89 e5 mov %esp,%ebp
80106fe3: 57 push %edi
80106fe4: 56 push %esi
80106fe5: 53 push %ebx
80106fe6: 83 ec 1c sub $0x1c,%esp
80106fe9: 8b 75 08 mov 0x8(%ebp),%esi
if(p == 0)
80106fec: 85 f6 test %esi,%esi
80106fee: 0f 84 cd 00 00 00 je 801070c1 <switchuvm+0xe1>
panic("switchuvm: no process");
if(p->kstack == 0)
80106ff4: 8b 46 08 mov 0x8(%esi),%eax
80106ff7: 85 c0 test %eax,%eax
80106ff9: 0f 84 dc 00 00 00 je 801070db <switchuvm+0xfb>
panic("switchuvm: no kstack");
if(p->pgdir == 0)
80106fff: 8b 7e 04 mov 0x4(%esi),%edi
80107002: 85 ff test %edi,%edi
80107004: 0f 84 c4 00 00 00 je 801070ce <switchuvm+0xee>
panic("switchuvm: no pgdir");
pushcli();
8010700a: e8 31 d9 ff ff call 80104940 <pushcli>
mycpu()->gdt[SEG_TSS] = SEG16(STS_T32A, &mycpu()->ts,
8010700f: e8 0c ca ff ff call 80103a20 <mycpu>
80107014: 89 c3 mov %eax,%ebx
80107016: e8 05 ca ff ff call 80103a20 <mycpu>
8010701b: 89 c7 mov %eax,%edi
8010701d: e8 fe c9 ff ff call 80103a20 <mycpu>
80107022: 89 45 e4 mov %eax,-0x1c(%ebp)
80107025: 83 c7 08 add $0x8,%edi
80107028: e8 f3 c9 ff ff call 80103a20 <mycpu>
8010702d: 8b 4d e4 mov -0x1c(%ebp),%ecx
80107030: 83 c0 08 add $0x8,%eax
80107033: ba 67 00 00 00 mov $0x67,%edx
80107038: c1 e8 18 shr $0x18,%eax
8010703b: 66 89 93 98 00 00 00 mov %dx,0x98(%ebx)
80107042: 66 89 bb 9a 00 00 00 mov %di,0x9a(%ebx)
80107049: c6 83 9d 00 00 00 99 movb $0x99,0x9d(%ebx)
80107050: c6 83 9e 00 00 00 40 movb $0x40,0x9e(%ebx)
80107057: 83 c1 08 add $0x8,%ecx
8010705a: 88 83 9f 00 00 00 mov %al,0x9f(%ebx)
80107060: c1 e9 10 shr $0x10,%ecx
80107063: 88 8b 9c 00 00 00 mov %cl,0x9c(%ebx)
mycpu()->gdt[SEG_TSS].s = 0;
mycpu()->ts.ss0 = SEG_KDATA << 3;
mycpu()->ts.esp0 = (uint)p->kstack + KSTACKSIZE;
// setting IOPL=0 in eflags *and* iomb beyond the tss segment limit
// forbids I/O instructions (e.g., inb and outb) from user space
mycpu()->ts.iomb = (ushort) 0xFFFF;
80107069: bb ff ff ff ff mov $0xffffffff,%ebx
panic("switchuvm: no pgdir");
pushcli();
mycpu()->gdt[SEG_TSS] = SEG16(STS_T32A, &mycpu()->ts,
sizeof(mycpu()->ts)-1, 0);
mycpu()->gdt[SEG_TSS].s = 0;
8010706e: e8 ad c9 ff ff call 80103a20 <mycpu>
80107073: 80 a0 9d 00 00 00 ef andb $0xef,0x9d(%eax)
mycpu()->ts.ss0 = SEG_KDATA << 3;
8010707a: e8 a1 c9 ff ff call 80103a20 <mycpu>
8010707f: b9 10 00 00 00 mov $0x10,%ecx
80107084: 66 89 48 10 mov %cx,0x10(%eax)
mycpu()->ts.esp0 = (uint)p->kstack + KSTACKSIZE;
80107088: e8 93 c9 ff ff call 80103a20 <mycpu>
8010708d: 8b 56 08 mov 0x8(%esi),%edx
80107090: 8d 8a 00 10 00 00 lea 0x1000(%edx),%ecx
80107096: 89 48 0c mov %ecx,0xc(%eax)
// setting IOPL=0 in eflags *and* iomb beyond the tss segment limit
// forbids I/O instructions (e.g., inb and outb) from user space
mycpu()->ts.iomb = (ushort) 0xFFFF;
80107099: e8 82 c9 ff ff call 80103a20 <mycpu>
8010709e: 66 89 58 6e mov %bx,0x6e(%eax)
}
static inline void
ltr(ushort sel)
{
asm volatile("ltr %0" : : "r" (sel));
801070a2: b8 28 00 00 00 mov $0x28,%eax
801070a7: 0f 00 d8 ltr %ax
}
static inline void
lcr3(uint val)
{
asm volatile("movl %0,%%cr3" : : "r" (val));
801070aa: 8b 46 04 mov 0x4(%esi),%eax
801070ad: 05 00 00 00 80 add $0x80000000,%eax
801070b2: 0f 22 d8 mov %eax,%cr3
ltr(SEG_TSS << 3);
lcr3(V2P(p->pgdir)); // switch to process's address space
popcli();
}
801070b5: 8d 65 f4 lea -0xc(%ebp),%esp
801070b8: 5b pop %ebx
801070b9: 5e pop %esi
801070ba: 5f pop %edi
801070bb: 5d pop %ebp
// setting IOPL=0 in eflags *and* iomb beyond the tss segment limit
// forbids I/O instructions (e.g., inb and outb) from user space
mycpu()->ts.iomb = (ushort) 0xFFFF;
ltr(SEG_TSS << 3);
lcr3(V2P(p->pgdir)); // switch to process's address space
popcli();
801070bc: e9 bf d8 ff ff jmp 80104980 <popcli>
// Switch TSS and h/w page table to correspond to process p.
void
switchuvm(struct proc *p)
{
if(p == 0)
panic("switchuvm: no process");
801070c1: 83 ec 0c sub $0xc,%esp
801070c4: 68 aa 80 10 80 push $0x801080aa
801070c9: e8 a2 92 ff ff call 80100370 <panic>
if(p->kstack == 0)
panic("switchuvm: no kstack");
if(p->pgdir == 0)
panic("switchuvm: no pgdir");
801070ce: 83 ec 0c sub $0xc,%esp
801070d1: 68 d5 80 10 80 push $0x801080d5
801070d6: e8 95 92 ff ff call 80100370 <panic>
switchuvm(struct proc *p)
{
if(p == 0)
panic("switchuvm: no process");
if(p->kstack == 0)
panic("switchuvm: no kstack");
801070db: 83 ec 0c sub $0xc,%esp
801070de: 68 c0 80 10 80 push $0x801080c0
801070e3: e8 88 92 ff ff call 80100370 <panic>
801070e8: 90 nop
801070e9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
801070f0 <inituvm>:
// Load the initcode into address 0 of pgdir.
// sz must be less than a page.
void
inituvm(pde_t *pgdir, char *init, uint sz)
{
801070f0: 55 push %ebp
801070f1: 89 e5 mov %esp,%ebp
801070f3: 57 push %edi
801070f4: 56 push %esi
801070f5: 53 push %ebx
801070f6: 83 ec 1c sub $0x1c,%esp
801070f9: 8b 75 10 mov 0x10(%ebp),%esi
801070fc: 8b 45 08 mov 0x8(%ebp),%eax
801070ff: 8b 7d 0c mov 0xc(%ebp),%edi
char *mem;
if(sz >= PGSIZE)
80107102: 81 fe ff 0f 00 00 cmp $0xfff,%esi
// Load the initcode into address 0 of pgdir.
// sz must be less than a page.
void
inituvm(pde_t *pgdir, char *init, uint sz)
{
80107108: 89 45 e4 mov %eax,-0x1c(%ebp)
char *mem;
if(sz >= PGSIZE)
8010710b: 77 49 ja 80107156 <inituvm+0x66>
panic("inituvm: more than a page");
mem = kalloc();
8010710d: e8 ae b6 ff ff call 801027c0 <kalloc>
memset(mem, 0, PGSIZE);
80107112: 83 ec 04 sub $0x4,%esp
{
char *mem;
if(sz >= PGSIZE)
panic("inituvm: more than a page");
mem = kalloc();
80107115: 89 c3 mov %eax,%ebx
memset(mem, 0, PGSIZE);
80107117: 68 00 10 00 00 push $0x1000
8010711c: 6a 00 push $0x0
8010711e: 50 push %eax
8010711f: e8 fc d9 ff ff call 80104b20 <memset>
mappages(pgdir, 0, PGSIZE, V2P(mem), PTE_W|PTE_U);
80107124: 58 pop %eax
80107125: 8d 83 00 00 00 80 lea -0x80000000(%ebx),%eax
8010712b: b9 00 10 00 00 mov $0x1000,%ecx
80107130: 5a pop %edx
80107131: 6a 06 push $0x6
80107133: 50 push %eax
80107134: 31 d2 xor %edx,%edx
80107136: 8b 45 e4 mov -0x1c(%ebp),%eax
80107139: e8 52 fc ff ff call 80106d90 <mappages>
memmove(mem, init, sz);
8010713e: 89 75 10 mov %esi,0x10(%ebp)
80107141: 89 7d 0c mov %edi,0xc(%ebp)
80107144: 83 c4 10 add $0x10,%esp
80107147: 89 5d 08 mov %ebx,0x8(%ebp)
}
8010714a: 8d 65 f4 lea -0xc(%ebp),%esp
8010714d: 5b pop %ebx
8010714e: 5e pop %esi
8010714f: 5f pop %edi
80107150: 5d pop %ebp
if(sz >= PGSIZE)
panic("inituvm: more than a page");
mem = kalloc();
memset(mem, 0, PGSIZE);
mappages(pgdir, 0, PGSIZE, V2P(mem), PTE_W|PTE_U);
memmove(mem, init, sz);
80107151: e9 7a da ff ff jmp 80104bd0 <memmove>
inituvm(pde_t *pgdir, char *init, uint sz)
{
char *mem;
if(sz >= PGSIZE)
panic("inituvm: more than a page");
80107156: 83 ec 0c sub $0xc,%esp
80107159: 68 e9 80 10 80 push $0x801080e9
8010715e: e8 0d 92 ff ff call 80100370 <panic>
80107163: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80107169: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80107170 <loaduvm>:
// Load a program segment into pgdir. addr must be page-aligned
// and the pages from addr to addr+sz must already be mapped.
int
loaduvm(pde_t *pgdir, char *addr, struct inode *ip, uint offset, uint sz)
{
80107170: 55 push %ebp
80107171: 89 e5 mov %esp,%ebp
80107173: 57 push %edi
80107174: 56 push %esi
80107175: 53 push %ebx
80107176: 83 ec 0c sub $0xc,%esp
uint i, pa, n;
pte_t *pte;
if((uint) addr % PGSIZE != 0)
80107179: f7 45 0c ff 0f 00 00 testl $0xfff,0xc(%ebp)
80107180: 0f 85 91 00 00 00 jne 80107217 <loaduvm+0xa7>
panic("loaduvm: addr must be page aligned");
for(i = 0; i < sz; i += PGSIZE){
80107186: 8b 75 18 mov 0x18(%ebp),%esi
80107189: 31 db xor %ebx,%ebx
8010718b: 85 f6 test %esi,%esi
8010718d: 75 1a jne 801071a9 <loaduvm+0x39>
8010718f: eb 6f jmp 80107200 <loaduvm+0x90>
80107191: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80107198: 81 c3 00 10 00 00 add $0x1000,%ebx
8010719e: 81 ee 00 10 00 00 sub $0x1000,%esi
801071a4: 39 5d 18 cmp %ebx,0x18(%ebp)
801071a7: 76 57 jbe 80107200 <loaduvm+0x90>
if((pte = walkpgdir(pgdir, addr+i, 0)) == 0)
801071a9: 8b 55 0c mov 0xc(%ebp),%edx
801071ac: 8b 45 08 mov 0x8(%ebp),%eax
801071af: 31 c9 xor %ecx,%ecx
801071b1: 01 da add %ebx,%edx
801071b3: e8 58 fb ff ff call 80106d10 <walkpgdir>
801071b8: 85 c0 test %eax,%eax
801071ba: 74 4e je 8010720a <loaduvm+0x9a>
panic("loaduvm: address should exist");
pa = PTE_ADDR(*pte);
801071bc: 8b 00 mov (%eax),%eax
if(sz - i < PGSIZE)
n = sz - i;
else
n = PGSIZE;
if(readi(ip, P2V(pa), offset+i, n) != n)
801071be: 8b 4d 14 mov 0x14(%ebp),%ecx
panic("loaduvm: addr must be page aligned");
for(i = 0; i < sz; i += PGSIZE){
if((pte = walkpgdir(pgdir, addr+i, 0)) == 0)
panic("loaduvm: address should exist");
pa = PTE_ADDR(*pte);
if(sz - i < PGSIZE)
801071c1: bf 00 10 00 00 mov $0x1000,%edi
if((uint) addr % PGSIZE != 0)
panic("loaduvm: addr must be page aligned");
for(i = 0; i < sz; i += PGSIZE){
if((pte = walkpgdir(pgdir, addr+i, 0)) == 0)
panic("loaduvm: address should exist");
pa = PTE_ADDR(*pte);
801071c6: 25 00 f0 ff ff and $0xfffff000,%eax
if(sz - i < PGSIZE)
801071cb: 81 fe ff 0f 00 00 cmp $0xfff,%esi
801071d1: 0f 46 fe cmovbe %esi,%edi
n = sz - i;
else
n = PGSIZE;
if(readi(ip, P2V(pa), offset+i, n) != n)
801071d4: 01 d9 add %ebx,%ecx
801071d6: 05 00 00 00 80 add $0x80000000,%eax
801071db: 57 push %edi
801071dc: 51 push %ecx
801071dd: 50 push %eax
801071de: ff 75 10 pushl 0x10(%ebp)
801071e1: e8 9a aa ff ff call 80101c80 <readi>
801071e6: 83 c4 10 add $0x10,%esp
801071e9: 39 c7 cmp %eax,%edi
801071eb: 74 ab je 80107198 <loaduvm+0x28>
return -1;
}
return 0;
}
801071ed: 8d 65 f4 lea -0xc(%ebp),%esp
if(sz - i < PGSIZE)
n = sz - i;
else
n = PGSIZE;
if(readi(ip, P2V(pa), offset+i, n) != n)
return -1;
801071f0: b8 ff ff ff ff mov $0xffffffff,%eax
}
return 0;
}
801071f5: 5b pop %ebx
801071f6: 5e pop %esi
801071f7: 5f pop %edi
801071f8: 5d pop %ebp
801071f9: c3 ret
801071fa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80107200: 8d 65 f4 lea -0xc(%ebp),%esp
else
n = PGSIZE;
if(readi(ip, P2V(pa), offset+i, n) != n)
return -1;
}
return 0;
80107203: 31 c0 xor %eax,%eax
}
80107205: 5b pop %ebx
80107206: 5e pop %esi
80107207: 5f pop %edi
80107208: 5d pop %ebp
80107209: c3 ret
if((uint) addr % PGSIZE != 0)
panic("loaduvm: addr must be page aligned");
for(i = 0; i < sz; i += PGSIZE){
if((pte = walkpgdir(pgdir, addr+i, 0)) == 0)
panic("loaduvm: address should exist");
8010720a: 83 ec 0c sub $0xc,%esp
8010720d: 68 03 81 10 80 push $0x80108103
80107212: e8 59 91 ff ff call 80100370 <panic>
{
uint i, pa, n;
pte_t *pte;
if((uint) addr % PGSIZE != 0)
panic("loaduvm: addr must be page aligned");
80107217: 83 ec 0c sub $0xc,%esp
8010721a: 68 a4 81 10 80 push $0x801081a4
8010721f: e8 4c 91 ff ff call 80100370 <panic>
80107224: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
8010722a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
80107230 <allocuvm>:
// Allocate page tables and physical memory to grow process from oldsz to
// newsz, which need not be page aligned. Returns new size or 0 on error.
int
allocuvm(pde_t *pgdir, uint oldsz, uint newsz)
{
80107230: 55 push %ebp
80107231: 89 e5 mov %esp,%ebp
80107233: 57 push %edi
80107234: 56 push %esi
80107235: 53 push %ebx
80107236: 83 ec 0c sub $0xc,%esp
80107239: 8b 7d 10 mov 0x10(%ebp),%edi
char *mem;
uint a;
if(newsz >= KERNBASE)
8010723c: 85 ff test %edi,%edi
8010723e: 0f 88 ca 00 00 00 js 8010730e <allocuvm+0xde>
return 0;
if(newsz < oldsz)
80107244: 3b 7d 0c cmp 0xc(%ebp),%edi
return oldsz;
80107247: 8b 45 0c mov 0xc(%ebp),%eax
char *mem;
uint a;
if(newsz >= KERNBASE)
return 0;
if(newsz < oldsz)
8010724a: 0f 82 82 00 00 00 jb 801072d2 <allocuvm+0xa2>
return oldsz;
a = PGROUNDUP(oldsz);
80107250: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx
80107256: 81 e3 00 f0 ff ff and $0xfffff000,%ebx
for(; a < newsz; a += PGSIZE){
8010725c: 39 df cmp %ebx,%edi
8010725e: 77 43 ja 801072a3 <allocuvm+0x73>
80107260: e9 bb 00 00 00 jmp 80107320 <allocuvm+0xf0>
80107265: 8d 76 00 lea 0x0(%esi),%esi
if(mem == 0){
cprintf("allocuvm out of memory\n");
deallocuvm(pgdir, newsz, oldsz);
return 0;
}
memset(mem, 0, PGSIZE);
80107268: 83 ec 04 sub $0x4,%esp
8010726b: 68 00 10 00 00 push $0x1000
80107270: 6a 00 push $0x0
80107272: 50 push %eax
80107273: e8 a8 d8 ff ff call 80104b20 <memset>
if(mappages(pgdir, (char*)a, PGSIZE, V2P(mem), PTE_W|PTE_U) < 0){
80107278: 58 pop %eax
80107279: 8d 86 00 00 00 80 lea -0x80000000(%esi),%eax
8010727f: b9 00 10 00 00 mov $0x1000,%ecx
80107284: 5a pop %edx
80107285: 6a 06 push $0x6
80107287: 50 push %eax
80107288: 89 da mov %ebx,%edx
8010728a: 8b 45 08 mov 0x8(%ebp),%eax
8010728d: e8 fe fa ff ff call 80106d90 <mappages>
80107292: 83 c4 10 add $0x10,%esp
80107295: 85 c0 test %eax,%eax
80107297: 78 47 js 801072e0 <allocuvm+0xb0>
return 0;
if(newsz < oldsz)
return oldsz;
a = PGROUNDUP(oldsz);
for(; a < newsz; a += PGSIZE){
80107299: 81 c3 00 10 00 00 add $0x1000,%ebx
8010729f: 39 df cmp %ebx,%edi
801072a1: 76 7d jbe 80107320 <allocuvm+0xf0>
mem = kalloc();
801072a3: e8 18 b5 ff ff call 801027c0 <kalloc>
if(mem == 0){
801072a8: 85 c0 test %eax,%eax
if(newsz < oldsz)
return oldsz;
a = PGROUNDUP(oldsz);
for(; a < newsz; a += PGSIZE){
mem = kalloc();
801072aa: 89 c6 mov %eax,%esi
if(mem == 0){
801072ac: 75 ba jne 80107268 <allocuvm+0x38>
cprintf("allocuvm out of memory\n");
801072ae: 83 ec 0c sub $0xc,%esp
801072b1: 68 21 81 10 80 push $0x80108121
801072b6: e8 a5 93 ff ff call 80100660 <cprintf>
deallocuvm(pde_t *pgdir, uint oldsz, uint newsz)
{
pte_t *pte;
uint a, pa;
if(newsz >= oldsz)
801072bb: 83 c4 10 add $0x10,%esp
801072be: 3b 7d 0c cmp 0xc(%ebp),%edi
801072c1: 76 4b jbe 8010730e <allocuvm+0xde>
801072c3: 8b 4d 0c mov 0xc(%ebp),%ecx
801072c6: 8b 45 08 mov 0x8(%ebp),%eax
801072c9: 89 fa mov %edi,%edx
801072cb: e8 50 fb ff ff call 80106e20 <deallocuvm.part.0>
for(; a < newsz; a += PGSIZE){
mem = kalloc();
if(mem == 0){
cprintf("allocuvm out of memory\n");
deallocuvm(pgdir, newsz, oldsz);
return 0;
801072d0: 31 c0 xor %eax,%eax
kfree(mem);
return 0;
}
}
return newsz;
}
801072d2: 8d 65 f4 lea -0xc(%ebp),%esp
801072d5: 5b pop %ebx
801072d6: 5e pop %esi
801072d7: 5f pop %edi
801072d8: 5d pop %ebp
801072d9: c3 ret
801072da: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
deallocuvm(pgdir, newsz, oldsz);
return 0;
}
memset(mem, 0, PGSIZE);
if(mappages(pgdir, (char*)a, PGSIZE, V2P(mem), PTE_W|PTE_U) < 0){
cprintf("allocuvm out of memory (2)\n");
801072e0: 83 ec 0c sub $0xc,%esp
801072e3: 68 39 81 10 80 push $0x80108139
801072e8: e8 73 93 ff ff call 80100660 <cprintf>
deallocuvm(pde_t *pgdir, uint oldsz, uint newsz)
{
pte_t *pte;
uint a, pa;
if(newsz >= oldsz)
801072ed: 83 c4 10 add $0x10,%esp
801072f0: 3b 7d 0c cmp 0xc(%ebp),%edi
801072f3: 76 0d jbe 80107302 <allocuvm+0xd2>
801072f5: 8b 4d 0c mov 0xc(%ebp),%ecx
801072f8: 8b 45 08 mov 0x8(%ebp),%eax
801072fb: 89 fa mov %edi,%edx
801072fd: e8 1e fb ff ff call 80106e20 <deallocuvm.part.0>
}
memset(mem, 0, PGSIZE);
if(mappages(pgdir, (char*)a, PGSIZE, V2P(mem), PTE_W|PTE_U) < 0){
cprintf("allocuvm out of memory (2)\n");
deallocuvm(pgdir, newsz, oldsz);
kfree(mem);
80107302: 83 ec 0c sub $0xc,%esp
80107305: 56 push %esi
80107306: e8 05 b3 ff ff call 80102610 <kfree>
return 0;
8010730b: 83 c4 10 add $0x10,%esp
}
}
return newsz;
}
8010730e: 8d 65 f4 lea -0xc(%ebp),%esp
memset(mem, 0, PGSIZE);
if(mappages(pgdir, (char*)a, PGSIZE, V2P(mem), PTE_W|PTE_U) < 0){
cprintf("allocuvm out of memory (2)\n");
deallocuvm(pgdir, newsz, oldsz);
kfree(mem);
return 0;
80107311: 31 c0 xor %eax,%eax
}
}
return newsz;
}
80107313: 5b pop %ebx
80107314: 5e pop %esi
80107315: 5f pop %edi
80107316: 5d pop %ebp
80107317: c3 ret
80107318: 90 nop
80107319: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80107320: 8d 65 f4 lea -0xc(%ebp),%esp
return 0;
if(newsz < oldsz)
return oldsz;
a = PGROUNDUP(oldsz);
for(; a < newsz; a += PGSIZE){
80107323: 89 f8 mov %edi,%eax
kfree(mem);
return 0;
}
}
return newsz;
}
80107325: 5b pop %ebx
80107326: 5e pop %esi
80107327: 5f pop %edi
80107328: 5d pop %ebp
80107329: c3 ret
8010732a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80107330 <deallocuvm>:
// 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)
{
80107330: 55 push %ebp
80107331: 89 e5 mov %esp,%ebp
80107333: 8b 55 0c mov 0xc(%ebp),%edx
80107336: 8b 4d 10 mov 0x10(%ebp),%ecx
80107339: 8b 45 08 mov 0x8(%ebp),%eax
pte_t *pte;
uint a, pa;
if(newsz >= oldsz)
8010733c: 39 d1 cmp %edx,%ecx
8010733e: 73 10 jae 80107350 <deallocuvm+0x20>
kfree(v);
*pte = 0;
}
}
return newsz;
}
80107340: 5d pop %ebp
80107341: e9 da fa ff ff jmp 80106e20 <deallocuvm.part.0>
80107346: 8d 76 00 lea 0x0(%esi),%esi
80107349: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
80107350: 89 d0 mov %edx,%eax
80107352: 5d pop %ebp
80107353: c3 ret
80107354: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
8010735a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
80107360 <freevm>:
// Free a page table and all the physical memory pages
// in the user part.
void
freevm(pde_t *pgdir)
{
80107360: 55 push %ebp
80107361: 89 e5 mov %esp,%ebp
80107363: 57 push %edi
80107364: 56 push %esi
80107365: 53 push %ebx
80107366: 83 ec 0c sub $0xc,%esp
80107369: 8b 75 08 mov 0x8(%ebp),%esi
uint i;
if(pgdir == 0)
8010736c: 85 f6 test %esi,%esi
8010736e: 74 59 je 801073c9 <freevm+0x69>
80107370: 31 c9 xor %ecx,%ecx
80107372: ba 00 00 00 80 mov $0x80000000,%edx
80107377: 89 f0 mov %esi,%eax
80107379: e8 a2 fa ff ff call 80106e20 <deallocuvm.part.0>
8010737e: 89 f3 mov %esi,%ebx
80107380: 8d be 00 10 00 00 lea 0x1000(%esi),%edi
80107386: eb 0f jmp 80107397 <freevm+0x37>
80107388: 90 nop
80107389: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80107390: 83 c3 04 add $0x4,%ebx
panic("freevm: no pgdir");
deallocuvm(pgdir, KERNBASE, 0);
for(i = 0; i < NPDENTRIES; i++){
80107393: 39 fb cmp %edi,%ebx
80107395: 74 23 je 801073ba <freevm+0x5a>
if(pgdir[i] & PTE_P){
80107397: 8b 03 mov (%ebx),%eax
80107399: a8 01 test $0x1,%al
8010739b: 74 f3 je 80107390 <freevm+0x30>
char * v = P2V(PTE_ADDR(pgdir[i]));
kfree(v);
8010739d: 25 00 f0 ff ff and $0xfffff000,%eax
801073a2: 83 ec 0c sub $0xc,%esp
801073a5: 83 c3 04 add $0x4,%ebx
801073a8: 05 00 00 00 80 add $0x80000000,%eax
801073ad: 50 push %eax
801073ae: e8 5d b2 ff ff call 80102610 <kfree>
801073b3: 83 c4 10 add $0x10,%esp
uint i;
if(pgdir == 0)
panic("freevm: no pgdir");
deallocuvm(pgdir, KERNBASE, 0);
for(i = 0; i < NPDENTRIES; i++){
801073b6: 39 fb cmp %edi,%ebx
801073b8: 75 dd jne 80107397 <freevm+0x37>
if(pgdir[i] & PTE_P){
char * v = P2V(PTE_ADDR(pgdir[i]));
kfree(v);
}
}
kfree((char*)pgdir);
801073ba: 89 75 08 mov %esi,0x8(%ebp)
}
801073bd: 8d 65 f4 lea -0xc(%ebp),%esp
801073c0: 5b pop %ebx
801073c1: 5e pop %esi
801073c2: 5f pop %edi
801073c3: 5d pop %ebp
if(pgdir[i] & PTE_P){
char * v = P2V(PTE_ADDR(pgdir[i]));
kfree(v);
}
}
kfree((char*)pgdir);
801073c4: e9 47 b2 ff ff jmp 80102610 <kfree>
freevm(pde_t *pgdir)
{
uint i;
if(pgdir == 0)
panic("freevm: no pgdir");
801073c9: 83 ec 0c sub $0xc,%esp
801073cc: 68 55 81 10 80 push $0x80108155
801073d1: e8 9a 8f ff ff call 80100370 <panic>
801073d6: 8d 76 00 lea 0x0(%esi),%esi
801073d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
801073e0 <setupkvm>:
};
// Set up kernel part of a page table.
pde_t*
setupkvm(void)
{
801073e0: 55 push %ebp
801073e1: 89 e5 mov %esp,%ebp
801073e3: 56 push %esi
801073e4: 53 push %ebx
pde_t *pgdir;
struct kmap *k;
if((pgdir = (pde_t*)kalloc()) == 0)
801073e5: e8 d6 b3 ff ff call 801027c0 <kalloc>
801073ea: 85 c0 test %eax,%eax
801073ec: 74 6a je 80107458 <setupkvm+0x78>
return 0;
memset(pgdir, 0, PGSIZE);
801073ee: 83 ec 04 sub $0x4,%esp
801073f1: 89 c6 mov %eax,%esi
if (P2V(PHYSTOP) > (void*)DEVSPACE)
panic("PHYSTOP too high");
for(k = kmap; k < &kmap[NELEM(kmap)]; k++)
801073f3: bb 20 b4 10 80 mov $0x8010b420,%ebx
pde_t *pgdir;
struct kmap *k;
if((pgdir = (pde_t*)kalloc()) == 0)
return 0;
memset(pgdir, 0, PGSIZE);
801073f8: 68 00 10 00 00 push $0x1000
801073fd: 6a 00 push $0x0
801073ff: 50 push %eax
80107400: e8 1b d7 ff ff call 80104b20 <memset>
80107405: 83 c4 10 add $0x10,%esp
if (P2V(PHYSTOP) > (void*)DEVSPACE)
panic("PHYSTOP too high");
for(k = kmap; k < &kmap[NELEM(kmap)]; k++)
if(mappages(pgdir, k->virt, k->phys_end - k->phys_start,
80107408: 8b 43 04 mov 0x4(%ebx),%eax
8010740b: 8b 4b 08 mov 0x8(%ebx),%ecx
8010740e: 83 ec 08 sub $0x8,%esp
80107411: 8b 13 mov (%ebx),%edx
80107413: ff 73 0c pushl 0xc(%ebx)
80107416: 50 push %eax
80107417: 29 c1 sub %eax,%ecx
80107419: 89 f0 mov %esi,%eax
8010741b: e8 70 f9 ff ff call 80106d90 <mappages>
80107420: 83 c4 10 add $0x10,%esp
80107423: 85 c0 test %eax,%eax
80107425: 78 19 js 80107440 <setupkvm+0x60>
if((pgdir = (pde_t*)kalloc()) == 0)
return 0;
memset(pgdir, 0, PGSIZE);
if (P2V(PHYSTOP) > (void*)DEVSPACE)
panic("PHYSTOP too high");
for(k = kmap; k < &kmap[NELEM(kmap)]; k++)
80107427: 83 c3 10 add $0x10,%ebx
8010742a: 81 fb 60 b4 10 80 cmp $0x8010b460,%ebx
80107430: 75 d6 jne 80107408 <setupkvm+0x28>
80107432: 89 f0 mov %esi,%eax
(uint)k->phys_start, k->perm) < 0) {
freevm(pgdir);
return 0;
}
return pgdir;
}
80107434: 8d 65 f8 lea -0x8(%ebp),%esp
80107437: 5b pop %ebx
80107438: 5e pop %esi
80107439: 5d pop %ebp
8010743a: c3 ret
8010743b: 90 nop
8010743c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
if (P2V(PHYSTOP) > (void*)DEVSPACE)
panic("PHYSTOP too high");
for(k = kmap; k < &kmap[NELEM(kmap)]; k++)
if(mappages(pgdir, k->virt, k->phys_end - k->phys_start,
(uint)k->phys_start, k->perm) < 0) {
freevm(pgdir);
80107440: 83 ec 0c sub $0xc,%esp
80107443: 56 push %esi
80107444: e8 17 ff ff ff call 80107360 <freevm>
return 0;
80107449: 83 c4 10 add $0x10,%esp
}
return pgdir;
}
8010744c: 8d 65 f8 lea -0x8(%ebp),%esp
panic("PHYSTOP too high");
for(k = kmap; k < &kmap[NELEM(kmap)]; k++)
if(mappages(pgdir, k->virt, k->phys_end - k->phys_start,
(uint)k->phys_start, k->perm) < 0) {
freevm(pgdir);
return 0;
8010744f: 31 c0 xor %eax,%eax
}
return pgdir;
}
80107451: 5b pop %ebx
80107452: 5e pop %esi
80107453: 5d pop %ebp
80107454: c3 ret
80107455: 8d 76 00 lea 0x0(%esi),%esi
{
pde_t *pgdir;
struct kmap *k;
if((pgdir = (pde_t*)kalloc()) == 0)
return 0;
80107458: 31 c0 xor %eax,%eax
8010745a: eb d8 jmp 80107434 <setupkvm+0x54>
8010745c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
80107460 <kvmalloc>:
// Allocate one page table for the machine for the kernel address
// space for scheduler processes.
void
kvmalloc(void)
{
80107460: 55 push %ebp
80107461: 89 e5 mov %esp,%ebp
80107463: 83 ec 08 sub $0x8,%esp
kpgdir = setupkvm();
80107466: e8 75 ff ff ff call 801073e0 <setupkvm>
8010746b: a3 64 69 11 80 mov %eax,0x80116964
80107470: 05 00 00 00 80 add $0x80000000,%eax
80107475: 0f 22 d8 mov %eax,%cr3
switchkvm();
}
80107478: c9 leave
80107479: c3 ret
8010747a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80107480 <clearpteu>:
// Clear PTE_U on a page. Used to create an inaccessible
// page beneath the user stack.
void
clearpteu(pde_t *pgdir, char *uva)
{
80107480: 55 push %ebp
pte_t *pte;
pte = walkpgdir(pgdir, uva, 0);
80107481: 31 c9 xor %ecx,%ecx
// Clear PTE_U on a page. Used to create an inaccessible
// page beneath the user stack.
void
clearpteu(pde_t *pgdir, char *uva)
{
80107483: 89 e5 mov %esp,%ebp
80107485: 83 ec 08 sub $0x8,%esp
pte_t *pte;
pte = walkpgdir(pgdir, uva, 0);
80107488: 8b 55 0c mov 0xc(%ebp),%edx
8010748b: 8b 45 08 mov 0x8(%ebp),%eax
8010748e: e8 7d f8 ff ff call 80106d10 <walkpgdir>
if(pte == 0)
80107493: 85 c0 test %eax,%eax
80107495: 74 05 je 8010749c <clearpteu+0x1c>
panic("clearpteu");
*pte &= ~PTE_U;
80107497: 83 20 fb andl $0xfffffffb,(%eax)
}
8010749a: c9 leave
8010749b: c3 ret
{
pte_t *pte;
pte = walkpgdir(pgdir, uva, 0);
if(pte == 0)
panic("clearpteu");
8010749c: 83 ec 0c sub $0xc,%esp
8010749f: 68 66 81 10 80 push $0x80108166
801074a4: e8 c7 8e ff ff call 80100370 <panic>
801074a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
801074b0 <copyuvm>:
// Given a parent process's page table, create a copy
// of it for a child.
pde_t*
copyuvm(pde_t *pgdir, uint sz)
{
801074b0: 55 push %ebp
801074b1: 89 e5 mov %esp,%ebp
801074b3: 57 push %edi
801074b4: 56 push %esi
801074b5: 53 push %ebx
801074b6: 83 ec 1c sub $0x1c,%esp
pde_t *d;
pte_t *pte;
uint pa, i, flags;
char *mem;
if((d = setupkvm()) == 0)
801074b9: e8 22 ff ff ff call 801073e0 <setupkvm>
801074be: 85 c0 test %eax,%eax
801074c0: 89 45 e0 mov %eax,-0x20(%ebp)
801074c3: 0f 84 c5 00 00 00 je 8010758e <copyuvm+0xde>
return 0;
for(i = 0; i < sz; i += PGSIZE){
801074c9: 8b 4d 0c mov 0xc(%ebp),%ecx
801074cc: 85 c9 test %ecx,%ecx
801074ce: 0f 84 9c 00 00 00 je 80107570 <copyuvm+0xc0>
801074d4: 31 ff xor %edi,%edi
801074d6: eb 4a jmp 80107522 <copyuvm+0x72>
801074d8: 90 nop
801074d9: 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);
801074e0: 83 ec 04 sub $0x4,%esp
801074e3: 81 c3 00 00 00 80 add $0x80000000,%ebx
801074e9: 68 00 10 00 00 push $0x1000
801074ee: 53 push %ebx
801074ef: 50 push %eax
801074f0: e8 db d6 ff ff call 80104bd0 <memmove>
if(mappages(d, (void*)i, PGSIZE, V2P(mem), flags) < 0) {
801074f5: 58 pop %eax
801074f6: 8d 86 00 00 00 80 lea -0x80000000(%esi),%eax
801074fc: b9 00 10 00 00 mov $0x1000,%ecx
80107501: 5a pop %edx
80107502: ff 75 e4 pushl -0x1c(%ebp)
80107505: 50 push %eax
80107506: 89 fa mov %edi,%edx
80107508: 8b 45 e0 mov -0x20(%ebp),%eax
8010750b: e8 80 f8 ff ff call 80106d90 <mappages>
80107510: 83 c4 10 add $0x10,%esp
80107513: 85 c0 test %eax,%eax
80107515: 78 69 js 80107580 <copyuvm+0xd0>
uint pa, i, flags;
char *mem;
if((d = setupkvm()) == 0)
return 0;
for(i = 0; i < sz; i += PGSIZE){
80107517: 81 c7 00 10 00 00 add $0x1000,%edi
8010751d: 39 7d 0c cmp %edi,0xc(%ebp)
80107520: 76 4e jbe 80107570 <copyuvm+0xc0>
if((pte = walkpgdir(pgdir, (void *) i, 0)) == 0)
80107522: 8b 45 08 mov 0x8(%ebp),%eax
80107525: 31 c9 xor %ecx,%ecx
80107527: 89 fa mov %edi,%edx
80107529: e8 e2 f7 ff ff call 80106d10 <walkpgdir>
8010752e: 85 c0 test %eax,%eax
80107530: 74 6d je 8010759f <copyuvm+0xef>
panic("copyuvm: pte should exist");
if(!(*pte & PTE_P))
80107532: 8b 00 mov (%eax),%eax
80107534: a8 01 test $0x1,%al
80107536: 74 5a je 80107592 <copyuvm+0xe2>
panic("copyuvm: page not present");
pa = PTE_ADDR(*pte);
80107538: 89 c3 mov %eax,%ebx
flags = PTE_FLAGS(*pte);
8010753a: 25 ff 0f 00 00 and $0xfff,%eax
for(i = 0; i < sz; i += PGSIZE){
if((pte = walkpgdir(pgdir, (void *) i, 0)) == 0)
panic("copyuvm: pte should exist");
if(!(*pte & PTE_P))
panic("copyuvm: page not present");
pa = PTE_ADDR(*pte);
8010753f: 81 e3 00 f0 ff ff and $0xfffff000,%ebx
flags = PTE_FLAGS(*pte);
80107545: 89 45 e4 mov %eax,-0x1c(%ebp)
if((mem = kalloc()) == 0)
80107548: e8 73 b2 ff ff call 801027c0 <kalloc>
8010754d: 85 c0 test %eax,%eax
8010754f: 89 c6 mov %eax,%esi
80107551: 75 8d jne 801074e0 <copyuvm+0x30>
}
}
return d;
bad:
freevm(d);
80107553: 83 ec 0c sub $0xc,%esp
80107556: ff 75 e0 pushl -0x20(%ebp)
80107559: e8 02 fe ff ff call 80107360 <freevm>
return 0;
8010755e: 83 c4 10 add $0x10,%esp
80107561: 31 c0 xor %eax,%eax
}
80107563: 8d 65 f4 lea -0xc(%ebp),%esp
80107566: 5b pop %ebx
80107567: 5e pop %esi
80107568: 5f pop %edi
80107569: 5d pop %ebp
8010756a: c3 ret
8010756b: 90 nop
8010756c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
uint pa, i, flags;
char *mem;
if((d = setupkvm()) == 0)
return 0;
for(i = 0; i < sz; i += PGSIZE){
80107570: 8b 45 e0 mov -0x20(%ebp),%eax
return d;
bad:
freevm(d);
return 0;
}
80107573: 8d 65 f4 lea -0xc(%ebp),%esp
80107576: 5b pop %ebx
80107577: 5e pop %esi
80107578: 5f pop %edi
80107579: 5d pop %ebp
8010757a: c3 ret
8010757b: 90 nop
8010757c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
flags = PTE_FLAGS(*pte);
if((mem = kalloc()) == 0)
goto bad;
memmove(mem, (char*)P2V(pa), PGSIZE);
if(mappages(d, (void*)i, PGSIZE, V2P(mem), flags) < 0) {
kfree(mem);
80107580: 83 ec 0c sub $0xc,%esp
80107583: 56 push %esi
80107584: e8 87 b0 ff ff call 80102610 <kfree>
goto bad;
80107589: 83 c4 10 add $0x10,%esp
8010758c: eb c5 jmp 80107553 <copyuvm+0xa3>
pte_t *pte;
uint pa, i, flags;
char *mem;
if((d = setupkvm()) == 0)
return 0;
8010758e: 31 c0 xor %eax,%eax
80107590: eb d1 jmp 80107563 <copyuvm+0xb3>
for(i = 0; i < sz; i += PGSIZE){
if((pte = walkpgdir(pgdir, (void *) i, 0)) == 0)
panic("copyuvm: pte should exist");
if(!(*pte & PTE_P))
panic("copyuvm: page not present");
80107592: 83 ec 0c sub $0xc,%esp
80107595: 68 8a 81 10 80 push $0x8010818a
8010759a: e8 d1 8d ff ff call 80100370 <panic>
if((d = setupkvm()) == 0)
return 0;
for(i = 0; i < sz; i += PGSIZE){
if((pte = walkpgdir(pgdir, (void *) i, 0)) == 0)
panic("copyuvm: pte should exist");
8010759f: 83 ec 0c sub $0xc,%esp
801075a2: 68 70 81 10 80 push $0x80108170
801075a7: e8 c4 8d ff ff call 80100370 <panic>
801075ac: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
801075b0 <uva2ka>:
//PAGEBREAK!
// Map user virtual address to kernel address.
char*
uva2ka(pde_t *pgdir, char *uva)
{
801075b0: 55 push %ebp
pte_t *pte;
pte = walkpgdir(pgdir, uva, 0);
801075b1: 31 c9 xor %ecx,%ecx
//PAGEBREAK!
// Map user virtual address to kernel address.
char*
uva2ka(pde_t *pgdir, char *uva)
{
801075b3: 89 e5 mov %esp,%ebp
801075b5: 83 ec 08 sub $0x8,%esp
pte_t *pte;
pte = walkpgdir(pgdir, uva, 0);
801075b8: 8b 55 0c mov 0xc(%ebp),%edx
801075bb: 8b 45 08 mov 0x8(%ebp),%eax
801075be: e8 4d f7 ff ff call 80106d10 <walkpgdir>
if((*pte & PTE_P) == 0)
801075c3: 8b 00 mov (%eax),%eax
return 0;
if((*pte & PTE_U) == 0)
801075c5: 89 c2 mov %eax,%edx
801075c7: 83 e2 05 and $0x5,%edx
801075ca: 83 fa 05 cmp $0x5,%edx
801075cd: 75 11 jne 801075e0 <uva2ka+0x30>
return 0;
return (char*)P2V(PTE_ADDR(*pte));
801075cf: 25 00 f0 ff ff and $0xfffff000,%eax
}
801075d4: c9 leave
pte = walkpgdir(pgdir, uva, 0);
if((*pte & PTE_P) == 0)
return 0;
if((*pte & PTE_U) == 0)
return 0;
return (char*)P2V(PTE_ADDR(*pte));
801075d5: 05 00 00 00 80 add $0x80000000,%eax
}
801075da: c3 ret
801075db: 90 nop
801075dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
pte = walkpgdir(pgdir, uva, 0);
if((*pte & PTE_P) == 0)
return 0;
if((*pte & PTE_U) == 0)
return 0;
801075e0: 31 c0 xor %eax,%eax
return (char*)P2V(PTE_ADDR(*pte));
}
801075e2: c9 leave
801075e3: c3 ret
801075e4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
801075ea: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
801075f0 <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)
{
801075f0: 55 push %ebp
801075f1: 89 e5 mov %esp,%ebp
801075f3: 57 push %edi
801075f4: 56 push %esi
801075f5: 53 push %ebx
801075f6: 83 ec 1c sub $0x1c,%esp
801075f9: 8b 5d 14 mov 0x14(%ebp),%ebx
801075fc: 8b 55 0c mov 0xc(%ebp),%edx
801075ff: 8b 7d 10 mov 0x10(%ebp),%edi
char *buf, *pa0;
uint n, va0;
buf = (char*)p;
while(len > 0){
80107602: 85 db test %ebx,%ebx
80107604: 75 40 jne 80107646 <copyout+0x56>
80107606: eb 70 jmp 80107678 <copyout+0x88>
80107608: 90 nop
80107609: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
va0 = (uint)PGROUNDDOWN(va);
pa0 = uva2ka(pgdir, (char*)va0);
if(pa0 == 0)
return -1;
n = PGSIZE - (va - va0);
80107610: 8b 55 e4 mov -0x1c(%ebp),%edx
80107613: 89 f1 mov %esi,%ecx
80107615: 29 d1 sub %edx,%ecx
80107617: 81 c1 00 10 00 00 add $0x1000,%ecx
8010761d: 39 d9 cmp %ebx,%ecx
8010761f: 0f 47 cb cmova %ebx,%ecx
if(n > len)
n = len;
memmove(pa0 + (va - va0), buf, n);
80107622: 29 f2 sub %esi,%edx
80107624: 83 ec 04 sub $0x4,%esp
80107627: 01 d0 add %edx,%eax
80107629: 51 push %ecx
8010762a: 57 push %edi
8010762b: 50 push %eax
8010762c: 89 4d e4 mov %ecx,-0x1c(%ebp)
8010762f: e8 9c d5 ff ff call 80104bd0 <memmove>
len -= n;
buf += n;
80107634: 8b 4d e4 mov -0x1c(%ebp),%ecx
{
char *buf, *pa0;
uint n, va0;
buf = (char*)p;
while(len > 0){
80107637: 83 c4 10 add $0x10,%esp
if(n > len)
n = len;
memmove(pa0 + (va - va0), buf, n);
len -= n;
buf += n;
va = va0 + PGSIZE;
8010763a: 8d 96 00 10 00 00 lea 0x1000(%esi),%edx
n = PGSIZE - (va - va0);
if(n > len)
n = len;
memmove(pa0 + (va - va0), buf, n);
len -= n;
buf += n;
80107640: 01 cf add %ecx,%edi
{
char *buf, *pa0;
uint n, va0;
buf = (char*)p;
while(len > 0){
80107642: 29 cb sub %ecx,%ebx
80107644: 74 32 je 80107678 <copyout+0x88>
va0 = (uint)PGROUNDDOWN(va);
80107646: 89 d6 mov %edx,%esi
pa0 = uva2ka(pgdir, (char*)va0);
80107648: 83 ec 08 sub $0x8,%esp
char *buf, *pa0;
uint n, va0;
buf = (char*)p;
while(len > 0){
va0 = (uint)PGROUNDDOWN(va);
8010764b: 89 55 e4 mov %edx,-0x1c(%ebp)
8010764e: 81 e6 00 f0 ff ff and $0xfffff000,%esi
pa0 = uva2ka(pgdir, (char*)va0);
80107654: 56 push %esi
80107655: ff 75 08 pushl 0x8(%ebp)
80107658: e8 53 ff ff ff call 801075b0 <uva2ka>
if(pa0 == 0)
8010765d: 83 c4 10 add $0x10,%esp
80107660: 85 c0 test %eax,%eax
80107662: 75 ac jne 80107610 <copyout+0x20>
len -= n;
buf += n;
va = va0 + PGSIZE;
}
return 0;
}
80107664: 8d 65 f4 lea -0xc(%ebp),%esp
buf = (char*)p;
while(len > 0){
va0 = (uint)PGROUNDDOWN(va);
pa0 = uva2ka(pgdir, (char*)va0);
if(pa0 == 0)
return -1;
80107667: b8 ff ff ff ff mov $0xffffffff,%eax
len -= n;
buf += n;
va = va0 + PGSIZE;
}
return 0;
}
8010766c: 5b pop %ebx
8010766d: 5e pop %esi
8010766e: 5f pop %edi
8010766f: 5d pop %ebp
80107670: c3 ret
80107671: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
80107678: 8d 65 f4 lea -0xc(%ebp),%esp
memmove(pa0 + (va - va0), buf, n);
len -= n;
buf += n;
va = va0 + PGSIZE;
}
return 0;
8010767b: 31 c0 xor %eax,%eax
}
8010767d: 5b pop %ebx
8010767e: 5e pop %esi
8010767f: 5f pop %edi
80107680: 5d pop %ebp
80107681: c3 ret
|
; A052619: E.g.f. 3x^3/(1-x).
; 0,0,0,18,72,360,2160,15120,120960,1088640,10886400,119750400,1437004800,18681062400,261534873600,3923023104000,62768369664000,1067062284288000
mov $1,$0
fac $1
div $1,6
mul $1,18
|
; A101097: a(n) = n*(n+1)*(n+2)*(n+3)*(n+4)*(2 + 4*n + n^2)/840.
; 1,12,69,272,846,2232,5214,11088,21879,40612,71643,121056,197132,310896,476748,713184,1043613,1497276,2110273,2926704,3999930,5393960,7184970,9462960,12333555,15919956,20365047,25833664,32515032,40625376,50410712,62149824,76157433,92787564,112437117,135549648,162619366,194195352,230886006,273363728,322369839,378719748,443308371,517115808,601213284,696769360,805056420,927457440,1065473045,1220728860,1394983161,1590134832,1808231634,2051478792,2322247906,2623086192,2956726059,3326095028,3734325999,4184767872,4680996528,5226826176,5826321072,6483807616,7203886833,7991447244,8851678133,9790083216,10812494718,11925087864,13134395790,14447324880,15871170535,17413633380,19082835915,20887339616,22836162492,24938797104,27205229052,29645955936,32272006797,35094962044,38126973873,41380787184,44869761002,48607890408,52609828986,56890911792,61467178851,66355399188,71573095399,77138568768,83070924936,89390100128,96116887944,103272966720,110880927465,118964302380,127547593965,136656304720
mov $1,5
add $1,$0
bin $1,$0
mov $2,3
add $2,$0
pow $2,2
sub $2,2
mul $1,$2
sub $1,7
div $1,7
add $1,1
mov $0,$1
|
/*++
Copyright (c) 2020 Microsoft Corporation
Module Name:
euf_model.cpp
Abstract:
Model building for EUF solver plugin.
Author:
Nikolaj Bjorner (nbjorner) 2020-08-25
--*/
#include "ast/ast_pp.h"
#include "ast/ast_ll_pp.h"
#include "sat/smt/euf_solver.h"
#include "model/value_factory.h"
namespace euf {
class solver::user_sort {
solver& s;
ast_manager& m;
model_ref& mdl;
expr_ref_vector& values;
user_sort_factory factory;
scoped_ptr_vector<expr_ref_vector> sort_values;
obj_map<sort, expr_ref_vector*> sort2values;
public:
user_sort(solver& s, expr_ref_vector& values, model_ref& mdl) :
s(s), m(s.m), mdl(mdl), values(values), factory(m) {}
~user_sort() {
for (auto const& kv : sort2values)
mdl->register_usort(kv.m_key, kv.m_value->size(), kv.m_value->data());
}
void add(enode* r, sort* srt) {
unsigned id = r->get_expr_id();
expr_ref value(m);
if (m.is_value(r->get_expr()))
value = r->get_expr();
else
value = factory.get_fresh_value(srt);
(void)s;
TRACE("model", tout << s.bpp(r) << " := " << value << "\n";);
values.set(id, value);
expr_ref_vector* vals = nullptr;
if (!sort2values.find(srt, vals)) {
vals = alloc(expr_ref_vector, m);
sort2values.insert(srt, vals);
sort_values.push_back(vals);
}
vals->push_back(value);
}
void register_value(expr* val) {
factory.register_value(val);
}
};
void solver::update_model(model_ref& mdl) {
TRACE("model", tout << "create model\n";);
mdl->reset_eval_cache();
for (auto* mb : m_solvers)
mb->init_model();
m_values.reset();
m_values2root.reset();
deps_t deps;
user_sort us(*this, m_values, mdl);
collect_dependencies(us, deps);
deps.topological_sort();
dependencies2values(us, deps, mdl);
values2model(deps, mdl);
for (auto* mb : m_solvers)
mb->finalize_model(*mdl);
TRACE("model", tout << "created model " << *mdl << "\n";);
validate_model(*mdl);
}
bool solver::include_func_interp(func_decl* f) {
if (f->get_family_id() == null_family_id)
return true;
if (f->get_family_id() == m.get_basic_family_id())
return false;
if (f->is_skolem())
return false;
euf::th_model_builder* mb = func_decl2solver(f);
return mb && mb->include_func_interp(f);
}
void solver::collect_dependencies(user_sort& us, deps_t& deps) {
ptr_buffer<enode> fresh_values;
for (enode* n : m_egraph.nodes()) {
expr* e = n->get_expr();
sort* srt = e->get_sort();
auto* mb = sort2solver(srt);
if (!mb)
deps.insert(n, nullptr);
else if (!mb->add_dep(n, deps))
fresh_values.push_back(n);
if (n->is_root() && m.is_uninterp(srt) && m.is_value(e))
us.register_value(e);
}
// fresh values depend on all non-fresh values of the same sort
for (enode* n : fresh_values) {
n->mark1();
deps.insert(n, nullptr);
}
for (enode* n : fresh_values)
for (enode* r : m_egraph.nodes())
if (r->is_root() && r->get_sort() == n->get_sort() && !r->is_marked1())
deps.add(n, r);
for (enode* n : fresh_values)
n->unmark1();
TRACE("model",
for (auto const& d : deps.deps())
if (d.m_value) {
tout << bpp(d.m_key) << ":\n";
for (auto* n : *d.m_value)
tout << " " << bpp(n) << "\n";
}
);
}
void solver::dependencies2values(user_sort& us, deps_t& deps, model_ref& mdl) {
for (enode* n : deps.top_sorted()) {
TRACE("model", tout << bpp(n->get_root()) << "\n");
unsigned id = n->get_root_id();
if (m_values.get(id, nullptr))
continue;
expr* e = n->get_expr();
m_values.reserve(id + 1);
if (m.is_bool(e) && is_uninterp_const(e) && mdl->get_const_interp(to_app(e)->get_decl())) {
m_values.set(id, mdl->get_const_interp(to_app(e)->get_decl()));
continue;
}
// model of s() must have been fixed.
if (m.is_bool(e)) {
if (m.is_true(e)) {
m_values.set(id, m.mk_true());
continue;
}
if (m.is_false(e)) {
m_values.set(id, m.mk_false());
continue;
}
switch (n->value()) {
case l_true:
m_values.set(id, m.mk_true());
continue;
case l_false:
m_values.set(id, m.mk_false());
continue;
default:
break;
}
sat::bool_var v = get_enode(e)->bool_var();
if (v == sat::null_bool_var)
continue;
switch (s().value(v)) {
case l_true:
m_values.set(id, m.mk_true());
break;
case l_false:
m_values.set(id, m.mk_false());
break;
default:
break;
}
continue;
}
sort* srt = e->get_sort();
if (m.is_uninterp(srt))
us.add(n->get_root(), srt);
else if (auto* mbS = sort2solver(srt))
mbS->add_value(n, *mdl, m_values);
else if (auto* mbE = expr2solver(e))
mbE->add_value(n, *mdl, m_values);
else if (is_app(e) && to_app(e)->get_family_id() != m.get_basic_family_id()) {
m_values.set(id, e);
IF_VERBOSE(1, verbose_stream() << "creating self-value for " << mk_pp(e, m) << "\n");
}
else {
IF_VERBOSE(1, verbose_stream() << "no model values created for " << mk_pp(e, m) << "\n");
}
}
}
void solver::values2model(deps_t const& deps, model_ref& mdl) {
ptr_vector<expr> args;
for (enode* n : deps.top_sorted()) {
expr* e = n->get_expr();
if (!is_app(e))
continue;
if (!is_relevant(n))
continue;
app* a = to_app(e);
func_decl* f = a->get_decl();
if (!include_func_interp(f))
continue;
if (m.is_bool(e) && is_uninterp_const(e) && mdl->get_const_interp(f))
continue;
expr* v = m_values.get(n->get_root_id());
CTRACE("euf", !v, tout << "no value for " << mk_pp(e, m) << "\n";);
if (!v)
continue;
unsigned arity = f->get_arity();
if (arity == 0)
mdl->register_decl(f, v);
else {
auto* fi = mdl->get_func_interp(f);
if (!fi) {
fi = alloc(func_interp, m, arity);
mdl->register_decl(f, fi);
}
args.reset();
for (expr* arg : *a) {
enode* earg = get_enode(arg);
expr* val = m_values.get(earg->get_root_id());
args.push_back(val);
CTRACE("euf", !val, tout << "no value for " << bpp(earg) << "\n" << bpp(n) << "\n"; display(tout););
SASSERT(val);
}
SASSERT(args.size() == arity);
if (!fi->get_entry(args.data()))
fi->insert_new_entry(args.data(), v);
TRACE("euf", tout << bpp(n) << " " << f->get_name() << "\n";
for (expr* arg : args) tout << mk_pp(arg, m) << " ";
tout << "\n -> " << mk_pp(v, m) << "\n";
for (euf::enode* arg : euf::enode_args(n)) tout << bpp(arg) << " ";
tout << "\n";
);
}
}
}
void solver::register_macros(model& mdl) {
// TODO
}
void solver::model_updated(model_ref& mdl) {
m_values2root.reset();
for (enode* n : m_egraph.nodes())
if (n->is_root() && m_values.get(n->get_expr_id()))
m_values[n->get_expr_id()] = (*mdl)(n->get_expr());
}
obj_map<expr,enode*> const& solver::values2root() {
if (!m_values2root.empty())
return m_values2root;
for (enode* n : m_egraph.nodes())
if (n->is_root() && m_values.get(n->get_expr_id()))
m_values2root.insert(m_values.get(n->get_expr_id()), n);
TRACE("model",
for (auto const& kv : m_values2root)
tout << mk_bounded_pp(kv.m_key, m) << "\n -> " << bpp(kv.m_value) << "\n";);
return m_values2root;
}
expr* solver::node2value(enode* n) const {
return m_values.get(n->get_root_id(), nullptr);
}
void solver::display_validation_failure(std::ostream& out, model& mdl, enode* n) {
out << "Failed to validate " << n->bool_var() << " " << bpp(n) << " " << mdl(n->get_expr()) << "\n";
s().display(out);
euf::enode_vector nodes;
nodes.push_back(n);
for (unsigned i = 0; i < nodes.size(); ++i) {
euf::enode* r = nodes[i];
if (r->is_marked1())
continue;
r->mark1();
for (auto* arg : euf::enode_args(r))
nodes.push_back(arg);
expr_ref val = mdl(r->get_expr());
expr_ref sval(m);
th_rewriter rw(m);
rw(val, sval);
out << bpp(r) << " := " << sval << " " << mdl(r->get_root()->get_expr()) << "\n";
}
for (euf::enode* r : nodes)
r->unmark1();
out << mdl << "\n";
}
void solver::validate_model(model& mdl) {
if (!m_unhandled_functions.empty())
return;
for (auto* s : m_solvers)
if (s && s->has_unhandled())
return;
model_evaluator ev(mdl);
ev.set_model_completion(true);
TRACE("model",
for (enode* n : m_egraph.nodes()) {
if (!is_relevant(n))
continue;
unsigned id = n->get_root_id();
expr* val = m_values.get(id, nullptr);
if (!val)
continue;
expr_ref mval = ev(n->get_expr());
if (m.is_value(mval) && val != mval)
tout << "#" << bpp(n) << " := " << mk_pp(val, m) << " ~ " << mval << "\n";
});
bool first = true;
for (enode* n : m_egraph.nodes()) {
expr* e = n->get_expr();
if (!m.is_bool(e))
continue;
if (has_quantifiers(e))
continue;
if (!is_relevant(n))
continue;
bool tt = l_true == s().value(n->bool_var());
if (tt && !mdl.is_false(e))
continue;
if (!tt && !mdl.is_true(e))
continue;
IF_VERBOSE(0, display_validation_failure(verbose_stream(), mdl, n););
CTRACE("euf", first, display_validation_failure(tout, mdl, n););
(void)first;
first = false;
exit(1);
}
}
}
|
; A034115: Fractional part of square root of a(n) starts with 9: first term of runs.
; 35,48,63,80,99,119,142,167,194,223,253,286,321,358,397,437,480,525,572,621,671,724,779,836,895,955,1018,1083,1150,1219,1289,1362,1437,1514,1593,1673,1756,1841,1928,2017,2107,2200,2295,2392,2491,2591,2694
mov $2,$0
add $0,6
pow $0,2
div $2,5
sub $0,$2
sub $0,1
|
/* $Id: tls-generic.cpp $ */
/** @file
* IPRT - Thread Local Storage (TSL), Generic Implementation.
*/
/*
* Copyright (C) 2008-2017 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* you can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* The contents of this file may alternatively be used under the terms
* of the Common Development and Distribution License Version 1.0
* (CDDL) only, as it comes in the "COPYING.CDDL" file of the
* VirtualBox OSE distribution, in which case the provisions of the
* CDDL are applicable instead of those of the GPL.
*
* You may elect to license modified versions of this file under the
* terms and conditions of either the GPL or the CDDL or both.
*/
/*********************************************************************************************************************************
* Header Files *
*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_THREAD
#include <iprt/thread.h>
#include "internal/iprt.h"
#include <iprt/err.h>
#include <iprt/asm.h>
#include <iprt/log.h>
#include <iprt/assert.h>
#include "internal/thread.h"
/*********************************************************************************************************************************
* Global Variables *
*********************************************************************************************************************************/
/** Allocation bitmap. Set bits indicates allocated entries. */
static uint32_t volatile g_au32AllocatedBitmap[(RTTHREAD_TLS_ENTRIES + 31) / 32];
/** Destructors for each of the TLS entries. */
static PFNRTTLSDTOR g_apfnDestructors[RTTHREAD_TLS_ENTRIES];
RTR3DECL(RTTLS) RTTlsAlloc(void)
{
RTTLS iTls;
int rc = RTTlsAllocEx(&iTls, NULL);
return RT_SUCCESS(rc) ? iTls : NIL_RTTLS;
}
RTR3DECL(int) RTTlsAllocEx(PRTTLS piTls, PFNRTTLSDTOR pfnDestructor)
{
for (unsigned i = 0; i < 128; i++)
{
int iTls = ASMBitFirstClear(&g_au32AllocatedBitmap[0], RTTHREAD_TLS_ENTRIES);
if (iTls < 0)
{
*piTls = NIL_RTTLS;
return VERR_NO_MEMORY;
}
if (!ASMAtomicBitTestAndSet(&g_au32AllocatedBitmap[0], iTls))
{
g_apfnDestructors[iTls] = pfnDestructor;
*piTls = iTls;
return VINF_SUCCESS;
}
}
AssertFailed();
return VERR_NO_MEMORY;
}
RTR3DECL(int) RTTlsFree(RTTLS iTls)
{
if (iTls == NIL_RTTLS)
return VINF_SUCCESS;
if ( iTls < 0
|| iTls >= RTTHREAD_TLS_ENTRIES
|| !ASMBitTest(&g_au32AllocatedBitmap[0], iTls))
return VERR_INVALID_PARAMETER;
ASMAtomicWriteNullPtr(&g_apfnDestructors[iTls]);
rtThreadClearTlsEntry(iTls);
ASMAtomicBitClear(&g_au32AllocatedBitmap[0], iTls);
return VINF_SUCCESS;
}
RTR3DECL(void *) RTTlsGet(RTTLS iTls)
{
void *pv;
int rc = RTTlsGetEx(iTls, &pv);
return RT_SUCCESS(rc) ? pv : NULL;
}
RTR3DECL(int) RTTlsGetEx(RTTLS iTls, void **ppvValue)
{
if (RT_UNLIKELY( iTls < 0
|| iTls >= RTTHREAD_TLS_ENTRIES
|| !ASMBitTest(&g_au32AllocatedBitmap[0], iTls)))
return VERR_INVALID_PARAMETER;
PRTTHREADINT pThread = rtThreadGet(RTThreadSelf());
AssertReturn(pThread, VERR_NOT_SUPPORTED);
void *pv = pThread->apvTlsEntries[iTls];
rtThreadRelease(pThread);
*ppvValue = pv;
return VINF_SUCCESS;
}
RTR3DECL(int) RTTlsSet(RTTLS iTls, void *pvValue)
{
if (RT_UNLIKELY( iTls < 0
|| iTls >= RTTHREAD_TLS_ENTRIES
|| !ASMBitTest(&g_au32AllocatedBitmap[0], iTls)))
return VERR_INVALID_PARAMETER;
PRTTHREADINT pThread = rtThreadGet(RTThreadSelf());
AssertReturn(pThread, VERR_NOT_SUPPORTED);
pThread->apvTlsEntries[iTls] = pvValue;
rtThreadRelease(pThread);
return VINF_SUCCESS;
}
/**
* Called at thread termination to invoke TLS destructors.
*
* @param pThread The current thread.
*/
DECLHIDDEN(void) rtThreadTlsDestruction(PRTTHREADINT pThread)
{
for (RTTLS iTls = 0; iTls < RTTHREAD_TLS_ENTRIES; iTls++)
{
void *pv = pThread->apvTlsEntries[iTls];
if (pv)
{
PFNRTTLSDTOR pfnDestructor = (PFNRTTLSDTOR)(uintptr_t)ASMAtomicUoReadPtr((void * volatile *)(uintptr_t)&g_apfnDestructors[iTls]);
if (pfnDestructor)
{
pThread->apvTlsEntries[iTls] = NULL;
pfnDestructor(pv);
}
}
}
}
|
;
; Copyright (c) 2020 Phillip Stevens
;
; This Source Code Form is subject to the terms of the Mozilla Public
; License, v. 2.0. If a copy of the MPL was not distributed with this
; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;
; feilipu, August 2020
;
;-------------------------------------------------------------------------
; asm_am9511_sqr - z80, z180, z80n floating point square
;-------------------------------------------------------------------------
SECTION code_clib
SECTION code_fp_am9511
EXTERN __IO_APU_CONTROL
EXTERN __IO_APU_OP_PTOF
EXTERN __IO_APU_OP_FMUL
EXTERN asm_am9511_pushf_hl
EXTERN asm_am9511_pushf_fastcall
EXTERN asm_am9511_popf
PUBLIC asm_am9511_sqr, asm_am9511_sqr_fastcall
.asm_am9511_sqr
ld hl,2
add hl,sp
call asm_am9511_pushf_hl ; x
ld a,__IO_APU_OP_PTOF
out (__IO_APU_CONTROL),a ; x
ld a,__IO_APU_OP_FMUL
out (__IO_APU_CONTROL),a ; x*x
jp asm_am9511_popf
.asm_am9511_sqr_fastcall
call asm_am9511_pushf_fastcall ; x
ld a,__IO_APU_OP_PTOF
out (__IO_APU_CONTROL),a ; x
ld a,__IO_APU_OP_FMUL
out (__IO_APU_CONTROL),a ; x*x
jp asm_am9511_popf
|
extern m7_ippsHMACInit_rmf:function
extern n8_ippsHMACInit_rmf:function
extern y8_ippsHMACInit_rmf:function
extern e9_ippsHMACInit_rmf:function
extern l9_ippsHMACInit_rmf:function
extern n0_ippsHMACInit_rmf:function
extern k0_ippsHMACInit_rmf:function
extern ippcpJumpIndexForMergedLibs
extern ippcpSafeInit:function
segment .data
align 8
dq .Lin_ippsHMACInit_rmf
.Larraddr_ippsHMACInit_rmf:
dq m7_ippsHMACInit_rmf
dq n8_ippsHMACInit_rmf
dq y8_ippsHMACInit_rmf
dq e9_ippsHMACInit_rmf
dq l9_ippsHMACInit_rmf
dq n0_ippsHMACInit_rmf
dq k0_ippsHMACInit_rmf
segment .text
global ippsHMACInit_rmf:function (ippsHMACInit_rmf.LEndippsHMACInit_rmf - ippsHMACInit_rmf)
.Lin_ippsHMACInit_rmf:
db 0xf3, 0x0f, 0x1e, 0xfa
call ippcpSafeInit wrt ..plt
align 16
ippsHMACInit_rmf:
db 0xf3, 0x0f, 0x1e, 0xfa
mov rax, qword [rel ippcpJumpIndexForMergedLibs wrt ..gotpc]
movsxd rax, dword [rax]
lea r11, [rel .Larraddr_ippsHMACInit_rmf]
mov r11, qword [r11+rax*8]
jmp r11
.LEndippsHMACInit_rmf:
|
/*
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <AK/ByteBuffer.h>
#include <AK/JsonObject.h>
#include <AK/JsonValue.h>
#include <LibCore/ArgsParser.h>
#include <LibCore/DateTime.h>
#include <LibCore/File.h>
#include <unistd.h>
int main(int argc, char** argv)
{
if (pledge("stdio wpath cpath", nullptr) < 0) {
perror("pledge");
return 1;
}
if (unveil("/var/run/utmp", "rwc") < 0) {
perror("unveil");
return 1;
}
unveil(nullptr, nullptr);
pid_t pid = 0;
bool flag_create = false;
bool flag_delete = false;
const char* tty_name = nullptr;
const char* from = nullptr;
Core::ArgsParser args_parser;
args_parser.add_option(flag_create, "Create entry", "create", 'c');
args_parser.add_option(flag_delete, "Delete entry", "delete", 'd');
args_parser.add_option(pid, "PID", "PID", 'p', "PID");
args_parser.add_option(from, "From", "from", 'f', "From");
args_parser.add_positional_argument(tty_name, "TTY name", "tty");
args_parser.parse(argc, argv);
if (flag_create && flag_delete) {
warnln("-c and -d are mutually exclusive");
return 1;
}
dbgln("Updating utmp from UID={} GID={} EGID={} PID={}", getuid(), getgid(), getegid(), pid);
auto file_or_error = Core::File::open("/var/run/utmp", Core::IODevice::ReadWrite);
if (file_or_error.is_error()) {
dbgln("Error: {}", file_or_error.error());
return 1;
}
auto& file = *file_or_error.value();
auto file_contents = file.read_all();
auto previous_json = JsonValue::from_string(file_contents);
JsonObject json;
if (!file_contents.is_empty()) {
if (!previous_json.has_value() || !previous_json.value().is_object()) {
dbgln("Error: Could not parse JSON");
} else {
json = previous_json.value().as_object();
}
}
if (flag_create) {
JsonObject entry;
entry.set("pid", pid);
entry.set("uid", getuid());
entry.set("from", from);
entry.set("login_at", time(nullptr));
json.set(tty_name, move(entry));
} else {
VERIFY(flag_delete);
dbgln("Removing {} from utmp", tty_name);
json.remove(tty_name);
}
if (!file.seek(0)) {
dbgln("Seek failed");
return 1;
}
if (!file.truncate(0)) {
dbgln("Truncation failed");
return 1;
}
if (!file.write(json.to_string())) {
dbgln("Write failed");
return 1;
}
return 0;
}
|
; A109588: n followed by n^2 followed by n^3.
; 1,1,1,2,4,8,3,9,27,4,16,64,5,25,125,6,36,216,7,49,343,8,64,512,9,81,729,10,100,1000,11,121,1331,12,144,1728,13,169,2197,14,196,2744,15,225,3375,16,256,4096,17,289,4913,18,324,5832,19,361,6859,20,400,8000,21,441,9261,22,484,10648,23,529,12167,24,576,13824,25,625,15625,26,676,17576,27,729,19683,28,784,21952,29,841,24389,30,900,27000,31,961,29791,32,1024,32768,33,1089,35937,34
mov $1,$0
mod $0,3
add $0,1
add $1,3
div $1,3
pow $1,$0
mov $0,$1
|
; A096027: Numbers n such that (n+j) mod (2+j) = 1 for j from 0 to 10 and (n+11) mod 13 <> 1.
; 27723,55443,83163,110883,138603,166323,194043,221763,249483,277203,304923,332643,388083,415803,443523,471243,498963,526683,554403,582123,609843,637563,665283,693003,748443,776163,803883,831603,859323,887043
mov $1,$0
div $0,12
add $1,$0
mul $1,27720
add $1,27723
|
/*
* Copyright (c) 2015 ARM Limited. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
* 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.
*/
#include "CppUTest/TestHarness.h"
#include "test_m2minterfaceimpl.h"
#include "m2minterfaceobserver.h"
#include "m2mconnectionhandler_stub.h"
#include "m2msecurity_stub.h"
#include "m2mnsdlinterface_stub.h"
#include "m2mobject_stub.h"
#include "m2mobjectinstance_stub.h"
#include "m2mbase.h"
entropy_cb ent_cb;
class TestObserver : public M2MInterfaceObserver {
public:
TestObserver() : val_updated(false), error_occured(false),
registered(false), unregistered(false), bootstrapped(false)
{
}
virtual ~TestObserver(){}
void bootstrap_done(M2MSecurity */*server_object*/){
bootstrapped = true;
}
void object_registered(M2MSecurity */*security_object*/,
const M2MServer &/*server_object*/) {
registered = true;
}
void object_unregistered(M2MSecurity */*server_object*/){
unregistered = true;
}
void registration_updated(M2MSecurity */*security_object*/,
const M2MServer &/*server_object*/){
registered = true;
}
void error(M2MInterface::Error /*error*/){
error_occured = true;
}
void value_updated(M2MBase *, M2MBase::BaseType ){
val_updated = true;
}
bool val_updated;
bool error_occured;
bool registered;
bool unregistered;
bool bootstrapped;
};
class M2MBaseTest : public M2MBase
{
public:
M2MBaseTest() : M2MBase(M2MBase::Resource,
7,
M2MBase::Static,
#ifndef DISABLE_RESOURCE_TYPE
"type",
#endif
"7",
false,
false){}
virtual ~M2MBaseTest() {
free_resources();
}
virtual M2MObservationHandler* observation_handler() const {};
virtual void set_observation_handler(M2MObservationHandler*) {};
};
Test_M2MInterfaceImpl::Test_M2MInterfaceImpl()
{
observer = new TestObserver();
impl = new M2MInterfaceImpl(*observer,
"endpoint_name",
"endpoint_type",
120,
8000,
"domain",
M2MInterface::TCP);
}
Test_M2MInterfaceImpl:: ~Test_M2MInterfaceImpl()
{
delete observer;
delete impl;
}
void Test_M2MInterfaceImpl::test_constructor()
{
TestObserver obs;
M2MInterfaceImpl* obj = new M2MInterfaceImpl(obs,
"endpoint_name",
"endpoint_type",
120,
8000,
"domain",
M2MInterface::TCP);
CHECK(obj->_current_state == 0);
//TODO: Check rest of variables
delete obj;
obj = new M2MInterfaceImpl(obs,
"endpoint_name",
"endpoint_type",
120,
8000,
"domain",
M2MInterface::TCP_QUEUE);
delete obj;
}
void Test_M2MInterfaceImpl::test_bootstrap()
{
M2MSecurity *sec = new M2MSecurity(M2MSecurity::Bootstrap);
m2msecurity_stub::int_value = 2;
String *val = new String("coaps://[2001:12:12:23::23:FF]:5685");
m2msecurity_stub::string_value = val;
m2mnsdlinterface_stub::bool_value = true;
m2mconnectionhandler_stub::bool_value = true;
impl->bootstrap(NULL);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_IDLE);
impl->bootstrap(sec);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_BOOTSTRAP);
delete val;
val = new String("coaps://[10.45.3.83:5685");
impl->_current_state = M2MInterfaceImpl::STATE_IDLE;
m2msecurity_stub::string_value = val;
m2mnsdlinterface_stub::bool_value = true;
m2mconnectionhandler_stub::bool_value = true;
impl->_security = NULL;
impl->bootstrap(sec);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_IDLE);
delete val;
val = new String("coaps://10.45.3.83]:5685");
impl->_current_state = M2MInterfaceImpl::STATE_IDLE;
m2msecurity_stub::string_value = val;
m2mnsdlinterface_stub::bool_value = true;
m2mconnectionhandler_stub::bool_value = true;
impl->_security = NULL;
impl->bootstrap(sec);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_IDLE);
delete val;
val = new String("coap://10.45.3.83:5685");
impl->_current_state = M2MInterfaceImpl::STATE_IDLE;
impl->_security = NULL;
m2msecurity_stub::string_value = val;
m2mnsdlinterface_stub::bool_value = true;
m2mconnectionhandler_stub::bool_value = true;
impl->bootstrap(sec);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_BOOTSTRAP);
delete val;
val = new String("coap://10.45.3.83:5685");
impl->_current_state = M2MInterfaceImpl::STATE_IDLE;
m2msecurity_stub::string_value = val;
m2mnsdlinterface_stub::bool_value = true;
m2mconnectionhandler_stub::bool_value = true;
impl->bootstrap(sec);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_BOOTSTRAP);
delete val;
val = new String("coap://10.45.3.83:5685");
m2msecurity_stub::string_value = val;
m2mconnectionhandler_stub::bool_value = true;
impl->bootstrap(sec);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_BOOTSTRAP);
impl->_current_state = M2MInterfaceImpl::STATE_IDLE;
m2mconnectionhandler_stub::bool_value = false;
// Ignore the event.
impl->_current_state = M2MInterfaceImpl::STATE_WAITING;
impl->bootstrap(sec);
m2mconnectionhandler_stub::bool_value = true;
impl->bootstrap(sec);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_WAITING);
CHECK(observer->error_occured == true);
delete val;
val = NULL;
delete sec;
}
void Test_M2MInterfaceImpl::test_cancel_bootstrap()
{
// Check for coverage, currently no implementation
impl->cancel_bootstrap();
}
void Test_M2MInterfaceImpl::test_register_object()
{
M2MSecurity *sec = new M2MSecurity(M2MSecurity::M2MServer);
m2msecurity_stub::int_value = 2;
M2MObject *object = new M2MObject(1, "test");
M2MObjectInstance *ins = object->create_object_instance();
ins->create_dynamic_resource(2,"type",M2MResourceInstance::STRING,false,false);
M2MObjectList list;
list.push_back(object);
String *val = new String("coaps://[2001:12:12:23::23:FF]:5685");
m2msecurity_stub::string_value = val;
m2mnsdlinterface_stub::bool_value = true;
m2mconnectionhandler_stub::bool_value = true;
impl->register_object(NULL,list);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_IDLE);
impl->register_object(sec,list);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_REGISTER);
impl->_current_state = M2MInterfaceImpl::STATE_IDLE;
impl->register_object(sec,list);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_REGISTER);
delete val;
val = new String("coaps://[10.45.3.83:5685");
impl->_current_state = M2MInterfaceImpl::STATE_IDLE;
m2msecurity_stub::string_value = val;
m2mnsdlinterface_stub::bool_value = true;
m2mconnectionhandler_stub::bool_value = true;
delete impl->_security;
impl->_security = NULL;
sec = new M2MSecurity(M2MSecurity::M2MServer);
impl->register_object(sec,list);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_IDLE);
CHECK(observer->error_occured == true);
observer->error_occured = false;
delete val;
val = new String("coaps://10.45.3.83]:5685");
impl->_current_state = M2MInterfaceImpl::STATE_IDLE;
m2msecurity_stub::string_value = val;
m2mnsdlinterface_stub::bool_value = true;
m2mconnectionhandler_stub::bool_value = true;
delete impl->_security;
impl->_security = NULL;
sec = new M2MSecurity(M2MSecurity::M2MServer);
impl->register_object(sec,list);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_IDLE);
CHECK(observer->error_occured == true);
observer->error_occured = false;
delete val;
val = new String("coaps://10.45.3.83:5685");
delete impl->_security;
impl->_security = NULL;
sec = new M2MSecurity(M2MSecurity::M2MServer);
impl->_current_state = M2MInterfaceImpl::STATE_IDLE;
m2msecurity_stub::string_value = val;
m2mnsdlinterface_stub::bool_value = true;
m2mconnectionhandler_stub::bool_value = true;
impl->register_object(sec,list);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_REGISTER);
observer->error_occured = false;
delete val;
val = new String("coap://10.45.3.83:5685");
delete impl->_security;
impl->_security = NULL;
sec = new M2MSecurity(M2MSecurity::M2MServer);
impl->_current_state = M2MInterfaceImpl::STATE_IDLE;
m2msecurity_stub::string_value = val;
m2mnsdlinterface_stub::bool_value = true;
m2mconnectionhandler_stub::bool_value = true;
impl->register_object(sec,list);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_REGISTER);
delete val;
val = new String("coap://10.45.3.83:5685");
impl->register_object(sec,list);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_REGISTER);
impl->_current_state = M2MInterfaceImpl::STATE_IDLE;
m2mconnectionhandler_stub::bool_value = true;
m2mnsdlinterface_stub::bool_value = false;
delete impl->_security;
impl->_security = NULL;
sec = new M2MSecurity(M2MSecurity::M2MServer);
impl->register_object(sec,list);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_IDLE);
CHECK(observer->error_occured == true);
impl->_current_state = M2MInterfaceImpl::STATE_BOOTSTRAP;
m2mconnectionhandler_stub::bool_value = true;
m2mnsdlinterface_stub::bool_value = true;
impl->register_object(sec,list);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_BOOTSTRAP);
CHECK(observer->error_occured == true);
impl->_current_state = M2MInterfaceImpl::STATE_BOOTSTRAP;
m2mconnectionhandler_stub::bool_value = true;
m2mnsdlinterface_stub::bool_value = true;
impl->register_object(sec,list);
CHECK(observer->error_occured == true);
delete val;
val = NULL;
list.clear();
delete object;
delete sec;
}
void Test_M2MInterfaceImpl::test_update_registration()
{
impl->_current_state = M2MInterfaceImpl::STATE_REGISTERED;
m2mnsdlinterface_stub::bool_value = true;
impl->update_registration(NULL,120);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_UPDATE_REGISTRATION);
impl->_current_state = M2MInterfaceImpl::STATE_REGISTERED;
m2mnsdlinterface_stub::bool_value = true;
impl->update_registration(NULL,120);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_UPDATE_REGISTRATION);
impl->_current_state = M2MInterfaceImpl::STATE_IDLE;
impl->_current_state = M2MInterfaceImpl::STATE_REGISTERED;
m2mnsdlinterface_stub::bool_value = false;
impl->update_registration(NULL,120);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_IDLE);
CHECK(observer->error_occured == true);
m2mnsdlinterface_stub::bool_value = true;
impl->update_registration(NULL,120);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_IDLE);
CHECK(observer->error_occured == true);
impl->_current_state = M2MInterfaceImpl::STATE_BOOTSTRAP;
impl->update_registration(NULL,120);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_BOOTSTRAP);
CHECK(observer->error_occured == true);
impl->update_registration(NULL,30);
CHECK(observer->error_occured == true);
impl->update_registration(NULL,120);
CHECK(observer->error_occured == true);
M2MObject *object = new M2MObject(1, "test");
M2MObjectInstance *ins = object->create_object_instance();
ins->create_dynamic_resource(2,"type",M2MResourceInstance::STRING,false,false);
M2MObjectList list;
list.push_back(object);
impl->_current_state = M2MInterfaceImpl::STATE_REGISTERED;
m2mnsdlinterface_stub::bool_value = true;
impl->update_registration(NULL, list);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_UPDATE_REGISTRATION);
list.clear();
impl->_current_state = M2MInterfaceImpl::STATE_REGISTERED;
m2mnsdlinterface_stub::bool_value = true;
impl->update_registration(NULL, list);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_UPDATE_REGISTRATION);
delete object;
}
void Test_M2MInterfaceImpl::test_unregister_object()
{
impl->_current_state = M2MInterfaceImpl::STATE_REGISTERED;
m2mnsdlinterface_stub::bool_value = true;
impl->unregister_object(NULL);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_WAITING);
impl->_current_state = M2MInterfaceImpl::STATE_REGISTERED;
m2mnsdlinterface_stub::bool_value = false;
impl->unregister_object(NULL);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_IDLE);
CHECK(observer->error_occured == true);
impl->_current_state = M2MInterfaceImpl::STATE_IDLE;
impl->unregister_object(NULL);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_IDLE);
CHECK(observer->error_occured == true);
}
void Test_M2MInterfaceImpl::test_set_queue_sleep_handler()
{
callback_handler cb(this,&Test_M2MInterfaceImpl::test_callback_handler);
impl->set_queue_sleep_handler(cb);
CHECK(impl->_callback_handler != NULL);
callback_handler cb1(NULL);
impl->set_queue_sleep_handler(cb1);
CHECK(impl->_callback_handler == NULL);
}
void Test_M2MInterfaceImpl::test_set_random_number_callback()
{
random_number_cb cb(&test_random_callback);
impl->set_random_number_callback(cb);
}
void Test_M2MInterfaceImpl::test_set_entropy_callback()
{
impl->set_entropy_callback(ent_cb);
}
void Test_M2MInterfaceImpl::test_set_platform_network_handler()
{
void *test = NULL;
impl->set_platform_network_handler(test);
}
void Test_M2MInterfaceImpl::test_coap_message_ready()
{
m2mconnectionhandler_stub::bool_value = true;
uint8_t *data_ptr = (uint8_t *)malloc(sizeof(uint8_t));
uint16_t data_len = sizeof(uint8_t);
sn_nsdl_addr_s *address_ptr = (sn_nsdl_addr_s*)malloc(sizeof(sn_nsdl_addr_s));
impl->coap_message_ready(data_ptr,data_len,address_ptr);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_IDLE);
impl->_current_state = M2MInterfaceImpl::STATE_WAITING;
impl->coap_message_ready(data_ptr,data_len,address_ptr);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_WAITING);
m2mconnectionhandler_stub::bool_value = false;
impl->coap_message_ready(data_ptr,data_len,address_ptr);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_IDLE);
CHECK(observer->error_occured == true);
m2mconnectionhandler_stub::bool_value = false;
impl->_current_state = M2MInterfaceImpl::STATE_WAITING;
impl->_reconnecting = true;
impl->coap_message_ready(data_ptr,data_len,address_ptr);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_IDLE);
CHECK(observer->error_occured == true);
free(address_ptr);
free(data_ptr);
}
void Test_M2MInterfaceImpl::test_client_registered()
{
impl->client_registered(NULL);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_REGISTERED);
CHECK(observer->registered == true);
}
void Test_M2MInterfaceImpl::test_registration_updated()
{
M2MServer *server = NULL;
impl->registration_updated(*server);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_REGISTERED);
CHECK(observer->registered == true);
}
void Test_M2MInterfaceImpl::test_registration_error()
{
impl->registration_error(1);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_IDLE);
CHECK(observer->error_occured == true);
observer->error_occured = false;
impl->registration_error(1, true);
CHECK(observer->error_occured == true);
observer->error_occured = false;
impl->registration_error(M2MInterface::UnregistrationFailed, true);
CHECK(observer->error_occured == true);
observer->error_occured = false;
impl->registration_error(M2MInterface::UnregistrationFailed, false);
CHECK(observer->error_occured == true);
STRCMP_EQUAL(impl->_error_description, ERROR_REASON_24);
}
void Test_M2MInterfaceImpl::test_client_unregistered()
{
impl->client_unregistered();
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_IDLE);
CHECK(observer->unregistered == true);
}
void Test_M2MInterfaceImpl::test_bootstrap_wait()
{
M2MSecurity *sec = new M2MSecurity(M2MSecurity::M2MServer);
impl->bootstrap_wait(sec);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_BOOTSTRAP_WAIT);
CHECK(impl->_security == sec);
CHECK(observer->bootstrapped == false);
delete sec;
}
void Test_M2MInterfaceImpl::test_bootstrap_error_wait()
{
impl->bootstrap_error_wait("bs-error");
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_BOOTSTRAP_ERROR_WAIT);
STRCMP_EQUAL(impl->_error_description, "bs-error");
CHECK(observer->bootstrapped == false);
}
void Test_M2MInterfaceImpl::test_bootstrap_error()
{
impl->bootstrap_error("server-internal-error");
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_IDLE);
for (int i = 0; i <= MBED_CLIENT_RECONNECTION_COUNT; i++) {
impl->bootstrap_error("server-error");
impl->_retry_timer_expired = true;
}
CHECK(observer->error_occured == true);
}
void Test_M2MInterfaceImpl::test_bootstrap_done()
{
M2MSecurity *sec = new M2MSecurity(M2MSecurity::M2MServer);
impl->bootstrap_done(sec);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_BOOTSTRAPPED);
CHECK(observer->bootstrapped == true);
delete sec;
}
void Test_M2MInterfaceImpl::test_coap_data_processed()
{
impl->coap_data_processed();
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_WAITING);
}
void Test_M2MInterfaceImpl::test_value_updated()
{
impl->value_updated(NULL);
CHECK(observer->val_updated == false);
M2MBaseTest b;
impl->value_updated(&b);
CHECK(observer->val_updated == true);
}
void Test_M2MInterfaceImpl::test_data_available()
{
uint8_t* data = (uint8_t*)malloc(sizeof(uint8_t));
uint16_t data_size = sizeof(uint8_t);
M2MConnectionObserver::SocketAddress *address = (M2MConnectionObserver::SocketAddress*)
malloc(sizeof(M2MConnectionObserver::SocketAddress));
address->_stack = M2MInterface::LwIP_IPv4;
m2mnsdlinterface_stub::bool_value = true;
impl->data_available(data,data_size,*address);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_WAITING);
address->_stack = M2MInterface::LwIP_IPv6;
m2mnsdlinterface_stub::bool_value = true;
impl->data_available(data,data_size,*address);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_WAITING);
address->_stack = M2MInterface::LwIP_IPv4;
m2mnsdlinterface_stub::bool_value = false;
impl->data_available(data,data_size,*address);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_WAITING);
CHECK(observer->error_occured == true);
free(data);
free(address);
}
void Test_M2MInterfaceImpl::test_socket_error()
{
for (int i = 0; i <= MBED_CLIENT_RECONNECTION_COUNT; i++) {
impl->socket_error(M2MConnectionHandler::SSL_CONNECTION_ERROR);
impl->_retry_timer_expired = true;
}
CHECK(observer->error_occured == true);
observer->error_occured = false;
impl->socket_error(M2MConnectionHandler::SOCKET_READ_ERROR, false);
CHECK(observer->error_occured == true);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_IDLE);
observer->error_occured = false;
impl->socket_error(M2MConnectionHandler::DNS_RESOLVING_ERROR, false);
CHECK(observer->error_occured == true);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_IDLE);
observer->error_occured = false;
impl->socket_error(M2MConnectionHandler::SOCKET_SEND_ERROR, false);
CHECK(observer->error_occured == true);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_IDLE);
observer->error_occured = false;
impl->socket_error(M2MConnectionHandler::SSL_HANDSHAKE_ERROR, false);
CHECK(observer->error_occured == true);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_IDLE);
observer->error_occured = false;
impl->socket_error(M2MConnectionHandler::SOCKET_ABORT, false);
CHECK(observer->error_occured == true);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_IDLE);
observer->error_occured = false;
impl->socket_error(M2MConnectionHandler::ERROR_NONE, false);
CHECK(observer->error_occured == false);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_IDLE);
observer->error_occured = false;
impl->_queue_mode_timer_ongoing = true;
impl->_binding_mode = M2MInterface::TCP_QUEUE;
impl->_callback_handler = callback_handler(this, &Test_M2MInterfaceImpl::test_callback_handler);
impl->socket_error(M2MConnectionHandler::SOCKET_SEND_ERROR, true);
CHECK(observer->error_occured == false);
}
void Test_M2MInterfaceImpl::test_address_ready()
{
M2MConnectionObserver::SocketAddress *address =
(M2MConnectionObserver::SocketAddress*) malloc(sizeof(M2MConnectionObserver::SocketAddress));
M2MConnectionObserver::ServerType server_type = M2MConnectionObserver::Bootstrap;
uint16_t server_port = 5685;
address->_stack = M2MInterface::LwIP_IPv6;
m2mnsdlinterface_stub::bool_value = true;
impl->address_ready(*address,server_type,server_port);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_BOOTSTRAP_RESOURCE_CREATED);
address->_stack = M2MInterface::LwIP_IPv4;
m2mnsdlinterface_stub::bool_value = true;
impl->address_ready(*address,server_type,server_port);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_BOOTSTRAP_RESOURCE_CREATED);
address->_stack = M2MInterface::LwIP_IPv6;
m2mnsdlinterface_stub::bool_value = false;
impl->address_ready(*address,server_type,server_port);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_IDLE);
CHECK(observer->error_occured == true);
// Test for Address resolving for LWM2M server
server_type = M2MConnectionObserver::LWM2MServer;
address->_stack = M2MInterface::LwIP_IPv4;
m2mnsdlinterface_stub::bool_value = true;
impl->address_ready(*address,server_type,server_port);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_REGISTER_ADDRESS_RESOLVED);
impl->address_ready(*address,server_type,server_port);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_REGISTER_ADDRESS_RESOLVED);
impl->_reconnection_state = M2MInterfaceImpl::WithUpdate;
impl->address_ready(*address,server_type,server_port);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_UPDATE_REGISTRATION);
impl->_reconnection_state = M2MInterfaceImpl::Unregistration;
impl->address_ready(*address,server_type,server_port);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_WAITING);
impl->_reconnection_state = M2MInterfaceImpl::None;
address->_stack = M2MInterface::LwIP_IPv6;
m2mnsdlinterface_stub::bool_value = false;
impl->address_ready(*address,server_type,server_port);
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_IDLE);
CHECK(observer->error_occured == true);
free(address);
}
void Test_M2MInterfaceImpl::test_data_sent()
{
m2mconnectionhandler_stub::bool_value = true;
impl->data_sent();
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_WAITING);
m2mconnectionhandler_stub::bool_value = false;
impl->data_sent();
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_WAITING);
CHECK(observer->error_occured == false);
impl->_callback_handler = callback_handler(this, &Test_M2MInterfaceImpl::test_callback_handler);
m2mconnectionhandler_stub::bool_value = true;
impl->_binding_mode = M2MInterface::UDP_QUEUE;
impl->data_sent();
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_WAITING);
impl->_binding_mode = M2MInterface::TCP_QUEUE;
impl->data_sent();
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_WAITING);
impl->_binding_mode = M2MInterface::SMS_QUEUE;
impl->data_sent();
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_WAITING);
impl->_binding_mode = M2MInterface::UDP_SMS_QUEUE;
impl->data_sent();
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_WAITING);
impl->_current_state = M2MInterfaceImpl::STATE_BOOTSTRAP_WAIT;
impl->data_sent();
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_BOOTSTRAPPED);
observer->error_occured = false;
impl->_current_state = M2MInterfaceImpl::STATE_BOOTSTRAP_ERROR_WAIT;
impl->data_sent();
CHECK(impl->_current_state == M2MInterfaceImpl::STATE_IDLE);
CHECK(observer->error_occured == true);
}
void Test_M2MInterfaceImpl::test_timer_expired()
{
visited = false;
impl->_callback_handler = NULL;
impl->timer_expired(M2MTimerObserver::QueueSleep);
CHECK(visited == false);
impl->_callback_handler = callback_handler(this, &Test_M2MInterfaceImpl::test_callback_handler);
visited = false;
impl->timer_expired(M2MTimerObserver::QueueSleep);
CHECK(visited == true);
visited = false;
impl->_bootstrapped = true;
impl->timer_expired(M2MTimerObserver::RetryTimer);
CHECK(impl->_retry_timer_expired == true);
impl->_bootstrapped = false;
impl->timer_expired(M2MTimerObserver::RetryTimer);
CHECK(impl->_retry_timer_expired == true);
impl->timer_expired(M2MTimerObserver::BootstrapFlowTimer);
CHECK(impl->_reconnecting == true);
impl->timer_expired(M2MTimerObserver::RegistrationFlowTimer);
CHECK(impl->_reconnecting == true);
/* Test reconnecting part in state_bootstrap() */
impl->_security = new M2MSecurity(M2MSecurity::Bootstrap);
impl->_bootstrapped = false;
impl->timer_expired(M2MTimerObserver::RetryTimer);
CHECK(impl->_retry_timer_expired == true);
delete impl->_security;
}
void Test_M2MInterfaceImpl::test_callback_handler()
{
visited = true;
}
uint32_t test_random_callback(void)
{
return 1;
}
void Test_M2MInterfaceImpl::test_update_endpoint()
{
const char *data = "name";
impl->update_endpoint(data);
}
void Test_M2MInterfaceImpl::test_update_domain()
{
const char *data = "domain";
impl->update_domain(data);
}
void Test_M2MInterfaceImpl::test_internal_endpoint_name()
{
String value;
*m2mnsdlinterface_stub::string_value = "test";
value = impl->internal_endpoint_name();
STRCMP_EQUAL(value.c_str(),m2mnsdlinterface_stub::string_value->c_str());
}
void Test_M2MInterfaceImpl::test_error_description()
{
char value[10];
strncpy(value, "error", 10);
strncpy(impl->_error_description, value, sizeof(impl->_error_description));
STRCMP_EQUAL(impl->error_description(), value);
}
|
/*=========================================================================
Program: Visualization Toolkit
Module: TestSeedWidgetNonUniformRepresentations.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
//
// This example tests the vtkSeedWidget by instantiating it with handles
// composed of varied geometric representations and constraints.
// There are 4 handles. They are composed of heterogeneous representations.
// One of them is passive and does not respond to user interaction.
// It also shows how they are placed in a non-interacitve mode (ie
// programmatically).
#include "vtkSeedWidget.h"
#include "vtkSeedRepresentation.h"
#include "vtkSphereSource.h"
#include "vtkPolyDataMapper.h"
#include "vtkActor.h"
#include "vtkRenderer.h"
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkCommand.h"
#include "vtkInteractorEventRecorder.h"
#include "vtkCoordinate.h"
#include "vtkMath.h"
#include "vtkHandleWidget.h"
#include "vtkPointHandleRepresentation3D.h"
#include "vtkAxisActor2D.h"
#include "vtkProperty2D.h"
#include "vtkOrientedPolygonalHandleRepresentation3D.h"
#include "vtkPointHandleRepresentation3D.h"
#include "vtkProperty.h"
#include "vtkGlyphSource2D.h"
#include "vtkPolyData.h"
#include "vtkSmartPointer.h"
#define VTK_CREATE(type, name) \
vtkSmartPointer<type> name = vtkSmartPointer<type>::New()
// This callback is responsible for setting the seed label.
class vtkSeedNonUniformRepresentationCallback : public vtkCommand
{
public:
static vtkSeedNonUniformRepresentationCallback *New()
{ return new vtkSeedNonUniformRepresentationCallback; }
void Execute( vtkObject *o, unsigned long event, void* ) VTK_OVERRIDE
{
vtkSeedWidget *sw = vtkSeedWidget::SafeDownCast(o);
if (sw && event == vtkCommand::PlacePointEvent)
{
std::cout << "Point placed, total of:" << this->SeedRepresentation->GetNumberOfSeeds() << "\n";
}
}
vtkSeedNonUniformRepresentationCallback() : SeedRepresentation(nullptr) {}
vtkSeedRepresentation *SeedRepresentation;
};
// The actual test function
int TestSeedWidgetNonUniformRepresentations(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
{
VTK_CREATE( vtkSphereSource, ss );
VTK_CREATE( vtkPolyDataMapper, mapper );
VTK_CREATE( vtkActor, actor );
VTK_CREATE( vtkRenderer, ren );
VTK_CREATE( vtkRenderWindow, renWin );
VTK_CREATE( vtkRenderWindowInteractor, iren );
VTK_CREATE( vtkSeedWidget, widget );
VTK_CREATE( vtkSeedRepresentation, seedRep );
VTK_CREATE( vtkGlyphSource2D, glyphs );
VTK_CREATE( vtkSeedNonUniformRepresentationCallback, scbk );
renWin->AddRenderer(ren);
iren->SetRenderWindow(renWin);
mapper->SetInputConnection(ss->GetOutputPort());
actor->SetMapper(mapper);
ren->AddActor(actor);
ren->SetBackground(0.1, 0.2, 0.4);
renWin->SetSize(500, 500);
widget->SetInteractor(iren);
widget->SetRepresentation(seedRep);
scbk->SeedRepresentation = seedRep;
widget->AddObserver(vtkCommand::PlacePointEvent,scbk);
iren->Initialize();
renWin->Render();
widget->EnabledOn();
// Now add some seeds programmatically...
// First, get out out of the mode where we are interactively defining seeds
widget->CompleteInteraction();
// Let's add a seed of type vtkOrientedPolygonalHandleRepresentation3D with
// a triangle glyph, facing the camera.
VTK_CREATE( vtkOrientedPolygonalHandleRepresentation3D, handleRep1 );
glyphs->SetGlyphType( VTK_TRIANGLE_GLYPH );
glyphs->SetScale( .1 );
glyphs->Update();
handleRep1->SetHandle(glyphs->GetOutput());
handleRep1->GetProperty()->SetColor(1,0,0);
handleRep1->SetLabelVisibility(1);
handleRep1->SetLabelText( "Seed-1" );
seedRep->SetHandleRepresentation( handleRep1 );
vtkHandleWidget * handleWidget1 = widget->CreateNewHandle();
handleWidget1->SetEnabled(1);
double p1[3] = { .3, .3, .6 };
seedRep->GetHandleRepresentation(0)->SetWorldPosition( p1 );
// Let's add a seed of type vtkPointHandleRepresentation3D with
// a triangle glyph, facing the camera.
VTK_CREATE( vtkPointHandleRepresentation3D, handleRep2 );
handleRep2->GetProperty()->SetColor(0,1,0);
seedRep->SetHandleRepresentation( handleRep2 );
vtkHandleWidget *handleWidget2 = widget->CreateNewHandle();
handleWidget2->SetEnabled(1);
double p2[3] = { .3, -.3, .6 };
seedRep->GetHandleRepresentation(1)->SetWorldPosition( p2 );
// Let's add a seed of type vtkOrientedPolygonalHandleRepresentation3D with
// a triangle glyph, facing the camera.
VTK_CREATE( vtkOrientedPolygonalHandleRepresentation3D, handleRep3 );
glyphs->SetGlyphType( VTK_THICKCROSS_GLYPH );
glyphs->Update();
handleRep3->SetHandle(glyphs->GetOutput());
handleRep3->GetProperty()->SetColor(1,1,0);
handleRep3->SetLabelVisibility(1);
handleRep3->SetLabelText( "Seed-2" );
seedRep->SetHandleRepresentation( handleRep3 );
vtkHandleWidget * handleWidget3 = widget->CreateNewHandle();
handleWidget3->SetEnabled(1);
double p3[3] = { -.3, .3, .6 };
seedRep->GetHandleRepresentation(2)->SetWorldPosition( p3 );
// Let's add a seed that does not respond to user interaction now.
VTK_CREATE( vtkOrientedPolygonalHandleRepresentation3D, handleRep4 );
glyphs->SetGlyphType( VTK_DIAMOND_GLYPH );
glyphs->Update();
handleRep4->SetHandle(glyphs->GetOutput());
handleRep4->GetProperty()->SetColor(1,0,1);
handleRep4->SetLabelVisibility(1);
handleRep4->SetLabelText( "Passive\nSeed" );
seedRep->SetHandleRepresentation( handleRep4 );
vtkHandleWidget * handleWidget4 = widget->CreateNewHandle();
handleWidget4->SetEnabled(1);
handleWidget4->ProcessEventsOff();
double p4[3] = { -.3, -.3, .6 };
seedRep->GetHandleRepresentation(3)->SetWorldPosition( p4 );
// Render..
renWin->Render();
iren->Start();
return EXIT_SUCCESS;
}
|
; ===============================================================
; Dec 2013
; ===============================================================
;
; int strcmp(const char *s1, const char *s2)
;
; Compare string s1 to string s2. Return when the first
; differing char is found with *s1 - *s2.
;
; ===============================================================
SECTION code_clib
SECTION code_string
PUBLIC asm_strcmp
asm_strcmp:
; enter : hl = char *s2
; de = char *s1
;
; exit : a = h = *s1-*s2 of first differing char
; de = ptr in s1 to first differing char or NUL if equal
;
; if s1==s2 : hl=0, nc+z flags set
; if s1<<s2 : hl<0, c+nz flags set
; if s1>>s2 : hl>0, nc+nz flag set
;
; uses : af, bc, de, hl
loop:
ld a,(de) ; a = *s1
IF __CPU_INTEL__ || __CPU_GBZ80__
cp (hl)
inc hl
ELSE
cpi ; *s1 - *s2
ENDIF
jr NZ,different
inc de
or a ; end of string?
jr NZ,loop
equal: ; both strings ended same time
dec de
ld l,a
ld h,a
ret
different:
dec hl
sub (hl)
ld h,a
ret
|
<%
from pwnlib.shellcraft.aarch64.linux import syscall
%>
<%page args="fd, file, type, flag"/>
<%docstring>
Invokes the syscall faccessat. See 'man 2 faccessat' for more information.
Arguments:
fd(int): fd
file(char): file
type(int): type
flag(int): flag
</%docstring>
${syscall('SYS_faccessat', fd, file, type, flag)}
|
; A140230: Binomial transform of [1, 2, -3, -4, 5, 6, -7, -8, 9, 10,...].
; 1,3,2,-6,-20,-28,-8,56,144,176,32,-352,-832,-960,-128,1920,4352,4864,512,-9728,-21504,-23552,-2048,47104,102400,110592,8192,-221184,-475136,-507904,-32768,1015808,2162688,2293760,131072,-4587520,-9699328,-10223616,-524288,20447232,42991616,45088768,2097152,-90177536,-188743680,-197132288,-8388608,394264576,822083584,855638016,33554432,-1711276032,-3556769792,-3690987520,-134217728,7381975040,15300820992,15837691904,536870912,-31675383808,-65498251264,-67645734912,-2147483648,135291469824,279172874240,287762808832,8589934592,-575525617664,-1185410973696,-1219770712064,-34359738368,2439541424128,5016521801728,5153960755200,137438953472,-10307921510400,-21165598834688,-21715354648576,-549755813888,43430709297152,89060441849856,91259465105408,2199023255552,-182518930210816,-373833953443840,-382630046466048,-8796093022208,765260092932096,1565704557953024,1600888930041856,35184372088832,-3201777860083712,-6544293208522752,-6685030696878080,-140737488355328
mov $1,1
mov $2,$0
lpb $2
add $0,$1
sub $1,$0
mul $0,2
sub $2,1
lpe
add $0,$1
mov $1,$0
|
; A162886: Even numbers in an alternating 1-based sum up to some odd nonprime.
; Submitted by Jamie Morken(w2)
; 24,42,54,60,78,84,96,114,132,138,144,150,168,174,180,186,204,216,222,234,240,258,264,276,282,294,306,312,324,330,348,354,366,372,384,390,402,414,420,432,438,444,450,456,474,480,486,492,504,510,516,528,534,546,558,564
mov $1,6
mov $2,$0
add $2,2
pow $2,2
lpb $2
add $1,4
sub $2,1
mov $3,$1
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
add $0,$3
sub $0,1
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
lpe
mov $0,$1
sub $0,14
div $0,4
mul $0,6
add $0,24
|
#######
# DRAW GAME BOARD INCLUDING NUMBERS
# ------------
# inputs: none
#######
draw_board:
# save variables
addi sp, sp, -36
sw ra 32(sp)
sw a1 28(sp)
sw a2 24(sp)
sw a3 20(sp)
sw a4 16(sp)
sw a5 12(sp)
sw t1 8(sp)
sw t2 4(sp)
sw t3 0(sp)
li a3 0xffffff # store color white in a3
addi t1, zero, DISPLAY_WIDTH # t1=loop end größe
addi t2, zero, BORDER_SIZE # t2=loop für dicke end größe
addi t3, zero, 2 # 2 linien horizontal
# horizontale linien
li a2, CELL_SIZE
li a5, 0 # number of current line
hori_line_loop:
li a4, 0 # a4 current line width
line_height_loop:
li a1, 0
hori_hori_loop:
jal draw_pixel
addi a1, a1, 1
blt a1, t1, hori_hori_loop
addi a4, a4, 1
addi a2, a2, 1
blt a4, t2, line_height_loop
addi a5, a5, 1
addi a2, a2, CELL_SIZE # nächste linie CELL_SIZE pixel weiter zeichnen
blt a5, t3, hori_line_loop
# vertikale linien
li a1, CELL_SIZE
li a5, 0 # number of current line
verti_line_loop:
li a4, 0 # a4 current line width
line_width_loop:
li a2, 0
verti_verti_loop:
jal draw_pixel
addi a2, a2, 1
blt a2, t1, verti_verti_loop
addi a4, a4, 1
addi a1, a1, 1
blt a4, t2, line_width_loop
addi a5, a5, 1
addi a1, a1, CELL_SIZE # nächste linie CELL_SIZE pixel weiter zeichnen
blt a5, t3, verti_line_loop
jal draw_board_numbers
# restore variables
lw ra 32(sp)
lw a1 28(sp)
lw a2 24(sp)
lw a3 20(sp)
lw a4 16(sp)
lw a5 12(sp)
lw t1 8(sp)
lw t2 4(sp)
lw t3 0(sp)
addi sp, sp, 36
ret
.include "draw_board_numbers.asm"
|
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r13
push %r15
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0x72c9, %r15
nop
nop
nop
nop
nop
add $50340, %r13
mov $0x6162636465666768, %rax
movq %rax, (%r15)
nop
nop
and $59402, %r10
lea addresses_WT_ht+0x707d, %rsi
lea addresses_UC_ht+0x1b8cd, %rdi
and %r11, %r11
mov $40, %rcx
rep movsb
nop
nop
nop
nop
nop
cmp $31728, %rsi
lea addresses_A_ht+0x1a14d, %r11
nop
nop
nop
xor $52459, %r13
movw $0x6162, (%r11)
nop
nop
nop
cmp $65389, %r11
lea addresses_WT_ht+0x1164d, %rsi
lea addresses_WC_ht+0x6ae5, %rdi
clflush (%rsi)
nop
nop
and %r15, %r15
mov $11, %rcx
rep movsl
nop
sub %r11, %r11
lea addresses_normal_ht+0xe9cd, %rsi
lea addresses_WT_ht+0x874b, %rdi
nop
nop
nop
nop
nop
cmp %r10, %r10
mov $94, %rcx
rep movsl
nop
nop
nop
nop
nop
xor %rcx, %rcx
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r15
pop %r13
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r12
push %r15
push %r8
push %r9
push %rsi
// Store
lea addresses_PSE+0x17d03, %r15
nop
nop
add $30618, %r9
movw $0x5152, (%r15)
nop
nop
nop
dec %r9
// Faulty Load
mov $0x3e29ad0000000fcd, %rsi
nop
nop
nop
nop
and %r12, %r12
mov (%rsi), %r10d
lea oracles, %r12
and $0xff, %r10
shlq $12, %r10
mov (%r12,%r10,1), %r10
pop %rsi
pop %r9
pop %r8
pop %r15
pop %r12
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_NC'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 1, 'AVXalign': True, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_PSE'}}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 4, 'NT': False, 'type': 'addresses_NC'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': True, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_WC_ht'}}
{'src': {'congruent': 3, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 8, 'same': False, 'type': 'addresses_UC_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_A_ht'}}
{'src': {'congruent': 6, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 2, 'same': False, 'type': 'addresses_WC_ht'}}
{'src': {'congruent': 8, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'congruent': 1, 'same': False, 'type': 'addresses_WT_ht'}}
{'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
*/
|
object_const_def ; object_event constants
const MRPSYCHICSHOUSE_FISHING_GURU
MrPsychicsHouse_MapScripts:
db 0 ; scene scripts
db 0 ; callbacks
MrPsychic:
faceplayer
opentext
checkevent EVENT_GOT_TM29_PSYCHIC
iftrue .AlreadyGotItem
writetext MrPsychicText1
buttonsound
verbosegivetmhm TM_PSYCHIC_M
iffalse .Done
setevent EVENT_GOT_TM29_PSYCHIC
.AlreadyGotItem:
writetext MrPsychicText2
waitbutton
.Done:
closetext
end
MrPsychicsHouseBookshelf:
jumpstd difficultbookshelf
MrPsychicText1:
text "…"
para "…"
para "…"
para "…I got it!"
para "You wanted this!"
done
MrPsychicText2:
text "TM29 is PSYCHIC."
para "It may lower the"
line "target's SPCL.DEF."
done
MrPsychicsHouse_MapEvents:
db 0, 0 ; filler
db 2 ; warp events
warp_event 2, 7, SAFFRON_CITY, 5
warp_event 3, 7, SAFFRON_CITY, 5
db 0 ; coord events
db 2 ; bg events
bg_event 0, 1, BGEVENT_READ, MrPsychicsHouseBookshelf
bg_event 1, 1, BGEVENT_READ, MrPsychicsHouseBookshelf
db 1 ; object events
object_event 5, 3, SPRITE_FISHING_GURU, SPRITEMOVEDATA_STANDING_LEFT, 0, 0, -1, -1, PAL_NPC_GREEN, OBJECTTYPE_SCRIPT, 0, MrPsychic, -1
|
#include "control_plane.h"
#include "bitstring.h"
#include <p4/v1/p4data.pb.h>
#include <p4/v1/p4runtime.pb.h>
#include <p4/v1/p4runtime.grpc.pb.h>
#include <p4/config/v1/p4info.pb.h>
#include <boost/range/adaptor/reversed.hpp>
#include <iomanip>
#include <iostream>
#include <stdexcept>
#include <string>
using p4::config::v1::P4Info;
ControlPlane::ControlPlane(
std::unique_ptr<SwitchConnection> connection,
std::unique_ptr<P4Info> p4Info, DeviceConfig config,
size_t nCtrls)
: con(std::move(connection))
, p4Info(std::move(p4Info))
, deviceConfig(std::move(config))
{
ctrls.reserve(nCtrls);
}
void ControlPlane::run()
{
using p4::v1::StreamMessageResponse;
using boost::adaptors::reverse;
if (!con->sendMasterArbitrationUpdate())
return;
StreamMessageResponse msg;
while(con->readStream(msg))
{
switch (msg.update_case())
{
case StreamMessageResponse::kArbitration:
handleArbitrationUpdate(msg.arbitration());
for (const auto &ctrl : ctrls)
ctrl->handleArbitrationUpdate(*con, msg.arbitration());
break;
case StreamMessageResponse::kPacket:
for (const auto &ctrl : reverse(ctrls))
if (ctrl->handlePacketIn(*con, msg.packet()))
break;
break;
case StreamMessageResponse::kDigest:
for (const auto &ctrl : reverse(ctrls))
if (ctrl->handleDigest(*con, msg.digest()))
break;
break;
case StreamMessageResponse::kIdleTimeoutNotification:
for (const auto &ctrl : reverse(ctrls))
if (ctrl->handleIdleTimeout(*con, msg.idle_timeout_notification()))
break;
break;
case StreamMessageResponse::kError:
for (const auto &ctrl : reverse(ctrls))
if (ctrl->handleError(*con, msg.error()))
break;
break;
default:
std::cout << "Unknown data plane event" << std::endl;
break;
}
}
}
void ControlPlane::handleArbitrationUpdate(const p4::v1::MasterArbitrationUpdate& arbUpdate)
{
if (!arbUpdate.status().code())
{
std::cout << "Elected as primary controller" << std::endl;
con->setPipelineConfig(*p4Info.get(), deviceConfig);
}
else
{
std::cout << "Other controller elected as primary" << std::endl;
}
}
|
; A075682: First differences of A075681.
; 0,2,19,39,61,86,114,145,179,216,256,299,345,394,446,501,559,620,684,751,821,894,970,1049,1131,1216,1304,1395,1489,1586,1686,1789,1895,2004,2116,2231,2349,2470,2594,2721,2851,2984,3120,3259,3401,3546
mov $4,$0
lpb $0
sub $0,1
trn $0,1
add $0,1
add $3,6
sub $4,1
add $4,$0
add $5,1
add $6,1
lpe
add $3,$4
mov $0,$3
add $0,$6
mov $2,3
add $2,$6
add $2,$0
add $4,$6
add $4,$2
sub $5,1
trn $5,1
sub $0,$5
mul $6,2
sub $0,$6
mov $3,3
sub $4,4
add $3,$4
add $0,$3
trn $0,3
|
; A073211: Sum of two powers of 11.
; 2,12,22,122,132,242,1332,1342,1452,2662,14642,14652,14762,15972,29282,161052,161062,161172,162382,175692,322102,1771562,1771572,1771682,1772892,1786202,1932612,3543122,19487172,19487182,19487292,19488502,19501812,19648222,21258732,38974342,214358882,214358892,214359002,214360212,214373522,214519932,216130442,233846052,428717762,2357947692,2357947702,2357947812,2357949022,2357962332,2358108742,2359719252,2377434862,2572306572,4715895382,25937424602,25937424612,25937424722,25937425932,25937439242
seq $0,131437 ; (A000012 * A131436) + (A131436 * A000012) - A000012.
seq $0,32931 ; Numbers whose set of base-11 digits is {1,2}.
mul $0,5
div $0,55
mul $0,10
add $0,2
|
; A109594: n followed by n^3 followed by n^2.
; Submitted by Jon Maiga
; 1,1,1,2,8,4,3,27,9,4,64,16,5,125,25,6,216,36,7,343,49,8,512,64,9,729,81,10,1000,100,11,1331,121,12,1728,144,13,2197,169,14,2744,196,15,3375,225,16,4096,256,17,4913,289,18,5832,324,19,6859,361,20,8000,400,21,9261,441,22,10648,484,23,12167,529,24,13824,576,25,15625,625,26,17576,676,27,19683,729,28,21952,784,29,24389,841,30,27000,900,31,29791,961,32,32768,1024,33,35937,1089,34
mov $1,$0
mul $0,2
mod $0,3
add $0,1
add $1,3
div $1,3
pow $1,$0
mov $0,$1
|
;------------------------------------------------------------------------------
;
; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at
; http://opensource.org/licenses/bsd-license.php.
;
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
;
; Module Name:
;
; EnableCache.Asm
;
; Abstract:
;
; Flush all caches with a WBINVD instruction, clear the CD bit of CR0 to 0, and clear
; the NW bit of CR0 to 0
;
; Notes:
;
;------------------------------------------------------------------------------
.code
;------------------------------------------------------------------------------
; VOID
; EFIAPI
; AsmEnableCache (
; VOID
; );
;------------------------------------------------------------------------------
AsmEnableCache PROC
wbinvd
mov rax, cr0
btr rax, 29
btr rax, 30
mov cr0, rax
ret
AsmEnableCache ENDP
END
|
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r13
push %r14
push %rax
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_A_ht+0x1c7dd, %rdx
nop
nop
nop
sub $57923, %r13
movl $0x61626364, (%rdx)
nop
nop
nop
nop
nop
dec %r12
lea addresses_A_ht+0xfdb5, %rbx
nop
nop
nop
nop
nop
add $32931, %rdx
movw $0x6162, (%rbx)
nop
cmp %r13, %r13
lea addresses_WC_ht+0x11376, %r12
clflush (%r12)
nop
nop
cmp %rax, %rax
movl $0x61626364, (%r12)
dec %r13
lea addresses_WT_ht+0x686d, %rsi
lea addresses_WT_ht+0xee6d, %rdi
nop
nop
add $27844, %r14
mov $43, %rcx
rep movsl
nop
nop
inc %r10
lea addresses_UC_ht+0x16e6d, %rbx
clflush (%rbx)
and $37641, %r14
movb $0x61, (%rbx)
nop
nop
nop
nop
and $54568, %r14
lea addresses_D_ht+0x176d, %rsi
lea addresses_D_ht+0x1bc6d, %rdi
nop
nop
and %r13, %r13
mov $51, %rcx
rep movsl
nop
nop
dec %r12
lea addresses_normal_ht+0x14ead, %r10
nop
nop
nop
nop
sub $6016, %r14
movups (%r10), %xmm0
vpextrq $0, %xmm0, %rdx
nop
add $31921, %rdx
lea addresses_WC_ht+0x15e29, %rdi
cmp $35965, %rbx
movups (%rdi), %xmm1
vpextrq $0, %xmm1, %r14
xor %rax, %rax
lea addresses_UC_ht+0xfe6d, %r12
clflush (%r12)
and %rsi, %rsi
mov (%r12), %edi
inc %r10
lea addresses_UC_ht+0x1ce71, %rsi
lea addresses_WT_ht+0x7e6d, %rdi
nop
nop
nop
nop
dec %rbx
mov $83, %rcx
rep movsl
nop
nop
mfence
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r14
pop %r13
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %r14
push %rax
push %rcx
push %rsi
// Faulty Load
lea addresses_D+0x1566d, %r11
nop
nop
cmp $10367, %r14
mov (%r11), %cx
lea oracles, %r14
and $0xff, %rcx
shlq $12, %rcx
mov (%r14,%rcx,1), %rcx
pop %rsi
pop %rcx
pop %rax
pop %r14
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_D', 'same': True, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_D', 'same': True, 'size': 2, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 2, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WC_ht', 'same': False, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 7, 'same': True}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_UC_ht', 'same': False, 'size': 1, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_D_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 9, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 16, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 16, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_UC_ht', 'same': False, 'size': 4, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_UC_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}, 'OP': 'REPM'}
{'36': 21829}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
|
SECTION code_driver
PUBLIC disk_status
EXTERN asm_disk_status
;------------------------------------------------------------------------------
; Routines that talk with the IDE drive, these should be called from diskio.h
; extern DSTATUS disk_status (BYTE pdrv) __smallc __z88dk_fastcall;
;
; get the ide drive status
defc disk_status = asm_disk_status
|
;/*
; * Microsoft Confidential
; * Copyright (C) Microsoft Corporation 1991
; * All Rights Reserved.
; */
; SCCSID = @(#)ifequ.asm 1.1 85/05/14
; SCCSID = @(#)ifequ.asm 1.1 85/05/14
;*************************************
; COMMAND EQUs which are switch dependant
IF1
IF IBM
%OUT DBCS Enabled IBM version
ELSE
%OUT Normal version
ENDIF
ENDIF
|
;
;
; Copyright (c) 2015 - 2021 by blindtiger. All rights reserved.
;
; The contents of this file are subject to the Mozilla Public 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.mozilla.org/MPL/
;
; Software distributed under the License is distributed on an "AS IS" basis,
; WITHOUT WARRANTY OF ANY KIND, either express or implied. SEe the License
; for the specific language governing rights and limitations under the
; License.
;
; The Initial Developer of the Original Code is blindtiger.
;
;
.686
.xlist
include callconv.inc
.list
_TEXT$00 SEGMENT PAGE 'CODE'
; b
; NTAPI
; _cmpbyte(
; __in s8 b1,
; __in s8 b2
; );
cPublicProc __cmpbyte, 2
mov cl, [esp + 4]
mov dl, [esp + 8]
cmp cl, dl
setnz al
stdRET __cmpbyte
stdENDP __cmpbyte
; b
; NTAPI
; _cmpword(
; __in s16 s1,
; __in s16 s2
; );
cPublicProc __cmpword, 2
mov cx, [esp + 4]
mov dx, [esp + 8]
cmp cx, dx
setnz al
stdRET __cmpword
stdENDP __cmpword
; b
; NTAPI
; _cmpdword(
; __in s32 l1,
; __in s32 l2
; );
cPublicProc __cmpdword, 2
mov ecx, [esp + 4]
mov edx, [esp + 8]
cmp ecx, edx
setnz al
stdRET __cmpdword
stdENDP __cmpdword
; b
; NTAPI
; _cmpqword(
; __in s64 ll1,
; __in s64 ll2
; );
cPublicProc __cmpqword, 4
mov ecx, [esp + 4]
mov edx, [esp + 0ch]
cmp ecx, edx
jnz @f
mov ecx, [esp + 8h]
mov edx, [esp + 10h]
cmp ecx, edx
@@ :
setnz al
stdRET __cmpqword
stdENDP __cmpqword
_TEXT$00 ends
end
|
//===-- COFFDumper.cpp - COFF-specific dumper -------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
///
/// \file
/// This file implements the COFF-specific dumper for llvm-readobj.
///
//===----------------------------------------------------------------------===//
#include "ARMWinEHPrinter.h"
#include "Error.h"
#include "ObjDumper.h"
#include "StackMapPrinter.h"
#include "Win64EHDumper.h"
#include "llvm-readobj.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/BinaryFormat/COFF.h"
#include "llvm/DebugInfo/CodeView/CVTypeVisitor.h"
#include "llvm/DebugInfo/CodeView/CodeView.h"
#include "llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h"
#include "llvm/DebugInfo/CodeView/DebugFrameDataSubsection.h"
#include "llvm/DebugInfo/CodeView/DebugInlineeLinesSubsection.h"
#include "llvm/DebugInfo/CodeView/DebugLinesSubsection.h"
#include "llvm/DebugInfo/CodeView/DebugStringTableSubsection.h"
#include "llvm/DebugInfo/CodeView/LazyRandomTypeCollection.h"
#include "llvm/DebugInfo/CodeView/Line.h"
#include "llvm/DebugInfo/CodeView/MergingTypeTableBuilder.h"
#include "llvm/DebugInfo/CodeView/RecordSerialization.h"
#include "llvm/DebugInfo/CodeView/SymbolDumpDelegate.h"
#include "llvm/DebugInfo/CodeView/SymbolDumper.h"
#include "llvm/DebugInfo/CodeView/SymbolRecord.h"
#include "llvm/DebugInfo/CodeView/TypeDumpVisitor.h"
#include "llvm/DebugInfo/CodeView/TypeHashing.h"
#include "llvm/DebugInfo/CodeView/TypeIndex.h"
#include "llvm/DebugInfo/CodeView/TypeRecord.h"
#include "llvm/DebugInfo/CodeView/TypeStreamMerger.h"
#include "llvm/DebugInfo/CodeView/TypeTableCollection.h"
#include "llvm/Object/COFF.h"
#include "llvm/Object/ObjectFile.h"
#include "llvm/Object/WindowsResource.h"
#include "llvm/Support/BinaryStreamReader.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/ConvertUTF.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/LEB128.h"
#include "llvm/Support/ScopedPrinter.h"
#include "llvm/Support/Win64EH.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
using namespace llvm::object;
using namespace llvm::codeview;
using namespace llvm::support;
using namespace llvm::Win64EH;
static inline Error createError(const Twine &Err) {
return make_error<StringError>(Err, object_error::parse_failed);
}
namespace {
struct LoadConfigTables {
uint64_t SEHTableVA = 0;
uint64_t SEHTableCount = 0;
uint32_t GuardFlags = 0;
uint64_t GuardFidTableVA = 0;
uint64_t GuardFidTableCount = 0;
uint64_t GuardLJmpTableVA = 0;
uint64_t GuardLJmpTableCount = 0;
};
class COFFDumper : public ObjDumper {
public:
friend class COFFObjectDumpDelegate;
COFFDumper(const llvm::object::COFFObjectFile *Obj, ScopedPrinter &Writer)
: ObjDumper(Writer), Obj(Obj), Writer(Writer), Types(100) {}
void printFileHeaders() override;
void printSectionHeaders() override;
void printRelocations() override;
void printUnwindInfo() override;
void printNeededLibraries() override;
void printCOFFImports() override;
void printCOFFExports() override;
void printCOFFDirectives() override;
void printCOFFBaseReloc() override;
void printCOFFDebugDirectory() override;
void printCOFFResources() override;
void printCOFFLoadConfig() override;
void printCodeViewDebugInfo() override;
void mergeCodeViewTypes(llvm::codeview::MergingTypeTableBuilder &CVIDs,
llvm::codeview::MergingTypeTableBuilder &CVTypes,
llvm::codeview::GlobalTypeTableBuilder &GlobalCVIDs,
llvm::codeview::GlobalTypeTableBuilder &GlobalCVTypes,
bool GHash) override;
void printStackMap() const override;
void printAddrsig() override;
private:
void printSymbols() override;
void printDynamicSymbols() override;
void printSymbol(const SymbolRef &Sym);
void printRelocation(const SectionRef &Section, const RelocationRef &Reloc,
uint64_t Bias = 0);
void printDataDirectory(uint32_t Index, const std::string &FieldName);
void printDOSHeader(const dos_header *DH);
template <class PEHeader> void printPEHeader(const PEHeader *Hdr);
void printBaseOfDataField(const pe32_header *Hdr);
void printBaseOfDataField(const pe32plus_header *Hdr);
template <typename T>
void printCOFFLoadConfig(const T *Conf, LoadConfigTables &Tables);
typedef void (*PrintExtraCB)(raw_ostream &, const uint8_t *);
void printRVATable(uint64_t TableVA, uint64_t Count, uint64_t EntrySize,
PrintExtraCB PrintExtra = 0);
void printCodeViewSymbolSection(StringRef SectionName, const SectionRef &Section);
void printCodeViewTypeSection(StringRef SectionName, const SectionRef &Section);
StringRef getTypeName(TypeIndex Ty);
StringRef getFileNameForFileOffset(uint32_t FileOffset);
void printFileNameForOffset(StringRef Label, uint32_t FileOffset);
void printTypeIndex(StringRef FieldName, TypeIndex TI) {
// Forward to CVTypeDumper for simplicity.
codeview::printTypeIndex(Writer, FieldName, TI, Types);
}
void printCodeViewSymbolsSubsection(StringRef Subsection,
const SectionRef &Section,
StringRef SectionContents);
void printCodeViewFileChecksums(StringRef Subsection);
void printCodeViewInlineeLines(StringRef Subsection);
void printRelocatedField(StringRef Label, const coff_section *Sec,
uint32_t RelocOffset, uint32_t Offset,
StringRef *RelocSym = nullptr);
uint32_t countTotalTableEntries(ResourceSectionRef RSF,
const coff_resource_dir_table &Table,
StringRef Level);
void printResourceDirectoryTable(ResourceSectionRef RSF,
const coff_resource_dir_table &Table,
StringRef Level);
void printBinaryBlockWithRelocs(StringRef Label, const SectionRef &Sec,
StringRef SectionContents, StringRef Block);
/// Given a .debug$S section, find the string table and file checksum table.
void initializeFileAndStringTables(BinaryStreamReader &Reader);
void cacheRelocations();
std::error_code resolveSymbol(const coff_section *Section, uint64_t Offset,
SymbolRef &Sym);
std::error_code resolveSymbolName(const coff_section *Section,
uint64_t Offset, StringRef &Name);
std::error_code resolveSymbolName(const coff_section *Section,
StringRef SectionContents,
const void *RelocPtr, StringRef &Name);
void printImportedSymbols(iterator_range<imported_symbol_iterator> Range);
void printDelayImportedSymbols(
const DelayImportDirectoryEntryRef &I,
iterator_range<imported_symbol_iterator> Range);
typedef DenseMap<const coff_section*, std::vector<RelocationRef> > RelocMapTy;
const llvm::object::COFFObjectFile *Obj;
bool RelocCached = false;
RelocMapTy RelocMap;
DebugChecksumsSubsectionRef CVFileChecksumTable;
DebugStringTableSubsectionRef CVStringTable;
/// Track the compilation CPU type. S_COMPILE3 symbol records typically come
/// first, but if we don't see one, just assume an X64 CPU type. It is common.
CPUType CompilationCPUType = CPUType::X64;
ScopedPrinter &Writer;
BinaryByteStream TypeContents;
LazyRandomTypeCollection Types;
};
class COFFObjectDumpDelegate : public SymbolDumpDelegate {
public:
COFFObjectDumpDelegate(COFFDumper &CD, const SectionRef &SR,
const COFFObjectFile *Obj, StringRef SectionContents)
: CD(CD), SR(SR), SectionContents(SectionContents) {
Sec = Obj->getCOFFSection(SR);
}
uint32_t getRecordOffset(BinaryStreamReader Reader) override {
ArrayRef<uint8_t> Data;
if (auto EC = Reader.readLongestContiguousChunk(Data)) {
llvm::consumeError(std::move(EC));
return 0;
}
return Data.data() - SectionContents.bytes_begin();
}
void printRelocatedField(StringRef Label, uint32_t RelocOffset,
uint32_t Offset, StringRef *RelocSym) override {
CD.printRelocatedField(Label, Sec, RelocOffset, Offset, RelocSym);
}
void printBinaryBlockWithRelocs(StringRef Label,
ArrayRef<uint8_t> Block) override {
StringRef SBlock(reinterpret_cast<const char *>(Block.data()),
Block.size());
if (opts::CodeViewSubsectionBytes)
CD.printBinaryBlockWithRelocs(Label, SR, SectionContents, SBlock);
}
StringRef getFileNameForFileOffset(uint32_t FileOffset) override {
return CD.getFileNameForFileOffset(FileOffset);
}
DebugStringTableSubsectionRef getStringTable() override {
return CD.CVStringTable;
}
private:
COFFDumper &CD;
const SectionRef &SR;
const coff_section *Sec;
StringRef SectionContents;
};
} // end namespace
namespace llvm {
std::error_code createCOFFDumper(const object::ObjectFile *Obj,
ScopedPrinter &Writer,
std::unique_ptr<ObjDumper> &Result) {
const COFFObjectFile *COFFObj = dyn_cast<COFFObjectFile>(Obj);
if (!COFFObj)
return readobj_error::unsupported_obj_file_format;
Result.reset(new COFFDumper(COFFObj, Writer));
return readobj_error::success;
}
} // namespace llvm
// Given a section and an offset into this section the function returns the
// symbol used for the relocation at the offset.
std::error_code COFFDumper::resolveSymbol(const coff_section *Section,
uint64_t Offset, SymbolRef &Sym) {
cacheRelocations();
const auto &Relocations = RelocMap[Section];
auto SymI = Obj->symbol_end();
for (const auto &Relocation : Relocations) {
uint64_t RelocationOffset = Relocation.getOffset();
if (RelocationOffset == Offset) {
SymI = Relocation.getSymbol();
break;
}
}
if (SymI == Obj->symbol_end())
return readobj_error::unknown_symbol;
Sym = *SymI;
return readobj_error::success;
}
// Given a section and an offset into this section the function returns the name
// of the symbol used for the relocation at the offset.
std::error_code COFFDumper::resolveSymbolName(const coff_section *Section,
uint64_t Offset,
StringRef &Name) {
SymbolRef Symbol;
if (std::error_code EC = resolveSymbol(Section, Offset, Symbol))
return EC;
Expected<StringRef> NameOrErr = Symbol.getName();
if (!NameOrErr)
return errorToErrorCode(NameOrErr.takeError());
Name = *NameOrErr;
return std::error_code();
}
// Helper for when you have a pointer to real data and you want to know about
// relocations against it.
std::error_code COFFDumper::resolveSymbolName(const coff_section *Section,
StringRef SectionContents,
const void *RelocPtr,
StringRef &Name) {
assert(SectionContents.data() < RelocPtr &&
RelocPtr < SectionContents.data() + SectionContents.size() &&
"pointer to relocated object is not in section");
uint64_t Offset = ptrdiff_t(reinterpret_cast<const char *>(RelocPtr) -
SectionContents.data());
return resolveSymbolName(Section, Offset, Name);
}
void COFFDumper::printRelocatedField(StringRef Label, const coff_section *Sec,
uint32_t RelocOffset, uint32_t Offset,
StringRef *RelocSym) {
StringRef SymStorage;
StringRef &Symbol = RelocSym ? *RelocSym : SymStorage;
if (!resolveSymbolName(Sec, RelocOffset, Symbol))
W.printSymbolOffset(Label, Symbol, Offset);
else
W.printHex(Label, RelocOffset);
}
void COFFDumper::printBinaryBlockWithRelocs(StringRef Label,
const SectionRef &Sec,
StringRef SectionContents,
StringRef Block) {
W.printBinaryBlock(Label, Block);
assert(SectionContents.begin() < Block.begin() &&
SectionContents.end() >= Block.end() &&
"Block is not contained in SectionContents");
uint64_t OffsetStart = Block.data() - SectionContents.data();
uint64_t OffsetEnd = OffsetStart + Block.size();
W.flush();
cacheRelocations();
ListScope D(W, "BlockRelocations");
const coff_section *Section = Obj->getCOFFSection(Sec);
const auto &Relocations = RelocMap[Section];
for (const auto &Relocation : Relocations) {
uint64_t RelocationOffset = Relocation.getOffset();
if (OffsetStart <= RelocationOffset && RelocationOffset < OffsetEnd)
printRelocation(Sec, Relocation, OffsetStart);
}
}
static const EnumEntry<COFF::MachineTypes> ImageFileMachineType[] = {
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_FILE_MACHINE_UNKNOWN ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_FILE_MACHINE_AM33 ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_FILE_MACHINE_AMD64 ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_FILE_MACHINE_ARM ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_FILE_MACHINE_ARM64 ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_FILE_MACHINE_ARMNT ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_FILE_MACHINE_EBC ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_FILE_MACHINE_I386 ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_FILE_MACHINE_IA64 ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_FILE_MACHINE_M32R ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_FILE_MACHINE_MIPS16 ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_FILE_MACHINE_MIPSFPU ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_FILE_MACHINE_MIPSFPU16),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_FILE_MACHINE_POWERPC ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_FILE_MACHINE_POWERPCFP),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_FILE_MACHINE_R4000 ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_FILE_MACHINE_SH3 ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_FILE_MACHINE_SH3DSP ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_FILE_MACHINE_SH4 ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_FILE_MACHINE_SH5 ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_FILE_MACHINE_THUMB ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_FILE_MACHINE_WCEMIPSV2)
};
static const EnumEntry<COFF::Characteristics> ImageFileCharacteristics[] = {
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_FILE_RELOCS_STRIPPED ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_FILE_EXECUTABLE_IMAGE ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_FILE_LINE_NUMS_STRIPPED ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_FILE_LOCAL_SYMS_STRIPPED ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_FILE_AGGRESSIVE_WS_TRIM ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_FILE_LARGE_ADDRESS_AWARE ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_FILE_BYTES_REVERSED_LO ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_FILE_32BIT_MACHINE ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_FILE_DEBUG_STRIPPED ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_FILE_NET_RUN_FROM_SWAP ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_FILE_SYSTEM ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_FILE_DLL ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_FILE_UP_SYSTEM_ONLY ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_FILE_BYTES_REVERSED_HI )
};
static const EnumEntry<COFF::WindowsSubsystem> PEWindowsSubsystem[] = {
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SUBSYSTEM_UNKNOWN ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SUBSYSTEM_NATIVE ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SUBSYSTEM_WINDOWS_GUI ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SUBSYSTEM_WINDOWS_CUI ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SUBSYSTEM_POSIX_CUI ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SUBSYSTEM_WINDOWS_CE_GUI ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SUBSYSTEM_EFI_APPLICATION ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SUBSYSTEM_EFI_ROM ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SUBSYSTEM_XBOX ),
};
static const EnumEntry<COFF::DLLCharacteristics> PEDLLCharacteristics[] = {
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_DLL_CHARACTERISTICS_FORCE_INTEGRITY ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_DLL_CHARACTERISTICS_NX_COMPAT ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_DLL_CHARACTERISTICS_NO_ISOLATION ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_DLL_CHARACTERISTICS_NO_SEH ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_DLL_CHARACTERISTICS_NO_BIND ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_DLL_CHARACTERISTICS_APPCONTAINER ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_DLL_CHARACTERISTICS_WDM_DRIVER ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_DLL_CHARACTERISTICS_GUARD_CF ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE),
};
static const EnumEntry<COFF::ExtendedDLLCharacteristics>
PEExtendedDLLCharacteristics[] = {
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_DLL_CHARACTERISTICS_EX_CET_COMPAT),
};
static const EnumEntry<COFF::SectionCharacteristics>
ImageSectionCharacteristics[] = {
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SCN_TYPE_NOLOAD ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SCN_TYPE_NO_PAD ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SCN_CNT_CODE ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SCN_CNT_INITIALIZED_DATA ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SCN_CNT_UNINITIALIZED_DATA),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SCN_LNK_OTHER ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SCN_LNK_INFO ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SCN_LNK_REMOVE ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SCN_LNK_COMDAT ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SCN_GPREL ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SCN_MEM_PURGEABLE ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SCN_MEM_16BIT ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SCN_MEM_LOCKED ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SCN_MEM_PRELOAD ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_1BYTES ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_2BYTES ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_4BYTES ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_8BYTES ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_16BYTES ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_32BYTES ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_64BYTES ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_128BYTES ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_256BYTES ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_512BYTES ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_1024BYTES ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_2048BYTES ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_4096BYTES ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SCN_ALIGN_8192BYTES ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SCN_LNK_NRELOC_OVFL ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SCN_MEM_DISCARDABLE ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SCN_MEM_NOT_CACHED ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SCN_MEM_NOT_PAGED ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SCN_MEM_SHARED ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SCN_MEM_EXECUTE ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SCN_MEM_READ ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_SCN_MEM_WRITE )
};
static const EnumEntry<COFF::SymbolBaseType> ImageSymType[] = {
{ "Null" , COFF::IMAGE_SYM_TYPE_NULL },
{ "Void" , COFF::IMAGE_SYM_TYPE_VOID },
{ "Char" , COFF::IMAGE_SYM_TYPE_CHAR },
{ "Short" , COFF::IMAGE_SYM_TYPE_SHORT },
{ "Int" , COFF::IMAGE_SYM_TYPE_INT },
{ "Long" , COFF::IMAGE_SYM_TYPE_LONG },
{ "Float" , COFF::IMAGE_SYM_TYPE_FLOAT },
{ "Double", COFF::IMAGE_SYM_TYPE_DOUBLE },
{ "Struct", COFF::IMAGE_SYM_TYPE_STRUCT },
{ "Union" , COFF::IMAGE_SYM_TYPE_UNION },
{ "Enum" , COFF::IMAGE_SYM_TYPE_ENUM },
{ "MOE" , COFF::IMAGE_SYM_TYPE_MOE },
{ "Byte" , COFF::IMAGE_SYM_TYPE_BYTE },
{ "Word" , COFF::IMAGE_SYM_TYPE_WORD },
{ "UInt" , COFF::IMAGE_SYM_TYPE_UINT },
{ "DWord" , COFF::IMAGE_SYM_TYPE_DWORD }
};
static const EnumEntry<COFF::SymbolComplexType> ImageSymDType[] = {
{ "Null" , COFF::IMAGE_SYM_DTYPE_NULL },
{ "Pointer" , COFF::IMAGE_SYM_DTYPE_POINTER },
{ "Function", COFF::IMAGE_SYM_DTYPE_FUNCTION },
{ "Array" , COFF::IMAGE_SYM_DTYPE_ARRAY }
};
static const EnumEntry<COFF::SymbolStorageClass> ImageSymClass[] = {
{ "EndOfFunction" , COFF::IMAGE_SYM_CLASS_END_OF_FUNCTION },
{ "Null" , COFF::IMAGE_SYM_CLASS_NULL },
{ "Automatic" , COFF::IMAGE_SYM_CLASS_AUTOMATIC },
{ "External" , COFF::IMAGE_SYM_CLASS_EXTERNAL },
{ "Static" , COFF::IMAGE_SYM_CLASS_STATIC },
{ "Register" , COFF::IMAGE_SYM_CLASS_REGISTER },
{ "ExternalDef" , COFF::IMAGE_SYM_CLASS_EXTERNAL_DEF },
{ "Label" , COFF::IMAGE_SYM_CLASS_LABEL },
{ "UndefinedLabel" , COFF::IMAGE_SYM_CLASS_UNDEFINED_LABEL },
{ "MemberOfStruct" , COFF::IMAGE_SYM_CLASS_MEMBER_OF_STRUCT },
{ "Argument" , COFF::IMAGE_SYM_CLASS_ARGUMENT },
{ "StructTag" , COFF::IMAGE_SYM_CLASS_STRUCT_TAG },
{ "MemberOfUnion" , COFF::IMAGE_SYM_CLASS_MEMBER_OF_UNION },
{ "UnionTag" , COFF::IMAGE_SYM_CLASS_UNION_TAG },
{ "TypeDefinition" , COFF::IMAGE_SYM_CLASS_TYPE_DEFINITION },
{ "UndefinedStatic", COFF::IMAGE_SYM_CLASS_UNDEFINED_STATIC },
{ "EnumTag" , COFF::IMAGE_SYM_CLASS_ENUM_TAG },
{ "MemberOfEnum" , COFF::IMAGE_SYM_CLASS_MEMBER_OF_ENUM },
{ "RegisterParam" , COFF::IMAGE_SYM_CLASS_REGISTER_PARAM },
{ "BitField" , COFF::IMAGE_SYM_CLASS_BIT_FIELD },
{ "Block" , COFF::IMAGE_SYM_CLASS_BLOCK },
{ "Function" , COFF::IMAGE_SYM_CLASS_FUNCTION },
{ "EndOfStruct" , COFF::IMAGE_SYM_CLASS_END_OF_STRUCT },
{ "File" , COFF::IMAGE_SYM_CLASS_FILE },
{ "Section" , COFF::IMAGE_SYM_CLASS_SECTION },
{ "WeakExternal" , COFF::IMAGE_SYM_CLASS_WEAK_EXTERNAL },
{ "CLRToken" , COFF::IMAGE_SYM_CLASS_CLR_TOKEN }
};
static const EnumEntry<COFF::COMDATType> ImageCOMDATSelect[] = {
{ "NoDuplicates", COFF::IMAGE_COMDAT_SELECT_NODUPLICATES },
{ "Any" , COFF::IMAGE_COMDAT_SELECT_ANY },
{ "SameSize" , COFF::IMAGE_COMDAT_SELECT_SAME_SIZE },
{ "ExactMatch" , COFF::IMAGE_COMDAT_SELECT_EXACT_MATCH },
{ "Associative" , COFF::IMAGE_COMDAT_SELECT_ASSOCIATIVE },
{ "Largest" , COFF::IMAGE_COMDAT_SELECT_LARGEST },
{ "Newest" , COFF::IMAGE_COMDAT_SELECT_NEWEST }
};
static const EnumEntry<COFF::DebugType> ImageDebugType[] = {
{"Unknown", COFF::IMAGE_DEBUG_TYPE_UNKNOWN},
{"COFF", COFF::IMAGE_DEBUG_TYPE_COFF},
{"CodeView", COFF::IMAGE_DEBUG_TYPE_CODEVIEW},
{"FPO", COFF::IMAGE_DEBUG_TYPE_FPO},
{"Misc", COFF::IMAGE_DEBUG_TYPE_MISC},
{"Exception", COFF::IMAGE_DEBUG_TYPE_EXCEPTION},
{"Fixup", COFF::IMAGE_DEBUG_TYPE_FIXUP},
{"OmapToSrc", COFF::IMAGE_DEBUG_TYPE_OMAP_TO_SRC},
{"OmapFromSrc", COFF::IMAGE_DEBUG_TYPE_OMAP_FROM_SRC},
{"Borland", COFF::IMAGE_DEBUG_TYPE_BORLAND},
{"Reserved10", COFF::IMAGE_DEBUG_TYPE_RESERVED10},
{"CLSID", COFF::IMAGE_DEBUG_TYPE_CLSID},
{"VCFeature", COFF::IMAGE_DEBUG_TYPE_VC_FEATURE},
{"POGO", COFF::IMAGE_DEBUG_TYPE_POGO},
{"ILTCG", COFF::IMAGE_DEBUG_TYPE_ILTCG},
{"MPX", COFF::IMAGE_DEBUG_TYPE_MPX},
{"Repro", COFF::IMAGE_DEBUG_TYPE_REPRO},
{"ExtendedDLLCharacteristics",
COFF::IMAGE_DEBUG_TYPE_EX_DLLCHARACTERISTICS},
};
static const EnumEntry<COFF::WeakExternalCharacteristics>
WeakExternalCharacteristics[] = {
{ "NoLibrary", COFF::IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY },
{ "Library" , COFF::IMAGE_WEAK_EXTERN_SEARCH_LIBRARY },
{ "Alias" , COFF::IMAGE_WEAK_EXTERN_SEARCH_ALIAS }
};
static const EnumEntry<uint32_t> SubSectionTypes[] = {
LLVM_READOBJ_ENUM_CLASS_ENT(DebugSubsectionKind, Symbols),
LLVM_READOBJ_ENUM_CLASS_ENT(DebugSubsectionKind, Lines),
LLVM_READOBJ_ENUM_CLASS_ENT(DebugSubsectionKind, StringTable),
LLVM_READOBJ_ENUM_CLASS_ENT(DebugSubsectionKind, FileChecksums),
LLVM_READOBJ_ENUM_CLASS_ENT(DebugSubsectionKind, FrameData),
LLVM_READOBJ_ENUM_CLASS_ENT(DebugSubsectionKind, InlineeLines),
LLVM_READOBJ_ENUM_CLASS_ENT(DebugSubsectionKind, CrossScopeImports),
LLVM_READOBJ_ENUM_CLASS_ENT(DebugSubsectionKind, CrossScopeExports),
LLVM_READOBJ_ENUM_CLASS_ENT(DebugSubsectionKind, ILLines),
LLVM_READOBJ_ENUM_CLASS_ENT(DebugSubsectionKind, FuncMDTokenMap),
LLVM_READOBJ_ENUM_CLASS_ENT(DebugSubsectionKind, TypeMDTokenMap),
LLVM_READOBJ_ENUM_CLASS_ENT(DebugSubsectionKind, MergedAssemblyInput),
LLVM_READOBJ_ENUM_CLASS_ENT(DebugSubsectionKind, CoffSymbolRVA),
};
static const EnumEntry<uint32_t> FrameDataFlags[] = {
LLVM_READOBJ_ENUM_ENT(FrameData, HasSEH),
LLVM_READOBJ_ENUM_ENT(FrameData, HasEH),
LLVM_READOBJ_ENUM_ENT(FrameData, IsFunctionStart),
};
static const EnumEntry<uint8_t> FileChecksumKindNames[] = {
LLVM_READOBJ_ENUM_CLASS_ENT(FileChecksumKind, None),
LLVM_READOBJ_ENUM_CLASS_ENT(FileChecksumKind, MD5),
LLVM_READOBJ_ENUM_CLASS_ENT(FileChecksumKind, SHA1),
LLVM_READOBJ_ENUM_CLASS_ENT(FileChecksumKind, SHA256),
};
template <typename T>
static std::error_code getSymbolAuxData(const COFFObjectFile *Obj,
COFFSymbolRef Symbol,
uint8_t AuxSymbolIdx, const T *&Aux) {
ArrayRef<uint8_t> AuxData = Obj->getSymbolAuxData(Symbol);
AuxData = AuxData.slice(AuxSymbolIdx * Obj->getSymbolTableEntrySize());
Aux = reinterpret_cast<const T*>(AuxData.data());
return readobj_error::success;
}
void COFFDumper::cacheRelocations() {
if (RelocCached)
return;
RelocCached = true;
for (const SectionRef &S : Obj->sections()) {
const coff_section *Section = Obj->getCOFFSection(S);
for (const RelocationRef &Reloc : S.relocations())
RelocMap[Section].push_back(Reloc);
// Sort relocations by address.
llvm::sort(RelocMap[Section], [](RelocationRef L, RelocationRef R) {
return L.getOffset() < R.getOffset();
});
}
}
void COFFDumper::printDataDirectory(uint32_t Index,
const std::string &FieldName) {
const data_directory *Data;
if (Obj->getDataDirectory(Index, Data))
return;
W.printHex(FieldName + "RVA", Data->RelativeVirtualAddress);
W.printHex(FieldName + "Size", Data->Size);
}
void COFFDumper::printFileHeaders() {
time_t TDS = Obj->getTimeDateStamp();
char FormattedTime[20] = { };
strftime(FormattedTime, 20, "%Y-%m-%d %H:%M:%S", gmtime(&TDS));
{
DictScope D(W, "ImageFileHeader");
W.printEnum ("Machine", Obj->getMachine(),
makeArrayRef(ImageFileMachineType));
W.printNumber("SectionCount", Obj->getNumberOfSections());
W.printHex ("TimeDateStamp", FormattedTime, Obj->getTimeDateStamp());
W.printHex ("PointerToSymbolTable", Obj->getPointerToSymbolTable());
W.printNumber("SymbolCount", Obj->getNumberOfSymbols());
W.printNumber("OptionalHeaderSize", Obj->getSizeOfOptionalHeader());
W.printFlags ("Characteristics", Obj->getCharacteristics(),
makeArrayRef(ImageFileCharacteristics));
}
// Print PE header. This header does not exist if this is an object file and
// not an executable.
if (const pe32_header *PEHeader = Obj->getPE32Header())
printPEHeader<pe32_header>(PEHeader);
if (const pe32plus_header *PEPlusHeader = Obj->getPE32PlusHeader())
printPEHeader<pe32plus_header>(PEPlusHeader);
if (const dos_header *DH = Obj->getDOSHeader())
printDOSHeader(DH);
}
void COFFDumper::printDOSHeader(const dos_header *DH) {
DictScope D(W, "DOSHeader");
W.printString("Magic", StringRef(DH->Magic, sizeof(DH->Magic)));
W.printNumber("UsedBytesInTheLastPage", DH->UsedBytesInTheLastPage);
W.printNumber("FileSizeInPages", DH->FileSizeInPages);
W.printNumber("NumberOfRelocationItems", DH->NumberOfRelocationItems);
W.printNumber("HeaderSizeInParagraphs", DH->HeaderSizeInParagraphs);
W.printNumber("MinimumExtraParagraphs", DH->MinimumExtraParagraphs);
W.printNumber("MaximumExtraParagraphs", DH->MaximumExtraParagraphs);
W.printNumber("InitialRelativeSS", DH->InitialRelativeSS);
W.printNumber("InitialSP", DH->InitialSP);
W.printNumber("Checksum", DH->Checksum);
W.printNumber("InitialIP", DH->InitialIP);
W.printNumber("InitialRelativeCS", DH->InitialRelativeCS);
W.printNumber("AddressOfRelocationTable", DH->AddressOfRelocationTable);
W.printNumber("OverlayNumber", DH->OverlayNumber);
W.printNumber("OEMid", DH->OEMid);
W.printNumber("OEMinfo", DH->OEMinfo);
W.printNumber("AddressOfNewExeHeader", DH->AddressOfNewExeHeader);
}
template <class PEHeader>
void COFFDumper::printPEHeader(const PEHeader *Hdr) {
DictScope D(W, "ImageOptionalHeader");
W.printHex ("Magic", Hdr->Magic);
W.printNumber("MajorLinkerVersion", Hdr->MajorLinkerVersion);
W.printNumber("MinorLinkerVersion", Hdr->MinorLinkerVersion);
W.printNumber("SizeOfCode", Hdr->SizeOfCode);
W.printNumber("SizeOfInitializedData", Hdr->SizeOfInitializedData);
W.printNumber("SizeOfUninitializedData", Hdr->SizeOfUninitializedData);
W.printHex ("AddressOfEntryPoint", Hdr->AddressOfEntryPoint);
W.printHex ("BaseOfCode", Hdr->BaseOfCode);
printBaseOfDataField(Hdr);
W.printHex ("ImageBase", Hdr->ImageBase);
W.printNumber("SectionAlignment", Hdr->SectionAlignment);
W.printNumber("FileAlignment", Hdr->FileAlignment);
W.printNumber("MajorOperatingSystemVersion",
Hdr->MajorOperatingSystemVersion);
W.printNumber("MinorOperatingSystemVersion",
Hdr->MinorOperatingSystemVersion);
W.printNumber("MajorImageVersion", Hdr->MajorImageVersion);
W.printNumber("MinorImageVersion", Hdr->MinorImageVersion);
W.printNumber("MajorSubsystemVersion", Hdr->MajorSubsystemVersion);
W.printNumber("MinorSubsystemVersion", Hdr->MinorSubsystemVersion);
W.printNumber("SizeOfImage", Hdr->SizeOfImage);
W.printNumber("SizeOfHeaders", Hdr->SizeOfHeaders);
W.printEnum ("Subsystem", Hdr->Subsystem, makeArrayRef(PEWindowsSubsystem));
W.printFlags ("Characteristics", Hdr->DLLCharacteristics,
makeArrayRef(PEDLLCharacteristics));
W.printNumber("SizeOfStackReserve", Hdr->SizeOfStackReserve);
W.printNumber("SizeOfStackCommit", Hdr->SizeOfStackCommit);
W.printNumber("SizeOfHeapReserve", Hdr->SizeOfHeapReserve);
W.printNumber("SizeOfHeapCommit", Hdr->SizeOfHeapCommit);
W.printNumber("NumberOfRvaAndSize", Hdr->NumberOfRvaAndSize);
if (Hdr->NumberOfRvaAndSize > 0) {
DictScope D(W, "DataDirectory");
static const char * const directory[] = {
"ExportTable", "ImportTable", "ResourceTable", "ExceptionTable",
"CertificateTable", "BaseRelocationTable", "Debug", "Architecture",
"GlobalPtr", "TLSTable", "LoadConfigTable", "BoundImport", "IAT",
"DelayImportDescriptor", "CLRRuntimeHeader", "Reserved"
};
for (uint32_t i = 0; i < Hdr->NumberOfRvaAndSize; ++i)
printDataDirectory(i, directory[i]);
}
}
void COFFDumper::printCOFFDebugDirectory() {
ListScope LS(W, "DebugDirectory");
for (const debug_directory &D : Obj->debug_directories()) {
char FormattedTime[20] = {};
time_t TDS = D.TimeDateStamp;
strftime(FormattedTime, 20, "%Y-%m-%d %H:%M:%S", gmtime(&TDS));
DictScope S(W, "DebugEntry");
W.printHex("Characteristics", D.Characteristics);
W.printHex("TimeDateStamp", FormattedTime, D.TimeDateStamp);
W.printHex("MajorVersion", D.MajorVersion);
W.printHex("MinorVersion", D.MinorVersion);
W.printEnum("Type", D.Type, makeArrayRef(ImageDebugType));
W.printHex("SizeOfData", D.SizeOfData);
W.printHex("AddressOfRawData", D.AddressOfRawData);
W.printHex("PointerToRawData", D.PointerToRawData);
// Ideally, if D.AddressOfRawData == 0, we should try to load the payload
// using D.PointerToRawData instead.
if (D.AddressOfRawData == 0)
continue;
if (D.Type == COFF::IMAGE_DEBUG_TYPE_CODEVIEW) {
const codeview::DebugInfo *DebugInfo;
StringRef PDBFileName;
if (std::error_code EC = Obj->getDebugPDBInfo(&D, DebugInfo, PDBFileName))
reportError(errorCodeToError(EC), Obj->getFileName());
DictScope PDBScope(W, "PDBInfo");
W.printHex("PDBSignature", DebugInfo->Signature.CVSignature);
if (DebugInfo->Signature.CVSignature == OMF::Signature::PDB70) {
W.printBinary("PDBGUID", makeArrayRef(DebugInfo->PDB70.Signature));
W.printNumber("PDBAge", DebugInfo->PDB70.Age);
W.printString("PDBFileName", PDBFileName);
}
} else if (D.SizeOfData != 0) {
// FIXME: Data visualization for IMAGE_DEBUG_TYPE_VC_FEATURE and
// IMAGE_DEBUG_TYPE_POGO?
ArrayRef<uint8_t> RawData;
if (std::error_code EC = Obj->getRvaAndSizeAsBytes(D.AddressOfRawData,
D.SizeOfData, RawData))
reportError(errorCodeToError(EC), Obj->getFileName());
if (D.Type == COFF::IMAGE_DEBUG_TYPE_EX_DLLCHARACTERISTICS) {
// FIXME right now the only possible value would fit in 8 bits,
// but that might change in the future
uint16_t Characteristics = RawData[0];
W.printFlags("ExtendedCharacteristics", Characteristics,
makeArrayRef(PEExtendedDLLCharacteristics));
}
W.printBinaryBlock("RawData", RawData);
}
}
}
void COFFDumper::printRVATable(uint64_t TableVA, uint64_t Count,
uint64_t EntrySize, PrintExtraCB PrintExtra) {
uintptr_t TableStart, TableEnd;
if (std::error_code EC = Obj->getVaPtr(TableVA, TableStart))
reportError(errorCodeToError(EC), Obj->getFileName());
if (std::error_code EC =
Obj->getVaPtr(TableVA + Count * EntrySize - 1, TableEnd))
reportError(errorCodeToError(EC), Obj->getFileName());
TableEnd++;
for (uintptr_t I = TableStart; I < TableEnd; I += EntrySize) {
uint32_t RVA = *reinterpret_cast<const ulittle32_t *>(I);
raw_ostream &OS = W.startLine();
OS << W.hex(Obj->getImageBase() + RVA);
if (PrintExtra)
PrintExtra(OS, reinterpret_cast<const uint8_t *>(I));
OS << '\n';
}
}
void COFFDumper::printCOFFLoadConfig() {
LoadConfigTables Tables;
if (Obj->is64())
printCOFFLoadConfig(Obj->getLoadConfig64(), Tables);
else
printCOFFLoadConfig(Obj->getLoadConfig32(), Tables);
if (Tables.SEHTableVA) {
ListScope LS(W, "SEHTable");
printRVATable(Tables.SEHTableVA, Tables.SEHTableCount, 4);
}
if (Tables.GuardFidTableVA) {
ListScope LS(W, "GuardFidTable");
if (Tables.GuardFlags & uint32_t(coff_guard_flags::FidTableHasFlags)) {
auto PrintGuardFlags = [](raw_ostream &OS, const uint8_t *Entry) {
uint8_t Flags = *reinterpret_cast<const uint8_t *>(Entry + 4);
if (Flags)
OS << " flags " << utohexstr(Flags);
};
printRVATable(Tables.GuardFidTableVA, Tables.GuardFidTableCount, 5,
PrintGuardFlags);
} else {
printRVATable(Tables.GuardFidTableVA, Tables.GuardFidTableCount, 4);
}
}
if (Tables.GuardLJmpTableVA) {
ListScope LS(W, "GuardLJmpTable");
printRVATable(Tables.GuardLJmpTableVA, Tables.GuardLJmpTableCount, 4);
}
}
template <typename T>
void COFFDumper::printCOFFLoadConfig(const T *Conf, LoadConfigTables &Tables) {
if (!Conf)
return;
ListScope LS(W, "LoadConfig");
char FormattedTime[20] = {};
time_t TDS = Conf->TimeDateStamp;
strftime(FormattedTime, 20, "%Y-%m-%d %H:%M:%S", gmtime(&TDS));
W.printHex("Size", Conf->Size);
// Print everything before SecurityCookie. The vast majority of images today
// have all these fields.
if (Conf->Size < offsetof(T, SEHandlerTable))
return;
W.printHex("TimeDateStamp", FormattedTime, TDS);
W.printHex("MajorVersion", Conf->MajorVersion);
W.printHex("MinorVersion", Conf->MinorVersion);
W.printHex("GlobalFlagsClear", Conf->GlobalFlagsClear);
W.printHex("GlobalFlagsSet", Conf->GlobalFlagsSet);
W.printHex("CriticalSectionDefaultTimeout",
Conf->CriticalSectionDefaultTimeout);
W.printHex("DeCommitFreeBlockThreshold", Conf->DeCommitFreeBlockThreshold);
W.printHex("DeCommitTotalFreeThreshold", Conf->DeCommitTotalFreeThreshold);
W.printHex("LockPrefixTable", Conf->LockPrefixTable);
W.printHex("MaximumAllocationSize", Conf->MaximumAllocationSize);
W.printHex("VirtualMemoryThreshold", Conf->VirtualMemoryThreshold);
W.printHex("ProcessHeapFlags", Conf->ProcessHeapFlags);
W.printHex("ProcessAffinityMask", Conf->ProcessAffinityMask);
W.printHex("CSDVersion", Conf->CSDVersion);
W.printHex("DependentLoadFlags", Conf->DependentLoadFlags);
W.printHex("EditList", Conf->EditList);
W.printHex("SecurityCookie", Conf->SecurityCookie);
// Print the safe SEH table if present.
if (Conf->Size < offsetof(coff_load_configuration32, GuardCFCheckFunction))
return;
W.printHex("SEHandlerTable", Conf->SEHandlerTable);
W.printNumber("SEHandlerCount", Conf->SEHandlerCount);
Tables.SEHTableVA = Conf->SEHandlerTable;
Tables.SEHTableCount = Conf->SEHandlerCount;
// Print everything before CodeIntegrity. (2015)
if (Conf->Size < offsetof(T, CodeIntegrity))
return;
W.printHex("GuardCFCheckFunction", Conf->GuardCFCheckFunction);
W.printHex("GuardCFCheckDispatch", Conf->GuardCFCheckDispatch);
W.printHex("GuardCFFunctionTable", Conf->GuardCFFunctionTable);
W.printNumber("GuardCFFunctionCount", Conf->GuardCFFunctionCount);
W.printHex("GuardFlags", Conf->GuardFlags);
Tables.GuardFidTableVA = Conf->GuardCFFunctionTable;
Tables.GuardFidTableCount = Conf->GuardCFFunctionCount;
Tables.GuardFlags = Conf->GuardFlags;
// Print the rest. (2017)
if (Conf->Size < sizeof(T))
return;
W.printHex("GuardAddressTakenIatEntryTable",
Conf->GuardAddressTakenIatEntryTable);
W.printNumber("GuardAddressTakenIatEntryCount",
Conf->GuardAddressTakenIatEntryCount);
W.printHex("GuardLongJumpTargetTable", Conf->GuardLongJumpTargetTable);
W.printNumber("GuardLongJumpTargetCount", Conf->GuardLongJumpTargetCount);
W.printHex("DynamicValueRelocTable", Conf->DynamicValueRelocTable);
W.printHex("CHPEMetadataPointer", Conf->CHPEMetadataPointer);
W.printHex("GuardRFFailureRoutine", Conf->GuardRFFailureRoutine);
W.printHex("GuardRFFailureRoutineFunctionPointer",
Conf->GuardRFFailureRoutineFunctionPointer);
W.printHex("DynamicValueRelocTableOffset",
Conf->DynamicValueRelocTableOffset);
W.printNumber("DynamicValueRelocTableSection",
Conf->DynamicValueRelocTableSection);
W.printHex("GuardRFVerifyStackPointerFunctionPointer",
Conf->GuardRFVerifyStackPointerFunctionPointer);
W.printHex("HotPatchTableOffset", Conf->HotPatchTableOffset);
Tables.GuardLJmpTableVA = Conf->GuardLongJumpTargetTable;
Tables.GuardLJmpTableCount = Conf->GuardLongJumpTargetCount;
}
void COFFDumper::printBaseOfDataField(const pe32_header *Hdr) {
W.printHex("BaseOfData", Hdr->BaseOfData);
}
void COFFDumper::printBaseOfDataField(const pe32plus_header *) {}
void COFFDumper::printCodeViewDebugInfo() {
// Print types first to build CVUDTNames, then print symbols.
for (const SectionRef &S : Obj->sections()) {
StringRef SectionName = unwrapOrError(Obj->getFileName(), S.getName());
// .debug$T is a standard CodeView type section, while .debug$P is the same
// format but used for MSVC precompiled header object files.
if (SectionName == ".debug$T" || SectionName == ".debug$P")
printCodeViewTypeSection(SectionName, S);
}
for (const SectionRef &S : Obj->sections()) {
StringRef SectionName = unwrapOrError(Obj->getFileName(), S.getName());
if (SectionName == ".debug$S")
printCodeViewSymbolSection(SectionName, S);
}
}
void COFFDumper::initializeFileAndStringTables(BinaryStreamReader &Reader) {
while (Reader.bytesRemaining() > 0 &&
(!CVFileChecksumTable.valid() || !CVStringTable.valid())) {
// The section consists of a number of subsection in the following format:
// |SubSectionType|SubSectionSize|Contents...|
uint32_t SubType, SubSectionSize;
if (Error E = Reader.readInteger(SubType))
reportError(std::move(E), Obj->getFileName());
if (Error E = Reader.readInteger(SubSectionSize))
reportError(std::move(E), Obj->getFileName());
StringRef Contents;
if (Error E = Reader.readFixedString(Contents, SubSectionSize))
reportError(std::move(E), Obj->getFileName());
BinaryStreamRef ST(Contents, support::little);
switch (DebugSubsectionKind(SubType)) {
case DebugSubsectionKind::FileChecksums:
if (Error E = CVFileChecksumTable.initialize(ST))
reportError(std::move(E), Obj->getFileName());
break;
case DebugSubsectionKind::StringTable:
if (Error E = CVStringTable.initialize(ST))
reportError(std::move(E), Obj->getFileName());
break;
default:
break;
}
uint32_t PaddedSize = alignTo(SubSectionSize, 4);
if (Error E = Reader.skip(PaddedSize - SubSectionSize))
reportError(std::move(E), Obj->getFileName());
}
}
void COFFDumper::printCodeViewSymbolSection(StringRef SectionName,
const SectionRef &Section) {
StringRef SectionContents =
unwrapOrError(Obj->getFileName(), Section.getContents());
StringRef Data = SectionContents;
SmallVector<StringRef, 10> FunctionNames;
StringMap<StringRef> FunctionLineTables;
ListScope D(W, "CodeViewDebugInfo");
// Print the section to allow correlation with printSectionHeaders.
W.printNumber("Section", SectionName, Obj->getSectionID(Section));
uint32_t Magic;
if (Error E = consume(Data, Magic))
reportError(std::move(E), Obj->getFileName());
W.printHex("Magic", Magic);
if (Magic != COFF::DEBUG_SECTION_MAGIC)
reportError(errorCodeToError(object_error::parse_failed),
Obj->getFileName());
BinaryStreamReader FSReader(Data, support::little);
initializeFileAndStringTables(FSReader);
// TODO: Convert this over to using ModuleSubstreamVisitor.
while (!Data.empty()) {
// The section consists of a number of subsection in the following format:
// |SubSectionType|SubSectionSize|Contents...|
uint32_t SubType, SubSectionSize;
if (Error E = consume(Data, SubType))
reportError(std::move(E), Obj->getFileName());
if (Error E = consume(Data, SubSectionSize))
reportError(std::move(E), Obj->getFileName());
ListScope S(W, "Subsection");
// Dump the subsection as normal even if the ignore bit is set.
if (SubType & SubsectionIgnoreFlag) {
W.printHex("IgnoredSubsectionKind", SubType);
SubType &= ~SubsectionIgnoreFlag;
}
W.printEnum("SubSectionType", SubType, makeArrayRef(SubSectionTypes));
W.printHex("SubSectionSize", SubSectionSize);
// Get the contents of the subsection.
if (SubSectionSize > Data.size())
return reportError(errorCodeToError(object_error::parse_failed),
Obj->getFileName());
StringRef Contents = Data.substr(0, SubSectionSize);
// Add SubSectionSize to the current offset and align that offset to find
// the next subsection.
size_t SectionOffset = Data.data() - SectionContents.data();
size_t NextOffset = SectionOffset + SubSectionSize;
NextOffset = alignTo(NextOffset, 4);
if (NextOffset > SectionContents.size())
return reportError(errorCodeToError(object_error::parse_failed),
Obj->getFileName());
Data = SectionContents.drop_front(NextOffset);
// Optionally print the subsection bytes in case our parsing gets confused
// later.
if (opts::CodeViewSubsectionBytes)
printBinaryBlockWithRelocs("SubSectionContents", Section, SectionContents,
Contents);
switch (DebugSubsectionKind(SubType)) {
case DebugSubsectionKind::Symbols:
printCodeViewSymbolsSubsection(Contents, Section, SectionContents);
break;
case DebugSubsectionKind::InlineeLines:
printCodeViewInlineeLines(Contents);
break;
case DebugSubsectionKind::FileChecksums:
printCodeViewFileChecksums(Contents);
break;
case DebugSubsectionKind::Lines: {
// Holds a PC to file:line table. Some data to parse this subsection is
// stored in the other subsections, so just check sanity and store the
// pointers for deferred processing.
if (SubSectionSize < 12) {
// There should be at least three words to store two function
// relocations and size of the code.
reportError(errorCodeToError(object_error::parse_failed),
Obj->getFileName());
return;
}
StringRef LinkageName;
if (std::error_code EC = resolveSymbolName(Obj->getCOFFSection(Section),
SectionOffset, LinkageName))
reportError(errorCodeToError(EC), Obj->getFileName());
W.printString("LinkageName", LinkageName);
if (FunctionLineTables.count(LinkageName) != 0) {
// Saw debug info for this function already?
reportError(errorCodeToError(object_error::parse_failed),
Obj->getFileName());
return;
}
FunctionLineTables[LinkageName] = Contents;
FunctionNames.push_back(LinkageName);
break;
}
case DebugSubsectionKind::FrameData: {
// First four bytes is a relocation against the function.
BinaryStreamReader SR(Contents, llvm::support::little);
DebugFrameDataSubsectionRef FrameData;
if (Error E = FrameData.initialize(SR))
reportError(std::move(E), Obj->getFileName());
StringRef LinkageName;
if (std::error_code EC =
resolveSymbolName(Obj->getCOFFSection(Section), SectionContents,
FrameData.getRelocPtr(), LinkageName))
reportError(errorCodeToError(EC), Obj->getFileName());
W.printString("LinkageName", LinkageName);
// To find the active frame description, search this array for the
// smallest PC range that includes the current PC.
for (const auto &FD : FrameData) {
StringRef FrameFunc = unwrapOrError(
Obj->getFileName(), CVStringTable.getString(FD.FrameFunc));
DictScope S(W, "FrameData");
W.printHex("RvaStart", FD.RvaStart);
W.printHex("CodeSize", FD.CodeSize);
W.printHex("LocalSize", FD.LocalSize);
W.printHex("ParamsSize", FD.ParamsSize);
W.printHex("MaxStackSize", FD.MaxStackSize);
W.printHex("PrologSize", FD.PrologSize);
W.printHex("SavedRegsSize", FD.SavedRegsSize);
W.printFlags("Flags", FD.Flags, makeArrayRef(FrameDataFlags));
// The FrameFunc string is a small RPN program. It can be broken up into
// statements that end in the '=' operator, which assigns the value on
// the top of the stack to the previously pushed variable. Variables can
// be temporary values ($T0) or physical registers ($esp). Print each
// assignment on its own line to make these programs easier to read.
{
ListScope FFS(W, "FrameFunc");
while (!FrameFunc.empty()) {
size_t EqOrEnd = FrameFunc.find('=');
if (EqOrEnd == StringRef::npos)
EqOrEnd = FrameFunc.size();
else
++EqOrEnd;
StringRef Stmt = FrameFunc.substr(0, EqOrEnd);
W.printString(Stmt);
FrameFunc = FrameFunc.drop_front(EqOrEnd).trim();
}
}
}
break;
}
// Do nothing for unrecognized subsections.
default:
break;
}
W.flush();
}
// Dump the line tables now that we've read all the subsections and know all
// the required information.
for (unsigned I = 0, E = FunctionNames.size(); I != E; ++I) {
StringRef Name = FunctionNames[I];
ListScope S(W, "FunctionLineTable");
W.printString("LinkageName", Name);
BinaryStreamReader Reader(FunctionLineTables[Name], support::little);
DebugLinesSubsectionRef LineInfo;
if (Error E = LineInfo.initialize(Reader))
reportError(std::move(E), Obj->getFileName());
W.printHex("Flags", LineInfo.header()->Flags);
W.printHex("CodeSize", LineInfo.header()->CodeSize);
for (const auto &Entry : LineInfo) {
ListScope S(W, "FilenameSegment");
printFileNameForOffset("Filename", Entry.NameIndex);
uint32_t ColumnIndex = 0;
for (const auto &Line : Entry.LineNumbers) {
if (Line.Offset >= LineInfo.header()->CodeSize) {
reportError(errorCodeToError(object_error::parse_failed),
Obj->getFileName());
return;
}
std::string PC = std::string(formatv("+{0:X}", uint32_t(Line.Offset)));
ListScope PCScope(W, PC);
codeview::LineInfo LI(Line.Flags);
if (LI.isAlwaysStepInto())
W.printString("StepInto", StringRef("Always"));
else if (LI.isNeverStepInto())
W.printString("StepInto", StringRef("Never"));
else
W.printNumber("LineNumberStart", LI.getStartLine());
W.printNumber("LineNumberEndDelta", LI.getLineDelta());
W.printBoolean("IsStatement", LI.isStatement());
if (LineInfo.hasColumnInfo()) {
W.printNumber("ColStart", Entry.Columns[ColumnIndex].StartColumn);
W.printNumber("ColEnd", Entry.Columns[ColumnIndex].EndColumn);
++ColumnIndex;
}
}
}
}
}
void COFFDumper::printCodeViewSymbolsSubsection(StringRef Subsection,
const SectionRef &Section,
StringRef SectionContents) {
ArrayRef<uint8_t> BinaryData(Subsection.bytes_begin(),
Subsection.bytes_end());
auto CODD = std::make_unique<COFFObjectDumpDelegate>(*this, Section, Obj,
SectionContents);
CVSymbolDumper CVSD(W, Types, CodeViewContainer::ObjectFile, std::move(CODD),
CompilationCPUType, opts::CodeViewSubsectionBytes);
CVSymbolArray Symbols;
BinaryStreamReader Reader(BinaryData, llvm::support::little);
if (Error E = Reader.readArray(Symbols, Reader.getLength())) {
W.flush();
reportError(std::move(E), Obj->getFileName());
}
if (Error E = CVSD.dump(Symbols)) {
W.flush();
reportError(std::move(E), Obj->getFileName());
}
CompilationCPUType = CVSD.getCompilationCPUType();
W.flush();
}
void COFFDumper::printCodeViewFileChecksums(StringRef Subsection) {
BinaryStreamRef Stream(Subsection, llvm::support::little);
DebugChecksumsSubsectionRef Checksums;
if (Error E = Checksums.initialize(Stream))
reportError(std::move(E), Obj->getFileName());
for (auto &FC : Checksums) {
DictScope S(W, "FileChecksum");
StringRef Filename = unwrapOrError(
Obj->getFileName(), CVStringTable.getString(FC.FileNameOffset));
W.printHex("Filename", Filename, FC.FileNameOffset);
W.printHex("ChecksumSize", FC.Checksum.size());
W.printEnum("ChecksumKind", uint8_t(FC.Kind),
makeArrayRef(FileChecksumKindNames));
W.printBinary("ChecksumBytes", FC.Checksum);
}
}
void COFFDumper::printCodeViewInlineeLines(StringRef Subsection) {
BinaryStreamReader SR(Subsection, llvm::support::little);
DebugInlineeLinesSubsectionRef Lines;
if (Error E = Lines.initialize(SR))
reportError(std::move(E), Obj->getFileName());
for (auto &Line : Lines) {
DictScope S(W, "InlineeSourceLine");
printTypeIndex("Inlinee", Line.Header->Inlinee);
printFileNameForOffset("FileID", Line.Header->FileID);
W.printNumber("SourceLineNum", Line.Header->SourceLineNum);
if (Lines.hasExtraFiles()) {
W.printNumber("ExtraFileCount", Line.ExtraFiles.size());
ListScope ExtraFiles(W, "ExtraFiles");
for (const auto &FID : Line.ExtraFiles) {
printFileNameForOffset("FileID", FID);
}
}
}
}
StringRef COFFDumper::getFileNameForFileOffset(uint32_t FileOffset) {
// The file checksum subsection should precede all references to it.
if (!CVFileChecksumTable.valid() || !CVStringTable.valid())
reportError(errorCodeToError(object_error::parse_failed),
Obj->getFileName());
auto Iter = CVFileChecksumTable.getArray().at(FileOffset);
// Check if the file checksum table offset is valid.
if (Iter == CVFileChecksumTable.end())
reportError(errorCodeToError(object_error::parse_failed),
Obj->getFileName());
return unwrapOrError(Obj->getFileName(),
CVStringTable.getString(Iter->FileNameOffset));
}
void COFFDumper::printFileNameForOffset(StringRef Label, uint32_t FileOffset) {
W.printHex(Label, getFileNameForFileOffset(FileOffset), FileOffset);
}
void COFFDumper::mergeCodeViewTypes(MergingTypeTableBuilder &CVIDs,
MergingTypeTableBuilder &CVTypes,
GlobalTypeTableBuilder &GlobalCVIDs,
GlobalTypeTableBuilder &GlobalCVTypes,
bool GHash) {
for (const SectionRef &S : Obj->sections()) {
StringRef SectionName = unwrapOrError(Obj->getFileName(), S.getName());
if (SectionName == ".debug$T") {
StringRef Data = unwrapOrError(Obj->getFileName(), S.getContents());
uint32_t Magic;
if (Error E = consume(Data, Magic))
reportError(std::move(E), Obj->getFileName());
if (Magic != 4)
reportError(errorCodeToError(object_error::parse_failed),
Obj->getFileName());
CVTypeArray Types;
BinaryStreamReader Reader(Data, llvm::support::little);
if (auto EC = Reader.readArray(Types, Reader.getLength())) {
consumeError(std::move(EC));
W.flush();
reportError(errorCodeToError(object_error::parse_failed),
Obj->getFileName());
}
SmallVector<TypeIndex, 128> SourceToDest;
Optional<uint32_t> PCHSignature;
if (GHash) {
std::vector<GloballyHashedType> Hashes =
GloballyHashedType::hashTypes(Types);
if (Error E =
mergeTypeAndIdRecords(GlobalCVIDs, GlobalCVTypes, SourceToDest,
Types, Hashes, PCHSignature))
return reportError(std::move(E), Obj->getFileName());
} else {
if (Error E = mergeTypeAndIdRecords(CVIDs, CVTypes, SourceToDest, Types,
PCHSignature))
return reportError(std::move(E), Obj->getFileName());
}
}
}
}
void COFFDumper::printCodeViewTypeSection(StringRef SectionName,
const SectionRef &Section) {
ListScope D(W, "CodeViewTypes");
W.printNumber("Section", SectionName, Obj->getSectionID(Section));
StringRef Data = unwrapOrError(Obj->getFileName(), Section.getContents());
if (opts::CodeViewSubsectionBytes)
W.printBinaryBlock("Data", Data);
uint32_t Magic;
if (Error E = consume(Data, Magic))
reportError(std::move(E), Obj->getFileName());
W.printHex("Magic", Magic);
if (Magic != COFF::DEBUG_SECTION_MAGIC)
reportError(errorCodeToError(object_error::parse_failed),
Obj->getFileName());
Types.reset(Data, 100);
TypeDumpVisitor TDV(Types, &W, opts::CodeViewSubsectionBytes);
if (Error E = codeview::visitTypeStream(Types, TDV))
reportError(std::move(E), Obj->getFileName());
W.flush();
}
void COFFDumper::printSectionHeaders() {
ListScope SectionsD(W, "Sections");
int SectionNumber = 0;
for (const SectionRef &Sec : Obj->sections()) {
++SectionNumber;
const coff_section *Section = Obj->getCOFFSection(Sec);
StringRef Name = unwrapOrError(Obj->getFileName(), Sec.getName());
DictScope D(W, "Section");
W.printNumber("Number", SectionNumber);
W.printBinary("Name", Name, Section->Name);
W.printHex ("VirtualSize", Section->VirtualSize);
W.printHex ("VirtualAddress", Section->VirtualAddress);
W.printNumber("RawDataSize", Section->SizeOfRawData);
W.printHex ("PointerToRawData", Section->PointerToRawData);
W.printHex ("PointerToRelocations", Section->PointerToRelocations);
W.printHex ("PointerToLineNumbers", Section->PointerToLinenumbers);
W.printNumber("RelocationCount", Section->NumberOfRelocations);
W.printNumber("LineNumberCount", Section->NumberOfLinenumbers);
W.printFlags ("Characteristics", Section->Characteristics,
makeArrayRef(ImageSectionCharacteristics),
COFF::SectionCharacteristics(0x00F00000));
if (opts::SectionRelocations) {
ListScope D(W, "Relocations");
for (const RelocationRef &Reloc : Sec.relocations())
printRelocation(Sec, Reloc);
}
if (opts::SectionSymbols) {
ListScope D(W, "Symbols");
for (const SymbolRef &Symbol : Obj->symbols()) {
if (!Sec.containsSymbol(Symbol))
continue;
printSymbol(Symbol);
}
}
if (opts::SectionData &&
!(Section->Characteristics & COFF::IMAGE_SCN_CNT_UNINITIALIZED_DATA)) {
StringRef Data = unwrapOrError(Obj->getFileName(), Sec.getContents());
W.printBinaryBlock("SectionData", Data);
}
}
}
void COFFDumper::printRelocations() {
ListScope D(W, "Relocations");
int SectionNumber = 0;
for (const SectionRef &Section : Obj->sections()) {
++SectionNumber;
StringRef Name = unwrapOrError(Obj->getFileName(), Section.getName());
bool PrintedGroup = false;
for (const RelocationRef &Reloc : Section.relocations()) {
if (!PrintedGroup) {
W.startLine() << "Section (" << SectionNumber << ") " << Name << " {\n";
W.indent();
PrintedGroup = true;
}
printRelocation(Section, Reloc);
}
if (PrintedGroup) {
W.unindent();
W.startLine() << "}\n";
}
}
}
void COFFDumper::printRelocation(const SectionRef &Section,
const RelocationRef &Reloc, uint64_t Bias) {
uint64_t Offset = Reloc.getOffset() - Bias;
uint64_t RelocType = Reloc.getType();
SmallString<32> RelocName;
StringRef SymbolName;
Reloc.getTypeName(RelocName);
symbol_iterator Symbol = Reloc.getSymbol();
int64_t SymbolIndex = -1;
if (Symbol != Obj->symbol_end()) {
Expected<StringRef> SymbolNameOrErr = Symbol->getName();
if (!SymbolNameOrErr)
reportError(SymbolNameOrErr.takeError(), Obj->getFileName());
SymbolName = *SymbolNameOrErr;
SymbolIndex = Obj->getSymbolIndex(Obj->getCOFFSymbol(*Symbol));
}
if (opts::ExpandRelocs) {
DictScope Group(W, "Relocation");
W.printHex("Offset", Offset);
W.printNumber("Type", RelocName, RelocType);
W.printString("Symbol", SymbolName.empty() ? "-" : SymbolName);
W.printNumber("SymbolIndex", SymbolIndex);
} else {
raw_ostream& OS = W.startLine();
OS << W.hex(Offset)
<< " " << RelocName
<< " " << (SymbolName.empty() ? "-" : SymbolName)
<< " (" << SymbolIndex << ")"
<< "\n";
}
}
void COFFDumper::printSymbols() {
ListScope Group(W, "Symbols");
for (const SymbolRef &Symbol : Obj->symbols())
printSymbol(Symbol);
}
void COFFDumper::printDynamicSymbols() { ListScope Group(W, "DynamicSymbols"); }
static Expected<StringRef>
getSectionName(const llvm::object::COFFObjectFile *Obj, int32_t SectionNumber,
const coff_section *Section) {
if (Section)
return Obj->getSectionName(Section);
if (SectionNumber == llvm::COFF::IMAGE_SYM_DEBUG)
return StringRef("IMAGE_SYM_DEBUG");
if (SectionNumber == llvm::COFF::IMAGE_SYM_ABSOLUTE)
return StringRef("IMAGE_SYM_ABSOLUTE");
if (SectionNumber == llvm::COFF::IMAGE_SYM_UNDEFINED)
return StringRef("IMAGE_SYM_UNDEFINED");
return StringRef("");
}
void COFFDumper::printSymbol(const SymbolRef &Sym) {
DictScope D(W, "Symbol");
COFFSymbolRef Symbol = Obj->getCOFFSymbol(Sym);
const coff_section *Section;
if (std::error_code EC = Obj->getSection(Symbol.getSectionNumber(), Section)) {
W.startLine() << "Invalid section number: " << EC.message() << "\n";
W.flush();
return;
}
StringRef SymbolName;
if (Obj->getSymbolName(Symbol, SymbolName))
SymbolName = "";
StringRef SectionName;
if (Expected<StringRef> NameOrErr =
getSectionName(Obj, Symbol.getSectionNumber(), Section))
SectionName = *NameOrErr;
W.printString("Name", SymbolName);
W.printNumber("Value", Symbol.getValue());
W.printNumber("Section", SectionName, Symbol.getSectionNumber());
W.printEnum ("BaseType", Symbol.getBaseType(), makeArrayRef(ImageSymType));
W.printEnum ("ComplexType", Symbol.getComplexType(),
makeArrayRef(ImageSymDType));
W.printEnum ("StorageClass", Symbol.getStorageClass(),
makeArrayRef(ImageSymClass));
W.printNumber("AuxSymbolCount", Symbol.getNumberOfAuxSymbols());
for (uint8_t I = 0; I < Symbol.getNumberOfAuxSymbols(); ++I) {
if (Symbol.isFunctionDefinition()) {
const coff_aux_function_definition *Aux;
if (std::error_code EC = getSymbolAuxData(Obj, Symbol, I, Aux))
reportError(errorCodeToError(EC), Obj->getFileName());
DictScope AS(W, "AuxFunctionDef");
W.printNumber("TagIndex", Aux->TagIndex);
W.printNumber("TotalSize", Aux->TotalSize);
W.printHex("PointerToLineNumber", Aux->PointerToLinenumber);
W.printHex("PointerToNextFunction", Aux->PointerToNextFunction);
} else if (Symbol.isAnyUndefined()) {
const coff_aux_weak_external *Aux;
if (std::error_code EC = getSymbolAuxData(Obj, Symbol, I, Aux))
reportError(errorCodeToError(EC), Obj->getFileName());
Expected<COFFSymbolRef> Linked = Obj->getSymbol(Aux->TagIndex);
if (!Linked)
reportError(Linked.takeError(), Obj->getFileName());
StringRef LinkedName;
if (std::error_code EC = Obj->getSymbolName(*Linked, LinkedName))
reportError(errorCodeToError(EC), Obj->getFileName());
DictScope AS(W, "AuxWeakExternal");
W.printNumber("Linked", LinkedName, Aux->TagIndex);
W.printEnum ("Search", Aux->Characteristics,
makeArrayRef(WeakExternalCharacteristics));
} else if (Symbol.isFileRecord()) {
const char *FileName;
if (std::error_code EC = getSymbolAuxData(Obj, Symbol, I, FileName))
reportError(errorCodeToError(EC), Obj->getFileName());
DictScope AS(W, "AuxFileRecord");
StringRef Name(FileName, Symbol.getNumberOfAuxSymbols() *
Obj->getSymbolTableEntrySize());
W.printString("FileName", Name.rtrim(StringRef("\0", 1)));
break;
} else if (Symbol.isSectionDefinition()) {
const coff_aux_section_definition *Aux;
if (std::error_code EC = getSymbolAuxData(Obj, Symbol, I, Aux))
reportError(errorCodeToError(EC), Obj->getFileName());
int32_t AuxNumber = Aux->getNumber(Symbol.isBigObj());
DictScope AS(W, "AuxSectionDef");
W.printNumber("Length", Aux->Length);
W.printNumber("RelocationCount", Aux->NumberOfRelocations);
W.printNumber("LineNumberCount", Aux->NumberOfLinenumbers);
W.printHex("Checksum", Aux->CheckSum);
W.printNumber("Number", AuxNumber);
W.printEnum("Selection", Aux->Selection, makeArrayRef(ImageCOMDATSelect));
if (Section && Section->Characteristics & COFF::IMAGE_SCN_LNK_COMDAT
&& Aux->Selection == COFF::IMAGE_COMDAT_SELECT_ASSOCIATIVE) {
const coff_section *Assoc;
StringRef AssocName = "";
if (std::error_code EC = Obj->getSection(AuxNumber, Assoc))
reportError(errorCodeToError(EC), Obj->getFileName());
Expected<StringRef> Res = getSectionName(Obj, AuxNumber, Assoc);
if (!Res)
reportError(Res.takeError(), Obj->getFileName());
AssocName = *Res;
W.printNumber("AssocSection", AssocName, AuxNumber);
}
} else if (Symbol.isCLRToken()) {
const coff_aux_clr_token *Aux;
if (std::error_code EC = getSymbolAuxData(Obj, Symbol, I, Aux))
reportError(errorCodeToError(EC), Obj->getFileName());
Expected<COFFSymbolRef> ReferredSym =
Obj->getSymbol(Aux->SymbolTableIndex);
if (!ReferredSym)
reportError(ReferredSym.takeError(), Obj->getFileName());
StringRef ReferredName;
if (std::error_code EC = Obj->getSymbolName(*ReferredSym, ReferredName))
reportError(errorCodeToError(EC), Obj->getFileName());
DictScope AS(W, "AuxCLRToken");
W.printNumber("AuxType", Aux->AuxType);
W.printNumber("Reserved", Aux->Reserved);
W.printNumber("SymbolTableIndex", ReferredName, Aux->SymbolTableIndex);
} else {
W.startLine() << "<unhandled auxiliary record>\n";
}
}
}
void COFFDumper::printUnwindInfo() {
ListScope D(W, "UnwindInformation");
switch (Obj->getMachine()) {
case COFF::IMAGE_FILE_MACHINE_AMD64: {
Win64EH::Dumper Dumper(W);
Win64EH::Dumper::SymbolResolver
Resolver = [](const object::coff_section *Section, uint64_t Offset,
SymbolRef &Symbol, void *user_data) -> std::error_code {
COFFDumper *Dumper = reinterpret_cast<COFFDumper *>(user_data);
return Dumper->resolveSymbol(Section, Offset, Symbol);
};
Win64EH::Dumper::Context Ctx(*Obj, Resolver, this);
Dumper.printData(Ctx);
break;
}
case COFF::IMAGE_FILE_MACHINE_ARM64:
case COFF::IMAGE_FILE_MACHINE_ARMNT: {
ARM::WinEH::Decoder Decoder(W, Obj->getMachine() ==
COFF::IMAGE_FILE_MACHINE_ARM64);
// TODO Propagate the error.
consumeError(Decoder.dumpProcedureData(*Obj));
break;
}
default:
W.printEnum("unsupported Image Machine", Obj->getMachine(),
makeArrayRef(ImageFileMachineType));
break;
}
}
void COFFDumper::printNeededLibraries() {
ListScope D(W, "NeededLibraries");
using LibsTy = std::vector<StringRef>;
LibsTy Libs;
for (const ImportDirectoryEntryRef &DirRef : Obj->import_directories()) {
StringRef Name;
if (!DirRef.getName(Name))
Libs.push_back(Name);
}
llvm::stable_sort(Libs);
for (const auto &L : Libs) {
W.startLine() << L << "\n";
}
}
void COFFDumper::printImportedSymbols(
iterator_range<imported_symbol_iterator> Range) {
for (const ImportedSymbolRef &I : Range) {
StringRef Sym;
if (std::error_code EC = I.getSymbolName(Sym))
reportError(errorCodeToError(EC), Obj->getFileName());
uint16_t Ordinal;
if (std::error_code EC = I.getOrdinal(Ordinal))
reportError(errorCodeToError(EC), Obj->getFileName());
W.printNumber("Symbol", Sym, Ordinal);
}
}
void COFFDumper::printDelayImportedSymbols(
const DelayImportDirectoryEntryRef &I,
iterator_range<imported_symbol_iterator> Range) {
int Index = 0;
for (const ImportedSymbolRef &S : Range) {
DictScope Import(W, "Import");
StringRef Sym;
if (std::error_code EC = S.getSymbolName(Sym))
reportError(errorCodeToError(EC), Obj->getFileName());
uint16_t Ordinal;
if (std::error_code EC = S.getOrdinal(Ordinal))
reportError(errorCodeToError(EC), Obj->getFileName());
W.printNumber("Symbol", Sym, Ordinal);
uint64_t Addr;
if (std::error_code EC = I.getImportAddress(Index++, Addr))
reportError(errorCodeToError(EC), Obj->getFileName());
W.printHex("Address", Addr);
}
}
void COFFDumper::printCOFFImports() {
// Regular imports
for (const ImportDirectoryEntryRef &I : Obj->import_directories()) {
DictScope Import(W, "Import");
StringRef Name;
if (std::error_code EC = I.getName(Name))
reportError(errorCodeToError(EC), Obj->getFileName());
W.printString("Name", Name);
uint32_t ILTAddr;
if (std::error_code EC = I.getImportLookupTableRVA(ILTAddr))
reportError(errorCodeToError(EC), Obj->getFileName());
W.printHex("ImportLookupTableRVA", ILTAddr);
uint32_t IATAddr;
if (std::error_code EC = I.getImportAddressTableRVA(IATAddr))
reportError(errorCodeToError(EC), Obj->getFileName());
W.printHex("ImportAddressTableRVA", IATAddr);
// The import lookup table can be missing with certain older linkers, so
// fall back to the import address table in that case.
if (ILTAddr)
printImportedSymbols(I.lookup_table_symbols());
else
printImportedSymbols(I.imported_symbols());
}
// Delay imports
for (const DelayImportDirectoryEntryRef &I : Obj->delay_import_directories()) {
DictScope Import(W, "DelayImport");
StringRef Name;
if (std::error_code EC = I.getName(Name))
reportError(errorCodeToError(EC), Obj->getFileName());
W.printString("Name", Name);
const delay_import_directory_table_entry *Table;
if (std::error_code EC = I.getDelayImportTable(Table))
reportError(errorCodeToError(EC), Obj->getFileName());
W.printHex("Attributes", Table->Attributes);
W.printHex("ModuleHandle", Table->ModuleHandle);
W.printHex("ImportAddressTable", Table->DelayImportAddressTable);
W.printHex("ImportNameTable", Table->DelayImportNameTable);
W.printHex("BoundDelayImportTable", Table->BoundDelayImportTable);
W.printHex("UnloadDelayImportTable", Table->UnloadDelayImportTable);
printDelayImportedSymbols(I, I.imported_symbols());
}
}
void COFFDumper::printCOFFExports() {
for (const ExportDirectoryEntryRef &E : Obj->export_directories()) {
DictScope Export(W, "Export");
StringRef Name;
uint32_t Ordinal, RVA;
if (std::error_code EC = E.getSymbolName(Name))
reportError(errorCodeToError(EC), Obj->getFileName());
if (std::error_code EC = E.getOrdinal(Ordinal))
reportError(errorCodeToError(EC), Obj->getFileName());
if (std::error_code EC = E.getExportRVA(RVA))
reportError(errorCodeToError(EC), Obj->getFileName());
W.printNumber("Ordinal", Ordinal);
W.printString("Name", Name);
W.printHex("RVA", RVA);
}
}
void COFFDumper::printCOFFDirectives() {
for (const SectionRef &Section : Obj->sections()) {
StringRef Name = unwrapOrError(Obj->getFileName(), Section.getName());
if (Name != ".drectve")
continue;
StringRef Contents =
unwrapOrError(Obj->getFileName(), Section.getContents());
W.printString("Directive(s)", Contents);
}
}
static std::string getBaseRelocTypeName(uint8_t Type) {
switch (Type) {
case COFF::IMAGE_REL_BASED_ABSOLUTE: return "ABSOLUTE";
case COFF::IMAGE_REL_BASED_HIGH: return "HIGH";
case COFF::IMAGE_REL_BASED_LOW: return "LOW";
case COFF::IMAGE_REL_BASED_HIGHLOW: return "HIGHLOW";
case COFF::IMAGE_REL_BASED_HIGHADJ: return "HIGHADJ";
case COFF::IMAGE_REL_BASED_ARM_MOV32T: return "ARM_MOV32(T)";
case COFF::IMAGE_REL_BASED_DIR64: return "DIR64";
default: return "unknown (" + llvm::utostr(Type) + ")";
}
}
void COFFDumper::printCOFFBaseReloc() {
ListScope D(W, "BaseReloc");
for (const BaseRelocRef &I : Obj->base_relocs()) {
uint8_t Type;
uint32_t RVA;
if (std::error_code EC = I.getRVA(RVA))
reportError(errorCodeToError(EC), Obj->getFileName());
if (std::error_code EC = I.getType(Type))
reportError(errorCodeToError(EC), Obj->getFileName());
DictScope Import(W, "Entry");
W.printString("Type", getBaseRelocTypeName(Type));
W.printHex("Address", RVA);
}
}
void COFFDumper::printCOFFResources() {
ListScope ResourcesD(W, "Resources");
for (const SectionRef &S : Obj->sections()) {
StringRef Name = unwrapOrError(Obj->getFileName(), S.getName());
if (!Name.startswith(".rsrc"))
continue;
StringRef Ref = unwrapOrError(Obj->getFileName(), S.getContents());
if ((Name == ".rsrc") || (Name == ".rsrc$01")) {
ResourceSectionRef RSF;
Error E = RSF.load(Obj, S);
if (E)
reportError(std::move(E), Obj->getFileName());
auto &BaseTable = unwrapOrError(Obj->getFileName(), RSF.getBaseTable());
W.printNumber("Total Number of Resources",
countTotalTableEntries(RSF, BaseTable, "Type"));
W.printHex("Base Table Address",
Obj->getCOFFSection(S)->PointerToRawData);
W.startLine() << "\n";
printResourceDirectoryTable(RSF, BaseTable, "Type");
}
if (opts::SectionData)
W.printBinaryBlock(Name.str() + " Data", Ref);
}
}
uint32_t
COFFDumper::countTotalTableEntries(ResourceSectionRef RSF,
const coff_resource_dir_table &Table,
StringRef Level) {
uint32_t TotalEntries = 0;
for (int i = 0; i < Table.NumberOfNameEntries + Table.NumberOfIDEntries;
i++) {
auto Entry = unwrapOrError(Obj->getFileName(), RSF.getTableEntry(Table, i));
if (Entry.Offset.isSubDir()) {
StringRef NextLevel;
if (Level == "Name")
NextLevel = "Language";
else
NextLevel = "Name";
auto &NextTable =
unwrapOrError(Obj->getFileName(), RSF.getEntrySubDir(Entry));
TotalEntries += countTotalTableEntries(RSF, NextTable, NextLevel);
} else {
TotalEntries += 1;
}
}
return TotalEntries;
}
void COFFDumper::printResourceDirectoryTable(
ResourceSectionRef RSF, const coff_resource_dir_table &Table,
StringRef Level) {
W.printNumber("Number of String Entries", Table.NumberOfNameEntries);
W.printNumber("Number of ID Entries", Table.NumberOfIDEntries);
// Iterate through level in resource directory tree.
for (int i = 0; i < Table.NumberOfNameEntries + Table.NumberOfIDEntries;
i++) {
auto Entry = unwrapOrError(Obj->getFileName(), RSF.getTableEntry(Table, i));
StringRef Name;
SmallString<20> IDStr;
raw_svector_ostream OS(IDStr);
if (i < Table.NumberOfNameEntries) {
ArrayRef<UTF16> RawEntryNameString =
unwrapOrError(Obj->getFileName(), RSF.getEntryNameString(Entry));
std::vector<UTF16> EndianCorrectedNameString;
if (llvm::sys::IsBigEndianHost) {
EndianCorrectedNameString.resize(RawEntryNameString.size() + 1);
std::copy(RawEntryNameString.begin(), RawEntryNameString.end(),
EndianCorrectedNameString.begin() + 1);
EndianCorrectedNameString[0] = UNI_UTF16_BYTE_ORDER_MARK_SWAPPED;
RawEntryNameString = makeArrayRef(EndianCorrectedNameString);
}
std::string EntryNameString;
if (!llvm::convertUTF16ToUTF8String(RawEntryNameString, EntryNameString))
reportError(errorCodeToError(object_error::parse_failed),
Obj->getFileName());
OS << ": ";
OS << EntryNameString;
} else {
if (Level == "Type") {
OS << ": ";
printResourceTypeName(Entry.Identifier.ID, OS);
} else {
OS << ": (ID " << Entry.Identifier.ID << ")";
}
}
Name = StringRef(IDStr);
ListScope ResourceType(W, Level.str() + Name.str());
if (Entry.Offset.isSubDir()) {
W.printHex("Table Offset", Entry.Offset.value());
StringRef NextLevel;
if (Level == "Name")
NextLevel = "Language";
else
NextLevel = "Name";
auto &NextTable =
unwrapOrError(Obj->getFileName(), RSF.getEntrySubDir(Entry));
printResourceDirectoryTable(RSF, NextTable, NextLevel);
} else {
W.printHex("Entry Offset", Entry.Offset.value());
char FormattedTime[20] = {};
time_t TDS = time_t(Table.TimeDateStamp);
strftime(FormattedTime, 20, "%Y-%m-%d %H:%M:%S", gmtime(&TDS));
W.printHex("Time/Date Stamp", FormattedTime, Table.TimeDateStamp);
W.printNumber("Major Version", Table.MajorVersion);
W.printNumber("Minor Version", Table.MinorVersion);
W.printNumber("Characteristics", Table.Characteristics);
ListScope DataScope(W, "Data");
auto &DataEntry =
unwrapOrError(Obj->getFileName(), RSF.getEntryData(Entry));
W.printHex("DataRVA", DataEntry.DataRVA);
W.printNumber("DataSize", DataEntry.DataSize);
W.printNumber("Codepage", DataEntry.Codepage);
W.printNumber("Reserved", DataEntry.Reserved);
StringRef Contents =
unwrapOrError(Obj->getFileName(), RSF.getContents(DataEntry));
W.printBinaryBlock("Data", Contents);
}
}
}
void COFFDumper::printStackMap() const {
object::SectionRef StackMapSection;
for (auto Sec : Obj->sections()) {
StringRef Name;
if (Expected<StringRef> NameOrErr = Sec.getName())
Name = *NameOrErr;
else
consumeError(NameOrErr.takeError());
if (Name == ".llvm_stackmaps") {
StackMapSection = Sec;
break;
}
}
if (StackMapSection == object::SectionRef())
return;
StringRef StackMapContents =
unwrapOrError(Obj->getFileName(), StackMapSection.getContents());
ArrayRef<uint8_t> StackMapContentsArray =
arrayRefFromStringRef(StackMapContents);
if (Obj->isLittleEndian())
prettyPrintStackMap(
W, StackMapParser<support::little>(StackMapContentsArray));
else
prettyPrintStackMap(
W, StackMapParser<support::big>(StackMapContentsArray));
}
void COFFDumper::printAddrsig() {
object::SectionRef AddrsigSection;
for (auto Sec : Obj->sections()) {
StringRef Name;
if (Expected<StringRef> NameOrErr = Sec.getName())
Name = *NameOrErr;
else
consumeError(NameOrErr.takeError());
if (Name == ".llvm_addrsig") {
AddrsigSection = Sec;
break;
}
}
if (AddrsigSection == object::SectionRef())
return;
StringRef AddrsigContents =
unwrapOrError(Obj->getFileName(), AddrsigSection.getContents());
ArrayRef<uint8_t> AddrsigContentsArray(AddrsigContents.bytes_begin(),
AddrsigContents.size());
ListScope L(W, "Addrsig");
const uint8_t *Cur = AddrsigContents.bytes_begin();
const uint8_t *End = AddrsigContents.bytes_end();
while (Cur != End) {
unsigned Size;
const char *Err;
uint64_t SymIndex = decodeULEB128(Cur, &Size, End, &Err);
if (Err)
reportError(createError(Err), Obj->getFileName());
Expected<COFFSymbolRef> Sym = Obj->getSymbol(SymIndex);
if (!Sym)
reportError(Sym.takeError(), Obj->getFileName());
StringRef SymName;
if (std::error_code EC = Obj->getSymbolName(*Sym, SymName))
reportError(errorCodeToError(EC), Obj->getFileName());
W.printNumber("Sym", SymName, SymIndex);
Cur += Size;
}
}
void llvm::dumpCodeViewMergedTypes(ScopedPrinter &Writer,
ArrayRef<ArrayRef<uint8_t>> IpiRecords,
ArrayRef<ArrayRef<uint8_t>> TpiRecords) {
TypeTableCollection TpiTypes(TpiRecords);
{
ListScope S(Writer, "MergedTypeStream");
TypeDumpVisitor TDV(TpiTypes, &Writer, opts::CodeViewSubsectionBytes);
if (Error Err = codeview::visitTypeStream(TpiTypes, TDV))
reportError(std::move(Err), "<?>");
Writer.flush();
}
// Flatten the id stream and print it next. The ID stream refers to names from
// the type stream.
TypeTableCollection IpiTypes(IpiRecords);
{
ListScope S(Writer, "MergedIDStream");
TypeDumpVisitor TDV(TpiTypes, &Writer, opts::CodeViewSubsectionBytes);
TDV.setIpiTypes(IpiTypes);
if (Error Err = codeview::visitTypeStream(IpiTypes, TDV))
reportError(std::move(Err), "<?>");
Writer.flush();
}
}
|
;================================================================================
; Dialog Pointer Override
;--------------------------------------------------------------------------------
DialogOverride:
LDA $7F5035 : BEQ .skip
LDA $7F5700, X ; use alternate buffer
RTL
.skip
LDA $7F1200, X
RTL
;--------------------------------------------------------------------------------
; $7F5035 - Alternate Text Pointer Flag ; 0=Disable
; $7F5036 - Padding Byte (Must be Zero)
; $7F5700 - $7F57FF - Dialog Buffer
;--------------------------------------------------------------------------------
ResetDialogPointer:
STZ $1CF0 : STZ $1CF1 ; reset decompression buffer
LDA.b #$00 : STA $7F5035 ; zero out the alternate flag
LDA.b #$1C : STA $1CE9 ; thing we wrote over
RTL
;--------------------------------------------------------------------------------
;macro LoadDialog(index,table)
; PHA : PHX : PHY
; PHB : PHK : PLB
; LDA $00 : PHA
; LDA $01 : PHA
; LDA $02 : PHA
; LDA.b #$01 : STA $7F5035 ; set flag
;
; LDA <index> : ASL : !ADD.l <index> : TAX ; get quote offset *3, move to X
; LDA <table>, X : STA $00 ; write pointer to direct page
; LDA <table>+1, X : STA $01
; LDA <table>+2, X : STA $02
;
; LDX.b #$00 : LDY.b #$00
; -
; LDA [$00], Y ; load the next character from the pointer
; STA $7F5700, X ; write to the buffer
; INX : INY
; CMP.b #$7F : BNE -
; PLA : STA $02
; PLA : STA $01
; PLA : STA $00
; PLB
; PLY : PLX : PLA
;endmacro
;--------------------------------------------------------------------------------
;macro LoadDialogAddress(address)
; PHA : PHX : PHY
; PHP
; PHB : PHK : PLB
; SEP #$30 ; set 8-bit accumulator and index registers
; LDA $00 : PHA
; LDA $01 : PHA
; LDA $02 : PHA
; LDA.b #$01 : STA $7F5035 ; set flag
;
; LDA.b #<address> : STA $00 ; write pointer to direct page
; LDA.b #<address>>>8 : STA $01
; LDA.b #<address>>>16 : STA $02
;
; LDX.b #$00 : LDY.b #$00
; -
; LDA [$00], Y ; load the next character from the pointer
; STA $7F5700, X ; write to the buffer
; INX : INY
; CMP.b #$7F : BNE -
; PLA : STA $02
; PLA : STA $01
; PLA : STA $00
; PLB
; PLP
; PLY : PLX : PLA
;endmacro
;--------------------------------------------------------------------------------
!OFFSET_POINTER = "$7F5094"
!OFFSET_RETURN = "$7F5096"
!DIALOG_BUFFER = "$7F5700"
macro LoadDialogAddress(address)
PHA : PHX : PHY
PHP
PHB : PHK : PLB
SEP #$20 ; set 8-bit accumulator
REP #$10 ; set 16-bit index registers
LDA $00 : PHA
LDA $01 : PHA
LDA $02 : PHA
STZ $1CF0 : STZ $1CF1 ; reset decompression buffer
LDA.b #$01 : STA $7F5035 ; set flag
%CopyDialog(<address>)
PLA : STA $02
PLA : STA $01
PLA : STA $00
PLB
PLP
PLY : PLX : PLA
endmacro
;--------------------------------------------------------------------------------
macro CopyDialog(address)
LDA.b #<address> : STA $00 ; write pointer to direct page
LDA.b #<address>>>8 : STA $01
LDA.b #<address>>>16 : STA $02
%CopyDialogIndirect()
endmacro
;--------------------------------------------------------------------------------
macro CopyDialogIndirect()
REP #$20 : LDA !OFFSET_POINTER : TAX : LDY.w #$0000 : SEP #$20 ; copy 2-byte offset pointer to X and set Y to 0
?loop:
LDA [$00], Y ; load the next character from the pointer
STA !DIALOG_BUFFER, X ; write to the buffer
INX : INY
CMP.b #$7F : BNE ?loop
REP #$20 ; set 16-bit accumulator
TXA : INC : STA !OFFSET_RETURN ; copy out X into
LDA.w #$0000 : STA !OFFSET_POINTER
SEP #$20 ; set 8-bit accumulator
endmacro
;--------------------------------------------------------------------------------
LoadDialogAddressIndirect:
STZ $1CF0 : STZ $1CF1 ; reset decompression buffer
LDA.b #$01 : STA $7F5035 ; set flag
%CopyDialogIndirect()
;%LoadDialogAddress(UncleText)
RTL
;--------------------------------------------------------------------------------
!ITEM_TEMPORARY = "$7F5040"
FreeDungeonItemNotice:
STA !ITEM_TEMPORARY
PHA : PHX : PHY
PHP
PHB : PHK : PLB
SEP #$20 ; set 8-bit accumulator
REP #$10 ; set 16-bit index registers
LDA $00 : PHA
LDA $01 : PHA
LDA $02 : PHA
;--------------------------------
LDA.l FreeItemText : BNE + : BRL .skip : +
LDA #$00 : STA $7F5010 ; initialize scratch
LDA !ITEM_TEMPORARY
CMP.b #$24 : BNE + ; general small key
%CopyDialog(Notice_SmallKeyOf)
LDA !OFFSET_RETURN : DEC #2 : STA !OFFSET_POINTER
%CopyDialog(Notice_Self)
BRL .done
+ : CMP.b #$25 : BNE + ; general compass
%CopyDialog(Notice_CompassOf)
LDA !OFFSET_RETURN : DEC #2 : STA !OFFSET_POINTER
%CopyDialog(Notice_Self)
BRL .done
+ : CMP.b #$33 : BNE + ; general map
%CopyDialog(Notice_MapOf)
LDA !OFFSET_RETURN : DEC #2 : STA !OFFSET_POINTER
%CopyDialog(Notice_Self)
BRL .done
+ : CMP.b #$32 : BNE + ; general big key
%CopyDialog(Notice_BigKeyOf)
LDA !OFFSET_RETURN : DEC #2 : STA !OFFSET_POINTER
%CopyDialog(Notice_Self)
BRL .done
+
AND.b #$F0 ; looking at high bits only
CMP.b #$70 : BNE + ; map of...
%CopyDialog(Notice_MapOf)
BRL .dungeon
+ : CMP.b #$80 : BNE + ; compass of...
%CopyDialog(Notice_CompassOf)
BRL .dungeon
+ : CMP.b #$90 : BNE + ; big key of...
%CopyDialog(Notice_BigKeyOf)
BRA .dungeon
+ : CMP.b #$A0 : BNE + ; small key of...
LDA !ITEM_TEMPORARY : CMP.b #$AF : BNE ++ : BRL .skip : ++
%CopyDialog(Notice_SmallKeyOf)
PLA : AND.b #$0F : STA $7F5020 : LDA.b #$0F : !SUB $7F5020 : PHA
LDA #$01 : STA $7F5010 ; set up a flip for small keys
BRA .dungeon
+
BRL .skip ; it's not something we are going to give a notice for
.dungeon
LDA !OFFSET_RETURN : DEC #2 : STA !OFFSET_POINTER
LDA !ITEM_TEMPORARY
AND.b #$0F ; looking at low bits only
STA $7F5011
LDA $7F5010 : BEQ +
LDA $7F5010
LDA #$0F : !SUB $7F5011 : STA $7F5011 ; flip the values for small keys
+
LDA $7F5011
CMP.b #$00 : BNE + ; ...light world
%CopyDialog(Notice_LightWorld) : BRL .done
+ : CMP.b #$01 : BNE + ; ...dark world
%CopyDialog(Notice_DarkWorld) : BRL .done
+ : CMP.b #$02 : BNE + ; ...ganon's tower
%CopyDialog(Notice_GTower) : BRL .done
+ : CMP.b #$03 : BNE + ; ...turtle rock
%CopyDialog(Notice_TRock) : BRL .done
+ : CMP.b #$04 : BNE + ; ...thieves' town
%CopyDialog(Notice_Thieves) : BRL .done
+ : CMP.b #$05 : BNE + ; ...tower of hera
%CopyDialog(Notice_Hera) : BRL .done
+ : CMP.b #$06 : BNE + ; ...ice palace
%CopyDialog(Notice_Ice) : BRL .done
+ : CMP.b #$07 : BNE + ; ...skull woods
%CopyDialog(Notice_Skull) : BRL .done
+ : CMP.b #$08 : BNE + ; ...misery mire
%CopyDialog(Notice_Mire) : BRL .done
+ : CMP.b #$09 : BNE + ; ...dark palace
%CopyDialog(Notice_PoD) : BRL .done
+ : CMP.b #$0A : BNE + ; ...swamp palace
%CopyDialog(Notice_Swamp) : BRL .done
+ : CMP.b #$0B : BNE + ; ...agahnim's tower
%CopyDialog(Notice_AgaTower) : BRL .done
+ : CMP.b #$0C : BNE + ; ...desert palace
%CopyDialog(Notice_Desert) : BRL .done
+ : CMP.b #$0D : BNE + ; ...eastern palace
%CopyDialog(Notice_Eastern) : BRA .done
+ : CMP.b #$0E : BNE + ; ...hyrule castle
%CopyDialog(Notice_Castle) : BRA .done
+ : CMP.b #$0F : BNE + ; ...sewers
%CopyDialog(Notice_Sewers)
+
.done
STZ $1CF0 : STZ $1CF1 ; reset decompression buffer
LDA.b #$01 : STA $7F5035 ; set alternate dialog flag
LDA.b #$01 : STA $7F50A0
;--------------------------------
PLA : STA $02
PLA : STA $01
PLA : STA $00
PLB
PLP
PLY : PLX : PLA
;JSL.l Main_ShowTextMessage_Alt
RTL
.skip
;--------------------------------
PLA : STA $02
PLA : STA $01
PLA : STA $00
PLB
PLP
PLY : PLX : PLA
RTL
;--------------------------------------------------------------------------------
DialogResetSelectionIndex:
JSL.l Attract_DecompressStoryGfx ; what we wrote over
STZ $1CE8
RTL
;--------------------------------------------------------------------------------
DialogItemReceive:
BCS .noMessage ; if doubling the item value overflowed it must be a rando item
CPY #$98 : !BLT + ;if the item is $4C or greater it must be a rando item
.noMessage
LDA.w #$FFFF
BRA .done
+
LDA Ancilla_ReceiveItem_item_messages, Y
.done
CMP.w #$FFFF
RTL
;--------------------------------------------------------------------------------
DialogFairyThrow:
LDA.l Restrict_Ponds : BEQ .normal
LDA $7EF35C : ORA $7EF35D : ORA $7EF35E : ORA $7EF35F : BNE .normal
.noInventory
LDA $0D80, X : !ADD #$08 : STA $0D80, X
LDA.b #$51
LDY.b #$01
RTL
.normal
LDA.b #$88
LDY.b #$00
RTL
;--------------------------------------------------------------------------------
DialogGanon1:
JSL.l CheckGanonVulnerability : BCS +
REP #$20 : LDA.w #$018C : STA $1CF0 : SEP #$20
BRA ++
+
REP #$20 : LDA.w #$016D : STA $1CF0 : SEP #$20
++
JSL.l Sprite_ShowMessageMinimal_Alt
RTL
;--------------------------------------------------------------------------------
DialogGanon2:
JSL.l CheckGanonVulnerability : BCS +
REP #$20 : LDA.w #$018D : STA $1CF0 : SEP #$20
BRA ++
+
REP #$20 : LDA.w #$016E : STA $1CF0 : SEP #$20
++
JSL.l Sprite_ShowMessageMinimal_Alt
RTL
;--------------------------------------------------------------------------------
DialogEtherTablet:
PHA
LDA $0202 : CMP.b #$0F : BEQ + ; Show normal text if book is not equipped
-
PLA : JSL Sprite_ShowMessageUnconditional ; Wacky Hylian Text
RTL
+
BIT $F4 : BVC - ; Show normal text if Y is not pressed
LDA.l AllowHammerTablets : BEQ ++
LDA $7EF34B : BEQ .yesText : BRA .noText
++
LDA $7EF359 : CMP.b #$FF : BEQ .yesText : CMP.b #$02 : !BGE .noText
;++
.yesText
PLA
LDA.b #$0c
LDY.b #$01
JSL Sprite_ShowMessageUnconditional ; Text From MSPedestalText (tables.asm)
RTL
.noText
PLA
RTL
;--------------------------------------------------------------------------------
DialogBombosTablet:
PHA
LDA $0202 : CMP.b #$0F : BEQ + ; Show normal text if book is not equipped
-
PLA : JSL Sprite_ShowMessageUnconditional ; Wacky Hylian Text
RTL
+
BIT $F4 : BVC - ; Show normal text if Y is not pressed
LDA.l AllowHammerTablets : BEQ ++
LDA $7EF34B : BEQ .yesText : BRA .noText
++
LDA $7EF359 : CMP.b #$FF : BEQ .yesText : CMP.b #$02 : !BGE .noText
;++
.yesText
PLA
LDA.b #$0D
LDY.b #$01
JSL Sprite_ShowMessageUnconditional ; Text From MSPedestalText (tables.asm)
RTL
.noText
PLA
RTL
;--------------------------------------------------------------------------------
DialogSahasrahla:
LDA.l $7EF374 : AND #$04 : BEQ + ;Check if player has green pendant
LDA.b #$2F
LDY.b #$00
JSL.l Sprite_ShowMessageUnconditional
+
RTL
;--------------------------------------------------------------------------------
DialogBombShopGuy:
LDA.l $7EF37A : AND #$05 : CMP #$05 : BEQ + ;Check if player has crystals 5 & 6
LDA.b #$15
LDY.b #$01
JSL.l Sprite_ShowMessageUnconditional
RTL
+
LDA.b #$16
LDY.b #$01
JSL.l Sprite_ShowMessageUnconditional
RTL
;--------------------------------------------------------------------------------
Main_ShowTextMessage_Alt:
; Are we in text mode? If so then end the routine.
LDA $10 : CMP.b #$0E : BEQ .already_in_text_mode
Sprite_ShowMessageMinimal_Alt:
STZ $11
PHX : PHY
LDA.b $00 : PHA
LDA.b $01 : PHA
LDA.b $02 : PHA
LDA.b #$1C : STA.b $02
REP #$30
LDA.w $1CF0 : ASL : TAX
LDA.l $7f71c0, X
STA.b $00
SEP #$30
LDY.b #$00
LDA [$00], Y : CMP.b #$fe : BNE +
INY : LDA [$00], Y : CMP.b #$6e : BNE +
INY : LDA [$00], Y : : BNE +
INY : LDA [$00], Y : CMP.b #$fe : BNE +
INY : LDA [$00], Y : CMP.b #$6b : BNE +
INY : LDA [$00], Y : CMP.b #$04 : BNE +
STZ $1CE8
BRL .end
+
STZ $0223 ; Otherwise set it so we are in text mode.
STZ $1CD8 ; Initialize the step in the submodule
; Go to text display mode (as opposed to maps, etc)
LDA.b #$02 : STA $11
; Store the current module in the temporary location.
LDA $10 : STA $010C
; Switch the main module ($10) to text mode.
LDA.b #$0E : STA $10
.end
PLA : STA.b $02
PLA : STA.b $01
PLA : STA.b $00
PLY : PLX
Main_ShowTextMessage_Alt_already_in_text_mode:
RTL
;--------------------------------------------------------------------------------
; A0 - A9 - 0 - 9
; AA - C3 - A - Z
; C6 - ?
; C7 - !
; C8 - ,
; C9 - - Hyphen
; CD - Japanese period
; CE - ~
; D8 - ` apostraphe
;;--------------------------------------------------------------------------------
;DialogUncleData:
;;--------------------------------------------------------------------------------
; .pointers
; dl #DialogUncleData_weetabix
; dl #DialogUncleData_bootlessUntilBoots
; dl #DialogUncleData_onlyOneBed
; dl #DialogUncleData_onlyTextBox
; dl #DialogUncleData_mothTutorial
; dl #DialogUncleData_seedWorst
; dl #DialogUncleData_chasingTail
; dl #DialogUncleData_doneBefore
; dl #DialogUncleData_capeCanPass
; dl #DialogUncleData_bootsAtRace
; dl #DialogUncleData_kanzeonSeed
; dl #DialogUncleData_notRealUncle
; dl #DialogUncleData_haveAVeryBadTime
; dl #DialogUncleData_todayBadLuck
; dl #DialogUncleData_leavingGoodbye
; dl #DialogUncleData_iGotThis
; dl #DialogUncleData_raceToCastle
; dl #DialogUncleData_69BlazeIt
; dl #DialogUncleData_hi
; dl #DialogUncleData_gettingSmokes
; dl #DialogUncleData_dangerousSeeYa
; dl #DialogUncleData_badEnoughDude
; dl #DialogUncleData_iAmError
; dl #DialogUncleData_sub2Guaranteed
; dl #DialogUncleData_chestSecretEverybody
; dl #DialogUncleData_findWindFish
; dl #DialogUncleData_shortcutToGanon
; dl #DialogUncleData_moonCrashing
; dl #DialogUncleData_fightVoldemort
; dl #DialogUncleData_redMailForCowards
; dl #DialogUncleData_heyListen
; dl #DialogUncleData_excuseMePrincess
;;--------------------------------------------------------------------------------
; .weetabix
; ; We’re out of / Weetabix. To / the store!
; db $00, $c0, $00, $ae, $00, $d8, $00, $bb, $00, $ae, $00, $ff, $00, $b8, $00, $be, $00, $bd, $00, $ff, $00, $b8, $00, $af
; db $75, $00, $c0, $00, $ae, $00, $ae, $00, $bd, $00, $aa, $00, $ab, $00, $b2, $00, $c1, $00, $cD, $00, $ff, $00, $bd, $00, $b8
; db $76, $00, $bd, $00, $b1, $00, $ae, $00, $ff, $00, $bc, $00, $bd, $00, $b8, $00, $bb, $00, $ae, $00, $c7
; db $7f, $7f
;;--------------------------------------------------------------------------------
; .bootlessUntilBoots
; ; This seed is / bootless / until boots.
; db $00, $bd, $00, $b1, $00, $b2, $00, $bc, $00, $ff, $00, $bc, $00, $ae, $00, $ae, $00, $ad, $00, $ff, $00, $b2, $00, $bc
; db $75, $00, $ab, $00, $b8, $00, $b8, $00, $bd, $00, $b5, $00, $ae, $00, $bc, $00, $bc
; db $76, $00, $be, $00, $b7, $00, $bd, $00, $b2, $00, $b5, $00, $ff, $00, $ab, $00, $b8, $00, $b8, $00, $bd, $00, $bc, $00, $cD
; db $7f, $7f
;;--------------------------------------------------------------------------------
; .onlyOneBed
; ; Why do we only / have one bed?
; db $00, $c0, $00, $b1, $00, $c2, $00, $ff, $00, $ad, $00, $b8, $00, $ff, $00, $c0, $00, $ae, $00, $ff, $00, $b8, $00, $b7, $00, $b5, $00, $c2
; db $75, $00, $b1, $00, $aa, $00, $bf, $00, $ae, $00, $ff, $00, $b8, $00, $b7, $00, $ae, $00, $ff, $00, $ab, $00, $ae, $00, $ad, $00, $c6
; db $7f, $7f
;;--------------------------------------------------------------------------------
; .onlyTextBox
; ; This is the / only textbox.
; db $00, $bd, $00, $b1, $00, $b2, $00, $bc, $00, $ff, $00, $b2, $00, $bc, $00, $ff, $00, $bd, $00, $b1, $00, $ae
; db $75, $00, $b8, $00, $b7, $00, $b5, $00, $c2, $00, $ff, $00, $bd, $00, $ae, $00, $c1, $00, $bd, $00, $ab, $00, $b8, $00, $c1, $00, $cD
; db $7f, $7f
;;--------------------------------------------------------------------------------
; .mothTutorial
; ; I'm going to / go watch the / Moth tutorial.
; db $00, $b2, $00, $d8, $00, $b6, $00, $ff, $00, $b0, $00, $b8, $00, $b2, $00, $b7, $00, $b0, $00, $ff, $00, $bd, $00, $b8
; db $75, $00, $b0, $00, $b8, $00, $ff, $00, $c0, $00, $aa, $00, $bd, $00, $ac, $00, $b1, $00, $ff, $00, $bd, $00, $b1, $00, $ae
; db $76, $00, $b6, $00, $b8, $00, $bd, $00, $b1, $00, $ff, $00, $bd, $00, $be, $00, $bd, $00, $b8, $00, $bb, $00, $b2, $00, $aa, $00, $b5, $00, $cD
; db $7f, $7f
;;--------------------------------------------------------------------------------
; .seedWorst
; ; This seed is / the worst.
; db $00, $bd, $00, $b1, $00, $b2, $00, $bc, $00, $ff, $00, $bc, $00, $ae, $00, $ae, $00, $ad, $00, $ff, $00, $b2, $00, $bc
; db $75, $00, $bd, $00, $b1, $00, $ae, $00, $ff, $00, $c0, $00, $b8, $00, $bb, $00, $bc, $00, $bd, $00, $cD
; db $7f, $7f
;;--------------------------------------------------------------------------------
; .chasingTail
; ; Chasing tail. / Fly ladies. / Do not follow.
; db $00, $ac, $00, $b1, $00, $aa, $00, $bc, $00, $b2, $00, $b7, $00, $b0, $00, $ff, $00, $bd, $00, $aa, $00, $b2, $00, $b5, $00, $cD
; db $75, $00, $af, $00, $b5, $00, $c2, $00, $ff, $00, $b5, $00, $aa, $00, $ad, $00, $b2, $00, $ae, $00, $bc, $00, $cD
; db $76, $00, $ad, $00, $b8, $00, $ff, $00, $b7, $00, $b8, $00, $bd, $00, $ff, $00, $af, $00, $b8, $00, $b5, $00, $b5, $00, $b8, $00, $c0, $00, $cD
; db $7f, $7f
;;--------------------------------------------------------------------------------
; .doneBefore
; ; I feel like / I’ve done this / before…
; db $00, $b2, $00, $ff, $00, $af, $00, $ae, $00, $ae, $00, $b5, $00, $ff, $00, $b5, $00, $b2, $00, $b4, $00, $ae
; db $75, $00, $b2, $00, $d8, $00, $bf, $00, $ae, $00, $ff, $00, $ad, $00, $b8, $00, $b7, $00, $ae, $00, $ff, $00, $bd, $00, $b1, $00, $b2, $00, $bc
; db $76, $00, $ab, $00, $ae, $00, $af, $00, $b8, $00, $bb, $00, $ae, $00, $cD, $00, $cD, $00, $cD
; db $7f, $7f
;;--------------------------------------------------------------------------------
; .capeCanPass
; ; Magic cape can / pass through / the barrier!
; db $00, $b6, $00, $aa, $00, $b0, $00, $b2, $00, $ac, $00, $ff, $00, $ac, $00, $aa, $00, $b9, $00, $ae, $00, $ff, $00, $ac, $00, $aa, $00, $b7
; db $75, $00, $b9, $00, $aa, $00, $bc, $00, $bc, $00, $ff, $00, $bd, $00, $b1, $00, $bb, $00, $b8, $00, $be, $00, $b0, $00, $b1
; db $76, $00, $bd, $00, $b1, $00, $ae, $00, $ff, $00, $ab, $00, $aa, $00, $bb, $00, $bb, $00, $b2, $00, $ae, $00, $bb, $00, $c7
; db $7f, $7f
;;--------------------------------------------------------------------------------
; .bootsAtRace
; ; Boots at race? / Seed confirmed / impossible.
; db $00, $ab, $00, $b8, $00, $b8, $00, $bd, $00, $bc, $00, $ff, $00, $aa, $00, $bd, $00, $ff, $00, $bb, $00, $aa, $00, $ac, $00, $ae, $00, $c6
; db $75, $00, $bc, $00, $ae, $00, $ae, $00, $ad, $00, $ff, $00, $ac, $00, $b8, $00, $b7, $00, $af, $00, $b2, $00, $bb, $00, $b6, $00, $ae, $00, $ad
; db $76, $00, $b2, $00, $b6, $00, $b9, $00, $b8, $00, $bc, $00, $bc, $00, $b2, $00, $ab, $00, $b5, $00, $ae, $00, $cD
; db $7f, $7f
;;--------------------------------------------------------------------------------
; .kanzeonSeed
; ; If this is a / Kanzeon seed, / I'm quitting.
; db $00, $b2, $00, $af, $00, $ff, $00, $bd, $00, $b1, $00, $b2, $00, $bc, $00, $ff, $00, $b2, $00, $bc, $00, $ff, $00, $aa
; db $75, $00, $b4, $00, $aa, $00, $b7, $00, $c3, $00, $ae, $00, $b8, $00, $b7, $00, $ff, $00, $bc, $00, $ae, $00, $ae, $00, $ad, $00, $c8
; db $76, $00, $b2, $00, $d8, $00, $b6, $00, $ff, $00, $ba, $00, $be, $00, $b2, $00, $bd, $00, $bd, $00, $b2, $00, $b7, $00, $b0, $00, $cD
; db $7f, $7f
;;--------------------------------------------------------------------------------
; .notRealUncle
; ; I am not your / real uncle.
; db $00, $b2, $00, $ff, $00, $aa, $00, $b6, $00, $ff, $00, $b7, $00, $b8, $00, $bd, $00, $ff, $00, $c2, $00, $b8, $00, $be, $00, $bb
; db $75, $00, $bb, $00, $ae, $00, $aa, $00, $b5, $00, $ff, $00, $be, $00, $b7, $00, $ac, $00, $b5, $00, $ae, $00, $cD
; db $7f, $7f
;;--------------------------------------------------------------------------------
; .haveAVeryBadTime
; ; You're going / to have a very / bad time.
; db $00, $c2, $00, $b8, $00, $be, $00, $d8, $00, $bb, $00, $ae, $00, $ff, $00, $b0, $00, $b8, $00, $b2, $00, $b7, $00, $b0
; db $75, $00, $bd, $00, $b8, $00, $ff, $00, $b1, $00, $aa, $00, $bf, $00, $ae, $00, $ff, $00, $aa, $00, $ff, $00, $bf, $00, $ae, $00, $bb, $00, $c2
; db $76, $00, $ab, $00, $aa, $00, $ad, $00, $ff, $00, $bd, $00, $b2, $00, $b6, $00, $ae, $00, $cD
; db $7f, $7f
;;--------------------------------------------------------------------------------
; .todayBadLuck
; ; Today you / will have / bad luck.
; db $00, $bd, $00, $b8, $00, $ad, $00, $aa, $00, $c2, $00, $ff, $00, $c2, $00, $b8, $00, $be, $00, $ff, $00, $c0, $00, $b2, $00, $b5, $00, $b5
; db $75, $00, $b1, $00, $aa, $00, $bf, $00, $ae, $00, $ff, $00, $ab, $00, $aa, $00, $ad, $00, $ff, $00, $b5, $00, $be, $00, $ac, $00, $b4, $00, $c7
; db $7f, $7f
;;--------------------------------------------------------------------------------
; .leavingGoodbye
; ; I am leaving / forever. / Goodbye.
; db $00, $b2, $00, $ff, $00, $aa, $00, $b6, $00, $ff, $00, $b5, $00, $ae, $00, $aa, $00, $bf, $00, $b2, $00, $b7, $00, $b0
; db $75, $00, $af, $00, $b8, $00, $bb, $00, $ae, $00, $bf, $00, $ae, $00, $bb, $00, $cD
; db $76, $00, $b0, $00, $b8, $00, $b8, $00, $ad, $00, $ab, $00, $c2, $00, $ae, $00, $cD
; db $7f, $7f
;;--------------------------------------------------------------------------------
; .iGotThis
; ; Don’t worry. / I got this / covered.
; db $00, $ad, $00, $b8, $00, $b7, $00, $d8, $00, $bd, $00, $ff, $00, $c0, $00, $b8, $00, $bb, $00, $bb, $00, $c2, $00, $cD
; db $75, $00, $b2, $00, $ff, $00, $b0, $00, $b8, $00, $bd, $00, $ff, $00, $bd, $00, $b1, $00, $b2, $00, $bc
; db $76, $00, $ac, $00, $b8, $00, $bf, $00, $ae, $00, $bb, $00, $ae, $00, $ad, $00, $cD
; db $7f, $7f
;;--------------------------------------------------------------------------------
; .raceToCastle
; ; Race you to / the castle!
; db $00, $bb, $00, $aa, $00, $ac, $00, $ae, $00, $ff, $00, $c2, $00, $b8, $00, $be, $00, $ff, $00, $bd, $00, $b8
; db $75, $00, $bd, $00, $b1, $00, $ae, $00, $ff, $00, $ac, $00, $aa, $00, $bc, $00, $bd, $00, $b5, $00, $ae, $00, $c7
; db $7f, $7f
;;--------------------------------------------------------------------------------
; .69BlazeIt
; ; ~69 Blaze It!~
; db $75, $00, $cE, $00, $a6, $00, $a9, $00, $ff, $00, $ab, $00, $b5, $00, $aa, $00, $c3, $00, $ae, $00, $ff, $00, $b2, $00, $bd, $00, $c7, $00, $cE
; db $7f, $7f
;;--------------------------------------------------------------------------------
; .hi
; ; hi
; db $75, $00, $ff, $00, $ff, $00, $ff, $00, $ff, $00, $ff, $00, $ff, $00, $b1, $00, $b2
; db $7f, $7f
;;--------------------------------------------------------------------------------
; .gettingSmokes
; ; I'M JUST GOING / OUT FOR A / PACK OF SMOKES.
; db $00, $b2, $00, $d8, $00, $b6, $00, $ff, $00, $b3, $00, $be, $00, $bc, $00, $bd, $00, $ff, $00, $b0, $00, $b8, $00, $b2, $00, $b7, $00, $b0
; db $75, $00, $b8, $00, $be, $00, $bd, $00, $ff, $00, $af, $00, $b8, $00, $bb, $00, $ff, $00, $aa
; db $76, $00, $b9, $00, $aa, $00, $ac, $00, $b4, $00, $ff, $00, $b8, $00, $af, $00, $ff, $00, $bc, $00, $b6, $00, $b8, $00, $b4, $00, $ae, $00, $bc, $00, $cD
; db $7f, $7f
;;--------------------------------------------------------------------------------
; .dangerousSeeYa
; ; It's dangerous / to go alone. / See ya!
; db $00, $b2, $00, $bd, $00, $d8, $00, $bc, $00, $ff, $00, $ad, $00, $aa, $00, $b7, $00, $b0, $00, $ae, $00, $bb, $00, $b8, $00, $be, $00, $bc
; db $75, $00, $bd, $00, $b8, $00, $ff, $00, $b0, $00, $b8, $00, $ff, $00, $aa, $00, $b5, $00, $b8, $00, $b7, $00, $ae, $00, $cD
; db $76, $00, $bc, $00, $ae, $00, $ae, $00, $ff, $00, $c2, $00, $aa, $00, $c7
; db $7f, $7f
;;--------------------------------------------------------------------------------
; .badEnoughDude
; ; ARE YOU A BAD / ENOUGH DUDE TO / RESCUE ZELDA?
; db $00, $aa, $00, $bb, $00, $ae, $00, $ff, $00, $c2, $00, $b8, $00, $be, $00, $ff, $00, $aa, $00, $ff, $00, $ab, $00, $aa, $00, $ad
; db $75, $00, $ae, $00, $b7, $00, $b8, $00, $be, $00, $b0, $00, $b1, $00, $ff, $00, $ad, $00, $be, $00, $ad, $00, $ae, $00, $ff, $00, $bd, $00, $b8
; db $76, $00, $bb, $00, $ae, $00, $bc, $00, $ac, $00, $be, $00, $ae, $00, $ff, $00, $c3, $00, $ae, $00, $b5, $00, $ad, $00, $aa, $00, $c6
; db $7f, $7f
;;--------------------------------------------------------------------------------
; .iAmError
; ; I AM ERROR
; db $76, $00, $ff, $00, $ff, $00, $ff, $00, $ff, $00, $b2, $00, $ff, $00, $aa, $00, $b6, $00, $ff, $00, $ae, $00, $bb, $00, $bb, $00, $b8, $00, $bb
; db $7f, $7f
;;--------------------------------------------------------------------------------
; .sub2Guaranteed
; ; This seed is / sub 2 hours, / guaranteed.
; db $00, $bd, $00, $b1, $00, $b2, $00, $bc, $00, $ff, $00, $bc, $00, $ae, $00, $ae, $00, $ad, $00, $ff, $00, $b2, $00, $bc
; db $75, $00, $bc, $00, $be, $00, $ab, $00, $ff, $00, $a2, $00, $ff, $00, $b1, $00, $b8, $00, $be, $00, $bb, $00, $bc, $00, $c8
; db $76, $00, $b0, $00, $be, $00, $aa, $00, $bb, $00, $aa, $00, $b7, $00, $bd, $00, $ae, $00, $ae, $00, $ad, $00, $cD
; db $7f, $7f
;;--------------------------------------------------------------------------------
; .chestSecretEverybody
; ; The chest is / a secret to / everybody.
; db $00, $bd, $00, $b1, $00, $ae, $00, $ff, $00, $ac, $00, $b1, $00, $ae, $00, $bc, $00, $bd, $00, $ff, $00, $b2, $00, $bc
; db $75, $00, $aa, $00, $ff, $00, $bc, $00, $ae, $00, $ac, $00, $bb, $00, $ae, $00, $bd, $00, $ff, $00, $bd, $00, $b8
; db $76, $00, $ae, $00, $bf, $00, $ae, $00, $bb, $00, $c2, $00, $ab, $00, $b8, $00, $ad, $00, $c2, $00, $cD
; db $7f, $7f
;;--------------------------------------------------------------------------------
; .findWindFish
; ; I'm off to / find the / wind fish.
; db $00, $b2, $00, $d8, $00, $b6, $00, $ff, $00, $b8, $00, $af, $00, $af, $00, $ff, $00, $bd, $00, $b8
; db $75, $00, $af, $00, $b2, $00, $b7, $00, $ad, $00, $ff, $00, $bd, $00, $b1, $00, $ae
; db $76, $00, $c0, $00, $b2, $00, $b7, $00, $ad, $00, $ff, $00, $af, $00, $b2, $00, $bc, $00, $b1, $00, $cD
; db $7f, $7f
;;--------------------------------------------------------------------------------
; .shortcutToGanon
; ; The shortcut / to Ganon / is this way!
; db $00, $bd, $00, $b1, $00, $ae, $00, $ff, $00, $bc, $00, $b1, $00, $b8, $00, $bb, $00, $bd, $00, $ac, $00, $be, $00, $bd
; db $75, $00, $bd, $00, $b8, $00, $ff, $00, $b0, $00, $aa, $00, $b7, $00, $b8, $00, $b7
; db $76, $00, $b2, $00, $bc, $00, $ff, $00, $bd, $00, $b1, $00, $b2, $00, $bc, $00, $ff, $00, $c0, $00, $aa, $00, $c2, $00, $c7
; db $7f, $7f
;;--------------------------------------------------------------------------------
; .moonCrashing
; ; THE MOON IS / CRASHING! RUN / FOR YOUR LIFE!
; db $00, $bd, $00, $b1, $00, $ae, $00, $ff, $00, $b6, $00, $b8, $00, $b8, $00, $b7, $00, $ff, $00, $b2, $00, $bc
; db $75, $00, $ac, $00, $bb, $00, $aa, $00, $bc, $00, $b1, $00, $b2, $00, $b7, $00, $b0, $00, $c7, $00, $ff, $00, $bb, $00, $be, $00, $b7
; db $76, $00, $af, $00, $b8, $00, $bb, $00, $ff, $00, $c2, $00, $b8, $00, $be, $00, $bb, $00, $ff, $00, $b5, $00, $b2, $00, $af, $00, $ae, $00, $c7
; db $7f, $7f
;;--------------------------------------------------------------------------------
; .fightVoldemort
; ; Time to fight / he who must / not be named.
; db $00, $bd, $00, $b2, $00, $b6, $00, $ae, $00, $ff, $00, $bd, $00, $b8, $00, $ff, $00, $af, $00, $b2, $00, $b0, $00, $b1, $00, $bd
; db $75, $00, $b1, $00, $ae, $00, $ff, $00, $c0, $00, $b1, $00, $b8, $00, $ff, $00, $b6, $00, $be, $00, $bc, $00, $bd
; db $76, $00, $b7, $00, $b8, $00, $bd, $00, $ff, $00, $ab, $00, $ae, $00, $ff, $00, $b7, $00, $aa, $00, $b6, $00, $ae, $00, $ad, $00, $cD
; db $7f, $7f
;;--------------------------------------------------------------------------------
; .redMailForCowards
; ; RED MAIL / IS FOR / COWARDS.
; db $00, $bb, $00, $ae, $00, $ad, $00, $ff, $00, $b6, $00, $aa, $00, $b2, $00, $b5
; db $75, $00, $b2, $00, $bc, $00, $ff, $00, $af, $00, $b8, $00, $bb
; db $76, $00, $ac, $00, $b8, $00, $c0, $00, $aa, $00, $bb, $00, $ad, $00, $bc, $00, $cD
; db $7f, $7f
;;--------------------------------------------------------------------------------
; .heyListen
; ; HEY! / / LISTEN!
; db $00, $b1, $00, $ae, $00, $c2, $00, $c7
; db $76, $00, $b5, $00, $b2, $00, $bc, $00, $bd, $00, $ae, $00, $b7, $00, $c7
; db $7f, $7f
;;--------------------------------------------------------------------------------
; .excuseMePrincess
; ; Well / excuuuuuse me, / princess!
; db $00, $c0, $00, $ae, $00, $b5, $00, $b5
; db $75, $00, $ae, $00, $c1, $00, $ac, $00, $be, $00, $be, $00, $be, $00, $be, $00, $be, $00, $bc, $00, $ae, $00, $ff, $00, $b6, $00, $ae, $00, $c8
; db $76, $00, $b9, $00, $bb, $00, $b2, $00, $b7, $00, $ac, $00, $ae, $00, $bc, $00, $bc, $00, $c7
; db $7f, $7f
;;-------------------------------------------------------------------------------- ^32nd
|
; A017762: Binomial coefficients C(n,98).
; 1,99,4950,166650,4249575,87541245,1517381580,22760723700,301579589025,3585446225075,38722819230810,383707936014390,3517322746798575,30032524991895525,240260199935164200,1809960172844903640,12895966231519938435,87237418624987818825,562196697805477054650,3461948086486358704950,20425493710269516359205,115744464358193926035495,631333441953785051102700,3321362890278608312322900,16883594692249592254308075,83067285885867993891195729,396167055763370432404164246,1834106739645233483352612250
add $0,98
bin $0,98
|
user/_ln: file format elf64-littleriscv
Disassembly of section .text:
0000000000000000 <main>:
#include "kernel/stat.h"
#include "user/user.h"
int
main(int argc, char *argv[])
{
0: 1101 addi sp,sp,-32
2: ec06 sd ra,24(sp)
4: e822 sd s0,16(sp)
6: e426 sd s1,8(sp)
8: 1000 addi s0,sp,32
if(argc != 3){
a: 478d li a5,3
c: 02f50063 beq a0,a5,2c <main+0x2c>
fprintf(2, "Usage: ln old new\n");
10: 00000597 auipc a1,0x0
14: 7f058593 addi a1,a1,2032 # 800 <malloc+0xec>
18: 4509 li a0,2
1a: 00000097 auipc ra,0x0
1e: 60e080e7 jalr 1550(ra) # 628 <fprintf>
exit(1);
22: 4505 li a0,1
24: 00000097 auipc ra,0x0
28: 2aa080e7 jalr 682(ra) # 2ce <exit>
2c: 84ae mv s1,a1
}
if(link(argv[1], argv[2]) < 0)
2e: 698c ld a1,16(a1)
30: 6488 ld a0,8(s1)
32: 00000097 auipc ra,0x0
36: 2fc080e7 jalr 764(ra) # 32e <link>
3a: 00054763 bltz a0,48 <main+0x48>
fprintf(2, "link %s %s: failed\n", argv[1], argv[2]);
exit(0);
3e: 4501 li a0,0
40: 00000097 auipc ra,0x0
44: 28e080e7 jalr 654(ra) # 2ce <exit>
fprintf(2, "link %s %s: failed\n", argv[1], argv[2]);
48: 6894 ld a3,16(s1)
4a: 6490 ld a2,8(s1)
4c: 00000597 auipc a1,0x0
50: 7cc58593 addi a1,a1,1996 # 818 <malloc+0x104>
54: 4509 li a0,2
56: 00000097 auipc ra,0x0
5a: 5d2080e7 jalr 1490(ra) # 628 <fprintf>
5e: b7c5 j 3e <main+0x3e>
0000000000000060 <strcpy>:
#include "kernel/fcntl.h"
#include "user/user.h"
char*
strcpy(char *s, const char *t)
{
60: 1141 addi sp,sp,-16
62: e422 sd s0,8(sp)
64: 0800 addi s0,sp,16
char *os;
os = s;
while((*s++ = *t++) != 0)
66: 87aa mv a5,a0
68: 0585 addi a1,a1,1
6a: 0785 addi a5,a5,1
6c: fff5c703 lbu a4,-1(a1)
70: fee78fa3 sb a4,-1(a5)
74: fb75 bnez a4,68 <strcpy+0x8>
;
return os;
}
76: 6422 ld s0,8(sp)
78: 0141 addi sp,sp,16
7a: 8082 ret
000000000000007c <strcmp>:
int
strcmp(const char *p, const char *q)
{
7c: 1141 addi sp,sp,-16
7e: e422 sd s0,8(sp)
80: 0800 addi s0,sp,16
while(*p && *p == *q)
82: 00054783 lbu a5,0(a0)
86: cb91 beqz a5,9a <strcmp+0x1e>
88: 0005c703 lbu a4,0(a1)
8c: 00f71763 bne a4,a5,9a <strcmp+0x1e>
p++, q++;
90: 0505 addi a0,a0,1
92: 0585 addi a1,a1,1
while(*p && *p == *q)
94: 00054783 lbu a5,0(a0)
98: fbe5 bnez a5,88 <strcmp+0xc>
return (uchar)*p - (uchar)*q;
9a: 0005c503 lbu a0,0(a1)
}
9e: 40a7853b subw a0,a5,a0
a2: 6422 ld s0,8(sp)
a4: 0141 addi sp,sp,16
a6: 8082 ret
00000000000000a8 <strlen>:
uint
strlen(const char *s)
{
a8: 1141 addi sp,sp,-16
aa: e422 sd s0,8(sp)
ac: 0800 addi s0,sp,16
int n;
for(n = 0; s[n]; n++)
ae: 00054783 lbu a5,0(a0)
b2: cf91 beqz a5,ce <strlen+0x26>
b4: 0505 addi a0,a0,1
b6: 87aa mv a5,a0
b8: 4685 li a3,1
ba: 9e89 subw a3,a3,a0
bc: 00f6853b addw a0,a3,a5
c0: 0785 addi a5,a5,1
c2: fff7c703 lbu a4,-1(a5)
c6: fb7d bnez a4,bc <strlen+0x14>
;
return n;
}
c8: 6422 ld s0,8(sp)
ca: 0141 addi sp,sp,16
cc: 8082 ret
for(n = 0; s[n]; n++)
ce: 4501 li a0,0
d0: bfe5 j c8 <strlen+0x20>
00000000000000d2 <memset>:
void*
memset(void *dst, int c, uint n)
{
d2: 1141 addi sp,sp,-16
d4: e422 sd s0,8(sp)
d6: 0800 addi s0,sp,16
char *cdst = (char *) dst;
int i;
for(i = 0; i < n; i++){
d8: ca19 beqz a2,ee <memset+0x1c>
da: 87aa mv a5,a0
dc: 1602 slli a2,a2,0x20
de: 9201 srli a2,a2,0x20
e0: 00a60733 add a4,a2,a0
cdst[i] = c;
e4: 00b78023 sb a1,0(a5)
for(i = 0; i < n; i++){
e8: 0785 addi a5,a5,1
ea: fee79de3 bne a5,a4,e4 <memset+0x12>
}
return dst;
}
ee: 6422 ld s0,8(sp)
f0: 0141 addi sp,sp,16
f2: 8082 ret
00000000000000f4 <strchr>:
char*
strchr(const char *s, char c)
{
f4: 1141 addi sp,sp,-16
f6: e422 sd s0,8(sp)
f8: 0800 addi s0,sp,16
for(; *s; s++)
fa: 00054783 lbu a5,0(a0)
fe: cb99 beqz a5,114 <strchr+0x20>
if(*s == c)
100: 00f58763 beq a1,a5,10e <strchr+0x1a>
for(; *s; s++)
104: 0505 addi a0,a0,1
106: 00054783 lbu a5,0(a0)
10a: fbfd bnez a5,100 <strchr+0xc>
return (char*)s;
return 0;
10c: 4501 li a0,0
}
10e: 6422 ld s0,8(sp)
110: 0141 addi sp,sp,16
112: 8082 ret
return 0;
114: 4501 li a0,0
116: bfe5 j 10e <strchr+0x1a>
0000000000000118 <gets>:
char*
gets(char *buf, int max)
{
118: 711d addi sp,sp,-96
11a: ec86 sd ra,88(sp)
11c: e8a2 sd s0,80(sp)
11e: e4a6 sd s1,72(sp)
120: e0ca sd s2,64(sp)
122: fc4e sd s3,56(sp)
124: f852 sd s4,48(sp)
126: f456 sd s5,40(sp)
128: f05a sd s6,32(sp)
12a: ec5e sd s7,24(sp)
12c: 1080 addi s0,sp,96
12e: 8baa mv s7,a0
130: 8a2e mv s4,a1
int i, cc;
char c;
for(i=0; i+1 < max; ){
132: 892a mv s2,a0
134: 4481 li s1,0
cc = read(0, &c, 1);
if(cc < 1)
break;
buf[i++] = c;
if(c == '\n' || c == '\r')
136: 4aa9 li s5,10
138: 4b35 li s6,13
for(i=0; i+1 < max; ){
13a: 89a6 mv s3,s1
13c: 2485 addiw s1,s1,1
13e: 0344d863 bge s1,s4,16e <gets+0x56>
cc = read(0, &c, 1);
142: 4605 li a2,1
144: faf40593 addi a1,s0,-81
148: 4501 li a0,0
14a: 00000097 auipc ra,0x0
14e: 19c080e7 jalr 412(ra) # 2e6 <read>
if(cc < 1)
152: 00a05e63 blez a0,16e <gets+0x56>
buf[i++] = c;
156: faf44783 lbu a5,-81(s0)
15a: 00f90023 sb a5,0(s2)
if(c == '\n' || c == '\r')
15e: 01578763 beq a5,s5,16c <gets+0x54>
162: 0905 addi s2,s2,1
164: fd679be3 bne a5,s6,13a <gets+0x22>
for(i=0; i+1 < max; ){
168: 89a6 mv s3,s1
16a: a011 j 16e <gets+0x56>
16c: 89a6 mv s3,s1
break;
}
buf[i] = '\0';
16e: 99de add s3,s3,s7
170: 00098023 sb zero,0(s3)
return buf;
}
174: 855e mv a0,s7
176: 60e6 ld ra,88(sp)
178: 6446 ld s0,80(sp)
17a: 64a6 ld s1,72(sp)
17c: 6906 ld s2,64(sp)
17e: 79e2 ld s3,56(sp)
180: 7a42 ld s4,48(sp)
182: 7aa2 ld s5,40(sp)
184: 7b02 ld s6,32(sp)
186: 6be2 ld s7,24(sp)
188: 6125 addi sp,sp,96
18a: 8082 ret
000000000000018c <stat>:
int
stat(const char *n, struct stat *st)
{
18c: 1101 addi sp,sp,-32
18e: ec06 sd ra,24(sp)
190: e822 sd s0,16(sp)
192: e426 sd s1,8(sp)
194: e04a sd s2,0(sp)
196: 1000 addi s0,sp,32
198: 892e mv s2,a1
int fd;
int r;
fd = open(n, O_RDONLY);
19a: 4581 li a1,0
19c: 00000097 auipc ra,0x0
1a0: 172080e7 jalr 370(ra) # 30e <open>
if(fd < 0)
1a4: 02054563 bltz a0,1ce <stat+0x42>
1a8: 84aa mv s1,a0
return -1;
r = fstat(fd, st);
1aa: 85ca mv a1,s2
1ac: 00000097 auipc ra,0x0
1b0: 17a080e7 jalr 378(ra) # 326 <fstat>
1b4: 892a mv s2,a0
close(fd);
1b6: 8526 mv a0,s1
1b8: 00000097 auipc ra,0x0
1bc: 13e080e7 jalr 318(ra) # 2f6 <close>
return r;
}
1c0: 854a mv a0,s2
1c2: 60e2 ld ra,24(sp)
1c4: 6442 ld s0,16(sp)
1c6: 64a2 ld s1,8(sp)
1c8: 6902 ld s2,0(sp)
1ca: 6105 addi sp,sp,32
1cc: 8082 ret
return -1;
1ce: 597d li s2,-1
1d0: bfc5 j 1c0 <stat+0x34>
00000000000001d2 <atoi>:
int
atoi(const char *s)
{
1d2: 1141 addi sp,sp,-16
1d4: e422 sd s0,8(sp)
1d6: 0800 addi s0,sp,16
int n;
n = 0;
while('0' <= *s && *s <= '9')
1d8: 00054603 lbu a2,0(a0)
1dc: fd06079b addiw a5,a2,-48
1e0: 0ff7f793 andi a5,a5,255
1e4: 4725 li a4,9
1e6: 02f76963 bltu a4,a5,218 <atoi+0x46>
1ea: 86aa mv a3,a0
n = 0;
1ec: 4501 li a0,0
while('0' <= *s && *s <= '9')
1ee: 45a5 li a1,9
n = n*10 + *s++ - '0';
1f0: 0685 addi a3,a3,1
1f2: 0025179b slliw a5,a0,0x2
1f6: 9fa9 addw a5,a5,a0
1f8: 0017979b slliw a5,a5,0x1
1fc: 9fb1 addw a5,a5,a2
1fe: fd07851b addiw a0,a5,-48
while('0' <= *s && *s <= '9')
202: 0006c603 lbu a2,0(a3)
206: fd06071b addiw a4,a2,-48
20a: 0ff77713 andi a4,a4,255
20e: fee5f1e3 bgeu a1,a4,1f0 <atoi+0x1e>
return n;
}
212: 6422 ld s0,8(sp)
214: 0141 addi sp,sp,16
216: 8082 ret
n = 0;
218: 4501 li a0,0
21a: bfe5 j 212 <atoi+0x40>
000000000000021c <memmove>:
void*
memmove(void *vdst, const void *vsrc, int n)
{
21c: 1141 addi sp,sp,-16
21e: e422 sd s0,8(sp)
220: 0800 addi s0,sp,16
char *dst;
const char *src;
dst = vdst;
src = vsrc;
if (src > dst) {
222: 02b57463 bgeu a0,a1,24a <memmove+0x2e>
while(n-- > 0)
226: 00c05f63 blez a2,244 <memmove+0x28>
22a: 1602 slli a2,a2,0x20
22c: 9201 srli a2,a2,0x20
22e: 00c507b3 add a5,a0,a2
dst = vdst;
232: 872a mv a4,a0
*dst++ = *src++;
234: 0585 addi a1,a1,1
236: 0705 addi a4,a4,1
238: fff5c683 lbu a3,-1(a1)
23c: fed70fa3 sb a3,-1(a4)
while(n-- > 0)
240: fee79ae3 bne a5,a4,234 <memmove+0x18>
src += n;
while(n-- > 0)
*--dst = *--src;
}
return vdst;
}
244: 6422 ld s0,8(sp)
246: 0141 addi sp,sp,16
248: 8082 ret
dst += n;
24a: 00c50733 add a4,a0,a2
src += n;
24e: 95b2 add a1,a1,a2
while(n-- > 0)
250: fec05ae3 blez a2,244 <memmove+0x28>
254: fff6079b addiw a5,a2,-1
258: 1782 slli a5,a5,0x20
25a: 9381 srli a5,a5,0x20
25c: fff7c793 not a5,a5
260: 97ba add a5,a5,a4
*--dst = *--src;
262: 15fd addi a1,a1,-1
264: 177d addi a4,a4,-1
266: 0005c683 lbu a3,0(a1)
26a: 00d70023 sb a3,0(a4)
while(n-- > 0)
26e: fee79ae3 bne a5,a4,262 <memmove+0x46>
272: bfc9 j 244 <memmove+0x28>
0000000000000274 <memcmp>:
int
memcmp(const void *s1, const void *s2, uint n)
{
274: 1141 addi sp,sp,-16
276: e422 sd s0,8(sp)
278: 0800 addi s0,sp,16
const char *p1 = s1, *p2 = s2;
while (n-- > 0) {
27a: ca05 beqz a2,2aa <memcmp+0x36>
27c: fff6069b addiw a3,a2,-1
280: 1682 slli a3,a3,0x20
282: 9281 srli a3,a3,0x20
284: 0685 addi a3,a3,1
286: 96aa add a3,a3,a0
if (*p1 != *p2) {
288: 00054783 lbu a5,0(a0)
28c: 0005c703 lbu a4,0(a1)
290: 00e79863 bne a5,a4,2a0 <memcmp+0x2c>
return *p1 - *p2;
}
p1++;
294: 0505 addi a0,a0,1
p2++;
296: 0585 addi a1,a1,1
while (n-- > 0) {
298: fed518e3 bne a0,a3,288 <memcmp+0x14>
}
return 0;
29c: 4501 li a0,0
29e: a019 j 2a4 <memcmp+0x30>
return *p1 - *p2;
2a0: 40e7853b subw a0,a5,a4
}
2a4: 6422 ld s0,8(sp)
2a6: 0141 addi sp,sp,16
2a8: 8082 ret
return 0;
2aa: 4501 li a0,0
2ac: bfe5 j 2a4 <memcmp+0x30>
00000000000002ae <memcpy>:
void *
memcpy(void *dst, const void *src, uint n)
{
2ae: 1141 addi sp,sp,-16
2b0: e406 sd ra,8(sp)
2b2: e022 sd s0,0(sp)
2b4: 0800 addi s0,sp,16
return memmove(dst, src, n);
2b6: 00000097 auipc ra,0x0
2ba: f66080e7 jalr -154(ra) # 21c <memmove>
}
2be: 60a2 ld ra,8(sp)
2c0: 6402 ld s0,0(sp)
2c2: 0141 addi sp,sp,16
2c4: 8082 ret
00000000000002c6 <fork>:
# generated by usys.pl - do not edit
#include "kernel/syscall.h"
.global fork
fork:
li a7, SYS_fork
2c6: 4885 li a7,1
ecall
2c8: 00000073 ecall
ret
2cc: 8082 ret
00000000000002ce <exit>:
.global exit
exit:
li a7, SYS_exit
2ce: 4889 li a7,2
ecall
2d0: 00000073 ecall
ret
2d4: 8082 ret
00000000000002d6 <wait>:
.global wait
wait:
li a7, SYS_wait
2d6: 488d li a7,3
ecall
2d8: 00000073 ecall
ret
2dc: 8082 ret
00000000000002de <pipe>:
.global pipe
pipe:
li a7, SYS_pipe
2de: 4891 li a7,4
ecall
2e0: 00000073 ecall
ret
2e4: 8082 ret
00000000000002e6 <read>:
.global read
read:
li a7, SYS_read
2e6: 4895 li a7,5
ecall
2e8: 00000073 ecall
ret
2ec: 8082 ret
00000000000002ee <write>:
.global write
write:
li a7, SYS_write
2ee: 48c1 li a7,16
ecall
2f0: 00000073 ecall
ret
2f4: 8082 ret
00000000000002f6 <close>:
.global close
close:
li a7, SYS_close
2f6: 48d5 li a7,21
ecall
2f8: 00000073 ecall
ret
2fc: 8082 ret
00000000000002fe <kill>:
.global kill
kill:
li a7, SYS_kill
2fe: 4899 li a7,6
ecall
300: 00000073 ecall
ret
304: 8082 ret
0000000000000306 <exec>:
.global exec
exec:
li a7, SYS_exec
306: 489d li a7,7
ecall
308: 00000073 ecall
ret
30c: 8082 ret
000000000000030e <open>:
.global open
open:
li a7, SYS_open
30e: 48bd li a7,15
ecall
310: 00000073 ecall
ret
314: 8082 ret
0000000000000316 <mknod>:
.global mknod
mknod:
li a7, SYS_mknod
316: 48c5 li a7,17
ecall
318: 00000073 ecall
ret
31c: 8082 ret
000000000000031e <unlink>:
.global unlink
unlink:
li a7, SYS_unlink
31e: 48c9 li a7,18
ecall
320: 00000073 ecall
ret
324: 8082 ret
0000000000000326 <fstat>:
.global fstat
fstat:
li a7, SYS_fstat
326: 48a1 li a7,8
ecall
328: 00000073 ecall
ret
32c: 8082 ret
000000000000032e <link>:
.global link
link:
li a7, SYS_link
32e: 48cd li a7,19
ecall
330: 00000073 ecall
ret
334: 8082 ret
0000000000000336 <mkdir>:
.global mkdir
mkdir:
li a7, SYS_mkdir
336: 48d1 li a7,20
ecall
338: 00000073 ecall
ret
33c: 8082 ret
000000000000033e <chdir>:
.global chdir
chdir:
li a7, SYS_chdir
33e: 48a5 li a7,9
ecall
340: 00000073 ecall
ret
344: 8082 ret
0000000000000346 <dup>:
.global dup
dup:
li a7, SYS_dup
346: 48a9 li a7,10
ecall
348: 00000073 ecall
ret
34c: 8082 ret
000000000000034e <getpid>:
.global getpid
getpid:
li a7, SYS_getpid
34e: 48ad li a7,11
ecall
350: 00000073 ecall
ret
354: 8082 ret
0000000000000356 <sbrk>:
.global sbrk
sbrk:
li a7, SYS_sbrk
356: 48b1 li a7,12
ecall
358: 00000073 ecall
ret
35c: 8082 ret
000000000000035e <sleep>:
.global sleep
sleep:
li a7, SYS_sleep
35e: 48b5 li a7,13
ecall
360: 00000073 ecall
ret
364: 8082 ret
0000000000000366 <uptime>:
.global uptime
uptime:
li a7, SYS_uptime
366: 48b9 li a7,14
ecall
368: 00000073 ecall
ret
36c: 8082 ret
000000000000036e <sigalarm>:
.global sigalarm
sigalarm:
li a7, SYS_sigalarm
36e: 48d9 li a7,22
ecall
370: 00000073 ecall
ret
374: 8082 ret
0000000000000376 <sigreturn>:
.global sigreturn
sigreturn:
li a7, SYS_sigreturn
376: 48dd li a7,23
ecall
378: 00000073 ecall
ret
37c: 8082 ret
000000000000037e <putc>:
static char digits[] = "0123456789ABCDEF";
static void
putc(int fd, char c)
{
37e: 1101 addi sp,sp,-32
380: ec06 sd ra,24(sp)
382: e822 sd s0,16(sp)
384: 1000 addi s0,sp,32
386: feb407a3 sb a1,-17(s0)
write(fd, &c, 1);
38a: 4605 li a2,1
38c: fef40593 addi a1,s0,-17
390: 00000097 auipc ra,0x0
394: f5e080e7 jalr -162(ra) # 2ee <write>
}
398: 60e2 ld ra,24(sp)
39a: 6442 ld s0,16(sp)
39c: 6105 addi sp,sp,32
39e: 8082 ret
00000000000003a0 <printint>:
static void
printint(int fd, int xx, int base, int sgn)
{
3a0: 7139 addi sp,sp,-64
3a2: fc06 sd ra,56(sp)
3a4: f822 sd s0,48(sp)
3a6: f426 sd s1,40(sp)
3a8: f04a sd s2,32(sp)
3aa: ec4e sd s3,24(sp)
3ac: 0080 addi s0,sp,64
3ae: 84aa mv s1,a0
char buf[16];
int i, neg;
uint x;
neg = 0;
if(sgn && xx < 0){
3b0: c299 beqz a3,3b6 <printint+0x16>
3b2: 0805c863 bltz a1,442 <printint+0xa2>
neg = 1;
x = -xx;
} else {
x = xx;
3b6: 2581 sext.w a1,a1
neg = 0;
3b8: 4881 li a7,0
3ba: fc040693 addi a3,s0,-64
}
i = 0;
3be: 4701 li a4,0
do{
buf[i++] = digits[x % base];
3c0: 2601 sext.w a2,a2
3c2: 00000517 auipc a0,0x0
3c6: 47650513 addi a0,a0,1142 # 838 <digits>
3ca: 883a mv a6,a4
3cc: 2705 addiw a4,a4,1
3ce: 02c5f7bb remuw a5,a1,a2
3d2: 1782 slli a5,a5,0x20
3d4: 9381 srli a5,a5,0x20
3d6: 97aa add a5,a5,a0
3d8: 0007c783 lbu a5,0(a5)
3dc: 00f68023 sb a5,0(a3)
}while((x /= base) != 0);
3e0: 0005879b sext.w a5,a1
3e4: 02c5d5bb divuw a1,a1,a2
3e8: 0685 addi a3,a3,1
3ea: fec7f0e3 bgeu a5,a2,3ca <printint+0x2a>
if(neg)
3ee: 00088b63 beqz a7,404 <printint+0x64>
buf[i++] = '-';
3f2: fd040793 addi a5,s0,-48
3f6: 973e add a4,a4,a5
3f8: 02d00793 li a5,45
3fc: fef70823 sb a5,-16(a4)
400: 0028071b addiw a4,a6,2
while(--i >= 0)
404: 02e05863 blez a4,434 <printint+0x94>
408: fc040793 addi a5,s0,-64
40c: 00e78933 add s2,a5,a4
410: fff78993 addi s3,a5,-1
414: 99ba add s3,s3,a4
416: 377d addiw a4,a4,-1
418: 1702 slli a4,a4,0x20
41a: 9301 srli a4,a4,0x20
41c: 40e989b3 sub s3,s3,a4
putc(fd, buf[i]);
420: fff94583 lbu a1,-1(s2)
424: 8526 mv a0,s1
426: 00000097 auipc ra,0x0
42a: f58080e7 jalr -168(ra) # 37e <putc>
while(--i >= 0)
42e: 197d addi s2,s2,-1
430: ff3918e3 bne s2,s3,420 <printint+0x80>
}
434: 70e2 ld ra,56(sp)
436: 7442 ld s0,48(sp)
438: 74a2 ld s1,40(sp)
43a: 7902 ld s2,32(sp)
43c: 69e2 ld s3,24(sp)
43e: 6121 addi sp,sp,64
440: 8082 ret
x = -xx;
442: 40b005bb negw a1,a1
neg = 1;
446: 4885 li a7,1
x = -xx;
448: bf8d j 3ba <printint+0x1a>
000000000000044a <vprintf>:
}
// Print to the given fd. Only understands %d, %x, %p, %s.
void
vprintf(int fd, const char *fmt, va_list ap)
{
44a: 7119 addi sp,sp,-128
44c: fc86 sd ra,120(sp)
44e: f8a2 sd s0,112(sp)
450: f4a6 sd s1,104(sp)
452: f0ca sd s2,96(sp)
454: ecce sd s3,88(sp)
456: e8d2 sd s4,80(sp)
458: e4d6 sd s5,72(sp)
45a: e0da sd s6,64(sp)
45c: fc5e sd s7,56(sp)
45e: f862 sd s8,48(sp)
460: f466 sd s9,40(sp)
462: f06a sd s10,32(sp)
464: ec6e sd s11,24(sp)
466: 0100 addi s0,sp,128
char *s;
int c, i, state;
state = 0;
for(i = 0; fmt[i]; i++){
468: 0005c903 lbu s2,0(a1)
46c: 18090f63 beqz s2,60a <vprintf+0x1c0>
470: 8aaa mv s5,a0
472: 8b32 mv s6,a2
474: 00158493 addi s1,a1,1
state = 0;
478: 4981 li s3,0
if(c == '%'){
state = '%';
} else {
putc(fd, c);
}
} else if(state == '%'){
47a: 02500a13 li s4,37
if(c == 'd'){
47e: 06400c13 li s8,100
printint(fd, va_arg(ap, int), 10, 1);
} else if(c == 'l') {
482: 06c00c93 li s9,108
printint(fd, va_arg(ap, uint64), 10, 0);
} else if(c == 'x') {
486: 07800d13 li s10,120
printint(fd, va_arg(ap, int), 16, 0);
} else if(c == 'p') {
48a: 07000d93 li s11,112
putc(fd, digits[x >> (sizeof(uint64) * 8 - 4)]);
48e: 00000b97 auipc s7,0x0
492: 3aab8b93 addi s7,s7,938 # 838 <digits>
496: a839 j 4b4 <vprintf+0x6a>
putc(fd, c);
498: 85ca mv a1,s2
49a: 8556 mv a0,s5
49c: 00000097 auipc ra,0x0
4a0: ee2080e7 jalr -286(ra) # 37e <putc>
4a4: a019 j 4aa <vprintf+0x60>
} else if(state == '%'){
4a6: 01498f63 beq s3,s4,4c4 <vprintf+0x7a>
for(i = 0; fmt[i]; i++){
4aa: 0485 addi s1,s1,1
4ac: fff4c903 lbu s2,-1(s1)
4b0: 14090d63 beqz s2,60a <vprintf+0x1c0>
c = fmt[i] & 0xff;
4b4: 0009079b sext.w a5,s2
if(state == 0){
4b8: fe0997e3 bnez s3,4a6 <vprintf+0x5c>
if(c == '%'){
4bc: fd479ee3 bne a5,s4,498 <vprintf+0x4e>
state = '%';
4c0: 89be mv s3,a5
4c2: b7e5 j 4aa <vprintf+0x60>
if(c == 'd'){
4c4: 05878063 beq a5,s8,504 <vprintf+0xba>
} else if(c == 'l') {
4c8: 05978c63 beq a5,s9,520 <vprintf+0xd6>
} else if(c == 'x') {
4cc: 07a78863 beq a5,s10,53c <vprintf+0xf2>
} else if(c == 'p') {
4d0: 09b78463 beq a5,s11,558 <vprintf+0x10e>
printptr(fd, va_arg(ap, uint64));
} else if(c == 's'){
4d4: 07300713 li a4,115
4d8: 0ce78663 beq a5,a4,5a4 <vprintf+0x15a>
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
4dc: 06300713 li a4,99
4e0: 0ee78e63 beq a5,a4,5dc <vprintf+0x192>
putc(fd, va_arg(ap, uint));
} else if(c == '%'){
4e4: 11478863 beq a5,s4,5f4 <vprintf+0x1aa>
putc(fd, c);
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
4e8: 85d2 mv a1,s4
4ea: 8556 mv a0,s5
4ec: 00000097 auipc ra,0x0
4f0: e92080e7 jalr -366(ra) # 37e <putc>
putc(fd, c);
4f4: 85ca mv a1,s2
4f6: 8556 mv a0,s5
4f8: 00000097 auipc ra,0x0
4fc: e86080e7 jalr -378(ra) # 37e <putc>
}
state = 0;
500: 4981 li s3,0
502: b765 j 4aa <vprintf+0x60>
printint(fd, va_arg(ap, int), 10, 1);
504: 008b0913 addi s2,s6,8
508: 4685 li a3,1
50a: 4629 li a2,10
50c: 000b2583 lw a1,0(s6)
510: 8556 mv a0,s5
512: 00000097 auipc ra,0x0
516: e8e080e7 jalr -370(ra) # 3a0 <printint>
51a: 8b4a mv s6,s2
state = 0;
51c: 4981 li s3,0
51e: b771 j 4aa <vprintf+0x60>
printint(fd, va_arg(ap, uint64), 10, 0);
520: 008b0913 addi s2,s6,8
524: 4681 li a3,0
526: 4629 li a2,10
528: 000b2583 lw a1,0(s6)
52c: 8556 mv a0,s5
52e: 00000097 auipc ra,0x0
532: e72080e7 jalr -398(ra) # 3a0 <printint>
536: 8b4a mv s6,s2
state = 0;
538: 4981 li s3,0
53a: bf85 j 4aa <vprintf+0x60>
printint(fd, va_arg(ap, int), 16, 0);
53c: 008b0913 addi s2,s6,8
540: 4681 li a3,0
542: 4641 li a2,16
544: 000b2583 lw a1,0(s6)
548: 8556 mv a0,s5
54a: 00000097 auipc ra,0x0
54e: e56080e7 jalr -426(ra) # 3a0 <printint>
552: 8b4a mv s6,s2
state = 0;
554: 4981 li s3,0
556: bf91 j 4aa <vprintf+0x60>
printptr(fd, va_arg(ap, uint64));
558: 008b0793 addi a5,s6,8
55c: f8f43423 sd a5,-120(s0)
560: 000b3983 ld s3,0(s6)
putc(fd, '0');
564: 03000593 li a1,48
568: 8556 mv a0,s5
56a: 00000097 auipc ra,0x0
56e: e14080e7 jalr -492(ra) # 37e <putc>
putc(fd, 'x');
572: 85ea mv a1,s10
574: 8556 mv a0,s5
576: 00000097 auipc ra,0x0
57a: e08080e7 jalr -504(ra) # 37e <putc>
57e: 4941 li s2,16
putc(fd, digits[x >> (sizeof(uint64) * 8 - 4)]);
580: 03c9d793 srli a5,s3,0x3c
584: 97de add a5,a5,s7
586: 0007c583 lbu a1,0(a5)
58a: 8556 mv a0,s5
58c: 00000097 auipc ra,0x0
590: df2080e7 jalr -526(ra) # 37e <putc>
for (i = 0; i < (sizeof(uint64) * 2); i++, x <<= 4)
594: 0992 slli s3,s3,0x4
596: 397d addiw s2,s2,-1
598: fe0914e3 bnez s2,580 <vprintf+0x136>
printptr(fd, va_arg(ap, uint64));
59c: f8843b03 ld s6,-120(s0)
state = 0;
5a0: 4981 li s3,0
5a2: b721 j 4aa <vprintf+0x60>
s = va_arg(ap, char*);
5a4: 008b0993 addi s3,s6,8
5a8: 000b3903 ld s2,0(s6)
if(s == 0)
5ac: 02090163 beqz s2,5ce <vprintf+0x184>
while(*s != 0){
5b0: 00094583 lbu a1,0(s2)
5b4: c9a1 beqz a1,604 <vprintf+0x1ba>
putc(fd, *s);
5b6: 8556 mv a0,s5
5b8: 00000097 auipc ra,0x0
5bc: dc6080e7 jalr -570(ra) # 37e <putc>
s++;
5c0: 0905 addi s2,s2,1
while(*s != 0){
5c2: 00094583 lbu a1,0(s2)
5c6: f9e5 bnez a1,5b6 <vprintf+0x16c>
s = va_arg(ap, char*);
5c8: 8b4e mv s6,s3
state = 0;
5ca: 4981 li s3,0
5cc: bdf9 j 4aa <vprintf+0x60>
s = "(null)";
5ce: 00000917 auipc s2,0x0
5d2: 26290913 addi s2,s2,610 # 830 <malloc+0x11c>
while(*s != 0){
5d6: 02800593 li a1,40
5da: bff1 j 5b6 <vprintf+0x16c>
putc(fd, va_arg(ap, uint));
5dc: 008b0913 addi s2,s6,8
5e0: 000b4583 lbu a1,0(s6)
5e4: 8556 mv a0,s5
5e6: 00000097 auipc ra,0x0
5ea: d98080e7 jalr -616(ra) # 37e <putc>
5ee: 8b4a mv s6,s2
state = 0;
5f0: 4981 li s3,0
5f2: bd65 j 4aa <vprintf+0x60>
putc(fd, c);
5f4: 85d2 mv a1,s4
5f6: 8556 mv a0,s5
5f8: 00000097 auipc ra,0x0
5fc: d86080e7 jalr -634(ra) # 37e <putc>
state = 0;
600: 4981 li s3,0
602: b565 j 4aa <vprintf+0x60>
s = va_arg(ap, char*);
604: 8b4e mv s6,s3
state = 0;
606: 4981 li s3,0
608: b54d j 4aa <vprintf+0x60>
}
}
}
60a: 70e6 ld ra,120(sp)
60c: 7446 ld s0,112(sp)
60e: 74a6 ld s1,104(sp)
610: 7906 ld s2,96(sp)
612: 69e6 ld s3,88(sp)
614: 6a46 ld s4,80(sp)
616: 6aa6 ld s5,72(sp)
618: 6b06 ld s6,64(sp)
61a: 7be2 ld s7,56(sp)
61c: 7c42 ld s8,48(sp)
61e: 7ca2 ld s9,40(sp)
620: 7d02 ld s10,32(sp)
622: 6de2 ld s11,24(sp)
624: 6109 addi sp,sp,128
626: 8082 ret
0000000000000628 <fprintf>:
void
fprintf(int fd, const char *fmt, ...)
{
628: 715d addi sp,sp,-80
62a: ec06 sd ra,24(sp)
62c: e822 sd s0,16(sp)
62e: 1000 addi s0,sp,32
630: e010 sd a2,0(s0)
632: e414 sd a3,8(s0)
634: e818 sd a4,16(s0)
636: ec1c sd a5,24(s0)
638: 03043023 sd a6,32(s0)
63c: 03143423 sd a7,40(s0)
va_list ap;
va_start(ap, fmt);
640: fe843423 sd s0,-24(s0)
vprintf(fd, fmt, ap);
644: 8622 mv a2,s0
646: 00000097 auipc ra,0x0
64a: e04080e7 jalr -508(ra) # 44a <vprintf>
}
64e: 60e2 ld ra,24(sp)
650: 6442 ld s0,16(sp)
652: 6161 addi sp,sp,80
654: 8082 ret
0000000000000656 <printf>:
void
printf(const char *fmt, ...)
{
656: 711d addi sp,sp,-96
658: ec06 sd ra,24(sp)
65a: e822 sd s0,16(sp)
65c: 1000 addi s0,sp,32
65e: e40c sd a1,8(s0)
660: e810 sd a2,16(s0)
662: ec14 sd a3,24(s0)
664: f018 sd a4,32(s0)
666: f41c sd a5,40(s0)
668: 03043823 sd a6,48(s0)
66c: 03143c23 sd a7,56(s0)
va_list ap;
va_start(ap, fmt);
670: 00840613 addi a2,s0,8
674: fec43423 sd a2,-24(s0)
vprintf(1, fmt, ap);
678: 85aa mv a1,a0
67a: 4505 li a0,1
67c: 00000097 auipc ra,0x0
680: dce080e7 jalr -562(ra) # 44a <vprintf>
}
684: 60e2 ld ra,24(sp)
686: 6442 ld s0,16(sp)
688: 6125 addi sp,sp,96
68a: 8082 ret
000000000000068c <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
68c: 1141 addi sp,sp,-16
68e: e422 sd s0,8(sp)
690: 0800 addi s0,sp,16
Header *bp, *p;
bp = (Header*)ap - 1;
692: ff050693 addi a3,a0,-16
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
696: 00000797 auipc a5,0x0
69a: 1ba7b783 ld a5,442(a5) # 850 <freep>
69e: a805 j 6ce <free+0x42>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
break;
if(bp + bp->s.size == p->s.ptr){
bp->s.size += p->s.ptr->s.size;
6a0: 4618 lw a4,8(a2)
6a2: 9db9 addw a1,a1,a4
6a4: feb52c23 sw a1,-8(a0)
bp->s.ptr = p->s.ptr->s.ptr;
6a8: 6398 ld a4,0(a5)
6aa: 6318 ld a4,0(a4)
6ac: fee53823 sd a4,-16(a0)
6b0: a091 j 6f4 <free+0x68>
} else
bp->s.ptr = p->s.ptr;
if(p + p->s.size == bp){
p->s.size += bp->s.size;
6b2: ff852703 lw a4,-8(a0)
6b6: 9e39 addw a2,a2,a4
6b8: c790 sw a2,8(a5)
p->s.ptr = bp->s.ptr;
6ba: ff053703 ld a4,-16(a0)
6be: e398 sd a4,0(a5)
6c0: a099 j 706 <free+0x7a>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
6c2: 6398 ld a4,0(a5)
6c4: 00e7e463 bltu a5,a4,6cc <free+0x40>
6c8: 00e6ea63 bltu a3,a4,6dc <free+0x50>
{
6cc: 87ba mv a5,a4
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
6ce: fed7fae3 bgeu a5,a3,6c2 <free+0x36>
6d2: 6398 ld a4,0(a5)
6d4: 00e6e463 bltu a3,a4,6dc <free+0x50>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
6d8: fee7eae3 bltu a5,a4,6cc <free+0x40>
if(bp + bp->s.size == p->s.ptr){
6dc: ff852583 lw a1,-8(a0)
6e0: 6390 ld a2,0(a5)
6e2: 02059813 slli a6,a1,0x20
6e6: 01c85713 srli a4,a6,0x1c
6ea: 9736 add a4,a4,a3
6ec: fae60ae3 beq a2,a4,6a0 <free+0x14>
bp->s.ptr = p->s.ptr;
6f0: fec53823 sd a2,-16(a0)
if(p + p->s.size == bp){
6f4: 4790 lw a2,8(a5)
6f6: 02061593 slli a1,a2,0x20
6fa: 01c5d713 srli a4,a1,0x1c
6fe: 973e add a4,a4,a5
700: fae689e3 beq a3,a4,6b2 <free+0x26>
} else
p->s.ptr = bp;
704: e394 sd a3,0(a5)
freep = p;
706: 00000717 auipc a4,0x0
70a: 14f73523 sd a5,330(a4) # 850 <freep>
}
70e: 6422 ld s0,8(sp)
710: 0141 addi sp,sp,16
712: 8082 ret
0000000000000714 <malloc>:
return freep;
}
void*
malloc(uint nbytes)
{
714: 7139 addi sp,sp,-64
716: fc06 sd ra,56(sp)
718: f822 sd s0,48(sp)
71a: f426 sd s1,40(sp)
71c: f04a sd s2,32(sp)
71e: ec4e sd s3,24(sp)
720: e852 sd s4,16(sp)
722: e456 sd s5,8(sp)
724: e05a sd s6,0(sp)
726: 0080 addi s0,sp,64
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
728: 02051493 slli s1,a0,0x20
72c: 9081 srli s1,s1,0x20
72e: 04bd addi s1,s1,15
730: 8091 srli s1,s1,0x4
732: 0014899b addiw s3,s1,1
736: 0485 addi s1,s1,1
if((prevp = freep) == 0){
738: 00000517 auipc a0,0x0
73c: 11853503 ld a0,280(a0) # 850 <freep>
740: c515 beqz a0,76c <malloc+0x58>
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
742: 611c ld a5,0(a0)
if(p->s.size >= nunits){
744: 4798 lw a4,8(a5)
746: 02977f63 bgeu a4,s1,784 <malloc+0x70>
74a: 8a4e mv s4,s3
74c: 0009871b sext.w a4,s3
750: 6685 lui a3,0x1
752: 00d77363 bgeu a4,a3,758 <malloc+0x44>
756: 6a05 lui s4,0x1
758: 000a0b1b sext.w s6,s4
p = sbrk(nu * sizeof(Header));
75c: 004a1a1b slliw s4,s4,0x4
p->s.size = nunits;
}
freep = prevp;
return (void*)(p + 1);
}
if(p == freep)
760: 00000917 auipc s2,0x0
764: 0f090913 addi s2,s2,240 # 850 <freep>
if(p == (char*)-1)
768: 5afd li s5,-1
76a: a895 j 7de <malloc+0xca>
base.s.ptr = freep = prevp = &base;
76c: 00000797 auipc a5,0x0
770: 0ec78793 addi a5,a5,236 # 858 <base>
774: 00000717 auipc a4,0x0
778: 0cf73e23 sd a5,220(a4) # 850 <freep>
77c: e39c sd a5,0(a5)
base.s.size = 0;
77e: 0007a423 sw zero,8(a5)
if(p->s.size >= nunits){
782: b7e1 j 74a <malloc+0x36>
if(p->s.size == nunits)
784: 02e48c63 beq s1,a4,7bc <malloc+0xa8>
p->s.size -= nunits;
788: 4137073b subw a4,a4,s3
78c: c798 sw a4,8(a5)
p += p->s.size;
78e: 02071693 slli a3,a4,0x20
792: 01c6d713 srli a4,a3,0x1c
796: 97ba add a5,a5,a4
p->s.size = nunits;
798: 0137a423 sw s3,8(a5)
freep = prevp;
79c: 00000717 auipc a4,0x0
7a0: 0aa73a23 sd a0,180(a4) # 850 <freep>
return (void*)(p + 1);
7a4: 01078513 addi a0,a5,16
if((p = morecore(nunits)) == 0)
return 0;
}
}
7a8: 70e2 ld ra,56(sp)
7aa: 7442 ld s0,48(sp)
7ac: 74a2 ld s1,40(sp)
7ae: 7902 ld s2,32(sp)
7b0: 69e2 ld s3,24(sp)
7b2: 6a42 ld s4,16(sp)
7b4: 6aa2 ld s5,8(sp)
7b6: 6b02 ld s6,0(sp)
7b8: 6121 addi sp,sp,64
7ba: 8082 ret
prevp->s.ptr = p->s.ptr;
7bc: 6398 ld a4,0(a5)
7be: e118 sd a4,0(a0)
7c0: bff1 j 79c <malloc+0x88>
hp->s.size = nu;
7c2: 01652423 sw s6,8(a0)
free((void*)(hp + 1));
7c6: 0541 addi a0,a0,16
7c8: 00000097 auipc ra,0x0
7cc: ec4080e7 jalr -316(ra) # 68c <free>
return freep;
7d0: 00093503 ld a0,0(s2)
if((p = morecore(nunits)) == 0)
7d4: d971 beqz a0,7a8 <malloc+0x94>
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
7d6: 611c ld a5,0(a0)
if(p->s.size >= nunits){
7d8: 4798 lw a4,8(a5)
7da: fa9775e3 bgeu a4,s1,784 <malloc+0x70>
if(p == freep)
7de: 00093703 ld a4,0(s2)
7e2: 853e mv a0,a5
7e4: fef719e3 bne a4,a5,7d6 <malloc+0xc2>
p = sbrk(nu * sizeof(Header));
7e8: 8552 mv a0,s4
7ea: 00000097 auipc ra,0x0
7ee: b6c080e7 jalr -1172(ra) # 356 <sbrk>
if(p == (char*)-1)
7f2: fd5518e3 bne a0,s5,7c2 <malloc+0xae>
return 0;
7f6: 4501 li a0,0
7f8: bf45 j 7a8 <malloc+0x94>
|
; Filter definitions 1998 Jochen Merz
section text
xdef flt_pre,flt_post
xdef flt_fnams
xdef flt_end
xdef flt_pica,flt_elite,flt_cond,flt_dron,flt_droff
xdef flt_text,flt_num,flt_empty
fs equ 1
fe equ 2
flt_pre dc.w 3
dc.b fs,'+',fe
flt_post dc.w 3
dc.b fs,'-',fe
flt_fnams dc.w 2
dc.b fs,'f'
flt_end dc.w 1
dc.b fe
flt_pica dc.w 3
dc.b fs,'P',fe
flt_elite dc.w 3
dc.b fs,'E',fe
flt_cond dc.w 3
dc.b fs,'C',fe
flt_dron dc.w 4
dc.b fs,'D0',fe
flt_droff dc.w 4
dc.b fs,'D1',fe
flt_text dc.w 3
dc.b fs,'T',fe
flt_num dc.w 3
dc.b fs,'N',fe
flt_empty dc.w 3
dc.b fs,' ',fe
ds.w 0
end
|
#include "Platform.inc"
#include "FarCalls.inc"
#include "Lcd.inc"
#include "../../../../firmware/Platform/Lcd/Isr.inc"
#include "TestFixture.inc"
radix decimal
ContrastPinAfterDisabledTest code
global testArrange
testArrange:
fcall initialiseLcd
fcall enableLcd
waitUntilLcdIsEnabled:
fcall pollLcd
fcall isLcdEnabled
sublw 0
btfsc STATUS, Z
goto waitUntilLcdIsEnabled
testAct:
banksel LCD_CONTRAST_PORT
bsf LCD_CONTRAST_PORT, LCD_CONTRAST_PIN
fcall disableLcd
testAssert:
banksel LCD_CONTRAST_PORT
movf LCD_CONTRAST_PORT, W
andlw LCD_CONTRAST_PIN_MASK
.aliasWForAssert _a
.assert "_a == 0, 'Expected contrast pin to be at 0V.'"
return
end
|
dnl ARM mpn_addmul_2.
dnl Contributed to the GNU project by Torbjörn Granlund.
dnl Copyright 2012, 2013, 2015 Free Software Foundation, Inc.
dnl This file is part of the GNU MP Library.
dnl
dnl The GNU MP Library is free software; you can redistribute it and/or modify
dnl it under the terms of either:
dnl
dnl * the GNU Lesser General Public License as published by the Free
dnl Software Foundation; either version 3 of the License, or (at your
dnl option) any later version.
dnl
dnl or
dnl
dnl * the GNU General Public License as published by the Free Software
dnl Foundation; either version 2 of the License, or (at your option) any
dnl later version.
dnl
dnl or both in parallel, as here.
dnl
dnl The GNU MP Library is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
dnl for more details.
dnl
dnl You should have received copies of the GNU General Public License and the
dnl GNU Lesser General Public License along with the GNU MP Library. If not,
dnl see https://www.gnu.org/licenses/.
include(`../config.m4')
C cycles/limb
C StrongARM: -
C XScale -
C ARM11 4.68
C Cortex-A7 3.625
C Cortex-A8 4
C Cortex-A9 2.25
C Cortex-A15 2.5
define(`rp',`r0')
define(`up',`r1')
define(`n', `r2')
define(`vp',`r3')
define(`v0',`r6')
define(`v1',`r7')
define(`u0',`r3')
define(`u1',`r9')
define(`cya',`r8')
define(`cyb',`r12')
ASM_START()
PROLOGUE(mpn_addmul_2)
push { r4-r9 }
ldrd v0, v1, [vp, #0]
mov cya, #0
mov cyb, #0
tst n, #1
beq L(evn)
L(odd): ldr u1, [up, #0]
ldr r4, [rp, #0]
tst n, #2
beq L(fi1)
L(fi3): sub up, up, #8
sub rp, rp, #8
b L(lo3)
L(fi1): sub n, n, #1
b L(top)
L(evn): ldr u0, [up, #0]
ldr r5, [rp, #0]
tst n, #2
bne L(fi2)
L(fi0): sub up, up, #4
sub rp, rp, #4
b L(lo0)
L(fi2): sub up, up, #12
sub rp, rp, #12
b L(lo2)
ALIGN(16)
L(top): ldr r5, [rp, #4]
umaal r4, cya, u1, v0
ldr u0, [up, #4]
umaal r5, cyb, u1, v1
str r4, [rp, #0]
L(lo0): ldr r4, [rp, #8]
umaal r5, cya, u0, v0
ldr u1, [up, #8]
umaal r4, cyb, u0, v1
str r5, [rp, #4]
L(lo3): ldr r5, [rp, #12]
umaal r4, cya, u1, v0
ldr u0, [up, #12]
umaal r5, cyb, u1, v1
str r4, [rp, #8]
L(lo2): ldr r4, [rp, #16]!
umaal r5, cya, u0, v0
ldr u1, [up, #16]!
umaal r4, cyb, u0, v1
str r5, [rp, #-4]
subs n, n, #4
bhi L(top)
L(end): umaal r4, cya, u1, v0
umaal cya, cyb, u1, v1
str r4, [rp, #0]
str cya, [rp, #4]
mov r0, cyb
pop { r4-r9 }
bx r14
EPILOGUE()
|
SECTION code_fp_am9511
PUBLIC _frexp
EXTERN cam32_sdcc_frexp
defc _frexp = cam32_sdcc_frexp
|
;
; 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. All advertising materials mentioning features or use of this software
; must display the following acknowledgement:
; This product includes software developed by Manuel Bouyer.
; 4. 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.
;
;
LIST P=PIC18F26K80
#include <p18f26k80.inc>
errorlevel -302
RADIX dec;
CBLOCK 0x00C ; start vars
devidh : 1 ;
devidl : 1 ;
tmp : 1 ;
cmpt1 : 1 ;
cmpt2 : 1 ;
ENDC ; end of vars
; flash-related defines
OFFSET EQU 0x400
WRBLK EQU 8
DEVIDP EQU 0x200000
; device-related defines
CLOCKHZ EQU 10
MTXIF EQU TX2IF
MRCIF EQU RC2IF
MPIR EQU PIR3
MTXREG EQU TXREG2
MRCREG EQU RCREG2
MRCSTA EQU RCSTA2
MTXSTA EQU TXSTA2
MSPBRG EQU SPBRG2
print macro str
movlw LOW str
rcall txstr
endm
printcr macro str
movlw LOW str
rcall txstrcrlf
endm
ORG OFFSET
nop;
bra start
crlfstr DA "\r\n\0"; ! only 4 bytes available
ORG OFFSET + 0x0008 ; interrupt vector;
reset
ORG OFFSET + 0x0018;
reset
;strings has to be low in memory, because we set TBLPTRU and TBLPTRH to a
; fixed value
bootstr DA "write id\0"
endstr DA "write done\0";
start
clrf INTCON, a;
; assume oscillator and serial ports are already set up
movlw HIGH DEVID
movwf devidh
movlw LOW DEVID
movwf devidl
; print version string
print bootstr;
swapf devidh, w
rcall printhex
movf devidh, w
rcall printhex
swapf devidl, w
rcall printhex
movf devidl, w
rcall printhex
rcall crlf
; ID to flash
movlw UPPER DEVIDP
movwf TBLPTRU
movlw HIGH DEVIDP
movwf TBLPTRH
movlw LOW DEVIDP
movwf TBLPTRL
movlw b'10010100'
movwf EECON1; point to flash, access flash, enable write, enable erase
rcall dowrite
movff devidl, TABLAT;
tblwt*+;
movff devidh, TABLAT;
tblwt*;
movlw b'10000100'
movwf EECON1; point to flash, access flash, enable write
rcall dowrite
doend:
printcr endstr
rcall crlf
reset
dowrite
movlw 0x55;
movwf EECON2;
movlw 0xAA;
movwf EECON2;
bsf EECON1, WR; start write;
nop
return;
txstrcrlf
rcall txstr
crlf
movlw LOW crlfstr;
txstr
movwf TBLPTRL, a;
clrf TBLPTRU, a;
movlw HIGH OFFSET
movwf TBLPTRH, a;
txstrloop
tblrd*+;
movf TABLAT, w;
bz doreturn;
rcall dotx;
bra txstrloop;
printhex
andlw 0x0f;
sublw 9;
bc decimal;
sublw '@';
bra dotx;
decimal
sublw '9';
; bra dotx
dotx
btfss MPIR, MTXIF, a;
bra dotx;
movwf MTXREG, a;
doreturn
return;
END
|
#include "fd_textBox.hpp"
FD_TextBox::FD_TextBox(std::weak_ptr<FD_Scene> s,
const FD_TextTemplate& type_temp, int x, int y, int z,
bool camera_bound, FD_DrawStyle style)
: FD_Object(z + 1, camera_bound, x, y, type_temp.box_width,
type_temp.box_height, 0, 1, 1, 255, true), type_temp{ type_temp } {
this->scene = s;
std::shared_ptr<FD_Scene> scene;
FD_Handling::lock(s, scene, true);
// Set values
this->draw_style = style;
this->line_offset = new FD_Tween(0);
this->caret_timer = new FD_Timer();
// Create the caret
this->caret = std::make_shared<FD_Box>(0, 0, 0, 0,
z + 1, camera_bound, type_temp.font_colour);
this->caret_rect = new SDL_Rect();
this->caret_rect->x = x;
this->caret_rect->y = y;
this->caret_rect->w = 2;
this->caret_rect->h = type_temp.font->getSize();
this->caret->supplyRect(this->caret_rect);
this->caret->setVisible(false);
// Set values
this->srcrect = new SDL_Rect();
FD_Object::updateBounds(this->srcrect, 0, 0, this->w->value(),
this->h->value(), FD_TOP_LEFT);
this->dstrect = new SDL_Rect();
FD_Object::updateBounds(this->dstrect, this->x->value(),
this->y->value(), this->w->value(), this->h->value(), draw_style);
// Create the pure image
this->pure_image = std::make_shared<FD_PureImage>(
scene->getWindow()->getRenderer(),
static_cast<Uint32>(this->getWidth()),
static_cast<Uint32>(this->getHeight()), pure_elements);
scene->getWindow()->addResizable(pure_image);
this->changeText("");
}
FD_TextBox::~FD_TextBox() {
this->clearPureElements();
delete caret_rect;
delete line_offset;
delete caret_timer;
}
void FD_TextBox::clearPureElements() {
for (auto p : pure_elements) {
if (p->dstrect != nullptr) delete p->dstrect;
if (p->srcrect != nullptr) delete p->srcrect;
delete p;
}
}
void FD_TextBox::wake() {
this->update();
}
void FD_TextBox::update() {
// Caret
if (editing && FD_Maths::hasIntersection(dstrect, caret_rect)) {
if (caret_timer->finished()) {
caret->setVisible(!caret->isVisible());
caret_timer->start(type_temp.caret_blink_delay);
}
} else {
caret->setVisible(false);
}
// Offset updating
if (line_offset->moved()) {
if (type_temp.horz_scroll) {
this->srcrect->x = static_cast<int>(-line_offset->value());
this->srcrect->y = 0;
caret_rect->x = caret_x + dstrect->x + static_cast<int>(line_offset->value());
caret_rect->y = caret_y + dstrect->y;
} else {
this->srcrect->x = 0;
this->srcrect->y = static_cast<int>(-line_offset->value());
caret_rect->x = caret_x + dstrect->x;
caret_rect->y = caret_y + dstrect->y + static_cast<int>(line_offset->value());
}
this->updateBoxes();
}
// Bounds updating
if (x->moved() || y->moved() || w->moved() || h->moved()) {
FD_Object::updateBounds(dstrect);
}
}
void FD_TextBox::changeText(const std::string text) {
FD_TextInfo info{ FD_TextInfo{ text } };
this->changeText(info);
}
void FD_TextBox::changeText(const FD_TextInfo info) {
text_info = info;
caret->setVisible(true);
caret_timer->start(type_temp.caret_blink_delay);
if (type_temp.horz_scroll) {
this->updateHorizontalImage();
} else {
this->updateVerticalImage();
}
}
void FD_TextBox::prepareRender() {
// Prepare the images
std::shared_ptr<FD_Scene> s;
FD_Handling::lock(scene, s);
while (text_images.size() < lines.size()) {
text_images.push_back(std::make_shared<FD_TextImage>(
s->getWindow()->getRenderer(),
type_temp.font, "", "", "", type_temp.font_colour
));
}
// Prepare the selection boxes
for (auto b : boxes) b->setVisible(false);
while (boxes.size() < lines.size()) {
boxes.push_back(std::make_shared<FD_Box>(0, 0, 0, 0,
this->getLayer(), this->isCameraBound(), type_temp.selection_colour));
boxes.back()->setUnderlayColour(type_temp.selection_colour);
boxes.back()->setVisible(false);
if (auto g{ object_group.lock() }) {
boxes.back()->assimilate(g);
} else {
FD_Handling::error("Could not add selection box to FD_ObjectGroup in FD_TextBox.");
}
}
}
void FD_TextBox::updateHorizontalImage() {
// Text variables
size_t index{ 0 };
bool selecting{ false };
std::string text_stack{ };
std::string text{ text_info.text };
lines.clear();
// Positioning variables
caret_x = caret_y = 0;
int w{ 0 }, h{ 0 };
Uint32 x_buffer{ 0 };
if (index == text_info.selection_start) selecting = true;
if (index == text_info.selection_end) selecting = false;
// Iterating over the text until we finish a line
while (text.size() > 0) {
// Get the dimensions of the current stack plus the next character
type_temp.font->getRenderedDimensions(text_stack + text.front(), w, h);
// Add to the stack
text_stack.push_back(text.front());
text.erase(text.begin());
// Increment our index to the next char
index++;
if (index == text_info.selection_start) {
// If the selection is starting on the next char,
// finish this section
lines.push_back(LineSection{ text_stack, x_buffer, 0, w, h, selecting, index });
x_buffer += w;
text_stack.clear();
selecting = true;
}
if (index == text_info.selection_end) {
// If the selection ends on the next char, finish the section
// if we have selected a non-zero amount of chars
if (text_stack.size() > 0) {
lines.push_back(LineSection{ text_stack, x_buffer, 0, w, h, selecting, index });
x_buffer += w;
text_stack.clear();
}
selecting = false;
}
}
// If there are characters left on the stack, add the final line
if (text_stack.size() > 0) {
type_temp.font->getRenderedDimensions(text_stack, w, h);
lines.push_back(LineSection{ text_stack, x_buffer, 0, w, h, selecting, text_info.text.size() });
}
// Clear the image
this->clearPureElements();
pure_elements.clear();
pure_image->clear();
this->prepareRender();
// Create the elements
size_t next_image{ 0 };
Uint32 pure_w{ 0 };
std::shared_ptr<FD_Box> box;
std::shared_ptr<FD_TextImage> image;
std::shared_ptr<FD_Scene> s;
FD_Handling::lock(scene, s);
for (auto l : lines) {
// Get the image
image = text_images.at(next_image);
box = boxes.at(next_image);
// Colour the image
if (l.sel) {
image->setTextColour(type_temp.selection_text_colour);
box->setVisible(true);
} else {
image->setTextColour(type_temp.font_colour);
box->setVisible(false);
}
// Set the text
image->changeText(s->getWindow()->getRenderer(), l.text);
// Add the element
FD_PureElement* pd{ new FD_PureElement() };
pd->image = image;
pd->dstrect = new SDL_Rect();
pd->dstrect->x = l.x;
pd->dstrect->y = l.y;
pd->dstrect->w = image->getWidth();
pd->dstrect->h = image->getHeight();
if (pd->dstrect->x + pd->dstrect->w > static_cast<int>(pure_w)) {
pure_w = pd->dstrect->x + pd->dstrect->w;
}
pure_elements.push_back(pd);
next_image++;
}
// Add the elements
for (auto p : pure_elements) pure_image->add(p);
// Redraw the pure image
if (pure_w < pure_image->getWidth()) pure_w = pure_image->getWidth();
pure_image->redraw(pure_w, type_temp.box_height);
// Set the dstrect height
if (pure_w < type_temp.box_width) {
this->dstrect->w = pure_w;
} else {
this->dstrect->w = type_temp.box_width;
}
// Update the caret
this->updateCaret();
// Update the boxes
this->updateBoxes();
}
void FD_TextBox::updateVerticalImage() {
// Text variables
size_t index{ 0 };
bool selecting{ false };
std::string text_stack{ };
std::string text{ text_info.text };
lines.clear();
// Positioning variables
caret_x = caret_y = 0;
int w{ 0 }, h{ 0 };
Uint32 x_buffer{ 0 }, y_buffer{ 0 };
if (index == text_info.selection_start) selecting = true;
if (index == text_info.selection_end) selecting = false;
// Iterating over the text until we finish a line
while (text.size() > 0) {
// Get the dimensions of the current stack plus the next character
type_temp.font->getRenderedDimensions(text_stack + text.front(), w, h);
if (x_buffer + w > type_temp.box_width) {
// If we overflow our line, add a new line and reposition
lines.push_back(LineSection{ text_stack, x_buffer, y_buffer, w, h, selecting, index });
x_buffer = 0;
y_buffer += h + type_temp.line_spacing;
text_stack.clear();
} else {
// If we don't overflow the line, add to the stack
text_stack.push_back(text.front());
text.erase(text.begin());
// Increment our index to the next char
index++;
if (index == text_info.selection_start) {
// If the selection is starting on the next char,
// finish this section
lines.push_back(LineSection{ text_stack, x_buffer, y_buffer, w, h, selecting, index });
x_buffer += w;
text_stack.clear();
selecting = true;
}
if (index == text_info.selection_end) {
// If the selection ends on the next char, finish the section
// if we have selected a non-zero amount of chars
if (text_stack.size() > 0) {
lines.push_back(LineSection{ text_stack, x_buffer, y_buffer, w, h, selecting, index });
x_buffer += w;
text_stack.clear();
}
selecting = false;
}
}
}
// If there are characters left on the stack, add the final line
if (text_stack.size() > 0) {
type_temp.font->getRenderedDimensions(text_stack, w, h);
lines.push_back(LineSection{ text_stack, x_buffer, y_buffer, w, h, selecting, text_info.text.size() });
}
// Clear the image
this->clearPureElements();
pure_elements.clear();
pure_image->clear();
this->prepareRender();
// Create the elements
size_t next_image{ 0 };
Uint32 pure_h{ 0 };
std::shared_ptr<FD_Box> box;
std::shared_ptr<FD_TextImage> image;
std::shared_ptr<FD_Scene> s;
FD_Handling::lock(scene, s);
for (auto l : lines) {
// Get the image
image = text_images.at(next_image);
box = boxes.at(next_image);
// Colour the image
if (l.sel) {
image->setTextColour(type_temp.selection_text_colour);
} else {
image->setTextColour(type_temp.font_colour);
}
// Set the text
image->changeText(s->getWindow()->getRenderer(), l.text);
// Add the element
FD_PureElement* pd{ new FD_PureElement() };
pd->image = image;
pd->dstrect = new SDL_Rect();
pd->dstrect->x = l.x;
pd->dstrect->y = l.y;
pd->dstrect->w = image->getWidth();
pd->dstrect->h = image->getHeight();
if (pd->dstrect->y + pd->dstrect->h > static_cast<int>(pure_h)) {
pure_h = pd->dstrect->y + pd->dstrect->h;
}
pure_elements.push_back(pd);
next_image++;
}
// Add the elements
for (auto p : pure_elements) pure_image->add(p);
// Redraw the pure image
if (pure_h < pure_image->getHeight()) pure_h = pure_image->getHeight();
pure_image->redraw(type_temp.box_width, pure_h);
// Set the dstrect height
if (pure_h < type_temp.box_height) {
this->dstrect->h = pure_h;
} else {
this->dstrect->h = type_temp.box_height;
}
// Update the caret
this->updateCaret();
// Update the boxes
this->updateBoxes();
}
void FD_TextBox::updateBoxes() {
size_t index{ 0 };
SDL_Rect tr{};
LineSection l;
std::shared_ptr<FD_Box> b;
while (index < lines.size()) {
l = lines.at(index);
b = boxes.at(index);
if (!l.sel) {
b->setVisible(false);
index++;
continue;
}
tr.w = l.w;
tr.h = l.h;
if (type_temp.horz_scroll) {
tr.x = l.x + dstrect->x + static_cast<int>(line_offset->value());
tr.y = l.y + dstrect->y;
} else {
tr.x = l.x + dstrect->x;
tr.y = l.y + dstrect->y + static_cast<int>(line_offset->value());
}
if (!FD_Maths::hasIntersection(&tr, dstrect)) {
b->setVisible(false);
index++;
continue;
}
if (tr.x < dstrect->x) {
tr.w -= dstrect->x - tr.x;
tr.x = dstrect->x;
}
if (tr.x + tr.w > dstrect->x + dstrect->w) {
tr.w = dstrect->x + dstrect->w - tr.x;
}
if (tr.y < dstrect->y) {
tr.h -= dstrect->y - tr.y;
tr.y = dstrect->y;
}
if (tr.y + tr.h > dstrect->y + dstrect->h) {
tr.h = dstrect->y + dstrect->h - tr.y;
}
b->setVisible(true);
b->updateRect(tr.x, tr.y, tr.w, tr.h);
index++;
}
}
void FD_TextBox::updateCaret() {
this->updateCaret(text_info.caret_pos);
}
void FD_TextBox::updateCaret(size_t pos) {
caret->setVisible(true);
caret_timer->start(type_temp.caret_blink_delay);
// Set the new position
text_info.caret_pos = pos;
// Manage scroll
bool found{ false };
size_t lower_bound{ 0 };
LineSection capture{ "", 0, 0, 0, 0, false, 1 };
for (auto l : lines) {
if (l.index_bound >= text_info.caret_pos) {
found = true;
capture = l;
break;
}
lower_bound = l.index_bound;
}
int w, h;
if (found) {
std::string pre{ capture.text.substr(0, text_info.caret_pos - lower_bound) };
type_temp.font->getRenderedDimensions(pre, w, h);
} else {
w = h = 0;
}
caret_x = capture.x + w;
caret_y = capture.y;
if (type_temp.horz_scroll) {
if (caret_x + line_offset->destination() < 0) {
line_offset->move(FD_TWEEN_EASE_OUT, -caret_x, 200);
} else if (caret_x + line_offset->destination() > type_temp.box_width) {
line_offset->move(FD_TWEEN_EASE_OUT,
static_cast<double>(type_temp.box_width) - caret_x, 200);
}
} else {
if (caret_y + line_offset->destination() < 0) {
line_offset->move(FD_TWEEN_EASE_OUT, -caret_y, 200);
} else if (caret_y + line_offset->destination() + h > type_temp.box_height) {
line_offset->move(FD_TWEEN_EASE_OUT,
static_cast<double>(type_temp.box_height) - caret_y - h, 200);
}
Uint32 final_y{ 0 };
if (lines.size() > 0) final_y = lines.back().y + lines.back().h;
if (-line_offset->destination() + srcrect->h > final_y) {
double push_up{ static_cast<double>(srcrect->h - final_y) };
if (push_up > 0) push_up = 0;
line_offset->move(FD_TWEEN_EASE_OUT, push_up, 200);
}
}
// Position the caret
if (type_temp.horz_scroll) {
caret_rect->x = caret_x + dstrect->x + static_cast<int>(line_offset->value());
caret_rect->y = caret_y + dstrect->y;
} else {
caret_rect->x = caret_x + dstrect->x;
caret_rect->y = caret_y + dstrect->y + static_cast<int>(line_offset->value());
}
this->update();
}
void FD_TextBox::setEditing(bool edit) {
this->editing = edit;
if (!edit) for (auto b : boxes) b->setVisible(false);
}
std::shared_ptr<FD_Image> FD_TextBox::getImage() const {
return pure_image;
}
bool FD_TextBox::isEditing() const {
return editing;
}
FD_TextInfo FD_TextBox::getTextInfo() const {
return text_info;
}
FD_Tween* FD_TextBox::getTweenX() {
return x;
}
FD_Tween* FD_TextBox::getTweenY() {
return y;
}
void FD_TextBox::assimilate(std::shared_ptr<FD_ObjectGroup> group) {
this->object_group = group;
group->addObject(shared_from_this());
caret->assimilate(group);
}
|
/* ************************************************************************
* Copyright 2016-2020 Advanced Micro Devices, Inc.
* ************************************************************************ */
#include "rocblas_syrk.hpp"
#include "logging.hpp"
#include "utility.hpp"
namespace
{
template <typename>
constexpr char rocblas_syrk_name[] = "unknown";
template <>
constexpr char rocblas_syrk_name<float>[] = "rocblas_ssyrk";
template <>
constexpr char rocblas_syrk_name<double>[] = "rocblas_dsyrk";
template <>
constexpr char rocblas_syrk_name<rocblas_float_complex>[] = "rocblas_csyrk";
template <>
constexpr char rocblas_syrk_name<rocblas_double_complex>[] = "rocblas_zsyrk";
template <typename T, typename U>
rocblas_status rocblas_syrk_impl(rocblas_handle handle,
rocblas_fill uplo,
rocblas_operation transA,
rocblas_int n,
rocblas_int k,
const U* alpha,
const T* A,
rocblas_int lda,
const U* beta,
T* C,
rocblas_int ldc)
{
if(!handle)
return rocblas_status_invalid_handle;
RETURN_ZERO_DEVICE_MEMORY_SIZE_IF_QUERIED(handle);
auto layer_mode = handle->layer_mode;
if(layer_mode
& (rocblas_layer_mode_log_trace | rocblas_layer_mode_log_bench
| rocblas_layer_mode_log_profile))
{
auto uplo_letter = rocblas_fill_letter(uplo);
auto transA_letter = rocblas_transpose_letter(transA);
if(handle->pointer_mode == rocblas_pointer_mode_host)
{
if(layer_mode & rocblas_layer_mode_log_trace)
log_trace(handle,
rocblas_syrk_name<T>,
uplo,
transA,
n,
k,
log_trace_scalar_value(alpha),
A,
lda,
log_trace_scalar_value(beta),
C,
ldc);
if(layer_mode & rocblas_layer_mode_log_bench)
log_bench(handle,
"./rocblas-bench -f syrk -r",
rocblas_precision_string<T>,
"--uplo",
uplo_letter,
"--transposeA",
transA_letter,
"-n",
n,
"-k",
k,
LOG_BENCH_SCALAR_VALUE(alpha),
"--lda",
lda,
LOG_BENCH_SCALAR_VALUE(beta),
"--ldc",
ldc);
}
else
{
if(layer_mode & rocblas_layer_mode_log_trace)
log_trace(handle,
rocblas_syrk_name<T>,
uplo,
transA,
n,
k,
log_trace_scalar_value(alpha),
A,
lda,
log_trace_scalar_value(beta),
C,
ldc);
}
if(layer_mode & rocblas_layer_mode_log_profile)
log_profile(handle,
rocblas_syrk_name<T>,
"uplo",
uplo_letter,
"transA",
transA_letter,
"N",
n,
"K",
k,
"lda",
lda,
"ldc",
ldc);
}
static constexpr rocblas_int offset_C = 0, offset_A = 0, batch_count = 1;
static constexpr rocblas_stride stride_C = 0, stride_A = 0;
rocblas_status arg_status = rocblas_syrk_arg_check(handle,
uplo,
transA,
n,
k,
alpha,
A,
offset_A,
lda,
stride_A,
beta,
C,
offset_C,
ldc,
stride_C,
batch_count);
if(arg_status != rocblas_status_continue)
return arg_status;
return rocblas_syrk_template(handle,
uplo,
transA,
n,
k,
alpha,
A,
offset_A,
lda,
stride_A,
beta,
C,
offset_C,
ldc,
stride_C,
batch_count);
}
}
/*
* ===========================================================================
* C wrapper
* ===========================================================================
*/
extern "C" {
#ifdef IMPL
#error IMPL ALREADY DEFINED
#endif
#define IMPL(routine_name_, T_) \
rocblas_status routine_name_(rocblas_handle handle, \
rocblas_fill uplo, \
rocblas_operation transA, \
rocblas_int n, \
rocblas_int k, \
const T_* alpha, \
const T_* A, \
rocblas_int lda, \
const T_* beta, \
T_* C, \
rocblas_int ldc) \
try \
{ \
return rocblas_syrk_impl(handle, uplo, transA, n, k, alpha, A, lda, beta, C, ldc); \
} \
catch(...) \
{ \
return exception_to_rocblas_status(); \
}
IMPL(rocblas_ssyrk, float);
IMPL(rocblas_dsyrk, double);
IMPL(rocblas_csyrk, rocblas_float_complex);
IMPL(rocblas_zsyrk, rocblas_double_complex);
#undef IMPL
} // extern "C"
|
// Copyright (c) 2015 Grant Mercer
//
// SPDX-License-Identifier: BSL-1.0
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <hpx/local/init.hpp>
#include <hpx/modules/testing.hpp>
#include <hpx/parallel/container_algorithms/make_heap.hpp>
#include <algorithm>
#include <cstddef>
#include <iostream>
#include <iterator>
#include <numeric>
#include <random>
#include <string>
#include <vector>
#include "test_utils.hpp"
///////////////////////////////////////////////////////////////////////////
int seed = std::random_device{}();
std::mt19937 gen(seed);
///////////////////////////////////////////////////////////////////////////
template <typename IteratorTag>
void test_make_heap1(IteratorTag)
{
typedef std::vector<std::size_t>::iterator base_iterator;
typedef test::test_iterator<base_iterator, IteratorTag> iterator;
std::vector<std::size_t> c(10007);
std::iota(hpx::util::begin(c), hpx::util::end(c), 0);
hpx::ranges::make_heap(
iterator(hpx::util::begin(c)), iterator(hpx::util::end(c)));
HPX_TEST_EQ(std::is_heap(hpx::util::begin(c), hpx::util::end(c)), true);
}
template <typename ExPolicy, typename IteratorTag>
void test_make_heap1(ExPolicy&& policy, IteratorTag)
{
static_assert(hpx::is_execution_policy<ExPolicy>::value,
"hpx::is_execution_policy<ExPolicy>::value");
typedef std::vector<std::size_t>::iterator base_iterator;
typedef test::test_iterator<base_iterator, IteratorTag> iterator;
std::vector<std::size_t> c(10007);
std::iota(hpx::util::begin(c), hpx::util::end(c), 0);
hpx::ranges::make_heap(
policy, iterator(hpx::util::begin(c)), iterator(hpx::util::end(c)));
HPX_TEST_EQ(std::is_heap(hpx::util::begin(c), hpx::util::end(c)), true);
}
template <typename ExPolicy, typename IteratorTag>
void test_make_heap_async1(ExPolicy&& p, IteratorTag)
{
typedef std::vector<std::size_t>::iterator base_iterator;
typedef test::test_iterator<base_iterator, IteratorTag> iterator;
std::vector<std::size_t> c(10007);
std::iota(hpx::util::begin(c), hpx::util::end(c), 0);
auto test = hpx::ranges::make_heap(
p, iterator(hpx::util::begin(c)), iterator(hpx::util::end(c)));
test.get();
HPX_TEST_EQ(std::is_heap(hpx::util::begin(c), hpx::util::end(c)), true);
}
template <typename IteratorTag>
void test_make_heap1()
{
using namespace hpx::execution;
test_make_heap1(IteratorTag());
test_make_heap1(seq, IteratorTag());
test_make_heap1(par, IteratorTag());
test_make_heap1(par_unseq, IteratorTag());
test_make_heap_async1(seq(task), IteratorTag());
test_make_heap_async1(par(task), IteratorTag());
}
void make_heap_test1()
{
test_make_heap1<std::random_access_iterator_tag>();
}
///////////////////////////////////////////////////////////////////////////
template <typename IteratorTag>
void test_make_heap2(IteratorTag)
{
typedef std::vector<std::size_t>::iterator base_iterator;
typedef test::test_iterator<base_iterator, IteratorTag> iterator;
std::vector<std::size_t> c(25);
std::iota(hpx::util::begin(c), hpx::util::end(c), 0);
hpx::ranges::make_heap(iterator(hpx::util::begin(c)),
iterator(hpx::util::end(c)), std::greater<std::size_t>());
HPX_TEST_EQ(std::is_heap(hpx::util::begin(c), hpx::util::end(c),
std::greater<std::size_t>()),
true);
}
template <typename ExPolicy, typename IteratorTag>
void test_make_heap2(ExPolicy&& policy, IteratorTag)
{
static_assert(hpx::is_execution_policy<ExPolicy>::value,
"hpx::is_execution_policy<ExPolicy>::value");
typedef std::vector<std::size_t>::iterator base_iterator;
typedef test::test_iterator<base_iterator, IteratorTag> iterator;
std::vector<std::size_t> c(25);
std::iota(hpx::util::begin(c), hpx::util::end(c), 0);
hpx::ranges::make_heap(policy, iterator(hpx::util::begin(c)),
iterator(hpx::util::end(c)), std::greater<std::size_t>());
HPX_TEST_EQ(std::is_heap(hpx::util::begin(c), hpx::util::end(c),
std::greater<std::size_t>()),
true);
}
template <typename ExPolicy, typename IteratorTag>
void test_make_heap_async2(ExPolicy&& p, IteratorTag)
{
typedef std::vector<std::size_t>::iterator base_iterator;
typedef test::test_iterator<base_iterator, IteratorTag> iterator;
std::vector<std::size_t> c(10007);
std::iota(hpx::util::begin(c), hpx::util::end(c), 0);
hpx::future<void> test =
hpx::ranges::make_heap(p, iterator(hpx::util::begin(c)),
iterator(hpx::util::end(c)), std::greater<std::size_t>());
test.wait();
HPX_TEST_EQ(std::is_heap(hpx::util::begin(c), hpx::util::end(c),
std::greater<std::size_t>()),
true);
}
template <typename IteratorTag>
void test_make_heap2()
{
using namespace hpx::execution;
test_make_heap2(IteratorTag());
test_make_heap2(seq, IteratorTag());
test_make_heap2(par, IteratorTag());
test_make_heap2(par_unseq, IteratorTag());
test_make_heap_async2(seq(task), IteratorTag());
test_make_heap_async2(par(task), IteratorTag());
}
void make_heap_test2()
{
test_make_heap2<std::random_access_iterator_tag>();
}
///////////////////////////////////////////////////////////////////////////////
template <typename IteratorTag>
void test_make_heap_exception(IteratorTag)
{
typedef std::vector<std::size_t>::iterator base_iterator;
typedef test::decorated_iterator<base_iterator, IteratorTag>
decorated_iterator;
std::vector<std::size_t> c(10007);
std::iota(hpx::util::begin(c), hpx::util::end(c), gen());
bool caught_exception = false;
try
{
hpx::ranges::make_heap(decorated_iterator(hpx::util::begin(c),
[]() { throw std::runtime_error("test"); }),
decorated_iterator(hpx::util::end(c)));
HPX_TEST(false);
}
catch (hpx::exception_list const& e)
{
caught_exception = true;
//test::test_num_exceptions<ExPolicy, IteratorTag>::call(policy, e);
}
catch (...)
{
HPX_TEST(false);
}
HPX_TEST(caught_exception);
}
template <typename ExPolicy, typename IteratorTag>
void test_make_heap_exception(ExPolicy&& policy, IteratorTag)
{
static_assert(hpx::is_execution_policy<ExPolicy>::value,
"hpx::is_execution_policy<ExPolicy>::value");
typedef std::vector<std::size_t>::iterator base_iterator;
typedef test::decorated_iterator<base_iterator, IteratorTag>
decorated_iterator;
std::vector<std::size_t> c(10007);
std::iota(hpx::util::begin(c), hpx::util::end(c), gen());
bool caught_exception = false;
try
{
hpx::ranges::make_heap(policy,
decorated_iterator(hpx::util::begin(c),
[]() { throw std::runtime_error("test"); }),
decorated_iterator(hpx::util::end(c)));
HPX_TEST(false);
}
catch (hpx::exception_list const& e)
{
caught_exception = true;
//test::test_num_exceptions<ExPolicy, IteratorTag>::call(policy, e);
}
catch (...)
{
HPX_TEST(false);
}
HPX_TEST(caught_exception);
}
template <typename ExPolicy, typename IteratorTag>
void test_make_heap_exception_async(ExPolicy&& p, IteratorTag)
{
typedef std::vector<std::size_t>::iterator base_iterator;
typedef test::decorated_iterator<base_iterator, IteratorTag>
decorated_iterator;
std::vector<std::size_t> c(10007);
std::iota(hpx::util::begin(c), hpx::util::end(c), gen());
bool caught_exception = false;
bool returned_from_algorithm = false;
try
{
hpx::future<void> f = hpx::ranges::make_heap(p,
decorated_iterator(hpx::util::begin(c),
[]() { throw std::runtime_error("test"); }),
decorated_iterator(hpx::util::end(c)));
returned_from_algorithm = true;
f.get();
HPX_TEST(false);
}
catch (hpx::exception_list const& e)
{
caught_exception = true;
//test::test_num_exceptions<ExPolicy, IteratorTag>::call(policy, e);
}
catch (...)
{
HPX_TEST(false);
}
HPX_TEST(caught_exception);
HPX_TEST(returned_from_algorithm);
}
template <typename IteratorTag>
void test_make_heap_exception()
{
using namespace hpx::execution;
test_make_heap_exception(IteratorTag());
// If the execution policy object is of type vector_execution_policy,
// std::terminate shall be called. therefore we do not test exceptions
// with a vector execution policy
test_make_heap_exception(seq, IteratorTag());
test_make_heap_exception(par, IteratorTag());
test_make_heap_exception_async(seq(task), IteratorTag());
test_make_heap_exception_async(par(task), IteratorTag());
}
void make_heap_exception_test()
{
test_make_heap_exception<std::random_access_iterator_tag>();
}
//////////////////////////////////////////////////////////////////////////////
template <typename IteratorTag>
void test_make_heap_bad_alloc(IteratorTag)
{
typedef std::vector<std::size_t>::iterator base_iterator;
typedef test::decorated_iterator<base_iterator, IteratorTag>
decorated_iterator;
std::vector<std::size_t> c(100007);
std::iota(hpx::util::begin(c), hpx::util::end(c), gen());
bool caught_bad_alloc = false;
try
{
hpx::ranges::make_heap(decorated_iterator(hpx::util::begin(c),
[]() { throw std::bad_alloc(); }),
decorated_iterator(hpx::util::end(c)));
HPX_TEST(false);
}
catch (std::bad_alloc const&)
{
caught_bad_alloc = true;
}
catch (...)
{
HPX_TEST(false);
}
HPX_TEST(caught_bad_alloc);
}
template <typename ExPolicy, typename IteratorTag>
void test_make_heap_bad_alloc(ExPolicy&& policy, IteratorTag)
{
static_assert(hpx::is_execution_policy<ExPolicy>::value,
"hpx::is_execution_policy<ExPolicy>::value");
typedef std::vector<std::size_t>::iterator base_iterator;
typedef test::decorated_iterator<base_iterator, IteratorTag>
decorated_iterator;
std::vector<std::size_t> c(100007);
std::iota(hpx::util::begin(c), hpx::util::end(c), gen());
bool caught_bad_alloc = false;
try
{
hpx::ranges::make_heap(policy,
decorated_iterator(
hpx::util::begin(c), []() { throw std::bad_alloc(); }),
decorated_iterator(hpx::util::end(c)));
HPX_TEST(false);
}
catch (std::bad_alloc const&)
{
caught_bad_alloc = true;
}
catch (...)
{
HPX_TEST(false);
}
HPX_TEST(caught_bad_alloc);
}
template <typename ExPolicy, typename IteratorTag>
void test_make_heap_bad_alloc_async(ExPolicy&& p, IteratorTag)
{
typedef std::vector<std::size_t>::iterator base_iterator;
typedef test::decorated_iterator<base_iterator, IteratorTag>
decorated_iterator;
std::vector<std::size_t> c(10007);
std::iota(hpx::util::begin(c), hpx::util::end(c), gen());
bool caught_bad_alloc = false;
bool returned_from_algorithm = false;
try
{
hpx::future<void> f = hpx::ranges::make_heap(p,
decorated_iterator(
hpx::util::begin(c), []() { throw std::bad_alloc(); }),
decorated_iterator(hpx::util::end(c)));
returned_from_algorithm = true;
f.get();
HPX_TEST(false);
}
catch (std::bad_alloc const&)
{
caught_bad_alloc = true;
}
catch (...)
{
HPX_TEST(false);
}
HPX_TEST(caught_bad_alloc);
HPX_TEST(returned_from_algorithm);
}
template <typename IteratorTag>
void test_make_heap_bad_alloc()
{
using namespace hpx::execution;
test_make_heap_bad_alloc(IteratorTag());
// If the execution policy object is of type vector_execution_policy,
// std::terminate shall be called. therefore we do not test exceptions
// with a vector execution policy
test_make_heap_bad_alloc(seq, IteratorTag());
test_make_heap_bad_alloc(par, IteratorTag());
test_make_heap_bad_alloc_async(seq(task), IteratorTag());
test_make_heap_bad_alloc_async(par(task), IteratorTag());
}
void make_heap_bad_alloc_test()
{
test_make_heap_bad_alloc<std::random_access_iterator_tag>();
}
int hpx_main(hpx::program_options::variables_map& vm)
{
if (vm.count("seed"))
seed = vm["seed"].as<unsigned int>();
std::cout << "using seed: " << seed << std::endl;
gen.seed(seed);
make_heap_test1();
make_heap_test2();
make_heap_exception_test();
make_heap_bad_alloc_test();
return hpx::local::finalize();
}
int main(int argc, char* argv[])
{
using namespace hpx::program_options;
options_description desc_commandline(
"Usage: " HPX_APPLICATION_STRING " [options]");
desc_commandline.add_options()("seed,s", value<unsigned int>(),
"the random number generator seed to use for this run");
hpx::local::init_params init_args;
init_args.desc_cmdline = desc_commandline;
HPX_TEST_EQ_MSG(hpx::local::init(hpx_main, argc, argv, init_args), 0,
"HPX main exited with a non-zero status");
return hpx::util::report_errors();
}
|
l2_circle_dblx DB 0
l2_circle_dbly DB 0
; ">l2_draw_circle_fill BC = center row col, d = radius, e = colour"
; Note this code currently does not process BC
l2_draw_circle_fill: ld a,e
ld (.LineColour+1),a
ld a,d ; get radius
and a
ret z
cp 1
jp z,CircleSinglepixel
ld (.Line1+1),bc ; save origin into DE reg in code
ld ixh,a ; ixh = raidus (x)
ld ixl,0 ; ihy = y
.calcd: ld h,0
ld l,a
add hl,hl ; hl = r * 2
ex de,hl ; de = r * 2
ld hl,3
and a
sbc hl,de ; hl = 3 - (r * 2)
ld b,h
ld c,l ; bc = 3 - (r * 2)
.calcdelta ld hl,1
ld d,0
ld e,ixl
and a
sbc hl,de
.Setde1 ld de,1
.CircleLoop: ld a,ixh
cp ixl
ret c
.ProcessLoop: exx
.Line1: ld de,0
ld a,e
sub ixl
ld c,a
ld a,d
add a,ixh
ld b,a
;; TODO ADD DOUBLE X CALC
push de
ld d,ixl
sla d
call .PlotLine ;CX-X,CY+Y
pop de
.Line2: ld a,e
sub ixl
ld c,a
ld a,d
sub ixh
ld b,a
;; TODO ADD DOUBLE X CALC
push de
ld d,ixl
sla d
call .PlotLine ;CX-X,CY-Y
pop de
.Line3: ld a,e
sub ixh
ld c,a
ld a,d
add a,ixl
ld b,a
;; TODO ADD DOUBLE Y CALC
push de
ld d,ixh
sla d
call .PlotLine ;CX-Y,CY+x
pop de
.Line4: ld a,e
sub ixh
ld c,a
ld a,d
sub ixl
ld b,a
;; TODO ADD DOUBLE Y CALC
push de
ld d,ixh
sla d
call .PlotLine ;CX-Y,CY+x
pop de
exx
.IncrementCircle: bit 7,h ; Check for Hl<=0
jr z,.draw_circle_1
add hl,de ; Delta=Delta+D1
jr .draw_circle_2 ;
.draw_circle_1: add hl,bc ; Delta=Delta+D2
inc bc
inc bc ; D2=D2+2
dec ixh ; Y=Y-1
.draw_circle_2: inc bc ; D2=D2+2
inc bc
inc de ; D1=D1+2
inc de
inc ixl ; X=X+1
jp .CircleLoop
.PlotLine: push de,,bc,,hl,,af
.LineColour: ld a,0 ; circle colur
ld e,a
call l2_draw_horz_line
pop de,,bc,,hl,,af
ret
|
; A093302: a(n) = (a(n-1)+(2n-1))*(2n) with a(0) = 0.
; 0,2,20,150,1256,12650,151932,2127230,34035920,612646866,12252937700,269564629862,6469551117240,168208329048890,4709833213369676,141294996401091150,4521439884834917792,153728956084387206050,5534242419037939419060,210301211923441697925686,8412048476937667917029000,353306036031382052515219722,15545465585380810310669669660,715091416927517274290804806430,34324388012520829165958630710896,1716219400626041458297931535547250,89243408832554155831492439848459652
add $0,1
mov $2,1
lpb $0
sub $0,1
mul $2,2
add $1,$2
sub $1,2
mul $2,$0
lpe
mov $0,$1
|
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define all(a) begin(a), end(a)
#define has(a, b) (a.find(b) != a.end())
#define fora(i, n) for(int i = 0; i < n; i++)
#define forb(i, n) for(int i = 1; i <= n; i++)
#define forc(a, b) for(const auto &a : b)
#define ford(i, n) for(int i = n; i >= 0; i--)
#define maxval(t) numeric_limits<t>::max()
#define minval(t) numeric_limits<t>::min()
#define imin(a, b) a = min(a, b)
#define imax(a, b) a = max(a, b)
#define sz(x) (int)(x).size()
#define pvec(v) copy(all(v), ostream_iterator<decltype(v)::value_type>(cout, " "))
#define dbgs(x) #x << " = " << x
#define dbgs2(x, y) dbgs(x) << ", " << dbgs(y)
#define dbgs3(x, y, z) dbgs2(x, y) << ", " << dbgs(z)
#define dbgs4(w, x, y, z) dbgs3(w, x, y) << ", " << dbgs(z)
using ll = long long;
using ld = long double;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
vector<pair<ll, ll>> ps(n);
fora(i, n) cin >> ps[i].first >> ps[i].second;
char dir;
ll q;
set<pair<ll, ll>> curdots(all(ps));
while (cin >> dir >> q) {
set<pair<ll, ll>> newdots;
forc(d, curdots) {
ll newx = d.first, newy = d.second;
if (dir == 'x') {
if (newx >= q) {
newx = 2 * q - newx;
}
} else{
if (newy >= q) {
newy = 2 * q - newy;
}
}
newdots.emplace(newx, newy);
}
curdots = newdots;
}
ll xmin = maxval(int), xmax = minval(int), ymin = maxval(int), ymax = minval(int);
forc(d, curdots) {
imin(xmin, d.first);
imax(xmax, d.first);
imin(ymin, d.second);
imax(ymax, d.second);
}
cout << dbgs4(xmin, xmax, ymin, ymax) << endl;
vector<vector<char>> a(10, vector<char>(40, '.'));
forc(d, curdots) a[d.second][d.first] = '#';
fora(i, 10) {
forc(c, a[i]) cout << c;
cout << endl;
}
}
|
// APriKey.cpp -- CAbstractPrivateKey implementation
// (c) Copyright Schlumberger Technology Corp., unpublished work, created
// 1999. This computer program includes Confidential, Proprietary
// Information and is a Trade Secret of Schlumberger Technology Corp. All
// use, disclosure, and/or reproduction is prohibited unless authorized
// in writing. All Rights Reserved.
#include <algorithm>
#include "cciPriKey.h"
#include "cciCont.h"
#include "AKeyPair.h"
#include "TransactionWrap.h"
#include "AContHelp.h"
using namespace std;
using namespace cci;
/////////////////////////// LOCAL/HELPER /////////////////////////////////
/////////////////////////// PUBLIC /////////////////////////////////
// Types
// C'tors/D'tors
CAbstractPrivateKey::~CAbstractPrivateKey()
{}
// Operators
bool
CAbstractPrivateKey::operator==(CAbstractPrivateKey const &rhs) const
{
CTransactionWrap wrap(m_hcard);
CTransactionWrap rhswrap(rhs.m_hcard);
return CProtectableCrypt::operator==(rhs) &&
DoEquals(rhs);
}
bool
CAbstractPrivateKey::operator!=(CAbstractPrivateKey const &rhs) const
{
return !(*this == rhs);
}
// Operations
void
CAbstractPrivateKey::Delete()
{
CTransactionWrap wrap(m_hcard);
// Remove any references to this object from the container
vector<CContainer> vCont(m_hcard->EnumContainers());
for_each(vCont.begin(), vCont.end(),
EraseFromContainer<CPrivateKey, CAbstractKeyPair>(CPrivateKey(this),
CAbstractKeyPair::PrivateKey,
CAbstractKeyPair::PrivateKey));
DoDelete();
}
void
CAbstractPrivateKey::Value(CPrivateKeyBlob const &rblob)
{
CTransactionWrap wrap(m_hcard);
DoWriteKey(rblob);
}
// Access
// Predicates
// Static Variables
/////////////////////////// PROTECTED /////////////////////////////////
// C'tors/D'tors
CAbstractPrivateKey::CAbstractPrivateKey(CAbstractCard const &racard,
ObjectAccess oa)
: slbRefCnt::RCObject(),
CProtectableCrypt(racard, oa)
{}
// Operators
// Operations
// Access
// Predicates
// Static Variables
/////////////////////////// PRIVATE /////////////////////////////////
// C'tors/D'tors
// Operators
// Operations
// Access
// Predicates
// Static Variables
|
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r13
push %r9
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x1cd5c, %rsi
lea addresses_WT_ht+0x1ad5c, %rdi
nop
nop
sub %r9, %r9
mov $58, %rcx
rep movsl
nop
nop
nop
nop
nop
and $5692, %r13
lea addresses_A_ht+0x1515c, %rsi
lea addresses_WC_ht+0xe95c, %rdi
clflush (%rdi)
nop
nop
nop
nop
and $32135, %r10
mov $17, %rcx
rep movsl
nop
nop
nop
nop
nop
dec %r10
lea addresses_WT_ht+0x160dc, %r10
nop
xor $10252, %rax
mov (%r10), %r9
add $55999, %rsi
lea addresses_normal_ht+0x32a4, %r10
nop
nop
nop
nop
nop
inc %rcx
movb $0x61, (%r10)
nop
nop
nop
add $24100, %r9
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r13
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r15
push %rax
push %rbx
push %rcx
push %rsi
// Load
lea addresses_WT+0x185fc, %rbx
nop
nop
nop
nop
sub %r12, %r12
mov (%rbx), %eax
nop
nop
nop
nop
nop
inc %rbx
// Load
lea addresses_WT+0x255c, %r15
nop
sub %r10, %r10
mov (%r15), %rax
nop
xor $49306, %rax
// Store
lea addresses_WC+0x1855c, %rbx
nop
nop
sub $4301, %rcx
movw $0x5152, (%rbx)
nop
nop
nop
dec %r10
// Store
lea addresses_A+0x19cdc, %r12
nop
inc %rax
mov $0x5152535455565758, %rbx
movq %rbx, %xmm4
vmovups %ymm4, (%r12)
nop
and %r12, %r12
// Faulty Load
lea addresses_WT+0x255c, %r15
nop
nop
nop
sub %rax, %rax
mov (%r15), %ecx
lea oracles, %rsi
and $0xff, %rcx
shlq $12, %rcx
mov (%rsi,%rcx,1), %rcx
pop %rsi
pop %rcx
pop %rbx
pop %rax
pop %r15
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT', 'NT': True, 'AVXalign': False, 'size': 2, 'congruent': 0}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 4}}
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_WT', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 8}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 3}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_WT', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'same': False, 'congruent': 10, 'type': 'addresses_D_ht'}, 'dst': {'same': False, 'congruent': 11, 'type': 'addresses_WT_ht'}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 10, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 10, 'type': 'addresses_WC_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 7}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 3}}
{'39': 21829}
39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39
*/
|
INIT_PATCH $3f,$eefa,$f38a
;INIT_PATCH $3f,$eefa,$f02a
;;# $3f:eefa textd.draw_in_box
;;
;;### args:
;;+ [in] $37: in_menu_mode (1: menu, 0: floor)
;;+ [in, out] string* $3e: ptr to string
;;+ [in, out] u8 $1f: number of lines drawn (in 8x8 unit)
;;+ [out] u8 $90: destOffset
;;+ [out] bool carry: more_to_draw
;;
;;### callers:
;;+ `1F:EEE4:20 FA EE JSR textd.draw_in_box` @ $3f:eec0 field.draw_string_in_window
;;+ `1F:F0D8:20 FA EE JSR textd.draw_in_box` @ $3f:f02a textd.eval_replacement (recurse)
;;+ `1F:F33F:20 FA EE JSR textd.draw_in_box` @ ?
;;+ `1F:EF24:4C FA EE JMP textd.draw_in_box` @ $3f:eefa textd.draw_in_box(recurse)
;;+ `1F:F345:4C FA EE JMP textd.draw_in_box` @ ?
;;+ `1F:F387:4C FA EE JMP textd.draw_in_box` @ ?
textd.draw_in_box:
;; fixups.
;FIX_ADDR_ON_CALLER $3f,$eee4+1
;FIX_ADDR_ON_CALLER $3f,$f0d8+1
;FIX_ADDR_ON_CALLER $3f,$f33f+1
;FIX_ADDR_ON_CALLER $3f,$ef24+1
;FIX_ADDR_ON_CALLER $3f,$f345+1
;FIX_ADDR_ON_CALLER $3f,$f387+1
;; --- variables.
.output_index = $90
.text_id = $92
.text_bank = $93
.p_text_table = $94 ;;stores offset from $30000(18:8000) to the text
;; floor
.treasure_item_id = $bb
.inn_charge = $61 ;24 bits.
;; textd
.p_text_line = $1c
.lines_drawn = $1f
;; ---
.program_bank = $57
;; --- window related
.in_menu_mode = $37
.window_left = $38
.window_top = $39
.offset_x = $3a
.offset_y = $3b
.window_width = $3c
.window_height = $3d
.p_text = $3e
;;
.tile_buffer_upper = $0780
.tile_buffer_lower = $07a0
;;static reference
;; --- begin.
ldy #$00 ; EEFA A0 00
lda [.p_text],y ; EEFC B1 3E
beq field_x.clc_return ; EEFE F0 F1
inc <.p_text ; EF00 E6 3E
bne .test_charcode ; EF02 D0 02
inc <.p_text+1 ; EF04 E6 3F
.test_charcode:
cmp #$28 ; EF06 C9 28
bcc .not_printable_char ; EF08 90 34
cmp #$5C ; EF0A C9 5C
bcc .need_composition ; EF0C 90 19
ldy <.output_index ; EF0E A4 90
ldx <.in_menu_mode ; EF10 A6 37
bne .icons_supported ; EF12 D0 06
cmp #$70 ; EF14 C9 70
bcs .icons_supported ; EF16 B0 02
lda #$FF ; EF18 A9 FF
.icons_supported:
sta .tile_buffer_lower,y ; EF1A 99 A0 07
lda #$FF ; EF1D A9 FF
sta .tile_buffer_upper,y ; EF1F 99 80 07
inc <.output_index ; EF22 E6 90
jmp textd.draw_in_box ; EF24 4C FA EE
; ----------------------------------------------------------------------------
.need_composition:
sec ; EF27 38
sbc #$28 ; EF28 E9 28
tax ; EF2A AA
ldy <.output_index ; EF2B A4 90
lda textd.tile_map_upper,x ; EF2D BD 15 F5
sta .tile_buffer_upper,y ; EF30 99 80 07
lda textd.tile_map_lower,x ; EF33 BD E1 F4
sta .tile_buffer_lower,y ; EF36 99 A0 07
inc <.output_index ; EF39 E6 90
jmp textd.draw_in_box ; EF3B 4C FA EE
; ----------------------------------------------------------------------------
.not_printable_char:
cmp #$10 ; EF3E C9 10
bcc .control_char ; EF40 90 03
jmp textd.eval_replacement ; EF42 4C 2A F0
; ----------------------------------------------------------------------------
.control_char:
cmp #$01 ; EF45 C9 01
bne .case_2 ; EF47 D0 12
;;case_1: ;;eol.
jsr field.draw_window_content ; EF49 20 92 F6
inc <.lines_drawn ; EF4C E6 1F
.next_line:
inc <.lines_drawn ; EF4E E6 1F
lda <.lines_drawn ; EF50 A5 1F
cmp <.window_height ; EF52 C5 3D
bcc .continue_drawing ; EF54 90 02
sec ; EF56 38
rts ; EF57 60
; ----------------------------------------------------------------------------
.continue_drawing:
jmp textd.draw_in_box ; EF58 4C FA EE
; ----------------------------------------------------------------------------
.case_2: ;;item name of treasure which has just been gotten. $bb := item_id
cmp #$02 ; EF5B C9 02
bne .case_3 ; EF5D D0 0B
lda <.treasure_item_id ; EF5F A5 BB
sta <$84 ; EF61 85 84
lda #$00 ; EF63 A9 00
sta <$B9 ; EF65 85 B9
jmp textd.deref_param_text ; EF67 4C 9D F0
; ----------------------------------------------------------------------------
.case_3: ;;item price.
cmp #$03 ; EF6A C9 03
bne .case_4 ; EF6C D0 0E
jsr switch_to_character_logics_bank ; EF6E 20 27 F7
ldx <.treasure_item_id ; EF71 A6 BB
jsr floor.get_item_price ; EF73 20 D4 F5
jsr $8B78 ; EF76 20 78 8B
jmp textd.continue_with_text ; EF79 4C 91 F2
; ----------------------------------------------------------------------------
.case_4: ;;inn charge.
cmp #$04 ; EF7C C9 04
bne .case_5 ; EF7E D0 15
lda <.inn_charge ; EF80 A5 61
sta <$80 ; EF82 85 80
lda <.inn_charge+1 ; EF84 A5 62
sta <$81 ; EF86 85 81
lda <.inn_charge+2 ; EF88 A5 63
sta <$82 ; EF8A 85 82
jsr switch_to_character_logics_bank ; EF8C 20 27 F7
jsr $8B78 ; EF8F 20 78 8B
jmp textd.continue_with_text ; EF92 4C 91 F2
; ----------------------------------------------------------------------------
.case_5:
cmp #$05 ; EF95 C9 05
bne .case_6 ; EF97 D0 09
jsr switch_to_character_logics_bank ; EF99 20 27 F7
jsr $8B03 ; EF9C 20 03 8B
jmp textd.continue_with_text ; EF9F 4C 91 F2
; ----------------------------------------------------------------------------
.case_6: ;;not implemented (nop)
cmp #$06 ; EFA2 C9 06
bne .case_7 ; EFA4 D0 03
.break_case:
jmp textd.draw_in_box ; EFA6 4C FA EE
; ----------------------------------------------------------------------------
.case_7: ;; ally NPC name
cmp #$07 ; EFA9 C9 07
bne .case_8 ; EFAB D0 0E
lda party.ally_npc ; EFAD AD 0B 60
beq .break_case ; EFB0 F0 F4
sec ; EFB2 38
sbc #$01 ; EFB3 E9 01
clc ; EFB5 18
adc #$F8 ; EFB6 69 F8
jmp textd.deref_text_id ; EFB8 4C D8 F2
; ----------------------------------------------------------------------------
.case_8: ;;capacity.
cmp #$08 ; EFBB C9 08
bne .case_9 ; EFBD D0 1B
lda party.capacity ; EFBF AD 1B 60
sta <$80 ; EFC2 85 80
lda #$00 ; EFC4 A9 00
sta <$81 ; EFC6 85 81
jsr switch_to_character_logics_bank ; EFC8 20 27 F7
jsr $8B57 ; EFCB 20 57 8B
ldx <.output_index ; EFCE A6 90
inc <.output_index ; EFD0 E6 90
lda #$5C ; EFD2 A9 5C
sta .tile_buffer_lower,x ; EFD4 9D A0 07
jmp textd.continue_with_text ; EFD7 4C 91 F2
; ----------------------------------------------------------------------------
.case_9: ;;pad to eol.
cmp #$09 ; EFDA C9 09
bne .case_0a ; EFDC D0 06
jsr field.draw_window_content ; EFDE 20 92 F6
jmp .next_line ; EFE1 4C 4E EF
; ----------------------------------------------------------------------------
.case_0a: ;;paging.
cmp #$0A ; EFE4 C9 0A
bne .case_0b ; EFE6 D0 04
lda #$09 ; EFE8 A9 09
clc ; EFEA 18
rts ; EFEB 60
; ----------------------------------------------------------------------------
.case_0b: ;;not implemented (nop)
cmp #$0B ; EFEC C9 0B
bne .case_0c ; EFEE D0 00
.case_0c: ;;leader name
cmp #$0C ; EFF0 C9 0C
bne .case_0d ; EFF2 D0 06
ldx party.leader_offset ; EFF4 AE 0E 60
jmp textd.draw_player_name ; EFF7 4C 16 F3
; ----------------------------------------------------------------------------
.case_0d:
cmp #$0D ; EFFA C9 0D
bne .case_0f ; EFFC D0 09
jsr switch_to_character_logics_bank ; EFFE 20 27 F7
jsr $8B34 ; F001 20 34 8B
jmp textd.continue_with_text ; F004 4C 91 F2
; ----------------------------------------------------------------------------
.case_0f: ;;dustbox
cmp #$0F ; F007 C9 0F
bne .case_0e ; F009 D0 1C
ldx <.output_index ; F00B A6 90
lda #$58 ; F00D A9 58
sta .tile_buffer_upper,x ; F00F 9D 80 07
lda #$59 ; F012 A9 59
sta .tile_buffer_upper+1,x ; F014 9D 81 07
lda #$5A ; F017 A9 5A
sta .tile_buffer_lower,x ; F019 9D A0 07
lda #$5B ; F01C A9 5B
sta .tile_buffer_lower+1,x ; F01E 9D A1 07
txa ; F021 8A
clc ; F022 18
adc #$02 ; F023 69 02
sta <.output_index ; F025 85 90
.case_0e: ;;not implemented (nop)
jmp textd.draw_in_box ; F027 4C FA EE
; ----------------------------------------------------------------------------
;VERIFY_PC $f02a
;INIT_PATCH $3f,$f02a,$f38a
;------------------------------------------------------------------------------------------------------
;;# $3f:f02a textd.eval_replacement
;;### args:
;;+ [in] a: charcode
;;+ [in] y: offset into the string pointed to by $3e.
;;+ [in, out] u8 $1f: number of lines drawn (in 8x8 unit)
;;+ [in] string * $3e: ptr to text to evaluate.
;; On entry, this will point to the parameter byte of replacement code.
;;+ [in,out] u8 $67: ?
;;+ [in,out] u8 $90: offset into the tile buffer ($0780/$07a0)
;;+ [out] u8 $0780[32]: tile (or name table) buffer for upper line
;;+ [out] u8 $07a0[32]: tile (or name table) buffer for lower line
;;
;;### local variables:
;;+ u8 $80,81,82,83: scratch.
;;+ u8 $84: parameter byte
;;+ u8 $97,98
;;
;;### notes:
;;charcodes ranged [10...28) are defined as opcodes (or 'replacement'),
;;given that the codes have followed by additional one byte for parameter.
;;
;;#### code meanings:
;;+ 10-13: status of a player character. lower 2-bits represents an index of character.
;;+ 15-17: left-align text by paramter,increment menu-item count by 4
;;+ 1e: get job name
; ----------------------------------------------------------------------------
; bank $3f
textd.eval_replacement:
;; --- variables.
.output_index = $90
.text_id = $92
.text_bank = $93
.p_text_table = $94 ;;stores offset from $30000(18:8000) to the text
;; floor
.treasure_item_id = $bb
;; textd
.p_text_line = $1c
.lines_drawn = $1f
.parameter_byte = $84
.cached_param = $67
;; ---
.program_bank = $57
;; --- window related
.in_menu_mode = $37
.window_left = $38
.window_top = $39
.offset_x = $3a
.offset_y = $3b
.window_width = $3c
.window_height = $3d
.p_text = $3e
;;
.tile_buffer_upper = $0780
.tile_buffer_lower = $07a0
;;static reference
;; ---
pha ; F02A 48
ldx <.cached_param ; F02B A6 67
cmp #$1D ; F02D C9 1D
beq .L_F034 ; F02F F0 03
lda [.p_text],y ; F031 B1 3E
tax ; F033 AA
.L_F034:
stx <.parameter_byte ; F034 86 84
stx <.cached_param ; F036 86 67
inc <.p_text ; F038 E6 3E
bne .L_F03E ; F03A D0 02
inc <.p_text+1 ; F03C E6 3F
.L_F03E:
pla ; F03E 68
cmp #$14 ; F03F C9 14
bcs .L_F046 ; F041 B0 03
jmp textd.eval_code_10_13 ; F043 4C 39 F2
; ----------------------------------------------------------------------------
.L_F046:
bne .case_15_17 ; F046 D0 07
;;case 0x14: ;; padding, offset dest buffer by the number specified in parameter byte
lda <.parameter_byte ; F048 A5 84
sta <.output_index ; F04A 85 90
jmp textd.draw_in_box ; F04C 4C FA EE
; ----------------------------------------------------------------------------
.case_15_17:
;; setup command window. param: space fill.
;; 15 = (new-game; menu; equip; job)
;; 16 = (magic setup; item target; shop offerings;)
;; 17 = (items to equip; items to use; items to sell; (fatty choccobo))
cmp #$18 ; F04F C9 18
bcs .case_18 ;L_F09B ; F051 B0 48
sec ; F053 38
sbc #$15 ; F054 E9 15
clc ; F056 18
adc #$78 ; F057 69 78
sta <$81 ; F059 85 81
lda #$00 ; F05B A9 00
sta <$80 ; F05D 85 80
lda <.parameter_byte ; F05F A5 84
sta <.output_index ; F061 85 90
lda [.p_text],y ; F063 B1 3E
sta <$82 ; F065 85 82
iny ; F067 C8
lda [.p_text],y ; F068 B1 3E
sta <$83 ; F06A 85 83
ldy #$F1 ; F06C A0 F1
lda [$80],y ; F06E B1 80
ldx <$1E ; F070 A6 1E
bne .L_F077 ; F072 D0 03
inc <$1E ; F074 E6 1E
txa ; F076 8A
.L_F077:
tax ; F077 AA
clc ; F078 18
adc #$04 ; F079 69 04
sta [$80],y ; F07B 91 80
txa ; F07D 8A
tay ; F07E A8
lda <.parameter_byte ; F07F A5 84
clc ; F081 18
adc <$97 ; F082 65 97
sta [$80],y ; F084 91 80
lda <$98 ; F086 A5 98
clc ; F088 18
adc <.lines_drawn ; F089 65 1F
iny ; F08B C8
sta [$80],y ; F08C 91 80
iny ; F08E C8
lda <$82 ; F08F A5 82
sta [$80],y ; F091 91 80
lda <$83 ; F093 A5 83
iny ; F095 C8
sta [$80],y ; F096 91 80
jmp textd.draw_in_box ; F098 4C FA EE
; ----------------------------------------------------------------------------
.case_18:
;; reference to anothert text.
;; parameter = text_id.
bne .case_19 ; F09B D0 53
.L_F09D:
;;textd.f09d_deref_param_text
;;in $b9?
lda <.parameter_byte ; F09D A5 84
beq .L_F0ED ; F09F F0 4C
;;F0A1
lda <.output_index ; F0A1 A5 90
pha ; F0A3 48
jsr textd.save_text_ptr ; F0A4 20 E4 F3
lda #$18 ; F0A7 A9 18
jsr call_switch_2banks ; F0A9 20 03 FF
lda <.parameter_byte ; F0AC A5 84
asl a ; F0AE 0A
tax ; F0AF AA
bcs .L_F0BD ; F0B0 B0 0B
lda $8800,x ; F0B2 BD 00 88
sta <.p_text ; F0B5 85 3E
lda $8801,x ; F0B7 BD 01 88
jmp textd.draw_embedded_text ; F0BA 4C C5 F0
; ----------------------------------------------------------------------------
.L_F0BD:
lda $8900,x ; F0BD BD 00 89
sta <.p_text ; F0C0 85 3E
lda $8901,x ; F0C2 BD 01 89
.L_F0C5:
;;textd.draw_embedded_text?
pha ; F0C5 48
and #$1F ; F0C6 29 1F
ora #$80 ; F0C8 09 80
sta <.p_text+1 ; F0CA 85 3F
pla ; F0CC 68
lsr a ; F0CD 4A
lsr a ; F0CE 4A
lsr a ; F0CF 4A
lsr a ; F0D0 4A
lsr a ; F0D1 4A
clc ; F0D2 18
adc #$18 ; F0D3 69 18
jsr call_switch_2banks ; F0D5 20 03 FF
jsr textd.draw_in_box ; F0D8 20 FA EE
jsr textd.restore_text_ptr ; F0DB 20 ED F3
pla ; F0DE 68
tax ; F0DF AA
lda <$B9 ; F0E0 A5 B9
beq .L_F0ED ; F0E2 F0 09
lda #$00 ; F0E4 A9 00
sta <$B9 ; F0E6 85 B9
;;73 == 'X' (unusable mark)
lda #$73 ; F0E8 A9 73
sta .tile_buffer_lower,x ; F0EA 9D A0 07
.L_F0ED:
jmp textd.draw_in_box ; F0ED 4C FA EE
; ----------------------------------------------------------------------------
.case_19:
;;item name of which is listed in the shop.
;;param: index in the shop offerings list.
cmp #$19 ; F0F0 C9 19
bne .case_1a ; F0F2 D0 20
ldx <.parameter_byte ; F0F4 A6 84
lda menu.shop_offerings,x ; F0F6 BD 80 7B
sta <.parameter_byte ; F0F9 85 84
bne .L_F10A ; F0FB D0 0D
lda $79F1 ; F0FD AD F1 79
sec ; F100 38
sbc #$04 ; F101 E9 04
sta $79F1 ; F103 8D F1 79
lda #$FF ; F106 A9 FF
clc ; F108 18
rts ; F109 60
; ----------------------------------------------------------------------------
.L_F10A:
lda #$00 ; F10A A9 00
sta <$B9 ; F10C 85 B9
jmp textd.deref_param_text ; F10E 4C 9D F0
; ----------------------------------------------------------------------------
.break_case_f111:
jmp textd.draw_in_box ; F111 4C FA EE
; ----------------------------------------------------------------------------
.case_1a:
;; item name of which is stored in the backpack,
;; at the index specified by parameter
cmp #$1A ; F114 C9 1A
bne .case_1b ; F116 D0 10
lda #$00 ; F118 A9 00
sta <$B9 ; F11A 85 B9
ldx <.parameter_byte ; F11C A6 84
lda party.backpack.item_id,x ; F11E BD C0 60
beq .break_case_f111 ; F121 F0 EE
sta <.parameter_byte ; F123 85 84
jmp textd.deref_param_text ; F125 4C 9D F0
; ----------------------------------------------------------------------------
.case_1b:
;;item name of which is in stomach. (of fatty choccobo).
;;param: index in the stomach.
cmp #$1B ; F128 C9 1B
bne .case_1c ; F12A D0 13
jsr textd.setup_output_ptr_to_next_column ; F12C 20 AC F3
ldx <.parameter_byte ; F12F A6 84
lda menu.available_items_in_stomach,x ; F131 BD 00 7C
beq .break_case_f111 ; F134 F0 DB
sta <.parameter_byte ; F136 85 84
lda #$00 ; F138 A9 00
sta <$B9 ; F13A 85 B9
jmp textd.deref_param_text ; F13C 4C 9D F0
; ----------------------------------------------------------------------------
.case_1c:
;; number of item of which is stored in the backpack,
;; at the index specified by parameter
cmp #$1C ; F13F C9 1C
bne .case_1d ; F141 D0 09
ldx <.parameter_byte ; F143 A6 84
lda party.backpack.item_count,x ; F145 BD E0 60
beq .break_case_f111 ; F148 F0 C7
bne .L_F166 ; F14A D0 1A
.case_1d: ;;fatty choccobo. param: index in the list
cmp #$1D ; F14C C9 1D
bne .case_1e ; F14E D0 2A
lda <.parameter_byte ; F150 A5 84
lsr a ; F152 4A
lda #$0A ; F153 A9 0A
bcc .L_F159 ; F155 90 02
lda #$18 ; F157 A9 18
.L_F159:
sta <.output_index ; F159 85 90
ldx <.parameter_byte ; F15B A6 84
;; 7c00 = item_id, where x = index in the stomach.
lda menu.available_items_in_stomach,x ; F15D BD 00 7C
beq .break_case_f111 ; F160 F0 AF
tax ; F162 AA
;; $6300 = number of items, where x = item_id
lda party.item_amount_in_stomach,x ; F163 BD 00 63
.L_F166:
sta <$80 ; F166 85 80
ldx <.output_index ; F168 A6 90
inc <.output_index ; F16A E6 90
;;c8 = ':'
lda #$C8 ; F16C A9 C8
sta .tile_buffer_lower,x ; F16E 9D A0 07
jsr switch_to_character_logics_bank ; F171 20 27 F7
jsr $8B29 ; F174 20 29 8B
jmp textd.continue_with_text ; F177 4C 91 F2
; ----------------------------------------------------------------------------
.case_1e:
;;available job name. param = job_id
cmp #$1E ; F17A C9 1E
bne .case_1f ; F17C D0 1C
jsr field.get_max_available_job_id ; F17E 20 8A F3
cmp <.parameter_byte ; F181 C5 84
bcs .L_F192 ; F183 B0 0D
lda $78F1 ; F185 AD F1 78
sec ; F188 38
sbc #$04 ; F189 E9 04
sta $78F1 ; F18B 8D F1 78
lda #$FF ; F18E A9 FF
clc ; F190 18
rts ; F191 60
; ----------------------------------------------------------------------------
.L_F192:
lda <.parameter_byte ; F192 A5 84
clc ; F194 18
adc #$E2 ; F195 69 E2
jmp textd.deref_text_id ; F197 4C D8 F2
; ----------------------------------------------------------------------------
.case_1f:
;;capacity needed to change job to which is in the available job list.
;;param: index in the list.(ie, job_id)
cmp #$1F ; F19A C9 1F
bne .case_20 ; F19C D0 1D
ldx <.parameter_byte ; F19E A6 84
lda $7200,x ; F1A0 BD 00 72
sta <$80 ; F1A3 85 80
ldx <.output_index ; F1A5 A6 90
inc <.output_index ; F1A7 E6 90
lda #$C8 ; F1A9 A9 C8
sta .tile_buffer_lower,x ; F1AB 9D A0 07
lda #$00 ; F1AE A9 00
sta <$81 ; F1B0 85 81
jsr switch_to_character_logics_bank ; F1B2 20 27 F7
jsr $8B57 ; F1B5 20 57 8B
jmp textd.continue_with_text ; F1B8 4C 91 F2
; ----------------------------------------------------------------------------
.case_20:
;;item name referenced in equip selection window
cmp #$20 ; F1BB C9 20
bne .case_21 ; F1BD D0 12
ldx <.parameter_byte ; F1BF A6 84
lda party.backpack.item_id,x ; F1C1 BD C0 60
beq .break_case_f1f6 ; F1C4 F0 30
sta <.parameter_byte ; F1C6 85 84
tax ; F1C8 AA
lda $7200,x ; F1C9 BD 00 72
sta <$B9 ; F1CC 85 B9
jmp textd.deref_param_text ; F1CE 4C 9D F0
; ----------------------------------------------------------------------------
.case_21:
;;item price listed in shop. param = index.
cmp #$21 ; F1D1 C9 21
bne .case_22 ; F1D3 D0 24
ldx <.parameter_byte ; F1D5 A6 84
;;$7b80 = item list in shop
lda menu.shop_offerings,x ; F1D7 BD 80 7B
beq .break_case_f1f6 ; F1DA F0 1A
lda menu.shop_item_price.low,x ; F1DC BD 90 7B
sta <$80 ; F1DF 85 80
lda menu.shop_item_price.mid,x ; F1E1 BD 98 7B
sta <$81 ; F1E4 85 81
lda menu.shop_item_price.high,x ; F1E6 BD A0 7B
sta <$82 ; F1E9 85 82
jsr switch_to_character_logics_bank ; F1EB 20 27 F7
jsr $8B78 ; F1EE 20 78 8B
lda <.text_bank ; F1F1 A5 93
jsr call_switch_2banks ; F1F3 20 03 FF
;.L_F1F6:
.break_case_f1f6:
jmp textd.draw_in_box ; F1F6 4C FA EE
; ----------------------------------------------------------------------------
.case_22:
;;item name of which is stored in the backpack.
;;parameter = index in backpack
cmp #$22 ; F1F9 C9 22
bne .break_case_f1f6 ; F1FB D0 F9
lda #$00 ; F1FD A9 00
sta <$B9 ; F1FF 85 B9
ldx <.parameter_byte ; F201 A6 84
lda party.backpack.item_id,x ; F203 BD C0 60
beq .break_case_f1f6 ; F206 F0 EE
sta <.parameter_byte ; F208 85 84
lda <.output_index ; F20A A5 90
pha ; F20C 48
jsr textd.save_text_ptr ; F20D 20 E4 F3
lda #$18 ; F210 A9 18
jsr call_switch_2banks ; F212 20 03 FF
lda <.parameter_byte ; F215 A5 84
asl a ; F217 0A
tax ; F218 AA
bcs .L_F229 ; F219 B0 0E
lda $8800,x ; F21B BD 00 88
clc ; F21E 18
adc #$01 ; F21F 69 01
sta <.p_text ; F221 85 3E
lda $8801,x ; F223 BD 01 88
jmp .L_F234 ; F226 4C 34 F2
; ----------------------------------------------------------------------------
.L_F229:
lda $8900,x ; F229 BD 00 89
clc ; F22C 18
adc #$01 ; F22D 69 01
sta <.p_text ; F22F 85 3E
lda $8901,x ; F231 BD 01 89
.L_F234:
adc #$00 ; F234 69 00
jmp textd.draw_embedded_text ; F236 4C C5 F0
; ----------------------------------------------------------------------------
;------------------------------------------------------------------------------------------------------
;;field.string.eval_code_10_13:
textd.eval_code_10_13:
;; --- variables.
.output_index = $90
.text_id = $92
.text_bank = $93
.p_text_table = $94 ;;stores offset from $30000(18:8000) to the text
;; textd
.p_text_line = $1c
.lines_drawn = $1f
.parameter_byte = $84
.cached_param = $67 ;;offset to character.
;; ---
.program_bank = $57
;; --- window related
.in_menu_mode = $37
.window_left = $38
.window_top = $39
.offset_x = $3a
.offset_y = $3b
.window_width = $3c
.window_height = $3d
.p_text = $3e
;;
.tile_buffer_upper = $0780
.tile_buffer_lower = $07a0
;; A = char code
;; X = param byte
lsr a ; F239 4A
ror a ; F23A 6A
ror a ; F23B 6A
and #$C0 ; F23C 29 C0
sta <.cached_param ; F23E 85 67
lda <.parameter_byte ; F240 A5 84
cmp #$30 ; F242 C9 30
bcc .case_below_30 ; F244 90 53
.L_F246:
cmp #$FF ; F246 C9 FF
bne .case_30_fe ; F248 D0 3F
;;case 0xff:
ldx <.cached_param ; F24A A6 67
lda player.level,x ; F24C BD 01 61
cmp #$62 ; F24F C9 62
bcs textd.continue_with_text ; F251 B0 3E
sta <$80 ; F253 85 80
asl a ; F255 0A
clc ; F256 18
adc <$80 ; F257 65 80
sta <$84 ; F259 85 84
lda #$00 ; F25B A9 00
adc #$80 ; F25D 69 80
sta <$85 ; F25F 85 85
lda #$39 ; F261 A9 39
jsr call_switch1stBank ; F263 20 06 FF
ldy #$B0 ; F266 A0 B0
lda [$84],y ; F268 B1 84
sec ; F26A 38
sbc player.exp,x ; F26B FD 03 61
sta <$80 ; F26E 85 80
iny ; F270 C8
lda [$84],y ; F271 B1 84
sbc player.exp+1,x ; F273 FD 04 61
sta <$81 ; F276 85 81
iny ; F278 C8
lda [$84],y ; F279 B1 84
sbc player.exp+2,x ; F27B FD 05 61
sta <$82 ; F27E 85 82
jsr switch_to_character_logics_bank ; F280 20 27 F7
jsr $8B78 ; F283 20 78 8B
jmp textd.continue_with_text ; F286 4C 91 F2
; ----------------------------------------------------------------------------
.case_30_fe:
pha ; F289 48
jsr switch_to_character_logics_bank ; F28A 20 27 F7
pla ; F28D 68
jsr $8998 ; F28E 20 98 89
;;textd.continue_with_text
.L_F291:
lda <.text_bank ; F291 A5 93
jsr call_switch_2banks ; F293 20 03 FF
jmp textd.draw_in_box ; F296 4C FA EE
; ----------------------------------------------------------------------------
.case_below_30:
cmp #$00 ; F299 C9 00
bne .case_01 ; F29B D0 64
;;case 0x00: ;;status
ldx <.cached_param ; F29D A6 67
lda player.status,x ; F29F BD 02 61
and #$FE ; F2A2 29 FE
bne .L_F2BB ; F2A4 D0 15
ldx <.output_index ; F2A6 A6 90
inc <.output_index ; F2A8 E6 90
inc <.output_index ; F2AA E6 90
lda #$5E ; F2AC A9 5E
sta .tile_buffer_lower,x ; F2AE 9D A0 07
lda #$5F ; F2B1 A9 5F
sta .tile_buffer_lower+1,x ; F2B3 9D A1 07
lda #$3e ; F2B6 A9 3E
jmp .L_F246 ; F2B8 4C 46 F2
; ----------------------------------------------------------------------------
.L_F2BB:
ldy #$16 ; F2BB A0 16
asl a ; F2BD 0A
bcs .L_F2D7 ; F2BE B0 17
ldy #$17 ; F2C0 A0 17
asl a ; F2C2 0A
bcs .L_F2D7 ; F2C3 B0 12
ldy #$1B ; F2C5 A0 1B
asl a ; F2C7 0A
bcs .L_F2D7 ; F2C8 B0 0D
iny ; F2CA C8
asl a ; F2CB 0A
bcs .L_F2D7 ; F2CC B0 09
iny ; F2CE C8
asl a ; F2CF 0A
bcs .L_F2D7 ; F2D0 B0 05
iny ; F2D2 C8
asl a ; F2D3 0A
bcs .L_F2D7 ; F2D4 B0 01
iny ; F2D6 C8
.L_F2D7:
tya ; F2D7 98
;;textd.deref_text_id
.L_F2D8:
tax ; F2D8 AA
jsr textd.save_text_ptr ; F2D9 20 E4 F3
lda #$18 ; F2DC A9 18
jsr call_switch_2banks ; F2DE 20 03 FF
txa ; F2E1 8A
asl a ; F2E2 0A
tax ; F2E3 AA
bcs .L_F2F1 ; F2E4 B0 0B
lda textd.status_and_area_names,x ; F2E6 BD 00 82
sta <.p_text ; F2E9 85 3E
lda textd.status_and_area_names+1,x ; F2EB BD 01 82
jmp .L_F2F9 ; F2EE 4C F9 F2
; ----------------------------------------------------------------------------
.L_F2F1:
lda textd.status_and_area_names+$100,x ; F2F1 BD 00 83
sta <.p_text ; F2F4 85 3E
lda textd.status_and_area_names+$101,x ; F2F6 BD 01 83
.L_F2F9:
tax ; F2F9 AA
lda <.output_index ; F2FA A5 90
pha ; F2FC 48
txa ; F2FD 8A
jmp textd.draw_embedded_text ; F2FE 4C C5 F0
; ----------------------------------------------------------------------------
.case_01: ;;job name
cmp #$01 ; F301 C9 01
bne .case_02 ; F303 D0 0B
ldx <.cached_param ; F305 A6 67
lda player.job,x ; F307 BD 00 61
clc ; F30A 18
adc #$E2 ; F30B 69 E2
jmp textd.deref_text_id ; F30D 4C D8 F2
; ----------------------------------------------------------------------------
.case_02: ;;player name
cmp #$02 ; F310 C9 02
bne .case_03_07 ; F312 D0 34
ldx <.cached_param ; F314 A6 67
;;textd.draw_player_name
;;in x : offset
lda player.name+0,x ; F316 BD 06 61
sta <$5A ; F319 85 5A
lda player.name+1,x ; F31B BD 07 61
sta <$5B ; F31E 85 5B
lda player.name+2,x ; F320 BD 08 61
sta <$5C ; F323 85 5C
lda player.name+3,x ; F325 BD 09 61
sta <$5D ; F328 85 5D
lda player.name+4,x ; F32A BD 0A 61
sta <$5E ; F32D 85 5E
lda player.name+5,x ; F32F BD 0B 61
sta <$5F ; F332 85 5F
jsr textd.save_text_ptr ; F334 20 E4 F3
lda #$5A ; F337 A9 5A
sta <.p_text ; F339 85 3E
lda #$00 ; F33B A9 00
sta <.p_text+1 ; F33D 85 3F
jsr textd.draw_in_box ; F33F 20 FA EE
jsr textd.restore_text_ptr ; F342 20 ED F3
jmp textd.draw_in_box ; F345 4C FA EE
; ----------------------------------------------------------------------------
.case_03_07: ;;equipped item
cmp #$08 ; F348 C9 08
bcs .case_gte_08 ; F34A B0 27
sec ; F34C 38
sbc #$03 ; F34D E9 03
cmp #$04 ; F34F C9 04
bne .L_F356 ; F351 D0 03
clc ; F353 18
adc #$01 ; F354 69 01
.L_F356:
ora <.cached_param ; F356 05 67
tax ; F358 AA
lda player.equips,x ; F359 BD 00 62
bne .L_F368 ; F35C D0 0A
txa ; F35E 8A
and #$07 ; F35F 29 07
tax ; F361 AA
lda .L_F36D,x ; F362 BD 6D F3
jmp textd.deref_text_id ; F365 4C D8 F2
; ----------------------------------------------------------------------------
.L_F368:
sta <.parameter_byte ; F368 85 84
jmp textd.deref_param_text_unsafe ; F36A 4C A1 F0
; ----------------------------------------------------------------------------
.L_F36D:
.db $dd, $de, $df, $e0, $e1, $e1
;cmp $DFDE,x ; F36D DD DE DF
;cpx #$E1 ; F370 E0 E1
;.byte $E1 ; F372 E1
; ----------------------------------------------------------------------------
.case_gte_08:
sec ; F373 38
sbc #$08 ; F374 E9 08
tax ; F376 AA
lda $7C00,x ; F377 BD 00 7C
beq .break_case_f387 ; F37A F0 0B
sta <$84 ; F37C 85 84
tax ; F37E AA
lda $7200,x ; F37F BD 00 72
sta <$B9 ; F382 85 B9
jmp textd.deref_param_text ; F384 4C 9D F0
; ----------------------------------------------------------------------------
.break_case_f387:
jmp textd.draw_in_box ; F387 4C FA EE |
; A298705: Numbers from the 15-theorem for universal Hermitian lattices.
; 1,2,3,5,6,7,10,13,14,15
mov $2,29
add $2,$0
mov $3,$0
add $3,2
seq $3,102363 ; Triangle read by rows, constructed by a Pascal-like rule with left edge = 2^k, right edge = 2^(k+1)-1 (k >= 0).
add $3,3
min $2,$3
mov $0,$2
sub $0,5
|
; A184043: 1/9 the number of (n+1) X 5 0..2 arrays with all 2 X 2 subblocks having the same four values.
; 45,51,61,81,117,189,325,597,1125,2181,4261,8421,16677,33189,66085,131877,263205,525861,1050661,2100261,4198437,8394789,16785445,33566757,67125285,134242341,268468261,536920101,1073807397,2147581989,4295098405,8590131237,17180131365,34360131621,68720001061,137439739941,274878955557,549757386789,1099513724965,2199026401317,4398050705445,8796099313701,17592194433061,35184384671781,70368760954917,140737513521189,281475010265125,562950003752997,1125899973951525,2251799914348581,4503599761588261,9007199456067621,18014398777917477,36028797421617189,72057594574798885,144115188881162277,288230377225453605,576460753914036261,1152921506754330661,2305843012434919461,4611686022722355237,9223372043297226789,18446744082299486245,36893488160304005157,73786976312018075685,147573952615446216741,295147905213712564261,590295810410245259301,1180591620786130780197,2361183241537901821989,4722366483007084167205,9444732965945448857637,18889465931753458761765,37778931863369478570021,75557863726464079233061,151115727452653280559141,302231454904756805304357,604462909808963854794789,1208925819616828197961765,2417851639232556884295717,4835703278462914745335845,9671406556923630467416101,19342813113842862888321061,38685626227681327730130981,77371252455353859367239717,154742504910698922641457189,309485009821380253096869925,618970019642742914007695397,1237940039285450643643301925,2475880078570866102914514981,4951760157141661837084852261,9903520314283253305425526821,19807040628566365873362698277,39614081257132591009237041189,79228162514264900543497371685,158456325028529519612018032677,316912650057058476274082644005,633825300114116389598211866661,1267650600228231653296516890661,2535301200456462180693126938661
mov $1,3
mov $2,$0
lpb $0
mul $1,2
add $1,$2
sub $1,$0
sub $0,1
trn $2,2
lpe
sub $1,3
mul $1,2
add $1,45
mov $0,$1
|
; Listing generated by Microsoft (R) Optimizing Compiler Version 18.00.31101.0
TITLE C:\Users\DAVE\Documents\Programming\Visual_Studio_6\EXE\Console\SoundOff\SoundOff\SOff_ReportLoadStringError.C
.686P
.XMM
include listing.inc
.model flat
INCLUDELIB OLDNAMES
EXTRN __imp__FB_GetSprintFBufferW:PROC
EXTRN __imp__FB_LoadStringW:PROC
EXTRN __imp__SetLastError@4:PROC
EXTRN __imp__GetLastError@0:PROC
EXTRN __imp__FB_FormatMessage2W:PROC
EXTRN __imp__wprintf:PROC
EXTRN __imp___swprintf:PROC
EXTRN __imp__FB_FormatMessageW:PROC
EXTRN __imp__FB_GetlpResourceBufferW:PROC
PUBLIC _SOff_ReportLoadStringError@12
; Function compile flags: /Ogtp
; File c:\users\dave\documents\programming\visual_studio_6\exe\console\soundoff\soundoff\soff_reportloadstringerror.c
; COMDAT _SOff_ReportLoadStringError@12
_TEXT SEGMENT
_puintBufferID$dead$ = 8 ; size = 4
_SOff_ReportLoadStringError@12 PROC ; COMDAT
; _phSourceModule$dead$ = ecx
; _puintStringID$ = edx
; 9 : {
push esi
push edi
mov esi, edx
; 10 : DWORD dwStatus = GetLastError ( ) ;
call DWORD PTR __imp__GetLastError@0
mov edi, eax
; 11 :
; 12 : if ( dwStatus )
test edi, edi
je SHORT $LN3@SOff_Repor
; 13 : {
; 14 : if ( FB_LoadFixedString_DfltBuf ( IDS_STRING_LOAD_ERROR_1 ) )
push 0
push 0
push 106 ; 0000006aH
push 0
call DWORD PTR __imp__FB_LoadStringW
add esp, 16 ; 00000010H
test eax, eax
je SHORT $LN6@SOff_Repor
; 15 : {
; 16 : _stprintf ( FB_GetSprintFBuffer ( FB_FIRST_BUFFER_INDEX ) ,
; 17 : FB_GetlpResourceBuffer ( FB_FIRST_BUFFER_INDEX ) ,
; 18 : puintStringID ) ;
push esi
mov esi, DWORD PTR __imp__FB_GetlpResourceBufferW
push 0
call esi
add esp, 4
push eax
push 0
call DWORD PTR __imp__FB_GetSprintFBufferW
add esp, 4
push eax
call DWORD PTR __imp___swprintf
add esp, 12 ; 0000000cH
; 19 : _tprintf ( FB_FormatMessage ( FB_GetlpResourceBuffer ( FB_FIRST_BUFFER_INDEX ) ,
; 20 : dwStatus ,
; 21 : SCF2_HEXADECIMAL ) ) ;
push 0
push edi
push 0
call esi
add esp, 4
push eax
call DWORD PTR __imp__FB_FormatMessageW
push eax
call DWORD PTR __imp__wprintf
; 28 : _tprintf ( FB_FormatMessage2 ( IDS_STRING_LOAD_ERROR_2 ,
; 29 : dwStatus ,
; 30 : SCF2_HEXADECIMAL ) ) ;
add esp, 16 ; 00000010H
; 31 : } // FALSE block, if ( dwStatus )
; 32 :
; 33 : // ------------------------------------------------------------------------
; 34 : // Raise a structured exception if the SEH flag is set. When this happens,
; 35 : // there is no actual return, and the stack is unwound.
; 36 : // ------------------------------------------------------------------------
; 37 :
; 38 : return dwStatus ; // Tell the calling routine to call GetLastError and/or FB_GetlpErrMsgSprintf (to get the message).
mov eax, edi
pop edi
pop esi
; 39 : } // SOff_ReportLoadStringError
ret 4
$LN6@SOff_Repor:
; 31 : } // FALSE block, if ( dwStatus )
; 32 :
; 33 : // ------------------------------------------------------------------------
; 34 : // Raise a structured exception if the SEH flag is set. When this happens,
; 35 : // there is no actual return, and the stack is unwound.
; 36 : // ------------------------------------------------------------------------
; 37 :
; 38 : return dwStatus ; // Tell the calling routine to call GetLastError and/or FB_GetlpErrMsgSprintf (to get the message).
mov eax, edi
pop edi
pop esi
; 39 : } // SOff_ReportLoadStringError
ret 4
$LN3@SOff_Repor:
; 22 : } // if ( FB_LoadFixedString_DfltBuf ( IDS_STRING_LOAD_ERROR_1 ) )
; 23 : } // TRUE block, if ( dwStatus )
; 24 : else
; 25 : { // Since Windows provided no error, we supply our own.
; 26 : dwStatus = FB_ERR_STRNG_NOT_FOUND_FOR_ID ;
; 27 : SetLastError ( dwStatus );
push 537002000 ; 20020010H
call DWORD PTR __imp__SetLastError@4
; 28 : _tprintf ( FB_FormatMessage2 ( IDS_STRING_LOAD_ERROR_2 ,
; 29 : dwStatus ,
; 30 : SCF2_HEXADECIMAL ) ) ;
push 0
push 537002000 ; 20020010H
push 107 ; 0000006bH
call DWORD PTR __imp__FB_FormatMessage2W
push eax
call DWORD PTR __imp__wprintf
add esp, 16 ; 00000010H
; 31 : } // FALSE block, if ( dwStatus )
; 32 :
; 33 : // ------------------------------------------------------------------------
; 34 : // Raise a structured exception if the SEH flag is set. When this happens,
; 35 : // there is no actual return, and the stack is unwound.
; 36 : // ------------------------------------------------------------------------
; 37 :
; 38 : return dwStatus ; // Tell the calling routine to call GetLastError and/or FB_GetlpErrMsgSprintf (to get the message).
mov eax, 537002000 ; 20020010H
pop edi
pop esi
; 39 : } // SOff_ReportLoadStringError
ret 4
_SOff_ReportLoadStringError@12 ENDP
_TEXT ENDS
END
|
; A313722: Coordination sequence Gal.6.248.4 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings.
; Submitted by Jamie Morken(s1)
; 1,5,10,15,20,24,30,34,39,44,49,54,59,64,69,74,78,84,88,93,98,103,108,113,118,123,128,132,138,142,147,152,157,162,167,172,177,182,186,192,196,201,206,211,216,221,226,231,236,240
mul $0,18
mov $1,$0
add $0,5
div $0,11
mul $1,2
sub $1,6
div $1,11
add $1,1
add $0,$1
|
#include "rpcconsole.h"
#include "ui_rpcconsole.h"
#include "clientmodel.h"
#include "bitcoinrpc.h"
#include "guiutil.h"
#include <QTime>
#include <QTimer>
#include <QThread>
#include <QTextEdit>
#include <QKeyEvent>
#include <QUrl>
#include <QScrollBar>
#include <openssl/crypto.h>
// TODO: make it possible to filter out categories (esp debug messages when implemented)
// TODO: receive errors and debug messages through ClientModel
const int CONSOLE_SCROLLBACK = 50;
const int CONSOLE_HISTORY = 50;
const QSize ICON_SIZE(24, 24);
const struct {
const char *url;
const char *source;
} ICON_MAPPING[] = {
{"cmd-request", ":/icons/tx_input"},
{"cmd-reply", ":/icons/tx_output"},
{"cmd-error", ":/icons/tx_output"},
{"misc", ":/icons/tx_inout"},
{NULL, NULL}
};
/* Object for executing console RPC commands in a separate thread.
*/
class RPCExecutor: public QObject
{
Q_OBJECT
public slots:
void start();
void request(const QString &command);
signals:
void reply(int category, const QString &command);
};
#include "rpcconsole.moc"
void RPCExecutor::start()
{
// Nothing to do
}
/**
* Split shell command line into a list of arguments. Aims to emulate \c bash and friends.
*
* - Arguments are delimited with whitespace
* - Extra whitespace at the beginning and end and between arguments will be ignored
* - Text can be "double" or 'single' quoted
* - The backslash \c \ is used as escape character
* - Outside quotes, any character can be escaped
* - Within double quotes, only escape \c " and backslashes before a \c " or another backslash
* - Within single quotes, no escaping is possible and no special interpretation takes place
*
* @param[out] args Parsed arguments will be appended to this list
* @param[in] strCommand Command line to split
*/
bool parseCommandLine(std::vector<std::string> &args, const std::string &strCommand)
{
enum CmdParseState
{
STATE_EATING_SPACES,
STATE_ARGUMENT,
STATE_SINGLEQUOTED,
STATE_DOUBLEQUOTED,
STATE_ESCAPE_OUTER,
STATE_ESCAPE_DOUBLEQUOTED
} state = STATE_EATING_SPACES;
std::string curarg;
foreach(char ch, strCommand)
{
switch(state)
{
case STATE_ARGUMENT: // In or after argument
case STATE_EATING_SPACES: // Handle runs of whitespace
switch(ch)
{
case '"': state = STATE_DOUBLEQUOTED; break;
case '\'': state = STATE_SINGLEQUOTED; break;
case '\\': state = STATE_ESCAPE_OUTER; break;
case ' ': case '\n': case '\t':
if(state == STATE_ARGUMENT) // Space ends argument
{
args.push_back(curarg);
curarg.clear();
}
state = STATE_EATING_SPACES;
break;
default: curarg += ch; state = STATE_ARGUMENT;
}
break;
case STATE_SINGLEQUOTED: // Single-quoted string
switch(ch)
{
case '\'': state = STATE_ARGUMENT; break;
default: curarg += ch;
}
break;
case STATE_DOUBLEQUOTED: // Double-quoted string
switch(ch)
{
case '"': state = STATE_ARGUMENT; break;
case '\\': state = STATE_ESCAPE_DOUBLEQUOTED; break;
default: curarg += ch;
}
break;
case STATE_ESCAPE_OUTER: // '\' outside quotes
curarg += ch; state = STATE_ARGUMENT;
break;
case STATE_ESCAPE_DOUBLEQUOTED: // '\' in double-quoted text
if(ch != '"' && ch != '\\') curarg += '\\'; // keep '\' for everything but the quote and '\' itself
curarg += ch; state = STATE_DOUBLEQUOTED;
break;
}
}
switch(state) // final state
{
case STATE_EATING_SPACES:
return true;
case STATE_ARGUMENT:
args.push_back(curarg);
return true;
default: // ERROR to end in one of the other states
return false;
}
}
void RPCExecutor::request(const QString &command)
{
std::vector<std::string> args;
if(!parseCommandLine(args, command.toStdString()))
{
emit reply(RPCConsole::CMD_ERROR, QString("Parse error: unbalanced ' or \""));
return;
}
if(args.empty())
return; // Nothing to do
try
{
std::string strPrint;
// Convert argument list to JSON objects in method-dependent way,
// and pass it along with the method name to the dispatcher.
json_spirit::Value result = tableRPC.execute(
args[0],
RPCConvertValues(args[0], std::vector<std::string>(args.begin() + 1, args.end())));
// Format result reply
if (result.type() == json_spirit::null_type)
strPrint = "";
else if (result.type() == json_spirit::str_type)
strPrint = result.get_str();
else
strPrint = write_string(result, true);
emit reply(RPCConsole::CMD_REPLY, QString::fromStdString(strPrint));
}
catch (json_spirit::Object& objError)
{
try // Nice formatting for standard-format error
{
int code = find_value(objError, "code").get_int();
std::string message = find_value(objError, "message").get_str();
emit reply(RPCConsole::CMD_ERROR, QString::fromStdString(message) + " (code " + QString::number(code) + ")");
}
catch(std::runtime_error &) // raised when converting to invalid type, i.e. missing code or message
{ // Show raw JSON object
emit reply(RPCConsole::CMD_ERROR, QString::fromStdString(write_string(json_spirit::Value(objError), false)));
}
}
catch (std::exception& e)
{
emit reply(RPCConsole::CMD_ERROR, QString("Error: ") + QString::fromStdString(e.what()));
}
}
RPCConsole::RPCConsole(QWidget *parent) :
QDialog(parent),
ui(new Ui::RPCConsole),
historyPtr(0)
{
ui->setupUi(this);
#ifndef Q_OS_MAC
ui->openDebugLogfileButton->setIcon(QIcon(":/icons/export"));
ui->showCLOptionsButton->setIcon(QIcon(":/icons/options"));
#endif
// Install event filter for up and down arrow
ui->lineEdit->installEventFilter(this);
ui->messagesWidget->installEventFilter(this);
connect(ui->clearButton, SIGNAL(clicked()), this, SLOT(clear()));
// set OpenSSL version label
ui->openSSLVersion->setText(SSLeay_version(SSLEAY_VERSION));
startExecutor();
clear();
}
RPCConsole::~RPCConsole()
{
emit stopExecutor();
delete ui;
}
bool RPCConsole::eventFilter(QObject* obj, QEvent *event)
{
if(event->type() == QEvent::KeyPress) // Special key handling
{
QKeyEvent *keyevt = static_cast<QKeyEvent*>(event);
int key = keyevt->key();
Qt::KeyboardModifiers mod = keyevt->modifiers();
switch(key)
{
case Qt::Key_Up: if(obj == ui->lineEdit) { browseHistory(-1); return true; } break;
case Qt::Key_Down: if(obj == ui->lineEdit) { browseHistory(1); return true; } break;
case Qt::Key_PageUp: /* pass paging keys to messages widget */
case Qt::Key_PageDown:
if(obj == ui->lineEdit)
{
QApplication::postEvent(ui->messagesWidget, new QKeyEvent(*keyevt));
return true;
}
break;
default:
// Typing in messages widget brings focus to line edit, and redirects key there
// Exclude most combinations and keys that emit no text, except paste shortcuts
if(obj == ui->messagesWidget && (
(!mod && !keyevt->text().isEmpty() && key != Qt::Key_Tab) ||
((mod & Qt::ControlModifier) && key == Qt::Key_V) ||
((mod & Qt::ShiftModifier) && key == Qt::Key_Insert)))
{
ui->lineEdit->setFocus();
QApplication::postEvent(ui->lineEdit, new QKeyEvent(*keyevt));
return true;
}
}
}
return QDialog::eventFilter(obj, event);
}
void RPCConsole::setClientModel(ClientModel *model)
{
this->clientModel = model;
if(model)
{
// Subscribe to information, replies, messages, errors
connect(model, SIGNAL(numConnectionsChanged(int)), this, SLOT(setNumConnections(int)));
connect(model, SIGNAL(numBlocksChanged(int,int)), this, SLOT(setNumBlocks(int,int)));
// Provide initial values
ui->clientVersion->setText(model->formatFullVersion());
ui->clientName->setText(model->clientName());
// ui->buildDate->setText(model->formatBuildDate());
ui->startupTime->setText(model->formatClientStartupTime());
setNumConnections(model->getNumConnections());
ui->isTestNet->setChecked(model->isTestNet());
setNumBlocks(model->getNumBlocks(), model->getNumBlocksOfPeers());
}
}
static QString categoryClass(int category)
{
switch(category)
{
case RPCConsole::CMD_REQUEST: return "cmd-request"; break;
case RPCConsole::CMD_REPLY: return "cmd-reply"; break;
case RPCConsole::CMD_ERROR: return "cmd-error"; break;
default: return "misc";
}
}
void RPCConsole::clear()
{
ui->messagesWidget->clear();
ui->lineEdit->clear();
ui->lineEdit->setFocus();
// Add smoothly scaled icon images.
// (when using width/height on an img, Qt uses nearest instead of linear interpolation)
for(int i=0; ICON_MAPPING[i].url; ++i)
{
ui->messagesWidget->document()->addResource(
QTextDocument::ImageResource,
QUrl(ICON_MAPPING[i].url),
QImage(ICON_MAPPING[i].source).scaled(ICON_SIZE, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
}
// Set default style sheet
ui->messagesWidget->document()->setDefaultStyleSheet(
"table { }"
"td.time { color: #808080; padding-top: 3px; } "
"td.message { font-family: Monospace; font-size: 12px; } "
"td.cmd-request { color: #00C0C0; } "
"td.cmd-error { color: red; } "
"b { color: #00C0C0; } "
);
message(CMD_REPLY, (tr("Welcome to the FailCoin RPC console.") + "<br>" +
tr("Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen.") + "<br>" +
tr("Type <b>help</b> for an overview of available commands.")), true);
}
void RPCConsole::message(int category, const QString &message, bool html)
{
QTime time = QTime::currentTime();
QString timeString = time.toString();
QString out;
out += "<table><tr><td class=\"time\" width=\"65\">" + timeString + "</td>";
out += "<td class=\"icon\" width=\"32\"><img src=\"" + categoryClass(category) + "\"></td>";
out += "<td class=\"message " + categoryClass(category) + "\" valign=\"middle\">";
if(html)
out += message;
else
out += GUIUtil::HtmlEscape(message, true);
out += "</td></tr></table>";
ui->messagesWidget->append(out);
}
void RPCConsole::setNumConnections(int count)
{
ui->numberOfConnections->setText(QString::number(count));
}
void RPCConsole::setNumBlocks(int count, int countOfPeers)
{
ui->numberOfBlocks->setText(QString::number(count));
ui->totalBlocks->setText(QString::number(countOfPeers));
if(clientModel)
{
// If there is no current number available display N/A instead of 0, which can't ever be true
ui->totalBlocks->setText(clientModel->getNumBlocksOfPeers() == 0 ? tr("N/A") : QString::number(clientModel->getNumBlocksOfPeers()));
ui->lastBlockTime->setText(clientModel->getLastBlockDate().toString());
}
}
void RPCConsole::on_lineEdit_returnPressed()
{
QString cmd = ui->lineEdit->text();
ui->lineEdit->clear();
if(!cmd.isEmpty())
{
message(CMD_REQUEST, cmd);
emit cmdRequest(cmd);
// Remove command, if already in history
history.removeOne(cmd);
// Append command to history
history.append(cmd);
// Enforce maximum history size
while(history.size() > CONSOLE_HISTORY)
history.removeFirst();
// Set pointer to end of history
historyPtr = history.size();
// Scroll console view to end
scrollToEnd();
}
}
void RPCConsole::browseHistory(int offset)
{
historyPtr += offset;
if(historyPtr < 0)
historyPtr = 0;
if(historyPtr > history.size())
historyPtr = history.size();
QString cmd;
if(historyPtr < history.size())
cmd = history.at(historyPtr);
ui->lineEdit->setText(cmd);
}
void RPCConsole::startExecutor()
{
QThread* thread = new QThread;
RPCExecutor *executor = new RPCExecutor();
executor->moveToThread(thread);
// Notify executor when thread started (in executor thread)
connect(thread, SIGNAL(started()), executor, SLOT(start()));
// Replies from executor object must go to this object
connect(executor, SIGNAL(reply(int,QString)), this, SLOT(message(int,QString)));
// Requests from this object must go to executor
connect(this, SIGNAL(cmdRequest(QString)), executor, SLOT(request(QString)));
// On stopExecutor signal
// - queue executor for deletion (in execution thread)
// - quit the Qt event loop in the execution thread
connect(this, SIGNAL(stopExecutor()), executor, SLOT(deleteLater()));
connect(this, SIGNAL(stopExecutor()), thread, SLOT(quit()));
// Queue the thread for deletion (in this thread) when it is finished
connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater()));
// Default implementation of QThread::run() simply spins up an event loop in the thread,
// which is what we want.
thread->start();
}
void RPCConsole::on_tabWidget_currentChanged(int index)
{
if(ui->tabWidget->widget(index) == ui->tab_console)
{
ui->lineEdit->setFocus();
}
}
void RPCConsole::on_openDebugLogfileButton_clicked()
{
GUIUtil::openDebugLogfile();
}
void RPCConsole::scrollToEnd()
{
QScrollBar *scrollbar = ui->messagesWidget->verticalScrollBar();
scrollbar->setValue(scrollbar->maximum());
}
void RPCConsole::on_showCLOptionsButton_clicked()
{
GUIUtil::HelpMessageBox help;
help.exec();
}
|
; A008764: Number of 3 X 3 symmetric stochastic matrices under row and column permutations.
; 1,1,2,4,6,8,12,16,21,27,34,42,52,62,74,88,103,119,138,158,180,204,230,258,289,321,356,394,434,476,522,570,621,675,732,792,856,922,992,1066,1143,1223,1308,1396,1488,1584,1684,1788,1897,2009,2126,2248,2374,2504,2640,2780,2925,3075,3230,3390,3556,3726,3902,4084,4271,4463,4662,4866,5076,5292,5514,5742,5977,6217,6464,6718,6978,7244,7518,7798,8085,8379,8680,8988,9304,9626,9956,10294,10639,10991,11352,11720,12096,12480,12872,13272,13681,14097,14522,14956
add $0,2
lpb $0
mov $2,$0
trn $0,4
seq $2,7997 ; a(n) = ceiling((n-3)(n-4)/6).
add $1,$2
lpe
mov $0,$1
|
#include <opencv2/opencv.hpp>
#include <sophus/se3.h>
#include <Eigen/Core>
#include <vector>
#include <string>
#include <boost/format.hpp>
#include <pangolin/pangolin.h>
using namespace std;
typedef vector<Eigen::Vector2d, Eigen::aligned_allocator<Eigen::Vector2d>> VecVector2d;
// Camera intrinsics
// 内参
double fx = 718.856, fy = 718.856, cx = 607.1928, cy = 185.2157;
// 基线
double baseline = 0.573;
// paths
string left_file = "./left.png";
string disparity_file = "./disparity.png";
boost::format fmt_others("./%06d.png"); // other files
// useful typedefs
typedef Eigen::Matrix<double, 6, 6> Matrix6d;
typedef Eigen::Matrix<double, 2, 6> Matrix26d;
typedef Eigen::Matrix<double, 6, 1> Vector6d;
// TODO implement this function
/**
* pose estimation using direct method
* @param img1
* @param img2
* @param px_ref
* @param depth_ref
* @param T21
*/
void DirectPoseEstimationMultiLayer(
const cv::Mat &img1,
const cv::Mat &img2,
const VecVector2d &px_ref,
const vector<double> depth_ref,
Sophus::SE3 &T21
);
// TODO implement this function
/**
* pose estimation using direct method
* @param img1
* @param img2
* @param px_ref
* @param depth_ref
* @param T21
*/
void DirectPoseEstimationSingleLayer(
const cv::Mat &img1,
const cv::Mat &img2,
const VecVector2d &px_ref,
const vector<double> depth_ref,
Sophus::SE3 &T21
);
// bilinear interpolation
inline float GetPixelValue(const cv::Mat &img, float x, float y) {
uchar *data = &img.data[int(y) * img.step + int(x)];
float xx = x - floor(x);
float yy = y - floor(y);
return float(
(1 - xx) * (1 - yy) * data[0] +
xx * (1 - yy) * data[1] +
(1 - xx) * yy * data[img.step] +
xx * yy * data[img.step + 1]
);
}
int main(int argc, char **argv) {
cv::Mat left_img = cv::imread(left_file, 0);
cv::Mat disparity_img = cv::imread(disparity_file, 0);
// let's randomly pick pixels in the first image and generate some 3d points in the first image's frame
cv::RNG rng;
int nPoints = 1000;
int boarder = 40;
VecVector2d pixels_ref;
vector<double> depth_ref;
// generate pixels in ref and load depth data
for (int i = 0; i < nPoints; i++) {
int x = rng.uniform(boarder, left_img.cols - boarder); // don't pick pixels close to boarder
int y = rng.uniform(boarder, left_img.rows - boarder); // don't pick pixels close to boarder
int disparity = disparity_img.at<uchar>(y, x);
double depth = fx * baseline / disparity; // you know this is disparity to depth
depth_ref.push_back(depth);
pixels_ref.push_back(Eigen::Vector2d(x, y));
}
// estimates 01~05.png's pose using this information
Sophus::SE3 T_cur_ref;
for (int i = 1; i < 6; i++) { // 1~10
cv::Mat img = cv::imread((fmt_others % i).str(), 0);
// DirectPoseEstimationSingleLayer(left_img, img, pixels_ref, depth_ref, T_cur_ref); // first you need to test single layer
DirectPoseEstimationMultiLayer(left_img, img, pixels_ref, depth_ref, T_cur_ref);
}
}
void DirectPoseEstimationSingleLayer(
const cv::Mat &img1,
const cv::Mat &img2,
const VecVector2d &px_ref,
const vector<double> depth_ref,
Sophus::SE3 &T21
) {
// parameters
int half_patch_size = 4;
int iterations = 100;
double cost = 0, lastCost = 0;
int nGood = 0; // good projections
VecVector2d goodProjection;
for (int iter = 0; iter < iterations; iter++) {
nGood = 0;
goodProjection.clear();
// Define Hessian and bias
Matrix6d H = Matrix6d::Zero(); // 6x6 Hessian
Vector6d b = Vector6d::Zero(); // 6x1 bias
for (size_t i = 0; i < px_ref.size(); i++) {
// compute the projection in the second image
// TODO START YOUR CODE HERE
float u =0, v = 0;
nGood++;
goodProjection.push_back(Eigen::Vector2d(u, v));
// and compute error and jacobian
for (int x = -half_patch_size; x < half_patch_size; x++)
for (int y = -half_patch_size; y < half_patch_size; y++) {
double error =0;
Matrix26d J_pixel_xi; // pixel to \xi in Lie algebra
Eigen::Vector2d J_img_pixel; // image gradients
// total jacobian
Vector6d J=0;
H += J * J.transpose();
b += -error * J;
cost += error * error;
}
// END YOUR CODE HERE
}
// solve update and put it into estimation
// TODO START YOUR CODE HERE
Vector6d update;
T21 = Sophus::SE3::exp(update) * T21;
// END YOUR CODE HERE
cost /= nGood;
if (isnan(update[0])) {
// sometimes occurred when we have a black or white patch and H is irreversible
cout << "update is nan" << endl;
break;
}
if (iter > 0 && cost > lastCost) {
cout << "cost increased: " << cost << ", " << lastCost << endl;
break;
}
lastCost = cost;
cout << "cost = " << cost << ", good = " << nGood << endl;
}
cout << "good projection: " << nGood << endl;
cout << "T21 = \n" << T21.matrix() << endl;
// in order to help you debug, we plot the projected pixels here
cv::Mat img1_show, img2_show;
cv::cvtColor(img1, img1_show, CV_GRAY2BGR);
cv::cvtColor(img2, img2_show, CV_GRAY2BGR);
for (auto &px: px_ref) {
cv::rectangle(img1_show, cv::Point2f(px[0] - 2, px[1] - 2), cv::Point2f(px[0] + 2, px[1] + 2),
cv::Scalar(0, 250, 0));
}
for (auto &px: goodProjection) {
cv::rectangle(img2_show, cv::Point2f(px[0] - 2, px[1] - 2), cv::Point2f(px[0] + 2, px[1] + 2),
cv::Scalar(0, 250, 0));
}
cv::imshow("reference", img1_show);
cv::imshow("current", img2_show);
cv::waitKey();
}
void DirectPoseEstimationMultiLayer(
const cv::Mat &img1,
const cv::Mat &img2,
const VecVector2d &px_ref,
const vector<double> depth_ref,
Sophus::SE3 &T21
) {
// parameters
int pyramids = 4;
double pyramid_scale = 0.5;
double scales[] = {1.0, 0.5, 0.25, 0.125};
// create pyramids
vector<cv::Mat> pyr1, pyr2; // image pyramids
// TODO START YOUR CODE HERE
// END YOUR CODE HERE
double fxG = fx, fyG = fy, cxG = cx, cyG = cy; // backup the old values
for (int level = pyramids - 1; level >= 0; level--) {
VecVector2d px_ref_pyr; // set the keypoints in this pyramid level
for (auto &px: px_ref) {
px_ref_pyr.push_back(scales[level] * px);
}
// TODO START YOUR CODE HERE
// scale fx, fy, cx, cy in different pyramid levels
// END YOUR CODE HERE
DirectPoseEstimationSingleLayer(pyr1[level], pyr2[level], px_ref_pyr, depth_ref, T21);
}
}
|
#include <vector>
#include <string>
#include <cmath>
#include "specex_spot_array.h"
#include "specex_message.h"
using namespace std;
vector<specex::SpotArray> specex::find_spot_arrays( vector<specex::Spot_p> &spots, bool check_status) {
vector<specex::SpotArray> spotarrays;
{
for(size_t s=0;s<spots.size();s++) {
specex::Spot_p& spot = spots[s];
if(check_status && spot->status==0) continue;
specex::SpotArray* spotarray=0;
for(size_t a=0;a<spotarrays.size();a++) {
specex::SpotArray& testarray=spotarrays[a];
if(spot->fiber_bundle == testarray.fiber_bundle &&
fabs(spot->wavelength - testarray.wavelength)<1.e-6) {
spotarray = &testarray;
break;
}
}
if(!spotarray) {
specex::SpotArray newarray;
newarray.fiber_bundle = spot->fiber_bundle;
newarray.wavelength = spot->wavelength;
spotarrays.push_back(newarray);
spotarray=&(spotarrays[spotarrays.size()-1]);
}
spotarray->push_back(spot);
}
}
return spotarrays;
}
vector<specex::SpotArray> specex::isolated_spot_arrays( vector<specex::SpotArray>& other, const double& delta_lambda) {
vector<specex::SpotArray> iarray;
for(size_t a1=0;a1<other.size();a1++) {
const double& w1=other[a1].wavelength;
bool ok=true;
for(size_t a2=0;a2<other.size();a2++) {
if(a1!=a2) {
const double& w2=other[a2].wavelength;
if(fabs(w1-w2)<delta_lambda) {
ok = false;
break;
}
}
}
if(ok) iarray.push_back(other[a1]);
}
return iarray;
}
vector<specex::SpotArray> specex::valid_spot_arrays( vector<specex::SpotArray>& other, int required_status, const double& min_valid_fraction) {
vector<specex::SpotArray> varrays;
for(size_t a=0;a<other.size();a++) {
specex::SpotArray& other_array = other[a];
specex::SpotArray array;
for(size_t s=0;s<other_array.size();s++) {
specex::Spot_p& spot=other_array[s];
if(spot->status>=required_status)
array.push_back(spot);
}
float frac=float(array.size()/other_array.size());
if(frac>=min_valid_fraction)
varrays.push_back(array);
}
return varrays;
}
specex::SpotArray specex::merge_spot_arrays( vector<specex::SpotArray>& other) {
specex::SpotArray array;
for(size_t a=0;a<other.size();a++) {
specex::SpotArray& other_array = other[a];
for(size_t s=0;s<other_array.size();s++) {
array.push_back(other_array[s]);
}
}
return array;
}
void specex::write_spots_list(vector<Spot_p> spots, const string& filename) {
ofstream osl(filename.c_str());
for(size_t s=0;s<spots.size();s++) {
Spot_p& spot = spots[s];
if(s==0) {spot->write_list_header(osl); osl << "#end" << endl; }
spot->write_list_entry(osl);
osl << endl;
}
osl.close();
SPECEX_INFO("wrote spots in " << filename);
}
void specex::write_spots_list(vector<Spot_p> spots, const PSF_p psf, const string& filename) {
ofstream osl(filename.c_str());
std::vector<std::string> pnames = psf->DefaultParamNames();
for(size_t s=0;s<spots.size();s++) {
Spot_p& spot = spots[s];
if(s==0) {
spot->write_list_header(osl);
for(size_t p=0;p<pnames.size();p++)
osl << "# " << pnames[p] << " :" << endl;
osl << "#end" << endl;
}
spot->write_list_entry(osl);
harp::vector_double params = psf->AllLocalParamsFW(spot->fiber,spot->wavelength,spot->fiber_bundle);
for(size_t p=0;p<params.size();p++)
osl << " " << params[p];
osl << endl;
}
osl.close();
SPECEX_INFO("wrote spots in " << filename);
}
|
#pragma once
#include <bnb/types/base_types.hpp>
#include "offscreen_effect_player.hpp"
namespace bnb::interfaces
{
class offscreen_render_target
{
public:
virtual ~offscreen_render_target() = default;
/**
* Offscreen Render Target initialization. Includes initialization of gl context,
* buffers, support objects.
*
* Example init()
*/
virtual void init() = 0;
/**
* Notify about rendering surface being resized.
*
* @param width New width for the rendering surface
* @param height New height for the rendering surface
*
* Example surface_changed(1280, 720)
*/
virtual void surface_changed(int32_t width, int32_t height) = 0;
/**
* Activate context for current thread
*
* Example activate_context()
*/
virtual void activate_context() = 0;
/**
* Preparing texture for effect_player
*
* Example prepare_rendering()
*/
virtual void prepare_rendering() = 0;
/**
* Orientates the image
*
* @param orient
*
* Example prepare_rendering()
*/
virtual void orient_image(orient_format orient) = 0;
/**
* Reading current buffer of active texture
*
* @return a data_t with bytes of the processed frame
*
* Example read_current_buffer()
*/
virtual bnb::data_t read_current_buffer() = 0;
/**
* In thread with active texture get CVPixelBufferRef in nv12 from Offscreen_render_target.
*
* @param a void*. void* keep CVPixelBufferRef in nv12
*
* Example get_pixel_buffer()
*/
virtual void* get_pixel_buffer() = 0;
};
} // bnb::interfaces |
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r15
push %r8
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x172bf, %rsi
lea addresses_normal_ht+0x54db, %rdi
inc %rax
mov $22, %rcx
rep movsl
dec %r12
lea addresses_A_ht+0xc27b, %rcx
clflush (%rcx)
nop
nop
nop
cmp %r8, %r8
mov $0x6162636465666768, %r12
movq %r12, %xmm4
movups %xmm4, (%rcx)
nop
xor $20436, %rsi
lea addresses_normal_ht+0x12db6, %rsi
lea addresses_WC_ht+0x80d3, %rdi
nop
xor $40759, %r10
mov $26, %rcx
rep movsq
nop
nop
nop
nop
nop
cmp $49501, %rdi
lea addresses_WC_ht+0x93d8, %r8
nop
nop
nop
nop
nop
inc %r10
movups (%r8), %xmm1
vpextrq $1, %xmm1, %rax
nop
nop
add %rax, %rax
lea addresses_normal_ht+0x193, %rsi
lea addresses_A_ht+0x1b293, %rdi
nop
inc %r15
mov $60, %rcx
rep movsl
nop
nop
dec %rsi
lea addresses_WC_ht+0x1d893, %rdi
clflush (%rdi)
nop
nop
nop
nop
add %r12, %r12
mov $0x6162636465666768, %r10
movq %r10, %xmm7
vmovups %ymm7, (%rdi)
nop
nop
xor %r12, %r12
lea addresses_UC_ht+0x2a5f, %r12
clflush (%r12)
nop
nop
nop
nop
nop
dec %r15
mov (%r12), %r8
cmp %rdi, %rdi
lea addresses_UC_ht+0xbe93, %rax
sub $27427, %rdi
movb (%rax), %cl
nop
nop
nop
xor $46531, %r12
lea addresses_normal_ht+0x19f93, %rsi
lea addresses_A_ht+0x10ef9, %rdi
clflush (%rsi)
nop
nop
nop
sub $50769, %rax
mov $20, %rcx
rep movsw
nop
inc %rcx
lea addresses_WT_ht+0x6a93, %rdi
add %r15, %r15
mov (%rdi), %rax
nop
nop
nop
nop
and $25719, %rdi
lea addresses_UC_ht+0x1b093, %rsi
nop
nop
add $60971, %rcx
movl $0x61626364, (%rsi)
nop
nop
nop
inc %rsi
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r8
pop %r15
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r14
push %r15
push %r8
push %rcx
push %rsi
// Store
lea addresses_US+0x15293, %r8
nop
nop
nop
dec %r10
mov $0x5152535455565758, %r15
movq %r15, (%r8)
nop
nop
nop
nop
nop
inc %rsi
// Faulty Load
lea addresses_US+0x15293, %r15
nop
nop
nop
nop
sub $39695, %r11
mov (%r15), %r10
lea oracles, %rcx
and $0xff, %r10
shlq $12, %r10
mov (%rcx,%r10,1), %r10
pop %rsi
pop %rcx
pop %r8
pop %r15
pop %r14
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 4, 'AVXalign': False, 'NT': True, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_US', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 3, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 6, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 8, 'same': True}, 'dst': {'type': 'addresses_A_ht', 'congruent': 10, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 1, 'AVXalign': False, 'NT': True, 'congruent': 8, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': True}, 'dst': {'type': 'addresses_A_ht', 'congruent': 1, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'58': 9639, '16': 1}
58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58
*/
|
; A058212: a(n) = 1 + floor(n*(n-3)/6).
; 1,0,0,1,1,2,4,5,7,10,12,15,19,22,26,31,35,40,46,51,57,64,70,77,85,92,100,109,117,126,136,145,155,166,176,187,199,210,222,235,247,260,274,287,301,316,330,345,361,376,392,409,425,442,460,477,495,514,532,551,571,590,610,631,651,672,694,715,737,760,782,805,829,852,876,901,925,950,976,1001,1027,1054,1080,1107,1135,1162,1190,1219,1247,1276,1306,1335,1365,1396,1426,1457,1489,1520,1552,1585,1617,1650,1684,1717,1751,1786,1820,1855,1891,1926,1962,1999,2035,2072,2110,2147,2185,2224,2262,2301,2341,2380,2420,2461,2501,2542,2584,2625,2667,2710,2752,2795,2839,2882,2926,2971,3015,3060,3106,3151,3197,3244,3290,3337,3385,3432,3480,3529,3577,3626,3676,3725,3775,3826,3876,3927,3979,4030,4082,4135,4187,4240,4294,4347,4401,4456,4510,4565,4621,4676,4732,4789,4845,4902,4960,5017,5075,5134,5192,5251,5311,5370,5430,5491,5551,5612,5674,5735,5797,5860,5922,5985,6049,6112,6176,6241,6305,6370,6436,6501,6567,6634,6700,6767,6835,6902,6970,7039,7107,7176,7246,7315,7385,7456,7526,7597,7669,7740,7812,7885,7957,8030,8104,8177,8251,8326,8400,8475,8551,8626,8702,8779,8855,8932,9010,9087,9165,9244,9322,9401,9481,9560,9640,9721,9801,9882,9964,10045,10127,10210
sub $0,1
mov $1,$0
bin $1,2
add $1,2
div $1,3
|
;/*
; * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
; *
; *
; * 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 Texas Instruments Incorporated nor the names of
; * its contributors may be used to endorse or promote products derived
; * from this software without specific prior written permission.
; *
; * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
; * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
; * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
; * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
; * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
; * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
; * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
; * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
; * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
; * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
; * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
; *
;*/
;***********************************************************
; Version 3.00.00
;***********************************************************
; Function: fir2
; Processor: C55xx
; Description: Implements finite impulse response filter using
; dual-MAC approach. C-callable.
;
; Usage: ushort oflag = fir2(DATA *x, // XAR0 // Input
; DATA *h, // XAR1 // Filter Coeffs
; DATA *r, // XAR2 // Output
; DATA *dbuffer, // XAR3 // Delay Line
; ushort nx, // T0 // Length of Input
; ushort nh) // T1 // Filter Length
;
; Limitations:
; nh >= 3
; h[] is addressible by bbus (i.e. on-chip)
;
; Notes:
; if dbuffer is in saram instead of daram, the function takes twice as many cycles.
;
; Benchmarks:
; Cycles: ((nx / 2) * (nh + 5)) + 38
; Code Size (in bytes): 120???
;
; History:
; 2.10 Rishi 08/03/2001 - optimized the code for benchmark.
; 3.00 Craig Leeds 05/27/2012 - clear SMUL on exit
;****************************************************************
.ARMS_off ;enable assembler for ARMS=0
.CPL_on ;enable assembler for CPL=1
.mmregs ;enable mem mapped register names
; Stack frame
; -----------
RET_ADDR_SZ .set 1 ;return address
REG_SAVE_SZ .set 0 ;save-on-entry registers saved
FRAME_SZ .set 0 ;local variables
ARG_BLK_SZ .set 0 ;argument block
PARAM_OFFSET .set ARG_BLK_SZ + FRAME_SZ + REG_SAVE_SZ + RET_ADDR_SZ
; Register usage
; --------------
.asg AR0, x_ptr ;linear pointer
.asg AR1, db_ptr1 ;circular pointer
.asg AR2, r_ptr ;linear pointer
.asg AR3, db_ptr2 ;circular pointer
.asg CDP, h_ptr ;circular pointer
.asg BSA01, db_base1 ;base addr for db_ptr1
.asg XAR1, xdb_base1 ;extended base addr for db_ptr1
.asg BSA23, db_base2 ;base addr for db_ptr2
.asg BK03, db_sz ;circ buffer size for db_ptr1 and db_ptr2
.asg BK03_L, db_sz_L ;for memory mapped access
.asg BSAC, h_base ;base addr for h_ptr
.asg XCDP, xh_base ;extended base addr for h_ptr
.asg BKC, h_sz ;circ buffer size for h_sz
.asg T0, oflag ;returned value
ST2mask .set 0000000100001010b ;circular/linear pointers (AR1, AR3, CDP)
.global _fir2
.text
_fir2:
;
; Allocate the local frame and argument block
;----------------------------------------------------------------
; SP = SP - #(ARG_BLK_SZ + FRAME_SZ + REG_SAVE_SZ)
; - not necessary for this function (the above is zero)
;
; Save any save-on-entry registers that are used
;----------------------------------------------------------------
; - nothing to save for this function
;
; Configure the status registers as needed.
;----------------------------------------------------------------
BCLR ARMS
BCLR SMUL
BSET FRCT
BCLR ACOV0
BCLR ACOV1
;
; Setup passed parameters in their destination registers
; Setup circular/linear CDP/ARx behavior
;----------------------------------------------------------------
; x pointer - passed in its destination register, need do nothing
; h pointer
MOV XAR1, xh_base ;extended base address for h_ptr
MOV #0, h_ptr ;point to first coefficient
MOV AR1, mmap(h_base) ;base address of coefficients
MOV T1, mmap(h_sz) ;coefficient array size
; r pointer - passed in its destination register, need do nothing
; db pointers, part 1 - must come before circ/linear ARx setup
MOV XAR3, XAR4 ;save db array address
MOV XAR4, xdb_base1 ;extended base address for db_ptr1
;xdb_base2 already setup via argument pass
MOV *AR4, db_ptr1 ;index of oldest db entry
MOV *AR4+, db_ptr2 ;index of oldest db entry
MOV AR4, mmap(db_base1) ;base address for db_ptr1
MOV AR4, mmap(db_base2) ;base address for db_ptr2
; Set circular/linear ARx behavior
OR #ST2mask, mmap(ST2_55) ;config circ/linear pointers
MOV T1, mmap(db_sz) ;db_sz = nh
ADD #1, mmap(db_sz) ;db_sz = nh+1
; db pointers, part 2 - must come after circ/linear ARx setup
AMAR *db_ptr2- ;index of 2nd oldest db entry
;
; Setup loop counts
;----------------------------------------------------------------
||SFTS T0, #-1 ;T0 = nx/2
SUB #1, T0 ;T0 = (nx/2 - 1)
MOV T0, BRC0 ;outer loop executes nx/2 times
SUB #3, T1, T0 ;T0 = nh-3
MOV T0, CSR ;inner loop executes nh-2 times
;
; Compute last iteration input pointer offsets
;----------------------------------------------------------------
ADD #1, T1, T0 ;T0 = nh+1, adjustment for db_ptr1, db_ptr2
MOV *x_ptr+, *db_ptr1 ;get 1st new input value
MOV *x_ptr+, *db_ptr2 ;get 2nd new input value (newest)
;
; Start of outer loop
;----------------------------------------------------------------
||RPTBLOCAL LoopEnd-1 ;start the outer loop
;1st iteration
MPY *db_ptr1+, *h_ptr+, AC0 ;part 1 of dual-MPY
::MPY *db_ptr2+, *h_ptr+, AC1 ;part 2 of dual-MPY
;inner loop
||RPT CSR
MAC *db_ptr1+, *h_ptr+, AC0 ;part 1 of dual-MAC
::MAC *db_ptr2+, *h_ptr+, AC1 ;part 2 of dual-MAC
;last iteration has different pointer adjustment and rounding
MACR *(db_ptr1-T0), *h_ptr+, AC0 ;part 1 of dual-MAC
::MACR *(db_ptr2-T0), *h_ptr+, AC1 ;part 2 of dual-MAC
MOV *x_ptr+, *db_ptr1 ;get 1st new input value
MOV *x_ptr+, *db_ptr2 ;get 2nd new input value (newest)
;store results to memory
MOV pair(HI(AC0)), dbl(*r_ptr+) ;store 1st Q15 result to memory
;store 2nd Q15 result to memory
LoopEnd: ;end of outer loop
;
; Update the db entry point
;----------------------------------------------------------------
MOV db_ptr1, *-AR4 ;update 1st element of db array
;
; Check if overflow occurred, and setup return value
;----------------------------------------------------------------
||MOV #0, oflag ;clear oflag
XCCPART overflow(AC0) ;clears ACOV0
||MOV #1, oflag ;overflow occurred
XCCPART overflow(AC1) ;clears ACOV1
||MOV #1, oflag ;overflow occurred
;
; Restore status regs to expected C-convention values as needed
;----------------------------------------------------------------
AND #0FE00h, mmap(ST2_55) ;clear CDPLC and AR[7-0]LC (specifically AR1LC, AR3LC, CDPLC) for C
BCLR FRCT ;clear FRCT for C
BSET ARMS ;set ARMS for C
BSET SMUL ;set SMUL for C
;
; Restore any save-on-entry registers that are used
;----------------------------------------------------------------
; - nothing to restore for this function
;
; Deallocate the local frame and argument block
;----------------------------------------------------------------
; SP = SP + #(ARG_BLK_SZ + FRAME_SZ + REG_SAVE_SZ)
; - not necessary for this function (the above is zero)
;
; Return to calling function
;----------------------------------------------------------------
||RET ;return to calling function
;----------------------------------------------------------------
;End of file
|
.macosx_version_min 10, 12
.section __TEXT,__text,regular,pure_instructions
.align 4, 0x90
.globl _F2x_degree
_F2x_degree:
pushl %esi
movl 8(%esp), %edx
movl $16777215, %ecx
andl (%edx), %ecx
movl $-1, %eax
cmpl $2, %ecx
je L00000064
L00000016:
movl -4(%edx,%ecx,4), %edx
movl %edx, %eax
shrl $16, %eax
cmpl $65535, %edx
cmovbe %edx, %eax
movl $12, %esi
movl $28, %edx
cmova %esi, %edx
cmpl $256, %eax
jb L00000042
L0000003C:
addl $-8, %edx
shrl $8, %eax
L00000042:
call L00000047
L00000047:
popl %esi
sall $5, %ecx
cmpl $16, %eax
jb L00000056
L00000050:
addl $-4, %edx
shrl $4, %eax
L00000056:
addl $-65, %ecx
subl %edx, %ecx
subl _F2x_degree_lg.__bfffo_tabshi-L00000047(%esi,%eax,4), %ecx
movl %ecx, %eax
L00000064:
popl %esi
ret
# ----------------------
.align 4, 0x90
.globl _F2x_to_ZX
_F2x_to_ZX:
pushl %ebp
pushl %ebx
pushl %edi
pushl %esi
subl $60, %esp
call L0000007C
L0000007C:
popl %ebx
movl %ebx, 56(%esp)
movl 80(%esp), %ecx
movl $16777215, %eax
andl (%ecx), %eax
movl $2, %ebp
cmpl $2, %eax
je L000000E3
L00000096:
movl 80(%esp), %ecx
movl -4(%ecx,%eax,4), %edx
movl %edx, %ecx
shrl $16, %ecx
cmpl $65535, %edx
cmovbe %edx, %ecx
movl $12, %esi
movl $28, %edx
cmova %esi, %edx
cmpl $256, %ecx
jb L000000C7
L000000C1:
addl $-8, %edx
shrl $8, %ecx
L000000C7:
sall $5, %eax
cmpl $16, %ecx
jb L000000D5
L000000CF:
addl $-4, %edx
shrl $4, %ecx
L000000D5:
addl $-62, %eax
subl %edx, %eax
subl _F2x_degree_lg.__bfffo_tabshi-L0000007C(%ebx,%ecx,4), %eax
movl %eax, %ebp
L000000E3:
movl %ebp, 36(%esp)
movl L_avma$non_lazy_ptr-L0000007C(%ebx), %esi
movl (%esi), %ecx
movl %ecx, 28(%esp)
leal 0(,%ebp,4), %eax
movl %ecx, %edx
subl %eax, %edx
movl %edx, 20(%esp)
movl L_bot$non_lazy_ptr-L0000007C(%ebx), %eax
subl (%eax), %ecx
shrl $2, %ecx
cmpl %ebp, %ecx
jae L0000011D
L00000111:
movl $14, (%esp)
call _pari_err
L0000011D:
movl 20(%esp), %eax
movl %eax, (%esi)
cmpl $16777216, %ebp
jb L00000141
L0000012B:
leal LC00009591-L0000007C(%ebx), %eax
movl %eax, 4(%esp)
movl $15, (%esp)
call _pari_err
L00000141:
movl %ebp, %eax
orl $335544320, %eax
movl 20(%esp), %ecx
movl %eax, (%ecx)
movl 80(%esp), %eax
movl (%eax), %eax
movl %eax, %ecx
andl $16777215, %ecx
cmpl $3, %ecx
jb L00000295
L00000165:
movl %ebp, %ecx
negl %ecx
movl %ecx, 32(%esp)
movl $1, %ecx
subl %ebp, %ecx
movl 28(%esp), %edx
leal (%edx,%ecx,4), %ecx
movl %ecx, 24(%esp)
movl $2, %esi
movl $2, %edi
.align 4, 0x90
L00000190:
movl %esi, %edx
subl %ebp, %edx
jge L00000280
L0000019A:
cmpl $-32, %edx
movl $-32, %eax
cmova %edx, %eax
movl %eax, 48(%esp)
movl 32(%esp), %eax
leal (%eax,%esi), %ebp
cmpl $-32, %ebp
movl $-32, %eax
cmovbe %eax, %ebp
movl %ebp, %ecx
negl %ecx
notl %ebp
xorl %eax, %eax
testb $1, %cl
movl %esi, %ecx
je L000001F1
L000001CA:
movl 80(%esp), %eax
movl (%eax,%edi,4), %eax
testb $1, %al
movl L_gen_0$non_lazy_ptr-L0000007C(%ebx), %eax
cmovne L_gen_1$non_lazy_ptr-L0000007C(%ebx), %eax
movl (%eax), %eax
movl 28(%esp), %ecx
movl %eax, (%ecx,%edx,4)
movl $1, %eax
leal 1(%esi), %ecx
L000001F1:
movl %ecx, 40(%esp)
movl %esi, 44(%esp)
testl %ebp, %ebp
movl 80(%esp), %ecx
movl %edi, %edx
je L0000026D
L00000203:
movl 48(%esp), %esi
notl %esi
movl %esi, 52(%esp)
movl %ecx, %esi
movl 24(%esp), %ecx
movl 40(%esp), %edi
leal (%ecx,%edi,4), %ebp
movl %esi, %ecx
.align 4, 0x90
L00000220:
movl (%ecx,%edx,4), %esi
btl %eax, %esi
movl L_gen_1$non_lazy_ptr-L0000007C(%ebx), %esi
movl 56(%esp), %ecx
movl L_gen_0$non_lazy_ptr-L0000007C(%ecx), %ebx
movl %ebx, %edi
cmovb %esi, %edi
movl (%edi), %edi
movl %edi, -4(%ebp)
leal 1(%eax), %edi
movl %edx, %ecx
movl 80(%esp), %edx
movl (%edx,%ecx,4), %edx
btl %edi, %edx
cmovb %esi, %ebx
movl (%ebx), %edx
movl 56(%esp), %ebx
movl %edx, (%ebp)
movl %ecx, %edx
movl 80(%esp), %ecx
addl $2, %eax
addl $8, %ebp
cmpl 52(%esp), %edi
jne L00000220
L0000026D:
movl 44(%esp), %esi
subl 48(%esp), %esi
movl (%ecx), %eax
movl 36(%esp), %ebp
movl %edx, %ecx
jmp L00000282
L0000027F:
.align 4, 0x90
L00000280:
movl %edi, %ecx
L00000282:
incl %ecx
movl %ecx, %edi
movl %eax, %edx
andl $16777215, %edx
cmpl %edx, %edi
jl L00000190
L00000295:
cmpl $2, %ebp
setg %al
movzbl %al, %eax
sall $30, %eax
movl 80(%esp), %ecx
orl 4(%ecx), %eax
movl $1, %ecx
subl %ebp, %ecx
movl 28(%esp), %edx
movl %eax, (%edx,%ecx,4)
movl 20(%esp), %eax
addl $60, %esp
popl %esi
popl %edi
popl %ebx
popl %ebp
ret
# ----------------------
.align 4, 0x90
.globl _F2xC_to_ZXC
_F2xC_to_ZXC:
pushl %ebp
pushl %ebx
pushl %edi
pushl %esi
subl $12, %esp
call L000002DC
L000002DC:
popl %eax
movl 32(%esp), %edi
movl (%edi), %ebx
andl $16777215, %ebx
movl L_avma$non_lazy_ptr-L000002DC(%eax), %ebp
movl (%ebp), %ecx
leal 0(,%ebx,4), %edx
movl %ecx, %esi
subl %edx, %esi
movl L_bot$non_lazy_ptr-L000002DC(%eax), %eax
subl (%eax), %ecx
shrl $2, %ecx
cmpl %ebx, %ecx
jae L00000318
L0000030C:
movl $14, (%esp)
call _pari_err
L00000318:
movl %esi, (%ebp)
movl %ebx, %eax
orl $603979776, %eax
movl %eax, (%esi)
cmpl $2, %ebx
jb L00000343
L00000329:
movl $1, %ebp
.align 4, 0x90
L00000330:
movl (%edi,%ebp,4), %eax
movl %eax, (%esp)
call _F2x_to_ZX
L0000033B:
movl %eax, (%esi,%ebp,4)
incl %ebp
cmpl %ebx, %ebp
jl L00000330
L00000343:
movl %esi, %eax
addl $12, %esp
popl %esi
popl %edi
popl %ebx
popl %ebp
ret
# ----------------------
.align 4, 0x90
.globl _F2x_to_Flx
_F2x_to_Flx:
pushl %ebp
pushl %ebx
pushl %edi
pushl %esi
subl $44, %esp
call L0000035C
L0000035C:
popl %esi
movl 64(%esp), %edi
movl $16777215, %eax
andl (%edi), %eax
movl $2, %ecx
cmpl $2, %eax
je L000003BB
L00000372:
movl -4(%edi,%eax,4), %edx
movl %edx, %ecx
shrl $16, %ecx
cmpl $65535, %edx
cmovbe %edx, %ecx
movl $12, %ebx
movl $28, %edx
cmova %ebx, %edx
cmpl $256, %ecx
jb L0000039F
L00000399:
addl $-8, %edx
shrl $8, %ecx
L0000039F:
sall $5, %eax
cmpl $16, %ecx
jb L000003AD
L000003A7:
addl $-4, %edx
shrl $4, %ecx
L000003AD:
addl $-62, %eax
subl %edx, %eax
subl _F2x_degree_lg.__bfffo_tabshi-L0000035C(%esi,%ecx,4), %eax
movl %eax, %ecx
L000003BB:
movl %ecx, %edx
movl L_avma$non_lazy_ptr-L0000035C(%esi), %ebx
movl (%ebx), %ecx
movl %ecx, 24(%esp)
leal 0(,%edx,4), %eax
movl %ecx, %ebp
subl %eax, %ebp
movl %ebp, 16(%esp)
movl L_bot$non_lazy_ptr-L0000035C(%esi), %eax
subl (%eax), %ecx
shrl $2, %ecx
cmpl %edx, %ecx
movl %edx, %ebp
jae L000003F5
L000003E9:
movl $14, (%esp)
call _pari_err
L000003F5:
movl 16(%esp), %eax
movl %eax, (%ebx)
movl %ebp, %ebx
movl %ebx, 32(%esp)
cmpl $16777216, %ebx
jb L0000041F
L00000409:
leal LC00009591-L0000035C(%esi), %eax
movl %eax, 4(%esp)
movl $15, (%esp)
call _pari_err
L0000041F:
movl %ebx, %eax
orl $738197504, %eax
movl 16(%esp), %ecx
movl %eax, (%ecx)
movl 4(%edi), %eax
movl $1, %ecx
subl %ebx, %ecx
movl 24(%esp), %edx
movl %eax, (%edx,%ecx,4)
movl (%edi), %eax
movl %eax, %edx
andl $16777215, %edx
cmpl $3, %edx
jb L00000523
L00000450:
movl %ebx, %edx
negl %edx
movl %edx, 28(%esp)
movl 24(%esp), %edx
leal (%edx,%ecx,4), %ecx
movl %ecx, 20(%esp)
movl $2, %esi
movl $2, %ebp
.align 4, 0x90
L00000470:
movl %esi, %edx
subl %ebx, %edx
jge L00000512
L0000047A:
cmpl $-32, %edx
movl $-32, %eax
cmova %edx, %eax
movl %eax, 36(%esp)
movl 28(%esp), %eax
leal (%eax,%esi), %ecx
cmpl $-32, %ecx
movl $-32, %eax
cmovbe %eax, %ecx
movl %ecx, %ebx
negl %ebx
notl %ecx
xorl %eax, %eax
testb $1, %bl
movl %esi, %ebx
movl %esi, 40(%esp)
je L000004C7
L000004AE:
movl (%edi,%ebp,4), %eax
andl $1, %eax
movl 24(%esp), %esi
movl %eax, (%esi,%edx,4)
movl $1, %eax
movl 40(%esp), %edx
leal 1(%edx), %ebx
L000004C7:
testl %ecx, %ecx
je L00000504
L000004CB:
movl 36(%esp), %edx
notl %edx
movl 20(%esp), %ecx
leal (%ecx,%ebx,4), %ebx
.align 4, 0x90
L000004E0:
movl (%edi,%ebp,4), %esi
movb %al, %cl
shrl %cl, %esi
andl $1, %esi
movl %esi, -4(%ebx)
leal 1(%eax), %ecx
movl (%edi,%ebp,4), %esi
shrl %cl, %esi
andl $1, %esi
movl %esi, (%ebx)
addl $2, %eax
addl $8, %ebx
cmpl %edx, %ecx
jne L000004E0
L00000504:
movl 40(%esp), %esi
subl 36(%esp), %esi
movl (%edi), %eax
movl 32(%esp), %ebx
L00000512:
incl %ebp
movl %eax, %ecx
andl $16777215, %ecx
cmpl %ecx, %ebp
jl L00000470
L00000523:
movl 16(%esp), %eax
addl $44, %esp
popl %esi
popl %edi
popl %ebx
popl %ebp
ret
# ----------------------
.align 4, 0x90
.globl _Z_to_F2x
_Z_to_F2x:
pushl %ebp
pushl %ebx
pushl %edi
pushl %esi
subl $12, %esp
call L0000053C
L0000053C:
popl %ebp
movl 36(%esp), %edi
movl 32(%esp), %eax
movl 4(%eax), %ecx
cmpl $1073741823, %ecx
jbe L0000056B
L00000550:
andl $16777215, %ecx
testb $1, -4(%eax,%ecx,4)
movl L_avma$non_lazy_ptr-L0000053C(%ebp), %edi
movl (%edi), %ebx
jne L000005A5
L00000565:
movl 36(%esp), %edi
jmp L00000573
L0000056B:
movl L_avma$non_lazy_ptr-L0000053C(%ebp), %eax
movl (%eax), %ebx
L00000573:
leal -8(%ebx), %esi
movl L_bot$non_lazy_ptr-L0000053C(%ebp), %eax
movl %ebx, %ecx
subl (%eax), %ecx
cmpl $7, %ecx
ja L00000591
L00000585:
movl $14, (%esp)
call _pari_err
L00000591:
movl L_avma$non_lazy_ptr-L0000053C(%ebp), %eax
movl %esi, (%eax)
movl $738197506, -8(%ebx)
movl %edi, -4(%ebx)
jmp L000005DC
L000005A5:
movl %ebx, %esi
addl $-12, %esi
movl L_bot$non_lazy_ptr-L0000053C(%ebp), %eax
movl %ebx, %ecx
subl (%eax), %ecx
cmpl $11, %ecx
ja L000005C5
L000005B9:
movl $14, (%esp)
call _pari_err
L000005C5:
movl %esi, (%edi)
movl $738197507, -12(%ebx)
movl 36(%esp), %eax
movl %eax, -8(%ebx)
movl $1, -4(%ebx)
L000005DC:
movl %esi, %eax
addl $12, %esp
popl %esi
popl %edi
popl %ebx
popl %ebp
ret
# ----------------------
.align 4, 0x90
.globl _ZX_to_F2x
_ZX_to_F2x:
pushl %ebp
pushl %ebx
pushl %edi
pushl %esi
subl $28, %esp
call L000005FC
L000005FC:
popl %eax
movl 48(%esp), %ecx
movl $16777215, %ebx
movl (%ecx), %esi
andl %ebx, %esi
addl $93, %esi
shrl $5, %esi
movl %esi, 20(%esp)
movl L_avma$non_lazy_ptr-L000005FC(%eax), %ecx
movl %ecx, 12(%esp)
movl (%ecx), %edx
movl %edx, 24(%esp)
leal 0(,%esi,4), %ecx
movl %edx, %edi
subl %ecx, %edi
movl %edi, 16(%esp)
movl L_bot$non_lazy_ptr-L000005FC(%eax), %eax
subl (%eax), %edx
shrl $2, %edx
cmpl %esi, %edx
jae L0000064E
L00000642:
movl $14, (%esp)
call _pari_err
L0000064E:
movl 16(%esp), %ebp
movl 12(%esp), %eax
movl %ebp, (%eax)
movl %esi, %eax
orl $738197504, %eax
movl %eax, (%ebp)
movl $1073676288, %eax
movl 48(%esp), %edi
andl 4(%edi), %eax
movl $1, %ecx
subl %esi, %ecx
movl 24(%esp), %edx
movl %eax, (%edx,%ecx,4)
andl (%edi), %ebx
cmpl $3, %ebx
movl $1, %eax
jb L000006FB
L00000688:
movl $2, %edx
movl $32, %ecx
.align 4, 0x90
L000006A0:
cmpl $32, %ecx
jne L000006B7
L000006A5:
incl %eax
movl %eax, %ecx
subl %esi, %ecx
movl 24(%esp), %ebx
movl $0, (%ebx,%ecx,4)
xorl %ecx, %ecx
L000006B7:
movl (%edi,%edx,4), %ebx
movl 4(%ebx), %ebp
cmpl $1073741824, %ebp
jb L000006EC
L000006C5:
andl $16777215, %ebp
testb $1, -4(%ebx,%ebp,4)
je L000006EC
L000006D2:
movl $1, %ebx
sall %cl, %ebx
movl %eax, %ebp
subl %esi, %ebp
movl %edi, %esi
movl 24(%esp), %edi
orl %ebx, (%edi,%ebp,4)
movl %esi, %edi
movl 20(%esp), %esi
L000006EC:
incl %edx
incl %ecx
movl (%edi), %ebx
movl $16777215, %ebp
andl %ebp, %ebx
cmpl %ebx, %edx
jl L000006A0
L000006FB:
movl %esi, 4(%esp)
movl 16(%esp), %eax
movl %eax, (%esp)
call _Flx_renormalize
L0000070B:
addl $28, %esp
popl %esi
popl %edi
popl %ebx
popl %ebp
ret
# ----------------------
.align 4, 0x90
.globl _Flx_to_F2x
_Flx_to_F2x:
pushl %ebp
pushl %ebx
pushl %edi
pushl %esi
subl $28, %esp
call L0000072C
L0000072C:
popl %eax
movl 48(%esp), %ecx
movl $16777215, %ebx
movl (%ecx), %esi
andl %ebx, %esi
addl $93, %esi
shrl $5, %esi
movl L_avma$non_lazy_ptr-L0000072C(%eax), %ecx
movl %ecx, 16(%esp)
movl (%ecx), %ebp
movl %ebp, 24(%esp)
leal 0(,%esi,4), %ecx
movl %ebp, %edi
subl %ecx, %edi
movl L_bot$non_lazy_ptr-L0000072C(%eax), %eax
subl (%eax), %ebp
shrl $2, %ebp
cmpl %esi, %ebp
jae L00000776
L0000076A:
movl $14, (%esp)
call _pari_err
L00000776:
movl %edi, 20(%esp)
movl 16(%esp), %eax
movl %edi, (%eax)
movl %esi, %eax
orl $738197504, %eax
movl %eax, (%edi)
movl 48(%esp), %edi
movl 4(%edi), %eax
movl $1, %ecx
subl %esi, %ecx
movl 24(%esp), %edx
movl %eax, (%edx,%ecx,4)
andl (%edi), %ebx
cmpl $3, %ebx
movl %edi, %ebx
movl $1, %edi
jb L0000080A
L000007AC:
movl $2, %edx
movl $32, %ecx
.align 4, 0x90
L000007C0:
cmpl $32, %ecx
jne L000007D7
L000007C5:
incl %edi
movl %edi, %ecx
subl %esi, %ecx
movl 24(%esp), %eax
movl $0, (%eax,%ecx,4)
xorl %ecx, %ecx
L000007D7:
cmpl $0, (%ebx,%edx,4)
je L000007FB
L000007DD:
movl $1, %ebx
sall %cl, %ebx
movl %edi, %eax
subl %esi, %eax
movl %edi, %ebp
movl %esi, %edi
movl 24(%esp), %esi
orl %ebx, (%esi,%eax,4)
movl %edi, %esi
movl %ebp, %edi
movl 48(%esp), %ebx
L000007FB:
incl %edx
incl %ecx
movl (%ebx), %eax
movl $16777215, %ebp
andl %ebp, %eax
cmpl %eax, %edx
jl L000007C0
L0000080A:
movl %esi, 4(%esp)
movl 20(%esp), %eax
movl %eax, (%esp)
call _Flx_renormalize
L0000081A:
addl $28, %esp
popl %esi
popl %edi
popl %ebx
popl %ebp
ret
# ----------------------
.align 4, 0x90
.globl _F2x_to_F2v
_F2x_to_F2v:
pushl %ebp
pushl %ebx
pushl %edi
pushl %esi
subl $44, %esp
call L0000083C
L0000083C:
popl %esi
movl 68(%esp), %eax
leal 95(%eax), %edx
movl %edx, 28(%esp)
shrl $5, %edx
movl %edx, 40(%esp)
movl L_avma$non_lazy_ptr-L0000083C(%esi), %edi
movl (%edi), %ebx
movl %ebx, 36(%esp)
leal 0(,%edx,4), %eax
movl %ebx, %ecx
subl %eax, %ecx
movl %ecx, 32(%esp)
movl L_bot$non_lazy_ptr-L0000083C(%esi), %eax
movl %ebx, %ecx
subl (%eax), %ecx
shrl $2, %ecx
cmpl %edx, %ecx
movl 64(%esp), %ebx
movl (%ebx), %ebp
jae L0000088D
L00000881:
movl $14, (%esp)
call _pari_err
L0000088D:
andl $16777215, %ebp
movl 32(%esp), %eax
movl %eax, (%edi)
movl %eax, %edi
cmpl $536870912, 28(%esp)
jb L000008BB
L000008A5:
leal LC00009591-L0000083C(%esi), %eax
movl %eax, 4(%esp)
movl $15, (%esp)
call _pari_err
L000008BB:
movl 40(%esp), %esi
movl %esi, %eax
orl $738197504, %eax
movl %eax, (%edi)
movl $1, %eax
subl %esi, %eax
movl 36(%esp), %ecx
movl 68(%esp), %edx
movl %edx, (%ecx,%eax,4)
movl $2, %eax
cmpl $3, %ebp
jb L00000AC0
L000008E8:
movl $3, %eax
cmova %ebp, %eax
movl $2, %ecx
cmpl $2, %eax
je L00000A19
L000008FE:
leal -2(%eax), %esi
andl $-8, %esi
orl $2, %esi
movl %esi, 24(%esp)
leal -1(%ebp), %edx
cmpl $3, %ebp
movl $2, %ecx
cmovbe %ecx, %edx
cmpl $2, %esi
je L00000A0D
L00000922:
leal (%ebx,%edx,4), %ecx
movl %ecx, 20(%esp)
movl $2, %ecx
movl $2, %edi
subl 40(%esp), %edi
movl 36(%esp), %esi
leal (%esi,%edi,4), %edi
cmpl 20(%esp), %edi
movl 32(%esp), %edi
ja L00000964
L00000948:
leal 8(%ebx), %esi
movl %esi, 20(%esp)
subl 40(%esp), %edx
movl 36(%esp), %esi
leal (%esi,%edx,4), %edx
cmpl %edx, 20(%esp)
jbe L00000A0D
L00000964:
cmpl $3, %ebp
movl $3, %ecx
cmova %ebp, %ecx
addl $-2, %ecx
andl $-8, %ecx
addl $-8, %ecx
shrl $3, %ecx
leal 1(%ecx), %edx
movl $2, %esi
testb $1, %dl
je L000009AB
L00000988:
movups 8(%ebx), %xmm0
movups 24(%ebx), %xmm1
movl $2, %edx
subl 40(%esp), %edx
movl 36(%esp), %esi
movups %xmm0, (%esi,%edx,4)
movups %xmm1, 16(%esi,%edx,4)
movl $10, %esi
L000009AB:
testl %ecx, %ecx
je L00000A09
L000009AF:
movl 40(%esp), %ecx
negl %ecx
leal 12(%esi,%ecx), %ecx
movl 36(%esp), %edx
leal (%edx,%ecx,4), %ecx
cmpl $3, %ebp
movl %esi, %edx
movl $3, %esi
cmova %ebp, %esi
addl $-2, %esi
andl $-8, %esi
orl $2, %esi
subl %edx, %esi
leal 48(%ebx,%edx,4), %edx
.align 4, 0x90
L000009E0:
movups -48(%edx), %xmm0
movups -32(%edx), %xmm1
movups %xmm0, -48(%ecx)
movups %xmm1, -32(%ecx)
movups -16(%edx), %xmm0
movups (%edx), %xmm1
movups %xmm0, -16(%ecx)
movups %xmm1, (%ecx)
addl $64, %ecx
addl $64, %edx
addl $-16, %esi
jne L000009E0
L00000A09:
movl 24(%esp), %ecx
L00000A0D:
cmpl %ecx, %eax
movl 40(%esp), %esi
je L00000AB5
L00000A19:
movl %esi, 40(%esp)
movl %edi, 32(%esp)
leal 1(%ecx), %edx
cmpl %ebp, %edx
movl %ebp, %eax
cmovge %edx, %eax
movl %eax, %esi
subl %ecx, %esi
decl %eax
subl %ecx, %eax
movl %eax, 24(%esp)
movl %esi, %eax
testb $3, %al
je L00000A6A
L00000A3C:
movl 28(%esp), %edi
shrl $3, %edi
andl $536870908, %edi
movl 36(%esp), %esi
subl %edi, %esi
cmpl %ebp, %edx
cmovl %ebp, %edx
subl %ecx, %edx
andl $3, %edx
negl %edx
.align 4, 0x90
L00000A60:
movl (%ebx,%ecx,4), %edi
movl %edi, (%esi,%ecx,4)
incl %ecx
incl %edx
jne L00000A60
L00000A6A:
cmpl $3, 24(%esp)
movl 32(%esp), %edi
movl 40(%esp), %esi
jb L00000AB5
L00000A79:
movl $3, %eax
subl %esi, %eax
movl 36(%esp), %edx
leal (%edx,%eax,4), %eax
.align 4, 0x90
L00000A90:
movl (%ebx,%ecx,4), %edx
movl %edx, -12(%eax,%ecx,4)
movl 4(%ebx,%ecx,4), %edx
movl %edx, -8(%eax,%ecx,4)
movl 8(%ebx,%ecx,4), %edx
movl %edx, -4(%eax,%ecx,4)
movl 12(%ebx,%ecx,4), %edx
movl %edx, (%eax,%ecx,4)
addl $4, %ecx
cmpl %ebp, %ecx
jl L00000A90
L00000AB5:
cmpl $3, %ebp
movl $3, %eax
cmova %ebp, %eax
L00000AC0:
movl %eax, %ecx
subl %esi, %ecx
jge L00000ADE
L00000AC6:
movl 36(%esp), %edx
leal (%edx,%ecx,4), %ecx
subl %eax, %esi
sall $2, %esi
movl %esi, 4(%esp)
movl %ecx, (%esp)
call ___bzero
L00000ADE:
movl %edi, %eax
addl $44, %esp
popl %esi
popl %edi
popl %ebx
popl %ebp
ret
# ----------------------
.align 4, 0x90
.globl _F2x_add
_F2x_add:
pushl %ebp
pushl %ebx
pushl %edi
pushl %esi
subl $76, %esp
movl 100(%esp), %eax
movl 96(%esp), %esi
movl (%esi), %ecx
movl %ecx, 48(%esp)
andl $16777215, %ecx
movl %ecx, 72(%esp)
movl (%eax), %edi
movl %edi, 52(%esp)
andl $16777215, %edi
movl %edi, 56(%esp)
cmpl %ecx, %edi
movl %eax, %edx
cmova %esi, %edx
movl %edx, 40(%esp)
cmova %eax, %esi
movl %ecx, %edx
cmova %edi, %edx
cmova %ecx, %edi
movl %edi, 60(%esp)
call L00000B3E
L00000B3E:
popl %eax
movl L_avma$non_lazy_ptr-L00000B3E(%eax), %edi
movl (%edi), %ebx
movl %ebx, 68(%esp)
leal 0(,%edx,4), %ecx
movl %ebx, %ebp
subl %ecx, %ebp
movl %ebp, 64(%esp)
movl L_bot$non_lazy_ptr-L00000B3E(%eax), %eax
subl (%eax), %ebx
shrl $2, %ebx
cmpl %edx, %ebx
movl %edx, %ebx
jae L00000B77
L00000B6B:
movl $14, (%esp)
call _pari_err
L00000B77:
movl 64(%esp), %ebp
movl %ebp, (%edi)
movl %ebx, %edi
movl %edi, %eax
orl $738197504, %eax
movl %eax, (%ebp)
movl 4(%esi), %eax
movl $1, %ecx
subl %edi, %ecx
movl 68(%esp), %edx
movl %eax, (%edx,%ecx,4)
movl $2, %ecx
movl 60(%esp), %eax
cmpl $3, %eax
movl 72(%esp), %ebx
jb L00000E50
L00000BB0:
movl 48(%esp), %ecx
orl $-16777216, %ecx
xorl $16777215, %ecx
movl 52(%esp), %ebx
orl $-16777216, %ebx
xorl $16777215, %ebx
cmpl %ebx, %ecx
movl %ebx, %edx
cmova %ecx, %edx
notl %edx
movl %edx, 36(%esp)
cmpl $3, %edx
movl $3, %ebp
cmova %edx, %ebp
movl %eax, %edx
movl $2, %eax
cmpl $2, %ebp
je L00000DA1
L00000BF8:
movl %edi, 44(%esp)
leal -2(%ebp), %edx
andl $-4, %edx
orl $2, %edx
movl 72(%esp), %edi
movl 56(%esp), %eax
cmpl %eax, %edi
cmova %edi, %eax
movl %eax, 32(%esp)
cmpl %ebx, %ecx
movl %ebx, %eax
cmova %ecx, %eax
movl %ecx, 24(%esp)
movl $-2, %edi
subl %eax, %edi
cmpl $-4, %eax
movl $2, %eax
cmovae %eax, %edi
cmpl $2, %edx
jne L00000C41
L00000C38:
movl 44(%esp), %edi
jmp L00000D95
L00000C41:
movl %edx, 16(%esp)
movl %ebp, 28(%esp)
movl $2, %ebp
movl 32(%esp), %ecx
subl %ecx, %ebp
movl %edi, %edx
subl %ecx, %edx
movl %edx, 32(%esp)
movl 68(%esp), %edx
leal (%edx,%ebp,4), %ecx
movl 32(%esp), %ebp
leal (%edx,%ebp,4), %ebp
leal (%esi,%edi,4), %edx
cmpl %edx, %ecx
leal 8(%esi), %edx
setbe 32(%esp)
cmpl %ebp, %edx
movl 40(%esp), %edx
leal (%edx,%edi,4), %edi
setbe 23(%esp)
cmpl %edi, %ecx
leal 8(%edx), %edx
setbe %cl
cmpl %ebp, %edx
setbe %ch
movb 23(%esp), %dl
testb 32(%esp), %dl
jne L00000D8D
L00000CA0:
andb %ch, %cl
movl 44(%esp), %edi
movl 28(%esp), %ebp
jne L00000D95
L00000CB0:
movl 24(%esp), %ebp
cmpl %ebp, %ebx
movl %ebp, %edx
cmova %ebx, %edx
notl %edx
cmpl $3, %edx
movl $3, %eax
cmova %edx, %eax
addl $-2, %eax
andl $-4, %eax
addl $-4, %eax
shrl $2, %eax
leal 1(%eax), %edx
movl $2, %ecx
testb $1, %dl
je L00000D09
L00000CE1:
movups 8(%esi), %xmm0
movl 40(%esp), %edx
movups 8(%edx), %xmm1
xorps %xmm0, %xmm1
movl $2, %edx
subl %edi, %edx
movl %ebp, %ecx
movl 68(%esp), %ebp
movups %xmm1, (%ebp,%edx,4)
movl %ecx, %ebp
movl $6, %ecx
L00000D09:
movl %ecx, %edx
testl %eax, %eax
jne L00000D15
L00000D0F:
movl 16(%esp), %eax
jmp L00000D91
L00000D15:
movl 56(%esp), %eax
movl 72(%esp), %ecx
cmpl %eax, %ecx
cmova %ecx, %eax
negl %eax
movl %edx, %edi
leal 4(%edi,%eax), %eax
movl 68(%esp), %edx
leal (%edx,%eax,4), %eax
cmpl %ebp, %ebx
cmova %ebx, %ebp
notl %ebp
cmpl $3, %ebp
movl $3, %ecx
cmova %ebp, %ecx
movl %edi, %ebx
leal 16(%esi,%ebx,4), %edx
addl $-2, %ecx
andl $-4, %ecx
orl $2, %ecx
subl %ebx, %ecx
movl 40(%esp), %edi
leal 16(%edi,%ebx,4), %edi
.align 4, 0x90
L00000D60:
movups -16(%edx), %xmm0
movups -16(%edi), %xmm1
xorps %xmm0, %xmm1
movups %xmm1, -16(%eax)
movups (%edx), %xmm0
movups (%edi), %xmm1
xorps %xmm0, %xmm1
movups %xmm1, (%eax)
addl $32, %eax
addl $32, %edx
addl $32, %edi
addl $-8, %ecx
jne L00000D60
L00000D89:
movl 16(%esp), %eax
L00000D8D:
movl 44(%esp), %edi
L00000D91:
movl 28(%esp), %ebp
L00000D95:
cmpl %eax, %ebp
movl 60(%esp), %edx
je L00000E3D
L00000DA1:
movl %edx, 60(%esp)
movl 48(%esp), %ecx
notl %ecx
orl $-16777216, %ecx
movl 52(%esp), %ebx
notl %ebx
orl $-16777216, %ebx
cmpl %ebx, %ecx
cmova %ecx, %ebx
notl %ebx
leal 1(%eax), %ecx
cmpl %ecx, %ebx
cmovl %ecx, %ebx
movl %ebx, %edx
subl %eax, %edx
decl %ebx
subl %eax, %ebx
movl %ebx, 52(%esp)
testb $1, %dl
je L00000DF2
L00000DDC:
movl 40(%esp), %ebx
movl (%ebx,%eax,4), %edx
xorl (%esi,%eax,4), %edx
subl %edi, %eax
movl 68(%esp), %ebp
movl %edx, (%ebp,%eax,4)
jmp L00000DF8
L00000DF2:
movl 40(%esp), %ebx
movl %eax, %ecx
L00000DF8:
cmpl $0, 52(%esp)
movl %ebx, %ebp
movl 60(%esp), %ebx
je L00000E3D
L00000E05:
movl 72(%esp), %edx
movl 56(%esp), %eax
cmpl %eax, %edx
cmova %edx, %eax
movl $1, %edx
subl %eax, %edx
movl 68(%esp), %eax
leal (%eax,%edx,4), %eax
L00000E20:
movl (%ebp,%ecx,4), %edx
xorl (%esi,%ecx,4), %edx
movl %edx, -4(%eax,%ecx,4)
movl 4(%ebp,%ecx,4), %edx
xorl 4(%esi,%ecx,4), %edx
movl %edx, (%eax,%ecx,4)
addl $2, %ecx
cmpl %ebx, %ecx
jl L00000E20
L00000E3D:
movl 36(%esp), %eax
cmpl $3, %eax
movl $3, %ecx
cmova %eax, %ecx
movl 72(%esp), %ebx
L00000E50:
cmpl %edi, %ecx
jge L00001075
L00000E58:
movl 56(%esp), %ebp
cmpl %ebp, %ebx
movl %ebp, %eax
cmova %ebx, %eax
leal -1(%eax), %edx
subl %ecx, %edx
cmpl $-1, %edx
je L00000FC9
L00000E71:
movl %edi, 44(%esp)
movl %eax, %edi
subl %ecx, %edi
movl %edi, %edx
andl $-4, %edx
movl %edx, 60(%esp)
cmpl %ebp, %ebx
movl %ebp, %edx
cmova %ebx, %edx
andl $-4, %edi
je L00000FBD
L00000E92:
leal -4(%esi,%edx,4), %edi
movl %ecx, %ebx
subl %edx, %ebx
movl 68(%esp), %ebp
leal (%ebp,%ebx,4), %edx
cmpl %edi, %edx
ja L00000EB4
L00000EA6:
leal (%esi,%ecx,4), %edx
leal -4(%ebp), %edi
cmpl %edi, %edx
jbe L00000F40
L00000EB4:
movl 72(%esp), %ebp
movl 56(%esp), %edx
cmpl %ebp, %edx
cmova %edx, %ebp
subl %ecx, %ebp
andl $-4, %ebp
addl $-4, %ebp
shrl $2, %ebp
movl %ebp, 52(%esp)
leal 1(%ebp), %edx
testb $3, %dl
movl %ecx, %ebp
je L00000F31
L00000EDA:
movl 72(%esp), %edi
movl 56(%esp), %edx
cmpl %edi, %edx
movl %edi, %ebx
cmova %edx, %ebx
subl %ecx, %ebx
andl $-4, %ebx
addl $-4, %ebx
cmpl %edx, %edi
cmova %edi, %edx
leal 0(,%edx,4), %ebp
movl 68(%esp), %edi
subl %ebp, %edi
subl %ecx, %edx
andl $12, %edx
addl $-4, %edx
shrl $2, %edx
incl %edx
andl $3, %edx
negl %edx
movl %ecx, %ebp
.align 4, 0x90
L00000F20:
movups (%esi,%ebp,4), %xmm0
movups %xmm0, (%edi,%ebp,4)
addl $4, %ebp
addl $-4, %ebx
incl %edx
jne L00000F20
L00000F31:
movl 60(%esp), %edx
addl %ecx, %edx
cmpl $3, 52(%esp)
jae L00000F4A
L00000F3E:
movl %edx, %ecx
L00000F40:
movl 44(%esp), %edi
movl 72(%esp), %ebx
jmp L00000FC1
L00000F4A:
movl %edx, 60(%esp)
movl 72(%esp), %ebx
movl 56(%esp), %edi
cmpl %edi, %ebx
movl %edi, %edx
cmova %ebx, %edx
negl %edx
movl %edx, 52(%esp)
cmpl %ebx, %edi
movl %ebx, %edx
cmova %edi, %edx
subl %ecx, %edx
andl $-4, %edx
addl %ecx, %edx
movl 52(%esp), %ecx
leal 12(%ebp,%ecx), %ecx
movl 68(%esp), %edi
leal (%edi,%ecx,4), %ecx
subl %ebp, %edx
leal 48(%esi,%ebp,4), %edi
.align 4, 0x90
L00000F90:
movups -48(%edi), %xmm0
movups %xmm0, -48(%ecx)
movups -32(%edi), %xmm0
movups %xmm0, -32(%ecx)
movups -16(%edi), %xmm0
movups %xmm0, -16(%ecx)
movups (%edi), %xmm0
movups %xmm0, (%ecx)
addl $64, %ecx
addl $64, %edi
addl $-16, %edx
jne L00000F90
L00000FB9:
movl 60(%esp), %ecx
L00000FBD:
movl 44(%esp), %edi
L00000FC1:
cmpl %ecx, %eax
je L00001075
L00000FC9:
movl %edi, 44(%esp)
movl 56(%esp), %ebp
cmpl %ebp, %ebx
movl %ebp, %eax
cmova %ebx, %eax
leal 1(%ecx), %edi
cmpl %edi, %eax
cmovl %edi, %eax
movl %eax, %edx
subl %ecx, %edx
decl %eax
subl %ecx, %eax
testb $3, %dl
je L0000102C
L00000FEC:
cmpl %ebp, %ebx
movl %edi, 60(%esp)
movl %ebp, %edi
movl %ebx, %ebp
movl %edi, %ebx
cmova %ebp, %ebx
sall $2, %ebx
movl 68(%esp), %edx
subl %ebx, %edx
cmpl %ebp, %edi
movl %ebp, %ebx
cmova %edi, %ebx
movl 60(%esp), %edi
cmpl %edi, %ebx
cmovl %edi, %ebx
subl %ecx, %ebx
andl $3, %ebx
negl %ebx
.align 4, 0x90
L00001020:
movl (%esi,%ecx,4), %edi
movl %edi, (%edx,%ecx,4)
incl %ecx
incl %ebx
jne L00001020
L0000102A:
jmp L0000102E
L0000102C:
movl %ebx, %ebp
L0000102E:
cmpl $3, %eax
movl 44(%esp), %edi
jb L00001075
L00001037:
movl 56(%esp), %edx
cmpl %edx, %ebp
cmova %ebp, %edx
movl $3, %eax
subl %edx, %eax
movl 68(%esp), %edx
leal (%edx,%eax,4), %eax
.align 4, 0x90
L00001050:
movl (%esi,%ecx,4), %edx
movl %edx, -12(%eax,%ecx,4)
movl 4(%esi,%ecx,4), %edx
movl %edx, -8(%eax,%ecx,4)
movl 8(%esi,%ecx,4), %edx
movl %edx, -4(%eax,%ecx,4)
movl 12(%esi,%ecx,4), %edx
movl %edx, (%eax,%ecx,4)
addl $4, %ecx
cmpl %edi, %ecx
jl L00001050
L00001075:
movl %edi, 4(%esp)
movl 64(%esp), %eax
movl %eax, (%esp)
call _Flx_renormalize
L00001085:
addl $76, %esp
popl %esi
popl %edi
popl %ebx
popl %ebp
ret
# ----------------------
.align 4, 0x90
.globl _F2x_1_add
_F2x_1_add:
pushl %ebp
pushl %ebx
pushl %edi
pushl %esi
subl $28, %esp
call L0000109C
L0000109C:
popl %eax
movl 48(%esp), %edi
movl (%edi), %ebx
andl $16777215, %ebx
cmpl $2, %ebx
jne L000010F3
L000010AE:
movl 4(%edi), %edi
movl L_avma$non_lazy_ptr-L0000109C(%eax), %ebp
movl (%ebp), %ebx
leal -12(%ebx), %esi
movl L_bot$non_lazy_ptr-L0000109C(%eax), %eax
movl %ebx, %ecx
subl (%eax), %ecx
cmpl $11, %ecx
ja L000010D8
L000010CC:
movl $14, (%esp)
call _pari_err
L000010D8:
movl %esi, (%ebp)
movl %esi, %ebp
movl $738197507, -12(%ebx)
movl %edi, -8(%ebx)
movl $1, -4(%ebx)
jmp L0000134C
L000010F3:
movl L_avma$non_lazy_ptr-L0000109C(%eax), %ebp
movl (%ebp), %edx
movl %edx, 24(%esp)
leal 0(,%ebx,4), %esi
movl %esi, 20(%esp)
movl %edx, %ecx
subl %esi, %ecx
movl %ecx, %esi
movl L_bot$non_lazy_ptr-L0000109C(%eax), %eax
movl %edx, %ecx
subl (%eax), %ecx
shrl $2, %ecx
cmpl %ebx, %ecx
jae L0000112E
L00001122:
movl $14, (%esp)
call _pari_err
L0000112E:
movl %esi, (%ebp)
movl %esi, %ebp
movl %ebx, %eax
orl $738197504, %eax
movl %eax, (%ebp)
movl 4(%edi), %eax
movl $1, %ecx
subl %ebx, %ecx
movl 24(%esp), %esi
movl %eax, (%esi,%ecx,4)
movl 8(%edi), %eax
xorl $1, %eax
movl $2, %ecx
subl %ebx, %ecx
movl %eax, (%esi,%ecx,4)
cmpl $4, %ebx
jb L00001335
L00001167:
movl $4, %esi
cmova %ebx, %esi
movl $3, %edx
cmpl $3, %esi
je L000012A5
L0000117D:
leal -3(%esi), %ecx
andl $-8, %ecx
orl $3, %ecx
movl %ecx, 12(%esp)
leal -1(%ebx), %eax
cmpl $4, %ebx
movl $3, %edx
cmovbe %edx, %eax
cmpl $3, %ecx
je L0000129D
L000011A1:
leal (%edi,%eax,4), %ecx
movl %ecx, 8(%esp)
movl $3, %edx
movl %ebp, 16(%esp)
movl $3, %ebp
subl %ebx, %ebp
movl %esi, %ecx
movl 24(%esp), %esi
leal (%esi,%ebp,4), %ebp
movl %ecx, %esi
cmpl 8(%esp), %ebp
movl 16(%esp), %ebp
ja L000011EB
L000011CD:
leal 12(%edi), %ecx
movl %ecx, 8(%esp)
subl %ebx, %eax
movl %esi, %ecx
movl 24(%esp), %esi
leal (%esi,%eax,4), %eax
movl %ecx, %esi
cmpl %eax, 8(%esp)
jbe L0000129D
L000011EB:
cmpl $4, %ebx
movl $4, %eax
cmova %ebx, %eax
addl $-3, %eax
andl $-8, %eax
addl $-8, %eax
shrl $3, %eax
leal 1(%eax), %ecx
movl $3, %edx
testb $1, %cl
je L00001230
L0000120F:
movups 12(%edi), %xmm0
movups 28(%edi), %xmm1
movl $3, %ecx
subl %ebx, %ecx
movl 24(%esp), %edx
movups %xmm0, (%edx,%ecx,4)
movups %xmm1, 16(%edx,%ecx,4)
movl $11, %edx
L00001230:
testl %eax, %eax
je L00001299
L00001234:
leal 12(%edx), %eax
subl %ebx, %eax
movl 24(%esp), %ecx
movl %edx, 8(%esp)
leal (%ecx,%eax,4), %edx
movl 8(%esp), %eax
leal 48(%edi,%eax,4), %ecx
cmpl $4, %ebx
movl $4, %eax
cmova %ebx, %eax
addl $-3, %eax
andl $-8, %eax
orl $3, %eax
subl 8(%esp), %eax
.align 4, 0x90
L00001270:
movups -48(%ecx), %xmm0
movups -32(%ecx), %xmm1
movups %xmm0, -48(%edx)
movups %xmm1, -32(%edx)
movups -16(%ecx), %xmm0
movups (%ecx), %xmm1
movups %xmm0, -16(%edx)
movups %xmm1, (%edx)
addl $64, %edx
addl $64, %ecx
addl $-16, %eax
jne L00001270
L00001299:
movl 12(%esp), %edx
L0000129D:
cmpl %edx, %esi
je L00001335
L000012A5:
movl %ebp, 16(%esp)
leal 1(%edx), %ecx
cmpl %ebx, %ecx
movl %ebx, %eax
cmovge %ecx, %eax
movl %eax, %esi
subl %edx, %esi
decl %eax
subl %edx, %eax
movl %eax, 12(%esp)
movl %esi, %eax
testb $3, %al
je L000012EB
L000012C4:
movl 24(%esp), %ebp
subl 20(%esp), %ebp
cmpl %ebx, %ecx
cmovl %ebx, %ecx
subl %edx, %ecx
andl $3, %ecx
negl %ecx
.align 4, 0x90
L000012E0:
movl (%edi,%edx,4), %esi
movl %esi, (%ebp,%edx,4)
incl %edx
incl %ecx
jne L000012E0
L000012EB:
cmpl $3, 12(%esp)
movl 16(%esp), %ebp
jb L00001335
L000012F6:
movl $3, %eax
subl %ebx, %eax
movl 24(%esp), %ecx
leal (%ecx,%eax,4), %eax
.align 4, 0x90
L00001310:
movl (%edi,%edx,4), %ecx
movl %ecx, -12(%eax,%edx,4)
movl 4(%edi,%edx,4), %ecx
movl %ecx, -8(%eax,%edx,4)
movl 8(%edi,%edx,4), %ecx
movl %ecx, -4(%eax,%edx,4)
movl 12(%edi,%edx,4), %ecx
movl %ecx, (%eax,%edx,4)
addl $4, %edx
cmpl %ebx, %edx
jl L00001310
L00001335:
cmpl $3, %ebx
jne L0000134C
L0000133A:
movl %ebp, (%esp)
movl $3, 4(%esp)
call _Flx_renormalize
L0000134A:
jmp L0000134E
L0000134C:
movl %ebp, %eax
L0000134E:
addl $28, %esp
popl %esi
popl %edi
popl %ebx
popl %ebp
ret
# ----------------------
.align 4, 0x90
.globl _F2x_mul
_F2x_mul:
pushl %edi
pushl %esi
subl $20, %esp
movl 36(%esp), %edx
movl 32(%esp), %esi
leal 8(%esi), %ecx
movl $16777215, %eax
movl (%esi), %edi
andl %eax, %edi
addl $-2, %edi
andl (%edx), %eax
addl $8, %edx
addl $-2, %eax
movl %eax, 4(%esp)
movl %edi, (%esp)
call _F2x_mulspec
L00001390:
movl 4(%esi), %ecx
movl %ecx, 4(%eax)
addl $20, %esp
popl %esi
popl %edi
ret
L0000139C:
.align 4, 0x90
_F2x_mulspec:
pushl %ebp
pushl %ebx
pushl %edi
pushl %esi
subl $124, %esp
movl %ecx, %esi
call L000013AE
L000013AE:
popl %ebp
movl 148(%esp), %eax
movl 144(%esp), %edi
xorl %ebx, %ebx
testl %edi, %edi
je L000013E0
L000013C3:
xorl %ecx, %ecx
.align 4, 0x90
L000013D0:
cmpl $0, (%esi)
jne L000013E4
L000013D5:
addl $4, %esi
incl %ecx
decl %edi
jne L000013D0
L000013DC:
xorl %edi, %edi
jmp L000013E4
L000013E0:
xorl %edi, %edi
xorl %ecx, %ecx
L000013E4:
testl %eax, %eax
je L000013FC
L000013E8:
.align 4, 0x90
L000013F0:
cmpl $0, (%edx)
jne L00001402
L000013F5:
addl $4, %edx
incl %ecx
decl %eax
jne L000013F0
L000013FC:
movl %ebp, 112(%esp)
jmp L00001408
L00001402:
movl %ebp, 112(%esp)
movl %eax, %ebx
L00001408:
movl %ebx, 120(%esp)
cmpl %ebx, %edi
movl %ebx, %eax
movl %eax, %ebp
cmovle %edi, %ebp
movl %edi, %ebx
cmovl %eax, %ebx
movl %edx, %eax
cmovl %esi, %eax
movl %eax, 108(%esp)
cmovl %edx, %esi
movl 112(%esp), %eax
movl L_avma$non_lazy_ptr-L000013AE(%eax), %edx
movl (%edx), %eax
testl %ebp, %ebp
je L0000150E
L0000143A:
movl %eax, 96(%esp)
cmpl $1, %ebx
jg L0000154F
L00001447:
movl %edx, 100(%esp)
movl %ecx, 92(%esp)
movl (%esi), %esi
movl 108(%esp), %eax
movl (%eax), %ebp
movl %esi, %eax
shrl $16, %eax
movl %eax, 120(%esp)
movzwl %bp, %edx
shrl $16, %ebp
xorl %eax, %eax
andl $65535, %esi
movl $0, 116(%esp)
movl $0, %edi
je L000014BD
L0000147D:
xorl %ecx, %ecx
xorl %edi, %edi
movl $0, 116(%esp)
.align 4, 0x90
L00001490:
btl %ecx, %esi
jae L000014A3
L00001495:
movl %edx, %ebx
sall %cl, %ebx
xorl %ebx, 116(%esp)
movl %ebp, %ebx
sall %cl, %ebx
xorl %ebx, %edi
L000014A3:
incl %ecx
btl %ecx, %esi
jae L000014B7
L000014A9:
movl %edx, %ebx
sall %cl, %ebx
xorl %ebx, 116(%esp)
movl %ebp, %ebx
sall %cl, %ebx
xorl %ebx, %edi
L000014B7:
incl %ecx
cmpl $16, %ecx
jne L00001490
L000014BD:
cmpl $0, 120(%esp)
je L000018A4
L000014C8:
xorl %esi, %esi
.align 4, 0x90
L000014D0:
movl 120(%esp), %ecx
btl %eax, %ecx
jae L000014E9
L000014D9:
movl %ebp, %ebx
movb %al, %cl
sall %cl, %ebx
xorl %ebx, %esi
movl %edx, %ebx
movb %al, %cl
sall %cl, %ebx
xorl %ebx, %edi
L000014E9:
incl %eax
movl 120(%esp), %ecx
btl %eax, %ecx
jae L00001503
L000014F3:
movl %ebp, %ebx
movb %al, %cl
sall %cl, %ebx
xorl %ebx, %esi
movl %edx, %ebx
movb %al, %cl
sall %cl, %ebx
xorl %ebx, %edi
L00001503:
incl %eax
cmpl $16, %eax
jne L000014D0
L00001509:
jmp L000018A6
L0000150E:
leal -8(%eax), %esi
movl 112(%esp), %ecx
movl L_bot$non_lazy_ptr-L000013AE(%ecx), %edi
movl %eax, %ecx
subl (%edi), %ecx
cmpl $7, %ecx
ja L00001538
L00001524:
movl $14, (%esp)
movl %eax, %edi
movl %edx, %ebx
call _pari_err
L00001534:
movl %ebx, %edx
movl %edi, %eax
L00001538:
movl %esi, (%edx)
movl $738197506, -8(%eax)
movl $0, -4(%eax)
movl %esi, %eax
jmp L000024DC
L0000154F:
movl %edx, 100(%esp)
movl %ebx, %edx
sarl $1, %edx
movl %edx, 116(%esp)
subl %edx, %ebx
movl %ebx, 80(%esp)
leal (%esi,%ebx,4), %eax
movl %eax, 104(%esp)
movl 120(%esp), %ebx
cmpl %ebx, %edi
movl %edi, %eax
movl %edi, 88(%esp)
cmovl %ebx, %eax
incl %eax
subl %edx, %eax
.align 4, 0x90
L00001580:
xorl %edi, %edi
cmpl $1, %eax
je L00001593
L00001587:
cmpl $0, -8(%esi,%eax,4)
leal -1(%eax), %eax
movl %eax, %edi
je L00001580
L00001593:
movl %ebp, %eax
movl 80(%esp), %ebx
subl %ebx, %eax
movl 108(%esp), %edx
jle L0000186F
L000015A5:
movl %eax, 68(%esp)
movl %ecx, 92(%esp)
leal (%edx,%ebx,4), %eax
movl %eax, 84(%esp)
movl 88(%esp), %ebx
movl 120(%esp), %ecx
cmpl %ecx, %ebx
movl %ebx, %eax
cmovl %ecx, %eax
incl %eax
movl 116(%esp), %ebp
subl %ebp, %eax
.align 4, 0x90
L000015D0:
xorl %ebx, %ebx
cmpl $1, %eax
je L000015E3
L000015D7:
cmpl $0, -8(%edx,%eax,4)
leal -1(%eax), %eax
movl %eax, %ebx
je L000015D0
L000015E3:
movl %ebx, 4(%esp)
movl %edi, (%esp)
movl %esi, %ecx
call _F2x_mulspec
L000015F1:
movl %eax, 52(%esp)
movl 68(%esp), %eax
movl %eax, 4(%esp)
movl %ebp, (%esp)
movl 104(%esp), %ebp
movl %ebp, %ecx
movl 84(%esp), %edx
call _F2x_mulspec
L0000160F:
movl %eax, 48(%esp)
movl 116(%esp), %eax
cmpl %eax, %edi
movl %edi, %ecx
cmovg %eax, %ecx
movl %ecx, 36(%esp)
cmovge %edi, %eax
movl %esi, %ecx
cmovg %ebp, %ecx
movl %ecx, 32(%esp)
cmovg %esi, %ebp
movl %ebp, 104(%esp)
movl %eax, %ebp
movl 100(%esp), %eax
movl (%eax), %esi
movl %esi, 56(%esp)
movl $-2, %ecx
subl %ebp, %ecx
movl %ecx, 64(%esp)
movl 112(%esp), %eax
movl L_bot$non_lazy_ptr-L000013AE(%eax), %edx
movl %edx, 44(%esp)
movl %esi, %eax
subl (%edx), %eax
shrl $2, %eax
leal 2(%ebp), %edx
cmpl %edx, %eax
leal (%esi,%ecx,4), %esi
jae L0000168B
L0000166B:
movl $14, (%esp)
movl %ebp, 72(%esp)
movl %edx, %ebp
movl %esi, 60(%esp)
call _pari_err
L00001681:
movl 60(%esp), %esi
movl %ebp, %edx
movl 72(%esp), %ebp
L0000168B:
movl 100(%esp), %ecx
movl %esi, (%ecx)
cmpl $16777216, %edx
movl 104(%esp), %ecx
jb L000016C7
L0000169D:
movl 112(%esp), %eax
leal LC00009591-L000013AE(%eax), %eax
movl %eax, 4(%esp)
movl $15, (%esp)
movl %ebp, 72(%esp)
movl %edx, %ebp
call _pari_err
L000016BD:
movl %ebp, %edx
movl 104(%esp), %ecx
movl 72(%esp), %ebp
L000016C7:
movl %edx, 40(%esp)
movl %edx, %eax
orl $738197504, %eax
movl %eax, (%esi)
movl %esi, 60(%esp)
xorl %eax, %eax
cmpl $0, 36(%esp)
jle L00001A08
L000016E5:
movl %ebp, 72(%esp)
movl %ecx, 104(%esp)
movl %ebx, 76(%esp)
movl %edi, %ebp
notl %ebp
movl 116(%esp), %esi
notl %esi
cmpl %esi, %ebp
movl %esi, %eax
cmovge %ebp, %eax
movl 64(%esp), %ecx
addl $2, %ecx
xorl %ebx, %ebx
cmpl $-1, %eax
je L00001955
L00001714:
movl %ecx, 64(%esp)
movl %eax, %ebx
notl %ebx
movl %ebx, 28(%esp)
movl 116(%esp), %ecx
cmpl %ecx, %edi
movl %ecx, %edx
cmovge %edi, %edx
cmpl %esi, %ebp
movl %esi, %ecx
cmovge %ebp, %ecx
andl $-4, %ebx
je L00001935
L0000173B:
movl %ebx, 16(%esp)
movl %esi, 36(%esp)
movl %ebp, 24(%esp)
leal 0(,%edx,4), %ebp
movl 56(%esp), %ebx
movl %ebx, %esi
subl %ebp, %esi
movl $-2, %ebp
subl %edx, %ebp
movl $-2, %edx
subl %ecx, %ebp
subl %ecx, %edx
leal (%ebx,%ebp,4), %ebp
movl 32(%esp), %ecx
leal (%ecx,%edx,4), %ebx
movl %ebx, 20(%esp)
movl 104(%esp), %ebx
leal (%ebx,%edx,4), %edx
cmpl %edx, %esi
setbe %dh
cmpl %ebp, %ebx
setbe %dl
cmpl 20(%esp), %esi
setbe %bl
cmpl %ebp, %ecx
setbe %ch
testb %dl, %dh
jne L0000193D
L00001799:
andb %ch, %bl
movl 64(%esp), %ecx
movl 24(%esp), %ebp
movl 36(%esp), %esi
movl $0, %ebx
jne L0000194B
L000017B2:
cmpl %esi, %ebp
movl %esi, %edx
cmovge %ebp, %edx
notl %edx
andl $-4, %edx
addl $-4, %edx
shrl $2, %edx
leal 1(%edx), %ecx
xorl %ebx, %ebx
testb $1, %cl
movl 104(%esp), %esi
je L000017F0
L000017D2:
movups (%esi), %xmm0
movl 32(%esp), %ecx
movups (%ecx), %xmm1
xorps %xmm0, %xmm1
movl 56(%esp), %ecx
movl 64(%esp), %ebx
movups %xmm1, (%ecx,%ebx,4)
movl $4, %ebx
L000017F0:
testl %edx, %edx
je L0000185A
L000017F4:
movl 116(%esp), %ecx
cmpl %ecx, %edi
cmovge %edi, %ecx
negl %ecx
leal 4(%ebx,%ecx), %ecx
movl 56(%esp), %edx
leal (%edx,%ecx,4), %ebp
leal 16(%esi,%ebx,4), %esi
movl 24(%esp), %ecx
movl 36(%esp), %edx
cmpl %edx, %ecx
cmovge %ecx, %edx
notl %edx
andl $-4, %edx
subl %ebx, %edx
movl 32(%esp), %ecx
leal 16(%ecx,%ebx,4), %ecx
.align 4, 0x90
L00001830:
movups -16(%esi), %xmm0
movups -16(%ecx), %xmm1
xorps %xmm0, %xmm1
movups %xmm1, -16(%ebp)
movups (%esi), %xmm0
movups (%ecx), %xmm1
xorps %xmm0, %xmm1
movups %xmm1, (%ebp)
addl $32, %ebp
addl $32, %esi
addl $32, %ecx
addl $-8, %edx
jne L00001830
L0000185A:
movl 16(%esp), %ebx
movl 24(%esp), %ebp
movl 36(%esp), %esi
movl 64(%esp), %ecx
jmp L0000194B
L0000186F:
movl %ecx, 92(%esp)
movl %ebp, 4(%esp)
movl %edi, (%esp)
movl %esi, %ecx
movl %edx, %edi
call _F2x_mulspec
L00001883:
movl %eax, %esi
movl %ebp, 4(%esp)
movl 116(%esp), %eax
movl %eax, (%esp)
movl 104(%esp), %ecx
movl %edi, %edx
call _F2x_mulspec
L0000189B:
movl %eax, %ecx
movl %ebx, %eax
jmp L000024C0
L000018A4:
xorl %esi, %esi
L000018A6:
movl %edi, %eax
sall $16, %eax
xorl 116(%esp), %eax
movl %eax, 120(%esp)
shrl $16, %edi
cmpl %edi, %esi
setne %al
movzbl %al, %ebp
leal 12(,%ebp,4), %eax
movl 96(%esp), %ecx
movl %ecx, %ebx
subl %eax, %ebx
movl 112(%esp), %eax
movl L_bot$non_lazy_ptr-L000013AE(%eax), %eax
movl %ecx, %edx
subl (%eax), %edx
addl $3, %ebp
shrl $2, %edx
cmpl %ebp, %edx
jae L000018F5
L000018E5:
movl $14, (%esp)
call _pari_err
L000018F1:
movl 96(%esp), %ecx
L000018F5:
movl 100(%esp), %eax
movl %ebx, (%eax)
movl %ebp, %eax
orl $738197504, %eax
movl %eax, (%ebx)
movl $2, %eax
subl %ebp, %eax
movl 120(%esp), %edx
movl %edx, (%ecx,%eax,4)
cmpl %edi, %esi
je L00001922
L00001916:
xorl %edi, %esi
movl $3, %eax
subl %ebp, %eax
movl %esi, (%ecx,%eax,4)
L00001922:
movl 92(%esp), %eax
movl %eax, (%esp)
movl %ebx, %edx
call _F2x_shiftip
L00001930:
jmp L000024DC
L00001935:
movl 64(%esp), %ecx
xorl %ebx, %ebx
jmp L0000194B
L0000193D:
movl 64(%esp), %ecx
movl 24(%esp), %ebp
movl 36(%esp), %esi
xorl %ebx, %ebx
L0000194B:
cmpl 28(%esp), %ebx
je L000019FE
L00001955:
movl %ecx, 64(%esp)
movl %esi, 36(%esp)
movl %ebx, %edx
notl %edx
cmpl %esi, %ebp
cmovge %ebp, %esi
subl %esi, %edx
movl $-2, %ecx
subl %ebx, %ecx
subl %esi, %ecx
testb $1, %dl
je L000019A4
L00001976:
movl 32(%esp), %edx
movl (%edx,%ebx,4), %edx
movl 104(%esp), %esi
xorl (%esi,%ebx,4), %edx
movl %edx, 28(%esp)
addl %ebx, 64(%esp)
movl 56(%esp), %esi
movl 28(%esp), %edx
movl %ecx, 20(%esp)
movl 64(%esp), %ecx
movl %edx, (%esi,%ecx,4)
movl 20(%esp), %ecx
incl %ebx
L000019A4:
testl %ecx, %ecx
movl 36(%esp), %esi
je L000019FE
L000019AC:
movl 116(%esp), %ecx
cmpl %ecx, %edi
cmovge %edi, %ecx
negl %ecx
cmpl %esi, %ebp
cmovge %ebp, %esi
movl %ebx, %ebp
movl %ebp, %edx
notl %edx
subl %esi, %edx
leal 1(%ebp,%ecx), %ecx
movl 56(%esp), %esi
leal (%esi,%ecx,4), %ecx
movl 32(%esp), %esi
leal 4(%esi,%ebp,4), %esi
movl 104(%esp), %ebx
leal 4(%ebx,%ebp,4), %ebp
.align 4, 0x90
L000019E0:
movl -4(%esi), %ebx
xorl -4(%ebp), %ebx
movl %ebx, -4(%ecx)
movl (%esi), %ebx
xorl (%ebp), %ebx
movl %ebx, (%ecx)
addl $8, %ecx
addl $8, %esi
addl $8, %ebp
addl $-2, %edx
jne L000019E0
L000019FE:
notl %eax
movl 76(%esp), %ebx
movl 72(%esp), %ebp
L00001A08:
cmpl %ebp, %eax
jge L00001C35
L00001A10:
movl %ebp, 72(%esp)
movl 116(%esp), %ebp
cmpl %ebp, %edi
movl %ebp, %esi
cmovge %edi, %esi
leal -1(%esi), %ecx
subl %eax, %ecx
cmpl $-1, %ecx
je L00001A7C
L00001A29:
movl %esi, %edx
subl %eax, %edx
movl %edx, %ecx
andl $-4, %ecx
movl %ecx, 36(%esp)
cmpl %ebp, %edi
cmovge %edi, %ebp
andl $-4, %edx
je L00001A85
L00001A40:
movl %esi, 32(%esp)
movl 104(%esp), %edx
leal -4(%edx,%ebp,4), %esi
movl %esi, 64(%esp)
movl %eax, %esi
subl %ebp, %esi
movl 56(%esp), %ebp
leal (%ebp,%esi,4), %ecx
movl %ebp, %esi
movl %edx, %ebp
cmpl 64(%esp), %ecx
ja L00001A8E
L00001A66:
leal (%ebp,%eax,4), %ecx
leal -4(%esi), %edx
cmpl %edx, %ecx
ja L00001A8E
L00001A71:
movl 32(%esp), %esi
movl %ebp, %ecx
jmp L00001B75
L00001A7C:
movl 104(%esp), %ecx
jmp L00001B7D
L00001A85:
movl 104(%esp), %ecx
jmp L00001B75
L00001A8E:
movl 116(%esp), %ecx
cmpl %ecx, %edi
cmovge %edi, %ecx
subl %eax, %ecx
andl $-4, %ecx
addl $-4, %ecx
shrl $2, %ecx
movl %ecx, 28(%esp)
leal 1(%ecx), %ecx
testb $3, %cl
movl %eax, %ebp
je L00001AF9
L00001AB0:
movl 116(%esp), %ecx
cmpl %ecx, %edi
movl %ecx, %edx
cmovge %edi, %edx
movl %edx, %ecx
subl %eax, %ecx
andl $-4, %ecx
addl $-4, %ecx
sall $2, %edx
movl 56(%esp), %esi
subl %edx, %esi
movl %esi, 64(%esp)
movl %ecx, %edx
shrl $2, %edx
incl %edx
andl $3, %edx
negl %edx
movl %eax, %ebp
.align 4, 0x90
L00001AE0:
movl 104(%esp), %esi
movups (%esi,%ebp,4), %xmm0
movl 64(%esp), %esi
movups %xmm0, (%esi,%ebp,4)
addl $4, %ebp
addl $-4, %ecx
incl %edx
jne L00001AE0
L00001AF9:
movl 36(%esp), %ecx
addl %eax, %ecx
cmpl $3, 28(%esp)
jae L00001B0A
L00001B06:
movl %ecx, %eax
jmp L00001B6D
L00001B0A:
movl %ecx, 36(%esp)
leal 12(%ebp), %ecx
movl 116(%esp), %edx
cmpl %edx, %edi
cmovge %edi, %edx
subl %edx, %ecx
subl %eax, %edx
andl $-4, %edx
addl %eax, %edx
movl 56(%esp), %eax
leal (%eax,%ecx,4), %eax
subl %ebp, %edx
movl 104(%esp), %ecx
leal 48(%ecx,%ebp,4), %ecx
.align 4, 0x90
L00001B40:
movups -48(%ecx), %xmm0
movups %xmm0, -48(%eax)
movups -32(%ecx), %xmm0
movups %xmm0, -32(%eax)
movups -16(%ecx), %xmm0
movups %xmm0, -16(%eax)
movups (%ecx), %xmm0
movups %xmm0, (%eax)
addl $64, %eax
addl $64, %ecx
addl $-16, %edx
jne L00001B40
L00001B69:
movl 36(%esp), %eax
L00001B6D:
movl 104(%esp), %ecx
movl 32(%esp), %esi
L00001B75:
cmpl %eax, %esi
je L00001C35
L00001B7D:
movl %ecx, 104(%esp)
movl 116(%esp), %ecx
cmpl %ecx, %edi
movl %ecx, %esi
cmovge %edi, %esi
leal 1(%eax), %ebp
cmpl %ebp, %esi
cmovl %ebp, %esi
movl %esi, %edx
subl %eax, %edx
decl %esi
subl %eax, %esi
movl %esi, 64(%esp)
testb $3, %dl
je L00001BDC
L00001BA4:
cmpl %ecx, %edi
movl %ecx, %edx
cmovge %edi, %edx
leal 0(,%edx,4), %ecx
movl 56(%esp), %esi
subl %ecx, %esi
cmpl %ebp, %edx
cmovl %ebp, %edx
subl %eax, %edx
andl $3, %edx
negl %edx
movl 104(%esp), %ecx
.align 4, 0x90
L00001BD0:
movl (%ecx,%eax,4), %ebp
movl %ebp, (%esi,%eax,4)
incl %eax
incl %edx
jne L00001BD0
L00001BDA:
jmp L00001BE0
L00001BDC:
movl 104(%esp), %ecx
L00001BE0:
cmpl $3, 64(%esp)
movl %ecx, %esi
movl 72(%esp), %ebp
jb L00001C35
L00001BED:
movl 116(%esp), %ecx
cmpl %ecx, %edi
cmovl %ecx, %edi
movl $3, %ecx
subl %edi, %ecx
movl 56(%esp), %edx
leal (%edx,%ecx,4), %ecx
.align 4, 0x90
L00001C10:
movl (%esi,%eax,4), %edx
movl %edx, -12(%ecx,%eax,4)
movl 4(%esi,%eax,4), %edx
movl %edx, -8(%ecx,%eax,4)
movl 8(%esi,%eax,4), %edx
movl %edx, -4(%ecx,%eax,4)
movl 12(%esi,%eax,4), %edx
movl %edx, (%ecx,%eax,4)
addl $4, %eax
cmpl %ebp, %eax
jl L00001C10
L00001C35:
movl 40(%esp), %eax
movl %eax, 4(%esp)
movl 60(%esp), %eax
movl %eax, (%esp)
call _Flx_renormalize
L00001C49:
movl %eax, 60(%esp)
movl 68(%esp), %eax
cmpl %eax, %ebx
movl %ebx, %ecx
cmovg %eax, %ecx
movl %ecx, 56(%esp)
movl %eax, %ebp
cmovge %ebx, %ebp
movl 108(%esp), %eax
movl %eax, %ecx
movl 84(%esp), %edi
cmovg %edi, %ecx
movl %ecx, 40(%esp)
cmovg %eax, %edi
movl 100(%esp), %eax
movl (%eax), %ecx
movl %ecx, 64(%esp)
movl %ecx, %eax
movl 44(%esp), %edx
subl (%edx), %eax
movl $-2, %esi
subl %ebp, %esi
movl %esi, 44(%esp)
shrl $2, %eax
leal 2(%ebp), %edx
cmpl %edx, %eax
leal (%ecx,%esi,4), %eax
movl 100(%esp), %ecx
jae L00001CC7
L00001CA3:
movl $14, (%esp)
movl %ebp, 104(%esp)
movl %edx, %ebp
movl %eax, 72(%esp)
call _pari_err
L00001CB9:
movl 72(%esp), %eax
movl %ebp, %edx
movl 100(%esp), %ecx
movl 104(%esp), %ebp
L00001CC7:
movl %edi, 84(%esp)
movl %eax, (%ecx)
cmpl $16777216, %edx
movl 88(%esp), %esi
movl %eax, %edi
jb L00001CFD
L00001CDB:
movl 112(%esp), %eax
leal LC00009591-L000013AE(%eax), %eax
movl %eax, 4(%esp)
movl $15, (%esp)
movl %edx, 108(%esp)
call _pari_err
L00001CF9:
movl 108(%esp), %edx
L00001CFD:
movl %edx, 108(%esp)
movl %edx, %eax
orl $738197504, %eax
movl %eax, (%edi)
movl %edi, 72(%esp)
xorl %eax, %eax
cmpl $0, 56(%esp)
movl 120(%esp), %edi
jle L0000208F
L00001D1F:
movl %ebp, 104(%esp)
movl %ebx, %eax
movl %ebx, 76(%esp)
notl %ebx
movl 68(%esp), %eax
notl %eax
cmpl %eax, %ebx
cmovge %ebx, %eax
addl $2, 44(%esp)
cmpl %edi, %esi
movl %esi, %ecx
cmovl %edi, %ecx
notl %esi
movl %edi, %ebp
movl %esi, %edi
notl %ebp
cmpl %ebp, %edi
movl %ebp, %edx
cmovge %edi, %edx
addl %ecx, %edx
subl 116(%esp), %edx
cmpl %ebx, %edx
cmovl %ebx, %edx
xorl %ecx, %ecx
cmpl $-1, %edx
je L00001F82
L00001D67:
notl %edx
movl %edx, 56(%esp)
movl %ebx, 68(%esp)
movl 116(%esp), %ecx
leal -1(%ecx), %ebx
movl %ebx, 28(%esp)
movl 88(%esp), %ecx
movl 120(%esp), %esi
cmpl %esi, %ecx
movl %edi, %edx
movl %edx, 100(%esp)
movl %ecx, %edi
cmovl %esi, %edi
movl %ebx, %esi
subl %edi, %esi
cmpl %ebp, %edx
movl %ebp, %ecx
movl %ebp, 112(%esp)
cmovge %edx, %ecx
movl 56(%esp), %edx
subl %ecx, %esi
movl 76(%esp), %ebp
cmpl %esi, %ebp
cmovge %ebp, %esi
addl %edi, %ecx
subl 116(%esp), %ecx
movl 68(%esp), %ebx
cmpl %ebx, %ecx
cmovl %ebx, %ecx
movl %edx, %ebp
andl $-4, %ebp
je L00001EAB
L00001DC9:
leal 0(,%esi,4), %edi
movl 64(%esp), %edx
movl %edx, %ebx
subl %edi, %ebx
movl $-2, %edi
subl %esi, %edi
movl $-2, %esi
subl %ecx, %edi
subl %ecx, %esi
leal (%edx,%edi,4), %edx
movl 40(%esp), %edi
leal (%edi,%esi,4), %ecx
movl %ecx, 32(%esp)
movl 84(%esp), %ecx
leal (%ecx,%esi,4), %esi
cmpl %esi, %ebx
setbe 36(%esp)
cmpl %edx, %ecx
setbe %ch
cmpl 32(%esp), %ebx
setbe %cl
cmpl %edx, %edi
setbe %bl
testb 36(%esp), %ch
jne L00001EB2
L00001E1F:
andb %bl, %cl
movl 68(%esp), %ebx
movl $0, %ecx
movl 56(%esp), %edx
jne L00001F72
L00001E34:
movl %ebp, 36(%esp)
movl 88(%esp), %edi
movl 120(%esp), %ecx
cmpl %edi, %ecx
movl %edi, %esi
cmovge %ecx, %esi
movl 112(%esp), %ebp
movl 100(%esp), %ecx
cmpl %ecx, %ebp
cmovge %ebp, %ecx
addl %esi, %ecx
subl 116(%esp), %ecx
cmpl %ebx, %ecx
cmovl %ebx, %ecx
notl %ecx
andl $-4, %ecx
addl $-4, %ecx
shrl $2, %ecx
leal 1(%ecx), %ebx
xorl %esi, %esi
testb $1, %bl
je L00001E96
L00001E74:
movl 84(%esp), %esi
movups (%esi), %xmm0
movl 40(%esp), %esi
movups (%esi), %xmm1
xorps %xmm0, %xmm1
movl 64(%esp), %esi
movl 44(%esp), %ebx
movups %xmm1, (%esi,%ebx,4)
movl $4, %esi
L00001E96:
movl %esi, 32(%esp)
testl %ecx, %ecx
jne L00001EBD
L00001E9E:
movl 36(%esp), %ecx
movl 68(%esp), %ebx
jmp L00001F72
L00001EAB:
xorl %ecx, %ecx
jmp L00001F72
L00001EB2:
movl 68(%esp), %ebx
xorl %ecx, %ecx
jmp L00001F6E
L00001EBD:
movl 120(%esp), %esi
cmpl %esi, %edi
movl %edi, %ecx
cmovl %esi, %ecx
movl 28(%esp), %ebx
subl %ecx, %ebx
movl 100(%esp), %edx
cmpl %ebp, %edx
movl %ebp, %ecx
cmovge %edx, %ecx
subl %ecx, %ebx
movl 76(%esp), %ecx
cmpl %ebx, %ecx
cmovge %ecx, %ebx
negl %ebx
movl 32(%esp), %ecx
leal 4(%ecx,%ebx), %ecx
movl 64(%esp), %ebx
leal (%ebx,%ecx,4), %ebp
cmpl %edi, %esi
movl %edi, %ecx
cmovge %esi, %ecx
movl 112(%esp), %edi
cmpl %edx, %edi
movl %edx, %esi
cmovge %edi, %esi
addl %ecx, %esi
movl 84(%esp), %ecx
movl 32(%esp), %edx
leal 16(%ecx,%edx,4), %ecx
subl 116(%esp), %esi
movl 68(%esp), %ebx
cmpl %ebx, %esi
cmovl %ebx, %esi
notl %esi
andl $-4, %esi
subl %edx, %esi
movl 40(%esp), %edi
leal 16(%edi,%edx,4), %edi
.align 4, 0x90
L00001F40:
movups -16(%ecx), %xmm0
movups -16(%edi), %xmm1
xorps %xmm0, %xmm1
movups %xmm1, -16(%ebp)
movups (%ecx), %xmm0
movups (%edi), %xmm1
xorps %xmm0, %xmm1
movups %xmm1, (%ebp)
addl $32, %ebp
addl $32, %ecx
addl $32, %edi
addl $-8, %esi
jne L00001F40
L00001F6A:
movl 36(%esp), %ecx
L00001F6E:
movl 56(%esp), %edx
L00001F72:
cmpl %edx, %ecx
movl 112(%esp), %ebp
movl 100(%esp), %edi
je L0000207D
L00001F82:
movl %ecx, 68(%esp)
movl %ebp, 112(%esp)
movl %ecx, %edx
notl %edx
movl 88(%esp), %ecx
movl 120(%esp), %esi
cmpl %esi, %ecx
cmovl %esi, %ecx
cmpl %ebp, %edi
movl %ebp, %esi
cmovge %edi, %esi
addl %ecx, %esi
subl 116(%esp), %esi
cmpl %ebx, %esi
cmovl %ebx, %esi
subl %esi, %edx
movl $-2, %ecx
movl 68(%esp), %ebp
subl %ebp, %ecx
subl %esi, %ecx
testb $1, %dl
je L00001FE3
L00001FC1:
movl %edi, 100(%esp)
movl 40(%esp), %edx
movl (%edx,%ebp,4), %edx
movl 84(%esp), %esi
xorl (%esi,%ebp,4), %edx
movl 44(%esp), %edi
addl %ebp, %edi
movl 64(%esp), %esi
movl %edx, (%esi,%edi,4)
incl %ebp
jmp L00001FE7
L00001FE3:
movl %edi, 100(%esp)
L00001FE7:
movl %ebp, %esi
testl %ecx, %ecx
movl 112(%esp), %ebp
movl 100(%esp), %edi
je L0000207D
L00001FF9:
movl 116(%esp), %ecx
leal -1(%ecx), %edx
movl 88(%esp), %ecx
movl %esi, 68(%esp)
movl 120(%esp), %esi
cmpl %esi, %ecx
cmovl %esi, %ecx
subl %ecx, %edx
cmpl %ebp, %edi
cmovge %edi, %ebp
subl %ebp, %edx
movl 76(%esp), %esi
cmpl %edx, %esi
cmovge %esi, %edx
addl %ecx, %ebp
negl %edx
subl 116(%esp), %ebp
cmpl %ebx, %ebp
cmovl %ebx, %ebp
movl 68(%esp), %ebx
movl %ebx, %ecx
notl %ecx
subl %ebp, %ecx
leal 1(%ebx,%edx), %edx
movl 64(%esp), %esi
leal (%esi,%edx,4), %edx
movl 40(%esp), %esi
leal 4(%esi,%ebx,4), %esi
movl 84(%esp), %edi
leal 4(%edi,%ebx,4), %edi
.align 4, 0x90
L00002060:
movl -4(%esi), %ebx
xorl -4(%edi), %ebx
movl %ebx, -4(%edx)
movl (%esi), %ebx
xorl (%edi), %ebx
movl %ebx, (%edx)
addl $8, %edx
addl $8, %esi
addl $8, %edi
addl $-2, %ecx
jne L00002060
L0000207D:
notl %eax
movl 88(%esp), %esi
movl 120(%esp), %edi
movl 76(%esp), %ebx
movl 104(%esp), %ebp
L0000208F:
cmpl %ebp, %eax
jge L00002445
L00002097:
movl %ebp, 104(%esp)
movl 116(%esp), %ebp
decl %ebp
movl %ebp, 116(%esp)
cmpl %edi, %esi
movl %esi, %ecx
cmovl %edi, %ecx
subl %ecx, %ebp
notl %esi
movl %edi, %edx
notl %edx
cmpl %edx, %esi
movl %edx, %ecx
cmovge %esi, %ecx
subl %ecx, %ebp
cmpl %ebp, %ebx
cmovge %ebx, %ebp
leal -1(%ebp), %ecx
subl %eax, %ecx
cmpl $-1, %ecx
je L0000223B
L000020CF:
movl %ebp, %ecx
movl %ebp, 56(%esp)
subl %eax, %ecx
movl %ecx, 68(%esp)
andl $-4, %ecx
movl %ecx, 44(%esp)
movl 88(%esp), %ebp
cmpl %edi, %ebp
movl %edi, %ecx
cmovl %ecx, %ebp
movl 116(%esp), %ecx
subl %ebp, %ecx
cmpl %edx, %esi
movl %edx, %edi
movl %edx, 112(%esp)
cmovge %esi, %edi
subl %edi, %ecx
cmpl %ecx, %ebx
cmovge %ebx, %ecx
andl $-4, 68(%esp)
je L0000224C
L00002110:
movl %esi, 100(%esp)
movl %ebx, 76(%esp)
movl 84(%esp), %ebx
leal -4(%ebx,%ecx,4), %edx
movl %eax, %edi
subl %ecx, %edi
movl 64(%esp), %ebp
leal (%ebp,%edi,4), %ecx
movl %ebp, %edi
cmpl %edx, %ecx
ja L00002140
L00002132:
leal (%ebx,%eax,4), %ecx
leal -4(%edi), %edx
cmpl %edx, %ecx
jbe L0000222E
L00002140:
movl 88(%esp), %ebp
movl 120(%esp), %edx
cmpl %ebp, %edx
movl %ebp, %ecx
cmovge %edx, %ecx
movl 116(%esp), %esi
subl %ecx, %esi
movl 100(%esp), %ecx
movl 112(%esp), %edx
cmpl %ecx, %edx
cmovge %edx, %ecx
subl %ecx, %esi
movl 76(%esp), %ecx
cmpl %esi, %ecx
cmovge %ecx, %esi
subl %eax, %esi
andl $-4, %esi
addl $-4, %esi
shrl $2, %esi
leal 1(%esi), %ecx
testb $3, %cl
movl %eax, %edi
je L00002221
L00002186:
movl 88(%esp), %edx
movl 120(%esp), %edi
cmpl %edx, %edi
movl %edx, %ecx
cmovge %edi, %ecx
movl 116(%esp), %ebp
subl %ecx, %ebp
movl %esi, 68(%esp)
movl 112(%esp), %esi
cmpl 100(%esp), %esi
movl 100(%esp), %ecx
cmovge %esi, %ecx
subl %ecx, %ebp
movl 76(%esp), %ecx
cmpl %ebp, %ecx
cmovge %ecx, %ebp
subl %eax, %ebp
andl $-4, %ebp
addl $-4, %ebp
cmpl %edi, %edx
cmovl %edi, %edx
movl 116(%esp), %ecx
subl %edx, %ecx
movl 100(%esp), %edi
cmpl %esi, %edi
movl %esi, %edx
movl 68(%esp), %esi
cmovge %edi, %edx
subl %edx, %ecx
movl 76(%esp), %edx
cmpl %ecx, %edx
cmovge %edx, %ecx
leal 0(,%ecx,4), %edi
movl 64(%esp), %edx
subl %edi, %edx
subl %eax, %ecx
andl $12, %ecx
addl $-4, %ecx
shrl $2, %ecx
incl %ecx
andl $3, %ecx
negl %ecx
movl %eax, %edi
.align 4, 0x90
L00002210:
movups (%ebx,%edi,4), %xmm0
movups %xmm0, (%edx,%edi,4)
addl $4, %edi
addl $-4, %ebp
incl %ecx
jne L00002210
L00002221:
movl 44(%esp), %ecx
addl %eax, %ecx
cmpl $3, %esi
jae L00002255
L0000222C:
movl %ecx, %eax
L0000222E:
movl 88(%esp), %edx
movl 76(%esp), %ebx
jmp L00002301
L0000223B:
movl %edx, 112(%esp)
movl %esi, 100(%esp)
movl 88(%esp), %edx
jmp L00002311
L0000224C:
movl %esi, 100(%esp)
jmp L000022FD
L00002255:
movl %ecx, 44(%esp)
movl 88(%esp), %ebp
movl 120(%esp), %ebx
cmpl %ebx, %ebp
movl %ebp, %ecx
cmovl %ebx, %ecx
movl 116(%esp), %edx
subl %ecx, %edx
movl 100(%esp), %esi
cmpl 112(%esp), %esi
movl 112(%esp), %ecx
cmovge %esi, %ecx
subl %ecx, %edx
movl 76(%esp), %ecx
cmpl %edx, %ecx
cmovge %ecx, %edx
negl %edx
cmpl %ebp, %ebx
movl %ebx, %ecx
movl %ebp, %ebx
cmovge %ecx, %ebx
movl 116(%esp), %ecx
subl %ebx, %ecx
movl 112(%esp), %ebp
cmpl %esi, %ebp
movl %esi, %ebx
cmovge %ebp, %ebx
subl %ebx, %ecx
movl 76(%esp), %ebx
cmpl %ecx, %ebx
cmovge %ebx, %ecx
subl %eax, %ecx
andl $-4, %ecx
addl %eax, %ecx
leal 12(%edi,%edx), %eax
movl 64(%esp), %edx
leal (%edx,%eax,4), %eax
subl %edi, %ecx
movl 84(%esp), %edx
leal 48(%edx,%edi,4), %edx
.align 4, 0x90
L000022D0:
movups -48(%edx), %xmm0
movups %xmm0, -48(%eax)
movups -32(%edx), %xmm0
movups %xmm0, -32(%eax)
movups -16(%edx), %xmm0
movups %xmm0, -16(%eax)
movups (%edx), %xmm0
movups %xmm0, (%eax)
addl $64, %eax
addl $64, %edx
addl $-16, %ecx
jne L000022D0
L000022F9:
movl 44(%esp), %eax
L000022FD:
movl 88(%esp), %edx
L00002301:
movl 120(%esp), %edi
movl 56(%esp), %ecx
cmpl %eax, %ecx
je L00002445
L00002311:
cmpl %edi, %edx
movl %edx, %ecx
cmovl %edi, %ecx
movl 116(%esp), %esi
subl %ecx, %esi
movl 100(%esp), %ebp
movl 112(%esp), %ecx
cmpl %ecx, %ebp
cmovge %ebp, %ecx
subl %ecx, %esi
cmpl %esi, %ebx
cmovge %ebx, %esi
leal 1(%eax), %ecx
movl %ecx, 68(%esp)
cmpl %ecx, %esi
cmovl %ecx, %esi
movl %esi, %edx
subl %eax, %edx
decl %esi
subl %eax, %esi
testb $3, %dl
movl %ebx, %ecx
je L000023CC
L00002350:
movl 88(%esp), %edx
cmpl %edi, %edx
cmovl %edi, %edx
movl 116(%esp), %ebx
subl %edx, %ebx
movl 112(%esp), %edx
cmpl %edx, %ebp
cmovge %ebp, %edx
subl %edx, %ebx
cmpl %ebx, %ecx
cmovge %ecx, %ebx
sall $2, %ebx
movl 88(%esp), %edx
movl 64(%esp), %edi
subl %ebx, %edi
cmpl %edx, 120(%esp)
movl %edx, %ebx
cmovge 120(%esp), %ebx
movl 116(%esp), %edx
subl %ebx, %edx
cmpl %ebp, 112(%esp)
cmovge 112(%esp), %ebp
subl %ebp, %edx
cmpl %edx, %ecx
cmovge %ecx, %edx
movl %ecx, 76(%esp)
movl 68(%esp), %ecx
cmpl %ecx, %edx
cmovl %ecx, %edx
subl %eax, %edx
andl $3, %edx
negl %edx
movl 84(%esp), %ebx
.align 4, 0x90
L000023C0:
movl (%ebx,%eax,4), %ecx
movl %ecx, (%edi,%eax,4)
incl %eax
incl %edx
jne L000023C0
L000023CA:
jmp L000023D8
L000023CC:
movl %ecx, 76(%esp)
movl %edi, 120(%esp)
movl 84(%esp), %ebx
L000023D8:
cmpl $3, %esi
movl %ebx, %esi
movl 88(%esp), %ebp
movl 120(%esp), %ecx
movl 76(%esp), %edi
movl 104(%esp), %ebx
jb L00002445
L000023EF:
cmpl %ecx, %ebp
cmovl %ecx, %ebp
movl 116(%esp), %edx
subl %ebp, %edx
movl 100(%esp), %ecx
movl 112(%esp), %ebp
cmpl %ebp, %ecx
cmovge %ecx, %ebp
subl %ebp, %edx
cmpl %edx, %edi
cmovge %edi, %edx
movl $3, %ecx
subl %edx, %ecx
movl 64(%esp), %edx
leal (%edx,%ecx,4), %ecx
.align 4, 0x90
L00002420:
movl (%esi,%eax,4), %edx
movl %edx, -12(%ecx,%eax,4)
movl 4(%esi,%eax,4), %edx
movl %edx, -8(%ecx,%eax,4)
movl 8(%esi,%eax,4), %edx
movl %edx, -4(%ecx,%eax,4)
movl 12(%esi,%eax,4), %edx
movl %edx, (%ecx,%eax,4)
addl $4, %eax
cmpl %ebx, %eax
jl L00002420
L00002445:
movl 108(%esp), %eax
movl %eax, 4(%esp)
movl 72(%esp), %eax
movl %eax, (%esp)
call _Flx_renormalize
L00002459:
movl %eax, %esi
leal 8(%esi), %ecx
movl 60(%esp), %ebx
movl %ebx, %edx
addl $8, %edx
movl $16777215, %eax
movl (%esi), %edi
andl %eax, %edi
addl $-2, %edi
andl (%ebx), %eax
addl $-2, %eax
movl %eax, 4(%esp)
movl %edi, (%esp)
call _F2x_mulspec
L00002484:
movl %eax, %edi
movl 4(%esi), %eax
movl %eax, 4(%edi)
movl 52(%esp), %esi
movl %esi, 4(%esp)
movl 48(%esp), %ebx
movl %ebx, (%esp)
call _F2x_add
L000024A0:
movl %eax, 4(%esp)
movl %edi, (%esp)
call _F2x_add
L000024AC:
movl 80(%esp), %edi
movl %edi, (%esp)
movl %ebx, %ecx
movl %eax, %edx
call _F2x_addshift
L000024BC:
movl %eax, %ecx
movl %edi, %eax
L000024C0:
movl %eax, (%esp)
movl %esi, %edx
call _F2x_addshift
L000024CA:
movl 92(%esp), %ecx
movl %ecx, (%esp)
movl 96(%esp), %ecx
movl %eax, %edx
call _F2x_shiftip
L000024DC:
addl $124, %esp
popl %esi
popl %edi
popl %ebx
popl %ebp
ret
# ----------------------
.align 4, 0x90
.globl _F2x_sqr
_F2x_sqr:
pushl %ebp
pushl %ebx
pushl %edi
pushl %esi
subl $28, %esp
call L000024FC
L000024FC:
popl %esi
movl 48(%esp), %eax
movl (%eax), %edx
andl $16777215, %edx
movl %edx, 24(%esp)
leal (%edx,%edx), %eax
movl L_avma$non_lazy_ptr-L000024FC(%esi), %ecx
movl %ecx, 20(%esp)
movl (%ecx), %ebx
movl $2, %edi
subl %eax, %edi
movl L_bot$non_lazy_ptr-L000024FC(%esi), %eax
movl %ebx, %ecx
subl (%eax), %ecx
shrl $2, %ecx
leal -2(%edx,%edx), %ebp
cmpl %ebp, %ecx
leal (%ebx,%edi,4), %eax
movl %eax, 16(%esp)
jae L0000254B
L0000253F:
movl $14, (%esp)
call _pari_err
L0000254B:
movl 16(%esp), %eax
movl 20(%esp), %ecx
movl %eax, (%ecx)
cmpl $16777216, %ebp
jb L00002573
L0000255D:
leal LC00009591-L000024FC(%esi), %eax
movl %eax, 4(%esp)
movl $15, (%esp)
call _pari_err
L00002573:
movl %ebp, %eax
movl %ebp, 12(%esp)
orl $738197504, %eax
movl %eax, (%ebx,%edi,4)
movl 48(%esp), %eax
movl 4(%eax), %eax
orl $1, %edi
movl %eax, (%ebx,%edi,4)
cmpl $3, 24(%esp)
jb L00002676
L00002599:
movl 24(%esp), %eax
leal 0(,%eax,8), %eax
subl %eax, %ebx
movl %ebx, 20(%esp)
movl $2, %eax
.align 4, 0x90
L000025B0:
movl 48(%esp), %ecx
movl (%ecx,%eax,4), %edi
movl %edi, %ebp
shrl $16, %ebp
leal (%eax,%eax), %ecx
movl $0, (%ebx,%eax,8)
testw %di, %di
je L00002618
L000025CB:
movl %edi, %ebx
andl $15, %ebx
movl %edi, %edx
shrl $2, %edx
andl $60, %edx
movl _F2x_sqr.sq-L000024FC(%esi,%edx), %edx
sall $8, %edx
orl _F2x_sqr.sq-L000024FC(%esi,%ebx,4), %edx
movl %edi, %ebx
shrl $6, %ebx
andl $60, %ebx
movl _F2x_sqr.sq-L000024FC(%esi,%ebx), %ebx
sall $16, %ebx
orl %edx, %ebx
movl %edi, %edx
shrl $10, %edx
andl $60, %edx
movl _F2x_sqr.sq-L000024FC(%esi,%edx), %edx
sall $24, %edx
orl %ebx, %edx
movl 20(%esp), %ebx
movl %edx, (%ebx,%ecx,4)
L00002618:
movl $0, 4(%ebx,%eax,8)
testl %ebp, %ebp
je L0000266B
L00002624:
andl $15, %ebp
movl %edi, %edx
shrl $18, %edx
andl $60, %edx
movl _F2x_sqr.sq-L000024FC(%esi,%edx), %edx
sall $8, %edx
orl _F2x_sqr.sq-L000024FC(%esi,%ebp,4), %edx
movl %ebx, %ebp
movl %edi, %ebx
shrl $22, %ebx
andl $60, %ebx
movl _F2x_sqr.sq-L000024FC(%esi,%ebx), %ebx
sall $16, %ebx
orl %edx, %ebx
shrl $28, %edi
movl _F2x_sqr.sq-L000024FC(%esi,%edi,4), %edx
sall $24, %edx
orl %ebx, %edx
movl %ebp, %ebx
movl %edx, 4(%ebx,%ecx,4)
L0000266B:
incl %eax
cmpl 24(%esp), %eax
jl L000025B0
L00002676:
movl 12(%esp), %eax
movl %eax, 4(%esp)
movl 16(%esp), %eax
movl %eax, (%esp)
call _Flx_renormalize
L0000268A:
addl $28, %esp
popl %esi
popl %edi
popl %ebx
popl %ebp
ret
# ----------------------
.align 4, 0x90
.globl _F2x_rem
_F2x_rem:
pushl %ebp
pushl %ebx
pushl %edi
pushl %esi
subl $76, %esp
call L000026AC
L000026AC:
popl %ebx
movl 100(%esp), %ecx
movl 96(%esp), %eax
movl (%eax), %edi
movl $16777215, %eax
andl (%ecx), %eax
movl $-1, 72(%esp)
cmpl $2, %eax
movl $-1, %edx
je L00002763
L000026D4:
movl -4(%ecx,%eax,4), %edx
movl %edx, %ecx
shrl $16, %ecx
cmpl $65535, %edx
cmovbe %edx, %ecx
movl $12, %esi
movl $28, %edx
cmova %esi, %edx
cmpl $256, %ecx
jb L00002701
L000026FB:
addl $-8, %edx
shrl $8, %ecx
L00002701:
sall $5, %eax
cmpl $16, %ecx
jb L0000270F
L00002709:
addl $-4, %edx
shrl $4, %ecx
L0000270F:
addl $-65, %eax
subl %edx, %eax
subl _F2x_degree_lg.__bfffo_tabshi-L000026AC(%ebx,%ecx,4), %eax
movl %eax, %edx
jne L00002763
L0000271F:
movl 96(%esp), %eax
movl 4(%eax), %edi
movl %ebx, %eax
movl L_avma$non_lazy_ptr-L000026AC(%eax), %ebp
movl (%ebp), %ebx
leal -8(%ebx), %esi
movl L_bot$non_lazy_ptr-L000026AC(%eax), %eax
movl %ebx, %ecx
subl (%eax), %ecx
cmpl $7, %ecx
ja L0000274F
L00002743:
movl $14, (%esp)
call _pari_err
L0000274F:
movl %esi, (%ebp)
movl $738197506, -8(%ebx)
movl %edi, -4(%ebx)
movl %esi, %eax
jmp L00002E27
L00002763:
movl %edx, 40(%esp)
movl %edi, %esi
movl %edi, 68(%esp)
andl $16777215, %esi
cmpl $2, %esi
je L000027C8
L00002778:
movl 96(%esp), %eax
movl -4(%eax,%esi,4), %ecx
movl %ecx, %eax
shrl $16, %eax
cmpl $65535, %ecx
cmovbe %ecx, %eax
movl $12, %edx
movl $28, %ecx
cmova %edx, %ecx
cmpl $256, %eax
jb L000027A8
L000027A2:
addl $-8, %ecx
shrl $8, %eax
L000027A8:
movl %esi, %edx
sall $5, %edx
cmpl $16, %eax
jb L000027B8
L000027B2:
addl $-4, %ecx
shrl $4, %eax
L000027B8:
addl $-65, %edx
subl %ecx, %edx
subl _F2x_degree_lg.__bfffo_tabshi-L000026AC(%ebx,%eax,4), %edx
movl %edx, 72(%esp)
L000027C8:
movl %ebx, 36(%esp)
movl L_avma$non_lazy_ptr-L000026AC(%ebx), %ebp
movl (%ebp), %ecx
movl %ecx, 64(%esp)
leal 0(,%esi,4), %eax
movl %ecx, %edi
subl %eax, %edi
movl L_bot$non_lazy_ptr-L000026AC(%ebx), %eax
subl (%eax), %ecx
shrl $2, %ecx
cmpl %esi, %ecx
jae L000027FF
L000027F3:
movl $14, (%esp)
call _pari_err
L000027FF:
movl %edi, (%ebp)
movl $-16777217, %eax
movl 96(%esp), %ecx
andl (%ecx), %eax
movl %eax, (%edi)
cmpl $2, %esi
movl %esi, 52(%esp)
movl 40(%esp), %ebx
jb L000029E7
L00002820:
movl 68(%esp), %ebp
andl $16777215, %ebp
movl %ebp, %esi
negl %esi
cmpl $-3, %esi
movl $-2, %edx
cmovg %esi, %edx
addl %ebp, %edx
cmpl $-1, %edx
movl 52(%esp), %eax
je L00002923
L00002848:
incl %edx
cmpl $-3, %esi
movl $-2, %ebx
cmovg %esi, %ebx
xorl %ecx, %ecx
movl %edx, %eax
andl $-8, %eax
je L0000290F
L00002861:
movl %eax, 60(%esp)
movl %ebx, %eax
notl %eax
movl 96(%esp), %ecx
leal (%ecx,%eax,4), %ecx
movl 64(%esp), %eax
leal -4(%eax), %eax
cmpl %ecx, %eax
ja L00002898
L0000287B:
movl 96(%esp), %eax
leal -4(%eax,%ebp,4), %eax
addl %ebp, %ebx
notl %ebx
movl 64(%esp), %ecx
leal (%ecx,%ebx,4), %ebx
xorl %ecx, %ecx
cmpl %ebx, %eax
movl 52(%esp), %eax
jbe L00002913
L00002898:
movl %edx, 56(%esp)
movl %edi, 20(%esp)
movl 52(%esp), %ecx
movl %ecx, %eax
subl 60(%esp), %eax
cmpl $-3, %esi
movl $-2, %ebx
cmovg %esi, %ebx
leal 1(%ebx,%ebp), %esi
andl $-8, %esi
movl 36(%esp), %ebx
movdqa LC000093F0-L000026AC(%ebx), %xmm0
movl 64(%esp), %edx
movl 96(%esp), %edi
L000028D0:
movd %ebp, %xmm1
pshufd $0, %xmm1, %xmm1
paddd %xmm0, %xmm1
movd %xmm1, %ebx
movdqu -12(%edi,%ebx,4), %xmm1
movups -28(%edi,%ebx,4), %xmm2
subl %ecx, %ebx
movdqu %xmm1, -12(%edx,%ebx,4)
movups %xmm2, -28(%edx,%ebx,4)
addl $-8, %ebp
addl $-8, %esi
jne L000028D0
L00002901:
movl 60(%esp), %ecx
movl 20(%esp), %edi
movl 56(%esp), %edx
jmp L00002913
L0000290F:
movl 52(%esp), %eax
L00002913:
cmpl %ecx, %edx
movl 40(%esp), %ebx
movl 96(%esp), %ecx
je L000029E7
L00002923:
movl %ecx, %edx
movl %eax, %esi
negl %esi
cmpl $-3, %esi
movl $-2, %ecx
cmovg %esi, %ecx
leal (%eax,%ecx), %ebp
leal 1(%eax,%ecx), %ecx
testb $3, %cl
je L0000298F
L00002940:
movl %ebp, 60(%esp)
movl %ebx, %ebp
movl 68(%esp), %ecx
notl %ecx
orl $1056964608, %ecx
movl %edi, %ebx
movl 64(%esp), %edi
leal (%edi,%ecx,4), %ecx
movl %ebx, %edi
cmpl $-3, %esi
movl $-2, %ebx
cmovg %esi, %ebx
leal 1(%eax,%ebx), %esi
andl $3, %esi
negl %esi
.align 4, 0x90
L00002980:
movl -4(%edx,%eax,4), %ebx
movl %ebx, (%ecx,%eax,4)
leal -1(%eax), %eax
incl %esi
jne L00002980
L0000298D:
jmp L00002995
L0000298F:
movl %ebp, 60(%esp)
movl %ebx, %ebp
L00002995:
cmpl $3, 60(%esp)
movl %ebp, %ebx
movl %edx, %esi
jb L000029E7
L000029A0:
movl 68(%esp), %ecx
notl %ecx
orl $1056964608, %ecx
movl 64(%esp), %edx
leal (%edx,%ecx,4), %ecx
.align 4, 0x90
L000029C0:
movl -4(%esi,%eax,4), %edx
movl %edx, (%ecx,%eax,4)
movl -8(%esi,%eax,4), %edx
movl %edx, -4(%ecx,%eax,4)
movl -12(%esi,%eax,4), %edx
movl %edx, -8(%ecx,%eax,4)
movl -16(%esi,%eax,4), %edx
movl %edx, -12(%ecx,%eax,4)
leal -4(%eax), %eax
cmpl $1, %eax
jg L000029C0
L000029E7:
movl 72(%esp), %edx
cmpl %ebx, %edx
jge L000029FC
L000029EF:
movl %edi, 20(%esp)
movl 52(%esp), %eax
jmp L00002E17
L000029FC:
movl %edi, 20(%esp)
movl 68(%esp), %edi
movl %edi, %eax
notl %eax
movl %edi, %ecx
orl $-16777216, %ecx
xorl $16777215, %ecx
movl %ecx, 32(%esp)
andl $16777215, %edi
movl $2, %ecx
subl %edi, %ecx
movl %ecx, 16(%esp)
movl 100(%esp), %ebp
leal 8(%ebp), %ecx
movl %ecx, 12(%esp)
sall $2, %edi
movl 64(%esp), %ecx
movl %ecx, %esi
subl %edi, %esi
movl %esi, 24(%esp)
leal 16(%ebp), %esi
movl %esi, 8(%esp)
orl $1056964608, %eax
leal (%ecx,%eax,4), %ecx
movl %ecx, 28(%esp)
movl 52(%esp), %edi
.align 4, 0x90
L00002A60:
subl %ebx, %edx
movl %edx, %eax
sarl $5, %eax
movl (%ebp), %esi
andl $16777215, %esi
andl $31, %edx
je L00002AF0
L00002A75:
cmpl $3, %esi
jb L00002D80
L00002A7E:
movl $32, %ecx
subl %edx, %ecx
movl %ecx, 56(%esp)
movl %eax, %ecx
subl 52(%esp), %ecx
movl %ecx, 48(%esp)
cmpl $2, %esi
movl $3, %ebx
cmovg %esi, %ebx
leal -2(%ebx), %ecx
addl $-3, %ebx
testb $1, %cl
je L00002BE9
L00002AAD:
movl %edi, 44(%esp)
movl %eax, 60(%esp)
movl %esi, 68(%esp)
movl %edx, %ecx
movl %ecx, 72(%esp)
movl 8(%ebp), %edx
sall %cl, %edx
movl 64(%esp), %eax
movl 48(%esp), %ecx
xorl %edx, 8(%eax,%ecx,4)
movl 8(%ebp), %esi
movl 56(%esp), %ecx
shrl %cl, %esi
movl $3, %edx
jmp L00002C00
L00002AE3:
.align 4, 0x90
L00002AF0:
cmpl $3, %esi
jb L00002D80
L00002AF9:
movl %eax, %ecx
movl %eax, 60(%esp)
subl 52(%esp), %ecx
movl %ecx, 72(%esp)
cmpl $3, %esi
movl $3, %ecx
cmova %esi, %ecx
movl $2, %edx
cmpl $2, %ecx
je L00002D0C
L00002B20:
leal -2(%ecx), %edx
andl $-4, %edx
orl $2, %edx
movl %edx, 56(%esp)
cmpl $3, %esi
movl $3, %eax
cmova %esi, %eax
cmpl $2, %edx
movl $2, %edx
je L00002D08
L00002B46:
leal -4(%ebp,%eax,4), %ebx
movl %ebx, 48(%esp)
movl %esi, 68(%esp)
movl 16(%esp), %esi
movl 60(%esp), %ebx
leal (%esi,%ebx), %ebx
movl 64(%esp), %esi
leal (%esi,%ebx,4), %ebx
movl 68(%esp), %esi
cmpl 48(%esp), %ebx
movl 40(%esp), %ebx
ja L00002B8F
L00002B72:
addl 60(%esp), %eax
addl 32(%esp), %eax
movl 64(%esp), %esi
leal (%esi,%eax,4), %eax
movl 68(%esp), %esi
cmpl %eax, 12(%esp)
jbe L00002D08
L00002B8F:
movl %esi, 68(%esp)
cmpl $3, %esi
movl $3, %edx
cmova %esi, %edx
addl $-2, %edx
andl $-4, %edx
addl $-4, %edx
shrl $2, %edx
leal 1(%edx), %eax
movl $2, %esi
testb $1, %al
je L00002BD8
L00002BB6:
movdqu 8(%ebp), %xmm0
movl 64(%esp), %eax
movl 72(%esp), %esi
movdqu 8(%eax,%esi,4), %xmm1
pxor %xmm0, %xmm1
movdqu %xmm1, 8(%eax,%esi,4)
movl $6, %esi
L00002BD8:
testl %edx, %edx
jne L00002C8B
L00002BE0:
movl 56(%esp), %edx
jmp L00002D04
L00002BE9:
movl %edi, 44(%esp)
movl %eax, 60(%esp)
movl %esi, 68(%esp)
movl %edx, 72(%esp)
movl $2, %edx
xorl %esi, %esi
L00002C00:
testl %ebx, %ebx
movl 68(%esp), %eax
movl 56(%esp), %ebx
je L00002C5C
L00002C0C:
movl 24(%esp), %eax
movl 60(%esp), %ecx
leal (%eax,%ecx,4), %edi
.align 4, 0x90
L00002C20:
movl %ebp, %eax
movl (%eax,%edx,4), %ebp
movl 72(%esp), %ecx
sall %cl, %ebp
orl %esi, %ebp
xorl %ebp, (%edi,%edx,4)
movl (%eax,%edx,4), %esi
movb %bl, %cl
shrl %cl, %esi
movl 4(%eax,%edx,4), %ebp
movl 72(%esp), %ecx
sall %cl, %ebp
orl %esi, %ebp
xorl %ebp, 4(%edi,%edx,4)
movl %eax, %ebp
movl 68(%esp), %eax
movl 4(%ebp,%edx,4), %esi
movb %bl, %cl
shrl %cl, %esi
addl $2, %edx
cmpl %eax, %edx
jl L00002C20
L00002C5C:
testl %esi, %esi
je L00002C7A
L00002C60:
movl %eax, %ecx
cmpl $3, %ecx
movl $3, %eax
cmovbe %eax, %ecx
movl 48(%esp), %edx
addl %ecx, %edx
movl 64(%esp), %eax
xorl %esi, (%eax,%edx,4)
L00002C7A:
movl 40(%esp), %ebx
movl 28(%esp), %ecx
movl 44(%esp), %edi
jmp L00002D80
L00002C8B:
movl 60(%esp), %eax
leal (%esi,%eax), %eax
movl 24(%esp), %edx
leal (%edx,%eax,4), %edx
movl 8(%esp), %eax
movl %esi, 48(%esp)
leal (%eax,%esi,4), %esi
movl 68(%esp), %eax
cmpl $3, %eax
movl $3, %ebx
cmova %eax, %ebx
addl $-2, %ebx
andl $-4, %ebx
orl $2, %ebx
subl 48(%esp), %ebx
xorl %eax, %eax
.align 4, 0x90
L00002CD0:
movups -16(%esi,%eax,4), %xmm0
movups (%edx,%eax,4), %xmm1
xorps %xmm0, %xmm1
movups %xmm1, (%edx,%eax,4)
movdqu (%esi,%eax,4), %xmm0
movdqu 16(%edx,%eax,4), %xmm1
pxor %xmm0, %xmm1
movdqu %xmm1, 16(%edx,%eax,4)
addl $8, %eax
cmpl %eax, %ebx
jne L00002CD0
L00002CFC:
movl 56(%esp), %edx
movl 40(%esp), %ebx
L00002D04:
movl 68(%esp), %esi
L00002D08:
cmpl %edx, %ecx
je L00002D76
L00002D0C:
movl %esi, 68(%esp)
leal 1(%edx), %ecx
cmpl %esi, %ecx
cmovge %ecx, %esi
movl %esi, %eax
subl %edx, %eax
decl %esi
subl %edx, %esi
testb $1, %al
je L00002D42
L00002D23:
movl (%ebp,%edx,4), %eax
movl %eax, 56(%esp)
movl 72(%esp), %eax
addl %edx, %eax
movl 64(%esp), %edx
movl 56(%esp), %ebx
xorl %ebx, (%edx,%eax,4)
movl 40(%esp), %ebx
jmp L00002D44
L00002D42:
movl %edx, %ecx
L00002D44:
testl %esi, %esi
je L00002D76
L00002D48:
movl 24(%esp), %eax
movl 60(%esp), %edx
leal (%eax,%edx,4), %eax
movl 68(%esp), %esi
.align 4, 0x90
L00002D60:
movl (%ebp,%ecx,4), %edx
xorl %edx, (%eax,%ecx,4)
movl 4(%ebp,%ecx,4), %edx
xorl %edx, 4(%eax,%ecx,4)
addl $2, %ecx
cmpl %esi, %ecx
jl L00002D60
L00002D76:
movl 28(%esp), %ecx
.align 4, 0x90
L00002D80:
movl %edi, %eax
cmpl $3, %eax
jl L00002D90
L00002D87:
leal -1(%eax), %edi
cmpl $0, (%ecx,%eax,4)
je L00002D80
L00002D90:
cmpl $2, %eax
jne L00002DB0
L00002D95:
movl $2, %eax
movl $-1, %edx
jmp L00002E0D
L00002DA1:
.align 4, 0x90
L00002DB0:
movl %ecx, %edi
movl 32(%esp), %ecx
leal (%ecx,%eax), %ecx
movl 64(%esp), %edx
movl (%edx,%ecx,4), %edx
movl %edx, %ecx
shrl $16, %ecx
cmpl $65535, %edx
cmovbe %edx, %ecx
movl $28, %edx
movl $12, %esi
cmova %esi, %edx
cmpl $256, %ecx
jb L00002DE9
L00002DE3:
addl $-8, %edx
shrl $8, %ecx
L00002DE9:
movl %eax, %esi
sall $5, %esi
cmpl $16, %ecx
jb L00002DF9
L00002DF3:
addl $-4, %edx
shrl $4, %ecx
L00002DF9:
addl $-65, %esi
subl %edx, %esi
movl 36(%esp), %edx
subl _F2x_degree_lg.__bfffo_tabshi-L000026AC(%edx,%ecx,4), %esi
movl %esi, %edx
movl %edi, %ecx
L00002E0D:
cmpl %ebx, %edx
movl %eax, %edi
jge L00002A60
L00002E17:
movl %eax, 4(%esp)
movl 20(%esp), %eax
movl %eax, (%esp)
call _Flx_renormalize
L00002E27:
addl $76, %esp
popl %esi
popl %edi
popl %ebx
popl %ebp
ret
# ----------------------
.align 4, 0x90
.globl _F2x_divrem
_F2x_divrem:
pushl %ebp
pushl %ebx
pushl %edi
pushl %esi
subl $108, %esp
call L00002E3C
L00002E3C:
popl %ebp
movl 136(%esp), %ebx
movl 132(%esp), %ecx
movl %ecx, 48(%esp)
movl 128(%esp), %eax
movl %eax, 100(%esp)
movl $16777215, %edx
movl (%eax), %esi
andl %edx, %esi
movl 4(%eax), %eax
movl %eax, 96(%esp)
andl (%ecx), %edx
cmpl $2, %edx
movl $-1, %edi
je L00002EC8
L00002E76:
movl 48(%esp), %eax
movl -4(%eax,%edx,4), %ecx
movl %edx, %edi
movl %ecx, %eax
shrl $16, %eax
cmpl $65535, %ecx
cmovbe %ecx, %eax
movl $12, %edx
movl $28, %ecx
cmova %edx, %ecx
cmpl $256, %eax
jb L00002EA8
L00002EA2:
addl $-8, %ecx
shrl $8, %eax
L00002EA8:
movl %edi, %edx
sall $5, %edx
cmpl $16, %eax
jb L00002EB8
L00002EB2:
addl $-4, %ecx
shrl $4, %eax
L00002EB8:
addl $-65, %edx
subl %ecx, %edx
subl _F2x_degree_lg.__bfffo_tabshi-L00002E3C(%ebp,%eax,4), %edx
movl %edx, %edi
jns L00002ED6
L00002EC8:
movl $27, (%esp)
call _pari_err
L00002ED4:
movl %edi, %edx
L00002ED6:
movl %ebx, %ecx
cmpl $1, %ecx
je L00003094
L00002EE1:
testl %edx, %edx
je L000030A0
L00002EE9:
movl $-1, %eax
cmpl $2, %esi
je L00002F49
L00002EF3:
movl %edx, %ebx
movl %ecx, %edi
movl 100(%esp), %eax
movl -4(%eax,%esi,4), %ecx
movl %ecx, %eax
shrl $16, %eax
cmpl $65535, %ecx
cmovbe %ecx, %eax
movl $12, %edx
movl $28, %ecx
cmova %edx, %ecx
cmpl $256, %eax
jb L00002F27
L00002F21:
addl $-8, %ecx
shrl $8, %eax
L00002F27:
movl %ebx, %edx
movl %esi, %ebx
sall $5, %ebx
cmpl $16, %eax
jb L00002F39
L00002F33:
addl $-4, %ecx
shrl $4, %eax
L00002F39:
addl $-65, %ebx
subl %ecx, %ebx
subl _F2x_degree_lg.__bfffo_tabshi-L00002E3C(%ebp,%eax,4), %ebx
movl %ebx, %eax
movl %edi, %ecx
L00002F49:
cmpl %edx, %eax
jge L00003190
L00002F51:
cmpl $2, %ecx
je L000033BE
L00002F5A:
movl L_avma$non_lazy_ptr-L00002E3C(%ebp), %ebx
movl (%ebx), %esi
leal -8(%esi), %edx
movl L_bot$non_lazy_ptr-L00002E3C(%ebp), %edi
movl %ebp, 72(%esp)
movl %esi, %eax
subl (%edi), %eax
cmpl $7, %eax
movl 96(%esp), %eax
ja L00002F98
L00002F7C:
movl $14, (%esp)
movl %ecx, 40(%esp)
movl %edx, %ebp
call _pari_err
L00002F8E:
movl %ebp, %edx
movl 96(%esp), %eax
movl 40(%esp), %ecx
L00002F98:
movl %edx, (%ebx)
movl $738197506, -8(%esi)
movl %eax, -4(%esi)
testl %ecx, %ecx
je L00003D41
L00002FAC:
movl %ecx, 40(%esp)
movl 100(%esp), %eax
movl (%eax), %esi
movl %esi, 92(%esp)
andl $16777215, %esi
movl (%ebx), %ebp
leal 0(,%esi,4), %eax
movl %ebp, %ecx
subl %eax, %ecx
movl %ebp, %eax
subl (%edi), %eax
shrl $2, %eax
cmpl %esi, %eax
jae L00002FF0
L00002FD8:
movl $14, (%esp)
movl %edx, 104(%esp)
movl %ecx, %edi
call _pari_err
L00002FEA:
movl %edi, %ecx
movl 104(%esp), %edx
L00002FF0:
movl %ecx, 96(%esp)
movl %ecx, (%ebx)
movl $-16777217, %eax
movl 100(%esp), %edi
andl (%edi), %eax
movl %eax, (%ecx)
cmpl $2, %esi
jb L00003D37
L0000300C:
movl %edx, 104(%esp)
movl 92(%esp), %edx
andl $16777215, %edx
movl %edx, %ebx
negl %ebx
cmpl $-3, %ebx
movl $-2, %edi
movl $-2, %ecx
cmovg %ebx, %ecx
addl %edx, %ecx
cmpl $-1, %ecx
je L00003C0D
L00003039:
incl %ecx
movl %ecx, 88(%esp)
cmpl $-3, %ebx
movl $-2, %eax
cmovg %ebx, %eax
andl $-8, %ecx
je L00003C1A
L00003052:
movl %ecx, 84(%esp)
movl %eax, %edi
notl %edi
movl 100(%esp), %ecx
leal (%ecx,%edi,4), %edi
movl %edi, 80(%esp)
leal -4(%ebp), %edi
cmpl 80(%esp), %edi
ja L00003C26
L00003072:
leal -4(%ecx,%edx,4), %edi
addl %edx, %eax
notl %eax
leal (%ebp,%eax,4), %eax
cmpl %eax, %edi
ja L00003C26
L00003086:
movl 104(%esp), %edx
movl $-2, %edi
jmp L00003C1E
L00003094:
addl $108, %esp
popl %esi
popl %edi
popl %ebx
popl %ebp
jmp _F2x_rem
L000030A0:
movl %ecx, 40(%esp)
movl 100(%esp), %esi
movl (%esi), %ebx
movl %ebx, 92(%esp)
andl $16777215, %ebx
movl %ebp, 72(%esp)
movl L_avma$non_lazy_ptr-L00002E3C(%ebp), %edx
movl (%edx), %edi
leal 0(,%ebx,4), %eax
movl %edi, %ecx
subl %eax, %ecx
movl L_bot$non_lazy_ptr-L00002E3C(%ebp), %ebp
movl %ebp, 84(%esp)
movl %edi, %eax
subl (%ebp), %eax
shrl $2, %eax
cmpl %ebx, %eax
jae L000030F9
L000030E1:
movl $14, (%esp)
movl %ecx, 104(%esp)
movl %edx, %ebp
call _pari_err
L000030F3:
movl %ebp, %edx
movl 104(%esp), %ecx
L000030F9:
movl %edx, 88(%esp)
movl %ecx, 104(%esp)
movl %ecx, (%edx)
movl $-16777217, %eax
andl (%esi), %eax
movl %eax, (%ecx)
cmpl $2, %ebx
jb L000035D7
L00003115:
movl 92(%esp), %edx
andl $16777215, %edx
movl %edx, %esi
negl %esi
cmpl $-3, %esi
movl $-2, %ecx
cmovg %esi, %ecx
addl %edx, %ecx
cmpl $-1, %ecx
je L000034B1
L00003139:
incl %ecx
cmpl $-3, %esi
movl $-2, %ebp
cmovg %esi, %ebp
movl %ecx, %eax
andl $-8, %eax
je L000034BA
L00003150:
movl %ecx, 76(%esp)
movl %eax, 80(%esp)
movl %ebp, %eax
notl %eax
movl 100(%esp), %ecx
leal (%ecx,%eax,4), %ecx
leal -4(%edi), %eax
cmpl %ecx, %eax
ja L000034BE
L0000316E:
movl 100(%esp), %eax
leal -4(%eax,%edx,4), %eax
addl %edx, %ebp
notl %ebp
leal (%edi,%ebp,4), %ebp
cmpl %ebp, %eax
ja L000034BE
L00003185:
xorl %eax, %eax
movl 76(%esp), %ecx
jmp L00003529
L00003190:
movl %esi, 88(%esp)
movl %eax, 104(%esp)
movl %edx, 56(%esp)
movl %ecx, 40(%esp)
movl $16777215, %eax
movl 100(%esp), %ecx
movl (%ecx), %edi
andl %eax, %edi
movl 48(%esp), %ecx
andl (%ecx), %eax
subl %eax, %edi
leal 3(%edi), %ebx
movl %ebp, %esi
movl L_avma$non_lazy_ptr-L00002E3C(%esi), %eax
movl %eax, 36(%esp)
movl (%eax), %edx
movl %edx, 68(%esp)
movl $-3, %ebp
subl %edi, %ebp
movl %ebp, 76(%esp)
movl L_bot$non_lazy_ptr-L00002E3C(%esi), %ecx
movl %ecx, 20(%esp)
movl %esi, 72(%esp)
movl %edx, %eax
subl (%ecx), %eax
shrl $2, %eax
cmpl %ebx, %eax
leal (%edx,%ebp,4), %eax
movl %eax, 32(%esp)
jae L00003201
L000031F5:
movl $14, (%esp)
call _pari_err
L00003201:
leal 2(%edi), %ebp
movl 36(%esp), %eax
movl 32(%esp), %ecx
movl %ecx, (%eax)
cmpl $16777216, %ebx
jb L00003230
L00003216:
movl 72(%esp), %eax
leal LC00009591-L00002E3C(%eax), %eax
movl %eax, 4(%esp)
movl $15, (%esp)
call _pari_err
L00003230:
orl $738197504, %ebx
movl 32(%esp), %eax
movl %ebx, (%eax)
testl %ebp, %ebp
movl 68(%esp), %ebx
jle L0000325D
L00003244:
movl $-2, %eax
subl %edi, %eax
leal (%ebx,%eax,4), %eax
sall $2, %ebp
movl %ebp, 4(%esp)
movl %eax, (%esp)
call ___bzero
L0000325D:
movl 76(%esp), %eax
movl 96(%esp), %ecx
movl %ecx, 4(%ebx,%eax,4)
movl 100(%esp), %edi
movl (%edi), %esi
movl %esi, %ebp
andl $16777215, %ebp
movl 36(%esp), %eax
movl (%eax), %ecx
movl %ecx, 80(%esp)
leal 0(,%ebp,4), %eax
movl %ecx, %edx
subl %eax, %edx
movl %edx, 28(%esp)
movl %ecx, %eax
movl 20(%esp), %ecx
subl (%ecx), %eax
shrl $2, %eax
cmpl %ebp, %eax
jae L000032AB
L0000329F:
movl $14, (%esp)
call _pari_err
L000032AB:
movl 36(%esp), %eax
movl 28(%esp), %ecx
movl %ecx, (%eax)
movl $-16777217, %eax
andl (%edi), %eax
movl %eax, (%ecx)
cmpl $2, %ebp
movl %ebp, 64(%esp)
movl %edi, %ecx
jb L000036F7
L000032CD:
movl %esi, %edi
andl $16777215, %edi
movl %edi, %ebp
negl %ebp
cmpl $-3, %ebp
movl $-2, %edx
cmovg %ebp, %edx
addl %edi, %edx
cmpl $-1, %edx
movl 64(%esp), %eax
je L0000364F
L000032F3:
incl %edx
cmpl $-3, %ebp
movl $-2, %ebx
cmovg %ebp, %ebx
movl %edx, %eax
andl $-8, %eax
je L00003633
L0000330A:
movl %eax, 92(%esp)
movl %edx, 96(%esp)
movl %ebx, %eax
notl %eax
movl 100(%esp), %ecx
leal (%ecx,%eax,4), %ecx
movl 80(%esp), %eax
leal -4(%eax), %eax
cmpl %ecx, %eax
movl $0, %edx
ja L0000334C
L0000332D:
movl 100(%esp), %eax
leal -4(%eax,%edi,4), %eax
addl %edi, %ebx
notl %ebx
movl 80(%esp), %ecx
leal (%ecx,%ebx,4), %ebx
cmpl %ebx, %eax
movl 64(%esp), %eax
jbe L0000363D
L0000334C:
movl %esi, 84(%esp)
movl 64(%esp), %esi
movl %esi, %eax
subl 92(%esp), %eax
cmpl $-3, %ebp
movl $-2, %ebx
cmovg %ebp, %ebx
leal 1(%ebx,%edi), %ebx
andl $-8, %ebx
movl 72(%esp), %ebp
movdqa LC00009400-L00002E3C(%ebp), %xmm0
movl 100(%esp), %ecx
movl 80(%esp), %edx
L00003380:
movd %edi, %xmm1
pshufd $0, %xmm1, %xmm1
paddd %xmm0, %xmm1
movd %xmm1, %ebp
movdqu -12(%ecx,%ebp,4), %xmm1
movups -28(%ecx,%ebp,4), %xmm2
subl %esi, %ebp
movdqu %xmm1, -12(%edx,%ebp,4)
movups %xmm2, -28(%edx,%ebp,4)
addl $-8, %edi
addl $-8, %ebx
jne L00003380
L000033B1:
movl 92(%esp), %edx
movl 84(%esp), %esi
jmp L0000363D
L000033BE:
xorl %edx, %edx
testl %eax, %eax
jns L00003D41
L000033C8:
movl 100(%esp), %edi
movl (%edi), %esi
movl %esi, 96(%esp)
andl $16777215, %esi
movl %ebp, %ecx
movl %ecx, 72(%esp)
movl L_avma$non_lazy_ptr-L00002E3C(%ecx), %ebp
movl (%ebp), %ebx
leal 0(,%esi,4), %eax
movl %ebx, %edx
subl %eax, %edx
movl L_bot$non_lazy_ptr-L00002E3C(%ecx), %eax
movl %ebx, %ecx
subl (%eax), %ecx
shrl $2, %ecx
cmpl %esi, %ecx
jae L00003417
L00003403:
movl $14, (%esp)
movl %edx, 104(%esp)
call _pari_err
L00003413:
movl 104(%esp), %edx
L00003417:
movl %edx, (%ebp)
movl $-16777217, %eax
andl (%edi), %eax
movl %eax, (%edx)
cmpl $2, %esi
jb L00003D41
L0000342C:
movl %edx, 104(%esp)
movl 96(%esp), %edx
andl $16777215, %edx
movl %edx, %ebp
negl %ebp
cmpl $-3, %ebp
movl $-2, %eax
movl $-2, %ecx
cmovg %ebp, %ecx
addl %edx, %ecx
cmpl $-1, %ecx
je L00003D4B
L00003459:
incl %ecx
movl %ecx, 92(%esp)
cmpl $-3, %ebp
movl $-2, %edi
cmovg %ebp, %edi
andl $-8, %ecx
movl %ecx, 88(%esp)
je L000034A6
L00003472:
movl %edi, %eax
notl %eax
movl 100(%esp), %ecx
leal (%ecx,%eax,4), %eax
movl %eax, 84(%esp)
leal -4(%ebx), %eax
cmpl 84(%esp), %eax
ja L00003D51
L0000348E:
leal -4(%ecx,%edx,4), %eax
addl %edx, %edi
notl %edi
leal (%ebx,%edi,4), %edi
cmpl %edi, %eax
ja L00003D51
L000034A1:
movl $-2, %eax
L000034A6:
movl 92(%esp), %edx
xorl %edi, %edi
jmp L00003DB9
L000034B1:
movl 100(%esp), %eax
jmp L00003535
L000034BA:
xorl %eax, %eax
jmp L00003529
L000034BE:
movl %ebx, %eax
subl 80(%esp), %eax
movl %eax, 68(%esp)
cmpl $-3, %esi
movl $-2, %eax
cmovg %esi, %eax
leal 1(%eax,%edx), %esi
andl $-8, %esi
movl 72(%esp), %eax
movdqa LC00009400-L00002E3C(%eax), %xmm0
movl 100(%esp), %ebp
movl 76(%esp), %ecx
.align 4, 0x90
L000034F0:
movd %edx, %xmm1
pshufd $0, %xmm1, %xmm1
paddd %xmm0, %xmm1
movd %xmm1, %eax
movdqu -12(%ebp,%eax,4), %xmm1
movups -28(%ebp,%eax,4), %xmm2
subl %ebx, %eax
movdqu %xmm1, -12(%edi,%eax,4)
movups %xmm2, -28(%edi,%eax,4)
addl $-8, %edx
addl $-8, %esi
jne L000034F0
L00003521:
movl 68(%esp), %ebx
movl 80(%esp), %eax
L00003529:
cmpl %eax, %ecx
movl 100(%esp), %eax
je L000035D7
L00003535:
movl %eax, %ebp
movl %ebx, %edx
negl %edx
cmpl $-3, %edx
movl $-2, %eax
cmovg %edx, %eax
leal (%ebx,%eax), %ecx
leal 1(%ebx,%eax), %eax
testb $3, %al
je L0000358D
L00003551:
movl 92(%esp), %eax
notl %eax
orl $1056964608, %eax
leal (%edi,%eax,4), %eax
cmpl $-3, %edx
movl $-2, %esi
cmovg %edx, %esi
leal 1(%ebx,%esi), %edx
andl $3, %edx
negl %edx
.align 4, 0x90
L00003580:
movl -4(%ebp,%ebx,4), %esi
movl %esi, (%eax,%ebx,4)
leal -1(%ebx), %ebx
incl %edx
jne L00003580
L0000358D:
cmpl $3, %ecx
movl %ebp, %edx
jb L000035D7
L00003594:
movl 92(%esp), %eax
notl %eax
orl $1056964608, %eax
leal (%edi,%eax,4), %eax
.align 4, 0x90
L000035B0:
movl -4(%edx,%ebx,4), %ecx
movl %ecx, (%eax,%ebx,4)
movl -8(%edx,%ebx,4), %ecx
movl %ecx, -4(%eax,%ebx,4)
movl -12(%edx,%ebx,4), %ecx
movl %ecx, -8(%eax,%ebx,4)
movl -16(%edx,%ebx,4), %ecx
movl %ecx, -12(%eax,%ebx,4)
leal -4(%ebx), %ebx
cmpl $1, %ebx
jg L000035B0
L000035D7:
movl 40(%esp), %ecx
movl %ecx, %eax
orl $2, %eax
cmpl $2, %eax
jne L000035EE
L000035E5:
movl 104(%esp), %edx
jmp L00003D41
L000035EE:
movl 88(%esp), %edx
movl (%edx), %esi
leal -8(%esi), %edi
movl %esi, %eax
movl 84(%esp), %ebx
subl (%ebx), %eax
cmpl $7, %eax
ja L00003618
L00003604:
movl $14, (%esp)
movl %ecx, %ebx
movl %edx, %ebp
call _pari_err
L00003614:
movl %ebp, %edx
movl %ebx, %ecx
L00003618:
movl %edi, (%edx)
movl $738197506, -8(%esi)
movl 96(%esp), %eax
movl %eax, -4(%esi)
movl %edi, (%ecx)
movl 104(%esp), %edx
jmp L00003D41
L00003633:
movl %edx, 96(%esp)
movl 64(%esp), %eax
xorl %edx, %edx
L0000363D:
cmpl %edx, 96(%esp)
movl 100(%esp), %ecx
movl 68(%esp), %ebx
je L000036F7
L0000364F:
movl %ebx, 68(%esp)
movl %ecx, %ebp
movl %eax, %edi
negl %edi
cmpl $-3, %edi
movl $-2, %ecx
cmovg %edi, %ecx
leal (%eax,%ecx), %edx
leal 1(%eax,%ecx), %ecx
testb $3, %cl
je L000036AD
L00003670:
movl %esi, %ecx
notl %ecx
orl $1056964608, %ecx
movl 80(%esp), %ebx
leal (%ebx,%ecx,4), %ecx
cmpl $-3, %edi
movl $-2, %ebx
cmovg %edi, %ebx
leal 1(%eax,%ebx), %edi
andl $3, %edi
negl %edi
.align 4, 0x90
L000036A0:
movl -4(%ebp,%eax,4), %ebx
movl %ebx, (%ecx,%eax,4)
leal -1(%eax), %eax
incl %edi
jne L000036A0
L000036AD:
cmpl $3, %edx
movl %ebp, %edi
movl 68(%esp), %ebx
jb L000036F7
L000036B8:
movl %esi, %ecx
notl %ecx
orl $1056964608, %ecx
movl 80(%esp), %edx
leal (%edx,%ecx,4), %ecx
.align 4, 0x90
L000036D0:
movl -4(%edi,%eax,4), %edx
movl %edx, (%ecx,%eax,4)
movl -8(%edi,%eax,4), %edx
movl %edx, -4(%ecx,%eax,4)
movl -12(%edi,%eax,4), %edx
movl %edx, -8(%ecx,%eax,4)
movl -16(%edi,%eax,4), %edx
movl %edx, -12(%ecx,%eax,4)
leal -4(%eax), %eax
cmpl $1, %eax
jg L000036D0
L000036F7:
addl $2, 76(%esp)
movl %esi, %eax
notl %eax
movl %esi, %ecx
orl $-16777216, %ecx
xorl $16777215, %ecx
movl %ecx, 60(%esp)
andl $16777215, %esi
movl $2, %ecx
subl %esi, %ecx
movl %ecx, 24(%esp)
movl 48(%esp), %ebp
leal 8(%ebp), %ecx
movl %ecx, 16(%esp)
sall $2, %esi
movl 80(%esp), %edx
movl %edx, %ecx
subl %esi, %ecx
movl %ecx, 44(%esp)
leal 16(%ebp), %ecx
movl %ecx, 12(%esp)
orl $1056964608, %eax
leal (%edx,%eax,4), %eax
movl %eax, 84(%esp)
movl 56(%esp), %edx
movl 104(%esp), %esi
.align 4, 0x90
L00003760:
subl %edx, %esi
movl %esi, %edi
sarl $5, %edi
movl %esi, %ecx
andl $31, %ecx
movl $1, %eax
sall %cl, %eax
movl 76(%esp), %ecx
leal (%ecx,%edi), %ecx
orl %eax, (%ebx,%ecx,4)
movl %esi, %ecx
movl (%ebp), %esi
andl $16777215, %esi
andl $31, %ecx
je L00003800
L0000378D:
cmpl $3, %esi
jb L00003900
L00003796:
movl $32, %eax
subl %ecx, %eax
movl %eax, 96(%esp)
movl %edi, %edx
subl 64(%esp), %edx
cmpl $2, %esi
movl $3, %ebx
cmovg %esi, %ebx
leal -2(%ebx), %eax
addl $-3, %ebx
testb $1, %al
je L00003909
L000037C0:
movl %edi, 92(%esp)
movl %esi, 100(%esp)
movl %edx, %edi
movl %edi, 52(%esp)
movl 8(%ebp), %edx
movl %ecx, %esi
sall %cl, %edx
movl 80(%esp), %eax
xorl %edx, 8(%eax,%edi,4)
movl %ebp, %eax
movl 8(%eax), %ebp
movl 96(%esp), %ecx
shrl %cl, %ebp
movl $3, %edx
jmp L00003920
L000037F2:
.align 4, 0x90
L00003800:
cmpl $3, %esi
jb L00003900
L00003809:
movl %edi, %eax
movl %edi, 92(%esp)
subl 64(%esp), %eax
movl %eax, 104(%esp)
cmpl $3, %esi
movl $3, %ecx
cmova %esi, %ecx
movl $2, %edx
cmpl $2, %ecx
je L00003A39
L00003830:
leal -2(%ecx), %edi
andl $-4, %edi
orl $2, %edi
cmpl $3, %esi
movl $3, %eax
cmova %esi, %eax
movl %esi, 100(%esp)
cmpl $2, %edi
movl $2, %edx
je L00003A23
L00003856:
movl %edi, 96(%esp)
leal -4(%ebp,%eax,4), %esi
movl 24(%esp), %ebp
movl 92(%esp), %ebx
leal (%ebp,%ebx), %ebp
movl 80(%esp), %edi
leal (%edi,%ebp,4), %ebp
cmpl %esi, %ebp
movl 68(%esp), %ebx
ja L00003892
L00003879:
addl 92(%esp), %eax
addl 60(%esp), %eax
movl 80(%esp), %edi
leal (%edi,%eax,4), %eax
cmpl %eax, 16(%esp)
jbe L00003A23
L00003892:
movl 100(%esp), %eax
cmpl $3, %eax
movl $3, %edx
cmova %eax, %edx
addl $-2, %edx
andl $-4, %edx
addl $-4, %edx
shrl $2, %edx
leal 1(%edx), %eax
movl $2, %edi
testb $1, %al
je L000038DF
L000038B9:
movl 48(%esp), %eax
movdqu 8(%eax), %xmm0
movl 80(%esp), %eax
movl 104(%esp), %esi
movdqu 8(%eax,%esi,4), %xmm1
pxor %xmm0, %xmm1
movdqu %xmm1, 8(%eax,%esi,4)
movl $6, %edi
L000038DF:
testl %edx, %edx
movl 96(%esp), %esi
jne L000039B3
L000038EB:
movl %esi, %edx
jmp L00003A23
L000038F2:
.align 4, 0x90
L00003900:
movl 88(%esp), %eax
jmp L00003AA4
L00003909:
movl %edx, 52(%esp)
movl %edi, 92(%esp)
movl %esi, 100(%esp)
movl %ecx, %esi
movl %ebp, %eax
movl $2, %edx
xorl %ebp, %ebp
L00003920:
testl %ebx, %ebx
movl %esi, %ecx
movl 100(%esp), %edi
je L00003984
L0000392A:
movl %ecx, 104(%esp)
movl 44(%esp), %ecx
movl 92(%esp), %edi
leal (%ecx,%edi,4), %ecx
movl %ecx, 92(%esp)
.align 4, 0x90
L00003940:
movl (%eax,%edx,4), %edi
movl %eax, %esi
movl 104(%esp), %ecx
sall %cl, %edi
orl %ebp, %edi
movl 92(%esp), %eax
xorl %edi, (%eax,%edx,4)
movl (%esi,%edx,4), %edi
movl 96(%esp), %ebx
movb %bl, %cl
shrl %cl, %edi
movl 4(%esi,%edx,4), %ebp
movl 104(%esp), %ecx
sall %cl, %ebp
orl %edi, %ebp
movl 100(%esp), %edi
xorl %ebp, 4(%eax,%edx,4)
movl 4(%esi,%edx,4), %ebp
movb %bl, %cl
shrl %cl, %ebp
movl %esi, %eax
addl $2, %edx
cmpl %edi, %edx
jl L00003940
L00003984:
movl %eax, %ecx
testl %ebp, %ebp
movl 88(%esp), %eax
je L000039A8
L0000398E:
cmpl $3, %edi
movl $3, %edx
cmovbe %edx, %edi
movl %edi, %edx
movl 52(%esp), %edi
addl %edx, %edi
movl 80(%esp), %edx
xorl %ebp, (%edx,%edi,4)
L000039A8:
movl %ecx, %ebp
movl 56(%esp), %edx
jmp L00003AA0
L000039B3:
movl 92(%esp), %eax
leal (%edi,%eax), %eax
movl 44(%esp), %edx
leal (%edx,%eax,4), %edx
movl 12(%esp), %eax
leal (%eax,%edi,4), %ebp
movl 100(%esp), %eax
cmpl $3, %eax
movl $3, %ebx
cmova %eax, %ebx
addl $-2, %ebx
andl $-4, %ebx
orl $2, %ebx
subl %edi, %ebx
xorl %eax, %eax
.align 4, 0x90
L000039F0:
movups -16(%ebp,%eax,4), %xmm0
movups (%edx,%eax,4), %xmm1
xorps %xmm0, %xmm1
movups %xmm1, (%edx,%eax,4)
movdqu (%ebp,%eax,4), %xmm0
movdqu 16(%edx,%eax,4), %xmm1
pxor %xmm0, %xmm1
movdqu %xmm1, 16(%edx,%eax,4)
addl $8, %eax
cmpl %eax, %ebx
jne L000039F0
L00003A1D:
movl %esi, %edx
movl 68(%esp), %ebx
L00003A23:
cmpl %edx, %ecx
movl 48(%esp), %ebp
movl 100(%esp), %esi
jne L00003A39
L00003A2F:
movl 88(%esp), %eax
movl 56(%esp), %edx
jmp L00003AA4
L00003A39:
leal 1(%edx), %ecx
cmpl %esi, %ecx
movl %esi, %ebx
cmovge %ecx, %ebx
movl %ebx, %eax
subl %edx, %eax
decl %ebx
subl %edx, %ebx
testb $1, %al
je L00003A61
L00003A4E:
movl (%ebp,%edx,4), %eax
movl 104(%esp), %edi
addl %edx, %edi
movl 80(%esp), %edx
xorl %eax, (%edx,%edi,4)
jmp L00003A63
L00003A61:
movl %edx, %ecx
L00003A63:
movl 56(%esp), %edx
movl 92(%esp), %edi
testl %ebx, %ebx
jne L00003A75
L00003A6F:
movl 88(%esp), %eax
jmp L00003AA0
L00003A75:
movl %edx, %ebx
movl 44(%esp), %eax
leal (%eax,%edi,4), %eax
.align 4, 0x90
L00003A80:
movl (%ebp,%ecx,4), %edx
xorl %edx, (%eax,%ecx,4)
movl 4(%ebp,%ecx,4), %edx
xorl %edx, 4(%eax,%ecx,4)
addl $2, %ecx
cmpl %esi, %ecx
jl L00003A80
L00003A96:
movl 88(%esp), %eax
movl %ebx, %edx
.align 4, 0x90
L00003AA0:
movl 68(%esp), %ebx
L00003AA4:
movl 84(%esp), %ecx
.align 4, 0x90
L00003AB0:
movl %eax, %esi
cmpl $3, %esi
jl L00003AC0
L00003AB7:
leal -1(%esi), %eax
cmpl $0, (%ecx,%esi,4)
je L00003AB0
L00003AC0:
cmpl $2, %esi
jne L00003AE0
L00003AC5:
movl %ecx, 84(%esp)
movl $2, 88(%esp)
movl $-1, %esi
jmp L00003B40
L00003AD8:
.align 4, 0x90
L00003AE0:
movl %ebx, %edi
movl %ecx, 84(%esp)
movl 60(%esp), %eax
leal (%eax,%esi), %eax
movl 80(%esp), %ecx
movl (%ecx,%eax,4), %ecx
movl %ecx, %eax
shrl $16, %eax
cmpl $65535, %ecx
cmovbe %ecx, %eax
movl $28, %ecx
movl $12, %ebx
cmova %ebx, %ecx
cmpl $256, %eax
jb L00003B1C
L00003B16:
addl $-8, %ecx
shrl $8, %eax
L00003B1C:
movl %edi, %ebx
movl %esi, 88(%esp)
sall $5, %esi
cmpl $16, %eax
jb L00003B30
L00003B2A:
addl $-4, %ecx
shrl $4, %eax
L00003B30:
addl $-65, %esi
subl %ecx, %esi
movl 72(%esp), %ecx
subl _F2x_degree_lg.__bfffo_tabshi-L00002E3C(%ecx,%eax,4), %esi
L00003B40:
cmpl %edx, %esi
jge L00003760
L00003B48:
movl 32(%esp), %ecx
movl (%ecx), %eax
andl $16777215, %eax
movl %eax, 4(%esp)
movl %ecx, (%esp)
call _Flx_renormalize
L00003B5F:
movl %eax, %edx
movl 40(%esp), %eax
testl %eax, %eax
je L00003BBC
L00003B69:
movl %edx, %ebx
movl 88(%esp), %ecx
movl %ecx, 4(%esp)
movl 28(%esp), %ecx
movl %ecx, (%esp)
movl %eax, %esi
call _Flx_renormalize
L00003B81:
movl %esi, %ecx
cmpl $2, %ecx
jne L00003BB3
L00003B88:
movl $16777215, %ecx
movl (%eax), %edx
andl %ecx, %edx
cmpl $2, %edx
jne L00003BFB
L00003B96:
addl $8, %eax
movl 20(%esp), %ecx
cmpl (%ecx), %eax
jb L00003BB5
L00003BA1:
movl 72(%esp), %ecx
movl L_top$non_lazy_ptr-L00002E3C(%ecx), %ecx
cmpl (%ecx), %eax
jae L00003BB5
L00003BAF:
movl 36(%esp), %ecx
L00003BB3:
movl %eax, (%ecx)
L00003BB5:
movl %ebx, %edx
jmp L00003D41
L00003BBC:
movl $16777215, %eax
movl 28(%esp), %ecx
andl (%ecx), %eax
subl 64(%esp), %eax
movl 80(%esp), %ecx
leal (%ecx,%eax,4), %eax
movl 20(%esp), %ecx
cmpl (%ecx), %eax
jb L00003D41
L00003BDE:
movl 72(%esp), %ecx
movl L_top$non_lazy_ptr-L00002E3C(%ecx), %ecx
cmpl (%ecx), %eax
jae L00003D41
L00003BF0:
movl 36(%esp), %ecx
movl %eax, (%ecx)
jmp L00003D41
L00003BFB:
andl (%ebx), %ecx
leal (%ebx,%ecx,4), %eax
movl 36(%esp), %ecx
movl %eax, (%ecx)
xorl %edx, %edx
jmp L00003D41
L00003C0D:
movl 100(%esp), %ecx
movl 104(%esp), %edx
jmp L00003CA2
L00003C1A:
movl 104(%esp), %edx
L00003C1E:
movl 88(%esp), %eax
xorl %ecx, %ecx
jmp L00003C96
L00003C26:
movl %esi, %eax
subl 84(%esp), %eax
movl %eax, 80(%esp)
cmpl $-3, %ebx
movl $-2, %eax
cmovg %ebx, %eax
leal 1(%eax,%edx), %edi
andl $-8, %edi
movl 72(%esp), %eax
movdqa LC00009400-L00002E3C(%eax), %xmm0
.align 4, 0x90
L00003C50:
movd %edx, %xmm1
pshufd $0, %xmm1, %xmm1
paddd %xmm0, %xmm1
movd %xmm1, %eax
movdqu -12(%ecx,%eax,4), %xmm1
movups -28(%ecx,%eax,4), %xmm2
subl %esi, %eax
movdqu %xmm1, -12(%ebp,%eax,4)
movups %xmm2, -28(%ebp,%eax,4)
addl $-8, %edx
addl $-8, %edi
jne L00003C50
L00003C81:
movl 80(%esp), %esi
movl 84(%esp), %ecx
movl 104(%esp), %edx
movl $-2, %edi
movl 88(%esp), %eax
L00003C96:
cmpl %ecx, %eax
movl 100(%esp), %ecx
je L00003D37
L00003CA2:
movl %edx, 104(%esp)
movl %ecx, %ebx
movl %esi, %edx
negl %edx
cmpl $-3, %edx
cmovg %edx, %edi
leal (%esi,%edi), %ecx
leal 1(%esi,%edi), %eax
testb $3, %al
je L00003CED
L00003CBD:
movl 92(%esp), %eax
notl %eax
orl $1056964608, %eax
leal (%ebp,%eax,4), %eax
cmpl $-3, %edx
movl $-2, %edi
cmovg %edx, %edi
leal 1(%esi,%edi), %edx
andl $3, %edx
negl %edx
L00003CE0:
movl -4(%ebx,%esi,4), %edi
movl %edi, (%eax,%esi,4)
leal -1(%esi), %esi
incl %edx
jne L00003CE0
L00003CED:
cmpl $3, %ecx
movl 104(%esp), %edx
jb L00003D37
L00003CF6:
movl 92(%esp), %eax
notl %eax
orl $1056964608, %eax
leal (%ebp,%eax,4), %eax
.align 4, 0x90
L00003D10:
movl -4(%ebx,%esi,4), %ecx
movl %ecx, (%eax,%esi,4)
movl -8(%ebx,%esi,4), %ecx
movl %ecx, -4(%eax,%esi,4)
movl -12(%ebx,%esi,4), %ecx
movl %ecx, -8(%eax,%esi,4)
movl -16(%ebx,%esi,4), %ecx
movl %ecx, -12(%eax,%esi,4)
leal -4(%esi), %esi
cmpl $1, %esi
jg L00003D10
L00003D37:
movl 40(%esp), %eax
movl 96(%esp), %ecx
movl %ecx, (%eax)
L00003D41:
movl %edx, %eax
addl $108, %esp
popl %esi
popl %edi
popl %ebx
popl %ebp
ret
L00003D4B:
movl 100(%esp), %ebp
jmp L00003DCA
L00003D51:
movl %esi, %eax
movl 88(%esp), %edi
subl %edi, %eax
movl %eax, 84(%esp)
cmpl $-3, %ebp
movl $-2, %eax
cmovg %ebp, %eax
leal 1(%eax,%edx), %ebp
andl $-8, %ebp
movl 72(%esp), %eax
movdqa LC00009400-L00002E3C(%eax), %xmm0
L00003D7B:
movd %edx, %xmm1
pshufd $0, %xmm1, %xmm1
paddd %xmm0, %xmm1
movd %xmm1, %eax
movdqu -12(%ecx,%eax,4), %xmm1
movups -28(%ecx,%eax,4), %xmm2
subl %esi, %eax
movdqu %xmm1, -12(%ebx,%eax,4)
movups %xmm2, -28(%ebx,%eax,4)
addl $-8, %edx
addl $-8, %ebp
jne L00003D7B
L00003DAC:
movl 84(%esp), %esi
movl $-2, %eax
movl 92(%esp), %edx
L00003DB9:
cmpl %edi, %edx
movl 100(%esp), %ebp
jne L00003DCA
L00003DC1:
movl 104(%esp), %edx
jmp L00003D41
L00003DCA:
movl %esi, %edx
negl %edx
cmpl $-3, %edx
cmovg %edx, %eax
leal (%esi,%eax), %ecx
leal 1(%esi,%eax), %eax
testb $3, %al
je L00003E0E
L00003DDF:
movl 96(%esp), %eax
notl %eax
orl $1056964608, %eax
leal (%ebx,%eax,4), %eax
cmpl $-3, %edx
movl $-2, %edi
cmovg %edx, %edi
leal 1(%esi,%edi), %edx
andl $3, %edx
negl %edx
L00003E01:
movl -4(%ebp,%esi,4), %edi
movl %edi, (%eax,%esi,4)
leal -1(%esi), %esi
incl %edx
jne L00003E01
L00003E0E:
cmpl $3, %ecx
jae L00003E1C
L00003E13:
movl 104(%esp), %edx
jmp L00003D41
L00003E1C:
movl 96(%esp), %eax
notl %eax
orl $1056964608, %eax
leal (%ebx,%eax,4), %eax
movl 104(%esp), %edx
L00003E2E:
movl -4(%ebp,%esi,4), %ecx
movl %ecx, (%eax,%esi,4)
movl -8(%ebp,%esi,4), %ecx
movl %ecx, -4(%eax,%esi,4)
movl -12(%ebp,%esi,4), %ecx
movl %ecx, -8(%eax,%esi,4)
movl -16(%ebp,%esi,4), %ecx
movl %ecx, -12(%eax,%esi,4)
leal -4(%esi), %esi
cmpl $1, %esi
jg L00003E2E
L00003E55:
jmp L00003D41
# ----------------------
.align 4, 0x90
.globl _F2x_deriv
_F2x_deriv:
pushl %ebp
pushl %ebx
pushl %edi
pushl %esi
subl $28, %esp
call L00003E6C
L00003E6C:
popl %edx
movl %edx, 20(%esp)
movl 48(%esp), %edi
movl (%edi), %esi
andl $16777215, %esi
movl L_avma$non_lazy_ptr-L00003E6C(%edx), %ebp
movl (%ebp), %ecx
movl %ecx, 24(%esp)
leal 0(,%esi,4), %eax
movl %ecx, %ebx
subl %eax, %ebx
movl L_bot$non_lazy_ptr-L00003E6C(%edx), %eax
subl (%eax), %ecx
shrl $2, %ecx
cmpl %esi, %ecx
jae L00003EB0
L00003EA4:
movl $14, (%esp)
call _pari_err
L00003EB0:
movl %ebx, (%ebp)
movl %esi, %eax
orl $738197504, %eax
movl %eax, (%ebx)
movl 4(%edi), %eax
movl $1, %ecx
subl %esi, %ecx
movl 24(%esp), %edx
movl %eax, (%edx,%ecx,4)
cmpl $3, %esi
jb L00004035
L00003ED6:
movl $3, %eax
cmova %esi, %eax
movl $2, %edx
cmpl $2, %eax
je L00003FB9
L00003EEC:
leal -2(%eax), %ecx
movl %eax, 16(%esp)
andl $-8, %ecx
orl $2, %ecx
movl %ecx, 12(%esp)
leal -1(%esi), %eax
cmpl $3, %esi
movl $2, %edx
cmovbe %edx, %eax
cmpl $2, %ecx
je L00003FB3
L00003F14:
leal (%edi,%eax,4), %ecx
movl %ecx, 8(%esp)
movl $2, %edx
movl $2, %ebp
subl %esi, %ebp
movl 24(%esp), %ecx
leal (%ecx,%ebp,4), %ebp
cmpl 8(%esp), %ebp
ja L00003F45
L00003F34:
leal 8(%edi), %ecx
subl %esi, %eax
movl 24(%esp), %ebp
leal (%ebp,%eax,4), %eax
cmpl %eax, %ecx
jbe L00003FB3
L00003F45:
movl $6, %eax
subl %esi, %eax
movl 24(%esp), %ecx
leal (%ecx,%eax,4), %edx
leal 24(%edi), %ecx
cmpl $3, %esi
movl $3, %eax
cmova %esi, %eax
addl $-2, %eax
andl $-8, %eax
movl 20(%esp), %ebp
movdqa LC00009410-L00003E6C(%ebp), %xmm0
.align 4, 0x90
L00003F80:
movdqu -16(%ecx), %xmm1
movdqu (%ecx), %xmm2
psrld $1, %xmm1
psrld $1, %xmm2
pand %xmm0, %xmm1
pand %xmm0, %xmm2
movdqu %xmm1, -16(%edx)
movdqu %xmm2, (%edx)
addl $32, %edx
addl $32, %ecx
addl $-8, %eax
jne L00003F80
L00003FAF:
movl 12(%esp), %edx
L00003FB3:
cmpl %edx, 16(%esp)
je L00004035
L00003FB9:
movl %ebx, 20(%esp)
leal 1(%edx), %eax
cmpl %esi, %eax
movl %esi, %ecx
cmovge %eax, %ecx
movl %ecx, %ebx
subl %edx, %ebx
decl %ecx
subl %edx, %ecx
testb $1, %bl
je L00003FEA
L00003FD3:
movl (%edi,%edx,4), %ebx
shrl $1, %ebx
andl $1431655765, %ebx
subl %esi, %edx
movl 24(%esp), %ebp
movl %ebx, (%ebp,%edx,4)
jmp L00003FEC
L00003FEA:
movl %edx, %eax
L00003FEC:
movl 20(%esp), %ebx
testl %ecx, %ecx
je L00004035
L00003FF4:
movl $1, %ecx
subl %esi, %ecx
movl 24(%esp), %edx
leal (%edx,%ecx,4), %ecx
.align 4, 0x90
L00004010:
movl (%edi,%eax,4), %edx
shrl $1, %edx
andl $1431655765, %edx
movl %edx, -4(%ecx,%eax,4)
movl 4(%edi,%eax,4), %edx
shrl $1, %edx
andl $1431655765, %edx
movl %edx, (%ecx,%eax,4)
addl $2, %eax
cmpl %esi, %eax
jl L00004010
L00004035:
movl %esi, 4(%esp)
movl %ebx, (%esp)
call _Flx_renormalize
L00004041:
addl $28, %esp
popl %esi
popl %edi
popl %ebx
popl %ebp
ret
# ----------------------
.align 4, 0x90
.globl _F2x_gcd
_F2x_gcd:
pushl %ebp
pushl %ebx
pushl %edi
pushl %esi
subl $60, %esp
call L0000405C
L0000405C:
popl %ecx
movl %ecx, 48(%esp)
movl 84(%esp), %edx
movl 80(%esp), %eax
movl %eax, 56(%esp)
movl %edx, 52(%esp)
movl L_avma$non_lazy_ptr-L0000405C(%ecx), %ebx
movl (%ebx), %esi
movl %esi, 40(%esp)
movl L_bot$non_lazy_ptr-L0000405C(%ecx), %ecx
movl %ecx, 36(%esp)
movl (%ecx), %ecx
movl %ecx, 44(%esp)
subl %ecx, %esi
shrl $2, %esi
movl (%edx), %edi
movl %edi, %ecx
andl $16777215, %ecx
movl (%eax), %edx
movl %edx, %ebp
andl $16777215, %ebp
cmpl %ebp, %ecx
jbe L000040B8
L000040AA:
movl 84(%esp), %ecx
movl %ecx, 56(%esp)
movl %eax, 52(%esp)
jmp L000040C0
L000040B8:
movl %eax, %ecx
movl %edi, %edx
movl 84(%esp), %eax
L000040C0:
movl 40(%esp), %edi
movl 44(%esp), %ebp
addl %ebp, %esi
andl $16777215, %edx
cmpl $2, %edx
movl %edi, %edx
je L000041D1
L000040DB:
movl $16777215, %ebp
movl 48(%esp), %edx
leal LC00009540-L0000405C(%edx), %edx
movl %edx, 44(%esp)
jmp L000040F4
L000040F0:
movl 56(%esp), %ecx
L000040F4:
movl %eax, 4(%esp)
movl %ecx, (%esp)
call _F2x_rem
L00004100:
movl 52(%esp), %ecx
movl %ecx, 56(%esp)
movl %eax, 52(%esp)
cmpl %esi, (%ebx)
jae L000041C2
L00004114:
movl 48(%esp), %ecx
movl L_DEBUGMEM$non_lazy_ptr-L0000405C(%ecx), %ecx
cmpl $2, (%ecx)
jb L0000419E
L00004123:
movl (%eax), %ecx
andl %ebp, %ecx
movl $-1, %edx
cmpl $2, %ecx
je L00004186
L00004131:
movl %edi, %ebp
movl -4(%eax,%ecx,4), %edx
movl %edx, %eax
shrl $16, %eax
cmpl $65535, %edx
cmovbe %edx, %eax
movl $28, %edx
movl $12, %edi
cmova %edi, %edx
cmpl $256, %eax
jb L0000415F
L00004159:
addl $-8, %edx
shrl $8, %eax
L0000415F:
movl %ebp, %edi
sall $5, %ecx
cmpl $16, %eax
movl $16777215, %ebp
jb L00004174
L0000416E:
addl $-4, %edx
shrl $4, %eax
L00004174:
addl $-65, %ecx
subl %edx, %ecx
movl 48(%esp), %edx
subl _F2x_degree_lg.__bfffo_tabshi-L0000405C(%edx,%eax,4), %ecx
movl %ecx, %edx
L00004186:
movl %edx, 8(%esp)
movl 44(%esp), %eax
movl %eax, 4(%esp)
movl $3, (%esp)
call _pari_warn
L0000419E:
leal 52(%esp), %eax
movl %eax, 12(%esp)
leal 56(%esp), %eax
movl %eax, 8(%esp)
movl %edi, (%esp)
movl $2, 4(%esp)
call _gerepileall
L000041BE:
movl 52(%esp), %eax
L000041C2:
movl (%eax), %ecx
andl %ebp, %ecx
cmpl $2, %ecx
jne L000040F0
L000041CF:
movl (%ebx), %edx
L000041D1:
movl 56(%esp), %eax
cmpl %esi, %edx
jae L00004256
L000041D9:
movl 36(%esp), %ecx
cmpl (%ecx), %eax
jb L00004250
L000041E1:
movl 48(%esp), %ecx
movl L_top$non_lazy_ptr-L0000405C(%ecx), %ecx
cmpl (%ecx), %eax
jae L00004250
L000041EF:
cmpl %eax, %edi
jbe L00004250
L000041F3:
movl (%eax), %ebp
movl %ebp, %ecx
andl $16777215, %ecx
sall $2, %ecx
movl %edi, %esi
subl %ecx, %esi
movl %ebp, %edx
andl $16777215, %edx
movl %esi, (%ebx)
je L0000425E
L00004210:
movl %esi, 44(%esp)
movl %ebp, %esi
movl %ebp, 36(%esp)
orl $-16777216, %esi
movl %esi, %ecx
xorl $16777215, %ecx
cmpl $-16777216, %esi
movl $-2, %ebx
cmove %ecx, %ebx
leal (%ebx,%edx), %ebp
cmpl $-2, %ebp
jne L00004262
L0000423E:
movl %edi, 40(%esp)
movl $-2, %esi
movl 36(%esp), %ebp
jmp L00004345
L00004250:
movl %edi, (%ebx)
L00004252:
movl %eax, 56(%esp)
L00004256:
addl $60, %esp
popl %esi
popl %edi
popl %ebx
popl %ebp
ret
L0000425E:
movl %esi, %eax
jmp L00004252
L00004262:
movl %edi, 40(%esp)
addl $2, %ebp
cmpl $-16777216, %esi
movl $-2, %esi
cmovne %esi, %ecx
xorl %edi, %edi
movl %ebp, %esi
andl $-8, %esi
je L00004329
L00004284:
movl %esi, 28(%esp)
movl %ebp, 32(%esp)
movl $-2, %esi
movl $-2, %edi
subl %ecx, %edi
leal (%eax,%edi,4), %ebp
movl 40(%esp), %edi
leal -4(%edi), %edi
cmpl %ebp, %edi
movl 36(%esp), %ebp
ja L000042C2
L000042AA:
leal -4(%eax,%edx,4), %edi
addl %edx, %ecx
subl %ecx, %esi
movl 40(%esp), %ecx
leal (%ecx,%esi,4), %ecx
cmpl %ecx, %edi
movl $0, %edi
jbe L00004331
L000042C2:
movl %edx, %ecx
subl 28(%esp), %ecx
movl %ecx, 24(%esp)
leal 2(%ebx,%edx), %ebx
andl $-8, %ebx
movl 48(%esp), %ecx
movdqa LC00009420-L0000405C(%ecx), %xmm0
movl %edx, %edi
movl 40(%esp), %ecx
.align 4, 0x90
L000042F0:
movd %edi, %xmm1
pshufd $0, %xmm1, %xmm1
paddd %xmm0, %xmm1
movd %xmm1, %esi
movups -12(%eax,%esi,4), %xmm1
movups -28(%eax,%esi,4), %xmm2
subl %edx, %esi
movups %xmm1, -12(%ecx,%esi,4)
movups %xmm2, -28(%ecx,%esi,4)
addl $-8, %edi
addl $-8, %ebx
jne L000042F0
L0000431F:
movl 24(%esp), %edx
movl 28(%esp), %edi
jmp L00004331
L00004329:
movl %ebp, 32(%esp)
movl 36(%esp), %ebp
L00004331:
cmpl %edi, 32(%esp)
movl $-2, %esi
jne L00004345
L0000433C:
movl 44(%esp), %eax
jmp L00004252
L00004345:
movl %edx, %ebx
notl %ebx
cmpl $-3, %ebx
cmovg %ebx, %esi
leal 2(%edx,%esi), %ecx
leal 1(%edx,%esi), %edi
testb $3, %cl
je L0000439D
L0000435C:
movl %ebp, %ecx
notl %ecx
orl $1056964608, %ecx
movl 40(%esp), %esi
leal (%esi,%ecx,4), %ecx
cmpl $-3, %ebx
movl $-2, %esi
cmovg %ebx, %esi
leal 2(%edx,%esi), %ebx
andl $3, %ebx
negl %ebx
.align 4, 0x90
L00004390:
movl -4(%eax,%edx,4), %esi
movl %esi, (%ecx,%edx,4)
leal -1(%edx), %edx
incl %ebx
jne L00004390
L0000439D:
cmpl $3, %edi
jae L000043AB
L000043A2:
movl 44(%esp), %eax
jmp L00004252
L000043AB:
incl %edx
andl $16777215, %ebp
movl $-4, %ecx
subl %ebp, %ecx
movl 40(%esp), %esi
leal (%esi,%ecx,4), %ecx
movl 44(%esp), %edi
.align 4, 0x90
L000043D0:
movl -8(%eax,%edx,4), %esi
movl %esi, 8(%ecx,%edx,4)
movl -12(%eax,%edx,4), %esi
movl %esi, 4(%ecx,%edx,4)
movl -16(%eax,%edx,4), %esi
movl %esi, (%ecx,%edx,4)
movl -20(%eax,%edx,4), %esi
movl %esi, -4(%ecx,%edx,4)
addl $-4, %edx
cmpl $1, %edx
jg L000043D0
L000043F7:
movl %edi, %eax
jmp L00004252
L000043FE:
.align 4, 0x90
_gerepileall:
pushl %ebp
pushl %ebx
pushl %edi
pushl %esi
subl $76, %esp
call L0000440C
L0000440C:
popl %ecx
movl 100(%esp), %ebx
movl 96(%esp), %ebp
movl L___stack_chk_guard$non_lazy_ptr-L0000440C(%ecx), %edi
movl (%edi), %eax
movl %eax, 72(%esp)
leal 104(%esp), %eax
movl %eax, 28(%esp)
cmpl $9, %ebx
jg L00004498
L0000442E:
testl %ebx, %ebx
jle L00004500
L00004436:
movl %edi, 20(%esp)
movl %ecx, 24(%esp)
xorl %esi, %esi
L00004440:
movl 28(%esp), %eax
leal 4(%eax), %ecx
movl %ecx, 28(%esp)
movl (%eax), %edi
movl %edi, 32(%esp,%esi,4)
movl (%edi), %eax
movl %eax, (%esp)
call _copy_bin
L0000445B:
movl %eax, (%edi)
incl %esi
cmpl %esi, %ebx
jne L00004440
L00004462:
movl 24(%esp), %eax
movl L_avma$non_lazy_ptr-L0000440C(%eax), %eax
movl %ebp, (%eax)
testl %ebx, %ebx
movl 20(%esp), %edi
jle L000045D4
L0000447A:
incl %ebx
.align 4, 0x90
L00004480:
movl 24(%esp,%ebx,4), %esi
movl (%esi), %ecx
call _bin_copy
L0000448B:
movl %eax, (%esi)
decl %ebx
cmpl $1, %ebx
jg L00004480
L00004493:
jmp L000045D4
L00004498:
leal 0(,%ebx,4), %eax
testl %eax, %eax
je L0000450D
L000044A3:
movl %edi, 20(%esp)
movl %ecx, 24(%esp)
movl L_PARI_SIGINT_block$non_lazy_ptr-L0000440C(%ecx), %edi
movl (%edi), %ebp
movl $1, (%edi)
movl %eax, (%esp)
call _malloc
L000044C1:
movl %eax, %esi
movl %ebp, (%edi)
testl %ebp, %ebp
jne L000044E8
L000044C9:
movl 24(%esp), %eax
movl L_PARI_SIGINT_pending$non_lazy_ptr-L0000440C(%eax), %eax
cmpl $0, (%eax)
je L000044E8
L000044D8:
movl (%eax), %ecx
movl $0, (%eax)
movl %ecx, (%esp)
call _raise
L000044E8:
testl %esi, %esi
movl 96(%esp), %ebp
jne L0000453E
L000044F0:
movl $28, (%esp)
call _pari_err
L000044FC:
xorl %esi, %esi
jmp L0000453E
L00004500:
movl L_avma$non_lazy_ptr-L0000440C(%ecx), %eax
movl %ebp, (%eax)
jmp L000045D4
L0000450D:
movl %edi, 20(%esp)
movl L_DEBUGMEM$non_lazy_ptr-L0000440C(%ecx), %eax
xorl %esi, %esi
cmpl $0, (%eax)
je L0000453A
L0000451E:
leal LC0000957B-L0000440C(%ecx), %eax
movl %ecx, 24(%esp)
movl %eax, 4(%esp)
movl $0, (%esp)
call _pari_warn
L00004538:
jmp L0000453E
L0000453A:
movl %ecx, 24(%esp)
L0000453E:
xorl %edi, %edi
L00004540:
movl 28(%esp), %eax
leal 4(%eax), %ecx
movl %ecx, 28(%esp)
movl (%eax), %eax
movl %eax, (%esi,%edi,4)
movl (%eax), %eax
movl %eax, (%esp)
call _copy_bin
L0000455A:
movl (%esi,%edi,4), %ecx
movl %eax, (%ecx)
incl %edi
cmpl %edi, %ebx
jne L00004540
L00004564:
movl 24(%esp), %edi
movl L_avma$non_lazy_ptr-L0000440C(%edi), %eax
movl %ebp, (%eax)
testl %ebx, %ebx
jle L00004597
L00004574:
incl %ebx
.align 4, 0x90
L00004580:
movl -8(%esi,%ebx,4), %eax
movl (%eax), %ecx
call _bin_copy
L0000458B:
movl -8(%esi,%ebx,4), %ecx
movl %eax, (%ecx)
decl %ebx
cmpl $1, %ebx
jg L00004580
L00004597:
movl %edi, %ebp
movl L_PARI_SIGINT_block$non_lazy_ptr-L0000440C(%ebp), %edi
movl (%edi), %ebx
movl $1, (%edi)
movl %esi, (%esp)
call _free
L000045AF:
movl %ebx, (%edi)
testl %ebx, %ebx
movl 20(%esp), %edi
jne L000045D4
L000045B9:
movl L_PARI_SIGINT_pending$non_lazy_ptr-L0000440C(%ebp), %eax
cmpl $0, (%eax)
je L000045D4
L000045C4:
movl (%eax), %ecx
movl $0, (%eax)
movl %ecx, (%esp)
call _raise
L000045D4:
movl (%edi), %eax
cmpl 72(%esp), %eax
jne L000045E4
L000045DC:
addl $76, %esp
popl %esi
popl %edi
popl %ebx
popl %ebp
ret
L000045E4:
call ___stack_chk_fail
L000045E9:
.align 4, 0x90
_gerepileuptoleaf:
pushl %ebp
pushl %ebx
pushl %edi
pushl %esi
subl $24, %esp
call L000045FC
L000045FC:
popl %ebp
movl L_bot$non_lazy_ptr-L000045FC(%ebp), %eax
cmpl (%eax), %edx
jb L00004674
L00004607:
movl L_top$non_lazy_ptr-L000045FC(%ebp), %eax
cmpl (%eax), %edx
jae L00004674
L00004611:
cmpl %edx, %ecx
jbe L00004674
L00004615:
movl (%edx), %ebx
movl %ebx, %eax
andl $16777215, %eax
sall $2, %eax
movl %ecx, %edi
subl %eax, %edi
movl %ebx, %esi
andl $16777215, %esi
movl L_avma$non_lazy_ptr-L000045FC(%ebp), %eax
movl %edi, (%eax)
je L000047F7
L0000463B:
movl %edi, 20(%esp)
movl %ebx, 16(%esp)
orl $-16777216, %ebx
movl %ebx, %eax
xorl $16777215, %eax
movl %eax, 12(%esp)
cmpl $-16777216, %ebx
movl $-2, %edi
cmove %eax, %edi
leal (%edi,%esi), %eax
cmpl $-2, %eax
jne L00004681
L0000466A:
movl $-2, %ebx
jmp L00004751
L00004674:
movl L_avma$non_lazy_ptr-L000045FC(%ebp), %eax
movl %ecx, (%eax)
jmp L000047F9
L00004681:
movl %edi, 8(%esp)
addl $2, %eax
cmpl $-16777216, %ebx
movl 12(%esp), %edi
movl $-2, %ebx
cmovne %ebx, %edi
movl %eax, %ebx
andl $-8, %ebx
je L00004737
L000046A5:
movl %ebx, 4(%esp)
movl %eax, 12(%esp)
movl $-2, %ebx
subl %edi, %ebx
leal (%edx,%ebx,4), %eax
leal -4(%ecx), %ebx
cmpl %eax, %ebx
movl $0, %eax
ja L000046DB
L000046C3:
leal -4(%edx,%esi,4), %ebx
movl %ebx, (%esp)
addl %esi, %edi
movl $-2, %ebx
subl %edi, %ebx
leal (%ecx,%ebx,4), %edi
cmpl %edi, (%esp)
jbe L0000473D
L000046DB:
movl %esi, %edi
subl 4(%esp), %edi
movl 8(%esp), %eax
leal 2(%eax,%esi), %eax
andl $-8, %eax
movdqa LC00009430-L000045FC(%ebp), %xmm0
movl %esi, %ebp
.align 4, 0x90
L00004700:
movd %ebp, %xmm1
pshufd $0, %xmm1, %xmm1
paddd %xmm0, %xmm1
movd %xmm1, %ebx
movups -12(%edx,%ebx,4), %xmm1
movups -28(%edx,%ebx,4), %xmm2
subl %esi, %ebx
movups %xmm1, -12(%ecx,%ebx,4)
movups %xmm2, -28(%ecx,%ebx,4)
addl $-8, %ebp
addl $-8, %eax
jne L00004700
L0000472F:
movl %edi, %esi
movl 4(%esp), %eax
jmp L0000473D
L00004737:
movl %eax, 12(%esp)
xorl %eax, %eax
L0000473D:
cmpl %eax, 12(%esp)
movl $-2, %ebx
jne L00004751
L00004748:
movl 20(%esp), %edx
jmp L000047F9
L00004751:
movl %esi, %edi
notl %edi
cmpl $-3, %edi
cmovg %edi, %ebx
leal 2(%esi,%ebx), %eax
leal 1(%esi,%ebx), %ebx
testb $3, %al
je L0000479D
L00004767:
movl 16(%esp), %eax
notl %eax
orl $1056964608, %eax
leal (%ecx,%eax,4), %eax
cmpl $-3, %edi
movl $-2, %ebp
cmovg %edi, %ebp
leal 2(%esi,%ebp), %edi
andl $3, %edi
negl %edi
.align 4, 0x90
L00004790:
movl -4(%edx,%esi,4), %ebp
movl %ebp, (%eax,%esi,4)
leal -1(%esi), %esi
incl %edi
jne L00004790
L0000479D:
cmpl $3, %ebx
jae L000047A8
L000047A2:
movl 20(%esp), %edx
jmp L000047F9
L000047A8:
incl %esi
movl 16(%esp), %edi
andl $16777215, %edi
movl $-4, %eax
subl %edi, %eax
leal (%ecx,%eax,4), %eax
movl 20(%esp), %edi
.align 4, 0x90
L000047D0:
movl -8(%edx,%esi,4), %ecx
movl %ecx, 8(%eax,%esi,4)
movl -12(%edx,%esi,4), %ecx
movl %ecx, 4(%eax,%esi,4)
movl -16(%edx,%esi,4), %ecx
movl %ecx, (%eax,%esi,4)
movl -20(%edx,%esi,4), %ecx
movl %ecx, -4(%eax,%esi,4)
addl $-4, %esi
cmpl $1, %esi
jg L000047D0
L000047F7:
movl %edi, %edx
L000047F9:
movl %edx, %eax
addl $24, %esp
popl %esi
popl %edi
popl %ebx
popl %ebp
ret
# ----------------------
.align 4, 0x90
.globl _F2x_extgcd
_F2x_extgcd:
pushl %ebp
pushl %ebx
pushl %edi
pushl %esi
subl $76, %esp
call L0000481C
L0000481C:
popl %ecx
movl %ecx, 40(%esp)
movl 96(%esp), %edx
movl L_avma$non_lazy_ptr-L0000481C(%ecx), %ebp
movl (%ebp), %eax
movl L_bot$non_lazy_ptr-L0000481C(%ecx), %esi
movl (%esi), %edi
movl %edi, 28(%esp)
movl %eax, %ecx
subl %edi, %ecx
movl %ecx, 48(%esp)
movl 4(%edx), %edi
movl %edi, 32(%esp)
movl %edx, 64(%esp)
movl 100(%esp), %edx
movl %edx, 60(%esp)
cmpl $7, %ecx
leal -8(%eax), %edi
movl %eax, %ebx
ja L0000486B
L0000485F:
movl $14, (%esp)
call _pari_err
L0000486B:
movl %ebp, 44(%esp)
movl %edi, (%ebp)
movl %ebx, 36(%esp)
movl $738197506, -8(%ebx)
movl 32(%esp), %eax
movl %eax, -4(%ebx)
movl %eax, %ebx
movl %edi, 68(%esp)
movl (%ebp), %edi
movl %edi, %eax
subl (%esi), %eax
shrl $2, 48(%esp)
cmpl $11, %eax
leal -12(%edi), %esi
ja L000048AA
L0000489E:
movl $14, (%esp)
call _pari_err
L000048AA:
movl 28(%esp), %eax
addl %eax, 48(%esp)
movl 44(%esp), %eax
movl %esi, (%eax)
movl $738197507, -12(%edi)
movl %ebx, -8(%edi)
movl $1, -4(%edi)
movl %esi, 56(%esp)
movl 60(%esp), %eax
movl $16777215, %edi
movl (%eax), %ecx
andl %edi, %ecx
cmpl $2, %ecx
je L00004A53
L000048E3:
movl 40(%esp), %ecx
leal LC00009552-L0000481C(%ecx), %ecx
movl %ecx, 32(%esp)
.align 4, 0x90
L00004900:
movl 64(%esp), %ecx
leal 52(%esp), %edx
movl %edx, 8(%esp)
movl %eax, 4(%esp)
movl %ecx, (%esp)
call _F2x_divrem
L00004918:
movl %eax, %esi
movl 68(%esp), %ebx
movl 56(%esp), %edx
leal 8(%esi), %ecx
movl (%esi), %eax
andl %edi, %eax
addl $-2, %eax
movl (%edx), %ebp
andl %edi, %ebp
addl $8, %edx
addl $-2, %ebp
movl %ebp, 4(%esp)
movl %eax, (%esp)
call _F2x_mulspec
L00004942:
movl 4(%esi), %ecx
movl %ecx, 4(%eax)
movl %eax, 4(%esp)
movl %ebx, (%esp)
call _F2x_add
L00004954:
movl 56(%esp), %ecx
movl %ecx, 68(%esp)
movl %eax, 56(%esp)
movl 52(%esp), %eax
movl %eax, 72(%esp)
movl 60(%esp), %ecx
movl %ecx, 64(%esp)
movl %eax, 60(%esp)
movl 44(%esp), %edx
movl 48(%esp), %esi
cmpl %esi, (%edx)
jae L00004A46
L00004984:
movl 40(%esp), %eax
movl L_DEBUGMEM$non_lazy_ptr-L0000481C(%eax), %eax
cmpl $2, (%eax)
jb L00004A06
L00004993:
movl (%ecx), %eax
andl %edi, %eax
movl $-1, %edx
cmpl $2, %eax
je L000049EE
L000049A1:
movl -4(%ecx,%eax,4), %edx
movl %edx, %ecx
shrl $16, %ecx
cmpl $65535, %edx
cmovbe %edx, %ecx
movl $28, %edx
movl $12, %esi
cmova %esi, %edx
cmpl $256, %ecx
jb L000049CE
L000049C8:
addl $-8, %edx
shrl $8, %ecx
L000049CE:
sall $5, %eax
cmpl $16, %ecx
jb L000049DC
L000049D6:
addl $-4, %edx
shrl $4, %ecx
L000049DC:
addl $-65, %eax
subl %edx, %eax
movl 40(%esp), %edx
subl _F2x_degree_lg.__bfffo_tabshi-L0000481C(%edx,%ecx,4), %eax
movl %eax, %edx
L000049EE:
movl %edx, 8(%esp)
movl 32(%esp), %eax
movl %eax, 4(%esp)
movl $3, (%esp)
call _pari_warn
L00004A06:
leal 56(%esp), %eax
movl %eax, 24(%esp)
leal 68(%esp), %eax
movl %eax, 20(%esp)
leal 72(%esp), %eax
movl %eax, 16(%esp)
leal 60(%esp), %eax
movl %eax, 12(%esp)
leal 64(%esp), %eax
movl %eax, 8(%esp)
movl 36(%esp), %eax
movl %eax, (%esp)
movl $5, 4(%esp)
call _gerepileall
L00004A42:
movl 60(%esp), %eax
L00004A46:
movl (%eax), %ecx
andl %edi, %ecx
cmpl $2, %ecx
jne L00004900
L00004A53:
movl 108(%esp), %edx
movl 104(%esp), %esi
testl %esi, %esi
je L00004AC5
L00004A5F:
movl 64(%esp), %edi
movl %edx, %esi
movl 68(%esp), %edx
movl 100(%esp), %eax
movl %eax, %ebp
leal 8(%ebp), %ecx
movl $16777215, %eax
movl (%ebp), %ebx
andl %eax, %ebx
addl $-2, %ebx
andl (%edx), %eax
addl $8, %edx
addl $-2, %eax
movl %eax, 4(%esp)
movl %ebx, (%esp)
call _F2x_mulspec
L00004A93:
movl 4(%ebp), %ecx
movl %ecx, 4(%eax)
movl %eax, 4(%esp)
movl %edi, (%esp)
call _F2x_add
L00004AA5:
movl 96(%esp), %ecx
movl %ecx, 4(%esp)
movl %eax, (%esp)
movl $0, 8(%esp)
call _F2x_divrem
L00004ABD:
movl %esi, %edx
movl 104(%esp), %esi
movl %eax, (%esi)
L00004AC5:
movl 68(%esp), %eax
movl %eax, (%edx)
movl 44(%esp), %eax
movl 48(%esp), %ecx
cmpl %ecx, (%eax)
jae L00004B02
L00004AD7:
testl %esi, %esi
setne %al
movzbl %al, %eax
orl $2, %eax
movl %esi, 16(%esp)
movl %edx, 12(%esp)
leal 64(%esp), %ecx
movl %ecx, 8(%esp)
movl 36(%esp), %ecx
movl %ecx, (%esp)
movl %eax, 4(%esp)
call _gerepileall
L00004B02:
movl 64(%esp), %eax
addl $76, %esp
popl %esi
popl %edi
popl %ebx
popl %ebp
ret
# ----------------------
.align 4, 0x90
.globl _F2xq_mul
_F2xq_mul:
pushl %ebx
pushl %edi
pushl %esi
subl $16, %esp
movl 40(%esp), %esi
movl 36(%esp), %edx
movl 32(%esp), %edi
leal 8(%edi), %ecx
movl $16777215, %eax
movl (%edi), %ebx
andl %eax, %ebx
addl $-2, %ebx
andl (%edx), %eax
addl $8, %edx
addl $-2, %eax
movl %eax, 4(%esp)
movl %ebx, (%esp)
call _F2x_mulspec
L00004B45:
movl 4(%edi), %ecx
movl %ecx, 4(%eax)
movl %esi, 4(%esp)
movl %eax, (%esp)
call _F2x_rem
L00004B57:
addl $16, %esp
popl %esi
popl %edi
popl %ebx
ret
# ----------------------
.align 4, 0x90
.globl _F2xq_sqr
_F2xq_sqr:
pushl %esi
subl $8, %esp
movl 20(%esp), %esi
movl 16(%esp), %eax
movl %eax, (%esp)
call _F2x_sqr
L00004B74:
movl %esi, 4(%esp)
movl %eax, (%esp)
call _F2x_rem
L00004B80:
addl $8, %esp
popl %esi
ret
# ----------------------
.align 4, 0x90
.globl _F2xq_invsafe
_F2xq_invsafe:
pushl %ebx
pushl %edi
pushl %esi
subl $32, %esp
call L00004B9B
L00004B9B:
popl %esi
movl 52(%esp), %eax
movl 48(%esp), %ecx
leal 28(%esp), %edx
movl %edx, 12(%esp)
movl %ecx, 4(%esp)
movl %eax, (%esp)
movl $0, 8(%esp)
call _F2x_extgcd
L00004BC0:
movl %eax, %ecx
movl $16777215, %edx
andl (%ecx), %edx
xorl %eax, %eax
cmpl $2, %edx
movl $0, %ebx
je L00004C1F
L00004BD5:
movl -4(%ecx,%edx,4), %edi
movl %edi, %ecx
shrl $16, %ecx
cmpl $65535, %edi
cmovbe %edi, %ecx
movl $12, %ebx
movl $28, %edi
cmova %ebx, %edi
cmpl $256, %ecx
jb L00004C02
L00004BFC:
addl $-8, %edi
shrl $8, %ecx
L00004C02:
sall $5, %edx
cmpl $16, %ecx
jb L00004C10
L00004C0A:
addl $-4, %edi
shrl $4, %ecx
L00004C10:
addl $-65, %edx
subl %edi, %edx
cmpl _F2x_degree_lg.__bfffo_tabshi-L00004B9B(%esi,%ecx,4), %edx
sete %bl
L00004C1F:
testb %bl, %bl
cmovne 28(%esp), %eax
addl $32, %esp
popl %esi
popl %edi
popl %ebx
ret
# ----------------------
.align 4, 0x90
.globl _F2xq_inv
_F2xq_inv:
pushl %ebp
pushl %ebx
pushl %edi
pushl %esi
subl $44, %esp
call L00004C3C
L00004C3C:
popl %ebx
movl 68(%esp), %eax
movl 64(%esp), %ecx
movl L_avma$non_lazy_ptr-L00004C3C(%ebx), %edi
movl (%edi), %ebp
leal 40(%esp), %edx
movl %edx, 12(%esp)
movl %ecx, 4(%esp)
movl %eax, (%esp)
movl $0, 8(%esp)
call _F2x_extgcd
L00004C69:
movl $16777215, %ecx
andl (%eax), %ecx
xorl %esi, %esi
cmpl $2, %ecx
movl $0, %edx
je L00004CCD
L00004C7C:
movl %ebp, 36(%esp)
movl -4(%eax,%ecx,4), %edx
movl %edx, %eax
shrl $16, %eax
cmpl $65535, %edx
cmovbe %edx, %eax
movl $28, %edx
movl $12, %ebp
cmova %ebp, %edx
cmpl $256, %eax
jb L00004CAC
L00004CA6:
addl $-8, %edx
shrl $8, %eax
L00004CAC:
movl 36(%esp), %ebp
sall $5, %ecx
cmpl $16, %eax
jb L00004CBE
L00004CB8:
addl $-4, %edx
shrl $4, %eax
L00004CBE:
addl $-65, %ecx
subl %edx, %ecx
cmpl _F2x_degree_lg.__bfffo_tabshi-L00004C3C(%ebx,%eax,4), %ecx
sete %dl
L00004CCD:
testb %dl, %dl
cmovne 40(%esp), %esi
testl %esi, %esi
jne L00004CE4
L00004CD8:
movl $27, (%esp)
call _pari_err
L00004CE4:
movl L_bot$non_lazy_ptr-L00004C3C(%ebx), %eax
cmpl (%eax), %esi
jb L00004E27
L00004CF2:
movl L_top$non_lazy_ptr-L00004C3C(%ebx), %eax
cmpl (%eax), %esi
jae L00004E27
L00004D00:
cmpl %esi, %ebp
jbe L00004E27
L00004D08:
movl (%esi), %ecx
movl %ecx, %eax
andl $16777215, %eax
sall $2, %eax
movl %ebp, %edx
subl %eax, %edx
movl %ecx, %eax
andl $16777215, %ecx
movl %edx, (%edi)
je L00004E33
L00004D28:
movl %ebp, %edi
movl %edx, 32(%esp)
movl %eax, %edx
movl %eax, 28(%esp)
orl $-16777216, %edx
movl %edx, %eax
xorl $16777215, %eax
movl %eax, 24(%esp)
cmpl $-16777216, %edx
movl $-2, %ebp
cmove %eax, %ebp
leal (%ebp,%ecx), %eax
cmpl $-2, %eax
je L00004E4D
L00004D60:
movl %ebp, 20(%esp)
movl %edi, 36(%esp)
addl $2, %eax
cmpl $-16777216, %edx
movl 24(%esp), %ebp
movl $-2, %edx
cmovne %edx, %ebp
movl %eax, %edx
andl $-8, %edx
je L00004E37
L00004D88:
movl %edx, 16(%esp)
movl %eax, 24(%esp)
movl $-2, %edx
movl $-2, %edi
subl %ebp, %edi
leal (%esi,%edi,4), %eax
movl 36(%esp), %edi
leal -4(%edi), %edi
cmpl %eax, %edi
movl $0, %eax
ja L00004DC3
L00004DAF:
leal -4(%esi,%ecx,4), %edi
addl %ecx, %ebp
subl %ebp, %edx
movl 36(%esp), %ebp
leal (%ebp,%edx,4), %edx
cmpl %edx, %edi
jbe L00004E3D
L00004DC3:
movl %ecx, %ebp
subl 16(%esp), %ebp
movl 20(%esp), %eax
leal 2(%eax,%ecx), %eax
andl $-8, %eax
movdqa LC00009440-L00004C3C(%ebx), %xmm0
movl %ecx, %ebx
movl 36(%esp), %edi
.align 4, 0x90
L00004DF0:
movd %ebx, %xmm1
pshufd $0, %xmm1, %xmm1
paddd %xmm0, %xmm1
movd %xmm1, %edx
movups -12(%esi,%edx,4), %xmm1
movups -28(%esi,%edx,4), %xmm2
subl %ecx, %edx
movups %xmm1, -12(%edi,%edx,4)
movups %xmm2, -28(%edi,%edx,4)
addl $-8, %ebx
addl $-8, %eax
jne L00004DF0
L00004E1F:
movl %ebp, %ecx
movl 16(%esp), %eax
jmp L00004E3D
L00004E27:
movl %ebp, (%edi)
L00004E29:
movl %esi, %eax
addl $44, %esp
popl %esi
popl %edi
popl %ebx
popl %ebp
ret
L00004E33:
movl %edx, %esi
jmp L00004E29
L00004E37:
movl %eax, 24(%esp)
xorl %eax, %eax
L00004E3D:
cmpl %eax, 24(%esp)
movl 36(%esp), %edi
jne L00004E4D
L00004E47:
movl 32(%esp), %esi
jmp L00004E29
L00004E4D:
movl %ecx, %ebp
notl %ebp
cmpl $-3, %ebp
movl $-2, %edx
cmovg %ebp, %edx
leal 2(%ecx,%edx), %eax
leal 1(%ecx,%edx), %ebx
testb $3, %al
je L00004E9D
L00004E68:
movl 28(%esp), %eax
notl %eax
orl $1056964608, %eax
leal (%edi,%eax,4), %eax
cmpl $-3, %ebp
movl $-2, %edx
cmovg %ebp, %edx
leal 2(%ecx,%edx), %ebp
andl $3, %ebp
negl %ebp
.align 4, 0x90
L00004E90:
movl -4(%esi,%ecx,4), %edx
movl %edx, (%eax,%ecx,4)
leal -1(%ecx), %ecx
incl %ebp
jne L00004E90
L00004E9D:
cmpl $3, %ebx
jae L00004EA8
L00004EA2:
movl 32(%esp), %esi
jmp L00004E29
L00004EA8:
incl %ecx
movl 28(%esp), %edx
andl $16777215, %edx
movl $-4, %eax
subl %edx, %eax
leal (%edi,%eax,4), %eax
movl 32(%esp), %edi
.align 4, 0x90
L00004ED0:
movl -8(%esi,%ecx,4), %edx
movl %edx, 8(%eax,%ecx,4)
movl -12(%esi,%ecx,4), %edx
movl %edx, 4(%eax,%ecx,4)
movl -16(%esi,%ecx,4), %edx
movl %edx, (%eax,%ecx,4)
movl -20(%esi,%ecx,4), %edx
movl %edx, -4(%eax,%ecx,4)
addl $-4, %ecx
cmpl $1, %ecx
jg L00004ED0
L00004EF7:
movl %edi, %esi
jmp L00004E29
# ----------------------
.align 4, 0x90
.globl _F2xq_div
_F2xq_div:
pushl %ebp
pushl %ebx
pushl %edi
pushl %esi
subl $44, %esp
call L00004F0C
L00004F0C:
popl %esi
movl 64(%esp), %ebp
movl 68(%esp), %eax
movl 72(%esp), %edx
movl L_avma$non_lazy_ptr-L00004F0C(%esi), %ecx
movl %ecx, 36(%esp)
movl (%ecx), %ecx
movl %ecx, 40(%esp)
movl %edx, 4(%esp)
movl %eax, (%esp)
call _F2xq_inv
L00004F35:
leal 8(%ebp), %ecx
movl $16777215, %ebx
movl (%ebp), %edi
andl %ebx, %edi
addl $-2, %edi
andl (%eax), %ebx
leal 8(%eax), %edx
addl $-2, %ebx
movl %ebx, 4(%esp)
movl %edi, (%esp)
call _F2x_mulspec
L00004F59:
movl 4(%ebp), %ecx
movl %ecx, 4(%eax)
movl 72(%esp), %ecx
movl %ecx, 4(%esp)
movl %eax, (%esp)
call _F2x_rem
L00004F6F:
movl L_bot$non_lazy_ptr-L00004F0C(%esi), %ecx
cmpl (%ecx), %eax
jb L00004FEC
L00004F79:
movl L_top$non_lazy_ptr-L00004F0C(%esi), %ecx
cmpl (%ecx), %eax
jae L00004FEC
L00004F83:
cmpl %eax, 40(%esp)
jbe L00004FEC
L00004F89:
movl (%eax), %ebx
movl %ebx, %ecx
andl $16777215, %ecx
sall $2, %ecx
movl 40(%esp), %edi
subl %ecx, %edi
movl %ebx, %edx
andl $16777215, %edx
movl 36(%esp), %ecx
movl %edi, (%ecx)
je L00005197
L00004FB0:
movl %esi, 28(%esp)
movl %ebx, %esi
orl $-16777216, %esi
movl %esi, %ecx
xorl $16777215, %ecx
movl %ecx, 36(%esp)
cmpl $-16777216, %esi
movl $-2, %ebp
cmove %ecx, %ebp
leal (%ebp,%edx), %ecx
cmpl $-2, %ecx
jne L00004FFB
L00004FDF:
movl %ebx, 32(%esp)
movl %edi, 36(%esp)
jmp L000050E4
L00004FEC:
movl 40(%esp), %ecx
movl 36(%esp), %edx
movl %ecx, (%edx)
jmp L00005199
L00004FFB:
movl %ebp, 20(%esp)
addl $2, %ecx
cmpl $-16777216, %esi
movl 36(%esp), %ebp
movl $-2, %esi
cmovne %esi, %ebp
movl %ecx, %esi
andl $-8, %esi
je L000050C7
L0000501F:
movl %esi, 16(%esp)
movl %ecx, 24(%esp)
movl %ebx, 32(%esp)
movl %edi, 36(%esp)
movl $-2, %esi
movl $-2, %edi
subl %ebp, %edi
leal (%eax,%edi,4), %edi
movl 40(%esp), %ebx
leal -4(%ebx), %ebx
cmpl %edi, %ebx
movl $0, %ecx
ja L00005061
L0000504E:
leal -4(%eax,%edx,4), %edi
addl %edx, %ebp
subl %ebp, %esi
movl 40(%esp), %ebx
leal (%ebx,%esi,4), %esi
cmpl %esi, %edi
jbe L000050D5
L00005061:
movl %edx, %esi
subl 16(%esp), %esi
movl 20(%esp), %ecx
leal 2(%ecx,%edx), %ecx
andl $-8, %ecx
movl 28(%esp), %edi
movdqa LC00009450-L00004F0C(%edi), %xmm0
movl %edx, %ebx
movl 40(%esp), %ebp
.align 4, 0x90
L00005090:
movd %ebx, %xmm1
pshufd $0, %xmm1, %xmm1
paddd %xmm0, %xmm1
movd %xmm1, %edi
movups -12(%eax,%edi,4), %xmm1
movups -28(%eax,%edi,4), %xmm2
subl %edx, %edi
movups %xmm1, -12(%ebp,%edi,4)
movups %xmm2, -28(%ebp,%edi,4)
addl $-8, %ebx
addl $-8, %ecx
jne L00005090
L000050BF:
movl %esi, %edx
movl 16(%esp), %ecx
jmp L000050D5
L000050C7:
movl %ecx, 24(%esp)
movl %ebx, 32(%esp)
movl %edi, 36(%esp)
xorl %ecx, %ecx
L000050D5:
cmpl %ecx, 24(%esp)
jne L000050E4
L000050DB:
movl 36(%esp), %eax
jmp L00005199
L000050E4:
movl %edx, %esi
notl %esi
cmpl $-3, %esi
movl $-2, %edi
cmovg %esi, %edi
leal 2(%edx,%edi), %ecx
leal 1(%edx,%edi), %ebx
testb $3, %cl
je L0000513F
L00005100:
movl 32(%esp), %ecx
notl %ecx
orl $1056964608, %ecx
movl 40(%esp), %ebp
leal (%ebp,%ecx,4), %ecx
cmpl $-3, %esi
movl $-2, %edi
cmovg %esi, %edi
leal 2(%edx,%edi), %esi
andl $3, %esi
negl %esi
.align 4, 0x90
L00005130:
movl -4(%eax,%edx,4), %edi
movl %edi, (%ecx,%edx,4)
leal -1(%edx), %edx
incl %esi
jne L00005130
L0000513D:
jmp L00005143
L0000513F:
movl 40(%esp), %ebp
L00005143:
cmpl $3, %ebx
jae L0000514E
L00005148:
movl 36(%esp), %eax
jmp L00005199
L0000514E:
incl %edx
movl 32(%esp), %esi
andl $16777215, %esi
movl $-4, %ecx
subl %esi, %ecx
leal (%ebp,%ecx,4), %ecx
movl 36(%esp), %edi
.align 4, 0x90
L00005170:
movl -8(%eax,%edx,4), %esi
movl %esi, 8(%ecx,%edx,4)
movl -12(%eax,%edx,4), %esi
movl %esi, 4(%ecx,%edx,4)
movl -16(%eax,%edx,4), %esi
movl %esi, (%ecx,%edx,4)
movl -20(%eax,%edx,4), %esi
movl %esi, -4(%ecx,%edx,4)
addl $-4, %edx
cmpl $1, %edx
jg L00005170
L00005197:
movl %edi, %eax
L00005199:
addl $44, %esp
popl %esi
popl %edi
popl %ebx
popl %ebp
ret
# ----------------------
.align 4, 0x90
.globl _F2xq_pow
_F2xq_pow:
pushl %ebp
pushl %ebx
pushl %edi
pushl %esi
subl $60, %esp
call L000051BC
L000051BC:
popl %esi
movl 84(%esp), %ebx
movl 80(%esp), %edi
movl L_avma$non_lazy_ptr-L000051BC(%esi), %ebp
movl (%ebp), %edx
movl 4(%ebx), %eax
cmpl $1073741823, %eax
jbe L000052ED
L000051DC:
movl %eax, %ecx
andl $16777215, %ecx
cmpl $3, %ecx
jne L0000532C
L000051ED:
cmpl $1, 8(%ebx)
jne L0000533C
L000051F7:
testl %eax, %eax
js L00005434
L000051FF:
movl %ebp, 56(%esp)
movl (%edi), %ebx
movl %ebx, 44(%esp)
andl $16777215, %ebx
leal 0(,%ebx,4), %eax
movl %edx, %ebp
subl %eax, %ebp
movl L_bot$non_lazy_ptr-L000051BC(%esi), %eax
movl %edx, %ecx
movl %edx, 52(%esp)
subl (%eax), %ecx
shrl $2, %ecx
cmpl %ebx, %ecx
jae L0000523B
L0000522F:
movl $14, (%esp)
call _pari_err
L0000523B:
movl 56(%esp), %eax
movl %ebp, (%eax)
movl $-16777217, %eax
andl (%edi), %eax
movl %eax, (%ebp)
cmpl $2, %ebx
jb L0000542A
L00005254:
movl %ebp, 48(%esp)
movl 44(%esp), %edx
andl $16777215, %edx
movl %edx, %ebp
negl %ebp
cmpl $-3, %ebp
movl $-2, %eax
movl $-2, %ecx
cmovg %ebp, %ecx
addl %edx, %ecx
cmpl $-1, %ecx
je L000056DC
L00005281:
incl %ecx
movl %ecx, 56(%esp)
cmpl $-3, %ebp
movl %ecx, %eax
movl $-2, %ecx
cmovg %ebp, %ecx
andl $-8, %eax
movl %eax, 40(%esp)
je L00005707
L000052A0:
movl %ecx, %eax
notl %eax
leal (%edi,%eax,4), %eax
movl %eax, 36(%esp)
movl 52(%esp), %eax
leal -4(%eax), %eax
cmpl 36(%esp), %eax
ja L00005718
L000052BC:
leal -4(%edi,%edx,4), %eax
movl %eax, 36(%esp)
addl %edx, %ecx
notl %ecx
movl 52(%esp), %eax
leal (%eax,%ecx,4), %ecx
cmpl %ecx, 36(%esp)
ja L00005718
L000052D9:
movl 48(%esp), %ebp
movl $-2, %eax
movl 56(%esp), %ecx
xorl %edx, %edx
jmp L00005792
L000052ED:
movl %ebp, %ebx
movl 4(%edi), %edi
leal -12(%edx), %ebp
movl L_bot$non_lazy_ptr-L000051BC(%esi), %eax
movl %edx, %ecx
subl (%eax), %ecx
cmpl $11, %ecx
ja L00005314
L00005304:
movl $14, (%esp)
movl %edx, %esi
call _pari_err
L00005312:
movl %esi, %edx
L00005314:
movl %ebp, (%ebx)
movl $738197507, -12(%edx)
movl %edi, -8(%edx)
movl $1, -4(%edx)
jmp L0000542A
L0000532C:
movl %ebp, 56(%esp)
testl %eax, %eax
movl 88(%esp), %ecx
js L0000534C
L00005338:
movl %edx, %ebp
jmp L00005360
L0000533C:
movl %ebp, 56(%esp)
testl %eax, %eax
movl 88(%esp), %ecx
js L0000534C
L00005348:
movl %edx, %ebp
jmp L00005360
L0000534C:
movl %edx, %ebp
movl %ecx, 4(%esp)
movl %edi, (%esp)
movl %ecx, %edi
call _F2xq_inv
L0000535C:
movl %edi, %ecx
movl %eax, %edi
L00005360:
leal __F2xq_mul-L000051BC(%esi), %eax
movl %eax, 16(%esp)
leal __F2xq_sqr-L000051BC(%esi), %eax
movl %eax, 12(%esp)
movl %ecx, 8(%esp)
movl %ebx, 4(%esp)
movl %edi, (%esp)
call _gen_pow
L00005384:
movl L_bot$non_lazy_ptr-L000051BC(%esi), %ecx
cmpl (%ecx), %eax
jb L00005422
L00005392:
cmpl %eax, %ebp
jbe L00005422
L0000539A:
movl L_top$non_lazy_ptr-L000051BC(%esi), %ecx
cmpl (%ecx), %eax
jae L00005422
L000053A4:
movl %ebp, 52(%esp)
movl (%eax), %edi
movl %edi, %ecx
shrl $25, %ecx
leal -21(%ecx), %edx
cmpl $2, %edx
jb L000053C0
L000053B7:
cmpl $2, %ecx
jne L00005446
L000053C0:
movl %edi, %ecx
andl $16777215, %ecx
sall $2, %ecx
movl 52(%esp), %ebp
subl %ecx, %ebp
movl %edi, %edx
andl $16777215, %edx
movl 56(%esp), %ecx
movl %ebp, (%ecx)
je L0000542A
L000053E1:
movl %ebp, 48(%esp)
movl %edi, %ecx
movl %edi, 56(%esp)
orl $-16777216, %ecx
movl %ecx, %edi
xorl $16777215, %edi
cmpl $-16777216, %ecx
movl $-2, %ebp
cmove %edi, %ebp
leal (%ebp,%edx), %ebx
cmpl $-2, %ebx
jne L00005570
L00005414:
movl 48(%esp), %ebp
movl $-2, %ecx
jmp L0000563E
L00005422:
movl 56(%esp), %ecx
movl %ebp, (%ecx)
movl %eax, %ebp
L0000542A:
movl %ebp, %eax
L0000542C:
addl $60, %esp
popl %esi
popl %edi
popl %ebx
popl %ebp
ret
L00005434:
movl 88(%esp), %eax
movl %eax, 4(%esp)
movl %edi, (%esp)
call _F2xq_inv
L00005444:
jmp L0000542C
L00005446:
cmpl $1, %ecx
jne L000056E5
L0000544F:
movl 4(%eax), %edi
movl %edi, 40(%esp)
andl $16777215, %edi
movl %edi, 44(%esp)
leal 0(,%edi,4), %edx
movl 52(%esp), %ebp
subl %edx, %ebp
cmpl $2, %edi
jb L000058DC
L00005476:
movl 40(%esp), %edx
andl $16777215, %edx
movl %edx, %ecx
negl %ecx
cmpl $-3, %ecx
movl $-2, %ebx
cmovg %ecx, %ebx
addl %edx, %ebx
cmpl $-1, %ebx
movl 44(%esp), %edi
je L0000584E
L0000549E:
incl %ebx
cmpl $-3, %ecx
movl $-2, %edi
cmovg %ecx, %edi
movl %edi, 48(%esp)
movl %ecx, 32(%esp)
xorl %ecx, %ecx
movl %ebx, %edi
andl $-8, %edi
je L0000583C
L000054BF:
movl %edi, 28(%esp)
movl %ebx, 36(%esp)
movl 48(%esp), %ebx
movl %ebx, %edi
notl %edi
leal (%eax,%edi,4), %edi
movl %edi, 24(%esp)
movl 52(%esp), %edi
leal -4(%edi), %edi
cmpl 24(%esp), %edi
ja L00005504
L000054E3:
leal -4(%eax,%edx,4), %edi
movl %edi, 24(%esp)
addl %edx, %ebx
notl %ebx
movl 52(%esp), %edi
leal (%edi,%ebx,4), %edi
cmpl %edi, 24(%esp)
movl 44(%esp), %edi
jbe L00005844
L00005504:
movl %ebp, 48(%esp)
movl 44(%esp), %ecx
movl %ecx, %edi
subl 28(%esp), %edi
movl 32(%esp), %ebp
cmpl $-3, %ebp
movl $-2, %ebx
cmovg %ebp, %ebx
leal 1(%ebx,%edx), %ebx
andl $-8, %ebx
movdqa LC00009460-L000051BC(%esi), %xmm0
movl 52(%esp), %ebp
L00005534:
movd %edx, %xmm1
pshufd $0, %xmm1, %xmm1
paddd %xmm0, %xmm1
movd %xmm1, %esi
movups -12(%eax,%esi,4), %xmm1
movups -28(%eax,%esi,4), %xmm2
subl %ecx, %esi
movups %xmm1, -12(%ebp,%esi,4)
movups %xmm2, -28(%ebp,%esi,4)
addl $-8, %edx
addl $-8, %ebx
jne L00005534
L00005563:
movl 28(%esp), %ecx
movl 48(%esp), %ebp
jmp L00005844
L00005570:
addl $2, %ebx
cmpl $-16777216, %ecx
movl $-2, %ecx
cmovne %ecx, %edi
movl $0, 44(%esp)
movl %ebx, %ecx
andl $-8, %ecx
je L0000562B
L00005594:
movl %ecx, 36(%esp)
movl $-2, %ecx
subl %edi, %ecx
leal (%eax,%ecx,4), %ecx
movl %ecx, 40(%esp)
movl 52(%esp), %ecx
leal -4(%ecx), %ecx
cmpl 40(%esp), %ecx
ja L000055D1
L000055B3:
leal -4(%eax,%edx,4), %ecx
movl %ecx, 40(%esp)
addl %edx, %edi
movl $-2, %ecx
subl %edi, %ecx
movl 52(%esp), %edi
leal (%edi,%ecx,4), %edi
cmpl %edi, 40(%esp)
jbe L0000562B
L000055D1:
movl %edx, %ecx
subl 36(%esp), %ecx
movl %ecx, 44(%esp)
leal 2(%ebp,%edx), %ebp
andl $-8, %ebp
movdqa LC00009460-L000051BC(%esi), %xmm0
movl %edx, %esi
movl 52(%esp), %edi
L000055F0:
movd %esi, %xmm1
pshufd $0, %xmm1, %xmm1
paddd %xmm0, %xmm1
movd %xmm1, %ecx
movups -12(%eax,%ecx,4), %xmm1
movups -28(%eax,%ecx,4), %xmm2
subl %edx, %ecx
movups %xmm1, -12(%edi,%ecx,4)
movups %xmm2, -28(%edi,%ecx,4)
addl $-8, %esi
addl $-8, %ebp
jne L000055F0
L0000561F:
movl 44(%esp), %edx
movl 36(%esp), %ecx
movl %ecx, 44(%esp)
L0000562B:
cmpl 44(%esp), %ebx
movl 48(%esp), %ebp
movl $-2, %ecx
je L0000542A
L0000563E:
movl %edx, %ebx
notl %ebx
cmpl $-3, %ebx
cmovg %ebx, %ecx
movl %ecx, %esi
leal 2(%edx,%esi), %ecx
leal 1(%edx,%esi), %esi
testb $3, %cl
je L0000568D
L00005657:
movl 56(%esp), %ecx
notl %ecx
orl $1056964608, %ecx
movl 52(%esp), %edi
leal (%edi,%ecx,4), %edi
cmpl $-3, %ebx
movl $-2, %ecx
cmovg %ebx, %ecx
leal 2(%edx,%ecx), %ebx
andl $3, %ebx
negl %ebx
.align 4, 0x90
L00005680:
movl -4(%eax,%edx,4), %ecx
movl %ecx, (%edi,%edx,4)
leal -1(%edx), %edx
incl %ebx
jne L00005680
L0000568D:
cmpl $3, %esi
jb L0000542A
L00005696:
incl %edx
movl 56(%esp), %esi
andl $16777215, %esi
movl $-4, %ecx
subl %esi, %ecx
movl 52(%esp), %esi
leal (%esi,%ecx,4), %ecx
.align 4, 0x90
L000056B0:
movl -8(%eax,%edx,4), %esi
movl %esi, 8(%ecx,%edx,4)
movl -12(%eax,%edx,4), %esi
movl %esi, 4(%ecx,%edx,4)
movl -16(%eax,%edx,4), %esi
movl %esi, (%ecx,%edx,4)
movl -20(%eax,%edx,4), %esi
movl %esi, -4(%ecx,%edx,4)
addl $-4, %edx
cmpl $1, %edx
jg L000056B0
L000056D7:
jmp L0000542A
L000056DC:
movl 48(%esp), %ebp
jmp L0000579A
L000056E5:
andl $16777215, %edi
leal (%eax,%edi,4), %ecx
movl %eax, 8(%esp)
movl 52(%esp), %eax
movl %eax, (%esp)
movl %ecx, 4(%esp)
call _gerepile
L00005702:
jmp L0000542C
L00005707:
movl 48(%esp), %ebp
movl 56(%esp), %ecx
movl $-2, %eax
xorl %edx, %edx
jmp L00005792
L00005718:
movl %ebx, %eax
movl 40(%esp), %ecx
subl %ecx, %eax
movl %eax, 36(%esp)
cmpl $-3, %ebp
movl $-2, %eax
cmovg %ebp, %eax
leal 1(%eax,%edx), %ebp
andl $-8, %ebp
movdqa LC00009460-L000051BC(%esi), %xmm0
movl 52(%esp), %esi
.align 4, 0x90
L00005750:
movd %edx, %xmm1
pshufd $0, %xmm1, %xmm1
paddd %xmm0, %xmm1
movd %xmm1, %eax
movups -12(%edi,%eax,4), %xmm1
movups -28(%edi,%eax,4), %xmm2
subl %ebx, %eax
movups %xmm1, -12(%esi,%eax,4)
movups %xmm2, -28(%esi,%eax,4)
addl $-8, %edx
addl $-8, %ebp
jne L00005750
L0000577F:
movl 36(%esp), %ebx
movl %ecx, %edx
movl 48(%esp), %ebp
movl $-2, %eax
movl 56(%esp), %ecx
L00005792:
cmpl %edx, %ecx
je L0000542A
L0000579A:
movl %ebx, %edx
negl %edx
cmpl $-3, %edx
cmovg %edx, %eax
leal (%ebx,%eax), %ecx
leal 1(%ebx,%eax), %eax
testb $3, %al
je L000057ED
L000057AF:
movl 44(%esp), %eax
notl %eax
orl $1056964608, %eax
movl 52(%esp), %esi
leal (%esi,%eax,4), %eax
cmpl $-3, %edx
movl $-2, %esi
cmovg %edx, %esi
leal 1(%ebx,%esi), %edx
andl $3, %edx
negl %edx
.align 4, 0x90
L000057E0:
movl -4(%edi,%ebx,4), %esi
movl %esi, (%eax,%ebx,4)
leal -1(%ebx), %ebx
incl %edx
jne L000057E0
L000057ED:
cmpl $3, %ecx
jb L0000542A
L000057F6:
movl 44(%esp), %ecx
notl %ecx
orl $1056964608, %ecx
movl 52(%esp), %eax
leal (%eax,%ecx,4), %eax
.align 4, 0x90
L00005810:
movl -4(%edi,%ebx,4), %ecx
movl %ecx, (%eax,%ebx,4)
movl -8(%edi,%ebx,4), %ecx
movl %ecx, -4(%eax,%ebx,4)
movl -12(%edi,%ebx,4), %ecx
movl %ecx, -8(%eax,%ebx,4)
movl -16(%edi,%ebx,4), %ecx
movl %ecx, -12(%eax,%ebx,4)
leal -4(%ebx), %ebx
cmpl $1, %ebx
jg L00005810
L00005837:
jmp L0000542A
L0000583C:
movl %ebx, 36(%esp)
movl 44(%esp), %edi
L00005844:
cmpl %ecx, 36(%esp)
je L000058DC
L0000584E:
movl %edi, %ebx
negl %ebx
cmpl $-3, %ebx
movl $-2, %edx
cmovg %ebx, %edx
leal (%edi,%edx), %ecx
leal 1(%edi,%edx), %edx
testb $3, %dl
je L0000589D
L00005869:
movl 40(%esp), %edx
notl %edx
orl $1056964608, %edx
movl 52(%esp), %esi
leal (%esi,%edx,4), %esi
cmpl $-3, %ebx
movl $-2, %edx
cmovg %ebx, %edx
leal 1(%edi,%edx), %ebx
andl $3, %ebx
negl %ebx
L00005890:
movl -4(%eax,%edi,4), %edx
movl %edx, (%esi,%edi,4)
leal -1(%edi), %edi
incl %ebx
jne L00005890
L0000589D:
cmpl $3, %ecx
movl 40(%esp), %esi
jb L000058DC
L000058A6:
notl %esi
orl $1056964608, %esi
movl 52(%esp), %edx
leal (%edx,%esi,4), %edx
L000058B5:
movl -4(%eax,%edi,4), %esi
movl %esi, (%edx,%edi,4)
movl -8(%eax,%edi,4), %esi
movl %esi, -4(%edx,%edi,4)
movl -12(%eax,%edi,4), %esi
movl %esi, -8(%edx,%edi,4)
movl -16(%eax,%edi,4), %esi
movl %esi, -12(%edx,%edi,4)
leal -4(%edi), %edi
cmpl $1, %edi
jg L000058B5
L000058DC:
movl 44(%esp), %eax
orl $33554432, %eax
movl %eax, (%ebp)
movl 56(%esp), %eax
movl %ebp, (%eax)
jmp L0000542A
L000058F3:
.align 4, 0x90
__F2xq_sqr:
pushl %esi
subl $8, %esp
movl 16(%esp), %esi
movl 20(%esp), %eax
movl %eax, (%esp)
call _F2x_sqr
L00005914:
movl %esi, 4(%esp)
movl %eax, (%esp)
call _F2x_rem
L00005920:
addl $8, %esp
popl %esi
ret
L00005925:
.align 4, 0x90
__F2xq_mul:
pushl %ebx
pushl %edi
pushl %esi
subl $16, %esp
movl 32(%esp), %esi
movl 40(%esp), %edx
movl 36(%esp), %edi
leal 8(%edi), %ecx
movl $16777215, %eax
movl (%edi), %ebx
andl %eax, %ebx
addl $-2, %ebx
andl (%edx), %eax
addl $8, %edx
addl $-2, %eax
movl %eax, 4(%esp)
movl %ebx, (%esp)
call _F2x_mulspec
L00005965:
movl 4(%edi), %ecx
movl %ecx, 4(%eax)
movl %esi, 4(%esp)
movl %eax, (%esp)
call _F2x_rem
L00005977:
addl $16, %esp
popl %esi
popl %edi
popl %ebx
ret
# ----------------------
.align 4, 0x90
.globl _F2xq_powers
_F2xq_powers:
pushl %ebp
pushl %ebx
pushl %edi
pushl %esi
subl $60, %esp
call L0000598C
L0000598C:
popl %eax
movl %eax, 32(%esp)
movl 84(%esp), %edx
movl %edx, 52(%esp)
movl L_avma$non_lazy_ptr-L0000598C(%eax), %ebx
movl (%ebx), %ecx
movl $-2, %esi
subl %edx, %esi
movl L_bot$non_lazy_ptr-L0000598C(%eax), %edi
movl %edi, 44(%esp)
movl %ecx, %eax
subl (%edi), %eax
shrl $2, %eax
leal 2(%edx), %ebp
movl %esi, %edx
cmpl %ebp, %eax
leal (%ecx,%edx,4), %edi
jae L000059E1
L000059C5:
movl $14, (%esp)
movl %ecx, %esi
movl %ebp, 48(%esp)
movl %edx, %ebp
call _pari_err
L000059D9:
movl %ebp, %edx
movl 48(%esp), %ebp
movl %esi, %ecx
L000059E1:
movl 88(%esp), %esi
movl %edi, (%ebx)
cmpl $16777216, %ebp
jb L00005A1D
L000059EF:
movl 32(%esp), %eax
leal LC00009591-L0000598C(%eax), %eax
movl %eax, 4(%esp)
movl $15, (%esp)
movl %ecx, %esi
movl %ebp, 48(%esp)
movl %edx, %ebp
call _pari_err
L00005A11:
movl %ebp, %edx
movl 48(%esp), %ebp
movl %esi, %ecx
movl 88(%esp), %esi
L00005A1D:
movl %ebp, 48(%esp)
movl %ebp, %eax
orl $570425344, %eax
movl %eax, (%edi)
movl %edi, 36(%esp)
movl 4(%esi), %esi
movl (%ebx), %edi
movl %edi, %eax
movl 44(%esp), %ebp
subl (%ebp), %eax
cmpl $11, %eax
leal -12(%edi), %ebp
ja L00005A60
L00005A44:
movl $14, (%esp)
movl %ecx, 40(%esp)
movl %edx, 56(%esp)
call _pari_err
L00005A58:
movl 56(%esp), %edx
movl 40(%esp), %ecx
L00005A60:
movl %ebp, (%ebx)
movl $738197507, -12(%edi)
movl %esi, -8(%edi)
movl $1, -4(%edi)
movl %ebp, 4(%ecx,%edx,4)
cmpl $0, 84(%esp)
je L00005EE6
L00005A82:
movl %ecx, 40(%esp)
movl 80(%esp), %eax
movl (%eax), %edi
movl %edi, 24(%esp)
andl $16777215, %edi
movl (%ebx), %esi
leal 0(,%edi,4), %eax
movl %esi, %ecx
subl %eax, %ecx
movl %esi, %eax
movl 44(%esp), %ebp
subl (%ebp), %eax
shrl $2, %eax
cmpl %edi, %eax
jae L00005ACB
L00005AB3:
movl $14, (%esp)
movl %edx, 56(%esp)
movl %ecx, %ebp
call _pari_err
L00005AC5:
movl %ebp, %ecx
movl 56(%esp), %edx
L00005ACB:
movl %ecx, 28(%esp)
movl %ecx, (%ebx)
movl $-16777217, %eax
movl 80(%esp), %ebx
andl (%ebx), %eax
movl %eax, (%ecx)
cmpl $2, %edi
jb L00005C97
L00005AE7:
movl %edx, 56(%esp)
movl 24(%esp), %edx
andl $16777215, %edx
movl %edx, %ebp
negl %ebp
cmpl $-3, %ebp
movl $-2, %eax
movl $-2, %ecx
cmovg %ebp, %ecx
addl %edx, %ecx
cmpl $-1, %ecx
je L00005B68
L00005B10:
incl %ecx
cmpl $-3, %ebp
movl $-2, %eax
cmovg %ebp, %eax
movl %ecx, %ebx
andl $-8, %ebx
je L00005B71
L00005B23:
movl %ebx, 16(%esp)
movl %ecx, 44(%esp)
movl %eax, %ebx
notl %ebx
movl 80(%esp), %ecx
leal (%ecx,%ebx,4), %ebx
movl %ebx, 20(%esp)
leal -4(%esi), %ebx
cmpl 20(%esp), %ebx
ja L00005B82
L00005B43:
leal -4(%ecx,%edx,4), %ebx
addl %edx, %eax
notl %eax
leal (%esi,%eax,4), %eax
cmpl %eax, %ebx
ja L00005B82
L00005B52:
movl 56(%esp), %edx
movl %ecx, %ebx
movl $-2, %eax
movl 44(%esp), %ecx
xorl %ebp, %ebp
jmp L00005BF0
L00005B68:
movl 56(%esp), %edx
jmp L00005BF8
L00005B71:
movl 56(%esp), %edx
movl 80(%esp), %ebx
movl $-2, %eax
xorl %ebp, %ebp
jmp L00005BF0
L00005B82:
movl %edi, %eax
subl 16(%esp), %eax
movl %eax, 20(%esp)
cmpl $-3, %ebp
movl $-2, %eax
cmovg %ebp, %eax
leal 1(%eax,%edx), %ebp
andl $-8, %ebp
movl 32(%esp), %eax
movdqa LC00009470-L0000598C(%eax), %xmm0
movl %ecx, %ebx
movl 44(%esp), %ecx
L00005BB0:
movd %edx, %xmm1
pshufd $0, %xmm1, %xmm1
paddd %xmm0, %xmm1
movd %xmm1, %eax
movups -12(%ebx,%eax,4), %xmm1
movups -28(%ebx,%eax,4), %xmm2
subl %edi, %eax
movups %xmm1, -12(%esi,%eax,4)
movups %xmm2, -28(%esi,%eax,4)
addl $-8, %edx
addl $-8, %ebp
jne L00005BB0
L00005BDF:
movl 20(%esp), %edi
movl 16(%esp), %ebp
movl 56(%esp), %edx
movl $-2, %eax
L00005BF0:
cmpl %ebp, %ecx
je L00005C97
L00005BF8:
movl %edx, 56(%esp)
movl %edi, %edx
negl %edx
cmpl $-3, %edx
cmovg %edx, %eax
leal (%edi,%eax), %ecx
leal 1(%edi,%eax), %eax
testb $3, %al
je L00005C51
L00005C11:
movl 24(%esp), %eax
notl %eax
orl $1056964608, %eax
leal (%esi,%eax,4), %eax
cmpl $-3, %edx
movl %ebx, %ebp
movl $-2, %ebx
cmovg %edx, %ebx
leal 1(%edi,%ebx), %edx
movl %ebp, %ebx
andl $3, %edx
negl %edx
.align 4, 0x90
L00005C40:
movl %ebx, %ebp
movl -4(%ebp,%edi,4), %ebx
movl %ebx, (%eax,%edi,4)
movl %ebp, %ebx
leal -1(%edi), %edi
incl %edx
jne L00005C40
L00005C51:
cmpl $3, %ecx
movl 56(%esp), %edx
jb L00005C97
L00005C5A:
movl 24(%esp), %eax
notl %eax
orl $1056964608, %eax
leal (%esi,%eax,4), %eax
.align 4, 0x90
L00005C70:
movl -4(%ebx,%edi,4), %ecx
movl %ecx, (%eax,%edi,4)
movl -8(%ebx,%edi,4), %ecx
movl %ecx, -4(%eax,%edi,4)
movl -12(%ebx,%edi,4), %ecx
movl %ecx, -8(%eax,%edi,4)
movl -16(%ebx,%edi,4), %ecx
movl %ecx, -12(%eax,%edi,4)
leal -4(%edi), %edi
cmpl $1, %edi
jg L00005C70
L00005C97:
movl 40(%esp), %eax
movl 28(%esp), %ecx
movl %ecx, 8(%eax,%edx,4)
cmpl $1, 84(%esp)
je L00005EE6
L00005CAE:
movl %ebx, (%esp)
movl %eax, %esi
movl %edx, %edi
movl %edi, 56(%esp)
call _F2x_sqr
L00005CBE:
movl 88(%esp), %ecx
movl %ecx, 4(%esp)
movl %eax, (%esp)
call _F2x_rem
L00005CCE:
movl %eax, 12(%esi,%edi,4)
movl %esi, %ebp
movl (%ebx), %eax
movl %eax, %edx
andl $16777215, %edx
movl $-2, %ecx
cmpl $2, %edx
je L00005D3A
L00005CE8:
movl -4(%ebx,%edx,4), %esi
movl %esi, %ecx
shrl $16, %ecx
cmpl $65535, %esi
cmovbe %esi, %ecx
movl $12, %edi
movl $28, %esi
cmova %edi, %esi
cmpl $256, %ecx
jb L00005D15
L00005D0F:
addl $-8, %esi
shrl $8, %ecx
L00005D15:
sall $5, %edx
cmpl $16, %ecx
jb L00005D23
L00005D1D:
addl $-4, %esi
shrl $4, %ecx
L00005D23:
addl $2147483583, %edx
subl %esi, %edx
movl 32(%esp), %esi
subl _F2x_degree_lg.__bfffo_tabshi-L0000598C(%esi,%ecx,4), %edx
addl %edx, %edx
movl %edx, %ecx
L00005D3A:
movl $16777215, %edx
movl 88(%esp), %esi
andl (%esi), %edx
movl $-1, %esi
cmpl $2, %edx
je L00005DA0
L00005D4F:
movl 88(%esp), %esi
movl -4(%esi,%edx,4), %edi
movl %edi, %esi
shrl $16, %esi
cmpl $65535, %edi
cmovbe %edi, %esi
movl $12, %ebx
movl $28, %edi
cmova %ebx, %edi
cmpl $256, %esi
jb L00005D80
L00005D7A:
addl $-8, %edi
shrl $8, %esi
L00005D80:
sall $5, %edx
cmpl $16, %esi
jb L00005D8E
L00005D88:
addl $-4, %edi
shrl $4, %esi
L00005D8E:
addl $-65, %edx
subl %edi, %edx
movl 32(%esp), %edi
subl _F2x_degree_lg.__bfffo_tabshi-L0000598C(%edi,%esi,4), %edx
movl %edx, %esi
L00005DA0:
cmpl %esi, %ecx
jge L00005E21
L00005DA4:
cmpl $5, 48(%esp)
movl %ebp, %ebx
jl L00005EE6
L00005DB1:
movl 80(%esp), %edx
leal 8(%edx), %edx
movl %edx, 56(%esp)
movl $1, %esi
subl 84(%esp), %esi
movl $16777215, %edi
jmp L00005DD7
L00005DCC:
.align 4, 0x90
L00005DD0:
movl 80(%esp), %eax
movl (%eax), %eax
incl %esi
L00005DD7:
movl (%ebx,%esi,4), %ebp
leal 8(%ebp), %ecx
movl (%ebp), %edx
andl %edi, %edx
addl $-2, %edx
andl $16777215, %eax
addl $-2, %eax
movl %eax, 4(%esp)
movl %edx, (%esp)
movl 56(%esp), %edx
call _F2x_mulspec
L00005DFD:
movl 4(%ebp), %ecx
movl %ecx, 4(%eax)
movl 88(%esp), %ecx
movl %ecx, 4(%esp)
movl %eax, (%esp)
call _F2x_rem
L00005E13:
movl %eax, 4(%ebx,%esi,4)
cmpl $-2, %esi
jne L00005DD0
L00005E1C:
jmp L00005EE6
L00005E21:
cmpl $5, 48(%esp)
movl %ebp, %esi
movl 56(%esp), %edi
jl L00005EE6
L00005E32:
leal -1(%edi), %eax
movl %eax, 48(%esp)
movl 80(%esp), %eax
leal 8(%eax), %eax
movl %eax, 44(%esp)
incl 52(%esp)
movl $4, %ebx
.align 4, 0x90
L00005E50:
testb $1, %bl
jne L00005EB0
L00005E55:
movl 48(%esp), %eax
leal (%eax,%ebx), %eax
movl (%esi,%eax,4), %ebp
leal 8(%ebp), %ecx
movl (%ebp), %eax
movl $16777215, %edi
andl %edi, %eax
addl $-2, %eax
movl 80(%esp), %edx
movl (%edx), %edx
andl %edi, %edx
addl $-2, %edx
movl %edx, 4(%esp)
movl %eax, (%esp)
movl 44(%esp), %edx
call _F2x_mulspec
L00005E8A:
movl 4(%ebp), %ecx
movl %ecx, 4(%eax)
movl 88(%esp), %ecx
movl %ecx, 4(%esp)
movl %eax, (%esp)
call _F2x_rem
L00005EA0:
movl 56(%esp), %edi
leal 1(%ebx), %ebp
jmp L00005ED4
L00005EA9:
.align 4, 0x90
L00005EB0:
leal 1(%ebx), %ebp
movl %ebp, %eax
shrl $1, %eax
addl %edi, %eax
movl (%esi,%eax,4), %eax
movl %eax, (%esp)
call _F2x_sqr
L00005EC4:
movl 88(%esp), %ecx
movl %ecx, 4(%esp)
movl %eax, (%esp)
call _F2x_rem
L00005ED4:
leal (%ebx,%edi), %ecx
movl %eax, (%esi,%ecx,4)
cmpl 52(%esp), %ebx
movl %ebp, %ebx
jne L00005E50
L00005EE6:
movl 36(%esp), %eax
addl $60, %esp
popl %esi
popl %edi
popl %ebx
popl %ebp
ret
# ----------------------
.align 4, 0x90
.globl _F2xq_matrix_pow
_F2xq_matrix_pow:
pushl %esi
subl $24, %esp
movl 36(%esp), %esi
movl 32(%esp), %eax
movl 44(%esp), %ecx
movl 40(%esp), %edx
decl %edx
movl %ecx, 8(%esp)
movl %edx, 4(%esp)
movl %eax, (%esp)
call _F2xq_powers
L00005F25:
movl %esi, 4(%esp)
movl %eax, (%esp)
call _F2xV_to_F2m
L00005F31:
addl $24, %esp
popl %esi
ret
# ----------------------
.align 4, 0x90
.globl _F2xV_to_F2m
_F2xV_to_F2m:
pushl %ebp
pushl %ebx
pushl %edi
pushl %esi
subl $92, %esp
call L00005F4C
L00005F4C:
popl %edi
movl 112(%esp), %eax
movl $16777215, %esi
andl (%eax), %esi
movl L_avma$non_lazy_ptr-L00005F4C(%edi), %ebx
movl (%ebx), %ecx
movl %ecx, 72(%esp)
leal 0(,%esi,4), %eax
movl %ecx, %ebp
subl %eax, %ebp
movl L_bot$non_lazy_ptr-L00005F4C(%edi), %edx
movl %edx, 68(%esp)
movl %ecx, %eax
subl (%edx), %eax
shrl $2, %eax
cmpl %esi, %eax
jae L00005F90
L00005F84:
movl $14, (%esp)
call _pari_err
L00005F90:
movl %ebx, 48(%esp)
movl %ebp, (%ebx)
movl %esi, 76(%esp)
movl %esi, %eax
orl $637534208, %eax
movl %eax, (%ebp)
movl %ebp, 32(%esp)
cmpl $2, %esi
movl %ebx, %esi
jb L00006544
L00005FB3:
movl 116(%esp), %eax
leal 95(%eax), %eax
movl %eax, %ecx
shrl $5, %ecx
movl %ecx, %edx
negl %edx
movl %edx, 64(%esp)
movl %ecx, %edx
orl $738197504, %edx
movl %edx, 60(%esp)
movl $1, %edx
subl %ecx, %edx
movl %edx, 56(%esp)
movl $2, %edx
subl %ecx, %edx
movl %edx, 36(%esp)
cmpl $536870911, %eax
movl %ecx, %eax
notl %eax
movl %eax, 28(%esp)
movl $1, %ebx
movl $12, %eax
jbe L000062B9
L00006006:
subl %ecx, %eax
movl %eax, 12(%esp)
movl $3, %eax
subl %ecx, %eax
movl %eax, 24(%esp)
movl %ecx, 88(%esp)
movl $1, %ebx
leal LC00009591-L00005F4C(%edi), %eax
movl %eax, 44(%esp)
.align 4, 0x90
L00006030:
movl %ebx, 52(%esp)
movl 112(%esp), %eax
movl (%eax,%ebx,4), %ebx
movl (%ebx), %edi
andl $16777215, %edi
movl (%esi), %edx
movl %edx, 84(%esp)
movl %edx, %eax
movl 68(%esp), %ecx
subl (%ecx), %eax
shrl $2, %eax
cmpl 88(%esp), %eax
movl 64(%esp), %eax
leal (%edx,%eax,4), %eax
jae L00006071
L00006061:
movl $14, (%esp)
movl %eax, %ebp
call _pari_err
L0000606F:
movl %ebp, %eax
L00006071:
movl %eax, 80(%esp)
movl %eax, (%esi)
movl %eax, %ebp
movl 44(%esp), %eax
movl %eax, 4(%esp)
movl $15, (%esp)
call _pari_err
L0000608D:
movl 60(%esp), %eax
movl %eax, (%ebp)
movl 116(%esp), %eax
movl 56(%esp), %ecx
movl 84(%esp), %edx
movl %eax, (%edx,%ecx,4)
movl $2, %eax
cmpl $3, %edi
jb L00006272
L000060B1:
movl $3, %eax
cmova %edi, %eax
movl $2, %edx
cmpl $2, %eax
je L000061E7
L000060C7:
leal -2(%eax), %ecx
movl %eax, 40(%esp)
andl $-4, %ecx
orl $2, %ecx
cmpl $3, %edi
movl $3, %eax
cmova %edi, %eax
cmpl $2, %ecx
movl $2, %edx
je L000061DD
L000060ED:
movl %ecx, 20(%esp)
leal -4(%ebx,%eax,4), %ebp
movl 36(%esp), %ecx
movl 84(%esp), %esi
leal (%esi,%ecx,4), %ecx
cmpl %ebp, %ecx
ja L0000611A
L00006104:
leal 8(%ebx), %ebp
addl 28(%esp), %eax
movl 84(%esp), %esi
leal (%esi,%eax,4), %eax
cmpl %eax, %ebp
jbe L000061DD
L0000611A:
cmpl $3, %edi
movl $3, %edx
cmova %edi, %edx
addl $-2, %edx
andl $-4, %edx
addl $-4, %edx
shrl $2, %edx
leal 1(%edx), %eax
movl $2, %esi
testb $3, %al
je L00006178
L0000613D:
movl %edx, 16(%esp)
cmpl $3, %edi
movl $3, %eax
cmova %edi, %eax
addl $-2, %eax
andl $12, %eax
addl $-4, %eax
shrl $2, %eax
incl %eax
andl $3, %eax
negl %eax
xorl %edx, %edx
L00006160:
movl %edx, %esi
movups 8(%ebx,%esi,4), %xmm0
movups %xmm0, (%ecx,%esi,4)
leal 4(%esi), %edx
incl %eax
jne L00006160
L00006171:
addl $6, %esi
movl 16(%esp), %edx
L00006178:
cmpl $3, %edx
jb L000061D9
L0000617D:
movl 12(%esp), %eax
movl 84(%esp), %ecx
leal (%ecx,%eax,4), %eax
leal (%eax,%esi,4), %ecx
cmpl $3, %edi
movl $3, %eax
cmova %edi, %eax
addl $-2, %eax
andl $-4, %eax
orl $2, %eax
subl %esi, %eax
leal 48(%ebx,%esi,4), %edx
.align 4, 0x90
L000061B0:
movups -48(%edx), %xmm0
movups %xmm0, -48(%ecx)
movups -32(%edx), %xmm0
movups %xmm0, -32(%ecx)
movups -16(%edx), %xmm0
movups %xmm0, -16(%ecx)
movups (%edx), %xmm0
movups %xmm0, (%ecx)
addl $64, %ecx
addl $64, %edx
addl $-16, %eax
jne L000061B0
L000061D9:
movl 20(%esp), %edx
L000061DD:
cmpl %edx, 40(%esp)
movl 48(%esp), %esi
je L00006265
L000061E7:
leal 1(%edx), %ecx
cmpl %edi, %ecx
movl %edi, %ebp
cmovge %ecx, %ebp
movl %ebp, %eax
subl %edx, %eax
decl %ebp
subl %edx, %ebp
testb $3, %al
je L0000621C
L000061FC:
cmpl %edi, %ecx
cmovl %edi, %ecx
subl %edx, %ecx
andl $3, %ecx
negl %ecx
movl 80(%esp), %eax
.align 4, 0x90
L00006210:
movl (%ebx,%edx,4), %esi
movl %esi, (%eax,%edx,4)
incl %edx
incl %ecx
jne L00006210
L0000621A:
jmp L00006220
L0000621C:
movl 80(%esp), %eax
L00006220:
movl %eax, 80(%esp)
cmpl $3, %ebp
movl 48(%esp), %esi
jb L00006265
L0000622D:
movl 24(%esp), %eax
movl 84(%esp), %ecx
leal (%ecx,%eax,4), %eax
.align 4, 0x90
L00006240:
movl (%ebx,%edx,4), %ecx
movl %ecx, -12(%eax,%edx,4)
movl 4(%ebx,%edx,4), %ecx
movl %ecx, -8(%eax,%edx,4)
movl 8(%ebx,%edx,4), %ecx
movl %ecx, -4(%eax,%edx,4)
movl 12(%ebx,%edx,4), %ecx
movl %ecx, (%eax,%edx,4)
addl $4, %edx
cmpl %edi, %edx
jl L00006240
L00006265:
cmpl $3, %edi
movl $3, %eax
cmovbe %eax, %edi
movl %edi, %eax
L00006272:
movl %eax, %ecx
movl 88(%esp), %edx
subl %edx, %ecx
jge L00006294
L0000627C:
movl 84(%esp), %edi
leal (%edi,%ecx,4), %ecx
subl %eax, %edx
sall $2, %edx
movl %edx, 4(%esp)
movl %ecx, (%esp)
call ___bzero
L00006294:
movl 52(%esp), %ebx
movl %ebx, %eax
movl 76(%esp), %ecx
subl %ecx, %eax
movl 72(%esp), %edx
movl 80(%esp), %edi
movl %edi, (%edx,%eax,4)
incl %ebx
cmpl %ecx, %ebx
jl L00006030
L000062B4:
jmp L00006544
L000062B9:
subl %ecx, %eax
movl %eax, 16(%esp)
movl $3, %eax
subl %ecx, %eax
movl %eax, 40(%esp)
movl %ecx, 88(%esp)
.align 4, 0x90
L000062D0:
movl %ebx, 52(%esp)
movl 112(%esp), %eax
movl (%eax,%ebx,4), %edi
movl (%edi), %ebx
andl $16777215, %ebx
movl (%esi), %edx
movl %edx, 84(%esp)
movl %edx, %eax
movl 68(%esp), %ecx
subl (%ecx), %eax
shrl $2, %eax
cmpl 88(%esp), %eax
movl 64(%esp), %eax
leal (%edx,%eax,4), %eax
jae L00006311
L00006301:
movl $14, (%esp)
movl %eax, %ebp
call _pari_err
L0000630F:
movl %ebp, %eax
L00006311:
movl %eax, 80(%esp)
movl %eax, (%esi)
movl %eax, %ecx
movl 60(%esp), %eax
movl %eax, (%ecx)
movl 116(%esp), %eax
movl 56(%esp), %ecx
movl 84(%esp), %edx
movl %eax, (%edx,%ecx,4)
movl $2, %eax
cmpl $3, %ebx
jb L00006502
L0000633C:
movl $3, %eax
cmova %ebx, %eax
movl $2, %edx
cmpl $2, %eax
je L00006477
L00006352:
leal -2(%eax), %ecx
movl %eax, 44(%esp)
andl $-4, %ecx
orl $2, %ecx
cmpl $3, %ebx
movl $3, %eax
cmova %ebx, %eax
cmpl $2, %ecx
movl $2, %edx
je L0000646D
L00006378:
movl %ecx, 24(%esp)
leal -4(%edi,%eax,4), %ebp
movl 36(%esp), %ecx
movl 84(%esp), %esi
leal (%esi,%ecx,4), %ecx
cmpl %ebp, %ecx
ja L000063A5
L0000638F:
leal 8(%edi), %ebp
addl 28(%esp), %eax
movl 84(%esp), %esi
leal (%esi,%eax,4), %eax
cmpl %eax, %ebp
jbe L0000646D
L000063A5:
cmpl $3, %ebx
movl $3, %edx
cmova %ebx, %edx
addl $-2, %edx
andl $-4, %edx
addl $-4, %edx
shrl $2, %edx
leal 1(%edx), %eax
movl $2, %esi
testb $3, %al
je L00006408
L000063C8:
movl %edx, 20(%esp)
cmpl $3, %ebx
movl $3, %eax
cmova %ebx, %eax
addl $-2, %eax
andl $12, %eax
addl $-4, %eax
shrl $2, %eax
incl %eax
andl $3, %eax
negl %eax
xorl %edx, %edx
.align 4, 0x90
L000063F0:
movl %edx, %esi
movups 8(%edi,%esi,4), %xmm0
movups %xmm0, (%ecx,%esi,4)
leal 4(%esi), %edx
incl %eax
jne L000063F0
L00006401:
addl $6, %esi
movl 20(%esp), %edx
L00006408:
cmpl $3, %edx
jb L00006469
L0000640D:
movl 16(%esp), %eax
movl 84(%esp), %ecx
leal (%ecx,%eax,4), %eax
leal (%eax,%esi,4), %ecx
cmpl $3, %ebx
movl $3, %eax
cmova %ebx, %eax
addl $-2, %eax
andl $-4, %eax
orl $2, %eax
subl %esi, %eax
leal 48(%edi,%esi,4), %edx
.align 4, 0x90
L00006440:
movups -48(%edx), %xmm0
movups %xmm0, -48(%ecx)
movups -32(%edx), %xmm0
movups %xmm0, -32(%ecx)
movups -16(%edx), %xmm0
movups %xmm0, -16(%ecx)
movups (%edx), %xmm0
movups %xmm0, (%ecx)
addl $64, %ecx
addl $64, %edx
addl $-16, %eax
jne L00006440
L00006469:
movl 24(%esp), %edx
L0000646D:
cmpl %edx, 44(%esp)
movl 48(%esp), %esi
je L000064F5
L00006477:
leal 1(%edx), %ecx
cmpl %ebx, %ecx
movl %ebx, %ebp
cmovge %ecx, %ebp
movl %ebp, %eax
subl %edx, %eax
decl %ebp
subl %edx, %ebp
testb $3, %al
je L000064AC
L0000648C:
cmpl %ebx, %ecx
cmovl %ebx, %ecx
subl %edx, %ecx
andl $3, %ecx
negl %ecx
movl 80(%esp), %eax
.align 4, 0x90
L000064A0:
movl (%edi,%edx,4), %esi
movl %esi, (%eax,%edx,4)
incl %edx
incl %ecx
jne L000064A0
L000064AA:
jmp L000064B0
L000064AC:
movl 80(%esp), %eax
L000064B0:
movl %eax, 80(%esp)
cmpl $3, %ebp
movl 48(%esp), %esi
jb L000064F5
L000064BD:
movl 40(%esp), %eax
movl 84(%esp), %ecx
leal (%ecx,%eax,4), %eax
.align 4, 0x90
L000064D0:
movl (%edi,%edx,4), %ecx
movl %ecx, -12(%eax,%edx,4)
movl 4(%edi,%edx,4), %ecx
movl %ecx, -8(%eax,%edx,4)
movl 8(%edi,%edx,4), %ecx
movl %ecx, -4(%eax,%edx,4)
movl 12(%edi,%edx,4), %ecx
movl %ecx, (%eax,%edx,4)
addl $4, %edx
cmpl %ebx, %edx
jl L000064D0
L000064F5:
cmpl $3, %ebx
movl $3, %eax
cmovbe %eax, %ebx
movl %ebx, %eax
L00006502:
movl %eax, %ecx
movl 88(%esp), %edx
subl %edx, %ecx
jge L00006524
L0000650C:
movl 84(%esp), %edi
leal (%edi,%ecx,4), %ecx
subl %eax, %edx
sall $2, %edx
movl %edx, 4(%esp)
movl %ecx, (%esp)
call ___bzero
L00006524:
movl 52(%esp), %ebx
movl %ebx, %eax
movl 76(%esp), %ecx
subl %ecx, %eax
movl 72(%esp), %edx
movl 80(%esp), %edi
movl %edi, (%edx,%eax,4)
incl %ebx
cmpl %ecx, %ebx
jl L000062D0
L00006544:
movl 32(%esp), %eax
addl $92, %esp
popl %esi
popl %edi
popl %ebx
popl %ebp
ret
# ----------------------
.align 4, 0x90
.globl _F2xq_trace
_F2xq_trace:
pushl %ebp
pushl %ebx
pushl %edi
pushl %esi
subl $44, %esp
call L0000655C
L0000655C:
popl %ecx
movl %ecx, 20(%esp)
movl 68(%esp), %edi
movl L_avma$non_lazy_ptr-L0000655C(%ecx), %eax
movl %eax, 40(%esp)
movl (%eax), %ebx
movl (%edi), %esi
andl $16777215, %esi
leal 0(,%esi,4), %eax
movl %ebx, %ebp
subl %eax, %ebp
movl L_bot$non_lazy_ptr-L0000655C(%ecx), %ecx
movl %ecx, 36(%esp)
movl %ebx, %eax
subl (%ecx), %eax
shrl $2, %eax
cmpl %esi, %eax
jae L000065A5
L00006599:
movl $14, (%esp)
call _pari_err
L000065A5:
movl %ebp, 32(%esp)
movl 40(%esp), %ecx
movl %ebp, (%ecx)
movl %esi, %eax
orl $738197504, %eax
movl %eax, (%ebp)
movl %ecx, %ebp
movl 4(%edi), %eax
movl $1, %ecx
subl %esi, %ecx
movl %eax, (%ebx,%ecx,4)
movl %ebx, 28(%esp)
movl 64(%esp), %ebx
cmpl $3, %esi
jb L00006735
L000065D9:
movl $3, %eax
cmova %esi, %eax
movl $2, %edx
cmpl $2, %eax
je L000066BF
L000065EF:
leal -2(%eax), %ecx
andl $-8, %ecx
orl $2, %ecx
movl %ecx, 24(%esp)
leal -1(%esi), %ebx
cmpl $3, %esi
movl $2, %edx
cmovbe %edx, %ebx
cmpl $2, %ecx
je L000066B3
L00006613:
leal (%edi,%ebx,4), %ecx
movl %ecx, 16(%esp)
movl $2, %edx
movl $2, %ebp
subl %esi, %ebp
movl 28(%esp), %ecx
leal (%ecx,%ebp,4), %ebp
cmpl 16(%esp), %ebp
ja L00006644
L00006633:
leal 8(%edi), %ecx
subl %esi, %ebx
movl 28(%esp), %ebp
leal (%ebp,%ebx,4), %ebx
cmpl %ebx, %ecx
jbe L000066B3
L00006644:
movl $6, %edx
subl %esi, %edx
movl 28(%esp), %ecx
leal (%ecx,%edx,4), %edx
leal 24(%edi), %ebx
cmpl $3, %esi
movl $3, %ebp
cmova %esi, %ebp
addl $-2, %ebp
andl $-8, %ebp
movl 20(%esp), %ecx
movdqa LC00009480-L0000655C(%ecx), %xmm0
.align 4, 0x90
L00006680:
movdqu -16(%ebx), %xmm1
movdqu (%ebx), %xmm2
psrld $1, %xmm1
psrld $1, %xmm2
pand %xmm0, %xmm1
pand %xmm0, %xmm2
movdqu %xmm1, -16(%edx)
movdqu %xmm2, (%edx)
addl $32, %edx
addl $32, %ebx
addl $-8, %ebp
jne L00006680
L000066AF:
movl 24(%esp), %edx
L000066B3:
cmpl %edx, %eax
movl 40(%esp), %ebp
movl 64(%esp), %ebx
je L00006735
L000066BF:
leal 1(%edx), %eax
cmpl %esi, %eax
movl %esi, %ecx
cmovge %eax, %ecx
movl %ecx, %ebx
subl %edx, %ebx
decl %ecx
subl %edx, %ecx
testb $1, %bl
je L000066EB
L000066D5:
movl (%edi,%edx,4), %ebx
shrl $1, %ebx
andl $1431655765, %ebx
subl %esi, %edx
movl 28(%esp), %edi
movl %ebx, (%edi,%edx,4)
jmp L000066ED
L000066EB:
movl %edx, %eax
L000066ED:
movl 64(%esp), %ebx
testl %ecx, %ecx
movl 68(%esp), %edi
je L00006735
L000066F9:
movl $1, %ecx
subl %esi, %ecx
movl 28(%esp), %edx
leal (%edx,%ecx,4), %ecx
.align 4, 0x90
L00006710:
movl (%edi,%eax,4), %edx
shrl $1, %edx
andl $1431655765, %edx
movl %edx, -4(%ecx,%eax,4)
movl 4(%edi,%eax,4), %edx
shrl $1, %edx
andl $1431655765, %edx
movl %edx, (%ecx,%eax,4)
addl $2, %eax
cmpl %esi, %eax
jl L00006710
L00006735:
movl %esi, 4(%esp)
movl 32(%esp), %eax
movl %eax, (%esp)
call _Flx_renormalize
L00006745:
leal 8(%ebx), %ecx
movl $16777215, %esi
movl (%ebx), %edi
andl %esi, %edi
addl $-2, %edi
andl (%eax), %esi
leal 8(%eax), %edx
addl $-2, %esi
movl %esi, 4(%esp)
movl %edi, (%esp)
call _F2x_mulspec
L00006768:
movl %eax, %esi
movl 4(%ebx), %eax
movl %eax, 4(%esi)
movl (%esi), %edi
movl %edi, %ebx
andl $16777215, %ebx
movl (%ebp), %ebp
movl %ebp, %eax
movl 36(%esp), %ecx
subl (%ecx), %eax
leal 1(%ebx), %ecx
movl %ecx, 36(%esp)
orl $-16777216, %edi
xorl $16777215, %edi
shrl $2, %eax
cmpl %ecx, %eax
leal (%ebp,%edi,4), %eax
movl %eax, 32(%esp)
jae L000067B3
L000067A7:
movl $14, (%esp)
call _pari_err
L000067B3:
movl 40(%esp), %eax
movl 32(%esp), %ecx
movl %ecx, (%eax)
cmpl $16777216, 36(%esp)
jb L000067E1
L000067C7:
movl 20(%esp), %eax
leal LC00009591-L0000655C(%eax), %eax
movl %eax, 4(%esp)
movl $15, (%esp)
call _pari_err
L000067E1:
movl 36(%esp), %eax
orl $738197504, %eax
movl %ebp, 24(%esp)
movl %eax, (%ebp,%edi,4)
movl $0, 8(%ebp,%edi,4)
movl $2, %eax
cmpl $3, %ebx
movl $0, %ecx
movl 40(%esp), %ebp
jb L00006886
L0000680D:
cmpl $2, %ebx
movl $3, %eax
movl $3, %edx
cmovg %ebx, %edx
leal -2(%edx), %ecx
addl $-3, %edx
testb $1, %cl
je L0000683D
L00006828:
movl 8(%esi), %ecx
addl %ecx, %ecx
movl 24(%esp), %ebp
movl %ecx, 8(%ebp,%edi,4)
movl 8(%esi), %ecx
shrl $31, %ecx
jmp L00006844
L0000683D:
movl $2, %eax
xorl %ecx, %ecx
L00006844:
testl %edx, %edx
je L00006877
L00006848:
movl 24(%esp), %edx
leal 4(%edx,%edi,4), %edx
L00006850:
movl (%esi,%eax,4), %ebp
addl %ebp, %ebp
orl %ecx, %ebp
movl %ebp, -4(%edx,%eax,4)
movl (%esi,%eax,4), %ecx
movl 4(%esi,%eax,4), %ebp
shldl $1, %ecx, %ebp
movl %ebp, (%edx,%eax,4)
movl 4(%esi,%eax,4), %ecx
shrl $31, %ecx
addl $2, %eax
cmpl %ebx, %eax
jl L00006850
L00006877:
cmpl $3, %ebx
movl $3, %eax
cmova %ebx, %eax
movl 40(%esp), %ebp
L00006886:
addl %edi, %eax
movl 24(%esp), %edx
movl %ecx, (%edx,%eax,4)
movl 36(%esp), %eax
movl %eax, 4(%esp)
movl 32(%esp), %eax
movl %eax, (%esp)
call _Flx_renormalize
L000068A3:
movl 68(%esp), %ecx
movl %ecx, 4(%esp)
movl %eax, (%esp)
movl $0, 8(%esp)
call _F2x_divrem
L000068BB:
movl $16777215, %ecx
andl (%eax), %ecx
cmpl $2, %ecx
movl $0, %ecx
je L000068D2
L000068CC:
movl 8(%eax), %ecx
andl $1, %ecx
L000068D2:
movl 28(%esp), %eax
movl %eax, (%ebp)
movl %ecx, %eax
addl $44, %esp
popl %esi
popl %edi
popl %ebx
popl %ebp
ret
# ----------------------
.align 4, 0x90
.globl _F2xq_conjvec
_F2xq_conjvec:
pushl %ebp
pushl %ebx
pushl %edi
pushl %esi
subl $44, %esp
call L000068FC
L000068FC:
popl %esi
movl 68(%esp), %ecx
movl $16777215, %eax
andl (%ecx), %eax
movl $-1, %edx
cmpl $2, %eax
je L0000695F
L00006912:
movl %esi, %edi
movl -4(%ecx,%eax,4), %edx
movl %edx, %ecx
shrl $16, %ecx
cmpl $65535, %edx
cmovbe %edx, %ecx
movl $12, %esi
movl $28, %edx
cmova %esi, %edx
cmpl $256, %ecx
jb L00006941
L0000693B:
addl $-8, %edx
shrl $8, %ecx
L00006941:
movl %edi, %esi
sall $5, %eax
cmpl $16, %ecx
jb L00006951
L0000694B:
addl $-4, %edx
shrl $4, %ecx
L00006951:
addl $-65, %eax
subl %edx, %eax
subl _F2x_degree_lg.__bfffo_tabshi-L000068FC(%esi,%ecx,4), %eax
movl %eax, %edx
L0000695F:
movl %esi, 12(%esp)
movl L_avma$non_lazy_ptr-L000068FC(%esi), %ebp
movl (%ebp), %ebx
leal 0(,%edx,4), %eax
movl %ebx, %edi
subl %eax, %edi
movl L_bot$non_lazy_ptr-L000068FC(%esi), %ecx
movl %ecx, 28(%esp)
movl %ebx, %eax
subl (%ecx), %eax
shrl $2, %eax
cmpl %edx, %eax
jae L0000699C
L0000698C:
movl $14, (%esp)
movl %edx, %esi
call _pari_err
L0000699A:
movl %esi, %edx
L0000699C:
movl 64(%esp), %esi
movl %edi, (%ebp)
cmpl $16777216, %edx
jb L000069CD
L000069AB:
movl 12(%esp), %eax
leal LC00009591-L000068FC(%eax), %eax
movl %eax, 4(%esp)
movl $15, (%esp)
movl %edx, 40(%esp)
call _pari_err
L000069C9:
movl 40(%esp), %edx
L000069CD:
movl %edx, %eax
orl $603979776, %eax
movl %eax, (%edi)
movl %edi, 32(%esp)
movl (%esi), %edi
movl %edi, 20(%esp)
andl $16777215, %edi
movl %ebp, 24(%esp)
movl (%ebp), %ebp
movl %ebp, 16(%esp)
leal 0(,%edi,4), %eax
movl %ebp, %ecx
subl %eax, %ecx
movl %ebp, %eax
movl 28(%esp), %ebp
subl (%ebp), %eax
shrl $2, %eax
cmpl %edi, %eax
jae L00006A28
L00006A0C:
movl $14, (%esp)
movl %edx, 40(%esp)
movl %ecx, 36(%esp)
call _pari_err
L00006A20:
movl 36(%esp), %ecx
movl 40(%esp), %edx
L00006A28:
movl %ecx, 36(%esp)
movl 24(%esp), %eax
movl %ecx, (%eax)
movl $-16777217, %eax
andl (%esi), %eax
movl %eax, (%ecx)
cmpl $2, %edi
jb L00006BE7
L00006A44:
movl %edx, 40(%esp)
movl 20(%esp), %edx
andl $16777215, %edx
movl %edx, %ebp
negl %ebp
cmpl $-3, %ebp
movl $-2, %eax
movl $-2, %ecx
cmovg %ebp, %ecx
addl %edx, %ecx
cmpl $-1, %ecx
je L00006AC2
L00006A6D:
incl %ecx
movl %ecx, 28(%esp)
cmpl $-3, %ebp
movl %ecx, %eax
movl $-2, %ecx
cmovg %ebp, %ecx
andl $-8, %eax
je L00006AB9
L00006A84:
movl %eax, 24(%esp)
movl %ecx, %eax
notl %eax
leal (%esi,%eax,4), %eax
movl %eax, 8(%esp)
movl 16(%esp), %eax
leal -4(%eax), %eax
cmpl 8(%esp), %eax
ja L00006ACB
L00006AA0:
leal -4(%esi,%edx,4), %eax
movl %eax, 8(%esp)
addl %edx, %ecx
notl %ecx
movl 16(%esp), %eax
leal (%eax,%ecx,4), %ecx
cmpl %ecx, 8(%esp)
ja L00006ACB
L00006AB9:
movl $-2, %eax
xorl %ecx, %ecx
jmp L00006B3C
L00006AC2:
movl 40(%esp), %edx
jmp L00006B4A
L00006ACB:
movl %edi, %eax
subl 24(%esp), %eax
movl %eax, 8(%esp)
cmpl $-3, %ebp
movl $-2, %eax
cmovg %ebp, %eax
leal 1(%eax,%edx), %ebp
andl $-8, %ebp
movl 12(%esp), %eax
movdqa LC00009490-L000068FC(%eax), %xmm0
movl 16(%esp), %ecx
.align 4, 0x90
L00006B00:
movd %edx, %xmm1
pshufd $0, %xmm1, %xmm1
paddd %xmm0, %xmm1
movd %xmm1, %eax
movups -12(%esi,%eax,4), %xmm1
movups -28(%esi,%eax,4), %xmm2
subl %edi, %eax
movups %xmm1, -12(%ecx,%eax,4)
movups %xmm2, -28(%ecx,%eax,4)
addl $-8, %edx
addl $-8, %ebp
jne L00006B00
L00006B2F:
movl 8(%esp), %edi
movl 24(%esp), %ecx
movl $-2, %eax
L00006B3C:
cmpl %ecx, 28(%esp)
movl 40(%esp), %edx
je L00006BE7
L00006B4A:
movl %edx, 40(%esp)
movl %edi, %edx
negl %edx
cmpl $-3, %edx
cmovg %edx, %eax
leal (%edi,%eax), %ecx
leal 1(%edi,%eax), %eax
testb $3, %al
je L00006B9D
L00006B63:
movl 20(%esp), %eax
notl %eax
orl $1056964608, %eax
movl 16(%esp), %ebp
leal (%ebp,%eax,4), %eax
cmpl $-3, %edx
movl $-2, %ebp
cmovg %edx, %ebp
leal 1(%edi,%ebp), %edx
andl $3, %edx
negl %edx
.align 4, 0x90
L00006B90:
movl -4(%esi,%edi,4), %ebp
movl %ebp, (%eax,%edi,4)
leal -1(%edi), %edi
incl %edx
jne L00006B90
L00006B9D:
cmpl $3, %ecx
movl 40(%esp), %edx
jb L00006BE7
L00006BA6:
movl 20(%esp), %eax
notl %eax
orl $1056964608, %eax
movl 16(%esp), %ecx
leal (%ecx,%eax,4), %eax
.align 4, 0x90
L00006BC0:
movl -4(%esi,%edi,4), %ecx
movl %ecx, (%eax,%edi,4)
movl -8(%esi,%edi,4), %ecx
movl %ecx, -4(%eax,%edi,4)
movl -12(%esi,%edi,4), %ecx
movl %ecx, -8(%eax,%edi,4)
movl -16(%esi,%edi,4), %ecx
movl %ecx, -12(%eax,%edi,4)
leal -4(%edi), %edi
cmpl $1, %edi
jg L00006BC0
L00006BE7:
movl $1, %eax
subl %edx, %eax
movl 36(%esp), %ecx
movl %ecx, (%ebx,%eax,4)
cmpl $3, %edx
movl 68(%esp), %edi
jl L00006C2E
L00006BFE:
movl $2, %esi
subl %edx, %esi
.align 4, 0x90
L00006C10:
movl -4(%ebx,%esi,4), %eax
movl %eax, (%esp)
call _F2x_sqr
L00006C1C:
movl %edi, 4(%esp)
movl %eax, (%esp)
call _F2x_rem
L00006C28:
movl %eax, (%ebx,%esi,4)
incl %esi
jne L00006C10
L00006C2E:
movl 32(%esp), %eax
addl $44, %esp
popl %esi
popl %edi
popl %ebx
popl %ebp
ret
# ----------------------
.align 4, 0x90
.globl _random_F2x
_random_F2x:
pushl %ebp
pushl %ebx
pushl %edi
pushl %esi
subl $28, %esp
call L00006C4C
L00006C4C:
popl %ebp
movl 48(%esp), %eax
leal 96(%eax), %ebx
movl %ebx, %esi
shrl $5, %esi
movl L_avma$non_lazy_ptr-L00006C4C(%ebp), %edi
movl (%edi), %edx
movl %edx, 20(%esp)
leal 0(,%esi,4), %eax
movl %edx, %ecx
subl %eax, %ecx
movl %ecx, 24(%esp)
movl L_bot$non_lazy_ptr-L00006C4C(%ebp), %eax
movl %edx, %ecx
subl (%eax), %ecx
shrl $2, %ecx
cmpl %esi, %ecx
jae L00006C91
L00006C85:
movl $14, (%esp)
call _pari_err
L00006C91:
movl 52(%esp), %edx
movl 24(%esp), %eax
movl %eax, (%edi)
cmpl $536870912, %ebx
jb L00006CBD
L00006CA3:
leal LC00009591-L00006C4C(%ebp), %eax
movl %eax, 4(%esp)
movl $15, (%esp)
movl %edx, %edi
call _pari_err
L00006CBB:
movl %edi, %edx
L00006CBD:
movl %esi, %eax
orl $738197504, %eax
movl 24(%esp), %ecx
movl %eax, (%ecx)
movl $1, %ebp
movl $1, %eax
subl %esi, %eax
movl 20(%esp), %ecx
movl %edx, (%ecx,%eax,4)
cmpl $-97, 48(%esp)
ja L00006D0D
L00006CE4:
shrl $3, %ebx
andl $536870908, %ebx
movl 20(%esp), %edi
subl %ebx, %edi
movl $2, %ebx
.align 4, 0x90
L00006D00:
call _pari_rand
L00006D05:
movl %eax, (%edi,%ebx,4)
incl %ebx
cmpl %esi, %ebx
jl L00006D00
L00006D0D:
movl 48(%esp), %ecx
sall %cl, %ebp
decl %ebp
movl 20(%esp), %eax
andl %ebp, -4(%eax)
movl %esi, 4(%esp)
movl 24(%esp), %eax
movl %eax, (%esp)
call _Flx_renormalize
L00006D2B:
addl $28, %esp
popl %esi
popl %edi
popl %ebx
popl %ebp
ret
# ----------------------
.align 4, 0x90
.globl _F2xq_order
_F2xq_order:
pushl %esi
subl $24, %esp
call L00006D49
L00006D49:
popl %eax
movl 32(%esp), %ecx
movl 36(%esp), %edx
movl 40(%esp), %esi
leal _F2xq_star-L00006D49(%eax), %eax
movl %eax, 12(%esp)
movl %esi, 8(%esp)
movl %edx, 4(%esp)
movl %ecx, (%esp)
call _gen_eltorder
L00006D70:
addl $24, %esp
popl %esi
ret
# ----------------------
.align 4, 0x90
.globl _F2xq_log
_F2xq_log:
pushl %edi
pushl %esi
subl $36, %esp
call L00006D8A
L00006D8A:
popl %eax
movl 48(%esp), %ecx
movl 52(%esp), %edx
movl 56(%esp), %esi
movl 60(%esp), %edi
leal _F2xq_star-L00006D8A(%eax), %eax
movl %eax, 16(%esp)
movl %edi, 12(%esp)
movl %esi, 8(%esp)
movl %edx, 4(%esp)
movl %ecx, (%esp)
movl $0, 20(%esp)
call _gen_PH_log
L00006DC1:
addl $36, %esp
popl %esi
popl %edi
ret
# ----------------------
.align 4, 0x90
.globl _F2xq_sqrt
_F2xq_sqrt:
pushl %ebp
pushl %ebx
pushl %edi
pushl %esi
subl $108, %esp
call L00006DDC
L00006DDC:
popl %ebx
movl %ebx, 80(%esp)
movl 132(%esp), %ecx
movl 128(%esp), %esi
movl L_avma$non_lazy_ptr-L00006DDC(%ebx), %eax
movl %eax, 104(%esp)
movl (%eax), %edi
movl %edi, 88(%esp)
movl L_bot$non_lazy_ptr-L00006DDC(%ebx), %edx
movl $16777215, %ebp
andl (%ecx), %ebp
cmpl $2, %ebp
movl (%edx), %eax
je L00007156
L00006E17:
movl %edi, 88(%esp)
movl %edx, 92(%esp)
movl %ebx, %edi
movl -4(%ecx,%ebp,4), %edx
movl %edx, %ecx
shrl $16, %ecx
cmpl $65535, %edx
cmovbe %edx, %ecx
movl $12, %ebx
movl $28, %edx
cmova %ebx, %edx
cmpl $256, %ecx
jb L00006E4E
L00006E48:
addl $-8, %edx
shrl $8, %ecx
L00006E4E:
movl %edi, %ebx
movl 88(%esp), %edi
sall $5, %ebp
cmpl $16, %ecx
jb L00006E62
L00006E5C:
addl $-4, %edx
shrl $4, %ecx
L00006E62:
addl $-65, %ebp
subl %edx, %ebp
subl _F2x_degree_lg.__bfffo_tabshi-L00006DDC(%ebx,%ecx,4), %ebp
cmpl $2, %ebp
jl L00007156
L00006E77:
movl %edi, %ecx
subl %eax, %ecx
shrl $2, %ecx
addl %eax, %ecx
movl %ecx, 96(%esp)
decl %ebp
movl %ebp, 100(%esp)
leal -4(%edi), %eax
movl %eax, 36(%esp)
leal -16(%edi), %eax
movl %eax, 28(%esp)
movl $1, %ebp
leal LC00009567-L00006DDC(%ebx), %eax
movl %eax, 68(%esp)
movdqa LC000094A0-L00006DDC(%ebx), %xmm0
movdqa %xmm0, 48(%esp)
.align 4, 0x90
L00006EC0:
movl %esi, (%esp)
call _F2x_sqr
L00006EC8:
movl 132(%esp), %ecx
movl %ecx, 4(%esp)
movl %eax, (%esp)
call _F2x_rem
L00006EDB:
movl %eax, %esi
movl 104(%esp), %eax
movl 96(%esp), %ecx
cmpl %ecx, (%eax)
jae L00007143
L00006EED:
movl L_DEBUGMEM$non_lazy_ptr-L00006DDC(%ebx), %eax
cmpl $2, (%eax)
jb L00006F10
L00006EF8:
movl %ebp, 8(%esp)
movl 68(%esp), %eax
movl %eax, 4(%esp)
movl $3, (%esp)
call _pari_warn
L00006F10:
movl 92(%esp), %eax
cmpl (%eax), %esi
jb L00007080
L00006F1C:
movl L_top$non_lazy_ptr-L00006DDC(%ebx), %eax
cmpl (%eax), %esi
jae L00007080
L00006F2A:
cmpl %esi, %edi
jbe L00007080
L00006F32:
movl %edi, %ebx
movl (%esi), %edi
movl %edi, %ecx
andl $16777215, %ecx
sall $2, %ecx
movl %ebx, %edx
subl %ecx, %edx
movl %edi, %ecx
andl $16777215, %ecx
movl 104(%esp), %eax
movl %edx, (%eax)
movdqa 48(%esp), %xmm2
je L0000708B
L00006F5F:
movl %edx, 76(%esp)
movl %edi, %edx
orl $-16777216, %edx
movl %edx, %eax
xorl $16777215, %eax
movl %eax, 84(%esp)
cmpl $-16777216, %edx
movl $-2, %ebx
cmove %eax, %ebx
leal (%ebx,%ecx), %eax
cmpl $-2, %eax
je L00007094
L00006F90:
leal 2(%ebx,%ecx), %eax
movl %eax, 44(%esp)
leal 2(%edi,%ebx), %eax
movl %edi, 72(%esp)
andl $7, %eax
cmpl $-16777216, %edx
movl $-2, %edx
movl 84(%esp), %edi
cmovne %edx, %edi
movl %edi, 84(%esp)
movl 44(%esp), %edi
movl $0, 40(%esp)
movl %edi, %edx
subl %eax, %edx
je L00007070
L00006FCF:
movl %ebx, 24(%esp)
movl %edx, 32(%esp)
movl $-2, %eax
movl 84(%esp), %ebx
subl %ebx, %eax
leal (%esi,%eax,4), %eax
cmpl %eax, 36(%esp)
ja L00007003
L00006FEB:
leal -4(%esi,%ecx,4), %eax
addl %ecx, %ebx
movl $-2, %edx
subl %ebx, %edx
movl 88(%esp), %ebx
leal (%ebx,%edx,4), %edx
cmpl %edx, %eax
jbe L00007070
L00007003:
movl %ecx, %eax
subl 32(%esp), %eax
movl %eax, 84(%esp)
movl 72(%esp), %eax
movl 24(%esp), %edx
leal 2(%edx,%eax), %ebx
andl $7, %ebx
subl %edx, %ebx
addl $-2, %ebx
movl %ecx, %edi
movl 88(%esp), %edx
.align 4, 0x90
L00007030:
movd %edi, %xmm0
pshufd $0, %xmm0, %xmm0
paddd %xmm2, %xmm0
movd %xmm0, %eax
movdqu -12(%esi,%eax,4), %xmm0
movups -28(%esi,%eax,4), %xmm1
subl %ecx, %eax
movdqu %xmm0, -12(%edx,%eax,4)
movups %xmm1, -28(%edx,%eax,4)
addl $-8, %edi
cmpl %edi, %ebx
jne L00007030
L00007060:
movl 84(%esp), %ecx
movl 32(%esp), %eax
movl %eax, 40(%esp)
movl 44(%esp), %edi
L00007070:
cmpl 40(%esp), %edi
je L00007137
L0000707A:
jmp L00007098
L0000707C:
.align 4, 0x90
L00007080:
movl 104(%esp), %eax
movl %edi, (%eax)
jmp L00007143
L0000708B:
movl %edx, %esi
movl %ebx, %edi
jmp L0000713F
L00007094:
movl %edi, 72(%esp)
L00007098:
movl %ecx, %edi
notl %edi
cmpl $-3, %edi
movl $-2, %eax
cmovg %edi, %eax
leal 2(%ecx,%eax), %edx
leal 1(%ecx,%eax), %eax
testb $3, %dl
je L000070EF
L000070B4:
movl %eax, %edx
movl 72(%esp), %eax
andl $16777215, %eax
sall $2, %eax
movl 36(%esp), %ebx
subl %eax, %ebx
cmpl $-3, %edi
movl $-2, %eax
cmovle %eax, %edi
leal 2(%ecx,%edi), %edi
andl $3, %edi
negl %edi
.align 4, 0x90
L000070E0:
movl -4(%esi,%ecx,4), %eax
movl %eax, (%ebx,%ecx,4)
leal -1(%ecx), %ecx
incl %edi
jne L000070E0
L000070ED:
jmp L000070F1
L000070EF:
movl %eax, %edx
L000070F1:
cmpl $3, %edx
jb L00007137
L000070F6:
incl %ecx
movl 72(%esp), %eax
andl $16777215, %eax
sall $2, %eax
movl 28(%esp), %edi
subl %eax, %edi
.align 4, 0x90
L00007110:
movl -8(%esi,%ecx,4), %eax
movl %eax, 8(%edi,%ecx,4)
movl -12(%esi,%ecx,4), %eax
movl %eax, 4(%edi,%ecx,4)
movl -16(%esi,%ecx,4), %eax
movl %eax, (%edi,%ecx,4)
movl -20(%esi,%ecx,4), %eax
movl %eax, -4(%edi,%ecx,4)
addl $-4, %ecx
cmpl $1, %ecx
jg L00007110
L00007137:
movl 76(%esp), %esi
movl 88(%esp), %edi
L0000713F:
movl 80(%esp), %ebx
L00007143:
cmpl 100(%esp), %ebp
leal 1(%ebp), %ebp
jne L00006EC0
L00007150:
movl 92(%esp), %eax
movl (%eax), %eax
L00007156:
cmpl %eax, %esi
jb L000071C9
L0000715A:
movl L_top$non_lazy_ptr-L00006DDC(%ebx), %eax
cmpl (%eax), %esi
jae L000071C9
L00007164:
cmpl %esi, %edi
jbe L000071C9
L00007168:
movl (%esi), %eax
movl %eax, %ecx
andl $16777215, %ecx
sall $2, %ecx
movl %edi, %ebp
subl %ecx, %ebp
movl %eax, %ecx
andl $16777215, %ecx
movl 104(%esp), %edx
movl %ebp, (%edx)
je L000071D9
L00007189:
movl %ebp, 104(%esp)
movl %ebx, 80(%esp)
movl %edi, 88(%esp)
movl %eax, %edx
orl $-16777216, %edx
movl %edx, %ebx
xorl $16777215, %ebx
cmpl $-16777216, %edx
movl $-2, %edi
cmove %ebx, %edi
leal (%edi,%ecx), %ebp
cmpl $-2, %ebp
jne L000071DD
L000071BB:
movl 88(%esp), %ebx
movl $-2, %edx
jmp L000072C9
L000071C9:
movl 104(%esp), %eax
movl %edi, (%eax)
L000071CF:
movl %esi, %eax
addl $108, %esp
popl %esi
popl %edi
popl %ebx
popl %ebp
ret
L000071D9:
movl %ebp, %esi
jmp L000071CF
L000071DD:
addl $2, %ebp
cmpl $-16777216, %edx
movl $-2, %edx
cmovne %edx, %ebx
movl $0, 100(%esp)
movl %ebp, %edx
andl $-8, %edx
je L000072B1
L00007201:
movl %edx, 96(%esp)
movl $-2, %edx
subl %ebx, %edx
leal (%esi,%edx,4), %edx
movl %edx, 92(%esp)
movl 88(%esp), %edx
leal -4(%edx), %edx
cmpl 92(%esp), %edx
ja L0000723E
L00007220:
leal -4(%esi,%ecx,4), %edx
movl %edx, 92(%esp)
addl %ecx, %ebx
movl $-2, %edx
subl %ebx, %edx
movl 88(%esp), %ebx
leal (%ebx,%edx,4), %ebx
cmpl %ebx, 92(%esp)
jbe L000072B1
L0000723E:
movl %ebp, 92(%esp)
movl %ecx, %edx
subl 96(%esp), %edx
movl %edx, 100(%esp)
leal 2(%edi,%ecx), %edi
andl $-8, %edi
movl 80(%esp), %edx
movdqa LC000094A0-L00006DDC(%edx), %xmm0
movl %ecx, %ebx
movl 88(%esp), %ebp
.align 4, 0x90
L00007270:
movd %ebx, %xmm1
pshufd $0, %xmm1, %xmm1
paddd %xmm0, %xmm1
movd %xmm1, %edx
movups -12(%esi,%edx,4), %xmm1
movdqu -28(%esi,%edx,4), %xmm2
subl %ecx, %edx
movups %xmm1, -12(%ebp,%edx,4)
movdqu %xmm2, -28(%ebp,%edx,4)
addl $-8, %ebx
addl $-8, %edi
jne L00007270
L000072A1:
movl 100(%esp), %ecx
movl 96(%esp), %edx
movl %edx, 100(%esp)
movl 92(%esp), %ebp
L000072B1:
cmpl 100(%esp), %ebp
movl 88(%esp), %ebx
movl $-2, %edx
jne L000072C9
L000072C0:
movl 104(%esp), %esi
jmp L000071CF
L000072C9:
movl %ecx, %ebp
notl %ebp
cmpl $-3, %ebp
cmovg %ebp, %edx
movl %edx, %edi
leal 2(%ecx,%edi), %edx
leal 1(%ecx,%edi), %edi
testb $3, %dl
je L0000731D
L000072E2:
movl %eax, %edx
notl %edx
orl $1056964608, %edx
leal (%ebx,%edx,4), %ebx
cmpl $-3, %ebp
movl $-2, %edx
cmovg %ebp, %edx
leal 2(%ecx,%edx), %ebp
andl $3, %ebp
negl %ebp
.align 4, 0x90
L00007310:
movl -4(%esi,%ecx,4), %edx
movl %edx, (%ebx,%ecx,4)
leal -1(%ecx), %ecx
incl %ebp
jne L00007310
L0000731D:
cmpl $3, %edi
jae L0000732B
L00007322:
movl 104(%esp), %esi
jmp L000071CF
L0000732B:
incl %ecx
andl $16777215, %eax
movl $-4, %edx
subl %eax, %edx
movl 88(%esp), %eax
leal (%eax,%edx,4), %edx
movl 104(%esp), %edi
.align 4, 0x90
L00007350:
movl -8(%esi,%ecx,4), %eax
movl %eax, 8(%edx,%ecx,4)
movl -12(%esi,%ecx,4), %eax
movl %eax, 4(%edx,%ecx,4)
movl -16(%esi,%ecx,4), %eax
movl %eax, (%edx,%ecx,4)
movl -20(%esi,%ecx,4), %eax
movl %eax, -4(%edx,%ecx,4)
addl $-4, %ecx
cmpl $1, %ecx
jg L00007350
L00007377:
movl %edi, %esi
jmp L000071CF
# ----------------------
.align 4, 0x90
.globl _F2xq_sqrtn
_F2xq_sqrtn:
pushl %ebp
pushl %ebx
pushl %edi
pushl %esi
subl $28, %esp
call L0000738C
L0000738C:
popl %edi
movl 60(%esp), %ebx
movl 56(%esp), %esi
movl 48(%esp), %ebp
movl $16777215, %eax
movl (%ebp), %ecx
andl %eax, %ecx
cmpl $2, %ecx
jne L0000743E
L000073AC:
testl %ebx, %ebx
je L000073FE
L000073B0:
movl L_avma$non_lazy_ptr-L0000738C(%edi), %ebx
movl (%ebx), %ebp
movl L_bot$non_lazy_ptr-L0000738C(%edi), %eax
movl %ebp, %ecx
subl (%eax), %ecx
movl 4(%esi), %eax
cmpl $11, %ecx
leal -12(%ebp), %esi
ja L000073E1
L000073CD:
movl $14, (%esp)
movl %eax, 24(%esp)
call _pari_err
L000073DD:
movl 24(%esp), %eax
L000073E1:
movl %esi, (%ebx)
movl $738197507, -12(%ebp)
movl %eax, -8(%ebp)
movl $1, -4(%ebp)
movl 60(%esp), %eax
movl %esi, (%eax)
movl 56(%esp), %esi
L000073FE:
movl 4(%esi), %edx
movl L_avma$non_lazy_ptr-L0000738C(%edi), %ebx
movl (%ebx), %ebp
leal -8(%ebp), %esi
movl L_bot$non_lazy_ptr-L0000738C(%edi), %eax
movl %ebp, %ecx
subl (%eax), %ecx
cmpl $7, %ecx
ja L0000742B
L0000741B:
movl $14, (%esp)
movl %edx, %edi
call _pari_err
L00007429:
movl %edi, %edx
L0000742B:
movl %esi, (%ebx)
movl $738197506, -8(%ebp)
movl %edx, -4(%ebp)
movl %esi, %eax
jmp L000074EB
L0000743E:
andl (%esi), %eax
movl $-1, %ecx
cmpl $2, %eax
je L0000749B
L0000744A:
movl -4(%esi,%eax,4), %edx
movl %esi, %ebx
movl %edx, %ecx
shrl $16, %ecx
cmpl $65535, %edx
cmovbe %edx, %ecx
movl $12, %esi
movl $28, %edx
cmova %esi, %edx
cmpl $256, %ecx
jb L00007479
L00007473:
addl $-8, %edx
shrl $8, %ecx
L00007479:
sall $5, %eax
cmpl $16, %ecx
movl %ebx, %esi
jb L00007489
L00007483:
addl $-4, %edx
shrl $4, %ecx
L00007489:
movl 60(%esp), %ebx
addl $-65, %eax
subl %edx, %eax
subl _F2x_degree_lg.__bfffo_tabshi-L0000738C(%edi,%ecx,4), %eax
movl %eax, %ecx
L0000749B:
movl %ecx, 4(%esp)
movl $2, (%esp)
call _powuu
L000074AB:
movl 4(%eax), %ecx
sarl $30, %ecx
movl %ecx, 8(%esp)
movl %eax, 4(%esp)
movl $-1, (%esp)
call _addsi_sign
L000074C5:
leal _F2xq_star-L0000738C(%edi), %ecx
movl %ecx, 20(%esp)
movl %esi, 16(%esp)
movl %ebx, 12(%esp)
movl %eax, 8(%esp)
movl 52(%esp), %eax
movl %eax, 4(%esp)
movl %ebp, (%esp)
call _gen_Shanks_sqrtn
L000074EB:
addl $28, %esp
popl %esi
popl %edi
popl %ebx
popl %ebp
ret
# ----------------------
.align 4, 0x90
.globl _gener_F2xq
_gener_F2xq:
pushl %ebp
pushl %ebx
pushl %edi
pushl %esi
subl $76, %esp
call L0000750C
L0000750C:
popl %ebx
movl 96(%esp), %ecx
movl 4(%ecx), %esi
movl %esi, 48(%esp)
movl $16777215, %eax
andl (%ecx), %eax
movl $-1, %ebp
cmpl $2, %eax
je L00007634
L0000752D:
movl %esi, %edi
movl 96(%esp), %ecx
movl -4(%ecx,%eax,4), %edx
movl %edx, %ecx
shrl $16, %ecx
cmpl $65535, %edx
cmovbe %edx, %ecx
movl $12, %esi
movl $28, %edx
cmova %esi, %edx
cmpl $256, %ecx
jb L00007560
L0000755A:
addl $-8, %edx
shrl $8, %ecx
L00007560:
movl %edi, %esi
sall $5, %eax
cmpl $16, %ecx
jb L00007570
L0000756A:
addl $-4, %edx
shrl $4, %ecx
L00007570:
addl $-65, %eax
subl %edx, %eax
subl _F2x_degree_lg.__bfffo_tabshi-L0000750C(%ebx,%ecx,4), %eax
cmpl $1, %eax
movl %eax, %ebp
jne L00007634
L00007587:
movl %esi, 48(%esp)
cmpl $0, 100(%esp)
je L000075F0
L00007592:
movl L_gen_1$non_lazy_ptr-L0000750C(%ebx), %eax
movl (%eax), %eax
movl %eax, 68(%esp)
call _trivfact
L000075A3:
movl %eax, %edx
movl L_avma$non_lazy_ptr-L0000750C(%ebx), %edi
movl %ebx, %esi
movl (%edi), %ebx
leal -12(%ebx), %ebp
movl L_bot$non_lazy_ptr-L0000750C(%esi), %eax
movl %ebx, %ecx
subl (%eax), %ecx
cmpl $11, %ecx
ja L000075D5
L000075C1:
movl $14, (%esp)
movl %edx, 64(%esp)
call _pari_err
L000075D1:
movl 64(%esp), %edx
L000075D5:
movl %ebp, (%edi)
movl $570425347, -12(%ebx)
movl 68(%esp), %eax
movl %eax, -8(%ebx)
movl %edx, -4(%ebx)
movl 100(%esp), %eax
movl %ebp, (%eax)
movl %esi, %ebx
L000075F0:
movl %ebx, %eax
movl L_avma$non_lazy_ptr-L0000750C(%eax), %ebx
movl (%ebx), %edi
leal -12(%edi), %esi
movl L_bot$non_lazy_ptr-L0000750C(%eax), %eax
movl %edi, %ecx
subl (%eax), %ecx
cmpl $11, %ecx
ja L00007618
L0000760C:
movl $14, (%esp)
call _pari_err
L00007618:
movl %esi, (%ebx)
movl $738197507, -12(%edi)
movl 48(%esp), %eax
movl %eax, -8(%edi)
movl $1, -4(%edi)
jmp L00007C66
L00007634:
movl %ebp, 64(%esp)
movl L_avma$non_lazy_ptr-L0000750C(%ebx), %eax
movl %eax, 68(%esp)
movl (%eax), %eax
movl %eax, 28(%esp)
movl %ebp, 4(%esp)
movl $2, (%esp)
call _powuu
L00007658:
movl 4(%eax), %ecx
sarl $30, %ecx
movl %ecx, 8(%esp)
movl %eax, 4(%esp)
movl $-1, (%esp)
call _addsi_sign
L00007672:
movl %eax, 36(%esp)
movl L_gen_2$non_lazy_ptr-L0000750C(%ebx), %eax
movl (%eax), %eax
movl %ebp, 4(%esp)
movl %eax, (%esp)
call _factor_pn_1
L0000768A:
movl %eax, 20(%esp)
movl 4(%eax), %ebp
movl (%ebp), %eax
movl %eax, 32(%esp)
movl %ebx, %edi
movl %eax, %ebx
andl $16777215, %ebx
movl 68(%esp), %eax
movl (%eax), %edx
movl %edx, 40(%esp)
leal 0(,%ebx,4), %eax
movl %edx, %ecx
subl %eax, %ecx
movl %ecx, 44(%esp)
movl L_bot$non_lazy_ptr-L0000750C(%edi), %ecx
movl %ecx, 24(%esp)
movl %edi, 56(%esp)
movl %edx, %eax
subl (%ecx), %eax
movl %ebx, %ecx
shrl $2, %eax
cmpl %ecx, %eax
jae L000076E6
L000076D6:
movl $14, (%esp)
movl %ecx, %ebx
call _pari_err
L000076E4:
movl %ebx, %ecx
L000076E6:
movl 44(%esp), %eax
movl 68(%esp), %edi
movl %eax, (%edi)
movl $-16777217, %ebx
andl (%ebp), %ebx
movl %ebx, (%eax)
cmpl $2, %ecx
jb L000078A9
L00007703:
movl %esi, 48(%esp)
movl 32(%esp), %ebx
andl $16777215, %ebx
movl %ebx, %edi
negl %edi
cmpl $-3, %edi
movl $-2, %edx
movl $-2, %esi
cmovg %edi, %esi
addl %ebx, %esi
cmpl $-1, %esi
movl %ecx, %eax
movl %ecx, 52(%esp)
je L000077F8
L00007736:
incl %esi
movl %esi, 60(%esp)
cmpl $-3, %edi
movl %esi, %eax
movl $-2, %esi
cmovg %edi, %esi
xorl %ecx, %ecx
andl $-8, %eax
je L000077EA
L00007753:
movl %eax, 16(%esp)
movl %esi, %eax
notl %eax
leal (%ebp,%eax,4), %ecx
movl 40(%esp), %eax
leal -4(%eax), %eax
cmpl %ecx, %eax
ja L00007783
L0000776A:
leal -4(%ebp,%ebx,4), %eax
addl %ebx, %esi
notl %esi
movl 40(%esp), %ecx
leal (%ecx,%esi,4), %esi
xorl %ecx, %ecx
cmpl %esi, %eax
movl 52(%esp), %eax
jbe L000077EE
L00007783:
movl 52(%esp), %edx
movl %edx, %eax
subl 16(%esp), %eax
cmpl $-3, %edi
movl $-2, %esi
cmovg %edi, %esi
leal 1(%esi,%ebx), %esi
andl $-8, %esi
movl 56(%esp), %edi
movdqa LC000094B0-L0000750C(%edi), %xmm0
movl 40(%esp), %ecx
.align 4, 0x90
L000077B0:
movd %ebx, %xmm1
pshufd $0, %xmm1, %xmm1
paddd %xmm0, %xmm1
movd %xmm1, %edi
movups -12(%ebp,%edi,4), %xmm1
movups -28(%ebp,%edi,4), %xmm2
subl %edx, %edi
movups %xmm1, -12(%ecx,%edi,4)
movups %xmm2, -28(%ecx,%edi,4)
addl $-8, %ebx
addl $-8, %esi
jne L000077B0
L000077DF:
movl 16(%esp), %ecx
movl $-2, %edx
jmp L000077EE
L000077EA:
movl 52(%esp), %eax
L000077EE:
cmpl %ecx, 60(%esp)
je L00007897
L000077F8:
movl %eax, %esi
negl %esi
cmpl $-3, %esi
cmovg %esi, %edx
movl %edx, %ecx
leal (%eax,%ecx), %edx
leal 1(%eax,%ecx), %ecx
testb $3, %cl
je L0000784D
L00007810:
movl 32(%esp), %ecx
notl %ecx
orl $1056964608, %ecx
movl 40(%esp), %edi
leal (%edi,%ecx,4), %ecx
cmpl $-3, %esi
movl $-2, %edi
cmovg %esi, %edi
leal 1(%eax,%edi), %esi
andl $3, %esi
negl %esi
.align 4, 0x90
L00007840:
movl -4(%ebp,%eax,4), %edi
movl %edi, (%ecx,%eax,4)
leal -1(%eax), %eax
incl %esi
jne L00007840
L0000784D:
cmpl $3, %edx
jb L00007897
L00007852:
movl 32(%esp), %ecx
notl %ecx
orl $1056964608, %ecx
movl 40(%esp), %edx
leal (%edx,%ecx,4), %ecx
.align 4, 0x90
L00007870:
movl -4(%ebp,%eax,4), %edx
movl %edx, (%ecx,%eax,4)
movl -8(%ebp,%eax,4), %edx
movl %edx, -4(%ecx,%eax,4)
movl -12(%ebp,%eax,4), %edx
movl %edx, -8(%ecx,%eax,4)
movl -16(%ebp,%eax,4), %edx
movl %edx, -12(%ecx,%eax,4)
leal -4(%eax), %eax
cmpl $1, %eax
jg L00007870
L00007897:
movl 44(%esp), %eax
movl (%eax), %ebx
movl 48(%esp), %esi
movl 68(%esp), %edi
movl 52(%esp), %ecx
L000078A9:
movl %ebx, %eax
andl $16777214, %eax
cmpl $2, %eax
jb L0000796C
L000078B9:
movl %ecx, 52(%esp)
movl %edi, 68(%esp)
movl 32(%esp), %eax
andl $16777215, %eax
sall $2, %eax
movl 40(%esp), %ecx
subl %eax, %ecx
movl %ecx, 60(%esp)
movl $1, %edi
movl $1, %ebp
.align 4, 0x90
L000078F0:
movl 60(%esp), %eax
movl (%eax,%edi,4), %eax
movl 4(%eax), %ecx
movl $16777215, %edx
andl %edx, %ecx
cmpl $3, %ecx
jne L0000790C
L00007906:
cmpl $2, 8(%eax)
je L00007932
L0000790C:
movl %eax, 4(%esp)
movl 36(%esp), %eax
movl %eax, (%esp)
call _diviiexact
L0000791C:
leal 1(%ebp), %ecx
subl 52(%esp), %ebp
movl 40(%esp), %edx
movl %eax, (%edx,%ebp,4)
movl 44(%esp), %eax
movl (%eax), %ebx
movl %ecx, %ebp
L00007932:
incl %edi
movl %ebx, %eax
andl $16777215, %eax
cmpl %eax, %edi
jl L000078F0
L0000793E:
andl $-16777216, %ebx
cmpl $16777216, %ebp
movl 68(%esp), %edi
jb L00007977
L00007950:
movl 56(%esp), %eax
leal LC00009591-L0000750C(%eax), %eax
movl %eax, 4(%esp)
movl $15, (%esp)
call _pari_err
L0000796A:
jmp L00007977
L0000796C:
andl $-16777216, %ebx
movl $1, %ebp
L00007977:
movl 40(%esp), %eax
movl %ebp, 52(%esp)
movl %edi, 68(%esp)
orl %ebp, %ebx
movl 44(%esp), %ecx
movl %ebx, (%ecx)
movl (%edi), %ecx
movl %ecx, 60(%esp)
movl 32(%esp), %ecx
andl $16777215, %ecx
sall $2, %ecx
subl %ecx, %eax
movl %eax, %ebx
jmp L000079BA
L000079A4:
.align 4, 0x90
L000079B0:
movl 68(%esp), %eax
movl 60(%esp), %ecx
movl %ecx, (%eax)
L000079BA:
movl %esi, 4(%esp)
movl 64(%esp), %eax
movl %eax, (%esp)
call _random_F2x
L000079CA:
movl %eax, %edi
movl %edi, 72(%esp)
movl (%edi), %eax
movl $16777215, %ecx
andl %ecx, %eax
cmpl $2, %eax
je L000079B0
L000079DE:
movl %esi, %ebp
movl -4(%edi,%eax,4), %edx
movl %edx, %ecx
shrl $16, %ecx
cmpl $65535, %edx
cmovbe %edx, %ecx
movl $28, %edx
movl $12, %esi
cmova %esi, %edx
cmpl $256, %ecx
jb L00007A0D
L00007A07:
addl $-8, %edx
shrl $8, %ecx
L00007A0D:
movl %ebp, %esi
movl 52(%esp), %ebp
sall $5, %eax
cmpl $16, %ecx
jb L00007A21
L00007A1B:
addl $-4, %edx
shrl $4, %ecx
L00007A21:
addl $-65, %eax
subl %edx, %eax
movl 56(%esp), %edx
subl _F2x_degree_lg.__bfffo_tabshi-L0000750C(%edx,%ecx,4), %eax
testl %eax, %eax
jle L000079B0
L00007A39:
movl $1, %esi
cmpl $2, %ebp
jl L00007A80
L00007A43:
.align 4, 0x90
L00007A50:
movl (%ebx,%esi,4), %eax
movl 96(%esp), %ecx
movl %ecx, 8(%esp)
movl %eax, 4(%esp)
movl %edi, (%esp)
call _F2xq_pow
L00007A67:
movl (%eax), %ecx
movl $16777215, %edx
andl %edx, %ecx
cmpl $3, %ecx
jne L00007A7B
L00007A75:
cmpl $1, 8(%eax)
je L00007A80
L00007A7B:
incl %esi
cmpl %ebp, %esi
jl L00007A50
L00007A80:
cmpl %ebp, %esi
movl 48(%esp), %esi
jne L000079B0
L00007A8C:
movl 100(%esp), %ebp
testl %ebp, %ebp
je L00007B27
L00007A98:
movl 64(%esp), %eax
movl %eax, (%esp)
call _int2n
L00007AA4:
movl 4(%eax), %ecx
sarl $30, %ecx
movl %ecx, 8(%esp)
movl %eax, 4(%esp)
movl $-1, (%esp)
call _addsi_sign
L00007ABE:
movl 68(%esp), %edi
movl (%edi), %esi
leal -12(%esi), %ebx
movl %esi, %edx
movl 24(%esp), %ecx
subl (%ecx), %edx
cmpl $11, %edx
ja L00007AE8
L00007AD4:
movl $14, (%esp)
movl %eax, 64(%esp)
call _pari_err
L00007AE4:
movl 64(%esp), %eax
L00007AE8:
movl %ebx, (%edi)
movl $570425347, -12(%esi)
movl %eax, -8(%esi)
movl 20(%esp), %eax
movl %eax, -4(%esi)
movl %ebx, (%ebp)
movl %ebp, 12(%esp)
leal 72(%esp), %eax
movl %eax, 8(%esp)
movl 28(%esp), %eax
movl %eax, (%esp)
movl $2, 4(%esp)
call _gerepileall
L00007B1E:
movl 72(%esp), %esi
jmp L00007C66
L00007B27:
movl %edi, (%esp)
call _copy_bin
L00007B2F:
movl %eax, %edx
movl 28(%esp), %esi
movl 68(%esp), %eax
movl %esi, (%eax)
movl 4(%edx), %eax
testl %eax, %eax
je L00007BCC
L00007B46:
movl (%edx), %ebx
movl %ebx, 64(%esp)
movl %eax, 60(%esp)
movl %eax, %ebp
subl 8(%edx), %ebp
movl %edx, 48(%esp)
sarl $2, %ebp
leal 0(,%ebx,4), %edi
movl %edi, 52(%esp)
movl %esi, %eax
movl 24(%esp), %edx
subl (%edx), %eax
subl %edi, %esi
shrl $2, %eax
cmpl %ebx, %eax
jae L00007B84
L00007B78:
movl $14, (%esp)
call _pari_err
L00007B84:
movl 68(%esp), %eax
movl %esi, (%eax)
movl 48(%esp), %edi
movl %edi, %eax
addl $16, %eax
movl 52(%esp), %ecx
movl %ecx, 8(%esp)
movl %eax, 4(%esp)
movl %esi, (%esp)
call _memcpy
L00007BA7:
subl 64(%esp), %ebp
movl 28(%esp), %eax
leal (%eax,%ebp,4), %esi
movl %esi, %eax
subl 60(%esp), %eax
cmpl $0, 12(%edi)
je L00007C17
L00007BBE:
movl %eax, 4(%esp)
movl %esi, (%esp)
call _shiftaddress_canon
L00007BCA:
jmp L00007C23
L00007BCC:
movl 56(%esp), %ebp
movl L_PARI_SIGINT_block$non_lazy_ptr-L0000750C(%ebp), %esi
movl (%esi), %ebx
movl $1, (%esi)
movl %edx, (%esp)
call _free
L00007BE6:
movl %ebx, (%esi)
testl %ebx, %ebx
movl %ebp, %esi
jne L00007C09
L00007BEE:
movl L_PARI_SIGINT_pending$non_lazy_ptr-L0000750C(%esi), %eax
cmpl $0, (%eax)
je L00007C09
L00007BF9:
movl (%eax), %ecx
movl $0, (%eax)
movl %ecx, (%esp)
call _raise
L00007C09:
movl L_gen_0$non_lazy_ptr-L0000750C(%esi), %eax
movl (%eax), %esi
movl %esi, 72(%esp)
jmp L00007C66
L00007C17:
movl %eax, 4(%esp)
movl %esi, (%esp)
call _shiftaddress
L00007C23:
movl 56(%esp), %eax
movl L_PARI_SIGINT_block$non_lazy_ptr-L0000750C(%eax), %ebx
movl (%ebx), %ebp
movl $1, (%ebx)
movl %edi, (%esp)
call _free
L00007C3D:
movl %ebp, (%ebx)
testl %ebp, %ebp
jne L00007C62
L00007C43:
movl 56(%esp), %eax
movl L_PARI_SIGINT_pending$non_lazy_ptr-L0000750C(%eax), %eax
cmpl $0, (%eax)
je L00007C62
L00007C52:
movl (%eax), %ecx
movl $0, (%eax)
movl %ecx, (%esp)
call _raise
L00007C62:
movl %esi, 72(%esp)
L00007C66:
movl %esi, %eax
addl $76, %esp
popl %esi
popl %edi
popl %ebx
popl %ebp
ret
_F2x_equal1:
movl 4(%esp), %eax
movl $16777215, %ecx
andl (%eax), %ecx
cmpl $3, %ecx
jne L00007C8B
L00007C80:
cmpl $1, 8(%eax)
sete %al
movzbl %al, %eax
ret
L00007C8B:
xorl %eax, %eax
movzbl %al, %eax
ret
# ----------------------
.align 4, 0x90
.globl _ZXX_to_F2xX
_ZXX_to_F2xX:
pushl %ebp
pushl %ebx
pushl %edi
pushl %esi
subl $28, %esp
call L00007CAC
L00007CAC:
popl %eax
movl 48(%esp), %ebx
movl (%ebx), %esi
andl $16777215, %esi
movl L_avma$non_lazy_ptr-L00007CAC(%eax), %ecx
movl %ecx, 24(%esp)
movl (%ecx), %edi
leal 0(,%esi,4), %ecx
movl %edi, %ebp
subl %ecx, %ebp
movl %ebp, 20(%esp)
movl L_bot$non_lazy_ptr-L00007CAC(%eax), %ecx
movl %ecx, 16(%esp)
movl %edi, %eax
subl (%ecx), %eax
shrl $2, %eax
cmpl %esi, %eax
jae L00007CF5
L00007CE9:
movl $14, (%esp)
call _pari_err
L00007CF5:
movl 24(%esp), %eax
movl %ebp, (%eax)
movl %esi, %eax
orl $335544320, %eax
movl %eax, (%ebp)
movl $1073676288, %eax
andl 4(%ebx), %eax
orl $1073741824, %eax
movl $1, %ecx
subl %esi, %ecx
movl %eax, (%edi,%ecx,4)
cmpl $3, %esi
jb L00007E19
L00007D25:
movl $2, %edi
.align 4, 0x90
L00007D30:
movl (%ebx,%edi,4), %eax
movl (%eax), %ecx
shrl $25, %ecx
cmpl $10, %ecx
jne L00007D50
L00007D3D:
movl %eax, (%esp)
call _ZX_to_F2x
L00007D45:
movl %eax, (%ebp,%edi,4)
jmp L00007E10
L00007D4E:
.align 4, 0x90
L00007D50:
cmpl $1, %ecx
jne L00007E10
L00007D59:
movl 4(%eax), %ecx
cmpl $1073741823, %ecx
jbe L00007DC2
L00007D64:
andl $16777215, %ecx
testb $1, -4(%eax,%ecx,4)
movl 24(%esp), %eax
movl (%eax), %ebp
je L00007DC8
L00007D77:
movl %ebp, %edx
addl $-12, %edx
movl %ebp, %eax
movl 16(%esp), %ecx
subl (%ecx), %eax
cmpl $11, %eax
ja L00007D9D
L00007D89:
movl $14, (%esp)
movl %edx, 12(%esp)
call _pari_err
L00007D99:
movl 12(%esp), %edx
L00007D9D:
movl 24(%esp), %eax
movl %edx, (%eax)
movl $738197507, -12(%ebp)
movl 52(%esp), %eax
movl %eax, -8(%ebp)
movl $1, -4(%ebp)
movl 20(%esp), %ebp
movl %edx, (%ebp,%edi,4)
jmp L00007E10
L00007DC2:
movl 24(%esp), %eax
movl (%eax), %ebp
L00007DC8:
leal -8(%ebp), %ebx
movl %ebp, %eax
movl 16(%esp), %ecx
subl (%ecx), %eax
cmpl $7, %eax
ja L00007DE4
L00007DD8:
movl $14, (%esp)
call _pari_err
L00007DE4:
movl 24(%esp), %eax
movl %ebx, (%eax)
movl $738197506, -8(%ebp)
movl 52(%esp), %eax
movl %eax, -4(%ebp)
movl 20(%esp), %ebp
movl %ebx, (%ebp,%edi,4)
movl 48(%esp), %ebx
.align 4, 0x90
L00007E10:
incl %edi
cmpl %esi, %edi
jl L00007D30
L00007E19:
movl %esi, 4(%esp)
movl %ebp, (%esp)
call _FlxX_renormalize
L00007E25:
addl $28, %esp
popl %esi
popl %edi
popl %ebx
popl %ebp
ret
# ----------------------
.align 4, 0x90
.globl _F2c_to_ZC
_F2c_to_ZC:
pushl %ebp
pushl %ebx
pushl %edi
pushl %esi
subl $60, %esp
call L00007E3C
L00007E3C:
popl %edi
movl %edi, 52(%esp)
movl 80(%esp), %eax
movl 4(%eax), %esi
movl L_avma$non_lazy_ptr-L00007E3C(%edi), %ebp
movl (%ebp), %edx
movl %edx, 28(%esp)
movl L_bot$non_lazy_ptr-L00007E3C(%edi), %eax
movl %edx, %ecx
subl (%eax), %ecx
leal 1(%esi), %eax
movl %eax, 36(%esp)
shrl $2, %ecx
cmpl %eax, %ecx
movl %esi, %eax
notl %eax
movl %eax, 32(%esp)
leal (%edx,%eax,4), %eax
movl %eax, 20(%esp)
jae L00007E88
L00007E7C:
movl $14, (%esp)
call _pari_err
L00007E88:
movl 20(%esp), %eax
movl %eax, (%ebp)
movl 36(%esp), %ebp
cmpl $16777216, %ebp
jb L00007EB1
L00007E9B:
leal LC00009591-L00007E3C(%edi), %eax
movl %eax, 4(%esp)
movl $15, (%esp)
call _pari_err
L00007EB1:
movl %ebp, %eax
orl $603979776, %eax
movl 20(%esp), %ecx
movl %eax, (%ecx)
movl 80(%esp), %eax
movl (%eax), %eax
movl %eax, %ecx
andl $16777215, %ecx
cmpl $3, %ecx
jb L00007FDD
L00007ED5:
sall $2, %esi
movl 28(%esp), %ecx
subl %esi, %ecx
movl %ecx, 24(%esp)
movl $2, %ebx
movl $1, %esi
.align 4, 0x90
L00007EF0:
cmpl %ebp, %esi
jge L00007FCC
L00007EF8:
movl 32(%esp), %eax
leal (%esi,%eax), %ebp
cmpl $-32, %ebp
movl $-32, %edx
cmova %ebp, %edx
movl %edx, 40(%esp)
movl %edx, %ecx
notl %ecx
negl %edx
movl %esi, %eax
movl %eax, 44(%esp)
xorl %esi, %esi
testb $1, %dl
movl %eax, %edx
movl 80(%esp), %eax
je L00007F57
L00007F27:
movl (%eax,%ebx,4), %edx
testb $1, %dl
movl L_gen_0$non_lazy_ptr-L00007E3C(%edi), %edx
cmovne L_gen_1$non_lazy_ptr-L00007E3C(%edi), %edx
movl (%edx), %edx
movl %ecx, 48(%esp)
movl 28(%esp), %ecx
movl %edx, (%ecx,%ebp,4)
movl $1, %esi
movl 44(%esp), %ecx
leal 1(%ecx), %edx
movl 48(%esp), %ecx
L00007F57:
testl %ecx, %ecx
movl %ebx, 56(%esp)
je L00007FBE
L00007F5F:
movl %ecx, 48(%esp)
movl 24(%esp), %ecx
leal (%ecx,%edx,4), %edx
.align 4, 0x90
L00007F70:
movl (%eax,%ebx,4), %ebp
btl %esi, %ebp
movl L_gen_1$non_lazy_ptr-L00007E3C(%edi), %ebp
movl 52(%esp), %ecx
movl L_gen_0$non_lazy_ptr-L00007E3C(%ecx), %edi
movl %edi, %ebx
cmovb %ebp, %ebx
movl (%ebx), %ebx
movl %ebx, -4(%edx)
leal 1(%esi), %ebx
movl %eax, %ecx
movl 56(%esp), %eax
movl (%ecx,%eax,4), %eax
btl %ebx, %eax
cmovb %ebp, %edi
movl (%edi), %eax
movl 52(%esp), %edi
movl %eax, (%edx)
movl %ecx, %eax
movl 48(%esp), %ecx
addl $2, %esi
addl $8, %edx
cmpl %ecx, %ebx
movl 56(%esp), %ebx
jne L00007F70
L00007FBE:
movl 44(%esp), %esi
subl 40(%esp), %esi
movl (%eax), %eax
movl 36(%esp), %ebp
L00007FCC:
incl %ebx
movl %eax, %edx
andl $16777215, %edx
cmpl %edx, %ebx
jl L00007EF0
L00007FDD:
movl 20(%esp), %eax
addl $60, %esp
popl %esi
popl %edi
popl %ebx
popl %ebp
ret
# ----------------------
.align 4, 0x90
.globl _F2m_to_ZM
_F2m_to_ZM:
pushl %ebp
pushl %ebx
pushl %edi
pushl %esi
subl $12, %esp
call L00007FFC
L00007FFC:
popl %eax
movl 32(%esp), %edi
movl (%edi), %ebx
andl $16777215, %ebx
movl L_avma$non_lazy_ptr-L00007FFC(%eax), %ebp
movl (%ebp), %ecx
leal 0(,%ebx,4), %edx
movl %ecx, %esi
subl %edx, %esi
movl L_bot$non_lazy_ptr-L00007FFC(%eax), %eax
subl (%eax), %ecx
shrl $2, %ecx
cmpl %ebx, %ecx
jae L00008038
L0000802C:
movl $14, (%esp)
call _pari_err
L00008038:
movl %esi, (%ebp)
movl %ebx, %eax
orl $637534208, %eax
movl %eax, (%esi)
cmpl $2, %ebx
jb L00008063
L00008049:
movl $1, %ebp
.align 4, 0x90
L00008050:
movl (%edi,%ebp,4), %eax
movl %eax, (%esp)
call _F2c_to_ZC
L0000805B:
movl %eax, (%esi,%ebp,4)
incl %ebp
cmpl %ebx, %ebp
jl L00008050
L00008063:
movl %esi, %eax
addl $12, %esp
popl %esi
popl %edi
popl %ebx
popl %ebp
ret
# ----------------------
.align 4, 0x90
.globl _ZV_to_F2v
_ZV_to_F2v:
pushl %ebp
pushl %ebx
pushl %edi
pushl %esi
subl $28, %esp
call L0000807C
L0000807C:
popl %eax
movl 48(%esp), %ecx
movl $16777215, %edi
andl (%ecx), %edi
leal 94(%edi), %ebx
shrl $5, %ebx
movl L_avma$non_lazy_ptr-L0000807C(%eax), %ecx
movl %ecx, 12(%esp)
movl (%ecx), %edx
movl %edx, 24(%esp)
leal 0(,%ebx,4), %ecx
movl %edx, %esi
subl %ecx, %esi
movl L_bot$non_lazy_ptr-L0000807C(%eax), %eax
movl %edx, %ecx
subl (%eax), %ecx
shrl $2, %ecx
cmpl %ebx, %ecx
leal -1(%edi), %ebp
jae L000080C9
L000080BD:
movl $14, (%esp)
call _pari_err
L000080C9:
movl %esi, 16(%esp)
movl 12(%esp), %eax
movl %esi, (%eax)
movl %ebx, %eax
orl $738197504, %eax
movl %eax, (%esi)
movl $1, %eax
movl $1, %ecx
subl %ebx, %ecx
movl 24(%esp), %edx
movl %ebp, %esi
movl %esi, 20(%esp)
movl %esi, (%edx,%ecx,4)
cmpl $2, %edi
jb L00008167
L000080FA:
movl $32, %ecx
xorl %edx, %edx
.align 4, 0x90
L00008110:
cmpl $32, %ecx
jne L00008127
L00008115:
incl %eax
movl %eax, %ecx
subl %ebx, %ecx
movl 24(%esp), %edi
movl $0, (%edi,%ecx,4)
xorl %ecx, %ecx
L00008127:
movl 48(%esp), %edi
movl 4(%edi,%edx,4), %edi
movl 4(%edi), %ebp
cmpl $1073741824, %ebp
jb L00008161
L0000813A:
andl $16777215, %ebp
testb $1, -4(%edi,%ebp,4)
je L00008161
L00008147:
movl $1, %edi
sall %cl, %edi
movl %eax, %ebp
subl %ebx, %ebp
movl %ebx, %esi
movl 24(%esp), %ebx
orl %edi, (%ebx,%ebp,4)
movl %esi, %ebx
movl 20(%esp), %esi
L00008161:
incl %ecx
incl %edx
cmpl %esi, %edx
jl L00008110
L00008167:
movl 16(%esp), %eax
addl $28, %esp
popl %esi
popl %edi
popl %ebx
popl %ebp
ret
# ----------------------
.align 4, 0x90
.globl _Flv_to_F2v
_Flv_to_F2v:
pushl %ebp
pushl %ebx
pushl %edi
pushl %esi
subl $12, %esp
call L0000818C
L0000818C:
popl %eax
movl 32(%esp), %ecx
movl $16777215, %edi
andl (%ecx), %edi
leal 94(%edi), %ebx
shrl $5, %ebx
movl L_avma$non_lazy_ptr-L0000818C(%eax), %edx
movl (%edx), %ebp
leal 0(,%ebx,4), %ecx
movl %ebp, %esi
subl %ecx, %esi
movl L_bot$non_lazy_ptr-L0000818C(%eax), %eax
movl %ebp, %ecx
subl (%eax), %ecx
shrl $2, %ecx
cmpl %ebx, %ecx
leal -1(%edi), %eax
movl %eax, 8(%esp)
jae L000081DD
L000081C9:
movl $14, (%esp)
movl %edx, 4(%esp)
call _pari_err
L000081D9:
movl 4(%esp), %edx
L000081DD:
movl %esi, (%edx)
movl %ebx, %eax
orl $738197504, %eax
movl %eax, (%esi)
movl %esi, 4(%esp)
movl $1, %esi
movl $1, %ecx
subl %ebx, %ecx
movl 8(%esp), %eax
movl %eax, (%ebp,%ecx,4)
cmpl $2, %edi
jb L00008246
L00008205:
movl $32, %ecx
xorl %edx, %edx
.align 4, 0x90
L00008210:
cmpl $32, %ecx
jne L00008224
L00008215:
incl %esi
movl %esi, %ecx
subl %ebx, %ecx
movl $0, (%ebp,%ecx,4)
xorl %ecx, %ecx
L00008224:
movl 32(%esp), %eax
testb $1, 4(%eax,%edx,4)
je L0000823E
L0000822F:
movl $1, %edi
sall %cl, %edi
movl %esi, %eax
subl %ebx, %eax
orl %edi, (%ebp,%eax,4)
L0000823E:
incl %ecx
incl %edx
cmpl 8(%esp), %edx
jl L00008210
L00008246:
movl 4(%esp), %eax
addl $12, %esp
popl %esi
popl %edi
popl %ebx
popl %ebp
ret
# ----------------------
.align 4, 0x90
.globl _ZM_to_F2m
_ZM_to_F2m:
pushl %ebp
pushl %ebx
pushl %edi
pushl %esi
subl $12, %esp
call L0000826C
L0000826C:
popl %eax
movl 32(%esp), %edi
movl (%edi), %ebx
andl $16777215, %ebx
movl L_avma$non_lazy_ptr-L0000826C(%eax), %ebp
movl (%ebp), %ecx
leal 0(,%ebx,4), %edx
movl %ecx, %esi
subl %edx, %esi
movl L_bot$non_lazy_ptr-L0000826C(%eax), %eax
subl (%eax), %ecx
shrl $2, %ecx
cmpl %ebx, %ecx
jae L000082A8
L0000829C:
movl $14, (%esp)
call _pari_err
L000082A8:
movl %esi, (%ebp)
movl %ebx, %eax
orl $637534208, %eax
movl %eax, (%esi)
cmpl $2, %ebx
jb L000082D3
L000082B9:
movl $1, %ebp
.align 4, 0x90
L000082C0:
movl (%edi,%ebp,4), %eax
movl %eax, (%esp)
call _ZV_to_F2v
L000082CB:
movl %eax, (%esi,%ebp,4)
incl %ebp
cmpl %ebx, %ebp
jl L000082C0
L000082D3:
movl %esi, %eax
addl $12, %esp
popl %esi
popl %edi
popl %ebx
popl %ebp
ret
# ----------------------
.align 4, 0x90
.globl _Flm_to_F2m
_Flm_to_F2m:
pushl %ebp
pushl %ebx
pushl %edi
pushl %esi
subl $44, %esp
call L000082EC
L000082EC:
popl %eax
movl 64(%esp), %ecx
movl $16777215, %esi
andl (%ecx), %esi
movl L_avma$non_lazy_ptr-L000082EC(%eax), %edi
movl %edi, 28(%esp)
movl (%edi), %edx
movl %edx, 16(%esp)
leal 0(,%esi,4), %ecx
movl %edx, %ebx
subl %ecx, %ebx
movl L_bot$non_lazy_ptr-L000082EC(%eax), %ecx
movl %ecx, 12(%esp)
movl %edx, %eax
subl (%ecx), %eax
shrl $2, %eax
cmpl %esi, %eax
jae L00008334
L00008328:
movl $14, (%esp)
call _pari_err
L00008334:
movl %edi, %ecx
movl %ecx, 28(%esp)
movl %ebx, (%ecx)
movl %esi, 20(%esp)
movl %esi, %eax
orl $637534208, %eax
movl %eax, (%ebx)
movl %ebx, 8(%esp)
cmpl $2, %esi
jb L0000846B
L00008356:
movl $1, %esi
.align 4, 0x90
L00008360:
movl %esi, 24(%esp)
movl 64(%esp), %eax
movl (%eax,%esi,4), %esi
movl (%esi), %edi
movl $16777215, %eax
andl %eax, %edi
leal 94(%edi), %ebp
shrl $5, %ebp
movl (%ecx), %ebx
leal 0(,%ebp,4), %eax
movl %ebx, %edx
subl %eax, %edx
movl %ebx, %eax
movl 12(%esp), %ecx
subl (%ecx), %eax
movl %ebp, %ecx
shrl $2, %eax
cmpl %ecx, %eax
leal -1(%edi), %ebp
jae L000083BB
L0000839B:
movl $14, (%esp)
movl %edx, 32(%esp)
movl %ebp, 40(%esp)
movl %ecx, %ebp
call _pari_err
L000083B1:
movl %ebp, %ecx
movl 40(%esp), %ebp
movl 32(%esp), %edx
L000083BB:
movl %ecx, 36(%esp)
movl %edx, 32(%esp)
movl 28(%esp), %eax
movl %edx, (%eax)
movl %ecx, %eax
orl $738197504, %eax
movl %eax, (%edx)
movl $1, %eax
subl %ecx, %eax
movl %ebp, (%ebx,%eax,4)
cmpl $2, %edi
movl %ebx, %eax
jb L00008447
L000083E3:
movl $32, %ecx
movl $1, 40(%esp)
xorl %edx, %edx
.align 4, 0x90
L00008400:
cmpl $32, %ecx
jne L0000841B
L00008405:
movl 40(%esp), %ecx
incl %ecx
movl %ecx, 40(%esp)
subl 36(%esp), %ecx
movl $0, (%eax,%ecx,4)
xorl %ecx, %ecx
L0000841B:
testb $1, 4(%esi,%edx,4)
je L00008441
L00008422:
movl %esi, %ebx
movl $1, %esi
sall %cl, %esi
movl %ebp, %edi
movl %eax, %ebp
movl 40(%esp), %eax
subl 36(%esp), %eax
orl %esi, (%ebp,%eax,4)
movl %ebp, %eax
movl %edi, %ebp
movl %ebx, %esi
L00008441:
incl %ecx
incl %edx
cmpl %ebp, %edx
jl L00008400
L00008447:
movl 24(%esp), %esi
movl %esi, %eax
movl 20(%esp), %ecx
subl %ecx, %eax
movl 16(%esp), %edx
movl 32(%esp), %edi
movl %edi, (%edx,%eax,4)
incl %esi
cmpl %ecx, %esi
movl 28(%esp), %ecx
jl L00008360
L0000846B:
movl 8(%esp), %eax
addl $44, %esp
popl %esi
popl %edi
popl %ebx
popl %ebp
ret
# ----------------------
.align 4, 0x90
.globl _F2v_add_inplace
_F2v_add_inplace:
pushl %ebp
pushl %ebx
pushl %edi
pushl %esi
movl 24(%esp), %ecx
movl 20(%esp), %eax
movl (%ecx), %esi
movl %esi, %edi
andl $16777215, %edi
addl $6, %esi
andl $7, %esi
movl %edi, %ebx
subl %esi, %ebx
movl $2, %edx
cmpl $3, %ebx
jl L0000850A
L000084AA:
addl $-3, %edi
subl %esi, %edi
andl $-8, %edi
movl $2, %edx
.align 4, 0x90
L000084C0:
movl (%ecx,%edx,4), %ebp
xorl %ebp, (%eax,%edx,4)
movl 4(%ecx,%edx,4), %ebp
xorl %ebp, 4(%eax,%edx,4)
movl 8(%ecx,%edx,4), %ebp
xorl %ebp, 8(%eax,%edx,4)
movl 12(%ecx,%edx,4), %ebp
xorl %ebp, 12(%eax,%edx,4)
movl 16(%ecx,%edx,4), %ebp
xorl %ebp, 16(%eax,%edx,4)
movl 20(%ecx,%edx,4), %ebp
xorl %ebp, 20(%eax,%edx,4)
movl 24(%ecx,%edx,4), %ebp
xorl %ebp, 24(%eax,%edx,4)
movl 28(%ecx,%edx,4), %ebp
xorl %ebp, 28(%eax,%edx,4)
addl $8, %edx
cmpl %ebx, %edx
jl L000084C0
L00008505:
addl $10, %edi
movl %edi, %edx
L0000850A:
decl %esi
cmpl $6, %esi
ja L00008551
L00008510:
call L00008515
L00008515:
popl %edi
addl L00008558-L00008515(%edi,%esi,4), %edi
jmp *%edi
L0000851F:
movl (%ecx,%edx,4), %esi
xorl %esi, (%eax,%edx,4)
orl $1, %edx
L00008528:
movl (%ecx,%edx,4), %esi
xorl %esi, (%eax,%edx,4)
incl %edx
L0000852F:
movl (%ecx,%edx,4), %esi
xorl %esi, (%eax,%edx,4)
incl %edx
L00008536:
movl (%ecx,%edx,4), %esi
xorl %esi, (%eax,%edx,4)
incl %edx
L0000853D:
movl (%ecx,%edx,4), %esi
xorl %esi, (%eax,%edx,4)
incl %edx
L00008544:
movl (%ecx,%edx,4), %esi
xorl %esi, (%eax,%edx,4)
incl %edx
L0000854B:
movl (%ecx,%edx,4), %ecx
xorl %ecx, (%eax,%edx,4)
L00008551:
popl %esi
popl %edi
popl %ebx
popl %ebp
ret
.align 2, 0x90
L00008558:
.long L0000854B-L00008515
.long L00008544-L00008515
.long L0000853D-L00008515
.long L00008536-L00008515
.long L0000852F-L00008515
.long L00008528-L00008515
.long L0000851F-L00008515
L00008574:
.align 4, 0x90
_F2x_shiftip:
pushl %ebp
pushl %ebx
pushl %edi
pushl %esi
subl $44, %esp
call L0000858C
L0000858C:
popl %esi
movl 64(%esp), %edi
testl %edi, %edi
je L00008642
L00008599:
movl (%edx), %eax
andl $16777215, %eax
cmpl $2, %eax
je L00008642
L000085A9:
movl %edx, 24(%esp)
movl %eax, 36(%esp)
leal (%eax,%edi), %ebx
movl %ecx, %ebp
movl %ebx, 28(%esp)
leal 0(,%ebx,4), %eax
movl %ebp, %edx
subl %eax, %edx
movl L_bot$non_lazy_ptr-L0000858C(%esi), %eax
subl (%eax), %ecx
shrl $2, %ecx
cmpl %ebx, %ecx
movl L_avma$non_lazy_ptr-L0000858C(%esi), %ebx
movl %esi, 32(%esp)
movl %ebp, (%ebx)
movl %ebp, %esi
jae L000085F2
L000085E2:
movl $14, (%esp)
movl %edx, %ebp
call _pari_err
L000085F0:
movl %ebp, %edx
L000085F2:
movl %edx, (%ebx)
movl 36(%esp), %ebx
cmpl $3, %ebx
movl %esi, 40(%esp)
jb L000087DA
L00008605:
movl 24(%esp), %eax
leal (%eax,%ebx,4), %ecx
movl $2, %eax
movl $2, %edx
subl %ebx, %edx
cmpl $3, %ebx
movl $-1, %esi
cmova %edx, %esi
movl %esi, 20(%esp)
movl $3, %edx
movl $3, %esi
cmova %ebx, %esi
cmpl $2, %esi
jne L0000864C
L00008639:
movl 40(%esp), %edx
jmp L00008733
L00008642:
call _gerepileuptoleaf
L00008647:
jmp L0000891F
L0000864C:
movl %esi, 16(%esp)
leal -2(%esi), %esi
andl $-8, %esi
leal 2(%esi), %eax
cmpl $3, %ebx
cmova %ebx, %edx
cmpl $2, %eax
jne L00008674
L00008664:
movl $2, %eax
movl 40(%esp), %ebp
movl %ebp, %edx
jmp L00008721
L00008674:
movl %eax, 12(%esp)
leal 2(%ebx), %eax
subl %edx, %eax
movl 24(%esp), %ebx
leal (%ebx,%eax,4), %eax
movl 40(%esp), %ebp
leal -4(%ebp), %ebx
cmpl %eax, %ebx
ja L000086BA
L0000868F:
movl 36(%esp), %eax
movl 24(%esp), %ebx
leal -4(%ebx,%eax,4), %eax
movl %eax, 8(%esp)
movl $2, %eax
movl %ebp, %ebx
movl $2, %ebp
subl %edx, %ebp
leal (%ebx,%ebp,4), %edx
movl %ebx, %ebp
cmpl %edx, 8(%esp)
movl %ebp, %edx
jbe L00008721
L000086BA:
movl %ebp, 40(%esp)
leal 0(,%esi,4), %eax
movl %ebp, %edx
subl %eax, %edx
movl %ebp, %ebx
movl 36(%esp), %ebp
movl %ebp, %eax
subl %esi, %eax
movl 24(%esp), %esi
leal (%esi,%eax,4), %ecx
leal -16(%esi,%ebp,4), %eax
leal -16(%ebx), %esi
cmpl $3, %ebp
movl $3, %ebx
cmova %ebp, %ebx
addl $-2, %ebx
andl $-8, %ebx
.align 4, 0x90
L00008700:
movups -16(%eax), %xmm0
movups (%eax), %xmm1
movups %xmm1, (%esi)
movups %xmm0, -16(%esi)
addl $-32, %eax
addl $-32, %esi
addl $-8, %ebx
jne L00008700
L00008719:
movl 12(%esp), %eax
movl 40(%esp), %ebp
L00008721:
movl %ebp, 40(%esp)
cmpl %eax, 16(%esp)
movl 36(%esp), %ebx
je L000087CB
L00008733:
leal 1(%eax), %esi
cmpl %ebx, %esi
cmovge %esi, %ebx
movl %ebx, %ebp
subl %eax, %ebp
decl %ebx
subl %eax, %ebx
movl %ebx, 24(%esp)
movl %ebp, %ebx
testb $7, %bl
je L00008773
L0000874D:
movl 36(%esp), %ebx
cmpl %ebx, %esi
cmovl %ebx, %esi
subl %eax, %esi
andl $7, %esi
negl %esi
xorl %ebx, %ebx
.align 4, 0x90
L00008760:
movl -4(%ecx,%ebx), %ebp
movl %ebp, -4(%edx,%ebx)
incl %eax
addl $-4, %ebx
incl %esi
jne L00008760
L0000876F:
addl %ebx, %edx
addl %ebx, %ecx
L00008773:
cmpl $7, 24(%esp)
movl 36(%esp), %ebx
jb L000087CB
L0000877E:
addl $-4, %edx
addl $-4, %ecx
.align 4, 0x90
L00008790:
movl (%ecx), %esi
movl %esi, (%edx)
movl -4(%ecx), %esi
movl %esi, -4(%edx)
movl -8(%ecx), %esi
movl %esi, -8(%edx)
movl -12(%ecx), %esi
movl %esi, -12(%edx)
movl -16(%ecx), %esi
movl %esi, -16(%edx)
movl -20(%ecx), %esi
movl %esi, -20(%edx)
movl -24(%ecx), %esi
movl %esi, -24(%edx)
movl -28(%ecx), %esi
movl %esi, -28(%edx)
addl $8, %eax
addl $-32, %edx
addl $-32, %ecx
cmpl %ebx, %eax
jl L00008790
L000087CB:
movl 20(%esp), %eax
movl 40(%esp), %ecx
leal (%ecx,%eax,4), %ecx
movl %ecx, 40(%esp)
L000087DA:
testl %edi, %edi
jle L0000883A
L000087DE:
movl %edi, %eax
negl %eax
xorl %edx, %edx
testl %edi, %edi
movl 40(%esp), %ebp
movl %ebp, %ecx
je L00008881
L000087F2:
movl %edi, %ebx
andl $-8, %ebx
xorl %edx, %edx
movl %edi, %esi
andl $-8, %esi
movl %ebp, %ecx
je L0000887D
L00008802:
sall $2, %ebx
leal -8(%esi), %edx
shrl $3, %edx
leal 1(%edx), %ecx
movl $0, 36(%esp)
testb $1, %cl
je L0000882E
L0000881B:
xorps %xmm0, %xmm0
movups %xmm0, -16(%ebp)
movups %xmm0, -32(%ebp)
movl $8, 36(%esp)
L0000882E:
movl %ebp, %ecx
subl %ebx, %ecx
testl %edx, %edx
jne L00008843
L00008836:
movl %esi, %edx
jmp L0000887D
L0000883A:
movl 40(%esp), %ebp
jmp L000088EB
L00008843:
movl $-4, %edx
subl 36(%esp), %edx
leal (%ebp,%edx,4), %edx
movl %ebp, 40(%esp)
movl %esi, %ebx
subl 36(%esp), %ebx
xorps %xmm0, %xmm0
.align 4, 0x90
L00008860:
movups %xmm0, (%edx)
movups %xmm0, -16(%edx)
movups %xmm0, -32(%edx)
movups %xmm0, -48(%edx)
addl $-64, %edx
addl $-16, %ebx
jne L00008860
L00008877:
movl %esi, %edx
movl 40(%esp), %ebp
L0000887D:
cmpl %edi, %edx
je L000088E7
L00008881:
movl %edi, %ebx
subl %edx, %ebx
leal -1(%edi), %esi
subl %edx, %esi
testb $7, %bl
je L000088AE
L0000888F:
andl $7, %ebx
negl %ebx
.align 4, 0x90
L000088A0:
movl $0, -4(%ecx)
addl $-4, %ecx
incl %edx
incl %ebx
jne L000088A0
L000088AE:
cmpl $7, %esi
jb L000088E7
L000088B3:
addl $-4, %ecx
subl %edx, %edi
xorps %xmm0, %xmm0
.align 4, 0x90
L000088C0:
movl $0, (%ecx)
movl $0, -4(%ecx)
movl $0, -8(%ecx)
movl $0, -12(%ecx)
movups %xmm0, -28(%ecx)
addl $-32, %ecx
addl $-8, %edi
jne L000088C0
L000088E7:
leal (%ebp,%eax,4), %ebp
L000088EB:
addl $-8, %ebp
movl 28(%esp), %esi
cmpl $16777216, %esi
movl 32(%esp), %eax
jb L00008914
L000088FE:
leal LC00009591-L0000858C(%eax), %eax
movl %eax, 4(%esp)
movl $15, (%esp)
call _pari_err
L00008914:
orl $738197504, %esi
movl %esi, (%ebp)
movl %ebp, %eax
L0000891F:
addl $44, %esp
popl %esi
popl %edi
popl %ebx
popl %ebp
ret
L00008927:
.align 4, 0x90
_F2x_addshift:
pushl %ebp
pushl %ebx
pushl %edi
pushl %esi
subl $108, %esp
movl %edx, 100(%esp)
movl 128(%esp), %edi
movl (%edx), %eax
movl %eax, 84(%esp)
andl $16777215, %eax
movl %eax, 80(%esp)
leal -2(%eax), %eax
movl %eax, 76(%esp)
movl (%ecx), %ebx
andl $16777215, %ebx
movl %ebx, 68(%esp)
subl %edi, %eax
call L0000896B
L0000896B:
popl %edx
movl L_avma$non_lazy_ptr-L0000896B(%edx), %esi
movl %esi, 88(%esp)
movl (%esi), %esi
movl 4(%ecx), %ebp
movl %ebp, 64(%esp)
leal -2(%ebx), %ebx
leal 8(%ecx), %ebp
movl %ebp, 104(%esp)
movl 100(%esp), %ebp
leal 8(%ebp), %ebp
movl %ebp, 60(%esp)
jle L00008C05
L0000899A:
movl %ebx, 96(%esp)
movl %eax, 92(%esp)
leal 0(,%edi,4), %eax
movl %eax, 52(%esp)
movl %esi, %ebx
subl %eax, %ebx
movl L_bot$non_lazy_ptr-L0000896B(%edx), %ebp
movl %edx, 76(%esp)
movl (%ebp), %eax
movl %esi, %ecx
subl %eax, %ecx
shrl $2, %ecx
cmpl %edi, %ecx
jae L000089DF
L000089C9:
movl $14, (%esp)
call _pari_err
L000089D5:
movl 128(%esp), %edi
movl (%ebp), %eax
L000089DF:
movl %eax, 44(%esp)
movl %ebx, 48(%esp)
movl 88(%esp), %eax
movl %ebx, (%eax)
movl %edi, %edx
movl 100(%esp), %eax
leal 8(%eax,%edx,4), %edi
movl 92(%esp), %ecx
movl 96(%esp), %ebp
cmpl %ebp, %ecx
movl %ecx, %eax
cmovg %ebp, %eax
movl %eax, 100(%esp)
cmovge %ecx, %ebp
movl %edi, %eax
movl 104(%esp), %ecx
cmovg %ecx, %eax
movl %eax, 40(%esp)
cmovg %edi, %ecx
movl %ecx, 104(%esp)
leal 2(%ebp), %eax
movl %ebx, %ecx
movl %ebp, %ebx
subl 44(%esp), %ecx
movl $-2, %ebp
subl %ebx, %ebp
subl %edx, %ebp
movl %ebp, 44(%esp)
shrl $2, %ecx
cmpl %eax, %ecx
leal (%esi,%ebp,4), %ebp
jae L00008A5B
L00008A43:
movl $14, (%esp)
movl %ebx, 72(%esp)
movl %eax, %ebx
call _pari_err
L00008A55:
movl %ebx, %eax
movl 72(%esp), %ebx
L00008A5B:
movl 88(%esp), %ecx
movl %ebp, (%ecx)
cmpl $16777216, %eax
movl %ebx, %edx
jb L00008A90
L00008A6A:
movl %eax, 56(%esp)
movl 76(%esp), %eax
leal LC00009591-L0000896B(%eax), %eax
movl %eax, 4(%esp)
movl $15, (%esp)
movl %edx, %ebx
call _pari_err
L00008A8A:
movl 56(%esp), %eax
movl %ebx, %edx
L00008A90:
movl %eax, 56(%esp)
orl $738197504, %eax
movl %eax, (%ebp)
movl %ebp, 88(%esp)
xorl %eax, %eax
cmpl $0, 100(%esp)
jle L00008E29
L00008AAD:
movl %edx, 72(%esp)
movl 92(%esp), %eax
notl %eax
movl $1, %ebp
subl 68(%esp), %ebp
cmpl %eax, %ebp
cmovge %ebp, %eax
movl %eax, 32(%esp)
addl $2, 44(%esp)
movl 128(%esp), %ecx
leal 1(%ecx), %ebx
movl 84(%esp), %ecx
andl $16777215, %ecx
movl %ecx, 28(%esp)
subl %ecx, %ebx
cmpl %ebp, %ebx
movl %ebp, %eax
cmovge %ebx, %eax
xorl %edx, %edx
cmpl $-1, %eax
je L00008D60
L00008AFA:
notl %eax
movl %eax, 20(%esp)
movl 28(%esp), %ecx
movl %ebx, 36(%esp)
leal -2(%ecx), %ebx
movl %ebp, %edx
movl %edx, 16(%esp)
movl 128(%esp), %ebp
movl %ebp, %eax
subl %eax, %ebx
movl %ebx, 8(%esp)
movl 96(%esp), %ecx
cmpl %ecx, %ebx
cmovge %ebx, %ecx
movl 36(%esp), %ebx
cmpl %edx, %ebx
cmovge %ebx, %edx
movl 20(%esp), %ebp
andl $-4, %ebp
movl %ebp, 24(%esp)
je L00008CBB
L00008B43:
movl %eax, %ebx
negl %ebx
subl %ecx, %ebx
movl $-2, %ebp
subl %eax, %ebp
subl %ecx, %ebp
movl $-2, %ecx
subl %edx, %ebp
subl %edx, %ecx
leal (%esi,%ebx,4), %eax
movl %eax, 12(%esp)
leal (%esi,%ebp,4), %eax
movl 40(%esp), %ebp
leal (%ebp,%ecx,4), %edx
movl %edx, 100(%esp)
movl 104(%esp), %ebx
leal (%ebx,%ecx,4), %edx
movl 12(%esp), %ecx
cmpl %edx, %ecx
setbe %dh
cmpl %eax, %ebx
setbe %dl
cmpl 100(%esp), %ecx
setbe %cl
cmpl %eax, %ebp
setbe %ch
testb %dl, %dh
jne L00008CB7
L00008B9A:
andb %ch, %cl
movl 36(%esp), %ebx
movl 16(%esp), %ebp
movl $0, %edx
jne L00008D56
L00008BAF:
movl $1, %ecx
subl 68(%esp), %ecx
cmpl %ecx, %ebx
cmovge %ebx, %ecx
notl %ecx
andl $-4, %ecx
addl $-4, %ecx
shrl $2, %ecx
leal 1(%ecx), %edx
xorl %ebx, %ebx
testb $1, %dl
je L00008BF0
L00008BD2:
movl 104(%esp), %edx
movups (%edx), %xmm0
movl 40(%esp), %edx
movups (%edx), %xmm1
xorps %xmm0, %xmm1
movl 44(%esp), %edx
movups %xmm1, (%esi,%edx,4)
movl $4, %ebx
L00008BF0:
testl %ecx, %ecx
jne L00008CC6
L00008BF8:
movl 24(%esp), %edx
movl 36(%esp), %ebx
jmp L00008D56
L00008C05:
movl %ecx, 84(%esp)
addl %ebx, %edi
cmpl %ebx, %eax
movl %eax, 92(%esp)
cmovg 76(%esp), %edi
movl $-2, %eax
subl %edi, %eax
addl $2, %edi
movl %edi, 24(%esp)
leal (%esi,%eax,4), %ebp
movl L_bot$non_lazy_ptr-L0000896B(%edx), %eax
movl %edx, 76(%esp)
movl %esi, %ecx
subl (%eax), %ecx
shrl $2, %ecx
cmpl %edi, %ecx
jae L00008C48
L00008C3C:
movl $14, (%esp)
call _pari_err
L00008C48:
movl 88(%esp), %eax
movl %ebp, (%eax)
movl 68(%esp), %eax
cmpl $3, %eax
movl 64(%esp), %edx
movl 104(%esp), %edi
movl 84(%esp), %ecx
jb L00008C80
L00008C63:
leal (%ecx,%eax,4), %eax
.align 4, 0x90
L00008C70:
movl -4(%eax), %ecx
addl $-4, %eax
movl %ecx, -4(%esi)
addl $-4, %esi
cmpl %edi, %eax
ja L00008C70
L00008C80:
movl 80(%esp), %eax
movl 100(%esp), %ecx
leal (%ecx,%eax,4), %edi
movl 92(%esp), %eax
testl %eax, %eax
movl 24(%esp), %ebx
movl 60(%esp), %ebp
jns L00008CAE
L00008C9B:
leal (%esi,%eax,4), %eax
.align 4, 0x90
L00008CA0:
movl $0, -4(%esi)
addl $-4, %esi
cmpl %eax, %esi
ja L00008CA0
L00008CAE:
movl 76(%esp), %ecx
jmp L0000910C
L00008CB7:
movl 36(%esp), %ebx
L00008CBB:
movl 16(%esp), %ebp
xorl %edx, %edx
jmp L00008D56
L00008CC6:
movl %ebx, %ecx
subl 128(%esp), %ecx
movl 96(%esp), %edx
movl %ebx, %eax
movl %eax, 100(%esp)
movl 8(%esp), %ebx
cmpl %edx, %ebx
cmovl %edx, %ebx
subl %ebx, %ecx
leal (%esi,%ecx,4), %ebx
movl 104(%esp), %ecx
leal 16(%ecx,%eax,4), %ecx
movl 40(%esp), %edx
leal 16(%edx,%eax,4), %edx
movl $1, %ebp
subl 68(%esp), %ebp
movl 36(%esp), %eax
cmpl %ebp, %eax
cmovge %eax, %ebp
notl %ebp
andl $-4, %ebp
subl 100(%esp), %ebp
movl %ebp, 100(%esp)
xorl %ebp, %ebp
.align 4, 0x90
L00008D20:
movups -16(%ecx,%ebp,4), %xmm0
movups -16(%edx,%ebp,4), %xmm1
xorps %xmm0, %xmm1
movups %xmm1, (%ebx,%ebp,4)
movups (%ecx,%ebp,4), %xmm0
movups (%edx,%ebp,4), %xmm1
xorps %xmm0, %xmm1
movups %xmm1, 16(%ebx,%ebp,4)
addl $8, %ebp
cmpl %ebp, 100(%esp)
jne L00008D20
L00008D4A:
movl 24(%esp), %edx
movl 36(%esp), %ebx
movl 16(%esp), %ebp
L00008D56:
cmpl 20(%esp), %edx
je L00008E1F
L00008D60:
movl %edx, %ecx
notl %ecx
cmpl %ebp, %ebx
cmovge %ebx, %ebp
subl %ebp, %ecx
movl $-2, %eax
subl %edx, %eax
subl %ebp, %eax
testb $1, %cl
je L00008D99
L00008D79:
movl 40(%esp), %ecx
movl (%ecx,%edx,4), %ecx
movl %ebx, 36(%esp)
movl 104(%esp), %ebx
xorl (%ebx,%edx,4), %ecx
movl 44(%esp), %ebx
addl %edx, %ebx
movl %ecx, (%esi,%ebx,4)
movl 36(%esp), %ebx
incl %edx
L00008D99:
testl %eax, %eax
je L00008E1F
L00008DA1:
movl %edx, %ecx
movl %edx, 44(%esp)
movl 128(%esp), %edx
subl %edx, %ecx
movl 28(%esp), %ebp
addl $-2, %ebp
subl %edx, %ebp
movl 96(%esp), %edx
cmpl %edx, %ebp
cmovl %edx, %ebp
subl %ebp, %ecx
movl %ebx, %edx
movl $1, %ebx
subl 68(%esp), %ebx
leal (%esi,%ecx,4), %eax
cmpl %ebx, %edx
cmovge %edx, %ebx
movl 44(%esp), %ebp
movl %ebp, %ecx
notl %ecx
subl %ebx, %ecx
movl %ecx, 100(%esp)
movl 40(%esp), %ecx
leal 4(%ecx,%ebp,4), %ecx
movl 104(%esp), %edx
leal 4(%edx,%ebp,4), %ebp
xorl %ebx, %ebx
.align 4, 0x90
L00008E00:
movl -4(%ecx,%ebx,4), %edx
xorl -4(%ebp,%ebx,4), %edx
movl %edx, (%eax,%ebx,4)
movl (%ecx,%ebx,4), %edx
xorl (%ebp,%ebx,4), %edx
movl %edx, 4(%eax,%ebx,4)
addl $2, %ebx
cmpl %ebx, 100(%esp)
jne L00008E00
L00008E1F:
movl 32(%esp), %eax
notl %eax
movl 72(%esp), %edx
L00008E29:
cmpl %edx, %eax
jge L00009095
L00008E31:
movl 84(%esp), %ebx
andl $16777215, %ebx
addl $-2, %ebx
subl 128(%esp), %ebx
movl 96(%esp), %ebp
cmpl %ebp, %ebx
cmovge %ebx, %ebp
leal -1(%ebp), %ecx
subl %eax, %ecx
cmpl $-1, %ecx
je L00008F50
L00008E5C:
movl %edx, 72(%esp)
movl %ebp, %edx
movl %ebp, 68(%esp)
subl %eax, %edx
movl %edx, %ebp
andl $-4, %ebp
movl 96(%esp), %ecx
cmpl %ecx, %ebx
cmovge %ebx, %ecx
andl $-4, %edx
je L00008F56
L00008E7F:
movl %ebp, 44(%esp)
movl %ebx, 84(%esp)
movl 104(%esp), %ebp
leal -4(%ebp,%ecx,4), %edx
movl %edx, 100(%esp)
movl %eax, %ebx
movl 128(%esp), %edx
subl %edx, %ebx
subl %ecx, %ebx
leal (%esi,%ebx,4), %ecx
cmpl 100(%esp), %ecx
ja L00008EBA
L00008EA9:
leal (%ebp,%eax,4), %ecx
notl %edx
leal (%esi,%edx,4), %edx
cmpl %edx, %ecx
jbe L00008FBF
L00008EBA:
movl 96(%esp), %ecx
movl 84(%esp), %edx
cmpl %ecx, %edx
cmovge %edx, %ecx
subl %eax, %ecx
andl $-4, %ecx
addl $-4, %ecx
shrl $2, %ecx
movl %ecx, 40(%esp)
leal 1(%ecx), %ecx
testb $3, %cl
movl %eax, %ebx
je L00008F3B
L00008EE0:
movl 96(%esp), %ecx
movl 84(%esp), %edx
cmpl %ecx, %edx
cmovge %edx, %ecx
movl 128(%esp), %edx
negl %edx
subl %ecx, %edx
subl %eax, %ecx
andl $-4, %ecx
addl $-4, %ecx
leal (%esi,%edx,4), %edx
movl %edx, 100(%esp)
movl %ecx, %edx
shrl $2, %edx
incl %edx
andl $3, %edx
negl %edx
movl %eax, %ebx
.align 4, 0x90
L00008F20:
movups (%ebp,%ebx,4), %xmm0
movl 100(%esp), %ebp
movups %xmm0, (%ebp,%ebx,4)
movl 104(%esp), %ebp
addl $4, %ebx
addl $-4, %ecx
incl %edx
jne L00008F20
L00008F3B:
movl 44(%esp), %ebp
addl %eax, %ebp
cmpl $3, 40(%esp)
movl 72(%esp), %edx
jae L00008F5C
L00008F4C:
movl %ebp, %eax
jmp L00008FC3
L00008F50:
movl %ebx, 84(%esp)
jmp L00008FCF
L00008F56:
movl %ebx, 84(%esp)
jmp L00008FBF
L00008F5C:
movl %ebx, %ecx
subl 128(%esp), %ecx
movl 96(%esp), %edx
cmpl %edx, 84(%esp)
cmovge 84(%esp), %edx
subl %edx, %ecx
leal (%esi,%ecx,4), %ecx
subl %eax, %edx
andl $-4, %edx
addl %eax, %edx
movl 104(%esp), %eax
leal 48(%eax,%ebx,4), %eax
subl %ebx, %edx
xorl %ebx, %ebx
.align 4, 0x90
L00008F90:
movups -48(%eax,%ebx,4), %xmm0
movups %xmm0, (%ecx,%ebx,4)
movups -32(%eax,%ebx,4), %xmm0
movups %xmm0, 16(%ecx,%ebx,4)
movups -16(%eax,%ebx,4), %xmm0
movups %xmm0, 32(%ecx,%ebx,4)
movups (%eax,%ebx,4), %xmm0
movups %xmm0, 48(%ecx,%ebx,4)
addl $16, %ebx
cmpl %ebx, %edx
jne L00008F90
L00008FBD:
movl %ebp, %eax
L00008FBF:
movl 72(%esp), %edx
L00008FC3:
movl 68(%esp), %ecx
cmpl %eax, %ecx
je L00009095
L00008FCF:
movl %edx, 72(%esp)
movl 84(%esp), %ebx
movl 96(%esp), %ecx
cmpl %ecx, %ebx
movl %ecx, %ebp
cmovge %ebx, %ebp
leal 1(%eax), %edx
movl %edx, 68(%esp)
cmpl %edx, %ebp
cmovl %edx, %ebp
movl %ebp, %edx
subl %eax, %edx
decl %ebp
subl %eax, %ebp
movl %ebp, 100(%esp)
testb $3, %dl
je L0000903C
L00008FFE:
movl 128(%esp), %ebp
negl %ebp
cmpl %ecx, %ebx
movl %ecx, %edx
cmovge %ebx, %edx
subl %edx, %ebp
movl 68(%esp), %ecx
cmpl %ecx, %edx
cmovl %ecx, %edx
leal (%esi,%ebp,4), %ecx
subl %eax, %edx
andl $3, %edx
negl %edx
movl 104(%esp), %ebx
.align 4, 0x90
L00009030:
movl (%ebx,%eax,4), %ebp
movl %ebp, (%ecx,%eax,4)
incl %eax
incl %edx
jne L00009030
L0000903A:
jmp L00009040
L0000903C:
movl 104(%esp), %ebx
L00009040:
cmpl $3, 100(%esp)
jb L00009095
L00009047:
movl 128(%esp), %ecx
negl %ecx
movl 84(%esp), %edx
movl 96(%esp), %ebp
cmpl %ebp, %edx
cmovl %ebp, %edx
subl %edx, %ecx
movl 72(%esp), %ebp
leal (%esi,%ecx,4), %ecx
.align 4, 0x90
L00009070:
movl (%ebx,%eax,4), %edx
movl %edx, (%ecx,%eax,4)
movl 4(%ebx,%eax,4), %edx
movl %edx, 4(%ecx,%eax,4)
movl 8(%ebx,%eax,4), %edx
movl %edx, 8(%ecx,%eax,4)
movl 12(%ebx,%eax,4), %edx
movl %edx, 12(%ecx,%eax,4)
addl $4, %eax
cmpl %ebp, %eax
jl L00009070
L00009095:
movl 56(%esp), %eax
movl %eax, 4(%esp)
movl 88(%esp), %eax
movl %eax, (%esp)
call _Flx_renormalize
L000090A9:
movl 96(%esp), %ecx
cmpl %ecx, 92(%esp)
jg L000090C5
L000090B3:
movl $16777215, %ecx
andl (%eax), %ecx
addl 128(%esp), %ecx
movl %ecx, 80(%esp)
L000090C5:
addl $8, %eax
cmpl %eax, 48(%esp)
movl 64(%esp), %edx
movl 52(%esp), %ebx
jbe L000090F2
L000090D6:
negl %ebx
.align 4, 0x90
L000090E0:
movl -4(%ebx,%esi), %ecx
movl %ecx, -4(%esi)
leal -4(%esi,%ebx), %ecx
leal -4(%esi), %esi
cmpl %eax, %ecx
ja L000090E0
L000090F2:
movl 80(%esp), %ebx
movl 76(%esp), %ecx
movl 60(%esp), %ebp
jmp L0000910C
L00009100:
movl -4(%edi), %eax
addl $-4, %edi
movl %eax, -4(%esi)
addl $-4, %esi
L0000910C:
cmpl %ebp, %edi
ja L00009100
L00009110:
movl %edx, -4(%esi)
cmpl $16777216, %ebx
jb L00009131
L0000911B:
leal LC00009591-L0000896B(%ecx), %eax
movl %eax, 4(%esp)
movl $15, (%esp)
call _pari_err
L00009131:
orl $738197504, %ebx
movl %ebx, -8(%esi)
addl $-8, %esi
movl %esi, %eax
addl $108, %esp
popl %esi
popl %edi
popl %ebx
popl %ebp
ret
L00009147:
.align 4, 0x90
_bin_copy:
pushl %ebp
pushl %ebx
pushl %edi
pushl %esi
subl $44, %esp
movl %ecx, %esi
call L0000915E
L0000915E:
popl %ecx
movl 4(%esi), %ebp
testl %ebp, %ebp
je L000091F2
L0000916A:
movl (%esi), %edx
movl %edx, 36(%esp)
movl %ebp, 32(%esp)
subl 8(%esi), %ebp
sarl $2, %ebp
movl L_avma$non_lazy_ptr-L0000915E(%ecx), %eax
movl %eax, 24(%esp)
movl (%eax), %ebx
movl %ebx, 28(%esp)
leal 0(,%edx,4), %edi
movl L_bot$non_lazy_ptr-L0000915E(%ecx), %eax
movl %ecx, 40(%esp)
movl %ebx, %ecx
subl (%eax), %ecx
subl %edi, %ebx
shrl $2, %ecx
cmpl %edx, %ecx
jae L000091B4
L000091A8:
movl $14, (%esp)
call _pari_err
L000091B4:
movl 24(%esp), %eax
movl %ebx, (%eax)
leal 16(%esi), %eax
movl %edi, 8(%esp)
movl %eax, 4(%esp)
movl %ebx, (%esp)
call _memcpy
L000091CD:
subl 36(%esp), %ebp
movl 28(%esp), %eax
leal (%eax,%ebp,4), %edi
movl %edi, %eax
subl 32(%esp), %eax
cmpl $0, 12(%esi)
je L00009237
L000091E4:
movl %eax, 4(%esp)
movl %edi, (%esp)
call _shiftaddress_canon
L000091F0:
jmp L00009243
L000091F2:
movl %ecx, %ebp
movl L_PARI_SIGINT_block$non_lazy_ptr-L0000915E(%ebp), %edi
movl (%edi), %ebx
movl $1, (%edi)
movl %esi, (%esp)
call _free
L0000920A:
movl %ebx, (%edi)
movl %ebp, %esi
testl %ebx, %ebx
jne L0000922D
L00009212:
movl L_PARI_SIGINT_pending$non_lazy_ptr-L0000915E(%esi), %eax
cmpl $0, (%eax)
je L0000922D
L0000921D:
movl (%eax), %ecx
movl $0, (%eax)
movl %ecx, (%esp)
call _raise
L0000922D:
movl L_gen_0$non_lazy_ptr-L0000915E(%esi), %eax
movl (%eax), %edi
jmp L00009282
L00009237:
movl %eax, 4(%esp)
movl %edi, (%esp)
call _shiftaddress
L00009243:
movl 40(%esp), %eax
movl L_PARI_SIGINT_block$non_lazy_ptr-L0000915E(%eax), %ebx
movl (%ebx), %ebp
movl $1, (%ebx)
movl %esi, (%esp)
call _free
L0000925D:
movl %ebp, (%ebx)
testl %ebp, %ebp
jne L00009282
L00009263:
movl 40(%esp), %eax
movl L_PARI_SIGINT_pending$non_lazy_ptr-L0000915E(%eax), %eax
cmpl $0, (%eax)
je L00009282
L00009272:
movl (%eax), %ecx
movl $0, (%eax)
movl %ecx, (%esp)
call _raise
L00009282:
movl %edi, %eax
addl $44, %esp
popl %esi
popl %edi
popl %ebx
popl %ebp
ret
L0000928C:
.align 4, 0x90
__F2xq_pow:
subl $12, %esp
movl 20(%esp), %eax
movl 24(%esp), %ecx
movl 16(%esp), %edx
movl %edx, 8(%esp)
movl %ecx, 4(%esp)
movl %eax, (%esp)
call _F2xq_pow
L000092AF:
addl $12, %esp
ret
L000092B3:
.align 4, 0x90
__F2xq_rand:
pushl %ebp
pushl %ebx
pushl %edi
pushl %esi
subl $12, %esp
call L000092CC
L000092CC:
popl %ebp
movl 32(%esp), %edx
movl L_avma$non_lazy_ptr-L000092CC(%ebp), %edi
movl (%edi), %ebx
movl $16777215, %eax
movl (%edx), %ecx
andl %eax, %ecx
movl $-1, %esi
cmpl $2, %ecx
je L00009340
L000092EC:
movl -4(%edx,%ecx,4), %eax
movl %eax, %edx
shrl $16, %edx
cmpl $65535, %eax
cmovbe %eax, %edx
movl $12, %esi
movl $28, %eax
cmova %esi, %eax
cmpl $256, %edx
jb L00009318
L00009312:
addl $-8, %eax
shrl $8, %edx
L00009318:
sall $5, %ecx
cmpl $16, %edx
jb L00009326
L00009320:
addl $-4, %eax
shrl $4, %edx
L00009326:
addl $-65, %ecx
subl %eax, %ecx
subl _F2x_degree_lg.__bfffo_tabshi-L000092CC(%ebp,%edx,4), %ecx
movl %ecx, %esi
movl 32(%esp), %edx
.align 4, 0x90
L00009340:
movl %ebx, (%edi)
movl 4(%edx), %eax
movl %eax, 4(%esp)
movl %esi, (%esp)
movl %edx, %ebp
call _random_F2x
L00009353:
movl %ebp, %edx
movl $16777215, %ebp
movl (%eax), %ecx
andl %ebp, %ecx
cmpl $2, %ecx
je L00009340
L00009363:
addl $12, %esp
popl %esi
popl %edi
popl %ebx
popl %ebp
ret
L0000936B:
.align 4, 0x90
__F2xq_hash:
movl 4(%esp), %eax
movl 8(%eax), %eax
ret
L00009378:
.align 4, 0x90
_vecsmall_lexcmp:
pushl %ebp
pushl %ebx
pushl %edi
pushl %esi
movl 24(%esp), %eax
movl 20(%esp), %esi
movl $16777215, %ecx
movl (%esi), %edx
andl %ecx, %edx
andl (%eax), %ecx
cmpl %ecx, %edx
movl %ecx, %edi
cmovb %edx, %edi
cmpl $1, %edi
jbe L000093BD
L000093A3:
movl $1, %ebx
.align 4, 0x90
L000093B0:
movl (%eax,%ebx,4), %ebp
cmpl %ebp, (%esi,%ebx,4)
jne L000093D2
L000093B8:
incl %ebx
cmpl %edi, %ebx
jl L000093B0
L000093BD:
xorl %eax, %eax
cmpl %ecx, %edx
je L000093DF
L000093C3:
movl $-1, %ecx
movl $1, %eax
cmovb %ecx, %eax
jmp L000093DF
L000093D2:
movl $-1, %ecx
movl $1, %eax
cmovl %ecx, %eax
L000093DF:
popl %esi
popl %edi
popl %ebx
popl %ebp
ret
# ----------------------
.section __TEXT,__literal16,16byte_literals
.align 4
LC000093F0:
.long -1
.long -2
.long -3
.long -4
.align 4
LC00009400:
.long -1
.long -2
.long -3
.long -4
.align 4
LC00009410:
.ascii "UUUUUUUUUUUUUUUU"
.align 4
LC00009420:
.long -1
.long -2
.long -3
.long -4
.align 4
LC00009430:
.long -1
.long -2
.long -3
.long -4
.align 4
LC00009440:
.long -1
.long -2
.long -3
.long -4
.align 4
LC00009450:
.long -1
.long -2
.long -3
.long -4
.align 4
LC00009460:
.long -1
.long -2
.long -3
.long -4
.align 4
LC00009470:
.long -1
.long -2
.long -3
.long -4
.align 4
LC00009480:
.ascii "UUUUUUUUUUUUUUUU"
.align 4
LC00009490:
.long -1
.long -2
.long -3
.long -4
.align 4
LC000094A0:
.long -1
.long -2
.long -3
.long -4
.align 4
LC000094B0:
.long -1
.long -2
.long -3
.long -4
# ----------------------
.section __TEXT,__const,regular
.align 4
_F2x_sqr.sq:
.long 0
.long 1
.long 4
.long 5
.long 16
.long 17
.long 20
.long 21
.long 64
.long 65
.long 68
.long 69
.long 80
.long 81
.long 84
.long 85
.align 4
_F2x_degree_lg.__bfffo_tabshi:
.long 4
.long 3
.long 2
.long 2
.long 1
.long 1
.long 1
.long 1
.long 0
.long 0
.long 0
.long 0
.long 0
.long 0
.long 0
.long 0
# ----------------------
.section __TEXT,__cstring,cstring_literals
LC00009540:
.string "F2x_gcd (d = %ld)"
LC00009552:
.string "F2x_extgcd (d = %ld)"
LC00009567:
.string "F2xq_sqrt (i = %ld)"
LC0000957B:
.string "mallocing NULL object"
LC00009591:
.string "lg()"
# ----------------------
.section __DATA,__const,regular
.align 2
_F2xq_star:
.long __F2xq_mul
.long __F2xq_pow
.long __F2xq_rand
.long __F2xq_hash
.long _vecsmall_lexcmp
.long _F2x_equal1
# ----------------------
.section __IMPORT,__pointers,non_lazy_symbol_pointers
L_DEBUGMEM$non_lazy_ptr:
.indirect_symbol _DEBUGMEM
.long 0
# ----------------------
L_PARI_SIGINT_block$non_lazy_ptr:
.indirect_symbol _PARI_SIGINT_block
.long 0
# ----------------------
L_PARI_SIGINT_pending$non_lazy_ptr:
.indirect_symbol _PARI_SIGINT_pending
.long 0
# ----------------------
L___stack_chk_guard$non_lazy_ptr:
.indirect_symbol ___stack_chk_guard
.long 0
# ----------------------
L_avma$non_lazy_ptr:
.indirect_symbol _avma
.long 0
# ----------------------
L_bot$non_lazy_ptr:
.indirect_symbol _bot
.long 0
# ----------------------
L_gen_0$non_lazy_ptr:
.indirect_symbol _gen_0
.long 0
# ----------------------
L_gen_1$non_lazy_ptr:
.indirect_symbol _gen_1
.long 0
# ----------------------
L_gen_2$non_lazy_ptr:
.indirect_symbol _gen_2
.long 0
# ----------------------
L_top$non_lazy_ptr:
.indirect_symbol _top
.long 0
# ----------------------
.subsections_via_symbols
|
#include <algorithm>
#include <iostream>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
struct TreeNode {
int val;
TreeNode* left;
TreeNode* right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
TreeNode(int x, TreeNode* left, TreeNode* right) : val(x), left(left), right(right) {}
};
class Solution {
public:
TreeNode* buildTree(vector<int>& preorder, vector<int>& inorder) {
// populate inorder data into a map for constant time searching
unordered_map<int, int> inorder_map;
for (int i = 0; i < inorder.size(); ++i) {
inorder_map.emplace(inorder[i], i);
}
TreeNode* root = dfs(0, preorder.size() - 1, preorder, 0, inorder.size() - 1, inorder, inorder_map);
return root;
}
private:
TreeNode* dfs(int pre_start, int pre_end, vector<int>& preorder, int in_start, int in_end, vector<int>& inorder, unordered_map<int, int>& inorder_map) {
TreeNode* cur_node = new TreeNode(preorder[pre_start]);
// Base case: leaf reached
if (pre_start == pre_end) {
return cur_node;
}
// Find index of cur_node value within inorder array
int in_cur_idx = inorder_map[preorder[pre_start]];
// for (int i = in_start; i <= in_end; ++i) {
// if (inorder[i] == preorder[pre_start]) {
// in_cur_idx = i;
// }
// }
// left next inorder: [in_start, in_cur_idx - 1]
// num_left_elements = in_cur_idx - in_start
// num_right_elements = in_end - in_cur_index
// right next inorder: [in_cur_idx + 1, in_end]
// left next preorder: [pre_start + 1, pre_start + num_left_elements]
// right next preorder: [pre_end - num_right_elements + 1 , pre_end]
int num_left_elements = in_cur_idx - in_start;
int num_right_elements = in_end - in_cur_idx;
// dfs left if left child exists
if (in_cur_idx != in_start) {
cur_node->left = dfs(pre_start + 1, pre_start + num_left_elements, preorder, in_start, in_cur_idx - 1, inorder, inorder_map);
}
// dfs right if right child exists
if (in_cur_idx != in_end) {
cur_node->right = dfs(pre_end - num_right_elements + 1, pre_end, preorder, in_cur_idx + 1, in_end, inorder, inorder_map);
}
return cur_node;
}
};
int main() {
Solution solution;
vector<int> inorder;
vector<int> preorder;
TreeNode* output;
inorder = {6, 9, 7, 2, 1, 4, 2};
preorder = {9, 2, 7, 1, 6, 2, 4};
output = solution.buildTree(inorder, preorder);
cout << output->val << endl;
// inorder = {1};
// postorder = {1};
// output = solution.buildTree(inorder, postorder);
// cout << output->val << endl;
// inorder = {1, 2};
// postorder = {2, 1};
// output = solution.buildTree(inorder, postorder);
// cout << output->val << endl;
// inorder = {2, 1};
// postorder = {2, 1};
// output = solution.buildTree(inorder, postorder);
// cout << output->val << endl;
// inorder = {9, 3, 15, 20, 7};
// postorder = {9, 15, 7, 20, 3};
// output = solution.buildTree(inorder, postorder);
// cout << output->val << endl;
// inorder = {5, 4, 6, 3, 8, 7};
// postorder = {5, 6, 4, 8, 7, 3};
// output = solution.buildTree(inorder, postorder);
// cout << output->val << endl;
}
|
SECTION code_clib
SECTION code_fp_math48
PUBLIC derror_pinfnc
EXTERN am48_derror_pinfnc
defc derror_pinfnc = am48_derror_pinfnc
|
.global s_prepare_buffers
s_prepare_buffers:
push %r8
push %r9
push %rbp
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_A_ht+0x1b879, %rdx
nop
nop
nop
nop
nop
add %r8, %r8
and $0xffffffffffffffc0, %rdx
movaps (%rdx), %xmm7
vpextrq $0, %xmm7, %r9
nop
nop
add %rcx, %rcx
lea addresses_UC_ht+0xaef9, %r9
nop
nop
sub $42138, %rsi
mov (%r9), %r8d
nop
nop
cmp %rcx, %rcx
lea addresses_UC_ht+0xa397, %rbx
sub %rbp, %rbp
mov (%rbx), %dx
nop
nop
and $53667, %r8
lea addresses_A_ht+0x6f59, %rsi
lea addresses_normal_ht+0x182f9, %rdi
clflush (%rsi)
cmp $56216, %rdx
mov $75, %rcx
rep movsb
nop
nop
nop
nop
nop
cmp $59860, %r8
lea addresses_WT_ht+0x13cb1, %rsi
lea addresses_A_ht+0x19461, %rdi
inc %rbx
mov $39, %rcx
rep movsw
nop
nop
nop
nop
nop
add $31903, %rsi
lea addresses_UC_ht+0xbef9, %rsi
lea addresses_D_ht+0x12659, %rdi
nop
nop
nop
nop
nop
add $30315, %rbp
mov $91, %rcx
rep movsw
nop
nop
nop
sub $11650, %rbx
lea addresses_normal_ht+0x1ea49, %r8
nop
nop
nop
inc %rbx
movups (%r8), %xmm2
vpextrq $0, %xmm2, %r9
nop
and $30387, %r8
lea addresses_D_ht+0x142f9, %rsi
lea addresses_A_ht+0x1d2f9, %rdi
nop
nop
nop
cmp %rbp, %rbp
mov $67, %rcx
rep movsl
nop
nop
nop
nop
nop
dec %rbx
lea addresses_normal_ht+0x126f9, %rsi
lea addresses_A_ht+0x8979, %rdi
nop
nop
nop
nop
nop
cmp %r9, %r9
mov $74, %rcx
rep movsl
nop
nop
xor %rbp, %rbp
lea addresses_A_ht+0x567d, %rsi
nop
nop
nop
nop
add %rbx, %rbx
movb $0x61, (%rsi)
nop
nop
nop
nop
nop
add $49445, %rbp
lea addresses_WT_ht+0x78f9, %r8
nop
nop
nop
nop
nop
cmp %rdi, %rdi
mov (%r8), %esi
nop
nop
nop
and $3015, %rcx
lea addresses_WC_ht+0x16c45, %rsi
lea addresses_WT_ht+0xf2f9, %rdi
nop
nop
nop
nop
nop
inc %rdx
mov $47, %rcx
rep movsw
nop
nop
nop
nop
inc %rdx
lea addresses_normal_ht+0xd7bd, %rsi
lea addresses_normal_ht+0x1aaf9, %rdi
nop
nop
nop
nop
cmp %rdx, %rdx
mov $97, %rcx
rep movsw
nop
nop
nop
add $13275, %r9
lea addresses_normal_ht+0xc6d9, %r8
inc %rcx
mov $0x6162636465666768, %rbp
movq %rbp, %xmm0
movups %xmm0, (%r8)
nop
nop
nop
nop
nop
inc %r9
lea addresses_D_ht+0x1ab79, %rdx
nop
add %r9, %r9
mov (%rdx), %rsi
nop
nop
nop
nop
sub $26543, %rbp
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r9
pop %r8
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r15
push %r8
push %r9
push %rbp
push %rbx
// Store
lea addresses_normal+0xfb79, %r9
nop
nop
nop
cmp %r15, %r15
mov $0x5152535455565758, %rbx
movq %rbx, %xmm6
vmovups %ymm6, (%r9)
nop
nop
nop
nop
dec %r15
// Store
lea addresses_UC+0x1ec93, %r11
nop
nop
nop
nop
dec %r8
movw $0x5152, (%r11)
add %rbp, %rbp
// Load
lea addresses_UC+0x18af9, %r11
nop
nop
nop
sub $58590, %r12
mov (%r11), %ebx
nop
nop
nop
nop
nop
dec %r12
// Faulty Load
lea addresses_PSE+0x17ef9, %rbp
nop
nop
nop
nop
nop
add %r15, %r15
movb (%rbp), %bl
lea oracles, %r11
and $0xff, %rbx
shlq $12, %rbx
mov (%r11,%rbx,1), %rbx
pop %rbx
pop %rbp
pop %r9
pop %r8
pop %r15
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_PSE', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 5}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_UC', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 8}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_PSE', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A_ht', 'NT': True, 'AVXalign': True, 'size': 16, 'congruent': 7}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 10}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 1}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 4, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 7, 'type': 'addresses_normal_ht'}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 3, 'type': 'addresses_WT_ht'}, 'dst': {'same': False, 'congruent': 3, 'type': 'addresses_A_ht'}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 10, 'type': 'addresses_UC_ht'}, 'dst': {'same': False, 'congruent': 5, 'type': 'addresses_D_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 4}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 9, 'type': 'addresses_D_ht'}, 'dst': {'same': False, 'congruent': 10, 'type': 'addresses_A_ht'}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 11, 'type': 'addresses_normal_ht'}, 'dst': {'same': False, 'congruent': 7, 'type': 'addresses_A_ht'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 5}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 0, 'type': 'addresses_WC_ht'}, 'dst': {'same': False, 'congruent': 9, 'type': 'addresses_WT_ht'}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 2, 'type': 'addresses_normal_ht'}, 'dst': {'same': False, 'congruent': 9, 'type': 'addresses_normal_ht'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 4}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 6}}
{'33': 21829}
33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33
*/
|
/**********************************************************************
* Copyright (c) 2008-2015, Alliance for Sustainable Energy.
* All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
**********************************************************************/
#include <gtest/gtest.h>
#include "AnalysisFixture.hpp"
#include "../Algorithm.hpp"
#include "../AlgorithmOptions.hpp"
#include "../DesignOfExperiments.hpp"
#include "../DesignOfExperimentsOptions.hpp"
#include "../SamplingAlgorithm.hpp"
#include "../SamplingAlgorithmOptions.hpp"
#include "../../runmanager/lib/Job.hpp"
#include "../../utilities/core/FileReference.hpp"
using namespace openstudio;
using namespace openstudio::analysis;
TEST_F(AnalysisFixture,MaxIterSimsIsComplete_Connection_OSAlg) {
// maxIter clear
DesignOfExperimentsOptions options(DesignOfExperimentsType::FullFactorial);
options.setMaxIter(0);
DesignOfExperiments algorithm(createUUID(),
createUUID(),
std::string(),
std::string(),
true,
false,
-1,
options);
EXPECT_TRUE(algorithm.isComplete());
algorithm.options().clearMaxIter();
EXPECT_FALSE(algorithm.isComplete());
EXPECT_EQ(-1,algorithm.iter());
// maxSims bump up
options = DesignOfExperimentsOptions(DesignOfExperimentsType::FullFactorial);
options.setMaxSims(10);
algorithm = DesignOfExperiments(createUUID(),
createUUID(),
std::string(),
std::string(),
true,
false,
0,
options);
EXPECT_TRUE(algorithm.isComplete());
// shares data
options.setMaxSims(20);
EXPECT_EQ(20,algorithm.options().maxSims());
EXPECT_FALSE(algorithm.isComplete());
EXPECT_EQ(0,algorithm.iter());
}
TEST_F(AnalysisFixture,MaxIterSimsIsComplete_Connection_DakotaAlg) {
// maxIter bump up
SamplingAlgorithmOptions options;
options.setMaxIter(0);
SamplingAlgorithm algorithm(createUUID(),
createUUID(),
std::string(),
std::string(),
true,
false,
-1,
options,
boost::none,
boost::none,
boost::none); //DLM: Elaine is this ok?
EXPECT_TRUE(algorithm.isComplete());
EXPECT_FALSE(algorithm.restartFileReference());
algorithm.options().setMaxIter(3);
EXPECT_FALSE(algorithm.isComplete());
EXPECT_EQ(-1,algorithm.iter());
EXPECT_FALSE(algorithm.job());
// maxSims clear
options = SamplingAlgorithmOptions();
options.setMaxSims(100);
algorithm = SamplingAlgorithm(createUUID(),
createUUID(),
std::string(),
std::string(),
true,
false,
0,
options,
FileReference(toPath("dakota.rst")),
FileReference(toPath("dakota.out")),
boost::none); //DLM: Elaine is this ok?
EXPECT_TRUE(algorithm.isComplete());
EXPECT_TRUE(algorithm.outFileReference());
options.clearMaxSims();
EXPECT_FALSE(algorithm.options().maxSims());
EXPECT_FALSE(algorithm.isComplete()); // DLM: Elaine, shouldn't isComplete be tied to the job status?
EXPECT_FALSE(algorithm.failed());
EXPECT_EQ(0,algorithm.iter());
EXPECT_TRUE(algorithm.restartFileReference());
EXPECT_FALSE(algorithm.job());
}
|
level6_enemies.TXT :
db 116
db 10 , 16 , 110 , ENEMY_SALTARIN_BIS , MOVE_LEFT , 2 , 2 , 1
db 10 , 22 , 87 , ENEMY_POWERUP , MOVE_LEFT , 1 , 2 , 59
db 13 , 17 , 15 , ENEMY_SHIP3_BIS , MOVE_KAMIKAZE_NOANIM , 2 , 4 , 0
db 15 , 12 , 29 , ENEMY_SHIP2_BIS , MOVE_WAVE , 2 , 3 , 12
db 16 , 23 , 104 , ENEMY_CASCO_BIS , MOVE_LEFTANIM , 2 , 3 , 4
db 19 , 21 , 106 , ENEMY_SALTARIN_BIS , MOVE_LEFT , 2 , 2 , 1
db 21 , 5 , 25 , ENEMY_POWERUP , MOVE_LEFT , 1 , 2 , 58
db 21 , 9 , 89 , ENEMY_EGG_BIS , MOVE_LEFTANIM , 3 , 2 , 10
db 24 , 3 , 16 , ENEMY_SHIP3_BIS , MOVE_KAMIKAZE_NOANIM , 2 , 4 , 0
db 27 , 17 , 44 , ENEMY_SHIP2_BIS , MOVE_WAVE , 2 , 3 , 8
db 27 , 20 , 88 , ENEMY_UGLYGUY_BIS , MOVE_LEFTANIM , 3 , 4 , 3
db 28 , 17 , 88 , ENEMY_CASCO_BIS , MOVE_LEFTANIM , 2 , 3 , 4
db 29 , 5 , 9 , ENEMY_SHIP3_BIS , MOVE_KAMIKAZE_NOANIM , 2 , 4 , 0
db 30 , 7 , 40 , ENEMY_SHIP3_BIS , MOVE_KAMIKAZE_NOANIM , 2 , 4 , 0
db 31 , 12 , 88 , ENEMY_UGLYGUY_BIS , MOVE_LEFTANIM , 3 , 4 , 3
db 32 , 12 , 94 , ENEMY_SALTARIN_BIS , MOVE_LEFT , 2 , 2 , 1
db 34 , 8 , 81 , ENEMY_EGG_BIS , MOVE_LEFTANIM , 3 , 2 , 10
db 35 , 7 , 35 , ENEMY_SHIP2_BIS , MOVE_WAVE , 2 , 3 , 12
db 38 , 16 , 9 , ENEMY_POWERUP , MOVE_LEFT , 1 , 2 , 57
db 41 , 7 , 82 , ENEMY_UGLYGUY_BIS , MOVE_LEFTANIM , 3 , 4 , 3
db 43 , 22 , 50 , ENEMY_CASCO_BIS , MOVE_LEFTANIM , 2 , 3 , 4
db 46 , 21 , 84 , ENEMY_SALTARIN_BIS , MOVE_LEFT , 2 , 2 , 1
db 48 , 19 , 17 , ENEMY_SHIP2_BIS , MOVE_WAVE , 2 , 3 , 15
db 50 , 10 , 45 , ENEMY_SHIP2_BIS , MOVE_WAVE , 2 , 3 , 15
db 53 , 7 , 95 , ENEMY_SHIP3_BIS , MOVE_KAMIKAZE_NOANIM , 2 , 4 , 0
db 54 , 5 , 81 , ENEMY_SHIP3_BIS , MOVE_KAMIKAZE_NOANIM , 2 , 4 , 0
db 56 , 10 , 40 , ENEMY_SHIP2_BIS , MOVE_WAVE , 2 , 3 , 15
db 57 , 3 , 96 , ENEMY_CASCO_BIS , MOVE_LEFTANIM , 2 , 3 , 4
db 58 , 18 , 64 , ENEMY_SHIP2_BIS , MOVE_WAVE , 2 , 3 , 15
db 61 , 4 , 39 , ENEMY_SHIP2_BIS , MOVE_WAVE , 2 , 3 , 15
db 61 , 5 , 99 , ENEMY_SALTARIN_BIS , MOVE_LEFT , 2 , 2 , 1
db 62 , 5 , 26 , ENEMY_POWERUP , MOVE_LEFT , 1 , 2 , 62
db 63 , 4 , 105 , ENEMY_EGG_BIS , MOVE_LEFTANIM , 3 , 2 , 10
db 64 , 6 , 16 , ENEMY_SHIP3_BIS , MOVE_KAMIKAZE_NOANIM , 2 , 4 , 0
db 65 , 5 , 99 , ENEMY_SALTARIN_BIS , MOVE_LEFT , 2 , 2 , 1
db 68 , 3 , 16 , ENEMY_SHIP3_BIS , MOVE_KAMIKAZE_NOANIM , 2 , 4 , 0
db 70 , 1 , 64 , ENEMY_CASCO_BIS , MOVE_LEFTANIM , 2 , 3 , 4
db 71 , 0 , 101 , ENEMY_SHIP2_BIS , MOVE_WAVE , 2 , 3 , 3
db 72 , 0 , 111 , ENEMY_EGG_BIS , MOVE_LEFTANIM , 3 , 2 , 10
db 74 , 4 , 64 , ENEMY_EGG_BIS , MOVE_LEFTANIM , 3 , 2 , 10
db 74 , 23 , 104 , ENEMY_POWERUP , MOVE_LEFT , 1 , 2 , 58
db 76 , 19 , 65 , ENEMY_UGLYGUY_BIS , MOVE_LEFTANIM , 3 , 4 , 3
db 77 , 11 , 100 , ENEMY_SHIP2_BIS , MOVE_WAVE , 2 , 3 , 3
db 78 , 19 , 109 , ENEMY_SALTARIN_BIS , MOVE_LEFT , 2 , 2 , 1
db 79 , 13 , 12 , ENEMY_SHIP3_BIS , MOVE_KAMIKAZE_NOANIM , 2 , 4 , 0
db 80 , 16 , 40 , ENEMY_SHIP3_BIS , MOVE_KAMIKAZE_NOANIM , 2 , 4 , 0
db 81 , 4 , 65 , ENEMY_POWERUP , MOVE_LEFT , 1 , 2 , 60
db 82 , 12 , 96 , ENEMY_CASCO_BIS , MOVE_LEFTANIM , 2 , 3 , 4
db 84 , 2 , 63 , ENEMY_SHIP2_BIS , MOVE_WAVE , 2 , 3 , 12
db 85 , 11 , 96 , ENEMY_CASCO_BIS , MOVE_LEFTANIM , 2 , 3 , 4
db 86 , 5 , 81 , ENEMY_EGG_BIS , MOVE_LEFTANIM , 3 , 2 , 10
db 88 , 8 , 31 , ENEMY_SHIP3_BIS , MOVE_KAMIKAZE_NOANIM , 2 , 4 , 0
db 90 , 4 , 83 , ENEMY_SALTARIN_BIS , MOVE_LEFT , 2 , 2 , 1
db 90 , 21 , 27 , ENEMY_SHIP3_BIS , MOVE_KAMIKAZE_NOANIM , 2 , 4 , 0
db 94 , 0 , 52 , ENEMY_SHIP2_BIS , MOVE_WAVE , 2 , 3 , 12
db 94 , 4 , 81 , ENEMY_EGG_BIS , MOVE_LEFTANIM , 3 , 2 , 10
db 96 , 16 , 28 , ENEMY_SHIP2_BIS , MOVE_WAVE , 2 , 3 , 16
db 97 , 11 , 98 , ENEMY_SALTARIN_BIS , MOVE_LEFT , 2 , 2 , 1
db 99 , 2 , 99 , ENEMY_SALTARIN_BIS , MOVE_LEFT , 2 , 2 , 1
db 100 , 8 , 32 , ENEMY_SHIP3_BIS , MOVE_KAMIKAZE_NOANIM , 2 , 4 , 0
db 100 , 18 , 96 , ENEMY_UGLYGUY_BIS , MOVE_LEFTANIM , 3 , 4 , 3
db 103 , 16 , 45 , ENEMY_SHIP2_BIS , MOVE_WAVE , 2 , 3 , 12
db 104 , 4 , 88 , ENEMY_EGG_BIS , MOVE_LEFTANIM , 3 , 2 , 10
db 107 , 3 , 46 , ENEMY_SHIP2_BIS , MOVE_WAVE , 2 , 3 , 12
db 108 , 8 , 15 , ENEMY_POWERUP , MOVE_LEFT , 1 , 2 , 57
db 109 , 12 , 96 , ENEMY_UGLYGUY_BIS , MOVE_LEFTANIM , 3 , 4 , 3
db 110 , 8 , 96 , ENEMY_CASCO_BIS , MOVE_LEFTANIM , 2 , 3 , 4
db 111 , 5 , 89 , ENEMY_SALTARIN_BIS , MOVE_LEFT , 2 , 2 , 1
db 113 , 11 , 15 , ENEMY_SHIP3_BIS , MOVE_KAMIKAZE_NOANIM , 2 , 4 , 0
db 115 , 19 , 17 , ENEMY_POWERUP , MOVE_LEFT , 1 , 2 , 59
db 116 , 21 , 42 , ENEMY_CASCO_BIS , MOVE_LEFTANIM , 2 , 3 , 4
db 117 , 10 , 98 , ENEMY_SHIP2_BIS , MOVE_WAVE , 2 , 3 , 3
db 117 , 21 , 42 , ENEMY_UGLYGUY_BIS , MOVE_LEFTANIM , 3 , 4 , 3
db 120 , 21 , 42 , ENEMY_CASCO_BIS , MOVE_LEFTANIM , 2 , 3 , 4
db 121 , 10 , 102 , ENEMY_POWERUP , MOVE_LEFT , 1 , 2 , 63
db 123 , 8 , 7 , ENEMY_SHIP3_BIS , MOVE_KAMIKAZE_NOANIM , 2 , 4 , 0
db 123 , 21 , 42 , ENEMY_CASCO_BIS , MOVE_LEFTANIM , 2 , 3 , 4
db 126 , 19 , 78 , ENEMY_SHIP2_BIS , MOVE_WAVE , 2 , 3 , 12
db 128 , 5 , 33 , ENEMY_SHIP3_BIS , MOVE_KAMIKAZE_NOANIM , 2 , 4 , 0
db 132 , 3 , 72 , ENEMY_SHIP2_BIS , MOVE_WAVE , 2 , 3 , 6
db 132 , 6 , 88 , ENEMY_CASCO_BIS , MOVE_LEFTANIM , 2 , 3 , 4
db 133 , 5 , 81 , ENEMY_SALTARIN_BIS , MOVE_LEFT , 2 , 2 , 1
db 136 , 10 , 8 , ENEMY_SHIP3_BIS , MOVE_KAMIKAZE_NOANIM , 2 , 4 , 0
db 137 , 19 , 88 , ENEMY_CASCO_BIS , MOVE_LEFTANIM , 2 , 3 , 4
db 138 , 14 , 93 , ENEMY_EGG_BIS , MOVE_LEFTANIM , 3 , 2 , 10
db 139 , 3 , 55 , ENEMY_SHIP2_BIS , MOVE_WAVE , 2 , 3 , 12
db 139 , 5 , 12 , ENEMY_POWERUP , MOVE_LEFT , 1 , 2 , 60
db 139 , 21 , 44 , ENEMY_EGG_BIS , MOVE_LEFTANIM , 3 , 2 , 10
db 142 , 9 , 21 , ENEMY_SHIP2_BIS , MOVE_WAVE , 2 , 3 , 6
db 144 , 10 , 41 , ENEMY_CASCO_BIS , MOVE_LEFTANIM , 2 , 3 , 4
db 145 , 19 , 42 , ENEMY_UGLYGUY_BIS , MOVE_LEFTANIM , 3 , 4 , 3
db 145 , 23 , 90 , ENEMY_UGLYGUY_BIS , MOVE_LEFTANIM , 3 , 4 , 3
db 148 , 4 , 42 , ENEMY_CASCO_BIS , MOVE_LEFTANIM , 2 , 3 , 4
db 150 , 21 , 43 , ENEMY_EGG_BIS , MOVE_LEFTANIM , 3 , 2 , 10
db 152 , 4 , 86 , ENEMY_POWERUP , MOVE_LEFT , 1 , 2 , 63
db 154 , 5 , 67 , ENEMY_SALTARIN_BIS , MOVE_LEFT , 2 , 2 , 1
db 156 , 18 , 19 , ENEMY_SHIP3_BIS , MOVE_KAMIKAZE_NOANIM , 2 , 4 , 0
db 156 , 19 , 78 , ENEMY_EGG_BIS , MOVE_LEFTANIM , 3 , 2 , 10
db 157 , 10 , 17 , ENEMY_EGG_BIS , MOVE_LEFTANIM , 3 , 2 , 10
db 160 , 19 , 72 , ENEMY_CASCO_BIS , MOVE_LEFTANIM , 2 , 3 , 4
db 162 , 13 , 41 , ENEMY_SHIP3_BIS , MOVE_KAMIKAZE_NOANIM , 2 , 4 , 0
db 162 , 13 , 72 , ENEMY_CASCO_BIS , MOVE_LEFTANIM , 2 , 3 , 4
db 164 , 2 , 72 , ENEMY_UGLYGUY_BIS , MOVE_LEFTANIM , 3 , 4 , 3
db 164 , 23 , 26 , ENEMY_POWERUP , MOVE_LEFT , 1 , 2 , 62
db 165 , 21 , 25 , ENEMY_SHIP3_BIS , MOVE_KAMIKAZE_NOANIM , 2 , 4 , 0
db 165 , 23 , 97 , ENEMY_EGG_BIS , MOVE_LEFTANIM , 3 , 2 , 10
db 168 , 16 , 56 , ENEMY_SHIP2_BIS , MOVE_WAVE , 2 , 3 , 12
db 170 , 13 , 108 , ENEMY_SHIP3_BIS , MOVE_KAMIKAZE_NOANIM , 2 , 4 , 0
db 171 , 6 , 27 , ENEMY_SHIP2_BIS , MOVE_WAVE , 2 , 3 , 12
db 172 , 12 , 80 , ENEMY_SHIP2_BIS , MOVE_WAVE , 2 , 3 , 12
db 174 , 1 , 104 , ENEMY_CASCO_BIS , MOVE_LEFTANIM , 2 , 3 , 4
db 174 , 15 , 44 , ENEMY_SHIP3_BIS , MOVE_KAMIKAZE_NOANIM , 2 , 4 , 0
db 175 , 3 , 111 , ENEMY_EGG_BIS , MOVE_LEFTANIM , 3 , 2 , 10
db 180 , 4 , 95 , ENEMY_POWERUP , MOVE_LEFT , 1 , 2 , 61
db 180 , 5 , 96 , ENEMY_SHIP3_BIS , MOVE_KAMIKAZE_NOANIM , 2 , 4 , 0
db 255, 23, 80, 2, MOVE_LEFT, 10, 4, 0 ; dummy enemy, to mark the end!
|
#ifndef wali_witness_WITNESS_WRAPPER_GUARD
#define wali_witness_WITNESS_WRAPPER_GUARD 1
/**
* @author Nicholas Kidd
*/
#include "wali/Common.hpp"
#include "wali/MergeFn.hpp"
#include "wali/wpds/Wrapper.hpp"
namespace wali
{
namespace witness
{
/**
* @class WitnessWrapper
*/
class WitnessWrapper : public ::wali::wpds::Wrapper
{
public:
WitnessWrapper() {}
virtual ~WitnessWrapper() {}
virtual sem_elem_t wrap( wfa::ITrans const & t );
virtual sem_elem_t wrap( wpds::Rule const & r );
virtual merge_fn_t wrap( wpds::ewpds::ERule const & r, merge_fn_t user_merge );
virtual sem_elem_t unwrap( sem_elem_t se );
virtual merge_fn_t unwrap( merge_fn_t mf );
}; // namespace WitnessWrapper
} // namespace witness
} // namespace wali
#endif // wali_witness_WITNESS_WRAPPER_GUARD
|
;bouncingball.asm - Example ROM for the NES (Nintendo Entertainment System) showing a bouncing ball. Written in 6502 Assembly.
;by Mark Bouwman (https://github.com/MarkBouwman)
.inesprg 1 ; 1x 16KB PRG code
.ineschr 1 ; 1x 8KB CHR data
.inesmap 0 ; mapper 0 = NROM, no bank swapping
.inesmir 1 ; background mirroring
; Hardware constants CPU
ControllerPort1 = $4016
PPU_CTRL_REG1 = $2000
PPU_CTRL_REG2 = $2001
PPU_STATUS = $2002
PPU_SPR_ADDR = $2003
PPU_SPR_DATA = $2004
PPU_SCROLL_REG = $2005
PPU_ADDRESS = $2006
PPU_DATA = $2007
; Hardware constants PPU
PPU_Attribute_0_Hi = $23 ; This is the PPU address of attribute table 0
PPU_Attribute_0_Lo = $C0
; Sprite constants
sprite_RAM = $0200 ; starting point of the sprite data
sprite_YPOS = $0200 ; sprite Y position
sprite_Tile = $0201 ; sprite tile number
sprite_Attr = $0202 ; sprite attribute byte
sprite_XPOS = $0203 ; sprite X position
; Game constants
RIGHT_WALL = $F4
LEFT_WALL = $01
TOP_WALL = $03
BOTTOM_WALL = $DB
BALL_SPEED = $02
BALL_MOVEMENT_LEFT = %00000010
BALL_MOVEMENT_RIGHT = %00000001
BALL_MOVEMENT_UP = %00000010
BALL_MOVEMENT_DOWN = %00000001
; Variables
.rsset $0000 ; start variables at ram location 0
ball_x .rs 1 ; The X position of the ball
ball_y .rs 1 ; The Y position of the ball
ball_movement_x .rs 1 ; reserve 1 byte to store the ball movement state for X
ball_movement_y .rs 1 ; reserve 1 byte to store the ball movement state for Y
.bank 0
.org $C000
RESET: ; This is the reset interupt
SEI ; disable IRQs
CLD ; disable decimal mode
LDX #$40
STX $4017 ; disable APU frame IRQ
LDX #$FF
TXS ; Set up stack
INX ; now X = 0
STX PPU_CTRL_REG1 ; disable NMI
STX PPU_CTRL_REG2 ; disable rendering
STX $4010 ; disable DMC channel IRQs
JSR VBlankWait ; First wait for vblank to make sure PPU is ready
clrmem: ; Simple loop to clear all the memory
LDA #$00
STA $0000, x
STA $0100, x
STA $0300, x
STA $0400, x
STA $0500, x
STA $0600, x
STA $0700, x
LDA #$FE
STA $0200, x ;move all sprites off screen
INX
BNE clrmem
JSR VBlankWait ; Second wait for vblank, PPU is ready after this
; init PPU
LDA #%10010000 ; enable NMI, sprites from Pattern Table 0, background from Pattern Table 1
STA PPU_CTRL_REG1
LDA #%00011110 ; enable sprites, enable background, no clipping on left side
STA PPU_CTRL_REG2
LDA #$80 ; set the initial position of the ball
STA ball_x
STA ball_y
LDA #BALL_MOVEMENT_UP
STA ball_movement_y
LDA #BALL_MOVEMENT_RIGHT
STA ball_movement_x ; Initially the ball goes right and down
JSR LoadPalette ; Load the color palette
JSR SetBallTileConfig ; Load the ball sprites
; start game loop
GameLoop:
JMP GameLoop ;jump back to GameLoop, infinite loop
; NMI
NMI:
JSR SpriteDMA ; load in the sprites for the ball
LDA #%10010000 ; enable NMI, sprites from Pattern Table 0, background from Pattern Table 1
STA PPU_CTRL_REG1
LDA #%00011110 ; enable sprites, enable background, no clipping on left side
STA PPU_CTRL_REG2
LDA #$00 ;tell the ppu there is no background scrolling
STA PPU_SCROLL_REG
MoveLeft:
LDA ball_movement_x
AND #BALL_MOVEMENT_LEFT
BEQ MoveLeftDone
LDA ball_x
SEC
SBC #BALL_SPEED
STA ball_x
CMP #LEFT_WALL
BCS MoveLeftDone
LSR ball_movement_x
MoveLeftDone:
MoveRight:
LDA ball_movement_x
AND #BALL_MOVEMENT_RIGHT
BEQ MoveRightDone
LDA ball_x
CLC
ADC #BALL_SPEED
STA ball_x
CMP #RIGHT_WALL
BCC MoveRightDone
ASL ball_movement_x
MoveRightDone:
MoveUp:
LDA ball_movement_y
AND #BALL_MOVEMENT_UP
BEQ MoveUpDone
LDA ball_y
SEC
SBC #BALL_SPEED
STA ball_y
CMP #TOP_WALL
BCS MoveUpDone
LSR ball_movement_y
MoveUpDone:
MoveDown:
LDA ball_movement_y
AND #BALL_MOVEMENT_DOWN
BEQ MoveDownDone
LDA ball_y
CLC
ADC #BALL_SPEED
STA ball_y
CMP #BOTTOM_WALL
BCC MoveDownDone
ASL ball_movement_y
MoveDownDone:
DrawBall:
LDA ball_y
STA sprite_YPOS
STA sprite_YPOS+4
CLC
ADC #$08 ; Add 8 to move to the next row
STA sprite_YPOS+8
STA sprite_YPOS+12
LDA ball_x
STA sprite_XPOS
STA sprite_XPOS+8
CLC
ADC #$08 ; Add 8 to move to the next column
STA sprite_XPOS+4
STA sprite_XPOS+12
RTI ; return from interrupt
; Sub routines
SpriteDMA: ; Sprite DMA subroutine
LDA #$00
STA PPU_SPR_ADDR
LDA #$02
STA $4014
RTS
VBlankWait:
BIT $2002
BPL VBlankWait
RTS
LoadPalette:
LDA PPU_STATUS ; read PPU status to reset the high/low latch
LDA #$3F
STA PPU_ADDRESS ; write the high byte of $3F00 address
LDA #$10
STA PPU_ADDRESS ; write the low byte of $3F00 address
LDX #$00 ; start out at 0
LoadPaletteLoop:
LDA palette, x ; load data from address (palette + the value in x)
STA PPU_DATA ; write to PPU
INX ; X = X + 1
CPX #$10 ; Compare X to hex $10, decimal 16 - copying 16 bytes = 4 sprites
BNE LoadPaletteLoop ; Branch to LoadPalettesLoop if compare was Not Equal to zero
RTS ; if compare was equal to 32, keep going down
SetBallTileConfig:
LDX #$00
LDY #$00
SetBallTileConfigLoop: ; Loop through the sprite setup / config and write it to the sprite addresses
LDA BallSpriteSetup, y
STA sprite_Tile,x
LDA BallSpriteConfig, y
STA sprite_Attr,x
INX
INX
INX
INX ; Increment X four times to get to the next sprite
INY
CPY #$04
BNE SetBallTileConfigLoop
RTS
.bank 1
.org $E000
palette:
.db $0F,$20,$10,$00, $0F,$20,$10,$00, $0F,$20,$10,$00, $0F,$20,$10,$00
BallSpriteSetup:
.db $00,$01,$10,$11
BallSpriteConfig:
.db $00,$00,$00,$00
.org $FFFA
.dw NMI ; NMI interupt, jump to NMI label
.dw RESET ; Reset interupt, jump to RESET label
.dw 0 ; external interrupt IRQ is not used
.bank 2
.org $0000
.incbin "bouncingball.chr" |
;
; Z88dk Z88 Maths Library
;
;
; $Id: dmul.asm,v 1.4 2016-06-22 19:55:06 dom Exp $
SECTION code_fp
PUBLIC dmul
EXTERN fsetup
EXTERN stkequ
INCLUDE "fpp.def"
.dmul
call fsetup
fpp(FP_MUL)
jp stkequ
|
%define BPM 100
%include "../src/sointu.inc"
BEGIN_PATTERNS
PATTERN 64, HLD, HLD, HLD, HLD, HLD, HLD, HLD, 0, 0, 0, 0, 0, 0, 0, 0
END_PATTERNS
BEGIN_TRACKS
TRACK VOICES(1),0
END_TRACKS
BEGIN_PATCH
BEGIN_INSTRUMENT VOICES(1) ; Instrument0
SU_LOADVAL MONO,VALUE(32)
SU_LOADVAL MONO,VALUE(0)
SU_MUL MONO
SU_OUT STEREO,GAIN(128)
END_INSTRUMENT
END_PATCH
%include "../src/sointu.asm"
|
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r14
push %r15
push %r9
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WT_ht+0x62dc, %rsi
nop
sub $13006, %r9
mov $0x6162636465666768, %rbx
movq %rbx, %xmm5
and $0xffffffffffffffc0, %rsi
movaps %xmm5, (%rsi)
nop
nop
nop
add $25988, %r10
lea addresses_WT_ht+0x3f48, %r14
nop
nop
sub $41337, %rdx
mov $0x6162636465666768, %r15
movq %r15, (%r14)
and %rsi, %rsi
lea addresses_A_ht+0x6c0c, %r10
xor $28205, %rsi
mov (%r10), %r14
nop
nop
nop
nop
add $34648, %r15
lea addresses_UC_ht+0x5d14, %rbx
inc %r14
movb $0x61, (%rbx)
nop
and $29846, %rsi
lea addresses_normal_ht+0x11ddc, %r14
nop
cmp %r15, %r15
movb $0x61, (%r14)
nop
nop
nop
nop
nop
and $44825, %rsi
lea addresses_D_ht+0x23c5, %rsi
nop
nop
cmp %r14, %r14
movb (%rsi), %dl
nop
cmp $15418, %r10
lea addresses_D_ht+0x1643e, %rsi
lea addresses_UC_ht+0x34dc, %rdi
nop
nop
nop
nop
add $33056, %r15
mov $72, %rcx
rep movsl
nop
nop
sub %r10, %r10
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r9
pop %r15
pop %r14
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r9
push %rax
push %rbp
push %rcx
push %rdi
// Store
lea addresses_D+0x1a8dc, %rax
nop
nop
nop
nop
add $3752, %rdi
movl $0x51525354, (%rax)
nop
cmp $60409, %rcx
// Store
lea addresses_D+0x1459c, %r13
nop
nop
nop
nop
cmp %r9, %r9
movb $0x51, (%r13)
nop
and $19730, %rax
// Store
lea addresses_A+0x776c, %rbp
nop
nop
nop
xor %rdi, %rdi
movw $0x5152, (%rbp)
nop
nop
nop
inc %rbp
// Load
mov $0x6706ca000000051a, %r12
cmp %rax, %rax
vmovups (%r12), %ymm2
vextracti128 $0, %ymm2, %xmm2
vpextrq $0, %xmm2, %rcx
nop
nop
nop
nop
dec %r9
// Store
lea addresses_UC+0xccdc, %r13
nop
nop
nop
nop
cmp $40648, %rax
mov $0x5152535455565758, %r9
movq %r9, %xmm0
vmovaps %ymm0, (%r13)
nop
nop
cmp $46558, %r9
// Faulty Load
mov $0x2dc, %r13
nop
nop
xor %rbp, %rbp
movntdqa (%r13), %xmm6
vpextrq $1, %xmm6, %rax
lea oracles, %rcx
and $0xff, %rax
shlq $12, %rax
mov (%rcx,%rax,1), %rax
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r9
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_P', 'congruent': 0}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_D', 'congruent': 8}, 'OP': 'STOR'}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_D', 'congruent': 5}, 'OP': 'STOR'}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_A', 'congruent': 4}, 'OP': 'STOR'}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_NC', 'congruent': 0}}
{'dst': {'same': False, 'NT': False, 'AVXalign': True, 'size': 32, 'type': 'addresses_UC', 'congruent': 9}, 'OP': 'STOR'}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'NT': True, 'AVXalign': False, 'size': 16, 'type': 'addresses_P', 'congruent': 0}}
<gen_prepare_buffer>
{'dst': {'same': False, 'NT': False, 'AVXalign': True, 'size': 16, 'type': 'addresses_WT_ht', 'congruent': 10}, 'OP': 'STOR'}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_WT_ht', 'congruent': 2}, 'OP': 'STOR'}
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_A_ht', 'congruent': 2}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_UC_ht', 'congruent': 3}, 'OP': 'STOR'}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_normal_ht', 'congruent': 8}, 'OP': 'STOR'}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': True, 'size': 1, 'type': 'addresses_D_ht', 'congruent': 0}}
{'dst': {'same': False, 'congruent': 7, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 1, 'type': 'addresses_D_ht'}}
{'46': 12}
46 46 46 46 46 46 46 46 46 46 46 46
*/
|
%include "x86-helpers.asm"
nasm_util_assert_boilerplate
thunk_boilerplate
define_bench raw_rdpmc0_overhead
assert_eq rdi, 0
assert_eq rsi, 0
mov r8, rdx
readpmc0_start
readpmc0_end
store_pfcnow0 r8
ret
define_bench raw_rdpmc4_overhead
assert_eq rdi, 0
assert_eq rsi, 0
mov r8, rdx
readpmc4_start
readpmc4_end
store_pfcnow4 r8
ret
; 100 stores with raw rdpmc calls
define_bench store_raw_libpfc
; loop count should be 1 since we don't have a loop here
assert_eq rdi, 1
sub rsp, 128
mov r8, rdx
readpmc4_start
.top:
%assign offset 0
%rep 100
mov [rsp], BYTE 42
;sfence
%assign offset offset+1
%endrep
readpmc4_end
store_pfcnow4 r8
add rsp, 128
ret
%macro define_oneshot_adds 1
define_bench oneshot_%1adds
push rbx
mov r8, rdx
xor eax, eax
cpuid
xor r9d, r9d
readpmc0_start_nofence
lfence
times (%1) add r9, 1
lfence
readpmc0_end_nofence
store_pfcnow0 r8
pop rbx
ret
%endmacro
define_oneshot_adds 6
define_oneshot_adds 11
define_bench oneshot_loadadds
push rbx
mov r8, rdx
xor eax, eax
cpuid
xor r9d, r9d
readpmc0_start_nofence
lfence
mov r9, [rsp]
times 6 add r9, 1
lfence
readpmc0_end_nofence
store_pfcnow0 r8
pop rbx
ret |
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r14
push %r15
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x1b249, %r14
nop
nop
inc %r15
movups (%r14), %xmm4
vpextrq $0, %xmm4, %rbx
nop
add $15933, %rbx
lea addresses_A_ht+0x11801, %rsi
lea addresses_D_ht+0x1b941, %rdi
nop
nop
and $61941, %r11
mov $51, %rcx
rep movsq
nop
nop
sub $7533, %rsi
lea addresses_UC_ht+0x1b581, %r14
cmp %rbx, %rbx
mov (%r14), %r11d
nop
sub $39380, %r14
lea addresses_A_ht+0xab11, %r14
nop
nop
nop
sub %rsi, %rsi
movups (%r14), %xmm3
vpextrq $0, %xmm3, %rbx
nop
nop
nop
nop
cmp %r11, %r11
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r15
pop %r14
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %r14
push %rax
push %rbp
push %rbx
push %rcx
// Store
lea addresses_normal+0x71c1, %rcx
nop
nop
nop
nop
nop
inc %r14
mov $0x5152535455565758, %rbx
movq %rbx, %xmm7
vmovups %ymm7, (%rcx)
nop
nop
nop
nop
nop
xor %r14, %r14
// Store
lea addresses_RW+0x4711, %r13
nop
nop
xor %rax, %rax
movw $0x5152, (%r13)
nop
nop
nop
nop
sub %rcx, %rcx
// Faulty Load
lea addresses_normal+0x71c1, %r10
nop
xor %r14, %r14
movb (%r10), %bl
lea oracles, %rcx
and $0xff, %rbx
shlq $12, %rbx
mov (%rcx,%rbx,1), %rbx
pop %rcx
pop %rbx
pop %rbp
pop %rax
pop %r14
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': True, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 3, 'size': 2, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 3, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 6, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 6, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 4, 'size': 16, 'same': False, 'NT': False}}
{'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
*/
|
// Copyright Bernhard Manfred Gruber & Michael Florian Hava.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file ../LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#include <boost/test/unit_test.hpp>
#include <boost/core/demangle.hpp>
#include "boost/observer_ptr/observer_ptr.hpp"
#include <string>
#include <iomanip>
namespace boost {
template <typename T>
auto operator<<(std::ostream& os, const boost::observer_ptr<T>& op) -> std::ostream& {
return os << "observer_ptr<" << boost::core::demangle(typeid(T).name()) << ">{0x" << std::hex << op.get() << "}";
}
}
BOOST_AUTO_TEST_SUITE(observer_ptr)
BOOST_AUTO_TEST_CASE(ctor_default) {
boost::observer_ptr<int> op;
BOOST_TEST(op.get() == nullptr);
}
BOOST_AUTO_TEST_CASE(ctor_nullptr) {
boost::observer_ptr<int> op{nullptr};
BOOST_TEST(op.get() == nullptr);
}
BOOST_AUTO_TEST_CASE(ctor_from_raw_pointer) {
int i = 42;
int* p = &i;
boost::observer_ptr<int> op{p};
BOOST_TEST(op.get() == p);
}
BOOST_AUTO_TEST_CASE(ctor_from_observer_different_type) {
int i = 42;
boost::observer_ptr<int> op1{&i};
boost::observer_ptr<const int> op2{op1};
BOOST_TEST(op1.get() == op2.get());
}
BOOST_AUTO_TEST_CASE(copy_ctor) {
int i = 42;
boost::observer_ptr<int> op1{&i};
boost::observer_ptr<int> op2{op1};
BOOST_TEST(op1.get() == op2.get());
}
BOOST_AUTO_TEST_CASE(dereference) {
int i = 42;
boost::observer_ptr<int> op{&i};
BOOST_TEST(*op == 42);
}
BOOST_AUTO_TEST_CASE(arrow_operator) {
std::string s = "Hello";
boost::observer_ptr<std::string> op{&s};
BOOST_TEST(op->size() == 5);
}
BOOST_AUTO_TEST_CASE(operator_bool) {
boost::observer_ptr<int> op1;
BOOST_TEST((bool)op1 == false);
int i = 42;
boost::observer_ptr<int> op2{&i};
BOOST_TEST((bool)op2);
}
BOOST_AUTO_TEST_CASE(pointer_conversion) {
int i = 42;
boost::observer_ptr<int> op{&i};
int* p = static_cast<int*>(op);
BOOST_TEST(p == &i);
}
BOOST_AUTO_TEST_CASE(release) {
int i = 42;
boost::observer_ptr<int> op{&i};
BOOST_TEST(op.get() == &i);
auto p = op.release();
BOOST_TEST(p == &i);
BOOST_TEST(op.get() == nullptr);
}
BOOST_AUTO_TEST_CASE(reset) {
int i = 42;
boost::observer_ptr<int> op{&i};
op.reset();
BOOST_TEST(op.get() == nullptr);
op.reset(&i);
BOOST_TEST(op.get() == &i);
}
BOOST_AUTO_TEST_CASE(swap) {
int a = 42, b = 43;
boost::observer_ptr<int> opA{&a};
boost::observer_ptr<int> opB{&b};
std::swap(opA, opB);
BOOST_TEST(opA.get() == &b);
BOOST_TEST(opB.get() == &a);
}
BOOST_AUTO_TEST_CASE(make_observer) {
int i = 42;
auto op = boost::make_observer(&i);
BOOST_TEST(op.get() == &i);
}
BOOST_AUTO_TEST_CASE(equality_comparison) {
int a = 42, b = 42;
boost::observer_ptr<int> opA{&a};
BOOST_TEST(opA == opA);
BOOST_TEST(!(opA != opA));
boost::observer_ptr<int> opB{&b};
BOOST_TEST(!(opA == opB));
BOOST_TEST(opA != opB);
}
BOOST_AUTO_TEST_CASE(less_than_comparison) {
int* a = (int*)42, *b = (int*)43;
boost::observer_ptr<int> opA{a};
boost::observer_ptr<int> opB{b};
BOOST_TEST(opA < opB);
BOOST_TEST(opA <= opB);
BOOST_TEST(opA <= opA);
BOOST_TEST(opB > opA);
BOOST_TEST(opB >= opA);
BOOST_TEST(opB >= opB);
}
BOOST_AUTO_TEST_CASE(hash) {
int i = 42;
boost::observer_ptr<int> op{&i};
BOOST_TEST(std::hash<boost::observer_ptr<int>>{}(op) == std::hash<int*>{}(op.get()));
}
BOOST_AUTO_TEST_SUITE_END()
|
# BEGIN ASSIGNMENT TAGS
# CWID = 890468754
# NaMe = Naoki Atkins
# Assignment = Mips9Average
# END ASSIGNMENT TAGS
.data
newline: .asciiz "\n"
.text
main:
li $t0, 0
li $t3, 0
li $t4, 0
li $v0, 5
syscall
move $t2, $v0
calc_loop:
bge $t0, $t2, calc_exit
li $v0, 5
syscall
add $t3, $t3, $v0
addi $t0, $t0, 1
j calc_loop
calc_exit:
move $a0, $t3
li $v0, 1
syscall
li $v0, 4
la $a0, newline
syscall
mtc1.d $t3, $f0
cvt.d.w $f0, $f0
mtc1.d $t2, $f2
cvt.d.w $f2, $f2
div.d $f12, $f0, $f2
li $v0, 3
syscall
li $v0, 4
la $a0, newline
syscall
j Exit
Exit:
li $v0, 10
syscall
|
;;
;; Copyright (c) 2018, 2019 Antti Tiihala
;;
;; Permission to use, copy, modify, and/or distribute this software for any
;; purpose with or without fee is hereby granted, provided that the above
;; copyright notice and this permission notice appear in all copies.
;;
;; THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
;; WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
;; MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
;; ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
;; WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
;; ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
;; OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
;;
;; init/a32/start.asm
;; Entry point (32-bit)
;;
bits 32
section .text
extern _b_pause
extern _boot_loader_type
extern _start_init
global _start
align 16
_start:
push eax ; esp -= 4
push edx ; esp -= 4
mov eax, esp ; eax = esp
sub al, 0xE8 ; stack check
jnz short .halt
add ebx, 0x00010000 ; ebx = "address of memory map"
push dword 0 ; push 0x00000000
push ebx ; "void start_init(void *)"
xor ebx, ebx ; ebx = 0
call _start_init ; call start_init
.pause: call _b_pause ; "unsigned long b_pause(void)"
jmp short .pause
.halt: hlt ; halt
jmp short .halt
|
%ifdef CONFIG
{
"RegData": {
"R15": "0x1"
},
"MemoryRegions": {
"0x100000000": "4096"
}
}
%endif
%macro cfmerge 0
; Get CF
sbb r14, r14
and r14, 1
; Merge in to results
shl r15, 1
or r15, r14
%endmacro
mov rdx, 0xe0000000
mov rax, 0x0000000100000000
mov [rdx + 8 * 0], rax
xor r15, r15 ; Will contain our results
bt qword [rdx], 32
cfmerge
hlt
|
; généré avec https://github.com/oxypomme/BMPtoASM
push AX
push BX
mov AX, playerX
mov BX, playerY
add AX, 4
mov BX, playerY
add BX, 7
oxgSHOWPIXEL AX, BX, 006h ; 4-7
inc BX
oxgSHOWPIXEL AX, BX, 006h ; 4-8
inc BX
oxgSHOWPIXEL AX, BX, 007h ; 4-9
inc BX
oxgSHOWPIXEL AX, BX, 007h ; 4-10
inc AX
mov BX, playerY
add BX, 6
oxgSHOWPIXEL AX, BX, 006h ; 5-6
inc BX
oxgSHOWPIXEL AX, BX, 006h ; 5-7
add BX, 2
oxgSHOWPIXEL AX, BX, 007h ; 5-9
inc BX
oxgSHOWPIXEL AX, BX, 007h ; 5-10
add BX, 3
oxgSHOWPIXEL AX, BX, 001h ; 5-13
inc BX
oxgSHOWPIXEL AX, BX, 001h ; 5-14
inc BX
oxgSHOWPIXEL AX, BX, 007h ; 5-15
inc AX
mov BX, playerY
add BX, 2
oxgSHOWPIXEL AX, BX, 0B8h ; 6-2
inc BX
oxgSHOWPIXEL AX, BX, 007h ; 6-3
inc BX
oxgSHOWPIXEL AX, BX, 007h ; 6-4
inc BX
oxgSHOWPIXEL AX, BX, 007h ; 6-5
inc BX
oxgSHOWPIXEL AX, BX, 006h ; 6-6
inc BX
oxgSHOWPIXEL AX, BX, 006h ; 6-7
inc BX
oxgSHOWPIXEL AX, BX, 006h ; 6-8
inc BX
oxgSHOWPIXEL AX, BX, 007h ; 6-9
inc BX
oxgSHOWPIXEL AX, BX, 006h ; 6-10
inc BX
oxgSHOWPIXEL AX, BX, 001h ; 6-11
inc BX
oxgSHOWPIXEL AX, BX, 001h ; 6-12
add BX, 3
oxgSHOWPIXEL AX, BX, 007h ; 6-15
inc AX
mov BX, playerY
inc BX
oxgSHOWPIXEL AX, BX, 0B8h ; 7-1
inc BX
oxgSHOWPIXEL AX, BX, 071h ; 7-2
inc BX
oxgSHOWPIXEL AX, BX, 05Ah ; 7-3
inc BX
oxgSHOWPIXEL AX, BX, 05Ah ; 7-4
inc BX
oxgSHOWPIXEL AX, BX, 05Ah ; 7-5
inc BX
oxgSHOWPIXEL AX, BX, 00Ch ; 7-6
inc BX
oxgSHOWPIXEL AX, BX, 00Ch ; 7-7
inc BX
oxgSHOWPIXEL AX, BX, 007h ; 7-8
inc BX
oxgSHOWPIXEL AX, BX, 007h ; 7-9
inc BX
oxgSHOWPIXEL AX, BX, 00Ch ; 7-10
inc BX
oxgSHOWPIXEL AX, BX, 036h ; 7-11
inc BX
oxgSHOWPIXEL AX, BX, 036h ; 7-12
inc AX
mov BX, playerY
inc BX
oxgSHOWPIXEL AX, BX, 071h ; 8-1
inc BX
oxgSHOWPIXEL AX, BX, 071h ; 8-2
inc BX
oxgSHOWPIXEL AX, BX, 05Ah ; 8-3
inc BX
oxgSHOWPIXEL AX, BX, 05Ah ; 8-4
inc BX
oxgSHOWPIXEL AX, BX, 05Ah ; 8-5
inc BX
oxgSHOWPIXEL AX, BX, 00Ch ; 8-6
inc BX
oxgSHOWPIXEL AX, BX, 00Ch ; 8-7
inc BX
oxgSHOWPIXEL AX, BX, 00Fh ; 8-8
inc BX
oxgSHOWPIXEL AX, BX, 00Fh ; 8-9
inc BX
oxgSHOWPIXEL AX, BX, 00Ch ; 8-10
inc BX
oxgSHOWPIXEL AX, BX, 036h ; 8-11
inc BX
oxgSHOWPIXEL AX, BX, 036h ; 8-12
add BX, 2
oxgSHOWPIXEL AX, BX, 036h ; 8-14
inc BX
oxgSHOWPIXEL AX, BX, 01Dh ; 8-15
inc AX
mov BX, playerY
add BX, 4
oxgSHOWPIXEL AX, BX, 05Ah ; 9-4
add BX, 2
oxgSHOWPIXEL AX, BX, 00Ch ; 9-6
inc BX
oxgSHOWPIXEL AX, BX, 00Ch ; 9-7
inc BX
oxgSHOWPIXEL AX, BX, 034h ; 9-8
inc BX
oxgSHOWPIXEL AX, BX, 00Fh ; 9-9
add BX, 3
oxgSHOWPIXEL AX, BX, 036h ; 9-12
inc BX
oxgSHOWPIXEL AX, BX, 036h ; 9-13
add BX, 2
oxgSHOWPIXEL AX, BX, 01Dh ; 9-15
inc AX
mov BX, playerY
add BX, 7
oxgSHOWPIXEL AX, BX, 00Ch ; 10-7
inc BX
oxgSHOWPIXEL AX, BX, 034h ; 10-8
inc BX
oxgSHOWPIXEL AX, BX, 00Fh ; 10-9
inc BX
oxgSHOWPIXEL AX, BX, 05Ah ; 10-10
inc AX
mov BX, playerY
add BX, 8
oxgSHOWPIXEL AX, BX, 00Fh ; 11-8
inc BX
oxgSHOWPIXEL AX, BX, 00Fh ; 11-9
inc AX
mov BX, playerY
add BX, 8
oxgSHOWPIXEL AX, BX, 00Fh ; 12-8
inc BX
oxgSHOWPIXEL AX, BX, 00Fh ; 12-9
inc AX
mov BX, playerY
add BX, 8
oxgSHOWPIXEL AX, BX, 00Fh ; 13-8
inc BX
oxgSHOWPIXEL AX, BX, 00Fh ; 13-9
inc AX
mov BX, playerY
add BX, 9
oxgSHOWPIXEL AX, BX, 00Fh ; 14-9
pop BX
pop AX
|
#include "lcd.hpp"
// TSC2046 8bit mode
#define READ_X 0b11011000
#define READ_Y 0b10011000
inline void ILI9341_Select()
{
HAL_GPIO_WritePin(ILI9341_CS_GPIO_Port, ILI9341_CS_Pin, GPIO_PIN_RESET);
}
inline void ILI9341_Unselect()
{
HAL_GPIO_WritePin(ILI9341_CS_GPIO_Port, ILI9341_CS_Pin, GPIO_PIN_SET);
}
inline void ILI9341_Reset()
{
HAL_GPIO_WritePin(ILI9341_RES_GPIO_Port, ILI9341_RES_Pin, GPIO_PIN_RESET);
HAL_Delay(5);
HAL_GPIO_WritePin(ILI9341_RES_GPIO_Port, ILI9341_RES_Pin, GPIO_PIN_SET);
}
inline void ILI9341_WriteCommand(uint8_t cmd)
{
HAL_GPIO_WritePin(ILI9341_DC_GPIO_Port, ILI9341_DC_Pin, GPIO_PIN_RESET);
HAL_SPI_Transmit(&ILI9341_SPI_PORT, &cmd, sizeof(cmd), HAL_MAX_DELAY);
}
inline void ILI9341_WriteData(uint8_t* buff, size_t buff_size)
{
HAL_GPIO_WritePin(ILI9341_DC_GPIO_Port, ILI9341_DC_Pin, GPIO_PIN_SET);
// split data in small chunks because HAL can't send more then 64K at once
while(buff_size > 0)
{
uint16_t chunk_size = buff_size > 32768 ? 32768 : buff_size;
HAL_SPI_Transmit(&ILI9341_SPI_PORT, buff, chunk_size, HAL_MAX_DELAY);
buff += chunk_size;
buff_size -= chunk_size;
}
}
inline void ILI9341_SetAddressWindow(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1)
{
// column address set
ILI9341_WriteCommand(0x2A); // CASET
{
uint8_t data[] = {(uint8_t)((x0 >> 8) & 0xFF), (uint8_t)(x0 & 0xFF), (uint8_t)((x1 >> 8) & 0xFF), (uint8_t)(x1 & 0xFF)};
ILI9341_WriteData(data, sizeof(data));
}
// row address set
ILI9341_WriteCommand(0x2B); // RASET
{
uint8_t data[] = {(uint8_t)((y0 >> 8) & 0xFF), (uint8_t)(y0 & 0xFF), (uint8_t)((y1 >> 8) & 0xFF), (uint8_t)(y1 & 0xFF)};
ILI9341_WriteData(data, sizeof(data));
}
// write to RAM
ILI9341_WriteCommand(0x2C); // RAMWR
}
void ILI9341_Init()
{
ILI9341_Select();
ILI9341_Reset();
// command list is based on https://github.com/martnak/STM32-ILI9341
// SOFTWARE RESET
ILI9341_WriteCommand(0x01);
HAL_Delay(100);
// POWER CONTROL A
ILI9341_WriteCommand(0xCB);
{
uint8_t data[] = { 0x39, 0x2C, 0x00, 0x34, 0x02 };
ILI9341_WriteData(data, sizeof(data));
}
// POWER CONTROL B
ILI9341_WriteCommand(0xCF);
{
uint8_t data[] = { 0x00, 0xC1, 0x30 };
ILI9341_WriteData(data, sizeof(data));
}
// DRIVER TIMING CONTROL A
ILI9341_WriteCommand(0xE8);
{
uint8_t data[] = { 0x85, 0x00, 0x78 };
ILI9341_WriteData(data, sizeof(data));
}
// DRIVER TIMING CONTROL B
ILI9341_WriteCommand(0xEA);
{
uint8_t data[] = { 0x00, 0x00 };
ILI9341_WriteData(data, sizeof(data));
}
// POWER ON SEQUENCE CONTROL
ILI9341_WriteCommand(0xED);
{
uint8_t data[] = { 0x64, 0x03, 0x12, 0x81 };
ILI9341_WriteData(data, sizeof(data));
}
// PUMP RATIO CONTROL
ILI9341_WriteCommand(0xF7);
{
uint8_t data[] = { 0x20 };
ILI9341_WriteData(data, sizeof(data));
}
// POWER CONTROL,VRH[5:0]
ILI9341_WriteCommand(0xC0);
{
uint8_t data[] = { 0x23 };
ILI9341_WriteData(data, sizeof(data));
}
// POWER CONTROL,SAP[2:0];BT[3:0]
ILI9341_WriteCommand(0xC1);
{
uint8_t data[] = { 0x10 };
ILI9341_WriteData(data, sizeof(data));
}
// VCM CONTROL
ILI9341_WriteCommand(0xC5);
{
uint8_t data[] = { 0x3E, 0x28 };
ILI9341_WriteData(data, sizeof(data));
}
// VCM CONTROL 2
ILI9341_WriteCommand(0xC7);
{
uint8_t data[] = { 0x86 };
ILI9341_WriteData(data, sizeof(data));
}
// MEMORY ACCESS CONTROL
ILI9341_WriteCommand(0x36);
{
uint8_t data[] = { 0x48 };
ILI9341_WriteData(data, sizeof(data));
}
// PIXEL FORMAT
ILI9341_WriteCommand(0x3A);
{
uint8_t data[] = { 0x55 };
ILI9341_WriteData(data, sizeof(data));
}
// FRAME RATIO CONTROL, STANDARD RGB COLOR
ILI9341_WriteCommand(0xB1);
{
uint8_t data[] = { 0x00, 0x18 };
ILI9341_WriteData(data, sizeof(data));
}
// DISPLAY FUNCTION CONTROL
ILI9341_WriteCommand(0xB6);
{
uint8_t data[] = { 0x08, 0x82, 0x27 };
ILI9341_WriteData(data, sizeof(data));
}
// 3GAMMA FUNCTION DISABLE
ILI9341_WriteCommand(0xF2);
{
uint8_t data[] = { 0x00 };
ILI9341_WriteData(data, sizeof(data));
}
// GAMMA CURVE SELECTED
ILI9341_WriteCommand(0x26);
{
uint8_t data[] = { 0x01 };
ILI9341_WriteData(data, sizeof(data));
}
// POSITIVE GAMMA CORRECTION
ILI9341_WriteCommand(0xE0);
{
uint8_t data[] = { 0x0F, 0x31, 0x2B, 0x0C, 0x0E, 0x08, 0x4E, 0xF1,
0x37, 0x07, 0x10, 0x03, 0x0E, 0x09, 0x00 };
ILI9341_WriteData(data, sizeof(data));
}
// NEGATIVE GAMMA CORRECTION
ILI9341_WriteCommand(0xE1);
{
uint8_t data[] = { 0x00, 0x0E, 0x14, 0x03, 0x11, 0x07, 0x31, 0xC1,
0x48, 0x08, 0x0F, 0x0C, 0x31, 0x36, 0x0F };
ILI9341_WriteData(data, sizeof(data));
}
// EXIT SLEEP
ILI9341_WriteCommand(0x11);
HAL_Delay(120);
// TURN ON DISPLAY
ILI9341_WriteCommand(0x29);
// MADCTL
ILI9341_WriteCommand(0x36);
{
uint8_t data[] = { ILI9341_ROTATION };
ILI9341_WriteData(data, sizeof(data));
}
ILI9341_Unselect();
}
void ILI9341_DrawPixel(uint16_t x, uint16_t y, uint16_t color)
{
if((x >= ILI9341_WIDTH) || (y >= ILI9341_HEIGHT)) return;
ILI9341_Select();
ILI9341_SetAddressWindow(x, y, x+1, y+1);
uint8_t data[] = {(uint8_t)(color >> 8), (uint8_t)(color & 0xFF)};
ILI9341_WriteData(data, sizeof(data));
ILI9341_Unselect();
}
void ILI9341_WriteChar(uint16_t x, uint16_t y, char ch, FontDef font, uint16_t color, uint16_t bgcolor)
{
uint32_t i, b, j;
ILI9341_SetAddressWindow(x, y, x+font.width-1, y+font.height-1);
for(i = 0; i < font.height; i++)
{
b = font.data[(ch - 32) * font.height + i];
for(j = 0; j < font.width; j++)
{
if((b << j) & 0x8000)
{
uint8_t data[] = {(uint8_t)(color >> 8), (uint8_t)(color & 0xFF)};
ILI9341_WriteData(data, sizeof(data));
}
else
{
uint8_t data[] = {(uint8_t)(bgcolor >> 8), (uint8_t)(bgcolor & 0xFF)};
ILI9341_WriteData(data, sizeof(data));
}
}
}
}
void ILI9341_WriteString(uint16_t x, uint16_t y, const char* str, FontDef font, uint16_t color, uint16_t bgcolor)
{
ILI9341_Select();
while(*str)
{
if(x + font.width >= ILI9341_WIDTH)
{
x = 0;
y += font.height;
if(y + font.height >= ILI9341_HEIGHT)
{
break;
}
if(*str == ' ')
{
// skip spaces in the beginning of the new line
str++;
continue;
}
}
ILI9341_WriteChar(x, y, *str, font, color, bgcolor);
x += font.width;
str++;
}
ILI9341_Unselect();
}
void ILI9341_FillRectangle(uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint16_t color)
{
// clipping
if((x >= ILI9341_WIDTH) || (y >= ILI9341_HEIGHT)) return;
if((x + w - 1) >= ILI9341_WIDTH) w = ILI9341_WIDTH - x;
if((y + h - 1) >= ILI9341_HEIGHT) h = ILI9341_HEIGHT - y;
ILI9341_Select();
ILI9341_SetAddressWindow(x, y, x+w-1, y+h-1);
uint8_t data[] = {(uint8_t)(color >> 8), (uint8_t)(color & 0xFF)};
HAL_GPIO_WritePin(ILI9341_DC_GPIO_Port, ILI9341_DC_Pin, GPIO_PIN_SET);
for(y = h; y > 0; y--)
{
for(x = w; x > 0; x--)
{
HAL_SPI_Transmit(&ILI9341_SPI_PORT, data, sizeof(data), HAL_MAX_DELAY);
}
}
ILI9341_Unselect();
}
void ILI9341_FillScreen(uint16_t color)
{
ILI9341_FillRectangle(0, 0, ILI9341_WIDTH, ILI9341_HEIGHT, color);
}
void ILI9341_DrawImage(uint16_t x, uint16_t y, uint16_t w, uint16_t h, const uint16_t* data)
{
if((x >= ILI9341_WIDTH) || (y >= ILI9341_HEIGHT)) return;
if((x + w - 1) >= ILI9341_WIDTH) return;
if((y + h - 1) >= ILI9341_HEIGHT) return;
ILI9341_Select();
ILI9341_SetAddressWindow(x, y, x+w-1, y+h-1);
ILI9341_WriteData((uint8_t*)data, sizeof(uint16_t)*w*h);
ILI9341_Unselect();
}
void ILI9341_InvertColors(bool invert)
{
ILI9341_Select();
ILI9341_WriteCommand(invert ? 0x21 /* INVON */ : 0x20 /* INVOFF */);
ILI9341_Unselect();
}
void ILI9341_Circle(uint16_t x0, uint16_t y0, uint16_t r, uint16_t color)
{
uint16_t x = r;
uint16_t y = 0;
int16_t F = -2 * r + 3;
while (x >= y)
{
ILI9341_DrawPixel(x0 + x, y0 + y, color);
ILI9341_DrawPixel(x0 - x, y0 + y, color);
ILI9341_DrawPixel(x0 + x, y0 - y, color);
ILI9341_DrawPixel(x0 - x, y0 - y, color);
ILI9341_DrawPixel(x0 + y, y0 + x, color);
ILI9341_DrawPixel(x0 - y, y0 + x, color);
ILI9341_DrawPixel(x0 + y, y0 - x, color);
ILI9341_DrawPixel(x0 - y, y0 - x, color);
if (F >= 0)
{
x--;
F -= 4 * x;
}
y++;
F += 4 * y + 2;
}
}
void ILI9341_Line(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t color)
{
int16_t i, dx, dy, sx, sy;
/* 二点間の距離 */
dx = (x1 > x0) ? x1 - x0 : x0 - x1;
dy = (y1 > y0) ? y1 - y0 : y0 - y1;
/* 二点の方向 */
sx = (x1 > x0) ? 1 : -1;
sy = (y1 > y0) ? 1 : -1;
if (dx > dy) /* 傾きが1より小さい場合 */
{
int16_t E = -dx;
for (i = 0; i < (dx + 1) >> 1; i++)
{
ILI9341_DrawPixel(x0, y0, color);
ILI9341_DrawPixel(x1, y1, color);
x0 += sx;
x1 -= sx;
E += 2 * dy;
if (E >= 0)
{
y0 += sy;
y1 -= sy;
E -= 2 * dx;
}
}
if ((dx % 2) == 0) ILI9341_DrawPixel(x0, y0, color); /* dx + 1 が奇数の場合、残った中央の点を最後に描画 */
}
else /* 傾きが1以上の場合 */
{
int16_t E = -dy;
for (i = 0 ;i < (dy + 1) >> 1; i++)
{
ILI9341_DrawPixel(x0, y0, color);
ILI9341_DrawPixel(x1, y1, color);
y0 += sy;
y1 -= sy;
E += 2 * dx;
if (E >= 0)
{
x0 += sx;
x1 -= sx;
E -= 2 * dy;
}
}
if ((dy % 2) == 0) ILI9341_DrawPixel(x0, y0, color); /* dy + 1 が奇数の場合、残った中央の点を最後に描画 */
}
}
inline void ILI9341_TouchSelect()
{
HAL_GPIO_WritePin(ILI9341_TOUCH_CS_GPIO_Port, ILI9341_TOUCH_CS_Pin, GPIO_PIN_RESET);
}
inline void ILI9341_TouchUnselect()
{
HAL_GPIO_WritePin(ILI9341_TOUCH_CS_GPIO_Port, ILI9341_TOUCH_CS_Pin, GPIO_PIN_SET);
}
inline bool ILI9341_TouchPressed()
{
return HAL_GPIO_ReadPin(ILI9341_TOUCH_IRQ_GPIO_Port, ILI9341_TOUCH_IRQ_Pin) == GPIO_PIN_RESET;
}
bool ILI9341_TouchGetCoordinates(uint16_t* x, uint16_t* y)
{
static const uint8_t cmd_read_x[] = { READ_X };
static const uint8_t cmd_read_y[] = { READ_Y };
static const uint8_t zeroes_tx[] = { 0x00, 0x00 };
ILI9341_TouchSelect();
uint32_t avg_x = 0;
uint32_t avg_y = 0;
uint8_t nsamples = 0;
for(uint8_t i = 0; i < 16; i++)
{
if(!ILI9341_TouchPressed())
break;
nsamples++;
HAL_SPI_Transmit(&ILI9341_TOUCH_SPI_PORT, (uint8_t*)cmd_read_y, sizeof(cmd_read_y), HAL_MAX_DELAY);
uint8_t y_raw[2];
HAL_SPI_TransmitReceive(&ILI9341_TOUCH_SPI_PORT, (uint8_t*)zeroes_tx, y_raw, sizeof(y_raw), HAL_MAX_DELAY);
HAL_SPI_Transmit(&ILI9341_TOUCH_SPI_PORT, (uint8_t*)cmd_read_x, sizeof(cmd_read_x), HAL_MAX_DELAY);
uint8_t x_raw[2];
HAL_SPI_TransmitReceive(&ILI9341_TOUCH_SPI_PORT, (uint8_t*)zeroes_tx, x_raw, sizeof(x_raw), HAL_MAX_DELAY);
avg_x += (((uint16_t)x_raw[0]) << 8) | ((uint16_t)x_raw[1]);
avg_y += (((uint16_t)y_raw[0]) << 8) | ((uint16_t)y_raw[1]);
}
ILI9341_TouchUnselect();
if(nsamples < 16)
return false;
uint32_t raw_x = (avg_x / 16);
if(raw_x < ILI9341_TOUCH_MIN_RAW_X) raw_x = ILI9341_TOUCH_MIN_RAW_X;
if(raw_x > ILI9341_TOUCH_MAX_RAW_X) raw_x = ILI9341_TOUCH_MAX_RAW_X;
uint32_t raw_y = (avg_y / 16);
if(raw_y < ILI9341_TOUCH_MIN_RAW_X) raw_y = ILI9341_TOUCH_MIN_RAW_Y;
if(raw_y > ILI9341_TOUCH_MAX_RAW_Y) raw_y = ILI9341_TOUCH_MAX_RAW_Y;
// orientation: upside down
*x = ILI9341_TOUCH_SCALE_X - (raw_x - ILI9341_TOUCH_MIN_RAW_X) * ILI9341_TOUCH_SCALE_X / (ILI9341_TOUCH_MAX_RAW_X - ILI9341_TOUCH_MIN_RAW_X);
*y = (raw_y - ILI9341_TOUCH_MIN_RAW_Y) * ILI9341_TOUCH_SCALE_Y / (ILI9341_TOUCH_MAX_RAW_Y - ILI9341_TOUCH_MIN_RAW_Y);
return true;
}
void ILI9341_TouchGetXY(uint16_t &x, uint16_t &y)
{
//static const uint8_t cmd_x[] = {READ_X};
//static const uint8_t cmd_zero[] = {0x00};
//static const uint8_t cmd_y[] = {READ_Y};
static const uint8_t cmd_xy[5] = {READ_X, 0x00, READ_Y, 0x00, 0x00};
uint8_t raw[5];
uint16_t avg_x = 0;
uint16_t avg_y = 0;
for (int i = 0; i < 8; i++) // 8回平均を算出
{
ILI9341_TouchSelect();
HAL_SPI_TransmitReceive(&ILI9341_TOUCH_SPI_PORT, (uint8_t*)cmd_xy, raw, sizeof(raw), HAL_MAX_DELAY);
avg_x += raw[1];
avg_y += raw[3];
ILI9341_TouchUnselect();
}
uint16_t raw_x = avg_x >> 3;
uint16_t raw_y = avg_y >> 3;
if(raw_x < ILI9341_TOUCH_MIN_RAW_X) raw_x = ILI9341_TOUCH_MIN_RAW_X;
if(raw_x > ILI9341_TOUCH_MAX_RAW_X) raw_x = ILI9341_TOUCH_MAX_RAW_X;
if(raw_y < ILI9341_TOUCH_MIN_RAW_X) raw_y = ILI9341_TOUCH_MIN_RAW_Y;
if(raw_y > ILI9341_TOUCH_MAX_RAW_Y) raw_y = ILI9341_TOUCH_MAX_RAW_Y;
// orientation: upside down
x = ILI9341_TOUCH_SCALE_X - (raw_x - ILI9341_TOUCH_MIN_RAW_X) * ILI9341_TOUCH_SCALE_X / (ILI9341_TOUCH_MAX_RAW_X - ILI9341_TOUCH_MIN_RAW_X);
y = (raw_y - ILI9341_TOUCH_MIN_RAW_Y) * ILI9341_TOUCH_SCALE_Y / (ILI9341_TOUCH_MAX_RAW_Y - ILI9341_TOUCH_MIN_RAW_Y);
}
uint16_t ILI9341_TouchGetX()
{
static const uint8_t cmd_read_x[] = { READ_X };
static const uint8_t zeroes_tx[] = { 0x00, 0x00 };
ILI9341_TouchSelect();
HAL_SPI_Transmit(&ILI9341_TOUCH_SPI_PORT, (uint8_t*)cmd_read_x, sizeof(cmd_read_x), HAL_MAX_DELAY);
uint8_t x_raw[2];
HAL_SPI_TransmitReceive(&ILI9341_TOUCH_SPI_PORT, (uint8_t*)zeroes_tx, x_raw, sizeof(x_raw), HAL_MAX_DELAY);
uint32_t raw_x = ((uint16_t)x_raw[0]);
ILI9341_TouchUnselect();
//return raw_x;
if(raw_x < ILI9341_TOUCH_MIN_RAW_X) raw_x = ILI9341_TOUCH_MIN_RAW_X;
if(raw_x > ILI9341_TOUCH_MAX_RAW_X) raw_x = ILI9341_TOUCH_MAX_RAW_X;
// orientation: upside down
return ILI9341_TOUCH_SCALE_X - (raw_x - ILI9341_TOUCH_MIN_RAW_X) * ILI9341_TOUCH_SCALE_X / (ILI9341_TOUCH_MAX_RAW_X - ILI9341_TOUCH_MIN_RAW_X);
}
uint16_t ILI9341_TouchGetY()
{
static const uint8_t cmd_read_y[] = { READ_Y };
static const uint8_t zeroes_tx[] = { 0x00, 0x00 };
ILI9341_TouchSelect();
HAL_SPI_Transmit(&ILI9341_TOUCH_SPI_PORT, (uint8_t*)cmd_read_y, sizeof(cmd_read_y), HAL_MAX_DELAY);
uint8_t y_raw[2];
HAL_SPI_TransmitReceive(&ILI9341_TOUCH_SPI_PORT, (uint8_t*)zeroes_tx, y_raw, sizeof(y_raw), HAL_MAX_DELAY);
uint32_t raw_y = ((uint16_t)y_raw[0]);
ILI9341_TouchUnselect();
//return raw_y;
if(raw_y < ILI9341_TOUCH_MIN_RAW_X) raw_y = ILI9341_TOUCH_MIN_RAW_Y;
if(raw_y > ILI9341_TOUCH_MAX_RAW_Y) raw_y = ILI9341_TOUCH_MAX_RAW_Y;
// orientation: upside down
return (raw_y - ILI9341_TOUCH_MIN_RAW_Y) * ILI9341_TOUCH_SCALE_Y / (ILI9341_TOUCH_MAX_RAW_Y - ILI9341_TOUCH_MIN_RAW_Y);
}
void ILI9341_Triangle(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2,uint16_t color)
{
ILI9341_Line(x0, y0, x1, y1, color);
ILI9341_Line(x0, y0, x2, y2, color);
ILI9341_Line(x1, y1, x2, y2, color);
}
#define TRI_BUF_SIZE 32 // FillTriangle用のバッファ配列の大きさ
void ILI9341_LineBuf(bool buf[TRI_BUF_SIZE*2][TRI_BUF_SIZE*2], int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color)
{
int16_t i, dx, dy, sx, sy;
/* 二点間の距離 */
dx = (x1 > x0) ? x1 - x0 : x0 - x1;
dy = (y1 > y0) ? y1 - y0 : y0 - y1;
/* 二点の方向 */
sx = (x1 > x0) ? 1 : -1;
sy = (y1 > y0) ? 1 : -1;
if (dx > dy) /* 傾きが1より小さい場合 */
{
int16_t E = -dx;
for (i = 0; i < (dx + 1) >> 1; i++)
{
buf[y0 + TRI_BUF_SIZE][x0 + TRI_BUF_SIZE] = true;
buf[y1 + TRI_BUF_SIZE][x1 + TRI_BUF_SIZE] = true;
x0 += sx;
x1 -= sx;
E += 2 * dy;
if (E >= 0)
{
y0 += sy;
y1 -= sy;
E -= 2 * dx;
}
}
if ((dx % 2) == 0) buf[y0 + TRI_BUF_SIZE][x0 + TRI_BUF_SIZE] = true; /* dx + 1 が奇数の場合、残った中央の点を最後に描画 */
}
else /* 傾きが1以上の場合 */
{
int16_t E = -dy;
for (i = 0 ;i < (dy + 1) >> 1; i++)
{
buf[y0 + TRI_BUF_SIZE][x0 + TRI_BUF_SIZE] = true;
buf[y1 + TRI_BUF_SIZE][x1 + TRI_BUF_SIZE] = true;
y0 += sy;
y1 -= sy;
E += 2 * dx;
if (E >= 0)
{
x0 += sx;
x1 -= sx;
E -= 2 * dy;
}
}
if ((dy % 2) == 0) buf[y0 + TRI_BUF_SIZE][x0 + TRI_BUF_SIZE] = true; /* dy + 1 が奇数の場合、残った中央の点を最後に描画 */
}
}
void ILI9341_FillTriangle(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2,uint16_t color)
{
bool buf[TRI_BUF_SIZE*2][TRI_BUF_SIZE*2] = {}; // バッファ配列
uint8_t points = 0; // 1列につき交差する辺の数
uint16_t xa = 0, ya = 0, xb = 0; // 交差する点の座標
// 原点をx0として移動
int16_t x01 = x1 - x0;
int16_t y01 = y1 - y0;
int16_t x02 = x2 - x0;
int16_t y02 = y2 - y0;
// バッファ配列に線分を仮描画
ILI9341_LineBuf(buf, 0, 0, x01, y01, color);
ILI9341_LineBuf(buf, 0, 0, x02, y02, color);
ILI9341_LineBuf(buf, x01, y01, x02, y02, color);
for (int i = 0; i < TRI_BUF_SIZE*2; i++) // y座標一列ずつ点があるか確認
{
points = 0;
xa = 0;
xb = 0;
ya = 0;
for (int j = 0; j < TRI_BUF_SIZE*2; j++)
{
if (buf[i][j])
{
if (points) // 2点目以降
{
xb = x0 + j - TRI_BUF_SIZE;
}
else // 1点目
{
xa = x0 + j - TRI_BUF_SIZE;
ya = y0 + i - TRI_BUF_SIZE;
}
points++;
}
}
if (points == 1) ILI9341_DrawPixel(xa, ya, color); // 1点のみ
else if (points >= 2) ILI9341_FillRectangle(xa, ya, xb - xa + 1, 1, color); // 2点以上あり→線分描画
}
}
|
/*
* Copyright 2018-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0/
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
#include <AVSCommon/Utils/HTTP/HttpResponseCode.h>
#include <AVSCommon/Utils/Logger/Logger.h>
#include "ACL/Transport/HTTP2Transport.h"
#include "ACL/Transport/PingHandler.h"
namespace alexaClientSDK {
namespace acl {
using namespace avsCommon::utils::http;
using namespace avsCommon::utils::http2;
/// URL to send pings to
const static std::string AVS_PING_URL_PATH_EXTENSION = "/ping";
/// Max time to wait for a ping reply.
static const std::chrono::milliseconds PING_TRANSFER_TIMEOUT(30000);
/// Priority for ping requests (high, default is 16).
static const uint8_t PING_PRIORITY = 200;
/// Prefix for the ID of ping requests.
static const std::string PING_ID_PREFIX = "AVSPing-";
/// String to identify log entries originating from this file.
static const std::string TAG("PingHandler");
/**
* Create a LogEntry using this file's TAG and the specified event string.
*
* @param The event string for this @c LogEntry.
*/
#define LX(event) alexaClientSDK::avsCommon::utils::logger::LogEntry(TAG, event)
std::shared_ptr<PingHandler> PingHandler::create(
std::shared_ptr<ExchangeHandlerContextInterface> context,
const std::string& authToken) {
ACSDK_DEBUG5(LX(__func__).d("context", context.get()));
if (!context) {
ACSDK_CRITICAL(LX("createFailed").d("reason", "nullContext"));
return nullptr;
}
if (authToken.empty()) {
ACSDK_DEBUG9(LX("createFailed").d("reason", "emptyAuthToken"));
return nullptr;
}
std::shared_ptr<PingHandler> handler(new PingHandler(context, authToken));
HTTP2RequestConfig cfg{HTTP2RequestType::GET, context->getEndpoint() + AVS_PING_URL_PATH_EXTENSION, PING_ID_PREFIX};
cfg.setRequestSource(handler);
cfg.setResponseSink(handler);
cfg.setTransferTimeout(PING_TRANSFER_TIMEOUT);
cfg.setPriority(PING_PRIORITY);
auto request = context->createAndSendRequest(cfg);
if (!request) {
ACSDK_ERROR(LX("createFailed").d("reason", "createAndSendRequestFailed"));
return nullptr;
}
return handler;
}
PingHandler::PingHandler(std::shared_ptr<ExchangeHandlerContextInterface> context, const std::string& authToken) :
ExchangeHandler{context, authToken},
m_wasPingAcknowledgedReported{false},
m_responseCode{0} {
ACSDK_DEBUG5(LX(__func__).d("context", context.get()));
}
void PingHandler::reportPingAcknowledged() {
ACSDK_DEBUG5(LX(__func__));
if (!m_wasPingAcknowledgedReported) {
m_wasPingAcknowledgedReported = true;
m_context->onPingRequestAcknowledged(
HTTPResponseCode::SUCCESS_NO_CONTENT == intToHTTPResponseCode(m_responseCode));
}
}
std::vector<std::string> PingHandler::getRequestHeaderLines() {
ACSDK_DEBUG5(LX(__func__));
return {m_authHeader};
}
HTTP2SendDataResult PingHandler::onSendData(char* bytes, size_t size) {
ACSDK_DEBUG5(LX(__func__).d("size", size));
return HTTP2SendDataResult::COMPLETE;
}
bool PingHandler::onReceiveResponseCode(long responseCode) {
ACSDK_DEBUG5(LX(__func__).d("responseCode", responseCode));
if (HTTPResponseCode::CLIENT_ERROR_FORBIDDEN == intToHTTPResponseCode(responseCode)) {
m_context->onForbidden(m_authToken);
}
m_context->onActivity();
m_responseCode = responseCode;
reportPingAcknowledged();
return true;
}
bool PingHandler::onReceiveHeaderLine(const std::string& line) {
ACSDK_DEBUG5(LX(__func__).d("line", line));
m_context->onActivity();
return true;
}
HTTP2ReceiveDataStatus PingHandler::onReceiveData(const char* bytes, size_t size) {
ACSDK_DEBUG5(LX(__func__).d("size", size));
m_context->onActivity();
return HTTP2ReceiveDataStatus::SUCCESS;
}
void PingHandler::onResponseFinished(HTTP2ResponseFinishedStatus status) {
ACSDK_DEBUG5(LX(__func__).d("status", status));
switch (status) {
case HTTP2ResponseFinishedStatus::COMPLETE:
reportPingAcknowledged();
return;
case HTTP2ResponseFinishedStatus::TIMEOUT:
case HTTP2ResponseFinishedStatus::INTERNAL_ERROR:
m_context->onPingTimeout();
return;
case HTTP2ResponseFinishedStatus::CANCELLED:
ACSDK_WARN(LX("onResponseFinishedWithCancelledStatus"));
return;
}
ACSDK_ERROR(LX("onResponseFinishedWithUnhandledStatus").d("status", static_cast<int>(status)));
}
} // namespace acl
} // namespace alexaClientSDK
|
; A032765: Floor(n(n+1)(n+2) / (n+ n+1 + n+2)), which equals floor(n(n + 2)/3).
; 0,1,2,5,8,11,16,21,26,33,40,47,56,65,74,85,96,107,120,133,146,161,176,191,208,225,242,261,280,299,320,341,362,385,408,431,456,481,506,533,560,587,616,645,674,705,736,767,800,833,866,901,936,971,1008
mov $1,$0
add $1,2
mul $1,$0
div $1,3
|
/**
******************************************************************************
* This file is part of the TouchGFX 4.10.0 distribution.
*
* <h2><center>© Copyright (c) 2018 STMicroelectronics.
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under Ultimate Liberty license
* SLA0044, the "License"; You may not use this file except in compliance with
* the License. You may obtain a copy of the License at:
* www.st.com/SLA0044
*
******************************************************************************
*/
#ifndef LCD2BPP_HPP
#define LCD2BPP_HPP
#include <touchgfx/hal/Types.hpp>
#include <touchgfx/hal/HAL.hpp>
#include <touchgfx/lcd/LCD.hpp>
#include <touchgfx/Font.hpp>
#include <touchgfx/Bitmap.hpp>
#include <touchgfx/Unicode.hpp>
#include <touchgfx/TextProvider.hpp>
#include <touchgfx/TextureMapTypes.hpp>
#include <stdarg.h>
namespace touchgfx
{
#undef LCD
#define USE_LSB
/**
* @class LCD2bpp LCD2bpp.hpp platform/driver/lcd/LCD2bpp.hpp
*
* @brief This class contains the various low-level drawing routines for drawing bitmaps.
*
* This class contains the various low-level drawing routines for drawing bitmaps, texts
* and rectangles on 2 bits per pixel grayscale displays.
*
* @note All coordinates are expected to be in absolute coordinates!
*
* @see LCD
*/
class LCD2bpp : public LCD
{
public:
virtual ~LCD2bpp() {}
/**
* @fn virtual void LCD2bpp::init();
*
* @brief Performs initialization.
*
* Performs initialization.
*/
virtual void init();
/**
* @fn virtual void LCD2bpp::drawPartialBitmap(const Bitmap& bitmap, int16_t x, int16_t y, const Rect& rect, uint8_t alpha = 255, bool useOptimized = true);
*
* @brief Draws a portion of a bitmap.
*
* @param bitmap The bitmap to draw.
* @param x The absolute x coordinate to place pixel (0, 0) on the screen.
* @param y The absolute y coordinate to place pixel (0, 0) on the screen.
* @param rect A rectangle describing what region of the bitmap is to be drawn.
* @param alpha Optional alpha value. Default is 255 (solid).
* @param useOptimized if false, do not attempt to substitute (parts of) this bitmap with
* faster fillrects.
*/
virtual void drawPartialBitmap(const Bitmap& bitmap, int16_t x, int16_t y, const Rect& rect, uint8_t alpha = 255, bool useOptimized = true);
/**
* @fn virtual void LCD2bpp::blitCopy(const uint16_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha, bool hasTransparentPixels);
*
* @brief Blits a 2D source-array to the framebuffer.
*
* Blits a 2D source-array to the framebuffer perfoming alpha-blending (and
* tranparency keying) as specified Performs a software blend if HAL does not
* support BLIT_COPY_WITH_ALPHA and alpha != 255.
*
* @param sourceData The source-array pointer (points to the beginning of the
* data). The sourceData must be stored as 16-bits RGB565
* values.
* @param source The location and dimension of the source.
* @param blitRect A rectangle describing what region is to be drawn.
* @param alpha The alpha value to use for blending (255 = solid, no blending)
* @param hasTransparentPixels If true, this data copy contains transparent pixels and
* require hardware support for that to be enabled.
*/
virtual void blitCopy(const uint16_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha, bool hasTransparentPixels);
/**
* @fn virtual void LCD2bpp::blitCopy(const uint8_t* sourceData, Bitmap::BitmapFormat sourceFormat, const Rect& source, const Rect& blitRect, uint8_t alpha, bool hasTransparentPixels);
*
* @brief Blits a 2D source-array to the framebuffer while converting the format.
*
* Blits a 2D source-array to the framebuffer perfoming alpha-blending (and
* tranparency keying) as specified. Performs a software blend if HAL does not
* support BLIT_COPY_WITH_ALPHA and alpha != 255. LCD2 supports source data
* formats: RGB565 and ARGB8888.
*
* @param sourceData The source-array pointer (points to the beginning of the
* data). The sourceData must be stored in a format suitable for
* the selected display.
* @param sourceFormat The bitmap format used in the source data.
* @param source The location and dimension of the source.
* @param blitRect A rectangle describing what region is to be drawn.
* @param alpha The alpha value to use for blending (255 = solid, no blending)
* @param hasTransparentPixels If true, this data copy contains transparent pixels and
* require hardware support for that to be enabled.
*/
virtual void blitCopy(const uint8_t* sourceData, Bitmap::BitmapFormat sourceFormat, const Rect& source, const Rect& blitRect, uint8_t alpha, bool hasTransparentPixels);
/**
* @fn virtual uint16_t* LCD2bpp::copyFrameBufferRegionToMemory(const Rect& region, const BitmapId bitmap = BITMAP_ANIMATION_STORAGE) = 0;
*
* @brief Copies a part of the frame buffer.
*
* Copies a part of the frame buffer to a bitmap.
*
* @param region The part to copy.
* @param bitmap The bitmap to store the data in. Default parameter is Animation Storage.
*
* @return A pointer to the copy.
*
*/
virtual uint16_t* copyFrameBufferRegionToMemory(const Rect& region, const BitmapId bitmap = BITMAP_ANIMATION_STORAGE);
/**
* @fn virtual void LCD2bpp::fillRect(const Rect& rect, colortype color, uint8_t alpha = 255);
*
* @brief Draws a filled rectangle in the specified color.
*
* Draws a filled rectangle in the specified color.
*
* @param rect The rectangle to draw in absolute coordinates.
* @param color The rectangle color.
* @param alpha The rectangle opacity (255=solid)
*/
virtual void fillRect(const Rect& rect, colortype color, uint8_t alpha = 255);
/**
* @fn virtual uint8_t LCD2bpp::bitDepth() const
*
* @brief Number of bits per pixel used by the display.
*
* Number of bits per pixel used by the display.
*
* @return The number of bits per pixel.
*/
virtual uint8_t bitDepth() const
{
return 2;
}
protected:
static const uint16_t TRANSPARENT_COL = 0xABCD; ///< Transparency color. Deprecated, do not use.
static const uint8_t alphaTable2bpp[64]; ///< The alpha lookup table to avoid arithmetics when alpha blending
/**
* @fn virtual void LCD2bpp::drawTextureMapScanLine(const DrawingSurface& dest, const Gradients& gradients, const Edge* leftEdge, const Edge* rightEdge, const TextureSurface& texture, const Rect& absoluteRect, const Rect& dirtyAreaAbsolute, RenderingVariant renderVariant, uint8_t alpha, uint16_t subDivisionSize);
*
* @brief Draw scan line. Draw one horizontal line of the texture map on screen. The scan line
* will be drawn using perspective correct texture mapping. The appearance of the
* line is determined by the left and right edge and the gradients structure. The
* edges contain the information about the x,y,z coordinates of the left and right
* side respectively and also information about the u,v coordinates of the texture
* map used. The gradients structure contains information about how to interpolate
* all the values across the scan line. The data drawn should be present in the
* texture argument.
*
* The scan line will be drawn using the additional arguments. The scan line will be
* placed and clipped using the absolute and dirty rectangles The alpha will
* determine how the scan line should be alpha blended. The subDivisionSize will
* determine the size of the piecewise affine texture mapped lines.
*
* @param dest The description of where the texture is drawn - can be used to
* issue a draw off screen.
* @param gradients The gradients using in interpolation across the scan line.
* @param leftEdge The left edge of the scan line.
* @param rightEdge The right edge of the scan line.
* @param texture The texture.
* @param absoluteRect The containing rectangle in absolute coordinates.
* @param dirtyAreaAbsolute The dirty area in absolute coordinates.
* @param renderVariant The render variant - includes the algorithm and the pixel format.
* @param alpha The alpha.
* @param subDivisionSize The size of the subdivisions of the scan line. A value of 1 will
* give a completely perspective correct texture mapped scan line. A
* large value will give an affine texture mapped scan line.
*/
virtual void drawTextureMapScanLine(const DrawingSurface& dest, const Gradients& gradients, const Edge* leftEdge, const Edge* rightEdge, const TextureSurface& texture, const Rect& absoluteRect, const Rect& dirtyAreaAbsolute, RenderingVariant renderVariant, uint8_t alpha, uint16_t subDivisionSize);
/**
* @fn static int LCD2bpp::nextPixel(bool portrait, TextRotation rotation);
*
* @brief Find out how much to advance in the display buffer to get to the next pixel.
*
* Find out how much to advance in the display buffer to get to the next pixel.
*
* @param portrait Is the display running in portrait mode?
* @param rotation Rotation to perform.
*
* @return How much to advance to get to the next pixel.
*/
static int nextPixel(bool portrait, TextRotation rotation);
/**
* @fn static int LCD2bpp::nextLine(bool portrait, TextRotation rotation);
*
* @brief Find out how much to advance in the display buffer to get to the next line.
*
* Find out how much to advance in the display buffer to get to the next line.
*
* @param portrait Is the display running in portrait mode?
* @param rotation Rotation to perform.
*
* @return How much to advance to get to the next line.
*/
static int nextLine(bool portrait, TextRotation rotation);
/**
* @fn virtual void LCD2bpp::drawGlyph(uint16_t* wbuf, Rect widgetArea, int16_t x, int16_t y, uint16_t offsetX, uint16_t offsetY, const Rect& invalidatedArea, const GlyphNode* glyph, const uint8_t* glyphData, colortype color, uint8_t bitsPerPixel, uint8_t alpha, TextRotation rotation = TEXT_ROTATE_0);
*
* @brief Private version of draw-glyph with explicit destination buffer pointer argument.
*
* Private version of draw-glyph with explicit destination buffer pointer argument.
* For all parameters (except the buffer pointer) see the public version of
* drawGlyph()
*
* @param [in] wbuf The destination (frame) buffer to draw to.
* @param widgetArea The canvas to draw the glyph inside.
* @param x Horizontal offset to start drawing the glyph.
* @param y Vertical offset to start drawing the glyph.
* @param offsetX Horizontal offset in the glyph to start drawing from.
* @param offsetY Vertical offset in the glyph to start drawing from.
* @param invalidatedArea The area to draw within.
* @param glyph Specifications of the glyph to draw.
* @param glyphData Data containing the actual glyph (dense format)
* @param color The color of the glyph.
* @param bitsPerPixel Bit depth of the glyph.
* @param alpha The transparency of the glyph.
* @param rotation Rotation to do before drawing the glyph.
*/
virtual void drawGlyph(uint16_t* wbuf, Rect widgetArea, int16_t x, int16_t y, uint16_t offsetX, uint16_t offsetY, const Rect& invalidatedArea, const GlyphNode* glyph, const uint8_t* glyphData, colortype color, uint8_t bitsPerPixel, uint8_t alpha, TextRotation rotation = TEXT_ROTATE_0);
/**
* @fn static void LCD2bpp::blitCopyAlphaPerPixel(const uint16_t* sourceData16, const uint8_t* sourceAlphaData, const Rect& source, const Rect& blitRect, uint8_t alpha);
*
* @brief Blits a 2D source-array to the framebuffer.
*
* Blits a 2D source-array to the framebuffer performing alpha-blending per pixel as
* specified Performs always a software blend.
*
* @param sourceData16 The source-array pointer (points to the beginning of the data). The
* sourceData must be stored as 2bpp GREY2 values.
* @param sourceAlphaData The alpha channel array pointer (points to the beginning of the data)
* @param source The location and dimension of the source.
* @param blitRect A rectangle describing what region is to be drawn.
* @param alpha The alpha value to use for blending applied to the whole image (255 =
* solid, no blending)
*/
static void blitCopyAlphaPerPixel(const uint16_t* sourceData16, const uint8_t* sourceAlphaData, const Rect& source, const Rect& blitRect, uint8_t alpha);
};
/**
* @fn FORCE_INLINE_FUNCTION int LCD2shiftVal(int offset)
*
* @brief Shift value to get the right pixel in a byte.
*
* @param offset The offset.
*
* @return The shift value.
*/
FORCE_INLINE_FUNCTION int LCD2shiftVal(int offset)
{
#ifdef USE_LSB
return (offset & 3) << 1;
#else
return (3 - (offset & 3)) << 1;
#endif
}
/**
* @fn FORCE_INLINE_FUNCTION uint8_t LCD2getPixel(const uint8_t* addr, int offset)
*
* @brief Get pixel from buffer/image.
*
* @param addr The address.
* @param offset The offset.
*
* @return The pixel value.
*/
FORCE_INLINE_FUNCTION uint8_t LCD2getPixel(const uint8_t* addr, int offset)
{
return (addr[offset >> 2] >> LCD2shiftVal(offset)) & 3;
}
/**
* @fn FORCE_INLINE_FUNCTION uint8_t LCD2getPixel(const uint16_t* addr, int offset)
*
* @brief Get pixel from buffer/image.
*
* @param addr The address.
* @param offset The offset.
*
* @return The pixel value.
*/
FORCE_INLINE_FUNCTION uint8_t LCD2getPixel(const uint16_t* addr, int offset)
{
return LCD2getPixel(reinterpret_cast<const uint8_t*>(addr), offset);
}
/**
* @fn FORCE_INLINE_FUNCTION void LCD2setPixel(uint8_t* addr, int offset, uint8_t value)
*
* @brief Set pixel in buffer.
*
* @param [in] addr The address.
* @param offset The offset.
* @param value The value.
*/
FORCE_INLINE_FUNCTION void LCD2setPixel(uint8_t* addr, int offset, uint8_t value)
{
int shift = LCD2shiftVal(offset);
addr[offset >> 2] = (addr[offset >> 2] & ~(3 << shift)) | ((value & 3) << shift);
}
/**
* @fn FORCE_INLINE_FUNCTION void LCD2setPixel(uint16_t* addr, int offset, uint8_t value)
*
* @brief Set pixel in buffer.
*
* @param [in] addr The address.
* @param offset The offset.
* @param value The value.
*/
FORCE_INLINE_FUNCTION void LCD2setPixel(uint16_t* addr, int offset, uint8_t value)
{
LCD2setPixel(reinterpret_cast<uint8_t*>(addr), offset, value);
}
} // namespace touchgfx
#endif // LCD2BPP_HPP
|
#ifndef PYTHONIC_OPERATOR_IFLOORDIV__HPP
#define PYTHONIC_OPERATOR_IFLOORDIV__HPP
#include "pythonic/include/operator_/__ifloordiv__.hpp"
#include "pythonic/operator_/ifloordiv.hpp"
#endif
|
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "media/base/demuxer_stream.h"
namespace media {
DemuxerStream::~DemuxerStream() {}
// Most DemuxerStream implementations don't specify liveness. Returns unknown
// liveness by default.
DemuxerStream::Liveness DemuxerStream::liveness() const {
return DemuxerStream::LIVENESS_UNKNOWN;
}
// Most DemuxerStream implementations don't need to convert bit stream.
// Do nothing by default.
void DemuxerStream::EnableBitstreamConverter() {}
} // namespace media
|
; A101624: Stern-Jacobsthal numbers.
; Submitted by Jon Maiga
; 1,1,3,1,7,5,11,1,23,21,59,17,103,69,139,1,279,277,827,273,1895,1349,2955,257,5655,5141,14395,4113,24679,16453,32907,1,65815,65813,197435,65809,460647,329029,723851,65793,1512983,1381397,3881019,1118225,6774887,4538437,9142411,65537,18219287,18088213,54002491,17826065,123733863,88081733,192940939,16777473,369104407,335549461,939538491,268439569,1610637415,1073758277,2147516555,1,4295033111,4295033109,12885099323,4295033105,30065231719,21475165509,47245364107,4295033089,98785760791,90195694613
add $0,1
lpb $0
sub $0,1
mul $1,2
mov $3,$2
add $2,1
bin $3,$0
mod $3,2
add $1,$3
lpe
mov $0,$1
|
; A151980: Numbers n such that n^2 - n is divisible by 20.
; 0,1,5,16,20,21,25,36,40,41,45,56,60,61,65,76,80,81,85,96,100,101,105,116,120,121,125,136,140,141,145,156,160,161,165,176,180,181,185,196,200,201,205,216,220,221,225,236,240,241,245,256,260,261,265,276,280,281,285,296
add $0,7
mov $2,$0
mov $4,$0
add $4,$0
mov $0,5
mov $1,$2
div $1,2
pow $2,0
mov $3,898
add $4,2
add $1,$4
mul $2,$1
gcd $3,$1
add $1,$2
lpb $0
sub $0,1
add $1,3
sub $1,$3
lpe
add $1,2
bin $3,$0
add $1,$3
sub $1,51
mov $0,$1
|
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow_serving/apis/model.proto
#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
#include "tensorflow_serving/apis/model.pb.h"
#include <algorithm>
#include <google/protobuf/stubs/common.h>
#include <google/protobuf/stubs/port.h>
#include <google/protobuf/stubs/once.h>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/wire_format_lite_inl.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/generated_message_reflection.h>
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
// @@protoc_insertion_point(includes)
namespace tensorflow {
namespace serving {
namespace {
const ::google::protobuf::Descriptor* ModelSpec_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
ModelSpec_reflection_ = NULL;
} // namespace
void protobuf_AssignDesc_tensorflow_5fserving_2fapis_2fmodel_2eproto() GOOGLE_ATTRIBUTE_COLD;
void protobuf_AssignDesc_tensorflow_5fserving_2fapis_2fmodel_2eproto() {
protobuf_AddDesc_tensorflow_5fserving_2fapis_2fmodel_2eproto();
const ::google::protobuf::FileDescriptor* file =
::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
"tensorflow_serving/apis/model.proto");
GOOGLE_CHECK(file != NULL);
ModelSpec_descriptor_ = file->message_type(0);
static const int ModelSpec_offsets_[3] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ModelSpec, name_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ModelSpec, version_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ModelSpec, signature_name_),
};
ModelSpec_reflection_ =
::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
ModelSpec_descriptor_,
ModelSpec::internal_default_instance(),
ModelSpec_offsets_,
-1,
-1,
-1,
sizeof(ModelSpec),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ModelSpec, _internal_metadata_));
}
namespace {
GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
void protobuf_AssignDescriptorsOnce() {
::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
&protobuf_AssignDesc_tensorflow_5fserving_2fapis_2fmodel_2eproto);
}
void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD;
void protobuf_RegisterTypes(const ::std::string&) {
protobuf_AssignDescriptorsOnce();
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
ModelSpec_descriptor_, ModelSpec::internal_default_instance());
}
} // namespace
void protobuf_ShutdownFile_tensorflow_5fserving_2fapis_2fmodel_2eproto() {
ModelSpec_default_instance_.Shutdown();
delete ModelSpec_reflection_;
}
void protobuf_InitDefaults_tensorflow_5fserving_2fapis_2fmodel_2eproto_impl() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
::google::protobuf::protobuf_InitDefaults_google_2fprotobuf_2fwrappers_2eproto();
::google::protobuf::internal::GetEmptyString();
ModelSpec_default_instance_.DefaultConstruct();
ModelSpec_default_instance_.get_mutable()->InitAsDefaultInstance();
}
GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_InitDefaults_tensorflow_5fserving_2fapis_2fmodel_2eproto_once_);
void protobuf_InitDefaults_tensorflow_5fserving_2fapis_2fmodel_2eproto() {
::google::protobuf::GoogleOnceInit(&protobuf_InitDefaults_tensorflow_5fserving_2fapis_2fmodel_2eproto_once_,
&protobuf_InitDefaults_tensorflow_5fserving_2fapis_2fmodel_2eproto_impl);
}
void protobuf_AddDesc_tensorflow_5fserving_2fapis_2fmodel_2eproto_impl() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
protobuf_InitDefaults_tensorflow_5fserving_2fapis_2fmodel_2eproto();
::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
"\n#tensorflow_serving/apis/model.proto\022\022t"
"ensorflow.serving\032\036google/protobuf/wrapp"
"ers.proto\"_\n\tModelSpec\022\014\n\004name\030\001 \001(\t\022,\n\007"
"version\030\002 \001(\0132\033.google.protobuf.Int64Val"
"ue\022\026\n\016signature_name\030\003 \001(\tB\003\370\001\001b\006proto3", 199);
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
"tensorflow_serving/apis/model.proto", &protobuf_RegisterTypes);
::google::protobuf::protobuf_AddDesc_google_2fprotobuf_2fwrappers_2eproto();
::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_tensorflow_5fserving_2fapis_2fmodel_2eproto);
}
GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AddDesc_tensorflow_5fserving_2fapis_2fmodel_2eproto_once_);
void protobuf_AddDesc_tensorflow_5fserving_2fapis_2fmodel_2eproto() {
::google::protobuf::GoogleOnceInit(&protobuf_AddDesc_tensorflow_5fserving_2fapis_2fmodel_2eproto_once_,
&protobuf_AddDesc_tensorflow_5fserving_2fapis_2fmodel_2eproto_impl);
}
// Force AddDescriptors() to be called at static initialization time.
struct StaticDescriptorInitializer_tensorflow_5fserving_2fapis_2fmodel_2eproto {
StaticDescriptorInitializer_tensorflow_5fserving_2fapis_2fmodel_2eproto() {
protobuf_AddDesc_tensorflow_5fserving_2fapis_2fmodel_2eproto();
}
} static_descriptor_initializer_tensorflow_5fserving_2fapis_2fmodel_2eproto_;
namespace {
static void MergeFromFail(int line) GOOGLE_ATTRIBUTE_COLD GOOGLE_ATTRIBUTE_NORETURN;
static void MergeFromFail(int line) {
::google::protobuf::internal::MergeFromFail(__FILE__, line);
}
} // namespace
// ===================================================================
void ModelSpec::_slow_mutable_version() {
version_ = ::google::protobuf::Arena::CreateMessage< ::google::protobuf::Int64Value >(
GetArenaNoVirtual());
}
::google::protobuf::Int64Value* ModelSpec::_slow_release_version() {
if (version_ == NULL) {
return NULL;
} else {
::google::protobuf::Int64Value* temp = new ::google::protobuf::Int64Value(*version_);
version_ = NULL;
return temp;
}
}
::google::protobuf::Int64Value* ModelSpec::unsafe_arena_release_version() {
// @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.serving.ModelSpec.version)
::google::protobuf::Int64Value* temp = version_;
version_ = NULL;
return temp;
}
void ModelSpec::_slow_set_allocated_version(
::google::protobuf::Arena* message_arena, ::google::protobuf::Int64Value** version) {
if (message_arena != NULL &&
::google::protobuf::Arena::GetArena(*version) == NULL) {
message_arena->Own(*version);
} else if (message_arena !=
::google::protobuf::Arena::GetArena(*version)) {
::google::protobuf::Int64Value* new_version =
::google::protobuf::Arena::CreateMessage< ::google::protobuf::Int64Value >(
message_arena);
new_version->CopyFrom(**version);
*version = new_version;
}
}
void ModelSpec::unsafe_arena_set_allocated_version(
::google::protobuf::Int64Value* version) {
if (GetArenaNoVirtual() == NULL) {
delete version_;
}
version_ = version;
if (version) {
} else {
}
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.serving.ModelSpec.version)
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int ModelSpec::kNameFieldNumber;
const int ModelSpec::kVersionFieldNumber;
const int ModelSpec::kSignatureNameFieldNumber;
#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
ModelSpec::ModelSpec()
: ::google::protobuf::Message(), _internal_metadata_(NULL) {
if (this != internal_default_instance()) protobuf_InitDefaults_tensorflow_5fserving_2fapis_2fmodel_2eproto();
SharedCtor();
// @@protoc_insertion_point(constructor:tensorflow.serving.ModelSpec)
}
ModelSpec::ModelSpec(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(),
_internal_metadata_(arena) {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_InitDefaults_tensorflow_5fserving_2fapis_2fmodel_2eproto();
#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:tensorflow.serving.ModelSpec)
}
void ModelSpec::InitAsDefaultInstance() {
version_ = const_cast< ::google::protobuf::Int64Value*>(
::google::protobuf::Int64Value::internal_default_instance());
}
ModelSpec::ModelSpec(const ModelSpec& from)
: ::google::protobuf::Message(),
_internal_metadata_(NULL) {
SharedCtor();
UnsafeMergeFrom(from);
// @@protoc_insertion_point(copy_constructor:tensorflow.serving.ModelSpec)
}
void ModelSpec::SharedCtor() {
name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
signature_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
version_ = NULL;
_cached_size_ = 0;
}
ModelSpec::~ModelSpec() {
// @@protoc_insertion_point(destructor:tensorflow.serving.ModelSpec)
SharedDtor();
}
void ModelSpec::SharedDtor() {
::google::protobuf::Arena* arena = GetArenaNoVirtual();
if (arena != NULL) {
return;
}
name_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena);
signature_name_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena);
if (this != &ModelSpec_default_instance_.get()) {
delete version_;
}
}
void ModelSpec::ArenaDtor(void* object) {
ModelSpec* _this = reinterpret_cast< ModelSpec* >(object);
(void)_this;
}
void ModelSpec::RegisterArenaDtor(::google::protobuf::Arena* arena) {
}
void ModelSpec::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* ModelSpec::descriptor() {
protobuf_AssignDescriptorsOnce();
return ModelSpec_descriptor_;
}
const ModelSpec& ModelSpec::default_instance() {
protobuf_InitDefaults_tensorflow_5fserving_2fapis_2fmodel_2eproto();
return *internal_default_instance();
}
::google::protobuf::internal::ExplicitlyConstructed<ModelSpec> ModelSpec_default_instance_;
ModelSpec* ModelSpec::New(::google::protobuf::Arena* arena) const {
return ::google::protobuf::Arena::CreateMessage<ModelSpec>(arena);
}
void ModelSpec::Clear() {
// @@protoc_insertion_point(message_clear_start:tensorflow.serving.ModelSpec)
name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
if (GetArenaNoVirtual() == NULL && version_ != NULL) delete version_;
version_ = NULL;
signature_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
bool ModelSpec::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
// @@protoc_insertion_point(parse_start:tensorflow.serving.ModelSpec)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// optional string name = 1;
case 1: {
if (tag == 10) {
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_name()));
DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
this->name().data(), this->name().length(),
::google::protobuf::internal::WireFormatLite::PARSE,
"tensorflow.serving.ModelSpec.name"));
} else {
goto handle_unusual;
}
if (input->ExpectTag(18)) goto parse_version;
break;
}
// optional .google.protobuf.Int64Value version = 2;
case 2: {
if (tag == 18) {
parse_version:
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, mutable_version()));
} else {
goto handle_unusual;
}
if (input->ExpectTag(26)) goto parse_signature_name;
break;
}
// optional string signature_name = 3;
case 3: {
if (tag == 26) {
parse_signature_name:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_signature_name()));
DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
this->signature_name().data(), this->signature_name().length(),
::google::protobuf::internal::WireFormatLite::PARSE,
"tensorflow.serving.ModelSpec.signature_name"));
} else {
goto handle_unusual;
}
if (input->ExpectAtEnd()) goto success;
break;
}
default: {
handle_unusual:
if (tag == 0 ||
::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
goto success;
}
DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
break;
}
}
}
success:
// @@protoc_insertion_point(parse_success:tensorflow.serving.ModelSpec)
return true;
failure:
// @@protoc_insertion_point(parse_failure:tensorflow.serving.ModelSpec)
return false;
#undef DO_
}
void ModelSpec::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:tensorflow.serving.ModelSpec)
// optional string name = 1;
if (this->name().size() > 0) {
::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
this->name().data(), this->name().length(),
::google::protobuf::internal::WireFormatLite::SERIALIZE,
"tensorflow.serving.ModelSpec.name");
::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
1, this->name(), output);
}
// optional .google.protobuf.Int64Value version = 2;
if (this->has_version()) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
2, *this->version_, output);
}
// optional string signature_name = 3;
if (this->signature_name().size() > 0) {
::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
this->signature_name().data(), this->signature_name().length(),
::google::protobuf::internal::WireFormatLite::SERIALIZE,
"tensorflow.serving.ModelSpec.signature_name");
::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
3, this->signature_name(), output);
}
// @@protoc_insertion_point(serialize_end:tensorflow.serving.ModelSpec)
}
::google::protobuf::uint8* ModelSpec::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
(void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:tensorflow.serving.ModelSpec)
// optional string name = 1;
if (this->name().size() > 0) {
::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
this->name().data(), this->name().length(),
::google::protobuf::internal::WireFormatLite::SERIALIZE,
"tensorflow.serving.ModelSpec.name");
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
1, this->name(), target);
}
// optional .google.protobuf.Int64Value version = 2;
if (this->has_version()) {
target = ::google::protobuf::internal::WireFormatLite::
InternalWriteMessageNoVirtualToArray(
2, *this->version_, false, target);
}
// optional string signature_name = 3;
if (this->signature_name().size() > 0) {
::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
this->signature_name().data(), this->signature_name().length(),
::google::protobuf::internal::WireFormatLite::SERIALIZE,
"tensorflow.serving.ModelSpec.signature_name");
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
3, this->signature_name(), target);
}
// @@protoc_insertion_point(serialize_to_array_end:tensorflow.serving.ModelSpec)
return target;
}
size_t ModelSpec::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:tensorflow.serving.ModelSpec)
size_t total_size = 0;
// optional string name = 1;
if (this->name().size() > 0) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->name());
}
// optional .google.protobuf.Int64Value version = 2;
if (this->has_version()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
*this->version_);
}
// optional string signature_name = 3;
if (this->signature_name().size() > 0) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->signature_name());
}
int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = cached_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void ModelSpec::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:tensorflow.serving.ModelSpec)
if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__);
const ModelSpec* source =
::google::protobuf::internal::DynamicCastToGenerated<const ModelSpec>(
&from);
if (source == NULL) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.serving.ModelSpec)
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.serving.ModelSpec)
UnsafeMergeFrom(*source);
}
}
void ModelSpec::MergeFrom(const ModelSpec& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.serving.ModelSpec)
if (GOOGLE_PREDICT_TRUE(&from != this)) {
UnsafeMergeFrom(from);
} else {
MergeFromFail(__LINE__);
}
}
void ModelSpec::UnsafeMergeFrom(const ModelSpec& from) {
GOOGLE_DCHECK(&from != this);
if (from.name().size() > 0) {
set_name(from.name());
}
if (from.has_version()) {
mutable_version()->::google::protobuf::Int64Value::MergeFrom(from.version());
}
if (from.signature_name().size() > 0) {
set_signature_name(from.signature_name());
}
}
void ModelSpec::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:tensorflow.serving.ModelSpec)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void ModelSpec::CopyFrom(const ModelSpec& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.serving.ModelSpec)
if (&from == this) return;
Clear();
UnsafeMergeFrom(from);
}
bool ModelSpec::IsInitialized() const {
return true;
}
void ModelSpec::Swap(ModelSpec* other) {
if (other == this) return;
if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
InternalSwap(other);
} else {
ModelSpec temp;
temp.UnsafeMergeFrom(*this);
CopyFrom(*other);
other->CopyFrom(temp);
}
}
void ModelSpec::UnsafeArenaSwap(ModelSpec* other) {
if (other == this) return;
GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
InternalSwap(other);
}
void ModelSpec::InternalSwap(ModelSpec* other) {
name_.Swap(&other->name_);
std::swap(version_, other->version_);
signature_name_.Swap(&other->signature_name_);
_internal_metadata_.Swap(&other->_internal_metadata_);
std::swap(_cached_size_, other->_cached_size_);
}
::google::protobuf::Metadata ModelSpec::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = ModelSpec_descriptor_;
metadata.reflection = ModelSpec_reflection_;
return metadata;
}
#if PROTOBUF_INLINE_NOT_IN_HEADERS
// ModelSpec
// optional string name = 1;
void ModelSpec::clear_name() {
name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
const ::std::string& ModelSpec::name() const {
// @@protoc_insertion_point(field_get:tensorflow.serving.ModelSpec.name)
return name_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
void ModelSpec::set_name(const ::std::string& value) {
name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:tensorflow.serving.ModelSpec.name)
}
void ModelSpec::set_name(const char* value) {
name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:tensorflow.serving.ModelSpec.name)
}
void ModelSpec::set_name(const char* value,
size_t size) {
name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:tensorflow.serving.ModelSpec.name)
}
::std::string* ModelSpec::mutable_name() {
// @@protoc_insertion_point(field_mutable:tensorflow.serving.ModelSpec.name)
return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
::std::string* ModelSpec::release_name() {
// @@protoc_insertion_point(field_release:tensorflow.serving.ModelSpec.name)
return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
::std::string* ModelSpec::unsafe_arena_release_name() {
// @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.serving.ModelSpec.name)
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
}
void ModelSpec::set_allocated_name(::std::string* name) {
if (name != NULL) {
} else {
}
name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:tensorflow.serving.ModelSpec.name)
}
void ModelSpec::unsafe_arena_set_allocated_name(
::std::string* name) {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (name != NULL) {
} else {
}
name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
name, GetArenaNoVirtual());
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.serving.ModelSpec.name)
}
// optional .google.protobuf.Int64Value version = 2;
bool ModelSpec::has_version() const {
return this != internal_default_instance() && version_ != NULL;
}
void ModelSpec::clear_version() {
if (GetArenaNoVirtual() == NULL && version_ != NULL) delete version_;
version_ = NULL;
}
const ::google::protobuf::Int64Value& ModelSpec::version() const {
// @@protoc_insertion_point(field_get:tensorflow.serving.ModelSpec.version)
return version_ != NULL ? *version_
: *::google::protobuf::Int64Value::internal_default_instance();
}
::google::protobuf::Int64Value* ModelSpec::mutable_version() {
if (version_ == NULL) {
_slow_mutable_version();
}
// @@protoc_insertion_point(field_mutable:tensorflow.serving.ModelSpec.version)
return version_;
}
::google::protobuf::Int64Value* ModelSpec::release_version() {
// @@protoc_insertion_point(field_release:tensorflow.serving.ModelSpec.version)
if (GetArenaNoVirtual() != NULL) {
return _slow_release_version();
} else {
::google::protobuf::Int64Value* temp = version_;
version_ = NULL;
return temp;
}
}
void ModelSpec::set_allocated_version(::google::protobuf::Int64Value* version) {
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == NULL) {
delete version_;
}
if (version != NULL) {
_slow_set_allocated_version(message_arena, &version);
}
version_ = version;
if (version) {
} else {
}
// @@protoc_insertion_point(field_set_allocated:tensorflow.serving.ModelSpec.version)
}
// optional string signature_name = 3;
void ModelSpec::clear_signature_name() {
signature_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
const ::std::string& ModelSpec::signature_name() const {
// @@protoc_insertion_point(field_get:tensorflow.serving.ModelSpec.signature_name)
return signature_name_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
void ModelSpec::set_signature_name(const ::std::string& value) {
signature_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:tensorflow.serving.ModelSpec.signature_name)
}
void ModelSpec::set_signature_name(const char* value) {
signature_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:tensorflow.serving.ModelSpec.signature_name)
}
void ModelSpec::set_signature_name(const char* value,
size_t size) {
signature_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:tensorflow.serving.ModelSpec.signature_name)
}
::std::string* ModelSpec::mutable_signature_name() {
// @@protoc_insertion_point(field_mutable:tensorflow.serving.ModelSpec.signature_name)
return signature_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
::std::string* ModelSpec::release_signature_name() {
// @@protoc_insertion_point(field_release:tensorflow.serving.ModelSpec.signature_name)
return signature_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
::std::string* ModelSpec::unsafe_arena_release_signature_name() {
// @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.serving.ModelSpec.signature_name)
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
return signature_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
}
void ModelSpec::set_allocated_signature_name(::std::string* signature_name) {
if (signature_name != NULL) {
} else {
}
signature_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), signature_name,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:tensorflow.serving.ModelSpec.signature_name)
}
void ModelSpec::unsafe_arena_set_allocated_signature_name(
::std::string* signature_name) {
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
if (signature_name != NULL) {
} else {
}
signature_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
signature_name, GetArenaNoVirtual());
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.serving.ModelSpec.signature_name)
}
inline const ModelSpec* ModelSpec::internal_default_instance() {
return &ModelSpec_default_instance_.get();
}
#endif // PROTOBUF_INLINE_NOT_IN_HEADERS
// @@protoc_insertion_point(namespace_scope)
} // namespace serving
} // namespace tensorflow
// @@protoc_insertion_point(global_scope)
|
// Copyright (c) 2011-2015 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "walletmodeltransaction.h"
#include "policy/policy.h"
#include "wallet/wallet.h"
WalletModelTransaction::WalletModelTransaction(const QList<SendCoinsRecipient> &recipients) :
recipients(recipients),
walletTransaction(0),
keyChange(0),
fee(0)
{
walletTransaction = new CWalletTx();
}
WalletModelTransaction::~WalletModelTransaction()
{
delete keyChange;
delete walletTransaction;
}
QList<SendCoinsRecipient> WalletModelTransaction::getRecipients()
{
return recipients;
}
CWalletTx *WalletModelTransaction::getTransaction()
{
return walletTransaction;
}
unsigned int WalletModelTransaction::getTransactionSize()
{
return (!walletTransaction ? 0 : ::GetVirtualTransactionSize(*walletTransaction));
}
CAmount WalletModelTransaction::getTransactionFee()
{
return fee;
}
void WalletModelTransaction::setTransactionFee(const CAmount& newFee)
{
fee = newFee;
}
void WalletModelTransaction::reassignAmounts(int nChangePosRet)
{
int i = 0;
for (QList<SendCoinsRecipient>::iterator it = recipients.begin(); it != recipients.end(); ++it)
{
SendCoinsRecipient& rcp = (*it);
if (rcp.paymentRequest.IsInitialized())
{
CAmount subtotal = 0;
const payments::PaymentDetails& details = rcp.paymentRequest.getDetails();
for (int j = 0; j < details.outputs_size(); j++)
{
const payments::Output& out = details.outputs(j);
if (out.amount() <= 0) continue;
if (i == nChangePosRet)
i++;
subtotal += walletTransaction->vout[i].nValue;
i++;
}
rcp.amount = subtotal;
}
else // normal recipient (no payment request)
{
if (i == nChangePosRet)
i++;
rcp.amount = walletTransaction->vout[i].nValue;
i++;
}
}
}
CAmount WalletModelTransaction::getTotalTransactionAmount()
{
CAmount totalTransactionAmount = 0;
Q_FOREACH(const SendCoinsRecipient &rcp, recipients)
{
totalTransactionAmount += rcp.amount;
}
return totalTransactionAmount;
}
void WalletModelTransaction::newPossibleKeyChange(CWallet *wallet)
{
keyChange = new CReserveKey(wallet);
}
CReserveKey *WalletModelTransaction::getPossibleKeyChange()
{
return keyChange;
}
|
/* Copyright 2022 Matteo Grasso
*
* 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.
*/
#include <AzCore/Memory/SystemAllocator.h>
#include <AzCore/Module/Module.h>
#include "Components/MainComponent.hpp"
namespace Loherangrin::Gems::DateTime
{
class DateTimeCppExampleModule
: public AZ::Module
{
public:
AZ_RTTI(DateTimeCppExampleModule, "{AB51F23D-5E0E-453C-A517-0FD74A94F7E9}", AZ::Module);
AZ_CLASS_ALLOCATOR(DateTimeCppExampleModule, AZ::SystemAllocator, 0);
DateTimeCppExampleModule()
: AZ::Module()
{
m_descriptors.insert(m_descriptors.end(),
{
MainComponent::CreateDescriptor()
});
}
AZ::ComponentTypeList GetRequiredSystemComponents() const override
{
return AZ::ComponentTypeList {};
}
};
} // Loherangrin::Gems::DateTime
AZ_DECLARE_MODULE_CLASS(Gem_Loherangrin_DateTime_CppExample, Loherangrin::Gems::DateTime::DateTimeCppExampleModule)
|
;*****************************************************
;
; Video Technology library for small C compiler
;
; Juergen Buchmueller
;
;*****************************************************
; ----- void __CALLEE__ vz_soundcopy_callee(char *dst, char *src, int size, int sound1, int sound2);
XLIB vz_soundcopy_callee
XDEF ASMDISP_VZ_SOUNDCOPY_CALLEE
XREF _std_seed
.vz_soundcopy_callee
pop af
pop bc
pop de
ld b,e
exx
pop bc
pop hl
pop de
push af
exx
; bc' = int size
; hl' = char *src
; de' = char *dst
; c = sound 2
; b = sound 1
.asmentry
ld e,c
ld d,b
ld hl,(_std_seed)
ld a,b
or c ; both off?
exx
ld a,($783b) ; get latch data
jp nz, soundcopy1 ; sound is on
ldir
ret
.soundcopy1
exx
inc d ; tone ?
dec d
jr z, soundcopy2 ; nope, skip
dec d ; counted down?
jr nz, soundcopy2 ; nope
ld d,b ; reset counter
xor $21 ; toggle output
ld ($6800),a
.soundcopy2
inc e ; noise ?
dec e
jr z, soundcopy3 ; nope, skip
dec e ; counted down?
jr nz, soundcopy3 ; nope
ld e,c ; reset counter
add hl,hl ; rotate 16 random bits
jr nc, soundcopy3 ; not set
inc l ; set bit 0 agaon
xor $21 ; toggle output
ld ($6800),a
.soundcopy3
exx
ldi ; transfer 4 bytes
ldi
ldi
ldi
jp pe, soundcopy1 ; until done
ld ($783b),a
ret
DEFC ASMDISP_VZ_SOUNDCOPY_CALLEE = asmentry - vz_soundcopy_callee
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.