Changeset 01e48c1 in mainline
- Timestamp:
- 2005-09-15T21:02:27Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0a50f59
- Parents:
- d6dcdd2e
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/amd64/include/mm/frame.h
rd6dcdd2e r01e48c1 1 1 /* 2 * Copyright (C) 2005 Martin Decky2 * Copyright (C) 2005 Ondrej Palkovsky 3 3 * All rights reserved. 4 4 * -
arch/amd64/include/mm/page.h
rd6dcdd2e r01e48c1 1 1 /* 2 * Copyright (C) 2005 Martin Decky2 * Copyright (C) 2005 Ondrej Palkovsky 3 3 * All rights reserved. 4 4 * -
arch/amd64/include/mm/vm.h
rd6dcdd2e r01e48c1 1 1 /* 2 * Copyright (C) 2005 Martin Decky2 * Copyright (C) 2005 Ondrej Palkovsky 3 3 * All rights reserved. 4 4 * -
arch/ia32/src/acpi/madt.c
rd6dcdd2e r01e48c1 113 113 int madt_cmp(void * a, void * b) 114 114 { 115 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);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 119 } 120 120 121 121 void acpi_madt_parse(void) 122 122 { 123 124 125 123 struct madt_apic_header *end = (struct madt_apic_header *) (((__u8 *) acpi_madt) + acpi_madt->header.length); 126 124 struct madt_apic_header *h; -
src/lib/sort.c
rd6dcdd2e r01e48c1 32 32 #include <panic.h> 33 33 34 #define EBUFSIZE 32 35 34 36 static void _qsort(void * data, count_t n, size_t e_size, int (* cmp) (void * a, void * b), void * pivot, void * tmp); 35 37 … … 38 40 */ 39 41 void qsort(void * data, count_t n, size_t e_size, int (* cmp) (void * a, void * b)) { 40 void * tmp = (void *) malloc(e_size); 41 void * pivot = (void *) malloc(e_size); 42 __u8 buf_tmp[EBUFSIZE]; 43 __u8 buf_pivot[EBUFSIZE]; 44 void * tmp = buf_tmp; 45 void * pivot = buf_pivot; 46 47 if (e_size > EBUFSIZE) { 48 pivot = (void *) malloc(e_size); 49 tmp = (void *) malloc(e_size); 42 50 43 if (!tmp || !pivot) { 44 panic("Cannot allocate memory\n"); 51 if (!tmp || !pivot) { 52 panic("Cannot allocate memory\n"); 53 } 45 54 } 46 55 47 56 _qsort(data, n, e_size, cmp, pivot, tmp); 48 57 49 free(tmp); 50 free(pivot); 58 if (e_size > EBUFSIZE) { 59 free(tmp); 60 free(pivot); 61 } 51 62 } 52 63 53 64 54 65 void bubblesort(void * data, count_t n, size_t e_size, int (* cmp) (void * a, void * b)) { 66 __u8 buf_slot[EBUFSIZE]; 55 67 bool done = false; 56 68 void * p; 57 void * slot = (void *) malloc(e_size); 69 void * slot = buf_slot; 70 71 if (e_size > EBUFSIZE) { 72 slot = (void *) malloc(e_size); 73 74 if (!slot) { 75 panic("Cannot allocate memory\n"); 76 } 77 } 58 78 59 79 while (!done) { … … 69 89 } 70 90 71 free(slot); 91 if (e_size > EBUFSIZE) { 92 free(slot); 93 } 72 94 } 73 95
Note:
See TracChangeset
for help on using the changeset viewer.