Skip to content
Snippets Groups Projects
Commit 2a305ab6 authored by Armin Luntzer's avatar Armin Luntzer
Browse files

add missing headers

parent 7fc3b8b2
Branches
No related tags found
No related merge requests found
/**
* @file arch/sparc/include/irq.h
* @ingroup timing
* @author Armin Luntzer (armin.luntzer@univie.ac.at),
* @date July, 2016
*
* @copyright GPLv2
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope 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.
*
*/
#ifndef _SPARC_IRQ_H_
#define _SPARC_IRQ_H_
void leon_enable_irq(unsigned int irq, int cpu);
void leon_disable_irq(unsigned int irq, int cpu);
void leon_force_irq(unsigned int irq, int cpu);
#endif /* _SPARC_IRQ_H_ */
/**
* @file include/kernel/smp.h
*
* @copyright GPLv2
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope 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.
*
* @brief kernel-level SMP support functions
*
*/
#ifndef _KERNEL_SMP_H_
#define _KERNEL_SMP_H_
extern void smp_init(void);
extern int smp_cpu_id(void);
extern void smp_send_reschedule(int cpu);
#endif /* _KERNEL_SMP_H_ */
CC = sparc-elf-gcc #CC = sparc-elf-gcc
CC = sparc-gaisler-elf-gcc
SOURCEDIR = ./ SOURCEDIR = ./
INCLUDEDIR = ./ INCLUDEDIR = ./
BUILDDIR = ./ BUILDDIR = ./
PATH += PATH +=
CPPFLAGS := CPPFLAGS :=
CFLAGS := -r -mv8 -mhard-float -mfix-gr712rc -O2 -std=gnu89 -W -Wall \ #CFLAGS := -r -mv8 -mhard-float -mfix-gr712rc -O2 -std=gnu89 -W -Wall
CFLAGS := -r -mhard-float -mcpu=leon3 -std=gnu89 -W -Wall \
-Wextra -Werror -pedantic -Wshadow -Wuninitialized \ -Wextra -Werror -pedantic -Wshadow -Wuninitialized \
-fdiagnostics-show-option -Wcast-qual -Wformat=2 \ -fdiagnostics-show-option -Wcast-qual -Wformat=2 \
-nostartfiles -nostdlib -nostartfiles
LDFLAGS := LDFLAGS :=
SOURCES := $(wildcard *.c) SOURCES := $(wildcard *.c)
OBJECTS := $(patsubst %.c, $(BUILDDIR)/%.o, $(subst $(SOURCEDIR)/,, $(SOURCES))) OBJECTS := $(patsubst %.c, $(BUILDDIR)/%.o, $(subst $(SOURCEDIR)/,, $(SOURCES)))
......
#
# Automatically generated file; DO NOT EDIT.
# LeanOS Configuration
#
#
# SPARC Configuration
#
# CONFIG_LEON2 is not set
# CONFIG_LEON3 is not set
CONFIG_LEON4=y
# CONFIG_MMU is not set
CONFIG_CPU_CLOCK_FREQ=250000000
CONFIG_EXTRA_SPARC_PHYS_BANKS=0
CONFIG_SPARC_CPU_REG_WINDOWS=8
CONFIG_SPARC_TEXT_START=0x0
CONFIG_SPARC_FP_START=0x00200000
#
# Memory Management Settings
#
CONFIG_SPARC_MM_BLOCK_ORDER_MAX=29
CONFIG_SPARC_MM_BLOCK_ORDER_MIN=12
CONFIG_SPARC_INIT_PAGE_MAP_MAX_ENTRIES=8
CONFIG_SPARC_BOOTMEM_RESERVE_CHUNK_ORDER=20
CONFIG_SPARC_BOOTMEM_REQUEST_NEW_ON_DEMAND=y
CONFIG_SPARC_NESTED_IRQ=y
#
# General Setup
#
CONFIG_SMP_CPUS_MAX=4
CONFIG_STACK_SIZE=4096
CONFIG_KALLSYMS=y
CONFIG_CROSS_PLATFORM_TARGET=y
CONFIG_CROSS_COMPILE="sparc-gaisler-elf-"
# CONFIG_TARGET_COMPILER_BOOT_CODE is not set
CONFIG_ARCH_CUSTOM_BOOT_CODE=y
CONFIG_MODULES=y
CONFIG_EMBED_MODULES_IMAGE=y
# CONFIG_BUILD_XEN_KERNELS is not set
#
# Compile-time checks and compiler options
#
CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
# CONFIG_CC_OPTIMIZE_NONE is not set
# CONFIG_DEBUG_INFO is not set
CONFIG_KERNEL_PRINTK=y
CONFIG_KERNEL_LEVEL=6
CONFIG_IRQ_STATS_COLLECT=y
# CONFIG_TASK_PREEMPTION_DISABLE is not set
# CONFIG_SOC is not set
#
# Core Components
#
CONFIG_SYSCTL=y
CONFIG_MM=y
#
# Memory Management Debug Options
#
CONFIG_MM_DEBUG_DUMP=y
CONFIG_MM_DEBUG_DUMP_ALLOC_BITMAP=y
CONFIG_MM_DEBUG_DUMP_BLOCK_ALLLOC=y
CONFIG_MM_DEBUG_DUMP_BLOCK_STATS=y
CONFIG_PAGE_MAP=y
#
# Page Map Options
#
# CONFIG_PAGE_MAP_CHECK_PAGE_ALIGNMENT is not set
CONFIG_PAGE_MAP_MOVE_NODE_AVAIL_THRESH=1
CONFIG_CHUNK=y
CONFIG_AR=y
# CONFIG_SAMPLES is not set
...@@ -2,12 +2,53 @@ ...@@ -2,12 +2,53 @@
* *
* Note that at this point, we do not distinguish between an application * Note that at this point, we do not distinguish between an application
* payload and a module, this will be changed in the future. * payload and a module, this will be changed in the future.
*
* NOTE: this is configured for the GR740
*/ */
#include "glue.h" #include "glue.h"
__attribute__((unused))
static int show_timer_irq(void)
{
char buf0[64];
char buf1[64];
char buf2[64];
char buf3[64];
char buf4[64];
struct sysobj *sys_irq = NULL;
sys_irq = sysset_find_obj(sys_set, "/sys/irl/primary");
if (!sys_irq) {
printk("Error locating sysctl entry\n");
return -1;
}
while (1) {
sysobj_show_attr(sys_irq, "irl", buf0);
sysobj_show_attr(sys_irq, "1", buf1);
sysobj_show_attr(sys_irq, "2", buf2);
sysobj_show_attr(sys_irq, "3", buf3);
sysobj_show_attr(sys_irq, "4", buf4);
printk("IRQ total: %s\n"
"CPU timers: \n"
" [0]: %s\n"
" [1]: %s\n"
" [2]: %s\n"
" [3]: %s\n",
buf0, buf1, buf2, buf3, buf4);
sched_yield();
}
return 0;
}
/* some random function we use in our executable */ /* some random function we use in our executable */
...@@ -36,7 +77,7 @@ static int iasw(void *data) ...@@ -36,7 +77,7 @@ static int iasw(void *data)
*/ */
while (1) { while (1) {
printk("z"); printk("%d\n", i++);
sched_yield(); sched_yield();
} }
...@@ -55,8 +96,11 @@ int init_iasw(void) ...@@ -55,8 +96,11 @@ int init_iasw(void)
{ {
struct task_struct *t; struct task_struct *t;
t = kthread_create(iasw, (void *) 0, KTHREAD_CPU_AFFINITY_NONE, "IASW"); t = kthread_create(iasw, NULL, KTHREAD_CPU_AFFINITY_NONE, "IASW");
kthread_wake_up(t); /* allocate 98% of the cpu */
kthread_set_sched_edf(t, 100*1000, 99*1000, 98*1000);
if (kthread_wake_up(t) < 0)
printk("---- IASW NOT SCHEDULABLE---\n");
return 0; return 0;
} }
...@@ -69,7 +113,7 @@ int init_iasw(void) ...@@ -69,7 +113,7 @@ int init_iasw(void)
int exit_iasw(void) int exit_iasw(void)
{ {
printk("%s leaving\n", __func__); printk("program leaving\n");
/* kthread_destroy() */ /* kthread_destroy() */
return 0; return 0;
} }
......
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
#define GLUE_H #define GLUE_H
#include <stddef.h>
#include <stdint.h>
/* /*
* prototypes and declarations needed to build this demo * prototypes and declarations needed to build this demo
*/ */
...@@ -20,10 +23,20 @@ struct task_struct *kthread_create(int (*thread_fn)(void *data), ...@@ -20,10 +23,20 @@ struct task_struct *kthread_create(int (*thread_fn)(void *data),
void *data, int cpu, void *data, int cpu,
const char *namefmt, const char *namefmt,
...); ...);
void kthread_wake_up(struct task_struct *task); int kthread_wake_up(struct task_struct *task);
void sched_yield(void); void sched_yield(void);
int smp_cpu_id(void);
void kthread_set_sched_edf(struct task_struct *task,
unsigned long period_us,
unsigned long wcet_us,
unsigned long deadline_rel_us);
extern struct sysset *sys_set;
struct sysobj *sysset_find_obj(struct sysset *sysset, const char *path);
void sysobj_show_attr(struct sysobj *sobj, const char *name, char *buf);
#endif /* GLUE_H */ #endif /* GLUE_H */
...@@ -9,14 +9,15 @@ make || exit 1 ...@@ -9,14 +9,15 @@ make || exit 1
mydir=$PWD mydir=$PWD
srcdir=../../../../ srcdir=../../../../
cp config ${srcdir}/.config || exit 1 #cp config ${srcdir}/.config || exit 1
cp config-gr740 ${srcdir}/.config || exit 1
echo -e "CONFIG_EMBED_APPLICATION=\"$PWD/executable_demo\"" >> ${srcdir}/.config echo -e "CONFIG_EMBED_APPLICATION=\"$PWD/executable_demo\"" >> ${srcdir}/.config
cd ${srcdir} || exit 1 cd ${srcdir} || exit 1
make clean || exit 1 #make clean || exit 1
make || exit 1 make || exit 1
grmon -ftdi -u -ftdifreq 0 -jtagcable 3 -nb -c $mydir/grmon_cmds #grmon -ftdi -u -ftdifreq 0 -jtagcable 3 -nb -c $mydir/grmon_cmds
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment