aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/python/grt-modules.adb
blob: 7f40b05367aa818e84eed84139165403a1d0bd48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
--  GHDL Run Time (GRT) -  Modules.
--  Copyright (C) 2005 - 2014 Tristan Gingold
--
--  GHDL is free software; you can redistribute it and/or modify it under
--  the terms of the GNU General Public License as published by the Free
--  Software Foundation; either version 2, or (at your option) any later
--  version.
--
--  GHDL is distributed in the hope that it will be useful, but WITHOUT ANY
--  WARRANTY; without even the implied warranty of MERCHANTABILITY or
--  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
--  for more details.
--
--  You should have received a copy of the GNU General Public License
--  along with GCC; see the file COPYING.  If not, write to the Free
--  Software Foundation, 59 Temple Place - Suite 330, Boston, MA
--  02111-1307, USA.
--
--  As a special exception, if other files instantiate generics from this
--  unit, or you link this unit with other files to produce an executable,
--  this unit does not by itself cause the resulting executable to be
--  covered by the GNU General Public License. This exception does not
--  however invalidate any other reasons why the executable file might be
--  covered by the GNU Public License.
with Grt.Vital_Annotate;
with Grt.Disp_Tree;
with Grt.Disp_Rti;
with Grt.Psl;
with Grt.Backtraces;

package body Grt.Modules is
   procedure Register_Modules is
   begin
      --  List of modules to be registered.
      Grt.Disp_Tree.Register;
      Grt.Vital_Annotate.Register;
      Grt.Disp_Rti.Register;
      Grt.Psl.Register;
      Grt.Backtraces.Register;
   end Register_Modules;
end Grt.Modules;
an> apic_bigsmp; extern struct genapic apic_default; struct genapic *genapic; struct genapic *apic_probe[] __initdata = { &apic_summit, &apic_bigsmp, &apic_default, /* must be last */ NULL, }; static int cmdline_apic; void __init generic_bigsmp_probe(void) { /* * This routine is used to switch to bigsmp mode when * - There is no apic= option specified by the user * - generic_apic_probe() has choosen apic_default as the sub_arch * - we find more than 8 CPUs in acpi LAPIC listing with xAPIC support */ if (!cmdline_apic && genapic == &apic_default) if (apic_bigsmp.probe()) { genapic = &apic_bigsmp; printk(KERN_INFO "Overriding APIC driver with %s\n", genapic->name); } } static void __init genapic_apic_force(char *str) { int i; for (i = 0; apic_probe[i]; i++) if (!strcmp(apic_probe[i]->name, str)) genapic = apic_probe[i]; } custom_param("apic", genapic_apic_force); void __init generic_apic_probe(void) { int i; int changed = cmdline_apic = (genapic != NULL); for (i = 0; !changed && apic_probe[i]; i++) { if (apic_probe[i]->probe()) { changed = 1; genapic = apic_probe[i]; } } if (!changed) genapic = &apic_default; printk(KERN_INFO "Using APIC driver %s\n", genapic->name); } /* These functions can switch the APIC even after the initial ->probe() */ int __init mps_oem_check(struct mp_config_table *mpc, char *oem, char *productid) { int i; for (i = 0; apic_probe[i]; ++i) { if (apic_probe[i]->mps_oem_check(mpc,oem,productid)) { if (!cmdline_apic) { genapic = apic_probe[i]; printk(KERN_INFO "Switched to APIC driver `%s'.\n", genapic->name); } return 1; } } return 0; } int __init acpi_madt_oem_check(char *oem_id, char *oem_table_id) { int i; for (i = 0; apic_probe[i]; ++i) { if (apic_probe[i]->acpi_madt_oem_check(oem_id, oem_table_id)) { if (!cmdline_apic) { genapic = apic_probe[i]; printk(KERN_INFO "Switched to APIC driver `%s'.\n", genapic->name); } return 1; } } return 0; }