os-k/obj/kaleid/kernel/io/terminal.S

847 lines
14 KiB
ArmAsm
Raw Normal View History

2019-01-02 16:33:29 +01:00
.file "terminal.c"
.text
.section .rodata.str1.1,"aMS",@progbits,1
.LC0:
.string "kaleid/kernel/io/terminal.c"
.LC1:
.string "kt->kt_init == INITOK"
.section .rodata.str1.8,"aMS",@progbits,1
.align 8
.LC2:
.string "(&(kt)->kt_lock)->lk_init == INITOK"
.align 8
.LC3:
.string "DosAquireLock on an already locked object"
.align 8
.LC4:
.string "DosReleaseLock on an unlocked object"
.text
.p2align 4,,15
.globl ClearTerm
.type ClearTerm, @function
ClearTerm:
.LFB3:
.cfi_startproc
testq %rdi, %rdi
je .L10
pushq %rbx
.cfi_def_cfa_offset 16
.cfi_offset 3, -16
cmpl $-889275714, 80(%rdi)
movq %rdi, %rbx
jne .L26
/APP
# 69 "kaleid/kernel/io/terminal.c" 1
cli
# 0 "" 2
/NO_APP
cmpl $-889275714, 24(%rdi)
jne .L27
movl 4(%rdi), %eax
leal 1(%rax), %edx
testl %eax, %eax
movl %edx, 4(%rdi)
jne .L28
.L5:
/APP
# 69 "kaleid/kernel/io/terminal.c" 1
sti
# 0 "" 2
/NO_APP
movq 48(%rbx), %rcx
movzbl 40(%rbx), %edx
imulq 56(%rbx), %rcx
sall $8, %edx
orl $32, %edx
testq %rcx, %rcx
je .L6
movq 32(%rbx), %rax
leaq (%rax,%rcx,2), %rcx
.p2align 4,,10
.p2align 3
.L7:
movw %dx, (%rax)
addq $2, %rax
cmpq %rax, %rcx
jne .L7
.L6:
movq $0, 72(%rbx)
movq $0, 64(%rbx)
/APP
# 71 "kaleid/kernel/io/terminal.c" 1
cli
# 0 "" 2
/NO_APP
cmpl $-889275714, 24(%rbx)
jne .L29
movl 4(%rbx), %eax
leal 1(%rax), %edx
testl %eax, %eax
movl %edx, 4(%rbx)
jne .L30
.L9:
/APP
# 71 "kaleid/kernel/io/terminal.c" 1
sti
# 0 "" 2
/NO_APP
xorl %eax, %eax
popq %rbx
.cfi_remember_state
.cfi_restore 3
.cfi_def_cfa_offset 8
ret
.p2align 4,,10
.p2align 3
.L30:
.cfi_restore_state
movabsq $.LC4, %rdi
xorl %eax, %eax
movabsq $StartPanic, %rdx
call *%rdx
jmp .L9
.p2align 4,,10
.p2align 3
.L28:
movabsq $.LC3, %rdi
xorl %eax, %eax
movabsq $StartPanic, %rdx
call *%rdx
jmp .L5
.p2align 4,,10
.p2align 3
.L26:
movabsq $__func__.1202, %rcx
movl $67, %edx
movabsq $.LC0, %rsi
movabsq $.LC1, %rdi
movabsq $_assert_handler, %rax
call *%rax
.p2align 4,,10
.p2align 3
.L27:
movabsq $__func__.1202, %rcx
movl $69, %edx
movabsq $.LC0, %rsi
movabsq $.LC2, %rdi
movabsq $_assert_handler, %rax
call *%rax
.p2align 4,,10
.p2align 3
.L29:
movabsq $__func__.1202, %rcx
movl $71, %edx
movabsq $.LC0, %rsi
movabsq $.LC2, %rdi
movabsq $_assert_handler, %rax
call *%rax
.L10:
.cfi_def_cfa_offset 8
.cfi_restore 3
movq $-6, %rax
ret
.cfi_endproc
.LFE3:
.size ClearTerm, .-ClearTerm
.section .rodata.str1.8
.align 8
.LC5:
.string "!stdout && _vga_term.kt_init != INITOK"
.text
.p2align 4,,15
.globl InitTerms
.type InitTerms, @function
InitTerms:
.LFB2:
.cfi_startproc
movabsq $stdout, %rdx
cmpq $0, (%rdx)
jne .L32
movabsq $_vga_term, %rdi
cmpl $-889275714, 80(%rdi)
je .L32
movabsq $_vga_term+80, %rax
movq %rdi, (%rdx)
movl $-889275714, (%rax)
movq %rdi, %rax
movabsq %rax, stddbg
movabsq $ClearTerm, %rax
jmp *%rax
.p2align 4,,10
.p2align 3
.L32:
subq $8, %rsp
.cfi_def_cfa_offset 16
movabsq $__func__.1198, %rcx
movl $49, %edx
movabsq $.LC0, %rsi
movabsq $.LC5, %rdi
movabsq $_assert_handler, %rax
call *%rax
.cfi_endproc
.LFE2:
.size InitTerms, .-InitTerms
.p2align 4,,15
.globl ChTermColor
.type ChTermColor, @function
ChTermColor:
.LFB4:
.cfi_startproc
cmpb $15, %sil
ja .L42
testq %rdi, %rdi
je .L43
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
pushq %rbx
.cfi_def_cfa_offset 24
.cfi_offset 3, -24
movl %esi, %ebp
movq %rdi, %rbx
subq $8, %rsp
.cfi_def_cfa_offset 32
/APP
# 87 "kaleid/kernel/io/terminal.c" 1
cli
# 0 "" 2
/NO_APP
cmpl $-889275714, 24(%rdi)
jne .L54
movl 4(%rdi), %eax
leal 1(%rax), %edx
testl %eax, %eax
movl %edx, 4(%rdi)
jne .L55
.L39:
/APP
# 87 "kaleid/kernel/io/terminal.c" 1
sti
# 0 "" 2
/NO_APP
movb %bpl, 40(%rbx)
/APP
# 89 "kaleid/kernel/io/terminal.c" 1
cli
# 0 "" 2
/NO_APP
cmpl $-889275714, 24(%rbx)
jne .L56
movl 4(%rbx), %eax
leal 1(%rax), %edx
testl %eax, %eax
movl %edx, 4(%rbx)
jne .L57
.L41:
/APP
# 89 "kaleid/kernel/io/terminal.c" 1
sti
# 0 "" 2
/NO_APP
addq $8, %rsp
.cfi_remember_state
.cfi_def_cfa_offset 24
xorl %eax, %eax
popq %rbx
.cfi_restore 3
.cfi_def_cfa_offset 16
popq %rbp
.cfi_restore 6
.cfi_def_cfa_offset 8
ret
.p2align 4,,10
.p2align 3
.L55:
.cfi_restore_state
movabsq $.LC3, %rdi
xorl %eax, %eax
movabsq $StartPanic, %rdx
call *%rdx
jmp .L39
.p2align 4,,10
.p2align 3
.L57:
movabsq $.LC4, %rdi
xorl %eax, %eax
movabsq $StartPanic, %rdx
call *%rdx
jmp .L41
.p2align 4,,10
.p2align 3
.L54:
movabsq $__func__.1210, %rcx
movl $87, %edx
movabsq $.LC0, %rsi
movabsq $.LC2, %rdi
movabsq $_assert_handler, %rax
call *%rax
.p2align 4,,10
.p2align 3
.L56:
movabsq $__func__.1210, %rcx
movl $89, %edx
movabsq $.LC0, %rsi
movabsq $.LC2, %rdi
movabsq $_assert_handler, %rax
call *%rax
.p2align 4,,10
.p2align 3
.L42:
.cfi_def_cfa_offset 8
.cfi_restore 3
.cfi_restore 6
movq $-5, %rax
ret
.L43:
movq $-6, %rax
ret
.cfi_endproc
.LFE4:
.size ChTermColor, .-ChTermColor
.p2align 4,,15
.globl ClearTermUnlocked
.type ClearTermUnlocked, @function
ClearTermUnlocked:
.LFB7:
.cfi_startproc
movq 48(%rdi), %rcx
movzbl 40(%rdi), %edx
imulq 56(%rdi), %rcx
sall $8, %edx
orl $32, %edx
testq %rcx, %rcx
je .L59
movq 32(%rdi), %rax
leaq (%rax,%rcx,2), %rcx
.p2align 4,,10
.p2align 3
.L60:
movw %dx, (%rax)
addq $2, %rax
cmpq %rcx, %rax
jne .L60
.L59:
movq $0, 72(%rdi)
movq $0, 64(%rdi)
ret
.cfi_endproc
.LFE7:
.size ClearTermUnlocked, .-ClearTermUnlocked
.p2align 4,,15
.globl PutOnTermUnlocked
.type PutOnTermUnlocked, @function
PutOnTermUnlocked:
.LFB8:
.cfi_startproc
cmpb $13, %sil
je .L69
movsbl %sil, %esi
movabsq $PutOnTermUnlocked.part.0, %rax
jmp *%rax
.p2align 4,,10
.p2align 3
.L69:
movq $0, 64(%rdi)
ret
.cfi_endproc
.LFE8:
.size PutOnTermUnlocked, .-PutOnTermUnlocked
.p2align 4,,15
.type PutOnTermUnlocked.part.0, @function
PutOnTermUnlocked.part.0:
.LFB10:
.cfi_startproc
pushq %r13
.cfi_def_cfa_offset 16
.cfi_offset 13, -16
pushq %r12
.cfi_def_cfa_offset 24
.cfi_offset 12, -24
pushq %rbp
.cfi_def_cfa_offset 32
.cfi_offset 6, -32
pushq %rbx
.cfi_def_cfa_offset 40
.cfi_offset 3, -40
movq %rdi, %rbx
subq $8, %rsp
.cfi_def_cfa_offset 48
cmpb $10, %sil
je .L81
cmpb $9, %sil
movq 72(%rdi), %rbp
je .L82
movq 48(%rdi), %rdx
movzbl 40(%rbx), %ecx
movsbw %sil, %si
movq 64(%rdi), %rax
movq 32(%rdi), %rdi
imulq %rdx, %rbp
sall $8, %ecx
orl %ecx, %esi
addq %rax, %rbp
movw %si, (%rdi,%rbp,2)
.L72:
addq $1, %rax
cmpq %rdx, %rax
je .L77
movq %rax, 64(%rbx)
.L70:
addq $8, %rsp
.cfi_remember_state
.cfi_def_cfa_offset 40
popq %rbx
.cfi_restore 3
.cfi_def_cfa_offset 32
popq %rbp
.cfi_restore 6
.cfi_def_cfa_offset 24
popq %r12
.cfi_restore 12
.cfi_def_cfa_offset 16
popq %r13
.cfi_restore 13
.cfi_def_cfa_offset 8
ret
.p2align 4,,10
.p2align 3
.L82:
.cfi_restore_state
movq %rbp, %rax
movl $4, %r12d
movabsq $PutOnTermUnlocked, %r13
cmpq %rbp, %rax
je .L83
.L74:
subl $1, %r12d
je .L84
movq 72(%rbx), %rax
cmpq %rbp, %rax
jne .L74
.L83:
movl $32, %esi
movq %rbx, %rdi
call *%r13
jmp .L74
.p2align 4,,10
.p2align 3
.L77:
movq 72(%rbx), %rax
movq $0, 64(%rbx)
addq $1, %rax
cmpq 56(%rbx), %rax
movq %rax, 72(%rbx)
jne .L70
movq $0, 72(%rbx)
addq $8, %rsp
.cfi_remember_state
.cfi_def_cfa_offset 40
popq %rbx
.cfi_restore 3
.cfi_def_cfa_offset 32
popq %rbp
.cfi_restore 6
.cfi_def_cfa_offset 24
popq %r12
.cfi_restore 12
.cfi_def_cfa_offset 16
popq %r13
.cfi_restore 13
.cfi_def_cfa_offset 8
ret
.p2align 4,,10
.p2align 3
.L81:
.cfi_restore_state
movq 48(%rdi), %rdx
leaq -1(%rdx), %rax
movq %rax, 72(%rdi)
movq 64(%rdi), %rax
jmp .L72
.p2align 4,,10
.p2align 3
.L84:
movq 64(%rbx), %rax
movq 48(%rbx), %rdx
jmp .L72
.cfi_endproc
.LFE10:
.size PutOnTermUnlocked.part.0, .-PutOnTermUnlocked.part.0
.p2align 4,,15
.globl PutOnTerm
.type PutOnTerm, @function
PutOnTerm:
.LFB5:
.cfi_startproc
testq %rdi, %rdi
je .L94
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
pushq %rbx
.cfi_def_cfa_offset 24
.cfi_offset 3, -24
movl %esi, %ebp
movq %rdi, %rbx
subq $8, %rsp
.cfi_def_cfa_offset 32
cmpl $-889275714, 80(%rdi)
jne .L105
/APP
# 104 "kaleid/kernel/io/terminal.c" 1
cli
# 0 "" 2
/NO_APP
cmpl $-889275714, 24(%rdi)
jne .L106
movl 4(%rdi), %eax
leal 1(%rax), %edx
testl %eax, %eax
movl %edx, 4(%rdi)
jne .L107
.L89:
/APP
# 104 "kaleid/kernel/io/terminal.c" 1
sti
# 0 "" 2
/NO_APP
cmpb $13, %bpl
jne .L90
movq $0, 64(%rbx)
.L91:
/APP
# 106 "kaleid/kernel/io/terminal.c" 1
cli
# 0 "" 2
/NO_APP
cmpl $-889275714, 24(%rbx)
jne .L108
movl 4(%rbx), %eax
leal 1(%rax), %edx
testl %eax, %eax
movl %edx, 4(%rbx)
jne .L109
.L93:
/APP
# 106 "kaleid/kernel/io/terminal.c" 1
sti
# 0 "" 2
/NO_APP
addq $8, %rsp
.cfi_remember_state
.cfi_def_cfa_offset 24
xorl %eax, %eax
popq %rbx
.cfi_restore 3
.cfi_def_cfa_offset 16
popq %rbp
.cfi_restore 6
.cfi_def_cfa_offset 8
ret
.p2align 4,,10
.p2align 3
.L90:
.cfi_restore_state
movsbl %bpl, %esi
movq %rbx, %rdi
movabsq $PutOnTermUnlocked.part.0, %rax
call *%rax
jmp .L91
.p2align 4,,10
.p2align 3
.L107:
movabsq $.LC3, %rdi
xorl %eax, %eax
movabsq $StartPanic, %rdx
call *%rdx
jmp .L89
.p2align 4,,10
.p2align 3
.L109:
movabsq $.LC4, %rdi
xorl %eax, %eax
movabsq $StartPanic, %rdx
call *%rdx
jmp .L93
.p2align 4,,10
.p2align 3
.L105:
movabsq $__func__.1217, %rcx
movl $102, %edx
movabsq $.LC0, %rsi
movabsq $.LC1, %rdi
movabsq $_assert_handler, %rax
call *%rax
.p2align 4,,10
.p2align 3
.L106:
movabsq $__func__.1217, %rcx
movl $104, %edx
movabsq $.LC0, %rsi
movabsq $.LC2, %rdi
movabsq $_assert_handler, %rax
call *%rax
.p2align 4,,10
.p2align 3
.L108:
movabsq $__func__.1217, %rcx
movl $106, %edx
movabsq $.LC0, %rsi
movabsq $.LC2, %rdi
movabsq $_assert_handler, %rax
call *%rax
.L94:
.cfi_def_cfa_offset 8
.cfi_restore 3
.cfi_restore 6
movq $-6, %rax
ret
.cfi_endproc
.LFE5:
.size PutOnTerm, .-PutOnTerm
.p2align 4,,15
.globl PrintOnTerm
.type PrintOnTerm, @function
PrintOnTerm:
.LFB6:
.cfi_startproc
testq %rdi, %rdi
je .L121
pushq %r12
.cfi_def_cfa_offset 16
.cfi_offset 12, -16
pushq %rbp
.cfi_def_cfa_offset 24
.cfi_offset 6, -24
movq %rdi, %rbp
pushq %rbx
.cfi_def_cfa_offset 32
.cfi_offset 3, -32
cmpl $-889275714, 80(%rdi)
jne .L132
/APP
# 121 "kaleid/kernel/io/terminal.c" 1
cli
# 0 "" 2
/NO_APP
cmpl $-889275714, 24(%rdi)
jne .L133
movl 4(%rdi), %eax
movq %rsi, %rbx
leal 1(%rax), %edx
testl %eax, %eax
movl %edx, 4(%rdi)
jne .L134
.L114:
/APP
# 121 "kaleid/kernel/io/terminal.c" 1
sti
# 0 "" 2
/NO_APP
movabsq $PutOnTermUnlocked.part.0, %r12
.L115:
movsbl (%rbx), %esi
testb %sil, %sil
je .L135
.L118:
addq $1, %rbx
cmpb $13, %sil
jne .L116
movq $0, 64(%rbp)
movsbl (%rbx), %esi
testb %sil, %sil
jne .L118
.L135:
/APP
# 125 "kaleid/kernel/io/terminal.c" 1
cli
# 0 "" 2
/NO_APP
cmpl $-889275714, 24(%rbp)
jne .L136
movl 4(%rbp), %eax
leal 1(%rax), %edx
testl %eax, %eax
movl %edx, 4(%rbp)
jne .L137
.L120:
/APP
# 125 "kaleid/kernel/io/terminal.c" 1
sti
# 0 "" 2
/NO_APP
xorl %eax, %eax
popq %rbx
.cfi_remember_state
.cfi_restore 3
.cfi_def_cfa_offset 24
popq %rbp
.cfi_restore 6
.cfi_def_cfa_offset 16
popq %r12
.cfi_restore 12
.cfi_def_cfa_offset 8
ret
.p2align 4,,10
.p2align 3
.L116:
.cfi_restore_state
movq %rbp, %rdi
call *%r12
jmp .L115
.p2align 4,,10
.p2align 3
.L137:
movabsq $.LC4, %rdi
xorl %eax, %eax
movabsq $StartPanic, %rdx
call *%rdx
jmp .L120
.p2align 4,,10
.p2align 3
.L134:
movabsq $.LC3, %rdi
xorl %eax, %eax
movabsq $StartPanic, %rdx
call *%rdx
jmp .L114
.p2align 4,,10
.p2align 3
.L132:
movabsq $__func__.1224, %rcx
movl $119, %edx
movabsq $.LC0, %rsi
movabsq $.LC1, %rdi
movabsq $_assert_handler, %rax
call *%rax
.p2align 4,,10
.p2align 3
.L133:
movabsq $__func__.1224, %rcx
movl $121, %edx
movabsq $.LC0, %rsi
movabsq $.LC2, %rdi
movabsq $_assert_handler, %rax
call *%rax
.p2align 4,,10
.p2align 3
.L136:
movabsq $__func__.1224, %rcx
movl $125, %edx
movabsq $.LC0, %rsi
movabsq $.LC2, %rdi
movabsq $_assert_handler, %rax
call *%rax
.L121:
.cfi_def_cfa_offset 8
.cfi_restore 3
.cfi_restore 6
.cfi_restore 12
movq $-6, %rax
ret
.cfi_endproc
.LFE6:
.size PrintOnTerm, .-PrintOnTerm
.p2align 4,,15
.globl PrintOnTermUnlocked
.type PrintOnTermUnlocked, @function
PrintOnTermUnlocked:
.LFB9:
.cfi_startproc
pushq %r12
.cfi_def_cfa_offset 16
.cfi_offset 12, -16
movabsq $PutOnTermUnlocked.part.0, %r12
pushq %rbp
.cfi_def_cfa_offset 24
.cfi_offset 6, -24
movq %rdi, %rbp
pushq %rbx
.cfi_def_cfa_offset 32
.cfi_offset 3, -32
movq %rsi, %rbx
.L139:
movsbl (%rbx), %esi
testb %sil, %sil
je .L144
.L142:
addq $1, %rbx
cmpb $13, %sil
jne .L140
movq $0, 64(%rbp)
movsbl (%rbx), %esi
testb %sil, %sil
jne .L142
.L144:
popq %rbx
.cfi_remember_state
.cfi_restore 3
.cfi_def_cfa_offset 24
popq %rbp
.cfi_restore 6
.cfi_def_cfa_offset 16
popq %r12
.cfi_restore 12
.cfi_def_cfa_offset 8
ret
.p2align 4,,10
.p2align 3
.L140:
.cfi_restore_state
movq %rbp, %rdi
call *%r12
jmp .L139
.cfi_endproc
.LFE9:
.size PrintOnTermUnlocked, .-PrintOnTermUnlocked
.section .rodata
.align 8
.type __func__.1224, @object
.size __func__.1224, 12
__func__.1224:
.string "PrintOnTerm"
.align 8
.type __func__.1217, @object
.size __func__.1217, 10
__func__.1217:
.string "PutOnTerm"
.align 8
.type __func__.1210, @object
.size __func__.1210, 12
__func__.1210:
.string "ChTermColor"
.align 8
.type __func__.1202, @object
.size __func__.1202, 10
__func__.1202:
.string "ClearTerm"
.align 8
.type __func__.1198, @object
.size __func__.1198, 10
__func__.1198:
.string "InitTerms"
.comm stddbg,8,8
.comm stdout,8,8
.data
.align 32
.type _vga_term, @object
.size _vga_term, 88
_vga_term:
.byte 0
.zero 3
.long 0
.quad 0
.quad 0
.long -889275714
.zero 4
.quad 753664
.byte 7
.zero 7
.quad 80
.quad 25
.quad 0
.quad 0
.long 0
.zero 4
.ident "GCC: (GNU) 7.3.0"