Changeset 493 for GPL/trunk/drv32/startup.asm
- Timestamp:
- Jul 3, 2010, 7:26:36 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk/drv32/startup.asm
r375 r493 1 ; $Id: startup.asm,v 1.1.1.1 2003/07/02 13:56:56 eleph Exp $ 1 ; $Id: startup.asm,v 1.1.1.1 2003/07/02 13:56:56 eleph Exp $ 2 2 ;* 3 3 ;* 16bit entrypoints to the PDD with thunks to the 32bit functions … … 52 52 public _RM_Help3 53 53 public _RMFlags 54 IFDEF DEBUG 55 public DbgU32TimerCnt 56 public DbgU32IntCnt 57 ENDIF 54 58 55 59 ;********************************************************************************************* … … 123 127 InitPktSeg dw 0 124 128 InitPktOff dw 0 129 IFDEF DEBUG 130 DbgU32TimerCnt dd 0 131 DbgU32IntCnt dd 0 132 ENDIF 125 133 ;needed for rmcalls.lib 126 134 _RM_Help0 dd 0 … … 165 173 cmp eax, 04h ; DosRead 166 174 je uniaud_stub_strategy 167 175 168 176 enter 0, 0 169 177 and sp, 0fffch ; align stack 170 178 171 pushad 179 pushad 172 180 push ds 173 181 push es … … 235 243 and sp, 0fffch ; align stack 236 244 237 pushad 245 pushad 238 246 push ds 239 247 push es … … 328 336 ; device_init 329 337 ; 330 ; Use DosOpen to tell the 1st driver to handle init for us. We must do it this 338 ; Use DosOpen to tell the 1st driver to handle init for us. We must do it this 331 339 ; way since right now our CPL is 3 and the flat code selector has DPL 0, so 332 340 ; we can't load it. In the open strategy request, CPL is 0 … … 600 608 call near ptr _CallRM 601 609 mov sp,bp 602 ret16 610 ret16 603 611 DeAllocL1: test byte ptr _RMFlags,02H 604 612 je short DeAllocL2 605 613 sub ax,ax 606 ret16 614 ret16 607 615 DeAllocL2: mov ax,0001H 608 ret16 616 ret16 609 617 _RMDeallocResourceOrg endp 610 618 … … 622 630 623 631 ALIGN 2 624 PUBLIC MY_DEVHELP_ATTACHDD 632 PUBLIC MY_DEVHELP_ATTACHDD 625 633 MY_DEVHELP_ATTACHDD proc near 626 634 push bp … … 638 646 pop es 639 647 pop di 640 leave 648 leave 641 649 ret 0004H 642 650 L2: pop es … … 659 667 call near ptr _CallRM 660 668 add sp,0006H 661 ret16 669 ret16 662 670 CreateDrL4: test byte ptr _RMFlags,02H 663 671 je short CreateDrL6 … … 670 678 pop bx 671 679 pop es 672 ret16 680 ret16 673 681 CreateDrL6: mov ax, word ptr DevHelpInit + 2H 674 682 or ax, word ptr DevHelpInit 675 683 jne short CreateDrL7 676 684 mov ax,0008H 677 ret16 685 ret16 678 686 CreateDrL7: push offset ResMgr 679 687 push offset _RMIDCTable … … 708 716 709 717 ALIGN 2 710 PUBLIC _CallRM 718 PUBLIC _CallRM 711 719 _CallRM proc near 712 720 enter 0002H,00H … … 719 727 call dword ptr _RM_Help3 720 728 add sp,0006H 721 leave 729 leave 722 730 ret 723 731 L1: push word ptr +6H[bp] 724 732 call dword ptr _RM_Help0 725 leave 733 leave 726 734 ret 727 735 _CallRM endp … … 733 741 pop word ptr -2H[bp] 734 742 mov ax,word ptr -2H[bp] 735 leave 736 ret 743 leave 744 ret 737 745 _GetCS endp 738 746 … … 754 762 je short DestroyDrvL2 755 763 sub ax,ax 756 ret16 764 ret16 757 765 DestroyDrvL2: mov ax,0001H 758 766 ret16 … … 788 796 GetNodeInfo_L1: mov ax,0014H 789 797 ret16 790 nop 798 nop 791 799 GetNodeInfo_L2: test byte ptr _RMFlags,02H 792 800 je short GetNodeInfo_L3 … … 799 807 ALIGN 2 800 808 PUBLIC _RMGetNodeInfo16 801 _RMGetNodeInfo16 proc far 809 _RMGetNodeInfo16 proc far 802 810 enter32 803 811 xor eax, eax … … 825 833 mov sp,bp 826 834 ret16 827 RMDevIDToHandleList_L1: 835 RMDevIDToHandleList_L1: 828 836 mov ax,0014H 829 837 ret16 830 nop 831 RMDevIDToHandleList_L2: 838 nop 839 RMDevIDToHandleList_L2: 832 840 test byte ptr _RMFlags,02H 833 841 je short RMDevIDToHandleList_L3 834 842 sub ax,ax 835 843 ret16 836 nop 837 RMDevIDToHandleList_L3: 844 nop 845 RMDevIDToHandleList_L3: 838 846 mov ax,0001H 839 847 ret16 840 nop 848 nop 841 849 _RMDevIDToHandleListOrg endp 842 850 843 851 ALIGN 2 844 852 PUBLIC _RMDevIDToHandleList16 845 _RMDevIDToHandleList16 proc far 853 _RMDevIDToHandleList16 proc far 846 854 enter32 847 855 xor eax, eax … … 874 882 call near ptr _CallRM 875 883 ret16 876 nop 884 nop 877 885 RMHandleToResourceHandleList_L1: 878 886 mov ax,0014H 879 887 ret16 880 nop 888 nop 881 889 RMHandleToResourceHandleList_L2: 882 890 test byte ptr _RMFlags,02H … … 884 892 sub ax,ax 885 893 ret16 886 nop 894 nop 887 895 RMHandleToResourceHandleList_L3: 888 896 mov ax,0001H 889 897 ret16 890 nop 898 nop 891 899 _RMHandleToResourceHandleListOrg endp 892 900 893 901 ALIGN 2 894 902 PUBLIC _RMHandleToResourceHandleList16 895 _RMHandleToResourceHandleList16 proc far 903 _RMHandleToResourceHandleList16 proc far 896 904 enter32 897 905 xor eax, eax … … 1082 1090 shr edx, 13 1083 1091 and edx, 3 1084 1092 1085 1093 ;has the OS/2 kernel finally changed the DPL to 0? 1086 1094 cmp edx, 0 … … 1089 1097 mov SelRef, 0 1090 1098 jmp short @@endchange 1091 1099 1092 1100 @@changedpl: 1093 1101 mov oldDPL, eax … … 1101 1109 inc SelRef 1102 1110 @@fixdpl_end: 1103 ret 1104 FixSelDPL endp 1111 ret 1112 FixSelDPL endp 1105 1113 ;;****************************************************************************** 1106 1114 ; RestoreSelDPL: … … 1114 1122 cmp fWrongDPL, 1 1115 1123 jne short @@restdpl_end 1116 1124 1117 1125 cmp SelRef, 1 1118 1126 jne short @@restdpl_endrest … … 1138 1146 ;******************************************************************************* 1139 1147 ;Copy parameters to 16 bits stack and call 16:32 IDC handler 1140 ; 1148 ; 1141 1149 ; Paramters: IDC16_HANDLER pHandler 1142 1150 ; ULONG cmd … … 1159 1167 call fword ptr [ebx] 1160 1168 add sp, 12 1161 1169 1162 1170 DevThunkStackTo32_Int 1163 1171 … … 1198 1206 cmp eax, 0 1199 1207 jne @@stackswitchfail_strat 1200 1208 1201 1209 call ALSA_STRATEGY 1202 1210 … … 1224 1232 ;******************************************************************************* 1225 1233 ALIGN 4 1226 IDC_ proc far 1234 IDC_ proc far 1227 1235 push ds 1228 1236 push es … … 1261 1269 ;******************************************************************************* 1262 1270 ALIGN 4 1263 TIMER_ proc far 1271 TIMER_ proc far 1264 1272 push ds 1265 1273 push es … … 1271 1279 mov es, eax 1272 1280 1281 IFDEF DEBUG 1282 add DbgU32TimerCnt, 1 1283 ENDIF 1284 1273 1285 IFDEF FLATSTACK 1274 1286 DevThunkStackTo32 … … 1285 1297 int 3 1286 1298 call ALSA_TIMER_ 1299 ENDIF 1300 IFDEF DEBUG 1301 add DbgU32TimerCnt, -1 1287 1302 ENDIF 1288 1303 … … 1316 1331 1317 1332 pushfd 1333 1334 IFDEF DEBUG 1335 add DbgU32IntCnt, 1 1336 ENDIF 1337 1318 1338 ; At this point a cli is redundant 1319 1339 ; we enter the interrupt handler with interrupts disabled. … … 1329 1349 1330 1350 DevThunkStackTo16 1331 1351 1332 1352 @@stackswitchfail_irq: 1333 1353 ELSE … … 1336 1356 ENDIF 1337 1357 1358 IFDEF DEBUG 1359 add DbgU32IntCnt, -1 1360 ENDIF 1361 1338 1362 ;restore flags 1339 1363 popfd … … 1348 1372 1349 1373 endofirq: 1350 1374 1351 1375 pop gs 1352 1376 pop fs … … 1534 1558 1535 1559 stackbase dd 0 1536 stacksel dd 0 1560 stacksel dd 0 1537 1561 ELSE 1538 1562 … … 1560 1584 _MSG_TABLE32 dw OFFSET DATA16:_MSG_TABLE16 1561 1585 dw SEG DATA16:_MSG_TABLE16 1562 1563 ;16:16 address of driver name 1586 1587 ;16:16 address of driver name 1564 1588 PDDName dw OFFSET DATA16:pddname16 1565 1589 dw SEG DATA16:pddname16
Note:
See TracChangeset
for help on using the changeset viewer.