include/linux/cb710.h
Source file repositories/reference/linux-study-clean/include/linux/cb710.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/cb710.h- Extension
.h- Size
- 5490 bytes
- Lines
- 202
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/io.hlinux/interrupt.hlinux/spinlock.hlinux/pci.hlinux/platform_device.hlinux/mmc/host.hlinux/highmem.hlinux/scatterlist.h
Detected Declarations
struct cb710_slotstruct cb710_slotstruct cb710_chipfunction cb710_sg_dwiter_write_from_iofunction cb710_sg_dwiter_read_to_io
Annotated Snippet
struct cb710_slot {
struct platform_device pdev;
void __iomem *iobase;
cb710_irq_handler_t irq_handler;
};
/* per-device structure */
struct cb710_chip {
struct pci_dev *pdev;
void __iomem *iobase;
unsigned platform_id;
#ifdef CONFIG_CB710_DEBUG_ASSUMPTIONS
atomic_t slot_refs_count;
#endif
unsigned slot_mask;
unsigned slots;
spinlock_t irq_lock;
struct cb710_slot slot[];
};
/* NOTE: cb710_chip.slots is modified only during device init/exit and
* they are all serialized wrt themselves */
/* cb710_chip.slot_mask values */
#define CB710_SLOT_MMC 1
#define CB710_SLOT_MS 2
#define CB710_SLOT_SM 4
/* slot port accessors - so the logic is more clear in the code */
#define CB710_PORT_ACCESSORS(t) \
static inline void cb710_write_port_##t(struct cb710_slot *slot, \
unsigned port, u##t value) \
{ \
iowrite##t(value, slot->iobase + port); \
} \
\
static inline u##t cb710_read_port_##t(struct cb710_slot *slot, \
unsigned port) \
{ \
return ioread##t(slot->iobase + port); \
} \
\
static inline void cb710_modify_port_##t(struct cb710_slot *slot, \
unsigned port, u##t set, u##t clear) \
{ \
iowrite##t( \
(ioread##t(slot->iobase + port) & ~clear)|set, \
slot->iobase + port); \
}
CB710_PORT_ACCESSORS(8)
CB710_PORT_ACCESSORS(16)
CB710_PORT_ACCESSORS(32)
void cb710_pci_update_config_reg(struct pci_dev *pdev,
int reg, uint32_t and, uint32_t xor);
void cb710_set_irq_handler(struct cb710_slot *slot,
cb710_irq_handler_t handler);
/* some device struct walking */
static inline struct cb710_slot *cb710_pdev_to_slot(
struct platform_device *pdev)
{
return container_of(pdev, struct cb710_slot, pdev);
}
static inline struct cb710_chip *cb710_slot_to_chip(struct cb710_slot *slot)
{
return dev_get_drvdata(slot->pdev.dev.parent);
}
static inline struct device *cb710_slot_dev(struct cb710_slot *slot)
{
return &slot->pdev.dev;
}
static inline struct device *cb710_chip_dev(struct cb710_chip *chip)
{
return &chip->pdev->dev;
}
/* debugging aids */
#ifdef CONFIG_CB710_DEBUG
void cb710_dump_regs(struct cb710_chip *chip, unsigned dump);
#else
#define cb710_dump_regs(c, d) do {} while (0)
#endif
Annotation
- Immediate include surface: `linux/io.h`, `linux/interrupt.h`, `linux/spinlock.h`, `linux/pci.h`, `linux/platform_device.h`, `linux/mmc/host.h`, `linux/highmem.h`, `linux/scatterlist.h`.
- Detected declarations: `struct cb710_slot`, `struct cb710_slot`, `struct cb710_chip`, `function cb710_sg_dwiter_write_from_io`, `function cb710_sg_dwiter_read_to_io`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.