Merge branch 'master' of postpeta.pccluster.org:mckernel

This commit is contained in:
Balazs Gerofi bgerofi@riken.jp
2013-11-14 17:21:54 +09:00
39 changed files with 369 additions and 6 deletions

View File

@@ -1,3 +1,12 @@
/**
* \file elfboot.c
* License details are found in the file LICENSE.
* \brief
* Load an ELF image.
* \author Taku Shimosawa <shimosawa@is.s.u-tokyo.ac.jp> \par
* Copyright (C) 2011 - 2012 Taku Shimosawa
*/
#include <elf.h> #include <elf.h>
#include "test.h" #include "test.h"

View File

@@ -1,3 +1,11 @@
/**
* \file head.S
* License details are found in the file LICENSE.
* \brief
* Entry point calling to elfboot_main.
* \author Taku Shimosawa <shimosawa@is.s.u-tokyo.ac.jp> \par
* Copyright (C) 2011 - 2012 Taku Shimosawa
*/
.text .text
.globl _start .globl _start
_start: _start:

View File

@@ -1,3 +1,11 @@
/**
* \file test.h
* License details are found in the file LICENSE.
* \brief
* Header file of test of loading an ELF image.
* \author Taku Shimosawa <shimosawa@is.s.u-tokyo.ac.jp> \par
* Copyright (C) 2011 - 2012 Taku Shimosawa
*/
#ifdef TEST #ifdef TEST
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>

View File

@@ -1,3 +1,11 @@
/**
* \file test_main.c
* License details are found in the file LICENSE.
* \brief
* Test of loading an ELF file.
* \author Taku Shimosawa <shimosawa@is.s.u-tokyo.ac.jp> \par
* Copyright (C) 2011 - 2012 Taku Shimosawa
*/
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>

View File

@@ -1,4 +1,13 @@
#define X86_CPU_LOCAL_OFFSET_TSS 128 /**
* \file context.S
* License details are found in the file LICENSE.
* \brief
* Save registers of old context and load registers of new context.
* \author Taku Shimosawa <shimosawa@is.s.u-tokyo.ac.jp> \par
* Copyright (C) 2011 - 2012 Taku Shimosawa
*/
#define X86_CPU_LOCAL_OFFSET_TSS 128
#define X86_TSS_OFFSET_SP0 4 #define X86_TSS_OFFSET_SP0 4
#define X86_CPU_LOCAL_OFFSET_SP0 \ #define X86_CPU_LOCAL_OFFSET_SP0 \
(X86_CPU_LOCAL_OFFSET_TSS + X86_TSS_OFFSET_SP0) (X86_CPU_LOCAL_OFFSET_TSS + X86_TSS_OFFSET_SP0)

View File

@@ -1,3 +1,12 @@
/**
* \file cpu.c
* License details are found in the file LICENSE.
* \brief
* Control CPU.
* \author Taku Shimosawa <shimosawa@is.s.u-tokyo.ac.jp> \par
* Copyright (C) 2011 - 2012 Taku Shimosawa
*/
#include <ihk/cpu.h> #include <ihk/cpu.h>
#include <ihk/debug.h> #include <ihk/debug.h>
#include <types.h> #include <types.h>

View File

@@ -1,3 +1,12 @@
/**
* \file arch-memomry.h
* License details are found in the file LICENSE.
* \brief
* Define and declare memory management macros and functions
* \author Taku Shimosawa <shimosawa@is.s.u-tokyo.ac.jp> \par
* Copyright (C) 2011 - 2012 Taku Shimosawa
*/
#ifndef __HEADER_X86_COMMON_ARCH_MEMORY_H #ifndef __HEADER_X86_COMMON_ARCH_MEMORY_H
#define __HEADER_X86_COMMON_ARCH_MEMORY_H #define __HEADER_X86_COMMON_ARCH_MEMORY_H

View File

@@ -1,3 +1,12 @@
/**
* \file bitops.h
* License details are found in the file LICENSE.
* \brief
* Find last set bit in word.
* \author Taku Shimosawa <shimosawa@is.s.u-tokyo.ac.jp> \par
* Copyright (C) 2011 - 2012 Taku Shimosawa
*/
#ifndef HEADER_X86_COMMON_BITOPS_H #ifndef HEADER_X86_COMMON_BITOPS_H
#define HEADER_X86_COMMON_BITOPS_H #define HEADER_X86_COMMON_BITOPS_H

View File

@@ -1,3 +1,12 @@
/**
* \file cpulocal.h
* License details are found in the file LICENSE.
* \brief
* Declare information for individual CPUs.
* \author Taku Shimosawa <shimosawa@is.s.u-tokyo.ac.jp> \par
* Copyright (C) 2011 - 2012 Taku Shimosawa
*/
#ifndef HEADER_X86_COMMON_CPULOCAL_H #ifndef HEADER_X86_COMMON_CPULOCAL_H
#define HEADER_X86_COMMON_CPULOCAL_H #define HEADER_X86_COMMON_CPULOCAL_H

View File

@@ -1,3 +1,12 @@
/**
* \file atomic.h
* License details are found in the file LICENSE.
* \brief
* Atomic memory operations.
* \author Taku Shimosawa <shimosawa@is.s.u-tokyo.ac.jp> \par
* Copyright (C) 2011 - 2012 Taku Shimosawa
*/
#ifndef HEADER_X86_COMMON_IHK_ATOMIC_H #ifndef HEADER_X86_COMMON_IHK_ATOMIC_H
#define HEADER_X86_COMMON_IHK_ATOMIC_H #define HEADER_X86_COMMON_IHK_ATOMIC_H

View File

@@ -1,3 +1,13 @@
/**
* \file context.h
* License details are found in the file LICENSE.
* \brief
* Define types of registers belonging to context.
* Define macros to retrieve arguments of system call.
* \author Taku Shimosawa <shimosawa@is.s.u-tokyo.ac.jp> \par
* Copyright (C) 2011 - 2012 Taku Shimosawa
*/
#ifndef __HEADER_X86_COMMON_CONTEXT_H #ifndef __HEADER_X86_COMMON_CONTEXT_H
#define __HEADER_X86_COMMON_CONTEXT_H #define __HEADER_X86_COMMON_CONTEXT_H

View File

@@ -1,3 +1,12 @@
/**
* \file ikc.h
* License details are found in the file LICENSE.
* \brief
* Declare functions to initialize Inter-Kernel Communication
* \author Taku Shimosawa <shimosawa@is.s.u-tokyo.ac.jp> \par
* Copyright (C) 2011 - 2012 Taku Shimosawa
*/
#ifndef HEADER_X86_COMMON_IHK_IKC_H #ifndef HEADER_X86_COMMON_IHK_IKC_H
#define HEADER_X86_COMMON_IHK_IKC_H #define HEADER_X86_COMMON_IHK_IKC_H

View File

@@ -1,3 +1,12 @@
/**
* \file types.h
* Licence details are found in the file LICENSE.
* \brief
* typedef stdint.h like integer types
* \author Taku Shimosawa <shimosawa@is.s.u-tokyo.ac.jp> \par
* Copyright (C) 2011 - 2012 Taku Shimosawa
*/
#ifndef X86_COMMON_TYPES_H #ifndef X86_COMMON_TYPES_H
#define X86_COMMON_TYPES_H #define X86_COMMON_TYPES_H

View File

@@ -1,3 +1,13 @@
/**
* \file registers.h
* License details are found in the file LICENSE.
* \brief
* Declare macros and functions to manipulate
* Machine Specific Registers (MSR)
* \author Taku Shimosawa <shimosawa@is.s.u-tokyo.ac.jp> \par
* Copyright (C) 2011 - 2012 Taku Shimosawa
*/
#ifndef __HEADER_X86_COMMON_REGISTERS_H #ifndef __HEADER_X86_COMMON_REGISTERS_H
#define __HEADER_X86_COMMON_REGISTERS_H #define __HEADER_X86_COMMON_REGISTERS_H

View File

@@ -1,4 +1,13 @@
#define X86_CPU_LOCAL_OFFSET_TSS 128 /**
* \file interrupt.S
* License details are found in the file LICENSE.
* \brief
* Interrupt handler entries.
* \author Taku Shimosawa <shimosawa@is.s.u-tokyo.ac.jp> \par
* Copyright (C) 2011 - 2012 Taku Shimosawa
*/
#define X86_CPU_LOCAL_OFFSET_TSS 128
#define X86_TSS_OFFSET_SP0 4 #define X86_TSS_OFFSET_SP0 4
#define X86_CPU_LOCAL_OFFSET_SP0 \ #define X86_CPU_LOCAL_OFFSET_SP0 \
(X86_CPU_LOCAL_OFFSET_TSS + X86_TSS_OFFSET_SP0) (X86_CPU_LOCAL_OFFSET_TSS + X86_TSS_OFFSET_SP0)

View File

@@ -1,3 +1,13 @@
/**
* \file local.c
* License details are found in the file LICENSE.
* \brief
* Manipulate information for individual CPUs. These information
* resides in memory.
* \author Taku Shimosawa <shimosawa@is.s.u-tokyo.ac.jp> \par
* Copyright (C) 2011 - 2012 Taku Shimosawa
*/
#include <cpulocal.h> #include <cpulocal.h>
#include <ihk/atomic.h> #include <ihk/atomic.h>
#include <ihk/mm.h> #include <ihk/mm.h>

View File

@@ -1,3 +1,12 @@
/**
* \file lock.c
* License details are found in the file LICENSE.
* \brief
* Spin lock.
* \author Taku Shimosawa <shimosawa@is.s.u-tokyo.ac.jp> \par
* Copyright (C) 2011 - 2012 Taku Shimosawa
*/
#include <ihk/lock.h> #include <ihk/lock.h>
#if 0 #if 0

View File

@@ -1,3 +1,12 @@
/**
* \file memory.c
* License details are found in the file LICENSE.
* \brief
* Acquire physical pages and manipulate page table entries.
* \author Taku Shimosawa <shimosawa@is.s.u-tokyo.ac.jp> \par
* Copyright (C) 2011 - 2012 Taku Shimosawa
*/
#include <ihk/cpu.h> #include <ihk/cpu.h>
#include <ihk/debug.h> #include <ihk/debug.h>
#include <ihk/mm.h> #include <ihk/mm.h>

View File

@@ -1,3 +1,12 @@
/**
* \file mikc.c
* License details are found in the file LICENSE.
* \brief
* Initialize Inter-Kernel Communication (IKC)
* \author Taku Shimosawa <shimosawa@is.s.u-tokyo.ac.jp> \par
* Copyright (C) 2011 - 2012 Taku Shimosawa
*/
#include <ihk/ikc.h> #include <ihk/ikc.h>
#include <ihk/lock.h> #include <ihk/lock.h>
#include <ikc/msg.h> #include <ikc/msg.h>

View File

@@ -1,3 +1,12 @@
/**
* \file perfctr.c
* License details are found in the file LICENSE.
* \brief
* Manipulate performance counter.
* \author Taku Shimosawa <shimosawa@is.s.u-tokyo.ac.jp> \par
* Copyright (C) 2011 - 2012 Taku Shimosawa
*/
#include <ihk/perfctr.h> #include <ihk/perfctr.h>
#include <march.h> #include <march.h>
#include <errno.h> #include <errno.h>

View File

@@ -1,4 +1,14 @@
#define BOOT_CS 0x10 /**
* \file trampoline.c
* License details are found in the file LICENSE.
* \brief
* (1) Set-up page table address, (2) Transition to 64-bit and paging mode,
* (3) Jump to specified address
* \author Taku Shimosawa <shimosawa@is.s.u-tokyo.ac.jp> \par
* Copyright (C) 2011 - 2012 Taku Shimosawa
*/
#define BOOT_CS 0x10
#define BOOT_DS 0x18 #define BOOT_DS 0x18
#define BOOT_CS64 0x20 #define BOOT_CS64 0x20

View File

@@ -1,3 +1,15 @@
/**
* \file cls.c
* License details are found in the file LICENSE.
* \brief
* Initialization of cpu local variable
* \author Taku Shimosawa <shimosawa@is.s.u-tokyo.ac.jp> \par
* Copyright (C) 2011 - 2012 Taku Shimosawa
*/
/*
* HISTORY:
*/
#include <kmsg.h> #include <kmsg.h>
#include <string.h> #include <string.h>
#include <ihk/cpu.h> #include <ihk/cpu.h>

View File

@@ -1,3 +1,15 @@
/**
* \file copy.c
* License details are found in the file LICENSE.
* \brief
* Memory copy using DMA controller
* \author Taku Shimosawa <shimosawa@is.s.u-tokyo.ac.jp> \par
* Copyright (C) 2011 - 2012 Taku Shimosawa
*/
/*
* HISTORY:
*/
#include <ihk/dma.h> #include <ihk/dma.h>
#include <amemcpy.h> #include <amemcpy.h>

View File

@@ -1,3 +1,15 @@
/**
* \file debug.c
* License details are found in the file LICENSE.
* \brief
* Output to kmsg
* \author Taku Shimosawa <shimosawa@is.s.u-tokyo.ac.jp> \par
* Copyright (C) 2011 - 2012 Taku Shimosawa
*/
/*
* HISTORY:
*/
#include <stdarg.h> #include <stdarg.h>
#include <string.h> #include <string.h>
#include <kmsg.h> #include <kmsg.h>

View File

@@ -1,3 +1,15 @@
/**
* \file listeners.c
* License details are found in the file LICENSE.
* \brief
* Usage example of ihk_ikc_listen_port()
* \author Taku Shimosawa <shimosawa@is.s.u-tokyo.ac.jp> \par
* Copyright (C) 2011 - 2012 Taku Shimosawa
*/
/*
* HISTORY:
*/
#include <types.h> #include <types.h>
#include <kmsg.h> #include <kmsg.h>
#include <ihk/cpu.h> #include <ihk/cpu.h>

View File

@@ -1,3 +1,15 @@
/**
* \file mikc.c
* License details are found in the file LICENSE.
* \brief
* Initialization of IKC master channel
* \author Taku Shimosawa <shimosawa@is.s.u-tokyo.ac.jp> \par
* Copyright (C) 2011 - 2012 Taku Shimosawa
*/
/*
* HISTORY:
*/
#include <kmsg.h> #include <kmsg.h>
#include <ihk/cpu.h> #include <ihk/cpu.h>
#include <ihk/debug.h> #include <ihk/debug.h>

View File

@@ -1,3 +1,12 @@
/**
* \file cpu.h
* License details are found in the file LICENSE.
* \brief
* Declare types and functions to control CPU.
* \author Taku Shimosawa <shimosawa@is.s.u-tokyo.ac.jp> \par
* Copyright (C) 2011 - 2012 Taku Shimosawa
*/
#ifndef IHK_CPU_H #ifndef IHK_CPU_H
#define IHK_CPU_H #define IHK_CPU_H

View File

@@ -1,3 +1,12 @@
/**
* \file debug.h
* License details are found in the file LICENSE.
* \brief
* Declare types and functions to print debug message (kmsg).
* \author Taku Shimosawa <shimosawa@is.s.u-tokyo.ac.jp> \par
* Copyright (C) 2011 - 2012 Taku Shimosawa
*/
#ifndef IHK_DEBUG_H #ifndef IHK_DEBUG_H
#define IHK_DEBUG_H #define IHK_DEBUG_H

View File

@@ -1,3 +1,12 @@
/**
* \file dma.h
* License details are found in the file LICENSE.
* \brief
* Declare types and functions for DMA.
* \author Taku Shimosawa <shimosawa@is.s.u-tokyo.ac.jp> \par
* Copyright (C) 2011 - 2012 Taku Shimosawa
*/
#ifndef __HEADER_GENERIC_INCLUDE_DMA_H #ifndef __HEADER_GENERIC_INCLUDE_DMA_H
#define __HEADER_GENERIC_INCLUDE_DMA_H #define __HEADER_GENERIC_INCLUDE_DMA_H

View File

@@ -1,3 +1,12 @@
/**
* \file lock.h
* License details are found in the file LICENSE.
* \brief
* Declare functions implementing spin lock.
* \author Taku Shimosawa <shimosawa@is.s.u-tokyo.ac.jp> \par
* Copyright (C) 2011 - 2012 Taku Shimosawa
*/
#ifndef __HEADER_GENERIC_IHK_LOCK #ifndef __HEADER_GENERIC_IHK_LOCK
#define __HEADER_GENERIC_IHK_LOCK #define __HEADER_GENERIC_IHK_LOCK

View File

@@ -1,3 +1,12 @@
/**
* \file mm.h
* License details are found in the file LICENSE.
* \brief
* Declare types and funcions for memory management.
* \author Taku Shimosawa <shimosawa@is.s.u-tokyo.ac.jp> \par
* Copyright (C) 2011 - 2012 Taku Shimosawa
*/
#ifndef __HEADER_GENERIC_IHK_MM_H #ifndef __HEADER_GENERIC_IHK_MM_H
#define __HEADER_GENERIC_IHK_MM_H #define __HEADER_GENERIC_IHK_MM_H

View File

@@ -1,3 +1,13 @@
/**
* \file page_alloc.h
* License details are found in the file LICENSE.
* \brief
* Declare functions acquire physical pages and assign virtual addresses
* to them.
* \author Taku Shimosawa <shimosawa@is.s.u-tokyo.ac.jp> \par
* Copyright (C) 2011 - 2012 Taku Shimosawa
*/
#ifndef __HEADER_GENERIC_IHK_PAGE_ALLOC #ifndef __HEADER_GENERIC_IHK_PAGE_ALLOC
#define __HEADER_GENERIC_IHK_PAGE_ALLOC #define __HEADER_GENERIC_IHK_PAGE_ALLOC

View File

@@ -1,3 +1,12 @@
/**
* \file perfctr.h
* License details are found in the file LICENSE.
* \brief
* Declare type and functions to manipulate performance counters.
* \author Taku Shimosawa <shimosawa@is.s.u-tokyo.ac.jp> \par
* Copyright (C) 2011 - 2012 Taku Shimosawa
*/
#ifndef HEADER_GENERIC_IHK_PERFCTR_H #ifndef HEADER_GENERIC_IHK_PERFCTR_H
#define HEADER_GENERIC_IHK_PERFCTR_H #define HEADER_GENERIC_IHK_PERFCTR_H

View File

@@ -1,3 +1,12 @@
/**
* \file limits.h
* License details are found in the file LICENSE.
* \brief
* Define max and min of 32-bit integer.
* \author Taku Shimosawa <shimosawa@is.s.u-tokyo.ac.jp> \par
* Copyright (C) 2011 - 2012 Taku Shimosawa
*/
#ifndef __HEADER_LIMITS #ifndef __HEADER_LIMITS
#define __HEADER_LIMITS #define __HEADER_LIMITS

View File

@@ -1,3 +1,12 @@
/**
* \file memory.h
* License details are found in the file LICENSE.
* \brief
* Convert virtual address from/to physical address.
* \author Taku Shimosawa <shimosawa@is.s.u-tokyo.ac.jp> \par
* Copyright (C) 2011 - 2012 Taku Shimosawa
*/
#ifndef __HEADER_GENERIC_MEMORY_H #ifndef __HEADER_GENERIC_MEMORY_H
#define __HEADER_GENERIC_MEMORY_H #define __HEADER_GENERIC_MEMORY_H

View File

@@ -1,3 +1,12 @@
/**
* \file string.h
* License details are found in the file LICENSE.
* \brief
* Declare string manipulation functions.
* \author Taku Shimosawa <shimosawa@is.s.u-tokyo.ac.jp> \par
* Copyright (C) 2011 - 2012 Taku Shimosawa
*/
#ifndef __STRING_H #ifndef __STRING_H
#define __STRING_H #define __STRING_H

View File

@@ -1,3 +1,12 @@
/**
* \file types.h
* License details are found in the file LICENSE.
* \brief
* typedef stdint.h like integer types
* \author Taku Shimosawa <shimosawa@is.s.u-tokyo.ac.jp> \par
* Copyright (C) 2011 - 2012 Taku Shimosawa
*/
#ifndef TYPES_H #ifndef TYPES_H
#define TYPES_H #define TYPES_H

View File

@@ -1,6 +1,10 @@
/* /**
* IHK - Generic page allocator (manycore version) * \file page_alloc.c
* (C) Copyright 2011 Taku Shimosawa. * License details are found in the file LICENSE.
* \brief
* IHK - Generic page allocator (manycore version)
* \author Taku Shimosawa <shimosawa@is.s.u-tokyo.ac.jp> \par
* Copyright (C) 2011 - 2012 Taku Shimosawa
*/ */
#include <types.h> #include <types.h>
#include <string.h> #include <string.h>

View File

@@ -1,3 +1,12 @@
/**
* \file page_alloc.c
* License details are found in the file LICENSE.
* \brief
* Manipulate strings.
* \author Taku Shimosawa <shimosawa@is.s.u-tokyo.ac.jp> \par
* Copyright (C) 2011 - 2012 Taku Shimosawa
*/
#include <string.h> #include <string.h>
size_t strlen(const char *p) size_t strlen(const char *p)