Changeset e16e036a in mainline for genarch


Ignore:
Timestamp:
2005-11-07T20:04:30Z (20 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c4e8ed9d
Parents:
d90ca68
Message:

major build system revision (unfinished)
this patchset most definitively breaks a lot of things, be patient

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.
    13#
    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:
    37#
    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#
    527
    6 ifeq ($(ARCH),ppc32)
    7 OFW=yes
     28## Accepted configuration directives
     29#
     30
     31ifeq ($(CONFIG_OFW),y)
     32        GENARCH_SOURCES += \
     33                genarch/src/firmware/ofw/ofw.c
    834endif
    9 
    10 ifeq ($(ARCH),sparc64)
    11 OFW=yes
     35ifeq ($(CONFIG_ACPI),y)
     36        GENARCH_SOURCES += \
     37                genarch/src/acpi/acpi.c \
     38                genarch/src/acpi/matd.c
    1239endif
    13 
    14 #
    15 # Advanced Configuration and Power Interface (ACPI)
    16 #
    17 ACPI=no
    18 
    19 ifeq ($(ARCH),ia32)
    20 ACPI=yes
    21 endif
    22 
    23 ifeq ($(ARCH),amd64)
    24 ACPI=yes
    25 endif
    26 
    27 ifeq ($(ARCH),ia64)
    28 #ACPI=yes
    29 endif
    30 
    31 
    32 ifeq ($(OFW),yes)
    33 genarch_sources+=generic/src/genarch/firmware/ofw/ofw.c
    34 endif
    35 
    36 ifeq ($(ACPI),yes)
    37 genarch_sources+=generic/src/genarch/firmware/acpi/acpi.c \
    38                  generic/src/genarch/firmware/acpi/madt.c
    39 endif
  • genarch/include/acpi/acpi.h

    rd90ca68 re16e036a  
    8181
    8282extern void acpi_init(void);
    83 static int rsdp_check(__u8 *rsdp);
    84 static void map_sdt(struct acpi_sdt_header *sdt);
    8583extern int acpi_sdt_check(__u8 *sdt);
    86 static void configure_via_rsdt(void);
    87 static void configure_via_xsdt(void);
    8884
    8985#endif /* __ACPI_H__ */
  • genarch/include/acpi/madt.h

    rd90ca68 re16e036a  
    3030#define __MADT_H__
    3131
    32 #include <genarch/firmware/acpi/acpi.h>
     32#include <genarch/acpi/acpi.h>
    3333#include <arch/smp/apic.h>
    3434#include <arch/smp/smp.h>
  • genarch/src/acpi/acpi.c

    rd90ca68 re16e036a  
    2727 */
    2828
    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>
    3131#include <arch/bios/bios.h>
    3232
     
    4545};
    4646
    47 int rsdp_check(__u8 *rsdp) {
     47static int rsdp_check(__u8 *rsdp) {
    4848        struct acpi_rsdp *r = (struct acpi_rsdp *) rsdp;
    4949        __u8 sum = 0;
     
    7878}
    7979
    80 void map_sdt(struct acpi_sdt_header *sdt)
     80static void map_sdt(struct acpi_sdt_header *sdt)
    8181{
    8282        map_page_to_frame((__address) sdt, (__address) sdt, PAGE_NOT_CACHEABLE, 0);
    8383        map_structure((__address) sdt, sdt->length);
     84}
     85
     86static 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                }
     102next:
     103                ;
     104        }
     105}
     106
     107static 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                }
     123next:
     124                ;
     125        }
     126
    84127}
    85128
     
    131174}
    132175
    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  
    2929#include <arch/types.h>
    3030#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>
    3333#include <arch/smp/apic.h>
    3434#include <arch/smp/smp.h>
Note: See TracChangeset for help on using the changeset viewer.