1
0
mirror of git://projects.qi-hardware.com/ben-blinkenlights.git synced 2024-11-17 19:55:21 +02:00
ben-blinkenlights/ubb-vga/physmem.c
Werner Almesberger 623f3ccbe3 ubb-vga2: non-contiguous allocation of frame buffer memory
- ubb-vga.h (calloc_phys_vec), physmem.c: non-contiguous memory allocator
  (for now, without really considering any mapping to physical memory)
- Makefile (OBJS): added physmem.o
- ubb-vga.h (grabfb), grabfb.c (grabfb): API change for non-contiguous
  frame buffer
- ubb-vga.h (ppmimg), ppmimg.c (convert, ppmimg): API change for
  non-contiguous frame buffer
- ubb-vga.h (tstimg), tstimg.c (pixel, color_bars, grill, grid, sides,
  dot, line45, arc, printc, text, ctext, tstimg): API change for
  non-contiguous frame buffer
- tstimg.c (tstimg): we no longer need to clear the frame buffer
- ubb-vga.c (frame, session, main): use a vector of line buffers instead
  of a contiguous frame buffer
2011-04-29 13:04:02 -03:00

36 lines
678 B
C

/*
* physmem.c - Physical memory allocator
*
* Written 2011 by Werner Almesberger
* Copyright 2011 Werner Almesberger
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
/*
* dummy implementation
*/
void **calloc_phys_vec(size_t n, size_t size)
{
void **vec;
int i;
vec = sbrk(sizeof(void *)*n);
for (i = 0; i != n; i++) {
vec[i] = sbrk(size);
memset(vec[i], 0, size);
}
return vec;
}