123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- #ifndef _HW_IOBUS_C_
- #define _HW_IOBUS_C_
- #ifndef STATIC_INLINE_HW_IOBUS
- #define STATIC_INLINE_HW_IOBUS STATIC_INLINE
- #endif
- #include "device_table.h"
- static void
- hw_iobus_attach_address_callback(device *me,
- attach_type type,
- int space,
- unsigned_word addr,
- unsigned nr_bytes,
- access_type access,
- device *client)
- {
- int attach_space;
- unsigned_word attach_address;
-
- if (space != 0)
- device_error(me, "invalid space (%d) specified by %s",
- space, device_path(client));
-
- device_address_to_attach_address(device_parent(me),
- device_unit_address(me),
- &attach_space,
- &attach_address,
- me);
- if (addr < attach_address)
- device_error(me, "Invalid attach address 0x%lx", (unsigned long)addr);
- device_attach_address(device_parent(me),
- type,
- attach_space,
- addr,
- nr_bytes,
- access,
- client);
- }
- static device_callbacks const hw_iobus_callbacks = {
- { NULL, },
- { hw_iobus_attach_address_callback, },
- { NULL, },
- { NULL, },
- { NULL, },
- { generic_device_unit_decode,
- generic_device_unit_encode,
- generic_device_address_to_attach_address,
- generic_device_size_to_attach_size }
- };
- const device_descriptor hw_iobus_device_descriptor[] = {
- { "iobus", NULL, &hw_iobus_callbacks },
- { NULL, },
- };
- #endif
|