]> git.wh0rd.org - ICEs.git/blame - 152840/ice.i.2
add bfin ice
[ICEs.git] / 152840 / ice.i.2
CommitLineData
45516216 1typedef struct {
2} spinlock_t;
3extern struct page *mem_map;
4typedef struct pm_message {
5} pm_message_t;
6struct device_driver {
7 const char *name;
8};
9struct page {
10 unsigned long flags;
11};
12struct scatterlist {
13 struct page *page;
14 unsigned int offset;
15};
16struct request {
17 unsigned int cmd_flags;
18};
19inline __attribute__ ((always_inline))
20void sg_set_buf(struct scatterlist *sg, const void *buf, unsigned int buflen)
21{
22 sg->page =
23 (mem_map +
24 ((((unsigned long)(buf) - 0x80000000) >> 12) -
25 ((0x0C000000 >> 12))));
26 sg->offset = ((unsigned long)(buf) & ~(~((1UL << 12) - 1)));
27}
28inline __attribute__ ((always_inline))
29void sg_init_one(struct scatterlist *sg, const void *buf, unsigned int buflen)
30{
31 memset(sg, 0, sizeof(*sg));
32 sg_set_buf(sg, buf, buflen);
33};
34struct mmc_card {
35 unsigned int state;
36};
37struct mmc_driver {
38 struct device_driver drv;
39 int (*probe) (struct mmc_card *);
40 void (*remove) (struct mmc_card *);
41 int (*suspend) (struct mmc_card *, pm_message_t);
42 int (*resume) (struct mmc_card *);
43};
44struct mmc_queue {
45 struct mmc_card *card;
46 int (*issue_fn) (struct mmc_queue *, struct request *);
47 void *data;
48};
49struct mmc_blk_data {
50 struct mmc_queue queue;
51};
52static
53unsigned int mmc_sd_num_wr_blocks(struct mmc_card *card)
54{
55 unsigned int blocks;
56 struct scatterlist sg;
57 sg_init_one(&sg, &blocks, 4);
58}
59int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
60{
61 struct mmc_blk_data *md = mq->data;
62 struct mmc_card *card = md->queue.card;
63 if (((req)->cmd_flags & 1) != 0 && ((card)->state & (1 << 3))) {
64 unsigned int blocks;
65 blocks = mmc_sd_num_wr_blocks(card);
66 if (blocks != (unsigned int) - 1) {
67 do {
68 local_irq_disable();
69 }
70 while (0);
71 }
72 }
73}
74struct mmc_blk_data *mmc_blk_alloc(struct mmc_card *card)
75{
76 struct mmc_blk_data *md;
77 md->queue.issue_fn = mmc_blk_issue_rq;
78}
79int mmc_blk_probe(struct mmc_card *card)
80{
81 struct mmc_blk_data *md;
82 md = mmc_blk_alloc(card);
83}
84static void mmc_blk_remove(struct mmc_card *card)
85{
86}
87static struct mmc_driver mmc_driver = {
88.probe = mmc_blk_probe
89};
90void
91__attribute__ ((__used__))
92mmc_blk_exit(void)
93{
94 mmc_unregister_driver(&mmc_driver);
95}