Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 1306 → Rev 1307

/uspace/trunk/libc/include/as.h
33,7 → 33,8
#include <task.h>
 
extern void *as_area_create(void *address, size_t size, int flags);
extern void *as_area_resize(void *address, size_t size, int flags);
extern int as_area_resize(void *address, size_t size, int flags);
extern int as_area_destroy(void *address);
extern int as_area_accept(task_id_t id, void *base, size_t size, int flags);
extern int as_area_send(task_id_t id, void *base);
 
/uspace/trunk/libc/generic/as.c
51,13 → 51,24
* @param size New requested size of the area.
* @param flags Currently unused.
*
* @return address on success, (void *) -1 otherwise.
* @return Zero on success or a code from @ref errno.h on failure.
*/
void *as_area_resize(void *address, size_t size, int flags)
int as_area_resize(void *address, size_t size, int flags)
{
return (void *) __SYSCALL3(SYS_AS_AREA_RESIZE, (sysarg_t ) address, (sysarg_t) size, (sysarg_t) flags);
return __SYSCALL3(SYS_AS_AREA_RESIZE, (sysarg_t ) address, (sysarg_t) size, (sysarg_t) flags);
}
 
/** Destroy address space area.
*
* @param address Virtual address pointing into the address space area being destroyed.
*
* @return Zero on success or a code from @ref errno.h on failure.
*/
int as_area_destroy(void *address)
{
return __SYSCALL1(SYS_AS_AREA_DESTROY, (sysarg_t ) address);
}
 
/** Prepare to accept address space area.
*
* @param id Task ID of the donor task.
110,6 → 121,7
*/
void *sbrk(ssize_t incr)
{
int rc;
void *res;
/* Check for invalid values */
if (incr < 0 && -incr > heapsize)
121,8 → 133,8
if (incr < 0 && incr+heapsize > heapsize)
return NULL;
 
res = as_area_resize(&_heap, heapsize + incr,0);
if (!res)
rc = as_area_resize(&_heap, heapsize + incr,0);
if (rc != 0)
return NULL;
/* Compute start of new area */
/uspace/trunk/pci/libpci/i386-ports.c
79,8 → 79,7
d.func = 0;
for (d.dev = 0; d.dev < 32; d.dev++) {
u16 class, vendor;
if (m->
read(&d, PCI_CLASS_DEVICE, (byte *) & class,
if (m->read(&d, PCI_CLASS_DEVICE, (byte *) & class,
sizeof(class))
&& (class == cpu_to_le16(PCI_CLASS_BRIDGE_HOST)
|| class == cpu_to_le16(PCI_CLASS_DISPLAY_VGA))
178,7 → 177,6
static int conf2_detect(struct pci_access *a)
{
/* This is ugly and tends to produce false positives. Beware. */
 
outb(0x00, 0xCFB);
outb(0x00, 0xCF8);
outb(0x00, 0xCFA);
226,8 → 224,7
return 0;
 
if (d->dev >= 16)
d->access->
error("conf2_write: only first 16 devices exist.");
d->access->error("conf2_write: only first 16 devices exist.");
outb((d->func << 1) | 0xf0, 0xcf8);
outb(d->bus, 0xcfa);
switch (len) {
/uspace/trunk/pci/libpci/access.c
25,6 → 25,9
struct pci_access *a = malloc(sizeof(struct pci_access));
int i;
 
if (!a)
return NULL;
bzero(a, sizeof(*a));
for (i = 0; i < PCI_ACCESS_MAX; i++)
if (pci_methods[i] && pci_methods[i]->config)
37,8 → 40,7
void *x = malloc(size);
 
if (!x)
a->error("Out of memory (allocation of %d bytes failed)",
size);
a->error("Out of memory (allocation of %d bytes failed)", size);
return x;
}
 
218,8 → 220,7
pci_write_data(struct pci_dev *d, void *buf, int pos, int len)
{
if (pos & (len - 1))
d->access->error("Unaligned write: pos=%02x,len=%d", pos,
len);
d->access->error("Unaligned write: pos=%02x,len=%d", pos, len);
if (pos + len <= d->cache_len)
memcpy(d->cache + pos, buf, len);
return d->methods->write(d, pos, buf, len);
245,9 → 246,7
int pci_write_block(struct pci_dev *d, int pos, byte * buf, int len)
{
if (pos < d->cache_len) {
int l =
(pos + len >=
d->cache_len) ? (d->cache_len - pos) : len;
int l = (pos + len >= d->cache_len) ? (d->cache_len - pos) : len;
memcpy(d->cache + pos, buf, l);
}
return d->methods->write(d, pos, buf, len);
260,8 → 259,7
d->known_fields = 0;
}
if (flags & ~d->known_fields)
d->known_fields |=
d->methods->fill_info(d, flags & ~d->known_fields);
d->known_fields |= d->methods->fill_info(d, flags & ~d->known_fields);
return d->known_fields;
}