Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 577fe9b6 in mainline


Ignore:
Timestamp:
2011-08-07T22:09:26Z (10 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master
Children:
699f3bc
Parents:
26fb118a
Message:

Support for calling SAL procedures from the loader.

  • Added sal_call() to perform and wrap around calls to SAL.
  • Added sal_base_clock_frequency() to read the system base frequency.
Location:
boot/arch/ia64
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • boot/arch/ia64/Makefile.inc

    r26fb118a r577fe9b6  
    4646        arch/$(BARCH)/src/main.c \
    4747        arch/$(BARCH)/src/sal.c \
     48        arch/$(BARCH)/src/sal_asm.S \
    4849        arch/$(BARCH)/src/putchar.c \
    4950        $(COMPS_C) \
  • boot/arch/ia64/include/sal.h

    r26fb118a r577fe9b6  
    3232#include <arch/types.h>
    3333#include <typedefs.h>
     34
     35/*
     36 * Essential SAL procedures' IDs
     37 */
     38#define SAL_FREQ_BASE   0x1000012
    3439
    3540typedef struct {
     
    103108extern void sal_system_table_parse(sal_system_table_header_t *);
    104109
     110extern uint64_t sal_base_clock_frequency(void);
     111
     112#define sal_call_1_1(id, arg1, ret1) \
     113        sal_call((id), (arg1), 0, 0, 0, 0, 0, 0, (ret1), NULL, NULL)
     114
     115extern uint64_t sal_call(uint64_t, uint64_t, uint64_t, uint64_t, uint64_t,
     116    uint64_t, uint64_t, uint64_t, uint64_t *, uint64_t *, uint64_t *);
     117
    105118#endif
  • boot/arch/ia64/src/main.c

    r26fb118a r577fe9b6  
    118118}
    119119
    120 static void read_sal_configuration(void)
    121 {
    122         if (bootpar && bootpar->efi_system_table) {
    123                 /* TODO: read the real values from SAL */
     120static void read_pal_configuration(void)
     121{
     122        if (bootpar) {
     123                /* TODO: read the real value from PAL */
    124124                bootinfo.freq_scale = DEFAULT_FREQ_SCALE;
    125                 bootinfo.sys_freq = DEFAULT_SYS_FREQ;
    126                
    127                 efi_guid_t sal_guid = SAL_SYSTEM_TABLE_GUID;
    128                 sal_system_table_header_t *sal_st;
    129                
    130                 sal_st = efi_vendor_table_find(
    131                     (efi_system_table_t *) bootpar->efi_system_table, sal_guid);
    132 
    133                 sal_system_table_parse(sal_st);
    134125        } else {
    135126                /* Configure default values for simulators. */
    136127                bootinfo.freq_scale = DEFAULT_FREQ_SCALE;
     128        }
     129}
     130
     131static void read_sal_configuration(void)
     132{
     133        if (bootpar && bootpar->efi_system_table) {
     134                efi_guid_t sal_guid = SAL_SYSTEM_TABLE_GUID;
     135                sal_system_table_header_t *sal_st;
     136               
     137                sal_st = efi_vendor_table_find(
     138                    (efi_system_table_t *) bootpar->efi_system_table, sal_guid);
     139
     140                sal_system_table_parse(sal_st);
     141               
     142                bootinfo.sys_freq = sal_base_clock_frequency();
     143        } else {
     144                /* Configure default values for simulators. */
    137145                bootinfo.sys_freq = DEFAULT_SYS_FREQ;
    138146        }
     
    198206        read_efi_memmap();
    199207        read_sal_configuration();
     208        read_pal_configuration();
    200209       
    201210        printf("Booting the kernel ...\n");
  • boot/arch/ia64/src/sal.c

    r26fb118a r577fe9b6  
    3030#include <arch/types.h>
    3131
    32 static sal_entrypoint_desc_t *sal_entrypoints;
    3332static sal_ap_wakeup_desc_t *sal_ap_wakeup;
     33
     34uint64_t pal_proc = 0;
     35
     36uint64_t sal_proc = 0;
     37uint64_t sal_proc_gp = 0;
    3438
    3539void sal_system_table_parse(sal_system_table_header_t *sst)
     
    4145                switch ((sal_sst_type_t) *cur) {
    4246                case SSTT_ENTRYPOINT_DESC:
    43                         sal_entrypoints = (sal_entrypoint_desc_t *) cur;
     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;
    4450                        cur += sizeof(sal_entrypoint_desc_t);
    4551                        break;
     
    6672}
    6773
     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.