├── impl ├── apps │ ├── file_server │ │ ├── files │ │ │ ├── logfile │ │ │ ├── hello.txt │ │ │ ├── nhdat │ │ │ ├── nethackrc │ │ │ └── news │ │ ├── Kbuild │ │ ├── Kconfig │ │ ├── Makefile │ │ ├── linker.lds │ │ ├── src │ │ │ ├── badge.h │ │ │ ├── dispatchers │ │ │ │ ├── fault_notify.h │ │ │ │ ├── serv_dispatch.h │ │ │ │ ├── cpio_dspace.h │ │ │ │ ├── dispatch.h │ │ │ │ └── dispatch.c │ │ │ └── state.h │ │ └── LICENSE_BSD2.txt │ ├── nethack │ │ ├── src │ │ │ ├── nethack-3.4.3 │ │ │ │ ├── include │ │ │ │ │ ├── vis_tab.h │ │ │ │ │ ├── qt_kde0.h │ │ │ │ │ ├── coord.h │ │ │ │ │ ├── rect.h │ │ │ │ │ ├── emin.h │ │ │ │ │ ├── winGnome.h │ │ │ │ │ ├── macpopup.h │ │ │ │ │ ├── micro.h │ │ │ │ │ ├── date.h │ │ │ │ │ ├── tile2x11.h │ │ │ │ │ ├── func_tab.h │ │ │ │ │ ├── qt_clust.h │ │ │ │ │ ├── spell.h │ │ │ │ │ ├── mail.h │ │ │ │ │ ├── epri.h │ │ │ │ │ ├── engrave.h │ │ │ │ │ ├── vault.h │ │ │ │ │ ├── beconf.h │ │ │ │ │ ├── bitmfile.h │ │ │ │ │ ├── mac-qt.h │ │ │ │ │ ├── mac-carbon.h │ │ │ │ │ ├── edog.h │ │ │ │ │ ├── align.h │ │ │ │ │ ├── mac-term.h │ │ │ │ │ ├── mfndpos.h │ │ │ │ │ ├── attrib.h │ │ │ │ │ ├── nhlan.h │ │ │ │ │ ├── lev.h │ │ │ │ │ ├── mttypriv.h │ │ │ │ │ ├── timeout.h │ │ │ │ │ ├── eshk.h │ │ │ │ │ ├── color.h │ │ │ │ │ ├── tcap.h │ │ │ │ │ ├── xwindowp.h │ │ │ │ │ ├── quest.h │ │ │ │ │ └── load_img.h │ │ │ │ ├── src │ │ │ │ │ ├── vis_tab.c │ │ │ │ │ ├── track.c │ │ │ │ │ └── monstr.c │ │ │ │ ├── sys │ │ │ │ │ ├── share │ │ │ │ │ │ ├── Makefile.lib │ │ │ │ │ │ ├── dgn_comp.h │ │ │ │ │ │ └── sounds │ │ │ │ │ │ │ └── README │ │ │ │ │ └── unix │ │ │ │ │ │ ├── setup.sh │ │ │ │ │ │ └── nethack.sh │ │ │ │ ├── dat │ │ │ │ │ ├── options │ │ │ │ │ ├── wizhelp │ │ │ │ │ └── oracle.des │ │ │ │ ├── win │ │ │ │ │ └── share │ │ │ │ │ │ └── tile.h │ │ │ │ └── doc │ │ │ │ │ ├── fixes31.3 │ │ │ │ │ └── fixes32.3 │ │ │ └── refos_nethack.c │ │ ├── Kbuild │ │ ├── Kconfig │ │ ├── linker.lds │ │ └── Makefile │ ├── Kbuild │ ├── snake │ │ ├── Kbuild │ │ ├── Kconfig │ │ ├── Makefile │ │ ├── linker.lds │ │ └── LICENSE_BSD2.txt │ ├── tetris │ │ ├── Kbuild │ │ ├── Kconfig │ │ ├── Makefile │ │ ├── linker.lds │ │ └── LICENSE_BSD2.txt │ ├── test_os │ │ ├── Kbuild │ │ ├── Kconfig │ │ ├── Makefile │ │ ├── linker.lds │ │ ├── src │ │ │ ├── test_anon_ram.h │ │ │ ├── test_fileserv.h │ │ │ └── test_anon_ram.c │ │ └── LICENSE_BSD2.txt │ ├── terminal │ │ ├── Kbuild │ │ ├── src │ │ │ ├── print_time.h │ │ │ └── print_time.c │ │ ├── Kconfig │ │ ├── Makefile │ │ ├── linker.lds │ │ └── LICENSE_BSD2.txt │ ├── test_user │ │ ├── Kbuild │ │ ├── Kconfig │ │ ├── Makefile │ │ ├── linker.lds │ │ └── LICENSE_BSD2.txt │ ├── selfloader │ │ ├── Kbuild │ │ ├── Kconfig │ │ ├── Makefile │ │ ├── linker.lds │ │ └── LICENSE_BSD2.txt │ ├── timer_server │ │ ├── Kbuild │ │ ├── Kconfig │ │ ├── linker.lds │ │ ├── Makefile │ │ ├── src │ │ │ ├── dispatchers │ │ │ │ ├── client_watch.h │ │ │ │ ├── serv_dispatch.h │ │ │ │ ├── dspace │ │ │ │ │ ├── dspace.h │ │ │ │ │ └── timer_dspace.h │ │ │ │ ├── dispatch.h │ │ │ │ └── dispatch.c │ │ │ ├── badge.h │ │ │ └── state.h │ │ └── LICENSE_BSD2.txt │ ├── console_server │ │ ├── Kbuild │ │ ├── Kconfig │ │ ├── linker.lds │ │ ├── Makefile │ │ ├── src │ │ │ └── dispatchers │ │ │ │ ├── client_watch.h │ │ │ │ ├── serv_dispatch.h │ │ │ │ ├── dspace │ │ │ │ ├── dspace.h │ │ │ │ ├── stdio_dspace.h │ │ │ │ └── screen_dspace.h │ │ │ │ ├── dispatch.h │ │ │ │ └── dispatch.c │ │ └── LICENSE_BSD2.txt │ └── process_server │ │ ├── src │ │ ├── test │ │ │ ├── test_addrspace.h │ │ │ ├── test_process.h │ │ │ ├── test.h │ │ │ └── test_memserv.h │ │ ├── dispatchers │ │ │ ├── mem_syscall.h │ │ │ ├── proc_syscall.h │ │ │ ├── data_syscall.h │ │ │ ├── name_syscall.h │ │ │ └── fault_handler.h │ │ ├── common.h │ │ └── badge.h │ │ ├── Kbuild │ │ ├── Makefile │ │ └── LICENSE_BSD2.txt ├── libs │ ├── libvterm │ │ ├── src │ │ │ ├── encoding │ │ │ │ ├── uk.tbl │ │ │ │ ├── uk.inc │ │ │ │ ├── DECdrawing.inc │ │ │ │ └── DECdrawing.tbl │ │ │ ├── utf8.h │ │ │ └── LICENSE │ │ ├── Kbuild │ │ ├── Makefile │ │ ├── Kconfig │ │ └── include │ │ │ └── vterm │ │ │ └── vterm_input.h │ ├── Kbuild │ ├── libdatastruct │ │ ├── Kbuild │ │ ├── include │ │ │ └── data_struct │ │ │ │ ├── csstring.h │ │ │ │ ├── cmacros.h │ │ │ │ ├── cpool.h │ │ │ │ ├── cqueue.h │ │ │ │ ├── cbpool.h │ │ │ │ ├── chash.h │ │ │ │ ├── cvector.h │ │ │ │ └── coat.h │ │ ├── Kconfig │ │ ├── Makefile │ │ ├── src │ │ │ └── cqueue.c │ │ └── LICENSE_BSD2.txt │ ├── librefossys │ │ ├── Kbuild │ │ ├── include │ │ │ └── refos-io │ │ │ │ ├── timer.h │ │ │ │ ├── morecore.h │ │ │ │ ├── stdio.h │ │ │ │ ├── filetable.h │ │ │ │ └── internal_state.h │ │ ├── src │ │ │ ├── sys_yield.c │ │ │ ├── sys_abort.c │ │ │ ├── sys_thread.c │ │ │ ├── sys_ignored.c │ │ │ ├── sys_exit.c │ │ │ └── syscalls.h │ │ ├── Makefile │ │ ├── Kconfig │ │ └── LICENSE_BSD2.txt │ ├── librefos │ │ ├── Kbuild │ │ ├── src │ │ │ ├── error.c │ │ │ └── refos-util │ │ │ │ └── stdio_copy.h │ │ ├── Kconfig │ │ ├── Makefile │ │ ├── include │ │ │ ├── refos-rpc │ │ │ │ └── proc_common.h │ │ │ ├── refos │ │ │ │ └── sync.h │ │ │ └── refos-util │ │ │ │ └── device_io.h │ │ └── LICENSE_BSD2.txt │ └── Kconfig ├── docs │ ├── doxygen │ │ ├── fault.png │ │ ├── refos.png │ │ ├── conserv.png │ │ ├── elfload.png │ │ ├── fileserv.png │ │ ├── memwindow.png │ │ ├── procserv.png │ │ ├── startup.png │ │ ├── timeserv.png │ │ ├── vmlayout.png │ │ ├── dispatcher.png │ │ ├── header-logo.png │ │ ├── testing_levels.png │ │ ├── component_design.png │ │ ├── dataspace_example.png │ │ └── style.css │ └── Makefile ├── cidl_templates │ ├── enum.py │ ├── dispatcher.py │ ├── client_header.py │ ├── dispatcher_container.py │ ├── server_header.py │ └── root.py ├── Kbuild ├── Kconfig └── refos_cidl_compile ├── design ├── refos.png └── extra.bib ├── .github ├── workflows │ ├── pr.yml │ └── push.yml ├── CODE_OF_CONDUCT.md └── CONTRIBUTING.md ├── LICENSE.md ├── LICENSES ├── ISC.txt ├── MIT.txt └── BSD-2-Clause.txt ├── .reuse └── dep5 └── .gitignore /impl/apps/file_server/files/logfile: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /impl/apps/file_server/files/hello.txt: -------------------------------------------------------------------------------- 1 | hello world! -------------------------------------------------------------------------------- /impl/libs/libvterm/src/encoding/uk.tbl: -------------------------------------------------------------------------------- 1 | 2/3 = "£" 2 | -------------------------------------------------------------------------------- /design/refos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seL4/refos/HEAD/design/refos.png -------------------------------------------------------------------------------- /impl/docs/doxygen/fault.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seL4/refos/HEAD/impl/docs/doxygen/fault.png -------------------------------------------------------------------------------- /impl/docs/doxygen/refos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seL4/refos/HEAD/impl/docs/doxygen/refos.png -------------------------------------------------------------------------------- /impl/docs/doxygen/conserv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seL4/refos/HEAD/impl/docs/doxygen/conserv.png -------------------------------------------------------------------------------- /impl/docs/doxygen/elfload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seL4/refos/HEAD/impl/docs/doxygen/elfload.png -------------------------------------------------------------------------------- /impl/docs/doxygen/fileserv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seL4/refos/HEAD/impl/docs/doxygen/fileserv.png -------------------------------------------------------------------------------- /impl/docs/doxygen/memwindow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seL4/refos/HEAD/impl/docs/doxygen/memwindow.png -------------------------------------------------------------------------------- /impl/docs/doxygen/procserv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seL4/refos/HEAD/impl/docs/doxygen/procserv.png -------------------------------------------------------------------------------- /impl/docs/doxygen/startup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seL4/refos/HEAD/impl/docs/doxygen/startup.png -------------------------------------------------------------------------------- /impl/docs/doxygen/timeserv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seL4/refos/HEAD/impl/docs/doxygen/timeserv.png -------------------------------------------------------------------------------- /impl/docs/doxygen/vmlayout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seL4/refos/HEAD/impl/docs/doxygen/vmlayout.png -------------------------------------------------------------------------------- /impl/apps/file_server/files/nhdat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seL4/refos/HEAD/impl/apps/file_server/files/nhdat -------------------------------------------------------------------------------- /impl/docs/doxygen/dispatcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seL4/refos/HEAD/impl/docs/doxygen/dispatcher.png -------------------------------------------------------------------------------- /impl/docs/doxygen/header-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seL4/refos/HEAD/impl/docs/doxygen/header-logo.png -------------------------------------------------------------------------------- /impl/docs/doxygen/testing_levels.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seL4/refos/HEAD/impl/docs/doxygen/testing_levels.png -------------------------------------------------------------------------------- /impl/docs/doxygen/component_design.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seL4/refos/HEAD/impl/docs/doxygen/component_design.png -------------------------------------------------------------------------------- /impl/docs/doxygen/dataspace_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seL4/refos/HEAD/impl/docs/doxygen/dataspace_example.png -------------------------------------------------------------------------------- /impl/apps/file_server/files/nethackrc: -------------------------------------------------------------------------------- 1 | # === OPTIONS for NETHACK === 2 | 3 | OPTIONS=number_pad:2 4 | OPTIONS=color,hilite_pet,lit_corridor 5 | OPTIONS=boulder:0,autodig -------------------------------------------------------------------------------- /impl/cidl_templates/enum.py: -------------------------------------------------------------------------------- 1 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 2 | # 3 | # SPDX-License-Identifier: BSD-2-Clause 4 | 5 | RPC_{{fname.upper()}}, 6 | -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/include/vis_tab.h: -------------------------------------------------------------------------------- 1 | /* This source file is generated by 'makedefs'. Do not edit. */ 2 | #ifdef VISION_TABLES 3 | 4 | #endif /* VISION_TABLES */ 5 | -------------------------------------------------------------------------------- /impl/libs/libvterm/src/encoding/uk.inc: -------------------------------------------------------------------------------- 1 | static const struct StaticTableEncoding encoding_uk = { 2 | { .decode = &decode_table }, 3 | { 4 | [0x23] = 0x00a3, 5 | } 6 | }; 7 | -------------------------------------------------------------------------------- /impl/libs/Kbuild: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | -include $(wildcard ${SEL4_LIBS_PATH}/*/Kbuild) 8 | -------------------------------------------------------------------------------- /impl/apps/Kbuild: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | -include $(wildcard ${SEL4_APPS_PATH}/*/Kbuild) 8 | 9 | -------------------------------------------------------------------------------- /impl/Kbuild: -------------------------------------------------------------------------------- 1 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 2 | # 3 | # SPDX-License-Identifier: BSD-2-Clause 4 | 5 | -include $(wildcard apps/*/Kbuild) 6 | -include $(wildcard libs/*/Kbuild) 7 | 8 | -------------------------------------------------------------------------------- /impl/libs/libvterm/Kbuild: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | libs-$(CONFIG_LIB_DATA_STRUCT) += libvterm 8 | 9 | libvterm: common 10 | -------------------------------------------------------------------------------- /design/extra.bib: -------------------------------------------------------------------------------- 1 | @Comment{$$Id: extra.bib,v 1.1 2007-02-03 05:56:45 gernot Exp $$} 2 | 3 | @Comment{References specific to this paper. 4 | Please use this sparingly, anything else than a one-off 5 | Should go into the group bib files!} 6 | -------------------------------------------------------------------------------- /impl/libs/libdatastruct/Kbuild: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | libs-$(CONFIG_LIB_DATA_STRUCT) += libdatastruct 8 | 9 | libdatastruct: common 10 | -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/src/vis_tab.c: -------------------------------------------------------------------------------- 1 | /* This source file is generated by 'makedefs'. Do not edit. */ 2 | #include "config.h" 3 | #ifdef VISION_TABLES 4 | #include "vis_tab.h" 5 | 6 | #endif /* VISION_TABLES */ 7 | 8 | /*vis_tab.c*/ 9 | -------------------------------------------------------------------------------- /impl/libs/librefossys/Kbuild: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | libs-$(CONFIG_LIB_REFOS_SYS) += librefossys 8 | 9 | librefossys: common librefos libutils 10 | -------------------------------------------------------------------------------- /impl/apps/snake/Kbuild: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | apps-$(CONFIG_APP_SNAKE) += snake 8 | 9 | snake: libmuslc libsel4 librefossys librefos libdatastruct 10 | -------------------------------------------------------------------------------- /impl/apps/tetris/Kbuild: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | apps-$(CONFIG_APP_TETRIS) += tetris 8 | 9 | tetris: libmuslc libsel4 librefossys librefos libdatastruct 10 | -------------------------------------------------------------------------------- /impl/libs/librefos/Kbuild: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | libs-$(CONFIG_LIB_REFOS) += librefos 8 | 9 | librefos: common libdatastruct libutils libplatsupport 10 | -------------------------------------------------------------------------------- /impl/apps/nethack/Kbuild: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | apps-$(CONFIG_APP_NETHACK) += nethack 8 | 9 | nethack: libmuslc libsel4 librefossys librefos libdatastruct 10 | -------------------------------------------------------------------------------- /impl/apps/test_os/Kbuild: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | apps-$(CONFIG_APP_TEST_OS) += test_os 8 | 9 | test_os: libmuslc libsel4 librefossys librefos libdatastruct 10 | -------------------------------------------------------------------------------- /impl/apps/terminal/Kbuild: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | apps-$(CONFIG_APP_TERMINAL) += terminal 8 | 9 | terminal: libmuslc libsel4 librefossys librefos libdatastruct 10 | -------------------------------------------------------------------------------- /impl/apps/test_user/Kbuild: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | apps-$(CONFIG_APP_TEST_USER) += test_user 8 | 9 | test_user: libmuslc libsel4 librefossys librefos libdatastruct 10 | -------------------------------------------------------------------------------- /impl/apps/selfloader/Kbuild: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | apps-$(CONFIG_APP_SELF_LOADER) += selfloader 8 | 9 | selfloader: libmuslc libsel4 libelf librefossys librefos libdatastruct 10 | 11 | -------------------------------------------------------------------------------- /impl/apps/file_server/Kbuild: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | apps-$(CONFIG_APP_FILE_SERVER) += file_server 8 | 9 | file_server: libmuslc libsel4 libelf librefossys librefos libcpio libdatastruct 10 | -------------------------------------------------------------------------------- /impl/cidl_templates/dispatcher.py: -------------------------------------------------------------------------------- 1 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 2 | # 3 | # SPDX-License-Identifier: BSD-2-Clause 4 | 5 | ________case RPC_{{fname.upper()}}:\n 6 | ____________assert({{fname}}_handler);\n 7 | ____________server_{{fname}}(rpc_userptr);\n 8 | ____________break; 9 | -------------------------------------------------------------------------------- /impl/docs/doxygen/style.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * SPDX-License-Identifier: BSD-2-Clause 4 | */ 5 | 6 | body, table, div, p, dl { 7 | font-size: 12px; 8 | } 9 | 10 | .memproto { 11 | background-image: none; 12 | padding: 1px 0px; 13 | } -------------------------------------------------------------------------------- /impl/libs/librefos/src/error.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #include 8 | 9 | /*! @file 10 | @brief RefOS Error codes. */ 11 | 12 | refos_err_t _refos_errno = ESUCCESS; 13 | -------------------------------------------------------------------------------- /impl/apps/timer_server/Kbuild: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | apps-$(CONFIG_APP_TIMER_SERVER) += timer_server 8 | 9 | timer_server: common libmuslc libsel4 librefossys librefos libdatastruct libplatsupport 10 | -------------------------------------------------------------------------------- /impl/apps/console_server/Kbuild: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | apps-$(CONFIG_APP_CONSOLE_SERVER) += console_server 8 | 9 | console_server: common libmuslc libsel4 librefossys librefos libdatastruct libplatsupport libvterm 10 | -------------------------------------------------------------------------------- /impl/apps/file_server/files/news: -------------------------------------------------------------------------------- 1 | ---- RefOS NetHack ---- 2 | 3 | Welcome to NetHack for RefOS! 4 | 5 | This is an unofficial port of NetHack 3.4.3 for RefOS. 6 | Not all of the functionality works, but the game 7 | should be somewhat playable. 8 | 9 | Type #quit to quit and return to terminal. 10 | 11 | Enjoy! 12 | -------------------------------------------------------------------------------- /impl/libs/librefossys/include/refos-io/timer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef _REFOS_IO_TIMER_H_ 8 | #define _REFOS_IO_TIMER_H_ 9 | 10 | void refos_init_timer(char *dspacePath); 11 | 12 | #endif /* _REFOS_IO_TIMER_H_ */ -------------------------------------------------------------------------------- /impl/apps/terminal/src/print_time.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef _TERMINAL_PRINT_TIME_H 8 | #define _TERMINAL_PRINT_TIME_H 9 | 10 | char * refos_print_time (struct tm *tm); 11 | 12 | #endif /* _TERMINAL_PRINT_TIME_H */ 13 | -------------------------------------------------------------------------------- /.github/workflows/pr.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2025, Proofcraft Pty Ltd 2 | # 3 | # SPDX-License-Identifier: BSD-2-Clause 4 | 5 | # Actions to run on pull requests 6 | 7 | name: PR 8 | 9 | on: [pull_request, workflow_dispatch] 10 | 11 | jobs: 12 | pr-checks: 13 | name: Checks 14 | uses: seL4/ci-actions/.github/workflows/pr.yml@master 15 | -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/include/qt_kde0.h: -------------------------------------------------------------------------------- 1 | /* SCCS Id: @(#)qt_kde0.h 3.4 1999/11/19 */ 2 | /* Copyright (c) Warwick Allison, 1999. */ 3 | /* NetHack may be freely redistributed. See license for details. */ 4 | 5 | #ifndef QT_DUMMYKDE 6 | #define QT_DUMMYKDE 7 | class KTopLevelWidget : public QMainWindow { 8 | Q_OBJECT 9 | }; 10 | #endif 11 | -------------------------------------------------------------------------------- /impl/libs/librefossys/src/sys_yield.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | long sys_sched_yield(va_list ap) { 13 | seL4_Yield(); 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/include/coord.h: -------------------------------------------------------------------------------- 1 | /* SCCS Id: @(#)coord.h 3.4 1990/02/22 */ 2 | /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ 3 | /* NetHack may be freely redistributed. See license for details. */ 4 | 5 | #ifndef COORD_H 6 | #define COORD_H 7 | 8 | typedef struct nhcoord { 9 | xchar x,y; 10 | } coord; 11 | 12 | #endif /* COORD_H */ 13 | -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/include/rect.h: -------------------------------------------------------------------------------- 1 | /* SCCS Id: @(#)rect.h 3.4 1990/02/22 */ 2 | /* Copyright (c) 1990 by Jean-Christophe Collet */ 3 | /* NetHack may be freely redistributed. See license for details. */ 4 | 5 | #ifndef RECT_H 6 | #define RECT_H 7 | 8 | typedef struct nhrect { 9 | xchar lx, ly; 10 | xchar hx, hy; 11 | } NhRect; 12 | 13 | #endif /* RECT_H */ 14 | -------------------------------------------------------------------------------- /.github/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | 6 | 7 | # Code of Conduct 8 | 9 | This repository and interactions with it fall under the [seL4 Code of Conduct][1] available from the [seL4 website][2]. 10 | 11 | [1]: https://docs.sel4.systems/processes/conduct.html 12 | [2]: https://sel4.systems 13 | -------------------------------------------------------------------------------- /impl/apps/nethack/Kconfig: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | config APP_NETHACK 8 | bool "Nethack 3.4.3" 9 | default n 10 | depends on LIB_SEL4 && HAVE_LIBC && LIB_REFOS 11 | help 12 | Nethack on RefOS. This is a port of the classic roguelike game 13 | Nethack. Not all functionality may be available. -------------------------------------------------------------------------------- /.github/workflows/push.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 2 | # 3 | # SPDX-License-Identifier: BSD-2-Clause 4 | 5 | # Actions to run on Push and Pull Request 6 | name: CI 7 | 8 | on: 9 | push: 10 | branches: 11 | - master 12 | pull_request: 13 | workflow_dispatch: 14 | 15 | jobs: 16 | checks: 17 | name: Checks 18 | uses: seL4/ci-actions/.github/workflows/push.yml@master 19 | -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/include/emin.h: -------------------------------------------------------------------------------- 1 | /* SCCS Id: @(#)emin.h 3.4 1997/05/01 */ 2 | /* Copyright (c) David Cohrs, 1990. */ 3 | /* NetHack may be freely redistributed. See license for details. */ 4 | 5 | #ifndef EMIN_H 6 | #define EMIN_H 7 | 8 | struct emin { 9 | aligntyp min_align; /* alignment of minion */ 10 | }; 11 | 12 | #define EMIN(mon) ((struct emin *)&(mon)->mextra[0]) 13 | 14 | #endif /* EMIN_H */ 15 | -------------------------------------------------------------------------------- /impl/apps/terminal/Kconfig: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | config APP_TERMINAL 8 | bool "RefOS Terminal" 9 | default y 10 | depends on LIB_SEL4 && HAVE_LIBC && LIB_REFOS 11 | select HAVE_SEL4_APPS 12 | select APP_BOOTSTRAP 13 | select APP_FILE_SERVER 14 | select APP_PROCESS_SERVER 15 | help 16 | Simple terminal program for RefOS. 17 | -------------------------------------------------------------------------------- /impl/docs/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 2 | # 3 | # SPDX-License-Identifier: BSD-2-Clause 4 | 5 | all: 6 | doxygen 7 | 8 | gui: 9 | doxywizard Doxyfile 10 | 11 | clean: 12 | rm -rf html 13 | 14 | help: 15 | @echo 'make all - Make RefOS docs.' 16 | @echo 'make gui - Start doxygen GUI interface and open doxygen config file.' 17 | @echo 'make clean - Clean all RefOS docs.' 18 | @echo 'make help - Display this help message.' 19 | -------------------------------------------------------------------------------- /impl/apps/file_server/Kconfig: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | config APP_FILE_SERVER 8 | bool "RefOS File Server" 9 | default y 10 | depends on LIB_SEL4 && HAVE_LIBC && LIB_CPIO && LIB_ELF && LIB_REFOS_SYS 11 | select HAVE_SEL4_APPS 12 | select APP_PROCESS_SERVER 13 | help 14 | Simple file server for RefOS, which relies on DITE to pre-store files. 15 | -------------------------------------------------------------------------------- /impl/apps/timer_server/Kconfig: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | config APP_TIMER_SERVER 8 | bool "RefOS Timer Server" 9 | default y 10 | depends on LIB_SEL4 && HAVE_LIBC && LIB_SEL4_PLAT_SUPPORT && LIB_REFOS_SYS 11 | select HAVE_SEL4_APPS 12 | select APP_PROCESS_SERVER 13 | help 14 | Timer server for RefOS, which exposes simple timer functionality. 15 | -------------------------------------------------------------------------------- /impl/libs/librefos/Kconfig: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | menuconfig LIB_REFOS 8 | bool "RefOS System Library" 9 | depends on LIB_SEL4 && HAVE_LIBC && LIB_DATA_STRUCT 10 | default y 11 | help 12 | RefOS System Library, containing a vide variety of things from RPC communications headers 13 | to utility libraries. You'll most definitely want this enabled. 14 | -------------------------------------------------------------------------------- /impl/apps/snake/Kconfig: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | config APP_SNAKE 8 | bool "Snake" 9 | default y 10 | depends on LIB_SEL4 && HAVE_LIBC && LIB_REFOS 11 | help 12 | Snake game for RefOS. Drawing done using ANSI. 13 | The Snake game is a demo for RefOS, showcasing UNIX-like dataspace 14 | printf, input functionality, and timer sleep functionality. 15 | -------------------------------------------------------------------------------- /impl/libs/libdatastruct/include/data_struct/csstring.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef _CSTATICSTRING_H_ 8 | #define _CSTATICSTRING_H_ 9 | 10 | #ifndef C_STATIC_STRING_MAXLEN 11 | #define C_STATIC_STRING_MAXLEN 64 12 | #endif 13 | 14 | typedef struct csstring_s { 15 | char str[C_STATIC_STRING_MAXLEN]; 16 | } csstring_t; 17 | 18 | #endif /* _CSTATICSTRING_H_ */ 19 | 20 | -------------------------------------------------------------------------------- /impl/Kconfig: -------------------------------------------------------------------------------- 1 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 2 | # 3 | # SPDX-License-Identifier: BSD-2-Clause 4 | 5 | # This file defines the Kconfig menu structure. 6 | 7 | mainmenu "Project Configuration" 8 | 9 | menu "seL4 Kernel" 10 | source "kernel/Kconfig" 11 | endmenu 12 | 13 | config COMMON_PATH 14 | string 15 | option env="COMMON_PATH" 16 | 17 | source libs/Kconfig 18 | source apps/Kconfig 19 | source tools/elfloader/Kconfig 20 | source "$COMMON_PATH/Kconfig" 21 | -------------------------------------------------------------------------------- /impl/apps/tetris/Kconfig: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | config APP_TETRIS 8 | bool "Tetris" 9 | default y 10 | depends on LIB_SEL4 && HAVE_LIBC && LIB_REFOS 11 | help 12 | Tetris game for RefOS. Drawing done using ANSI. 13 | The Tetris game is a demo for RefOS, showcasing UNIX-like dataspace 14 | printf, input functionality, and timer sleep functionality. 15 | -------------------------------------------------------------------------------- /impl/libs/librefossys/include/refos-io/morecore.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef _REFOS_IO_MORECORE_H_ 8 | #define _REFOS_IO_MORECORE_H_ 9 | 10 | struct sl_procinfo_s; 11 | 12 | void refosio_setup_morecore_override(char *mmapRegion, unsigned int mmapRegionSize); 13 | 14 | void refosio_init_morecore(struct sl_procinfo_s *procInfo); 15 | 16 | #endif /* _REFOS_IO_MORECORE_H_ */ 17 | 18 | -------------------------------------------------------------------------------- /impl/apps/console_server/Kconfig: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | config APP_CONSOLE_SERVER 8 | bool "RefOS Console Server" 9 | default y 10 | depends on LIB_SEL4 && HAVE_LIBC && LIB_SEL4_PLAT_SUPPORT && LIB_REFOS_SYS 11 | select HAVE_SEL4_APPS 12 | select APP_PROCESS_SERVER 13 | help 14 | Low level console server for Refos, which exposes a input/output consoel device 15 | for the system. 16 | -------------------------------------------------------------------------------- /impl/libs/libdatastruct/Kconfig: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | config LIB_DATA_STRUCT 8 | bool "Build C Data Structures" 9 | depends on LIB_SEL4 && HAVE_LIBC 10 | default y 11 | help 12 | Helper library containing various data structures 13 | that are useful but aren't included in C stdlib. 14 | These include vectors, hash tables, free list 15 | allocation, bitfield allocation, and so forth. 16 | -------------------------------------------------------------------------------- /impl/apps/test_os/Kconfig: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | config APP_TEST_OS 8 | bool "RefOS OS Level Unit Tests" 9 | default y 10 | depends on LIB_SEL4 && HAVE_LIBC && LIB_REFOS 11 | help 12 | OS Level Unit tests for RefOS. These tests test that the bottom level RefOS environment 13 | is working. If this test fails, then bootloading is likely to fail, and userland tests 14 | may fail to even boot at all. 15 | -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/include/winGnome.h: -------------------------------------------------------------------------------- 1 | /* SCCS Id: @(#)winGnome.h 3.4. 2000/07/16 */ 2 | /* Copyright (C) 1998 by Erik Andersen */ 3 | /* Copyright (C) 1998 by Anthony Taylor */ 4 | /* NetHack may be freely redistributed. See license for details. */ 5 | 6 | #ifndef WINGNOME_H 7 | #define WINGNOME_H 8 | 9 | #define E extern 10 | 11 | E struct window_procs Gnome_procs; 12 | 13 | #undef E 14 | 15 | #define NHW_WORN 6 16 | extern winid WIN_WORN; 17 | 18 | #endif /* WINGNOME_H */ 19 | -------------------------------------------------------------------------------- /impl/libs/librefossys/src/sys_abort.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | #define DPRINTF_SERVER_NAME "" 12 | #include 13 | 14 | void 15 | sys_abort(void) 16 | { 17 | seL4_DebugPrintf("RefOS HALT.\n"); 18 | 19 | #if defined(SEL4_DEBUG_KERNEL) 20 | seL4_DebugHalt(); 21 | #endif 22 | 23 | while (1); /* We don't return after this */ 24 | } 25 | -------------------------------------------------------------------------------- /impl/cidl_templates/client_header.py: -------------------------------------------------------------------------------- 1 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 2 | # 3 | # SPDX-License-Identifier: BSD-2-Clause 4 | 5 | {{if len(comment_text) > 0}} 6 | /*{{comment_text}} */\n 7 | {{endif}} 8 | 9 | {{py: first = True}} 10 | {{return_type}} {{fname}}( 11 | {{for type, itype, name, mode, dr, apfx, aref, apsfx in calist}} 12 | {{if first}} 13 | {{py: first = False}} 14 | {{else}} 15 | , 16 | {{endif}} 17 | {{type}} {{name}} 18 | {{endfor}} 19 | ); 20 | \n 21 | -------------------------------------------------------------------------------- /impl/apps/selfloader/Kconfig: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | config APP_SELF_LOADER 8 | bool "RefOS Self Loader" 9 | default y 10 | depends on LIB_SEL4 && HAVE_LIBC && LIB_REFOS_SYS 11 | select HAVE_SEL4_APPS 12 | select APP_PROCESS_SERVER 13 | help 14 | Self loader code for loading processes. Starts in the staring process' own vspace, 15 | and loads the process's ELF segments from within. Needed to start RefOS userland processes. 16 | -------------------------------------------------------------------------------- /impl/apps/test_os/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | # Targets 8 | TARGETS := test_os.bin 9 | 10 | # Source files required to build the target 11 | CFILES := $(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/src/*.c)) 12 | 13 | NK_CFLAGS += -O2 14 | 15 | # Libraries required to build the target 16 | LIBS := c sel4 refossys refos datastruct 17 | 18 | # Custom linker script 19 | NK_LDFLAGS += -T $(SOURCE_DIR)/linker.lds 20 | 21 | include $(SEL4_COMMON)/common.mk 22 | -------------------------------------------------------------------------------- /impl/apps/test_user/Kconfig: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | config APP_TEST_USER 8 | bool "RefOS User Level Unit Tests" 9 | default y 10 | depends on LIB_SEL4 && HAVE_LIBC && LIB_REFOS_SYS 11 | select HAVE_SEL4_APPS 12 | help 13 | Tests that test the bootstrapped RefOS userland environment is sane and usable. 14 | Tests include dynamic malloc() using both heap expansion and mmap, threads, 15 | IPC os_server printing, and so forth. 16 | -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/include/macpopup.h: -------------------------------------------------------------------------------- 1 | /* SCCS Id: @(#)macpopup.h 3.4 1999/10/25 */ 2 | /* Copyright (c) Nethack Develpment Team, 1999. */ 3 | /* NetHack may be freely redistributed. See license for details. */ 4 | 5 | #ifndef MACPOPUP_H 6 | # define MACPOPUP_H 7 | 8 | /* ### mmodal.c ### */ 9 | 10 | extern void FlashButton(DialogRef, short); 11 | extern char queued_resp(char *resp); 12 | extern char topl_yn_function(const char *query, const char *resp, char def); 13 | extern int get_line_from_key_queue(char *bufp); 14 | 15 | #endif /* MACPOPUP_H */ 16 | -------------------------------------------------------------------------------- /impl/apps/selfloader/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | # Targets 8 | TARGETS := selfloader.bin 9 | 10 | # Source files required to build the target 11 | CFILES := $(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/src/*.c)) 12 | 13 | NK_CFLAGS += -O2 14 | 15 | # Libraries required to build the target 16 | LIBS := c sel4 elf refossys refos datastruct 17 | 18 | # Custom linker script 19 | NK_LDFLAGS += -T $(SOURCE_DIR)/linker.lds 20 | 21 | include $(SEL4_COMMON)/common.mk 22 | -------------------------------------------------------------------------------- /impl/apps/snake/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | # Targets 8 | TARGETS := snake.bin 9 | 10 | # Source files required to build the target 11 | CFILES := $(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/src/*.c)) 12 | 13 | NK_CFLAGS += -D_BSD_SOURCE -O2 14 | 15 | # Libraries required to build the target 16 | LIBS := c sel4 refossys refos datastruct 17 | 18 | # Custom linker script 19 | NK_LDFLAGS += -T $(SOURCE_DIR)/linker.lds 20 | 21 | include $(SEL4_COMMON)/common.mk 22 | -------------------------------------------------------------------------------- /impl/libs/libvterm/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | # Targets 8 | TARGETS := libvterm.a 9 | 10 | # Source files required to build the target 11 | CFILES := $(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/src/*.c)) 12 | CFILES += $(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/src/*/*.c)) 13 | 14 | # Header files/directories this library provides 15 | HDRFILES := $(wildcard $(SOURCE_DIR)/include/*) 16 | 17 | CFLAGS := -O2 18 | 19 | include $(SEL4_COMMON)/common.mk 20 | -------------------------------------------------------------------------------- /impl/apps/tetris/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | # Targets 8 | TARGETS := tetris.bin 9 | 10 | # Source files required to build the target 11 | CFILES := $(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/src/*.c)) 12 | 13 | NK_CFLAGS += -D_BSD_SOURCE -O2 14 | 15 | # Libraries required to build the target 16 | LIBS := c sel4 refossys refos datastruct 17 | 18 | # Custom linker script 19 | NK_LDFLAGS += -T $(SOURCE_DIR)/linker.lds 20 | 21 | include $(SEL4_COMMON)/common.mk 22 | -------------------------------------------------------------------------------- /impl/apps/process_server/src/test/test_addrspace.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef _REFOS_PROCESS_SERVER_TEST_ADDRSPACE_H_ 8 | #define _REFOS_PROCESS_SERVER_TEST_ADDRSPACE_H_ 9 | 10 | #include 11 | #include "test.h" 12 | 13 | #ifdef CONFIG_REFOS_RUN_TESTS 14 | 15 | int test_pd(void); 16 | 17 | int test_vspace(int run); 18 | 19 | int test_vspace_mapping(void); 20 | 21 | #endif /* CONFIG_REFOS_RUN_TESTS */ 22 | 23 | #endif /* _REFOS_PROCESS_SERVER_TEST_ADDRSPACE_H_ */ -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/sys/share/Makefile.lib: -------------------------------------------------------------------------------- 1 | # SCCS Id: @(#)Makefile.lib 3.4 1990/22/02 2 | # Nethack makefile for Fred fish termlib -- Norman Meluch 3 | # 4 | CC = cl /c 5 | MODEL = L 6 | CFLAGS = /A$(MODEL) /Os /Oa /Gs /Zp1 /W0 7 | # 8 | # Termcap routines. 9 | TERMLIB = termlib.lib 10 | # 11 | TL_LOBJECTS = tgetent.o tgetflag.o tgetnum.o \ 12 | tgetstr.o tgoto.o tputs.o \ 13 | isdigit.o fgetlr.o 14 | # 15 | .SUFFIXES: .exe .o .c .obj .asm 16 | # 17 | .c.o: 18 | $(CC) $(CFLAGS) /Fo$*.o $*.c 19 | # 20 | $(TERMLIB): $(TL_LOBJECTS) 21 | lib $(TERMLIB) -+ $(TL_LOBJECTS); 22 | -------------------------------------------------------------------------------- /impl/apps/terminal/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | # Targets 8 | TARGETS := terminal.bin 9 | 10 | # Source files required to build the target 11 | CFILES := $(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/src/*.c)) 12 | 13 | NK_CFLAGS += -O2 -D_XOPEN_SOURCE=700 14 | 15 | # Libraries required to build the target 16 | LIBS := c sel4 refossys refos datastruct 17 | 18 | # Custom linker script 19 | NK_LDFLAGS += -T $(SOURCE_DIR)/linker.lds 20 | 21 | include $(SEL4_COMMON)/common.mk 22 | -------------------------------------------------------------------------------- /impl/apps/process_server/src/test/test_process.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef _REFOS_PROCESS_SERVER_TEST_PROCESS_MODULE_H_ 8 | #define _REFOS_PROCESS_SERVER_TEST_PROCESS_MODULE_H_ 9 | 10 | #include 11 | #include "test.h" 12 | 13 | #ifdef CONFIG_REFOS_RUN_TESTS 14 | 15 | int test_pid(void); 16 | 17 | int test_thread(void); 18 | 19 | int test_proc_client_watch(void); 20 | 21 | #endif /* CONFIG_REFOS_RUN_TESTS */ 22 | 23 | #endif /* _REFOS_PROCESS_SERVER_TEST_PROCESS_MODULE_H_ */ -------------------------------------------------------------------------------- /impl/libs/librefos/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | # Targets 8 | TARGETS := librefos.a 9 | 10 | # Source files required to build the target 11 | CFILES := $(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/src/*.c)) 12 | CFILES += $(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/src/*/*.c)) 13 | 14 | # Header files/directories this library provides 15 | HDRFILES := $(wildcard $(SOURCE_DIR)/include/*) 16 | 17 | CFLAGS += -O2 -D_XOPEN_SOURCE=700 18 | 19 | include $(SEL4_COMMON)/common.mk 20 | -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/include/micro.h: -------------------------------------------------------------------------------- 1 | /* SCCS Id: @(#)micro.h 3.4 1990/02/22 */ 2 | /* micro.h - function declarations for various microcomputers */ 3 | /* NetHack may be freely redistributed. See license for details. */ 4 | 5 | #ifndef MICRO_H 6 | #define MICRO_H 7 | 8 | extern const char *alllevels, *allbones; 9 | extern char levels[], bones[], permbones[], hackdir[]; 10 | 11 | extern int ramdisk; 12 | 13 | #ifndef C 14 | #define C(c) (0x1f & (c)) 15 | #endif 16 | #ifndef M 17 | #define M(c) (((char)0x80) | (c)) 18 | #endif 19 | #define ABORT C('a') 20 | 21 | #endif /* MICRO_H */ 22 | -------------------------------------------------------------------------------- /impl/apps/test_user/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | # Targets 8 | TARGETS := test_user.bin 9 | 10 | # Source files required to build the target 11 | CFILES := $(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/src/*.c)) 12 | 13 | NK_CFLAGS += -D_BSD_SOURCE -D_GNU_SOURCE -O2 14 | 15 | # Libraries required to build the target 16 | LIBS := c sel4 refossys refos datastruct 17 | 18 | # Custom linker script 19 | NK_LDFLAGS += -T $(SOURCE_DIR)/linker.lds 20 | 21 | include $(SEL4_COMMON)/common.mk 22 | -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/include/date.h: -------------------------------------------------------------------------------- 1 | /* SCCS Id: @(#)date.h 3.4 2002/02/03 */ 2 | 3 | /* This source file is generated by 'makedefs'. Do not edit. */ 4 | #define BUILD_DATE "Fri Sep 26 00:58:25 2014" 5 | #define BUILD_TIME (1411657105L) 6 | 7 | #define VERSION_NUMBER 0x03040300UL 8 | #define VERSION_FEATURES 0x001e0cc6UL 9 | #define IGNORED_FEATURES 0x00800000UL 10 | #define VERSION_SANITY1 0x211b117eUL 11 | #define VERSION_SANITY2 0xa48195c8UL 12 | 13 | #define VERSION_STRING "3.4.3" 14 | #define VERSION_ID \ 15 | "Unix NetHack Version 3.4.3 - last build Fri Sep 26 00:58:25 2014." 16 | 17 | -------------------------------------------------------------------------------- /impl/libs/libdatastruct/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | # Targets 8 | TARGETS := libdatastruct.a 9 | 10 | # Source files required to build the target 11 | CFILES := $(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/src/*.c)) 12 | CFILES += $(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/src/*/*.c)) 13 | 14 | # Header files/directories this library provides 15 | HDRFILES := $(wildcard $(SOURCE_DIR)/include/*) 16 | 17 | CFLAGS := -O2 -D_XOPEN_SOURCE=700 18 | 19 | include $(SEL4_COMMON)/common.mk 20 | -------------------------------------------------------------------------------- /impl/libs/libvterm/Kconfig: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | config LIB_VTERM 8 | bool "Virtual terminal library" 9 | depends on HAVE_LIBC 10 | default y 11 | help 12 | Port of libvterm by Paul "LeoNerd" Evans, a C99 virtual terminal emulator library released 13 | under the MIT license. As the library uses abstract C99 with no dependance on any POSIX or 14 | any rendering / UI system, no changes to the library code was required; only the build 15 | system has been adapted. 16 | -------------------------------------------------------------------------------- /impl/apps/process_server/src/test/test.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | /*! @file 8 | @brief Process server root task unit test module. 9 | 10 | Runs all the individual unit tests for the process server modules. 11 | */ 12 | 13 | #ifndef _REFOS_PROCESS_SERVER_TEST_TEST_H_ 14 | #define _REFOS_PROCESS_SERVER_TEST_TEST_H_ 15 | 16 | #include "../common.h" 17 | 18 | /*! @brief Runs all the process server root task tests. */ 19 | void test_run_all(void); 20 | 21 | #endif /* _REFOS_PROCESS_SERVER_TEST_TEST_H_ */ 22 | -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/include/tile2x11.h: -------------------------------------------------------------------------------- 1 | /* SCCS Id: @(#)tile2x11.h 3.4 1995/01/25 */ 2 | /* NetHack may be freely redistributed. See license for details. */ 3 | 4 | #ifndef TILE2X11_H 5 | #define TILE2X11_H 6 | 7 | /* 8 | * Header for the x11 tile map. 9 | */ 10 | typedef struct { 11 | unsigned long version; 12 | unsigned long ncolors; 13 | unsigned long tile_width; 14 | unsigned long tile_height; 15 | unsigned long ntiles; 16 | unsigned long per_row; 17 | } x11_header; 18 | 19 | /* how wide each row in the tile file is, in tiles */ 20 | #define TILES_PER_ROW (40) 21 | 22 | #endif /* TILE2X11_H */ 23 | -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/include/func_tab.h: -------------------------------------------------------------------------------- 1 | /* SCCS Id: @(#)func_tab.h 3.4 1992/04/03 */ 2 | /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ 3 | /* NetHack may be freely redistributed. See license for details. */ 4 | 5 | #ifndef FUNC_TAB_H 6 | #define FUNC_TAB_H 7 | 8 | struct func_tab { 9 | char f_char; 10 | boolean can_if_buried; 11 | int NDECL((*f_funct)); 12 | const char *f_text; 13 | }; 14 | 15 | struct ext_func_tab { 16 | const char *ef_txt, *ef_desc; 17 | int NDECL((*ef_funct)); 18 | boolean can_if_buried; 19 | }; 20 | 21 | extern struct ext_func_tab extcmdlist[]; 22 | 23 | #endif /* FUNC_TAB_H */ 24 | -------------------------------------------------------------------------------- /impl/cidl_templates/dispatcher_container.py: -------------------------------------------------------------------------------- 1 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 2 | # 3 | # SPDX-License-Identifier: BSD-2-Clause 4 | 5 | // DO NOT EDIT MANUALLY!!!\n 6 | // This file was generated by CIDL - Simple C IDL Compiler.\n\n 7 | 8 | {{for include in includes}} 9 | {{include}}\n 10 | {{endfor}} 11 | \n\n 12 | 13 | int rpc_sv_{{ifname}}_dispatcher(void *rpc_userptr, uint32_t label) {\n 14 | ____switch (label) {\n 15 | 16 | {{for func_output in func_list}} 17 | {{func_output}}\n 18 | {{endfor}} 19 | 20 | ________default:\n 21 | ____________return -1;\n 22 | ____}\n 23 | ____return 0;\n 24 | } 25 | \n 26 | -------------------------------------------------------------------------------- /impl/libs/libdatastruct/include/data_struct/cmacros.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef _CMACROUTILS_H_ 8 | #define _CMACROUTILS_H_ 9 | 10 | #ifdef _MIN 11 | #define _MIN(a,b) (((a)<(b))?(a):(b)) 12 | #endif 13 | #ifndef _MAX 14 | #define _MAX(a,b) (((a)>(b))?(a):(b)) 15 | #endif 16 | #ifndef _MiB 17 | #define _MiB(x) (1024*1024*(x)) 18 | #endif 19 | #ifndef _ALIGN 20 | #define _ALIGN(x, y) ((y) % (x) == 0 ? (y) : (y) - ((y) % (x)) + (x)) 21 | #endif 22 | 23 | #ifdef PAGE_SIZE 24 | #define _PAGE_ALIGN(x) ((x) & ~(PAGE_SIZE - 1)) 25 | #endif 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/sys/share/dgn_comp.h: -------------------------------------------------------------------------------- 1 | #define INTEGER 257 2 | #define A_DUNGEON 258 3 | #define BRANCH 259 4 | #define CHBRANCH 260 5 | #define LEVEL 261 6 | #define RNDLEVEL 262 7 | #define CHLEVEL 263 8 | #define RNDCHLEVEL 264 9 | #define UP_OR_DOWN 265 10 | #define PROTOFILE 266 11 | #define DESCRIPTION 267 12 | #define DESCRIPTOR 268 13 | #define LEVELDESC 269 14 | #define ALIGNMENT 270 15 | #define LEVALIGN 271 16 | #define ENTRY 272 17 | #define STAIR 273 18 | #define NO_UP 274 19 | #define NO_DOWN 275 20 | #define PORTAL 276 21 | #define STRING 277 22 | typedef union 23 | { 24 | int i; 25 | char* str; 26 | } YYSTYPE; 27 | extern YYSTYPE yylval; 28 | -------------------------------------------------------------------------------- /impl/apps/file_server/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | # Targets 8 | TARGETS := file_server.bin 9 | 10 | # Source files required to build the target 11 | CFILES := $(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/src/*.c)) 12 | CFILES += $(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/src/*/*.c)) 13 | 14 | OFILES := archive.o 15 | NK_CFLAGS += -O2 16 | 17 | # Libraries required to build the target 18 | LIBS := c sel4 elf refossys refos cpio datastruct 19 | 20 | # Custom linker script 21 | NK_LDFLAGS += -T $(SOURCE_DIR)/linker.lds 22 | 23 | include $(SEL4_COMMON)/common.mk 24 | -------------------------------------------------------------------------------- /impl/apps/nethack/linker.lds: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | ENTRY(_start) 8 | 9 | SECTIONS 10 | { 11 | PROVIDE (__executable_start = 0x8000); 12 | . = 0x8000; 13 | 14 | /* Code. */ 15 | .text : ALIGN(4096) { 16 | _text = .; 17 | *(.text*) 18 | } 19 | 20 | /* Read Only Data. */ 21 | .rodata : ALIGN(4096) { 22 | . = ALIGN(32); 23 | *(.rodata*) 24 | } 25 | 26 | /* Data / BSS */ 27 | .data : ALIGN(4096) { 28 | *(.data) 29 | } 30 | .bss : ALIGN(4096) { 31 | *(.bss) 32 | *(COMMON) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /impl/apps/snake/linker.lds: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | ENTRY(_start) 8 | 9 | SECTIONS 10 | { 11 | PROVIDE (__executable_start = 0x8000); 12 | . = 0x8000; 13 | 14 | /* Code. */ 15 | .text : ALIGN(4096) { 16 | _text = .; 17 | *(.text*) 18 | } 19 | 20 | /* Read Only Data. */ 21 | .rodata : ALIGN(4096) { 22 | . = ALIGN(32); 23 | *(.rodata*) 24 | } 25 | 26 | /* Data / BSS */ 27 | .data : ALIGN(4096) { 28 | *(.data) 29 | } 30 | .bss : ALIGN(4096) { 31 | *(.bss) 32 | *(COMMON) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /impl/apps/test_os/linker.lds: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | ENTRY(_start) 8 | 9 | SECTIONS 10 | { 11 | PROVIDE (__executable_start = 0x8000); 12 | . = 0x8000; 13 | 14 | /* Code. */ 15 | .text : ALIGN(4096) { 16 | _text = .; 17 | *(.text*) 18 | } 19 | 20 | /* Read Only Data. */ 21 | .rodata : ALIGN(4096) { 22 | . = ALIGN(32); 23 | *(.rodata*) 24 | } 25 | 26 | /* Data / BSS */ 27 | .data : ALIGN(4096) { 28 | *(.data) 29 | } 30 | .bss : ALIGN(4096) { 31 | *(.bss) 32 | *(COMMON) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /impl/apps/tetris/linker.lds: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | ENTRY(_start) 8 | 9 | SECTIONS 10 | { 11 | PROVIDE (__executable_start = 0x8000); 12 | . = 0x8000; 13 | 14 | /* Code. */ 15 | .text : ALIGN(4096) { 16 | _text = .; 17 | *(.text*) 18 | } 19 | 20 | /* Read Only Data. */ 21 | .rodata : ALIGN(4096) { 22 | . = ALIGN(32); 23 | *(.rodata*) 24 | } 25 | 26 | /* Data / BSS */ 27 | .data : ALIGN(4096) { 28 | *(.data) 29 | } 30 | .bss : ALIGN(4096) { 31 | *(.bss) 32 | *(COMMON) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /impl/libs/librefossys/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | # Targets 8 | TARGETS := librefossys.a 9 | 10 | # Source files required to build the target 11 | CFILES := $(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/src/*.c)) 12 | CFILES += $(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/src/*/*.c)) 13 | CFILES += $(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/src/arch/${ARCH}/*.c)) 14 | 15 | # Header files/directories this library provides 16 | HDRFILES := $(wildcard $(SOURCE_DIR)/include/*) 17 | 18 | NK_CFLAGS += -D_XOPEN_SOURCE=700 -O2 19 | 20 | include $(SEL4_COMMON)/common.mk 21 | -------------------------------------------------------------------------------- /impl/libs/librefossys/src/sys_thread.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #include 8 | 9 | /* Future Work 2: 10 | Find out why calls to assert_fail() call printf() and result 11 | in another call to assert_fail() on x86 architecture. assert_fail() 12 | correctly calls printf(), but this call to printf() erroneously 13 | calls assert_fail() which results in infinite recursion. Calls to 14 | printf() work fine in other parts of RefOS. 15 | */ 16 | long sys_set_thread_area(va_list ap) { 17 | return 0; 18 | } 19 | long sys_set_tid_address(va_list ap) { 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /impl/apps/file_server/linker.lds: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | ENTRY(_start) 8 | 9 | SECTIONS 10 | { 11 | PROVIDE (__executable_start = 0x8000); 12 | . = 0x8000; 13 | 14 | /* Code. */ 15 | .text : ALIGN(4096) { 16 | _text = .; 17 | *(.text*) 18 | } 19 | 20 | /* Read Only Data. */ 21 | .rodata : ALIGN(4096) { 22 | . = ALIGN(32); 23 | *(.rodata*) 24 | } 25 | 26 | /* Data / BSS */ 27 | .data : ALIGN(4096) { 28 | *(.data) 29 | } 30 | .bss : ALIGN(4096) { 31 | *(.bss) 32 | *(COMMON) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /impl/apps/terminal/linker.lds: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | ENTRY(_start) 8 | 9 | SECTIONS 10 | { 11 | PROVIDE (__executable_start = 0x8000); 12 | . = 0x8000; 13 | 14 | /* Code. */ 15 | .text : ALIGN(4096) { 16 | _text = .; 17 | *(.text*) 18 | } 19 | 20 | /* Read Only Data. */ 21 | .rodata : ALIGN(4096) { 22 | . = ALIGN(32); 23 | *(.rodata*) 24 | } 25 | 26 | /* Data / BSS */ 27 | .data : ALIGN(4096) { 28 | *(.data) 29 | } 30 | .bss : ALIGN(4096) { 31 | *(.bss) 32 | *(COMMON) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /impl/apps/test_user/linker.lds: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | ENTRY(_start) 8 | 9 | SECTIONS 10 | { 11 | PROVIDE (__executable_start = 0x8000); 12 | . = 0x8000; 13 | 14 | /* Code. */ 15 | .text : ALIGN(4096) { 16 | _text = .; 17 | *(.text*) 18 | } 19 | 20 | /* Read Only Data. */ 21 | .rodata : ALIGN(4096) { 22 | . = ALIGN(32); 23 | *(.rodata*) 24 | } 25 | 26 | /* Data / BSS */ 27 | .data : ALIGN(4096) { 28 | *(.data) 29 | } 30 | .bss : ALIGN(4096) { 31 | *(.bss) 32 | *(COMMON) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /impl/apps/timer_server/linker.lds: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | ENTRY(_start) 8 | 9 | SECTIONS 10 | { 11 | PROVIDE (__executable_start = 0x8000); 12 | . = 0x8000; 13 | 14 | /* Code. */ 15 | .text : ALIGN(4096) { 16 | _text = .; 17 | *(.text*) 18 | } 19 | 20 | /* Read Only Data. */ 21 | .rodata : ALIGN(4096) { 22 | . = ALIGN(32); 23 | *(.rodata*) 24 | } 25 | 26 | /* Data / BSS */ 27 | .data : ALIGN(4096) { 28 | *(.data) 29 | } 30 | .bss : ALIGN(4096) { 31 | *(.bss) 32 | *(COMMON) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /impl/apps/console_server/linker.lds: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | ENTRY(_start) 8 | 9 | SECTIONS 10 | { 11 | PROVIDE (__executable_start = 0x8000); 12 | . = 0x8000; 13 | 14 | /* Code. */ 15 | .text : ALIGN(4096) { 16 | _text = .; 17 | *(.text*) 18 | } 19 | 20 | /* Read Only Data. */ 21 | .rodata : ALIGN(4096) { 22 | . = ALIGN(32); 23 | *(.rodata*) 24 | } 25 | 26 | /* Data / BSS */ 27 | .data : ALIGN(4096) { 28 | *(.data) 29 | } 30 | .bss : ALIGN(4096) { 31 | *(.bss) 32 | *(COMMON) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /impl/apps/selfloader/linker.lds: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | ENTRY(_start) 8 | 9 | SECTIONS 10 | { 11 | PROVIDE (__executable_start = 0xDF000000); 12 | . = 0xDF000000; 13 | 14 | /* Code. */ 15 | .text : ALIGN(4096) { 16 | _text = .; 17 | *(.text*) 18 | } 19 | 20 | /* Read Only Data. */ 21 | .rodata : ALIGN(4096) { 22 | . = ALIGN(32); 23 | *(.rodata*) 24 | } 25 | 26 | /* Data / BSS */ 27 | .data : ALIGN(4096) { 28 | *(.data) 29 | } 30 | .bss : ALIGN(4096) { 31 | *(.bss) 32 | *(COMMON) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /impl/apps/process_server/Kbuild: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | apps-$(CONFIG_APP_PROCESS_SERVER) += process_server 8 | 9 | process_server-y = common libsel4 libmuslc libsel4allocman libsel4vka \ 10 | libsel4platsupport libsel4muslcsys libsel4utils \ 11 | libcpio libelf librefos libdatastruct libsel4simple \ 12 | libsel4vspace libsel4utils libutils libsel4vspace 13 | 14 | process_server-$(CONFIG_LIB_SEL4_SIMPLE_DEFAULT) += libsel4simple-default 15 | 16 | process_server: kernel_elf $(process_server-y) 17 | -------------------------------------------------------------------------------- /impl/libs/librefossys/src/sys_ignored.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | long sys_getpid(va_list ap) { 14 | /* Ignored stub. */ 15 | return 0; 16 | } 17 | 18 | long sys_umask(va_list ap) { 19 | /* Ignored stub. */ 20 | return (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); 21 | } 22 | 23 | long sys_rt_sigaction(va_list ap) { 24 | /* Ignored stub. */ 25 | return 0; 26 | } 27 | 28 | long sys_fcntl64(va_list ap) { 29 | /* Ignored stub. */ 30 | return 0; 31 | } -------------------------------------------------------------------------------- /impl/apps/process_server/src/test/test_memserv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef _REFOS_PROCESS_SERVER_TEST_MEMSERV_H_ 8 | #define _REFOS_PROCESS_SERVER_TEST_MEMSERV_H_ 9 | 10 | #include 11 | #include "test.h" 12 | 13 | #ifdef CONFIG_REFOS_RUN_TESTS 14 | 15 | int test_window_list(void); 16 | 17 | int test_window_associations(void); 18 | 19 | int test_ram_dspace_list(void); 20 | 21 | int test_ram_dspace_read_write(void); 22 | 23 | int test_ram_dspace_content_init(void); 24 | 25 | int test_ringbuffer(void); 26 | 27 | #endif /* CONFIG_REFOS_RUN_TESTS */ 28 | 29 | #endif /* _REFOS_PROCESS_SERVER_TEST_MEMSERV_H_ */ -------------------------------------------------------------------------------- /impl/libs/librefossys/src/sys_exit.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | long 15 | sys_exit(va_list ap) 16 | { 17 | int status = va_arg(ap, int); 18 | proc_exit(status); 19 | while (1); /* We don't return after this */ 20 | return 0; 21 | } 22 | 23 | long 24 | sys_exit_group(va_list ap) 25 | { 26 | int status = va_arg(ap, int); 27 | proc_exit(status); 28 | while (1); /* We don't return after this */ 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/dat/options: -------------------------------------------------------------------------------- 1 | 2 | NetHack version 3.4.3 3 | 4 | Options compiled into this edition: 5 | 6 | color, data file compression, debug mode, Elbereth, 7 | experience points on status line, 8 | insurance files for recovering from crashes, Keystone Kops, log file, 9 | mail daemon, news file, redo command, rogue level, saddles and riding, 10 | screen clipping, seduction, shell command, sinks, suspend command, 11 | terminal info library, tourists, walled mazes, 12 | save and bones files accepted from versions 3.4.0 through 3.4.3, 13 | basic NetHack features. 14 | 15 | Supported windowing systems: 16 | 17 | traditional tty-based graphics, 18 | with a default of tty. 19 | 20 | -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/include/qt_clust.h: -------------------------------------------------------------------------------- 1 | /* SCCS Id: @(#)qt_clust.h 3.4 1999/11/19 */ 2 | /* Copyright (c) Warwick Allison, 1999. */ 3 | /* NetHack may be freely redistributed. See license for details. */ 4 | 5 | #ifndef clusterizer_H 6 | #define clusterizer_H 7 | 8 | #include 9 | 10 | class Clusterizer { 11 | public: 12 | Clusterizer(int maxclusters); 13 | ~Clusterizer(); 14 | 15 | void add(int x, int y); // 1x1 rectangle (point) 16 | void add(int x, int y, int w, int h); 17 | void add(const QRect& rect); 18 | 19 | void clear(); 20 | int clusters() { return count; } 21 | const QRect& operator[](int i); 22 | 23 | private: 24 | QRect* cluster; 25 | int count; 26 | const int max; 27 | }; 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/include/spell.h: -------------------------------------------------------------------------------- 1 | /* SCCS Id: @(#)spell.h 3.4 1995/06/01 */ 2 | /* Copyright 1986, M. Stephenson */ 3 | /* NetHack may be freely redistributed. See license for details. */ 4 | 5 | #ifndef SPELL_H 6 | #define SPELL_H 7 | 8 | struct spell { 9 | short sp_id; /* spell id (== object.otyp) */ 10 | xchar sp_lev; /* power level */ 11 | int sp_know; /* knowlege of spell */ 12 | }; 13 | 14 | /* levels of memory destruction with a scroll of amnesia */ 15 | #define ALL_MAP 0x1 16 | #define ALL_SPELLS 0x2 17 | 18 | #define decrnknow(spell) spl_book[spell].sp_know-- 19 | #define spellid(spell) spl_book[spell].sp_id 20 | #define spellknow(spell) spl_book[spell].sp_know 21 | 22 | #endif /* SPELL_H */ 23 | -------------------------------------------------------------------------------- /impl/libs/libdatastruct/include/data_struct/cpool.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef _CALLOCPOOL_H_ 8 | #define _CALLOCPOOL_H_ 9 | 10 | #include 11 | #include 12 | 13 | typedef struct cpool_s { 14 | uint32_t start; 15 | uint32_t end; 16 | uint32_t mx; 17 | cvector_t freelist; 18 | } cpool_t; 19 | 20 | void cpool_init(cpool_t *p, uint32_t start, uint32_t end); 21 | 22 | void cpool_release(cpool_t *p); 23 | 24 | uint32_t cpool_alloc(cpool_t *p); 25 | 26 | void cpool_free(cpool_t *p, uint32_t obj); 27 | 28 | bool cpool_check(cpool_t *p, uint32_t obj); 29 | 30 | #endif /* _CALLOCPOOL_H_ */ 31 | -------------------------------------------------------------------------------- /impl/apps/timer_server/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | # Targets 8 | TARGETS := timer_server.bin 9 | 10 | # Source files required to build the target 11 | CFILES := $(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/src/*.c)) 12 | CFILES += $(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/src/*/*.c)) 13 | CFILES += $(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/src/*/*/*.c)) 14 | 15 | NK_CFLAGS += -O2 16 | 17 | # Libraries required to build the target 18 | LIBS := c sel4 refossys refos datastruct platsupport utils 19 | 20 | # Custom linker script 21 | NK_LDFLAGS += -T $(SOURCE_DIR)/linker.lds 22 | 23 | include $(SEL4_COMMON)/common.mk 24 | -------------------------------------------------------------------------------- /impl/apps/console_server/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | # Targets 8 | TARGETS := console_server.bin 9 | 10 | # Source files required to build the target 11 | CFILES := $(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/src/*.c)) 12 | CFILES += $(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/src/*/*.c)) 13 | CFILES += $(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/src/*/*/*.c)) 14 | 15 | NK_CFLAGS += -O2 16 | 17 | # Libraries required to build the target 18 | LIBS := c sel4 refossys refos datastruct platsupport vterm 19 | 20 | # Custom linker script 21 | NK_LDFLAGS += -T $(SOURCE_DIR)/linker.lds 22 | 23 | include $(SEL4_COMMON)/common.mk 24 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | 6 | 7 | # License 8 | 9 | The files in this repository are released under standard open source licenses, 10 | identified by [SPDX license tags][1]. See the individual file headers for 11 | details, or use one of the publicly available SPDX tools to generate a bill of 12 | materials. The directory [`LICENSES`][2] contains the text for all licenses 13 | that are mentioned by files in this repository. 14 | 15 | Please see the individual library directories and source files for the licenses 16 | that apply to each library. 17 | 18 | For licensing an application, you must check each library that you link against. 19 | 20 | [1]: https://spdx.org 21 | [2]: LICENSES/ 22 | -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/dat/wizhelp: -------------------------------------------------------------------------------- 1 | Debug-Mode Quick Reference: 2 | 3 | ^E == detect secret doors and traps. 4 | ^F == do magic mapping. 5 | ^G == create monster. 6 | ^I == identify items in pack. 7 | ^O == tell locations of special levels. 8 | ^T == do intra-level teleport. 9 | ^V == do trans-level teleport. 10 | ^W == make wish. 11 | ^X == show attributes including intrinsic attributes. 12 | 13 | #levelchange == change experience level 14 | #lightsources == show mobile light sources 15 | #monpolycontrol == control monster polymorphs 16 | #panic == panic test 17 | #polyself == polymorph self 18 | #seenv == show seen vectors 19 | #stats == show memory statistics 20 | #timeout == look at timeout queue 21 | #vision == show vision array 22 | #wmode == show wall modes 23 | 24 | -------------------------------------------------------------------------------- /impl/apps/file_server/src/badge.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef _FILE_SERVER_BADGE_H_ 8 | #define _FILE_SERVER_BADGE_H_ 9 | 10 | #include 11 | #include 12 | 13 | /*! @file 14 | @brief CPIO File Server badge space definitions. */ 15 | 16 | /* ---- BadgeID 49 : Async Notify ---- */ 17 | 18 | #define FS_ASYNC_NOTIFY_BADGE 0x31 19 | 20 | /* ---- BadgeID 50 to 4145 : Clients ---- */ 21 | 22 | #define FS_CLIENT_BADGE_BASE 0x32 23 | 24 | /* ---- BadgeID 4146 to 10319 : Dataspaces ---- */ 25 | 26 | #define FS_MAX_DATASPACES 8192 27 | #define FS_DSPACE_BADGE_BASE (FS_CLIENT_BADGE_BASE + SRV_DEFAULT_MAX_CLIENTS) 28 | 29 | #endif /* _FILE_SERVER_BADGE_H_ */ 30 | -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/include/mail.h: -------------------------------------------------------------------------------- 1 | /* SCCS Id: @(#)mail.h 3.4 1991/10/11 */ 2 | /* NetHack may be freely redistributed. See license for details. */ 3 | 4 | /* used by ckmailstatus() to pass information to the mail-daemon in newmail() */ 5 | 6 | #ifndef MAIL_H 7 | #define MAIL_H 8 | 9 | #define MSG_OTHER 0 /* catch-all; none of the below... */ 10 | #define MSG_MAIL 1 /* unimportant, uninteresting mail message */ 11 | #define MSG_CALL 2 /* annoying phone/talk/chat-type interruption */ 12 | 13 | struct mail_info { 14 | int message_typ; /* MSG_foo value */ 15 | const char *display_txt; /* text for daemon to verbalize */ 16 | const char *object_nam; /* text to tag object with */ 17 | const char *response_cmd; /* command to eventually execute */ 18 | }; 19 | 20 | #endif /* MAIL_H */ 21 | -------------------------------------------------------------------------------- /impl/cidl_templates/server_header.py: -------------------------------------------------------------------------------- 1 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 2 | # 3 | # SPDX-License-Identifier: BSD-2-Clause 4 | 5 | void server_{{fname}}(void *rpc_userptr);\n 6 | 7 | void reply_{{fname}}(void *rpc_userptr 8 | {{for type, itype, name, mode, dr, apfx, aref, apsfx in oalist}} 9 | {{if mode == 'array'}}{{py: type = 'rpc_buffer_t'}}{{endif}} 10 | , {{type}} rpc_{{name}} 11 | {{endfor}});\n 12 | 13 | extern {{return_type}} {{fname}}_handler(void *rpc_userptr 14 | {{for type, itype, name, mode, dr, apfx, aref, apsfx in calist}} 15 | {{if mode == 'length' or mode == 'connect_ep'}}{{continue}}{{endif}} 16 | {{if mode == 'array'}}{{py: type = 'rpc_buffer_t'}}{{endif}} 17 | , {{type}} rpc_{{name}} 18 | {{endfor}} 19 | ) {{weak_attrib}};\n 20 | -------------------------------------------------------------------------------- /impl/libs/libdatastruct/include/data_struct/cqueue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef _CQUEUE_H_ 8 | #define _CQUEUE_H_ 9 | 10 | #include 11 | #include 12 | #include "cvector.h" 13 | 14 | typedef void* cqueue_item_t; 15 | 16 | typedef struct cqueue_s { 17 | cqueue_item_t* data; 18 | uint32_t top; 19 | uint32_t count; 20 | uint32_t maxSize; 21 | } cqueue_t; 22 | 23 | void cqueue_init(cqueue_t *q, uint32_t maxSize); 24 | 25 | bool cqueue_push(cqueue_t *q, cqueue_item_t e); 26 | 27 | cqueue_item_t cqueue_pop(cqueue_t *q); 28 | 29 | inline size_t cqueue_size(cqueue_t *q) { 30 | return q->count; 31 | } 32 | 33 | void cqueue_free(cqueue_t *q); 34 | 35 | #endif /* _CQUEUE_H_ */ -------------------------------------------------------------------------------- /impl/apps/file_server/src/dispatchers/fault_notify.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef _FILESERV_FAULT_NOTIFY_DISPATCHER_H_ 8 | #define _FILESERV_FAULT_NOTIFY_DISPATCHER_H_ 9 | 10 | #include "../state.h" 11 | #include "dispatch.h" 12 | 13 | /*! @file 14 | @brief Handles process server client notifications. */ 15 | 16 | /*! @brief Notification dispatcher, responsible for dispatching async notifications. 17 | @param m The fileserver message info struct. 18 | @return DISPATCH_SUCCESS if success, DISPATCHER_ERROR of and error occured, DISPATCH_PASS if the 19 | message is not a async notification. 20 | */ 21 | int dispatch_notification(srv_msg_t *m); 22 | 23 | #endif /* _FILESERV_FAULT_NOTIFY_DISPATCHER_H_ */ 24 | -------------------------------------------------------------------------------- /LICENSES/ISC.txt: -------------------------------------------------------------------------------- 1 | ISC License: 2 | 3 | Copyright (c) 2004-2010 by Internet Systems Consortium, Inc. ("ISC") 4 | Copyright (c) 1995-2003 by Internet Software Consortium 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 9 | -------------------------------------------------------------------------------- /impl/apps/process_server/src/dispatchers/mem_syscall.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | /*! \file mem_syscall.h 8 | \brief Dispatcher for the procserv memory related syscalls. 9 | */ 10 | 11 | #ifndef _REFOS_PROCESS_SERVER_DISPATCHER_PROCSERV_MEMORY_SYSCALL_H_ 12 | #define _REFOS_PROCESS_SERVER_DISPATCHER_PROCSERV_MEMORY_SYSCALL_H_ 13 | 14 | #include "dispatcher.h" 15 | #include "../state.h" 16 | 17 | /*! @file 18 | @brief Handles process server memory-related syscalls. */ 19 | 20 | /*! @brief Memory syscall post-action. 21 | 22 | Replies to any processes that are waiting to be resumed from a dataspace VM fault. 23 | */ 24 | void mem_syscall_postaction(); 25 | 26 | #endif /* _REFOS_PROCESS_SERVER_DISPATCHER_PROCSERV_MEMORY_SYSCALL_H_ */ -------------------------------------------------------------------------------- /impl/apps/timer_server/src/dispatchers/client_watch.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef _TIMER_SERVER_DISPATCHER_CLIENT_WATCH_HANDLER_H_ 8 | #define _TIMER_SERVER_DISPATCHER_CLIENT_WATCH_HANDLER_H_ 9 | 10 | #include "../state.h" 11 | #include "dispatch.h" 12 | 13 | /*! @file 14 | @brief Client watch dispatcher module. */ 15 | 16 | /*! @brief Dispatch a client death notification message. 17 | @param m The recieved interrupt message. 18 | @return DISPATCH_SUCCESS if successfully dispatched, DISPATCH_ERROR if there was an unexpected 19 | error, DISPATCH_PASS if the given message is not an interrupt message. 20 | */ 21 | int dispatch_client_watch(srv_msg_t *m); 22 | 23 | #endif /* _TIMER_SERVER_DISPATCHER_CLIENT_WATCH_HANDLER_H_ */ -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/include/epri.h: -------------------------------------------------------------------------------- 1 | /* SCCS Id: @(#)epri.h 3.4 1997/05/01 */ 2 | /* Copyright (c) Izchak Miller, 1989. */ 3 | /* NetHack may be freely redistributed. See license for details. */ 4 | 5 | #ifndef EPRI_H 6 | #define EPRI_H 7 | 8 | struct epri { 9 | aligntyp shralign; /* alignment of priest's shrine */ 10 | /* leave as first field to match emin */ 11 | schar shroom; /* index in rooms */ 12 | coord shrpos; /* position of shrine */ 13 | d_level shrlevel; /* level (& dungeon) of shrine */ 14 | }; 15 | 16 | #define EPRI(mon) ((struct epri *)&(mon)->mextra[0]) 17 | 18 | /* A priest without ispriest is a roaming priest without a shrine, so 19 | * the fields (except shralign, which becomes only the priest alignment) 20 | * are available for reuse. 21 | */ 22 | #define renegade shroom 23 | 24 | #endif /* EPRI_H */ 25 | -------------------------------------------------------------------------------- /impl/apps/test_os/src/test_anon_ram.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef _OS_TESTS_ANON_RAM_DSPACE_H_ 8 | #define _OS_TESTS_ANON_RAM_DSPACE_H_ 9 | 10 | #include 11 | 12 | #ifdef CONFIG_REFOS_RUN_TESTS 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | void test_anon_dataspace(void); 30 | 31 | #endif /* CONFIG_REFOS_RUN_TESTS */ 32 | 33 | #endif /* _OS_TESTS_ANON_RAM_DSPACE_H_ */ -------------------------------------------------------------------------------- /impl/apps/console_server/src/dispatchers/client_watch.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef _CONSOLE_SERVER_DISPATCHER_CLIENT_WATCH_HANDLER_H_ 8 | #define _CONSOLE_SERVER_DISPATCHER_CLIENT_WATCH_HANDLER_H_ 9 | 10 | #include "../state.h" 11 | #include "dispatch.h" 12 | 13 | /*! @file 14 | @brief Client watch dispatcher module. */ 15 | 16 | /*! @brief Dispatch a client death notification message. 17 | @param m The recieved interrupt message. 18 | @return DISPATCH_SUCCESS if successfully dispatched, DISPATCH_ERROR if there was an unexpected 19 | error, DISPATCH_PASS if the given message is not an interrupt message. 20 | */ 21 | int dispatch_client_watch(srv_msg_t *m); 22 | 23 | #endif /* _CONSOLE_SERVER_DISPATCHER_CLIENT_WATCH_HANDLER_H_ */ -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/include/engrave.h: -------------------------------------------------------------------------------- 1 | /* SCCS Id: @(#)engrave.h 3.4 1991/07/31 */ 2 | /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ 3 | /* NetHack may be freely redistributed. See license for details. */ 4 | 5 | #ifndef ENGRAVE_H 6 | #define ENGRAVE_H 7 | 8 | struct engr { 9 | struct engr *nxt_engr; 10 | char *engr_txt; 11 | xchar engr_x, engr_y; 12 | unsigned engr_lth; /* for save & restore; not length of text */ 13 | long engr_time; /* moment engraving was (will be) finished */ 14 | xchar engr_type; 15 | #define DUST 1 16 | #define ENGRAVE 2 17 | #define BURN 3 18 | #define MARK 4 19 | #define ENGR_BLOOD 5 20 | #define HEADSTONE 6 21 | #define N_ENGRAVE 6 22 | }; 23 | 24 | #define newengr(lth) (struct engr *)alloc((unsigned)(lth) + sizeof(struct engr)) 25 | #define dealloc_engr(engr) free((genericptr_t) (engr)) 26 | 27 | #endif /* ENGRAVE_H */ 28 | -------------------------------------------------------------------------------- /.reuse/dep5: -------------------------------------------------------------------------------- 1 | Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: seL4 3 | Upstream-Contact: seL4 team 4 | Source: http://sel4.systems 5 | 6 | Files: 7 | impl/apps/nethack/src/nethack-3.4.3/* 8 | impl/apps/file_server/files/nethackrc 9 | impl/apps/file_server/files/nhdat 10 | impl/apps/file_server/files/hh 11 | Copyright: 1989 M. Stephenson 12 | License: NGPL 13 | 14 | Files: 15 | impl/docs/doxygen/*.png 16 | design/refos.png 17 | design/extra.bib 18 | impl/apps/file_server/files/hello.txt 19 | impl/apps/file_server/files/news 20 | Copyright: 2016 Data61, CSIRO (ABN 41 687 119 230) 21 | License: CC-BY-SA-4.0 22 | 23 | Files: 24 | impl/configs/* 25 | Copyright: 2016 Data61, CSIRO (ABN 41 687 119 230) 26 | License: BSD-2-Clause 27 | 28 | Files: impl/libs/libvterm/* impl/apps/file_server/files/license 29 | Copyright: 2008 Paul Evans 30 | License: MIT 31 | -------------------------------------------------------------------------------- /impl/libs/librefos/include/refos-rpc/proc_common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | /*! @file 8 | @brief Common interface for process server. 9 | 10 | Common interface a process server server and clients. 11 | 12 | Author: kevine 13 | Created on: Jul 29, 2012 14 | */ 15 | 16 | #ifndef PROC_COMMON_H_ 17 | #define PROC_COMMON_H_ 18 | 19 | #include 20 | #include 21 | 22 | #define PROCSERV_NOTIFICATION_MAGIC 0xB0BA11CE 23 | 24 | enum proc_notify_types { 25 | PROCSERV_NOTIFY_FAULT_DELEGATION, 26 | PROCSERV_NOTIFY_CONTENT_INIT, 27 | PROCSERV_NOTIFY_DEATH 28 | }; 29 | 30 | struct proc_notification { 31 | seL4_Word magic; 32 | seL4_Word label; 33 | seL4_Word arg[7]; 34 | }; 35 | 36 | #endif /* PROC_COMMON_H_ */ 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/include/vault.h: -------------------------------------------------------------------------------- 1 | /* SCCS Id: @(#)vault.h 3.4 1997/05/01 */ 2 | /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ 3 | /* NetHack may be freely redistributed. See license for details. */ 4 | 5 | #ifndef VAULT_H 6 | #define VAULT_H 7 | 8 | #define FCSIZ (ROWNO+COLNO) 9 | struct fakecorridor { 10 | xchar fx,fy,ftyp; 11 | }; 12 | 13 | struct egd { 14 | int fcbeg, fcend; /* fcend: first unused pos */ 15 | int vroom; /* room number of the vault */ 16 | xchar gdx, gdy; /* goal of guard's walk */ 17 | xchar ogx, ogy; /* guard's last position */ 18 | d_level gdlevel; /* level (& dungeon) guard was created in */ 19 | xchar warncnt; /* number of warnings to follow */ 20 | Bitfield(gddone,1); /* true iff guard has released player */ 21 | Bitfield(unused,7); 22 | struct fakecorridor fakecorr[FCSIZ]; 23 | }; 24 | 25 | #define EGD(mon) ((struct egd *)&(mon)->mextra[0]) 26 | 27 | #endif /* VAULT_H */ 28 | -------------------------------------------------------------------------------- /impl/libs/libvterm/src/encoding/DECdrawing.inc: -------------------------------------------------------------------------------- 1 | static const struct StaticTableEncoding encoding_DECdrawing = { 2 | { .decode = &decode_table }, 3 | { 4 | [0x60] = 0x25C6, 5 | [0x61] = 0x2592, 6 | [0x62] = 0x2409, 7 | [0x63] = 0x240C, 8 | [0x64] = 0x240D, 9 | [0x65] = 0x240A, 10 | [0x66] = 0x00B0, 11 | [0x67] = 0x00B1, 12 | [0x68] = 0x2424, 13 | [0x69] = 0x240B, 14 | [0x6a] = 0x2518, 15 | [0x6b] = 0x2510, 16 | [0x6c] = 0x250C, 17 | [0x6d] = 0x2514, 18 | [0x6e] = 0x253C, 19 | [0x6f] = 0x23BA, 20 | [0x70] = 0x23BB, 21 | [0x71] = 0x2500, 22 | [0x72] = 0x23BC, 23 | [0x73] = 0x23BD, 24 | [0x74] = 0x251C, 25 | [0x75] = 0x2524, 26 | [0x76] = 0x2534, 27 | [0x77] = 0x252C, 28 | [0x78] = 0x2502, 29 | [0x79] = 0x2A7D, 30 | [0x7a] = 0x2A7E, 31 | [0x7b] = 0x03C0, 32 | [0x7c] = 0x2260, 33 | [0x7d] = 0x00A3, 34 | [0x7e] = 0x00B7, 35 | } 36 | }; 37 | -------------------------------------------------------------------------------- /impl/apps/test_os/src/test_fileserv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef _OS_TESTS_FILE_SERVER_H_ 8 | #define _OS_TESTS_FILE_SERVER_H_ 9 | 10 | #include 11 | 12 | #ifdef CONFIG_REFOS_RUN_TESTS 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | void test_file_server(void); 33 | 34 | #endif /* _OS_TESTS_FILE_SERVER_H_ */ 35 | 36 | #endif /* _FILESERV_TESTS_H_ */ -------------------------------------------------------------------------------- /impl/apps/process_server/src/dispatchers/proc_syscall.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | /*! @file 8 | @brief Dispatcher for the procserv syscalls. */ 9 | 10 | #ifndef _REFOS_PROCESS_SERVER_DISPATCHER_PROCSERV_SYSCALL_H_ 11 | #define _REFOS_PROCESS_SERVER_DISPATCHER_PROCSERV_SYSCALL_H_ 12 | 13 | #include "dispatcher.h" 14 | 15 | /*! @brief Check whether the given recieved message is a procserv syscall. 16 | @param m Struct containing info about the recieved message. 17 | @param userptr Output user pointer. Pass this into the generated dispatcher function. 18 | @return DISPATCH_SUCCESS if message is a procserv syscall, DISPATCH_PASS otherwise. 19 | */ 20 | int check_dispatch_syscall(struct procserv_msg *m, void **userptr); 21 | 22 | int rpc_sv_proc_dispatcher(void *rpc_userptr, uint32_t label); 23 | 24 | #endif /* _REFOS_PROCESS_SERVER_DISPATCHER_PROCSERV_SYSCALL_H_ */ 25 | -------------------------------------------------------------------------------- /impl/libs/libdatastruct/include/data_struct/cbpool.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef _CBITMAPALLOCPOOL_H_ 8 | #define _CBITMAPALLOCPOOL_H_ 9 | 10 | #include 11 | #include 12 | 13 | #define CBPOOL_INVALID ((uint32_t) (-1)) 14 | 15 | typedef struct cbpool_s { 16 | uint32_t size; 17 | uint32_t size_ntiles; 18 | uint32_t *bitmap; 19 | } cbpool_t; 20 | 21 | void cbpool_init(cbpool_t *p, uint32_t size); 22 | 23 | void cbpool_init_static(cbpool_t *p, uint32_t size, char *buffer, int bufferSize); 24 | 25 | void cbpool_release(cbpool_t *p); 26 | 27 | uint32_t cbpool_alloc(cbpool_t *p, uint32_t size); 28 | 29 | void cbpool_free(cbpool_t *p, uint32_t obj, uint32_t size); 30 | 31 | bool cbpool_check_single(cbpool_t *p, uint32_t obj); 32 | 33 | void cbpool_set_single(cbpool_t *p, uint32_t obj, bool val); 34 | 35 | #endif /* _CBITMAPALLOCPOOL_H_ */ 36 | -------------------------------------------------------------------------------- /impl/apps/file_server/src/dispatchers/serv_dispatch.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef _FILESERV_SERV_SYSCALL_DISPATCHER_H_ 8 | #define _FILESERV_SERV_SYSCALL_DISPATCHER_H_ 9 | 10 | #include "../state.h" 11 | #include "dispatch.h" 12 | #include 13 | 14 | /*! @file 15 | @brief Handles server connection and session establishment syscalls. */ 16 | 17 | /*! @brief Check whether the given recieved message is a server syscall. 18 | @param m Struct containing info about the recieved message. 19 | @param userptr Output user pointer. Pass this into the generated dispatcher function. 20 | @return DISPATCH_SUCCESS if message is a dataspace syscall, DISPATCH_PASS otherwise. 21 | */ 22 | int check_dispatch_serv(srv_msg_t *m, void **userptr); 23 | 24 | int rpc_sv_serv_dispatcher(void *rpc_userptr, uint32_t label); 25 | 26 | #endif /* _FILESERV_SERV_SYSCALL_DISPATCHER_H_ */ 27 | -------------------------------------------------------------------------------- /impl/apps/file_server/src/dispatchers/cpio_dspace.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef _FILESERV_CPIO_DATASPACE_SYSCALL_DISPATCHER_H_ 8 | #define _FILESERV_CPIO_DATASPACE_SYSCALL_DISPATCHER_H_ 9 | 10 | #include "../state.h" 11 | #include "dispatch.h" 12 | #include 13 | 14 | /*! @file 15 | @brief Handles CPIO file server dataspace calls. */ 16 | 17 | int rpc_sv_data_dispatcher(void *rpc_userptr, uint32_t label); 18 | 19 | /*! @brief Check whether the given recieved message is a data syscall. 20 | @param m Struct containing info about the recieved message. 21 | @param userptr Output user pointer. Pass this into the generated dispatcher function. 22 | @return DISPATCH_SUCCESS if message is a dataspace syscall, DISPATCH_PASS otherwise. 23 | */ 24 | int check_dispatch_data(srv_msg_t *m, void **userptr); 25 | 26 | #endif /* _FILESERV_CPIO_DATASPACE_SYSCALL_DISPATCHER_H_ */ 27 | -------------------------------------------------------------------------------- /impl/apps/timer_server/src/dispatchers/serv_dispatch.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef _TIMER_SERVER_DISPATCHER_SERV_INTERFACE_H_ 8 | #define _TIMER_SERVER_DISPATCHER_SERV_INTERFACE_H_ 9 | 10 | #include "../state.h" 11 | #include "dispatch.h" 12 | #include 13 | 14 | /*! @file 15 | @brief Handles server connection and session establishment syscalls. */ 16 | 17 | int rpc_sv_serv_dispatcher(void *rpc_userptr, uint32_t label); 18 | 19 | /*! @brief Check whether the given recieved message is a server syscall. 20 | @param m Struct containing info about the recieved message. 21 | @param userptr Output user pointer. Pass this into the generated dispatcher function. 22 | @return DISPATCH_SUCCESS if message is a dataspace syscall, DISPATCH_PASS otherwise. 23 | */ 24 | int check_dispatch_serv(srv_msg_t *m, void **userptr); 25 | 26 | #endif /* _TIMER_SERVER_DISPATCHER_SERV_INTERFACE_H_ */ -------------------------------------------------------------------------------- /impl/apps/console_server/src/dispatchers/serv_dispatch.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef _CONSOLE_SERVER_DISPATCHER_SERV_INTERFACE_H_ 8 | #define _CONSOLE_SERVER_DISPATCHER_SERV_INTERFACE_H_ 9 | 10 | #include "../state.h" 11 | #include "dispatch.h" 12 | #include 13 | 14 | /*! @file 15 | @brief Handles server connection and session establishment syscalls. */ 16 | 17 | int rpc_sv_serv_dispatcher(void *rpc_userptr, uint32_t label); 18 | 19 | /*! @brief Check whether the given recieved message is a server syscall. 20 | @param m Struct containing info about the recieved message. 21 | @param userptr Output user pointer. Pass this into the generated dispatcher function. 22 | @return DISPATCH_SUCCESS if message is a dataspace syscall, DISPATCH_PASS otherwise. 23 | */ 24 | int check_dispatch_serv(srv_msg_t *m, void **userptr); 25 | 26 | #endif /* _CONSOLE_SERVER_DISPATCHER_SERV_INTERFACE_H_ */ -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/include/beconf.h: -------------------------------------------------------------------------------- 1 | /* SCCS Id: @(#)beconf.h 3.4 1998/07/08 */ 2 | /* Copyright (c) Dean Luick 1996. */ 3 | /* NetHack may be freely redistributed. See license for details. */ 4 | 5 | /* Configuration for Be Inc.'s BeOS */ 6 | 7 | #ifndef BECONF_H 8 | #define BECONF_H 9 | 10 | /* 11 | * We must use UNWIDENED_PROTOTYPES because we mix C++ and C. 12 | */ 13 | 14 | #define index strchr 15 | #define rindex strrchr 16 | #define Rand rand /* Be should have a better rand function! */ 17 | #define tgetch getchar 18 | #define FCMASK 0666 19 | #define PORT_ID "BeOS" 20 | #define TEXTCOLOR 21 | #define POSIX_TYPES 22 | #define SIG_RET_TYPE __signal_func_ptr 23 | 24 | #include /* for time_t */ 25 | #include /* for lseek() */ 26 | 27 | /* could go in extern.h, under bemain.c (or something..) */ 28 | void regularize(char *); 29 | 30 | 31 | /* instead of including system.h... */ 32 | #include 33 | #include 34 | #include 35 | 36 | #endif /* BECONF_H */ 37 | -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/include/bitmfile.h: -------------------------------------------------------------------------------- 1 | /****************************\ 2 | * Bitmap mit Farbtabelle als * 3 | * Graphik-Datei speichern * 4 | * Autor: Gabriel Schmidt * 5 | * (c} 1992 by MAXON-Computer * 6 | * -> Header-Datei * 7 | \****************************/ 8 | 9 | #ifndef H_TO_FILE 10 | #define H_TO_FILE 11 | 12 | /* #include */ 13 | #define UWORD unsigned short 14 | #define ULONG unsigned long 15 | #define UBYTE unsigned char 16 | 17 | #define XIMG_MAGIC 0x58494D47 18 | 19 | 20 | typedef enum { IMG, XIMG } FILE_TYP; 21 | 22 | const char *get_file_ext(FILE_TYP typ); 23 | 24 | struct RGB 25 | { 26 | UWORD r, g, b; 27 | }; 28 | 29 | int bitmap_to_file(FILE_TYP typ, int ww, int wh, 30 | unsigned int pwx, unsigned int pwy, 31 | unsigned int planes, unsigned int colors, 32 | const char *filename, 33 | void (*get_color) (unsigned int colind, struct RGB *rgb) , 34 | void (*get_pixel) (int x, int y, unsigned int *colind) ) ; 35 | 36 | #endif 37 | 38 | -------------------------------------------------------------------------------- /impl/libs/librefos/src/refos-util/stdio_copy.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef _REFOS_IO_STDIO_COPY_H_ 8 | #define _REFOS_IO_STDIO_COPY_H_ 9 | 10 | /*! @file 11 | @brief This file should be a copy of librefossys/include/refos-io/stdio.h. 12 | This unfortunate duplication is done to avoid cyclic dependency problems between 13 | the libraries, that isn't handled too nicely by our build system. 14 | */ 15 | 16 | #include 17 | #include 18 | 19 | typedef size_t (*stdio_read_fn_t)(void *data, size_t count); 20 | 21 | typedef size_t (*stdio_write_fn_t)(void *data, size_t count); 22 | 23 | void refos_override_stdio(stdio_read_fn_t readfn, stdio_write_fn_t writefn); 24 | 25 | void refos_seL4_debug_override_stdout(void); 26 | 27 | void refos_setup_dataspace_stdio(char *dspacePath); 28 | 29 | int refos_async_getc(void); 30 | 31 | int refos_getc(void); 32 | 33 | #endif /* _REFOS_IO_STDIO_H_ */ 34 | -------------------------------------------------------------------------------- /impl/libs/librefossys/Kconfig: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | menuconfig LIB_REFOS_SYS 8 | bool "Syscall library for RefOS userland" 9 | default y 10 | depends on LIB_SEL4 && LIB_REFOS && HAVE_LIBC 11 | help 12 | Syscall library for RefOS userland. This library is responsible for implementing simple 13 | POSIX environment syscalls on top of RefOS primitives. This allows for the C standard 14 | library to work and be happy, and also allows for easier porting. 15 | 16 | config REFOS_SYS_FORCE_DEBUGPUTCHAR 17 | bool "Force seL4_DebugPutChar printf" 18 | default n 19 | depends on LIB_REFOS_SYS 20 | help 21 | Force RefOS userland to use seL4_DebugPutChar(), even when not needed. If this option is not 22 | set, IPC messages will be sent to the Console server. This allows a few more messages to 23 | print during initialisation, useful for debugging. Requires seL4 debug kernel. 24 | -------------------------------------------------------------------------------- /impl/apps/timer_server/src/dispatchers/dspace/dspace.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef _TIMESERV_DATASPACE_SYSCALL_DISPATCHER_H_ 8 | #define _TIMESERV_DATASPACE_SYSCALL_DISPATCHER_H_ 9 | 10 | #include "../../state.h" 11 | #include "../dispatch.h" 12 | #include 13 | #include 14 | 15 | /*! @file 16 | @brief Common dataspace interface functions. */ 17 | 18 | int rpc_sv_data_dispatcher(void *rpc_userptr, uint32_t label); 19 | 20 | /*! @brief Check whether the given recieved message is a data syscall. 21 | @param m Struct containing info about the recieved message. 22 | @param userptr Output user pointer. Pass this into the generated dispatcher function. 23 | @return DISPATCH_SUCCESS if message is a dataspace syscall, DISPATCH_PASS otherwise. 24 | */ 25 | int check_dispatch_data(srv_msg_t *m, void **userptr); 26 | 27 | #endif /* _TIMESERV_DATASPACE_SYSCALL_DISPATCHER_H_ */ 28 | -------------------------------------------------------------------------------- /impl/apps/console_server/src/dispatchers/dspace/dspace.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef _CONSOLE_SERVER_DATASPACE_SYSCALL_DISPATCHER_H_ 8 | #define _CONSOLE_SERVER_DATASPACE_SYSCALL_DISPATCHER_H_ 9 | 10 | #include "../../state.h" 11 | #include "../dispatch.h" 12 | #include 13 | #include 14 | 15 | /*! @file 16 | @brief Common dataspace interface functions. */ 17 | 18 | int rpc_sv_data_dispatcher(void *rpc_userptr, uint32_t label); 19 | 20 | /*! @brief Check whether the given recieved message is a data syscall. 21 | @param m Struct containing info about the recieved message. 22 | @param userptr Output user pointer. Pass this into the generated dispatcher function. 23 | @return DISPATCH_SUCCESS if message is a dataspace syscall, DISPATCH_PASS otherwise. 24 | */ 25 | int check_dispatch_data(srv_msg_t *m, void **userptr); 26 | 27 | #endif /* _CONSOLE_SERVER_DATASPACE_SYSCALL_DISPATCHER_H_ */ 28 | -------------------------------------------------------------------------------- /impl/apps/process_server/src/dispatchers/data_syscall.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef _REFOS_PROCESS_SERVER_DISPATCHER_RAM_DATASPACE_SYSCALL_H_ 8 | #define _REFOS_PROCESS_SERVER_DISPATCHER_RAM_DATASPACE_SYSCALL_H_ 9 | 10 | #include "../common.h" 11 | #include "dispatcher.h" 12 | 13 | #define PROCSERV_DSPACE_FLAG_DEVICE_PADDR 0x10000000 14 | 15 | /*! @file 16 | @brief Process server anon dataspace syscall handler. */ 17 | 18 | int rpc_sv_data_dispatcher(void *rpc_userptr, uint32_t label); 19 | 20 | /*! @brief Check whether the given recieved message is a data syscall. 21 | @param m Struct containing info about the recieved message. 22 | @param userptr Output user pointer. Pass this into the generated dispatcher function. 23 | @return DISPATCH_SUCCESS if message is a dataspace syscall, DISPATCH_PASS otherwise. 24 | */ 25 | int check_dispatch_dataspace(struct procserv_msg *m, void **userptr); 26 | 27 | #endif /* _REFOS_PROCESS_SERVER_DISPATCHER_RAM_DATASPACE_SYSCALL_H_ */ -------------------------------------------------------------------------------- /impl/libs/libdatastruct/include/data_struct/chash.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef _CHASH_H_ 8 | #define _CHASH_H_ 9 | 10 | #include 11 | 12 | #ifndef kmalloc 13 | #include 14 | #include 15 | #define kmalloc malloc 16 | #define krealloc realloc 17 | #define kfree free 18 | #endif 19 | 20 | typedef void* chash_item_t; 21 | 22 | typedef struct chash_entry_s { 23 | uint32_t key; 24 | chash_item_t item; 25 | } chash_entry_t; 26 | 27 | typedef struct chash_s { 28 | cvector_t* table; 29 | size_t tableSize; 30 | } chash_t; 31 | 32 | void chash_init(chash_t *t, size_t sz); 33 | 34 | void chash_release(chash_t *t); 35 | 36 | chash_item_t chash_get(chash_t *t, uint32_t key); 37 | 38 | int chash_set(chash_t *t, uint32_t key, chash_item_t obj); 39 | 40 | void chash_remove(chash_t *t, uint32_t key); 41 | 42 | int chash_find_free(chash_t *t, uint32_t rangeStart, uint32_t rangeEnd); 43 | 44 | #endif /* _CHASH_H_ */ 45 | -------------------------------------------------------------------------------- /impl/libs/librefossys/src/syscalls.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014, NICTA 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef LIBREFOSSYS_SYSCALLS_H_ 8 | #define LIBREFOSSYS_SYSCALLS_H_ 9 | 10 | #include 11 | 12 | /* prototype all the syscalls we implement */ 13 | long sys_set_thread_area(va_list ap); 14 | long sys_set_tid_address(va_list ap); 15 | long sys_sched_yield(va_list ap); 16 | long sys_exit(va_list ap); 17 | long sys_rt_sigprocmask(va_list ap); 18 | long sys_gettid(va_list ap); 19 | long sys_getpid(va_list ap); 20 | long sys_tgkill(va_list ap); 21 | long sys_tkill(va_list ap); 22 | long sys_exit_group(va_list ap); 23 | long sys_open(va_list ap); 24 | long sys_close(va_list ap); 25 | long sys_readv(va_list ap); 26 | long sys_read(va_list ap); 27 | long sys_ioctl(va_list ap); 28 | long sys_prlimit64(va_list ap); 29 | long sys_lseek(va_list ap); 30 | long sys__llseek(va_list ap); 31 | long sys_access(va_list ap); 32 | long sys_brk(va_list ap); 33 | long sys_mmap2(va_list ap); 34 | long sys_mremap(va_list ap); 35 | long sys_writev(va_list ap); 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Copyright Data61, CSIRO (ABN 41 687 119 230) 2 | # SPDX-License-Identifier: BSD-2-Clause 3 | 4 | # Generated files that are part of the build system. 5 | impl/build 6 | impl/images 7 | impl/stage 8 | impl/config.mk 9 | impl/mtoolsrc 10 | impl/syslinux.cfg 11 | impl/include/* 12 | 13 | # Generated IDL rpc stub files. 14 | impl/libs/librefos/include/refos-rpc/*_client.h 15 | impl/libs/librefos/include/refos-rpc/*_server.h 16 | impl/libs/librefos/src/refos-rpc/*_client.c 17 | impl/libs/librefos/src/refos-rpc/*_server.c 18 | impl/libs/librefos/src/refos-rpc/*_dispatcher.c 19 | 20 | # Generated design doc files. 21 | design/msc/*.pdf 22 | design/msc/*.eps 23 | design/msc/*.err 24 | design/msc/*.mscg 25 | design/msc/*.out 26 | design/.log 27 | design/missfont.log 28 | design/paper.aux 29 | design/paper.log 30 | design/paper.out 31 | design/paper.pdf 32 | design/paper.toc 33 | 34 | # Generated doxygen files. 35 | impl/docs/html/ 36 | 37 | # Developer / Editor related files. 38 | cscope.* 39 | **/*.swp 40 | tags 41 | 42 | # Kconfig current configuration files. 43 | impl/.config 44 | impl/.config.old 45 | -------------------------------------------------------------------------------- /LICENSES/MIT.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /impl/apps/nethack/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | # Targets 8 | TARGETS := nethack.bin 9 | 10 | # Source files required to build the target 11 | CFILES := $(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/src/*.c)) 12 | CFILES += $(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/src/*/*.c)) 13 | CFILES += $(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/src/*/*/*.c)) 14 | CFILES += $(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/src/*/*/*/*.c)) 15 | HDRFILES += $(wildcard ${SOURCE_DIR}/src/nethack-3.4.3/include/*) 16 | 17 | NK_CFLAGS += -D_BSD_SOURCE -O2 18 | 19 | # Nethack configuration defines. 20 | NK_CFLAGS += -DTTY_GRAPHICS -DANSI_DEFAULT -DDLB -DNO_FILE_LINKS- -DDLBLIB 21 | 22 | # We also disable warnings when compiling nethack; there are a lot. 23 | NK_CFLAGS += -w 24 | 25 | # Libraries required to build the target 26 | LIBS := c sel4 refossys refos datastruct 27 | 28 | # Custom linker script 29 | NK_LDFLAGS += -T $(SOURCE_DIR)/linker.lds 30 | 31 | include $(SEL4_COMMON)/common.mk 32 | -------------------------------------------------------------------------------- /impl/libs/librefossys/include/refos-io/stdio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef _REFOS_IO_STDIO_H_ 8 | #define _REFOS_IO_STDIO_H_ 9 | 10 | /*! @file 11 | @brief There is a copy of this file in librefos/src/refos-util/stdio_copy.h. 12 | This unfortunate duplication is done to avoid cyclic dependency problems between 13 | the libraries. 14 | */ 15 | 16 | #include 17 | #include 18 | #include 19 | 20 | /*! @brief Whether to translate the return key into a "\n" from a "\r". */ 21 | extern bool refos_stdio_translate_stdin_cr; 22 | 23 | typedef size_t (*stdio_read_fn_t)(void *data, size_t count); 24 | 25 | typedef size_t (*stdio_write_fn_t)(void *data, size_t count); 26 | 27 | void refos_override_stdio(stdio_read_fn_t readfn, stdio_write_fn_t writefn); 28 | 29 | void refos_seL4_debug_override_stdout(void); 30 | 31 | void refos_setup_dataspace_stdio(char *dspacePath); 32 | 33 | int refos_async_getc(void); 34 | 35 | int refos_getc(void); 36 | 37 | #endif /* _REFOS_IO_STDIO_H_ */ 38 | -------------------------------------------------------------------------------- /impl/apps/process_server/src/dispatchers/name_syscall.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | /*! @file 8 | @brief Dispatcher for the procserv name server syscalls. 9 | 10 | Handles calls to process server name server interface. The process server acts as the root 11 | name server. 12 | */ 13 | 14 | #ifndef _REFOS_PROCESS_SERVER_DISPATCHER_NAMESERV_SYSCALL_H_ 15 | #define _REFOS_PROCESS_SERVER_DISPATCHER_NAMESERV_SYSCALL_H_ 16 | 17 | #include "../common.h" 18 | #include "dispatcher.h" 19 | 20 | /*! @brief Check whether the given recieved message is a nameserv syscall. 21 | @param m Struct containing info about the recieved message. 22 | @param userptr Output user pointer. Pass this into the generated dispatcher function. 23 | @return DISPATCH_SUCCESS if message is a nameserv syscall, DISPATCH_PASS otherwise. 24 | */ 25 | int check_dispatch_nameserv(struct procserv_msg *m, void **userptr); 26 | 27 | int rpc_sv_name_dispatcher(void *rpc_userptr, uint32_t label); 28 | 29 | #endif /* _REFOS_PROCESS_SERVER_DISPATCHER_NAMESERV_SYSCALL_H_ */ -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/include/mac-qt.h: -------------------------------------------------------------------------------- 1 | /* SCCS Id: @(#)mac-qt.h 3.4 2003/06/01 */ 2 | /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 2003. */ 3 | /* NetHack may be freely redistributed. See license for details. */ 4 | 5 | /* Compiler prefix file for the Macintosh Qt port. 6 | * 7 | * IMPORTANT: This file is intended only as a compiler prefix 8 | * file and must NEVER be included by other source (.c or .h) 9 | * files. 10 | * 11 | * Usage for MacOS X Project Builder: 12 | * Project menu -> Edit Active Target '_target_' -> 13 | * target settings dialog -> Settings -> Simple View -> 14 | * GCC Compiler Settings -> 15 | * set "Prefix Header" to include/mac-qt.h 16 | * 17 | * Usage for Metrowerks CodeWarrior: 18 | * Edit menu -> _target_ Settings -> Language Settings -> 19 | * C/C++ Language -> 20 | * set "Prefix File" to include/mac-qt.h 21 | */ 22 | 23 | #undef MAC 24 | #define UNIX 25 | #define BSD 26 | 27 | /* May already be defined by CodeWarrior as 0 or 1 */ 28 | #ifdef TARGET_API_MAC_CARBON 29 | # undef TARGET_API_MAC_CARBON 30 | #endif 31 | #define TARGET_API_MAC_CARBON 0 32 | 33 | #define GCC_WARN 34 | -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/include/mac-carbon.h: -------------------------------------------------------------------------------- 1 | /* SCCS Id: @(#)mac-carbon.h 3.4 2003/06/01 */ 2 | /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 2003. */ 3 | /* NetHack may be freely redistributed. See license for details. */ 4 | 5 | /* Compiler prefix file for the Macintosh Carbon port. 6 | * 7 | * IMPORTANT: This file is intended only as a compiler prefix 8 | * file and must NEVER be included by other source (.c or .h) 9 | * files. 10 | * 11 | * Usage for MacOS X Project Builder: 12 | * Project menu -> Edit Active Target '_target_' -> 13 | * target settings dialog -> Settings -> Simple View -> 14 | * GCC Compiler Settings -> 15 | * set "Prefix Header" to include/mac-carbon.h 16 | * 17 | * Usage for Metrowerks CodeWarrior: 18 | * Edit menu -> _target_ Settings -> Language Settings -> 19 | * C/C++ Language -> 20 | * set "Prefix File" to include/mac-carbon.h 21 | */ 22 | 23 | #define MAC 24 | #undef UNIX 25 | 26 | /* May already be defined by CodeWarrior as 0 or 1 */ 27 | #ifdef TARGET_API_MAC_CARBON 28 | # undef TARGET_API_MAC_CARBON 29 | #endif 30 | #define TARGET_API_MAC_CARBON 1 31 | 32 | #define GCC_WARN 33 | -------------------------------------------------------------------------------- /impl/apps/process_server/src/common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | /*! @file 8 | @brief Common helper functions and global definitions. 9 | 10 | Useful global definitions and general inline helper functions that every process server module 11 | should know about. 12 | */ 13 | 14 | #ifndef _REFOS_PROCESS_SERVER_COMMON_H_ 15 | #define _REFOS_PROCESS_SERVER_COMMON_H_ 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | // Macros. 29 | 30 | #define MiB(x) (1024*1024*(x)) 31 | #define die( ... ) while (1) { printf(__VA_ARGS__); seL4_DebugHalt(); } 32 | 33 | /* Debug printing. */ 34 | #include 35 | 36 | #include "badge.h" 37 | 38 | typedef seL4_Word vaddr_t; 39 | typedef seL4_Word paddr_t; 40 | 41 | #define kmalloc malloc 42 | #define krealloc realloc 43 | #define kfree free 44 | 45 | #endif /* _REFOS_PROCESS_SERVER_COMMON_H_ */ -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/include/edog.h: -------------------------------------------------------------------------------- 1 | /* SCCS Id: @(#)edog.h 3.4 1997/10/23 */ 2 | /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ 3 | /* NetHack may be freely redistributed. See license for details. */ 4 | 5 | #ifndef EDOG_H 6 | #define EDOG_H 7 | 8 | /* various types of food, the lower, the better liked. */ 9 | 10 | #define DOGFOOD 0 11 | #define CADAVER 1 12 | #define ACCFOOD 2 13 | #define MANFOOD 3 14 | #define APPORT 4 15 | #define POISON 5 16 | #define UNDEF 6 17 | #define TABU 7 18 | 19 | struct edog { 20 | long droptime; /* moment dog dropped object */ 21 | unsigned dropdist; /* dist of drpped obj from @ */ 22 | int apport; /* amount of training */ 23 | long whistletime; /* last time he whistled */ 24 | long hungrytime; /* will get hungry at this time */ 25 | coord ogoal; /* previous goal location */ 26 | int abuse; /* track abuses to this pet */ 27 | int revivals; /* count pet deaths */ 28 | int mhpmax_penalty; /* while starving, points reduced */ 29 | Bitfield(killed_by_u, 1); /* you attempted to kill him */ 30 | }; 31 | #define EDOG(mon) ((struct edog *)&(mon)->mextra[0]) 32 | 33 | #endif /* EDOG_H */ 34 | -------------------------------------------------------------------------------- /impl/apps/process_server/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | # Targets 8 | TARGETS := $(notdir $(SOURCE_DIR)).bin 9 | 10 | # Entry Point 11 | ENTRY_POINT := _sel4_start 12 | 13 | # Source files required to build the target 14 | CFILES := $(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/src/*.c)) 15 | CFILES += $(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/src/*/*.c)) 16 | CFILES += $(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/src/*/*/*.c)) 17 | CFILES += $(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/src/plat/${PLAT}/*.c)) 18 | CFILES += $(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/src/arch/${ARCH}/*.c)) 19 | 20 | OFILES := archive.o 21 | 22 | # We want to run C99 23 | NK_CFLAGS += -std=gnu99 -O2 24 | 25 | # Libraries required to build the target 26 | LIBS := c sel4 sel4muslcsys sel4allocman sel4platsupport sel4vka elf cpio refos sel4utils \ 27 | datastruct sel4debug sel4simple utils platsupport sel4vspace 28 | 29 | LIBS += sel4simple-default 30 | 31 | HDRFILES += $(wildcard ${SOURCE_DIR}/*) \ 32 | 33 | 34 | include $(SEL4_COMMON)/common.mk 35 | -------------------------------------------------------------------------------- /impl/libs/libdatastruct/include/data_struct/cvector.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef _CVECTOR_H_ 8 | #define _CVECTOR_H_ 9 | 10 | #define CVECTOR_INIT_SIZE 4 11 | #define CVECTOR_RESIZE_CHECK_FREQ 16 12 | 13 | #ifndef kmalloc 14 | #include 15 | #include 16 | #define kmalloc malloc 17 | #define krealloc realloc 18 | #define kfree free 19 | #endif 20 | 21 | typedef void* cvector_item_t; 22 | 23 | typedef struct cvector_s { 24 | cvector_item_t* data; 25 | size_t size; 26 | size_t count; 27 | int32_t nextResize; 28 | } cvector_t; 29 | 30 | void cvector_init(cvector_t *v); 31 | 32 | int cvector_add(cvector_t *v, cvector_item_t e); 33 | 34 | static inline size_t cvector_count(cvector_t *v) { 35 | return v->count; 36 | } 37 | 38 | void cvector_set(cvector_t *v, uint32_t index, cvector_item_t e); 39 | 40 | cvector_item_t cvector_get(cvector_t *v, int index); 41 | 42 | void cvector_delete(cvector_t *v, int index); 43 | 44 | void cvector_free(cvector_t *v); 45 | 46 | void cvector_reset(cvector_t *v); 47 | 48 | #endif /* _CVECTOR_H_ */ 49 | -------------------------------------------------------------------------------- /impl/libs/libvterm/src/utf8.h: -------------------------------------------------------------------------------- 1 | /* The following functions copied and adapted from libtermkey 2 | * 3 | * http://www.leonerd.org.uk/code/libtermkey/ 4 | */ 5 | static inline unsigned int utf8_seqlen(long codepoint) 6 | { 7 | if(codepoint < 0x0000080) return 1; 8 | if(codepoint < 0x0000800) return 2; 9 | if(codepoint < 0x0010000) return 3; 10 | if(codepoint < 0x0200000) return 4; 11 | if(codepoint < 0x4000000) return 5; 12 | return 6; 13 | } 14 | 15 | static int fill_utf8(long codepoint, char *str) 16 | { 17 | int nbytes = utf8_seqlen(codepoint); 18 | 19 | str[nbytes] = 0; 20 | 21 | // This is easier done backwards 22 | int b = nbytes; 23 | while(b > 1) { 24 | b--; 25 | str[b] = 0x80 | (codepoint & 0x3f); 26 | codepoint >>= 6; 27 | } 28 | 29 | switch(nbytes) { 30 | case 1: str[0] = (codepoint & 0x7f); break; 31 | case 2: str[0] = 0xc0 | (codepoint & 0x1f); break; 32 | case 3: str[0] = 0xe0 | (codepoint & 0x0f); break; 33 | case 4: str[0] = 0xf0 | (codepoint & 0x07); break; 34 | case 5: str[0] = 0xf8 | (codepoint & 0x03); break; 35 | case 6: str[0] = 0xfc | (codepoint & 0x01); break; 36 | } 37 | 38 | return nbytes; 39 | } 40 | /* end copy */ 41 | -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/include/align.h: -------------------------------------------------------------------------------- 1 | /* SCCS Id: @(#)align.h 3.4 1991/12/29 */ 2 | /* Copyright (c) Mike Stephenson, Izchak Miller 1991. */ 3 | /* NetHack may be freely redistributed. See license for details. */ 4 | 5 | #ifndef ALIGN_H 6 | #define ALIGN_H 7 | 8 | typedef schar aligntyp; /* basic alignment type */ 9 | 10 | typedef struct align { /* alignment & record */ 11 | aligntyp type; 12 | int record; 13 | } align; 14 | 15 | /* bounds for "record" -- respect initial alignments of 10 */ 16 | #define ALIGNLIM (10L + (moves/200L)) 17 | 18 | #define A_NONE (-128) /* the value range of type */ 19 | 20 | #define A_CHAOTIC (-1) 21 | #define A_NEUTRAL 0 22 | #define A_LAWFUL 1 23 | 24 | #define A_COALIGNED 1 25 | #define A_OPALIGNED (-1) 26 | 27 | #define AM_NONE 0 28 | #define AM_CHAOTIC 1 29 | #define AM_NEUTRAL 2 30 | #define AM_LAWFUL 4 31 | 32 | #define AM_MASK 7 33 | 34 | #define AM_SPLEV_CO 3 35 | #define AM_SPLEV_NONCO 7 36 | 37 | #define Amask2align(x) ((aligntyp) ((!(x)) ? A_NONE \ 38 | : ((x) == AM_LAWFUL) ? A_LAWFUL : ((int)x) - 2)) 39 | #define Align2amask(x) (((x) == A_NONE) ? AM_NONE \ 40 | : ((x) == A_LAWFUL) ? AM_LAWFUL : (x) + 2) 41 | 42 | #endif /* ALIGN_H */ 43 | -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/win/share/tile.h: -------------------------------------------------------------------------------- 1 | typedef unsigned char pixval; 2 | 3 | typedef struct { 4 | pixval r, g, b; 5 | } pixel; 6 | 7 | #define MAXCOLORMAPSIZE 256 8 | 9 | #define CM_RED 0 10 | #define CM_GREEN 1 11 | #define CM_BLUE 2 12 | 13 | /* shared between reader and writer */ 14 | extern pixval ColorMap[3][MAXCOLORMAPSIZE]; 15 | extern int colorsinmap; 16 | /* writer's accumulated colormap */ 17 | extern pixval MainColorMap[3][MAXCOLORMAPSIZE]; 18 | extern int colorsinmainmap; 19 | 20 | #include "dlb.h" /* for MODEs */ 21 | 22 | /* size of tiles */ 23 | #ifndef TILE_X 24 | #define TILE_X 16 25 | #endif 26 | #ifndef TILE_Y 27 | #define TILE_Y 16 28 | #endif 29 | 30 | #define Fprintf (void) fprintf 31 | 32 | 33 | extern boolean FDECL(fopen_text_file, (const char *, const char *)); 34 | extern boolean FDECL(read_text_tile, (pixel (*)[TILE_X])); 35 | extern boolean FDECL(write_text_tile, (pixel (*)[TILE_X])); 36 | extern int NDECL(fclose_text_file); 37 | 38 | extern void NDECL(init_colormap); 39 | extern void NDECL(merge_colormap); 40 | 41 | #if defined(MICRO) || defined(WIN32) 42 | #undef exit 43 | # if !defined(MSDOS) && !defined(WIN32) 44 | extern void FDECL(exit, (int)); 45 | # endif 46 | #endif 47 | -------------------------------------------------------------------------------- /impl/apps/terminal/src/print_time.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #include 8 | #include 9 | 10 | /*! @file 11 | @brief Supports printing the current time in a human readable form 12 | */ 13 | 14 | char *weekdays[7] = {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"}; 15 | char *months[12] = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}; 16 | 17 | /*! @brief Returns the day as a string */ 18 | char * day_to_string(int day) 19 | { 20 | return weekdays[day - 1]; 21 | } 22 | 23 | /*! @brief Returns the month as a string */ 24 | char * month_to_string(int month) 25 | { 26 | return months[month]; 27 | } 28 | 29 | /*! @brief Formats the time string */ 30 | char * refos_print_time (struct tm *tm) 31 | { 32 | static char buf[47]; 33 | snprintf(buf, 47, "%s, %s%3d %.2d:%.2d:%.2d %d\n", 34 | day_to_string(tm->tm_wday), 35 | month_to_string(tm->tm_mon), 36 | tm->tm_mday, tm->tm_hour, 37 | tm->tm_min, tm->tm_sec, 38 | 1900 + tm->tm_year); 39 | return buf; 40 | } 41 | -------------------------------------------------------------------------------- /impl/apps/timer_server/src/badge.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef _TIMER_SERVER_BADGE_H_ 8 | #define _TIMER_SERVER_BADGE_H_ 9 | 10 | #include 11 | 12 | /*! @file 13 | @brief Timer Server badge space definitions. 14 | 15 | Since Timer server needs to recieve both asynchronous device IRQ and synchronous syscall 16 | messages, similar to the console server. The solution is thus also similar to console server. 17 | Please look in @ref console_server/src/badge.h for a more detailed explanation. 18 | */ 19 | 20 | #define TIMESERV_DSPACE_BADGE_TIMER 0x26 /*!< @brief Timer dataspace badge value. */ 21 | 22 | /* ---- BadgeID 48 to 4143 : Clients ---- */ 23 | #define TIMESERV_CLIENT_BADGE_BASE 0x30 24 | 25 | /* ---- Async BadgeIDs ---- */ 26 | 27 | #define TIMESERV_ASYNC_BADGE_MASK (1 << 19) 28 | #define TIMESERV_ASYNC_NOTIFY_BADGE (1 << 0) 29 | 30 | #define TIMESERV_IRQ_BADGE_BASE_POW 1 31 | #define TIMESERV_IRQ_BADGE_BASE_POW_TOP 18 32 | #define TIMESERV_IRQ_BADGE_NCHANNELS \ 33 | ((TIMESERV_IRQ_BADGE_BASE_POW_TOP - TIMESERV_IRQ_BADGE_BASE_POW) + 1) 34 | 35 | #endif /* _TIMER_SERVER_BADGE_H_ */ 36 | -------------------------------------------------------------------------------- /impl/libs/libdatastruct/include/data_struct/coat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef _C_OBJECT_ALLOCATION_TABLE_H_ 8 | #define _C_OBJECT_ALLOCATION_TABLE_H_ 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #define COAT_INVALID_ID -1 16 | #define COAT_ARGS 4 17 | 18 | struct coat_s; 19 | typedef struct coat_s coat_t; 20 | 21 | // Not a bad idea to 'inherit' this struct. 22 | struct coat_s { 23 | // Config 24 | void (*oat_expand)(cvector_t *table); 25 | cvector_item_t (*oat_create)(coat_t *oat, int id, uint32_t arg[COAT_ARGS]); 26 | void (*oat_delete)(coat_t *oat, cvector_item_t *obj); 27 | 28 | // Members. 29 | cpool_t /* indexes */ pool; 30 | cvector_t /* cvector_item_t */ table; 31 | }; 32 | 33 | void coat_init(coat_t *t, int start, int end); 34 | 35 | void coat_release(coat_t *t); 36 | 37 | int coat_alloc(coat_t *t, uint32_t arg[COAT_ARGS], cvector_item_t *out_obj); 38 | 39 | cvector_item_t coat_get(coat_t *t, int id); 40 | 41 | int coat_free(coat_t *t, int id); 42 | 43 | #endif /* _C_OBJECT_ALLOCATION_TABLE_H_ */ 44 | -------------------------------------------------------------------------------- /impl/libs/Kconfig: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | # 4 | # SPDX-License-Identifier: BSD-2-Clause 5 | # 6 | 7 | config SEL4_LIBS_PATH 8 | string 9 | option env="SEL4_LIBS_PATH" 10 | 11 | menu "seL4 Libraries" 12 | 13 | source "$SEL4_LIBS_PATH/libsel4/Kconfig" 14 | source "$SEL4_LIBS_PATH/libcpio/Kconfig" 15 | source "$SEL4_LIBS_PATH/libdatastruct/Kconfig" 16 | source "$SEL4_LIBS_PATH/libelf/Kconfig" 17 | source "$SEL4_LIBS_PATH/libmuslc/Kconfig" 18 | source "$SEL4_LIBS_PATH/libsel4allocman/Kconfig" 19 | source "$SEL4_LIBS_PATH/libsel4debug/Kconfig" 20 | source "$SEL4_LIBS_PATH/libsel4muslcsys/Kconfig" 21 | source "$SEL4_LIBS_PATH/libsel4platsupport/Kconfig" 22 | source "$SEL4_LIBS_PATH/libsel4simple/Kconfig" 23 | source "$SEL4_LIBS_PATH/libsel4simple-default/Kconfig" 24 | source "$SEL4_LIBS_PATH/libsel4utils/Kconfig" 25 | source "$SEL4_LIBS_PATH/libsel4vspace/Kconfig" 26 | source "$SEL4_LIBS_PATH/libsel4vka/Kconfig" 27 | source "$SEL4_LIBS_PATH/libsel4utils/Kconfig" 28 | source "$SEL4_LIBS_PATH/librefossys/Kconfig" 29 | source "$SEL4_LIBS_PATH/librefos/Kconfig" 30 | source "$SEL4_LIBS_PATH/libutils/Kconfig" 31 | source "$SEL4_LIBS_PATH/libvterm/Kconfig" 32 | source "$SEL4_LIBS_PATH/libplatsupport/Kconfig" 33 | 34 | endmenu 35 | -------------------------------------------------------------------------------- /impl/libs/libvterm/src/LICENSE: -------------------------------------------------------------------------------- 1 | libvterm as a whole is licensed under the following MIT license: 2 | 3 | The MIT License 4 | 5 | Copyright (c) 2008 Paul Evans 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/include/mac-term.h: -------------------------------------------------------------------------------- 1 | /* SCCS Id: @(#)mac-term.h 3.4 2003/06/01 */ 2 | /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 2003. */ 3 | /* NetHack may be freely redistributed. See license for details. */ 4 | 5 | /* Compiler prefix file for the MacOS X Terminal.app port. 6 | * 7 | * IMPORTANT: This file is intended only as a compiler prefix 8 | * file and must NEVER be included by other source (.c or .h) 9 | * files. 10 | * 11 | * Usage for MacOS X Project Builder: 12 | * Project menu -> Edit Active Target '_target_' -> 13 | * target settings dialog -> Settings -> Simple View -> 14 | * GCC Compiler Settings -> 15 | * set "Prefix Header" to include/mac-term.h 16 | * 17 | * Usage for Metrowerks CodeWarrior: 18 | * Edit menu -> _target_ Settings -> Language Settings -> 19 | * C/C++ Language -> 20 | * set "Prefix File" to include/mac-term.h 21 | */ 22 | 23 | /* Stuff needed for the core of NetHack */ 24 | #undef MAC 25 | #define UNIX 26 | #define BSD 27 | #define __FreeBSD__ /* Darwin is based on FreeBSD */ 28 | #define GCC_WARN 29 | 30 | /* May already be defined by CodeWarrior as 0 or 1 */ 31 | #ifdef TARGET_API_MAC_CARBON 32 | # undef TARGET_API_MAC_CARBON 33 | #endif 34 | #define TARGET_API_MAC_CARBON 0 /* Not Carbon */ 35 | -------------------------------------------------------------------------------- /impl/apps/console_server/src/dispatchers/dspace/stdio_dspace.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef _CONSOLE_SERVER_DISPATCHER_DSPACE_STDIO_H_ 8 | #define _CONSOLE_SERVER_DISPATCHER_DSPACE_STDIO_H_ 9 | 10 | #include "../../badge.h" 11 | 12 | /*! @file 13 | @brief Serial STDIO dataspace interface functions. */ 14 | 15 | /*! @brief Similar to data_open_handler, for serial dataspaces. */ 16 | seL4_CPtr serial_open_handler(void *rpc_userptr , char* rpc_name , int rpc_flags , int rpc_mode , 17 | int rpc_size , int* rpc_errno); 18 | 19 | /*! @brief Similar to data_write_handler, for serial dataspaces. */ 20 | int serial_write_handler(void *rpc_userptr , seL4_CPtr rpc_dspace_fd , uint32_t rpc_offset , 21 | rpc_buffer_t rpc_buf , uint32_t rpc_count); 22 | 23 | /*! @brief Similar to data_getc_handler, for serial dataspaces. */ 24 | int serial_getc_handler(void *rpc_userptr , seL4_CPtr rpc_dspace_fd , int rpc_block); 25 | 26 | /*! @brief Similar to data_putc_handler, for serial dataspaces. */ 27 | refos_err_t serial_putc_handler(void *rpc_userptr , seL4_CPtr rpc_dspace_fd , int rpc_c); 28 | 29 | #endif /* _CONSOLE_SERVER_DISPATCHER_DSPACE_STDIO_H_ */ -------------------------------------------------------------------------------- /impl/apps/process_server/src/badge.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef _REFOS_PROCESS_SERVER_BADGE_H_ 8 | #define _REFOS_PROCESS_SERVER_BADGE_H_ 9 | 10 | #include 11 | 12 | /*! @file 13 | @brief Process Server badge space definitions. 14 | */ 15 | 16 | /* ---- BadgeID 3 to 4098 : ASID & Liveness caps ---- */ 17 | 18 | #define PID_MAX PROCSERV_MAX_PROCESSES 19 | #define PID_INVALID (ASID_MAX_ID + 1) 20 | 21 | #define PID_BADGE_BASE 0x3 22 | #define PID_BADGE_END (PID_BADGE_BASE + PID_MAX) 23 | #define PID_LIVENESS_BADGE_BASE PID_BADGE_END 24 | #define PID_LIVENESS_BADGE_END (PID_LIVENESS_BADGE_BASE + PID_MAX) 25 | 26 | /* ---- BadgeID 4099 to 12290 : Windows ---- */ 27 | 28 | #define W_MAX_WINDOWS 8192 29 | #define W_MAX_ASSOCIATED_WINDOWS 2048 30 | 31 | #define W_BADGE_BASE PID_LIVENESS_BADGE_END 32 | #define W_BADGE_END (W_BADGE_BASE + W_MAX_WINDOWS) 33 | 34 | /* ---- BadgeID 12291 to 20482 : RAM Dataspace Objects ---- */ 35 | 36 | #define RAM_DATASPACE_MAX_NUM_DATASPACE 8192 37 | #define RAM_DATASPACE_BADGE_BASE W_BADGE_END 38 | #define RAM_DATASPACE_BADGE_END (RAM_DATASPACE_BADGE_BASE + RAM_DATASPACE_MAX_NUM_DATASPACE) 39 | 40 | #endif /* _REFOS_PROCESS_SERVER_BADGE_H_ */ 41 | -------------------------------------------------------------------------------- /LICENSES/BSD-2-Clause.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | 5 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | 7 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | 9 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 10 | -------------------------------------------------------------------------------- /impl/apps/console_server/src/dispatchers/dispatch.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef _OS_SERV_DISPATCH_DISPATCH_H_ 8 | #define _OS_SERV_DISPATCH_DISPATCH_H_ 9 | 10 | #include "../state.h" 11 | 12 | /*! @file 13 | @brief Common Console server dispatcher helper functions. */ 14 | 15 | #define CONSERV_DISPATCH_ANON_CLIENT_MAGIC 0xC099F13E 16 | 17 | /*! @brief Helper function to check for an interface. 18 | 19 | Most of the other check_dispatcher_*_interface functions use call this helper function, that 20 | does most of the real work. It generates a usable userptr containing the client_t structure of 21 | the calling process. If the calling syscall label enum is outside of given range, DISPATCH_PASS 22 | is returned. 23 | 24 | @param m The recieved message structure. 25 | @param userptr Output userptr containing corresponding client, to be passed into generated 26 | interface dispatcher function. 27 | @param labelMin The minimum syscall label to accept. 28 | @param labelMax The maximum syscall label to accept. 29 | */ 30 | int check_dispatch_interface(srv_msg_t *m, void **userptr, int labelMin, int labelMax); 31 | 32 | #endif /* _OS_SERV_DISPATCH_DISPATCH_H_ */ -------------------------------------------------------------------------------- /impl/apps/console_server/src/dispatchers/dspace/screen_dspace.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef _CONSOLE_SERVER_DISPATCHER_DSPACE_SCREEN_H_ 8 | #define _CONSOLE_SERVER_DISPATCHER_DSPACE_SCREEN_H_ 9 | 10 | /*! @file 11 | @brief Screen / keyboard STDIO dataspace interface functions. */ 12 | 13 | /*! @brief Similar to data_open_handler, for screen / keyboard dataspaces. */ 14 | seL4_CPtr screen_open_handler(void *rpc_userptr , char* rpc_name , int rpc_flags , int rpc_mode , 15 | int rpc_size , int* rpc_errno); 16 | 17 | /*! @brief Similar to data_write_handler, for screen / keyboard dataspaces. */ 18 | int screen_write_handler(void *rpc_userptr , seL4_CPtr rpc_dspace_fd , uint32_t rpc_offset , 19 | rpc_buffer_t rpc_buf , uint32_t rpc_count); 20 | 21 | /*! @brief Similar to data_getc_handler, for screen / keyboard dataspaces. */ 22 | int screen_getc_handler(void *rpc_userptr , seL4_CPtr rpc_dspace_fd , int rpc_block); 23 | 24 | /*! @brief Similar to data_putc_handler, for screen / keyboard dataspaces. */ 25 | refos_err_t screen_putc_handler(void *rpc_userptr , seL4_CPtr rpc_dspace_fd , int rpc_c); 26 | 27 | #endif /* _CONSOLE_SERVER_DISPATCHER_DSPACE_SCREEN_H_ */ -------------------------------------------------------------------------------- /impl/apps/timer_server/src/dispatchers/dispatch.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef _TIMESERV_DISPATCH_DISPATCH_H_ 8 | #define _TIMESERV_DISPATCH_DISPATCH_H_ 9 | 10 | #include "../state.h" 11 | 12 | /*! @file 13 | @brief Common timer server dispatcher helper functions. */ 14 | 15 | #define TIMESERV_DISPATCH_ANON_CLIENT_MAGIC 0xC099F13E 16 | 17 | /*! @brief Helper function to check for an interface. 18 | 19 | Most of the other check_dispatcher_*_interface functions use call this helper function, that 20 | does most of the real work. It generates a usable userptr containing the client_t structure of 21 | the calling process. If the calling syscall label enum is outside of given range, DISPATCH_PASS 22 | is returned. 23 | 24 | @param m The recieved message structure. 25 | @param userptr Output userptr containing corresponding client, to be passed into generated 26 | interface dispatcher function. 27 | @param labelMin The minimum syscall label to accept. 28 | @param labelMax The maximum syscall label to accept. 29 | */ 30 | int check_dispatch_interface(srv_msg_t *m, void **userptr, int labelMin, int labelMax); 31 | 32 | #endif /* _TIMESERV_DISPATCH_DISPATCH_H_ */ -------------------------------------------------------------------------------- /impl/apps/process_server/src/dispatchers/fault_handler.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | /*! @file 8 | @brief Process server fault dispatcher which handles VM faults. 9 | 10 | Handles faults which the kernel sends to the processs server IPC endpoint pretending to be the 11 | faulting client, handling internal ram dataspace faults or delegating to the corresponding 12 | pager / content initialiser accordingly. 13 | */ 14 | 15 | #ifndef _REFOS_PROCESS_SERVER_DISPATCHER_FAULT_HANDLER_H_ 16 | #define _REFOS_PROCESS_SERVER_DISPATCHER_FAULT_HANDLER_H_ 17 | 18 | #include "dispatcher.h" 19 | #include "../state.h" 20 | 21 | /*! @brief Check whether the given recieved message is a VM fault message. 22 | @param m Struct containing info about the recieved message. 23 | @param userptr Output user pointer. Pass this into the generated dispatcher function. 24 | @return DISPATCH_SUCCESS if message is a VM fault syscall, DISPATCH_PASS otherwise. 25 | */ 26 | int check_dispatch_fault(struct procserv_msg *m, void **userptr); 27 | 28 | /*! \brief Dispatcher for client VM faults. */ 29 | int dispatch_vm_fault(struct procserv_msg *m, void **userptr); 30 | 31 | #endif /* _REFOS_PROCESS_SERVER_DISPATCHER_FAULT_HANDLER_H_ */ 32 | -------------------------------------------------------------------------------- /impl/libs/libvterm/include/vterm/vterm_input.h: -------------------------------------------------------------------------------- 1 | #ifndef __VTERM_INPUT_H__ 2 | #define __VTERM_INPUT_H__ 3 | 4 | typedef enum { 5 | VTERM_MOD_NONE = 0x00, 6 | VTERM_MOD_SHIFT = 0x01, 7 | VTERM_MOD_ALT = 0x02, 8 | VTERM_MOD_CTRL = 0x04, 9 | } VTermModifier; 10 | 11 | typedef enum { 12 | VTERM_KEY_NONE, 13 | 14 | VTERM_KEY_ENTER, 15 | VTERM_KEY_TAB, 16 | VTERM_KEY_BACKSPACE, 17 | VTERM_KEY_ESCAPE, 18 | 19 | VTERM_KEY_UP, 20 | VTERM_KEY_DOWN, 21 | VTERM_KEY_LEFT, 22 | VTERM_KEY_RIGHT, 23 | 24 | VTERM_KEY_INS, 25 | VTERM_KEY_DEL, 26 | VTERM_KEY_HOME, 27 | VTERM_KEY_END, 28 | VTERM_KEY_PAGEUP, 29 | VTERM_KEY_PAGEDOWN, 30 | 31 | VTERM_KEY_FUNCTION_0 = 256, 32 | VTERM_KEY_FUNCTION_MAX = VTERM_KEY_FUNCTION_0 + 255, 33 | 34 | VTERM_KEY_KP_0, 35 | VTERM_KEY_KP_1, 36 | VTERM_KEY_KP_2, 37 | VTERM_KEY_KP_3, 38 | VTERM_KEY_KP_4, 39 | VTERM_KEY_KP_5, 40 | VTERM_KEY_KP_6, 41 | VTERM_KEY_KP_7, 42 | VTERM_KEY_KP_8, 43 | VTERM_KEY_KP_9, 44 | VTERM_KEY_KP_MULT, 45 | VTERM_KEY_KP_PLUS, 46 | VTERM_KEY_KP_COMMA, 47 | VTERM_KEY_KP_MINUS, 48 | VTERM_KEY_KP_PERIOD, 49 | VTERM_KEY_KP_DIVIDE, 50 | VTERM_KEY_KP_ENTER, 51 | VTERM_KEY_KP_EQUAL, 52 | 53 | VTERM_KEY_MAX, // Must be last 54 | } VTermKey; 55 | 56 | #define VTERM_KEY_FUNCTION(n) (VTERM_KEY_FUNCTION_0+(n)) 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /impl/apps/file_server/src/dispatchers/dispatch.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef _FILESERV_SERV_DISPATCH_H_ 8 | #define _FILESERV_SERV_DISPATCH_H_ 9 | 10 | #include "../state.h" 11 | 12 | /*! @file 13 | @brief Common file server dispatcher helper functions. */ 14 | 15 | #define FS_DISPATCH_ANON_CLIENT_MAGIC 0x2F883C2C 16 | #define SET_ERRNO_PTR(e, ev) if (e) {(*e) = (ev);} 17 | 18 | /*! @brief Helper function to check for an interface. 19 | 20 | Most of the other check_dispatcher_*_interface functions use call this helper function, that 21 | does most of the real work. It generates a usable userptr containing the client_t structure of 22 | the calling process. If the calling syscall label enum is outside of given range, DISPATCH_PASS 23 | is returned. 24 | 25 | @param m The recieved message structure. 26 | @param userptr Output userptr containing corresponding client, to be passed into generated 27 | interface dispatcher function. 28 | @param labelMin The minimum syscall label to accept. 29 | @param labelMax The maximum syscall label to accept. 30 | */ 31 | int check_dispatch_interface(srv_msg_t *m, void **userptr, int labelMin, int labelMax); 32 | 33 | #endif /* _FILESERV_SERV_DISPATCH_H_ */ -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/doc/fixes31.3: -------------------------------------------------------------------------------- 1 | avoid divide by zero crash for eggs produced from horn of plenty 2 | prevent monsters from eating the invocation tools or Rider corpses 3 | make artifacts much less likely to be destroyed 4 | fix freezing lava in front a raised drawbridge 5 | fix digging pits in front of raised drawbridge; improve digging next to pools 6 | since random teleports have no --More-- prompt, have them purge REDO data 7 | to avoid repeating previous command before noticing changed context 8 | make magic portals function for monsters 9 | make numerous priest blessings increasingly rare, with an upper limit 10 | fix missing quotation marks in quest speech 11 | prevent monsters like killer bees from opening tins 12 | add: keep track of # player deaths, save game start time in struct u 13 | don't used "uncursed" with gold in containers in ending inventory display 14 | 15 | PC: Fix black/gray/white display problem 16 | 17 | X11: set input text portion of the dialog box so it is the width of the box 18 | X11: fix message window seperator redraw problem (thanks to 19 | Ivan D. Brawley ) 20 | VMS: avoid false "trickery" detection for bonesX#.##;1 levels 21 | VMS: prevent display of really long broadcast messages from clobbering stack 22 | VMS: prevent endless input loop upon remote terminal disconnect 23 | -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/include/mfndpos.h: -------------------------------------------------------------------------------- 1 | /* SCCS Id: @(#)mfndpos.h 3.4 2002/04/06 */ 2 | /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ 3 | /* NetHack may be freely redistributed. See license for details. */ 4 | 5 | #ifndef MFNDPOS_H 6 | #define MFNDPOS_H 7 | 8 | #define ALLOW_TRAPS 0x00020000L /* can enter traps */ 9 | #define ALLOW_U 0x00040000L /* can attack you */ 10 | #define ALLOW_M 0x00080000L /* can attack other monsters */ 11 | #define ALLOW_TM 0x00100000L /* can attack tame monsters */ 12 | #define ALLOW_ALL (ALLOW_U | ALLOW_M | ALLOW_TM | ALLOW_TRAPS) 13 | #define NOTONL 0x00200000L /* avoids direct line to player */ 14 | #define OPENDOOR 0x00400000L /* opens closed doors */ 15 | #define UNLOCKDOOR 0x00800000L /* unlocks locked doors */ 16 | #define BUSTDOOR 0x01000000L /* breaks any doors */ 17 | #define ALLOW_ROCK 0x02000000L /* pushes rocks */ 18 | #define ALLOW_WALL 0x04000000L /* walks thru walls */ 19 | #define ALLOW_DIG 0x08000000L /* digs */ 20 | #define ALLOW_BARS 0x10000000L /* may pass thru iron bars */ 21 | #define ALLOW_SANCT 0x20000000L /* enters temples */ 22 | #define ALLOW_SSM 0x40000000L /* ignores scare monster */ 23 | #ifdef NHSTDC 24 | #define NOGARLIC 0x80000000UL /* hates garlic */ 25 | #else 26 | #define NOGARLIC 0x80000000L /* hates garlic */ 27 | #endif 28 | 29 | #endif /* MFNDPOS_H */ 30 | -------------------------------------------------------------------------------- /impl/libs/libdatastruct/src/cqueue.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | void cqueue_init(cqueue_t *q, uint32_t maxSize) { 12 | assert(q); 13 | q->data = kmalloc(sizeof(cqueue_item_t) * maxSize); 14 | assert(q->data); 15 | q->top = 0; 16 | q->count = 0; 17 | q->maxSize = maxSize; 18 | } 19 | 20 | bool cqueue_push(cqueue_t *q, cqueue_item_t e) { 21 | assert(q && q->data); 22 | while (q->count >= q->maxSize) { 23 | return false; 24 | } 25 | q->data[q->top] = e; 26 | q->top = (q->top + 1) % q->maxSize; 27 | q->count++; 28 | return true; 29 | } 30 | 31 | cqueue_item_t cqueue_pop(cqueue_t *q) { 32 | assert(q && q->data); 33 | if (q->count == 0) { 34 | return (cqueue_item_t) NULL; 35 | } 36 | uint32_t bot = (q->top >= q->count) ? (q->top - q->count) : (q->maxSize - (q->count - q->top)); 37 | assert(bot < q->maxSize); 38 | cqueue_item_t item = q->data[bot]; 39 | q->count--; 40 | return item; 41 | } 42 | 43 | void cqueue_free(cqueue_t *q) { 44 | if (q->data) { 45 | kfree(q->data); 46 | q->data = NULL; 47 | } 48 | q->top = 0; 49 | q->count = 0; 50 | q->maxSize = 0; 51 | } -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/include/attrib.h: -------------------------------------------------------------------------------- 1 | /* SCCS Id: @(#)attrib.h 3.4 1990/22/02 */ 2 | /* Copyright 1988, Mike Stephenson */ 3 | /* NetHack may be freely redistributed. See license for details. */ 4 | 5 | /* attrib.h - Header file for character class processing. */ 6 | 7 | #ifndef ATTRIB_H 8 | #define ATTRIB_H 9 | 10 | #define A_STR 0 11 | #define A_INT 1 12 | #define A_WIS 2 13 | #define A_DEX 3 14 | #define A_CON 4 15 | #define A_CHA 5 16 | 17 | #define A_MAX 6 /* used in rn2() selection of attrib */ 18 | 19 | #define ABASE(x) (u.acurr.a[x]) 20 | #define ABON(x) (u.abon.a[x]) 21 | #define AEXE(x) (u.aexe.a[x]) 22 | #define ACURR(x) (acurr(x)) 23 | #define ACURRSTR (acurrstr()) 24 | /* should be: */ 25 | /* #define ACURR(x) (ABON(x) + ATEMP(x) + (Upolyd ? MBASE(x) : ABASE(x)) */ 26 | #define MCURR(x) (u.macurr.a[x]) 27 | #define AMAX(x) (u.amax.a[x]) 28 | #define MMAX(x) (u.mamax.a[x]) 29 | 30 | #define ATEMP(x) (u.atemp.a[x]) 31 | #define ATIME(x) (u.atime.a[x]) 32 | 33 | /* KMH -- Conveniences when dealing with strength constants */ 34 | #define STR18(x) (18+(x)) /* 18/xx */ 35 | #define STR19(x) (100+(x)) /* For 19 and above */ 36 | 37 | struct attribs { 38 | schar a[A_MAX]; 39 | }; 40 | 41 | #define ATTRMAX(x) ((x == A_STR && Upolyd && strongmonst(youmonst.data)) ? STR18(100) : urace.attrmax[x]) 42 | #define ATTRMIN(x) (urace.attrmin[x]) 43 | 44 | #endif /* ATTRIB_H */ 45 | -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/sys/unix/setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Copy files to their correct locations. 3 | # 4 | # If arguments are given, try symbolic link first. This is not the default 5 | # so that most people will have the distribution versions stay around so 6 | # subsequent patches can be applied. People who pay enough attention to 7 | # know there's a non-default behavior are assumed to pay enough attention 8 | # to keep distribution versions if they modify things. 9 | 10 | # Were we started from the top level? Cope. 11 | if [ -f sys/unix/Makefile.top ]; then cd sys/unix; fi 12 | 13 | if [ $# -gt 0 ] ; then 14 | # First, try to make a symbolic link. 15 | # 16 | ln -s Makefile.top Makefile >/dev/null 2>&1 17 | if [ $? -eq 0 ] ; then 18 | 19 | echo "Lucky you! Symbolic links." 20 | rm -f Makefile 21 | 22 | umask 0 23 | ln -s sys/unix/Makefile.top ../../Makefile 24 | ln -s ../sys/unix/Makefile.dat ../../dat/Makefile 25 | ln -s ../sys/unix/Makefile.doc ../../doc/Makefile 26 | ln -s ../sys/unix/Makefile.src ../../src/Makefile 27 | ln -s ../sys/unix/Makefile.utl ../../util/Makefile 28 | exit 0 29 | fi 30 | fi 31 | 32 | # 33 | # Otherwise... 34 | 35 | echo "Copying Makefiles." 36 | 37 | cp Makefile.top ../../Makefile 38 | cp Makefile.dat ../../dat/Makefile 39 | cp Makefile.doc ../../doc/Makefile 40 | cp Makefile.src ../../src/Makefile 41 | cp Makefile.utl ../../util/Makefile 42 | -------------------------------------------------------------------------------- /impl/libs/librefossys/include/refos-io/filetable.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef _REFOS_IO_FILETABLE_H_ 8 | #define _REFOS_IO_FILETABLE_H_ 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #define FD_TABLE_MAGIC 0xA6B1063F 16 | #define FD_TABLE_BASE 3 /* 0, 1 and 2 are stdin, stdout and stderr. */ 17 | 18 | typedef struct fd_table_s { 19 | coat_t table; /* fd_table_entry_*_t, Inherited, must be first. */ 20 | uint32_t tableSize; 21 | uint32_t magic; 22 | } fd_table_t; 23 | 24 | void filetable_init(fd_table_t *fdt, uint32_t tableSize); 25 | 26 | void filetable_release(fd_table_t *fdt); 27 | 28 | int filetable_dspace_open(fd_table_t *fdt, char* filePath, int flags, int mode, int size); 29 | 30 | int filetable_close(fd_table_t *fdt, int fd); 31 | 32 | refos_err_t filetable_lseek(fd_table_t *fdt, int fd, int *offset, int whence); 33 | 34 | int filetable_read(fd_table_t *fdt, int fd, char *bufferDest, int bufferLen); 35 | 36 | int filetable_write(fd_table_t *fdt, int fd, char *bufferSrc, int bufferLen); 37 | 38 | seL4_CPtr filetable_dspace_get(fd_table_t *fdt, int fd); 39 | 40 | void filetable_init_default(void); 41 | 42 | void filetable_deinit_default(void); 43 | 44 | #endif /* _REFOS_IO_FILETABLE_H_ */ 45 | -------------------------------------------------------------------------------- /impl/refos_cidl_compile: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 4 | # 5 | # SPDX-License-Identifier: BSD-2-Clause 6 | # 7 | 8 | libros_xpath='libs/librefos/interface' 9 | libros_hpath='libs/librefos/include/refos-rpc' 10 | libros_spath='libs/librefos/src/refos-rpc' 11 | 12 | function cidl_libros_interface { 13 | ./cidl_compile -g --client --header $libros_xpath/${1}_interface.xml > $libros_hpath/${1}_client.h || exit 1 14 | ./cidl_compile -g --client $libros_xpath/${1}_interface.xml > $libros_spath/${1}_client.c || exit 1 15 | ./cidl_compile -g --server --header $libros_xpath/${1}_interface.xml > $libros_hpath/${1}_server.h || exit 1 16 | ./cidl_compile -g --server $libros_xpath/${1}_interface.xml > $libros_spath/${1}_server.c || exit 1 17 | ./cidl_compile -g --server --dispatcher $libros_xpath/${1}_interface.xml > $libros_spath/${1}_dispatcher.c || exit 1 18 | } 19 | 20 | function clean_libros_interface { 21 | rm $libros_hpath/${1}_client.h 22 | rm $libros_spath/${1}_client.c 23 | rm $libros_hpath/${1}_server.h 24 | rm $libros_spath/${1}_server.c 25 | rm $libros_spath/${1}_dispatcher.c 26 | } 27 | 28 | if [ $1 == 'make' ] 29 | then 30 | cidl_libros_interface $2 31 | elif [ $1 == 'clean' ] 32 | then 33 | clean_libros_interface $2 34 | else 35 | echo 'usage: refos_cidl_compile [make|clean] INTERFACE_NAME' 36 | exit 1 37 | fi 38 | -------------------------------------------------------------------------------- /impl/cidl_templates/root.py: -------------------------------------------------------------------------------- 1 | # Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 2 | # 3 | # SPDX-License-Identifier: BSD-2-Clause 4 | 5 | {{if header_mode}} 6 | #ifndef _RPC_INTERFACE_{{ifname.upper()}}_{{'CLIENT' if client_mode else 'SERVER'}}_H_\n 7 | #define _RPC_INTERFACE_{{ifname.upper()}}_{{'CLIENT' if client_mode else 'SERVER'}}_H_\n\n 8 | {{endif}} 9 | 10 | {{for include in includes}} 11 | {{include}}\n 12 | {{endfor}} 13 | {{if not header_mode}} 14 | #include \n 15 | #include \n 16 | {{endif}} 17 | \n\n 18 | 19 | /*! @file\n 20 | ____@brief Generated file for the {{ifname}} interface. Please do NOT edit this file. */\n\n 21 | 22 | {{if header_mode}} 23 | #ifndef _RPC_{{ifname.upper()}}_LABEL_ENUMS_\n 24 | #define _RPC_{{ifname.upper()}}_LABEL_ENUMS_\n 25 | /*! @brief RPC syscall label enums for {{ifname}} interface. */\n 26 | enum rpc_{{ifname}}_label_enum {\n 27 | ____RPC_{{ifname.upper()}}_LABEL_MIN = {{label_min}},\n 28 | 29 | {{for enum_entry in enum_list}} 30 | ____{{enum_entry}}\n 31 | {{endfor}} 32 | 33 | ____RPC_{{ifname.upper()}}_LABEL_MAX\n 34 | };\n 35 | #endif\n\n 36 | {{endif}} 37 | 38 | {{for func_output in func_list}} 39 | {{func_output}}\n 40 | {{endfor}} 41 | 42 | {{if header_mode}} 43 | #endif /* _RPC_INTERFACE_{{ifname.upper()}}_{{'CLIENT' if client_mode else 'SERVER'}}_H_ */\n 44 | {{endif}} 45 | -------------------------------------------------------------------------------- /impl/libs/librefos/include/refos/sync.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef _REFOS_SYNC_H_ 8 | #define _REFOS_SYNC_H_ 9 | 10 | /*! @file 11 | @brief Basic kernel synchronisation library. 12 | 13 | Basic mutex functionality using a kernel lock. Based on Anna Lyons' sync library. Implemented 14 | using a kernel async endpoint. Slow! 15 | */ 16 | 17 | typedef struct sync_mutex_* sync_mutex_t; 18 | 19 | /*! @brief Create a mutex object. 20 | @return The created mutex object. (Gives ownership. Must call sync_destroy_mutex on given obj) 21 | */ 22 | sync_mutex_t sync_create_mutex(); 23 | 24 | /*! @brief Destroy a mutex object. 25 | @param mutex The mutex object to destroy. (Takes ownership) 26 | */ 27 | void sync_destroy_mutex(sync_mutex_t mutex); 28 | 29 | /*! @brief Lock a mutex. May block current program. 30 | @param mutex The mutex to lock. (No ownership) 31 | */ 32 | void sync_acquire(sync_mutex_t mutex); 33 | 34 | /*! @brief Release lock on a mutex. 35 | @param mutex The mutex to release. (No ownership) 36 | */ 37 | void sync_release(sync_mutex_t mutex); 38 | 39 | /*! @brief Poll on a mutex. 40 | @param mutex The mutex to poll. (No ownership) 41 | @return True if mutex was acquired, false otherwise. 42 | */ 43 | int sync_try_acquire(sync_mutex_t mutex); 44 | 45 | #endif /* _REFOS_SYNC_H_ */ 46 | -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/include/nhlan.h: -------------------------------------------------------------------------------- 1 | /* SCCS Id: @(#)nhlan.h 3.4 1997/04/12 */ 2 | /* Copyright (c) Michael Allison, 1997 */ 3 | /* NetHack may be freely redistributed. See license for details. */ 4 | 5 | #ifndef NHLAN_H 6 | #define NHLAN_H 7 | /* 8 | * Here are the LAN features currently implemented: 9 | * LAN_MAIL Mail facility allowing receipt and 10 | * reading of mail. 11 | * LAN_SHARED_BONES Allows bones files to be stored on a 12 | * network share. (Does NOT imply compatibiliy 13 | * between unlike platforms) 14 | */ 15 | 16 | # ifdef LAN_FEATURES 17 | # ifdef LAN_MAIL 18 | #define MAIL 19 | #ifndef WIN32 20 | #define MAILCKFREQ 50 21 | #else 22 | /* 23 | * WIN32 port does the real mail lookups in a separate thread 24 | * and the NetHack core code really just checks a flag, 25 | * so that part of it can be done more often. The throttle 26 | * for how often the mail thread should contact the mail 27 | * system is controlled by MAILTHREADFREQ and is expressed 28 | * in milliseconds. 29 | */ 30 | #define MAILCKFREQ 5 31 | #define MAILTHREADFREQ 50000 32 | #endif 33 | 34 | #ifndef MAX_BODY_SIZE 35 | #define MAX_BODY_SIZE 1024 36 | #endif 37 | 38 | struct lan_mail_struct { 39 | char sender[120]; 40 | char subject[120]; 41 | boolean body_in_ram; /* TRUE means body in memory not file */ 42 | char filename[_MAX_PATH]; 43 | char body[MAX_BODY_SIZE]; 44 | }; 45 | # endif 46 | 47 | # endif /*LAN_FEATURES*/ 48 | #endif /*NHLAN_H*/ 49 | -------------------------------------------------------------------------------- /impl/apps/timer_server/src/dispatchers/dspace/timer_dspace.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef _TIMER_SERVER_DISPATCHER_DSPACE_TIMER_H_ 8 | #define _TIMER_SERVER_DISPATCHER_DSPACE_TIMER_H_ 9 | 10 | #include "../../badge.h" 11 | 12 | /*! @file 13 | @brief Timer dataspace interface functions. */ 14 | 15 | /*! @brief Similar to data_open_handler, for timer dataspaces. */ 16 | seL4_CPtr timer_open_handler(void *rpc_userptr , char* rpc_name , int rpc_flags , int rpc_mode , 17 | int rpc_size , int* rpc_errno); 18 | 19 | /*! @brief Similar to data_write_handler, for timer dataspaces. 20 | 21 | Writing a uint64_t to the timer dspace will be interpreted as sleeping for that many nanoseconds 22 | akin to a nanosleep() syscall, before returning. 23 | */ 24 | int timer_write_handler(void *rpc_userptr , seL4_CPtr rpc_dspace_fd , uint32_t rpc_offset , 25 | rpc_buffer_t rpc_buf , uint32_t rpc_count); 26 | 27 | /*! @brief Similar to data_read_handler, for timer dataspaces. 28 | 29 | Reading a uint64_t from the timer dspace will be interpreted as reading the current time in 30 | nanoseconds. 31 | */ 32 | int timer_read_handler(void *rpc_userptr , seL4_CPtr rpc_dspace_fd , uint32_t rpc_offset , 33 | rpc_buffer_t rpc_buf , uint32_t rpc_count); 34 | 35 | #endif /* _TIMER_SERVER_DISPATCHER_DSPACE_TIMER_H_ */ -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | 6 | 7 | # Contributions Welcome 8 | 9 | Please see the [seL4 contributing guidelines][1] on the [seL4 website][2] for 10 | details. 11 | 12 | [1]: https://docs.sel4.systems/processes/contributing.html 13 | [2]: https://sel4.systems 14 | 15 | 16 | ## Contact 17 | 18 | If you have larger changes or additions, it is a good idea to get in contact 19 | with us as , so we can help you get started. 20 | 21 | The people responsible for the technical direction, procedures, and quality 22 | control are the [Technical Steering Committee][3] (TSC) of the seL4 23 | foundation. You can contact them either on the developer mailing list or on 24 | directly via email available from their profile pages. 25 | 26 | [3]: https://sel4.systems/Foundation/TSC 27 | 28 | 29 | ## Developer Certificate of Origin (DCO) 30 | 31 | This repository uses the same sign-off process as the Linux kernel. For every 32 | commit, use 33 | 34 | git commit -s 35 | 36 | to add a sign-off line to your commit message, which will come out as: 37 | 38 | Signed-off-by: name 39 | 40 | By adding this line, you make the declaration that you have the right to make 41 | this contribution under the open source license the files use that you changed 42 | or contributed. 43 | 44 | The full text of the declaration is at . 45 | -------------------------------------------------------------------------------- /impl/libs/libvterm/src/encoding/DECdrawing.tbl: -------------------------------------------------------------------------------- 1 | 6/0 = U+25C6 # BLACK DIAMOND 2 | 6/1 = U+2592 # MEDIUM SHADE (checkerboard) 3 | 6/2 = U+2409 # SYMBOL FOR HORIZONTAL TAB 4 | 6/3 = U+240C # SYMBOL FOR FORM FEED 5 | 6/4 = U+240D # SYMBOL FOR CARRIAGE RETURN 6 | 6/5 = U+240A # SYMBOL FOR LINE FEED 7 | 6/6 = U+00B0 # DEGREE SIGN 8 | 6/7 = U+00B1 # PLUS-MINUS SIGN (plus or minus) 9 | 6/8 = U+2424 # SYMBOL FOR NEW LINE 10 | 6/9 = U+240B # SYMBOL FOR VERTICAL TAB 11 | 6/10 = U+2518 # BOX DRAWINGS LIGHT UP AND LEFT (bottom-right corner) 12 | 6/11 = U+2510 # BOX DRAWINGS LIGHT DOWN AND LEFT (top-right corner) 13 | 6/12 = U+250C # BOX DRAWINGS LIGHT DOWN AND RIGHT (top-left corner) 14 | 6/13 = U+2514 # BOX DRAWINGS LIGHT UP AND RIGHT (bottom-left corner) 15 | 6/14 = U+253C # BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL (crossing lines) 16 | 6/15 = U+23BA # HORIZONTAL SCAN LINE-1 17 | 7/0 = U+23BB # HORIZONTAL SCAN LINE-3 18 | 7/1 = U+2500 # BOX DRAWINGS LIGHT HORIZONTAL 19 | 7/2 = U+23BC # HORIZONTAL SCAN LINE-7 20 | 7/3 = U+23BD # HORIZONTAL SCAN LINE-9 21 | 7/4 = U+251C # BOX DRAWINGS LIGHT VERTICAL AND RIGHT 22 | 7/5 = U+2524 # BOX DRAWINGS LIGHT VERTICAL AND LEFT 23 | 7/6 = U+2534 # BOX DRAWINGS LIGHT UP AND HORIZONTAL 24 | 7/7 = U+252C # BOX DRAWINGS LIGHT DOWN AND HORIZONTAL 25 | 7/8 = U+2502 # BOX DRAWINGS LIGHT VERTICAL 26 | 7/9 = U+2A7D # LESS-THAN OR SLANTED EQUAL-TO 27 | 7/10 = U+2A7E # GREATER-THAN OR SLANTED EQUAL-TO 28 | 7/11 = U+03C0 # GREEK SMALL LETTER PI 29 | 7/12 = U+2260 # NOT EQUAL TO 30 | 7/13 = U+00A3 # POUND SIGN 31 | 7/14 = U+00B7 # MIDDLE DOT 32 | -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/include/lev.h: -------------------------------------------------------------------------------- 1 | /* SCCS Id: @(#)lev.h 3.4 1994/03/18 */ 2 | /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ 3 | /* NetHack may be freely redistributed. See license for details. */ 4 | 5 | /* Common include file for save and restore routines */ 6 | 7 | #ifndef LEV_H 8 | #define LEV_H 9 | 10 | #define COUNT_SAVE 0x1 11 | #define WRITE_SAVE 0x2 12 | #define FREE_SAVE 0x4 13 | 14 | /* operations of the various saveXXXchn & co. routines */ 15 | #define perform_bwrite(mode) ((mode) & (COUNT_SAVE|WRITE_SAVE)) 16 | #define release_data(mode) ((mode) & FREE_SAVE) 17 | 18 | /* The following are used in mkmaze.c */ 19 | struct container { 20 | struct container *next; 21 | xchar x, y; 22 | short what; 23 | genericptr_t list; 24 | }; 25 | 26 | #define CONS_OBJ 0 27 | #define CONS_MON 1 28 | #define CONS_HERO 2 29 | #define CONS_TRAP 3 30 | 31 | struct bubble { 32 | xchar x, y; /* coordinates of the upper left corner */ 33 | schar dx, dy; /* the general direction of the bubble's movement */ 34 | uchar *bm; /* pointer to the bubble bit mask */ 35 | struct bubble *prev, *next; /* need to traverse the list up and down */ 36 | struct container *cons; 37 | }; 38 | 39 | /* used in light.c */ 40 | typedef struct ls_t { 41 | struct ls_t *next; 42 | xchar x, y; /* source's position */ 43 | short range; /* source's current range */ 44 | short flags; 45 | short type; /* type of light source */ 46 | genericptr_t id; /* source's identifier */ 47 | } light_source; 48 | 49 | #endif /* LEV_H */ 50 | -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/include/mttypriv.h: -------------------------------------------------------------------------------- 1 | /* SCCS Id: @(#)mttypriv.h 3.4 1993/03/01 */ 2 | /* Copyright (c) Jon W{tte 1993. */ 3 | /* NetHack may be freely redistributed. See license for details. */ 4 | 5 | /* 6 | * This file contains private structures used to implement the 7 | * tty windows - note that these structures may change between 8 | * minor releases! 9 | */ 10 | 11 | #ifndef _H_tty_private 12 | # define _H_tty_private 13 | 14 | # ifndef _H_tty_public 15 | #include "mactty.h" 16 | # endif 17 | 18 | #if !TARGET_API_MAC_CARBON 19 | # include 20 | # include 21 | # include 22 | #endif 23 | 24 | #define TA_TO_RGB(ta,rgb) (((rgb).red=(((ta)>>16)&0xff)*257),((rgb).green=(((ta)>>8)&0xff)*257),\ 25 | ((rgb).blue=((ta)&0xff)*257)),rgb 26 | 27 | typedef struct tty_record { 28 | WindowPtr its_window ; 29 | 30 | short font_number ; 31 | short font_size ; 32 | short char_width ; 33 | short row_height ; 34 | short ascent_height ; 35 | 36 | short x_size ; 37 | short y_size ; 38 | short x_curs ; 39 | short y_curs ; 40 | 41 | GWorldPtr its_window_world ; 42 | BitMap its_bits ; 43 | GrafPtr offscreen_port ; 44 | GWorldPtr offscreen_world ; 45 | #if CLIP_RECT_ONLY 46 | Rect invalid_rect ; 47 | #else 48 | RgnHandle invalid_part ; 49 | #endif 50 | 51 | long attribute [ TTY_NUMBER_ATTRIBUTES ] ; 52 | long last_cursor ; 53 | 54 | Boolean was_allocated ; 55 | Boolean curs_state ; 56 | Boolean uses_gworld ; 57 | } tty_record ; 58 | 59 | 60 | #endif /* _H_tty_private */ 61 | -------------------------------------------------------------------------------- /impl/libs/librefos/include/refos-util/device_io.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef _REFOS_UTIL_DEVICE_IO_MANAGER_H_ 8 | #define _REFOS_UTIL_DEVICE_IO_MANAGER_H_ 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | /*! @file 20 | @brief Device IO manager helper library. */ 21 | 22 | #define DEVICE_IO_TABLE_MAGIC 0x1C62D6B2 23 | #define DEVICE_IO_DEV_MAPPING_MAGIC 0x57545A05 24 | 25 | /* We don't need a huge table here; there aren't that many total devices on a system. */ 26 | #define DEVICE_MMIO_MAPPING_HASHTABLE_SIZE 128 27 | 28 | /*! @brief Global Device IO state structure. */ 29 | typedef struct dev_io_ops { 30 | struct ps_io_ops opsIO; 31 | chash_t MMIOMappings; /*!< vaddr --> data_mapping_t */ 32 | seL4_CPtr IOPorts; 33 | uint32_t magic; 34 | } dev_io_ops_t; 35 | 36 | /*! @brief Initialise device IO manager state. 37 | 38 | This function sets the function pointers for the device IO interfaces that any libplatsupport 39 | driver depends on. This means that this initialisation must be done before any libplatsupport 40 | drivers can be used. 41 | 42 | @param io The device state structure to initialise (No ownership transfer). 43 | */ 44 | void devio_init(dev_io_ops_t *io); 45 | 46 | #endif /* _REFOS_UTIL_DEVICE_IO_MANAGER_H_ */ -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/sys/share/sounds/README: -------------------------------------------------------------------------------- 1 | README for the AIFF files: 2 | 3 | These files are sound files for the instruments in NetHack. 4 | There are 11 sounds, one for each distinct instrument. 5 | The sounds are in 8-bit 22kHz AIFF format, which should be 6 | readable by a broad range of platforms. Since the sounds 7 | came from Rolands S-750 sample library (most of them) there 8 | should be no copyright on them when we treat them like we 9 | do here (as instruments) - indeed, the sample library I 10 | got from Roland didn't even bear a (c) symbol. 11 | 12 | Some of the sounds are very adequate (Drum of Earthquake, 13 | Wooden Flute, Magic Harp) while some are less true to the 14 | original name (how does a Frost Horn sound?) Actually, I 15 | don't know what a Bugle is (Bugle horn?) so I took a trumpet 16 | sound for that. Correct me if I'm wrong. 17 | 18 | What does this have to do with the main code? Well, nothing 19 | so far. There are some places that are #ifdef MAC and calls 20 | mac_speaker; that function takes an object and a tune (in 21 | capital letters A-G) and plays the tune with the given 22 | instrument. When playing a specific tune, that tune is of 23 | course used. For "improvise," I use middle "C." 24 | 25 | Ideally, we should do something equal with sound that we 26 | have with displays, so we can use one common set of calls 27 | in the main code, and have ports do whatever seems appropriate 28 | for the available hardware. 29 | 30 | Any comment on the sounds or their use is welcome: 31 | 32 | Jon W{tte 33 | Mac Team 34 | nethack-bugs@nethack.org 35 | -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/src/track.c: -------------------------------------------------------------------------------- 1 | /* SCCS Id: @(#)track.c 3.4 87/08/08 */ 2 | /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ 3 | /* NetHack may be freely redistributed. See license for details. */ 4 | /* track.c - version 1.0.2 */ 5 | 6 | #include "hack.h" 7 | 8 | #define UTSZ 50 9 | 10 | STATIC_VAR NEARDATA int utcnt, utpnt; 11 | STATIC_VAR NEARDATA coord utrack[UTSZ]; 12 | 13 | #ifdef OVLB 14 | 15 | void 16 | initrack() 17 | { 18 | utcnt = utpnt = 0; 19 | } 20 | 21 | #endif /* OVLB */ 22 | #ifdef OVL1 23 | 24 | /* add to track */ 25 | void 26 | settrack() 27 | { 28 | if(utcnt < UTSZ) utcnt++; 29 | if(utpnt == UTSZ) utpnt = 0; 30 | utrack[utpnt].x = u.ux; 31 | utrack[utpnt].y = u.uy; 32 | utpnt++; 33 | } 34 | 35 | #endif /* OVL1 */ 36 | #ifdef OVL0 37 | 38 | coord * 39 | gettrack(x, y) 40 | register int x, y; 41 | { 42 | register int cnt, ndist; 43 | register coord *tc; 44 | cnt = utcnt; 45 | for(tc = &utrack[utpnt]; cnt--; ){ 46 | if(tc == utrack) tc = &utrack[UTSZ-1]; 47 | else tc--; 48 | ndist = distmin(x,y,tc->x,tc->y); 49 | 50 | /* if far away, skip track entries til we're closer */ 51 | if(ndist > 2) { 52 | ndist -= 2; /* be careful due to extra decrement at top of loop */ 53 | cnt -= ndist; 54 | if(cnt <= 0) 55 | return (coord *) 0; /* too far away, no matches possible */ 56 | if(tc < &utrack[ndist]) 57 | tc += (UTSZ-ndist); 58 | else 59 | tc -= ndist; 60 | } else if(ndist <= 1) 61 | return(ndist ? tc : 0); 62 | } 63 | return (coord *)0; 64 | } 65 | 66 | #endif /* OVL0 */ 67 | 68 | /*track.c*/ 69 | -------------------------------------------------------------------------------- /impl/apps/snake/LICENSE_BSD2.txt: -------------------------------------------------------------------------------- 1 | Files described as being under the "BSD 2-Clause" license fall under the 2 | following license. 3 | 4 | ----------------------------------------------------------------------- 5 | 6 | Copyright (c) 2016 Data61, CSIRO and other contributors. 7 | All rights reserved. 8 | 9 | Redistribution and use in source and binary forms, with or without 10 | modification, are permitted provided that the following conditions 11 | are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright 14 | notice, this list of conditions and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright 17 | notice, this list of conditions and the following disclaimer in the 18 | documentation and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 21 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 | SUCH DAMAGE. 31 | 32 | -------------------------------------------------------------------------------- /impl/apps/test_os/LICENSE_BSD2.txt: -------------------------------------------------------------------------------- 1 | Files described as being under the "BSD 2-Clause" license fall under the 2 | following license. 3 | 4 | ----------------------------------------------------------------------- 5 | 6 | Copyright (c) 2016 Data61, CSIRO and other contributors. 7 | All rights reserved. 8 | 9 | Redistribution and use in source and binary forms, with or without 10 | modification, are permitted provided that the following conditions 11 | are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright 14 | notice, this list of conditions and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright 17 | notice, this list of conditions and the following disclaimer in the 18 | documentation and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 21 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 | SUCH DAMAGE. 31 | 32 | -------------------------------------------------------------------------------- /impl/apps/tetris/LICENSE_BSD2.txt: -------------------------------------------------------------------------------- 1 | Files described as being under the "BSD 2-Clause" license fall under the 2 | following license. 3 | 4 | ----------------------------------------------------------------------- 5 | 6 | Copyright (c) 2016 Data61, CSIRO and other contributors. 7 | All rights reserved. 8 | 9 | Redistribution and use in source and binary forms, with or without 10 | modification, are permitted provided that the following conditions 11 | are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright 14 | notice, this list of conditions and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright 17 | notice, this list of conditions and the following disclaimer in the 18 | documentation and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 21 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 | SUCH DAMAGE. 31 | 32 | -------------------------------------------------------------------------------- /impl/apps/file_server/LICENSE_BSD2.txt: -------------------------------------------------------------------------------- 1 | Files described as being under the "BSD 2-Clause" license fall under the 2 | following license. 3 | 4 | ----------------------------------------------------------------------- 5 | 6 | Copyright (c) 2016 Data61, CSIRO and other contributors. 7 | All rights reserved. 8 | 9 | Redistribution and use in source and binary forms, with or without 10 | modification, are permitted provided that the following conditions 11 | are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright 14 | notice, this list of conditions and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright 17 | notice, this list of conditions and the following disclaimer in the 18 | documentation and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 21 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 | SUCH DAMAGE. 31 | 32 | -------------------------------------------------------------------------------- /impl/apps/selfloader/LICENSE_BSD2.txt: -------------------------------------------------------------------------------- 1 | Files described as being under the "BSD 2-Clause" license fall under the 2 | following license. 3 | 4 | ----------------------------------------------------------------------- 5 | 6 | Copyright (c) 2016 Data61, CSIRO and other contributors. 7 | All rights reserved. 8 | 9 | Redistribution and use in source and binary forms, with or without 10 | modification, are permitted provided that the following conditions 11 | are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright 14 | notice, this list of conditions and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright 17 | notice, this list of conditions and the following disclaimer in the 18 | documentation and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 21 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 | SUCH DAMAGE. 31 | 32 | -------------------------------------------------------------------------------- /impl/apps/terminal/LICENSE_BSD2.txt: -------------------------------------------------------------------------------- 1 | Files described as being under the "BSD 2-Clause" license fall under the 2 | following license. 3 | 4 | ----------------------------------------------------------------------- 5 | 6 | Copyright (c) 2016 Data61, CSIRO and other contributors. 7 | All rights reserved. 8 | 9 | Redistribution and use in source and binary forms, with or without 10 | modification, are permitted provided that the following conditions 11 | are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright 14 | notice, this list of conditions and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright 17 | notice, this list of conditions and the following disclaimer in the 18 | documentation and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 21 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 | SUCH DAMAGE. 31 | 32 | -------------------------------------------------------------------------------- /impl/apps/test_user/LICENSE_BSD2.txt: -------------------------------------------------------------------------------- 1 | Files described as being under the "BSD 2-Clause" license fall under the 2 | following license. 3 | 4 | ----------------------------------------------------------------------- 5 | 6 | Copyright (c) 2016 Data61, CSIRO and other contributors. 7 | All rights reserved. 8 | 9 | Redistribution and use in source and binary forms, with or without 10 | modification, are permitted provided that the following conditions 11 | are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright 14 | notice, this list of conditions and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright 17 | notice, this list of conditions and the following disclaimer in the 18 | documentation and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 21 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 | SUCH DAMAGE. 31 | 32 | -------------------------------------------------------------------------------- /impl/apps/timer_server/LICENSE_BSD2.txt: -------------------------------------------------------------------------------- 1 | Files described as being under the "BSD 2-Clause" license fall under the 2 | following license. 3 | 4 | ----------------------------------------------------------------------- 5 | 6 | Copyright (c) 2016 Data61, CSIRO and other contributors. 7 | All rights reserved. 8 | 9 | Redistribution and use in source and binary forms, with or without 10 | modification, are permitted provided that the following conditions 11 | are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright 14 | notice, this list of conditions and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright 17 | notice, this list of conditions and the following disclaimer in the 18 | documentation and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 21 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 | SUCH DAMAGE. 31 | 32 | -------------------------------------------------------------------------------- /impl/libs/librefos/LICENSE_BSD2.txt: -------------------------------------------------------------------------------- 1 | Files described as being under the "BSD 2-Clause" license fall under the 2 | following license. 3 | 4 | ----------------------------------------------------------------------- 5 | 6 | Copyright (c) 2016 Data61, CSIRO and other contributors. 7 | All rights reserved. 8 | 9 | Redistribution and use in source and binary forms, with or without 10 | modification, are permitted provided that the following conditions 11 | are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright 14 | notice, this list of conditions and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright 17 | notice, this list of conditions and the following disclaimer in the 18 | documentation and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 21 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 | SUCH DAMAGE. 31 | 32 | -------------------------------------------------------------------------------- /impl/libs/librefossys/LICENSE_BSD2.txt: -------------------------------------------------------------------------------- 1 | Files described as being under the "BSD 2-Clause" license fall under the 2 | following license. 3 | 4 | ----------------------------------------------------------------------- 5 | 6 | Copyright (c) 2016 Data61, CSIRO and other contributors. 7 | All rights reserved. 8 | 9 | Redistribution and use in source and binary forms, with or without 10 | modification, are permitted provided that the following conditions 11 | are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright 14 | notice, this list of conditions and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright 17 | notice, this list of conditions and the following disclaimer in the 18 | documentation and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 21 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 | SUCH DAMAGE. 31 | 32 | -------------------------------------------------------------------------------- /impl/apps/console_server/LICENSE_BSD2.txt: -------------------------------------------------------------------------------- 1 | Files described as being under the "BSD 2-Clause" license fall under the 2 | following license. 3 | 4 | ----------------------------------------------------------------------- 5 | 6 | Copyright (c) 2016 Data61, CSIRO and other contributors. 7 | All rights reserved. 8 | 9 | Redistribution and use in source and binary forms, with or without 10 | modification, are permitted provided that the following conditions 11 | are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright 14 | notice, this list of conditions and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright 17 | notice, this list of conditions and the following disclaimer in the 18 | documentation and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 21 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 | SUCH DAMAGE. 31 | 32 | -------------------------------------------------------------------------------- /impl/apps/process_server/LICENSE_BSD2.txt: -------------------------------------------------------------------------------- 1 | Files described as being under the "BSD 2-Clause" license fall under the 2 | following license. 3 | 4 | ----------------------------------------------------------------------- 5 | 6 | Copyright (c) 2016 Data61, CSIRO and other contributors. 7 | All rights reserved. 8 | 9 | Redistribution and use in source and binary forms, with or without 10 | modification, are permitted provided that the following conditions 11 | are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright 14 | notice, this list of conditions and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright 17 | notice, this list of conditions and the following disclaimer in the 18 | documentation and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 21 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 | SUCH DAMAGE. 31 | 32 | -------------------------------------------------------------------------------- /impl/libs/libdatastruct/LICENSE_BSD2.txt: -------------------------------------------------------------------------------- 1 | Files described as being under the "BSD 2-Clause" license fall under the 2 | following license. 3 | 4 | ----------------------------------------------------------------------- 5 | 6 | Copyright (c) 2016 Data61, CSIRO and other contributors. 7 | All rights reserved. 8 | 9 | Redistribution and use in source and binary forms, with or without 10 | modification, are permitted provided that the following conditions 11 | are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright 14 | notice, this list of conditions and the following disclaimer. 15 | 16 | 2. Redistributions in binary form must reproduce the above copyright 17 | notice, this list of conditions and the following disclaimer in the 18 | documentation and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 21 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 | SUCH DAMAGE. 31 | 32 | -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/include/timeout.h: -------------------------------------------------------------------------------- 1 | /* SCCS Id: @(#)timeout.h 3.4 1999/02/13 */ 2 | /* Copyright 1994, Dean Luick */ 3 | /* NetHack may be freely redistributed. See license for details. */ 4 | 5 | #ifndef TIMEOUT_H 6 | #define TIMEOUT_H 7 | 8 | /* generic timeout function */ 9 | typedef void FDECL((*timeout_proc), (genericptr_t, long)); 10 | 11 | /* kind of timer */ 12 | #define TIMER_LEVEL 0 /* event specific to level */ 13 | #define TIMER_GLOBAL 1 /* event follows current play */ 14 | #define TIMER_OBJECT 2 /* event follows a object */ 15 | #define TIMER_MONSTER 3 /* event follows a monster */ 16 | 17 | /* save/restore timer ranges */ 18 | #define RANGE_LEVEL 0 /* save/restore timers staying on level */ 19 | #define RANGE_GLOBAL 1 /* save/restore timers following global play */ 20 | 21 | /* 22 | * Timeout functions. Add a define here, then put it in the table 23 | * in timeout.c. "One more level of indirection will fix everything." 24 | */ 25 | #define ROT_ORGANIC 0 /* for buried organics */ 26 | #define ROT_CORPSE 1 27 | #define REVIVE_MON 2 28 | #define BURN_OBJECT 3 29 | #define HATCH_EGG 4 30 | #define FIG_TRANSFORM 5 31 | #define NUM_TIME_FUNCS 6 32 | 33 | /* used in timeout.c */ 34 | typedef struct fe { 35 | struct fe *next; /* next item in chain */ 36 | long timeout; /* when we time out */ 37 | unsigned long tid; /* timer ID */ 38 | short kind; /* kind of use */ 39 | short func_index; /* what to call when we time out */ 40 | genericptr_t arg; /* pointer to timeout argument */ 41 | Bitfield (needs_fixup,1); /* does arg need to be patched? */ 42 | } timer_element; 43 | 44 | #endif /* TIMEOUT_H */ 45 | -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/include/eshk.h: -------------------------------------------------------------------------------- 1 | /* SCCS Id: @(#)eshk.h 3.4 1997/05/01 */ 2 | /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ 3 | /* NetHack may be freely redistributed. See license for details. */ 4 | 5 | #ifndef ESHK_H 6 | #define ESHK_H 7 | 8 | #define REPAIR_DELAY 5 /* minimum delay between shop damage & repair */ 9 | 10 | #define BILLSZ 200 11 | 12 | struct bill_x { 13 | unsigned bo_id; 14 | boolean useup; 15 | long price; /* price per unit */ 16 | long bquan; /* amount used up */ 17 | }; 18 | 19 | struct eshk { 20 | long robbed; /* amount stolen by most recent customer */ 21 | long credit; /* amount credited to customer */ 22 | long debit; /* amount of debt for using unpaid items */ 23 | long loan; /* shop-gold picked (part of debit) */ 24 | int shoptype; /* the value of rooms[shoproom].rtype */ 25 | schar shoproom; /* index in rooms; set by inshop() */ 26 | schar unused; /* to force alignment for stupid compilers */ 27 | boolean following; /* following customer since he owes us sth */ 28 | boolean surcharge; /* angry shk inflates prices */ 29 | coord shk; /* usual position shopkeeper */ 30 | coord shd; /* position shop door */ 31 | d_level shoplevel; /* level (& dungeon) of his shop */ 32 | int billct; /* no. of entries of bill[] in use */ 33 | struct bill_x bill[BILLSZ]; 34 | struct bill_x *bill_p; 35 | int visitct; /* nr of visits by most recent customer */ 36 | char customer[PL_NSIZ]; /* most recent customer */ 37 | char shknam[PL_NSIZ]; 38 | }; 39 | 40 | #define ESHK(mon) ((struct eshk *)&(mon)->mextra[0]) 41 | 42 | #define NOTANGRY(mon) ((mon)->mpeaceful) 43 | #define ANGRY(mon) (!NOTANGRY(mon)) 44 | 45 | #endif /* ESHK_H */ 46 | -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/sys/unix/nethack.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # SCCS Id: @(#)nethack.sh 3.4 1990/02/26 3 | 4 | HACKDIR=/usr/games/lib/nethackdir 5 | export HACKDIR 6 | HACK=$HACKDIR/nethack 7 | MAXNROFPLAYERS=4 8 | 9 | # Since Nethack.ad is installed in HACKDIR, add it to XUSERFILESEARCHPATH 10 | case "x$XUSERFILESEARCHPATH" in 11 | x) XUSERFILESEARCHPATH="$HACKDIR/%N.ad" 12 | ;; 13 | *) XUSERFILESEARCHPATH="$XUSERFILESEARCHPATH:$HACKDIR/%N.ad" 14 | ;; 15 | esac 16 | export XUSERFILESEARCHPATH 17 | 18 | # see if we can find the full path name of PAGER, so help files work properly 19 | # assume that if someone sets up a special variable (HACKPAGER) for NetHack, 20 | # it will already be in a form acceptable to NetHack 21 | # ideas from brian@radio.astro.utoronto.ca 22 | if test \( "xxx$PAGER" != xxx \) -a \( "xxx$HACKPAGER" = xxx \) 23 | then 24 | 25 | HACKPAGER=$PAGER 26 | 27 | # use only the first word of the pager variable 28 | # this prevents problems when looking for file names with trailing 29 | # options, but also makes the options unavailable for later use from 30 | # NetHack 31 | for i in $HACKPAGER 32 | do 33 | HACKPAGER=$i 34 | break 35 | done 36 | 37 | if test ! -f $HACKPAGER 38 | then 39 | IFS=: 40 | for i in $PATH 41 | do 42 | if test -f $i/$HACKPAGER 43 | then 44 | HACKPAGER=$i/$HACKPAGER 45 | export HACKPAGER 46 | break 47 | fi 48 | done 49 | IFS=' ' 50 | fi 51 | if test ! -f $HACKPAGER 52 | then 53 | echo Cannot find $PAGER -- unsetting PAGER. 54 | unset HACKPAGER 55 | unset PAGER 56 | fi 57 | fi 58 | 59 | 60 | cd $HACKDIR 61 | case $1 in 62 | -s*) 63 | exec $HACK "$@" 64 | ;; 65 | *) 66 | exec $HACK "$@" $MAXNROFPLAYERS 67 | ;; 68 | esac 69 | -------------------------------------------------------------------------------- /impl/apps/file_server/src/state.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef _FILE_SERVER_STATE_H_ 8 | #define _FILE_SERVER_STATE_H_ 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | #include "dataspace.h" 27 | #include "pager.h" 28 | 29 | /*! @file 30 | @brief CPIO Fileserver global state & helper functions. */ 31 | 32 | /* Debug printing. */ 33 | #include 34 | 35 | #define FILESERVER_MAX_PAGE_FRAMES 128 36 | #define FILESERVER_NOTIFICATION_BUFFER_SIZE 0x2000 /* 2 Frames. */ 37 | #define FILESERVER_MOUNTPOINT "fileserv" 38 | #define FS_CLIENT_MAGIC 0x3FA3EF6E 39 | 40 | /*! @brief Global CPIO file server state structure. */ 41 | struct fs_state { 42 | srv_common_t commonState; 43 | 44 | /* Main file server data structures. */ 45 | struct fs_frame_block pageFrameBlock; 46 | struct fs_dataspace_table dspaceTable; 47 | }; 48 | 49 | /*! @brief Global CPIO file server state. */ 50 | extern struct fs_state fileServ; 51 | 52 | /*! @brief Weak pointer to CPIO file server common state. */ 53 | extern srv_common_t *fileServCommon; 54 | 55 | /*! @brief Initialise the file server state. */ 56 | void fileserv_init(void); 57 | 58 | #endif /* _FILE_SERVER_STATE_H_ */ 59 | -------------------------------------------------------------------------------- /impl/apps/test_os/src/test_anon_ram.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #include 8 | #ifdef CONFIG_REFOS_RUN_TESTS 9 | 10 | #include 11 | #include 12 | #include 13 | #include "test_anon_ram.h" 14 | 15 | 16 | /* -------------------------------- RAM Dataspace tests -------------------------------------- */ 17 | 18 | static int 19 | test_anon_dspace() 20 | { 21 | test_start("anon dataspace"); 22 | 23 | /* Open an anonymous dataspace and map it entirely in our VSpace. */ 24 | data_mapping_t anon = data_open_map(REFOS_PROCSERV_EP, "anon", 0x0, 0, 0x2000, -1); 25 | test_assert(anon.err == ESUCCESS); 26 | test_assert(anon.size == 0x2000); 27 | test_assert(anon.sizeNPages == (0x2000 / REFOS_PAGE_SIZE)); 28 | test_assert(anon.session == REFOS_PROCSERV_EP); 29 | test_assert(anon.dataspace != 0); 30 | test_assert(anon.window != 0); 31 | test_assert(anon.vaddr != NULL); 32 | 33 | /* Write to and read from anon dataspace. */ 34 | strcpy(anon.vaddr, "hello world!"); 35 | int cmp = strcmp(anon.vaddr, "hello world!"); 36 | tvprintf("anon dataspace contents: [%s]\n", anon.vaddr); 37 | test_assert(cmp == 0); 38 | 39 | /* Test resize. */ 40 | int error = data_expand(REFOS_PROCSERV_EP, anon.dataspace, 0x3000); 41 | test_assert(error == ESUCCESS); 42 | test_assert(data_get_size(REFOS_PROCSERV_EP, anon.dataspace) == 0x3000); 43 | 44 | /* Clean up. */ 45 | error = data_mapping_release(anon); 46 | test_assert(error == ESUCCESS); 47 | return test_success(); 48 | } 49 | 50 | void 51 | test_anon_dataspace(void) 52 | { 53 | test_anon_dspace(); 54 | } 55 | 56 | #endif /* CONFIG_REFOS_RUN_TESTS */ 57 | -------------------------------------------------------------------------------- /impl/apps/timer_server/src/state.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef _TIMER_SERVER_STATE_H_ 8 | #define _TIMER_SERVER_STATE_H_ 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | #include 20 | #include 21 | #include "device_timer.h" 22 | #include "badge.h" 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | 34 | /*! @file 35 | @brief timer server global state & helper functions. */ 36 | 37 | // Debug printing. 38 | #include 39 | 40 | #ifndef CONFIG_REFOS_DEBUG 41 | #define printf(x,...) 42 | #endif /* CONFIG_REFOS_DEBUG */ 43 | 44 | #define TIMESERV_MMAP_REGION_SIZE 0x64000 45 | #define TIMESERV_MOUNTPOINT "dev_timer" 46 | #define TIMESERV_CLIENT_MAGIC 0xEE340912 47 | 48 | /*! @brief timer server global state. */ 49 | struct timeserv_state { 50 | srv_common_t commonState; 51 | dev_irq_state_t irqState; 52 | 53 | dev_io_ops_t devIO; 54 | struct device_timer_state devTimer; 55 | seL4_CPtr timerBadgeEP; 56 | }; 57 | 58 | extern struct timeserv_state timeServ; 59 | extern srv_common_t *timeServCommon; 60 | 61 | /*! @brief Initialise timer server state. */ 62 | void timeserv_init(void); 63 | 64 | #endif /* _TIMER_SERVER_STATE_H_ */ 65 | -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/dat/oracle.des: -------------------------------------------------------------------------------- 1 | # SCCS Id: @(#)oracle.des 3.4 1995/10/07 2 | # NetHack may be freely redistributed. See license for details. 3 | # 4 | # Oracle level 5 | # 6 | 7 | LEVEL: "oracle" 8 | 9 | ROOM: "ordinary" , lit, (3,3), (center,center), (11,9) 10 | NAME: "central" 11 | OBJECT:'`',"statue",(0,0),"forest centaur",1 12 | OBJECT:'`',"statue",(0,8),"mountain centaur",1 13 | OBJECT:'`',"statue",(10,0),"mountain centaur",1 14 | OBJECT:'`',"statue",(10,8),"forest centaur",1 15 | OBJECT:'`',"statue",(5,1),"plains centaur",1 16 | OBJECT:'`',"statue",(5,7),"plains centaur",1 17 | OBJECT:'`',"statue",(2,4),"plains centaur",1 18 | OBJECT:'`',"statue",(8,4),"plains centaur",1 19 | MONSTER: random, random, random 20 | MONSTER: random, random, random 21 | 22 | SUBROOM: "delphi" , lit , (4,3) , (3,3), "central" 23 | FOUNTAIN: (0, 1) 24 | FOUNTAIN: (1, 0) 25 | FOUNTAIN: (1, 2) 26 | FOUNTAIN: (2, 1) 27 | MONSTER: '@', "Oracle", (1,1) 28 | DOOR: false , nodoor , random, random 29 | 30 | ROOM: "ordinary" , random, random, random, random 31 | STAIR: random, up 32 | OBJECT: random,random,random 33 | 34 | ROOM: "ordinary" , random, random, random, random 35 | STAIR: random, down 36 | OBJECT: random, random, random 37 | TRAP: random, random 38 | MONSTER: random, random, random 39 | MONSTER: random, random, random 40 | 41 | ROOM: "ordinary" , random, random, random, random 42 | OBJECT: random, random, random 43 | OBJECT: random, random, random 44 | MONSTER: random, random, random 45 | 46 | ROOM: "ordinary" , random, random, random, random 47 | OBJECT: random, random, random 48 | TRAP: random, random 49 | MONSTER: random, random, random 50 | 51 | ROOM: "ordinary" , random, random, random, random 52 | OBJECT: random, random, random 53 | TRAP: random, random 54 | MONSTER: random, random, random 55 | 56 | RANDOM_CORRIDORS 57 | -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/doc/fixes32.3: -------------------------------------------------------------------------------- 1 | General Fixes and Modified Features 2 | ----------------------------------- 3 | Y2K fix: use 4 digit year values for the dates in the score file 4 | updated COPYRIGHT_BANNER_A to reflect year of release 5 | prevent "late" pline calls from triggering a crash when the RIP window was 6 | displayed at end of game (observed when bones file rename failure 7 | under Win95 was reported to wizard mode users) 8 | being punished on the Plane of Water doesn't trigger a panic when air bubbles 9 | try to move the ball&chain or you around 10 | avoid rn2(0) divide by 0 for empty inventory when trying to crawl out of water 11 | don't let randomly placed monsters on special levels prevent explicitly 12 | placed monsters who target that location from being created (a web 13 | trap's spider resulted in no quest nemesis) 14 | don't let randomly placed stairs on special levels be covered by explicitly 15 | placed features such as fountains 16 | pager: guard against '%' in output from being treated as a printf formatting 17 | directive (using '/' or ';' to look at food yields "% blah blah") 18 | prayer result of ``escape from solid rock'' isn't inhibited by teleport 19 | restrictions (attempting to fix all troubles got stuck in a loop) 20 | report "file empty?" rather than "version mismatch" when that's the reason 21 | why a data file fails its validation check 22 | drum of earthquake can't destroy the high altars 23 | 24 | 25 | Platform- and/or Interface-Specific Fixes 26 | ----------------------------------------- 27 | micro (assorted): readmail()--don't show fake mail text when blind; also, 28 | update the "report bugs to" message to specify 29 | msdos: fix missing $(INCL) in dependency in djgpp Makefile 30 | mac: Will only dispatch events if the window system is initialized 31 | -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/include/color.h: -------------------------------------------------------------------------------- 1 | /* SCCS Id: @(#)color.h 3.4 1992/02/02 */ 2 | /* Copyright (c) Steve Linhart, Eric Raymond, 1989. */ 3 | /* NetHack may be freely redistributed. See license for details. */ 4 | 5 | #ifndef COLOR_H 6 | #define COLOR_H 7 | 8 | /* 9 | * The color scheme used is tailored for an IBM PC. It consists of the 10 | * standard 8 colors, folowed by their bright counterparts. There are 11 | * exceptions, these are listed below. Bright black doesn't mean very 12 | * much, so it is used as the "default" foreground color of the screen. 13 | */ 14 | #define CLR_BLACK 0 15 | #define CLR_RED 1 16 | #define CLR_GREEN 2 17 | #define CLR_BROWN 3 /* on IBM, low-intensity yellow is brown */ 18 | #define CLR_BLUE 4 19 | #define CLR_MAGENTA 5 20 | #define CLR_CYAN 6 21 | #define CLR_GRAY 7 /* low-intensity white */ 22 | #define NO_COLOR 8 23 | #define CLR_ORANGE 9 24 | #define CLR_BRIGHT_GREEN 10 25 | #define CLR_YELLOW 11 26 | #define CLR_BRIGHT_BLUE 12 27 | #define CLR_BRIGHT_MAGENTA 13 28 | #define CLR_BRIGHT_CYAN 14 29 | #define CLR_WHITE 15 30 | #define CLR_MAX 16 31 | 32 | /* The "half-way" point for tty based color systems. This is used in */ 33 | /* the tty color setup code. (IMHO, it should be removed - dean). */ 34 | #define BRIGHT 8 35 | 36 | /* these can be configured */ 37 | #define HI_OBJ CLR_MAGENTA 38 | #define HI_METAL CLR_CYAN 39 | #define HI_COPPER CLR_YELLOW 40 | #define HI_SILVER CLR_GRAY 41 | #define HI_GOLD CLR_YELLOW 42 | #define HI_LEATHER CLR_BROWN 43 | #define HI_CLOTH CLR_BROWN 44 | #define HI_ORGANIC CLR_BROWN 45 | #define HI_WOOD CLR_BROWN 46 | #define HI_PAPER CLR_WHITE 47 | #define HI_GLASS CLR_BRIGHT_CYAN 48 | #define HI_MINERAL CLR_GRAY 49 | #define DRAGON_SILVER CLR_BRIGHT_CYAN 50 | #define HI_ZAP CLR_BRIGHT_BLUE 51 | 52 | #endif /* COLOR_H */ 53 | -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/include/tcap.h: -------------------------------------------------------------------------------- 1 | /* SCCS Id: @(#)tcap.h 3.4 1992/10/21 */ 2 | /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1989. */ 3 | /* NetHack may be freely redistributed. See license for details. */ 4 | 5 | /* not named termcap.h because it may conflict with a system header */ 6 | 7 | #ifndef TCAP_H 8 | #define TCAP_H 9 | 10 | #ifndef MICRO 11 | //# define TERMLIB /* include termcap code */ 12 | #endif 13 | 14 | /* might display need graphics code? */ 15 | #if !defined(AMIGA) && !defined(TOS) && !defined(MAC) 16 | # if defined(TERMLIB) || defined(OS2) || defined(MSDOS) 17 | # define ASCIIGRAPH 18 | # endif 19 | #endif 20 | 21 | #ifndef DECL_H 22 | extern struct tc_gbl_data { /* also declared in decl.h; defined in decl.c */ 23 | char *tc_AS, *tc_AE; /* graphics start and end (tty font swapping) */ 24 | int tc_LI, tc_CO; /* lines and columns */ 25 | } tc_gbl_data; 26 | #define AS tc_gbl_data.tc_AS 27 | #define AE tc_gbl_data.tc_AE 28 | #define LI tc_gbl_data.tc_LI 29 | #define CO tc_gbl_data.tc_CO 30 | #endif 31 | 32 | extern struct tc_lcl_data { /* defined and set up in termcap.c */ 33 | char *tc_CM, *tc_ND, *tc_CD; 34 | char *tc_HI, *tc_HE, *tc_US, *tc_UE; 35 | boolean tc_ul_hack; 36 | } tc_lcl_data; 37 | /* some curses.h declare CM etc. */ 38 | #define nh_CM tc_lcl_data.tc_CM 39 | #define nh_ND tc_lcl_data.tc_ND 40 | #define nh_CD tc_lcl_data.tc_CD 41 | #define nh_HI tc_lcl_data.tc_HI 42 | #define nh_HE tc_lcl_data.tc_HE 43 | #define nh_US tc_lcl_data.tc_US 44 | #define nh_UE tc_lcl_data.tc_UE 45 | #define ul_hack tc_lcl_data.tc_ul_hack 46 | 47 | extern short ospeed; /* set up in termcap.c */ 48 | 49 | #ifdef TEXTCOLOR 50 | # ifdef TOS 51 | extern const char *hilites[CLR_MAX]; 52 | # else 53 | extern NEARDATA char *hilites[CLR_MAX]; 54 | # endif 55 | #endif 56 | 57 | #endif /* TCAP_H */ 58 | -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/include/xwindowp.h: -------------------------------------------------------------------------------- 1 | /* SCCS Id: @(#)xwindowp.h 3.4 1992/03/07 */ 2 | /* Copyright (c) Dean Luick, 1992 */ 3 | /* NetHack may be freely redistributed. See license for details. */ 4 | 5 | #ifndef _xwindowp_h 6 | #define _xwindowp_h 7 | 8 | #include "xwindow.h" 9 | 10 | #ifndef SYSV 11 | #define PRESERVE_NO_SYSV /* X11 include files may define SYSV */ 12 | #endif 13 | 14 | /* include superclass private header file */ 15 | #include 16 | 17 | #ifdef PRESERVE_NO_SYSV 18 | # ifdef SYSV 19 | # undef SYSV 20 | # endif 21 | # undef PRESERVE_NO_SYSV 22 | #endif 23 | 24 | /* define unique representation types not found in */ 25 | 26 | #define XtRWindowResource "WindowResource" 27 | 28 | typedef struct { 29 | int empty; 30 | } WindowClassPart; 31 | 32 | typedef struct _WindowClassRec { 33 | CoreClassPart core_class; 34 | WindowClassPart window_class; 35 | } WindowClassRec; 36 | 37 | extern WindowClassRec windowClassRec; 38 | 39 | typedef struct { 40 | /* resources */ 41 | Dimension rows; 42 | Dimension columns; 43 | Pixel foreground; 44 | Pixel black; 45 | Pixel red; 46 | Pixel green; 47 | Pixel brown; 48 | Pixel blue; 49 | Pixel magenta; 50 | Pixel cyan; 51 | Pixel gray; 52 | Pixel orange; 53 | Pixel bright_green; 54 | Pixel yellow; 55 | Pixel bright_blue; 56 | Pixel bright_magenta; 57 | Pixel bright_cyan; 58 | Pixel white; 59 | XFontStruct *font; 60 | XtCallbackList expose_callback; 61 | XtCallbackList input_callback; 62 | XtCallbackList resize_callback; 63 | /* private state */ 64 | /* (none) */ 65 | } WindowPart; 66 | 67 | typedef struct _WindowRec { 68 | CorePart core; 69 | WindowPart window; 70 | } WindowRec; 71 | 72 | #endif /* _xwindowp_h */ 73 | -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/include/quest.h: -------------------------------------------------------------------------------- 1 | /* SCCS Id: @(#)quest.h 3.4 1992/11/15 */ 2 | /* Copyright (c) Mike Stephenson 1991. */ 3 | /* NetHack may be freely redistributed. See license for details. */ 4 | 5 | #ifndef QUEST_H 6 | #define QUEST_H 7 | 8 | struct q_score { /* Quest "scorecard" */ 9 | Bitfield(first_start,1); /* only set the first time */ 10 | Bitfield(met_leader,1); /* has met the leader */ 11 | Bitfield(not_ready,3); /* rejected due to alignment, etc. */ 12 | Bitfield(pissed_off,1); /* got the leader angry */ 13 | Bitfield(got_quest,1); /* got the quest assignment */ 14 | 15 | Bitfield(first_locate,1); /* only set the first time */ 16 | Bitfield(met_intermed,1); /* used if the locate is a person. */ 17 | Bitfield(got_final,1); /* got the final quest assignment */ 18 | 19 | Bitfield(made_goal,3); /* # of times on goal level */ 20 | Bitfield(met_nemesis,1); /* has met the nemesis before */ 21 | Bitfield(killed_nemesis,1); /* set when the nemesis is killed */ 22 | Bitfield(in_battle,1); /* set when nemesis fighting you */ 23 | 24 | Bitfield(cheater,1); /* set if cheating detected */ 25 | Bitfield(touched_artifact,1); /* for a special message */ 26 | Bitfield(offered_artifact,1); /* offered to leader */ 27 | Bitfield(got_thanks,1); /* final message from leader */ 28 | 29 | /* keep track of leader presence/absence even if leader is 30 | polymorphed, raised from dead, etc */ 31 | Bitfield(leader_is_dead,1); 32 | unsigned leader_m_id; 33 | }; 34 | 35 | #define MAX_QUEST_TRIES 7 /* exceed this and you "fail" */ 36 | #define MIN_QUEST_ALIGN 20 /* at least this align.record to start */ 37 | /* note: align 20 matches "pious" as reported by enlightenment (cmd.c) */ 38 | #define MIN_QUEST_LEVEL 14 /* at least this u.ulevel to start */ 39 | /* note: exp.lev. 14 is threshold level for 5th rank (class title, role.c) */ 40 | 41 | #endif /* QUEST_H */ 42 | -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/src/monstr.c: -------------------------------------------------------------------------------- 1 | /* This source file is generated by 'makedefs'. Do not edit. */ 2 | #include "config.h" 3 | 4 | const int monstr[] = { 5 | 4, 5, 6, 6, 6, 12, 2, 6, 8, 7, 8, 8, 1, 1, 2, 4, 6 | 3, 5, 7, 5, 6, 7, 8, 7, 9, 9, 14, 2, 3, 8, 8, 8, 7 | 3, 5, 6, 7, 7, 7, 8, 8, 8, 11, 2, 4, 5, 6, 8, 13, 8 | 19, 3, 3, 4, 5, 7, 7, 5, 6, 8, 1, 2, 3, 4, 4, 8, 9 | 9, 11, 5, 5, 5, 1, 3, 3, 4, 5, 5, 5, 7, 4, 6, 9, 10 | 4, 7, 8, 9, 13, 15, 22, 1, 2, 4, 4, 4, 4, 3, 4, 7, 11 | 8, 12, 14, 6, 6, 6, 4, 7, 9, 4, 6, 7, 9, 9, 10, 9, 12 | 9, 9, 17, 1, 9, 5, 7, 11, 11, 12, 19, 21, 26, 2, 3, 6, 13 | 7, 6, 8, 9, 13, 13, 13, 13, 13, 13, 13, 13, 13, 20, 20, 20, 14 | 20, 20, 20, 20, 20, 20, 9, 10, 10, 10, 10, 1, 2, 2, 2, 2, 15 | 2, 5, 3, 4, 5, 6, 8, 8, 10, 11, 13, 19, 13, 20, 17, 18, 16 | 3, 4, 5, 6, 14, 18, 21, 29, 4, 5, 6, 6, 7, 7, 8, 10, 17 | 4, 4, 4, 4, 8, 10, 13, 16, 7, 9, 11, 4, 6, 12, 8, 9, 18 | 8, 14, 3, 6, 7, 9, 8, 10, 9, 12, 12, 13, 16, 12, 12, 14, 19 | 18, 7, 8, 17, 11, 4, 6, 7, 7, 8, 9, 1, 2, 3, 3, 4, 20 | 5, 7, 9, 5, 14, 4, 4, 6, 6, 7, 8, 10, 12, 15, 18, 22, 21 | 2, 3, 3, 6, 12, 6, 7, 8, 11, 11, 11, 13, 15, 14, 14, 13, 22 | 15, 30, 8, 10, 12, 14, 8, 12, 25, 34, 22, 12, 14, 11, 9, 8, 23 | 8, 10, 10, 11, 11, 12, 13, 14, 15, 16, 20, 26, 31, 36, 36, 40, 24 | 45, 53, 57, 34, 34, 34, 26, 8, 15, 5, 6, 9, 7, 10, 22, 1, 25 | 2, 3, 4, 6, 7, 7, 12, 1, 12, 12, 12, 12, 12, 12, 11, 12, 26 | 12, 12, 12, 12, 12, 12, 12, 22, 22, 22, 22, 23, 30, 30, 22, 24, 27 | 23, 22, 23, 23, 23, 22, 23, 23, 22, 31, 23, 17, 20, 19, 19, 20, 28 | 7, 7, 7, 7, 7, 8, 8, 7, 7, 7, 7, 8, 7, 8, 29 | }; 30 | 31 | void NDECL(monstr_init); 32 | 33 | void 34 | monstr_init() 35 | { 36 | return; 37 | } 38 | 39 | /*monstr.c*/ 40 | -------------------------------------------------------------------------------- /impl/libs/librefossys/include/refos-io/internal_state.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef _REFOS_IO_INTERNAL_STATE_H_ 8 | #define _REFOS_IO_INTERNAL_STATE_H_ 9 | 10 | #include 11 | #include 12 | #include 13 | #include "stdio.h" 14 | #include "morecore.h" 15 | #include "mmap_segment.h" 16 | #include "filetable.h" 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | struct sl_procinfo_s; 23 | 24 | typedef struct refos_io_internal_state { 25 | /* STDIO read / write override functions. One example where this comps in handy is the OS 26 | server, which obviously cannot IPC itself to print. */ 27 | stdio_read_fn_t stdioReadOverride; 28 | stdio_read_fn_t stdioWriteOverride; 29 | 30 | /*! \brief Statically allocated morecore area. 31 | 32 | This is a rather terrible workaround for servers which would like to use malloc before 33 | The RefOS userland infrastructure is properly set up. 34 | 35 | */ 36 | char* staticMoreCoreOverride; 37 | uintptr_t staticMoreCoreOverrideBase; 38 | uintptr_t staticMoreCoreOverrideTop; 39 | 40 | /*! The STDIO dataspace, owned by Console server. */ 41 | serv_connection_t stdioSession; 42 | seL4_CPtr stdioDataspace; 43 | 44 | /*! File descriptor table. */ 45 | fd_table_t fdTable; 46 | 47 | /*! Dynamic morecore heap state. */ 48 | bool dynamicHeap; 49 | struct sl_procinfo_s *procInfo; 50 | 51 | /*! Dynamic morecore mmap state. */ 52 | bool dynamicMMap; 53 | refos_io_mmap_segment_state_t mmapState; 54 | 55 | /*! Timer state. */ 56 | FILE * timerFD; 57 | } refos_io_internal_state_t; 58 | 59 | extern refos_io_internal_state_t refosIOState; 60 | 61 | #endif /* _REFOS_IO_INTERNAL_STATE_H_ */ -------------------------------------------------------------------------------- /impl/apps/file_server/src/dispatchers/dispatch.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #include "dispatch.h" 8 | #include 9 | 10 | /*! @file 11 | @brief Common file server dispatcher helper functions. */ 12 | 13 | /*! @brief Special anonymous client structure. 14 | 15 | We use this to temporarily book-keep an anonymous client who has not fully connected yet. This 16 | solves the chicken-and-egg problem of needing a rpc_client_t to communicate so the client can 17 | communicate to set up real communication session. 18 | */ 19 | static struct srv_client _anonClient; 20 | 21 | int 22 | check_dispatch_interface(srv_msg_t *m, void **userptr, int labelMin, int labelMax) 23 | { 24 | assert(userptr); 25 | if (seL4_MessageInfo_get_label(m->message) != seL4_Fault_NullFault) { 26 | /* Not a Syscall, pass onto next dispatcher. */ 27 | return DISPATCH_PASS; 28 | } 29 | 30 | struct srv_client *c = NULL; 31 | if (m->badge) { 32 | /* Try to look up client. */ 33 | c = client_get_badge(&fileServCommon->clientTable, m->badge); 34 | } else { 35 | /* Anonymous client, unbadged. */ 36 | c = &_anonClient; 37 | memset(c, 0, sizeof(struct srv_client)); 38 | c->magic = FS_DISPATCH_ANON_CLIENT_MAGIC; 39 | } 40 | 41 | if (!c) { 42 | /* No client registered here, not our syscall to handle. */ 43 | return DISPATCH_PASS; 44 | } 45 | 46 | seL4_Word syscallFunc = seL4_GetMR(0); 47 | if (syscallFunc <= labelMin || syscallFunc >= labelMax) { 48 | /* Not our type of syscall to handle. */ 49 | return DISPATCH_PASS; 50 | } 51 | 52 | c->rpcClient.userptr = (void*) m; 53 | c->rpcClient.minfo = m->message; 54 | (*userptr) = (void*) c; 55 | return DISPATCH_SUCCESS; 56 | } 57 | -------------------------------------------------------------------------------- /impl/apps/nethack/src/nethack-3.4.3/include/load_img.h: -------------------------------------------------------------------------------- 1 | 2 | /* ------------------------------------------- */ 3 | #define XIMG 0x58494D47 4 | 5 | /* Header of GEM Image Files */ 6 | typedef struct IMG_HEADER{ 7 | short version; /* Img file format version (1) */ 8 | short length; /* Header length in words (8) */ 9 | short planes; /* Number of bit-planes (1) */ 10 | short pat_len; /* length of Patterns (2) */ 11 | short pix_w; /* Pixel width in 1/1000 mmm (372) */ 12 | short pix_h; /* Pixel height in 1/1000 mmm (372) */ 13 | short img_w; /* Pixels per line (=(x+7)/8 Bytes) */ 14 | short img_h; /* Total number of lines */ 15 | long magic; /* Contains "XIMG" if standard color */ 16 | short paltype; /* palette type (0=RGB (short each)) */ 17 | short *palette; /* palette etc. */ 18 | char *addr; /* Address for the depacked bit-planes */ 19 | } IMG_header; 20 | 21 | /* ------------------------------------------- */ 22 | /* error codes */ 23 | #define ERR_HEADER 1 24 | #define ERR_ALLOC 2 25 | #define ERR_FILE 3 26 | #define ERR_DEPACK 4 27 | #define ERR_COLOR 5 28 | 29 | /* saves the current colorpalette with col colors in palette */ 30 | void get_colors(int handle, short *palette, int col); 31 | 32 | /* sets col colors from palette */ 33 | void img_set_colors(int handle,short *palette, int col); 34 | 35 | /* converts MFDB of size from standard to deviceformat (0 if succeded, else error). */ 36 | int convert(MFDB *, long ); 37 | 38 | /* transforms image in VDI-Device format */ 39 | int transform_img(MFDB *); 40 | 41 | /* Loads & depacks IMG (0 if succeded, else error). */ 42 | /* Bitplanes are one after another in address IMG_HEADER.addr. */ 43 | int depack_img(char *, IMG_header *); 44 | 45 | /* Halves IMG in Device-format, dest memory has to be allocated*/ 46 | int half_img(MFDB *,MFDB *); 47 | -------------------------------------------------------------------------------- /impl/apps/timer_server/src/dispatchers/dispatch.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #include "dispatch.h" 8 | #include 9 | 10 | /*! @file 11 | @brief Common timer server dispatcher helper functions. */ 12 | 13 | /*! @brief Special anonymous client structure. 14 | 15 | We use this to temporarily book-keep an anonymous client who has not fully connected yet. This 16 | solves the chicken-and-egg problem of needing a rpc_client_t to communicate so the client can 17 | communicate to set up real communication session. 18 | */ 19 | static struct srv_client _anonClient; 20 | 21 | int 22 | check_dispatch_interface(srv_msg_t *m, void **userptr, int labelMin, int labelMax) 23 | { 24 | assert(userptr); 25 | if (seL4_MessageInfo_get_label(m->message) != seL4_Fault_NullFault) { 26 | /* Not a Syscall, pass onto next dispatcher. */ 27 | return DISPATCH_PASS; 28 | } 29 | 30 | struct srv_client *c = NULL; 31 | if (m->badge) { 32 | /* Try to look up client. */ 33 | c = client_get_badge(&timeServCommon->clientTable, m->badge); 34 | } else { 35 | /* Anonymous client, unbadged. */ 36 | c = &_anonClient; 37 | memset(c, 0, sizeof(struct srv_client)); 38 | c->magic = TIMESERV_DISPATCH_ANON_CLIENT_MAGIC; 39 | } 40 | 41 | if (!c) { 42 | /* No client registered here, not our syscall to handle. */ 43 | return DISPATCH_PASS; 44 | } 45 | 46 | seL4_Word syscallFunc = seL4_GetMR(0); 47 | if (syscallFunc <= labelMin || syscallFunc >= labelMax) { 48 | /* Not our type of syscall to handle. */ 49 | return DISPATCH_PASS; 50 | } 51 | 52 | c->rpcClient.userptr = (void*) m; 53 | c->rpcClient.minfo = m->message; 54 | (*userptr) = (void*) c; 55 | return DISPATCH_SUCCESS; 56 | } 57 | -------------------------------------------------------------------------------- /impl/apps/console_server/src/dispatchers/dispatch.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, Data61, CSIRO (ABN 41 687 119 230) 3 | * 4 | * SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #include "dispatch.h" 8 | #include 9 | 10 | /*! @file 11 | @brief Common Console server dispatcher helper functions. */ 12 | 13 | /*! @brief Special anonymous client structure. 14 | 15 | We use this to temporarily book-keep an anonymous client who has not fully connected yet. This 16 | solves the chicken-and-egg problem of needing a rpc_client_t to communicate so the client can 17 | communicate to set up real communication session. 18 | */ 19 | static struct srv_client _anonClient; 20 | 21 | int 22 | check_dispatch_interface(srv_msg_t *m, void **userptr, int labelMin, int labelMax) 23 | { 24 | assert(userptr); 25 | if (seL4_MessageInfo_get_label(m->message) != seL4_Fault_NullFault) { 26 | /* Not a Syscall, pass onto next dispatcher. */ 27 | return DISPATCH_PASS; 28 | } 29 | 30 | struct srv_client *c = NULL; 31 | if (m->badge) { 32 | /* Try to look up client. */ 33 | c = client_get_badge(&conServCommon->clientTable, m->badge); 34 | } else { 35 | /* Anonymous client, unbadged. */ 36 | c = &_anonClient; 37 | memset(c, 0, sizeof(struct srv_client)); 38 | c->magic = CONSERV_DISPATCH_ANON_CLIENT_MAGIC; 39 | } 40 | 41 | if (!c) { 42 | /* No client registered here, not our syscall to handle. */ 43 | return DISPATCH_PASS; 44 | } 45 | 46 | seL4_Word syscallFunc = seL4_GetMR(0); 47 | if (syscallFunc <= labelMin || syscallFunc >= labelMax) { 48 | /* Not our type of syscall to handle. */ 49 | return DISPATCH_PASS; 50 | } 51 | 52 | c->rpcClient.userptr = (void*) m; 53 | c->rpcClient.minfo = m->message; 54 | (*userptr) = (void*) c; 55 | return DISPATCH_SUCCESS; 56 | } 57 | -------------------------------------------------------------------------------- /impl/apps/nethack/src/refos_nethack.c: -------------------------------------------------------------------------------- 1 | /* Nethack as a whole is licensed under the NGPL license. 2 | 3 | SPDX-License-Identifier: NGPL 4 | Copyright 2014, NICTA 5 | 6 | Source files were modified to be compatible with the RefOS build system and to disable features 7 | that RefOS didn't fully support. Changes occurred on October 24, 2014. 8 | */ 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #define REFOS_NETHACK_WIZARD_MODE 0 16 | 17 | int 18 | has_colors() 19 | { 20 | return 1; 21 | } 22 | 23 | char _argv0[] = "fileserv/nethack"; 24 | #if REFOS_NETHACK_WIZARD_MODE 25 | char _argv1[] = "-D"; 26 | #endif 27 | 28 | int 29 | main(int argc, char **argv) 30 | { 31 | /* Future Work 3: 32 | How the selfloader bootstraps user processes needs to be modified further. Changes were 33 | made to accomodate the new way that muslc expects process's stacks to be set up when 34 | processes start, but the one part of this that still needs to changed is how user processes 35 | find their system call table. Currently the selfloader sets up user processes so that 36 | the selfloader's system call table is used by user processes by passing the address of the 37 | selfloader's system call table to the user processes via the user process's environment 38 | variables. Ideally, user processes would use their own system call table. 39 | */ 40 | 41 | uintptr_t address = strtoll(getenv("SYSTABLE"), NULL, 16); 42 | refos_init_selfload_child(address); 43 | refos_stdio_translate_stdin_cr = true; 44 | refos_initialise(); 45 | printf("RefOS nethack.\n"); 46 | setenv("PWD", "fileserv/", true); 47 | 48 | #if REFOS_NETHACK_WIZARD_MODE 49 | char *_argv[] = {_argv0, _argv1}; 50 | int _argc = 2; 51 | #else 52 | char *_argv[] = {_argv0 }; 53 | int _argc = 1; 54 | #endif 55 | 56 | nethack_main(_argc, _argv); 57 | } 58 | --------------------------------------------------------------------------------