Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 88274
b: refs/heads/master
c: 90768c0
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Apr 11, 2008
1 parent 63a1a41 commit a40d727
Show file tree
Hide file tree
Showing 228 changed files with 7,429 additions and 5,575 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7951f0b03a63d657c72c7d54d306ef3357e7e604
refs/heads/master: 90768c09bca4f306c00a0cdbcb2f82601231e93e
4 changes: 4 additions & 0 deletions trunk/Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,10 @@ and is between 256 and 4096 characters. It is defined in the file
ccw_timeout_log [S390]
See Documentation/s390/CommonIO for details.

cgroup_disable= [KNL] Disable a particular controller
Format: {name of the controller(s) to disable}
{Currently supported controllers - "memory"}

checkreqprot [SELINUX] Set initial checkreqprot flag value.
Format: { "0" | "1" }
See security/selinux/Kconfig help text.
Expand Down
15 changes: 14 additions & 1 deletion trunk/Documentation/spi/spi-summary
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,13 @@ low order bit. So when a chip's timing diagram shows the clock
starting low (CPOL=0) and data stabilized for sampling during the
trailing clock edge (CPHA=1), that's SPI mode 1.

Note that the clock mode is relevant as soon as the chipselect goes
active. So the master must set the clock to inactive before selecting
a slave, and the slave can tell the chosen polarity by sampling the
clock level when its select line goes active. That's why many devices
support for example both modes 0 and 3: they don't care about polarity,
and alway clock data in/out on rising clock edges.


How do these driver programming interfaces work?
------------------------------------------------
Expand Down Expand Up @@ -379,8 +386,14 @@ any more such messages.
+ when bidirectional reads and writes start ... by how its
sequence of spi_transfer requests is arranged;

+ which I/O buffers are used ... each spi_transfer wraps a
buffer for each transfer direction, supporting full duplex
(two pointers, maybe the same one in both cases) and half
duplex (one pointer is NULL) transfers;

+ optionally defining short delays after transfers ... using
the spi_transfer.delay_usecs setting;
the spi_transfer.delay_usecs setting (this delay can be the
only protocol effect, if the buffer length is zero);

+ whether the chipselect becomes inactive after a transfer and
any delay ... by using the spi_transfer.cs_change flag;
Expand Down
8 changes: 7 additions & 1 deletion trunk/arch/frv/kernel/entry-table.S
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,14 @@ __trap_fixup_kernel_data_tlb_miss:
.section .trap.vector
.org TBR_TT_TRAP0 >> 2
.long system_call
.rept 126
.rept 119
.long __entry_unsupported_trap
.endr

# userspace atomic op emulation, traps 120-126
.rept 7
.long __entry_atomic_op
.endr

.org TBR_TT_BREAK >> 2
.long __entry_debug_exception
20 changes: 20 additions & 0 deletions trunk/arch/frv/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,26 @@ __entry_debug_exception:
movgs gr4,psr
jmpl @(gr5,gr0) ; call ill_insn(esfr1,epcr0,esr0)

###############################################################################
#
# handle atomic operation emulation for userspace
#
###############################################################################
.globl __entry_atomic_op
__entry_atomic_op:
LEDS 0x6012
sethi.p %hi(atomic_operation),gr5
setlo %lo(atomic_operation),gr5
movsg esfr1,gr8
movsg epcr0,gr9
movsg esr0,gr10

# now that we've accessed the exception regs, we can enable exceptions
movsg psr,gr4
ori gr4,#PSR_ET,gr4
movgs gr4,psr
jmpl @(gr5,gr0) ; call atomic_operation(esfr1,epcr0,esr0)

###############################################################################
#
# handle media exception
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/frv/kernel/head.inc
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@
#ifdef CONFIG_MMU
__sdram_base = 0x00000000 /* base address to which SDRAM relocated */
#else
__sdram_base = 0xc0000000 /* base address to which SDRAM relocated */
__sdram_base = __page_offset /* base address to which SDRAM relocated */
#endif
7 changes: 0 additions & 7 deletions trunk/arch/frv/kernel/switch_to.S
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,6 @@ __switch_to:
movgs gr14,lr
bar

srli gr15,#28,gr5
subicc gr5,#0xc,gr0,icc0
beq icc0,#0,111f
break
nop
111:

# jump to __switch_back or ret_from_fork as appropriate
# - move prev to GR8
movgs gr4,psr
Expand Down
227 changes: 227 additions & 0 deletions trunk/arch/frv/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,233 @@ asmlinkage void illegal_instruction(unsigned long esfr1, unsigned long epcr0, un
force_sig_info(info.si_signo, &info, current);
} /* end illegal_instruction() */

/*****************************************************************************/
/*
* handle atomic operations with errors
* - arguments in gr8, gr9, gr10
* - original memory value placed in gr5
* - replacement memory value placed in gr9
*/
asmlinkage void atomic_operation(unsigned long esfr1, unsigned long epcr0,
unsigned long esr0)
{
static DEFINE_SPINLOCK(atomic_op_lock);
unsigned long x, y, z, *p;
mm_segment_t oldfs;
siginfo_t info;
int ret;

y = 0;
z = 0;

oldfs = get_fs();
if (!user_mode(__frame))
set_fs(KERNEL_DS);

switch (__frame->tbr & TBR_TT) {
/* TIRA gr0,#120
* u32 __atomic_user_cmpxchg32(u32 *ptr, u32 test, u32 new)
*/
case TBR_TT_ATOMIC_CMPXCHG32:
p = (unsigned long *) __frame->gr8;
x = __frame->gr9;
y = __frame->gr10;

for (;;) {
ret = get_user(z, p);
if (ret < 0)
goto error;

if (z != x)
goto done;

spin_lock_irq(&atomic_op_lock);

if (__get_user(z, p) == 0) {
if (z != x)
goto done2;

if (__put_user(y, p) == 0)
goto done2;
goto error2;
}

spin_unlock_irq(&atomic_op_lock);
}

/* TIRA gr0,#121
* u32 __atomic_kernel_xchg32(void *v, u32 new)
*/
case TBR_TT_ATOMIC_XCHG32:
p = (unsigned long *) __frame->gr8;
y = __frame->gr9;

for (;;) {
ret = get_user(z, p);
if (ret < 0)
goto error;

spin_lock_irq(&atomic_op_lock);

if (__get_user(z, p) == 0) {
if (__put_user(y, p) == 0)
goto done2;
goto error2;
}

spin_unlock_irq(&atomic_op_lock);
}

/* TIRA gr0,#122
* ulong __atomic_kernel_XOR_return(ulong i, ulong *v)
*/
case TBR_TT_ATOMIC_XOR:
p = (unsigned long *) __frame->gr8;
x = __frame->gr9;

for (;;) {
ret = get_user(z, p);
if (ret < 0)
goto error;

spin_lock_irq(&atomic_op_lock);

if (__get_user(z, p) == 0) {
y = x ^ z;
if (__put_user(y, p) == 0)
goto done2;
goto error2;
}

spin_unlock_irq(&atomic_op_lock);
}

/* TIRA gr0,#123
* ulong __atomic_kernel_OR_return(ulong i, ulong *v)
*/
case TBR_TT_ATOMIC_OR:
p = (unsigned long *) __frame->gr8;
x = __frame->gr9;

for (;;) {
ret = get_user(z, p);
if (ret < 0)
goto error;

spin_lock_irq(&atomic_op_lock);

if (__get_user(z, p) == 0) {
y = x ^ z;
if (__put_user(y, p) == 0)
goto done2;
goto error2;
}

spin_unlock_irq(&atomic_op_lock);
}

/* TIRA gr0,#124
* ulong __atomic_kernel_AND_return(ulong i, ulong *v)
*/
case TBR_TT_ATOMIC_AND:
p = (unsigned long *) __frame->gr8;
x = __frame->gr9;

for (;;) {
ret = get_user(z, p);
if (ret < 0)
goto error;

spin_lock_irq(&atomic_op_lock);

if (__get_user(z, p) == 0) {
y = x & z;
if (__put_user(y, p) == 0)
goto done2;
goto error2;
}

spin_unlock_irq(&atomic_op_lock);
}

/* TIRA gr0,#125
* int __atomic_user_sub_return(atomic_t *v, int i)
*/
case TBR_TT_ATOMIC_SUB:
p = (unsigned long *) __frame->gr8;
x = __frame->gr9;

for (;;) {
ret = get_user(z, p);
if (ret < 0)
goto error;

spin_lock_irq(&atomic_op_lock);

if (__get_user(z, p) == 0) {
y = z - x;
if (__put_user(y, p) == 0)
goto done2;
goto error2;
}

spin_unlock_irq(&atomic_op_lock);
}

/* TIRA gr0,#126
* int __atomic_user_add_return(atomic_t *v, int i)
*/
case TBR_TT_ATOMIC_ADD:
p = (unsigned long *) __frame->gr8;
x = __frame->gr9;

for (;;) {
ret = get_user(z, p);
if (ret < 0)
goto error;

spin_lock_irq(&atomic_op_lock);

if (__get_user(z, p) == 0) {
y = z + x;
if (__put_user(y, p) == 0)
goto done2;
goto error2;
}

spin_unlock_irq(&atomic_op_lock);
}

default:
BUG();
}

done2:
spin_unlock_irq(&atomic_op_lock);
done:
if (!user_mode(__frame))
set_fs(oldfs);
__frame->gr5 = z;
__frame->gr9 = y;
return;

error2:
spin_unlock_irq(&atomic_op_lock);
error:
if (!user_mode(__frame))
set_fs(oldfs);
__frame->pc -= 4;

die_if_kernel("-- Atomic Op Error --\n");

info.si_signo = SIGSEGV;
info.si_code = SEGV_ACCERR;
info.si_errno = 0;
info.si_addr = (void *) __frame->pc;

force_sig_info(info.si_signo, &info, current);
}

/*****************************************************************************/
/*
*
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/m68k/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
# Copyright (C) 1994 by Hamish Macdonald
#

KBUILD_DEFCONFIG := amiga_defconfig

# override top level makefile
AS += -m68020
LDFLAGS := -m m68kelf
Expand Down
Loading

0 comments on commit a40d727

Please sign in to comment.