Changeset 8ff0bd2 in mainline for boot/arch/ia64/src/sal.c


Ignore:
Timestamp:
2011-09-04T11:30:58Z (13 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
03bc76a
Parents:
d2c67e7 (diff), deac215e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes

File:
1 moved

Legend:

Unmodified
Added
Removed
  • boot/arch/ia64/src/sal.c

    rd2c67e7 r8ff0bd2  
    11/*
    2  * Copyright (c) 2006 Jakub Jermar
     2 * Copyright (c) 2011 Jakub Jermar
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 #ifndef KERN_FHC_H_
    30 #define KERN_FHC_H_
     29#include <arch/sal.h>
     30#include <arch/types.h>
    3131
    32 #include <genarch/ofw/ofw_tree.h>
    33 #include <typedefs.h>
    34 #include <ddi/irq.h>
    35 #include <typedefs.h>
     32static sal_ap_wakeup_desc_t *sal_ap_wakeup;
    3633
    37 typedef struct {
    38         uint64_t addr;
    39         uint32_t size;
    40 } __attribute__ ((packed)) ofw_fhc_reg_t;
     34extern uint64_t pal_proc;
    4135
    42 typedef struct {
    43         uint64_t child_base;
    44         uint64_t parent_base;
    45         uint32_t size;
    46 } __attribute__ ((packed)) ofw_fhc_range_t;
     36uint64_t sal_proc = 0;
     37uint64_t sal_proc_gp = 0;
    4738
    48 typedef struct {
    49         uint64_t addr;
    50         uint32_t size;
    51 } __attribute__ ((packed)) ofw_central_reg_t;
     39void sal_system_table_parse(sal_system_table_header_t *sst)
     40{
     41        uint8_t *cur = (uint8_t *) &sst[1];
     42        uint16_t entry;
    5243
    53 typedef struct {
    54         uint64_t child_base;
    55         uint64_t parent_base;
    56         uint32_t size;
    57 } __attribute__ ((packed)) ofw_central_range_t;
     44        for (entry = 0; entry < sst->entry_count; entry++) {
     45                switch ((sal_sst_type_t) *cur) {
     46                case SSTT_ENTRYPOINT_DESC:
     47                        pal_proc = ((sal_entrypoint_desc_t *) cur)->pal_proc;
     48                        sal_proc = ((sal_entrypoint_desc_t *) cur)->sal_proc;
     49                        sal_proc_gp = ((sal_entrypoint_desc_t *) cur)->sal_proc_gp;
     50                        cur += sizeof(sal_entrypoint_desc_t);
     51                        break;
     52                case SSTT_MEMORY_DESC:
     53                        cur += sizeof(sal_memory_desc_t);
     54                        break;
     55                case SSTT_PLATFORM_FEATURES_DESC:
     56                        cur += sizeof(sal_platform_features_desc_t);
     57                        break;
     58                case SSTT_TR_DESC:
     59                        cur += sizeof(sal_tr_desc_t);
     60                        break;
     61                case SSTT_PTC_COHERENCE_DOMAIN_DESC:
     62                        cur += sizeof(sal_ptc_coherence_domain_desc_t);
     63                        break;
     64                case SSTT_AP_WAKEUP_DESC:
     65                        sal_ap_wakeup = (sal_ap_wakeup_desc_t *) cur;
     66                        cur += sizeof(sal_ap_wakeup_desc_t);
     67                        break;
     68                default:
     69                        return;
     70                }
     71        }
     72}
    5873
    59 extern bool ofw_fhc_apply_ranges(ofw_tree_node_t *, ofw_fhc_reg_t *,
    60     uintptr_t *);
    61 extern bool ofw_central_apply_ranges(ofw_tree_node_t *, ofw_central_reg_t *,
    62     uintptr_t *);
    63 
    64 extern bool ofw_fhc_map_interrupt(ofw_tree_node_t *, ofw_fhc_reg_t *,
    65     uint32_t, int *, cir_t *, void **);
    66 
    67 #endif
     74uint64_t sal_base_clock_frequency(void)
     75{
     76        uint64_t freq;
     77       
     78        sal_call_1_1(SAL_FREQ_BASE, 0, &freq);
     79       
     80        return freq;
     81}
Note: See TracChangeset for help on using the changeset viewer.