Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/gerg/m68knommu

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu:
  m68knommu: set flow handler for secondary interrupt controller of 5249
  m68knommu: remove use of IRQ_FLG_LOCK from 68360 platform support
  m68knommu: fix dereference of port.tty
  m68knommu: add missing linker __modver section
  m68knommu: fix mis-named variable int set_irq_chip loop
  m68knommu: add optimize memmove() function
  m68k: remove arch specific non-optimized memcmp()
  m68knommu: fix use of un-defined _TIF_WORK_MASK
  m68knommu: Rename m548x_wdt.c to m54xx_wdt.c
  m68knommu: fix m548x_wdt.c compilation after headers renaming
  m68knommu: Remove dependencies on nonexistent M68KNOMMU
  • Loading branch information
Linus Torvalds committed Feb 16, 2011
2 parents b90be86 + 86d306c commit 048f039
Show file tree
Hide file tree
Showing 18 changed files with 165 additions and 69 deletions.
4 changes: 1 addition & 3 deletions arch/m68k/include/asm/string.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,12 @@ static inline int strcmp(const char *cs, const char *ct)
: "+a" (cs), "+a" (ct), "=d" (res));
return res;
}
#endif /* CONFIG_COLDFIRE */

#define __HAVE_ARCH_MEMMOVE
extern void *memmove(void *, const void *, __kernel_size_t);

#define __HAVE_ARCH_MEMCMP
extern int memcmp(const void *, const void *, __kernel_size_t);
#define memcmp(d, s, n) __builtin_memcmp(d, s, n)
#endif /* CONFIG_COLDFIRE */

#define __HAVE_ARCH_MEMSET
extern void *memset(void *, int, __kernel_size_t);
Expand Down
11 changes: 0 additions & 11 deletions arch/m68k/lib/string.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,14 +243,3 @@ void *memmove(void *dest, const void *src, size_t n)
return xdest;
}
EXPORT_SYMBOL(memmove);

int memcmp(const void *cs, const void *ct, size_t count)
{
const unsigned char *su1, *su2;

for (su1 = cs, su2 = ct; count > 0; ++su1, ++su2, count--)
if (*su1 != *su2)
return *su1 < *su2 ? -1 : +1;
return 0;
}
EXPORT_SYMBOL(memcmp);
6 changes: 6 additions & 0 deletions arch/m68knommu/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ SECTIONS {
*(__param)
__stop___param = .;

/* Built-in module versions */
. = ALIGN(4) ;
__start___modver = .;
*(__modver)
__stop___modver = .;

. = ALIGN(4) ;
_etext = . ;
} > TEXT
Expand Down
2 changes: 1 addition & 1 deletion arch/m68knommu/lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

lib-y := ashldi3.o ashrdi3.o lshrdi3.o \
muldi3.o mulsi3.o divsi3.o udivsi3.o modsi3.o umodsi3.o \
checksum.o memcpy.o memset.o delay.o
checksum.o memcpy.o memmove.o memset.o delay.o
105 changes: 105 additions & 0 deletions arch/m68knommu/lib/memmove.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file COPYING in the main directory of this archive
* for more details.
*/

#define __IN_STRING_C

#include <linux/module.h>
#include <linux/string.h>

void *memmove(void *dest, const void *src, size_t n)
{
void *xdest = dest;
size_t temp;

if (!n)
return xdest;

if (dest < src) {
if ((long)dest & 1) {
char *cdest = dest;
const char *csrc = src;
*cdest++ = *csrc++;
dest = cdest;
src = csrc;
n--;
}
if (n > 2 && (long)dest & 2) {
short *sdest = dest;
const short *ssrc = src;
*sdest++ = *ssrc++;
dest = sdest;
src = ssrc;
n -= 2;
}
temp = n >> 2;
if (temp) {
long *ldest = dest;
const long *lsrc = src;
temp--;
do
*ldest++ = *lsrc++;
while (temp--);
dest = ldest;
src = lsrc;
}
if (n & 2) {
short *sdest = dest;
const short *ssrc = src;
*sdest++ = *ssrc++;
dest = sdest;
src = ssrc;
}
if (n & 1) {
char *cdest = dest;
const char *csrc = src;
*cdest = *csrc;
}
} else {
dest = (char *)dest + n;
src = (const char *)src + n;
if ((long)dest & 1) {
char *cdest = dest;
const char *csrc = src;
*--cdest = *--csrc;
dest = cdest;
src = csrc;
n--;
}
if (n > 2 && (long)dest & 2) {
short *sdest = dest;
const short *ssrc = src;
*--sdest = *--ssrc;
dest = sdest;
src = ssrc;
n -= 2;
}
temp = n >> 2;
if (temp) {
long *ldest = dest;
const long *lsrc = src;
temp--;
do
*--ldest = *--lsrc;
while (temp--);
dest = ldest;
src = lsrc;
}
if (n & 2) {
short *sdest = dest;
const short *ssrc = src;
*--sdest = *--ssrc;
dest = sdest;
src = ssrc;
}
if (n & 1) {
char *cdest = dest;
const char *csrc = src;
*--cdest = *--csrc;
}
}
return xdest;
}
EXPORT_SYMBOL(memmove);
4 changes: 3 additions & 1 deletion arch/m68knommu/platform/5249/intc2.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ static int __init mcf_intc2_init(void)
int irq;

/* GPIO interrupt sources */
for (irq = MCFINTC2_GPIOIRQ0; (irq <= MCFINTC2_GPIOIRQ7); irq++)
for (irq = MCFINTC2_GPIOIRQ0; (irq <= MCFINTC2_GPIOIRQ7); irq++) {
irq_desc[irq].chip = &intc2_irq_gpio_chip;
set_irq_handler(irq, handle_edge_irq);
}

return 0;
}
Expand Down
1 change: 0 additions & 1 deletion arch/m68knommu/platform/68328/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ Luser_return:
movel %d1,%a2
1:
move %a2@(TI_FLAGS),%d1 /* thread_info->flags */
andl #_TIF_WORK_MASK,%d1
jne Lwork_to_do
RESTORE_ALL

Expand Down
2 changes: 1 addition & 1 deletion arch/m68knommu/platform/68360/commproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ void
cpm_install_handler(int vec, void (*handler)(), void *dev_id)
{

request_irq(vec, handler, IRQ_FLG_LOCK, "timer", dev_id);
request_irq(vec, handler, 0, "timer", dev_id);

/* if (cpm_vecs[vec].handler != 0) */
/* printk(KERN_INFO "CPM interrupt %x replacing %x\n", */
Expand Down
2 changes: 1 addition & 1 deletion arch/m68knommu/platform/68360/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void hw_timer_init(void)
/* Set compare register 32Khz / 32 / 10 = 100 */
TCMP = 10;

request_irq(IRQ_MACHSPEC | 1, timer_routine, IRQ_FLG_LOCK, "timer", NULL);
request_irq(IRQ_MACHSPEC | 1, timer_routine, 0, "timer", NULL);
#endif

/* General purpose quicc timers: MC68360UM p7-20 */
Expand Down
1 change: 0 additions & 1 deletion arch/m68knommu/platform/68360/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ Luser_return:
movel %d1,%a2
1:
move %a2@(TI_FLAGS),%d1 /* thread_info->flags */
andl #_TIF_WORK_MASK,%d1
jne Lwork_to_do
RESTORE_ALL

Expand Down
4 changes: 2 additions & 2 deletions arch/m68knommu/platform/68360/ints.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ void init_IRQ(void)
pquicc->intr_cimr = 0x00000000;

for (i = 0; (i < NR_IRQS); i++) {
set_irq_chip(irq, &intc_irq_chip);
set_irq_handler(irq, handle_level_irq);
set_irq_chip(i, &intc_irq_chip);
set_irq_handler(i, handle_level_irq);
}
}

1 change: 0 additions & 1 deletion arch/m68knommu/platform/coldfire/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ Luser_return:
andl #-THREAD_SIZE,%d1 /* at base of kernel stack */
movel %d1,%a0
movel %a0@(TI_FLAGS),%d1 /* get thread_info->flags */
andl #0xefff,%d1
jne Lwork_to_do /* still work to do */

Lreturn:
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/can/mscan/Kconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
config CAN_MSCAN
depends on CAN_DEV && (PPC || M68K || M68KNOMMU)
depends on CAN_DEV && (PPC || M68K)
tristate "Support for Freescale MSCAN based chips"
---help---
The Motorola Scalable Controller Area Network (MSCAN) definition
Expand Down
29 changes: 14 additions & 15 deletions drivers/tty/serial/68328serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ static void status_handle(struct m68k_serial *info, unsigned short status)

static void receive_chars(struct m68k_serial *info, unsigned short rx)
{
struct tty_struct *tty = info->port.tty;
struct tty_struct *tty = info->tty;
m68328_uart *uart = &uart_addr[info->line];
unsigned char ch, flag;

Expand Down Expand Up @@ -329,7 +329,7 @@ static void transmit_chars(struct m68k_serial *info)
goto clear_and_return;
}

if((info->xmit_cnt <= 0) || info->port.tty->stopped) {
if((info->xmit_cnt <= 0) || info->tty->stopped) {
/* That's peculiar... TX ints off */
uart->ustcnt &= ~USTCNT_TX_INTR_MASK;
goto clear_and_return;
Expand Down Expand Up @@ -383,7 +383,7 @@ static void do_softint(struct work_struct *work)
struct m68k_serial *info = container_of(work, struct m68k_serial, tqueue);
struct tty_struct *tty;

tty = info->port.tty;
tty = info->tty;
if (!tty)
return;
#if 0
Expand All @@ -407,7 +407,7 @@ static void do_serial_hangup(struct work_struct *work)
struct m68k_serial *info = container_of(work, struct m68k_serial, tqueue_hangup);
struct tty_struct *tty;

tty = info->port.tty;
tty = info->tty;
if (!tty)
return;

Expand Down Expand Up @@ -451,8 +451,8 @@ static int startup(struct m68k_serial * info)
uart->ustcnt = USTCNT_UEN | USTCNT_RXEN | USTCNT_RX_INTR_MASK;
#endif

if (info->port.tty)
clear_bit(TTY_IO_ERROR, &info->port.tty->flags);
if (info->tty)
clear_bit(TTY_IO_ERROR, &info->tty->flags);
info->xmit_cnt = info->xmit_head = info->xmit_tail = 0;

/*
Expand Down Expand Up @@ -486,8 +486,8 @@ static void shutdown(struct m68k_serial * info)
info->xmit_buf = 0;
}

if (info->port.tty)
set_bit(TTY_IO_ERROR, &info->port.tty->flags);
if (info->tty)
set_bit(TTY_IO_ERROR, &info->tty->flags);

info->flags &= ~S_INITIALIZED;
local_irq_restore(flags);
Expand Down Expand Up @@ -553,9 +553,9 @@ static void change_speed(struct m68k_serial *info)
unsigned cflag;
int i;

if (!info->port.tty || !info->port.tty->termios)
if (!info->tty || !info->tty->termios)
return;
cflag = info->port.tty->termios->c_cflag;
cflag = info->tty->termios->c_cflag;
if (!(port = info->port))
return;

Expand Down Expand Up @@ -970,7 +970,6 @@ static void send_break(struct m68k_serial * info, unsigned int duration)
static int rs_ioctl(struct tty_struct *tty, struct file * file,
unsigned int cmd, unsigned long arg)
{
int error;
struct m68k_serial * info = (struct m68k_serial *)tty->driver_data;
int retval;

Expand Down Expand Up @@ -1104,7 +1103,7 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
tty_ldisc_flush(tty);
tty->closing = 0;
info->event = 0;
info->port.tty = NULL;
info->tty = NULL;
#warning "This is not and has never been valid so fix it"
#if 0
if (tty->ldisc.num != ldiscs[N_TTY].num) {
Expand Down Expand Up @@ -1142,7 +1141,7 @@ void rs_hangup(struct tty_struct *tty)
info->event = 0;
info->count = 0;
info->flags &= ~S_NORMAL_ACTIVE;
info->port.tty = NULL;
info->tty = NULL;
wake_up_interruptible(&info->open_wait);
}

Expand Down Expand Up @@ -1261,7 +1260,7 @@ int rs_open(struct tty_struct *tty, struct file * filp)

info->count++;
tty->driver_data = info;
info->port.tty = tty;
info->tty = tty;

/*
* Start up serial port
Expand Down Expand Up @@ -1338,7 +1337,7 @@ rs68328_init(void)
info = &m68k_soft[i];
info->magic = SERIAL_MAGIC;
info->port = (int) &uart_addr[i];
info->port.tty = NULL;
info->tty = NULL;
info->irq = uart_irqs[i];
info->custom_divisor = 16;
info->close_delay = 50;
Expand Down
6 changes: 3 additions & 3 deletions drivers/watchdog/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -862,12 +862,12 @@ config SBC_EPX_C3_WATCHDOG

# M68K Architecture

config M548x_WATCHDOG
tristate "MCF548x watchdog support"
config M54xx_WATCHDOG
tristate "MCF54xx watchdog support"
depends on M548x
help
To compile this driver as a module, choose M here: the
module will be called m548x_wdt.
module will be called m54xx_wdt.

# MIPS Architecture

Expand Down
2 changes: 1 addition & 1 deletion drivers/watchdog/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ obj-$(CONFIG_SBC_EPX_C3_WATCHDOG) += sbc_epx_c3.o
# M32R Architecture

# M68K Architecture
obj-$(CONFIG_M548x_WATCHDOG) += m548x_wdt.o
obj-$(CONFIG_M54xx_WATCHDOG) += m54xx_wdt.o

# MIPS Architecture
obj-$(CONFIG_ATH79_WDT) += ath79_wdt.o
Expand Down
Loading

0 comments on commit 048f039

Please sign in to comment.