Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2540 → Rev 2541

/trunk/uspace/app/tester/tester.h
35,7 → 35,7
#ifndef TESTER_H_
#define TESTER_H_
 
#include <types.h>
#include <sys/types.h>
#include <bool.h>
#include <ipc/ipc.h>
 
/trunk/uspace/lib/libc/include/types.h
File deleted
/trunk/uspace/lib/libc/include/futex.h
36,7 → 36,7
#define LIBC_FUTEX_H_
 
#include <atomic.h>
#include <types.h>
#include <sys/types.h>
 
#define FUTEX_INITIALIZER {1}
 
/trunk/uspace/lib/libc/include/as.h
35,7 → 35,7
#ifndef LIBC_AS_H_
#define LIBC_AS_H_
 
#include <types.h>
#include <sys/types.h>
#include <task.h>
#include <kernel/mm/as.h>
#include <libarch/config.h>
/trunk/uspace/lib/libc/include/stdint.h
35,8 → 35,8
#ifndef LIBC_STDINT_H_
#define LIBC_STDINT_H_
 
/* Definitions of types with fixed size*/
#include <types.h>
/* Definitions of types with fixed size */
#include <libarch/types.h>
 
#define MAX_INT8 (0x7F)
#define MIN_INT8 (0x80)
/trunk/uspace/lib/libc/include/string.h
35,7 → 35,7
#ifndef LIBC_STRING_H_
#define LIBC_STRING_H_
 
#include <types.h>
#include <sys/types.h>
 
#define bzero(ptr, len) memset((ptr), 0, (len))
 
/trunk/uspace/lib/libc/include/stddef.h
35,7 → 35,7
#ifndef LIBC_STDDEF_H_
#define LIBC_STDDEF_H_
 
#include <types.h>
#include <sys/types.h>
 
#endif
 
/trunk/uspace/lib/libc/include/syscall.h
37,7 → 37,7
#ifndef LIBC_SYSCALL_H_
#define LIBC_SYSCALL_H_
 
#include <types.h>
#include <sys/types.h>
#include <kernel/syscall/syscall.h>
 
extern sysarg_t __syscall(const sysarg_t p1, const sysarg_t p2, const sysarg_t p3, const sysarg_t p4, const syscall_t id);
/trunk/uspace/lib/libc/include/async.h
55,9 → 55,9
}
 
aid_t async_send_2(int phoneid, ipcarg_t method, ipcarg_t arg1, ipcarg_t arg2,
ipc_call_t *dataptr);
ipc_call_t *dataptr);
aid_t async_send_3(int phoneid, ipcarg_t method, ipcarg_t arg1, ipcarg_t arg2,
ipcarg_t arg3, ipc_call_t *dataptr);
ipcarg_t arg3, ipc_call_t *dataptr);
void async_wait_for(aid_t amsgid, ipcarg_t *result);
int async_wait_timeout(aid_t amsgid, ipcarg_t *retval, suseconds_t timeout);
 
67,7 → 67,8
*
* @return Return code of message
*/
static inline ipcarg_t async_req_2(int phoneid, ipcarg_t method, ipcarg_t arg1, ipcarg_t arg2, ipcarg_t *r1, ipcarg_t *r2)
static inline ipcarg_t async_req_2(int phoneid, ipcarg_t method, ipcarg_t arg1,
ipcarg_t arg2, ipcarg_t *r1, ipcarg_t *r2)
{
ipc_call_t result;
ipcarg_t rc;
80,11 → 81,11
*r2 = IPC_GET_ARG2(result);
return rc;
}
#define async_req(phoneid, method, arg1, r1) async_req_2(phoneid, method, arg1, 0, r1, 0)
#define async_req(phoneid, method, arg1, r1) \
async_req_2(phoneid, method, arg1, 0, r1, 0)
 
static inline ipcarg_t async_req_3(int phoneid, ipcarg_t method, ipcarg_t arg1,
ipcarg_t arg2, ipcarg_t arg3, ipcarg_t *r1,
ipcarg_t *r2, ipcarg_t *r3)
ipcarg_t arg2, ipcarg_t arg3, ipcarg_t *r1, ipcarg_t *r2, ipcarg_t *r3)
{
ipc_call_t result;
ipcarg_t rc;
113,7 → 114,7
 
/* Primitve functions for IPC communication */
void async_msg_3(int phoneid, ipcarg_t method, ipcarg_t arg1, ipcarg_t arg2,
ipcarg_t arg3);
ipcarg_t arg3);
void async_msg_2(int phoneid, ipcarg_t method, ipcarg_t arg1, ipcarg_t arg2);
#define async_msg(ph, m, a1) async_msg_2(ph, m, a1, 0)
 
/trunk/uspace/lib/libc/include/stdio.h
35,7 → 35,7
#ifndef LIBC_STDIO_H_
#define LIBC_STDIO_H_
 
#include <types.h>
#include <sys/types.h>
#include <stdarg.h>
 
#define EOF (-1)
/trunk/uspace/lib/libc/include/bitops.h
35,7 → 35,7
#ifndef LIBC_BITOPS_H_
#define LIBC_BITOPS_H_
 
#include <types.h>
#include <sys/types.h>
 
 
/** Return position of first non-zero bit from left (i.e. [log_2(arg)]).
/trunk/uspace/lib/libc/include/task.h
35,7 → 35,7
#ifndef LIBC_TASK_H_
#define LIBC_TASK_H_
 
#include <types.h>
#include <sys/types.h>
 
typedef uint64_t task_id_t;
 
/trunk/uspace/lib/libc/include/unistd.h
35,7 → 35,7
#ifndef LIBC_UNISTD_H_
#define LIBC_UNISTD_H_
 
#include <types.h>
#include <sys/types.h>
#include <libarch/config.h>
 
#define NULL 0
/trunk/uspace/lib/libc/include/thread.h
37,7 → 37,7
 
#include <kernel/proc/uarg.h>
#include <libarch/thread.h>
#include <types.h>
#include <sys/types.h>
 
typedef uint64_t thread_id_t;
 
/trunk/uspace/lib/libc/include/libc.h
35,7 → 35,7
#ifndef LIBC_LIBC_H_
#define LIBC_LIBC_H_
 
#include <types.h>
#include <sys/types.h>
#include <kernel/syscall/syscall.h>
#include <libarch/syscall.h>
 
/trunk/uspace/lib/libc/include/io/printf_core.h
35,7 → 35,7
#ifndef LIBC_PRINTF_CORE_H_
#define LIBC_PRINTF_CORE_H_
 
#include <libarch/types.h>
#include <sys/types.h>
#include <stdarg.h>
 
/** Structure for specifying output methods for different printf clones. */
/trunk/uspace/lib/libc/include/io/io.h
35,7 → 35,7
#ifndef LIBC_IO_H_
#define LIBC_IO_H_
 
#include <libarch/types.h>
#include <sys/types.h>
 
int putnchars(const char * buf, size_t count);
int putstr(const char * str);
/trunk/uspace/lib/libc/include/stdarg.h
35,7 → 35,7
#ifndef LIBC_STDARG_H_
#define LIBC_STDARG_H_
 
#include <types.h>
#include <sys/types.h>
#include <libarch/stackarg.h>
 
#ifndef __VARARGS_DEFINED
/trunk/uspace/lib/libc/include/ipc/ipc.h
38,7 → 38,7
#include <kernel/ipc/ipc.h>
#include <kernel/ddi/irq.h>
#include <libc.h>
#include <types.h>
#include <sys/types.h>
#include <kernel/synch/synch.h>
 
typedef sysarg_t ipcarg_t;
/trunk/uspace/lib/libc/include/sys/time.h
35,7 → 35,7
#ifndef LIBC_TIME_H_
#define LIBC_TIME_H_
 
#include <types.h>
#include <sys/types.h>
 
#define DST_NONE 0
 
/trunk/uspace/lib/libc/include/sys/types.h
35,8 → 35,12
#ifndef LIBC_SYS_TYPES_H_
#define LIBC_SYS_TYPES_H_
 
#include <types.h>
#include <libarch/types.h>
 
typedef unsigned long size_t;
typedef signed long ssize_t;
typedef long off_t;
 
#endif
 
/** @}
/trunk/uspace/lib/libc/include/sys/mman.h
36,6 → 36,7
#define LIBC_MMAN_H_
 
#include <as.h>
#include <sys/types.h>
 
#define MAP_FAILED ((void *) -1)
 
48,8 → 49,8
#define PROTO_WRITE AS_AREA_WRITE
#define PROTO_EXEC AS_AREA_EXEC
 
extern void *mmap(void *start, size_t length, int prot, int flags, int fd,
off_t offset);
extern void *mmap(void *start, size_t length, int prot, int flags, int fd,
off_t offset);
extern int munmap(void *start, size_t length);
 
#endif
/trunk/uspace/lib/libc/generic/as.c
36,7 → 36,7
#include <libc.h>
#include <unistd.h>
#include <align.h>
#include <types.h>
#include <sys/types.h>
#include <bitops.h>
 
/**
/trunk/uspace/lib/libc/generic/string.c
37,6 → 37,7
#include <ctype.h>
#include <limits.h>
#include <align.h>
#include <sys/types.h>
 
 
/* Dummy implementation of mem/ functions */
/trunk/uspace/lib/libc/generic/io/stream.c
45,6 → 45,7
#include <console.h>
#include <unistd.h>
#include <async.h>
#include <sys/types.h>
 
#define FDS 32
 
/trunk/uspace/lib/libc/generic/mman.c
33,6 → 33,7
*/
 
#include <sys/mman.h>
#include <sys/types.h>
#include <as.h>
#include <unistd.h>
 
/trunk/uspace/lib/libc/generic/futex.c
36,7 → 36,7
#include <atomic.h>
#include <libc.h>
#include <stdio.h>
#include <types.h>
#include <sys/types.h>
#include <kernel/synch/synch.h>
 
/*
/trunk/uspace/lib/libc/arch/sparc64/include/syscall.h
35,7 → 35,7
#ifndef LIBC_sparc64_SYSCALL_H_
#define LIBC_sparc64_SYSCALL_H_
 
#include <types.h>
#include <sys/types.h>
#include <kernel/syscall/syscall.h>
 
static inline sysarg_t
/trunk/uspace/lib/libc/arch/sparc64/include/atomic.h
35,7 → 35,7
#ifndef LIBC_sparc64_ATOMIC_H_
#define LIBC_sparc64_ATOMIC_H_
 
#include <types.h>
#include <sys/types.h>
 
/** Atomic add operation.
*
/trunk/uspace/lib/libc/arch/sparc64/include/types.h
36,9 → 36,6
#define LIBC_sparc64_TYPES_H_
 
typedef unsigned long sysarg_t;
typedef unsigned long size_t;
typedef signed long ssize_t;
typedef ssize_t off_t;
 
typedef signed char int8_t;
typedef short int int16_t;
/trunk/uspace/lib/libc/arch/sparc64/include/fibril.h
36,7 → 36,7
#define LIBC_sparc64_FIBRIL_H_
 
#include <libarch/stack.h>
#include <types.h>
#include <sys/types.h>
#include <align.h>
 
#define SP_DELTA STACK_WINDOW_SAVE_AREA_SIZE
/trunk/uspace/lib/libc/arch/ia64/include/types.h
36,9 → 36,6
#define LIBC_ia64_TYPES_H_
 
typedef unsigned long long sysarg_t;
typedef unsigned long size_t;
typedef signed long ssize_t;
typedef ssize_t off_t;
 
typedef char int8_t;
typedef short int int16_t;
/trunk/uspace/lib/libc/arch/ia64/include/fibril.h
35,7 → 35,7
#ifndef LIBC_ia64_FIBRIL_H_
#define LIBC_ia64_FIBRIL_H_
 
#include <types.h>
#include <sys/types.h>
#include <align.h>
#include <libarch/stack.h>
#include <libarch/types.h>
/trunk/uspace/lib/libc/arch/arm32/include/types.h
37,9 → 37,6
#define LIBC_arm32_TYPES_H_
 
typedef unsigned int sysarg_t;
typedef unsigned int size_t;
typedef signed int ssize_t;
typedef ssize_t off_t;
 
typedef char int8_t;
typedef short int int16_t;
/trunk/uspace/lib/libc/arch/arm32/include/fibril.h
36,7 → 36,7
#ifndef LIBC_arm32_FIBRIL_H_
#define LIBC_arm32_FIBRIL_H_
 
#include <types.h>
#include <sys/types.h>
#include <align.h>
#include "thread.h"
 
/trunk/uspace/lib/libc/arch/ppc32/include/types.h
36,9 → 36,6
#define LIBC_ppc32_TYPES_H_
 
typedef unsigned int sysarg_t;
typedef unsigned int size_t;
typedef signed int ssize_t;
typedef ssize_t off_t;
 
typedef char int8_t;
typedef short int int16_t;
/trunk/uspace/lib/libc/arch/ppc32/include/fibril.h
35,7 → 35,7
#ifndef LIBC_ppc32_FIBRIL_H_
#define LIBC_ppc32_FIBRIL_H_
 
#include <types.h>
#include <sys/types.h>
 
/* We define our own context_set, because we need to set
* the TLS pointer to the tcb+0x7000
/trunk/uspace/lib/libc/arch/amd64/include/types.h
36,9 → 36,6
#define LIBC_amd64_TYPES_H_
 
typedef unsigned long long sysarg_t;
typedef unsigned long size_t;
typedef signed long ssize_t;
typedef ssize_t off_t;
 
typedef signed char int8_t;
typedef short int int16_t;
/trunk/uspace/lib/libc/arch/amd64/include/fibril.h
35,7 → 35,7
#ifndef LIBC_amd64_FIBRIL_H_
#define LIBC_amd64_FIBRIL_H_
 
#include <types.h>
#include <sys/types.h>
 
/* According to ABI the stack MUST be aligned on
* 16-byte boundary. If it is not, the va_arg calling will
/trunk/uspace/lib/libc/arch/ppc64/include/types.h
36,9 → 36,6
#define LIBC_ppc64_TYPES_H_
 
typedef unsigned long sysarg_t;
typedef unsigned long size_t;
typedef signed long ssize_t;
typedef ssize_t off_t;
 
typedef char int8_t;
typedef short int int16_t;
/trunk/uspace/lib/libc/arch/ppc64/include/fibril.h
35,7 → 35,7
#ifndef LIBC_ppc64_FIBRIL_H_
#define LIBC_ppc64_FIBRIL_H_
 
#include <types.h>
#include <sys/types.h>
 
/* We define our own context_set, because we need to set
* the TLS pointer to the tcb+0x7000
/trunk/uspace/lib/libc/arch/mips32/include/stackarg.h
39,7 → 39,7
/* dont allow to define it second time in stdarg.h */
#define __VARARGS_DEFINED
 
#include <types.h>
#include <sys/types.h>
 
/**
* va_arg macro for MIPS32 - problem is that 64 bit values must be aligned on an 8-byte boundary (32bit values not)
/trunk/uspace/lib/libc/arch/mips32/include/types.h
37,9 → 37,6
#define LIBC_mips32_TYPES_H_
 
typedef unsigned int sysarg_t;
typedef unsigned int size_t;
typedef signed int ssize_t;
typedef ssize_t off_t;
 
typedef char int8_t;
typedef short int int16_t;
/trunk/uspace/lib/libc/arch/mips32/include/fibril.h
36,7 → 36,7
#ifndef LIBC_mips32_FIBRIL_H_
#define LIBC_mips32_FIBRIL_H_
 
#include <types.h>
#include <sys/types.h>
 
/* We define our own context_set, because we need to set
* the TLS pointer to the tcb+0x7000
/trunk/uspace/lib/libc/arch/ia32/include/stackarg.h
40,7 → 40,7
#ifndef LIBC_ia32_STACKARG_H_
#define LIBC_ia32_STACKARG_H_
 
#include <types.h>
#include <sys/types.h>
 
/* dont allow to define it second time in stdarg.h */
#define __VARARGS_DEFINED
/trunk/uspace/lib/libc/arch/ia32/include/types.h
36,9 → 36,6
#define LIBC_ia32_TYPES_H_
 
typedef unsigned int sysarg_t;
typedef unsigned int size_t;
typedef signed int ssize_t;
typedef ssize_t off_t;
 
typedef char int8_t;
typedef short int int16_t;
/trunk/uspace/lib/libc/arch/ia32/include/fibril.h
35,7 → 35,7
#ifndef LIBC_ia32_FIBRIL_H_
#define LIBC_ia32_FIBRIL_H_
 
#include <types.h>
#include <sys/types.h>
 
/* According to ABI the stack MUST be aligned on
* 16-byte boundary. If it is not, the va_arg calling will
/trunk/uspace/srv/kbd/include/key_buffer.h
37,7 → 37,7
#ifndef __KEY_BUFFER_H__
#define __KEY_BUFFER_H__
 
#include <types.h>
#include <sys/types.h>
 
/** Size of buffer for pressed keys */
#define KEYBUFFER_SIZE 128
/trunk/uspace/srv/kbd/arch/sparc64/src/kbd.c
40,7 → 40,7
#include <kbd.h>
#include <keys.h>
#include <stdio.h>
#include <types.h>
#include <sys/types.h>
#include <genarch/kbd.h>
 
#define KBD_KEY_RELEASE 0x80
/trunk/uspace/srv/fb/ppm.h
30,6 → 30,7
#define FB_PPM_H_
 
#include "fb.h"
#include <sys/types.h>
 
extern int ppm_draw(unsigned char *, size_t, unsigned int, unsigned int,
unsigned int, unsigned int, putpixel_cb_t, void *);
/trunk/uspace/srv/fb/ppm.c
26,7 → 26,7
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
#include <types.h>
#include <sys/types.h>
#include <errno.h>
 
#include "ppm.h"
34,7 → 34,8
static void skip_whitespace(unsigned char **data)
{
retry:
while (**data == ' ' || **data == '\t' || **data == '\n' || **data == '\r')
while (**data == ' ' || **data == '\t' || **data == '\n' ||
**data == '\r')
(*data)++;
if (**data == '#') {
while (1) {
56,7 → 57,8
}
}
 
int ppm_get_data(unsigned char *data, size_t dtsz, unsigned int *width, unsigned int *height)
int ppm_get_data(unsigned char *data, size_t dtsz, unsigned int *width,
unsigned int *height)
{
/* Read magic */
if (data[0] != 'P' || data[1] != '6')
81,10 → 83,9
* @param maxheight Maximum allowed height for picture
* @param putpixel Putpixel function used to print bitmap
*/
int ppm_draw(unsigned char *data, size_t datasz, unsigned int sx,
unsigned int sy,
unsigned int maxwidth, unsigned int maxheight,
putpixel_cb_t putpixel, void *vport)
int ppm_draw(unsigned char *data, size_t datasz, unsigned int sx,
unsigned int sy, unsigned int maxwidth, unsigned int maxheight,
putpixel_cb_t putpixel, void *vport)
{
unsigned int width, height;
unsigned int maxcolor;
105,22 → 106,23
read_num(&data,&maxcolor);
data++;
 
if (maxcolor == 0 || maxcolor > 255 || width*height > datasz) {
if (maxcolor == 0 || maxcolor > 255 || width * height > datasz) {
return EINVAL;
}
coef = 255/maxcolor;
if (coef*maxcolor > 255)
coef = 255 / maxcolor;
if (coef * maxcolor > 255)
coef -= 1;
for (i=0; i < width*height; i++) {
for (i = 0; i < width * height; i++) {
/* Crop picture if we don't fit into region */
if (i % width > maxwidth || i/width > maxheight) {
if (i % width > maxwidth || i / width > maxheight) {
data += 3;
continue;
}
color = ((data[0]*coef) << 16) + ((data[1]*coef) << 8) + data[2]*coef;
color = ((data[0] * coef) << 16) + ((data[1] * coef) << 8) +
data[2] * coef;
(*putpixel)(vport, sx+(i % width), sy+(i / width), color);
(*putpixel)(vport, sx + (i % width), sy + (i / width), color);
data += 3;
}
 
/trunk/uspace/srv/pci/libpci/types.h
8,7 → 8,7
* Can be freely distributed and used under the terms of the GNU GPL.
*/
 
#include <types.h>
#include <sys/types.h>
 
#ifndef PCI_HAVE_Uxx_TYPES