├── src ├── nano.specs ├── libx68k │ ├── libsocket │ │ ├── .gitignore │ │ ├── TCPPACKB.LZH │ │ ├── listen.c │ │ ├── shutdown.c │ │ ├── bind.c │ │ ├── connect.c │ │ ├── getpeername.c │ │ ├── getsockname.c │ │ ├── recv.c │ │ ├── send.c │ │ ├── getprotonamnum.c │ │ ├── recvfrom.c │ │ ├── sendto.c │ │ ├── accept.c │ │ └── getnetnamadr.c │ ├── _crt0vars1.S │ ├── libdos │ │ ├── exit.S │ │ ├── getc.S │ │ ├── wait.S │ │ ├── inkey.S │ │ ├── cinsns.S │ │ ├── cominp.S │ │ ├── consns.S │ │ ├── curdrv.S │ │ ├── keysns.S │ │ ├── prnsns.S │ │ ├── coutsns.S │ │ ├── fflush.S │ │ ├── getchar.S │ │ ├── getdate.S │ │ ├── gettim2.S │ │ ├── gettime.S │ │ ├── kill_pr.S │ │ ├── verifyg.S │ │ ├── ctlabort.S │ │ ├── errabort.S │ │ ├── time_pr.S │ │ ├── vernum.S │ │ ├── allclose.S │ │ ├── change_pr.S │ │ ├── exit2.S │ │ ├── retshell.S │ │ ├── dup.S │ │ ├── c_up_s.S │ │ ├── close.S │ │ ├── fgetc.S │ │ ├── mfree.S │ │ ├── c_curon.S │ │ ├── chgdrv.S │ │ ├── comout.S │ │ ├── hendspmo.S │ │ ├── inpout.S │ │ ├── k_keyinp.S │ │ ├── prnout.S │ │ ├── verify.S │ │ ├── breakck.S │ │ ├── c_curoff.S │ │ ├── c_down_s.S │ │ ├── chdir.S │ │ ├── gets.S │ │ ├── hendspio.S │ │ ├── hendspmc.S │ │ ├── hendspsc.S │ │ ├── hendspso.S │ │ ├── k_keysns.S │ │ ├── k_sftsns.S │ │ ├── kflushgc.S │ │ ├── kflushgp.S │ │ ├── kflushin.S │ │ ├── mkdir.S │ │ ├── print.S │ │ ├── putchar.S │ │ ├── rmdir.S │ │ ├── s_mfree.S │ │ ├── setdate.S │ │ ├── settim2.S │ │ ├── settime.S │ │ ├── c_up.S │ │ ├── delete.S │ │ ├── getss.S │ │ ├── keeppr.S │ │ ├── sleep_pr.S │ │ ├── c_putc.S │ │ ├── nfiles.S │ │ ├── pspset.S │ │ ├── c_del.S │ │ ├── c_down.S │ │ ├── c_ins.S │ │ ├── c_left.S │ │ ├── fflush_set.S │ │ ├── suspend_pr.S │ │ ├── c_cls_ed.S │ │ ├── c_color.S │ │ ├── c_era_ed.S │ │ ├── c_right.S │ │ ├── dup0.S │ │ ├── dup2.S │ │ ├── getpdb.S │ │ ├── ioctrlgt.S │ │ ├── c_cls_al.S │ │ ├── c_cls_st.S │ │ ├── c_era_al.S │ │ ├── c_era_st.S │ │ ├── c_width.S │ │ ├── fputc.S │ │ ├── ioctrlis.S │ │ ├── ioctrlos.S │ │ ├── k_keybit.S │ │ ├── kflushio.S │ │ ├── open.S │ │ ├── c_fnkmod.S │ │ ├── c_print.S │ │ ├── curdir.S │ │ ├── hendspic.S │ │ ├── indosflg.S │ │ ├── k_insmod.S │ │ ├── rassign.S │ │ ├── super.S │ │ ├── common_ck.S │ │ ├── drvxchg.S │ │ ├── fputs.S │ │ ├── ioctrldvgt.S │ │ ├── move.S │ │ ├── fgets.S │ │ ├── filedate.S │ │ ├── fnckeygt.S │ │ ├── ioctrlfdgt.S │ │ ├── maketmp.S │ │ ├── setblock.S │ │ ├── common_del.S │ │ ├── create.S │ │ ├── dskfre.S │ │ ├── get_pr.S │ │ ├── getdpb.S │ │ ├── kflushgs.S │ │ ├── rename.S │ │ ├── chmod.S │ │ ├── fatchk.S │ │ ├── newfile.S │ │ ├── intvcg.S │ │ ├── malloc.S │ │ ├── nameck.S │ │ ├── seek.S │ │ ├── c_locate.S │ │ ├── c_window.S │ │ ├── ioctrlst.S │ │ ├── namests.S │ │ ├── read.S │ │ ├── exnfiles.S │ │ ├── getenv.S │ │ ├── hendspip.S │ │ ├── hendspir.S │ │ ├── hendspmp.S │ │ ├── hendspmr.S │ │ ├── hendspsp.S │ │ ├── hendspsr.S │ │ ├── write.S │ │ ├── drvctrl.S │ │ ├── getassign.S │ │ ├── ioctrlrtset.S │ │ ├── lock.S │ │ ├── setenv.S │ │ ├── setpdb.S │ │ ├── files.S │ │ ├── unlock.S │ │ ├── fnckeyst.S │ │ ├── intvcs.S │ │ ├── malloc2.S │ │ ├── s_process.S │ │ ├── get_fcb_adr.S │ │ ├── ioctrlrd.S │ │ ├── ioctrlrh.S │ │ ├── s_malloc.S │ │ ├── common_lk.S │ │ ├── execonly.S │ │ ├── loadonly.S │ │ ├── common_fre.S │ │ ├── common_rd.S │ │ ├── diskred.S │ │ ├── ioctrlwd.S │ │ ├── ioctrlwh.S │ │ ├── os_patch.S │ │ ├── common_wt.S │ │ ├── diskwrt.S │ │ ├── pathchk.S │ │ ├── ioctrldvctl.S │ │ ├── ioctrlfdctl.S │ │ ├── makeassign.S │ │ ├── fatchk2.S │ │ ├── exfiles.S │ │ ├── send_pr.S │ │ ├── diskred2.S │ │ ├── diskwrt2.S │ │ ├── bindno.S │ │ ├── exec2.S │ │ ├── load.S │ │ ├── malloc0.S │ │ ├── s_malloc0.S │ │ ├── loadexec.S │ │ ├── memcpy.S │ │ ├── open_pr.S │ │ └── super_jsr.S │ ├── isatty.c │ ├── _crt0vars-nodos.S │ ├── libpthread │ │ ├── pthread_yield.c │ │ ├── pthread_equal.c │ │ ├── pthread_spin_unlock.c │ │ ├── pthread_spin_init.c │ │ ├── pthread_cond_init.c │ │ ├── pthread_spin_destroy.c │ │ ├── pthread_mutex_init.c │ │ ├── pthread_rwlock_init.c │ │ ├── pthread_self.c │ │ ├── pthread_condattr_init.c │ │ ├── pthread_rwlockattr_init.c │ │ ├── pthread_barrierattr_init.c │ │ ├── pthread_attr_setdetachstate.c │ │ ├── pthread_cond_destroy.c │ │ ├── pthread_mutex_destroy.c │ │ ├── pthread_rwlock_destroy.c │ │ ├── pthread_attr_setschedparam.c │ │ ├── pthread_barrier_destroy.c │ │ ├── pthread_barrier_init.c │ │ ├── pthread_attr_getstacksize.c │ │ ├── pthread_attr_getdetachstate.c │ │ ├── pthread_attr_getschedparam.c │ │ ├── pthread_attr_getname_np.c │ │ ├── pthread_attr_setstacksize.c │ │ ├── pthread_attr_getsystemstacksize_np.c │ │ ├── pthread_spin_trylock.c │ │ ├── pthread_mutex_trylock.c │ │ ├── pthread_attr_setname_np.c │ │ ├── pthread_attr_setsystemstacksize_np.c │ │ ├── pthread_attr_getstack.c │ │ ├── pthread_attr_setstack.c │ │ ├── pthread_detach.c │ │ ├── pthread_attr_getsystemstack_np.c │ │ ├── pthread_attr_setsystemstack_np.c │ │ ├── pthread_spin_lock.c │ │ ├── pthread_once.c │ │ ├── pthread_cancel.c │ │ ├── pthread_attr_init.c │ │ ├── pthread_cond_signal.c │ │ ├── pthread_rwlock_tryrdlock.c │ │ ├── pthread_rwlock_trywrlock.c │ │ ├── pthread_cond_broadcast.c │ │ ├── pthread_mutexattr_init.c │ │ └── pthread_mutex_unlock.c │ ├── libiocs │ │ ├── iplerr.S │ │ ├── wipe.S │ │ ├── b_up_s.S │ │ ├── densns.S │ │ ├── opmsns.S │ │ ├── snsprn.S │ │ ├── sp_on.S │ │ ├── abortjob.S │ │ ├── b_curon.S │ │ ├── inp232c.S │ │ ├── lof232c.S │ │ ├── ms_init.S │ │ ├── ms_stat.S │ │ ├── sp_off.S │ │ ├── timeget.S │ │ ├── adpcmsns.S │ │ ├── b_curoff.S │ │ ├── b_down_s.S │ │ ├── b_keyinp.S │ │ ├── b_keysns.S │ │ ├── b_sftsns.S │ │ ├── dmamode.S │ │ ├── isns232c.S │ │ ├── ms_curgt.S │ │ ├── ms_curof.S │ │ ├── ms_curon.S │ │ ├── ms_getdt.S │ │ ├── ontime.S │ │ ├── osns232c.S │ │ ├── sp_init.S │ │ ├── abortrst.S │ │ ├── b_up.S │ │ ├── g_clr_on.S │ │ ├── os_curof.S │ │ ├── os_curon.S │ │ ├── b_del.S │ │ ├── b_ins.S │ │ ├── bindateget.S │ │ ├── apage.S │ │ ├── b_down.S │ │ ├── b_left.S │ │ ├── b_putc.S │ │ ├── bitsns.S │ │ ├── crtmod.S │ │ ├── joyget.S │ │ ├── ms_sel.S │ │ ├── outlpt.S │ │ ├── outprn.S │ │ ├── tcolor.S │ │ ├── tvctrl.S │ │ ├── vpage.S │ │ ├── b_clr_al.S │ │ ├── b_clr_ed.S │ │ ├── b_clr_st.S │ │ ├── b_color.S │ │ ├── b_eject.S │ │ ├── b_era_al.S │ │ ├── b_era_ed.S │ │ ├── b_era_st.S │ │ ├── b_right.S │ │ ├── datebin.S │ │ ├── out232c.S │ │ ├── s_phase.S │ │ ├── s_reset.S │ │ ├── set232c.S │ │ ├── skeyset.S │ │ ├── timebcd.S │ │ ├── timebin.S │ │ ├── timeset.S │ │ ├── adpcmmod.S │ │ ├── alarmmod.S │ │ ├── b_drvsns.S │ │ ├── b_recali.S │ │ ├── contrast.S │ │ ├── dakjob.S │ │ ├── dayasc.S │ │ ├── hanjob.S │ │ ├── romver.S │ │ ├── b_print.S │ │ ├── bgctrlgt.S │ │ ├── bootinf.S │ │ ├── box.S │ │ ├── dateasc.S │ │ ├── datecnv.S │ │ ├── hsyncst.S │ │ ├── ms_sel2.S │ │ ├── sp_cgclr.S │ │ ├── timeasc.S │ │ ├── timecnv.S │ │ ├── b_bpeek.S │ │ ├── b_lpeek.S │ │ ├── b_wpeek.S │ │ ├── bindatebcd.S │ │ ├── bindateset.S │ │ ├── fill.S │ │ ├── line.S │ │ ├── opmintst.S │ │ ├── paint.S │ │ ├── prnintst.S │ │ ├── pset.S │ │ ├── b_intvcs.S │ │ ├── getgrm.S │ │ ├── point.S │ │ ├── txbox.S │ │ ├── txrev.S │ │ ├── cache_st.S │ │ ├── circle.S │ │ ├── mpu_stat.S │ │ ├── putgrm.S │ │ ├── symbol.S │ │ ├── drawmode.S │ │ ├── jissft.S │ │ ├── s_msgin.S │ │ ├── s_stsin.S │ │ ├── sftjis.S │ │ ├── txfill.S │ │ ├── txxline.S │ │ ├── txyline.S │ │ ├── ms_patst.S │ │ ├── s_msgout.S │ │ ├── b_bpoke.S │ │ ├── b_lpoke.S │ │ ├── b_wpoke.S │ │ ├── crtcras.S │ │ ├── txline.S │ │ ├── b_seek.S │ │ ├── ledmod.S │ │ ├── ms_curst.S │ │ ├── opmset.S │ │ ├── tpalet.S │ │ ├── gpalet.S │ │ ├── ms_ontm.S │ │ ├── tgusemd.S │ │ ├── tpalet2.S │ │ ├── adpcmlin.S │ │ ├── adpcmlot.S │ │ ├── b_drvchk.S │ │ ├── b_locate.S │ │ ├── ms_offtm.S │ │ ├── bgtextcl.S │ │ ├── alarmset.S │ │ ├── rmacnv.S │ │ ├── akconv.S │ │ ├── defchr.S │ │ ├── init_prn.S │ │ ├── s_select.S │ │ ├── sp_gtpcg.S │ │ ├── fntget.S │ │ ├── sp_defcg.S │ │ ├── textget.S │ │ ├── b_curmod.S │ │ ├── s_cmdout.S │ │ ├── s_datain.S │ │ ├── s_testunit.S │ │ ├── textput.S │ │ ├── adpcminp.S │ │ ├── b_curdef.S │ │ ├── b_curpat1.S │ │ ├── s_dataout.S │ │ ├── window.S │ │ ├── adpcmout.S │ │ ├── b_dskini.S │ │ ├── b_super.S │ │ ├── s_rezerounit.S │ │ ├── bgtextst.S │ │ ├── home.S │ │ ├── s_readcap.S │ │ ├── scroll.S │ │ ├── adpcmain.S │ │ ├── adpcmaot.S │ │ ├── b_memset.S │ │ ├── b_memstr.S │ │ ├── spalet.S │ │ ├── vdispst.S │ │ ├── b_badfmt.S │ │ ├── b_read.S │ │ ├── b_readid.S │ │ ├── timerdst.S │ │ ├── bgctrlst.S │ │ ├── bgscrlst.S │ │ ├── bgtextgt.S │ │ ├── s_seek.S │ │ ├── txrascpy.S │ │ ├── b_curpat.S │ │ ├── b_readdi.S │ │ ├── b_readdl.S │ │ ├── b_write.S │ │ ├── dmamov_l.S │ │ ├── skey_mod.S │ │ ├── b_assign.S │ │ ├── b_format.S │ │ ├── b_putmes.S │ │ ├── b_verify.S │ │ ├── b_writed.S │ │ ├── s_format.S │ │ ├── s_read.S │ │ ├── s_write.S │ │ ├── s_pamedium.S │ │ ├── s_readext.S │ │ ├── s_startstop.S │ │ ├── s_request.S │ │ ├── s_writeext.S │ │ ├── hsvtorgb.S │ │ ├── s_reassign.S │ │ ├── alarmget.S │ │ ├── clipput.S │ │ ├── s_inquiry.S │ │ ├── b_scroll.S │ │ ├── dmamove.S │ │ ├── ms_limit.S │ │ ├── sp_regst.S │ │ ├── trap15.S │ │ ├── b_consol.S │ │ ├── dmamov_a.S │ │ ├── bgscrlgt.S │ │ ├── cache_md.S │ │ └── sp_reggt.S │ ├── _heapsize.S │ ├── _stacksize.S │ ├── creat.c │ ├── fork.c │ ├── getpid.c │ ├── wait.c │ ├── _exit.c │ ├── Common.mk │ ├── fcntl.c │ ├── kill.c │ ├── symlink.c │ ├── link.c │ ├── times.c │ ├── chown.c │ ├── execve.c │ ├── getentropy.c │ ├── readlink.c │ ├── telldir.c │ ├── closedir.c │ ├── _crt0vars.S │ ├── _at_exit.h │ ├── rmdir.c │ ├── unlink.c │ ├── mkdir.c │ ├── lseek.c │ ├── rename.c │ ├── _dosinit.c │ ├── write-nodos.c │ ├── chdir.c │ ├── _sflags.c │ └── readdir.c ├── c++small.specs ├── _default_fcntl.h ├── x68knodos.specs ├── features.h ├── x68k.specs ├── xc.specs.tmpl ├── m68k-xelf-gdb └── dirent.h ├── .gitignore └── .gitmodules /src/nano.specs: -------------------------------------------------------------------------------- 1 | *lib: 2 | -lc-nano 3 | -------------------------------------------------------------------------------- /src/libx68k/libsocket/.gitignore: -------------------------------------------------------------------------------- 1 | tcppack/ 2 | gethostnamadr.c 3 | network.h 4 | search_ti_entry.c 5 | tcpipdrv.h 6 | -------------------------------------------------------------------------------- /src/libx68k/libsocket/TCPPACKB.LZH: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunkya2/elf2x68k/HEAD/src/libx68k/libsocket/TCPPACKB.LZH -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | *.x 4 | *.elf* 5 | *.sys 6 | *.bz2 7 | .vscode 8 | .DS_Store 9 | build_gcc*/ 10 | download/ 11 | m68k-xelf*/ 12 | -------------------------------------------------------------------------------- /src/libx68k/_crt0vars1.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Variables used by crt0 (for "-nostartfiles") 3 | */ 4 | 5 | .comm _PSP, 4 6 | .comm _HSTA, 4 7 | .comm _HEND, 4 8 | -------------------------------------------------------------------------------- /src/libx68k/libdos/exit.S: -------------------------------------------------------------------------------- 1 | | __dead void _dos_exit (void); 2 | .text 3 | .even 4 | .global _dos_exit 5 | .type _dos_exit,@function 6 | _dos_exit: 7 | .short 0xff00 8 | -------------------------------------------------------------------------------- /src/libx68k/libdos/getc.S: -------------------------------------------------------------------------------- 1 | | int _dos_getc (void); 2 | .text 3 | .even 4 | .global _dos_getc 5 | .type _dos_getc,@function 6 | _dos_getc: 7 | .short 0xff08 8 | rts 9 | -------------------------------------------------------------------------------- /src/libx68k/libdos/wait.S: -------------------------------------------------------------------------------- 1 | | int _dos_wait (void); 2 | .text 3 | .even 4 | .global _dos_wait 5 | .type _dos_wait,@function 6 | _dos_wait: 7 | .short 0xff4d 8 | rts 9 | -------------------------------------------------------------------------------- /src/c++small.specs: -------------------------------------------------------------------------------- 1 | *cc1plus: 2 | -fno-rtti -fno-exceptions 3 | 4 | *link: 5 | -z max-page-size=2 -T x68k.ld --wrap __sflags %:replace-outfile(-lstdc++ -lstdc++small) 6 | -------------------------------------------------------------------------------- /src/libx68k/libdos/inkey.S: -------------------------------------------------------------------------------- 1 | | int _dos_inkey (void); 2 | .text 3 | .even 4 | .global _dos_inkey 5 | .type _dos_inkey,@function 6 | _dos_inkey: 7 | .short 0xff07 8 | rts 9 | -------------------------------------------------------------------------------- /src/libx68k/isatty.c: -------------------------------------------------------------------------------- 1 | /* 2 | * isatty() 3 | */ 4 | 5 | #include 6 | #include 7 | 8 | int isatty(int fd) 9 | { 10 | return fd < 5; 11 | } 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/cinsns.S: -------------------------------------------------------------------------------- 1 | | int _dos_cinsns (void); 2 | .text 3 | .even 4 | .global _dos_cinsns 5 | .type _dos_cinsns,@function 6 | _dos_cinsns: 7 | .short 0xff12 8 | rts 9 | -------------------------------------------------------------------------------- /src/libx68k/libdos/cominp.S: -------------------------------------------------------------------------------- 1 | | int _dos_cominp (void); 2 | .text 3 | .even 4 | .global _dos_cominp 5 | .type _dos_cominp,@function 6 | _dos_cominp: 7 | .short 0xff03 8 | rts 9 | -------------------------------------------------------------------------------- /src/libx68k/libdos/consns.S: -------------------------------------------------------------------------------- 1 | | int _dos_consns (void); 2 | .text 3 | .even 4 | .global _dos_consns 5 | .type _dos_consns,@function 6 | _dos_consns: 7 | .short 0xff10 8 | rts 9 | -------------------------------------------------------------------------------- /src/libx68k/libdos/curdrv.S: -------------------------------------------------------------------------------- 1 | | int _dos_curdrv (void); 2 | .text 3 | .even 4 | .global _dos_curdrv 5 | .type _dos_curdrv,@function 6 | _dos_curdrv: 7 | .short 0xff19 8 | rts 9 | -------------------------------------------------------------------------------- /src/libx68k/libdos/keysns.S: -------------------------------------------------------------------------------- 1 | | int _dos_keysns (void); 2 | .text 3 | .even 4 | .global _dos_keysns 5 | .type _dos_keysns,@function 6 | _dos_keysns: 7 | .short 0xff0b 8 | rts 9 | -------------------------------------------------------------------------------- /src/libx68k/libdos/prnsns.S: -------------------------------------------------------------------------------- 1 | | int _dos_prnsns (void); 2 | .text 3 | .even 4 | .global _dos_prnsns 5 | .type _dos_prnsns,@function 6 | _dos_prnsns: 7 | .short 0xff11 8 | rts 9 | -------------------------------------------------------------------------------- /src/libx68k/libdos/coutsns.S: -------------------------------------------------------------------------------- 1 | | int _dos_coutsns (void); 2 | .text 3 | .even 4 | .global _dos_coutsns 5 | .type _dos_coutsns,@function 6 | _dos_coutsns: 7 | .short 0xff13 8 | rts 9 | -------------------------------------------------------------------------------- /src/libx68k/libdos/fflush.S: -------------------------------------------------------------------------------- 1 | | void _dos_fflush (void); 2 | .text 3 | .even 4 | .global _dos_fflush 5 | .type _dos_fflush,@function 6 | _dos_fflush: 7 | .short 0xff0d 8 | rts 9 | -------------------------------------------------------------------------------- /src/libx68k/libdos/getchar.S: -------------------------------------------------------------------------------- 1 | | int _dos_getchar (void); 2 | .text 3 | .even 4 | .global _dos_getchar 5 | .type _dos_getchar,@function 6 | _dos_getchar: 7 | .short 0xff01 8 | rts 9 | -------------------------------------------------------------------------------- /src/libx68k/libdos/getdate.S: -------------------------------------------------------------------------------- 1 | | int _dos_getdate (void); 2 | .text 3 | .even 4 | .global _dos_getdate 5 | .type _dos_getdate,@function 6 | _dos_getdate: 7 | .short 0xff2a 8 | rts 9 | -------------------------------------------------------------------------------- /src/libx68k/libdos/gettim2.S: -------------------------------------------------------------------------------- 1 | | int _dos_gettim2 (void); 2 | .text 3 | .even 4 | .global _dos_gettim2 5 | .type _dos_gettim2,@function 6 | _dos_gettim2: 7 | .short 0xff27 8 | rts 9 | -------------------------------------------------------------------------------- /src/libx68k/libdos/gettime.S: -------------------------------------------------------------------------------- 1 | | int _dos_gettime (void); 2 | .text 3 | .even 4 | .global _dos_gettime 5 | .type _dos_gettime,@function 6 | _dos_gettime: 7 | .short 0xff2c 8 | rts 9 | -------------------------------------------------------------------------------- /src/libx68k/libdos/kill_pr.S: -------------------------------------------------------------------------------- 1 | | int _dos_kill_pr (void); 2 | .text 3 | .even 4 | .global _dos_kill_pr 5 | .type _dos_kill_pr,@function 6 | _dos_kill_pr: 7 | .short 0xfff9 8 | rts 9 | -------------------------------------------------------------------------------- /src/libx68k/libdos/verifyg.S: -------------------------------------------------------------------------------- 1 | | int _dos_verifyg (void); 2 | .text 3 | .even 4 | .global _dos_verifyg 5 | .type _dos_verifyg,@function 6 | _dos_verifyg: 7 | .short 0xff84 8 | rts 9 | -------------------------------------------------------------------------------- /src/_default_fcntl.h: -------------------------------------------------------------------------------- 1 | #include_next 2 | 3 | #ifndef O_BINARY 4 | #define O_BINARY 0x10000 5 | #endif 6 | #ifndef O_TEXT 7 | #define O_TEXT 0x20000 8 | #endif 9 | -------------------------------------------------------------------------------- /src/libx68k/_crt0vars-nodos.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Variables used by crt0 (without Human68k). 3 | */ 4 | 5 | .comm _SSTA, 4 6 | .comm _SEND, 4 7 | .comm _HSTA, 4 8 | .comm _HEND, 4 9 | -------------------------------------------------------------------------------- /src/libx68k/libdos/ctlabort.S: -------------------------------------------------------------------------------- 1 | | __dead void _dos_ctlabort (void); 2 | .text 3 | .even 4 | .global _dos_ctlabort 5 | .type _dos_ctlabort,@function 6 | _dos_ctlabort: 7 | .short 0xfff1 8 | -------------------------------------------------------------------------------- /src/libx68k/libdos/errabort.S: -------------------------------------------------------------------------------- 1 | | __dead void _dos_errabort (void); 2 | .text 3 | .even 4 | .global _dos_errabort 5 | .type _dos_errabort,@function 6 | _dos_errabort: 7 | .short 0xfff2 8 | -------------------------------------------------------------------------------- /src/libx68k/libdos/time_pr.S: -------------------------------------------------------------------------------- 1 | | long _dos_time_pr (void); 2 | .text 3 | .even 4 | .global _dos_time_pr 5 | .type _dos_time_pr,@function 6 | _dos_time_pr: 7 | .short 0xfffe 8 | rts 9 | -------------------------------------------------------------------------------- /src/libx68k/libdos/vernum.S: -------------------------------------------------------------------------------- 1 | | int __pure _dos_vernum (void); 2 | .text 3 | .even 4 | .global _dos_vernum 5 | .type _dos_vernum,@function 6 | _dos_vernum: 7 | .short 0xff30 8 | rts 9 | -------------------------------------------------------------------------------- /src/libx68k/libdos/allclose.S: -------------------------------------------------------------------------------- 1 | | void _dos_allclose (void); 2 | .text 3 | .even 4 | .global _dos_allclose 5 | .type _dos_allclose,@function 6 | _dos_allclose: 7 | .short 0xff1f 8 | rts 9 | -------------------------------------------------------------------------------- /src/libx68k/libdos/change_pr.S: -------------------------------------------------------------------------------- 1 | | void _dos_change_pr (void); 2 | .text 3 | .even 4 | .global _dos_change_pr 5 | .type _dos_change_pr,@function 6 | _dos_change_pr: 7 | .short 0xffff 8 | rts 9 | -------------------------------------------------------------------------------- /src/libx68k/libdos/exit2.S: -------------------------------------------------------------------------------- 1 | | __dead void _dos_exit2 (int); 2 | .text 3 | .even 4 | .global _dos_exit2 5 | .type _dos_exit2,@function 6 | _dos_exit2: 7 | move.w %sp@(6), %sp@- 8 | .short 0xff4c 9 | -------------------------------------------------------------------------------- /src/libx68k/libpthread/pthread_yield.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pthread_yield() 3 | */ 4 | 5 | #include "pthread_internal.h" 6 | 7 | void pthread_yield(void) 8 | { 9 | _dos_change_pr(); 10 | } 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/iplerr.S: -------------------------------------------------------------------------------- 1 | | __dead void _iocs_iplerr (void); 2 | .text 3 | .even 4 | .global _iocs_iplerr 5 | .type _iocs_iplerr,@function 6 | _iocs_iplerr: 7 | moveq #0xfffffffe, %d0 8 | trap #15 9 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/wipe.S: -------------------------------------------------------------------------------- 1 | | int _iocs_wipe (void); 2 | .text 3 | .even 4 | .global _iocs_wipe 5 | .type _iocs_wipe,@function 6 | _iocs_wipe: 7 | moveq #0xffffffb5, %d0 8 | trap #15 9 | rts 10 | -------------------------------------------------------------------------------- /src/libx68k/libdos/retshell.S: -------------------------------------------------------------------------------- 1 | | __dead void _dos_retshell (void); 2 | .text 3 | .even 4 | .global _dos_retshell 5 | .type _dos_retshell,@function 6 | _dos_retshell: 7 | .global _dos_exitvc 8 | .short 0xfff0 9 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_up_s.S: -------------------------------------------------------------------------------- 1 | | void _iocs_b_up_s (void); 2 | .text 3 | .even 4 | .global _iocs_b_up_s 5 | .type _iocs_b_up_s,@function 6 | _iocs_b_up_s: 7 | moveq #0x25, %d0 8 | trap #15 9 | rts 10 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/densns.S: -------------------------------------------------------------------------------- 1 | | void _iocs_densns (void); 2 | .text 3 | .even 4 | .global _iocs_densns 5 | .type _iocs_densns,@function 6 | _iocs_densns: 7 | moveq #0x7e, %d0 8 | trap #15 9 | rts 10 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/opmsns.S: -------------------------------------------------------------------------------- 1 | | int _iocs_opmsns (void); 2 | .text 3 | .even 4 | .global _iocs_opmsns 5 | .type _iocs_opmsns,@function 6 | _iocs_opmsns: 7 | moveq #0x69, %d0 8 | trap #15 9 | rts 10 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/snsprn.S: -------------------------------------------------------------------------------- 1 | | int _iocs_snsprn (void); 2 | .text 3 | .even 4 | .global _iocs_snsprn 5 | .type _iocs_snsprn,@function 6 | _iocs_snsprn: 7 | moveq #0x3d, %d0 8 | trap #15 9 | rts 10 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/sp_on.S: -------------------------------------------------------------------------------- 1 | | int _iocs_sp_on (void); 2 | .text 3 | .even 4 | .global _iocs_sp_on 5 | .type _iocs_sp_on,@function 6 | _iocs_sp_on: 7 | moveq #0xffffffc1, %d0 8 | trap #15 9 | rts 10 | -------------------------------------------------------------------------------- /src/libx68k/_heapsize.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Heap size definition 3 | */ 4 | 5 | #include "config.h" 6 | 7 | .data 8 | 9 | .global _heap_size 10 | _heap_size: 11 | .long HEAP_SIZE 12 | 13 | .end 14 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/abortjob.S: -------------------------------------------------------------------------------- 1 | | __dead void _iocs_abortjob (void); 2 | .text 3 | .even 4 | .global _iocs_abortjob 5 | .type _iocs_abortjob,@function 6 | _iocs_abortjob: 7 | moveq #0xffffffff, %d0 8 | trap #15 9 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_curon.S: -------------------------------------------------------------------------------- 1 | | void _iocs_b_curon (void); 2 | .text 3 | .even 4 | .global _iocs_b_curon 5 | .type _iocs_b_curon,@function 6 | _iocs_b_curon: 7 | moveq #0x1e, %d0 8 | trap #15 9 | rts 10 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/inp232c.S: -------------------------------------------------------------------------------- 1 | | int _iocs_inp232c (void); 2 | .text 3 | .even 4 | .global _iocs_inp232c 5 | .type _iocs_inp232c,@function 6 | _iocs_inp232c: 7 | moveq #0x32, %d0 8 | trap #15 9 | rts 10 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/lof232c.S: -------------------------------------------------------------------------------- 1 | | int _iocs_lof232c (void); 2 | .text 3 | .even 4 | .global _iocs_lof232c 5 | .type _iocs_lof232c,@function 6 | _iocs_lof232c: 7 | moveq #0x31, %d0 8 | trap #15 9 | rts 10 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/ms_init.S: -------------------------------------------------------------------------------- 1 | | void _iocs_ms_init (void); 2 | .text 3 | .even 4 | .global _iocs_ms_init 5 | .type _iocs_ms_init,@function 6 | _iocs_ms_init: 7 | moveq #0x70, %d0 8 | trap #15 9 | rts 10 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/ms_stat.S: -------------------------------------------------------------------------------- 1 | | int _iocs_ms_stat (void); 2 | .text 3 | .even 4 | .global _iocs_ms_stat 5 | .type _iocs_ms_stat,@function 6 | _iocs_ms_stat: 7 | moveq #0x73, %d0 8 | trap #15 9 | rts 10 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/sp_off.S: -------------------------------------------------------------------------------- 1 | | void _iocs_sp_off (void); 2 | .text 3 | .even 4 | .global _iocs_sp_off 5 | .type _iocs_sp_off,@function 6 | _iocs_sp_off: 7 | moveq #0xffffffc2, %d0 8 | trap #15 9 | rts 10 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/timeget.S: -------------------------------------------------------------------------------- 1 | | int _iocs_timeget (void); 2 | .text 3 | .even 4 | .global _iocs_timeget 5 | .type _iocs_timeget,@function 6 | _iocs_timeget: 7 | moveq #0x56, %d0 8 | trap #15 9 | rts 10 | -------------------------------------------------------------------------------- /src/libx68k/_stacksize.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Stack size definition 3 | */ 4 | 5 | #include "config.h" 6 | 7 | .data 8 | 9 | .global _stack_size 10 | _stack_size: 11 | .long STACK_SIZE 12 | 13 | .end 14 | -------------------------------------------------------------------------------- /src/libx68k/libdos/dup.S: -------------------------------------------------------------------------------- 1 | | int _dos_dup (int); 2 | .text 3 | .even 4 | .global _dos_dup 5 | .type _dos_dup,@function 6 | _dos_dup: 7 | move.w %sp@(6), %sp@- 8 | .short 0xff45 9 | addq.l #2, %sp 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/adpcmsns.S: -------------------------------------------------------------------------------- 1 | | int _iocs_adpcmsns (void); 2 | .text 3 | .even 4 | .global _iocs_adpcmsns 5 | .type _iocs_adpcmsns,@function 6 | _iocs_adpcmsns: 7 | moveq #0x66, %d0 8 | trap #15 9 | rts 10 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_curoff.S: -------------------------------------------------------------------------------- 1 | | void _iocs_b_curoff (void); 2 | .text 3 | .even 4 | .global _iocs_b_curoff 5 | .type _iocs_b_curoff,@function 6 | _iocs_b_curoff: 7 | moveq #0x1f, %d0 8 | trap #15 9 | rts 10 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_down_s.S: -------------------------------------------------------------------------------- 1 | | void _iocs_b_down_s (void); 2 | .text 3 | .even 4 | .global _iocs_b_down_s 5 | .type _iocs_b_down_s,@function 6 | _iocs_b_down_s: 7 | moveq #0x24, %d0 8 | trap #15 9 | rts 10 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_keyinp.S: -------------------------------------------------------------------------------- 1 | | int _iocs_b_keyinp (void); 2 | .text 3 | .even 4 | .global _iocs_b_keyinp 5 | .type _iocs_b_keyinp,@function 6 | _iocs_b_keyinp: 7 | moveq #0x00, %d0 8 | trap #15 9 | rts 10 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_keysns.S: -------------------------------------------------------------------------------- 1 | | int _iocs_b_keysns (void); 2 | .text 3 | .even 4 | .global _iocs_b_keysns 5 | .type _iocs_b_keysns,@function 6 | _iocs_b_keysns: 7 | moveq #0x01, %d0 8 | trap #15 9 | rts 10 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_sftsns.S: -------------------------------------------------------------------------------- 1 | | int _iocs_b_sftsns (void); 2 | .text 3 | .even 4 | .global _iocs_b_sftsns 5 | .type _iocs_b_sftsns,@function 6 | _iocs_b_sftsns: 7 | moveq #0x02, %d0 8 | trap #15 9 | rts 10 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/dmamode.S: -------------------------------------------------------------------------------- 1 | | int _iocs_dmamode (void); 2 | .text 3 | .even 4 | .global _iocs_dmamode 5 | .type _iocs_dmamode,@function 6 | _iocs_dmamode: 7 | moveq #0xffffff8d, %d0 8 | trap #15 9 | rts 10 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/isns232c.S: -------------------------------------------------------------------------------- 1 | | int _iocs_isns232c (void); 2 | .text 3 | .even 4 | .global _iocs_isns232c 5 | .type _iocs_isns232c,@function 6 | _iocs_isns232c: 7 | moveq #0x33, %d0 8 | trap #15 9 | rts 10 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/ms_curgt.S: -------------------------------------------------------------------------------- 1 | | int _iocs_ms_curgt (void); 2 | .text 3 | .even 4 | .global _iocs_ms_curgt 5 | .type _iocs_ms_curgt,@function 6 | _iocs_ms_curgt: 7 | moveq #0x75, %d0 8 | trap #15 9 | rts 10 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/ms_curof.S: -------------------------------------------------------------------------------- 1 | | void _iocs_ms_curof (void); 2 | .text 3 | .even 4 | .global _iocs_ms_curof 5 | .type _iocs_ms_curof,@function 6 | _iocs_ms_curof: 7 | moveq #0x72, %d0 8 | trap #15 9 | rts 10 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/ms_curon.S: -------------------------------------------------------------------------------- 1 | | void _iocs_ms_curon (void); 2 | .text 3 | .even 4 | .global _iocs_ms_curon 5 | .type _iocs_ms_curon,@function 6 | _iocs_ms_curon: 7 | moveq #0x71, %d0 8 | trap #15 9 | rts 10 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/ms_getdt.S: -------------------------------------------------------------------------------- 1 | | int _iocs_ms_getdt (void); 2 | .text 3 | .even 4 | .global _iocs_ms_getdt 5 | .type _iocs_ms_getdt,@function 6 | _iocs_ms_getdt: 7 | moveq #0x74, %d0 8 | trap #15 9 | rts 10 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/ontime.S: -------------------------------------------------------------------------------- 1 | | struct iocs_time _iocs_ontime (void); 2 | .text 3 | .even 4 | .global _iocs_ontime 5 | .type _iocs_ontime,@function 6 | _iocs_ontime: 7 | moveq #0x7f, %d0 8 | trap #15 9 | rts 10 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/osns232c.S: -------------------------------------------------------------------------------- 1 | | int _iocs_osns232c (void); 2 | .text 3 | .even 4 | .global _iocs_osns232c 5 | .type _iocs_osns232c,@function 6 | _iocs_osns232c: 7 | moveq #0x34, %d0 8 | trap #15 9 | rts 10 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/sp_init.S: -------------------------------------------------------------------------------- 1 | | int _iocs_sp_init (void); 2 | .text 3 | .even 4 | .global _iocs_sp_init 5 | .type _iocs_sp_init,@function 6 | _iocs_sp_init: 7 | moveq #0xffffffc0, %d0 8 | trap #15 9 | rts 10 | -------------------------------------------------------------------------------- /src/libx68k/libpthread/pthread_equal.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pthread_equal() 3 | */ 4 | 5 | #include "pthread_internal.h" 6 | 7 | int pthread_equal(pthread_t t1, pthread_t t2) 8 | { 9 | return (t1 == t2); 10 | } 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/abortrst.S: -------------------------------------------------------------------------------- 1 | | void _iocs_abortrst (void); 2 | .text 3 | .even 4 | .global _iocs_abortrst 5 | .type _iocs_abortrst,@function 6 | _iocs_abortrst: 7 | moveq #0xfffffffd, %d0 8 | trap #15 9 | rts 10 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_up.S: -------------------------------------------------------------------------------- 1 | | void _iocs_b_up (int); 2 | .text 3 | .even 4 | .global _iocs_b_up 5 | .type _iocs_b_up,@function 6 | _iocs_b_up: 7 | move.l %sp@(4), %d1 8 | moveq #0x26, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/g_clr_on.S: -------------------------------------------------------------------------------- 1 | | void _iocs_g_clr_on (void); 2 | .text 3 | .even 4 | .global _iocs_g_clr_on 5 | .type _iocs_g_clr_on,@function 6 | _iocs_g_clr_on: 7 | moveq #0xffffff90, %d0 8 | trap #15 9 | rts 10 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/os_curof.S: -------------------------------------------------------------------------------- 1 | | void _iocs_os_curof (void); 2 | .text 3 | .even 4 | .global _iocs_os_curof 5 | .type _iocs_os_curof,@function 6 | _iocs_os_curof: 7 | moveq #0xffffffaf, %d0 8 | trap #15 9 | rts 10 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/os_curon.S: -------------------------------------------------------------------------------- 1 | | void _iocs_os_curon (void); 2 | .text 3 | .even 4 | .global _iocs_os_curon 5 | .type _iocs_os_curon,@function 6 | _iocs_os_curon: 7 | moveq #0xffffffae, %d0 8 | trap #15 9 | rts 10 | -------------------------------------------------------------------------------- /src/libx68k/libdos/c_up_s.S: -------------------------------------------------------------------------------- 1 | | int _dos_c_up_s (void); 2 | .text 3 | .even 4 | .global _dos_c_up_s 5 | .type _dos_c_up_s,@function 6 | _dos_c_up_s: 7 | move.w #5, %sp@- 8 | .short 0xff23 9 | addq.l #2, %sp 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libdos/close.S: -------------------------------------------------------------------------------- 1 | | int _dos_close (int); 2 | .text 3 | .even 4 | .global _dos_close 5 | .type _dos_close,@function 6 | _dos_close: 7 | move.w %sp@(6), %sp@- 8 | .short 0xff3e 9 | addq.l #2, %sp 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libdos/fgetc.S: -------------------------------------------------------------------------------- 1 | | int _dos_fgetc (int); 2 | .text 3 | .even 4 | .global _dos_fgetc 5 | .type _dos_fgetc,@function 6 | _dos_fgetc: 7 | move.w %sp@(6), %sp@- 8 | .short 0xff1b 9 | addq.l #2, %sp 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libdos/mfree.S: -------------------------------------------------------------------------------- 1 | | int _dos_mfree (void *); 2 | .text 3 | .even 4 | .global _dos_mfree 5 | .type _dos_mfree,@function 6 | _dos_mfree: 7 | move.l %sp@(4), %sp@- 8 | .short 0xff49 9 | addq.l #4, %sp 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_del.S: -------------------------------------------------------------------------------- 1 | | void _iocs_b_del (int); 2 | .text 3 | .even 4 | .global _iocs_b_del 5 | .type _iocs_b_del,@function 6 | _iocs_b_del: 7 | move.l %sp@(4), %d1 8 | moveq #0x2d, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_ins.S: -------------------------------------------------------------------------------- 1 | | void _iocs_b_ins (int); 2 | .text 3 | .even 4 | .global _iocs_b_ins 5 | .type _iocs_b_ins,@function 6 | _iocs_b_ins: 7 | move.l %sp@(4), %d1 8 | moveq #0x2c, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/bindateget.S: -------------------------------------------------------------------------------- 1 | | int _iocs_bindateget (void); 2 | .text 3 | .even 4 | .global _iocs_bindateget 5 | .type _iocs_bindateget,@function 6 | _iocs_bindateget: 7 | moveq #0x54, %d0 8 | trap #15 9 | rts 10 | -------------------------------------------------------------------------------- /src/libx68k/libdos/c_curon.S: -------------------------------------------------------------------------------- 1 | | int _dos_c_curon (void); 2 | .text 3 | .even 4 | .global _dos_c_curon 5 | .type _dos_c_curon,@function 6 | _dos_c_curon: 7 | move.w #17, %sp@- 8 | .short 0xff23 9 | addq.l #2, %sp 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libdos/chgdrv.S: -------------------------------------------------------------------------------- 1 | | int _dos_chgdrv (int); 2 | .text 3 | .even 4 | .global _dos_chgdrv 5 | .type _dos_chgdrv,@function 6 | _dos_chgdrv: 7 | move.w %sp@(6), %sp@- 8 | .short 0xff0e 9 | addq.l #2, %sp 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libdos/comout.S: -------------------------------------------------------------------------------- 1 | | void _dos_comout (int); 2 | .text 3 | .even 4 | .global _dos_comout 5 | .type _dos_comout,@function 6 | _dos_comout: 7 | move.w %sp@(6), %sp@- 8 | .short 0xff04 9 | addq.l #2, %sp 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libdos/hendspmo.S: -------------------------------------------------------------------------------- 1 | | int _dos_hendspmo (void); 2 | .text 3 | .even 4 | .global _dos_hendspmo 5 | .type _dos_hendspmo,@function 6 | _dos_hendspmo: 7 | clr.w %sp@- 8 | .short 0xff18 9 | addq.l #2, %sp 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libdos/inpout.S: -------------------------------------------------------------------------------- 1 | | int _dos_inpout (int); 2 | .text 3 | .even 4 | .global _dos_inpout 5 | .type _dos_inpout,@function 6 | _dos_inpout: 7 | move.w %sp@(6), %sp@- 8 | .short 0xff06 9 | addq.l #2, %sp 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libdos/k_keyinp.S: -------------------------------------------------------------------------------- 1 | | int _dos_k_keyinp (void); 2 | .text 3 | .even 4 | .global _dos_k_keyinp 5 | .type _dos_k_keyinp,@function 6 | _dos_k_keyinp: 7 | clr.w %sp@- 8 | .short 0xff24 9 | addq.l #2, %sp 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libdos/prnout.S: -------------------------------------------------------------------------------- 1 | | void _dos_prnout (int); 2 | .text 3 | .even 4 | .global _dos_prnout 5 | .type _dos_prnout,@function 6 | _dos_prnout: 7 | move.w %sp@(6), %sp@- 8 | .short 0xff05 9 | addq.l #2, %sp 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libdos/verify.S: -------------------------------------------------------------------------------- 1 | | void _dos_verify (int); 2 | .text 3 | .even 4 | .global _dos_verify 5 | .type _dos_verify,@function 6 | _dos_verify: 7 | move.w %sp@(6), %sp@- 8 | .short 0xff2e 9 | addq.l #2, %sp 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/apage.S: -------------------------------------------------------------------------------- 1 | | int _iocs_apage (int); 2 | .text 3 | .even 4 | .global _iocs_apage 5 | .type _iocs_apage,@function 6 | _iocs_apage: 7 | move.l %sp@(4), %d1 8 | moveq #0xffffffb1, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_down.S: -------------------------------------------------------------------------------- 1 | | void _iocs_b_down (int); 2 | .text 3 | .even 4 | .global _iocs_b_down 5 | .type _iocs_b_down,@function 6 | _iocs_b_down: 7 | move.l %sp@(4), %d1 8 | moveq #0x27, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_left.S: -------------------------------------------------------------------------------- 1 | | void _iocs_b_left (int); 2 | .text 3 | .even 4 | .global _iocs_b_left 5 | .type _iocs_b_left,@function 6 | _iocs_b_left: 7 | move.l %sp@(4), %d1 8 | moveq #0x29, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_putc.S: -------------------------------------------------------------------------------- 1 | | int _iocs_b_putc (int); 2 | .text 3 | .even 4 | .global _iocs_b_putc 5 | .type _iocs_b_putc,@function 6 | _iocs_b_putc: 7 | move.l %sp@(4), %d1 8 | moveq #0x20, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/bitsns.S: -------------------------------------------------------------------------------- 1 | | int _iocs_bitsns (int); 2 | .text 3 | .even 4 | .global _iocs_bitsns 5 | .type _iocs_bitsns,@function 6 | _iocs_bitsns: 7 | move.l %sp@(4), %d1 8 | moveq #0x04, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/crtmod.S: -------------------------------------------------------------------------------- 1 | | int _iocs_crtmod (int); 2 | .text 3 | .even 4 | .global _iocs_crtmod 5 | .type _iocs_crtmod,@function 6 | _iocs_crtmod: 7 | move.l %sp@(4), %d1 8 | moveq #0x10, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/joyget.S: -------------------------------------------------------------------------------- 1 | | int _iocs_joyget (int); 2 | .text 3 | .even 4 | .global _iocs_joyget 5 | .type _iocs_joyget,@function 6 | _iocs_joyget: 7 | move.l %sp@(4), %d1 8 | moveq #0x3b, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/ms_sel.S: -------------------------------------------------------------------------------- 1 | | void _iocs_ms_sel (int); 2 | .text 3 | .even 4 | .global _iocs_ms_sel 5 | .type _iocs_ms_sel,@function 6 | _iocs_ms_sel: 7 | move.l %sp@(4), %d1 8 | moveq #0x7b, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/outlpt.S: -------------------------------------------------------------------------------- 1 | | void _iocs_outlpt (int); 2 | .text 3 | .even 4 | .global _iocs_outlpt 5 | .type _iocs_outlpt,@function 6 | _iocs_outlpt: 7 | move.l %sp@(4), %d1 8 | moveq #0x3e, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/outprn.S: -------------------------------------------------------------------------------- 1 | | void _iocs_outprn (int); 2 | .text 3 | .even 4 | .global _iocs_outprn 5 | .type _iocs_outprn,@function 6 | _iocs_outprn: 7 | move.l %sp@(4), %d1 8 | moveq #0x3f, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/tcolor.S: -------------------------------------------------------------------------------- 1 | | void _iocs_tcolor (int); 2 | .text 3 | .even 4 | .global _iocs_tcolor 5 | .type _iocs_tcolor,@function 6 | _iocs_tcolor: 7 | move.l %sp@(4), %d1 8 | moveq #0x15, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/tvctrl.S: -------------------------------------------------------------------------------- 1 | | void _iocs_tvctrl (int); 2 | .text 3 | .even 4 | .global _iocs_tvctrl 5 | .type _iocs_tvctrl,@function 6 | _iocs_tvctrl: 7 | move.l %sp@(4), %d1 8 | moveq #0x0c, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/vpage.S: -------------------------------------------------------------------------------- 1 | | int _iocs_vpage (int); 2 | .text 3 | .even 4 | .global _iocs_vpage 5 | .type _iocs_vpage,@function 6 | _iocs_vpage: 7 | move.l %sp@(4), %d1 8 | moveq #0xffffffb2, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libdos/breakck.S: -------------------------------------------------------------------------------- 1 | | int _dos_breakck (int); 2 | .text 3 | .even 4 | .global _dos_breakck 5 | .type _dos_breakck,@function 6 | _dos_breakck: 7 | move.w %sp@(6), %sp@- 8 | .short 0xff33 9 | addq.l #2, %sp 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libdos/c_curoff.S: -------------------------------------------------------------------------------- 1 | | int _dos_c_curoff (void); 2 | .text 3 | .even 4 | .global _dos_c_curoff 5 | .type _dos_c_curoff,@function 6 | _dos_c_curoff: 7 | move.w #18, %sp@- 8 | .short 0xff23 9 | addq.l #2, %sp 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libdos/c_down_s.S: -------------------------------------------------------------------------------- 1 | | int _dos_c_down_s (void); 2 | .text 3 | .even 4 | .global _dos_c_down_s 5 | .type _dos_c_down_s,@function 6 | _dos_c_down_s: 7 | move.w #4, %sp@- 8 | .short 0xff23 9 | addq.l #2, %sp 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libdos/chdir.S: -------------------------------------------------------------------------------- 1 | | int _dos_chdir (const char *); 2 | .text 3 | .even 4 | .global _dos_chdir 5 | .type _dos_chdir,@function 6 | _dos_chdir: 7 | move.l %sp@(4), %sp@- 8 | .short 0xff3b 9 | addq.l #4, %sp 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libdos/gets.S: -------------------------------------------------------------------------------- 1 | | int _dos_gets (struct _dos_inpptr *); 2 | .text 3 | .even 4 | .global _dos_gets 5 | .type _dos_gets,@function 6 | _dos_gets: 7 | move.l %sp@(4), %sp@- 8 | .short 0xff0a 9 | addq.l #4, %sp 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libdos/hendspio.S: -------------------------------------------------------------------------------- 1 | | int _dos_hendspio (void); 2 | .text 3 | .even 4 | .global _dos_hendspio 5 | .type _dos_hendspio,@function 6 | _dos_hendspio: 7 | move.w #4, %sp@- 8 | .short 0xff18 9 | addq.l #2, %sp 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libdos/hendspmc.S: -------------------------------------------------------------------------------- 1 | | void _dos_hendspmc (void); 2 | .text 3 | .even 4 | .global _dos_hendspmc 5 | .type _dos_hendspmc,@function 6 | _dos_hendspmc: 7 | move.w #3, %sp@- 8 | .short 0xff18 9 | addq.l #2, %sp 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libdos/hendspsc.S: -------------------------------------------------------------------------------- 1 | | void _dos_hendspsc (void); 2 | .text 3 | .even 4 | .global _dos_hendspsc 5 | .type _dos_hendspsc,@function 6 | _dos_hendspsc: 7 | move.w #11, %sp@- 8 | .short 0xff18 9 | addq.l #2, %sp 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libdos/hendspso.S: -------------------------------------------------------------------------------- 1 | | int _dos_hendspso (void); 2 | .text 3 | .even 4 | .global _dos_hendspso 5 | .type _dos_hendspso,@function 6 | _dos_hendspso: 7 | move.w #8, %sp@- 8 | .short 0xff18 9 | addq.l #2, %sp 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libdos/k_keysns.S: -------------------------------------------------------------------------------- 1 | | int _dos_k_keysns (void); 2 | .text 3 | .even 4 | .global _dos_k_keysns 5 | .type _dos_k_keysns,@function 6 | _dos_k_keysns: 7 | move.w #1, %sp@- 8 | .short 0xff24 9 | addq.l #2, %sp 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libdos/k_sftsns.S: -------------------------------------------------------------------------------- 1 | | int _dos_k_sftsns (void); 2 | .text 3 | .even 4 | .global _dos_k_sftsns 5 | .type _dos_k_sftsns,@function 6 | _dos_k_sftsns: 7 | move.w #2, %sp@- 8 | .short 0xff24 9 | addq.l #2, %sp 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libdos/kflushgc.S: -------------------------------------------------------------------------------- 1 | | int _dos_kflushgc (void); 2 | .text 3 | .even 4 | .global _dos_kflushgc 5 | .type _dos_kflushgc,@function 6 | _dos_kflushgc: 7 | move.w #8, %sp@- 8 | .short 0xff0c 9 | addq.l #2, %sp 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libdos/kflushgp.S: -------------------------------------------------------------------------------- 1 | | int _dos_kflushgp (void); 2 | .text 3 | .even 4 | .global _dos_kflushgp 5 | .type _dos_kflushgp,@function 6 | _dos_kflushgp: 7 | move.w #1, %sp@- 8 | .short 0xff0c 9 | addq.l #2, %sp 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libdos/kflushin.S: -------------------------------------------------------------------------------- 1 | | int _dos_kflushin (void); 2 | .text 3 | .even 4 | .global _dos_kflushin 5 | .type _dos_kflushin,@function 6 | _dos_kflushin: 7 | move.w #7, %sp@- 8 | .short 0xff0c 9 | addq.l #2, %sp 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libdos/mkdir.S: -------------------------------------------------------------------------------- 1 | | int _dos_mkdir (const char *); 2 | .text 3 | .even 4 | .global _dos_mkdir 5 | .type _dos_mkdir,@function 6 | _dos_mkdir: 7 | move.l %sp@(4), %sp@- 8 | .short 0xff39 9 | addq.l #4, %sp 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libdos/print.S: -------------------------------------------------------------------------------- 1 | | void _dos_print (const char *); 2 | .text 3 | .even 4 | .global _dos_print 5 | .type _dos_print,@function 6 | _dos_print: 7 | move.l %sp@(4), %sp@- 8 | .short 0xff09 9 | addq.l #4, %sp 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libdos/putchar.S: -------------------------------------------------------------------------------- 1 | | void _dos_putchar (int); 2 | .text 3 | .even 4 | .global _dos_putchar 5 | .type _dos_putchar,@function 6 | _dos_putchar: 7 | move.w %sp@(6), %sp@- 8 | .short 0xff02 9 | addq.l #2, %sp 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libdos/rmdir.S: -------------------------------------------------------------------------------- 1 | | int _dos_rmdir (const char *); 2 | .text 3 | .even 4 | .global _dos_rmdir 5 | .type _dos_rmdir,@function 6 | _dos_rmdir: 7 | move.l %sp@(4), %sp@- 8 | .short 0xff3a 9 | addq.l #4, %sp 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libdos/s_mfree.S: -------------------------------------------------------------------------------- 1 | | int _dos_s_mfree (void *); 2 | .text 3 | .even 4 | .global _dos_s_mfree 5 | .type _dos_s_mfree,@function 6 | _dos_s_mfree: 7 | move.l %sp@(4), %sp@- 8 | .short 0xffae 9 | addq.l #4, %sp 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libdos/setdate.S: -------------------------------------------------------------------------------- 1 | | int _dos_setdate (int); 2 | .text 3 | .even 4 | .global _dos_setdate 5 | .type _dos_setdate,@function 6 | _dos_setdate: 7 | move.w %sp@(6), %sp@- 8 | .short 0xff2b 9 | addq.l #2, %sp 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libdos/settim2.S: -------------------------------------------------------------------------------- 1 | | int _dos_settim2 (int); 2 | .text 3 | .even 4 | .global _dos_settim2 5 | .type _dos_settim2,@function 6 | _dos_settim2: 7 | move.l %sp@(4), %sp@- 8 | .short 0xff28 9 | addq.l #4, %sp 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libdos/settime.S: -------------------------------------------------------------------------------- 1 | | int _dos_settime (int); 2 | .text 3 | .even 4 | .global _dos_settime 5 | .type _dos_settime,@function 6 | _dos_settime: 7 | move.w %sp@(6), %sp@- 8 | .short 0xff2d 9 | addq.l #2, %sp 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_clr_al.S: -------------------------------------------------------------------------------- 1 | | void _iocs_b_clr_al (void); 2 | .text 3 | .even 4 | .global _iocs_b_clr_al 5 | .type _iocs_b_clr_al,@function 6 | _iocs_b_clr_al: 7 | moveq #2, %d1 8 | moveq #0x2a, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_clr_ed.S: -------------------------------------------------------------------------------- 1 | | void _iocs_b_clr_ed (void); 2 | .text 3 | .even 4 | .global _iocs_b_clr_ed 5 | .type _iocs_b_clr_ed,@function 6 | _iocs_b_clr_ed: 7 | moveq #0, %d1 8 | moveq #0x2a, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_clr_st.S: -------------------------------------------------------------------------------- 1 | | void _iocs_b_clr_st (void); 2 | .text 3 | .even 4 | .global _iocs_b_clr_st 5 | .type _iocs_b_clr_st,@function 6 | _iocs_b_clr_st: 7 | moveq #1, %d1 8 | moveq #0x2a, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_color.S: -------------------------------------------------------------------------------- 1 | | int _iocs_b_color (int); 2 | .text 3 | .even 4 | .global _iocs_b_color 5 | .type _iocs_b_color,@function 6 | _iocs_b_color: 7 | move.l %sp@(4), %d1 8 | moveq #0x22, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_eject.S: -------------------------------------------------------------------------------- 1 | | int _iocs_b_eject (int); 2 | .text 3 | .even 4 | .global _iocs_b_eject 5 | .type _iocs_b_eject,@function 6 | _iocs_b_eject: 7 | move.l %sp@(4), %d1 8 | moveq #0x4f, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_era_al.S: -------------------------------------------------------------------------------- 1 | | void _iocs_b_era_al (void); 2 | .text 3 | .even 4 | .global _iocs_b_era_al 5 | .type _iocs_b_era_al,@function 6 | _iocs_b_era_al: 7 | moveq #2, %d1 8 | moveq #0x2b, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_era_ed.S: -------------------------------------------------------------------------------- 1 | | void _iocs_b_era_ed (void); 2 | .text 3 | .even 4 | .global _iocs_b_era_ed 5 | .type _iocs_b_era_ed,@function 6 | _iocs_b_era_ed: 7 | moveq #0, %d1 8 | moveq #0x2b, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_era_st.S: -------------------------------------------------------------------------------- 1 | | void _iocs_b_era_st (void); 2 | .text 3 | .even 4 | .global _iocs_b_era_st 5 | .type _iocs_b_era_st,@function 6 | _iocs_b_era_st: 7 | moveq #1, %d1 8 | moveq #0x2b, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_right.S: -------------------------------------------------------------------------------- 1 | | void _iocs_b_right (int); 2 | .text 3 | .even 4 | .global _iocs_b_right 5 | .type _iocs_b_right,@function 6 | _iocs_b_right: 7 | move.l %sp@(4), %d1 8 | moveq #0x28, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/datebin.S: -------------------------------------------------------------------------------- 1 | | int _iocs_datebin (int); 2 | .text 3 | .even 4 | .global _iocs_datebin 5 | .type _iocs_datebin,@function 6 | _iocs_datebin: 7 | move.l %sp@(4), %d1 8 | moveq #0x55, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/out232c.S: -------------------------------------------------------------------------------- 1 | | void _iocs_out232c (int); 2 | .text 3 | .even 4 | .global _iocs_out232c 5 | .type _iocs_out232c,@function 6 | _iocs_out232c: 7 | move.l %sp@(4), %d1 8 | moveq #0x35, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/s_phase.S: -------------------------------------------------------------------------------- 1 | | int _iocs_s_phase (void); 2 | .text 3 | .even 4 | .global _iocs_s_phase 5 | .type _iocs_s_phase,@function 6 | _iocs_s_phase: 7 | moveq #9, %d1 8 | moveq #0xfffffff5, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/s_reset.S: -------------------------------------------------------------------------------- 1 | | void _iocs_s_reset (void); 2 | .text 3 | .even 4 | .global _iocs_s_reset 5 | .type _iocs_s_reset,@function 6 | _iocs_s_reset: 7 | moveq #0, %d1 8 | moveq #0xfffffff5, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/set232c.S: -------------------------------------------------------------------------------- 1 | | int _iocs_set232c (int); 2 | .text 3 | .even 4 | .global _iocs_set232c 5 | .type _iocs_set232c,@function 6 | _iocs_set232c: 7 | move.l %sp@(4), %d1 8 | moveq #0x30, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/skeyset.S: -------------------------------------------------------------------------------- 1 | | void _iocs_skeyset (int); 2 | .text 3 | .even 4 | .global _iocs_skeyset 5 | .type _iocs_skeyset,@function 6 | _iocs_skeyset: 7 | move.l %sp@(4), %d1 8 | moveq #0x05, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/timebcd.S: -------------------------------------------------------------------------------- 1 | | int _iocs_timebcd (int); 2 | .text 3 | .even 4 | .global _iocs_timebcd 5 | .type _iocs_timebcd,@function 6 | _iocs_timebcd: 7 | move.l %sp@(4), %d1 8 | moveq #0x52, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/timebin.S: -------------------------------------------------------------------------------- 1 | | int _iocs_timebin (int); 2 | .text 3 | .even 4 | .global _iocs_timebin 5 | .type _iocs_timebin,@function 6 | _iocs_timebin: 7 | move.l %sp@(4), %d1 8 | moveq #0x57, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/timeset.S: -------------------------------------------------------------------------------- 1 | | void _iocs_timeset (int); 2 | .text 3 | .even 4 | .global _iocs_timeset 5 | .type _iocs_timeset,@function 6 | _iocs_timeset: 7 | move.l %sp@(4), %d1 8 | moveq #0x53, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libdos/c_up.S: -------------------------------------------------------------------------------- 1 | | int _dos_c_up (int); 2 | .text 3 | .even 4 | .global _dos_c_up 5 | .type _dos_c_up,@function 6 | _dos_c_up: 7 | move.w %sp@(6), %sp@- 8 | move.w #6, %sp@- 9 | .short 0xff23 10 | addq.l #4, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/delete.S: -------------------------------------------------------------------------------- 1 | | int _dos_delete (const char *); 2 | .text 3 | .even 4 | .global _dos_delete 5 | .type _dos_delete,@function 6 | _dos_delete: 7 | move.l %sp@(4), %sp@- 8 | .short 0xff41 9 | addq.l #4, %sp 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libdos/getss.S: -------------------------------------------------------------------------------- 1 | | int _dos_getss (struct _dos_inpptr *); 2 | .text 3 | .even 4 | .global _dos_getss 5 | .type _dos_getss,@function 6 | _dos_getss: 7 | move.l %sp@(4), %sp@- 8 | .short 0xff1a 9 | addq.l #4, %sp 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libdos/keeppr.S: -------------------------------------------------------------------------------- 1 | | __dead void _dos_keeppr (int, int); 2 | .text 3 | .even 4 | .global _dos_keeppr 5 | .type _dos_keeppr,@function 6 | _dos_keeppr: 7 | move.w %sp@(10), %sp@- 8 | move.l %sp@(6), %sp@- 9 | .short 0xff31 10 | -------------------------------------------------------------------------------- /src/libx68k/libdos/sleep_pr.S: -------------------------------------------------------------------------------- 1 | | int _dos_sleep_pr (long); 2 | .text 3 | .even 4 | .global _dos_sleep_pr 5 | .type _dos_sleep_pr,@function 6 | _dos_sleep_pr: 7 | move.l %sp@(4), %sp@- 8 | .short 0xfffc 9 | addq.l #4, %sp 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/adpcmmod.S: -------------------------------------------------------------------------------- 1 | | void _iocs_adpcmmod (int); 2 | .text 3 | .even 4 | .global _iocs_adpcmmod 5 | .type _iocs_adpcmmod,@function 6 | _iocs_adpcmmod: 7 | move.l %sp@(4), %d1 8 | moveq #0x67, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/alarmmod.S: -------------------------------------------------------------------------------- 1 | | int _iocs_alarmmod (int); 2 | .text 3 | .even 4 | .global _iocs_alarmmod 5 | .type _iocs_alarmmod,@function 6 | _iocs_alarmmod: 7 | move.l %sp@(4), %d1 8 | moveq #0x5d, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_drvsns.S: -------------------------------------------------------------------------------- 1 | | int _iocs_b_drvsns (int); 2 | .text 3 | .even 4 | .global _iocs_b_drvsns 5 | .type _iocs_b_drvsns,@function 6 | _iocs_b_drvsns: 7 | move.l %sp@(4), %d1 8 | moveq #0x44, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_recali.S: -------------------------------------------------------------------------------- 1 | | int _iocs_b_recali (int); 2 | .text 3 | .even 4 | .global _iocs_b_recali 5 | .type _iocs_b_recali,@function 6 | _iocs_b_recali: 7 | move.l %sp@(4), %d1 8 | moveq #0x47, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/contrast.S: -------------------------------------------------------------------------------- 1 | | int _iocs_contrast (int); 2 | .text 3 | .even 4 | .global _iocs_contrast 5 | .type _iocs_contrast,@function 6 | _iocs_contrast: 7 | move.l %sp@(4), %d1 8 | moveq #0x11, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/dakjob.S: -------------------------------------------------------------------------------- 1 | | int _iocs_dakjob (char *); 2 | .text 3 | .even 4 | .global _iocs_dakjob 5 | .type _iocs_dakjob,@function 6 | _iocs_dakjob: 7 | move.l %sp@(4), %a1 8 | moveq #0xffffffa4, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/dayasc.S: -------------------------------------------------------------------------------- 1 | | void _iocs_dayasc (int, char *); 2 | .text 3 | .even 4 | .global _iocs_dayasc 5 | .type _iocs_dayasc,@function 6 | _iocs_dayasc: 7 | movem.l %sp@(4),%d1/%a1 8 | moveq #0x5c, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/hanjob.S: -------------------------------------------------------------------------------- 1 | | int _iocs_hanjob (char *); 2 | .text 3 | .even 4 | .global _iocs_hanjob 5 | .type _iocs_hanjob,@function 6 | _iocs_hanjob: 7 | move.l %sp@(4), %a1 8 | moveq #0xffffffa5, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/romver.S: -------------------------------------------------------------------------------- 1 | | int __pure _iocs_romver (void) __attribute__((const)); 2 | .text 3 | .even 4 | .global _iocs_romver 5 | .type _iocs_romver,@function 6 | _iocs_romver: 7 | moveq #0xffffff8f, %d0 8 | trap #15 9 | rts 10 | -------------------------------------------------------------------------------- /src/libx68k/libdos/c_putc.S: -------------------------------------------------------------------------------- 1 | | int _dos_c_putc (int); 2 | .text 3 | .even 4 | .global _dos_c_putc 5 | .type _dos_c_putc,@function 6 | _dos_c_putc: 7 | move.w %sp@(6), %sp@- 8 | clr.w %sp@- 9 | .short 0xff23 10 | addq.l #4, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/nfiles.S: -------------------------------------------------------------------------------- 1 | | int _dos_nfiles (struct _dos_filbuf *); 2 | .text 3 | .even 4 | .global _dos_nfiles 5 | .type _dos_nfiles,@function 6 | _dos_nfiles: 7 | move.l %sp@(4), %sp@- 8 | .short 0xff4f 9 | addq.l #4, %sp 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libdos/pspset.S: -------------------------------------------------------------------------------- 1 | | void _dos_pspset (struct _dos_psp *); 2 | .text 3 | .even 4 | .global _dos_pspset 5 | .type _dos_pspset,@function 6 | _dos_pspset: 7 | move.l %sp@(4), %sp@- 8 | .short 0xff26 9 | addq.l #4, %sp 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_print.S: -------------------------------------------------------------------------------- 1 | | int _iocs_b_print (const char *); 2 | .text 3 | .even 4 | .global _iocs_b_print 5 | .type _iocs_b_print,@function 6 | _iocs_b_print: 7 | move.l %sp@(4), %a1 8 | moveq #0x21, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/bgctrlgt.S: -------------------------------------------------------------------------------- 1 | | int _iocs_bgctrlgt (int); 2 | .text 3 | .even 4 | .global _iocs_bgctrlgt 5 | .type _iocs_bgctrlgt,@function 6 | _iocs_bgctrlgt: 7 | move.l %sp@(4), %d1 8 | moveq #0xffffffcb, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/bootinf.S: -------------------------------------------------------------------------------- 1 | | int __pure _iocs_bootinf (void) __attribute__((const)); 2 | .text 3 | .even 4 | .global _iocs_bootinf 5 | .type _iocs_bootinf,@function 6 | _iocs_bootinf: 7 | moveq #0xffffff8e, %d0 8 | trap #15 9 | rts 10 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/box.S: -------------------------------------------------------------------------------- 1 | | int _iocs_box (const struct _iocs_boxptr *); 2 | .text 3 | .even 4 | .global _iocs_box 5 | .type _iocs_box,@function 6 | _iocs_box: 7 | move.l %sp@(4), %a1 8 | moveq #0xffffffb9, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/dateasc.S: -------------------------------------------------------------------------------- 1 | | int _iocs_dateasc (int, char *); 2 | .text 3 | .even 4 | .global _iocs_dateasc 5 | .type _iocs_dateasc,@function 6 | _iocs_dateasc: 7 | movem.l %sp@(4),%d1/%a1 8 | moveq #0x5a, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/datecnv.S: -------------------------------------------------------------------------------- 1 | | int _iocs_datecnv (const char *); 2 | .text 3 | .even 4 | .global _iocs_datecnv 5 | .type _iocs_datecnv,@function 6 | _iocs_datecnv: 7 | move.l %sp@(4), %a1 8 | moveq #0x58, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/hsyncst.S: -------------------------------------------------------------------------------- 1 | | int _iocs_hsyncst (const void *); 2 | .text 3 | .even 4 | .global _iocs_hsyncst 5 | .type _iocs_hsyncst,@function 6 | _iocs_hsyncst: 7 | move.l %sp@(4), %a1 8 | moveq #0x6e, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/ms_sel2.S: -------------------------------------------------------------------------------- 1 | | void _iocs_ms_sel2 (const short *); 2 | .text 3 | .even 4 | .global _iocs_ms_sel2 5 | .type _iocs_ms_sel2,@function 6 | _iocs_ms_sel2: 7 | move.l %sp@(4), %a1 8 | moveq #0x7c, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/sp_cgclr.S: -------------------------------------------------------------------------------- 1 | | int _iocs_sp_cgclr (int); 2 | .text 3 | .even 4 | .global _iocs_sp_cgclr 5 | .type _iocs_sp_cgclr,@function 6 | _iocs_sp_cgclr: 7 | move.l %sp@(4), %d1 8 | moveq #0xffffffc3, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/timeasc.S: -------------------------------------------------------------------------------- 1 | | int _iocs_timeasc (int, char *); 2 | .text 3 | .even 4 | .global _iocs_timeasc 5 | .type _iocs_timeasc,@function 6 | _iocs_timeasc: 7 | movem.l %sp@(4),%d1/%a1 8 | moveq #0x5b, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/timecnv.S: -------------------------------------------------------------------------------- 1 | | int _iocs_timecnv (const char *); 2 | .text 3 | .even 4 | .global _iocs_timecnv 5 | .type _iocs_timecnv,@function 6 | _iocs_timecnv: 7 | move.l %sp@(4), %a1 8 | moveq #0x59, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libpthread/pthread_spin_unlock.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pthread_spin_unlock() 3 | */ 4 | 5 | #include "pthread_internal.h" 6 | 7 | int pthread_spin_unlock(pthread_spinlock_t *lock) 8 | { 9 | lock->lock = 0; 10 | return 0; 11 | } 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/c_del.S: -------------------------------------------------------------------------------- 1 | | int _dos_c_del (int); 2 | .text 3 | .even 4 | .global _dos_c_del 5 | .type _dos_c_del,@function 6 | _dos_c_del: 7 | move.w %sp@(6), %sp@- 8 | move.w #13, %sp@- 9 | .short 0xff23 10 | addq.l #4, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/c_down.S: -------------------------------------------------------------------------------- 1 | | int _dos_c_down (int); 2 | .text 3 | .even 4 | .global _dos_c_down 5 | .type _dos_c_down,@function 6 | _dos_c_down: 7 | move.w %sp@(6), %sp@- 8 | move.w #7, %sp@- 9 | .short 0xff23 10 | addq.l #4, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/c_ins.S: -------------------------------------------------------------------------------- 1 | | int _dos_c_ins (int); 2 | .text 3 | .even 4 | .global _dos_c_ins 5 | .type _dos_c_ins,@function 6 | _dos_c_ins: 7 | move.w %sp@(6), %sp@- 8 | move.w #12, %sp@- 9 | .short 0xff23 10 | addq.l #4, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/c_left.S: -------------------------------------------------------------------------------- 1 | | int _dos_c_left (int); 2 | .text 3 | .even 4 | .global _dos_c_left 5 | .type _dos_c_left,@function 6 | _dos_c_left: 7 | move.w %sp@(6), %sp@- 8 | move.w #9, %sp@- 9 | .short 0xff23 10 | addq.l #4, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/fflush_set.S: -------------------------------------------------------------------------------- 1 | | int _dos_fflush_set (int); 2 | .text 3 | .even 4 | .global _dos_fflush_set 5 | .type _dos_fflush_set,@function 6 | _dos_fflush_set: 7 | move.w %sp@(6), %sp@- 8 | .short 0xffaa 9 | addq.l #2, %sp 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libdos/suspend_pr.S: -------------------------------------------------------------------------------- 1 | | int _dos_suspend_pr (int); 2 | .text 3 | .even 4 | .global _dos_suspend_pr 5 | .type _dos_suspend_pr,@function 6 | _dos_suspend_pr: 7 | move.w %sp@(6), %sp@- 8 | .short 0xfffb 9 | addq.l #2, %sp 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_bpeek.S: -------------------------------------------------------------------------------- 1 | | int _iocs_b_bpeek (const void *); 2 | .text 3 | .even 4 | .global _iocs_b_bpeek 5 | .type _iocs_b_bpeek,@function 6 | _iocs_b_bpeek: 7 | move.l %sp@(4), %a1 8 | moveq #0xffffff82, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_lpeek.S: -------------------------------------------------------------------------------- 1 | | int _iocs_b_lpeek (const void *); 2 | .text 3 | .even 4 | .global _iocs_b_lpeek 5 | .type _iocs_b_lpeek,@function 6 | _iocs_b_lpeek: 7 | move.l %sp@(4), %a1 8 | moveq #0xffffff84, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_wpeek.S: -------------------------------------------------------------------------------- 1 | | int _iocs_b_wpeek (const void *); 2 | .text 3 | .even 4 | .global _iocs_b_wpeek 5 | .type _iocs_b_wpeek,@function 6 | _iocs_b_wpeek: 7 | move.l %sp@(4), %a1 8 | moveq #0xffffff83, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/bindatebcd.S: -------------------------------------------------------------------------------- 1 | | int _iocs_bindatebcd (int); 2 | .text 3 | .even 4 | .global _iocs_bindatebcd 5 | .type _iocs_bindatebcd,@function 6 | _iocs_bindatebcd: 7 | move.l %sp@(4), %d1 8 | moveq #0x50, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/bindateset.S: -------------------------------------------------------------------------------- 1 | | void _iocs_bindateset (int); 2 | .text 3 | .even 4 | .global _iocs_bindateset 5 | .type _iocs_bindateset,@function 6 | _iocs_bindateset: 7 | move.l %sp@(4), %d1 8 | moveq #0x51, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/fill.S: -------------------------------------------------------------------------------- 1 | | int _iocs_fill (const struct _iocs_fillptr *); 2 | .text 3 | .even 4 | .global _iocs_fill 5 | .type _iocs_fill,@function 6 | _iocs_fill: 7 | move.l %sp@(4), %a1 8 | moveq #0xffffffba, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/line.S: -------------------------------------------------------------------------------- 1 | | int _iocs_line (const struct _iocs_lineptr *); 2 | .text 3 | .even 4 | .global _iocs_line 5 | .type _iocs_line,@function 6 | _iocs_line: 7 | move.l %sp@(4), %a1 8 | moveq #0xffffffb8, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/opmintst.S: -------------------------------------------------------------------------------- 1 | | int _iocs_opmintst (const void *); 2 | .text 3 | .even 4 | .global _iocs_opmintst 5 | .type _iocs_opmintst,@function 6 | _iocs_opmintst: 7 | move.l %sp@(4), %a1 8 | moveq #0x6a, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/paint.S: -------------------------------------------------------------------------------- 1 | | int _iocs_paint (struct _iocs_paintptr *); 2 | .text 3 | .even 4 | .global _iocs_paint 5 | .type _iocs_paint,@function 6 | _iocs_paint: 7 | move.l %sp@(4), %a1 8 | moveq #0xffffffbc, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/prnintst.S: -------------------------------------------------------------------------------- 1 | | int _iocs_prnintst (const void *); 2 | .text 3 | .even 4 | .global _iocs_prnintst 5 | .type _iocs_prnintst,@function 6 | _iocs_prnintst: 7 | move.l %sp@(4), %a1 8 | moveq #0x6f, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/pset.S: -------------------------------------------------------------------------------- 1 | | int _iocs_pset (const struct _iocs_psetptr *); 2 | .text 3 | .even 4 | .global _iocs_pset 5 | .type _iocs_pset,@function 6 | _iocs_pset: 7 | move.l %sp@(4), %a1 8 | moveq #0xffffffb6, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/creat.c: -------------------------------------------------------------------------------- 1 | /* 2 | * creat() 3 | */ 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | int creat(const char *file, mode_t mode) 10 | { 11 | return open(file, O_CREAT|O_WRONLY|O_TRUNC, mode); 12 | } 13 | -------------------------------------------------------------------------------- /src/libx68k/fork.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Stub version of fork. 3 | */ 4 | 5 | #include "config.h" 6 | #include <_ansi.h> 7 | #include <_syslist.h> 8 | #include 9 | 10 | int 11 | _fork (void) 12 | { 13 | errno = ENOSYS; 14 | return -1; 15 | } 16 | -------------------------------------------------------------------------------- /src/libx68k/libdos/c_cls_ed.S: -------------------------------------------------------------------------------- 1 | | int _dos_c_cls_ed (void); 2 | .text 3 | .even 4 | .global _dos_c_cls_ed 5 | .type _dos_c_cls_ed,@function 6 | _dos_c_cls_ed: 7 | clr.w %sp@- 8 | move.w #10, %sp@- 9 | .short 0xff23 10 | addq.l #4, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/c_color.S: -------------------------------------------------------------------------------- 1 | | int _dos_c_color (int); 2 | .text 3 | .even 4 | .global _dos_c_color 5 | .type _dos_c_color,@function 6 | _dos_c_color: 7 | move.w %sp@(6), %sp@- 8 | move.w #2, %sp@- 9 | .short 0xff23 10 | addq.l #4, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/c_era_ed.S: -------------------------------------------------------------------------------- 1 | | int _dos_c_era_ed (void); 2 | .text 3 | .even 4 | .global _dos_c_era_ed 5 | .type _dos_c_era_ed,@function 6 | _dos_c_era_ed: 7 | clr.w %sp@- 8 | move.w #11, %sp@- 9 | .short 0xff23 10 | addq.l #4, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/c_right.S: -------------------------------------------------------------------------------- 1 | | int _dos_c_right (int); 2 | .text 3 | .even 4 | .global _dos_c_right 5 | .type _dos_c_right,@function 6 | _dos_c_right: 7 | move.w %sp@(6), %sp@- 8 | move.w #8, %sp@- 9 | .short 0xff23 10 | addq.l #4, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/dup0.S: -------------------------------------------------------------------------------- 1 | | int _dos_dup0 (int, int); 2 | .text 3 | .even 4 | .global _dos_dup0 5 | .type _dos_dup0,@function 6 | _dos_dup0: 7 | move.w %sp@(10), %sp@- 8 | move.w %sp@(8), %sp@- 9 | .short 0xff2f 10 | addq.l #4, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/dup2.S: -------------------------------------------------------------------------------- 1 | | int _dos_dup2 (int, int); 2 | .text 3 | .even 4 | .global _dos_dup2 5 | .type _dos_dup2,@function 6 | _dos_dup2: 7 | move.w %sp@(10), %sp@- 8 | move.w %sp@(8), %sp@- 9 | .short 0xff46 10 | addq.l #4, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/getpdb.S: -------------------------------------------------------------------------------- 1 | | struct _dos_psp *_dos_getpdb (void); 2 | .text 3 | .even 4 | .global _dos_getpdb 5 | .type _dos_getpdb,@function 6 | _dos_getpdb: 7 | .short 0xff81 8 | #ifdef __SVR4_ABI__ 9 | movea.l %d0, %a0 10 | #endif 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/ioctrlgt.S: -------------------------------------------------------------------------------- 1 | | int _dos_ioctrlgt (int); 2 | .text 3 | .even 4 | .global _dos_ioctrlgt 5 | .type _dos_ioctrlgt,@function 6 | _dos_ioctrlgt: 7 | move.w %sp@(6), %sp@- 8 | clr.w %sp@- 9 | .short 0xff44 10 | addq.l #4, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_intvcs.S: -------------------------------------------------------------------------------- 1 | | int _iocs_b_intvcs (int, int); 2 | .text 3 | .even 4 | .global _iocs_b_intvcs 5 | .type _iocs_b_intvcs,@function 6 | _iocs_b_intvcs: 7 | movem.l %sp@(4),%d1/%a1 8 | moveq #0xffffff80, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/getgrm.S: -------------------------------------------------------------------------------- 1 | | int _iocs_getgrm (struct _iocs_getptr *); 2 | .text 3 | .even 4 | .global _iocs_getgrm 5 | .type _iocs_getgrm,@function 6 | _iocs_getgrm: 7 | move.l %sp@(4), %a1 8 | moveq #0xffffffbe, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/point.S: -------------------------------------------------------------------------------- 1 | | int _iocs_point (const struct _iocs_pointptr *); 2 | .text 3 | .even 4 | .global _iocs_point 5 | .type _iocs_point,@function 6 | _iocs_point: 7 | move.l %sp@(4), %a1 8 | moveq #0xffffffb7, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/txbox.S: -------------------------------------------------------------------------------- 1 | | void _iocs_txbox (const struct _iocs_tboxptr *); 2 | .text 3 | .even 4 | .global _iocs_txbox 5 | .type _iocs_txbox,@function 6 | _iocs_txbox: 7 | move.l %sp@(4), %a1 8 | moveq #0xffffffd6, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/txrev.S: -------------------------------------------------------------------------------- 1 | | void _iocs_txrev (const struct _iocs_trevptr *); 2 | .text 3 | .even 4 | .global _iocs_txrev 5 | .type _iocs_txrev,@function 6 | _iocs_txrev: 7 | move.l %sp@(4), %a1 8 | moveq #0xffffffd8, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/getpid.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Stub version of getpid. 3 | */ 4 | 5 | #include "config.h" 6 | #include <_ansi.h> 7 | #include <_syslist.h> 8 | #include 9 | 10 | int 11 | _getpid (void) 12 | { 13 | errno = ENOSYS; 14 | return -1; 15 | } 16 | -------------------------------------------------------------------------------- /src/libx68k/libdos/c_cls_al.S: -------------------------------------------------------------------------------- 1 | | int _dos_c_cls_al (void); 2 | .text 3 | .even 4 | .global _dos_c_cls_al 5 | .type _dos_c_cls_al,@function 6 | _dos_c_cls_al: 7 | move.w #2, %sp@- 8 | move.w #10, %sp@- 9 | .short 0xff23 10 | addq.l #4, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/c_cls_st.S: -------------------------------------------------------------------------------- 1 | | int _dos_c_cls_st (void); 2 | .text 3 | .even 4 | .global _dos_c_cls_st 5 | .type _dos_c_cls_st,@function 6 | _dos_c_cls_st: 7 | move.w #1, %sp@- 8 | move.w #10, %sp@- 9 | .short 0xff23 10 | addq.l #4, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/c_era_al.S: -------------------------------------------------------------------------------- 1 | | int _dos_c_era_al (void); 2 | .text 3 | .even 4 | .global _dos_c_era_al 5 | .type _dos_c_era_al,@function 6 | _dos_c_era_al: 7 | move.w #2, %sp@- 8 | move.w #11, %sp@- 9 | .short 0xff23 10 | addq.l #4, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/c_era_st.S: -------------------------------------------------------------------------------- 1 | | int _dos_c_era_st (void); 2 | .text 3 | .even 4 | .global _dos_c_era_st 5 | .type _dos_c_era_st,@function 6 | _dos_c_era_st: 7 | move.w #1, %sp@- 8 | move.w #11, %sp@- 9 | .short 0xff23 10 | addq.l #4, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/c_width.S: -------------------------------------------------------------------------------- 1 | | int _dos_c_width (int); 2 | .text 3 | .even 4 | .global _dos_c_width 5 | .type _dos_c_width,@function 6 | _dos_c_width: 7 | move.w %sp@(6), %sp@- 8 | move.w #16, %sp@- 9 | .short 0xff23 10 | addq.l #4, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/fputc.S: -------------------------------------------------------------------------------- 1 | | void _dos_fputc (int, int); 2 | .text 3 | .even 4 | .global _dos_fputc 5 | .type _dos_fputc,@function 6 | _dos_fputc: 7 | move.w %sp@(10), %sp@- 8 | move.w %sp@(8), %sp@- 9 | .short 0xff1d 10 | addq.l #4, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/ioctrlis.S: -------------------------------------------------------------------------------- 1 | | int _dos_ioctrlis (int); 2 | .text 3 | .even 4 | .global _dos_ioctrlis 5 | .type _dos_ioctrlis,@function 6 | _dos_ioctrlis: 7 | move.w %sp@(6), %sp@- 8 | move.w #6, %sp@- 9 | .short 0xff44 10 | addq.l #4, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/ioctrlos.S: -------------------------------------------------------------------------------- 1 | | int _dos_ioctrlos (int); 2 | .text 3 | .even 4 | .global _dos_ioctrlos 5 | .type _dos_ioctrlos,@function 6 | _dos_ioctrlos: 7 | move.w %sp@(6), %sp@- 8 | move.w #7, %sp@- 9 | .short 0xff44 10 | addq.l #4, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/k_keybit.S: -------------------------------------------------------------------------------- 1 | | int _dos_k_keybit (int); 2 | .text 3 | .even 4 | .global _dos_k_keybit 5 | .type _dos_k_keybit,@function 6 | _dos_k_keybit: 7 | move.w %sp@(6), %sp@- 8 | move.w #3, %sp@- 9 | .short 0xff24 10 | addq.l #4, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/kflushio.S: -------------------------------------------------------------------------------- 1 | | int _dos_kflushio (int); 2 | .text 3 | .even 4 | .global _dos_kflushio 5 | .type _dos_kflushio,@function 6 | _dos_kflushio: 7 | move.w %sp@(6), %sp@- 8 | move.w #6, %sp@- 9 | .short 0xff0c 10 | addq.l #4, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/open.S: -------------------------------------------------------------------------------- 1 | | int _dos_open (const char *, int); 2 | .text 3 | .even 4 | .global _dos_open 5 | .type _dos_open,@function 6 | _dos_open: 7 | move.w %sp@(10), %sp@- 8 | move.l %sp@(6), %sp@- 9 | .short 0xff3d 10 | addq.l #6, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/cache_st.S: -------------------------------------------------------------------------------- 1 | | int _iocs_cache_st (void); /* rom 1.3 only */ 2 | .text 3 | .even 4 | .global _iocs_cache_st 5 | .type _iocs_cache_st,@function 6 | _iocs_cache_st: 7 | moveq #1, %d1 8 | moveq #0xffffffac, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/circle.S: -------------------------------------------------------------------------------- 1 | | int _iocs_circle (const struct _iocs_circleptr *); 2 | .text 3 | .even 4 | .global _iocs_circle 5 | .type _iocs_circle,@function 6 | _iocs_circle: 7 | move.l %sp@(4), %a1 8 | moveq #0xffffffbb, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/mpu_stat.S: -------------------------------------------------------------------------------- 1 | | int _iocs_mpu_stat (void); /* rom 1.3 only */ 2 | .text 3 | .even 4 | .global _iocs_mpu_stat 5 | .type _iocs_mpu_stat,@function 6 | _iocs_mpu_stat: 7 | moveq #0, %d1 8 | moveq #0xffffffac, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/putgrm.S: -------------------------------------------------------------------------------- 1 | | int _iocs_putgrm (const struct _iocs_putptr *); 2 | .text 3 | .even 4 | .global _iocs_putgrm 5 | .type _iocs_putgrm,@function 6 | _iocs_putgrm: 7 | move.l %sp@(4), %a1 8 | moveq #0xffffffbf, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/symbol.S: -------------------------------------------------------------------------------- 1 | | int _iocs_symbol (const struct _iocs_symbolptr *); 2 | .text 3 | .even 4 | .global _iocs_symbol 5 | .type _iocs_symbol,@function 6 | _iocs_symbol: 7 | move.l %sp@(4), %a1 8 | moveq #0xffffffbd, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/wait.c: -------------------------------------------------------------------------------- 1 | /* 2 | * wait() 3 | */ 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | pid_t wait(int *wstatus) 11 | { 12 | *wstatus = _dos_wait(); 13 | 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /src/libx68k/_exit.c: -------------------------------------------------------------------------------- 1 | /* 2 | * _exit() 3 | */ 4 | 5 | #include 6 | #include 7 | #include "fds.h" 8 | 9 | void _exit(int status) 10 | { 11 | /* Close opened file */ 12 | __fd_exit_clean (); 13 | 14 | _dos_exit2(status); 15 | } 16 | -------------------------------------------------------------------------------- /src/libx68k/libdos/c_fnkmod.S: -------------------------------------------------------------------------------- 1 | | int _dos_c_fnkmod (int); 2 | .text 3 | .even 4 | .global _dos_c_fnkmod 5 | .type _dos_c_fnkmod,@function 6 | _dos_c_fnkmod: 7 | move.w %sp@(6), %sp@- 8 | move.w #14, %sp@- 9 | .short 0xff23 10 | addq.l #4, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/c_print.S: -------------------------------------------------------------------------------- 1 | | int _dos_c_print (const char *); 2 | .text 3 | .even 4 | .global _dos_c_print 5 | .type _dos_c_print,@function 6 | _dos_c_print: 7 | move.l %sp@(4), %sp@- 8 | move.w #1, %sp@- 9 | .short 0xff23 10 | addq.l #6, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/curdir.S: -------------------------------------------------------------------------------- 1 | | int _dos_curdir (int, char *); 2 | .text 3 | .even 4 | .global _dos_curdir 5 | .type _dos_curdir,@function 6 | _dos_curdir: 7 | move.l %sp@(8), %sp@- 8 | move.w %sp@(10), %sp@- 9 | .short 0xff47 10 | addq.l #6, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/hendspic.S: -------------------------------------------------------------------------------- 1 | | void _dos_hendspic (int); 2 | .text 3 | .even 4 | .global _dos_hendspic 5 | .type _dos_hendspic,@function 6 | _dos_hendspic: 7 | move.w %sp@(6), %sp@- 8 | move.w #7, %sp@- 9 | .short 0xff18 10 | addq.l #4, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/indosflg.S: -------------------------------------------------------------------------------- 1 | | struct _dos_indos *_dos_indosflg (void); 2 | .text 3 | .even 4 | .global _dos_indosflg 5 | .type _dos_indosflg,@function 6 | _dos_indosflg: 7 | .short 0xfff5 8 | #ifdef __SVR4_ABI__ 9 | movea.l %d0, %a0 10 | #endif 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/k_insmod.S: -------------------------------------------------------------------------------- 1 | | void _dos_k_insmod (int); 2 | .text 3 | .even 4 | .global _dos_k_insmod 5 | .type _dos_k_insmod,@function 6 | _dos_k_insmod: 7 | move.w %sp@(6), %sp@- 8 | move.w #4, %sp@- 9 | .short 0xff24 10 | addq.l #4, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/rassign.S: -------------------------------------------------------------------------------- 1 | | int _dos_rassign (const char *); 2 | .text 3 | .even 4 | .global _dos_rassign 5 | .type _dos_rassign,@function 6 | _dos_rassign: 7 | move.l %sp@(4), %sp@- 8 | move.w #4, %sp@- 9 | .short 0xff8f 10 | addq.l #6, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/super.S: -------------------------------------------------------------------------------- 1 | | int _dos_super (int); 2 | .text 3 | .even 4 | .global _dos_super 5 | .type _dos_super,@function 6 | _dos_super: 7 | movea.l %sp@+, %a1 8 | tst.l %sp@ 9 | beq 1f 10 | move.l %sp, %usp 11 | 1: 12 | .short 0xff20 13 | jmp %a1@ 14 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/drawmode.S: -------------------------------------------------------------------------------- 1 | | int _iocs_drawmode (int); /* rom 1.3, iocs.x */ 2 | .text 3 | .even 4 | .global _iocs_drawmode 5 | .type _iocs_drawmode,@function 6 | _iocs_drawmode: 7 | move.l %sp@(4), %d1 8 | moveq #0xffffffb0, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/jissft.S: -------------------------------------------------------------------------------- 1 | | int __pure _iocs_jissft (int) __attribute__((const)); 2 | .text 3 | .even 4 | .global _iocs_jissft 5 | .type _iocs_jissft,@function 6 | _iocs_jissft: 7 | move.l %sp@(4), %d1 8 | moveq #0xffffffa1, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/s_msgin.S: -------------------------------------------------------------------------------- 1 | | int _iocs_s_msgin (void *); 2 | .text 3 | .even 4 | .global _iocs_s_msgin 5 | .type _iocs_s_msgin,@function 6 | _iocs_s_msgin: 7 | move.l %sp@(4), %a1 8 | moveq #7, %d1 9 | moveq #0xfffffff5, %d0 10 | trap #15 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/s_stsin.S: -------------------------------------------------------------------------------- 1 | | int _iocs_s_stsin (void *); 2 | .text 3 | .even 4 | .global _iocs_s_stsin 5 | .type _iocs_s_stsin,@function 6 | _iocs_s_stsin: 7 | move.l %sp@(4), %a1 8 | moveq #6, %d1 9 | moveq #0xfffffff5, %d0 10 | trap #15 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/sftjis.S: -------------------------------------------------------------------------------- 1 | | int __pure _iocs_sftjis (int) __attribute__((const)); 2 | .text 3 | .even 4 | .global _iocs_sftjis 5 | .type _iocs_sftjis,@function 6 | _iocs_sftjis: 7 | move.l %sp@(4), %d1 8 | moveq #0xffffffa0, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/txfill.S: -------------------------------------------------------------------------------- 1 | | void _iocs_txfill (const struct _iocs_txfillptr *); 2 | .text 3 | .even 4 | .global _iocs_txfill 5 | .type _iocs_txfill,@function 6 | _iocs_txfill: 7 | move.l %sp@(4), %a1 8 | moveq #0xffffffd7, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/txxline.S: -------------------------------------------------------------------------------- 1 | | void _iocs_txxline (const struct _iocs_xlineptr *); 2 | .text 3 | .even 4 | .global _iocs_txxline 5 | .type _iocs_txxline,@function 6 | _iocs_txxline: 7 | move.l %sp@(4), %a1 8 | moveq #0xffffffd3, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/txyline.S: -------------------------------------------------------------------------------- 1 | | void _iocs_txyline (const struct _iocs_ylineptr *); 2 | .text 3 | .even 4 | .global _iocs_txyline 5 | .type _iocs_txyline,@function 6 | _iocs_txyline: 7 | move.l %sp@(4), %a1 8 | moveq #0xffffffd4, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/Common.mk: -------------------------------------------------------------------------------- 1 | CROSS = m68k-xelf- 2 | CC = $(CROSS)gcc 3 | AS = $(CROSS)gcc 4 | LD = $(CROSS)gcc 5 | AR = $(CROSS)ar 6 | RANLIB = $(CROSS)ranlib 7 | 8 | CFLAGS = -m68000 -I. -Os -fcall-used-d2 -fcall-used-a2 -fexec-charset=cp932 9 | ASFLAGS = -m68000 -I. 10 | -------------------------------------------------------------------------------- /src/libx68k/libdos/common_ck.S: -------------------------------------------------------------------------------- 1 | | int _dos_common_ck (const char *); 2 | .text 3 | .even 4 | .global _dos_common_ck 5 | .type _dos_common_ck,@function 6 | _dos_common_ck: 7 | move.l %sp@(4), %sp@- 8 | clr.w %sp@- 9 | .short 0xff85 10 | addq.l #6, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/drvxchg.S: -------------------------------------------------------------------------------- 1 | | void _dos_drvxchg (int, int); 2 | .text 3 | .even 4 | .global _dos_drvxchg 5 | .type _dos_drvxchg,@function 6 | _dos_drvxchg: 7 | move.w %sp@(10), %sp@- 8 | move.w %sp@(8), %sp@- 9 | .short 0xff34 10 | addq.l #4, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/fputs.S: -------------------------------------------------------------------------------- 1 | | void _dos_fputs (const char *, int); 2 | .text 3 | .even 4 | .global _dos_fputs 5 | .type _dos_fputs,@function 6 | _dos_fputs: 7 | move.w %sp@(10), %sp@- 8 | move.l %sp@(6), %sp@- 9 | .short 0xff1e 10 | addq.l #6, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/ioctrldvgt.S: -------------------------------------------------------------------------------- 1 | | int _dos_ioctrldvgt (int); 2 | .text 3 | .even 4 | .global _dos_ioctrldvgt 5 | .type _dos_ioctrldvgt,@function 6 | _dos_ioctrldvgt: 7 | move.w %sp@(6), %sp@- 8 | move.w #9, %sp@- 9 | .short 0xff44 10 | addq.l #4, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/move.S: -------------------------------------------------------------------------------- 1 | | int _dos_move (const char *, const char *); 2 | .text 3 | .even 4 | .global _dos_move 5 | .type _dos_move,@function 6 | _dos_move: 7 | move.l %sp@(8), %sp@- 8 | move.l %sp@(8), %sp@- 9 | .short 0xff86 10 | addq.l #8, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/ms_patst.S: -------------------------------------------------------------------------------- 1 | | void _iocs_ms_patst (int, const struct _iocs_patst *); 2 | .text 3 | .even 4 | .global _iocs_ms_patst 5 | .type _iocs_ms_patst,@function 6 | _iocs_ms_patst: 7 | movem.l %sp@(4),%d1/%a1 8 | moveq #0x7a, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/s_msgout.S: -------------------------------------------------------------------------------- 1 | | int _iocs_s_msgout (void *); 2 | .text 3 | .even 4 | .global _iocs_s_msgout 5 | .type _iocs_s_msgout,@function 6 | _iocs_s_msgout: 7 | move.l %sp@(4), %a1 8 | moveq #8, %d1 9 | moveq #0xfffffff5, %d0 10 | trap #15 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/fcntl.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Stub version of fcntl. 3 | */ 4 | 5 | #include "config.h" 6 | #include <_ansi.h> 7 | #include <_syslist.h> 8 | #include 9 | 10 | int 11 | _fcntl (int fd, int cmd, ...) 12 | { 13 | errno = ENOSYS; 14 | return -1; 15 | } 16 | -------------------------------------------------------------------------------- /src/libx68k/libdos/fgets.S: -------------------------------------------------------------------------------- 1 | | int _dos_fgets (struct _dos_inpptr *, int); 2 | .text 3 | .even 4 | .global _dos_fgets 5 | .type _dos_fgets,@function 6 | _dos_fgets: 7 | move.w %sp@(10), %sp@- 8 | move.l %sp@(6), %sp@- 9 | .short 0xff1c 10 | addq.l #6, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/filedate.S: -------------------------------------------------------------------------------- 1 | | int _dos_filedate (int, int); 2 | .text 3 | .even 4 | .global _dos_filedate 5 | .type _dos_filedate,@function 6 | _dos_filedate: 7 | move.l %sp@(8), %sp@- 8 | move.w %sp@(10), %sp@- 9 | .short 0xff87 10 | addq.l #6, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/fnckeygt.S: -------------------------------------------------------------------------------- 1 | | void _dos_fnckeygt (int, char *); 2 | .text 3 | .even 4 | .global _dos_fnckeygt 5 | .type _dos_fnckeygt,@function 6 | _dos_fnckeygt: 7 | move.l %sp@(8), %sp@- 8 | move.w %sp@(10), %sp@- 9 | .short 0xff21 10 | addq.l #6, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/ioctrlfdgt.S: -------------------------------------------------------------------------------- 1 | | int _dos_ioctrlfdgt (int); 2 | .text 3 | .even 4 | .global _dos_ioctrlfdgt 5 | .type _dos_ioctrlfdgt,@function 6 | _dos_ioctrlfdgt: 7 | move.w %sp@(6), %sp@- 8 | move.w #10, %sp@- 9 | .short 0xff44 10 | addq.l #4, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/maketmp.S: -------------------------------------------------------------------------------- 1 | | int _dos_maketmp (const char *, int); 2 | .text 3 | .even 4 | .global _dos_maketmp 5 | .type _dos_maketmp,@function 6 | _dos_maketmp: 7 | move.w %sp@(10), %sp@- 8 | move.l %sp@(6), %sp@- 9 | .short 0xff8a 10 | addq.l #6, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/setblock.S: -------------------------------------------------------------------------------- 1 | | int _dos_setblock (void *, int); 2 | .text 3 | .even 4 | .global _dos_setblock 5 | .type _dos_setblock,@function 6 | _dos_setblock: 7 | move.l %sp@(8), %sp@- 8 | move.l %sp@(8), %sp@- 9 | .short 0xff4a 10 | addq.l #8, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_bpoke.S: -------------------------------------------------------------------------------- 1 | | void _iocs_b_bpoke (void *, int); 2 | .text 3 | .even 4 | .global _iocs_b_bpoke 5 | .type _iocs_b_bpoke,@function 6 | _iocs_b_bpoke: 7 | movea.l %sp@(4), %a1 8 | move.l %sp@(8) , %d1 9 | moveq #0xffffff86, %d0 10 | trap #15 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_lpoke.S: -------------------------------------------------------------------------------- 1 | | void _iocs_b_lpoke (void *, int); 2 | .text 3 | .even 4 | .global _iocs_b_lpoke 5 | .type _iocs_b_lpoke,@function 6 | _iocs_b_lpoke: 7 | movea.l %sp@(4), %a1 8 | move.l %sp@(8) , %d1 9 | moveq #0xffffff88, %d0 10 | trap #15 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_wpoke.S: -------------------------------------------------------------------------------- 1 | | void _iocs_b_wpoke (void *, int); 2 | .text 3 | .even 4 | .global _iocs_b_wpoke 5 | .type _iocs_b_wpoke,@function 6 | _iocs_b_wpoke: 7 | movea.l %sp@(4), %a1 8 | move.l %sp@(8) , %d1 9 | moveq #0xffffff87, %d0 10 | trap #15 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/crtcras.S: -------------------------------------------------------------------------------- 1 | | int _iocs_crtcras (const void *, int); 2 | .text 3 | .even 4 | .global _iocs_crtcras 5 | .type _iocs_crtcras,@function 6 | _iocs_crtcras: 7 | movea.l %sp@(4), %a1 8 | move.l %sp@(8) , %d1 9 | moveq #0x6d, %d0 10 | trap #15 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libpthread/pthread_spin_init.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pthread_spin_init() 3 | */ 4 | 5 | #include "pthread_internal.h" 6 | 7 | int pthread_spin_init(pthread_spinlock_t *lock, int pshared) 8 | { 9 | *lock = (pthread_spinlock_t){ 0 }; 10 | return 0; 11 | } 12 | -------------------------------------------------------------------------------- /src/libx68k/kill.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Stub version of kill. 3 | */ 4 | 5 | #include "config.h" 6 | #include <_ansi.h> 7 | #include <_syslist.h> 8 | #include 9 | 10 | int 11 | _kill (int pid, 12 | int sig) 13 | { 14 | errno = ENOSYS; 15 | return -1; 16 | } 17 | -------------------------------------------------------------------------------- /src/libx68k/libdos/common_del.S: -------------------------------------------------------------------------------- 1 | | int _dos_common_del (const char *); 2 | .text 3 | .even 4 | .global _dos_common_del 5 | .type _dos_common_del,@function 6 | _dos_common_del: 7 | move.l %sp@(4), %sp@- 8 | move.w #5, %sp@- 9 | .short 0xff85 10 | addq.l #6, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/create.S: -------------------------------------------------------------------------------- 1 | | int _dos_create (const char *, _dos_mode_t); 2 | .text 3 | .even 4 | .global _dos_create 5 | .type _dos_create,@function 6 | _dos_create: 7 | move.w %sp@(10), %sp@- 8 | move.l %sp@(6), %sp@- 9 | .short 0xff3c 10 | addq.l #6, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/dskfre.S: -------------------------------------------------------------------------------- 1 | | int _dos_dskfre (int, struct _dos_freeinf *); 2 | .text 3 | .even 4 | .global _dos_dskfre 5 | .type _dos_dskfre,@function 6 | _dos_dskfre: 7 | move.l %sp@(8), %sp@- 8 | move.w %sp@(10), %sp@- 9 | .short 0xff36 10 | addq.l #6, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/get_pr.S: -------------------------------------------------------------------------------- 1 | | int _dos_get_pr (int, struct _dos_prcptr *); 2 | .text 3 | .even 4 | .global _dos_get_pr 5 | .type _dos_get_pr,@function 6 | _dos_get_pr: 7 | move.l %sp@(8), %sp@- 8 | move.w %sp@(10), %sp@- 9 | .short 0xfffa 10 | addq.l #6, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/getdpb.S: -------------------------------------------------------------------------------- 1 | | int _dos_getdpb (int, struct _dos_dpbptr *); 2 | .text 3 | .even 4 | .global _dos_getdpb 5 | .type _dos_getdpb,@function 6 | _dos_getdpb: 7 | move.l %sp@(8), %sp@- 8 | move.w %sp@(10), %sp@- 9 | .short 0xff32 10 | addq.l #6, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/kflushgs.S: -------------------------------------------------------------------------------- 1 | | int _dos_kflushgs (struct _dos_inpptr *); 2 | .text 3 | .even 4 | .global _dos_kflushgs 5 | .type _dos_kflushgs,@function 6 | _dos_kflushgs: 7 | move.l %sp@(4), %sp@- 8 | move.w #10, %sp@- 9 | .short 0xff0c 10 | addq.l #6, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/rename.S: -------------------------------------------------------------------------------- 1 | | int _dos_rename (const char *, const char *); 2 | .text 3 | .even 4 | .global _dos_rename 5 | .type _dos_rename,@function 6 | _dos_rename: 7 | move.l %sp@(8), %sp@- 8 | move.l %sp@(8), %sp@- 9 | .short 0xff86 10 | addq.l #8, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/txline.S: -------------------------------------------------------------------------------- 1 | | void _iocs_txline (const struct _iocs_tlineptr *); /* 1.3, iocs.x */ 2 | .text 3 | .even 4 | .global _iocs_txline 5 | .type _iocs_txline,@function 6 | _iocs_txline: 7 | move.l %sp@(4), %a1 8 | moveq #0xffffffd5, %d0 9 | trap #15 10 | rts 11 | -------------------------------------------------------------------------------- /src/libx68k/symlink.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Stub version of symlink. 3 | */ 4 | 5 | #include "config.h" 6 | #include <_ansi.h> 7 | #include 8 | 9 | int 10 | symlink (const char *path1, 11 | const char *path2) 12 | { 13 | errno = ENOSYS; 14 | return -1; 15 | } 16 | -------------------------------------------------------------------------------- /src/libx68k/libdos/chmod.S: -------------------------------------------------------------------------------- 1 | | _dos_mode_t _dos_chmod (const char *, _dos_mode_t); 2 | .text 3 | .even 4 | .global _dos_chmod 5 | .type _dos_chmod,@function 6 | _dos_chmod: 7 | move.w %sp@(10), %sp@- 8 | move.l %sp@(6), %sp@- 9 | .short 0xff43 10 | addq.l #6, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/fatchk.S: -------------------------------------------------------------------------------- 1 | | int _dos_fatchk (const char *, unsigned short *); 2 | .text 3 | .even 4 | .global _dos_fatchk 5 | .type _dos_fatchk,@function 6 | _dos_fatchk: 7 | move.l %sp@(8), %sp@- 8 | move.l %sp@(8), %sp@- 9 | .short 0xff17 10 | addq.l #8, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/newfile.S: -------------------------------------------------------------------------------- 1 | | int _dos_newfile (const char *, _dos_mode_t); 2 | .text 3 | .even 4 | .global _dos_newfile 5 | .type _dos_newfile,@function 6 | _dos_newfile: 7 | move.w %sp@(10), %sp@- 8 | move.l %sp@(6), %sp@- 9 | .short 0xff8b 10 | addq.l #6, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_seek.S: -------------------------------------------------------------------------------- 1 | | int _iocs_b_seek (int, int); 2 | .text 3 | .even 4 | .global _iocs_b_seek 5 | .type _iocs_b_seek,@function 6 | _iocs_b_seek: 7 | move.l %d2, %sp@- 8 | movem.l %sp@(8),%d1/%d2 9 | moveq #0x40, %d0 10 | trap #15 11 | move.l %sp@+, %d2 12 | rts 13 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/ledmod.S: -------------------------------------------------------------------------------- 1 | | void _iocs_ledmod (int, int); 2 | .text 3 | .even 4 | .global _iocs_ledmod 5 | .type _iocs_ledmod,@function 6 | _iocs_ledmod: 7 | move.l %d2, %sp@- 8 | movem.l %sp@(8),%d1/%d2 9 | moveq #0x0d, %d0 10 | trap #15 11 | move.l %sp@+, %d2 12 | rts 13 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/ms_curst.S: -------------------------------------------------------------------------------- 1 | | int _iocs_ms_curst (int, int); 2 | .text 3 | .even 4 | .global _iocs_ms_curst 5 | .type _iocs_ms_curst,@function 6 | _iocs_ms_curst: 7 | move.w %sp@(6), %d1 8 | swap %d1 9 | move.w %sp@(10), %d1 10 | moveq #0x76, %d0 11 | trap #15 12 | rts 13 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/opmset.S: -------------------------------------------------------------------------------- 1 | | void _iocs_opmset (int, int); 2 | .text 3 | .even 4 | .global _iocs_opmset 5 | .type _iocs_opmset,@function 6 | _iocs_opmset: 7 | move.l %d2, %sp@- 8 | movem.l %sp@(8),%d1/%d2 9 | moveq #0x68, %d0 10 | trap #15 11 | move.l %sp@+, %d2 12 | rts 13 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/tpalet.S: -------------------------------------------------------------------------------- 1 | | int _iocs_tpalet (int, int); 2 | .text 3 | .even 4 | .global _iocs_tpalet 5 | .type _iocs_tpalet,@function 6 | _iocs_tpalet: 7 | move.l %d2, %sp@- 8 | movem.l %sp@(8),%d1/%d2 9 | moveq #0x13, %d0 10 | trap #15 11 | move.l %sp@+, %d2 12 | rts 13 | -------------------------------------------------------------------------------- /src/libx68k/libpthread/pthread_cond_init.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pthread_cond_init() 3 | */ 4 | 5 | #include "pthread_internal.h" 6 | 7 | int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr) 8 | { 9 | *cond = PTHREAD_COND_INITIALIZER; 10 | return 0; 11 | } 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/intvcg.S: -------------------------------------------------------------------------------- 1 | | void *_dos_intvcg (int); 2 | .text 3 | .even 4 | .global _dos_intvcg 5 | .type _dos_intvcg,@function 6 | _dos_intvcg: 7 | move.w %sp@(6), %sp@- 8 | .short 0xff35 9 | addq.l #2, %sp 10 | #ifdef __SVR4_ABI__ 11 | movea.l %d0, %a0 12 | #endif 13 | rts 14 | -------------------------------------------------------------------------------- /src/libx68k/libdos/malloc.S: -------------------------------------------------------------------------------- 1 | | void *_dos_malloc (int); 2 | .text 3 | .even 4 | .global _dos_malloc 5 | .type _dos_malloc,@function 6 | _dos_malloc: 7 | move.l %sp@(4), %sp@- 8 | .short 0xff48 9 | addq.l #4, %sp 10 | #ifdef __SVR4_ABI__ 11 | movea.l %d0, %a0 12 | #endif 13 | rts 14 | -------------------------------------------------------------------------------- /src/libx68k/libdos/nameck.S: -------------------------------------------------------------------------------- 1 | | int _dos_nameck (const char *, struct _dos_nameckbuf *); 2 | .text 3 | .even 4 | .global _dos_nameck 5 | .type _dos_nameck,@function 6 | _dos_nameck: 7 | move.l %sp@(8), %sp@- 8 | move.l %sp@(8), %sp@- 9 | .short 0xff37 10 | addq.l #8, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/seek.S: -------------------------------------------------------------------------------- 1 | | long _dos_seek (int, int, int); 2 | .text 3 | .even 4 | .global _dos_seek 5 | .type _dos_seek,@function 6 | _dos_seek: 7 | move.w %sp@(14), %sp@- 8 | move.l %sp@(10), %sp@- 9 | move.w %sp@(12), %sp@- 10 | .short 0xff42 11 | addq.l #8, %sp 12 | rts 13 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/gpalet.S: -------------------------------------------------------------------------------- 1 | | int _iocs_gpalet (int, int); 2 | .text 3 | .even 4 | .global _iocs_gpalet 5 | .type _iocs_gpalet,@function 6 | _iocs_gpalet: 7 | move.l %d2, %sp@- 8 | movem.l %sp@(8),%d1/%d2 9 | moveq #0xffffff94, %d0 10 | trap #15 11 | move.l %sp@+, %d2 12 | rts 13 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/ms_ontm.S: -------------------------------------------------------------------------------- 1 | | int _iocs_ms_ontm (int, int); 2 | .text 3 | .even 4 | .global _iocs_ms_ontm 5 | .type _iocs_ms_ontm,@function 6 | _iocs_ms_ontm: 7 | move.l %d2, %sp@- 8 | movem.l %sp@(8),%d1/%d2 9 | moveq #0x79, %d0 10 | trap #15 11 | move.l %sp@+, %d2 12 | rts 13 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/tgusemd.S: -------------------------------------------------------------------------------- 1 | | int _iocs_tgusemd (int, int); 2 | .text 3 | .even 4 | .global _iocs_tgusemd 5 | .type _iocs_tgusemd,@function 6 | _iocs_tgusemd: 7 | move.l %d2, %sp@- 8 | movem.l %sp@(8),%d1/%d2 9 | moveq #0x0e, %d0 10 | trap #15 11 | move.l %sp@+, %d2 12 | rts 13 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/tpalet2.S: -------------------------------------------------------------------------------- 1 | | int _iocs_tpalet2 (int, int); 2 | .text 3 | .even 4 | .global _iocs_tpalet2 5 | .type _iocs_tpalet2,@function 6 | _iocs_tpalet2: 7 | move.l %d2, %sp@- 8 | movem.l %sp@(8),%d1/%d2 9 | moveq #0x14, %d0 10 | trap #15 11 | move.l %sp@+, %d2 12 | rts 13 | -------------------------------------------------------------------------------- /src/libx68k/libpthread/pthread_spin_destroy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pthread_spin_destroy() 3 | */ 4 | 5 | #include "pthread_internal.h" 6 | 7 | int pthread_spin_destroy(pthread_spinlock_t *lock) 8 | { 9 | if (lock->lock) { 10 | return EBUSY; 11 | } 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /src/libx68k/link.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Stub version of link. 3 | */ 4 | 5 | #include "config.h" 6 | #include <_ansi.h> 7 | #include <_syslist.h> 8 | #include 9 | 10 | int 11 | _link (char *existing, 12 | char *new) 13 | { 14 | errno = ENOSYS; 15 | return -1; 16 | } 17 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "bas2c"] 2 | path = bas2c 3 | url = https://github.com/yunkya2/bas2c-x68k 4 | [submodule "unlha"] 5 | path = unlha 6 | url = https://github.com/yunkya2/unlha.git 7 | [submodule "sample"] 8 | path = sample 9 | url = https://github.com/yunkya2/elf2x68k-sample 10 | -------------------------------------------------------------------------------- /src/libx68k/libdos/c_locate.S: -------------------------------------------------------------------------------- 1 | | int _dos_c_locate (int, int); 2 | .text 3 | .even 4 | .global _dos_c_locate 5 | .type _dos_c_locate,@function 6 | _dos_c_locate: 7 | move.w %sp@(10), %sp@- 8 | move.w %sp@(8), %sp@- 9 | move.w #3, %sp@- 10 | .short 0xff23 11 | addq.l #6, %sp 12 | rts 13 | -------------------------------------------------------------------------------- /src/libx68k/libdos/c_window.S: -------------------------------------------------------------------------------- 1 | | int _dos_c_window (int, int); 2 | .text 3 | .even 4 | .global _dos_c_window 5 | .type _dos_c_window,@function 6 | _dos_c_window: 7 | move.w %sp@(10), %sp@- 8 | move.w %sp@(8), %sp@- 9 | move.w #15, %sp@- 10 | .short 0xff23 11 | addq.l #6, %sp 12 | rts 13 | -------------------------------------------------------------------------------- /src/libx68k/libdos/ioctrlst.S: -------------------------------------------------------------------------------- 1 | | int _dos_ioctrlst (int, int); 2 | .text 3 | .even 4 | .global _dos_ioctrlst 5 | .type _dos_ioctrlst,@function 6 | _dos_ioctrlst: 7 | move.w %sp@(10), %sp@- 8 | move.w %sp@(8), %sp@- 9 | move.w #1, %sp@- 10 | .short 0xff44 11 | addq.l #6, %sp 12 | rts 13 | -------------------------------------------------------------------------------- /src/libx68k/libdos/namests.S: -------------------------------------------------------------------------------- 1 | | int _dos_namests (const char *, struct _dos_namestbuf *); 2 | .text 3 | .even 4 | .global _dos_namests 5 | .type _dos_namests,@function 6 | _dos_namests: 7 | move.l %sp@(8), %sp@- 8 | move.l %sp@(8), %sp@- 9 | .short 0xff29 10 | addq.l #8, %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/read.S: -------------------------------------------------------------------------------- 1 | | int _dos_read (int, char *, int); 2 | .text 3 | .even 4 | .global _dos_read 5 | .type _dos_read,@function 6 | _dos_read: 7 | move.l %sp@(12), %sp@- 8 | move.l %sp@(12), %sp@- 9 | move.w %sp@(14), %sp@- 10 | .short 0xff3f 11 | lea %sp@(10), %sp 12 | rts 13 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/adpcmlin.S: -------------------------------------------------------------------------------- 1 | | void _iocs_adpcmlin (const struct _iocs_chain2 *, int); 2 | .text 3 | .even 4 | .global _iocs_adpcmlin 5 | .type _iocs_adpcmlin,@function 6 | _iocs_adpcmlin: 7 | movea.l %sp@(4), %a1 8 | move.l %sp@(8) , %d1 9 | moveq #0x65, %d0 10 | trap #15 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/adpcmlot.S: -------------------------------------------------------------------------------- 1 | | void _iocs_adpcmlot (const struct _iocs_chain2 *, int); 2 | .text 3 | .even 4 | .global _iocs_adpcmlot 5 | .type _iocs_adpcmlot,@function 6 | _iocs_adpcmlot: 7 | movea.l %sp@(4), %a1 8 | move.l %sp@(8) , %d1 9 | moveq #0x64, %d0 10 | trap #15 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_drvchk.S: -------------------------------------------------------------------------------- 1 | | int _iocs_b_drvchk (int, int); 2 | .text 3 | .even 4 | .global _iocs_b_drvchk 5 | .type _iocs_b_drvchk,@function 6 | _iocs_b_drvchk: 7 | move.l %d2, %sp@- 8 | movem.l %sp@(8),%d1/%d2 9 | moveq #0x4e, %d0 10 | trap #15 11 | move.l %sp@+, %d2 12 | rts 13 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_locate.S: -------------------------------------------------------------------------------- 1 | | int _iocs_b_locate (int, int); 2 | .text 3 | .even 4 | .global _iocs_b_locate 5 | .type _iocs_b_locate,@function 6 | _iocs_b_locate: 7 | move.l %d2, %sp@- 8 | movem.l %sp@(8),%d1/%d2 9 | moveq #0x23, %d0 10 | trap #15 11 | move.l %sp@+, %d2 12 | rts 13 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/ms_offtm.S: -------------------------------------------------------------------------------- 1 | | int _iocs_ms_offtm (int, int); 2 | .text 3 | .even 4 | .global _iocs_ms_offtm 5 | .type _iocs_ms_offtm,@function 6 | _iocs_ms_offtm: 7 | move.l %d2, %sp@- 8 | movem.l %sp@(8),%d1/%d2 9 | moveq #0x78, %d0 10 | trap #15 11 | move.l %sp@+, %d2 12 | rts 13 | -------------------------------------------------------------------------------- /src/libx68k/libpthread/pthread_mutex_init.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pthread_mutex_init() 3 | */ 4 | 5 | #include "pthread_internal.h" 6 | 7 | int pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *attr) 8 | { 9 | *mutex = PTHREAD_MUTEX_INITIALIZER; 10 | return 0; 11 | } 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/exnfiles.S: -------------------------------------------------------------------------------- 1 | | int _dos_exnfiles (struct _dos_exfilbuf *); 2 | .text 3 | .even 4 | .global _dos_exnfiles 5 | .type _dos_exnfiles,@function 6 | _dos_exnfiles: 7 | move.l %sp@(4), %d0 8 | bset #31, %d0 9 | move.l %d0, %sp@- 10 | .short 0xff4f 11 | addq.l #4, %sp 12 | rts 13 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/bgtextcl.S: -------------------------------------------------------------------------------- 1 | | int _iocs_bgtextcl (int, int); 2 | .text 3 | .even 4 | .global _iocs_bgtextcl 5 | .type _iocs_bgtextcl,@function 6 | _iocs_bgtextcl: 7 | move.l %d2, %sp@- 8 | movem.l %sp@(8),%d1/%d2 9 | moveq #0xffffffcc, %d0 10 | trap #15 11 | move.l %sp@+, %d2 12 | rts 13 | -------------------------------------------------------------------------------- /src/libx68k/libpthread/pthread_rwlock_init.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pthread_rwlock_init() 3 | */ 4 | 5 | #include "pthread_internal.h" 6 | 7 | int pthread_rwlock_init(pthread_rwlock_t *lock, const pthread_rwlockattr_t *attr) 8 | { 9 | *lock = PTHREAD_RWLOCK_INITIALIZER; 10 | return 0; 11 | } 12 | -------------------------------------------------------------------------------- /src/libx68k/libpthread/pthread_self.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pthread_self() 3 | */ 4 | 5 | #include "pthread_internal.h" 6 | 7 | pthread_t pthread_self(void) 8 | { 9 | struct dos_prcptr prc; 10 | int tid = _dos_get_pr(-2, &prc); 11 | return tid >= 0 ? (pthread_t)tid : (pthread_t)-1; 12 | } 13 | -------------------------------------------------------------------------------- /src/libx68k/times.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Stub version of times. 3 | */ 4 | 5 | #include "config.h" 6 | #include <_ansi.h> 7 | #include <_syslist.h> 8 | #include 9 | #include 10 | 11 | clock_t 12 | _times (struct tms *buf) 13 | { 14 | errno = ENOSYS; 15 | return -1; 16 | } 17 | -------------------------------------------------------------------------------- /src/libx68k/libdos/getenv.S: -------------------------------------------------------------------------------- 1 | | int _dos_getenv (const char *, const char *, char *); 2 | .text 3 | .even 4 | .global _dos_getenv 5 | .type _dos_getenv,@function 6 | _dos_getenv: 7 | movem.l %sp@(4), %d0-%d1/%a0 8 | movem.l %d0-%d1/%a0, %sp@- 9 | .short 0xff83 10 | lea %sp@(12), %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libdos/hendspip.S: -------------------------------------------------------------------------------- 1 | | int _dos_hendspip (int, const char *); 2 | .text 3 | .even 4 | .global _dos_hendspip 5 | .type _dos_hendspip,@function 6 | _dos_hendspip: 7 | move.l %sp@(8), %sp@- 8 | move.w %sp@(10), %sp@- 9 | move.w #5, %sp@- 10 | .short 0xff18 11 | addq.l #8, %sp 12 | rts 13 | -------------------------------------------------------------------------------- /src/libx68k/libdos/hendspir.S: -------------------------------------------------------------------------------- 1 | | int _dos_hendspir (int, const char *); 2 | .text 3 | .even 4 | .global _dos_hendspir 5 | .type _dos_hendspir,@function 6 | _dos_hendspir: 7 | move.l %sp@(8), %sp@- 8 | move.w %sp@(10), %sp@- 9 | move.w #6, %sp@- 10 | .short 0xff18 11 | addq.l #8, %sp 12 | rts 13 | -------------------------------------------------------------------------------- /src/libx68k/libdos/hendspmp.S: -------------------------------------------------------------------------------- 1 | | int _dos_hendspmp (int, const char *); 2 | .text 3 | .even 4 | .global _dos_hendspmp 5 | .type _dos_hendspmp,@function 6 | _dos_hendspmp: 7 | move.l %sp@(8), %sp@- 8 | move.w %sp@(10), %sp@- 9 | move.w #1, %sp@- 10 | .short 0xff18 11 | addq.l #8, %sp 12 | rts 13 | -------------------------------------------------------------------------------- /src/libx68k/libdos/hendspmr.S: -------------------------------------------------------------------------------- 1 | | int _dos_hendspmr (int, const char *); 2 | .text 3 | .even 4 | .global _dos_hendspmr 5 | .type _dos_hendspmr,@function 6 | _dos_hendspmr: 7 | move.l %sp@(8), %sp@- 8 | move.w %sp@(10), %sp@- 9 | move.w #2, %sp@- 10 | .short 0xff18 11 | addq.l #8, %sp 12 | rts 13 | -------------------------------------------------------------------------------- /src/libx68k/libdos/hendspsp.S: -------------------------------------------------------------------------------- 1 | | int _dos_hendspsp (int, const char *); 2 | .text 3 | .even 4 | .global _dos_hendspsp 5 | .type _dos_hendspsp,@function 6 | _dos_hendspsp: 7 | move.l %sp@(8), %sp@- 8 | move.w %sp@(10), %sp@- 9 | move.w #9, %sp@- 10 | .short 0xff18 11 | addq.l #8, %sp 12 | rts 13 | -------------------------------------------------------------------------------- /src/libx68k/libdos/hendspsr.S: -------------------------------------------------------------------------------- 1 | | int _dos_hendspsr (int, const char *); 2 | .text 3 | .even 4 | .global _dos_hendspsr 5 | .type _dos_hendspsr,@function 6 | _dos_hendspsr: 7 | move.l %sp@(8), %sp@- 8 | move.w %sp@(10), %sp@- 9 | move.w #10, %sp@- 10 | .short 0xff18 11 | addq.l #8, %sp 12 | rts 13 | -------------------------------------------------------------------------------- /src/libx68k/libdos/write.S: -------------------------------------------------------------------------------- 1 | | int _dos_write (int, const char *, int); 2 | .text 3 | .even 4 | .global _dos_write 5 | .type _dos_write,@function 6 | _dos_write: 7 | move.l %sp@(12), %sp@- 8 | move.l %sp@(12), %sp@- 9 | move.w %sp@(14), %sp@- 10 | .short 0xff40 11 | lea %sp@(10), %sp 12 | rts 13 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/alarmset.S: -------------------------------------------------------------------------------- 1 | | int _iocs_alarmset (int, int, int); 2 | .text 3 | .even 4 | .global _iocs_alarmset 5 | .type _iocs_alarmset,@function 6 | _iocs_alarmset: 7 | move.l %d2, %sp@- 8 | movem.l %sp@(8),%d1/%d2/%a1 9 | moveq #0x5e, %d0 10 | trap #15 11 | move.l %sp@+, %d2 12 | rts 13 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/rmacnv.S: -------------------------------------------------------------------------------- 1 | | int _iocs_rmacnv (int, char *, char *); 2 | .text 3 | .even 4 | .global _iocs_rmacnv 5 | .type _iocs_rmacnv,@function 6 | _iocs_rmacnv: 7 | move.l %a2, %sp@- 8 | movem.l %sp@(8),%d1/%a1/%a2 9 | moveq #0xffffffa3, %d0 10 | trap #15 11 | move.l %sp@+, %a2 12 | rts 13 | -------------------------------------------------------------------------------- /src/libx68k/libdos/drvctrl.S: -------------------------------------------------------------------------------- 1 | | int _dos_drvctrl (int, int); 2 | .text 3 | .even 4 | .global _dos_drvctrl 5 | .type _dos_drvctrl,@function 6 | _dos_drvctrl: 7 | move.b %sp@(7), %d0 8 | lsl.w #8, %d0 9 | move.b %sp@(11), %d0 10 | move.w %d0, %sp@- 11 | .short 0xff0f 12 | addq.l #2, %sp 13 | rts 14 | -------------------------------------------------------------------------------- /src/libx68k/libdos/getassign.S: -------------------------------------------------------------------------------- 1 | | int _dos_getassign (const char *, char *); 2 | .text 3 | .even 4 | .global _dos_getassign 5 | .type _dos_getassign,@function 6 | _dos_getassign: 7 | move.l %sp@(8), %sp@- 8 | move.l %sp@(8), %sp@- 9 | clr.w %sp@- 10 | .short 0xff8f 11 | lea %sp@(10), %sp 12 | rts 13 | -------------------------------------------------------------------------------- /src/libx68k/libdos/ioctrlrtset.S: -------------------------------------------------------------------------------- 1 | | int _dos_ioctrlrtset (int, int); 2 | .text 3 | .even 4 | .global _dos_ioctrlrtset 5 | .type _dos_ioctrlrtset,@function 6 | _dos_ioctrlrtset: 7 | move.w %sp@(10), %sp@- 8 | move.w %sp@(8), %sp@- 9 | move.w #11, %sp@- 10 | .short 0xff44 11 | addq.l #6, %sp 12 | rts 13 | -------------------------------------------------------------------------------- /src/libx68k/libdos/lock.S: -------------------------------------------------------------------------------- 1 | | int _dos_lock (int, int, int); 2 | .text 3 | .even 4 | .global _dos_lock 5 | .type _dos_lock,@function 6 | _dos_lock: 7 | move.l %sp@(12), %sp@- 8 | move.l %sp@(12), %sp@- 9 | move.w %sp@(14), %sp@- 10 | clr.w %sp@- 11 | .short 0xff8c 12 | lea %sp@(12), %sp 13 | rts 14 | -------------------------------------------------------------------------------- /src/libx68k/libdos/setenv.S: -------------------------------------------------------------------------------- 1 | | int _dos_setenv (const char *, const char *, const char *); 2 | .text 3 | .even 4 | .global _dos_setenv 5 | .type _dos_setenv,@function 6 | _dos_setenv: 7 | movem.l %sp@(4), %d0-%d1/%a0 8 | movem.l %d0-%d1/%a0, %sp@- 9 | .short 0xff82 10 | lea %sp@(12), %sp 11 | rts 12 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/akconv.S: -------------------------------------------------------------------------------- 1 | | int __pure _iocs_akconv (int, int) __attribute__((const)); 2 | .text 3 | .even 4 | .global _iocs_akconv 5 | .type _iocs_akconv,@function 6 | _iocs_akconv: 7 | move.w %sp@(6), %d1 8 | swap %d1 9 | move.w %sp@(10), %d1 10 | moveq #0xffffffa2, %d0 11 | trap #15 12 | rts 13 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/defchr.S: -------------------------------------------------------------------------------- 1 | | int _iocs_defchr (int, int, const void *); 2 | .text 3 | .even 4 | .global _iocs_defchr 5 | .type _iocs_defchr,@function 6 | _iocs_defchr: 7 | movem.l %sp@(4), %d0-%d1/%a1 8 | swap %d1 9 | move.w %d0, %d1 10 | swap %d1 11 | moveq #0x0f, %d0 12 | trap #15 13 | rts 14 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/init_prn.S: -------------------------------------------------------------------------------- 1 | | int _iocs_init_prn (int, int); 2 | .text 3 | .even 4 | .global _iocs_init_prn 5 | .type _iocs_init_prn,@function 6 | _iocs_init_prn: 7 | moveq #0, %d1 8 | move.b %sp@(7), %d1 9 | lsl.w #8, %d1 10 | move.b %sp@(11), %d1 11 | moveq #0x3c, %d0 12 | trap #15 13 | rts 14 | -------------------------------------------------------------------------------- /src/libx68k/libdos/setpdb.S: -------------------------------------------------------------------------------- 1 | | struct _dos_psp *_dos_setpdb (struct _dos_psp *); 2 | .text 3 | .even 4 | .global _dos_setpdb 5 | .type _dos_setpdb,@function 6 | _dos_setpdb: 7 | move.l %sp@(4), %sp@- 8 | .short 0xff80 9 | addq.l #4, %sp 10 | #ifdef __SVR4_ABI__ 11 | movea.l %d0, %a0 12 | #endif 13 | rts 14 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/s_select.S: -------------------------------------------------------------------------------- 1 | | int _iocs_s_select (int); 2 | .text 3 | .even 4 | .global _iocs_s_select 5 | .type _iocs_s_select,@function 6 | _iocs_s_select: 7 | move.l %d4, %sp@- 8 | move.l %sp@(8), %d4 9 | moveq #1, %d1 10 | moveq #0xfffffff5, %d0 11 | trap #15 12 | move.l %sp@+, %d4 13 | rts 14 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/sp_gtpcg.S: -------------------------------------------------------------------------------- 1 | | int _iocs_sp_gtpcg (int, int, void *); 2 | .text 3 | .even 4 | .global _iocs_sp_gtpcg 5 | .type _iocs_sp_gtpcg,@function 6 | _iocs_sp_gtpcg: 7 | move.l %d2, %sp@- 8 | movem.l %sp@(8),%d1/%d2/%a1 9 | moveq #0xffffffc5, %d0 10 | trap #15 11 | move.l %sp@+, %d2 12 | rts 13 | -------------------------------------------------------------------------------- /src/libx68k/chown.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Stub version of chown. 3 | */ 4 | 5 | #include "config.h" 6 | #include <_ansi.h> 7 | #include 8 | #include 9 | 10 | int 11 | chown (const char *path, 12 | uid_t owner, 13 | gid_t group) 14 | { 15 | errno = ENOSYS; 16 | return -1; 17 | } 18 | -------------------------------------------------------------------------------- /src/libx68k/execve.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Stub version of execve. 3 | */ 4 | 5 | #include "config.h" 6 | #include <_ansi.h> 7 | #include <_syslist.h> 8 | #include 9 | 10 | int 11 | _execve (char *name, 12 | char **argv, 13 | char **env) 14 | { 15 | errno = ENOSYS; 16 | return -1; 17 | } 18 | -------------------------------------------------------------------------------- /src/libx68k/getentropy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Stub version of getentropy. 3 | */ 4 | 5 | #include "config.h" 6 | #include <_ansi.h> 7 | #include <_syslist.h> 8 | #include 9 | #include 10 | 11 | int 12 | getentropy (void *buffer, size_t length) 13 | { 14 | errno = ENOSYS; 15 | return -1; 16 | } 17 | -------------------------------------------------------------------------------- /src/libx68k/libdos/files.S: -------------------------------------------------------------------------------- 1 | | int _dos_files (struct _dos_filbuf *, const char *, int); 2 | .text 3 | .even 4 | .global _dos_files 5 | .type _dos_files,@function 6 | _dos_files: 7 | move.w %sp@(14), %sp@- 8 | move.l %sp@(10), %sp@- 9 | move.l %sp@(10), %sp@- 10 | .short 0xff4e 11 | lea %sp@(10), %sp 12 | rts 13 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/fntget.S: -------------------------------------------------------------------------------- 1 | | int _iocs_fntget (int, int, struct _iocs_fntbuf *); 2 | .text 3 | .even 4 | .global _iocs_fntget 5 | .type _iocs_fntget,@function 6 | _iocs_fntget: 7 | movem.l %sp@(4), %d0-%d1/%a1 8 | swap %d1 9 | move.w %d0, %d1 10 | swap %d1 11 | moveq #0x19, %d0 12 | trap #15 13 | rts 14 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/sp_defcg.S: -------------------------------------------------------------------------------- 1 | | int _iocs_sp_defcg (int, int, const void *); 2 | .text 3 | .even 4 | .global _iocs_sp_defcg 5 | .type _iocs_sp_defcg,@function 6 | _iocs_sp_defcg: 7 | move.l %d2, %sp@- 8 | movem.l %sp@(8),%d1/%d2/%a1 9 | moveq #0xffffffc4, %d0 10 | trap #15 11 | move.l %sp@+, %d2 12 | rts 13 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/textget.S: -------------------------------------------------------------------------------- 1 | | void _iocs_textget (int, int, struct _iocs_fntbuf *); 2 | .text 3 | .even 4 | .global _iocs_textget 5 | .type _iocs_textget,@function 6 | _iocs_textget: 7 | move.l %d2, %sp@- 8 | movem.l %sp@(8),%d1/%d2/%a1 9 | moveq #0x1a, %d0 10 | trap #15 11 | move.l %sp@+, %d2 12 | rts 13 | -------------------------------------------------------------------------------- /src/libx68k/libdos/unlock.S: -------------------------------------------------------------------------------- 1 | | int _dos_unlock (int, int, int); 2 | .text 3 | .even 4 | .global _dos_unlock 5 | .type _dos_unlock,@function 6 | _dos_unlock: 7 | move.l %sp@(12), %sp@- 8 | move.l %sp@(12), %sp@- 9 | move.w %sp@(14), %sp@- 10 | move.w #1, %sp@- 11 | .short 0xff8c 12 | lea %sp@(12), %sp 13 | rts 14 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_curmod.S: -------------------------------------------------------------------------------- 1 | | void _iocs_b_curmod (int); /*1.3/iocs.x*/ 2 | .text 3 | .even 4 | .global _iocs_b_curmod 5 | .type _iocs_b_curmod,@function 6 | _iocs_b_curmod: 7 | move.l %sp@(4), %d1 8 | moveq #1, %d0 9 | cmp.l %d1, %d0 10 | bcss 6f 11 | moveq #0xffffffad, %d0 12 | trap #15 13 | 6: 14 | rts 15 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/s_cmdout.S: -------------------------------------------------------------------------------- 1 | | int _iocs_s_cmdout (int, void *); 2 | .text 3 | .even 4 | .global _iocs_s_cmdout 5 | .type _iocs_s_cmdout,@function 6 | _iocs_s_cmdout: 7 | move.l %d3, %sp@- 8 | movem.l %sp@(8),%d3/%a1 9 | moveq #3, %d1 10 | moveq #0xfffffff5, %d0 11 | trap #15 12 | move.l %sp@+, %d3 13 | rts 14 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/s_datain.S: -------------------------------------------------------------------------------- 1 | | int _iocs_s_datain (int, void *); 2 | .text 3 | .even 4 | .global _iocs_s_datain 5 | .type _iocs_s_datain,@function 6 | _iocs_s_datain: 7 | move.l %d3, %sp@- 8 | movem.l %sp@(8),%d3/%a1 9 | moveq #4, %d1 10 | moveq #0xfffffff5, %d0 11 | trap #15 12 | move.l %sp@+, %d3 13 | rts 14 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/s_testunit.S: -------------------------------------------------------------------------------- 1 | | int _iocs_s_testunit (int); 2 | .text 3 | .even 4 | .global _iocs_s_testunit 5 | .type _iocs_s_testunit,@function 6 | _iocs_s_testunit: 7 | move.l %d4, %sp@- 8 | move.l %sp@(8), %d4 9 | moveq #36, %d1 10 | moveq #0xfffffff5, %d0 11 | trap #15 12 | move.l %sp@+, %d4 13 | rts 14 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/textput.S: -------------------------------------------------------------------------------- 1 | | void _iocs_textput (int, int, const struct _iocs_fntbuf *); 2 | .text 3 | .even 4 | .global _iocs_textput 5 | .type _iocs_textput,@function 6 | _iocs_textput: 7 | move.l %d2, %sp@- 8 | movem.l %sp@(8),%d1/%d2/%a1 9 | moveq #0x1b, %d0 10 | trap #15 11 | move.l %sp@+, %d2 12 | rts 13 | -------------------------------------------------------------------------------- /src/libx68k/libdos/fnckeyst.S: -------------------------------------------------------------------------------- 1 | | void _dos_fnckeyst (int, const char *); 2 | .text 3 | .even 4 | .global _dos_fnckeyst 5 | .type _dos_fnckeyst,@function 6 | _dos_fnckeyst: 7 | move.l %sp@(8), %sp@- 8 | move.w %sp@(10), %d0 9 | or.w #0x100, %d0 10 | move.w %d0, %sp@- 11 | .short 0xff21 12 | addq.l #6, %sp 13 | rts 14 | -------------------------------------------------------------------------------- /src/libx68k/libdos/intvcs.S: -------------------------------------------------------------------------------- 1 | | void *_dos_intvcs (int, void *); 2 | .text 3 | .even 4 | .global _dos_intvcs 5 | .type _dos_intvcs,@function 6 | _dos_intvcs: 7 | move.l %sp@(8), %sp@- 8 | move.w %sp@(10), %sp@- 9 | .short 0xff25 10 | addq.l #6, %sp 11 | #ifdef __SVR4_ABI__ 12 | movea.l %d0, %a0 13 | #endif 14 | rts 15 | -------------------------------------------------------------------------------- /src/libx68k/libdos/malloc2.S: -------------------------------------------------------------------------------- 1 | | void *_dos_malloc2 (int, int); 2 | .text 3 | .even 4 | .global _dos_malloc2 5 | .type _dos_malloc2,@function 6 | _dos_malloc2: 7 | move.l %sp@(8), %sp@- 8 | move.w %sp@(10), %sp@- 9 | .short 0xff88 10 | addq.l #6, %sp 11 | #ifdef __SVR4_ABI__ 12 | movea.l %d0, %a0 13 | #endif 14 | rts 15 | -------------------------------------------------------------------------------- /src/libx68k/libdos/s_process.S: -------------------------------------------------------------------------------- 1 | | int _dos_s_process (int, int, int, int); 2 | .text 3 | .even 4 | .global _dos_s_process 5 | .type _dos_s_process,@function 6 | _dos_s_process: 7 | movem.l %sp@(4), %d0-%d1/%a0-%a1 8 | movem.l %d1/%a0-%a1, %sp@- 9 | move.w %d0, %sp@- 10 | .short 0xffaf 11 | lea %sp@(14), %sp 12 | rts 13 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/adpcminp.S: -------------------------------------------------------------------------------- 1 | | void _iocs_adpcminp (void *, int, int); 2 | .text 3 | .even 4 | .global _iocs_adpcminp 5 | .type _iocs_adpcminp,@function 6 | _iocs_adpcminp: 7 | move.l %d2, %sp@- 8 | movem.l %sp@(8), %d0-%d2 9 | move.l %d0, %a1 10 | moveq #0x61, %d0 11 | trap #15 12 | move.l %sp@+, %d2 13 | rts 14 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_curdef.S: -------------------------------------------------------------------------------- 1 | | void _iocs_b_curdef (void *); /*1.3/iocs.x*/ 2 | .text 3 | .even 4 | .global _iocs_b_curdef 5 | .type _iocs_b_curdef,@function 6 | _iocs_b_curdef: 7 | move.l %d2, %sp@- 8 | move.l %sp@(8), %d2 9 | moveq #3, %d1 10 | moveq #0xffffffad, %d0 11 | trap #15 12 | move.l %sp@+, %d2 13 | rts 14 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_curpat1.S: -------------------------------------------------------------------------------- 1 | | void _iocs_b_curpat1 (void); /*1.3/iocs.x*/ 2 | .text 3 | .even 4 | .global _iocs_b_curpat1 5 | .type _iocs_b_curpat1,@function 6 | _iocs_b_curpat1: 7 | move.l %d2, %sp@- 8 | moveq #2, %d1 9 | moveq #0, %d2 10 | moveq #0xffffffad, %d0 11 | trap #15 12 | move.l %sp@+, %d2 13 | rts 14 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/s_dataout.S: -------------------------------------------------------------------------------- 1 | | int _iocs_s_dataout (int, void *); 2 | .text 3 | .even 4 | .global _iocs_s_dataout 5 | .type _iocs_s_dataout,@function 6 | _iocs_s_dataout: 7 | move.l %d3, %sp@- 8 | movem.l %sp@(8),%d3/%a1 9 | moveq #5, %d1 10 | moveq #0xfffffff5, %d0 11 | trap #15 12 | move.l %sp@+, %d3 13 | rts 14 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/window.S: -------------------------------------------------------------------------------- 1 | | int _iocs_window (int, int, int, int); 2 | .text 3 | .even 4 | .global _iocs_window 5 | .type _iocs_window,@function 6 | _iocs_window: 7 | movem.l %d2/%d3/%d4, %sp@- 8 | movem.l %sp@(16),%d1/%d2/%d3/%d4 9 | moveq #0xffffffb4, %d0 10 | trap #15 11 | movem.l %sp@+,%d2/%d3/%d4 12 | rts 13 | -------------------------------------------------------------------------------- /src/libx68k/readlink.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Stub version of readlink. 3 | */ 4 | 5 | #include "config.h" 6 | #include <_ansi.h> 7 | #include 8 | #include 9 | 10 | int 11 | readlink (const char *path, 12 | char *buf, 13 | size_t bufsize) 14 | { 15 | errno = ENOSYS; 16 | return -1; 17 | } 18 | -------------------------------------------------------------------------------- /src/libx68k/libdos/get_fcb_adr.S: -------------------------------------------------------------------------------- 1 | | union _dos_fcb *_dos_get_fcb_adr (unsigned int); 2 | .text 3 | .even 4 | .global _dos_get_fcb_adr 5 | .type _dos_get_fcb_adr,@function 6 | _dos_get_fcb_adr: 7 | move.w %sp@(6), %sp@- 8 | .short 0xffac 9 | addq.l #2, %sp 10 | #ifdef __SVR4_ABI__ 11 | movea.l %d0, %a0 12 | #endif 13 | rts 14 | -------------------------------------------------------------------------------- /src/libx68k/libdos/ioctrlrd.S: -------------------------------------------------------------------------------- 1 | | int _dos_ioctrlrd (int, char *, int); 2 | .text 3 | .even 4 | .global _dos_ioctrlrd 5 | .type _dos_ioctrlrd,@function 6 | _dos_ioctrlrd: 7 | move.l %sp@(12), %sp@- 8 | move.l %sp@(12), %sp@- 9 | move.w %sp@(14), %sp@- 10 | move.w #4, %sp@- 11 | .short 0xff44 12 | lea %sp@(12), %sp 13 | rts 14 | -------------------------------------------------------------------------------- /src/libx68k/libdos/ioctrlrh.S: -------------------------------------------------------------------------------- 1 | | int _dos_ioctrlrh (int, char *, int); 2 | .text 3 | .even 4 | .global _dos_ioctrlrh 5 | .type _dos_ioctrlrh,@function 6 | _dos_ioctrlrh: 7 | move.l %sp@(12), %sp@- 8 | move.l %sp@(12), %sp@- 9 | move.w %sp@(14), %sp@- 10 | move.w #2, %sp@- 11 | .short 0xff44 12 | lea %sp@(12), %sp 13 | rts 14 | -------------------------------------------------------------------------------- /src/libx68k/libdos/s_malloc.S: -------------------------------------------------------------------------------- 1 | | void *_dos_s_malloc (int, int); 2 | .text 3 | .even 4 | .global _dos_s_malloc 5 | .type _dos_s_malloc,@function 6 | _dos_s_malloc: 7 | move.l %sp@(8), %sp@- 8 | move.w %sp@(10), %sp@- 9 | .short 0xffad 10 | addq.l #6, %sp 11 | #ifdef __SVR4_ABI__ 12 | movea.l %d0, %a0 13 | #endif 14 | rts 15 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/adpcmout.S: -------------------------------------------------------------------------------- 1 | | void _iocs_adpcmout (const void *, int, int); 2 | .text 3 | .even 4 | .global _iocs_adpcmout 5 | .type _iocs_adpcmout,@function 6 | _iocs_adpcmout: 7 | move.l %d2, %sp@- 8 | movem.l %sp@(8), %d0-%d2 9 | move.l %d0, %a1 10 | moveq #0x60, %d0 11 | trap #15 12 | move.l %sp@+, %d2 13 | rts 14 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_dskini.S: -------------------------------------------------------------------------------- 1 | | int _iocs_b_dskini (int, const void *, int); 2 | .text 3 | .even 4 | .global _iocs_b_dskini 5 | .type _iocs_b_dskini,@function 6 | _iocs_b_dskini: 7 | move.l %d2, %sp@- 8 | movem.l %sp@(8), %d1-%d2/%a1 9 | exg %d2, %a1 10 | moveq #0x43, %d0 11 | trap #15 12 | move.l %sp@+, %d2 13 | rts 14 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_super.S: -------------------------------------------------------------------------------- 1 | | int _iocs_b_super (int); 2 | .text 3 | .even 4 | .global _iocs_b_super 5 | .type _iocs_b_super,@function 6 | _iocs_b_super: 7 | movea.l %sp@+, %a0 8 | move.l %sp@, %d0 9 | beq 1f 10 | move.l %sp, %usp 11 | 1: 12 | movea.l %d0, %a1 13 | moveq #0xffffff81, %d0 14 | trap #15 15 | jmp %a0@ 16 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/s_rezerounit.S: -------------------------------------------------------------------------------- 1 | | int _iocs_s_rezerounit (int); 2 | .text 3 | .even 4 | .global _iocs_s_rezerounit 5 | .type _iocs_s_rezerounit,@function 6 | _iocs_s_rezerounit: 7 | move.l %d4, %sp@- 8 | move.l %sp@(8), %d4 9 | moveq #43, %d1 10 | moveq #0xfffffff5, %d0 11 | trap #15 12 | move.l %sp@+, %d4 13 | rts 14 | -------------------------------------------------------------------------------- /src/x68knodos.specs: -------------------------------------------------------------------------------- 1 | *linker: 2 | ld.x 3 | 4 | *link: 5 | -z max-page-size=2 -T x68k.ld 6 | 7 | *startfile: 8 | x68kcrt0nodos.o%s crtbegin.o%s 9 | 10 | *endfile: 11 | crtend.o%s 12 | 13 | *x68k_libgloss: 14 | -lx68knodos -lx68kiocs 15 | 16 | *link_gcc_c_sequence: 17 | --start-group %G %L %(x68k_libgloss) --end-group -lnosys 18 | -------------------------------------------------------------------------------- /src/libx68k/libdos/common_lk.S: -------------------------------------------------------------------------------- 1 | | int _dos_common_lk (const char *, int, int, int); 2 | .text 3 | .even 4 | .global _dos_common_lk 5 | .type _dos_common_lk,@function 6 | _dos_common_lk: 7 | movem.l %sp@(4), %d0-%d1/%a0-%a1 8 | movem.l %d0-%d1/%a0-%a1, %sp@- 9 | move.w #3, %sp@- 10 | .short 0xff85 11 | lea %sp@(18), %sp 12 | rts 13 | -------------------------------------------------------------------------------- /src/libx68k/libdos/execonly.S: -------------------------------------------------------------------------------- 1 | | int _dos_execonly (void *); 2 | .text 3 | .even 4 | .global _dos_execonly 5 | .type _dos_execonly,@function 6 | _dos_execonly: 7 | movem.l %d2-%d7/%a2-%a6, %sp@- 8 | move.l %sp@(48), %sp@- 9 | move.w #4, %sp@- 10 | .short 0xff4b 11 | addq.l #6, %sp 12 | movem.l %sp@+, %d2-%d7/%a2-%a6 13 | rts 14 | -------------------------------------------------------------------------------- /src/libx68k/libdos/loadonly.S: -------------------------------------------------------------------------------- 1 | | int _dos_loadonly (const char *, const void *, const void *); 2 | .text 3 | .even 4 | .global _dos_loadonly 5 | .type _dos_loadonly,@function 6 | _dos_loadonly: 7 | movem.l %sp@(4), %d0-%d1/%a0 8 | movem.l %d0-%d1/%a0, %sp@- 9 | move.w #3, %sp@- 10 | .short 0xff4b 11 | lea %sp@(14), %sp 12 | rts 13 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/bgtextst.S: -------------------------------------------------------------------------------- 1 | | int _iocs_bgtextst (int, int, int, int); 2 | .text 3 | .even 4 | .global _iocs_bgtextst 5 | .type _iocs_bgtextst,@function 6 | _iocs_bgtextst: 7 | movem.l %d2/%d3/%d4, %sp@- 8 | movem.l %sp@(16),%d1/%d2/%d3/%d4 9 | moveq #0xffffffcd, %d0 10 | trap #15 11 | movem.l %sp@+,%d2/%d3/%d4 12 | rts 13 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/home.S: -------------------------------------------------------------------------------- 1 | | int _iocs_home (int, int, int); 2 | .text 3 | .even 4 | .global _iocs_home 5 | .type _iocs_home,@function 6 | _iocs_home: 7 | move.l %d2, %sp@- 8 | move.l %d3, %sp@- 9 | movem.l %sp@(12),%d1/%d2/%d3 10 | moveq #0xffffffb3, %d0 11 | trap #15 12 | move.l %sp@+, %d3 13 | move.l %sp@+, %d2 14 | rts 15 | -------------------------------------------------------------------------------- /src/libx68k/libdos/common_fre.S: -------------------------------------------------------------------------------- 1 | | int _dos_common_fre (const char *, int, int, int); 2 | .text 3 | .even 4 | .global _dos_common_fre 5 | .type _dos_common_fre,@function 6 | _dos_common_fre: 7 | movem.l %sp@(4), %d0-%d1/%a0-%a1 8 | movem.l %d0-%d1/%a0-%a1, %sp@- 9 | move.w #4, %sp@- 10 | .short 0xff85 11 | lea %sp@(18), %sp 12 | rts 13 | -------------------------------------------------------------------------------- /src/libx68k/libdos/common_rd.S: -------------------------------------------------------------------------------- 1 | | int _dos_common_rd (const char *, int, char *, int); 2 | .text 3 | .even 4 | .global _dos_common_rd 5 | .type _dos_common_rd,@function 6 | _dos_common_rd: 7 | movem.l %sp@(4), %d0-%d1/%a0-%a1 8 | movem.l %d0-%d1/%a0-%a1, %sp@- 9 | move.w #1, %sp@- 10 | .short 0xff85 11 | lea %sp@(18), %sp 12 | rts 13 | -------------------------------------------------------------------------------- /src/libx68k/libdos/diskred.S: -------------------------------------------------------------------------------- 1 | | void _dos_diskred (void *, int, int, int); 2 | .text 3 | .even 4 | .global _dos_diskred 5 | .type _dos_diskred,@function 6 | _dos_diskred: 7 | move.w %sp@(18), %sp@- 8 | move.w %sp@(16), %sp@- 9 | move.w %sp@(14), %sp@- 10 | move.l %sp@(10), %sp@- 11 | .short 0xfff3 12 | lea %sp@(10), %sp 13 | rts 14 | -------------------------------------------------------------------------------- /src/libx68k/libdos/ioctrlwd.S: -------------------------------------------------------------------------------- 1 | | int _dos_ioctrlwd (int, const char *, int); 2 | .text 3 | .even 4 | .global _dos_ioctrlwd 5 | .type _dos_ioctrlwd,@function 6 | _dos_ioctrlwd: 7 | move.l %sp@(12), %sp@- 8 | move.l %sp@(12), %sp@- 9 | move.w %sp@(14), %sp@- 10 | move.w #5, %sp@- 11 | .short 0xff44 12 | lea %sp@(12), %sp 13 | rts 14 | -------------------------------------------------------------------------------- /src/libx68k/libdos/ioctrlwh.S: -------------------------------------------------------------------------------- 1 | | int _dos_ioctrlwh (int, const char *, int); 2 | .text 3 | .even 4 | .global _dos_ioctrlwh 5 | .type _dos_ioctrlwh,@function 6 | _dos_ioctrlwh: 7 | move.l %sp@(12), %sp@- 8 | move.l %sp@(12), %sp@- 9 | move.w %sp@(14), %sp@- 10 | move.w #3, %sp@- 11 | .short 0xff44 12 | lea %sp@(12), %sp 13 | rts 14 | -------------------------------------------------------------------------------- /src/libx68k/libdos/os_patch.S: -------------------------------------------------------------------------------- 1 | | void *_dos_os_patch (unsigned int, void *); 2 | .text 3 | .even 4 | .global _dos_os_patch 5 | .type _dos_os_patch,@function 6 | _dos_os_patch: 7 | move.l %sp@(8), %sp@- 8 | move.w %sp@(10), %sp@- 9 | .short 0xffab 10 | addq.l #6, %sp 11 | #ifdef __SVR4_ABI__ 12 | movea.l %d0, %a0 13 | #endif 14 | rts 15 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/s_readcap.S: -------------------------------------------------------------------------------- 1 | | int _iocs_s_readcap (int, struct _iocs_readcap *); 2 | .text 3 | .even 4 | .global _iocs_s_readcap 5 | .type _iocs_s_readcap,@function 6 | _iocs_s_readcap: 7 | move.l %d4, %sp@- 8 | movem.l %sp@(8),%d4/%a1 9 | moveq #37, %d1 10 | moveq #0xfffffff5, %d0 11 | trap #15 12 | move.l %sp@+, %d4 13 | rts 14 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/scroll.S: -------------------------------------------------------------------------------- 1 | | void _iocs_scroll (int, int, int); 2 | .text 3 | .even 4 | .global _iocs_scroll 5 | .type _iocs_scroll,@function 6 | _iocs_scroll: 7 | move.l %d2, %sp@- 8 | move.l %d3, %sp@- 9 | movem.l %sp@(12),%d1/%d2/%d3 10 | moveq #0x1d, %d0 11 | trap #15 12 | move.l %sp@+, %d3 13 | move.l %sp@+, %d2 14 | rts 15 | -------------------------------------------------------------------------------- /src/libx68k/libdos/common_wt.S: -------------------------------------------------------------------------------- 1 | | int _dos_common_wt (const char *, int, const char *, int); 2 | .text 3 | .even 4 | .global _dos_common_wt 5 | .type _dos_common_wt,@function 6 | _dos_common_wt: 7 | movem.l %sp@(4), %d0-%d1/%a0-%a1 8 | movem.l %d0-%d1/%a0-%a1, %sp@- 9 | move.w #2, %sp@- 10 | .short 0xff85 11 | lea %sp@(18), %sp 12 | rts 13 | -------------------------------------------------------------------------------- /src/libx68k/libdos/diskwrt.S: -------------------------------------------------------------------------------- 1 | | void _dos_diskwrt (const void *, int, int, int); 2 | .text 3 | .even 4 | .global _dos_diskwrt 5 | .type _dos_diskwrt,@function 6 | _dos_diskwrt: 7 | move.w %sp@(18), %sp@- 8 | move.w %sp@(16), %sp@- 9 | move.w %sp@(14), %sp@- 10 | move.l %sp@(10), %sp@- 11 | .short 0xfff4 12 | lea %sp@(10), %sp 13 | rts 14 | -------------------------------------------------------------------------------- /src/libx68k/libdos/pathchk.S: -------------------------------------------------------------------------------- 1 | | int _dos_pathchk (const char *, const struct _dos_comline *, const char *); 2 | .text 3 | .even 4 | .global _dos_pathchk 5 | .type _dos_pathchk,@function 6 | _dos_pathchk: 7 | movem.l %sp@(4), %d0-%d1/%a0 8 | movem.l %d0-%d1/%a0, %sp@- 9 | move.w #2, %sp@- 10 | .short 0xff4b 11 | lea %sp@(14), %sp 12 | rts 13 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/adpcmain.S: -------------------------------------------------------------------------------- 1 | | void _iocs_adpcmain (const struct _iocs_chain *, int, int); 2 | .text 3 | .even 4 | .global _iocs_adpcmain 5 | .type _iocs_adpcmain,@function 6 | _iocs_adpcmain: 7 | move.l %d2, %sp@- 8 | movem.l %sp@(8), %d0-%d2 9 | move.l %d0, %a1 10 | moveq #0x63, %d0 11 | trap #15 12 | move.l %sp@+, %d2 13 | rts 14 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/adpcmaot.S: -------------------------------------------------------------------------------- 1 | | void _iocs_adpcmaot (const struct _iocs_chain *, int, int); 2 | .text 3 | .even 4 | .global _iocs_adpcmaot 5 | .type _iocs_adpcmaot,@function 6 | _iocs_adpcmaot: 7 | move.l %d2, %sp@- 8 | movem.l %sp@(8), %d0-%d2 9 | move.l %d0, %a1 10 | moveq #0x62, %d0 11 | trap #15 12 | move.l %sp@+, %d2 13 | rts 14 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_memset.S: -------------------------------------------------------------------------------- 1 | | void _iocs_b_memset (void *, const void *, int); 2 | .text 3 | .even 4 | .global _iocs_b_memset 5 | .type _iocs_b_memset,@function 6 | _iocs_b_memset: 7 | move.l %a2, %sp@- 8 | movem.l %sp@(8), %a1/%a2 9 | move.l %sp@(16), %d1 10 | moveq #0xffffff89, %d0 11 | trap #15 12 | move.l %sp@+, %a2 13 | rts 14 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_memstr.S: -------------------------------------------------------------------------------- 1 | | void _iocs_b_memstr (const void *, void *, int); 2 | .text 3 | .even 4 | .global _iocs_b_memstr 5 | .type _iocs_b_memstr,@function 6 | _iocs_b_memstr: 7 | move.l %a2, %sp@- 8 | movem.l %sp@(8), %a1/%a2 9 | move.l %sp@(16), %d1 10 | moveq #0xffffff85, %d0 11 | trap #15 12 | move.l %sp@+, %a2 13 | rts 14 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/spalet.S: -------------------------------------------------------------------------------- 1 | | int _iocs_spalet (int, int, int); 2 | .text 3 | .even 4 | .global _iocs_spalet 5 | .type _iocs_spalet,@function 6 | _iocs_spalet: 7 | move.l %d2, %sp@- 8 | move.l %d3, %sp@- 9 | movem.l %sp@(12),%d1/%d2/%d3 10 | moveq #0xffffffcf, %d0 11 | trap #15 12 | move.l %sp@+, %d3 13 | move.l %sp@+, %d2 14 | rts 15 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/vdispst.S: -------------------------------------------------------------------------------- 1 | | int _iocs_vdispst (const void *, int, int); 2 | .text 3 | .even 4 | .global _iocs_vdispst 5 | .type _iocs_vdispst,@function 6 | _iocs_vdispst: 7 | movea.l %sp@(4), %a1 8 | moveq #0, %d1 9 | move.b %sp@(11), %d1 10 | lsl.w #8, %d1 11 | move.b %sp@(15), %d1 12 | moveq #0x6c, %d0 13 | trap #15 14 | rts 15 | -------------------------------------------------------------------------------- /src/libx68k/libdos/ioctrldvctl.S: -------------------------------------------------------------------------------- 1 | | int _dos_ioctrldvctl (int, int, char *); 2 | .text 3 | .even 4 | .global _dos_ioctrldvctl 5 | .type _dos_ioctrldvctl,@function 6 | _dos_ioctrldvctl: 7 | move.l %sp@(12), %sp@- 8 | move.w %sp@(14), %sp@- 9 | move.w %sp@(12), %sp@- 10 | move.w #12, %sp@- 11 | .short 0xff44 12 | lea %sp@(10), %sp 13 | rts 14 | -------------------------------------------------------------------------------- /src/libx68k/libdos/ioctrlfdctl.S: -------------------------------------------------------------------------------- 1 | | int _dos_ioctrlfdctl (int, int, char *); 2 | .text 3 | .even 4 | .global _dos_ioctrlfdctl 5 | .type _dos_ioctrlfdctl,@function 6 | _dos_ioctrlfdctl: 7 | move.l %sp@(12), %sp@- 8 | move.w %sp@(14), %sp@- 9 | move.w %sp@(12), %sp@- 10 | move.w #13, %sp@- 11 | .short 0xff44 12 | lea %sp@(10), %sp 13 | rts 14 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_badfmt.S: -------------------------------------------------------------------------------- 1 | | int _iocs_b_badfmt (int, int, int); 2 | .text 3 | .even 4 | .global _iocs_b_badfmt 5 | .type _iocs_b_badfmt,@function 6 | _iocs_b_badfmt: 7 | move.l %d2, %sp@- 8 | move.l %d3, %sp@- 9 | movem.l %sp@(12),%d1/%d2/%d3 10 | moveq #0x4b, %d0 11 | trap #15 12 | move.l %sp@+, %d3 13 | move.l %sp@+, %d2 14 | rts 15 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_read.S: -------------------------------------------------------------------------------- 1 | | int _iocs_b_read (int, int, int, void *); 2 | .text 3 | .even 4 | .global _iocs_b_read 5 | .type _iocs_b_read,@function 6 | _iocs_b_read: 7 | move.l %d2, %sp@- 8 | move.l %d3, %sp@- 9 | movem.l %sp@(12),%d1/%d2/%d3/%a1 10 | moveq #0x46, %d0 11 | trap #15 12 | move.l %sp@+, %d3 13 | move.l %sp@+, %d2 14 | rts 15 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_readid.S: -------------------------------------------------------------------------------- 1 | | int _iocs_b_readid (int, int, void *); 2 | .text 3 | .even 4 | .global _iocs_b_readid 5 | .type _iocs_b_readid,@function 6 | _iocs_b_readid: 7 | move.l %d2, %sp@- 8 | movem.l %sp@(8),%d1/%d2 9 | moveq #0x4a, %d0 10 | trap #15 11 | movea.l %sp@(16), %a0 12 | move.l %d2, %a0@ 13 | move.l %sp@+, %d2 14 | rts 15 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/timerdst.S: -------------------------------------------------------------------------------- 1 | | int _iocs_timerdst (const void *, int, int); 2 | .text 3 | .even 4 | .global _iocs_timerdst 5 | .type _iocs_timerdst,@function 6 | _iocs_timerdst: 7 | movea.l %sp@(4), %a1 8 | moveq #0, %d1 9 | move.b %sp@(11), %d1 10 | lsl.w #8, %d1 11 | move.b %sp@(15), %d1 12 | moveq #0x6b, %d0 13 | trap #15 14 | rts 15 | -------------------------------------------------------------------------------- /src/libx68k/libdos/makeassign.S: -------------------------------------------------------------------------------- 1 | | int _dos_makeassign (const char *, const char *, int); 2 | .text 3 | .even 4 | .global _dos_makeassign 5 | .type _dos_makeassign,@function 6 | _dos_makeassign: 7 | move.w %sp@(14), %sp@- 8 | move.l %sp@(10), %sp@- 9 | move.l %sp@(10), %sp@- 10 | move.w #1, %sp@- 11 | .short 0xff8f 12 | lea %sp@(12), %sp 13 | rts 14 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/bgctrlst.S: -------------------------------------------------------------------------------- 1 | | int _iocs_bgctrlst (int, int, int); 2 | .text 3 | .even 4 | .global _iocs_bgctrlst 5 | .type _iocs_bgctrlst,@function 6 | _iocs_bgctrlst: 7 | move.l %d2, %sp@- 8 | move.l %d3, %sp@- 9 | movem.l %sp@(12),%d1/%d2/%d3 10 | moveq #0xffffffca, %d0 11 | trap #15 12 | move.l %sp@+, %d3 13 | move.l %sp@+, %d2 14 | rts 15 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/bgscrlst.S: -------------------------------------------------------------------------------- 1 | | int _iocs_bgscrlst (int, int, int); 2 | .text 3 | .even 4 | .global _iocs_bgscrlst 5 | .type _iocs_bgscrlst,@function 6 | _iocs_bgscrlst: 7 | move.l %d2, %sp@- 8 | move.l %d3, %sp@- 9 | movem.l %sp@(12),%d1/%d2/%d3 10 | moveq #0xffffffc8, %d0 11 | trap #15 12 | move.l %sp@+, %d3 13 | move.l %sp@+, %d2 14 | rts 15 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/bgtextgt.S: -------------------------------------------------------------------------------- 1 | | int _iocs_bgtextgt (int, int, int); 2 | .text 3 | .even 4 | .global _iocs_bgtextgt 5 | .type _iocs_bgtextgt,@function 6 | _iocs_bgtextgt: 7 | move.l %d2, %sp@- 8 | move.l %d3, %sp@- 9 | movem.l %sp@(12),%d1/%d2/%d3 10 | moveq #0xffffffce, %d0 11 | trap #15 12 | move.l %sp@+, %d3 13 | move.l %sp@+, %d2 14 | rts 15 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/s_seek.S: -------------------------------------------------------------------------------- 1 | | int _iocs_s_seek (int, int); 2 | .text 3 | .even 4 | .global _iocs_s_seek 5 | .type _iocs_s_seek,@function 6 | _iocs_s_seek: 7 | move.l %d2, %sp@- 8 | move.l %d4, %sp@- 9 | movem.l %sp@(12),%d2/%d4 10 | moveq #45, %d1 11 | moveq #0xfffffff5, %d0 12 | trap #15 13 | move.l %sp@+, %d4 14 | move.l %sp@+, %d2 15 | rts 16 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/txrascpy.S: -------------------------------------------------------------------------------- 1 | | void _iocs_txrascpy (int, int, int); 2 | .text 3 | .even 4 | .global _iocs_txrascpy 5 | .type _iocs_txrascpy,@function 6 | _iocs_txrascpy: 7 | move.l %d2, %sp@- 8 | move.l %d3, %sp@- 9 | movem.l %sp@(12),%d1/%d2/%d3 10 | moveq #0xffffffdf, %d0 11 | trap #15 12 | move.l %sp@+, %d3 13 | move.l %sp@+, %d2 14 | rts 15 | -------------------------------------------------------------------------------- /src/libx68k/telldir.c: -------------------------------------------------------------------------------- 1 | /* 2 | * telldir() 3 | */ 4 | 5 | #include 6 | #include 7 | #include 8 | #include "fds.h" 9 | 10 | int __doserr2errno(int error); 11 | 12 | long telldir(DIR *dirp) 13 | { 14 | if (dirp->active == 0) { 15 | errno = EBADF; 16 | return -1; 17 | } 18 | return dirp->count; 19 | } 20 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_curpat.S: -------------------------------------------------------------------------------- 1 | | void _iocs_b_curpat (int); /*1.3/iocs.x*/ 2 | .text 3 | .even 4 | .global _iocs_b_curpat 5 | .type _iocs_b_curpat,@function 6 | _iocs_b_curpat: 7 | move.l %d2, %sp@- 8 | move.l %sp@(8), %d2 9 | tst.w %d2 10 | beqs 6f 11 | moveq #2, %d1 12 | moveq #0xffffffad, %d0 13 | trap #15 14 | 6: 15 | move.l %sp@+, %d2 16 | rts 17 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_readdi.S: -------------------------------------------------------------------------------- 1 | | int _iocs_b_readdi (int, int, int, void *); 2 | .text 3 | .even 4 | .global _iocs_b_readdi 5 | .type _iocs_b_readdi,@function 6 | _iocs_b_readdi: 7 | move.l %d2, %sp@- 8 | move.l %d3, %sp@- 9 | movem.l %sp@(12),%d1/%d2/%d3/%a1 10 | moveq #0x42, %d0 11 | trap #15 12 | move.l %sp@+, %d3 13 | move.l %sp@+, %d2 14 | rts 15 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_readdl.S: -------------------------------------------------------------------------------- 1 | | int _iocs_b_readdl (int, int, int, void *); 2 | .text 3 | .even 4 | .global _iocs_b_readdl 5 | .type _iocs_b_readdl,@function 6 | _iocs_b_readdl: 7 | move.l %d2, %sp@- 8 | move.l %d3, %sp@- 9 | movem.l %sp@(12),%d1/%d2/%d3/%a1 10 | moveq #0x4c, %d0 11 | trap #15 12 | move.l %sp@+, %d3 13 | move.l %sp@+, %d2 14 | rts 15 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_write.S: -------------------------------------------------------------------------------- 1 | | int _iocs_b_write (int, int, int, const void *); 2 | .text 3 | .even 4 | .global _iocs_b_write 5 | .type _iocs_b_write,@function 6 | _iocs_b_write: 7 | move.l %d2, %sp@- 8 | move.l %d3, %sp@- 9 | movem.l %sp@(12),%d1/%d2/%d3/%a1 10 | moveq #0x45, %d0 11 | trap #15 12 | move.l %sp@+, %d3 13 | move.l %sp@+, %d2 14 | rts 15 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/dmamov_l.S: -------------------------------------------------------------------------------- 1 | | void _iocs_dmamov_l (const struct _iocs_chain2 *, void *, int); 2 | .text 3 | .even 4 | .global _iocs_dmamov_l 5 | .type _iocs_dmamov_l,@function 6 | _iocs_dmamov_l: 7 | move.l %a2, %sp@- 8 | movem.l %sp@(8), %a1/%a2 9 | move.l %sp@(16), %d1 10 | moveq #0xffffff8c, %d0 11 | trap #15 12 | move.l %sp@+, %a2 13 | rts 14 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/skey_mod.S: -------------------------------------------------------------------------------- 1 | | int _iocs_skey_mod (int, int, int); 2 | .text 3 | .even 4 | .global _iocs_skey_mod 5 | .type _iocs_skey_mod,@function 6 | _iocs_skey_mod: 7 | move.l %d2, %sp@- 8 | move.l %sp@(8), %d1 9 | move.w %sp@(14), %d2 10 | swap %d2 11 | move.w %sp@(18), %d2 12 | moveq #0x7d, %d0 13 | trap #15 14 | move.l %sp@+, %d2 15 | rts 16 | -------------------------------------------------------------------------------- /src/libx68k/libpthread/pthread_condattr_init.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pthread_condattr_init() 3 | * pthread_condattr_destroy() 4 | */ 5 | 6 | #include "pthread_internal.h" 7 | 8 | int pthread_condattr_init(pthread_condattr_t *attr) 9 | { 10 | return 0; 11 | } 12 | 13 | int pthread_condattr_destroy(pthread_condattr_t *attr) 14 | { 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /src/libx68k/libdos/fatchk2.S: -------------------------------------------------------------------------------- 1 | | int _dos_fatchk2 (const char *, unsigned short *, int); 2 | .text 3 | .even 4 | .global _dos_fatchk2 5 | .type _dos_fatchk2,@function 6 | _dos_fatchk2: 7 | move.w %sp@(14), %sp@- 8 | move.l %sp@(10), %d0 9 | bset #31, %d0 10 | move.l %d0, %sp@- 11 | move.l %sp@(10), %sp@- 12 | .short 0xff17 13 | lea %sp@(10), %sp 14 | rts 15 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_assign.S: -------------------------------------------------------------------------------- 1 | | int _iocs_b_assign (int, int, int, const void *); 2 | .text 3 | .even 4 | .global _iocs_b_assign 5 | .type _iocs_b_assign,@function 6 | _iocs_b_assign: 7 | move.l %d2, %sp@- 8 | move.l %d3, %sp@- 9 | movem.l %sp@(12),%d1/%d2/%d3/%a1 10 | moveq #0x48, %d0 11 | trap #15 12 | move.l %sp@+, %d3 13 | move.l %sp@+, %d2 14 | rts 15 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_format.S: -------------------------------------------------------------------------------- 1 | | int _iocs_b_format (int, int, int, const void *); 2 | .text 3 | .even 4 | .global _iocs_b_format 5 | .type _iocs_b_format,@function 6 | _iocs_b_format: 7 | move.l %d2, %sp@- 8 | move.l %d3, %sp@- 9 | movem.l %sp@(12),%d1/%d2/%d3/%a1 10 | moveq #0x4d, %d0 11 | trap #15 12 | move.l %sp@+, %d3 13 | move.l %sp@+, %d2 14 | rts 15 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_putmes.S: -------------------------------------------------------------------------------- 1 | | int _iocs_b_putmes (int, int, int, int, const char *); 2 | .text 3 | .even 4 | .global _iocs_b_putmes 5 | .type _iocs_b_putmes,@function 6 | _iocs_b_putmes: 7 | movem.l %d2/%d3/%d4, %sp@- 8 | movem.l %sp@(16),%d1/%d2/%d3/%d4/%a1 9 | moveq #0x2f, %d0 10 | trap #15 11 | move.l %d2, %d0 12 | movem.l %sp@+,%d2/%d3/%d4 13 | rts 14 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_verify.S: -------------------------------------------------------------------------------- 1 | | int _iocs_b_verify (int, int, int, const void *); 2 | .text 3 | .even 4 | .global _iocs_b_verify 5 | .type _iocs_b_verify,@function 6 | _iocs_b_verify: 7 | move.l %d2, %sp@- 8 | move.l %d3, %sp@- 9 | movem.l %sp@(12),%d1/%d2/%d3/%a1 10 | moveq #0x41, %d0 11 | trap #15 12 | move.l %sp@+, %d3 13 | move.l %sp@+, %d2 14 | rts 15 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_writed.S: -------------------------------------------------------------------------------- 1 | | int _iocs_b_writed (int, int, int, const void *); 2 | .text 3 | .even 4 | .global _iocs_b_writed 5 | .type _iocs_b_writed,@function 6 | _iocs_b_writed: 7 | move.l %d2, %sp@- 8 | move.l %d3, %sp@- 9 | movem.l %sp@(12),%d1/%d2/%d3/%a1 10 | moveq #0x49, %d0 11 | trap #15 12 | move.l %sp@+, %d3 13 | move.l %sp@+, %d2 14 | rts 15 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/s_format.S: -------------------------------------------------------------------------------- 1 | | int _iocs_s_format (int, int); 2 | .text 3 | .even 4 | .global _iocs_s_format 5 | .type _iocs_s_format,@function 6 | _iocs_s_format: 7 | move.l %d3, %sp@- 8 | move.l %d4, %sp@- 9 | movem.l %sp@(12),%d3/%d4 10 | moveq #35, %d1 11 | moveq #0xfffffff5, %d0 12 | trap #15 13 | move.l %sp@+, %d4 14 | move.l %sp@+, %d3 15 | rts 16 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/s_read.S: -------------------------------------------------------------------------------- 1 | | int _iocs_s_read (int, int, int, int, void *); 2 | .text 3 | .even 4 | .global _iocs_s_read 5 | .type _iocs_s_read,@function 6 | _iocs_s_read: 7 | movem.l %d2/%d3/%d4/%d5, %sp@- 8 | movem.l %sp@(20),%d2/%d3/%d4/%d5/%a1 9 | moveq #33, %d1 10 | moveq #0xfffffff5, %d0 11 | trap #15 12 | movem.l %sp@+,%d2/%d3/%d4/%d5 13 | rts 14 | -------------------------------------------------------------------------------- /src/features.h: -------------------------------------------------------------------------------- 1 | #include_next 2 | 3 | #ifndef _POSIX_THREADS 4 | #define _POSIX_THREADS 1 5 | #endif 6 | #ifndef _POSIX_BARRIERS 7 | #define _POSIX_BARRIERS 1 8 | #endif 9 | #ifndef _POSIX_SPIN_LOCKS 10 | #define _POSIX_SPIN_LOCKS 1 11 | #endif 12 | #ifndef _POSIX_READER_WRITER_LOCKS 13 | #define _POSIX_READER_WRITER_LOCKS 1 14 | #endif 15 | -------------------------------------------------------------------------------- /src/libx68k/closedir.c: -------------------------------------------------------------------------------- 1 | /* 2 | * closedir() 3 | */ 4 | 5 | #include 6 | #include 7 | #include 8 | #include "fds.h" 9 | 10 | int __doserr2errno(int error); 11 | 12 | int closedir(DIR *dirp) 13 | { 14 | if (dirp->active == 0) { 15 | errno = EBADF; 16 | return -1; 17 | } 18 | dirp->active = 0; 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /src/libx68k/libdos/exfiles.S: -------------------------------------------------------------------------------- 1 | | int _dos_exfiles (struct _dos_exfilbuf *, const char *, int); 2 | .text 3 | .even 4 | .global _dos_exfiles 5 | .type _dos_exfiles,@function 6 | _dos_exfiles: 7 | move.w %sp@(14), %sp@- 8 | move.l %sp@(10), %sp@- 9 | move.l %sp@(10), %d0 10 | bset #31, %d0 11 | move.l %d0, %sp@- 12 | .short 0xff4e 13 | lea %sp@(10), %sp 14 | rts 15 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/s_write.S: -------------------------------------------------------------------------------- 1 | | int _iocs_s_write (int, int, int, int, void *); 2 | .text 3 | .even 4 | .global _iocs_s_write 5 | .type _iocs_s_write,@function 6 | _iocs_s_write: 7 | movem.l %d2/%d3/%d4/%d5, %sp@- 8 | movem.l %sp@(20),%d2/%d3/%d4/%d5/%a1 9 | moveq #34, %d1 10 | moveq #0xfffffff5, %d0 11 | trap #15 12 | movem.l %sp@+,%d2/%d3/%d4/%d5 13 | rts 14 | -------------------------------------------------------------------------------- /src/libx68k/libpthread/pthread_rwlockattr_init.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pthread_rwlockattr_init() 3 | * pthread_rwlockattr_destroy() 4 | */ 5 | 6 | #include "pthread_internal.h" 7 | 8 | int pthread_rwlockattr_init(pthread_rwlockattr_t *attr) 9 | { 10 | return 0; 11 | } 12 | 13 | int pthread_rwlockattr_destroy(pthread_rwlockattr_t *attr) 14 | { 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /src/libx68k/libdos/send_pr.S: -------------------------------------------------------------------------------- 1 | | int _dos_send_pr (int, int, int, char *, long); 2 | .text 3 | .even 4 | .global _dos_send_pr 5 | .type _dos_send_pr,@function 6 | _dos_send_pr: 7 | move.l %sp@(20), %sp@- 8 | move.l %sp@(20), %sp@- 9 | move.w %sp@(22), %sp@- 10 | move.w %sp@(20), %sp@- 11 | move.w %sp@(18), %sp@- 12 | .short 0xfffd 13 | lea %sp@(14), %sp 14 | rts 15 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/s_pamedium.S: -------------------------------------------------------------------------------- 1 | | int _iocs_s_pamedium (int, int); 2 | .text 3 | .even 4 | .global _iocs_s_pamedium 5 | .type _iocs_s_pamedium,@function 6 | _iocs_s_pamedium: 7 | move.l %d3, %sp@- 8 | move.l %d4, %sp@- 9 | movem.l %sp@(12),%d3/%d4 10 | moveq #50, %d1 11 | moveq #0xfffffff5, %d0 12 | trap #15 13 | move.l %sp@+, %d4 14 | move.l %sp@+, %d3 15 | rts 16 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/s_readext.S: -------------------------------------------------------------------------------- 1 | | int _iocs_s_readext (int, int, int, int, void *); 2 | .text 3 | .even 4 | .global _iocs_s_readext 5 | .type _iocs_s_readext,@function 6 | _iocs_s_readext: 7 | movem.l %d2/%d3/%d4/%d5, %sp@- 8 | movem.l %sp@(20),%d2/%d3/%d4/%d5/%a1 9 | moveq #38, %d1 10 | moveq #0xfffffff5, %d0 11 | trap #15 12 | movem.l %sp@+,%d2/%d3/%d4/%d5 13 | rts 14 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/s_startstop.S: -------------------------------------------------------------------------------- 1 | | int _iocs_s_startstop (int, int); 2 | .text 3 | .even 4 | .global _iocs_s_startstop 5 | .type _iocs_s_startstop,@function 6 | _iocs_s_startstop: 7 | move.l %d3, %sp@- 8 | move.l %d4, %sp@- 9 | movem.l %sp@(12),%d3/%d4 10 | moveq #47, %d1 11 | moveq #0xfffffff5, %d0 12 | trap #15 13 | move.l %sp@+, %d4 14 | move.l %sp@+, %d3 15 | rts 16 | -------------------------------------------------------------------------------- /src/libx68k/libpthread/pthread_barrierattr_init.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pthread_barrierattr_init() 3 | * pthread_barrierattr_destroy() 4 | */ 5 | 6 | #include "pthread_internal.h" 7 | 8 | int pthread_barrierattr_init(pthread_barrierattr_t *attr) 9 | { 10 | return 0; 11 | } 12 | 13 | int pthread_barrierattr_destroy(pthread_barrierattr_t *attr) 14 | { 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /src/libx68k/_crt0vars.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Variables used by crt0 3 | */ 4 | | 5 | .comm _MCB, 4 6 | // .comm _PSP, 4 7 | 8 | .comm _PSTA, 4 9 | .comm _PEND, 4 10 | .comm _BSTA, 4 11 | .comm _BEND, 4 12 | .comm _SSTA, 4 13 | .comm _SEND, 4 14 | // .comm _HSTA, 4 15 | // .comm _HEND, 4 16 | .comm _HMAX, 4 17 | 18 | .comm _ENV0, 4 19 | 20 | .comm _cmdline, 4 21 | -------------------------------------------------------------------------------- /src/libx68k/libdos/diskred2.S: -------------------------------------------------------------------------------- 1 | | void _dos_diskred2 (void *, int, int, int); 2 | .text 3 | .even 4 | .global _dos_diskred2 5 | .type _dos_diskred2,@function 6 | _dos_diskred2: 7 | move.l %sp@(16), %sp@- 8 | move.l %sp@(16), %sp@- 9 | move.w %sp@(18), %sp@- 10 | move.l %sp@(14), %d0 11 | bset #31, %d0 12 | move.l %d0, %sp@- 13 | .short 0xfff3 14 | lea %sp@(14), %sp 15 | rts 16 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/s_request.S: -------------------------------------------------------------------------------- 1 | | int _iocs_s_request (int, int, void *); 2 | .text 3 | .even 4 | .global _iocs_s_request 5 | .type _iocs_s_request,@function 6 | _iocs_s_request: 7 | move.l %d3, %sp@- 8 | move.l %d4, %sp@- 9 | movem.l %sp@(12),%d3/%d4/%a1 10 | moveq #44, %d1 11 | moveq #0xfffffff5, %d0 12 | trap #15 13 | move.l %sp@+, %d4 14 | move.l %sp@+, %d3 15 | rts 16 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/s_writeext.S: -------------------------------------------------------------------------------- 1 | | int _iocs_s_writeext (int, int, int, int, void *); 2 | .text 3 | .even 4 | .global _iocs_s_writeext 5 | .type _iocs_s_writeext,@function 6 | _iocs_s_writeext: 7 | movem.l %d2/%d3/%d4/%d5, %sp@- 8 | movem.l %sp@(20),%d2/%d3/%d4/%d5/%a1 9 | moveq #39, %d1 10 | moveq #0xfffffff5, %d0 11 | trap #15 12 | movem.l %sp@+,%d2/%d3/%d4/%d5 13 | rts 14 | -------------------------------------------------------------------------------- /src/libx68k/_at_exit.h: -------------------------------------------------------------------------------- 1 | #ifndef __AT_EXIT_H_ 2 | #define __AT_EXIT_H_ 3 | 4 | #define AT_EXIT_MAX 4 5 | 6 | #define AT_EXIT_TYPE_EXITVC 0xfff0 7 | #define AT_EXIT_TYPE_CTRLVC 0xfff1 8 | #define AT_EXIT_TYPE_ERRJVC 0xfff2 9 | 10 | int __at_exit(void (*func)(int)); 11 | void __at_exit_call(int); 12 | void __at_exit_init(void); 13 | 14 | #endif /* __AT_EXIT_H_ */ 15 | -------------------------------------------------------------------------------- /src/libx68k/libdos/diskwrt2.S: -------------------------------------------------------------------------------- 1 | | void _dos_diskwrt2 (const void *, int, int, int); 2 | .text 3 | .even 4 | .global _dos_diskwrt2 5 | .type _dos_diskwrt2,@function 6 | _dos_diskwrt2: 7 | move.l %sp@(16), %sp@- 8 | move.l %sp@(16), %sp@- 9 | move.w %sp@(18), %sp@- 10 | move.l %sp@(14), %d0 11 | bset #31, %d0 12 | move.l %d0, %sp@- 13 | .short 0xfff4 14 | lea %sp@(14), %sp 15 | rts 16 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/hsvtorgb.S: -------------------------------------------------------------------------------- 1 | | int __pure _iocs_hsvtorgb (int, int, int) __attribute__((const)); 2 | .text 3 | .even 4 | .global _iocs_hsvtorgb 5 | .type _iocs_hsvtorgb,@function 6 | _iocs_hsvtorgb: 7 | move.b %sp@(7), %d1 8 | swap %d1 9 | move.b %sp@(11), %d1 10 | lsl.w #8, %d1 11 | move.b %sp@(15), %d1 12 | and.l #0x00ff1f1f, %d1 13 | moveq #0x12, %d0 14 | trap #15 15 | rts 16 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/s_reassign.S: -------------------------------------------------------------------------------- 1 | | int _iocs_s_reassign (int, int, void *); 2 | .text 3 | .even 4 | .global _iocs_s_reassign 5 | .type _iocs_s_reassign,@function 6 | _iocs_s_reassign: 7 | move.l %d3, %sp@- 8 | move.l %d4, %sp@- 9 | movem.l %sp@(12),%d3/%d4/%a1 10 | moveq #49, %d1 11 | moveq #0xfffffff5, %d0 12 | trap #15 13 | move.l %sp@+, %d4 14 | move.l %sp@+, %d3 15 | rts 16 | -------------------------------------------------------------------------------- /src/libx68k/libdos/bindno.S: -------------------------------------------------------------------------------- 1 | | int _dos_bindno (const char *, const char *); 2 | .text 3 | .even 4 | .global _dos_bindno 5 | .type _dos_bindno,@function 6 | _dos_bindno: 7 | movem.l %d2-%d7/%a2-%a6, %sp@- 8 | clr.l %sp@- 9 | move.l %sp@(56), %sp@- 10 | move.l %sp@(56), %sp@- 11 | move.w #5, %sp@- 12 | .short 0xff4b 13 | lea %sp@(14), %sp 14 | movem.l %sp@+, %d2-%d7/%a2-%a6 15 | rts 16 | -------------------------------------------------------------------------------- /src/libx68k/libpthread/pthread_attr_setdetachstate.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pthread_attr_setdetachstate() 3 | */ 4 | 5 | #include "pthread_internal.h" 6 | 7 | int pthread_attr_setdetachstate(pthread_attr_t *attr, int detachstate) 8 | { 9 | if (!attr || !attr->is_initialized) { 10 | return EINVAL; 11 | } 12 | 13 | attr->detachstate = detachstate; 14 | 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /src/libx68k/libpthread/pthread_cond_destroy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pthread_cond_destroy() 3 | */ 4 | 5 | #include "pthread_internal.h" 6 | 7 | int pthread_cond_destroy(pthread_cond_t *cond) 8 | { 9 | if (!cond->is_initialized) { 10 | return EINVAL; 11 | } 12 | if (cond->waiting) { 13 | return EBUSY; 14 | } 15 | cond->is_initialized = 0; 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/alarmget.S: -------------------------------------------------------------------------------- 1 | | int _iocs_alarmget (int *, int *, int *); 2 | .text 3 | .even 4 | .global _iocs_alarmget 5 | .type _iocs_alarmget,@function 6 | _iocs_alarmget: 7 | move.l %d2, %sp@- 8 | moveq #0x5f, %d0 9 | trap #15 10 | movem.l %sp@(8), %a0/%a1 11 | move.l %d1, %a0@ 12 | move.l %d2, %a1@ 13 | movea.l %sp@(16), %a0 14 | move.l %d0, %a0@ 15 | move.l %sp@+, %d2 16 | rts 17 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/clipput.S: -------------------------------------------------------------------------------- 1 | | void _iocs_clipput (int, int, const struct _iocs_fntbuf *, const struct _iocs_clipxy *); 2 | .text 3 | .even 4 | .global _iocs_clipput 5 | .type _iocs_clipput,@function 6 | _iocs_clipput: 7 | move.l %d2, %sp@- 8 | move.l %a2, %sp@- 9 | movem.l %sp@(12),%d1/%d2/%a1/%a2 10 | moveq #0x1c, %d0 11 | trap #15 12 | move.l %sp@+, %a2 13 | move.l %sp@+, %d2 14 | rts 15 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/s_inquiry.S: -------------------------------------------------------------------------------- 1 | | int _iocs_s_inquiry (int, int, struct _iocs_inquiry *); 2 | .text 3 | .even 4 | .global _iocs_s_inquiry 5 | .type _iocs_s_inquiry,@function 6 | _iocs_s_inquiry: 7 | move.l %d3, %sp@- 8 | move.l %d4, %sp@- 9 | movem.l %sp@(12),%d3/%d4/%a1 10 | moveq #32, %d1 11 | moveq #0xfffffff5, %d0 12 | trap #15 13 | move.l %sp@+, %d4 14 | move.l %sp@+, %d3 15 | rts 16 | -------------------------------------------------------------------------------- /src/libx68k/libpthread/pthread_mutex_destroy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pthread_mutex_destroy() 3 | */ 4 | 5 | #include "pthread_internal.h" 6 | 7 | int pthread_mutex_destroy(pthread_mutex_t *mutex) 8 | { 9 | if (!mutex->is_initialized) { 10 | return EINVAL; 11 | } 12 | if (mutex->mutex) { 13 | return EBUSY; 14 | } 15 | mutex->is_initialized = 0; 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /src/libx68k/rmdir.c: -------------------------------------------------------------------------------- 1 | /* 2 | * rmdir() 3 | */ 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | int __doserr2errno(int error); 10 | 11 | int rmdir (const char *pathname) 12 | { 13 | int res; 14 | 15 | res = _dos_rmdir(pathname); 16 | 17 | if (res < 0) { 18 | errno = __doserr2errno(-res); 19 | res = -1; 20 | } 21 | 22 | return res; 23 | } 24 | -------------------------------------------------------------------------------- /src/libx68k/libdos/exec2.S: -------------------------------------------------------------------------------- 1 | | int _dos_exec2 (int, const char *, const char *, const char *); 2 | .text 3 | .even 4 | .global _dos_exec2 5 | .type _dos_exec2,@function 6 | _dos_exec2: 7 | movem.l %d2-%d7/%a2-%a6, %sp@- 8 | movem.l %sp@(48), %d0-%d1/%a0-%a1 9 | movem.l %d1/%a0-%a1, %sp@- 10 | move.w %d0, %sp@- 11 | .short 0xff4b 12 | lea %sp@(14), %sp 13 | movem.l %sp@+, %d2-%d7/%a2-%a6 14 | rts 15 | -------------------------------------------------------------------------------- /src/libx68k/libdos/load.S: -------------------------------------------------------------------------------- 1 | | int _dos_load (const char *, const struct _dos_comline *, const char *); 2 | .text 3 | .even 4 | .global _dos_load 5 | .type _dos_load,@function 6 | _dos_load: 7 | movem.l %d2-%d7/%a2-%a6, %sp@- 8 | movem.l %sp@(48), %d0-%d1/%a0 9 | movem.l %d0-%d1/%a0, %sp@- 10 | move.w #1, %sp@- 11 | .short 0xff4b 12 | lea %sp@(14), %sp 13 | movem.l %sp@+, %d2-%d7/%a2-%a6 14 | rts 15 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_scroll.S: -------------------------------------------------------------------------------- 1 | | void _iocs_b_scroll (int); /*1.3/iocs.x*/ 2 | .text 3 | .even 4 | .global _iocs_b_scroll 5 | .type _iocs_b_scroll,@function 6 | _iocs_b_scroll: 7 | move.l %d2, %sp@- 8 | move.l %sp@(8), %d2 9 | moveq #16, %d1 10 | cmp.l %d1, %d2 11 | bcss lscriocs 12 | move.l %d2, %d1 13 | lscriocs: 14 | moveq #0xffffffad, %d0 15 | trap #15 16 | move.l %sp@+, %d2 17 | rts 18 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/dmamove.S: -------------------------------------------------------------------------------- 1 | | void _iocs_dmamove (void *, void *, int, int); 2 | .text 3 | .even 4 | .global _iocs_dmamove 5 | .type _iocs_dmamove,@function 6 | _iocs_dmamove: 7 | move.l %d2, %sp@- 8 | move.l %a2, %sp@- 9 | movem.l %sp@(12), %d1-%d2/%a1-%a2 10 | exg %d1, %a1 11 | exg %d2, %a2 12 | moveq #0xffffff8a, %d0 13 | trap #15 14 | move.l %sp@+, %a2 15 | move.l %sp@+, %d2 16 | rts 17 | -------------------------------------------------------------------------------- /src/libx68k/libpthread/pthread_rwlock_destroy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pthread_rwlock_destroy() 3 | */ 4 | 5 | #include "pthread_internal.h" 6 | 7 | int pthread_rwlock_destroy(pthread_rwlock_t *lock) 8 | { 9 | if (!lock->is_initialized) { 10 | return EINVAL; 11 | } 12 | if (lock->count != 0) { 13 | return EBUSY; 14 | } 15 | lock->is_initialized = 0; 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /src/libx68k/unlink.c: -------------------------------------------------------------------------------- 1 | /* 2 | * unlink() 3 | */ 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | int __doserr2errno(int error); 10 | 11 | int unlink (const char *pathname) 12 | { 13 | int res; 14 | 15 | res = _dos_delete(pathname); 16 | 17 | if (res < 0) { 18 | errno = __doserr2errno(-res); 19 | res = -1; 20 | } 21 | 22 | return res; 23 | } 24 | -------------------------------------------------------------------------------- /src/libx68k/libdos/malloc0.S: -------------------------------------------------------------------------------- 1 | | void *_dos_malloc0 (int, int, int); 2 | .text 3 | .even 4 | .global _dos_malloc0 5 | .type _dos_malloc0,@function 6 | _dos_malloc0: 7 | move.l %sp@(12), %sp@- 8 | move.l %sp@(12), %sp@- 9 | move.w %sp@(14), %d0 10 | or.w #0x8000, %d0 11 | move.w %d0, %sp@- 12 | .short 0xff88 13 | lea %sp@(10), %sp 14 | #ifdef __SVR4_ABI__ 15 | movea.l %d0, %a0 16 | #endif 17 | rts 18 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/ms_limit.S: -------------------------------------------------------------------------------- 1 | | int _iocs_ms_limit (int, int, int, int); 2 | .text 3 | .even 4 | .global _iocs_ms_limit 5 | .type _iocs_ms_limit,@function 6 | _iocs_ms_limit: 7 | move.l %d2, %sp@- 8 | movem.l %sp@(8), %d1-%d2 9 | swap %d1 10 | move.w %d2, %d1 11 | move.w %sp@(18), %d2 12 | swap %d2 13 | move.w %sp@(22), %d2 14 | moveq #0x77, %d0 15 | trap #15 16 | move.l %sp@+, %d2 17 | rts 18 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/sp_regst.S: -------------------------------------------------------------------------------- 1 | | int _iocs_sp_regst (int, int, int, int, int, int); 2 | .text 3 | .even 4 | .global _iocs_sp_regst 5 | .type _iocs_sp_regst,@function 6 | _iocs_sp_regst: 7 | movem.l %d2/%d3/%d4/%d5, %sp@- 8 | movem.l %sp@(20),%d0/%d1/%d2/%d3/%d4/%d5 9 | and.l #0x80000000, %d1 10 | move.b %d0, %d1 11 | moveq #0xffffffc6, %d0 12 | trap #15 13 | movem.l %sp@+,%d2/%d3/%d4/%d5 14 | rts 15 | -------------------------------------------------------------------------------- /src/libx68k/libdos/s_malloc0.S: -------------------------------------------------------------------------------- 1 | | void *_dos_s_malloc0 (int, int); 2 | .text 3 | .even 4 | .global _dos_s_malloc0 5 | .type _dos_s_malloc0,@function 6 | _dos_s_malloc0: 7 | move.l %sp@(12), %sp@- 8 | move.l %sp@(12), %sp@- 9 | move.w %sp@(14), %d0 10 | or.w #0x8000, %d0 11 | move.w %d0, %sp@- 12 | .short 0xffad 13 | lea %sp@(10), %sp 14 | #ifdef __SVR4_ABI__ 15 | movea.l %d0, %a0 16 | #endif 17 | rts 18 | -------------------------------------------------------------------------------- /src/libx68k/libpthread/pthread_attr_setschedparam.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pthread_attr_setschedparam() 3 | */ 4 | 5 | #include "pthread_internal.h" 6 | 7 | int pthread_attr_setschedparam(pthread_attr_t *attr, const struct sched_param *param) 8 | { 9 | if (!attr || !attr->is_initialized) { 10 | return EINVAL; 11 | } 12 | 13 | attr->priority = param->sched_priority; 14 | 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /src/libx68k/mkdir.c: -------------------------------------------------------------------------------- 1 | /* 2 | * mkdir() 3 | */ 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | int __doserr2errno(int error); 10 | 11 | int mkdir (const char *pathname, mode_t mode) 12 | { 13 | int res; 14 | 15 | res = _dos_mkdir(pathname); 16 | 17 | if (res < 0) { 18 | errno = __doserr2errno(-res); 19 | res = -1; 20 | } 21 | 22 | return res; 23 | } 24 | -------------------------------------------------------------------------------- /src/libx68k/libdos/loadexec.S: -------------------------------------------------------------------------------- 1 | | int _dos_loadexec (const char *, const struct _dos_comline *, const char *); 2 | .text 3 | .even 4 | .global _dos_loadexec 5 | .type _dos_loadexec,@function 6 | _dos_loadexec: 7 | movem.l %d2-%d7/%a2-%a6, %sp@- 8 | movem.l %sp@(48), %d0-%d1/%a0 9 | movem.l %d0-%d1/%a0, %sp@- 10 | clr.w %sp@- 11 | .short 0xff4b 12 | lea %sp@(14), %sp 13 | movem.l %sp@+, %d2-%d7/%a2-%a6 14 | rts 15 | -------------------------------------------------------------------------------- /src/libx68k/libpthread/pthread_barrier_destroy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pthread_barrier_destroy() 3 | */ 4 | 5 | #include "pthread_internal.h" 6 | 7 | int pthread_barrier_destroy(pthread_barrier_t *barrier) 8 | { 9 | if (!barrier->is_initialized) { 10 | return EINVAL; 11 | } 12 | if (barrier->waiting) { 13 | return EBUSY; 14 | } 15 | barrier->is_initialized = 0; 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/trap15.S: -------------------------------------------------------------------------------- 1 | | int _iocs_trap15 (struct iocs_regs *, struct iocs_regs *) 2 | .text 3 | .even 4 | .global _iocs_trap15 5 | .type _iocs_trap15,@function 6 | _iocs_trap15: 7 | moveml %d2-%d7/%a2-%a6,%sp@- 8 | moveal %sp@(48),%a0 | inregs 9 | moveml %a0@,%d0-%d7/%a1-%a6 10 | trap #15 11 | moveal %sp@(52),%a0 | outregs 12 | moveml %d0-%d7/%a1-%a6,%a0@ 13 | moveml %sp@+,%d2-%d7/%a2-%a6 14 | rts 15 | 16 | -------------------------------------------------------------------------------- /src/libx68k/libpthread/pthread_barrier_init.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pthread_barrier_init() 3 | */ 4 | 5 | #include "pthread_internal.h" 6 | 7 | int pthread_barrier_init(pthread_barrier_t *barrier, const pthread_barrierattr_t *attr, unsigned count) 8 | { 9 | if (count == 0) { 10 | return EINVAL; 11 | } 12 | 13 | *barrier = (pthread_barrier_t){ .is_initialized = 1, .count = count }; 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /src/libx68k/libdos/memcpy.S: -------------------------------------------------------------------------------- 1 | | int _dos_memcpy (void *, void *, int); 2 | | int _dos_bus_err (void *, void *, int); 3 | .text 4 | .even 5 | .global _dos_memcpy 6 | .type _dos_memcpy,@function 7 | _dos_memcpy: 8 | .global _dos_bus_err 9 | .type _dos_bus_err,@function 10 | _dos_bus_err: 11 | move.w %sp@(14), %sp@- 12 | move.l %sp@(10), %sp@- 13 | move.l %sp@(10), %sp@- 14 | .short 0xfff7 15 | lea %sp@(10), %sp 16 | rts 17 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/b_consol.S: -------------------------------------------------------------------------------- 1 | | int _iocs_b_consol (int, int, int, int); 2 | .text 3 | .even 4 | .global _iocs_b_consol 5 | .type _iocs_b_consol,@function 6 | _iocs_b_consol: 7 | move.l %d2, %sp@- 8 | movem.l %sp@(8), %d1-%d2 9 | swap %d1 10 | move.w %d2, %d1 11 | move.w %sp@(18), %d2 12 | swap %d2 13 | move.w %sp@(22), %d2 14 | moveq #0x2e, %d0 15 | trap #15 16 | move.l %d2, %d0 17 | move.l %sp@+, %d2 18 | rts 19 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/dmamov_a.S: -------------------------------------------------------------------------------- 1 | | void _iocs_dmamov_a (const struct _iocs_chain *, void *, int, int); 2 | .text 3 | .even 4 | .global _iocs_dmamov_a 5 | .type _iocs_dmamov_a,@function 6 | _iocs_dmamov_a: 7 | move.l %d2, %sp@- 8 | move.l %a2, %sp@- 9 | movem.l %sp@(12), %d1-%d2/%a1-%a2 10 | exg %d1, %a1 11 | exg %d2, %a2 12 | moveq #0xffffff8b, %d0 13 | trap #15 14 | move.l %sp@+, %a2 15 | move.l %sp@+, %d2 16 | rts 17 | -------------------------------------------------------------------------------- /src/libx68k/lseek.c: -------------------------------------------------------------------------------- 1 | /* 2 | * lseek() 3 | */ 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | int __doserr2errno(int error); 10 | 11 | off_t lseek(int fd, off_t offset, int whence) 12 | { 13 | int res; 14 | 15 | res = _dos_seek(fd, offset, whence); 16 | 17 | if (res < 0) { 18 | errno = __doserr2errno(-res); 19 | res = -1; 20 | } 21 | 22 | return (off_t)res; 23 | } 24 | -------------------------------------------------------------------------------- /src/libx68k/libpthread/pthread_attr_getstacksize.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pthread_attr_getstacksize() 3 | */ 4 | 5 | #include "pthread_internal.h" 6 | 7 | int pthread_attr_getstacksize(const pthread_attr_t *attr, size_t *stacksize) 8 | { 9 | if (!attr || !attr->is_initialized) { 10 | return EINVAL; 11 | } 12 | 13 | if (stacksize) { 14 | *stacksize = attr->stacksize; 15 | } 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /src/libx68k/rename.c: -------------------------------------------------------------------------------- 1 | /* 2 | * rename() 3 | */ 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | int __doserr2errno(int error); 10 | 11 | int _rename (const char *old_path, const char *new_path) 12 | { 13 | int res; 14 | 15 | res = _dos_rename(old_path, new_path); 16 | 17 | if (res < 0) { 18 | errno = __doserr2errno(-res); 19 | res = -1; 20 | } 21 | 22 | return res; 23 | } 24 | -------------------------------------------------------------------------------- /src/libx68k/libpthread/pthread_attr_getdetachstate.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pthread_attr_getdetachstate() 3 | */ 4 | 5 | #include "pthread_internal.h" 6 | 7 | int pthread_attr_getdetachstate(const pthread_attr_t *attr, int *detachstate) 8 | { 9 | if (!attr || !attr->is_initialized) { 10 | return EINVAL; 11 | } 12 | 13 | if (detachstate) { 14 | *detachstate = attr->detachstate; 15 | } 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /src/libx68k/libpthread/pthread_attr_getschedparam.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pthread_attr_getschedparam() 3 | */ 4 | 5 | #include "pthread_internal.h" 6 | 7 | int pthread_attr_getschedparam(const pthread_attr_t *attr, struct sched_param *param) 8 | { 9 | if (!attr || !attr->is_initialized) { 10 | return EINVAL; 11 | } 12 | 13 | if (param) { 14 | param->sched_priority = attr->priority; 15 | } 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /src/libx68k/libpthread/pthread_attr_getname_np.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pthread_attr_getname_np() 3 | */ 4 | 5 | #include 6 | #include "pthread_internal.h" 7 | 8 | int pthread_attr_getname_np(const pthread_attr_t *attr, char *name, size_t len) 9 | { 10 | if (!attr || !attr->is_initialized) { 11 | return EINVAL; 12 | } 13 | 14 | strncpy(name, attr->name, len - 1); 15 | name[len - 1] = '\0'; 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /src/libx68k/libpthread/pthread_attr_setstacksize.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pthread_attr_setstacksize() 3 | */ 4 | 5 | #include "pthread_internal.h" 6 | 7 | int pthread_attr_setstacksize(pthread_attr_t *attr, size_t stacksize) 8 | { 9 | if (!attr || !attr->is_initialized) { 10 | return EINVAL; 11 | } 12 | 13 | if (stacksize == 0) { 14 | return EINVAL; 15 | } 16 | 17 | attr->stacksize = stacksize; 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /src/libx68k/_dosinit.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Initialize Human68k new doscall vectors for compatibility 3 | */ 4 | 5 | #include 6 | #include 7 | 8 | void __dosinit(void) 9 | { 10 | if ((uint16_t)_dos_vernum() >= 0x0300) { 11 | return; /* Human68k v3.x */ 12 | } 13 | 14 | /* Copy old doscall vectors to new doscall vectors */ 15 | for (int i = 0xff50; i < 0xff80; i++) { 16 | _dos_intvcs(i + 0x30, _dos_intvcg(i)); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/bgscrlgt.S: -------------------------------------------------------------------------------- 1 | | int _iocs_bgscrlgt (int, int *, int *); 2 | .text 3 | .even 4 | .global _iocs_bgscrlgt 5 | .type _iocs_bgscrlgt,@function 6 | _iocs_bgscrlgt: 7 | move.l %d2, %sp@- 8 | move.l %d3, %sp@- 9 | move.l %sp@(12), %d1 10 | moveq #0xffffffc9, %d0 11 | trap #15 12 | tst.l %d0 13 | bnes 6f 14 | movem.l %sp@(16), %a0/%a1 15 | move.l %d2, %a0@ 16 | move.l %d3, %a1@ 17 | 6: 18 | move.l %sp@+, %d3 19 | move.l %sp@+, %d2 20 | rts 21 | -------------------------------------------------------------------------------- /src/libx68k/libpthread/pthread_attr_getsystemstacksize_np.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pthread_attr_getsystemstacksize_np() 3 | */ 4 | 5 | #include "pthread_internal.h" 6 | 7 | int pthread_attr_getsystemstacksize_np(const pthread_attr_t *attr, size_t *stacksize) 8 | { 9 | if (!attr || !attr->is_initialized) { 10 | return EINVAL; 11 | } 12 | 13 | if (stacksize) { 14 | *stacksize = attr->systemstacksize; 15 | } 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /src/libx68k/libpthread/pthread_spin_trylock.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pthread_spin_trylock() 3 | */ 4 | 5 | #include "pthread_internal.h" 6 | 7 | int pthread_spin_trylock(pthread_spinlock_t *lock) 8 | { 9 | int val; 10 | __asm__ volatile( 11 | "moveq.l #0,%0\n" 12 | "tas %1\n" 13 | "beqs 1f\n" 14 | "addq.l #1,%0\n" 15 | "1:\n" 16 | : "=d"(val) : "m"(lock->lock) : "memory"); 17 | return val ? EBUSY : 0; 18 | } 19 | -------------------------------------------------------------------------------- /src/libx68k/libpthread/pthread_mutex_trylock.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pthread_mutex_trylock() 3 | */ 4 | 5 | #include "pthread_internal.h" 6 | 7 | int pthread_mutex_trylock(pthread_mutex_t *mutex) 8 | { 9 | if (!mutex->is_initialized) { 10 | return EINVAL; 11 | } 12 | 13 | int ssp = _pthread_enter_critical(); 14 | int res = (mutex->mutex == 0x00) ? 0 : EBUSY; 15 | mutex->mutex = 0x80; 16 | _pthread_leave_critical(ssp); 17 | return res; 18 | } 19 | -------------------------------------------------------------------------------- /src/libx68k/libdos/open_pr.S: -------------------------------------------------------------------------------- 1 | | int _dos_open_pr (const char *, int, int, int, int, int, struct _dos_prcctrl *, long); 2 | .text 3 | .even 4 | .global _dos_open_pr 5 | .type _dos_open_pr,@function 6 | _dos_open_pr: 7 | movem.l %sp@(20), %d0-%d1/%a0-%a1 8 | movem.l %d1/%a0-%a1, %sp@- 9 | move.w %d0, %sp@- 10 | move.l %sp@(30), %sp@- 11 | move.l %sp@(30), %sp@- 12 | move.w %sp@(32), %sp@- 13 | move.l %sp@(28), %sp@- 14 | .short 0xfff8 15 | lea %sp@(28), %sp 16 | rts 17 | -------------------------------------------------------------------------------- /src/libx68k/libpthread/pthread_attr_setname_np.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pthread_attr_setname_np() 3 | */ 4 | 5 | #include 6 | #include "pthread_internal.h" 7 | 8 | int pthread_attr_setname_np(pthread_attr_t *attr, const char *name) 9 | { 10 | if (!attr || !attr->is_initialized) { 11 | return EINVAL; 12 | } 13 | 14 | strncpy(attr->name, name, sizeof(attr->name) - 1); 15 | attr->name[sizeof(attr->name) - 1] = '\0'; 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/cache_md.S: -------------------------------------------------------------------------------- 1 | | int _iocs_cache_md (int); /* rom 1.3 only */ 2 | .text 3 | .even 4 | .global _iocs_cache_md 5 | .type _iocs_cache_md,@function 6 | _iocs_cache_md: 7 | move.l %d2, %sp@- 8 | move.l %sp@(8), %d2 9 | moveq #3, %d1 10 | move.l %d2, %d0 11 | addq.l #1, %d0 12 | beqs lcachemd 13 | moveq #2, %d1 14 | addq.l #1, %d0 15 | bnes lcachemd 16 | moveq #4, %d1 17 | lcachemd: 18 | moveq #0xffffffac, %d0 19 | trap #15 20 | move.l %sp@+, %d2 21 | rts 22 | -------------------------------------------------------------------------------- /src/libx68k/libpthread/pthread_attr_setsystemstacksize_np.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pthread_attr_setsystemstacksize_np() 3 | */ 4 | 5 | #include "pthread_internal.h" 6 | 7 | int pthread_attr_setsystemstacksize_np(pthread_attr_t *attr, size_t stacksize) 8 | { 9 | if (!attr || !attr->is_initialized) { 10 | return EINVAL; 11 | } 12 | 13 | if (stacksize == 0) { 14 | return EINVAL; 15 | } 16 | 17 | attr->systemstacksize = stacksize; 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /src/libx68k/libpthread/pthread_attr_getstack.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pthread_attr_getstack() 3 | */ 4 | 5 | #include "pthread_internal.h" 6 | 7 | int pthread_attr_getstack(const pthread_attr_t *attr, void **stackaddr, size_t *stacksize) 8 | { 9 | if (!attr || !attr->is_initialized) { 10 | return EINVAL; 11 | } 12 | 13 | if (stackaddr) { 14 | *stackaddr = attr->stackaddr; 15 | } 16 | if (stacksize) { 17 | *stacksize = attr->stacksize; 18 | } 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /src/libx68k/libpthread/pthread_attr_setstack.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pthread_attr_setstack() 3 | */ 4 | 5 | #include "pthread_internal.h" 6 | 7 | int pthread_attr_setstack(pthread_attr_t *attr, void *stackaddr, size_t stacksize) 8 | { 9 | if (!attr || !attr->is_initialized) { 10 | return EINVAL; 11 | } 12 | 13 | if (stackaddr == NULL || stacksize == 0) { 14 | return EINVAL; 15 | } 16 | 17 | attr->stackaddr = stackaddr; 18 | attr->stacksize = stacksize; 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /src/libx68k/libiocs/sp_reggt.S: -------------------------------------------------------------------------------- 1 | | int _iocs_sp_reggt (int, int *, int *, int *, int *); 2 | .text 3 | .even 4 | .global _iocs_sp_reggt 5 | .type _iocs_sp_reggt,@function 6 | _iocs_sp_reggt: 7 | movem.l %d2/%d3/%d4/%d5, %sp@- 8 | move.l %sp@(20), %d1 9 | moveq #0xffffffc7, %d0 10 | trap #15 11 | tst.l %d0 12 | bnes 6f 13 | movem.l %sp@(24), %a0/%a1 14 | move.l %d2, %a0@ 15 | move.l %d3, %a1@ 16 | movem.l %sp@(32), %a0/%a1 17 | move.l %d4, %a0@ 18 | move.l %d5, %a1@ 19 | 6: 20 | movem.l %sp@+,%d2/%d3/%d4/%d5 21 | rts 22 | -------------------------------------------------------------------------------- /src/libx68k/libdos/super_jsr.S: -------------------------------------------------------------------------------- 1 | | void _dos_super_jsr (void (*)(void), struct _dos_dregs *, struct _dos_dregs *); 2 | .text 3 | .even 4 | .global _dos_super_jsr 5 | .type _dos_super_jsr,@function 6 | _dos_super_jsr: 7 | movem.l %d2-%d7/%a2-%a6, %sp@- 8 | move.l %sp@(48), %sp@- 9 | movea.l %sp@(56), %a0 | inregs 10 | movem.l %a0@, %d0-%d7/%a0-%a6 11 | .short 0xfff6 12 | move.l %a6, %sp@ 13 | movea.l %sp@(60), %a6 | outregs 14 | move.l %sp@+, %a6@(56) 15 | movem.l %d0-%d7/%a0-%a5, %a6@ 16 | movem.l %sp@+, %d2-%d7/%a2-%a6 17 | rts 18 | -------------------------------------------------------------------------------- /src/x68k.specs: -------------------------------------------------------------------------------- 1 | *linker: 2 | ld.x 3 | 4 | *link: 5 | -z max-page-size=2 -T x68k.ld --wrap __sflags 6 | 7 | *startfile: 8 | x68kcrt0.o%s crtbegin.o%s 9 | 10 | *endfile: 11 | crtend.o%s 12 | 13 | *x68k_libgloss: 14 | -lx68k -lx68kdos -lx68kiocs 15 | 16 | *link_gcc_c_sequence: 17 | --start-group %G %L %(x68k_libgloss) --end-group 18 | 19 | *x68k_defines: 20 | -D__human68k=1 -D__human68k__=1 21 | 22 | *cpp_options: 23 | + %(x68k_defines) 24 | 25 | *cc1_options: 26 | + %(x68k_defines) -fcall-used-d2 -fcall-used-a2 -fexec-charset=cp932 27 | -------------------------------------------------------------------------------- /src/libx68k/libpthread/pthread_detach.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pthread_detach() 3 | */ 4 | 5 | #include "pthread_internal.h" 6 | 7 | int pthread_detach(pthread_t thread) 8 | { 9 | pthread_internal_t *pi = __pthread_tid_internal(thread); 10 | 11 | if (pi == NULL) { 12 | return ESRCH; // Thread does not exist 13 | } 14 | if (pi->stat & (PTH_STAT_DETACHED|PTH_STAT_TERMINATED)) { 15 | return EINVAL; // Thread is already detached or terminated 16 | } 17 | 18 | pi->stat |= PTH_STAT_DETACHED; 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /src/libx68k/libpthread/pthread_attr_getsystemstack_np.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pthread_attr_getsystemstack_np() 3 | */ 4 | 5 | #include "pthread_internal.h" 6 | 7 | int pthread_attr_getsystemstack_np(const pthread_attr_t *attr, void **stackaddr, size_t *stacksize) 8 | { 9 | if (!attr || !attr->is_initialized) { 10 | return EINVAL; 11 | } 12 | 13 | if (stackaddr) { 14 | *stackaddr = attr->systemstackaddr; 15 | } 16 | if (stacksize) { 17 | *stacksize = attr->systemstacksize; 18 | } 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /src/libx68k/libsocket/listen.c: -------------------------------------------------------------------------------- 1 | /* 2 | * listen() 3 | */ 4 | 5 | #include 6 | #include 7 | #include "tcpipdrv.h" 8 | 9 | int listen(int sockfd, int backlog) 10 | { 11 | if (!__sock_func) { 12 | errno = ENOSYS; 13 | return -1; 14 | } 15 | 16 | long arg[2]; 17 | int res; 18 | 19 | arg[0] = sockfd; 20 | arg[1] = backlog; 21 | 22 | res = __sock_func(_TI_listen, arg); 23 | if (res < 0) { 24 | errno = EIO; 25 | return res; 26 | } 27 | return res; 28 | } 29 | -------------------------------------------------------------------------------- /src/libx68k/libsocket/shutdown.c: -------------------------------------------------------------------------------- 1 | /* 2 | * shutdown() 3 | */ 4 | 5 | #include 6 | #include 7 | #include "tcpipdrv.h" 8 | 9 | int shutdown(int sockfd, int how) 10 | { 11 | if (!__sock_func) { 12 | errno = ENOSYS; 13 | return -1; 14 | } 15 | 16 | long arg[2]; 17 | int res; 18 | 19 | arg[0] = sockfd; 20 | arg[1] = how; 21 | 22 | res = __sock_func(_TI_shutdown, arg); 23 | if (res < 0) { 24 | errno = EIO; 25 | return res; 26 | } 27 | return res; 28 | } 29 | -------------------------------------------------------------------------------- /src/libx68k/libpthread/pthread_attr_setsystemstack_np.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pthread_attr_setsystemstack_np() 3 | */ 4 | 5 | #include "pthread_internal.h" 6 | 7 | int pthread_attr_setsystemstack_np(pthread_attr_t *attr, void *stackaddr, size_t stacksize) 8 | { 9 | if (!attr || !attr->is_initialized) { 10 | return EINVAL; 11 | } 12 | 13 | if (stackaddr == NULL || stacksize == 0) { 14 | return EINVAL; 15 | } 16 | 17 | attr->systemstackaddr = stackaddr; 18 | attr->systemstacksize = stacksize; 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /src/xc.specs.tmpl: -------------------------------------------------------------------------------- 1 | *linker: 2 | ld.x 3 | 4 | *lib: 5 | -lc -l${FLOAT} 6 | 7 | *link: 8 | -z max-page-size=2 -T x68k.ld -e _main -nostdlib -L${TOOLCHAIN_PATH}/xc-elf/lib 9 | 10 | *startfile: 11 | 12 | 13 | *endfile: 14 | 15 | 16 | *x68k_libgloss: 17 | 18 | 19 | *link_gcc_c_sequence: 20 | --start-group %G %L --end-group 21 | 22 | *cc1_options: 23 | + ${INPUT_CHARSET} 24 | 25 | %rename cpp_unique_options old_cpp_unique_options 26 | 27 | *cpp_unique_options: 28 | -nostdinc -isystem ${TOOLCHAIN_PATH}/xc-elf/include${SJIS} %(old_cpp_unique_options) 29 | -------------------------------------------------------------------------------- /src/m68k-xelf-gdb: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e -o pipefail 4 | 5 | interp="" 6 | remote="" 7 | param=("$@") 8 | for ((i=0; i<${#param[@]}; i++)); do 9 | case ${param[$i]} in 10 | --interpreter=*) 11 | interp=${param[$i]#--interpreter=} 12 | ;; 13 | -ex) 14 | case ${param[$i+1]} in 15 | 'target '*) 16 | remote=${param[$i+1]} 17 | esac 18 | esac 19 | done 20 | 21 | if [[ -z "${interp}" && -z "${remote}" && $# -gt 0 ]]; then 22 | m68k-elf-gdb -ex 'target remote :54321' "$@" 23 | else 24 | m68k-elf-gdb "$@" 25 | fi 26 | -------------------------------------------------------------------------------- /src/libx68k/write-nodos.c: -------------------------------------------------------------------------------- 1 | /* 2 | * write() (without Human68k) 3 | */ 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | ssize_t write(int fd, const void *buf, size_t count) 10 | { 11 | int res = count; 12 | const char *p; 13 | char ch; 14 | 15 | if (fd != 1 && fd != 2) { 16 | errno = EBADF; 17 | return -1; 18 | } 19 | 20 | p = buf; 21 | while (count-- > 0) { 22 | ch = *p++; 23 | if (ch == '\n') { 24 | _iocs_b_putc('\r'); 25 | } 26 | _iocs_b_putc(ch); 27 | } 28 | 29 | return res; 30 | } 31 | -------------------------------------------------------------------------------- /src/libx68k/libpthread/pthread_spin_lock.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pthread_spin_lock() 3 | */ 4 | 5 | #include "pthread_internal.h" 6 | 7 | int pthread_spin_lock(pthread_spinlock_t *lock) 8 | { 9 | int val; 10 | while (1) { 11 | __asm__ volatile( 12 | "moveq.l #0,%0\n" 13 | "tas %1\n" 14 | "beqs 1f\n" 15 | "addq.l #1,%0\n" 16 | "1:\n" 17 | : "=d"(val) : "m"(lock->lock) : "memory"); 18 | if (!val) { 19 | break; 20 | } 21 | _dos_change_pr(); 22 | } 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /src/libx68k/libsocket/bind.c: -------------------------------------------------------------------------------- 1 | /* 2 | * bind() 3 | */ 4 | 5 | #include 6 | #include 7 | #include "tcpipdrv.h" 8 | 9 | int bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen) 10 | { 11 | if (!__sock_func) { 12 | errno = ENOSYS; 13 | return -1; 14 | } 15 | 16 | long arg[3]; 17 | int res; 18 | 19 | arg[0] = sockfd; 20 | arg[1] = (long)addr; 21 | arg[2] = addrlen; 22 | 23 | res = __sock_func(_TI_bind, arg); 24 | if (res < 0) { 25 | errno = EIO; 26 | return res; 27 | } 28 | return res; 29 | } 30 | -------------------------------------------------------------------------------- /src/libx68k/libsocket/connect.c: -------------------------------------------------------------------------------- 1 | /* 2 | * connect() 3 | */ 4 | 5 | #include 6 | #include 7 | #include "tcpipdrv.h" 8 | 9 | int connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen) 10 | { 11 | if (!__sock_func) { 12 | errno = ENOSYS; 13 | return -1; 14 | } 15 | 16 | long arg[3]; 17 | int res; 18 | 19 | arg[0] = sockfd; 20 | arg[1] = (long)addr; 21 | arg[2] = addrlen; 22 | 23 | res = __sock_func(_TI_connect, arg); 24 | if (res < 0) { 25 | errno = EIO; 26 | return res; 27 | } 28 | return res; 29 | } 30 | -------------------------------------------------------------------------------- /src/libx68k/chdir.c: -------------------------------------------------------------------------------- 1 | /* 2 | * chdir() 3 | */ 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | int __doserr2errno(int error); 11 | 12 | int chdir(const char *path) 13 | { 14 | char drv = toupper(path[0]); 15 | int res; 16 | if (drv >= 'A' && drv <= 'Z' && path[1] == ':') { 17 | res = _dos_chgdrv(drv - 'A'); 18 | if (res < 0) { 19 | errno = __doserr2errno(-res); 20 | return -1; 21 | } 22 | } 23 | res = _dos_chdir(path); 24 | if (res < 0) { 25 | errno = __doserr2errno(-res); 26 | return -1; 27 | } 28 | 29 | return res; 30 | } 31 | -------------------------------------------------------------------------------- /src/libx68k/libsocket/getpeername.c: -------------------------------------------------------------------------------- 1 | /* 2 | * getpeername() 3 | */ 4 | 5 | #include 6 | #include 7 | #include "tcpipdrv.h" 8 | 9 | int getpeername(int sockfd, struct sockaddr *addr, socklen_t *addrlen) 10 | { 11 | if (!__sock_func) { 12 | errno = ENOSYS; 13 | return -1; 14 | } 15 | 16 | long arg[3]; 17 | int res; 18 | 19 | arg[0] = sockfd; 20 | arg[1] = (long)addr; 21 | arg[2] = (long)addrlen; 22 | 23 | res = __sock_func(_TI_getpeername, arg); 24 | if (res < 0) { 25 | errno = EIO; 26 | return res; 27 | } 28 | return res; 29 | } 30 | -------------------------------------------------------------------------------- /src/libx68k/libsocket/getsockname.c: -------------------------------------------------------------------------------- 1 | /* 2 | * getsockname() 3 | */ 4 | 5 | #include 6 | #include 7 | #include "tcpipdrv.h" 8 | 9 | int getsockname(int sockfd, struct sockaddr *addr, socklen_t *addrlen) 10 | { 11 | if (!__sock_func) { 12 | errno = ENOSYS; 13 | return -1; 14 | } 15 | 16 | long arg[3]; 17 | int res; 18 | 19 | arg[0] = sockfd; 20 | arg[1] = (long)addr; 21 | arg[2] = (long)addrlen; 22 | 23 | res = __sock_func(_TI_getsockname, arg); 24 | if (res < 0) { 25 | errno = EIO; 26 | return res; 27 | } 28 | return res; 29 | } 30 | -------------------------------------------------------------------------------- /src/libx68k/libpthread/pthread_once.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pthread_once() 3 | */ 4 | 5 | #include "pthread_internal.h" 6 | 7 | int pthread_once(pthread_once_t *once_control, void (*init_routine)(void)) 8 | { 9 | int ssp = _pthread_enter_critical(); 10 | if (!once_control->is_initialized) { 11 | _pthread_leave_critical(ssp); 12 | return 0; 13 | } 14 | if (!once_control->init_executed) { 15 | _pthread_leave_critical(ssp); 16 | return 0; 17 | } 18 | once_control->init_executed = 1; 19 | _pthread_leave_critical(ssp); 20 | if (init_routine) { 21 | init_routine(); 22 | } 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /src/dirent.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_DIRENT_H_ 2 | #define _SYS_DIRENT_H_ 3 | 4 | #include 5 | #include 6 | 7 | __BEGIN_DECLS 8 | 9 | #define MAXNAMLEN 255 10 | 11 | struct dirent { 12 | ino_t d_ino; 13 | off_t d_off; 14 | unsigned short d_reclen; 15 | unsigned char d_type; 16 | char d_name[MAXNAMLEN + 1]; 17 | }; 18 | 19 | struct DIR; 20 | typedef struct DIR DIR; 21 | 22 | #if __BSD_VISIBLE 23 | 24 | /* 25 | * File types 26 | */ 27 | #define DT_UNKNOWN 0 28 | #define DT_DIR 4 29 | #define DT_REG 8 30 | 31 | #endif /* __BSD_VISIBLE */ 32 | 33 | __END_DECLS 34 | 35 | #endif /*_SYS_DIRENT_H_*/ 36 | -------------------------------------------------------------------------------- /src/libx68k/libpthread/pthread_cancel.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pthread_cancel() 3 | */ 4 | 5 | #include "pthread_internal.h" 6 | 7 | int pthread_cancel(pthread_t thread) 8 | { 9 | pthread_internal_t *pi = __pthread_tid_internal(thread); 10 | 11 | if (pi == NULL || (pi->stat & PTH_STAT_TERMINATED)) { 12 | return ESRCH; // Thread does not exist 13 | } 14 | 15 | if (!(pi->stat & (PTH_STAT_CANCELED|PTH_STAT_CANCEL_DISABLE))) { 16 | pi->stat |= PTH_STAT_DEFEREED_CANCELED; 17 | if (pi->stat & (PTH_STAT_CANCEL_ASYNC|PTH_STAT_IN_CANCEL_POINT)) { 18 | __pthread_testcancel(pi); 19 | } 20 | } 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /src/libx68k/libpthread/pthread_attr_init.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pthread_attr_init() 3 | * pthread_attr_destroy() 4 | */ 5 | 6 | #include "pthread_internal.h" 7 | 8 | int pthread_attr_init(pthread_attr_t *attr) 9 | { 10 | attr->is_initialized = 1; 11 | attr->stackaddr = NULL; 12 | attr->stacksize = PTH_DEFAULT_USERSTACKSIZE; 13 | attr->systemstackaddr = NULL; 14 | attr->systemstacksize = PTH_DEFAULT_SYSTEMSTACKSIZE; 15 | attr->detachstate = PTHREAD_CREATE_JOINABLE; 16 | attr->priority = PTH_DEFAULT_PRIORITY; 17 | attr->name[0] = '\0'; 18 | return 0; 19 | } 20 | 21 | int pthread_attr_destroy(pthread_attr_t *attr) 22 | { 23 | attr->is_initialized = 0; 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /src/libx68k/libsocket/recv.c: -------------------------------------------------------------------------------- 1 | /* 2 | * recv() 3 | */ 4 | 5 | #include 6 | #include 7 | #include 8 | #include "tcpipdrv.h" 9 | 10 | ssize_t recv(int sockfd, void *buf, size_t len, int flags) 11 | { 12 | if (!__sock_func) { 13 | errno = ENOSYS; 14 | return -1; 15 | } 16 | 17 | long arg[6]; 18 | ssize_t res; 19 | 20 | arg[0] = sockfd; 21 | arg[1] = (long)buf; 22 | arg[2] = len; 23 | arg[3] = flags; 24 | arg[4] = 0; 25 | arg[5] = 0; 26 | 27 | res = __sock_func(_TI_recvfrom, arg); 28 | if (res < 0) { 29 | errno = EIO; 30 | return res; 31 | } 32 | return res; 33 | } 34 | -------------------------------------------------------------------------------- /src/libx68k/libsocket/send.c: -------------------------------------------------------------------------------- 1 | /* 2 | * send() 3 | */ 4 | 5 | #include 6 | #include 7 | #include 8 | #include "tcpipdrv.h" 9 | 10 | ssize_t send(int sockfd, const void *buf, size_t len, int flags) 11 | { 12 | if (!__sock_func) { 13 | errno = ENOSYS; 14 | return -1; 15 | } 16 | 17 | long arg[6]; 18 | ssize_t res; 19 | 20 | arg[0] = sockfd; 21 | arg[1] = (long)buf; 22 | arg[2] = len; 23 | arg[3] = flags; 24 | arg[4] = 0; 25 | arg[5] = 0; 26 | 27 | res = __sock_func(_TI_sendto, arg); 28 | if (res < 0) { 29 | errno = EIO; 30 | return res; 31 | } 32 | return res; 33 | } 34 | -------------------------------------------------------------------------------- /src/libx68k/_sflags.c: -------------------------------------------------------------------------------- 1 | /* 2 | * __sflags() wrapper to support text/binary mode for fopen() 3 | */ 4 | 5 | #include 6 | #include 7 | #include 8 | #include "fds.h" 9 | 10 | int __real___sflags(void *ptr, char *mode, int *optr); 11 | 12 | int __wrap___sflags(void *ptr, char *mode, int *optr) 13 | { 14 | int c; 15 | int m = 0; 16 | int flags; 17 | char *mp = mode; 18 | 19 | while (c = *mp++) { 20 | switch (c) { 21 | case 'b': 22 | m |= O_BINARY; 23 | break; 24 | case 't': 25 | m |= O_TEXT; 26 | break; 27 | } 28 | } 29 | 30 | flags = __real___sflags(ptr, mode, optr); 31 | *optr |= m; 32 | return flags; 33 | } 34 | -------------------------------------------------------------------------------- /src/libx68k/libpthread/pthread_cond_signal.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pthread_cond_signal() 3 | */ 4 | 5 | #include "pthread_internal.h" 6 | 7 | int pthread_cond_signal(pthread_cond_t *cond) 8 | { 9 | if (!cond->is_initialized) { 10 | return EINVAL; 11 | } 12 | 13 | int ssp = _pthread_enter_critical(); 14 | if (cond->waiting) { 15 | // Wake up the first waiting thread 16 | pthread_internal_t *wakeup = cond->waiting; 17 | cond->waiting = wakeup->waitnext; 18 | wakeup->waitnext = NULL; 19 | wakeup->stat &= ~PTH_STAT_WAITING; 20 | _dos_send_pr(0, wakeup->tid, 0xfffb, NULL, 0); 21 | } 22 | _pthread_leave_critical(ssp); 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /src/libx68k/libpthread/pthread_rwlock_tryrdlock.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pthread_rwlock_tryrdlock() 3 | */ 4 | 5 | #include "pthread_internal.h" 6 | 7 | int pthread_rwlock_tryrdlock(pthread_rwlock_t *lock) 8 | { 9 | if (!lock->is_initialized) { 10 | return EINVAL; 11 | } 12 | 13 | pthread_internal_t *pi = __pthread_self_internal(); 14 | if (pi == NULL) { 15 | return ESRCH; // Current thread not found 16 | } 17 | 18 | int ssp = _pthread_enter_critical(); 19 | if (lock->count < 0) { 20 | _pthread_leave_critical(ssp); 21 | return EBUSY; 22 | } 23 | lock->count++; // Own the reader lock 24 | _pthread_leave_critical(ssp); 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /src/libx68k/libpthread/pthread_rwlock_trywrlock.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pthread_rwlock_trywrlock() 3 | */ 4 | 5 | #include "pthread_internal.h" 6 | 7 | int pthread_rwlock_trywrlock(pthread_rwlock_t *lock) 8 | { 9 | if (!lock->is_initialized) { 10 | return EINVAL; 11 | } 12 | 13 | pthread_internal_t *pi = __pthread_self_internal(); 14 | if (pi == NULL) { 15 | return ESRCH; // Current thread not found 16 | } 17 | 18 | int ssp = _pthread_enter_critical(); 19 | if (lock->count != 0) { 20 | _pthread_leave_critical(ssp); 21 | return EBUSY; 22 | } 23 | lock->count--; // Own the writer lock 24 | _pthread_leave_critical(ssp); 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /src/libx68k/libpthread/pthread_cond_broadcast.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pthread_cond_broadcast() 3 | */ 4 | 5 | #include "pthread_internal.h" 6 | 7 | int pthread_cond_broadcast(pthread_cond_t *cond) 8 | { 9 | if (!cond->is_initialized) { 10 | return EINVAL; 11 | } 12 | 13 | int ssp = _pthread_enter_critical(); 14 | while (cond->waiting) { 15 | // Wake up all waiting threads 16 | pthread_internal_t *wakeup = cond->waiting; 17 | cond->waiting = wakeup->waitnext; 18 | wakeup->waitnext = NULL; 19 | wakeup->stat &= ~PTH_STAT_WAITING; 20 | _dos_send_pr(0, wakeup->tid, 0xfffb, NULL, 0); 21 | } 22 | _pthread_leave_critical(ssp); 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /src/libx68k/libsocket/getprotonamnum.c: -------------------------------------------------------------------------------- 1 | /* 2 | * getprotobyname() 3 | * getprotobynumber() 4 | */ 5 | 6 | #include 7 | #include 8 | #include 9 | #include "tcpipdrv.h" 10 | 11 | struct protoent *getprotobyname(const char *name) 12 | { 13 | _ti_func func = __sock_search_ti_entry(); 14 | 15 | if (!func) { 16 | return NULL; 17 | } 18 | 19 | return (struct protoent *)func(_TI_getprotobyname, (long *)name); 20 | } 21 | 22 | struct protoent *getprotobynumber(int proto) 23 | { 24 | _ti_func func = __sock_search_ti_entry(); 25 | 26 | if (!func) { 27 | return NULL; 28 | } 29 | 30 | return (struct protoent *)func(_TI_getprotobynumber, (long *)proto); 31 | } 32 | -------------------------------------------------------------------------------- /src/libx68k/readdir.c: -------------------------------------------------------------------------------- 1 | /* 2 | * readdir() 3 | */ 4 | 5 | #include 6 | #include 7 | #include 8 | #include "fds.h" 9 | 10 | int __doserr2errno(int error); 11 | 12 | struct dirent *readdir(DIR *dirp) 13 | { 14 | if (dirp->active == 2) { 15 | int res = _dos_nfiles(&dirp->filbuf); 16 | if (res < 0) { 17 | return NULL; 18 | } 19 | } 20 | 21 | dirp->dirent.d_ino = 0; 22 | dirp->dirent.d_off = dirp->count; 23 | dirp->dirent.d_reclen = sizeof(struct dirent); 24 | dirp->dirent.d_type = (dirp->filbuf.atr & 0x10) ? DT_DIR : DT_REG; 25 | strncpy(dirp->dirent.d_name, dirp->filbuf.name, sizeof(dirp->filbuf.name)); 26 | dirp->active = 2; 27 | dirp->count++; 28 | return &dirp->dirent; 29 | } 30 | -------------------------------------------------------------------------------- /src/libx68k/libpthread/pthread_mutexattr_init.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pthread_mutexattr_init() 3 | * pthread_mutexattr_destroy() 4 | * pthread_mutexattr_gettype() 5 | * pthread_mutexattr_settype() 6 | */ 7 | 8 | #include "pthread_internal.h" 9 | 10 | int pthread_mutexattr_init(pthread_mutexattr_t *attr) 11 | { 12 | attr->type = PTHREAD_MUTEX_NORMAL; 13 | return 0; 14 | } 15 | 16 | int pthread_mutexattr_destroy(pthread_mutexattr_t *attr) 17 | { 18 | return 0; 19 | } 20 | 21 | int pthread_mutexattr_gettype(const pthread_mutexattr_t *attr, int *kind) 22 | { 23 | *kind = attr->type; 24 | return 0; 25 | } 26 | 27 | int pthread_mutexattr_settype(pthread_mutexattr_t *attr, int kind) 28 | { 29 | attr->type = kind; 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /src/libx68k/libsocket/recvfrom.c: -------------------------------------------------------------------------------- 1 | /* 2 | * recvfrom() 3 | */ 4 | 5 | #include 6 | #include 7 | #include 8 | #include "tcpipdrv.h" 9 | 10 | ssize_t recvfrom(int sockfd, void *buf, size_t len, int flags, struct sockaddr *src_addr, socklen_t *addrlen) 11 | { 12 | if (!__sock_func) { 13 | errno = ENOSYS; 14 | return -1; 15 | } 16 | 17 | long arg[6]; 18 | ssize_t res; 19 | 20 | arg[0] = sockfd; 21 | arg[1] = (long)buf; 22 | arg[2] = len; 23 | arg[3] = flags; 24 | arg[4] = (long)src_addr; 25 | arg[5] = (long)addrlen; 26 | 27 | res = __sock_func(_TI_recvfrom, arg); 28 | if (res < 0) { 29 | errno = EIO; 30 | return res; 31 | } 32 | return res; 33 | } 34 | -------------------------------------------------------------------------------- /src/libx68k/libsocket/sendto.c: -------------------------------------------------------------------------------- 1 | /* 2 | * sendto() 3 | */ 4 | 5 | #include 6 | #include 7 | #include 8 | #include "tcpipdrv.h" 9 | 10 | ssize_t sendto(int sockfd, const void *buf, size_t len, int flags, const struct sockaddr *src_addr, socklen_t addrlen) 11 | { 12 | if (!__sock_func) { 13 | errno = ENOSYS; 14 | return -1; 15 | } 16 | 17 | long arg[6]; 18 | ssize_t res; 19 | 20 | arg[0] = sockfd; 21 | arg[1] = (long)buf; 22 | arg[2] = len; 23 | arg[3] = flags; 24 | arg[4] = (long)src_addr; 25 | arg[5] = addrlen; 26 | 27 | res = __sock_func(_TI_sendto, arg); 28 | if (res < 0) { 29 | errno = EIO; 30 | return res; 31 | } 32 | return res; 33 | } 34 | -------------------------------------------------------------------------------- /src/libx68k/libsocket/accept.c: -------------------------------------------------------------------------------- 1 | /* 2 | * accept() 3 | */ 4 | 5 | #include 6 | #include 7 | #include 8 | #include "tcpipdrv.h" 9 | 10 | extern uint32_t __sock_fds; 11 | 12 | int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen) 13 | { 14 | if (!__sock_func) { 15 | errno = ENOSYS; 16 | return -1; 17 | } 18 | 19 | long arg[3]; 20 | int res; 21 | 22 | arg[0] = sockfd; 23 | arg[1] = (long)addr; 24 | arg[2] = (long)addrlen; 25 | 26 | res = __sock_func(_TI_accept, arg); 27 | if (res < 0) { 28 | errno = EIO; 29 | return res; 30 | } 31 | if (res >= 128 && res < 128 + 32) { 32 | __sock_fds |= (1 << (res - 128)); 33 | } 34 | return res; 35 | } 36 | -------------------------------------------------------------------------------- /src/libx68k/libsocket/getnetnamadr.c: -------------------------------------------------------------------------------- 1 | /* 2 | * getnetbyname() 3 | * getnetbyaddr() 4 | */ 5 | 6 | #include 7 | #include 8 | #include 9 | #include "tcpipdrv.h" 10 | 11 | struct netent *getnetbyname(const char *name) 12 | { 13 | _ti_func func = __sock_search_ti_entry(); 14 | 15 | if (!func) { 16 | return NULL; 17 | } 18 | 19 | return (struct netent *)func(_TI_getnetbyname, (long *)name); 20 | } 21 | 22 | struct netent *getnetbyaddr(unsigned long net, int type) 23 | { 24 | _ti_func func = __sock_search_ti_entry(); 25 | 26 | if (!func) { 27 | return NULL; 28 | } 29 | 30 | long arg[2]; 31 | 32 | arg[0] = net; 33 | arg[1] = type; 34 | 35 | return (struct netent *)func(_TI_getnetbyaddr, arg); 36 | } 37 | -------------------------------------------------------------------------------- /src/libx68k/libpthread/pthread_mutex_unlock.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pthread_mutex_unlock() 3 | */ 4 | 5 | #include "pthread_internal.h" 6 | 7 | int pthread_mutex_unlock(pthread_mutex_t *mutex) 8 | { 9 | if (!mutex->is_initialized) { 10 | return EINVAL; 11 | } 12 | 13 | int ssp = _pthread_enter_critical(); 14 | mutex->mutex = 0; 15 | if (mutex->waiting) { 16 | // Wake up the first waiting thread 17 | pthread_internal_t *wakeup = mutex->waiting; 18 | mutex->waiting = wakeup->waitnext; 19 | wakeup->waitnext = NULL; 20 | wakeup->stat &= ~PTH_STAT_WAITING; 21 | _dos_send_pr(0, wakeup->tid, 0xfffb, NULL, 0); 22 | } 23 | _pthread_leave_critical(ssp); 24 | _dos_change_pr(); // send_prだけではスケジューリングされない 25 | 26 | return 0; 27 | } 28 | --------------------------------------------------------------------------------