Annotation of researchv9/jtools/src/pi/hostcore.h, revision 1.1.1.1

1.1       root        1: #include "core.pri"
                      2: #include "m68kcore.h"
                      3: #ifdef V9
                      4: #include <sys/param.h>
                      5: #include <sys/dir.h>
                      6: #include <machine/pte.h>
                      7: #include <sys/user.h>
                      8: #include <sys/proc.h>
                      9: #include <sys/pioctl.h>
                     10: #else
                     11: #include <sys/types.h>
                     12: #include <sys/reg.h>
                     13: #include <sys/time.h>
                     14: #include <sys/param.h>
                     15: #include <sys/user.h>
                     16: #include <sys/core.h>
                     17: #include <sys/ptrace.h>
                     18: #include <sys/wait.h>
                     19: int ptrace(int,int,...);
                     20: #endif V9
                     21: 
                     22: #define SYSADR         KERNELBASE      /* address of system seg. */
                     23: #define USRADR         UADDR           /* start of User page */
                     24: 
                     25: char *SignalName(int);
                     26: void Wait3();
                     27: 
                     28: class HostCore : public M68kCore {
                     29:        friend SigMask; friend KernCore;
                     30:        friend  HostProcess; friend HostContext;
                     31:        int     kmemfd;
                     32: #ifdef V9
                     33:        proc    pr;
                     34:        union {
                     35:                user    struct_u;
                     36:                char    char_u[ctob(UPAGES)];
                     37:        } union_u;
                     38:        char    *uarea()                { return union_u.char_u; }      
                     39:        user    *u()                    { return &union_u.struct_u; }
                     40:        char    *exechang(long e)       { return ioctl(e?PIOCSEXEC:PIOCREXEC); }
                     41:        char    *waitstop();
                     42:        short   ppid()                  { return pr.p_ppid; }
                     43:        char    *pswT();
                     44: #else
                     45:        friend  WaitList;
                     46:        Bsdcore bsdcore;
                     47:        int     pid;
                     48:        int     cursig;
                     49:        int     sigmask;
                     50:        int     state;
                     51:        int     endtext;
                     52:        int     startdata;
                     53:        int     enddata;
                     54:        int     startstack;
                     55:        char    *exechang(long);
                     56:        short   ppid()                  { return 0; }
                     57:        char    *pswT(long,int);
                     58:        char    *waitstop(int);
                     59:        int     ptrace(int,int=0,int=0,int=0);
                     60:        char    *regrw(long,char*,int,int);
                     61: #endif V9
                     62:        long    regaddr();
                     63:        int     fpvalid(long);
                     64:        long    scratchaddr();
                     65:        Behavs  behavetype();
                     66:        char    *ioctl(int);
                     67:        char    *signalmask(long);
                     68:        char    *clrcurrsig();
                     69:        char    *sendsig(long);
                     70:        char    *dostep(long,long,int);
                     71:        char    *readwrite(long,char*,int,int);
                     72: virtual char   *seekto(int&,long&,int&);
                     73: virtual int    instack(long,long);
                     74: public:
                     75:                HostCore(Process *p, Master *m):(p, m) { kmemfd = -1; }
                     76:        Context *newContext();
                     77:        Behavs  behavs();
                     78:        char    *eventname();
                     79:        char    *destroy();
                     80:        char    *laybpt(Trap*);
                     81:        char    *open();
                     82: #ifdef V9
                     83:        char    *resources();
                     84: #else
                     85:        void    close();
                     86: #endif V9
                     87:        char    *problem();
                     88:        char    *readcontrol();
                     89:        char    *reopen(char*,char*);
                     90:        char    *run();
                     91:        char    *stop();
                     92: virtual        int     event();
                     93: };
                     94: 
                     95: class HostContext : public Context { friend HostCore;
                     96:        long    regs[18];
                     97:        HostCore *core;
                     98:        int     pending;
                     99: public:
                    100:                HostContext()           {}
                    101:        void    restore();
                    102: };
                    103: 
                    104: class KernCore : public HostCore {
                    105:        long    sbr;
                    106:        long    slr;
                    107:        long    intstack;
                    108:        pcb     pcb_copy;
                    109:        long    pcb_loc;
                    110:        char    *seekto(int&,long&,int&);
                    111:        int     instack(long,long);
                    112: public:
                    113:                KernCore(Process *p, Master *m):(p,m) {}
                    114:        long    cs_fp;
                    115:        long    regloc(int,int=0);
                    116:        long    pc();
                    117:        long    fp();
                    118:        char    *open();
                    119:        char    *readcontrol();
                    120:        Behavs  behavs();
                    121:        char    *eventname();
                    122:        int     event();
                    123:        char    *getpcb(long);
                    124:        char    *specialop(char*);
                    125:        char    *special(char*,long);
                    126: };
                    127: 
                    128: #ifndef V9
                    129: class WaitMem {
                    130:        friend WaitList;
                    131:        HostCore        *core;
                    132:        WaitMem         *next;
                    133:        int             changed;
                    134:        _wait           status;
                    135: };
                    136: 
                    137: class WaitList {
                    138:        WaitMem         *head;
                    139: public:
                    140:        void            add(HostCore*);
                    141:        void            remove(HostCore*);
                    142:        int             wait(HostCore*, int);
                    143:                        WaitList()              { head = 0; }
                    144: };
                    145: 
                    146: #define WAIT_POLL      0x1
                    147: #define        WAIT_PCFIX      0x2
                    148: #define        WAIT_DISCARD    0x4
                    149: #endif V9
                    150: 
                    151: void WaitForExecHang(char*);

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.