Changeset 15d0046 in mainline for uspace/drv/platform/leon3/leon3.c
- Timestamp:
- 2014-09-12T13:22:33Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9b20126
- Parents:
- 8db09e4 (diff), 105d8d6 (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. - File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/platform/leon3/leon3.c
r8db09e4 r15d0046 29 29 30 30 /** 31 * @defgroup root_leon3 SPARC LEON3 platform driver.31 * @defgroup leon3 SPARC LEON3 platform driver. 32 32 * @brief HelenOS SPARC LEON3 platform driver. 33 33 * @{ … … 40 40 #include <ops/hw_res.h> 41 41 #include <stdio.h> 42 #include " rootleon3.h"42 #include "leon3.h" 43 43 44 #define NAME " rootleon3"44 #define NAME "leon3" 45 45 46 46 typedef struct { … … 48 48 match_id_t match_id; 49 49 hw_resource_list_t hw_resources; 50 } rootleon3_fun_t;50 } leon3_fun_t; 51 51 52 52 static hw_resource_t amba_res[] = { … … 69 69 }; 70 70 71 static const rootleon3_fun_t leon3_func = {71 static const leon3_fun_t leon3_func = { 72 72 .name = "leon_amba", 73 73 .match_id = { … … 81 81 }; 82 82 83 static hw_resource_list_t * rootleon3_get_resources(ddf_fun_t *);84 static bool rootleon3_enable_interrupt(ddf_fun_t *);83 static hw_resource_list_t *leon3_get_resources(ddf_fun_t *); 84 static bool leon3_enable_interrupt(ddf_fun_t *); 85 85 86 86 static hw_res_ops_t fun_hw_res_ops = { 87 .get_resource_list = & rootleon3_get_resources,88 .enable_interrupt = & rootleon3_enable_interrupt87 .get_resource_list = &leon3_get_resources, 88 .enable_interrupt = &leon3_enable_interrupt 89 89 }; 90 90 91 static ddf_dev_ops_t rootleon3_fun_ops = {91 static ddf_dev_ops_t leon3_fun_ops = { 92 92 .interfaces[HW_RES_DEV_IFACE] = &fun_hw_res_ops 93 93 }; 94 94 95 static int rootleon3_add_fun(ddf_dev_t *dev, const rootleon3_fun_t *fun)95 static int leon3_add_fun(ddf_dev_t *dev, const leon3_fun_t *fun) 96 96 { 97 97 assert(dev); … … 114 114 115 115 /* Allocate needed data */ 116 rootleon3_fun_t *rf =117 ddf_fun_data_alloc(fnode, sizeof( rootleon3_fun_t));116 leon3_fun_t *rf = 117 ddf_fun_data_alloc(fnode, sizeof(leon3_fun_t)); 118 118 if (!rf) { 119 119 ddf_fun_destroy(fnode); … … 123 123 124 124 /* Set provided operations to the device. */ 125 ddf_fun_set_ops(fnode, & rootleon3_fun_ops);125 ddf_fun_set_ops(fnode, &leon3_fun_ops); 126 126 127 127 /* Register function. */ … … 144 144 * 145 145 */ 146 static int rootleon3_dev_add(ddf_dev_t *dev)146 static int leon3_dev_add(ddf_dev_t *dev) 147 147 { 148 148 assert(dev); 149 149 150 150 /* Register functions */ 151 if ( rootleon3_add_fun(dev, &leon3_func) != EOK) {151 if (leon3_add_fun(dev, &leon3_func) != EOK) { 152 152 ddf_msg(LVL_ERROR, "Failed to add %s function for " 153 153 "LEON3 platform.", leon3_func.name); … … 158 158 159 159 /** The root device driver's standard operations. */ 160 static driver_ops_t rootleon3_ops = {161 .dev_add = & rootleon3_dev_add160 static driver_ops_t leon3_ops = { 161 .dev_add = &leon3_dev_add 162 162 }; 163 163 164 164 /** The root device driver structure. */ 165 static driver_t rootleon3_driver = {165 static driver_t leon3_driver = { 166 166 .name = NAME, 167 .driver_ops = & rootleon3_ops167 .driver_ops = &leon3_ops 168 168 }; 169 169 170 static hw_resource_list_t * rootleon3_get_resources(ddf_fun_t *fnode)170 static hw_resource_list_t *leon3_get_resources(ddf_fun_t *fnode) 171 171 { 172 rootleon3_fun_t *fun = ddf_fun_data_get(fnode);172 leon3_fun_t *fun = ddf_fun_data_get(fnode); 173 173 assert(fun != NULL); 174 174 175 printf(" rootleon3_get_resources() called\n");175 printf("leon3_get_resources() called\n"); 176 176 177 177 return &fun->hw_resources; 178 178 } 179 179 180 static bool rootleon3_enable_interrupt(ddf_fun_t *fun)180 static bool leon3_enable_interrupt(ddf_fun_t *fun) 181 181 { 182 182 // FIXME TODO … … 188 188 printf("%s: HelenOS SPARC LEON3 platform driver\n", NAME); 189 189 ddf_log_init(NAME); 190 return ddf_driver_main(& rootleon3_driver);190 return ddf_driver_main(&leon3_driver); 191 191 } 192 192
Note:
See TracChangeset
for help on using the changeset viewer.