Rev 3908 | Rev 4423 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3908 | Rev 4265 | ||
---|---|---|---|
Line 200... | Line 200... | ||
200 | jz .nothing |
200 | jz .nothing |
201 | ; 1c. Allocate memory for device data. |
201 | ; 1c. Allocate memory for device data. |
202 | ; For now, we need sizeof.usb_device_data and extra 8 bytes for GET_DESCRIPTOR |
202 | ; For now, we need sizeof.usb_device_data and extra 8 bytes for GET_DESCRIPTOR |
203 | ; input and output, see usb_after_set_address. Later we will reallocate it |
203 | ; input and output, see usb_after_set_address. Later we will reallocate it |
204 | ; to actual size needed for descriptors. |
204 | ; to actual size needed for descriptors. |
205 | push sizeof.usb_device_data + 8 |
205 | movi eax, sizeof.usb_device_data + 8 |
206 | pop eax |
- | |
207 | push ecx |
206 | push ecx |
208 | call malloc |
207 | call malloc |
209 | pop ecx |
208 | pop ecx |
210 | ; 1d. If failed, free the bus address and return zero. |
209 | ; 1d. If failed, free the bus address and return zero. |
211 | test eax, eax |
210 | test eax, eax |
Line 496... | Line 495... | ||
496 | mov ecx, sizeof.usb_device_data / 4 |
495 | mov ecx, sizeof.usb_device_data / 4 |
497 | rep movsd |
496 | rep movsd |
498 | pop edi esi |
497 | pop edi esi |
499 | call usb_reinit_pipe_list |
498 | call usb_reinit_pipe_list |
500 | ; 1d. Free the old memory. |
499 | ; 1d. Free the old memory. |
501 | ; Note that free destroys ebx. |
- | |
502 | push ebx |
- | |
503 | call free |
500 | call free |
504 | pop ebx |
- | |
505 | pop eax |
501 | pop eax |
506 | ; 2. Issue control transfer GET_DESCRIPTOR(DEVICE) for full descriptor. |
502 | ; 2. Issue control transfer GET_DESCRIPTOR(DEVICE) for full descriptor. |
507 | ; restore length saved in step 1a |
503 | ; restore length saved in step 1a |
508 | pop edx |
504 | pop edx |
509 | add eax, sizeof.usb_device_data |
505 | add eax, sizeof.usb_device_data |