1#------------------------------------------------------------------------------ 2# 3# Manage differenced between UNIX ABI and EFI/Windows ABI 4# 5# For IA-32 the only difference is Mac OS X requires a 16-byte aligned stack. 6# For Linux this stack adjustment is a no-op, but we may as well make the 7# the code common. 8# 9# Copyright (c) 2008 - 2011, Apple Inc. All rights reserved.<BR> 10# This program and the accompanying materials 11# are licensed and made available under the terms and conditions of the BSD License 12# which accompanies this distribution. The full text of the license may be found at 13# http://opensource.org/licenses/bsd-license.php 14# 15# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 16# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 17# 18#------------------------------------------------------------------------------ 19 20 21 22 .text 23 24// 25// EMU_THUNK_PROTOCOL gaskets (EFIAPI to UNIX ABI) 26// 27 28 29ASM_GLOBAL ASM_PFX(GasketSecWriteStdErr) 30ASM_PFX(GasketSecWriteStdErr): 31 pushl %ebp 32 movl %esp, %ebp 33 subl $24, %esp // sub extra 16 from the stack for alignment 34 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 35 movl 12(%ebp), %eax 36 movl %eax, 4(%esp) 37 movl 8(%ebp), %eax 38 movl %eax, (%esp) 39 40 call ASM_PFX(SecWriteStdErr) 41 42 leave 43 ret 44 45 46ASM_GLOBAL ASM_PFX(GasketSecConfigStdIn) 47ASM_PFX(GasketSecConfigStdIn): 48 pushl %ebp 49 movl %esp, %ebp 50 subl $24, %esp // sub extra 16 from the stack for alignment 51 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 52 movl 12(%ebp), %eax 53 movl %eax, 4(%esp) 54 movl 8(%ebp), %eax 55 movl %eax, (%esp) 56 57 call ASM_PFX(SecConfigStdIn) 58 59 leave 60 ret 61 62ASM_GLOBAL ASM_PFX(GasketSecWriteStdOut) 63ASM_PFX(GasketSecWriteStdOut): 64 pushl %ebp 65 movl %esp, %ebp 66 subl $24, %esp // sub extra 16 from the stack for alignment 67 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 68 movl 12(%ebp), %eax 69 movl %eax, 4(%esp) 70 movl 8(%ebp), %eax 71 movl %eax, (%esp) 72 73 call ASM_PFX(SecWriteStdOut) 74 75 leave 76 ret 77 78ASM_GLOBAL ASM_PFX(GasketSecReadStdIn) 79ASM_PFX(GasketSecReadStdIn): 80 pushl %ebp 81 movl %esp, %ebp 82 subl $24, %esp // sub extra 16 from the stack for alignment 83 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 84 movl 12(%ebp), %eax 85 movl %eax, 4(%esp) 86 movl 8(%ebp), %eax 87 movl %eax, (%esp) 88 89 call ASM_PFX(SecReadStdIn) 90 91 leave 92 ret 93 94ASM_GLOBAL ASM_PFX(GasketSecPollStdIn) 95ASM_PFX(GasketSecPollStdIn): 96 pushl %ebp 97 movl %esp, %ebp 98 subl $24, %esp // sub extra 16 from the stack for alignment 99 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 100 movl 12(%ebp), %eax 101 movl %eax, 4(%esp) 102 movl 8(%ebp), %eax 103 movl %eax, (%esp) 104 105 call ASM_PFX(SecPollStdIn) 106 107 leave 108 ret 109 110ASM_GLOBAL ASM_PFX(GasketSecMalloc) 111ASM_PFX(GasketSecMalloc): 112 pushl %ebp 113 movl %esp, %ebp 114 subl $24, %esp // sub extra 16 from the stack for alignment 115 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 116 movl 8(%ebp), %eax 117 movl %eax, (%esp) 118 119 call ASM_PFX(SecMalloc) 120 121 leave 122 ret 123 124ASM_GLOBAL ASM_PFX(GasketSecValloc) 125ASM_PFX(GasketSecValloc): 126 pushl %ebp 127 movl %esp, %ebp 128 subl $24, %esp // sub extra 16 from the stack for alignment 129 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 130 movl 8(%ebp), %eax 131 movl %eax, (%esp) 132 133 call ASM_PFX(SecValloc) 134 135 leave 136 ret 137 138ASM_GLOBAL ASM_PFX(GasketSecFree) 139ASM_PFX(GasketSecFree): 140 pushl %ebp 141 movl %esp, %ebp 142 subl $24, %esp // sub extra 16 from the stack for alignment 143 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 144 movl 8(%ebp), %eax 145 movl %eax, (%esp) 146 147 call ASM_PFX(SecFree) 148 149 leave 150 ret 151 152 153ASM_GLOBAL ASM_PFX(GasketSecSetTimer) 154ASM_PFX(GasketSecSetTimer): 155 pushl %ebp 156 movl %esp, %ebp 157 subl $40, %esp // sub extra 16 from the stack for alignment 158 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 159 movl 16(%ebp), %eax 160 movl %eax, 8(%esp) 161 movl 8(%ebp), %eax 162 movl 12(%ebp), %edx 163 movl %edx, 4(%esp) 164 movl %eax, (%esp) 165 166 call ASM_PFX(SecSetTimer) 167 168 leave 169 ret 170 171 172ASM_GLOBAL ASM_PFX(GasketSecEnableInterrupt) 173ASM_PFX(GasketSecEnableInterrupt): 174 pushl %ebp 175 movl %esp, %ebp 176 subl $24, %esp // sub extra 16 from the stack for alignment 177 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 178 179 call ASM_PFX(SecEnableInterrupt) 180 181 leave 182 ret 183 184 185ASM_GLOBAL ASM_PFX(GasketSecDisableInterrupt) 186ASM_PFX(GasketSecDisableInterrupt): 187 pushl %ebp 188 movl %esp, %ebp 189 subl $24, %esp // sub extra 16 from the stack for alignment 190 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 191 192 call ASM_PFX(SecDisableInterrupt) 193 194 leave 195 ret 196 197ASM_GLOBAL ASM_PFX(GasketQueryPerformanceFrequency) 198ASM_PFX(GasketQueryPerformanceFrequency): 199 pushl %ebp 200 movl %esp, %ebp 201 subl $24, %esp // sub extra 16 from the stack for alignment 202 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 203 204 call ASM_PFX(QueryPerformanceFrequency) 205 206 leave 207 ret 208 209 210ASM_GLOBAL ASM_PFX(GasketQueryPerformanceCounter) 211ASM_PFX(GasketQueryPerformanceCounter): 212 pushl %ebp 213 movl %esp, %ebp 214 subl $24, %esp // sub extra 16 from the stack for alignment 215 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 216 217 call ASM_PFX(QueryPerformanceCounter) 218 219 leave 220 ret 221 222 223ASM_GLOBAL ASM_PFX(GasketSecSleep) 224ASM_PFX(GasketSecSleep): 225 pushl %ebp 226 movl %esp, %ebp 227 subl $24, %esp // sub extra 16 from the stack for alignment 228 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 229 movl 8(%ebp), %eax 230 movl 12(%ebp), %ecx 231 movl %ecx, 4(%esp) 232 movl %eax, (%esp) 233 234 call ASM_PFX(SecSleep) 235 236 leave 237 ret 238 239 240ASM_GLOBAL ASM_PFX(GasketSecCpuSleep) 241ASM_PFX(GasketSecCpuSleep): 242 pushl %ebp 243 movl %esp, %ebp 244 subl $24, %esp // sub extra 16 from the stack for alignment 245 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 246 247 call ASM_PFX(SecCpuSleep) 248 249 leave 250 ret 251 252 253ASM_GLOBAL ASM_PFX(GasketSecExit) 254ASM_PFX(GasketSecExit): 255 pushl %ebp 256 movl %esp, %ebp 257 subl $24, %esp // sub extra 16 from the stack for alignment 258 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 259 movl 8(%ebp), %eax 260 movl %eax, (%esp) 261 262 call ASM_PFX(SecExit) // Less to do as we will never return to EFI ABI world 263LDEAD_LOOP: 264 jmp LDEAD_LOOP // _exit should never return 265 266 267ASM_GLOBAL ASM_PFX(GasketSecGetTime) 268ASM_PFX(GasketSecGetTime): 269 pushl %ebp 270 movl %esp, %ebp 271 subl $24, %esp // sub extra 16 from the stack for alignment 272 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 273 movl 12(%ebp), %eax 274 movl %eax, 4(%esp) 275 movl 8(%ebp), %eax 276 movl %eax, (%esp) 277 278 call ASM_PFX(SecGetTime) 279 280 leave 281 ret 282 283ASM_GLOBAL ASM_PFX(GasketSecSetTime) 284ASM_PFX(GasketSecSetTime): 285 pushl %ebp 286 movl %esp, %ebp 287 subl $24, %esp // sub extra 16 from the stack for alignment 288 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 289 movl 12(%ebp), %eax 290 movl %eax, 4(%esp) 291 movl 8(%ebp), %eax 292 movl %eax, (%esp) 293 294 call ASM_PFX(SecSetTime) 295 296 leave 297 ret 298 299 300ASM_GLOBAL ASM_PFX(GasketSecGetNextProtocol) 301ASM_PFX(GasketSecGetNextProtocol): 302 pushl %ebp 303 movl %esp, %ebp 304 subl $40, %esp // sub extra 16 from the stack for alignment 305 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 306 movl 20(%ebp), %eax 307 movl %eax, 12(%esp) 308 movl 16(%ebp), %eax 309 movl %eax, 8(%esp) 310 movl 12(%ebp), %eax 311 movl %eax, 4(%esp) 312 movl 8(%ebp), %eax 313 movl %eax, (%esp) 314 315 call ASM_PFX(SecGetNextProtocol) 316 317 leave 318 ret 319 320// PPIs produced by SEC 321 322ASM_GLOBAL ASM_PFX(GasketSecPeCoffGetEntryPoint) 323ASM_PFX(GasketSecPeCoffGetEntryPoint): 324 pushl %ebp 325 movl %esp, %ebp 326 subl $24, %esp // sub extra 16 from the stack for alignment 327 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 328 movl 12(%ebp), %eax 329 movl %eax, 4(%esp) 330 movl 8(%ebp), %eax 331 movl %eax, (%esp) 332 333 call ASM_PFX(SecPeCoffGetEntryPoint) 334 335 leave 336 ret 337 338ASM_GLOBAL ASM_PFX(GasketSecPeCoffRelocateImageExtraAction) 339ASM_PFX(GasketSecPeCoffRelocateImageExtraAction): 340 pushl %ebp 341 movl %esp, %ebp 342 subl $24, %esp // sub extra 16 from the stack for alignment 343 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 344 movl 8(%ebp), %eax 345 movl %eax, (%esp) 346 347 call ASM_PFX(SecPeCoffRelocateImageExtraAction) 348 349 leave 350 ret 351 352ASM_GLOBAL ASM_PFX(GasketSecPeCoffUnloadImageExtraAction) 353ASM_PFX(GasketSecPeCoffUnloadImageExtraAction): 354 pushl %ebp 355 movl %esp, %ebp 356 subl $24, %esp // sub extra 16 from the stack for alignment 357 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 358 movl 8(%ebp), %eax 359 movl %eax, (%esp) 360 361 call ASM_PFX(SecPeCoffUnloadImageExtraAction) 362 363 leave 364 ret 365 366 367ASM_GLOBAL ASM_PFX(GasketSecEmuThunkAddress) 368ASM_PFX(GasketSecEmuThunkAddress): 369 pushl %ebp 370 movl %esp, %ebp 371 subl $24, %esp // sub extra 16 from the stack for alignment 372 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 373 374 call ASM_PFX(SecEmuThunkAddress) 375 376 leave 377 ret 378 379// 380// Gasket functions for EFI_EMU_UGA_IO_PROTOCOL 381// 382 383ASM_GLOBAL ASM_PFX(GasketX11Size) 384ASM_PFX(GasketX11Size): 385 pushl %ebp 386 movl %esp, %ebp 387 subl $40, %esp // sub extra 16 from the stack for alignment 388 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 389 movl 20(%ebp), %eax 390 movl %eax, 12(%esp) 391 movl 16(%ebp), %eax 392 movl %eax, 8(%esp) 393 movl 12(%ebp), %eax 394 movl %eax, 4(%esp) 395 movl 8(%ebp), %eax 396 movl %eax, (%esp) 397 398 call ASM_PFX(X11Size) 399 400 leave 401 ret 402 403 404ASM_GLOBAL ASM_PFX(GasketX11CheckKey) 405ASM_PFX(GasketX11CheckKey): 406 pushl %ebp 407 movl %esp, %ebp 408 subl $24, %esp // sub extra 16 from the stack for alignment 409 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 410 movl 8(%ebp), %eax 411 movl %eax, (%esp) 412 413 call ASM_PFX(X11CheckKey) 414 415 leave 416 ret 417 418ASM_GLOBAL ASM_PFX(GasketX11GetKey) 419ASM_PFX(GasketX11GetKey): 420 pushl %ebp 421 movl %esp, %ebp 422 subl $24, %esp // sub extra 16 from the stack for alignment 423 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 424 movl 12(%ebp), %eax 425 movl %eax, 4(%esp) 426 movl 8(%ebp), %eax 427 movl %eax, (%esp) 428 429 call ASM_PFX(X11GetKey) 430 431 leave 432 ret 433 434 435ASM_GLOBAL ASM_PFX(GasketX11KeySetState) 436ASM_PFX(GasketX11KeySetState): 437 pushl %ebp 438 movl %esp, %ebp 439 subl $24, %esp // sub extra 16 from the stack for alignment 440 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 441 movl 12(%ebp), %eax 442 movl %eax, 4(%esp) 443 movl 8(%ebp), %eax 444 movl %eax, (%esp) 445 446 call ASM_PFX(X11KeySetState) 447 448 leave 449 ret 450 451 452ASM_GLOBAL ASM_PFX(GasketX11RegisterKeyNotify) 453ASM_PFX(GasketX11RegisterKeyNotify): 454 pushl %ebp 455 movl %esp, %ebp 456 subl $40, %esp // sub extra 16 from the stack for alignment 457 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 458 movl 20(%ebp), %eax 459 movl %eax, 12(%esp) 460 movl 16(%ebp), %eax 461 movl %eax, 8(%esp) 462 movl 12(%ebp), %eax 463 movl %eax, 4(%esp) 464 movl 8(%ebp), %eax 465 movl %eax, (%esp) 466 467 call ASM_PFX(X11RegisterKeyNotify) 468 469 leave 470 ret 471 472 473ASM_GLOBAL ASM_PFX(GasketX11Blt) 474ASM_PFX(GasketX11Blt): 475 pushl %ebp 476 movl %esp, %ebp 477 subl $40, %esp // sub extra 16 from the stack for alignment 478 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 479 movl 20(%ebp), %eax 480 movl %eax, 12(%esp) 481 movl 16(%ebp), %eax 482 movl %eax, 8(%esp) 483 movl 12(%ebp), %eax 484 movl %eax, 4(%esp) 485 movl 8(%ebp), %eax 486 movl %eax, (%esp) 487 488 call ASM_PFX(X11Blt) 489 490 leave 491 ret 492 493 494ASM_GLOBAL ASM_PFX(GasketX11CheckPointer) 495ASM_PFX(GasketX11CheckPointer): 496 pushl %ebp 497 movl %esp, %ebp 498 subl $24, %esp // sub extra 16 from the stack for alignment 499 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 500 movl 8(%ebp), %eax 501 movl %eax, (%esp) 502 503 call ASM_PFX(X11CheckPointer) 504 505 leave 506 ret 507 508 509ASM_GLOBAL ASM_PFX(GasketX11GetPointerState) 510ASM_PFX(GasketX11GetPointerState): 511 pushl %ebp 512 movl %esp, %ebp 513 subl $24, %esp // sub extra 16 from the stack for alignment 514 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 515 movl 12(%ebp), %eax 516 movl %eax, 4(%esp) 517 movl 8(%ebp), %eax 518 movl %eax, (%esp) 519 520 call ASM_PFX(X11GetPointerState) 521 522 leave 523 ret 524 525 526ASM_GLOBAL ASM_PFX(GasketX11GraphicsWindowOpen) 527ASM_PFX(GasketX11GraphicsWindowOpen): 528 pushl %ebp 529 movl %esp, %ebp 530 subl $24, %esp // sub extra 16 from the stack for alignment 531 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 532 movl 8(%ebp), %eax 533 movl %eax, (%esp) 534 535 call ASM_PFX(X11GraphicsWindowOpen) 536 537 leave 538 ret 539 540 541ASM_GLOBAL ASM_PFX(GasketX11GraphicsWindowClose) 542ASM_PFX(GasketX11GraphicsWindowClose): 543 pushl %ebp 544 movl %esp, %ebp 545 subl $24, %esp // sub extra 16 from the stack for alignment 546 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 547 movl 12(%ebp), %eax 548 movl %eax, 4(%esp) 549 movl 8(%ebp), %eax 550 movl %eax, (%esp) 551 552 call ASM_PFX(X11GraphicsWindowClose) 553 554 leave 555 ret 556 557 558// Pthreads 559 560ASM_GLOBAL ASM_PFX(GasketPthreadMutexLock) 561ASM_PFX(GasketPthreadMutexLock): 562 pushl %ebp 563 movl %esp, %ebp 564 subl $24, %esp // sub extra 16 from the stack for alignment 565 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 566 movl 8(%ebp), %eax 567 movl %eax, (%esp) 568 569 call ASM_PFX(PthreadMutexLock) 570 571 leave 572 ret 573 574 575ASM_GLOBAL ASM_PFX(GasketPthreadMutexUnLock) 576ASM_PFX(GasketPthreadMutexUnLock): 577 pushl %ebp 578 movl %esp, %ebp 579 subl $24, %esp // sub extra 16 from the stack for alignment 580 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 581 movl 8(%ebp), %eax 582 movl %eax, (%esp) 583 584 call ASM_PFX(PthreadMutexUnLock) 585 586 leave 587 ret 588 589ASM_GLOBAL ASM_PFX(GasketPthreadMutexTryLock) 590ASM_PFX(GasketPthreadMutexTryLock): 591 pushl %ebp 592 movl %esp, %ebp 593 subl $24, %esp // sub extra 16 from the stack for alignment 594 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 595 movl 8(%ebp), %eax 596 movl %eax, (%esp) 597 598 call ASM_PFX(PthreadMutexTryLock) 599 600 leave 601 ret 602 603ASM_GLOBAL ASM_PFX(GasketPthreadMutexInit) 604ASM_PFX(GasketPthreadMutexInit): 605 pushl %ebp 606 movl %esp, %ebp 607 subl $24, %esp // sub extra 16 from the stack for alignment 608 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 609 610 call ASM_PFX(PthreadMutexInit) 611 612 leave 613 ret 614 615 616 617ASM_GLOBAL ASM_PFX(GasketPthreadMutexDestroy) 618ASM_PFX(GasketPthreadMutexDestroy): 619 pushl %ebp 620 movl %esp, %ebp 621 subl $24, %esp // sub extra 16 from the stack for alignment 622 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 623 movl 8(%ebp), %eax 624 movl %eax, (%esp) 625 626 call ASM_PFX(PthreadMutexDestroy) 627 628 leave 629 ret 630 631 632ASM_GLOBAL ASM_PFX(GasketPthreadCreate) 633ASM_PFX(GasketPthreadCreate): 634 pushl %ebp 635 movl %esp, %ebp 636 subl $40, %esp // sub extra 16 from the stack for alignment 637 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 638 movl 20(%ebp), %eax 639 movl %eax, 12(%esp) 640 movl 16(%ebp), %eax 641 movl %eax, 8(%esp) 642 movl 12(%ebp), %eax 643 movl %eax, 4(%esp) 644 movl 8(%ebp), %eax 645 movl %eax, (%esp) 646 647 call ASM_PFX(PthreadCreate) 648 649 leave 650 ret 651 652 653ASM_GLOBAL ASM_PFX(GasketPthreadExit) 654ASM_PFX(GasketPthreadExit): 655 pushl %ebp 656 movl %esp, %ebp 657 subl $24, %esp // sub extra 16 from the stack for alignment 658 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 659 movl 8(%ebp), %eax 660 movl %eax, (%esp) 661 662 call ASM_PFX(PthreadExit) 663 664 leave 665 ret 666 667 668 669ASM_GLOBAL ASM_PFX(GasketPthreadSelf) 670ASM_PFX(GasketPthreadSelf): 671 pushl %ebp 672 movl %esp, %ebp 673 subl $24, %esp // sub extra 16 from the stack for alignment 674 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 675 676 call ASM_PFX(PthreadSelf) 677 678 leave 679 ret 680 681 682ASM_GLOBAL ASM_PFX(GasketPthreadOpen) 683ASM_PFX(GasketPthreadOpen): 684 pushl %ebp 685 movl %esp, %ebp 686 subl $24, %esp // sub extra 16 from the stack for alignment 687 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 688 movl 8(%ebp), %eax 689 movl %eax, (%esp) 690 691 call ASM_PFX(PthreadOpen) 692 693 leave 694 ret 695 696 697ASM_GLOBAL ASM_PFX(GasketPthreadClose) 698ASM_PFX(GasketPthreadClose): 699 pushl %ebp 700 movl %esp, %ebp 701 subl $24, %esp // sub extra 16 from the stack for alignment 702 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 703 movl 8(%ebp), %eax 704 movl %eax, (%esp) 705 706 call ASM_PFX(PthreadClose) 707 708 leave 709 ret 710 711 712 713 714// 715// UNIX ABI to EFI ABI call 716// 717// UINTN 718// ReverseGasketUint64 ( 719// void *Api, 720// UINTN Arg1 721// ); 722ASM_GLOBAL ASM_PFX(ReverseGasketUint64) 723ASM_PFX(ReverseGasketUint64): 724 pushl %ebp 725 movl %esp, %ebp 726 subl $8, %esp 727 movl 16(%ebp), %eax 728 movl %eax, 4(%esp) 729 movl 12(%ebp), %eax 730 movl %eax, (%esp) 731 calll *8(%ebp) 732 addl $8, %esp 733 popl %ebp 734 ret 735 736 737 738// 739// UNIX ABI to EFI ABI call 740// 741// UINTN 742// ReverseGasketUint64Uint64 ( 743// void *Api, 744// UINTN Arg1 745// UINTN Arg2 746// ); 747ASM_GLOBAL ASM_PFX(ReverseGasketUint64Uint64) 748ASM_PFX(ReverseGasketUint64Uint64): 749 pushl %ebp 750 movl %esp, %ebp 751 subl $24, %esp 752 movl 24(%ebp), %eax 753 movl %eax, 12(%esp) 754 movl 20(%ebp), %eax 755 movl %eax, 8(%esp) 756 movl 16(%ebp), %eax 757 movl %eax, 4(%esp) 758 movl 12(%ebp), %eax 759 movl %eax, (%esp) 760 calll *8(%ebp) 761 addl $24, %esp 762 popl %ebp 763 ret 764 765 766ASM_GLOBAL ASM_PFX(GasketSecUnixPeiAutoScan) 767ASM_PFX(GasketSecUnixPeiAutoScan): 768 pushl %ebp 769 movl %esp, %ebp 770 subl $40, %esp // sub extra 16 from the stack for alignment 771 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 772 movl 16(%ebp), %eax 773 movl %eax, 8(%esp) 774 movl 12(%ebp), %eax 775 movl %eax, 4(%esp) 776 movl 8(%ebp), %eax 777 movl %eax, (%esp) 778 779 call ASM_PFX(SecUnixPeiAutoScan) 780 781 leave 782 ret 783 784 785ASM_GLOBAL ASM_PFX(GasketSecUnixFdAddress) 786ASM_PFX(GasketSecUnixFdAddress): 787 pushl %ebp 788 movl %esp, %ebp 789 subl $40, %esp // sub extra 16 from the stack for alignment 790 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 791 movl 20(%ebp), %eax 792 movl %eax, 12(%esp) 793 movl 16(%ebp), %eax 794 movl %eax, 8(%esp) 795 movl 12(%ebp), %eax 796 movl %eax, 4(%esp) 797 movl 8(%ebp), %eax 798 movl %eax, (%esp) 799 800 call ASM_PFX(SecUnixFdAddress) 801 802 leave 803 ret 804 805 806// EmuIoThunk SimpleFileSystem 807 808ASM_GLOBAL ASM_PFX(GasketPosixOpenVolume) 809ASM_PFX(GasketPosixOpenVolume): 810 pushl %ebp 811 movl %esp, %ebp 812 subl $40, %esp // sub extra 16 from the stack for alignment 813 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 814 movl 20(%ebp), %eax 815 movl %eax, 12(%esp) 816 movl 16(%ebp), %eax 817 movl %eax, 8(%esp) 818 movl 12(%ebp), %eax 819 movl %eax, 4(%esp) 820 movl 8(%ebp), %eax 821 movl %eax, (%esp) 822 823 call ASM_PFX(PosixOpenVolume) 824 825 leave 826 ret 827 828 829ASM_GLOBAL ASM_PFX(GasketPosixFileOpen) 830ASM_PFX(GasketPosixFileOpen): 831 pushl %ebp 832 movl %esp, %ebp 833 subl $56, %esp // sub extra 16 from the stack for alignment 834 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 835 movl 28(%ebp), %eax 836 movl 32(%ebp), %ecx 837 movl %ecx, 24(%esp) 838 movl %eax, 20(%esp) 839 movl 20(%ebp), %eax 840 movl 24(%ebp), %ecx 841 movl %ecx, 16(%esp) 842 movl %eax, 12(%esp) 843 movl 16(%ebp), %eax 844 movl %eax, 8(%esp) 845 movl 12(%ebp), %eax 846 movl %eax, 4(%esp) 847 movl 8(%ebp), %eax 848 movl %eax, (%esp) 849 850 call ASM_PFX(PosixFileOpen) 851 852 leave 853 ret 854 855 856ASM_GLOBAL ASM_PFX(GasketPosixFileCLose) 857ASM_PFX(GasketPosixFileCLose): 858 pushl %ebp 859 movl %esp, %ebp 860 subl $24, %esp // sub extra 16 from the stack for alignment 861 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 862 movl 8(%ebp), %eax 863 movl %eax, (%esp) 864 865 call ASM_PFX(PosixFileCLose) 866 867 leave 868 ret 869 870 871ASM_GLOBAL ASM_PFX(GasketPosixFileDelete) 872ASM_PFX(GasketPosixFileDelete): 873 pushl %ebp 874 movl %esp, %ebp 875 subl $24, %esp // sub extra 16 from the stack for alignment 876 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 877 movl 8(%ebp), %eax 878 movl %eax, (%esp) 879 880 call ASM_PFX(PosixFileDelete) 881 882 leave 883 ret 884 885 886ASM_GLOBAL ASM_PFX(GasketPosixFileRead) 887ASM_PFX(GasketPosixFileRead): 888 pushl %ebp 889 movl %esp, %ebp 890 subl $40, %esp // sub extra 16 from the stack for alignment 891 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 892 movl 16(%ebp), %eax 893 movl %eax, 8(%esp) 894 movl 12(%ebp), %eax 895 movl %eax, 4(%esp) 896 movl 8(%ebp), %eax 897 movl %eax, (%esp) 898 899 call ASM_PFX(PosixFileRead) 900 901 leave 902 ret 903 904 905ASM_GLOBAL ASM_PFX(GasketPosixFileWrite) 906ASM_PFX(GasketPosixFileWrite): 907 pushl %ebp 908 movl %esp, %ebp 909 subl $40, %esp // sub extra 16 from the stack for alignment 910 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 911 movl 16(%ebp), %eax 912 movl %eax, 8(%esp) 913 movl 12(%ebp), %eax 914 movl %eax, 4(%esp) 915 movl 8(%ebp), %eax 916 movl %eax, (%esp) 917 918 call ASM_PFX(PosixFileWrite) 919 920 leave 921 ret 922 923 924ASM_GLOBAL ASM_PFX(GasketPosixFileSetPossition) 925ASM_PFX(GasketPosixFileSetPossition): 926 pushl %ebp 927 movl %esp, %ebp 928 subl $40, %esp // sub extra 16 from the stack for alignment 929 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 930 movl 12(%ebp), %eax 931 movl 16(%ebp), %ecx 932 movl %ecx, 8(%esp) 933 movl %eax, 4(%esp) 934 movl 8(%ebp), %eax 935 movl %eax, (%esp) 936 937 call ASM_PFX(PosixFileSetPossition) 938 939 leave 940 ret 941 942 943ASM_GLOBAL ASM_PFX(GasketPosixFileGetPossition) 944ASM_PFX(GasketPosixFileGetPossition): 945 pushl %ebp 946 movl %esp, %ebp 947 subl $24, %esp // sub extra 16 from the stack for alignment 948 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 949 movl 12(%ebp), %eax 950 movl %eax, 4(%esp) 951 movl 8(%ebp), %eax 952 movl %eax, (%esp) 953 954 call ASM_PFX(PosixFileGetPossition) 955 956 leave 957 ret 958 959 960ASM_GLOBAL ASM_PFX(GasketPosixFileGetInfo) 961ASM_PFX(GasketPosixFileGetInfo): 962 pushl %ebp 963 movl %esp, %ebp 964 subl $40, %esp // sub extra 16 from the stack for alignment 965 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 966 movl 20(%ebp), %eax 967 movl %eax, 12(%esp) 968 movl 16(%ebp), %eax 969 movl %eax, 8(%esp) 970 movl 12(%ebp), %eax 971 movl %eax, 4(%esp) 972 movl 8(%ebp), %eax 973 movl %eax, (%esp) 974 975 call ASM_PFX(PosixFileGetInfo) 976 977 leave 978 ret 979 980 981ASM_GLOBAL ASM_PFX(GasketPosixFileSetInfo) 982ASM_PFX(GasketPosixFileSetInfo): 983 pushl %ebp 984 movl %esp, %ebp 985 subl $40, %esp // sub extra 16 from the stack for alignment 986 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 987 movl 20(%ebp), %eax 988 movl %eax, 12(%esp) 989 movl 16(%ebp), %eax 990 movl %eax, 8(%esp) 991 movl 12(%ebp), %eax 992 movl %eax, 4(%esp) 993 movl 8(%ebp), %eax 994 movl %eax, (%esp) 995 996 call ASM_PFX(PosixFileSetInfo) 997 998 leave 999 ret 1000 1001 1002ASM_GLOBAL ASM_PFX(GasketPosixFileFlush) 1003ASM_PFX(GasketPosixFileFlush): 1004 pushl %ebp 1005 movl %esp, %ebp 1006 subl $24, %esp // sub extra 16 from the stack for alignment 1007 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 1008 movl 8(%ebp), %eax 1009 movl %eax, (%esp) 1010 1011 call ASM_PFX(PosixFileFlush) 1012 1013 leave 1014 ret 1015 1016 1017ASM_GLOBAL ASM_PFX(GasketPosixFileSystmeThunkOpen) 1018ASM_PFX(GasketPosixFileSystmeThunkOpen): 1019 pushl %ebp 1020 movl %esp, %ebp 1021 subl $24, %esp // sub extra 16 from the stack for alignment 1022 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 1023 movl 8(%ebp), %eax 1024 movl %eax, (%esp) 1025 1026 call ASM_PFX(PosixFileSystmeThunkOpen) 1027 1028 leave 1029 ret 1030 1031 1032ASM_GLOBAL ASM_PFX(GasketPosixFileSystmeThunkClose) 1033ASM_PFX(GasketPosixFileSystmeThunkClose): 1034 pushl %ebp 1035 movl %esp, %ebp 1036 subl $24, %esp // sub extra 16 from the stack for alignment 1037 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 1038 movl 8(%ebp), %eax 1039 movl %eax, (%esp) 1040 1041 call ASM_PFX(PosixFileSystmeThunkClose) 1042 1043 leave 1044 ret 1045 1046ASM_GLOBAL ASM_PFX(GasketEmuBlockIoReset) 1047ASM_PFX(GasketEmuBlockIoReset): 1048 pushl %ebp 1049 movl %esp, %ebp 1050 subl $24, %esp // sub extra 16 from the stack for alignment 1051 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 1052 movl 12(%ebp), %eax 1053 movl %eax, 4(%esp) 1054 movl 8(%ebp), %eax 1055 movl %eax, (%esp) 1056 1057 call ASM_PFX(EmuBlockIoReset) 1058 1059 leave 1060 ret 1061 1062 1063ASM_GLOBAL ASM_PFX(GasketEmuBlockIoReadBlocks) 1064ASM_PFX(GasketEmuBlockIoReadBlocks): 1065 pushl %ebp 1066 movl %esp, %ebp 1067 subl $56, %esp // sub extra 16 from the stack for alignment 1068 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 1069 movl 32(%ebp), %eax 1070 movl %eax, 24(%esp) 1071 movl 28(%ebp), %eax 1072 movl %eax, 20(%esp) 1073 movl 24(%ebp), %eax 1074 movl %eax, 16(%esp) 1075 movl 16(%ebp), %eax 1076 movl 20(%ebp), %edx 1077 movl %edx, 12(%esp) 1078 movl %eax, 8(%esp) 1079 movl 12(%ebp), %eax 1080 movl %eax, 4(%esp) 1081 movl 8(%ebp), %eax 1082 movl %eax, (%esp) 1083 1084 call ASM_PFX(EmuBlockIoReadBlocks) 1085 1086 leave 1087 ret 1088 1089 1090ASM_GLOBAL ASM_PFX(GasketEmuBlockIoWriteBlocks) 1091ASM_PFX(GasketEmuBlockIoWriteBlocks): 1092 pushl %ebp 1093 movl %esp, %ebp 1094 subl $56, %esp // sub extra 16 from the stack for alignment 1095 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 1096 movl 32(%ebp), %eax 1097 movl %eax, 24(%esp) 1098 movl 28(%ebp), %eax 1099 movl %eax, 20(%esp) 1100 movl 24(%ebp), %eax 1101 movl %eax, 16(%esp) 1102 movl 16(%ebp), %eax 1103 movl 20(%ebp), %edx 1104 movl %edx, 12(%esp) 1105 movl %eax, 8(%esp) 1106 movl 12(%ebp), %eax 1107 movl %eax, 4(%esp) 1108 movl 8(%ebp), %eax 1109 movl %eax, (%esp) 1110 1111 call ASM_PFX(EmuBlockIoWriteBlocks) 1112 1113 leave 1114 ret 1115 1116 1117ASM_GLOBAL ASM_PFX(GasketEmuBlockIoFlushBlocks) 1118ASM_PFX(GasketEmuBlockIoFlushBlocks): pushl %ebp 1119 movl %esp, %ebp 1120 subl $24, %esp // sub extra 16 from the stack for alignment 1121 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 1122 movl 12(%ebp), %eax 1123 movl %eax, 4(%esp) 1124 movl 8(%ebp), %eax 1125 movl %eax, (%esp) 1126 1127 1128 call ASM_PFX(EmuBlockIoFlushBlocks) 1129 1130 leave 1131 ret 1132 1133 1134ASM_GLOBAL ASM_PFX(GasketEmuBlockIoCreateMapping) 1135ASM_PFX(GasketEmuBlockIoCreateMapping): 1136 pushl %ebp 1137 movl %esp, %ebp 1138 subl $24, %esp // sub extra 16 from the stack for alignment 1139 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 1140 movl 12(%ebp), %eax 1141 movl %eax, 4(%esp) 1142 movl 8(%ebp), %eax 1143 movl %eax, (%esp) 1144 1145 call ASM_PFX(EmuBlockIoCreateMapping) 1146 1147 leave 1148 ret 1149 1150 1151ASM_GLOBAL ASM_PFX(GasketBlockIoThunkOpen) 1152ASM_PFX(GasketBlockIoThunkOpen): 1153 pushl %ebp 1154 movl %esp, %ebp 1155 subl $24, %esp // sub extra 16 from the stack for alignment 1156 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 1157 movl 8(%ebp), %eax 1158 movl %eax, (%esp) 1159 1160 call ASM_PFX(EmuBlockIoThunkOpen) 1161 1162 leave 1163 ret 1164 1165 1166ASM_GLOBAL ASM_PFX(GasketBlockIoThunkClose) 1167ASM_PFX(GasketBlockIoThunkClose): 1168 pushl %ebp 1169 movl %esp, %ebp 1170 subl $24, %esp // sub extra 16 from the stack for alignment 1171 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 1172 movl 8(%ebp), %eax 1173 movl %eax, (%esp) 1174 1175 call ASM_PFX(EmuBlockIoThunkClose) 1176 1177 leave 1178 ret 1179 1180 1181 1182ASM_GLOBAL ASM_PFX(GasketSnpCreateMapping) 1183ASM_PFX(GasketSnpCreateMapping): 1184 pushl %ebp 1185 movl %esp, %ebp 1186 subl $24, %esp // sub extra 16 from the stack for alignment 1187 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 1188 movl 12(%ebp), %eax 1189 movl %eax, 4(%esp) 1190 movl 8(%ebp), %eax 1191 movl %eax, (%esp) 1192 1193 call ASM_PFX(EmuSnpCreateMapping) 1194 1195 leave 1196 ret 1197 1198 1199ASM_GLOBAL ASM_PFX(GasketSnpStart) 1200ASM_PFX(GasketSnpStart): 1201 pushl %ebp 1202 movl %esp, %ebp 1203 subl $24, %esp // sub extra 16 from the stack for alignment 1204 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 1205 movl 8(%ebp), %eax 1206 movl %eax, (%esp) 1207 1208 call ASM_PFX(EmuSnpStart) 1209 1210 leave 1211 ret 1212 1213 1214ASM_GLOBAL ASM_PFX(GasketSnpStop) 1215ASM_PFX(GasketSnpStop): 1216 pushl %ebp 1217 movl %esp, %ebp 1218 subl $24, %esp // sub extra 16 from the stack for alignment 1219 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 1220 movl 8(%ebp), %eax 1221 movl %eax, (%esp) 1222 1223 call ASM_PFX(EmuSnpStop) 1224 1225 leave 1226 ret 1227 1228 1229ASM_GLOBAL ASM_PFX(GasketSnpInitialize) 1230ASM_PFX(GasketSnpInitialize): 1231 pushl %ebp 1232 movl %esp, %ebp 1233 subl $40, %esp // sub extra 16 from the stack for alignment 1234 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 1235 movl 16(%ebp), %eax 1236 movl %eax, 8(%esp) 1237 movl 12(%ebp), %eax 1238 movl %eax, 4(%esp) 1239 movl 8(%ebp), %eax 1240 movl %eax, (%esp) 1241 1242 call ASM_PFX(EmuSnpInitialize) 1243 1244 leave 1245 ret 1246 1247 1248ASM_GLOBAL ASM_PFX(GasketSnpReset) 1249ASM_PFX(GasketSnpReset): 1250 pushl %ebp 1251 movl %esp, %ebp 1252 subl $24, %esp // sub extra 16 from the stack for alignment 1253 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 1254 movl 12(%ebp), %eax 1255 movl %eax, 4(%esp) 1256 movl 8(%ebp), %eax 1257 movl %eax, (%esp) 1258 1259 call ASM_PFX(EmuSnpReset) 1260 1261 leave 1262 ret 1263 1264 1265ASM_GLOBAL ASM_PFX(GasketSnpShutdown) 1266ASM_PFX(GasketSnpShutdown): 1267 pushl %ebp 1268 movl %esp, %ebp 1269 subl $24, %esp // sub extra 16 from the stack for alignment 1270 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 1271 movl 8(%ebp), %eax 1272 movl %eax, (%esp) 1273 1274 call ASM_PFX(EmuSnpShutdown) 1275 1276 leave 1277 ret 1278 1279 1280ASM_GLOBAL ASM_PFX(GasketSnpReceiveFilters) 1281ASM_PFX(GasketSnpReceiveFilters): 1282 pushl %ebp 1283 movl %esp, %ebp 1284 subl $40, %esp // sub extra 16 from the stack for alignment 1285 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 1286 movl 28(%ebp), %eax 1287 movl %eax, 20(%esp) 1288 movl 24(%ebp), %eax 1289 movl %eax, 16(%esp) 1290 movl 20(%ebp), %eax 1291 movl %eax, 12(%esp) 1292 movl 16(%ebp), %eax 1293 movl %eax, 8(%esp) 1294 movl 12(%ebp), %eax 1295 movl %eax, 4(%esp) 1296 movl 8(%ebp), %eax 1297 movl %eax, (%esp) 1298 1299 call ASM_PFX(EmuSnpReceiveFilters) 1300 1301 leave 1302 ret 1303 1304 1305ASM_GLOBAL ASM_PFX(GasketSnpStationAddress) 1306ASM_PFX(GasketSnpStationAddress): 1307 pushl %ebp 1308 movl %esp, %ebp 1309 subl $40, %esp // sub extra 16 from the stack for alignment 1310 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 1311 movl 16(%ebp), %eax 1312 movl %eax, 8(%esp) 1313 movl 12(%ebp), %eax 1314 movl %eax, 4(%esp) 1315 movl 8(%ebp), %eax 1316 movl %eax, (%esp) 1317 1318 leave 1319 ret 1320 1321 1322 1323ASM_GLOBAL ASM_PFX(GasketSnpStatistics) 1324ASM_PFX(GasketSnpStatistics): 1325 pushl %ebp 1326 movl %esp, %ebp 1327 subl $40, %esp // sub extra 16 from the stack for alignment 1328 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 1329 movl 20(%ebp), %eax 1330 movl %eax, 12(%esp) 1331 movl 16(%ebp), %eax 1332 movl %eax, 8(%esp) 1333 movl 12(%ebp), %eax 1334 movl %eax, 4(%esp) 1335 movl 8(%ebp), %eax 1336 movl %eax, (%esp) 1337 1338 call ASM_PFX(EmuSnpStatistics) 1339 1340 leave 1341 ret 1342 1343 1344ASM_GLOBAL ASM_PFX(GasketSnpMCastIpToMac) 1345ASM_PFX(GasketSnpMCastIpToMac): 1346 pushl %ebp 1347 movl %esp, %ebp 1348 subl $40, %esp // sub extra 16 from the stack for alignment 1349 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 1350 movl 20(%ebp), %eax 1351 movl %eax, 12(%esp) 1352 movl 16(%ebp), %eax 1353 movl %eax, 8(%esp) 1354 movl 12(%ebp), %eax 1355 movl %eax, 4(%esp) 1356 movl 8(%ebp), %eax 1357 movl %eax, (%esp) 1358 1359 call ASM_PFX(EmuSnpMCastIpToMac) 1360 1361 leave 1362 ret 1363 1364 1365ASM_GLOBAL ASM_PFX(GasketSnpNvData) 1366ASM_PFX(GasketSnpNvData): 1367 pushl %ebp 1368 movl %esp, %ebp 1369 subl $40, %esp // sub extra 16 from the stack for alignment 1370 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 1371 movl 24(%ebp), %eax 1372 movl %eax, 16(%esp) 1373 movl 20(%ebp), %eax 1374 movl %eax, 12(%esp) 1375 movl 16(%ebp), %eax 1376 movl %eax, 8(%esp) 1377 movl 12(%ebp), %eax 1378 movl %eax, 4(%esp) 1379 movl 8(%ebp), %eax 1380 movl %eax, (%esp) 1381 1382 call ASM_PFX(EmuSnpNvData) 1383 1384 leave 1385 ret 1386 1387 1388ASM_GLOBAL ASM_PFX(GasketSnpGetStatus) 1389ASM_PFX(GasketSnpGetStatus): 1390 pushl %ebp 1391 movl %esp, %ebp 1392 subl $40, %esp // sub extra 16 from the stack for alignment 1393 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 1394 movl 16(%ebp), %eax 1395 movl %eax, 8(%esp) 1396 movl 12(%ebp), %eax 1397 movl %eax, 4(%esp) 1398 movl 8(%ebp), %eax 1399 movl %eax, (%esp) 1400 1401 call ASM_PFX(EmuSnpGetStatus) 1402 1403 leave 1404 ret 1405 1406 1407 1408ASM_GLOBAL ASM_PFX(GasketSnpTransmit) 1409ASM_PFX(GasketSnpTransmit): 1410 pushl %ebp 1411 movl %esp, %ebp 1412 subl $56, %esp // sub extra 16 from the stack for alignment 1413 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 1414 movl 32(%ebp), %eax 1415 movl %eax, 24(%esp) 1416 movl 28(%ebp), %eax 1417 movl %eax, 20(%esp) 1418 movl 24(%ebp), %eax 1419 movl %eax, 16(%esp) 1420 movl 20(%ebp), %eax 1421 movl %eax, 12(%esp) 1422 movl 16(%ebp), %eax 1423 movl %eax, 8(%esp) 1424 movl 12(%ebp), %eax 1425 movl %eax, 4(%esp) 1426 movl 8(%ebp), %eax 1427 movl %eax, (%esp) 1428 1429 call ASM_PFX(EmuSnpTransmit) 1430 1431 leave 1432 ret 1433 1434 1435 1436ASM_GLOBAL ASM_PFX(GasketSnpReceive) 1437ASM_PFX(GasketSnpReceive): 1438 pushl %ebp 1439 movl %esp, %ebp 1440 subl $56, %esp // sub extra 16 from the stack for alignment 1441 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 1442 movl 32(%ebp), %eax 1443 movl %eax, 24(%esp) 1444 movl 28(%ebp), %eax 1445 movl %eax, 20(%esp) 1446 movl 24(%ebp), %eax 1447 movl %eax, 16(%esp) 1448 movl 20(%ebp), %eax 1449 movl %eax, 12(%esp) 1450 movl 16(%ebp), %eax 1451 movl %eax, 8(%esp) 1452 movl 12(%ebp), %eax 1453 movl %eax, 4(%esp) 1454 movl 8(%ebp), %eax 1455 movl %eax, (%esp) 1456 1457 call ASM_PFX(EmuSnpReceive) 1458 1459 leave 1460 ret 1461 1462 1463ASM_GLOBAL ASM_PFX(GasketSnpThunkOpen) 1464ASM_PFX(GasketSnpThunkOpen): 1465 pushl %ebp 1466 movl %esp, %ebp 1467 subl $24, %esp // sub extra 16 from the stack for alignment 1468 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 1469 movl 8(%ebp), %eax 1470 movl %eax, (%esp) 1471 1472 call ASM_PFX(EmuSnpThunkOpen) 1473 1474 leave 1475 ret 1476 1477 1478ASM_GLOBAL ASM_PFX(GasketSnpThunkClose) 1479ASM_PFX(GasketSnpThunkClose): 1480 pushl %ebp 1481 movl %esp, %ebp 1482 subl $24, %esp // sub extra 16 from the stack for alignment 1483 and $-16, %esp // stack needs to end in 0xFFFFFFF0 before call 1484 movl 8(%ebp), %eax 1485 movl %eax, (%esp) 1486 1487 call ASM_PFX(EmuSnpThunkClose) 1488 1489 leave 1490 ret 1491 1492 1493