Messages in this thread | | | Date | Thu, 10 Aug 2000 17:50:16 +0200 | From | Jamie Lokier <> | Subject | Re: ioremap return type |
| |
Jes Sorensen wrote: > Jamie> Many drivers use a struct to define the offsets in their I/O or > Jamie> iomem space. E.g. acenic.c: readl(®s->CpuCtrl). We know > Jamie> that's not portable in the sense that struct layout is not > Jamie> guaranteed. However, provided all the fields are suitably > Jamie> padded & aligned, it works in practice. (So far..) > > That is perfectly portable because that maps onto the hardware > registers directly, the driver is not to known whether an IO spase is > sparse or not thats handle by readl/writel. The acenic driver simply > uses the struct to generate offsets because I find it utterly ugly to > use a zillion defines to set all the offsets.
The reason it's not portable in _principle_ is that the mapping "list of struct fields" -> "offsets" can vary between architectures.
-- Jamie
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |