Changeset 8491c48 in mainline
- Timestamp:
- 2005-09-11T12:19:35Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3156582
- Parents:
- a1493d9
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/ia32/src/acpi/madt.c
ra1493d9 r8491c48 39 39 #include <mm/heap.h> 40 40 #include <memstr.h> 41 #include <sort.h> 41 42 42 43 struct acpi_madt *acpi_madt = NULL; … … 46 47 static void madt_l_apic_entry(struct madt_l_apic *la, __u32 index); 47 48 static void madt_io_apic_entry(struct madt_io_apic *ioa, __u32 index); 49 static int madt_cmp(void * a, void * b); 48 50 49 51 struct madt_l_apic *madt_l_apic_entries = NULL; … … 109 111 } 110 112 113 int madt_cmp(void * a, void * b) 114 { 115 return 116 (((struct madt_apic_header *) a)->type > ((struct madt_apic_header *) b)->type) ? 117 1 : 118 ((((struct madt_apic_header *) a)->type < ((struct madt_apic_header *) b)->type) ? -1 : 0); 119 } 120 111 121 void acpi_madt_parse(void) 112 122 { 123 124 113 125 struct madt_apic_header *end = (struct madt_apic_header *) (((__u8 *) acpi_madt) + acpi_madt->header.length); 114 126 struct madt_apic_header *h; … … 132 144 133 145 134 /* Bublesort madt index. Quicksort later. */ 135 bool done = false; 136 137 while (!done) { 138 done = true; 139 for (index = 0; index < madt_entries_index_cnt - 1; index++) { 140 if (madt_entries_index[index]->type > madt_entries_index[index + 1]->type) { 141 h = madt_entries_index[index]; 142 madt_entries_index[index] = madt_entries_index[index + 1]; 143 madt_entries_index[index + 1] = h; 144 done = false; 145 } 146 } 147 148 } 149 146 /* Quicksort MADT index structure */ 147 qsort(madt_entries_index, madt_entries_index_cnt, sizeof(__address), &madt_cmp); 150 148 151 149 /* Parse MADT entries */ -
src/Makefile
ra1493d9 r8491c48 18 18 lib/memstr.c \ 19 19 lib/the.c \ 20 lib/sort.c \ 20 21 debug/print.c \ 21 22 debug/symtab.c \ -
src/lib/func.c
ra1493d9 r8491c48 77 77 return 1; 78 78 } 79
Note:
See TracChangeset
for help on using the changeset viewer.