00001 #ifndef misc_functions_h
00002 #define misc_functions_h
00003
00004 #include <linux/types.h>
00005 #include <linux/kdev_t.h>
00006
00007 char * do_translate(char * from);
00008 #ifndef CONFIG_VMS
00009 void * exttwo_search_fcb(struct _vcb * vcb,struct inode * inode);
00010 #else
00011 void * exttwo_search_fcb(struct _vcb * vcb,struct _fiddef * fid);
00012 #endif
00013 void * exttwo_search_fcb2(struct _vcb * vcb,struct _fiddef * fid);
00014 struct _fcb * e2_search_fcb(void * v);
00015 inline unsigned long * getefcp(struct _pcb * p, unsigned long efn);
00016 inline unsigned long * getefc(struct _pcb * p, unsigned long efn);
00017 inline unsigned long * getefcno(unsigned long efn);
00018 int alloc_ipid();
00019 void init_p1pp_long(unsigned long addr, signed long offset, signed long val);
00020 void init_p1pp_long_long(unsigned long addr, signed long offset, signed long long val);
00021 void init_p1pp_data(struct _pcb * pcb, struct _phd * phd,signed long offset);
00022 void init_sys_p1pp();
00023 void init_p1pp(struct _pcb * pcb, struct _phd * phd);
00024 int init_fork_p1pp(struct _pcb * pcb, struct _phd * phd, struct _pcb * oldpcb, struct _phd * oldphd);
00025 int shell_init_other(struct _pcb * pcb, struct _pcb * oldpcb, long addr, long oldaddr);
00026 int user_spaceable();
00027 int user_spaceable_addr(void * addr);
00028 int inline insrde(struct _rde * elem, struct _rde * head);
00029 inline void *find_task_by_pid(int pid);
00030
00031 inline void ini_fdt_act(struct _fdt * f, unsigned long long mask, void * fn, unsigned long type);
00032 inline void ini_fdt_end(struct _fdt * fdt);
00033 inline void ini_dpt_name(struct _dpt * d, char * n);
00034 inline void ini_dpt_adapt(struct _dpt * d, unsigned long type);
00035 inline void ini_dpt_flags(struct _dpt * d, unsigned long type);
00036 inline void ini_dpt_maxunits(struct _dpt * d, unsigned long type);
00037 inline void ini_dpt_ucbsize(struct _dpt * d, unsigned long type);
00038 inline void ini_dpt_struc_init(struct _dpt * d, unsigned long type);
00039 inline void ini_dpt_struc_reinit(struct _dpt * d, unsigned long type);
00040 inline void ini_dpt_ucb_crams(struct _dpt * d, unsigned long type);
00041 inline void ini_dpt_defunits(struct _dpt * d, unsigned long type);
00042 inline void ini_dpt_unload(struct _dpt * d, unsigned long type);
00043 inline void ini_dpt_adptype(struct _dpt * d, long l);
00044 inline void ini_dpt_vector(struct _dpt * d, long l);
00045 inline void ini_dpt_end(struct _dpt * d);
00046 inline void ini_ddt_ctrlinit(struct _ddt * d, unsigned long type);
00047 inline void ini_ddt_unitinit(struct _ddt * d, unsigned long type);
00048 inline void ini_ddt_start(struct _ddt * d, unsigned long type);
00049 inline void ini_ddt_kp_startio(struct _ddt * d, unsigned long type);
00050 inline void ini_ddt_kp_stack_size(struct _ddt * d, unsigned long type);
00051 inline void ini_ddt_kp_reg_mask(struct _ddt * d, unsigned long type);
00052 inline void ini_ddt_cancel(struct _ddt * d, unsigned long type);
00053 inline void ini_ddt_regdmp(struct _ddt * d, unsigned long type);
00054 inline void ini_ddt_erlgbf(struct _ddt * d, unsigned long type);
00055 inline void ini_ddt_qsrv_helper(struct _ddt * d, unsigned long type);
00056 inline void ini_ddt_end(struct _ddt * d);
00057 int init_ddb(struct _ddb * ddb, struct _ddt * ddt, struct _ucb * ucb, char * sddb);
00058 int init_ucb(struct _ucb * ucb, struct _ddb * ddb,struct _ddt * ddt, struct _crb *crb);
00059 int init_crb(struct _crb * crb);
00060 void insertdevlist(struct _ddb *d);
00061 void registerdevchan(unsigned long dev,unsigned short chan);
00062 unsigned short dev2chan(kdev_t dev);
00063 int path_unix_to_vms(char * new, char * old);
00064 int convert_soname(char * name);
00065 unsigned long get_x2p_prim_fcb();
00066 unsigned long get_xqp_prim_fcb();
00067 int rms_kernel_read(struct file *file, unsigned long offset, char * addr, unsigned long count);
00068 ssize_t rms_generic_file_read(struct file * filp, char * buf, size_t count, loff_t *ppos);
00069 void xqp_init2(void);
00070 void exttwo_init2(void * vcb);
00071 int init_phd(struct _phd * phd);
00072 void lnm_init_prc(struct _pcb * p);
00073 #ifndef CONFIG_VMS
00074 void make_fcb(struct inode * inode);
00075 #else
00076 void make_fcb(struct _fcb * inode);
00077 #endif
00078 struct file *rms_open_exec(const char *name);
00079 int rms_prepare_binprm(struct linux_binprm *bprm);
00080 struct vm_area_struct * find_vma_intersection2(struct mm_struct * mm, unsigned long start_addr, unsigned long end_addr);
00081 int ip4_vmsinit(void);
00082 int ide_vmsinit(void);
00083 int ide_vmsinit(void);
00084 int fd_vmsinit(void);
00085 int ubd_vmsinit(void);
00086 int ec_vmsinit(int dev);
00087 int er_vmsinit(int dev);
00088 int ft_vmsinit(void);
00089 int pn_vmsinit(void);
00090 int tz_vmsinit(void);
00091 int mb_vmsinit(void);
00092 int kbd_vmsinit(void);
00093 int tty_vmsinit(void);
00094 int con_vmsinit(void);
00095 int kbd_vmsinit(void);
00096 void __fl_init(void);
00097 int is_cluster_on();
00098 inline struct task_struct *find_process_by_pid(pid_t pid);
00099 void lck_searchdlck(void);
00100 inline void rdtscll_sync(unsigned long *tsc);
00101 #ifdef __x86_64__
00102 void set_rtc_mmss(unsigned long nowtime);
00103 #else
00104 int set_rtc_mmss(unsigned long nowtime);
00105 #endif
00106 void fixup_hib_pc(void * dummy);
00107 mycheckaddr(unsigned int ctl);
00108 int task_on_comqueue(struct _pcb *p);
00109 int cwps_forcex(unsigned int *pidadr, void *prcnam, unsigned int code);
00110 void * find_a_cdt(int a);
00111 int lck_grant_lock(struct _lkb * lck,struct _rsb * res, signed int curmode, signed int nextmode, int flags, int efn, signed int ggmode);
00112 int maybe_blkast(struct _rsb * res, struct _lkb * lck);
00113 int find_highest(struct _lkb * lck, struct _rsb * res);
00114 int grant_queued(struct _rsb * res, int ggmode_not, int docvt, int dowt);
00115 int inline forklock(int i, signed int j);
00116 void inline forkunlock(int i, signed int j);
00117 void lnm_lock(void);
00118 void lnm_unlock(void);
00119 void lnm_lockr(void);
00120 void lnm_unlockr(void);
00121 void lnm_lockw(void);
00122 void lnm_unlockw(void);
00123 void lnm_lock(void);
00124 void lnm_unlock(void);
00125 void lnm_lockr(void);
00126 void lnm_unlockr(void);
00127 void lnm_lockw(void);
00128 void lnm_unlockw(void);
00129 int lnm_check_prot();
00130 int mb_chanunwait(struct _ucb * u, struct _ccb * c);
00131 int ods2_block_read_full_page3(struct _wcb * wcb,struct page *page, unsigned long pageno);
00132 inline int copy_fs(unsigned long clone_flags, struct task_struct * tsk);
00133 int copy_files(unsigned long clone_flags, struct task_struct * tsk);
00134 inline int copy_sighand(unsigned long clone_flags, struct task_struct * tsk);
00135 int lnm_hash(const int length, const unsigned char * log, const unsigned long mask, unsigned long * myhash);
00136 unsigned long findpte_new(struct mm_struct *mm, unsigned long address);
00137 struct mm_struct * mm_init(struct mm_struct * mm);
00138 inline int dup_stuff(struct mm_struct * mm, struct _phd * phd);
00139 void kernel_puts(const char *s);
00140 int poison_packet(char * packet, int size, int deall);
00141 int check_packet(char * packet, int size, int deall);
00142 int ods2_block_write_full_page3(struct _wcb * wcb, struct page *page, unsigned long pageno);
00143 #ifndef CONFIG_VMS
00144 int block_prepare_write2(struct inode *inode, struct page *page, unsigned from, unsigned to, unsigned long pageno);
00145 int generic_commit_write2(struct inode * inode, struct page *page, unsigned from, unsigned to, unsigned long pageno);
00146 int ext2_direct_IO(int rw, struct inode * inode, struct kiobuf * iobuf, unsigned long blocknr, int blocksize);
00147 int ext2_get_block(struct inode *inode, long iblock, signed long *bh_result, int create, struct _fcb * fcb);
00148 int block_commit_write2(struct inode * inode, struct page *page, unsigned from, unsigned to, unsigned long pageno);
00149 #if 0
00150 int ext2_sync_inode (struct inode *inode);
00151 #endif
00152 #else
00153 int block_prepare_write2(struct _fcb *inode, struct page *page, unsigned from, unsigned to, unsigned long pageno);
00154 int generic_commit_write2(struct _fcb * inode, struct page *page, unsigned from, unsigned to, unsigned long pageno);
00155 int ext2_direct_IO(int rw, struct _fcb * inode, struct kiobuf * iobuf, unsigned long blocknr, int blocksize);
00156 int ext2_get_block(struct _vcb * vcb,struct _fcb *inode, long iblock, signed long *bh_result, int create, struct _fcb * fcb);
00157 int block_commit_write2(struct _fcb * inode, struct page *page, unsigned from, unsigned to, unsigned long pageno);
00158 #if 0
00159 int ext2_sync_inode (struct _vcb * vcb, struct _fcb *inode);
00160 #endif
00161 #endif
00162 mypfncheckaddr();
00163 void vms_submit_bh(int rw, struct buffer_head * bh);
00164 signed long e2_map_vbn(struct _fcb * fcb, signed long vbn);
00165 void myqio(long rw, long data, long size, long blocknr,kdev_t dev, long block_factor);
00166 int block_read_full_page3(struct _fcb * fcb,struct page *page, unsigned long pageno);
00167 int block_write_full_page3(struct _fcb * fcb, struct page *page, unsigned long pageno);
00168 unsigned phyio_read(unsigned handle,unsigned block,unsigned length,char *buffer);
00169 unsigned phyio_write(unsigned handle,unsigned block,unsigned length,char *buffer);
00170 int du_readblk(struct _irp * i, struct _ucb * u, struct _mscp_basic_pkt * m);
00171 int du_writeblk(struct _irp * i, struct _ucb * u, struct _mscp_basic_pkt * m);
00172 int du_rw(struct _irp * i, struct _mscp_ucb * u, struct _transfer_commands * m);
00173 void * find_mscp_cdt(void);
00174 insertfillist(struct _ucb *u, char *s);
00175 inline BLISSIF(int i);
00176 inline BLISSIFNOT(int i);
00177 long CH_PTR(long);
00178 long CH_MOVE(long,long,long);
00179 void * scs_find_name(char * c1);
00180 int swapbytes(long,long);
00181 long du_iodbunit_vmsinit(struct _ddb * ddb,int unitno, void * d);
00182 void du_iodb_clu_vmsinit(struct _ucb * u);
00183 long du_iodb_vmsinit(void);
00184 long ide_iodb_vmsinit(int mscp);
00185 long ide_iodbunit_vmsinit(struct _ddb * ddb,int unitno,void * dsc);
00186 void * find_free_cdt(void);
00187 char * do_file_translate(char * from);
00188 void __fl_init(void);
00189 unsigned phyio_init(int devlen,char *devnam,struct file **handle,struct phyio_info *info, struct _dt_ucb * ucb);
00190 void * du_init(char *s);
00191 struct _ucb * fl_init(char * s);
00192 void __du_init(void);
00193 void configure_init(void);
00194 int scs_rcv2(char * bufh, char * buf);
00195 int scs_from_myself(struct _nisca * msg,unsigned short sr_hi,unsigned long sr_lo);
00196 int scs_neigh_endnode_hello(struct sk_buff *skb);
00197 int scs_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt);
00198 int scs_rcv2(char * bufh, char * buf);
00199 void scs_fill_dx(struct _nisca * msg,unsigned short dx_hi,unsigned long dx_lo,unsigned short sr_hi,unsigned long sr_lo);
00200 void scs_msg_ctl_comm(struct _cdt *sk, unsigned char msgflg);
00201 void scs_nsp_send_conninit2(struct _cdt *sk, unsigned char msgflg, char * rprnam, char * lprnam, char * condat);
00202 void scs_msg_ctl_fill(char * buf, struct _cdt * cdt, unsigned char msgflg);
00203 void scs_msg_fill(char * buf, struct _cdt * cdt, unsigned char msgflg, struct _scs * newscs);
00204 void scs_msg_fill_more(char * buf,struct _cdt * cdt, struct _cdrp * cdrp, int bufsiz);
00205 void scs_receive ( int i);
00206 inline void scs_nsp_send2(char * buf, int len);
00207 scs_startdev ( scs_int2 , setflag , setaddr);
00208
00209 unsigned long inline buffer_offset(unsigned long buffer, unsigned long offset);
00210 int rms_get_idx(struct _rabdef * rab);
00211 int search_log_repl(char * name, char ** retname, int * retsize);
00212 unsigned search_ent(struct _fcb * fcb,struct dsc_descriptor * fibdsc,struct dsc$descriptor * filedsc, unsigned short *reslen,struct dsc$descriptor * resdsc,unsigned eofblk,unsigned action);
00213 signed int f11b_map_vbn(unsigned int vbn,struct _wcb *wcb);
00214 void f11b_write_attrib(struct _fcb * fcb,struct _atrdef * atrp);
00215 signed int f11b_map_idxvbn(struct _vcb * vcb, unsigned int vbn);
00216 void iosbret(struct _irp * i,int sts);
00217 int add_wcb(struct _fcb * fcb, unsigned short * map);
00218 struct _fcb * getmapfcb(struct _vcb * vcb);
00219 void * f11b_search_fcb(struct _vcb * vcb,struct _fiddef * fid);
00220 unsigned writechunk(struct _fcb * fcb,unsigned long vblock, char * buff);
00221 unsigned mounte2(unsigned flags, unsigned devices,char *devnam[],char *label[],struct _vcb **retvcb);
00222 unsigned f11b_access(struct _vcb * vcb, struct _irp * irp);
00223 unsigned f11b_delete(struct _vcb * vcb,struct _irp * irp);
00224 unsigned f11b_create(struct _vcb *vcb,struct _irp * i);
00225 int f11b_read_writevb(struct _irp * i);
00226 int f11b_io_done(struct _irp * i);
00227 unsigned f11b_extend(struct _fcb *fcb,unsigned blocks,unsigned contig);
00228 void *fcb_create2(struct _fh2 * head,unsigned *retsts);
00229 void *f11b_read_header(struct _vcb *vcb,struct _fiddef *fid,struct _fcb * fcb, unsigned long * retsts);
00230 void vms_ll_rw_block(int rw, int nr, struct buffer_head * bhs[],kdev_t dev);
00231 void vms_mark_buffer_dirty(struct buffer_head * bh);
00232 int e2_fcb_wcb_add_one(struct _fcb * fcb,signed long vbn,signed long result);
00233 #ifndef CONFIG_VMS
00234 int ext2_delete_entry2 (struct ext2_dir_entry_2 * dir, struct page * page, struct inode * inode );
00235 void *exttwo_fcb_create(struct inode * inode, int i_ino, unsigned *retsts);
00236 #else
00237 int ext2_delete_entry2 (struct _vcb * vcb, struct ext2_dir_entry_2 * dir, struct page * page, struct _fcb * inode );
00238 void *exttwo_fcb_create(struct _fcb * inode, int i_ino, unsigned *retsts);
00239 #endif
00240 int exttwo_read_writevb(struct _irp * i);
00241 unsigned exttwo_delete(struct _vcb * vcb,struct _irp * irp);
00242 exttwo_modify(struct _vcb * vcb, struct _irp * irp);
00243 int exttwo_io_done(struct _irp * i);
00244 unsigned exttwo_create(struct _vcb *vcb,struct _irp * i);
00245 struct _ucb * finducb(struct _fcb * fcb);
00246 int exe_altquepkt (struct _irp * i, struct _pcb * p, struct _ucb * u);
00247 int GET_DCL(struct _ucb * ucb);
00248 int VERIFY_SENSE(int *outsize, int **buf, struct _irp * i, struct _pcb * p, struct _ucb * u, struct _ccb * c);
00249 int jobctl_unsolicit(struct dsc_descriptor * term);
00250 int tty_getnextchar(int * chr, int * CC, struct _ucb * u);
00251 int tty_putnextchar(int * chr, int * CC, struct _ucb * u);
00252 void con_startio(int R3, struct _ucb * u, signed int CC);
00253
00254 #include <linux/linkage.h>
00255 asmlinkage int exe_qiow (unsigned int efn, unsigned short int chan,unsigned int func, struct _iosb *iosb, void(*astadr)(__unknown_params), long astprm, void*p1, long p2, long p3, long p4, long p5, long p6);
00256 asmlinkage int exe_qio (unsigned int efn, unsigned short int chan,unsigned int func, struct _iosb *iosb, void(*astadr)(__unknown_params), long astprm, void*p1, long p2, long p3, long p4, long p5, long p6);
00257 asmlinkage int cmod_astexit();
00258 asmlinkage long sys_unlink(const char * pathname);
00259 asmlinkage long sys_reboot(int magic1, int magic2, unsigned int cmd, void * arg);
00260 int exe_waitfr(unsigned int efn);
00261 FORKLOCK();
00262 FORKUNLOCK();
00263 int con_fdtwrite(struct _irp * i, struct _pcb * p, struct _ucb * u, struct _ccb * c);
00264 void myout(int tty, int p1, int p2);
00265 int kbd_fdtread(struct _irp * i, struct _pcb * p, struct _ucb * u, struct _ccb * c);
00266 inline CLASS_UNIT_INIT(struct _ucb * ucb,struct _tt_port * port_vector);
00267 kfreebuf(void * d);
00268 int lan_setmode(struct _irp * i, struct _pcb * p, struct _ucb * u, struct _ccb * c);
00269 int lan_sensemode(struct _irp * i, struct _pcb * p, struct _ucb * u, struct _ccb * c);
00270 int lan_setchar(struct _irp * i, struct _pcb * p, struct _ucb * u, struct _ccb * c);
00271 int lan_sensechar(struct _irp * i, struct _pcb * p, struct _ucb * u, struct _ccb * c);
00272 int lan_eth_type_trans(struct _ucb * u, void * data );
00273 int lan_netif_rx(struct _ucb * u, void * bdsc);
00274 int lan_readblk(struct _irp * i, struct _pcb * p, struct _ucb * u, struct _ccb * c);
00275 void * lan_alloc_cxb(int len);
00276 void * lan_alloc_xmit_buf(struct _irp * i, struct _ucbnidef * u, char *dest);
00277 int er_vmsinit(int dev);
00278 int ft_fdtread(struct _irp * i, struct _pcb * p, struct _ucb * u, struct _ccb * c);
00279 int ft_fdtwrite(struct _irp * i, struct _pcb * p, struct _ucb * u, struct _ccb * c);
00280 inline DEVICELOCK();
00281 inline DEVICEUNLOCK();
00282 int SEARCHDEV(struct _ddb ** ddb,char * string, int strlen);
00283 int SEARCHUNIT(struct _ddb * ddb, int unit, struct _ucb ** ucb);
00284 void mscp_talk_with(char * node, char * sysap);
00285 void sig_exit(int sig, int exit_code, struct siginfo *info);
00286
00287 #ifdef __x86_64__
00288 int new_thread(int nr, unsigned long clone_flags, unsigned long rsp,unsigned long unused,struct task_struct * p, struct pt_regs * regs);
00289 #else
00290 int new_thread(int nr, unsigned long clone_flags, unsigned long esp,unsigned long unused,struct task_struct * p, struct pt_regs * regs);
00291 #endif
00292
00293 void set_ccb_wind(short int channel, struct _fcb * fcb);
00294
00295 unsigned device_lookup(unsigned devlen,char *devnam,int create,short int *retchan);
00296 unsigned deaccesschunk(unsigned wrtvbn,int wrtblks,int reuse);
00297 unsigned mount(unsigned flags,unsigned devices,char *devnam[],char *label[],struct _vcb **vcb);
00298 int unlock_xqp(char * prefix, struct __xqp * xqp);
00299 int serial_file(char * prefix, struct __xqp * xqp, int fid);
00300 int volume_lock(char * prefix, char * name);
00301
00302 #endif
00303