2010-10-18 10:32:55 -06:00
|
|
|
// Copyright 2010 The Go Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
2011-10-05 10:07:44 -06:00
|
|
|
// Plan 9-specific system calls
|
2011-11-17 20:09:28 -07:00
|
|
|
int32 runtime·pread(int32 fd, void *buf, int32 nbytes, int64 offset);
|
|
|
|
int32 runtime·pwrite(int32 fd, void *buf, int32 nbytes, int64 offset);
|
2012-12-17 09:07:40 -07:00
|
|
|
int64 runtime·seek(int32 fd, int64 offset, int32 whence);
|
2011-10-05 10:07:44 -06:00
|
|
|
void runtime·exits(int8* msg);
|
2012-08-31 11:21:13 -06:00
|
|
|
intptr runtime·brk_(void*);
|
2011-10-05 10:07:44 -06:00
|
|
|
int32 runtime·sleep(int32 ms);
|
2012-12-18 09:30:29 -07:00
|
|
|
int32 runtime·rfork(int32 flags, void *stk, M *mp, G *gp, void (*fn)(void));
|
2011-10-05 10:07:44 -06:00
|
|
|
int32 runtime·plan9_semacquire(uint32 *addr, int32 block);
|
2012-05-16 16:09:28 -06:00
|
|
|
int32 runtime·plan9_tsemacquire(uint32 *addr, int32 ms);
|
2011-10-05 10:07:44 -06:00
|
|
|
int32 runtime·plan9_semrelease(uint32 *addr, int32 count);
|
2013-01-30 03:53:56 -07:00
|
|
|
int32 runtime·notify(void (*fn)(void*, int8*));
|
2012-05-04 04:48:34 -06:00
|
|
|
int32 runtime·noted(int32);
|
2014-07-09 04:33:42 -06:00
|
|
|
int64 runtime·nsec(int64*);
|
2013-01-30 03:53:56 -07:00
|
|
|
void runtime·sigtramp(void*, int8*);
|
|
|
|
void runtime·sigpanic(void);
|
|
|
|
void runtime·goexitsall(int8*);
|
2012-10-05 14:23:30 -06:00
|
|
|
void runtime·setfpmasks(void);
|
2010-10-18 10:32:55 -06:00
|
|
|
|
2011-06-10 01:23:54 -06:00
|
|
|
/* open */
|
|
|
|
enum
|
|
|
|
{
|
2011-11-17 20:09:28 -07:00
|
|
|
OREAD = 0,
|
|
|
|
OWRITE = 1,
|
|
|
|
ORDWR = 2,
|
|
|
|
OEXEC = 3,
|
|
|
|
OTRUNC = 16,
|
|
|
|
OCEXEC = 32,
|
|
|
|
ORCLOSE = 64,
|
|
|
|
OEXCL = 0x1000
|
2011-06-10 01:23:54 -06:00
|
|
|
};
|
|
|
|
|
2010-10-18 10:32:55 -06:00
|
|
|
/* rfork */
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
RFNAMEG = (1<<0),
|
|
|
|
RFENVG = (1<<1),
|
|
|
|
RFFDG = (1<<2),
|
|
|
|
RFNOTEG = (1<<3),
|
|
|
|
RFPROC = (1<<4),
|
|
|
|
RFMEM = (1<<5),
|
|
|
|
RFNOWAIT = (1<<6),
|
|
|
|
RFCNAMEG = (1<<10),
|
|
|
|
RFCENVG = (1<<11),
|
|
|
|
RFCFDG = (1<<12),
|
|
|
|
RFREND = (1<<13),
|
|
|
|
RFNOMNT = (1<<14)
|
|
|
|
};
|
2011-06-10 01:23:54 -06:00
|
|
|
|
2012-05-04 04:48:34 -06:00
|
|
|
/* notify */
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
NCONT = 0,
|
|
|
|
NDFLT = 1
|
|
|
|
};
|
|
|
|
|
2011-06-10 01:23:54 -06:00
|
|
|
typedef struct Tos Tos;
|
|
|
|
typedef intptr Plink;
|
|
|
|
|
|
|
|
struct Tos {
|
|
|
|
struct /* Per process profiling */
|
|
|
|
{
|
|
|
|
Plink *pp; /* known to be 0(ptr) */
|
|
|
|
Plink *next; /* known to be 4(ptr) */
|
|
|
|
Plink *last;
|
|
|
|
Plink *first;
|
|
|
|
uint32 pid;
|
|
|
|
uint32 what;
|
|
|
|
} prof;
|
|
|
|
uint64 cyclefreq; /* cycle clock frequency if there is one, 0 otherwise */
|
|
|
|
int64 kcycles; /* cycles spent in kernel */
|
|
|
|
int64 pcycles; /* cycles spent in process (kernel + user) */
|
|
|
|
uint32 pid; /* might as well put the pid here */
|
|
|
|
uint32 clock;
|
|
|
|
/* top of stack is here */
|
|
|
|
};
|
|
|
|
|
2014-03-13 10:00:12 -06:00
|
|
|
#define NSIG 14 /* number of signals in runtime·SigTab array */
|
2013-01-30 03:53:56 -07:00
|
|
|
#define ERRMAX 128 /* max length of note string */
|
2014-03-13 10:00:12 -06:00
|
|
|
|
|
|
|
/* Notes in runtime·sigtab that are handled by runtime·sigpanic. */
|
|
|
|
#define SIGRFAULT 2
|
|
|
|
#define SIGWFAULT 3
|
|
|
|
#define SIGINTDIV 4
|
|
|
|
#define SIGFLOAT 5
|
|
|
|
#define SIGTRAP 6
|