port_io.s 772 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. .code32
  2. .text
  3. .globl asm_outb
  4. .type asm_outb @function
  5. asm_outb:
  6. pushl %eax
  7. pushl %edx
  8. movw 12(%esp), %dx
  9. movb 16(%esp), %al
  10. outb %al, %dx
  11. popl %edx
  12. popl %eax
  13. ret
  14. .globl asm_inb
  15. .type asm_inb @function
  16. asm_inb:
  17. pushl %edx
  18. movw 8(%esp), %dx
  19. inb %dx, %al
  20. popl %edx
  21. ret
  22. .globl asm_hlt
  23. .type asm_hlt @function
  24. asm_hlt:
  25. hlt
  26. ret
  27. .globl asm_cli
  28. .type asm_cli @function
  29. asm_cli:
  30. cli
  31. ret
  32. .globl asm_sti
  33. .type asm_sti @function
  34. asm_sti:
  35. sti
  36. ret
  37. .section .text.kinit
  38. .globl asm_enable_sse
  39. .type asm_enable_sse @function
  40. asm_enable_sse:
  41. movl %cr0, %eax
  42. andl $0xfffffff3, %eax
  43. orl $0b100010, %eax
  44. movl %eax, %cr0
  45. movl %cr4, %eax
  46. orl $0b11000000000, %eax
  47. movl %eax, %cr4
  48. fninit
  49. ret