summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2004-02-22 09:09:57 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-02-22 09:09:57 -0800
commit6e9aed301836e982660ba8d2c305272c3a5bcf0e (patch)
treeea7a8af1f1091cfc1eda5e8cbda99c6f454b5ae3 /include
parentc2395b56dd0a848f35813df6685d843574a09263 (diff)
parent484a1f961217ab53fbc23e4908ef003c1a5335c1 (diff)
Merge bk://kernel.bkbits.net/davem/bt-2.6
into ppc970.osdl.org:/home/torvalds/v2.5/linux
Diffstat (limited to 'include')
-rw-r--r--include/asm-arm/arch-cl7500/acornfb.h2
-rw-r--r--include/asm-arm/arch-rpc/acornfb.h67
-rw-r--r--include/asm-arm/hardware/sa1111.h45
-rw-r--r--include/asm-generic/dma-mapping-broken.h22
-rw-r--r--include/asm-m68k/atarihw.h4
-rw-r--r--include/asm-m68k/dma-mapping.h2
-rw-r--r--include/asm-m68k/processor.h5
-rw-r--r--include/asm-m68k/sbus.h7
-rw-r--r--include/asm-m68k/system.h36
-rw-r--r--include/asm-x86_64/segment.h2
-rw-r--r--include/linux/devpts_fs.h23
-rw-r--r--include/linux/nbd.h25
-rw-r--r--include/linux/sysctl.h8
-rw-r--r--include/linux/tty.h24
-rw-r--r--include/linux/tty_driver.h11
15 files changed, 213 insertions, 70 deletions
diff --git a/include/asm-arm/arch-cl7500/acornfb.h b/include/asm-arm/arch-cl7500/acornfb.h
index 567d53973fd8..3867231a4470 100644
--- a/include/asm-arm/arch-cl7500/acornfb.h
+++ b/include/asm-arm/arch-cl7500/acornfb.h
@@ -1,5 +1,5 @@
#include <linux/config.h>
-#define acornfb_valid_pixrate(rate) (rate >= 39325 && rate <= 40119)
+#define acornfb_valid_pixrate(var) (var->pixclock >= 39325 && var->pixclock <= 40119)
static inline void
acornfb_vidc20_find_rates(struct vidc_timing *vidc,
diff --git a/include/asm-arm/arch-rpc/acornfb.h b/include/asm-arm/arch-rpc/acornfb.h
index 6c7696e676d6..ecb7733a0949 100644
--- a/include/asm-arm/arch-rpc/acornfb.h
+++ b/include/asm-arm/arch-rpc/acornfb.h
@@ -10,7 +10,30 @@
* AcornFB architecture specific code
*/
-#define acornfb_valid_pixrate(rate) (1)
+#define acornfb_bandwidth(var) ((var)->pixclock * 8 / (var)->bits_per_pixel)
+
+static inline int
+acornfb_valid_pixrate(struct fb_var_screeninfo *var)
+{
+ u_long limit;
+
+ if (!var->pixclock)
+ return 0;
+
+ /*
+ * Limits below are taken from RISC OS bandwidthlimit file
+ */
+ if (current_par.using_vram) {
+ if (current_par.vram_half_sam == 2048)
+ limit = 6578;
+ else
+ limit = 13157;
+ } else {
+ limit = 26315;
+ }
+
+ return acornfb_bandwidth(var) >= limit;
+}
/*
* Try to find the best PLL parameters for the pixel clock.
@@ -59,7 +82,7 @@ static inline void
acornfb_vidc20_find_rates(struct vidc_timing *vidc,
struct fb_var_screeninfo *var)
{
- u_int div, bandwidth;
+ u_int div;
/* Select pixel-clock divisor to keep PLL in range */
div = var->pixclock / 9090; /*9921*/
@@ -82,21 +105,35 @@ acornfb_vidc20_find_rates(struct vidc_timing *vidc,
case 8: vidc->control |= VIDC20_CTRL_PIX_CK8; break;
}
- /* Calculate bandwidth */
- bandwidth = var->pixclock * 8 / var->bits_per_pixel;
-
- /* Encode bandwidth as VIDC20 setting */
- if (bandwidth > 33334)
- vidc->control |= VIDC20_CTRL_FIFO_16; /* < 30.0MB/s */
- else if (bandwidth > 26666)
- vidc->control |= VIDC20_CTRL_FIFO_20; /* < 37.5MB/s */
- else if (bandwidth > 22222)
- vidc->control |= VIDC20_CTRL_FIFO_24; /* < 45.0MB/s */
- else
- vidc->control |= VIDC20_CTRL_FIFO_28; /* > 45.0MB/s */
+ /*
+ * With VRAM, the FIFO can be set to the highest possible setting
+ * because there are no latency considerations for other memory
+ * accesses. However, in 64 bit bus mode the FIFO preload value
+ * must not be set to VIDC20_CTRL_FIFO_28 because this will let
+ * the FIFO overflow. See VIDC20 manual page 33 (6.0 Setting the
+ * FIFO preload value).
+ */
+ if (current_par.using_vram) {
+ if (current_par.vram_half_sam == 2048)
+ vidc->control |= VIDC20_CTRL_FIFO_24;
+ else
+ vidc->control |= VIDC20_CTRL_FIFO_28;
+ } else {
+ unsigned long bandwidth = acornfb_bandwidth(var);
+
+ /* Encode bandwidth as VIDC20 setting */
+ if (bandwidth > 33334) /* < 30.0MB/s */
+ vidc->control |= VIDC20_CTRL_FIFO_16;
+ else if (bandwidth > 26666) /* < 37.5MB/s */
+ vidc->control |= VIDC20_CTRL_FIFO_20;
+ else if (bandwidth > 22222) /* < 45.0MB/s */
+ vidc->control |= VIDC20_CTRL_FIFO_24;
+ else /* > 45.0MB/s */
+ vidc->control |= VIDC20_CTRL_FIFO_28;
+ }
/* Find the PLL values */
- vidc->pll_ctl = acornfb_vidc20_find_pll(var->pixclock / div);
+ vidc->pll_ctl = acornfb_vidc20_find_pll(var->pixclock / div);
}
#define acornfb_default_control() (VIDC20_CTRL_PIX_VCLK)
diff --git a/include/asm-arm/hardware/sa1111.h b/include/asm-arm/hardware/sa1111.h
index 6f60c300099f..23faa6927f72 100644
--- a/include/asm-arm/hardware/sa1111.h
+++ b/include/asm-arm/hardware/sa1111.h
@@ -364,6 +364,47 @@
#define _PC_SDR _SA1111( 0x1028 )
#define _PC_SSR _SA1111( 0x102c )
+#define SA1111_GPIO 0x1000
+
+#define SA1111_GPIO_PADDR (0x000)
+#define SA1111_GPIO_PADRR (0x004)
+#define SA1111_GPIO_PADWR (0x004)
+#define SA1111_GPIO_PASDR (0x008)
+#define SA1111_GPIO_PASSR (0x00c)
+#define SA1111_GPIO_PBDDR (0x010)
+#define SA1111_GPIO_PBDRR (0x014)
+#define SA1111_GPIO_PBDWR (0x014)
+#define SA1111_GPIO_PBSDR (0x018)
+#define SA1111_GPIO_PBSSR (0x01c)
+#define SA1111_GPIO_PCDDR (0x020)
+#define SA1111_GPIO_PCDRR (0x024)
+#define SA1111_GPIO_PCDWR (0x024)
+#define SA1111_GPIO_PCSDR (0x028)
+#define SA1111_GPIO_PCSSR (0x02c)
+
+#define GPIO_A0 (1 << 0)
+#define GPIO_A1 (1 << 1)
+#define GPIO_A2 (1 << 2)
+#define GPIO_A3 (1 << 3)
+
+#define GPIO_B0 (1 << 8)
+#define GPIO_B1 (1 << 9)
+#define GPIO_B2 (1 << 10)
+#define GPIO_B3 (1 << 11)
+#define GPIO_B4 (1 << 12)
+#define GPIO_B5 (1 << 13)
+#define GPIO_B6 (1 << 14)
+#define GPIO_B7 (1 << 15)
+
+#define GPIO_C0 (1 << 16)
+#define GPIO_C1 (1 << 17)
+#define GPIO_C2 (1 << 18)
+#define GPIO_C3 (1 << 19)
+#define GPIO_C4 (1 << 20)
+#define GPIO_C5 (1 << 21)
+#define GPIO_C6 (1 << 22)
+#define GPIO_C7 (1 << 23)
+
#define PA_DDR __CCREG(0x1000)
#define PA_DRR __CCREG(0x1004)
#define PA_DWR __CCREG(0x1004)
@@ -570,4 +611,8 @@ int sa1111_check_dma_bug(dma_addr_t addr);
int sa1111_driver_register(struct sa1111_driver *);
void sa1111_driver_unregister(struct sa1111_driver *);
+void sa1111_set_io_dir(struct sa1111_dev *sadev, unsigned int bits, unsigned int dir, unsigned int sleep_dir);
+void sa1111_set_io(struct sa1111_dev *sadev, unsigned int bits, unsigned int v);
+void sa1111_set_sleep_io(struct sa1111_dev *sadev, unsigned int bits, unsigned int v);
+
#endif /* _ASM_ARCH_SA1111 */
diff --git a/include/asm-generic/dma-mapping-broken.h b/include/asm-generic/dma-mapping-broken.h
new file mode 100644
index 000000000000..e3185b194c3e
--- /dev/null
+++ b/include/asm-generic/dma-mapping-broken.h
@@ -0,0 +1,22 @@
+#ifndef _ASM_GENERIC_DMA_MAPPING_H
+#define _ASM_GENERIC_DMA_MAPPING_H
+
+/* This is used for archs that do not support DMA */
+
+
+static inline void *
+dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
+ int flag)
+{
+ BUG();
+ return 0;
+}
+
+static inline void
+dma_free_coherent(struct device *dev, size_t size, void *cpu_addr,
+ dma_addr_t dma_handle)
+{
+ BUG();
+}
+
+#endif /* _ASM_GENERIC_DMA_MAPPING_H */
diff --git a/include/asm-m68k/atarihw.h b/include/asm-m68k/atarihw.h
index feb510043c50..ccd67aa8d023 100644
--- a/include/asm-m68k/atarihw.h
+++ b/include/asm-m68k/atarihw.h
@@ -376,7 +376,7 @@ struct MATRIX
u_char external_frequency_divider;
u_char internal_frequency_divider;
};
-#define matrix (*(volatile struct MATRIX *)MATRIX_BASE)
+#define falcon_matrix (*(volatile struct MATRIX *)MATRIX_BASE)
#define CODEC_BASE (0xffff8936)
struct CODEC
@@ -405,7 +405,7 @@ struct CODEC
u_char unused6;
u_char gpio_data;
};
-#define codec (*(volatile struct CODEC *)CODEC_BASE)
+#define falcon_codec (*(volatile struct CODEC *)CODEC_BASE)
/*
** Falcon Blitter
diff --git a/include/asm-m68k/dma-mapping.h b/include/asm-m68k/dma-mapping.h
index e7799f13ad8c..b1920c703d82 100644
--- a/include/asm-m68k/dma-mapping.h
+++ b/include/asm-m68k/dma-mapping.h
@@ -5,6 +5,8 @@
#ifdef CONFIG_PCI
#include <asm-generic/dma-mapping.h>
+#else
+#include <asm-generic/dma-mapping-broken.h>
#endif
#endif /* _M68K_DMA_MAPPING_H */
diff --git a/include/asm-m68k/processor.h b/include/asm-m68k/processor.h
index 01acd63dc58f..db174ce801dd 100644
--- a/include/asm-m68k/processor.h
+++ b/include/asm-m68k/processor.h
@@ -55,11 +55,6 @@ static inline void wrusp(unsigned long usp)
#endif
#define TASK_UNMAPPED_ALIGN(addr, off) PAGE_ALIGN(addr)
-/*
- * Bus types
- */
-#define MCA_bus 0
-
struct task_work {
unsigned char sigpending;
unsigned char notify_resume; /* request for notification on
diff --git a/include/asm-m68k/sbus.h b/include/asm-m68k/sbus.h
index e0969af02492..3b25c0040aa6 100644
--- a/include/asm-m68k/sbus.h
+++ b/include/asm-m68k/sbus.h
@@ -36,8 +36,15 @@ static inline void _sbus_writel(unsigned long val, unsigned long addr)
}
+extern inline unsigned long _sbus_readl(unsigned long addr)
+{
+ return *(volatile unsigned long *)addr;
+}
+
+
#define sbus_readb(a) _sbus_readb((unsigned long)a)
#define sbus_writeb(v, a) _sbus_writeb(v, (unsigned long)a)
+#define sbus_readl(a) _sbus_readl((unsigned long)a)
#define sbus_writel(v, a) _sbus_writel(v, (unsigned long)a)
#endif
diff --git a/include/asm-m68k/system.h b/include/asm-m68k/system.h
index f7b5fd40f035..5a9c74c09e50 100644
--- a/include/asm-m68k/system.h
+++ b/include/asm-m68k/system.h
@@ -158,6 +158,42 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz
}
#endif
+/*
+ * Atomic compare and exchange. Compare OLD with MEM, if identical,
+ * store NEW in MEM. Return the initial value in MEM. Success is
+ * indicated by comparing RETURN with OLD.
+ */
+#ifdef CONFIG_RMW_INSNS
+#define __HAVE_ARCH_CMPXCHG 1
+
+static inline unsigned long __cmpxchg(volatile void *p, unsigned long old,
+ unsigned long new, int size)
+{
+ switch (size) {
+ case 1:
+ __asm__ __volatile__ ("casb %0,%2,%1"
+ : "=d" (old), "=m" (*(char *)p)
+ : "d" (new), "0" (old), "m" (*(char *)p));
+ break;
+ case 2:
+ __asm__ __volatile__ ("casw %0,%2,%1"
+ : "=d" (old), "=m" (*(short *)p)
+ : "d" (new), "0" (old), "m" (*(short *)p));
+ break;
+ case 4:
+ __asm__ __volatile__ ("casl %0,%2,%1"
+ : "=d" (old), "=m" (*(int *)p)
+ : "d" (new), "0" (old), "m" (*(int *)p));
+ break;
+ }
+ return old;
+}
+
+#define cmpxchg(ptr,o,n)\
+ ((__typeof__(*(ptr)))__cmpxchg((ptr),(unsigned long)(o),\
+ (unsigned long)(n),sizeof(*(ptr))))
+#endif
+
#endif /* __KERNEL__ */
#endif /* _M68K_SYSTEM_H */
diff --git a/include/asm-x86_64/segment.h b/include/asm-x86_64/segment.h
index 91c59738f3cc..8dc82dc557fb 100644
--- a/include/asm-x86_64/segment.h
+++ b/include/asm-x86_64/segment.h
@@ -40,7 +40,7 @@
#define FS_TLS_SEL ((GDT_ENTRY_TLS_MIN+FS_TLS)*8 + 3)
#define IDT_ENTRIES 256
-#define GDT_ENTRIES (L1_CACHE_BYTES / 8)
+#define GDT_ENTRIES 16
#define GDT_SIZE (GDT_ENTRIES * 8)
#define TLS_SIZE (GDT_ENTRY_TLS_ENTRIES * 8)
diff --git a/include/linux/devpts_fs.h b/include/linux/devpts_fs.h
index 4def3512b355..734f7ea9e835 100644
--- a/include/linux/devpts_fs.h
+++ b/include/linux/devpts_fs.h
@@ -2,7 +2,7 @@
*
* linux/include/linux/devpts_fs.h
*
- * Copyright 1998 H. Peter Anvin -- All Rights Reserved
+ * Copyright 1998-2004 H. Peter Anvin -- All Rights Reserved
*
* This file is part of the Linux kernel and is made available under
* the terms of the GNU General Public License, version 2, or at your
@@ -13,21 +13,22 @@
#ifndef _LINUX_DEVPTS_FS_H
#define _LINUX_DEVPTS_FS_H 1
-#ifdef CONFIG_DEVPTS_FS
+#include <linux/errno.h>
-void devpts_pty_new(int, dev_t); /* mknod in devpts */
-void devpts_pty_kill(int); /* unlink */
+#if CONFIG_UNIX98_PTYS
-#else
+int devpts_pty_new(struct tty_struct *); /* mknod in devpts */
+struct tty_struct *devpts_get_tty(int); /* get tty structure */
+void devpts_pty_kill(int); /* unlink */
-static inline void devpts_pty_new(int line, dev_t device)
-{
-}
+#else
-static inline void devpts_pty_kill(int line)
-{
-}
+/* Dummy stubs in the no-pty case */
+static inline int devpts_pty_new(struct tty_struct *) { return -EINVAL; }
+static inline struct tty_struct *devpts_get_tty(int) { return NULL; }
+static inline void devpts_pty_kill(int) { }
#endif
+
#endif /* _LINUX_DEVPTS_FS_H */
diff --git a/include/linux/nbd.h b/include/linux/nbd.h
index dcb0228efcae..090e210e98f0 100644
--- a/include/linux/nbd.h
+++ b/include/linux/nbd.h
@@ -8,6 +8,8 @@
* 2003/06/24 Louis D. Langholtz <ldl@aros.net>
* Removed unneeded blksize_bits field from nbd_device struct.
* Cleanup PARANOIA usage & code.
+ * 2004/02/19 Paul Clements
+ * Removed PARANOIA, plus various cleanup and comments
*/
#ifndef LINUX_NBD_H
@@ -32,22 +34,19 @@ enum {
#define nbd_cmd(req) ((req)->cmd[0])
#define MAX_NBD 128
-/* Define PARANOIA to include extra sanity checking code in here & driver */
-#define PARANOIA
-
/* userspace doesn't need the nbd_device structure */
#ifdef __KERNEL__
+/* values for flags field */
+#define NBD_READ_ONLY 0x0001
+#define NBD_WRITE_NOCHK 0x0002
+
struct nbd_device {
int flags;
int harderror; /* Code of hard error */
-#define NBD_READ_ONLY 0x0001
-#define NBD_WRITE_NOCHK 0x0002
struct socket * sock;
struct file * file; /* If == NULL, device is not ready, yet */
-#ifdef PARANOIA
- int magic; /* FIXME: not if debugging is off */
-#endif
+ int magic;
spinlock_t queue_lock;
struct list_head queue_head;/* Requests are added here... */
struct semaphore tx_lock;
@@ -58,16 +57,14 @@ struct nbd_device {
#endif
-/* This now IS in some kind of include file... */
-
-/* These are send over network in request/reply magic field */
+/* These are sent over the network in the request/reply magic fields */
#define NBD_REQUEST_MAGIC 0x25609513
#define NBD_REPLY_MAGIC 0x67446698
/* Do *not* use magics: 0x12560953 0x96744668. */
/*
- * This is packet used for communication between client and
+ * This is the packet used for communication between client and
* server. All data are in network byte order.
*/
struct nbd_request {
@@ -82,6 +79,10 @@ struct nbd_request {
#endif
;
+/*
+ * This is the reply packet that nbd-server sends back to the client after
+ * it has completed an I/O request (or an error occurs).
+ */
struct nbd_reply {
u32 magic;
u32 error; /* 0 = ok, else error */
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index f800e292d8a1..6819132d40d4 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -129,6 +129,7 @@ enum
KERN_HPPA_UNALIGNED=59, /* int: hppa unaligned-trap enable */
KERN_PRINTK_RATELIMIT=60, /* int: tune printk ratelimiting */
KERN_PRINTK_RATELIMIT_BURST=61, /* int: tune printk ratelimiting */
+ KERN_PTY=62, /* dir: pty driver */
};
@@ -192,6 +193,13 @@ enum
RANDOM_UUID=6
};
+/* /proc/sys/kernel/pty */
+enum
+{
+ PTY_MAX=1,
+ PTY_NR=2
+};
+
/* /proc/sys/bus/isa */
enum
{
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 0626d1b321aa..ca1f1ccf6c49 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -28,29 +28,13 @@
/*
- * Note: don't mess with NR_PTYS until you understand the tty minor
- * number allocation game...
* (Note: the *_driver.minor_start values 1, 64, 128, 192 are
* hardcoded at present.)
*/
-#define NR_PTYS 256 /* ptys/major */
-#define NR_LDISCS 16
-
-/*
- * Unix98 PTY's can be defined as any multiple of NR_PTYS up to
- * UNIX98_PTY_MAJOR_COUNT; this section defines what we need from the
- * config options
- */
-#ifdef CONFIG_UNIX98_PTYS
-# define UNIX98_NR_MAJORS ((CONFIG_UNIX98_PTY_COUNT+NR_PTYS-1)/NR_PTYS)
-# if UNIX98_NR_MAJORS <= 0
-# undef CONFIG_UNIX98_PTYS
-# elif UNIX98_NR_MAJORS > UNIX98_PTY_MAJOR_COUNT
-# error Too many Unix98 ptys defined
-# undef UNIX98_NR_MAJORS
-# define UNIX98_NR_MAJORS UNIX98_PTY_MAJOR_COUNT
-# endif
-#endif
+#define NR_PTYS CONFIG_LEGACY_PTY_COUNT /* Number of legacy ptys */
+#define NR_UNIX98_PTY_DEFAULT 4096 /* Default maximum for Unix98 ptys */
+#define NR_UNIX98_PTY_MAX (1 << MINORBITS) /* Absolute limit */
+#define NR_LDISCS 16
/*
* These are set up by the setup-routine at boot-time:
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h
index 63051af4d8ac..f0b98e5a5473 100644
--- a/include/linux/tty_driver.h
+++ b/include/linux/tty_driver.h
@@ -160,9 +160,10 @@ struct tty_driver {
const char *devfs_name;
const char *name;
int name_base; /* offset of printed name */
- short major; /* major device number */
- short minor_start; /* start of minor device number*/
- short num; /* number of devices */
+ int major; /* major device number */
+ int minor_start; /* start of minor device number */
+ int minor_num; /* number of *possible* devices */
+ int num; /* number of devices allocated */
short type; /* type of tty driver */
short subtype; /* subtype of tty driver */
struct termios init_termios; /* Initial termios */
@@ -244,11 +245,15 @@ void tty_set_operations(struct tty_driver *driver, struct tty_operations *op);
* TTY_DRIVER_NO_DEVFS --- if set, do not create devfs entries. This
* is only used by tty_register_driver().
*
+ * TTY_DRIVER_DEVPTS_MEM -- don't use the standard arrays, instead
+ * use dynamic memory keyed through the devpts filesystem. This
+ * is only applicable to the pty driver.
*/
#define TTY_DRIVER_INSTALLED 0x0001
#define TTY_DRIVER_RESET_TERMIOS 0x0002
#define TTY_DRIVER_REAL_RAW 0x0004
#define TTY_DRIVER_NO_DEVFS 0x0008
+#define TTY_DRIVER_DEVPTS_MEM 0x0010
/* tty driver types */
#define TTY_DRIVER_TYPE_SYSTEM 0x0001