-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 297248 b: refs/heads/master c: 8978bfd h: refs/heads/master v: v3
- Loading branch information
Guan Xuetao
authored and
David Howells
committed
Mar 28, 2012
1 parent
9c2b739
commit 0c23acf
Showing
23 changed files
with
226 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: bd119c69239322caafdb64517a806037d0d0c70a | ||
refs/heads/master: 8978bfd2288adaa24d39fa15f57eb9e24ffeca12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Memory barrier implementations for PKUnity SoC and UniCore ISA | ||
* | ||
* Copyright (C) 2001-2012 GUAN Xue-tao | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
*/ | ||
#ifndef __UNICORE_BARRIER_H__ | ||
#define __UNICORE_BARRIER_H__ | ||
|
||
#define isb() __asm__ __volatile__ ("" : : : "memory") | ||
#define dsb() __asm__ __volatile__ ("" : : : "memory") | ||
#define dmb() __asm__ __volatile__ ("" : : : "memory") | ||
|
||
#define mb() barrier() | ||
#define rmb() barrier() | ||
#define wmb() barrier() | ||
#define smp_mb() barrier() | ||
#define smp_rmb() barrier() | ||
#define smp_wmb() barrier() | ||
#define read_barrier_depends() do { } while (0) | ||
#define smp_read_barrier_depends() do { } while (0) | ||
|
||
#define set_mb(var, value) do { var = value; smp_mb(); } while (0) | ||
|
||
#endif /* __UNICORE_BARRIER_H__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Bug handling for PKUnity SoC and UniCore ISA | ||
* | ||
* Copyright (C) 2001-2012 GUAN Xue-tao | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
*/ | ||
#ifndef __UNICORE_BUG_H__ | ||
#define __UNICORE_BUG_H__ | ||
|
||
#include <asm-generic/bug.h> | ||
|
||
struct pt_regs; | ||
struct siginfo; | ||
|
||
extern void die(const char *msg, struct pt_regs *regs, int err); | ||
extern void uc32_notify_die(const char *str, struct pt_regs *regs, | ||
struct siginfo *info, unsigned long err, unsigned long trap); | ||
|
||
extern asmlinkage void __backtrace(void); | ||
extern asmlinkage void c_backtrace(unsigned long fp, int pmode); | ||
|
||
extern void __show_regs(struct pt_regs *); | ||
|
||
#endif /* __UNICORE_BUG_H__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
* Atomics xchg/cmpxchg for PKUnity SoC and UniCore ISA | ||
* | ||
* Copyright (C) 2001-2012 GUAN Xue-tao | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
*/ | ||
#ifndef __UNICORE_CMPXCHG_H__ | ||
#define __UNICORE_CMPXCHG_H__ | ||
|
||
/* | ||
* Generate a link failure on undefined symbol if the pointer points to a value | ||
* of unsupported size. | ||
*/ | ||
extern void __xchg_bad_pointer(void); | ||
|
||
static inline unsigned long __xchg(unsigned long x, volatile void *ptr, | ||
int size) | ||
{ | ||
unsigned long ret; | ||
|
||
switch (size) { | ||
case 1: | ||
asm volatile("swapb %0, %1, [%2]" | ||
: "=&r" (ret) | ||
: "r" (x), "r" (ptr) | ||
: "memory", "cc"); | ||
break; | ||
case 4: | ||
asm volatile("swapw %0, %1, [%2]" | ||
: "=&r" (ret) | ||
: "r" (x), "r" (ptr) | ||
: "memory", "cc"); | ||
break; | ||
default: | ||
ret = __xchg_bad_pointer(); | ||
} | ||
|
||
return ret; | ||
} | ||
|
||
#define xchg(ptr, x) \ | ||
((__typeof__(*(ptr)))__xchg((unsigned long)(x), (ptr), sizeof(*(ptr)))) | ||
|
||
#include <asm-generic/cmpxchg-local.h> | ||
|
||
/* | ||
* cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make | ||
* them available. | ||
*/ | ||
#define cmpxchg_local(ptr, o, n) \ | ||
((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), \ | ||
(unsigned long)(o), (unsigned long)(n), sizeof(*(ptr)))) | ||
#define cmpxchg64_local(ptr, o, n) \ | ||
__cmpxchg64_local_generic((ptr), (o), (n)) | ||
|
||
#include <asm-generic/cmpxchg.h> | ||
|
||
#endif /* __UNICORE_CMPXCHG_H__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
* Process execution bits for PKUnity SoC and UniCore ISA | ||
* | ||
* Copyright (C) 2001-2012 GUAN Xue-tao | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
*/ | ||
#ifndef __UNICORE_EXEC_H__ | ||
#define __UNICORE_EXEC_H__ | ||
|
||
#define arch_align_stack(x) (x) | ||
|
||
#endif /* __UNICORE_EXEC_H__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Co-processor register definitions for PKUnity SoC and UniCore ISA | ||
* | ||
* Copyright (C) 2001-2012 GUAN Xue-tao | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
*/ | ||
#ifndef __UNICORE_HWDEF_COPRO_H__ | ||
#define __UNICORE_HWDEF_COPRO_H__ | ||
|
||
/* | ||
* Control Register bits (CP#0 CR1) | ||
*/ | ||
#define CR_M (1 << 0) /* MMU enable */ | ||
#define CR_A (1 << 1) /* Alignment abort enable */ | ||
#define CR_D (1 << 2) /* Dcache enable */ | ||
#define CR_I (1 << 3) /* Icache enable */ | ||
#define CR_B (1 << 4) /* Dcache write mechanism: write back */ | ||
#define CR_T (1 << 5) /* Burst enable */ | ||
#define CR_V (1 << 13) /* Vectors relocated to 0xffff0000 */ | ||
|
||
#ifndef __ASSEMBLY__ | ||
|
||
#define vectors_high() (cr_alignment & CR_V) | ||
|
||
extern unsigned long cr_no_alignment; /* defined in entry.S */ | ||
extern unsigned long cr_alignment; /* defined in entry.S */ | ||
|
||
static inline unsigned int get_cr(void) | ||
{ | ||
unsigned int val; | ||
asm("movc %0, p0.c1, #0" : "=r" (val) : : "cc"); | ||
return val; | ||
} | ||
|
||
static inline void set_cr(unsigned int val) | ||
{ | ||
asm volatile("movc p0.c1, %0, #0" : : "r" (val) : "cc"); | ||
isb(); | ||
} | ||
|
||
extern void adjust_cr(unsigned long mask, unsigned long set); | ||
|
||
#endif /* __ASSEMBLY__ */ | ||
|
||
#endif /* __UNICORE_HWDEF_COPRO_H__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Task switching for PKUnity SoC and UniCore ISA | ||
* | ||
* Copyright (C) 2001-2012 GUAN Xue-tao | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
*/ | ||
#ifndef __UNICORE_SWITCH_TO_H__ | ||
#define __UNICORE_SWITCH_TO_H__ | ||
|
||
struct task_struct; | ||
struct thread_info; | ||
|
||
/* | ||
* switch_to(prev, next) should switch from task `prev' to `next' | ||
* `prev' will never be the same as `next'. schedule() itself | ||
* contains the memory barrier to tell GCC not to cache `current'. | ||
*/ | ||
extern struct task_struct *__switch_to(struct task_struct *, | ||
struct thread_info *, struct thread_info *); | ||
|
||
#define switch_to(prev, next, last) \ | ||
do { \ | ||
last = __switch_to(prev, task_thread_info(prev), \ | ||
task_thread_info(next)); \ | ||
} while (0) | ||
|
||
#endif /* __UNICORE_SWITCH_TO_H__ */ |
Oops, something went wrong.