- Timestamp:
- 2010-12-25T15:13:07Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a465a56, e84d65a
- Parents:
- ab49a0d (diff), 6eb794a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- uspace
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/Makefile
rab49a0d r467bf40 55 55 app/nettest2 \ 56 56 app/ping \ 57 app/sysinfo \ 57 58 srv/clip \ 58 59 srv/devmap \ -
uspace/drv/root/root.c
rab49a0d r467bf40 47 47 #include <macros.h> 48 48 #include <inttypes.h> 49 #include <sysinfo.h> 49 50 50 51 #include <driver.h> … … 55 56 56 57 #define PLATFORM_DEVICE_NAME "hw" 57 #define PLATFORM_DEVICE_MATCH_ID STRING(UARCH)58 #define PLATFORM_DEVICE_MATCH_ID_FMT "platform/%s" 58 59 #define PLATFORM_DEVICE_MATCH_SCORE 100 59 60 … … 100 101 static int add_platform_child(device_t *parent) 101 102 { 103 char *match_id; 104 char *platform; 105 size_t platform_size; 106 int res; 107 108 /* Get platform name from sysinfo. */ 109 110 platform = sysinfo_get_data("platform", &platform_size); 111 if (platform == NULL) { 112 printf(NAME ": Failed to obtain platform name.\n"); 113 return ENOENT; 114 } 115 116 /* Null-terminate string. */ 117 platform = realloc(platform, platform_size + 1); 118 if (platform == NULL) { 119 printf(NAME ": Memory allocation failed.\n"); 120 return ENOMEM; 121 } 122 123 platform[platform_size] = '\0'; 124 125 /* Construct match ID. */ 126 127 if (asprintf(&match_id, PLATFORM_DEVICE_MATCH_ID_FMT, platform) == -1) { 128 printf(NAME ": Memory allocation failed.\n"); 129 return ENOMEM; 130 } 131 132 /* Add child. */ 133 102 134 printf(NAME ": adding new child for platform device.\n"); 103 135 printf(NAME ": device node is `%s' (%d %s)\n", PLATFORM_DEVICE_NAME, 104 PLATFORM_DEVICE_MATCH_SCORE, PLATFORM_DEVICE_MATCH_ID); 105 106 int res = child_device_register_wrapper(parent, PLATFORM_DEVICE_NAME, 107 PLATFORM_DEVICE_MATCH_ID, PLATFORM_DEVICE_MATCH_SCORE, 108 NULL); 136 PLATFORM_DEVICE_MATCH_SCORE, match_id); 137 138 res = child_device_register_wrapper(parent, PLATFORM_DEVICE_NAME, 139 match_id, PLATFORM_DEVICE_MATCH_SCORE, NULL); 109 140 110 141 return res; -
uspace/drv/rootpc/rootpc.c
rab49a0d r467bf40 28 28 29 29 /** 30 * @defgroup root_pc Root HW device driver for ia32 and amd64 platform.31 * @brief HelenOS root HW device driver for ia32 and amd64 platform.30 * @defgroup root_pc PC platform driver. 31 * @brief HelenOS PC platform driver. 32 32 * @{ 33 33 */ … … 182 182 /* Register child devices. */ 183 183 if (!rootpc_add_children(dev)) { 184 printf(NAME ": failed to add child devices for platform " 185 "ia32.\n"); 184 printf(NAME ": failed to add child devices for PC platform.\n"); 186 185 } 187 186 … … 196 195 int main(int argc, char *argv[]) 197 196 { 198 printf(NAME ": HelenOS rootpc devicedriver\n");197 printf(NAME ": HelenOS PC platform driver\n"); 199 198 root_pc_init(); 200 199 return driver_main(&rootpc_driver); -
uspace/drv/rootpc/rootpc.ma
rab49a0d r467bf40 1 10 ia32 2 10 amd64 1 10 platform/pc
Note:
See TracChangeset
for help on using the changeset viewer.