OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [linux-2.4/] [drivers/] [s390/] [block/] [xpram.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1275 phoenix
 
2
/*
3
 * xpram.h -- definitions for the char module
4
 *
5
 *********/
6
 
7
 
8
#include <linux/ioctl.h>
9
#include <asm/atomic.h>
10
#include <linux/major.h>
11
 
12
/* version dependencies have been confined to a separate file */
13
 
14
/*
15
 * Macros to help debugging
16
 */
17
 
18
#define XPRAM_NAME "xpram"  /* name of device/module */
19
#define XPRAM_DEVICE_NAME_PREFIX "slram" /* Prefix device name for major 35 */
20
#define XPRAM_DEVS 1        /* one partition */
21
#define XPRAM_RAHEAD 8      /* no real read ahead */
22
#define XPRAM_PGSIZE 4096   /* page size of (expanded) mememory pages
23
                             * according to S/390 architecture
24
                             */
25
#define XPRAM_BLKSIZE XPRAM_PGSIZE  /* must be equalt to page size ! */
26
#define XPRAM_HARDSECT XPRAM_PGSIZE /* FIXME -- we have to deal with both
27
                                     * this hard sect size and in some cases
28
                                     * hard coded 512 bytes which I call
29
                                     * soft sects:
30
                                     */
31
#define XPRAM_SOFTSECT 512
32
#define XPRAM_MAX_DEVS 32   /* maximal number of devices (partitions) */
33
#define XPRAM_MAX_DEVS1 33  /* maximal number of devices (partitions) +1 */
34
 
35
/* The following macros depend on the sizes above */
36
 
37
#define XPRAM_KB_IN_PG 4                     /* 4 kBs per page */
38
#define XPRAM_KB_IN_PG_ORDER 2               /* 2^? kBs per page */
39
 
40
/* Eventhough XPRAM_HARDSECT is set to 4k some data structures use hard
41
 * coded 512 byte sa sector size
42
 */
43
#define XPRAM_SEC2KB(x) ((x >> 1) + (x & 1)) /* modifier used to compute size 
44
                                                in kB from number of sectors */
45
#define XPRAM_SEC_IN_PG 8                    /* 8 sectors per page */
46
#define XPRAM_SEC_IN_PG_ORDER 3              /* 2^? sectors per page */
47
 
48
#define XPRAM_UNUSED 40                     /* unused space between devices, 
49
                                             * in kB, i.e.
50
                                             * must be a multiple of 4
51
                                             */
52
/*
53
 * The xpram device is removable: if it is left closed for more than
54
 * half a minute, it is removed. Thus use a usage count and a
55
 * kernel timer
56
 */
57
 
58
typedef struct Xpram_Dev {
59
   int            size;   /* size in KB not in Byte - RB - */
60
   atomic_t       usage;
61
   char *         device_name;   /* device name prefix in devfs */
62
   devfs_handle_t devfs_entry;   /* handle needed to unregister dev from devfs */
63
   u8 *data;
64
}              Xpram_Dev;
65
 
66
/* 2.2: void xpram_setup (char *, int *); */
67
/* begin 2.3 */
68
int xpram_setup (char *);
69
/* end 2.3 */
70
int xpram_init(void);

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.