mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-19 10:14:23 +08:00
1394f03221
This adds support for the Analog Devices Blackfin processor architecture, and currently supports the BF533, BF532, BF531, BF537, BF536, BF534, and BF561 (Dual Core) devices, with a variety of development platforms including those avaliable from Analog Devices (BF533-EZKit, BF533-STAMP, BF537-STAMP, BF561-EZKIT), and Bluetechnix! Tinyboards. The Blackfin architecture was jointly developed by Intel and Analog Devices Inc. (ADI) as the Micro Signal Architecture (MSA) core and introduced it in December of 2000. Since then ADI has put this core into its Blackfin processor family of devices. The Blackfin core has the advantages of a clean, orthogonal,RISC-like microprocessor instruction set. It combines a dual-MAC (Multiply/Accumulate), state-of-the-art signal processing engine and single-instruction, multiple-data (SIMD) multimedia capabilities into a single instruction-set architecture. The Blackfin architecture, including the instruction set, is described by the ADSP-BF53x/BF56x Blackfin Processor Programming Reference http://blackfin.uclinux.org/gf/download/frsrelease/29/2549/Blackfin_PRM.pdf The Blackfin processor is already supported by major releases of gcc, and there are binary and source rpms/tarballs for many architectures at: http://blackfin.uclinux.org/gf/project/toolchain/frs There is complete documentation, including "getting started" guides available at: http://docs.blackfin.uclinux.org/ which provides links to the sources and patches you will need in order to set up a cross-compiling environment for bfin-linux-uclibc This patch, as well as the other patches (toolchain, distribution, uClibc) are actively supported by Analog Devices Inc, at: http://blackfin.uclinux.org/ We have tested this on LTP, and our test plan (including pass/fails) can be found at: http://docs.blackfin.uclinux.org/doku.php?id=testing_the_linux_kernel [m.kozlowski@tuxland.pl: balance parenthesis in blackfin header files] Signed-off-by: Bryan Wu <bryan.wu@analog.com> Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl> Signed-off-by: Aubrey Li <aubrey.li@analog.com> Signed-off-by: Jie Zhang <jie.zhang@analog.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
144 lines
4.3 KiB
C
144 lines
4.3 KiB
C
/*
|
|
* File: include/asm-blackfin/thread_info.h
|
|
* Based on: include/asm-m68knommu/thread_info.h
|
|
* Author: LG Soft India
|
|
* Copyright (C) 2004-2005 Analog Devices Inc.
|
|
* Created: Tue Sep 21 2004
|
|
* Description: Blackfin low-level thread information
|
|
* Modified:
|
|
* Bugs: Enter bugs at http://blackfin.uclinux.org/
|
|
*
|
|
* This program 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.
|
|
*
|
|
* This program 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 this program; see the file COPYING.
|
|
* If not, write to the Free Software Foundation,
|
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
*/
|
|
|
|
#ifndef _ASM_THREAD_INFO_H
|
|
#define _ASM_THREAD_INFO_H
|
|
|
|
#include <asm/page.h>
|
|
#include <asm/entry.h>
|
|
#include <asm/l1layout.h>
|
|
#include <linux/compiler.h>
|
|
|
|
#ifdef __KERNEL__
|
|
|
|
/* Thread Align Mask to reach to the top of the stack
|
|
* for any process
|
|
*/
|
|
#define ALIGN_PAGE_MASK 0xffffe000
|
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
typedef unsigned long mm_segment_t;
|
|
|
|
/*
|
|
* low level task data.
|
|
* If you change this, change the TI_* offsets below to match.
|
|
*/
|
|
|
|
struct thread_info {
|
|
struct task_struct *task; /* main task structure */
|
|
struct exec_domain *exec_domain; /* execution domain */
|
|
unsigned long flags; /* low level flags */
|
|
int cpu; /* cpu we're on */
|
|
int preempt_count; /* 0 => preemptable, <0 => BUG */
|
|
mm_segment_t addr_limit; /* address limit */
|
|
struct restart_block restart_block;
|
|
struct l1_scratch_task_info l1_task_info;
|
|
};
|
|
|
|
/*
|
|
* macros/functions for gaining access to the thread information structure
|
|
*/
|
|
#define INIT_THREAD_INFO(tsk) \
|
|
{ \
|
|
.task = &tsk, \
|
|
.exec_domain = &default_exec_domain, \
|
|
.flags = 0, \
|
|
.cpu = 0, \
|
|
.preempt_count = 1, \
|
|
.restart_block = { \
|
|
.fn = do_no_restart_syscall, \
|
|
}, \
|
|
}
|
|
#define init_thread_info (init_thread_union.thread_info)
|
|
#define init_stack (init_thread_union.stack)
|
|
|
|
/*
|
|
* Size of kernel stack for each process. This must be a power of 2...
|
|
*/
|
|
#define THREAD_SIZE 8192 /* 2 pages */
|
|
|
|
/* How to get the thread information struct from C */
|
|
|
|
static inline struct thread_info *current_thread_info(void)
|
|
__attribute__ ((__const__));
|
|
|
|
/* Given a task stack pointer, you can find it's task structure
|
|
* just by masking it to the 8K boundary.
|
|
*/
|
|
static inline struct thread_info *current_thread_info(void)
|
|
{
|
|
struct thread_info *ti;
|
|
__asm__("%0 = sp;": "=&d"(ti):
|
|
);
|
|
return (struct thread_info *)((long)ti & ~8191UL);
|
|
}
|
|
|
|
/* thread information allocation */
|
|
#define alloc_thread_info(tsk) ((struct thread_info *) \
|
|
__get_free_pages(GFP_KERNEL, 1))
|
|
#define free_thread_info(ti) free_pages((unsigned long) (ti), 1)
|
|
#endif /* __ASSEMBLY__ */
|
|
|
|
/*
|
|
* Offsets in thread_info structure, used in assembly code
|
|
*/
|
|
#define TI_TASK 0
|
|
#define TI_EXECDOMAIN 4
|
|
#define TI_FLAGS 8
|
|
#define TI_CPU 12
|
|
#define TI_PREEMPT 16
|
|
|
|
#define PREEMPT_ACTIVE 0x4000000
|
|
|
|
/*
|
|
* thread information flag bit numbers
|
|
*/
|
|
#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
|
|
#define TIF_NOTIFY_RESUME 1 /* resumption notification requested */
|
|
#define TIF_SIGPENDING 2 /* signal pending */
|
|
#define TIF_NEED_RESCHED 3 /* rescheduling necessary */
|
|
#define TIF_POLLING_NRFLAG 4 /* true if poll_idle() is polling
|
|
TIF_NEED_RESCHED */
|
|
#define TIF_MEMDIE 5
|
|
#define TIF_RESTORE_SIGMASK 6 /* restore signal mask in do_signal() */
|
|
#define TIF_FREEZE 7 /* is freezing for suspend */
|
|
|
|
/* as above, but as bit values */
|
|
#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
|
|
#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
|
|
#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
|
|
#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
|
|
#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
|
|
#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
|
|
#define _TIF_FREEZE (1<<TIF_FREEZE)
|
|
|
|
#define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */
|
|
|
|
#endif /* __KERNEL__ */
|
|
|
|
#endif /* _ASM_THREAD_INFO_H */
|