summaryrefslogtreecommitdiff
path: root/pfinet/glue-include/linux/kernel.h
blob: a0e101b97c82a71acce5ed0f3dc68471a1590e2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#ifndef _HACK_KERNEL_H
#define _HACK_KERNEL_H

#include <stdio.h>
#include <stdlib.h>
#include <assert.h>


/* These don't actually matter since our locking protocols are different.  */
#define barrier()	((void)0) /*__asm__ __volatile__("": : :"memory") */

#define NORET_TYPE	/**/
#define ATTRIB_NORET	__attribute__((noreturn))
#define NORET_AND	noreturn,
#define FASTCALL(x)	x

/* XXX do something syslogy */
#define	KERN_EMERG
#define	KERN_ALERT
#define	KERN_CRIT
#define	KERN_ERR
#define	KERN_WARNING
#define	KERN_NOTICE
#define	KERN_INFO
#define	KERN_DEBUG

#define panic(str...)	(printk (str), assert (!"panic"))

/*
 *      Display an IP address in readable format.
 */

#define NIPQUAD(addr) \
	((unsigned char *)&addr)[0], \
	((unsigned char *)&addr)[1], \
	((unsigned char *)&addr)[2], \
	((unsigned char *)&addr)[3]


#include <linux/sched.h>
#include <linux/bitops.h>

#define printk printf

extern inline int
getname (const char *name, char **newp)
{
  *newp = malloc (strlen (name) + 1);
  strcpy (*newp, name);
  return 0;
}

extern inline void
putname (char *p)
{
  free (p);
}

/* These two functions are used only to send SIGURG.  But I can't
   find any SIGIO code at all.  So we'll just punt on that; clearly
   Linux is missing the point.  SIGURG should only be sent for
   sockets that have explicitly requested it. */
extern inline int
kill_proc (int pid, int signo, int priv)
{
  assert (signo == SIGURG);
  return 0;
}

extern inline int
kill_pg (int pgrp, int signo, int priv)
{
  assert (signo == SIGURG);
  return 0;
}


#endif