aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/STM32/STM32L4xx/GPT-ADC
ModeNameSize
-rw-r--r--.cproject4515logstatsplain
-rw-r--r--.project2760logstatsplain
-rw-r--r--Makefile6019logstatsplain
-rw-r--r--chconf.h21687logstatsplain
d---------debug149logstatsplain
-rw-r--r--halconf.h17178logstatsplain
-rw-r--r--main.c4872logstatsplain
-rw-r--r--mcuconf.h14133logstatsplain
-rw-r--r--readme.txt966logstatsplain
nos pre { color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px; } span.linenos { color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px; } td.linenos pre.special { color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px; } span.linenos.special { color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px; } .highlight .hll { background-color: #ffffcc } .highlight { background: #ffffff; } .highlight .c { color: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/*
 * Copyright 2004 James Cleverdon, IBM.
 * Subject to the GNU Public License, v.2
 *
 * Xen APIC subarch code.  Maximum 8 CPUs, logical delivery.
 *
 * Hacked for x86-64 by James Cleverdon from i386 architecture code by
 * Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and
 * James Cleverdon.
 *
 * Hacked to pieces for Xen by Chris Wright.
 */
#include <linux/config.h>
#include <linux/threads.h>
#include <linux/cpumask.h>
#include <linux/string.h>
#include <linux/kernel.h>
#include <linux/ctype.h>
#include <linux/init.h>
#ifdef CONFIG_XEN_PRIVILEGED_GUEST
#include <asm/smp.h>
#include <asm/ipi.h>
#else
#include <asm/apic.h>
#include <asm/apicdef.h>
#include <asm/genapic.h>
#endif
#include <xen/evtchn.h>

DECLARE_PER_CPU(int, ipi_to_irq[NR_IPIS]);

static inline void __send_IPI_one(unsigned int cpu, int vector)
{
	int irq = per_cpu(ipi_to_irq, cpu)[vector];
	BUG_ON(irq < 0);
	notify_remote_via_irq(irq);
}

void xen_send_IPI_shortcut(unsigned int shortcut, int vector, unsigned int dest)
{
	int cpu;

	switch (shortcut) {
	case APIC_DEST_SELF:
		__send_IPI_one(smp_processor_id(), vector);
		break;
	case APIC_DEST_ALLBUT:
		for (cpu = 0; cpu < NR_CPUS; ++cpu) {
			if (cpu == smp_processor_id())
				continue;
			if (cpu_isset(cpu, cpu_online_map)) {
				__send_IPI_one(cpu, vector);
			}
		}
		break;
	case APIC_DEST_ALLINC:
		for (cpu = 0; cpu < NR_CPUS; ++cpu) {
			if (cpu_isset(cpu, cpu_online_map)) {
				__send_IPI_one(cpu, vector);
			}
		}
		break;
	default:
		printk("XXXXXX __send_IPI_shortcut %08x vector %d\n", shortcut,
		       vector);
		break;
	}
}

static cpumask_t xen_target_cpus(void)
{
	return cpu_online_map;
}

/*
 * Set up the logical destination ID.
 * Do nothing, not called now.
 */
static void xen_init_apic_ldr(void)
{
	Dprintk("%s\n", __FUNCTION__);
	return;
}

static void xen_send_IPI_allbutself(int vector)
{
	/*
	 * if there are no other CPUs in the system then
	 * we get an APIC send error if we try to broadcast.
	 * thus we have to avoid sending IPIs in this case.
	 */
	Dprintk("%s\n", __FUNCTION__);
	if (num_online_cpus() > 1)
		xen_send_IPI_shortcut(APIC_DEST_ALLBUT, vector, APIC_DEST_LOGICAL);
}

static void xen_send_IPI_all(int vector)
{
	Dprintk("%s\n", __FUNCTION__);
	xen_send_IPI_shortcut(APIC_DEST_ALLINC, vector, APIC_DEST_LOGICAL);
}

static void xen_send_IPI_mask(cpumask_t cpumask, int vector)
{
	unsigned long mask = cpus_addr(cpumask)[0];
	unsigned int cpu;
	unsigned long flags;

	Dprintk("%s\n", __FUNCTION__);
	local_irq_save(flags);
	WARN_ON(mask & ~cpus_addr(cpu_online_map)[0]);

	for (cpu = 0; cpu < NR_CPUS; ++cpu) {
		if (cpu_isset(cpu, cpumask)) {
			__send_IPI_one(cpu, vector);
		}
	}
	local_irq_restore(flags);
}

#ifdef CONFIG_XEN_PRIVILEGED_GUEST
static int xen_apic_id_registered(void)
{
	/* better be set */
	Dprintk("%s\n", __FUNCTION__);
	return physid_isset(smp_processor_id(), phys_cpu_present_map);
}
#endif

static unsigned int xen_cpu_mask_to_apicid(cpumask_t cpumask)
{
	Dprintk("%s\n", __FUNCTION__);
	return cpus_addr(cpumask)[0] & APIC_ALL_CPUS;
}

static unsigned int phys_pkg_id(int index_msb)
{
	u32 ebx;

	Dprintk("%s\n", __FUNCTION__);
	ebx = cpuid_ebx(1);
	return ((ebx >> 24) & 0xFF) >> index_msb;
}

struct genapic apic_xen =  {
	.name = "xen",
#ifdef CONFIG_XEN_PRIVILEGED_GUEST
	.int_delivery_mode = dest_LowestPrio,
#endif
	.int_dest_mode = (APIC_DEST_LOGICAL != 0),
	.int_delivery_dest = APIC_DEST_LOGICAL | APIC_DM_LOWEST,
	.target_cpus = xen_target_cpus,
#ifdef CONFIG_XEN_PRIVILEGED_GUEST
	.apic_id_registered = xen_apic_id_registered,
#endif
	.init_apic_ldr = xen_init_apic_ldr,
	.send_IPI_all = xen_send_IPI_all,
	.send_IPI_allbutself = xen_send_IPI_allbutself,
	.send_IPI_mask = xen_send_IPI_mask,
	.cpu_mask_to_apicid = xen_cpu_mask_to_apicid,
	.phys_pkg_id = phys_pkg_id,
};