- Timestamp:
- 2005-11-07T20:04:30Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c4e8ed9d
- Parents:
- d90ca68
- Location:
- genarch
- Files:
-
- 1 edited
- 4 moved
Legend:
- Unmodified
- Added
- Removed
-
genarch/Makefile.inc
rd90ca68 re16e036a 1 # Copyright (C) 2005 Martin Decky 2 # All rights reserved. 1 3 # 2 # Open Firmware 4 # Redistribution and use in source and binary forms, with or without 5 # modification, are permitted provided that the following conditions 6 # are met: 3 7 # 4 OFW=no 8 # - Redistributions of source code must retain the above copyright 9 # notice, this list of conditions and the following disclaimer. 10 # - Redistributions in binary form must reproduce the above copyright 11 # notice, this list of conditions and the following disclaimer in the 12 # documentation and/or other materials provided with the distribution. 13 # - The name of the author may not be used to endorse or promote products 14 # derived from this software without specific prior written permission. 15 # 16 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 # 5 27 6 ifeq ($(ARCH),ppc32) 7 OFW=yes 28 ## Accepted configuration directives 29 # 30 31 ifeq ($(CONFIG_OFW),y) 32 GENARCH_SOURCES += \ 33 genarch/src/firmware/ofw/ofw.c 8 34 endif 9 10 ifeq ($(ARCH),sparc64) 11 OFW=yes 35 ifeq ($(CONFIG_ACPI),y) 36 GENARCH_SOURCES += \ 37 genarch/src/acpi/acpi.c \ 38 genarch/src/acpi/matd.c 12 39 endif 13 14 #15 # Advanced Configuration and Power Interface (ACPI)16 #17 ACPI=no18 19 ifeq ($(ARCH),ia32)20 ACPI=yes21 endif22 23 ifeq ($(ARCH),amd64)24 ACPI=yes25 endif26 27 ifeq ($(ARCH),ia64)28 #ACPI=yes29 endif30 31 32 ifeq ($(OFW),yes)33 genarch_sources+=generic/src/genarch/firmware/ofw/ofw.c34 endif35 36 ifeq ($(ACPI),yes)37 genarch_sources+=generic/src/genarch/firmware/acpi/acpi.c \38 generic/src/genarch/firmware/acpi/madt.c39 endif -
genarch/include/acpi/acpi.h
rd90ca68 re16e036a 81 81 82 82 extern void acpi_init(void); 83 static int rsdp_check(__u8 *rsdp);84 static void map_sdt(struct acpi_sdt_header *sdt);85 83 extern int acpi_sdt_check(__u8 *sdt); 86 static void configure_via_rsdt(void);87 static void configure_via_xsdt(void);88 84 89 85 #endif /* __ACPI_H__ */ -
genarch/include/acpi/madt.h
rd90ca68 re16e036a 30 30 #define __MADT_H__ 31 31 32 #include <genarch/ firmware/acpi/acpi.h>32 #include <genarch/acpi/acpi.h> 33 33 #include <arch/smp/apic.h> 34 34 #include <arch/smp/smp.h> -
genarch/src/acpi/acpi.c
rd90ca68 re16e036a 27 27 */ 28 28 29 #include <genarch/ firmware/acpi/acpi.h>30 #include <genarch/ firmware/acpi/madt.h>29 #include <genarch/acpi/acpi.h> 30 #include <genarch/acpi/madt.h> 31 31 #include <arch/bios/bios.h> 32 32 … … 45 45 }; 46 46 47 int rsdp_check(__u8 *rsdp) {47 static int rsdp_check(__u8 *rsdp) { 48 48 struct acpi_rsdp *r = (struct acpi_rsdp *) rsdp; 49 49 __u8 sum = 0; … … 78 78 } 79 79 80 void map_sdt(struct acpi_sdt_header *sdt)80 static void map_sdt(struct acpi_sdt_header *sdt) 81 81 { 82 82 map_page_to_frame((__address) sdt, (__address) sdt, PAGE_NOT_CACHEABLE, 0); 83 83 map_structure((__address) sdt, sdt->length); 84 } 85 86 static void configure_via_rsdt(void) 87 { 88 int i, j, cnt = (acpi_rsdt->header.length - sizeof(struct acpi_sdt_header))/sizeof(__u32); 89 90 for (i=0; i<cnt; i++) { 91 for (j=0; j<sizeof(signature_map)/sizeof(struct acpi_signature_map); j++) { 92 struct acpi_sdt_header *h = (struct acpi_sdt_header *) (__native) acpi_rsdt->entry[i]; 93 94 map_sdt(h); 95 if (*((__u32 *) &h->signature[0])==*((__u32 *) &signature_map[j].signature[0])) { 96 if (!acpi_sdt_check((__u8 *) h)) 97 goto next; 98 *signature_map[j].sdt_ptr = h; 99 printf("%P: ACPI %s\n", *signature_map[j].sdt_ptr, signature_map[j].description); 100 } 101 } 102 next: 103 ; 104 } 105 } 106 107 static void configure_via_xsdt(void) 108 { 109 int i, j, cnt = (acpi_xsdt->header.length - sizeof(struct acpi_sdt_header))/sizeof(__u64); 110 111 for (i=0; i<cnt; i++) { 112 for (j=0; j<sizeof(signature_map)/sizeof(struct acpi_signature_map); j++) { 113 struct acpi_sdt_header *h = (struct acpi_sdt_header *) ((__address) acpi_rsdt->entry[i]); 114 115 map_sdt(h); 116 if (*((__u32 *) &h->signature[0])==*((__u32 *) &signature_map[j].signature[0])) { 117 if (!acpi_sdt_check((__u8 *) h)) 118 goto next; 119 *signature_map[j].sdt_ptr = h; 120 printf("%P: ACPI %s\n", *signature_map[j].sdt_ptr, signature_map[j].description); 121 } 122 } 123 next: 124 ; 125 } 126 84 127 } 85 128 … … 131 174 } 132 175 133 void configure_via_rsdt(void)134 {135 int i, j, cnt = (acpi_rsdt->header.length - sizeof(struct acpi_sdt_header))/sizeof(__u32);136 137 for (i=0; i<cnt; i++) {138 for (j=0; j<sizeof(signature_map)/sizeof(struct acpi_signature_map); j++) {139 struct acpi_sdt_header *h = (struct acpi_sdt_header *) (__native) acpi_rsdt->entry[i];140 141 map_sdt(h);142 if (*((__u32 *) &h->signature[0])==*((__u32 *) &signature_map[j].signature[0])) {143 if (!acpi_sdt_check((__u8 *) h))144 goto next;145 *signature_map[j].sdt_ptr = h;146 printf("%P: ACPI %s\n", *signature_map[j].sdt_ptr, signature_map[j].description);147 }148 }149 next:150 ;151 }152 }153 154 void configure_via_xsdt(void)155 {156 int i, j, cnt = (acpi_xsdt->header.length - sizeof(struct acpi_sdt_header))/sizeof(__u64);157 158 for (i=0; i<cnt; i++) {159 for (j=0; j<sizeof(signature_map)/sizeof(struct acpi_signature_map); j++) {160 struct acpi_sdt_header *h = (struct acpi_sdt_header *) ((__address) acpi_rsdt->entry[i]);161 162 map_sdt(h);163 if (*((__u32 *) &h->signature[0])==*((__u32 *) &signature_map[j].signature[0])) {164 if (!acpi_sdt_check((__u8 *) h))165 goto next;166 *signature_map[j].sdt_ptr = h;167 printf("%P: ACPI %s\n", *signature_map[j].sdt_ptr, signature_map[j].description);168 }169 }170 next:171 ;172 }173 174 } -
genarch/src/acpi/matd.c
rd90ca68 re16e036a 29 29 #include <arch/types.h> 30 30 #include <typedefs.h> 31 #include <genarch/ firmware/acpi/acpi.h>32 #include <genarch/ firmware/acpi/madt.h>31 #include <genarch/acpi/acpi.h> 32 #include <genarch/acpi/madt.h> 33 33 #include <arch/smp/apic.h> 34 34 #include <arch/smp/smp.h>
Note:
See TracChangeset
for help on using the changeset viewer.