Changeset 46ec2c06 in mainline
- Timestamp:
- 2006-05-11T16:08:50Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7981e3cc
- Parents:
- 20a9b85
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
libc/generic/as.c
r20a9b85 r46ec2c06 52 52 * @param flags Currently unused. 53 53 * 54 * @return address on success, (void *) -1 otherwise.54 * @return Zero on success or a code from @ref errno.h on failure. 55 55 */ 56 void *as_area_resize(void *address, size_t size, int flags)56 int as_area_resize(void *address, size_t size, int flags) 57 57 { 58 return (void *) __SYSCALL3(SYS_AS_AREA_RESIZE, (sysarg_t ) address, (sysarg_t) size, (sysarg_t) flags); 58 return __SYSCALL3(SYS_AS_AREA_RESIZE, (sysarg_t ) address, (sysarg_t) size, (sysarg_t) flags); 59 } 60 61 /** Destroy address space area. 62 * 63 * @param address Virtual address pointing into the address space area being destroyed. 64 * 65 * @return Zero on success or a code from @ref errno.h on failure. 66 */ 67 int as_area_destroy(void *address) 68 { 69 return __SYSCALL1(SYS_AS_AREA_DESTROY, (sysarg_t ) address); 59 70 } 60 71 … … 111 122 void *sbrk(ssize_t incr) 112 123 { 124 int rc; 113 125 void *res; 114 126 /* Check for invalid values */ … … 122 134 return NULL; 123 135 124 r es= as_area_resize(&_heap, heapsize + incr,0);125 if ( !res)136 rc = as_area_resize(&_heap, heapsize + incr,0); 137 if (rc != 0) 126 138 return NULL; 127 139 -
libc/include/as.h
r20a9b85 r46ec2c06 34 34 35 35 extern void *as_area_create(void *address, size_t size, int flags); 36 extern void *as_area_resize(void *address, size_t size, int flags); 36 extern int as_area_resize(void *address, size_t size, int flags); 37 extern int as_area_destroy(void *address); 37 38 extern int as_area_accept(task_id_t id, void *base, size_t size, int flags); 38 39 extern int as_area_send(task_id_t id, void *base); -
pci/libpci/access.c
r20a9b85 r46ec2c06 26 26 int i; 27 27 28 if (!a) 29 return NULL; 30 28 31 bzero(a, sizeof(*a)); 29 32 for (i = 0; i < PCI_ACCESS_MAX; i++) … … 38 41 39 42 if (!x) 40 a->error("Out of memory (allocation of %d bytes failed)", 41 size); 43 a->error("Out of memory (allocation of %d bytes failed)", size); 42 44 return x; 43 45 } … … 219 221 { 220 222 if (pos & (len - 1)) 221 d->access->error("Unaligned write: pos=%02x,len=%d", pos, 222 len); 223 d->access->error("Unaligned write: pos=%02x,len=%d", pos, len); 223 224 if (pos + len <= d->cache_len) 224 225 memcpy(d->cache + pos, buf, len); … … 246 247 { 247 248 if (pos < d->cache_len) { 248 int l = 249 (pos + len >= 250 d->cache_len) ? (d->cache_len - pos) : len; 249 int l = (pos + len >= d->cache_len) ? (d->cache_len - pos) : len; 251 250 memcpy(d->cache + pos, buf, l); 252 251 } … … 261 260 } 262 261 if (flags & ~d->known_fields) 263 d->known_fields |= 264 d->methods->fill_info(d, flags & ~d->known_fields); 262 d->known_fields |= d->methods->fill_info(d, flags & ~d->known_fields); 265 263 return d->known_fields; 266 264 } -
pci/libpci/i386-ports.c
r20a9b85 r46ec2c06 80 80 for (d.dev = 0; d.dev < 32; d.dev++) { 81 81 u16 class, vendor; 82 if (m-> 83 read(&d, PCI_CLASS_DEVICE, (byte *) & class, 82 if (m->read(&d, PCI_CLASS_DEVICE, (byte *) & class, 84 83 sizeof(class)) 85 84 && (class == cpu_to_le16(PCI_CLASS_BRIDGE_HOST) … … 179 178 { 180 179 /* This is ugly and tends to produce false positives. Beware. */ 181 182 180 outb(0x00, 0xCFB); 183 181 outb(0x00, 0xCF8); … … 227 225 228 226 if (d->dev >= 16) 229 d->access-> 230 error("conf2_write: only first 16 devices exist."); 227 d->access->error("conf2_write: only first 16 devices exist."); 231 228 outb((d->func << 1) | 0xf0, 0xcf8); 232 229 outb(d->bus, 0xcfa);
Note:
See TracChangeset
for help on using the changeset viewer.