#include <errno.h>
#include <assert.h>
-#define BYTE_ORDER LITTLE_ENDIAN
-
typedef i8_t s8_t;
typedef i16_t s16_t;
typedef i32_t s32_t;
/*
* Implementation-defined extensions
*/
-#if defined(__minix)
+#ifdef __minix
int lseek64(int fd, u64_t _offset, int _whence, u64_t *_newpos);
-#endif /* !__minix */
+#if defined(_MINIX)
+#include <minix/type.h>
+
+int getsigset(sigset_t *sigset);
+int getprocnr(void);
+int getnprocnr(pid_t pid);
+int getpprocnr(void);
+int _pm_findproc(char *proc_name, int *proc_nr);
+int mapdriver(char *label, int major, int style, int flags);
+int adddma(endpoint_t proc_e, phys_bytes start, phys_bytes size);
+int deldma(endpoint_t proc_e, phys_bytes start, phys_bytes size);
+int getdma(endpoint_t *procp, phys_bytes *basep, phys_bytes *sizep);
+pid_t getnpid(endpoint_t proc_ep);
+uid_t getnuid(endpoint_t proc_ep);
+gid_t getngid(endpoint_t proc_ep);
+int getnucred(endpoint_t proc_ep, struct ucred *ucred);
+#endif /* __MINIX */
+#endif /* __minix */
#if defined(_NETBSD_SOURCE)
#ifndef __minix
PUBLIC int uds_unsuspend(endpoint_t m_source, int minor)
{
- int r, bytes;
+ int r = OK, bytes;
message m_out;
uds_fd_t *fdp;
/* prepare the response */
uds_sel_reply(&m_out, DEV_SEL_REPL2, minor, fdp->sel_ops_out);
- r = OK;
} else if (fdp->ready_to_revive == 1) {
/* clear the ready to revive flag */
uds_set_reply(&m_out, DEV_REVIVE, fdp->endpoint,
fdp->io_gr, bytes);
- r = OK;
break;
case UDS_SUSPENDED_WRITE:
uds_set_reply(&m_out, DEV_REVIVE, fdp->endpoint,
fdp->io_gr, bytes);
- r = OK;
break;
case UDS_SUSPENDED_CONNECT:
uds_set_reply(&m_out, DEV_REVIVE, fdp->endpoint,
fdp->io_gr, OK);
- r = OK;
break;
default:
DPADD+= ${LIBSYS} ${LIBTIMERS} ${LIBEXEC}
LDADD+= -lsys -ltimers -lexec -lmthread
+.if ${COMPILER_TYPE} == "gnu"
+LDADD+= -lc
+.endif
+
MAN=
BINDIR?= /usr/sbin
int i, r = OK, found, isroot, mount_root, con_reqs;
struct fproc *tfp;
struct dmap *dp;
- struct vnode *root_node, *vp = NULL, *bspec;
+ struct vnode *root_node, *vp = NULL;
struct vmnt *new_vmp, *parent_vmp;
char *label;
struct node_details res;
m->DEVMAN_RESULT= res;
} else if (m->DEVMAN_RESULT != OK) {
printf("[W] devman.do_bind_device(): driver could"
- " not bind device (%d)\n", m->DEVMAN_RESULT);
+ " not bind device (%ld)\n", m->DEVMAN_RESULT);
} else {
dev->state = DEVMAN_DEVICE_BOUND;
devman_get_device(dev);
} else if (m->DEVMAN_RESULT != OK && m->DEVMAN_RESULT != 19) {
/* device drive deleted device already? */
printf("[W] devman.do_unbind_device(): driver could"
- " not unbind device (%d)\n", m->DEVMAN_RESULT);
+ " not unbind device (%ld)\n", m->DEVMAN_RESULT);
} else {
if (dev->state != DEVMAN_DEVICE_ZOMBIE) {
dev->state = DEVMAN_DEVICE_UNBOUND;
op = (rw_flag == READING ? MFS_DEV_READ : MFS_DEV_WRITE);
r = block_dev_io(op, dev, SELF_E, bp->b_data, pos, fs_block_size);
if (r < 0) {
- printf("Ext2(%d) I/O error on device %d/%d, block %lu\n",
+ printf("Ext2(%d) I/O error on device %d/%d, block %u\n",
SELF_E, major(dev), minor(dev), bp->b_blocknr);
op_failed = 1;
} else if( (unsigned) r != fs_block_size) {
/* Transfer failed. An error? Do we care? */
if (r != OK && i == 0) {
printf(
- "fs: I/O error on device %d/%d, block %lu\n",
+ "fs: I/O error on device %d/%d, block %u\n",
major(dev), minor(dev), bp->b_blocknr);
bp->b_dev = NO_DEV; /* invalidate block */
vm_forgetblocks();
rip = find_inode(fs_dev, (ino_t) fs_m_in.REQ_INODE_NR);
if (!rip) {
- printf("%s:%d put_inode: inode #%d dev: %d not found\n", __FILE__,
+ printf("%s:%d put_inode: inode #%lu dev: %d not found\n", __FILE__,
__LINE__, (ino_t) fs_m_in.REQ_INODE_NR, fs_dev);
panic("fs_putnode failed");
}
if (mtu > tcp_conn->tc_max_mtu)
mtu= tcp_conn->tc_max_mtu;
tcp_conn->tc_mtu= mtu;
- DBLOCK(0x1, printf("tcp_mtu_incr: new mtu %ld for conn %d\n",
+ DBLOCK(0x1, printf("tcp_mtu_incr: new mtu %u for conn %u\n",
mtu, tcp_conn-tcp_conn_table););
}
{
printf("RCV_NXT-RCV_LO != 0\n");
tcp_print_conn(tcp_conn);
- printf("lo_queue= %lu, hi_queue= %lu\n",
+ printf("lo_queue= %u, hi_queue= %u\n",
lo_queue, hi_queue);
allright= FALSE;
}
printf("RCV_NXT-RCV_LO != sizeof tc_rcvd_data\n");
tcp_print_conn(tcp_conn);
printf(
- "lo_queue= %lu, hi_queue= %lu, sizeof tc_rcvd_data= %d\n",
+ "lo_queue= %u, hi_queue= %u, sizeof tc_rcvd_data= %d\n",
lo_queue, hi_queue, bf_bufsize(tcp_conn->tc_rcvd_data));
allright= FALSE;
}
else
printf("???");
printf(",%u ", ntohs(tcp_hdr->th_dstport));
- printf(" 0x%lx", ntohl(tcp_hdr->th_seq_nr));
+ printf(" 0x%x", ntohl(tcp_hdr->th_seq_nr));
if (tcp_hdr->th_flags & THF_FIN)
printf(" <FIN>");
if (tcp_hdr->th_flags & THF_SYN)
if (tcp_hdr->th_flags & THF_PSH)
printf(" <PSH>");
if (tcp_hdr->th_flags & THF_ACK)
- printf(" <ACK 0x%lx %u>", ntohl(tcp_hdr->th_ack_nr),
+ printf(" <ACK 0x%x %u>", ntohl(tcp_hdr->th_ack_nr),
ntohs(tcp_hdr->th_window));
if (tcp_hdr->th_flags & THF_URG)
printf(" <URG %u>", tcp_hdr->th_urgptr);
tcp_print_state (tcp_conn);
printf(
- " ISS 0x%lx UNA +0x%lx(0x%lx) TRM +0x%lx(0x%lx) NXT +0x%lx(0x%lx)",
+ " ISS 0x%x UNA +0x%x(0x%x) TRM +0x%x(0x%x) NXT +0x%x(0x%x)",
iss, tcp_conn->tc_SND_UNA-iss, tcp_conn->tc_SND_UNA,
tcp_conn->tc_SND_TRM-iss, tcp_conn->tc_SND_TRM,
tcp_conn->tc_SND_NXT-iss, tcp_conn->tc_SND_NXT);
printf(
- " UP +0x%lx(0x%lx) PSH +0x%lx(0x%lx) ",
+ " UP +0x%x(0x%x) PSH +0x%x(0x%x) ",
tcp_conn->tc_SND_UP-iss, tcp_conn->tc_SND_UP,
tcp_conn->tc_SND_PSH-iss, tcp_conn->tc_SND_PSH);
- printf(" snd_cwnd +0x%lx(0x%lx)",
+ printf(" snd_cwnd +0x%x(0x%x)",
tcp_conn->tc_snd_cwnd-tcp_conn->tc_SND_UNA,
tcp_conn->tc_snd_cwnd);
printf(" transmit_seq ");
printf("0");
else
{
- printf("+0x%lx(0x%lx)", tcp_conn->tc_transmit_seq-iss,
+ printf("+0x%x(0x%x)", tcp_conn->tc_transmit_seq-iss,
tcp_conn->tc_transmit_seq);
}
- printf(" IRS 0x%lx LO +0x%lx(0x%lx) NXT +0x%lx(0x%lx) HI +0x%lx(0x%lx)",
+ printf(" IRS 0x%x LO +0x%x(0x%x) NXT +0x%x(0x%x) HI +0x%x(0x%x)",
irs, tcp_conn->tc_RCV_LO-irs, tcp_conn->tc_RCV_LO,
tcp_conn->tc_RCV_NXT-irs, tcp_conn->tc_RCV_NXT,
tcp_conn->tc_RCV_HI-irs, tcp_conn->tc_RCV_HI);
tcp_conn_write(tcp_conn, 1);
DBLOCK(1, printf(
"got an ack of something I haven't send\n");
- printf( "seg_ack= %lu, SND_NXT= %lu\n",
+ printf( "seg_ack= %u, SND_NXT= %u\n",
seg_ack, snd_nxt));
break;
}
pid_t pid; /* new pid */
int err[2]; /* error reporting pipe */
char line[32]; /* tty device name */
+#ifndef __NBSD_LIBC
int status;
+#endif
#ifdef __NBSD_LIBC
char **ty_getty_argv;
#endif
size = rp->p_memmap[T].mem_len
+ ((rp->p_memmap[S].mem_phys + rp->p_memmap[S].mem_len)
- rp->p_memmap[D].mem_phys);
- printf("%-7.7s%7lx %8lx %4x %4x %4x %4x %5x %5x %8lu\n",
+ printf("%-7.7s%7lx %8lx %4x %4x %4x %4x %5x %5x %8u\n",
rp->p_name,
(unsigned long) rp->p_reg.pc,
(unsigned long) rp->p_reg.sp,
return;
}
- printf("Total %u kB, free %u kB, largest free %u kB, cached %u kB\n",
+ printf("Total %lu kB, free %lu kB, largest free %lu kB, cached %lu kB\n",
vsi.vsi_total * (vsi.vsi_pagesize / 1024),
vsi.vsi_free * (vsi.vsi_pagesize / 1024),
vsi.vsi_largest * (vsi.vsi_pagesize / 1024),
if (r != block_size) {
if (r >= 0) r = END_OF_FILE;
if (r != END_OF_FILE)
- printf("ISOFS(%d) I/O error on device %d/%d, block %ld\n",
+ printf("ISOFS(%d) I/O error on device %d/%d, block %u\n",
SELF_E, (fs_dev>>MAJOR)&BYTE, (fs_dev>>MINOR)&BYTE,
bp->b_blocknr);
.PATH: ${.CURDIR}/generic
-DPADD+= ${LIBDRIVER} ${LIBSYS} ${LIBMINIXUTIL}
+DPADD+= ${LIBDRIVER} ${LIBSYS} ${LIBMINIXUTIL} ${LIBLWIP}
LDADD+= -ldriver -lsys -lminixutil -ltimers -llwip
MAN=
#include <minix/sysutil.h>
#include <minix/safecopies.h>
-#include <net/ioctl.h>
+#include <sys/ioc_net.h>
#include <net/gen/in.h>
#include <net/gen/ip_io.h>
#include <net/gen/route.h>
* at the very begining. dhcp should use raw socket but it is a little
* tricy in the current dhcp implementation
*/
- if (!netif_add(&nic->netif, &ip_addr_any, &ip_addr_none, &ip_addr_none,
- nic, ethernetif_init, ethernet_input)) {
+ if (!netif_add(&nic->netif, (ip_addr_t *) &ip_addr_any, &ip_addr_none,
+ &ip_addr_none, nic, ethernetif_init, ethernet_input)) {
printf("LWIP : failed to add device /dev/%s\n", nic->name);
nic->drv_ep = NONE;
}
extern struct tcp_conf tcp_conf[IP_PORT_MAX];
extern struct udp_conf udp_conf[IP_PORT_MAX];
void read_conf(void);
-extern char *sbrk(int);
void *alloc(size_t size);
/* Options */
#include <stdlib.h>
-#include <net/ioctl.h>
+#include <sys/ioc_net.h>
#include <net/gen/in.h>
#include <net/gen/ip_io.h>
#include <lwip/tcp.h>
-#include <net/ioctl.h>
+#include <sys/ioc_net.h>
#include "inet_config.h"
#include "proto.h"
#include <assert.h>
#include <minix/sysutil.h>
-#include <net/ioctl.h>
+#include <sys/ioc_net.h>
#include <net/gen/in.h>
#include <net/gen/tcp.h>
#include <net/gen/tcp_io.h>
#include <minix/sysutil.h>
-#include <net/ioctl.h>
+#include <sys/ioc_net.h>
#include <net/gen/in.h>
#include <net/gen/udp.h>
#include <net/gen/udp_io.h>
int s,i;
int nr_image_srvs, nr_image_priv_srvs, nr_uncaught_init_srvs;
struct rproc *rp;
- struct rproc *replica_rp;
struct rprocpub *rpub;
struct boot_image image[NR_BOOT_PROCS];
struct boot_image_priv *boot_image_priv;
struct boot_image_sys *boot_image_sys;
struct boot_image_dev *boot_image_dev;
- int pid, replica_pid;
- endpoint_t replica_endpoint;
int ipc_to;
int *calls;
int all_c[] = { ALL_C, NULL_C };
r = ds_retrieve_label_endpt("devman",&ep);
if (r != OK) {
- printf("RS: devman not running?", r);
+ printf("RS: devman not running?");
} else {
m.m_type = DEVMAN_UNBIND;
m.DEVMAN_ENDPOINT = rpub->endpoint;
#include "fs.h"
#include <fcntl.h>
#include <assert.h>
-#include <unistd.h> /* cc runs out of memory with unistd.h :-( */
+#include <unistd.h>
+#include <string.h>
#include <minix/callnr.h>
#include <minix/safecopies.h>
#include <minix/endpoint.h>
* as it isn't blocking on i/o.
*/
if(GRANT_VALID(fp->fp_grant)) {
- printf("vfs: fork: fp (endpoint %d) has grant %ld\n", fp->fp_endpoint, fp->fp_grant);
+ printf("vfs: fork: fp (endpoint %d) has grant %d\n", fp->fp_endpoint, fp->fp_grant);
panic("fp contains valid grant");
}
if(GRANT_VALID(cp->fp_grant)) {
- printf("vfs: fork: cp (endpoint %d) has grant %ld\n", cp->fp_endpoint, cp->fp_grant);
+ printf("vfs: fork: cp (endpoint %d) has grant %d\n", cp->fp_endpoint, cp->fp_grant);
panic("cp contains valid grant");
}
assert((vp->v_mode & I_TYPE) == I_CHAR_SPECIAL); /* Must be char. special */
if (vp->v_sdev != dev) {
printf("VFS (%s:%d): expected reply from dev %d not %d\n",
- vp->v_sdev, dev);
+ __FILE__, __LINE__, vp->v_sdev, dev);
return;
}
}
if(m->VMM_FLAGS & MAP_IPC_SHARED) {
vrflags |= VR_SHARED;
/* Shared memory has to be preallocated. */
- if(m->VMM_FLAGS & (MAP_PREALLOC|MAP_ANON) !=
+ if((m->VMM_FLAGS & (MAP_PREALLOC|MAP_ANON)) !=
(MAP_PREALLOC|MAP_ANON)) {
return EINVAL;
}
*===========================================================================*/
PUBLIC int do_notify_sig(message *m)
{
- int i, avails = 0, p;
+ int i, avails = 0;
endpoint_t ep = m->VM_NOTIFY_SIG_ENDPOINT;
endpoint_t ipc_ep = m->VM_NOTIFY_SIG_IPC;
int r;