Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Called by:
- # commConnectHandle
- # commClose
- # commUpdateEvents
- 00000000004a7070 <commSetEvents>:
- 4a7070: mov %rbx,-0x28(%rsp)
- 4a7075: mov %rbp,-0x20(%rsp)
- 4a707a: mov %edi,%ebp # ebp: fd
- 4a707c: mov %r12,-0x18(%rsp)
- 4a7081: mov %r13,-0x10(%rsp)
- 4a7086: mov %esi,%r12d # r12d: need_read
- 4a7089: mov %r14,-0x8(%rsp)
- 4a708e: sub $0x28,%rsp
- #
- # int st_new = (need_read ? STATE_READ : 0) |
- # (need_write ? STATE_WRITE : 0);
- #
- 4a7092: cmp $0x1,%edx # edx: need_write
- 4a7095: sbb %ebx,%ebx
- 4a7097: xor %eax,%eax
- 4a7099: mov %edx,%r13d
- 4a709c: not %ebx
- 4a709e: and $0x2,%ebx
- 4a70a1: test %esi,%esi
- 4a70a3: setne %al
- 4a70a6: or %eax,%ebx # ebx: st_new
- #
- # assert(fd >= 0);
- #
- 4a70a8: test %edi,%edi
- 4a70aa: js 4a7221 <commSetEvents+0x1b1>
- #
- #Jump from 4a7235:
- #
- # debug(5, 8) ("commSetEvents(fd=%d, read=%d, write=%d)\n",
- # fd, need_read, need_write);
- #
- 4a70b0: cmpl $0x7,0x267c3d(%rip) # 70ecf4 <debugLevels+0x14>
- 4a70b7: movl $0x8,0x267daf(%rip) # 70ee70 <_db_level>
- 4a70c1: jg 4a7208 <commSetEvents+0x198>
- #
- #Jump from 4a721c:
- #
- # st_change = kqueue_state[fd] ^ st_new;
- #
- 4a70c7: mov 0x22e12a(%rip),%rcx # 6d51f8 <kqueue_state.33801>
- 4a70ce: movslq %ebp,%rbp # rbp: fd
- 4a70d1: mov %ebx,%r14d # r14d: st_new
- 4a70d4: movzbl 0x0(%rbp,%rcx,1),%eax # eax: kqueue_state[fd]
- 4a70d9: xor %eax,%r14d # r14d: st_change
- #
- # if (!st_change)
- # return;
- #
- 4a70dc: je 4a71b0 <commSetEvents+0x140>
- #
- # if (kqoff >= kqmax - 2) {
- #
- 4a70e2: mov 0x22e108(%rip),%edx # 6d51f0 <kqmax.33799>
- 4a70e8: lea -0x2(%rdx),%eax
- 4a70eb: cmp 0x22e103(%rip),%eax # 6d51f4 <kqoff.33800>
- 4a70f1: jg 4a7150 <commSetEvents+0xe0>
- 4a70f3: mov 0x1583ef(%rip),%eax # 5ff4e8 <Squid_MaxFD>
- #
- # kqmax = kqmax + KE_QUEUE_STEP;
- #
- 4a70f9: sub $0xffffff80,%edx # edx: kqmax + KE_QUEUE_STEP
- 4a70fc: mov %edx,0x22e0ee(%rip) # 6d51f0 <kqmax.33799>
- #
- # assert(kqmax < Squid_MaxFD * 4);
- #
- 4a7102: shl $0x2,%eax # eax: Squid_MaxFD * 4
- 4a7105: cmp %eax,%edx
- 4a7107: jge 4a7240 <commSetEvents+0x1d0>
- #
- # kqlst = xrealloc(kqlst, sizeof(*kqlst) * kqmax);
- #
- 4a710d: movslq 0x22e0dc(%rip),%rsi # 6d51f0 <kqmax.33799>
- 4a7114: mov 0x22e0c5(%rip),%rdi # 6d51e0 <kqlst.33797>
- 4a711b: shl $0x5,%rsi
- 4a711f: callq 4b9440 <xrealloc>
- #
- # ke = xrealloc(ke, sizeof(*ke) * kqmax);
- #
- 4a7124: movslq 0x22e0c5(%rip),%rsi # 6d51f0 <kqmax.33799>
- 4a712b: mov 0x22e0b6(%rip),%rdi # 6d51e8 <ke.33798>
- 4a7132: mov %rax,0x22e0a7(%rip) # 6d51e0 <kqlst.33797>
- 4a7139: shl $0x5,%rsi
- 4a713d: callq 4b9440 <xrealloc>
- 4a7142: mov 0x22e0af(%rip),%rcx # 6d51f8 <kqueue_state.33801>
- 4a7149: mov %rax,0x22e098(%rip) # 6d51e8 <ke.33798>
- #
- #Conditional Jump from 4a71b0
- #
- # }
- #
- # kep = kqlst + kqof;
- #
- 4a7150: mov 0x22e09e(%rip),%esi # 6d51f4 <kqoff.33800>
- 4a7156: movslq %esi,%rdx
- 4a7159: shl $0x5,%rdx
- 4a715d: add 0x22e07c(%rip),%rdx # 6d51e0 <kqlst.33797>
- # rdx: kep
- #
- # if (st_change & STATE_READ) {
- #
- 4a7164: test $0x1,%r14b
- 4a7168: je 4a71a6 <commSetEvents+0x136>
- #
- # EV_SET(kep, (uintptr_t) fd, EVFILT_READ,
- # need_read ? EV_ADD : EV_DELETE, 0, 0, 0);
- #
- 4a716a: cmp $0x1,%r12d # r12d: need_read
- 4a716e: movl $0x0,0xc(%rdx)
- 4a7175: mov %rbp,(%rdx)
- 4a7178: sbb %eax,%eax
- 4a717a: movw $0xffff,0x8(%rdx)
- 4a7180: movq $0x0,0x10(%rdx)
- 4a7188: not %eax
- 4a718a: movq $0x0,0x18(%rdx)
- 4a7192: add $0x2,%eax
- 4a7195: mov %ax,0xa(%rdx)
- 4a7199: lea 0x1(%rsi),%eax
- 4a719c: add $0x20,%rdx # kep++;
- 4a71a0: mov %eax,0x22e04e(%rip) # 6d51f4 <kqoff.33800>
- #
- #Conditional Jump from 4a7168
- #
- # }
- #
- # if ( ! (st_change & STATE_WRITE) ) {
- #
- 4a71a6: and $0x2,%r14d
- 4a71aa: jne 4a71d0 <commSetEvents+0x160>
- #
- #Jump from 4a7206
- #
- #save_state_return:;
- #
- # kqueue_state[fd] = st_new;
- #
- 4a71ac: mov %bl,0x0(%rbp,%rcx,1)
- #
- #Restore registers and return
- #
- 4a71b0: mov (%rsp),%rbx
- 4a71b4: mov 0x8(%rsp),%rbp
- 4a71b9: mov 0x10(%rsp),%r12
- 4a71be: mov 0x18(%rsp),%r13
- 4a71c3: mov 0x20(%rsp),%r14
- 4a71c8: add $0x28,%rsp
- 4a71cc: retq
- #
- #Conditional Jump from 4a71aa
- #
- # }
- #
- # EV_SET(kep, (uintptr_t) fd, EVFILT_WRITE,
- # need_write ? EV_ADD : EV_DELETE, 0, 0, 0);
- #
- 4a71d0: cmp $0x1,%r13d # r13d: need_write
- 4a71d4: movl $0x0,0xc(%rdx)
- 4a71db: mov %rbp,(%rdx)
- 4a71de: sbb %eax,%eax
- 4a71e0: addl $0x1,0x22e00d(%rip) # 6d51f4 <kqoff.33800>
- 4a71e7: movw $0xfffe,0x8(%rdx)
- 4a71ed: not %eax
- 4a71ef: movq $0x0,0x10(%rdx)
- 4a71f7: movq $0x0,0x18(%rdx)
- 4a71ff: add $0x2,%eax
- 4a7202: mov %ax,0xa(%rdx)
- #
- # goto save_state_return;
- #
- 4a7206: jmp 4a71ac <commSetEvents+0x13c>
- ##
- #
- #Conditional Jump from 4a70c1
- #
- 4a7208: mov %r13d,%ecx
- 4a720b: mov %r12d,%edx
- 4a720e: mov %ebp,%esi
- 4a7210: mov $0x4f1760,%edi
- 4a7215: xor %eax,%eax
- 4a7217: callq 49b720 <_db_print>
- 4a721c: jmpq 4a70c7 <commSetEvents+0x57>
- ##
- #
- #Conditional Jump from 4a70aa
- #
- 4a7221: mov $0x77,%edx
- 4a7226: mov $0x4f2b1d,%esi
- 4a722b: mov $0x4e701d,%edi
- 4a7230: callq 49b8b0 <xassert>
- 4a7235: jmpq 4a70b0 <commSetEvents+0x40>
- ##
- #
- #Conditional Jump from 4a7107
- #
- 4a7240: mov $0x81,%edx
- 4a7245: mov $0x4f2b1d,%esi
- 4a724a: mov $0x4f2b2b,%edi
- 4a724f: callq 49b8b0 <xassert>
Advertisement
Add Comment
Please, Sign In to add comment