initial import
[ICEs.git] / 152840 / ice.i.3
1 extern struct page *mem_map;
2 struct page {
3 unsigned long flags;
4 };
5 struct scatterlist {
6 struct page *page;
7 unsigned int offset;
8 };
9 struct request {
10 unsigned int cmd_flags;
11 };
12 inline __attribute__ ((always_inline))
13 void sg_set_buf(struct scatterlist *sg, const void *buf, unsigned int buflen)
14 {
15 sg->page =
16 (mem_map +
17 ((((unsigned long)(buf) - 0x80000000) >> 12) -
18 ((0x0C000000 >> 12))));
19 sg->offset = ((unsigned long)(buf) & ~(~((1UL << 12) - 1)));
20 }
21
22 inline __attribute__ ((always_inline))
23 void sg_init_one(struct scatterlist *sg, const void *buf, unsigned int buflen)
24 {
25 memset(sg, 0, sizeof(*sg));
26 sg_set_buf(sg, buf, buflen);
27 };
28 struct mmc_card {
29 unsigned int state;
30 };
31 struct mmc_queue {
32 struct mmc_card *card;
33 void *data;
34 };
35 struct mmc_blk_data {
36 struct mmc_queue queue;
37 };
38 static unsigned int mmc_sd_num_wr_blocks(struct mmc_card *card)
39 {
40 unsigned int blocks;
41 struct scatterlist sg;
42 sg_init_one(&sg, &blocks, 4);
43 }
44 int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
45 {
46 struct mmc_blk_data *md = mq->data;
47 struct mmc_card *card = md->queue.card;
48 if (((req)->cmd_flags & 1) != 0 && ((card)->state & (1 << 3))) {
49 unsigned int blocks;
50 blocks = mmc_sd_num_wr_blocks(card);
51 if (blocks != (unsigned int)-1) {
52 do {
53 local_irq_disable();
54 }
55 while (0);
56 }
57 }
58 }