You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

libprefix.S 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797
  1. /*
  2. * Copyright (C) 2006 Michael Brown <mbrown@fensystems.co.uk>.
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License as
  6. * published by the Free Software Foundation; either version 2 of the
  7. * License, or any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful, but
  10. * WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17. *
  18. */
  19. FILE_LICENCE ( GPL2_OR_LATER )
  20. .arch i386
  21. /**
  22. * High memory temporary load address
  23. *
  24. * Temporary buffer into which to copy (or decompress) our runtime
  25. * image, prior to calling get_memmap() and relocate(). We don't
  26. * actually leave anything here once install() has returned.
  27. *
  28. * We use the start of an even megabyte so that we don't have to worry
  29. * about the current state of the A20 line.
  30. *
  31. * We use 4MB rather than 2MB because some PXE stack / PMM BIOS
  32. * combinations are known to place data required by other UNDI ROMs
  33. * loader around the 2MB mark.
  34. */
  35. .globl HIGHMEM_LOADPOINT
  36. .equ HIGHMEM_LOADPOINT, ( 4 << 20 )
  37. /* Image compression enabled */
  38. #define COMPRESS 1
  39. #define CR0_PE 1
  40. /*****************************************************************************
  41. * Utility function: print character (with LF -> LF,CR translation)
  42. *
  43. * Parameters:
  44. * %al : character to print
  45. * %ds:di : output buffer (or %di=0 to print to console)
  46. * Returns:
  47. * %ds:di : next character in output buffer (if applicable)
  48. *****************************************************************************
  49. */
  50. .section ".prefix.lib", "awx", @progbits
  51. .code16
  52. .globl print_character
  53. print_character:
  54. /* Preserve registers */
  55. pushw %ax
  56. pushw %bx
  57. pushw %bp
  58. /* If %di is non-zero, write character to buffer and exit */
  59. testw %di, %di
  60. jz 1f
  61. movb %al, %ds:(%di)
  62. incw %di
  63. jmp 3f
  64. 1: /* Print character */
  65. movw $0x0007, %bx /* page 0, attribute 7 (normal) */
  66. movb $0x0e, %ah /* write char, tty mode */
  67. cmpb $0x0a, %al /* '\n'? */
  68. jne 2f
  69. int $0x10
  70. movb $0x0d, %al
  71. 2: int $0x10
  72. /* Restore registers and return */
  73. 3: popw %bp
  74. popw %bx
  75. popw %ax
  76. ret
  77. .size print_character, . - print_character
  78. /*****************************************************************************
  79. * Utility function: print a NUL-terminated string
  80. *
  81. * Parameters:
  82. * %ds:si : string to print
  83. * %ds:di : output buffer (or %di=0 to print to console)
  84. * Returns:
  85. * %ds:si : character after terminating NUL
  86. * %ds:di : next character in output buffer (if applicable)
  87. *****************************************************************************
  88. */
  89. .section ".prefix.lib", "awx", @progbits
  90. .code16
  91. .globl print_message
  92. print_message:
  93. /* Preserve registers */
  94. pushw %ax
  95. /* Print string */
  96. 1: lodsb
  97. testb %al, %al
  98. je 2f
  99. call print_character
  100. jmp 1b
  101. 2: /* Restore registers and return */
  102. popw %ax
  103. ret
  104. .size print_message, . - print_message
  105. /*****************************************************************************
  106. * Utility functions: print hex digit/byte/word/dword
  107. *
  108. * Parameters:
  109. * %al (low nibble) : digit to print
  110. * %al : byte to print
  111. * %ax : word to print
  112. * %eax : dword to print
  113. * %ds:di : output buffer (or %di=0 to print to console)
  114. * Returns:
  115. * %ds:di : next character in output buffer (if applicable)
  116. *****************************************************************************
  117. */
  118. .section ".prefix.lib", "awx", @progbits
  119. .code16
  120. .globl print_hex_dword
  121. print_hex_dword:
  122. rorl $16, %eax
  123. call print_hex_word
  124. rorl $16, %eax
  125. /* Fall through */
  126. .size print_hex_dword, . - print_hex_dword
  127. .globl print_hex_word
  128. print_hex_word:
  129. xchgb %al, %ah
  130. call print_hex_byte
  131. xchgb %al, %ah
  132. /* Fall through */
  133. .size print_hex_word, . - print_hex_word
  134. .globl print_hex_byte
  135. print_hex_byte:
  136. rorb $4, %al
  137. call print_hex_nibble
  138. rorb $4, %al
  139. /* Fall through */
  140. .size print_hex_byte, . - print_hex_byte
  141. .globl print_hex_nibble
  142. print_hex_nibble:
  143. /* Preserve registers */
  144. pushw %ax
  145. /* Print digit (technique by Norbert Juffa <norbert.juffa@amd.com> */
  146. andb $0x0f, %al
  147. cmpb $10, %al
  148. sbbb $0x69, %al
  149. das
  150. call print_character
  151. /* Restore registers and return */
  152. popw %ax
  153. ret
  154. .size print_hex_nibble, . - print_hex_nibble
  155. /*****************************************************************************
  156. * Utility function: print PCI bus:dev.fn
  157. *
  158. * Parameters:
  159. * %ax : PCI bus:dev.fn to print
  160. * %ds:di : output buffer (or %di=0 to print to console)
  161. * Returns:
  162. * %ds:di : next character in output buffer (if applicable)
  163. *****************************************************************************
  164. */
  165. .section ".prefix.lib", "awx", @progbits
  166. .code16
  167. .globl print_pci_busdevfn
  168. print_pci_busdevfn:
  169. /* Preserve registers */
  170. pushw %ax
  171. /* Print bus */
  172. xchgb %al, %ah
  173. call print_hex_byte
  174. /* Print ":" */
  175. movb $( ':' ), %al
  176. call print_character
  177. /* Print device */
  178. movb %ah, %al
  179. shrb $3, %al
  180. call print_hex_byte
  181. /* Print "." */
  182. movb $( '.' ), %al
  183. call print_character
  184. /* Print function */
  185. movb %ah, %al
  186. andb $0x07, %al
  187. call print_hex_nibble
  188. /* Restore registers and return */
  189. popw %ax
  190. ret
  191. .size print_pci_busdevfn, . - print_pci_busdevfn
  192. /*****************************************************************************
  193. * Utility function: clear current line
  194. *
  195. * Parameters:
  196. * %ds:di : output buffer (or %di=0 to print to console)
  197. * Returns:
  198. * %ds:di : next character in output buffer (if applicable)
  199. *****************************************************************************
  200. */
  201. .section ".prefix.lib", "awx", @progbits
  202. .code16
  203. .globl print_kill_line
  204. print_kill_line:
  205. /* Preserve registers */
  206. pushw %ax
  207. pushw %cx
  208. /* Print CR */
  209. movb $( '\r' ), %al
  210. call print_character
  211. /* Print 79 spaces */
  212. movb $( ' ' ), %al
  213. movw $79, %cx
  214. 1: call print_character
  215. loop 1b
  216. /* Print CR */
  217. movb $( '\r' ), %al
  218. call print_character
  219. /* Restore registers and return */
  220. popw %cx
  221. popw %ax
  222. ret
  223. .size print_kill_line, . - print_kill_line
  224. /****************************************************************************
  225. * flatten_real_mode (real-mode far call)
  226. *
  227. * Set up 4GB segment limits
  228. *
  229. * Parameters:
  230. * none
  231. * Returns:
  232. * none
  233. * Corrupts:
  234. * none
  235. ****************************************************************************
  236. */
  237. #ifndef KEEP_IT_REAL
  238. /* GDT for protected-mode calls */
  239. .section ".text16.early.data", "aw", @progbits
  240. .align 16
  241. flatten_gdt:
  242. flatten_gdt_limit: .word flatten_gdt_length - 1
  243. flatten_gdt_base: .long 0
  244. .word 0 /* padding */
  245. flatten_cs: /* 16-bit protected-mode flat code segment */
  246. .equ FLAT_CS, flatten_cs - flatten_gdt
  247. .word 0xffff, 0
  248. .byte 0, 0x9b, 0x8f, 0
  249. flatten_ss: /* 16-bit protected-mode flat stack segment */
  250. .equ FLAT_SS, flatten_ss - flatten_gdt
  251. .word 0xffff, 0
  252. .byte 0, 0x93, 0x8f, 0
  253. flatten_gdt_end:
  254. .equ flatten_gdt_length, . - flatten_gdt
  255. .size flatten_gdt, . - flatten_gdt
  256. .section ".text16.early.data", "aw", @progbits
  257. .align 16
  258. flatten_saved_gdt:
  259. .long 0, 0
  260. .size flatten_saved_gdt, . - flatten_saved_gdt
  261. .section ".text16.early", "awx", @progbits
  262. .code16
  263. flatten_real_mode:
  264. /* Preserve registers and flags */
  265. pushfl
  266. pushl %eax
  267. pushw %si
  268. pushw %gs
  269. pushw %fs
  270. pushw %es
  271. pushw %ds
  272. pushw %ss
  273. /* Set %ds for access to .text16.early.data variables */
  274. pushw %cs
  275. popw %ds
  276. /* Preserve original GDT */
  277. sgdt flatten_saved_gdt
  278. /* Set up GDT bases */
  279. xorl %eax, %eax
  280. movw %cs, %ax
  281. shll $4, %eax
  282. addl $flatten_gdt, %eax
  283. movl %eax, flatten_gdt_base
  284. movw %cs, %ax
  285. movw $flatten_cs, %si
  286. call set_seg_base
  287. movw %ss, %ax
  288. movw $flatten_ss, %si
  289. call set_seg_base
  290. /* Switch temporarily to protected mode and set segment registers */
  291. pushw %cs
  292. pushw $2f
  293. cli
  294. data32 lgdt flatten_gdt
  295. movl %cr0, %eax
  296. orb $CR0_PE, %al
  297. movl %eax, %cr0
  298. ljmp $FLAT_CS, $1f
  299. 1: movw $FLAT_SS, %ax
  300. movw %ax, %ss
  301. movw %ax, %ds
  302. movw %ax, %es
  303. movw %ax, %fs
  304. movw %ax, %gs
  305. movl %cr0, %eax
  306. andb $0!CR0_PE, %al
  307. movl %eax, %cr0
  308. lret
  309. 2: /* lret will ljmp to here */
  310. /* Restore GDT, registers and flags */
  311. data32 lgdt flatten_saved_gdt
  312. popw %ss
  313. popw %ds
  314. popw %es
  315. popw %fs
  316. popw %gs
  317. popw %si
  318. popl %eax
  319. popfl
  320. lret
  321. .size flatten_real_mode, . - flatten_real_mode
  322. .section ".text16.early", "awx", @progbits
  323. .code16
  324. set_seg_base:
  325. rolw $4, %ax
  326. movw %ax, 2(%si)
  327. andw $0xfff0, 2(%si)
  328. movb %al, 4(%si)
  329. andb $0x0f, 4(%si)
  330. ret
  331. .size set_seg_base, . - set_seg_base
  332. #endif /* KEEP_IT_REAL */
  333. /****************************************************************************
  334. * copy_bytes
  335. *
  336. * Copy bytes
  337. *
  338. * Parameters:
  339. * %ds:esi : source address
  340. * %es:edi : destination address
  341. * %ecx : length
  342. * Returns:
  343. * %ds:esi : next source address
  344. * %es:edi : next destination address
  345. * Corrupts:
  346. * None
  347. ****************************************************************************
  348. */
  349. #if ! COMPRESS
  350. .section ".prefix.lib", "awx", @progbits
  351. .code16
  352. copy_bytes:
  353. pushl %ecx
  354. rep addr32 movsb
  355. popl %ecx
  356. ret
  357. .size copy_bytes, . - copy_bytes
  358. #endif /* COMPRESS */
  359. /****************************************************************************
  360. * install_block
  361. *
  362. * Install block to specified address
  363. *
  364. * Parameters:
  365. * %esi : source physical address (must be a multiple of 16)
  366. * %edi : destination physical address (must be a multiple of 16)
  367. * %ecx : length of (decompressed) data
  368. * %edx : total length of block (including any uninitialised data portion)
  369. * Returns:
  370. * %esi : next source physical address (will be a multiple of 16)
  371. * %edi : next destination physical address (will be a multiple of 16)
  372. * Corrupts:
  373. * none
  374. ****************************************************************************
  375. */
  376. .section ".prefix.lib", "awx", @progbits
  377. .code16
  378. install_block:
  379. /* Preserve registers */
  380. pushw %ds
  381. pushw %es
  382. pushl %ecx
  383. /* Convert %esi and %edi to %ds:esi and %es:edi */
  384. shrl $4, %esi
  385. movw %si, %ds
  386. xorw %si, %si
  387. shll $4, %esi
  388. shrl $4, %edi
  389. movw %di, %es
  390. xorw %di, %di
  391. shll $4, %edi
  392. #if COMPRESS
  393. /* Decompress source to destination */
  394. call decompress16
  395. #else
  396. /* Copy source to destination */
  397. call copy_bytes
  398. #endif
  399. /* Zero .bss portion */
  400. negl %ecx
  401. addl %edx, %ecx
  402. pushw %ax
  403. xorw %ax, %ax
  404. rep addr32 stosb
  405. popw %ax
  406. /* Round up %esi and %edi to start of next blocks */
  407. addl $0xf, %esi
  408. andl $~0xf, %esi
  409. addl $0xf, %edi
  410. andl $~0xf, %edi
  411. /* Convert %ds:esi and %es:edi back to physical addresses */
  412. xorl %ecx, %ecx
  413. movw %ds, %cx
  414. shll $4, %ecx
  415. addl %ecx, %esi
  416. xorl %ecx, %ecx
  417. movw %es, %cx
  418. shll $4, %ecx
  419. addl %ecx, %edi
  420. /* Restore registers and return */
  421. popl %ecx
  422. popw %es
  423. popw %ds
  424. ret
  425. .size install_block, . - install_block
  426. /****************************************************************************
  427. * alloc_basemem
  428. *
  429. * Allocate space for .text16 and .data16 from top of base memory.
  430. * Memory is allocated using the BIOS free base memory counter at
  431. * 0x40:13.
  432. *
  433. * Parameters:
  434. * none
  435. * Returns:
  436. * %ax : .text16 segment address
  437. * %bx : .data16 segment address
  438. * Corrupts:
  439. * none
  440. ****************************************************************************
  441. */
  442. .section ".prefix.lib", "awx", @progbits
  443. .code16
  444. .globl alloc_basemem
  445. alloc_basemem:
  446. /* Preserve registers */
  447. pushw %fs
  448. /* FBMS => %ax as segment address */
  449. pushw $0x40
  450. popw %fs
  451. movw %fs:0x13, %ax
  452. shlw $6, %ax
  453. /* Calculate .data16 segment address */
  454. subw $_data16_memsz_pgh, %ax
  455. pushw %ax
  456. /* Calculate .text16 segment address */
  457. subw $_text16_memsz_pgh, %ax
  458. pushw %ax
  459. /* Update FBMS */
  460. shrw $6, %ax
  461. movw %ax, %fs:0x13
  462. /* Retrieve .text16 and .data16 segment addresses */
  463. popw %ax
  464. popw %bx
  465. /* Restore registers and return */
  466. popw %fs
  467. ret
  468. .size alloc_basemem, . - alloc_basemem
  469. /****************************************************************************
  470. * free_basemem
  471. *
  472. * Free space allocated with alloc_basemem.
  473. *
  474. * Parameters:
  475. * %ax : .text16 segment address
  476. * %bx : .data16 segment address
  477. * Returns:
  478. * %ax : 0 if successfully freed
  479. * Corrupts:
  480. * none
  481. ****************************************************************************
  482. */
  483. .section ".text16", "ax", @progbits
  484. .code16
  485. .globl free_basemem
  486. free_basemem:
  487. /* Preserve registers */
  488. pushw %fs
  489. /* Check FBMS counter */
  490. pushw %ax
  491. shrw $6, %ax
  492. pushw $0x40
  493. popw %fs
  494. cmpw %ax, %fs:0x13
  495. popw %ax
  496. jne 1f
  497. /* Check hooked interrupt count */
  498. cmpw $0, %cs:hooked_bios_interrupts
  499. jne 1f
  500. /* OK to free memory */
  501. addw $_text16_memsz_pgh, %ax
  502. addw $_data16_memsz_pgh, %ax
  503. shrw $6, %ax
  504. movw %ax, %fs:0x13
  505. xorw %ax, %ax
  506. 1: /* Restore registers and return */
  507. popw %fs
  508. ret
  509. .size free_basemem, . - free_basemem
  510. .section ".text16.data", "aw", @progbits
  511. .globl hooked_bios_interrupts
  512. hooked_bios_interrupts:
  513. .word 0
  514. .size hooked_bios_interrupts, . - hooked_bios_interrupts
  515. /****************************************************************************
  516. * install
  517. *
  518. * Install all text and data segments.
  519. *
  520. * Parameters:
  521. * none
  522. * Returns:
  523. * %ax : .text16 segment address
  524. * %bx : .data16 segment address
  525. * Corrupts:
  526. * none
  527. ****************************************************************************
  528. */
  529. .section ".prefix.lib", "awx", @progbits
  530. .code16
  531. .globl install
  532. install:
  533. /* Preserve registers */
  534. pushl %esi
  535. pushl %edi
  536. /* Allocate space for .text16 and .data16 */
  537. call alloc_basemem
  538. /* Image source = %cs:0000 */
  539. xorl %esi, %esi
  540. /* Image destination = HIGHMEM_LOADPOINT */
  541. movl $HIGHMEM_LOADPOINT, %edi
  542. /* Install text and data segments */
  543. call install_prealloc
  544. /* Restore registers and return */
  545. popl %edi
  546. popl %esi
  547. ret
  548. .size install, . - install
  549. /****************************************************************************
  550. * install_prealloc
  551. *
  552. * Install all text and data segments.
  553. *
  554. * Parameters:
  555. * %ax : .text16 segment address
  556. * %bx : .data16 segment address
  557. * %esi : Image source physical address (or zero for %cs:0000)
  558. * %edi : Decompression temporary area physical address
  559. * Corrupts:
  560. * none
  561. ****************************************************************************
  562. */
  563. .section ".prefix.lib", "awx", @progbits
  564. .code16
  565. .globl install_prealloc
  566. install_prealloc:
  567. /* Save registers */
  568. pushal
  569. pushw %ds
  570. pushw %es
  571. /* Sanity: clear the direction flag asap */
  572. cld
  573. /* Copy decompression temporary area physical address to %ebp */
  574. movl %edi, %ebp
  575. /* Install .text16.early */
  576. pushl %esi
  577. xorl %esi, %esi
  578. movw %cs, %si
  579. shll $4, %esi
  580. addl $_text16_early_lma, %esi
  581. movzwl %ax, %edi
  582. shll $4, %edi
  583. movl $_text16_early_filesz, %ecx
  584. movl $_text16_early_memsz, %edx
  585. call install_block /* .text16.early */
  586. popl %esi
  587. /* Open up access to payload */
  588. #ifndef KEEP_IT_REAL
  589. /* Flatten real mode */
  590. pushw %cs
  591. pushw $1f
  592. pushw %ax
  593. pushw $flatten_real_mode
  594. lret
  595. 1:
  596. #endif
  597. /* Calculate physical address of payload (i.e. first source) */
  598. testl %esi, %esi
  599. jnz 1f
  600. movw %cs, %si
  601. shll $4, %esi
  602. 1: addl %cs:payload_lma, %esi
  603. /* Install .text16.late and .data16 */
  604. movl $_text16_late_filesz, %ecx
  605. movl $_text16_late_memsz, %edx
  606. call install_block /* .text16.late */
  607. movzwl %bx, %edi
  608. shll $4, %edi
  609. movl $_data16_filesz, %ecx
  610. movl $_data16_memsz, %edx
  611. call install_block /* .data16 */
  612. /* Set up %ds for access to .data16 */
  613. movw %bx, %ds
  614. #ifdef KEEP_IT_REAL
  615. /* Initialise libkir */
  616. movw %ax, (init_libkir_vector+2)
  617. lcall *init_libkir_vector
  618. #else
  619. /* Install .text and .data to temporary area in high memory,
  620. * prior to reading the E820 memory map and relocating
  621. * properly.
  622. */
  623. movl %ebp, %edi
  624. movl $_textdata_filesz, %ecx
  625. movl $_textdata_memsz, %edx
  626. call install_block
  627. /* Initialise librm at current location */
  628. movw %ax, (init_librm_vector+2)
  629. movl %ebp, %edi
  630. lcall *init_librm_vector
  631. /* Call relocate() to determine target address for relocation.
  632. * relocate() will return with %esi, %edi and %ecx set up
  633. * ready for the copy to the new location.
  634. */
  635. movw %ax, (prot_call_vector+2)
  636. pushl $relocate
  637. lcall *prot_call_vector
  638. popl %edx /* discard */
  639. /* Copy code to new location */
  640. xorw %ax, %ax
  641. movw %ax, %es
  642. movl %ebp, %edi
  643. es rep addr32 movsb
  644. /* Initialise librm at new location */
  645. movl %ebp, %edi
  646. lcall *init_librm_vector
  647. #endif
  648. /* Restore registers */
  649. popw %es
  650. popw %ds
  651. popal
  652. ret
  653. .size install_prealloc, . - install_prealloc
  654. /* Vectors for far calls to .text16 functions. Must be in
  655. * .data16, since .prefix may not be writable.
  656. */
  657. .section ".data16", "aw", @progbits
  658. #ifdef KEEP_IT_REAL
  659. init_libkir_vector:
  660. .word init_libkir
  661. .word 0
  662. .size init_libkir_vector, . - init_libkir_vector
  663. #else
  664. init_librm_vector:
  665. .word init_librm
  666. .word 0
  667. .size init_librm_vector, . - init_librm_vector
  668. prot_call_vector:
  669. .word prot_call
  670. .word 0
  671. .size prot_call_vector, . - prot_call_vector
  672. #endif
  673. /* Payload address */
  674. .section ".prefix.lib", "awx", @progbits
  675. payload_lma:
  676. .long 0
  677. .section ".zinfo.fixup", "a", @progbits /* Compressor fixups */
  678. .ascii "ADHL"
  679. .long payload_lma
  680. .long 1
  681. .long 0
  682. .previous
  683. /****************************************************************************
  684. * uninstall
  685. *
  686. * Uninstall all text and data segments.
  687. *
  688. * Parameters:
  689. * %ax : .text16 segment address
  690. * %bx : .data16 segment address
  691. * Returns:
  692. * none
  693. * Corrupts:
  694. * none
  695. ****************************************************************************
  696. */
  697. .section ".text16", "ax", @progbits
  698. .code16
  699. .globl uninstall
  700. uninstall:
  701. call free_basemem
  702. ret
  703. .size uninstall, . - uninstall
  704. /* File split information for the compressor */
  705. #if COMPRESS
  706. #define PACK_OR_COPY "PACK"
  707. #else
  708. #define PACK_OR_COPY "COPY"
  709. #endif
  710. .section ".zinfo", "a", @progbits
  711. .ascii "COPY"
  712. .long _prefix_lma
  713. .long _prefix_filesz
  714. .long _max_align
  715. .ascii PACK_OR_COPY
  716. .long _text16_early_lma
  717. .long _text16_early_filesz
  718. .long _max_align
  719. .ascii "PAYL"
  720. .long 0
  721. .long 0
  722. .long _max_align
  723. .ascii PACK_OR_COPY
  724. .long _text16_late_lma
  725. .long _text16_late_filesz
  726. .long _max_align
  727. .ascii PACK_OR_COPY
  728. .long _data16_lma
  729. .long _data16_filesz
  730. .long _max_align
  731. .ascii PACK_OR_COPY
  732. .long _textdata_lma
  733. .long _textdata_filesz
  734. .long _max_align