};
-device INLINE_DEVICE *
+INLINE_DEVICE\
+(device *)
device_create(const char *name,
device *parent)
{
return NULL;
}
-device INLINE_DEVICE *
+INLINE_DEVICE\
+(device *)
device_create_from(const char *name,
void *data,
const device_callbacks *callbacks,
}
-device INLINE_DEVICE *
+INLINE_DEVICE\
+(device *)
device_parent(device *me)
{
return me->parent;
}
-const char INLINE_DEVICE *
+INLINE_DEVICE\
+(device *)
+device_sibling(device *me)
+{
+ return me->sibling;
+}
+
+INLINE_DEVICE\
+(device *)
+device_child(device *me)
+{
+ return me->children;
+}
+
+INLINE_DEVICE\
+(const char *)
device_name(device *me)
{
return me->name;
}
-void INLINE_DEVICE *
+INLINE_DEVICE\
+(void *)
device_data(device *me)
{
return me->data;
}
-void INLINE_DEVICE
+INLINE_DEVICE\
+(void)
device_traverse_properties(device *me,
device_traverse_property_function *traverse,
void *data)
}
}
-void INLINE_DEVICE
+INLINE_DEVICE\
+(void)
device_init(device *me,
psim *system)
{
me->callback->init(me, system);
}
-void INLINE_DEVICE
+INLINE_DEVICE\
+(void)
device_attach_address(device *me,
const char *name,
attach_type attach,
addr, nr_bytes, access, who);
}
-void INLINE_DEVICE
+INLINE_DEVICE\
+(void)
device_detach_address(device *me,
const char *name,
attach_type attach,
addr, nr_bytes, access, who);
}
-unsigned INLINE_DEVICE
+INLINE_DEVICE\
+(unsigned)
device_io_read_buffer(device *me,
void *dest,
int space,
processor, cia);
}
-unsigned INLINE_DEVICE
+INLINE_DEVICE\
+(unsigned)
device_io_write_buffer(device *me,
const void *source,
int space,
processor, cia);
}
-unsigned INLINE_DEVICE
+INLINE_DEVICE\
+(unsigned)
device_dma_read_buffer(device *me,
void *dest,
int space,
addr, nr_bytes);
}
-unsigned INLINE_DEVICE
+INLINE_DEVICE\
+(unsigned)
device_dma_write_buffer(device *me,
const void *source,
int space,
violate_read_only_section);
}
-void INLINE_DEVICE
+INLINE_DEVICE\
+(void)
device_attach_interrupt(device *me,
device *who,
int interrupt_line,
me->callback->attach_interrupt(me, who, interrupt_line, name);
}
-void INLINE_DEVICE
+INLINE_DEVICE\
+(void)
device_detach_interrupt(device *me,
device *who,
int interrupt_line,
me->callback->detach_interrupt(me, who, interrupt_line, name);
}
-void INLINE_DEVICE
+INLINE_DEVICE\
+(void)
device_interrupt(device *me,
device *who,
int interrupt_line,
processor, cia);
}
-void INLINE_DEVICE
+INLINE_DEVICE\
+(void)
device_interrupt_ack(device *me,
int interrupt_line,
int interrupt_status)
me->callback->interrupt_ack(me, interrupt_line, interrupt_status);
}
-void EXTERN_DEVICE
+EXTERN_DEVICE\
+(void)
device_ioctl(device *me,
psim *system,
cpu *processor,
/* Manipulate properties attached to devices */
-device_property STATIC_INLINE_DEVICE *
+STATIC_INLINE_DEVICE\
+(device_property *)
device_add_property(device *me,
const char *property,
device_property_type type,
return new_value;
}
-void INLINE_DEVICE
+INLINE_DEVICE\
+(void)
device_add_array_property(device *me,
const char *property,
const void *array,
array_property, array, sizeof_array);
}
-void INLINE_DEVICE
+INLINE_DEVICE\
+(void)
device_add_integer_property(device *me,
const char *property,
signed32 integer)
&integer, sizeof(integer));
}
-void INLINE_DEVICE
+INLINE_DEVICE\
+(void)
device_add_boolean_property(device *me,
const char *property,
int boolean)
&new_boolean, sizeof(new_boolean));
}
-void INLINE_DEVICE
+INLINE_DEVICE\
+(void)
device_add_null_property(device *me,
const char *property)
{
NULL, 0);
}
-void INLINE_DEVICE
+INLINE_DEVICE\
+(void)
device_add_string_property(device *me,
const char *property,
const char *string)
string, strlen(string) + 1);
}
-const device_property INLINE_DEVICE *
+INLINE_DEVICE\
+(const device_property *)
device_find_property(device *me,
const char *property)
{
return (device_property*)0;
}
-const char INLINE_DEVICE *
+INLINE_DEVICE\
+(const char *)
device_find_next_property(device *me,
const char *property)
{
return NULL;
}
-const device_property INLINE_DEVICE *
+INLINE_DEVICE\
+(const device_property *)
device_find_array_property(device *me,
const char *property)
{
return node;
}
-signed_word INLINE_DEVICE
+INLINE_DEVICE\
+(signed_word)
device_find_integer_property(device *me,
const char *property)
{
return integer;
}
-int INLINE_DEVICE
+INLINE_DEVICE\
+(int)
device_find_boolean_property(device *me,
const char *property)
{
return boolean;
}
-const char INLINE_DEVICE *
+INLINE_DEVICE\
+(const char *)
device_find_string_property(device *me,
const char *property)
{
/* determine the full name of the device. If buf is specified it is
stored in there. Failing that, a safe area of memory is allocated */
-const char STATIC_INLINE_DEVICE *
+STATIC_INLINE_DEVICE\
+(const char *)
device_tree_full_name(device *leaf,
char *buf,
unsigned sizeof_buf)
device_tree_abort = 3,
} device_tree_action;
-device STATIC_INLINE_DEVICE *
+STATIC_INLINE_DEVICE\
+(device *)
device_tree_find_node(device *root,
const char *path,
const char *full_path,
child != NULL;
child = child->sibling) {
if (strncmp(name, child->name, strlen_name) == 0
- && strlen(child->name) == strlen_name) {
+ && strlen(child->name) >= strlen_name
+ && (child->name[strlen_name] == '\0'
+ || child->name[strlen_name] == '@')) {
if (*path == '\0')
return child;
else
/* grow the device tree */
-device INLINE_DEVICE *
+INLINE_DEVICE\
+(device *)
device_tree_add_device(device *root,
const char *prefix,
device *new_sub_tree)
return new_sub_tree;
}
-device INLINE_DEVICE *
+INLINE_DEVICE\
+(device *)
device_tree_find_device(device *root,
const char *path)
{
/* init all the devices */
-void STATIC_INLINE_DEVICE
+STATIC_INLINE_DEVICE\
+(void)
device_tree_init_device(device *root,
void *data)
{
}
-void INLINE_DEVICE
+INLINE_DEVICE\
+(void)
device_tree_init(device *root,
psim *system)
{
/* traverse a device tree applying prefix/postfix functions to it */
-void INLINE_DEVICE
+INLINE_DEVICE\
+(void)
device_tree_traverse(device *root,
device_tree_traverse_function *prefix,
device_tree_traverse_function *postfix,
/* dump out a device node and addresses */
-void INLINE_DEVICE
+INLINE_DEVICE\
+(void)
device_tree_dump(device *device,
void *ignore_data_argument)
{
/* lookup/create a device various formats */
-void STATIC_INLINE_DEVICE
+STATIC_INLINE_DEVICE\
+(void)
u_strcat(char *buf,
unsigned_word uw)
{
}
}
-void STATIC_INLINE_DEVICE
+STATIC_INLINE_DEVICE\
+(void)
c_strcat(char *buf,
const char *c)
{
*end = '\0';
}
-device INLINE_DEVICE *
+INLINE_DEVICE\
+(device *)
device_tree_add_found(device *root,
const char *prefix,
const char *name)
device *new_device;
device *new_node;
TRACE(trace_device_tree,
- ("device_tree_add_found(root=0x%lx, prefix=%s, name=%x)\n",
- (long)root, prefix, name));
+ ("device_tree_add_found(root=0x%lx, prefix=%s, name=%lx)\n",
+ (unsigned long)root, prefix, (unsigned long)name));
parent = device_tree_find_node(root, prefix, prefix,
device_tree_abort);
new_device = device_tree_find_device(parent, name);
}
}
-device INLINE_DEVICE *
+INLINE_DEVICE\
+(device *)
device_tree_add_found_c(device *root,
const char *prefix,
const char *name,
return device_tree_add_found(root, prefix, buf);
}
-device INLINE_DEVICE *
+INLINE_DEVICE\
+(device *)
device_tree_add_found_c_uw(device *root,
const char *prefix,
const char *name,
return device_tree_add_found(root, prefix, buf);
}
-device INLINE_DEVICE *
+INLINE_DEVICE\
+(device *)
device_tree_add_found_uw_u(device *root,
const char *prefix,
const char *name,
return device_tree_add_found(root, prefix, buf);
}
-device INLINE_DEVICE *
+INLINE_DEVICE\
+(device *)
device_tree_add_found_uw_u_u(device *root,
const char *prefix,
const char *name,
return device_tree_add_found(root, prefix, buf);
}
-device INLINE_DEVICE *
+INLINE_DEVICE\
+(device *)
device_tree_add_found_uw_u_u_c(device *root,
const char *prefix,
const char *name,
return device_tree_add_found(root, prefix, buf);
}
-device INLINE_DEVICE *
+INLINE_DEVICE\
+(device *)
device_tree_add_found_uw_uw_u_u_c(device *root,
const char *prefix,
const char *name,
return device_tree_add_found(root, prefix, buf);
}
-device INLINE_DEVICE *
+INLINE_DEVICE\
+(device *)
device_tree_add_found_uw_uw_u_u_u(device *root,
const char *prefix,
const char *name,
START = END + 1; \
} while (0)
-int INLINE_DEVICE
+INLINE_DEVICE\
+(int)
scand_c(const char *name,
char *c1,
unsigned c1size)
SCAN_END;
}
-int INLINE_DEVICE
+INLINE_DEVICE\
+(int)
scand_c_uw_u(const char *name,
char *c1,
unsigned c1size,
SCAN_END;
}
-int INLINE_DEVICE
+INLINE_DEVICE\
+(int)
scand_uw(const char *name,
unsigned_word *uw1)
{
SCAN_END;
}
-int INLINE_DEVICE
+INLINE_DEVICE\
+(int)
scand_uw_c(const char *name,
unsigned_word *uw1,
char *c2,
SCAN_END;
}
-int INLINE_DEVICE
+INLINE_DEVICE\
+(int)
scand_uw_u(const char *name,
unsigned_word *uw1,
unsigned *u2)
SCAN_END;
}
-int INLINE_DEVICE
+INLINE_DEVICE\
+(int)
scand_uw_u_u(const char *name,
unsigned_word *uw1,
unsigned *u2,
SCAN_END;
}
-int INLINE_DEVICE
+INLINE_DEVICE\
+(int)
scand_uw_u_u_c(const char *name,
unsigned_word *uw1,
unsigned *u2,
SCAN_END;
}
-int INLINE_DEVICE
+INLINE_DEVICE\
+(int)
scand_uw_uw(const char *name,
unsigned_word *uw1,
unsigned_word *uw2)
SCAN_END;
}
-int INLINE_DEVICE
+INLINE_DEVICE\
+(int)
scand_uw_uw_u(const char *name,
unsigned_word *uw1,
unsigned_word *uw2,
SCAN_END;
}
-int INLINE_DEVICE
+INLINE_DEVICE\
+(int)
scand_uw_uw_u_u_c(const char *name,
unsigned_word *uw1,
unsigned_word *uw2,
SCAN_END;
}
-int INLINE_DEVICE
+INLINE_DEVICE\
+(int)
scand_uw_uw_u_u_u(const char *name,
unsigned_word *uw1,
unsigned_word *uw2,