Changeset b0b4592e in mainline for uspace/drv
- Timestamp:
- 2014-03-15T19:21:53Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c773adc
- Parents:
- 2034f98 (diff), 8cffdf5 (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/drv
- Files:
-
- 11 added
- 8 edited
- 1 moved
-
block/ahci/ahci.c (modified) (8 diffs)
-
bus/amba/Makefile (added)
-
bus/amba/amba.c (added)
-
bus/amba/amba.ma (added)
-
bus/amba/ambapp.h (added)
-
bus/pci/pciintel/pci.c (modified) (7 diffs)
-
bus/usb/ehci/res.c (modified) (1 diff)
-
bus/usb/uhci/res.c (modified) (1 diff)
-
char/grlib_uart/Makefile (added)
-
char/grlib_uart/cyclic_buffer.h (moved) (moved from uspace/lib/c/include/device/pci.h ) (3 diffs)
-
char/grlib_uart/grlib_uart.c (added)
-
char/grlib_uart/grlib_uart.ma (added)
-
infrastructure/rootleon3/Makefile (added)
-
infrastructure/rootleon3/rootleon3.c (added)
-
infrastructure/rootleon3/rootleon3.h (added)
-
infrastructure/rootleon3/rootleon3.ma (added)
-
infrastructure/rootmalta/rootmalta.c (modified) (1 diff)
-
infrastructure/rootpc/rootpc.c (modified) (1 diff)
-
nic/e1k/e1k.c (modified) (1 diff)
-
nic/rtl8139/driver.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/block/ahci/ahci.c
r2034f98 rb0b4592e 37 37 #include <ddf/log.h> 38 38 #include <device/hw_res_parsed.h> 39 #include < device/pci.h>39 #include <pci_dev_iface.h> 40 40 #include <sysinfo.h> 41 41 #include <ipc/irc.h> … … 111 111 } 112 112 113 static int ahci_get_sata_device_name(ddf_fun_t *, size_t, char *);114 static int ahci_get_num_blocks(ddf_fun_t *, uint64_t *);115 static int ahci_get_block_size(ddf_fun_t *, size_t *);116 static int ahci_read_blocks(ddf_fun_t *, uint64_t, size_t, void *);117 static int ahci_write_blocks(ddf_fun_t *, uint64_t, size_t, void *);113 static int get_sata_device_name(ddf_fun_t *, size_t, char *); 114 static int get_num_blocks(ddf_fun_t *, uint64_t *); 115 static int get_block_size(ddf_fun_t *, size_t *); 116 static int read_blocks(ddf_fun_t *, uint64_t, size_t, void *); 117 static int write_blocks(ddf_fun_t *, uint64_t, size_t, void *); 118 118 119 119 static int ahci_identify_device(sata_dev_t *); … … 139 139 140 140 static ahci_iface_t ahci_interface = { 141 .get_sata_device_name = & ahci_get_sata_device_name,142 .get_num_blocks = & ahci_get_num_blocks,143 .get_block_size = & ahci_get_block_size,144 .read_blocks = & ahci_read_blocks,145 .write_blocks = & ahci_write_blocks141 .get_sata_device_name = &get_sata_device_name, 142 .get_num_blocks = &get_num_blocks, 143 .get_block_size = &get_block_size, 144 .read_blocks = &read_blocks, 145 .write_blocks = &write_blocks 146 146 }; 147 147 … … 180 180 * 181 181 */ 182 static int ahci_get_sata_device_name(ddf_fun_t *fun,182 static int get_sata_device_name(ddf_fun_t *fun, 183 183 size_t sata_dev_name_length, char *sata_dev_name) 184 184 { … … 196 196 * 197 197 */ 198 static int ahci_get_num_blocks(ddf_fun_t *fun, uint64_t *num_blocks)198 static int get_num_blocks(ddf_fun_t *fun, uint64_t *num_blocks) 199 199 { 200 200 sata_dev_t *sata = fun_sata_dev(fun); … … 211 211 * 212 212 */ 213 static int ahci_get_block_size(ddf_fun_t *fun, size_t *block_size)213 static int get_block_size(ddf_fun_t *fun, size_t *block_size) 214 214 { 215 215 sata_dev_t *sata = fun_sata_dev(fun); … … 228 228 * 229 229 */ 230 static int ahci_read_blocks(ddf_fun_t *fun, uint64_t blocknum,230 static int read_blocks(ddf_fun_t *fun, uint64_t blocknum, 231 231 size_t count, void *buf) 232 232 { … … 271 271 * 272 272 */ 273 static int ahci_write_blocks(ddf_fun_t *fun, uint64_t blocknum,273 static int write_blocks(ddf_fun_t *fun, uint64_t blocknum, 274 274 size_t count, void *buf) 275 275 { -
uspace/drv/bus/pci/pciintel/pci.c
r2034f98 rb0b4592e 153 153 154 154 155 static int pci_config_space_write_32(ddf_fun_t *fun, uint32_t address,155 static int config_space_write_32(ddf_fun_t *fun, uint32_t address, 156 156 uint32_t data) 157 157 { … … 162 162 } 163 163 164 static int pci_config_space_write_16(164 static int config_space_write_16( 165 165 ddf_fun_t *fun, uint32_t address, uint16_t data) 166 166 { … … 171 171 } 172 172 173 static int pci_config_space_write_8(173 static int config_space_write_8( 174 174 ddf_fun_t *fun, uint32_t address, uint8_t data) 175 175 { … … 180 180 } 181 181 182 static int pci_config_space_read_32(182 static int config_space_read_32( 183 183 ddf_fun_t *fun, uint32_t address, uint32_t *data) 184 184 { … … 189 189 } 190 190 191 static int pci_config_space_read_16(191 static int config_space_read_16( 192 192 ddf_fun_t *fun, uint32_t address, uint16_t *data) 193 193 { … … 198 198 } 199 199 200 static int pci_config_space_read_8(200 static int config_space_read_8( 201 201 ddf_fun_t *fun, uint32_t address, uint8_t *data) 202 202 { … … 217 217 218 218 static pci_dev_iface_t pci_dev_ops = { 219 .config_space_read_8 = & pci_config_space_read_8,220 .config_space_read_16 = & pci_config_space_read_16,221 .config_space_read_32 = & pci_config_space_read_32,222 .config_space_write_8 = & pci_config_space_write_8,223 .config_space_write_16 = & pci_config_space_write_16,224 .config_space_write_32 = & pci_config_space_write_32219 .config_space_read_8 = &config_space_read_8, 220 .config_space_read_16 = &config_space_read_16, 221 .config_space_read_32 = &config_space_read_32, 222 .config_space_write_8 = &config_space_write_8, 223 .config_space_write_16 = &config_space_write_16, 224 .config_space_write_32 = &config_space_write_32 225 225 }; 226 226 -
uspace/drv/bus/usb/ehci/res.c
r2034f98 rb0b4592e 43 43 #include <usb/debug.h> 44 44 #include <device/hw_res_parsed.h> 45 #include < device/pci.h>45 #include <pci_dev_iface.h> 46 46 47 47 #include "res.h" -
uspace/drv/bus/usb/uhci/res.c
r2034f98 rb0b4592e 39 39 #include <devman.h> 40 40 #include <device/hw_res_parsed.h> 41 #include < device/pci.h>41 #include <pci_dev_iface.h> 42 42 43 43 #include "res.h" -
uspace/drv/char/grlib_uart/cyclic_buffer.h
r2034f98 rb0b4592e 1 1 /* 2 * Copyright (c) 201 1 Jiri Michalec2 * Copyright (c) 2010 Lenka Trochtova 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup libc29 /** @addtogroup ns8250 30 30 * @{ 31 31 */ … … 33 33 */ 34 34 35 #ifndef LIBC_DEVICE_PCI_H_36 #define LIBC_DEVICE_PCI_H_35 #ifndef CYCLIC_BUFFER_H_ 36 #define CYCLIC_BUFFER_H_ 37 37 38 # include <async.h>38 #define BUF_LEN 4096 39 39 40 #define PCI_DEVICE_ID 0x02 40 typedef struct cyclic_buffer { 41 uint8_t buf[BUF_LEN]; 42 int start; 43 int cnt; 44 } cyclic_buffer_t; 41 45 42 typedef enum { 43 IPC_M_CONFIG_SPACE_READ_8, 44 IPC_M_CONFIG_SPACE_READ_16, 45 IPC_M_CONFIG_SPACE_READ_32, 46 /* 47 * @return False if the buffer is full. 48 */ 49 static inline bool buf_push_back(cyclic_buffer_t *buf, uint8_t item) 50 { 51 if (buf->cnt >= BUF_LEN) 52 return false; 46 53 47 IPC_M_CONFIG_SPACE_WRITE_8, 48 IPC_M_CONFIG_SPACE_WRITE_16, 49 IPC_M_CONFIG_SPACE_WRITE_32 50 } pci_dev_iface_funcs_t; 54 int pos = (buf->start + buf->cnt) % BUF_LEN; 55 buf->buf[pos] = item; 56 buf->cnt++; 57 return true; 58 } 51 59 52 extern int pci_config_space_read_8(async_sess_t *, uint32_t, uint8_t *); 53 extern int pci_config_space_read_16(async_sess_t *, uint32_t, uint16_t *); 54 extern int pci_config_space_read_32(async_sess_t *, uint32_t, uint32_t *); 60 static inline bool buf_is_empty(cyclic_buffer_t *buf) 61 { 62 return buf->cnt == 0; 63 } 55 64 56 extern int pci_config_space_write_8(async_sess_t *, uint32_t, uint8_t); 57 extern int pci_config_space_write_16(async_sess_t *, uint32_t, uint16_t); 58 extern int pci_config_space_write_32(async_sess_t *, uint32_t, uint32_t); 65 static inline uint8_t buf_pop_front(cyclic_buffer_t *buf) 66 { 67 assert(!buf_is_empty(buf)); 68 69 uint8_t res = buf->buf[buf->start]; 70 buf->start = (buf->start + 1) % BUF_LEN; 71 buf->cnt--; 72 return res; 73 } 74 75 static inline void buf_clear(cyclic_buffer_t *buf) 76 { 77 buf->cnt = 0; 78 } 59 79 60 80 #endif 61 81 62 /** @} 82 /** 83 * @} 63 84 */ -
uspace/drv/infrastructure/rootmalta/rootmalta.c
r2034f98 rb0b4592e 52 52 #include <ipc/dev_iface.h> 53 53 #include <ops/hw_res.h> 54 #include <device/hw_res.h>55 54 #include <ops/pio_window.h> 56 #include <device/pio_window.h>57 55 #include <byteorder.h> 58 56 -
uspace/drv/infrastructure/rootpc/rootpc.c
r2034f98 rb0b4592e 50 50 #include <ipc/dev_iface.h> 51 51 #include <ops/hw_res.h> 52 #include <device/hw_res.h>53 52 #include <ops/pio_window.h> 54 #include <device/pio_window.h>55 53 56 54 #define NAME "rootpc" -
uspace/drv/nic/e1k/e1k.c
r2034f98 rb0b4592e 50 50 #include <ddf/interrupt.h> 51 51 #include <device/hw_res_parsed.h> 52 #include < device/pci.h>52 #include <pci_dev_iface.h> 53 53 #include <nic.h> 54 54 #include <ops/nic.h> -
uspace/drv/nic/rtl8139/driver.c
r2034f98 rb0b4592e 41 41 #include <io/log.h> 42 42 #include <nic.h> 43 #include < device/pci.h>43 #include <pci_dev_iface.h> 44 44 45 45 #include <ipc/irc.h> … … 190 190 return; 191 191 } 192 193 #include <device/pci.h>194 192 195 193 /** Set PmEn (Power management enable) bit value
Note:
See TracChangeset
for help on using the changeset viewer.
