From e885f0757e5cfd9b2e4f16845026496e66bbc12e Mon Sep 17 00:00:00 2001 From: Akilan Date: Wed, 2 Apr 2025 17:28:49 +0100 Subject: [PATCH] added recent changes --- .DS_Store | Bin 8196 -> 10244 bytes .vscode/settings.json | 3 +- KernelModule/BSDmakefile.meson | 18 + KernelModule/Hugepages/Makefile | 5 + KernelModule/Hugepages/build | 0 KernelModule/Hugepages/build.sh | 6 + KernelModule/Hugepages/meson.build | 4 + KernelModule/Hugepages/superpage.c | 59 + KernelModule/meson.build | 39 + allocator/.DS_Store | Bin 0 -> 6148 bytes allocator/bitmap/.DS_Store | Bin 0 -> 6148 bytes benchmarks/.DS_Store | Bin 6148 -> 6148 bytes benchmarks/benchmarks/.DS_Store | Bin 0 -> 10244 bytes benchmarks/benchmarks/kmeans/stddefines.h | 522 +- docs/.DS_Store | Bin 10244 -> 14340 bytes docs/EuroSys/.DS_Store | Bin 0 -> 10244 bytes docs/EuroSys/ACM-Reference-Format.bst | 3081 ++++++ docs/EuroSys/Makefile | 169 + docs/EuroSys/Paper/.DS_Store | Bin 0 -> 6148 bytes docs/EuroSys/Paper/diagram/.DS_Store | Bin 6148 -> 6148 bytes docs/EuroSys/Paper/paper.aux | 67 +- docs/EuroSys/Paper/paper.bbl | 22 +- docs/EuroSys/Paper/paper.blg | 63 +- docs/EuroSys/Paper/paper.fdb_latexmk | 14 +- docs/EuroSys/Paper/paper.fls | 10 +- docs/EuroSys/Paper/paper.log | 225 +- docs/EuroSys/Paper/paper.pdf | Bin 701484 -> 701087 bytes docs/EuroSys/Paper/paper.tex | 112 +- docs/EuroSys/README | 385 + docs/EuroSys/acm-jdslogo.png | Bin 0 -> 19718 bytes docs/EuroSys/acmart.bib | 95 + docs/EuroSys/acmart.cls | 3579 +++++++ docs/EuroSys/acmart.dtx | 8754 +++++++++++++++++ docs/EuroSys/acmart.ins | 30 + docs/EuroSys/acmart.pdf | Bin 0 -> 919116 bytes docs/EuroSys/acmauthoryear.bbx | 900 ++ docs/EuroSys/acmauthoryear.cbx | 219 + docs/EuroSys/acmdatamodel.dbx | 33 + docs/EuroSys/acmguide.pdf | Bin 0 -> 439879 bytes docs/EuroSys/acmnumeric.bbx | 885 ++ docs/EuroSys/acmnumeric.cbx | 5 + docs/EuroSys/samples/ACM-Reference-Format.bst | 3081 ++++++ docs/EuroSys/samples/abbrev.bib | 86 + docs/EuroSys/samples/acm-jdslogo.png | Bin 0 -> 19718 bytes docs/EuroSys/samples/acmart.cls | 3579 +++++++ docs/EuroSys/samples/acmauthoryear.bbx | 900 ++ docs/EuroSys/samples/acmauthoryear.cbx | 219 + docs/EuroSys/samples/acmdatamodel.dbx | 33 + docs/EuroSys/samples/acmengage.dtx | 257 + docs/EuroSys/samples/acmnumeric.bbx | 885 ++ docs/EuroSys/samples/acmnumeric.cbx | 5 + docs/EuroSys/samples/comment.cut | 1 + docs/EuroSys/samples/sample-acmcp.aux | 32 + docs/EuroSys/samples/sample-acmcp.bbl | 0 docs/EuroSys/samples/sample-acmcp.blg | 48 + docs/EuroSys/samples/sample-acmcp.log | 1142 +++ docs/EuroSys/samples/sample-acmcp.pdf | Bin 0 -> 214870 bytes docs/EuroSys/samples/sample-acmcp.tex | 223 + docs/EuroSys/samples/sample-acmengage.aux | 64 + docs/EuroSys/samples/sample-acmengage.bbl | 166 + docs/EuroSys/samples/sample-acmengage.blg | 60 + docs/EuroSys/samples/sample-acmengage.log | 1092 ++ docs/EuroSys/samples/sample-acmengage.pdf | Bin 0 -> 394674 bytes docs/EuroSys/samples/sample-acmengage.tex | 272 + docs/EuroSys/samples/sample-acmlarge.aux | 133 + docs/EuroSys/samples/sample-acmlarge.bbl | 555 ++ docs/EuroSys/samples/sample-acmlarge.blg | 78 + docs/EuroSys/samples/sample-acmlarge.log | 1128 +++ docs/EuroSys/samples/sample-acmlarge.pdf | Bin 0 -> 609036 bytes docs/EuroSys/samples/sample-acmlarge.tex | 813 ++ .../samples/sample-acmsmall-biblatex.aux | 277 + .../samples/sample-acmsmall-biblatex.bbl | 1732 ++++ .../samples/sample-acmsmall-biblatex.bcf | 2719 +++++ .../samples/sample-acmsmall-biblatex.blg | 29 + .../samples/sample-acmsmall-biblatex.log | 1436 +++ .../samples/sample-acmsmall-biblatex.pdf | Bin 0 -> 631715 bytes .../samples/sample-acmsmall-biblatex.run.xml | 94 + .../samples/sample-acmsmall-biblatex.tex | 821 ++ docs/EuroSys/samples/sample-acmsmall-conf.aux | 135 + docs/EuroSys/samples/sample-acmsmall-conf.bbl | 555 ++ docs/EuroSys/samples/sample-acmsmall-conf.blg | 78 + docs/EuroSys/samples/sample-acmsmall-conf.log | 1122 +++ docs/EuroSys/samples/sample-acmsmall-conf.pdf | Bin 0 -> 1054333 bytes docs/EuroSys/samples/sample-acmsmall-conf.tex | 827 ++ .../samples/sample-acmsmall-submission.aux | 133 + .../samples/sample-acmsmall-submission.bbl | 555 ++ .../samples/sample-acmsmall-submission.blg | 78 + .../samples/sample-acmsmall-submission.log | 1138 +++ .../samples/sample-acmsmall-submission.pdf | Bin 0 -> 621533 bytes .../samples/sample-acmsmall-submission.tex | 813 ++ docs/EuroSys/samples/sample-acmsmall.aux | 133 + docs/EuroSys/samples/sample-acmsmall.bbl | 555 ++ docs/EuroSys/samples/sample-acmsmall.blg | 78 + docs/EuroSys/samples/sample-acmsmall.log | 1122 +++ docs/EuroSys/samples/sample-acmsmall.pdf | Bin 0 -> 619008 bytes docs/EuroSys/samples/sample-acmsmall.tex | 813 ++ docs/EuroSys/samples/sample-acmsmall.tex~ | 821 ++ docs/EuroSys/samples/sample-acmtog-conf.aux | 133 + docs/EuroSys/samples/sample-acmtog-conf.bbl | 555 ++ docs/EuroSys/samples/sample-acmtog-conf.blg | 78 + docs/EuroSys/samples/sample-acmtog-conf.log | 1130 +++ docs/EuroSys/samples/sample-acmtog-conf.pdf | Bin 0 -> 566982 bytes docs/EuroSys/samples/sample-acmtog-conf.tex | 822 ++ docs/EuroSys/samples/sample-acmtog.aux | 133 + docs/EuroSys/samples/sample-acmtog.bbl | 555 ++ docs/EuroSys/samples/sample-acmtog.blg | 78 + docs/EuroSys/samples/sample-acmtog.log | 1131 +++ docs/EuroSys/samples/sample-acmtog.pdf | Bin 0 -> 566732 bytes docs/EuroSys/samples/sample-acmtog.tex | 811 ++ docs/EuroSys/samples/sample-base.bib | 1651 ++++ docs/EuroSys/samples/sample-franklin.png | Bin 0 -> 95030 bytes docs/EuroSys/samples/sample-manuscript.aux | 133 + docs/EuroSys/samples/sample-manuscript.bbl | 555 ++ docs/EuroSys/samples/sample-manuscript.blg | 78 + docs/EuroSys/samples/sample-manuscript.log | 1135 +++ docs/EuroSys/samples/sample-manuscript.pdf | Bin 0 -> 620502 bytes docs/EuroSys/samples/sample-manuscript.tex | 817 ++ .../samples/sample-sigconf-authordraft.aux | 135 + .../samples/sample-sigconf-authordraft.bbl | 555 ++ .../samples/sample-sigconf-authordraft.blg | 78 + .../samples/sample-sigconf-authordraft.log | 1175 +++ .../samples/sample-sigconf-authordraft.pdf | Bin 0 -> 1046386 bytes .../samples/sample-sigconf-authordraft.tex | 827 ++ .../samples/sample-sigconf-biblatex.aux | 191 + .../samples/sample-sigconf-biblatex.bbl | 1581 +++ .../samples/sample-sigconf-biblatex.bcf | 2718 +++++ .../samples/sample-sigconf-biblatex.blg | 29 + .../samples/sample-sigconf-biblatex.log | 1467 +++ .../samples/sample-sigconf-biblatex.pdf | Bin 0 -> 619552 bytes .../samples/sample-sigconf-biblatex.run.xml | 94 + .../samples/sample-sigconf-biblatex.tex | 825 ++ docs/EuroSys/samples/sample-sigconf-i13n.aux | 158 + docs/EuroSys/samples/sample-sigconf-i13n.bbl | 555 ++ docs/EuroSys/samples/sample-sigconf-i13n.blg | 78 + docs/EuroSys/samples/sample-sigconf-i13n.log | 1244 +++ docs/EuroSys/samples/sample-sigconf-i13n.pdf | Bin 0 -> 1057515 bytes docs/EuroSys/samples/sample-sigconf-i13n.tex | 868 ++ .../samples/sample-sigconf-lualatex.tex | 827 ++ .../samples/sample-sigconf-xelatex.tex | 827 ++ docs/EuroSys/samples/sample-sigconf.aux | 135 + docs/EuroSys/samples/sample-sigconf.bbl | 555 ++ docs/EuroSys/samples/sample-sigconf.blg | 78 + docs/EuroSys/samples/sample-sigconf.log | 1149 +++ docs/EuroSys/samples/sample-sigconf.pdf | Bin 0 -> 1042571 bytes docs/EuroSys/samples/sample-sigconf.tex | 827 ++ docs/EuroSys/samples/sample-sigplan.aux | 135 + docs/EuroSys/samples/sample-sigplan.bbl | 555 ++ docs/EuroSys/samples/sample-sigplan.blg | 78 + docs/EuroSys/samples/sample-sigplan.log | 1199 +++ docs/EuroSys/samples/sample-sigplan.pdf | Bin 0 -> 1048573 bytes docs/EuroSys/samples/sample-sigplan.tex | 827 ++ docs/EuroSys/samples/samples.dtx | 1029 ++ docs/EuroSys/samples/samples.ins | 28 + docs/EuroSys/samples/samples.log | 213 + docs/EuroSys/samples/sampleteaser.pdf | Bin 0 -> 439021 bytes docs/EuroSys/samples/software.bib | 145 + docs/FAT-Pointer/.DS_Store | Bin 0 -> 6148 bytes docs/FAT-Pointer/diagram/.DS_Store | Bin 6148 -> 6148 bytes .../InputLeap_3.0.2_macos_AppleSilicon.dmg | Bin .../drawio/InputLeap_3.0.2_macos_x86_64.dmg | Bin docs/Riscv-docs/RISC-work.org | 174 + docs/Riscv-docs/RISC-work.pdf | Bin 0 -> 122882 bytes docs/Riscv-docs/RISC-work.tex | 211 + docs/Riscv-docs/docs.org | 279 + docs/evaluation/.DS_Store | Bin 0 -> 8196 bytes dpdk/.DS_Store | Bin 0 -> 8196 bytes dpdk/kernel/freebsd/Hugepage/Hugepage.c | 535 +- dpdk/kernel/freebsd/Malloc/Malloc.c | 353 +- dpdk/kernel/freebsd/meson.build | 2 +- localpush.sh | 2 +- pyplot/.DS_Store | Bin 8196 -> 10244 bytes 171 files changed, 81223 insertions(+), 1533 deletions(-) create mode 100644 KernelModule/BSDmakefile.meson create mode 100644 KernelModule/Hugepages/Makefile create mode 100644 KernelModule/Hugepages/build create mode 100644 KernelModule/Hugepages/build.sh create mode 100644 KernelModule/Hugepages/meson.build create mode 100644 KernelModule/Hugepages/superpage.c create mode 100644 KernelModule/meson.build create mode 100644 allocator/.DS_Store create mode 100644 allocator/bitmap/.DS_Store create mode 100644 benchmarks/benchmarks/.DS_Store create mode 100644 docs/EuroSys/.DS_Store create mode 100644 docs/EuroSys/ACM-Reference-Format.bst create mode 100644 docs/EuroSys/Makefile create mode 100644 docs/EuroSys/Paper/.DS_Store create mode 100644 docs/EuroSys/README create mode 100644 docs/EuroSys/acm-jdslogo.png create mode 100644 docs/EuroSys/acmart.bib create mode 100644 docs/EuroSys/acmart.cls create mode 100644 docs/EuroSys/acmart.dtx create mode 100644 docs/EuroSys/acmart.ins create mode 100644 docs/EuroSys/acmart.pdf create mode 100644 docs/EuroSys/acmauthoryear.bbx create mode 100644 docs/EuroSys/acmauthoryear.cbx create mode 100644 docs/EuroSys/acmdatamodel.dbx create mode 100644 docs/EuroSys/acmguide.pdf create mode 100644 docs/EuroSys/acmnumeric.bbx create mode 100644 docs/EuroSys/acmnumeric.cbx create mode 100644 docs/EuroSys/samples/ACM-Reference-Format.bst create mode 100644 docs/EuroSys/samples/abbrev.bib create mode 100644 docs/EuroSys/samples/acm-jdslogo.png create mode 100644 docs/EuroSys/samples/acmart.cls create mode 100644 docs/EuroSys/samples/acmauthoryear.bbx create mode 100644 docs/EuroSys/samples/acmauthoryear.cbx create mode 100644 docs/EuroSys/samples/acmdatamodel.dbx create mode 100644 docs/EuroSys/samples/acmengage.dtx create mode 100644 docs/EuroSys/samples/acmnumeric.bbx create mode 100644 docs/EuroSys/samples/acmnumeric.cbx create mode 100644 docs/EuroSys/samples/comment.cut create mode 100644 docs/EuroSys/samples/sample-acmcp.aux create mode 100644 docs/EuroSys/samples/sample-acmcp.bbl create mode 100644 docs/EuroSys/samples/sample-acmcp.blg create mode 100644 docs/EuroSys/samples/sample-acmcp.log create mode 100644 docs/EuroSys/samples/sample-acmcp.pdf create mode 100644 docs/EuroSys/samples/sample-acmcp.tex create mode 100644 docs/EuroSys/samples/sample-acmengage.aux create mode 100644 docs/EuroSys/samples/sample-acmengage.bbl create mode 100644 docs/EuroSys/samples/sample-acmengage.blg create mode 100644 docs/EuroSys/samples/sample-acmengage.log create mode 100644 docs/EuroSys/samples/sample-acmengage.pdf create mode 100644 docs/EuroSys/samples/sample-acmengage.tex create mode 100644 docs/EuroSys/samples/sample-acmlarge.aux create mode 100644 docs/EuroSys/samples/sample-acmlarge.bbl create mode 100644 docs/EuroSys/samples/sample-acmlarge.blg create mode 100644 docs/EuroSys/samples/sample-acmlarge.log create mode 100644 docs/EuroSys/samples/sample-acmlarge.pdf create mode 100644 docs/EuroSys/samples/sample-acmlarge.tex create mode 100644 docs/EuroSys/samples/sample-acmsmall-biblatex.aux create mode 100644 docs/EuroSys/samples/sample-acmsmall-biblatex.bbl create mode 100644 docs/EuroSys/samples/sample-acmsmall-biblatex.bcf create mode 100644 docs/EuroSys/samples/sample-acmsmall-biblatex.blg create mode 100644 docs/EuroSys/samples/sample-acmsmall-biblatex.log create mode 100644 docs/EuroSys/samples/sample-acmsmall-biblatex.pdf create mode 100644 docs/EuroSys/samples/sample-acmsmall-biblatex.run.xml create mode 100644 docs/EuroSys/samples/sample-acmsmall-biblatex.tex create mode 100644 docs/EuroSys/samples/sample-acmsmall-conf.aux create mode 100644 docs/EuroSys/samples/sample-acmsmall-conf.bbl create mode 100644 docs/EuroSys/samples/sample-acmsmall-conf.blg create mode 100644 docs/EuroSys/samples/sample-acmsmall-conf.log create mode 100644 docs/EuroSys/samples/sample-acmsmall-conf.pdf create mode 100644 docs/EuroSys/samples/sample-acmsmall-conf.tex create mode 100644 docs/EuroSys/samples/sample-acmsmall-submission.aux create mode 100644 docs/EuroSys/samples/sample-acmsmall-submission.bbl create mode 100644 docs/EuroSys/samples/sample-acmsmall-submission.blg create mode 100644 docs/EuroSys/samples/sample-acmsmall-submission.log create mode 100644 docs/EuroSys/samples/sample-acmsmall-submission.pdf create mode 100644 docs/EuroSys/samples/sample-acmsmall-submission.tex create mode 100644 docs/EuroSys/samples/sample-acmsmall.aux create mode 100644 docs/EuroSys/samples/sample-acmsmall.bbl create mode 100644 docs/EuroSys/samples/sample-acmsmall.blg create mode 100644 docs/EuroSys/samples/sample-acmsmall.log create mode 100644 docs/EuroSys/samples/sample-acmsmall.pdf create mode 100644 docs/EuroSys/samples/sample-acmsmall.tex create mode 100644 docs/EuroSys/samples/sample-acmsmall.tex~ create mode 100644 docs/EuroSys/samples/sample-acmtog-conf.aux create mode 100644 docs/EuroSys/samples/sample-acmtog-conf.bbl create mode 100644 docs/EuroSys/samples/sample-acmtog-conf.blg create mode 100644 docs/EuroSys/samples/sample-acmtog-conf.log create mode 100644 docs/EuroSys/samples/sample-acmtog-conf.pdf create mode 100644 docs/EuroSys/samples/sample-acmtog-conf.tex create mode 100644 docs/EuroSys/samples/sample-acmtog.aux create mode 100644 docs/EuroSys/samples/sample-acmtog.bbl create mode 100644 docs/EuroSys/samples/sample-acmtog.blg create mode 100644 docs/EuroSys/samples/sample-acmtog.log create mode 100644 docs/EuroSys/samples/sample-acmtog.pdf create mode 100644 docs/EuroSys/samples/sample-acmtog.tex create mode 100644 docs/EuroSys/samples/sample-base.bib create mode 100644 docs/EuroSys/samples/sample-franklin.png create mode 100644 docs/EuroSys/samples/sample-manuscript.aux create mode 100644 docs/EuroSys/samples/sample-manuscript.bbl create mode 100644 docs/EuroSys/samples/sample-manuscript.blg create mode 100644 docs/EuroSys/samples/sample-manuscript.log create mode 100644 docs/EuroSys/samples/sample-manuscript.pdf create mode 100644 docs/EuroSys/samples/sample-manuscript.tex create mode 100644 docs/EuroSys/samples/sample-sigconf-authordraft.aux create mode 100644 docs/EuroSys/samples/sample-sigconf-authordraft.bbl create mode 100644 docs/EuroSys/samples/sample-sigconf-authordraft.blg create mode 100644 docs/EuroSys/samples/sample-sigconf-authordraft.log create mode 100644 docs/EuroSys/samples/sample-sigconf-authordraft.pdf create mode 100644 docs/EuroSys/samples/sample-sigconf-authordraft.tex create mode 100644 docs/EuroSys/samples/sample-sigconf-biblatex.aux create mode 100644 docs/EuroSys/samples/sample-sigconf-biblatex.bbl create mode 100644 docs/EuroSys/samples/sample-sigconf-biblatex.bcf create mode 100644 docs/EuroSys/samples/sample-sigconf-biblatex.blg create mode 100644 docs/EuroSys/samples/sample-sigconf-biblatex.log create mode 100644 docs/EuroSys/samples/sample-sigconf-biblatex.pdf create mode 100644 docs/EuroSys/samples/sample-sigconf-biblatex.run.xml create mode 100644 docs/EuroSys/samples/sample-sigconf-biblatex.tex create mode 100644 docs/EuroSys/samples/sample-sigconf-i13n.aux create mode 100644 docs/EuroSys/samples/sample-sigconf-i13n.bbl create mode 100644 docs/EuroSys/samples/sample-sigconf-i13n.blg create mode 100644 docs/EuroSys/samples/sample-sigconf-i13n.log create mode 100644 docs/EuroSys/samples/sample-sigconf-i13n.pdf create mode 100644 docs/EuroSys/samples/sample-sigconf-i13n.tex create mode 100644 docs/EuroSys/samples/sample-sigconf-lualatex.tex create mode 100644 docs/EuroSys/samples/sample-sigconf-xelatex.tex create mode 100644 docs/EuroSys/samples/sample-sigconf.aux create mode 100644 docs/EuroSys/samples/sample-sigconf.bbl create mode 100644 docs/EuroSys/samples/sample-sigconf.blg create mode 100644 docs/EuroSys/samples/sample-sigconf.log create mode 100644 docs/EuroSys/samples/sample-sigconf.pdf create mode 100644 docs/EuroSys/samples/sample-sigconf.tex create mode 100644 docs/EuroSys/samples/sample-sigplan.aux create mode 100644 docs/EuroSys/samples/sample-sigplan.bbl create mode 100644 docs/EuroSys/samples/sample-sigplan.blg create mode 100644 docs/EuroSys/samples/sample-sigplan.log create mode 100644 docs/EuroSys/samples/sample-sigplan.pdf create mode 100644 docs/EuroSys/samples/sample-sigplan.tex create mode 100644 docs/EuroSys/samples/samples.dtx create mode 100644 docs/EuroSys/samples/samples.ins create mode 100644 docs/EuroSys/samples/samples.log create mode 100644 docs/EuroSys/samples/sampleteaser.pdf create mode 100644 docs/EuroSys/samples/software.bib create mode 100644 docs/FAT-Pointer/.DS_Store rename docs/{EuroSys/Paper => FAT-Pointer}/diagram/drawio/InputLeap_3.0.2_macos_AppleSilicon.dmg (100%) rename docs/{EuroSys/Paper => FAT-Pointer}/diagram/drawio/InputLeap_3.0.2_macos_x86_64.dmg (100%) create mode 100644 docs/Riscv-docs/RISC-work.org create mode 100644 docs/Riscv-docs/RISC-work.pdf create mode 100644 docs/Riscv-docs/RISC-work.tex create mode 100644 docs/Riscv-docs/docs.org create mode 100644 docs/evaluation/.DS_Store create mode 100644 dpdk/.DS_Store diff --git a/.DS_Store b/.DS_Store index 3966a2050d84d6010ca49aba076d5256c541939d..0f4d1825a4cdb19d87620ffb231393b371ecb43d 100644 GIT binary patch literal 10244 zcmeGhTWlQF^_;Qe%;LcwhmgQ#4V#!p3huH_3kgYS*7oLwV{B~4&$MQDXA+M*JG0rD zT?c4dw?(w5d;ooXv=9&oRfP&v1pHJWDk{hakqAO*iGVgz5lA2eqNF`ppOWlF{!_ z(34L5;~qL-io@_3dLZ<`QV+1+y%7>{5Daj|{(aqh<+Qk#x6|pYX=iCpK6`qw@zC=x zbO+b9y6c6R#cu=aK8_P9tRT4tXrMzzlnl`Di{Pp#`}LQ8^2(upPqsjxw-=??#t`N6 z;|x}k{4zL@1Dk0P)Iolnbg04*^~j!B&|?YKqAts01@(!OFp`!5lm2YdC;_=Wrk(RW z&JH!^?Zkh*iy=cqz|Me6RK+R^X2EArXim<|+P29~)fx-~E*X96j@nqFTi$K{`#S|5 z8a4Qd+f*Mj;GX?2lVCUpvJ@&7IcEm)WPA~3!3mm-?Svc&rPeVdu_|j7?xi22nK9drP*^mcFEElk9L?Z$Pqa*t**KC*3Fxe zo$=(6&N%wBg!{rKc*EM$Tzg&W-LH9UE6B$BmqA4I8)U(`u_j=I){4U{NoVnPWNIEafd{ zT5Zc^%v{OLxO%r~GGv--b#g`9GzV?Ra1Gm<72MoQqZ_d!%nTd>((=E-g4vv)#$HT8jRM|8o3(dc+7YaA*W?#*h4 zEPJ!<7e$r*8tKt*YmAwuJ|%Pf4HreDQ*5QTsMAyP2`;-ls*E_~12y9#UfHQABeS&k zs^g1Fb}7+)W+tnfsutmLuD(Wzj+MD_YM(#3b(<0$r;p2dvcze_PJeoPDjNMhle{C9w``oJ88pFg{sX1xuhc}BEDGhDl}xR(r>VC=dz%`;<_+SVGq zF*+=(ugJ6^hE+BwMT^ah26}s(k8Eka6dc=&%m>A98SV%cpE;1Gw>-=aHE9HxEj~sTD$<)V*-=dg`032?!w);2ZwMB zCvXy{P(uS}(ZoEK@dx-r{1MLM9e6kX5`Tri#-sRqd;}lGKjKsPS9}3q#AA2@U&lA_ zO?(^A;92}wYLr@}R!NmEl%i5hYL}8ym$X&tmG(+EN<&r< z^hE81itXNWeV@|*l~1VGT6hYbzh-Tm<<*w!dKO}k2W=%z#pw4!K9DG0$b0cn6|1jO zrmc&$D;HPtusT2YQLgBRWft)2N{+ojxkRR1QCINc<;pi?$`ZAS4?ANCnetMVyrI$+ z`&NXqPi^4C&e-ONtRf$5RlXCUJX9O`aJ$kSp%Xv_Zx~C*cFL4Ws{BRA_z5@#|Acqo z-*5(-D7sa=7&lT}UxO*!NpXEW_F+Gc`jNdKbv%GGUUa)y!Z|#Qx8P6lHoP5wMiG9G z7vaCb`|$yM5Ff&a@iBZH|AbHAllTlii_hU-@Og^)<9HJPf&ap{sv`M@U?k&z#7Guj z@b6D;oVck{^!hJT@ugmCU3`(Zo_LOlTF8>}aM3bt>mbdstYY&8x@Utgavw=5Lvz6??CTI-_TO^Go*4q*~SVcR+1OUQYx{iC|_D= zv5Hf)w+#lUsbHR(qnny4`rR*->WP}An#e(hL87#&B`XqLzGlf*7eCIZIza)2Hs*bQx7lT!Sn7Sk<`xA@f(Y4Y!TwRiLh^`n|a+`8dJ;T2CQxW-Mu6^ zz$;+sx|b@JR^bR%E`t-WF#a;LFakrcgDgqY4)37o$b%Ntob@9C&0AxD4eMSFd^O%oaL4lh|F6pi_@% delta 168 zcmZn(XmOBWU|?W$DortDU;r^WfEYvza8FDWo2aKKDg=@T@);PC8T1&EJ#+GtlX5mD zE@t1%&cVXL3X*1@+$k?Jd5fU)~R CY$OT* diff --git a/.vscode/settings.json b/.vscode/settings.json index c5dfb4a..381bf7d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -61,7 +61,8 @@ "cstdio": "c", "cstdlib": "c", "cwchar": "c", - "new": "c" + "new": "c", + "param.h": "c" }, "C_Cpp.errorSquiggles": "disabled" } \ No newline at end of file diff --git a/KernelModule/BSDmakefile.meson b/KernelModule/BSDmakefile.meson new file mode 100644 index 0000000..6839ac0 --- /dev/null +++ b/KernelModule/BSDmakefile.meson @@ -0,0 +1,18 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2017 Intel Corporation + +# makefile for building kernel modules using meson +# takes parameters from the environment + +# source file is passed via KMOD_SRC as relative path, we only use final +# (tail) component of it (:T), as VPATH is used to find actual file. The +# VPATH is similarly extracted from the non-final (head) portion of the +# path (:H) converted to absolute path (:tA). This use of VPATH is to have +# the .o files placed in the build, not source directory + +VPATH := ${KMOD_SRC:H:tA} +SRCS := ${KMOD_SRC:T} device_if.h bus_if.h pci_if.h +CFLAGS += $(KMOD_CFLAGS) +.OBJDIR: ${KMOD_OBJDIR} + +.include diff --git a/KernelModule/Hugepages/Makefile b/KernelModule/Hugepages/Makefile new file mode 100644 index 0000000..c8ff204 --- /dev/null +++ b/KernelModule/Hugepages/Makefile @@ -0,0 +1,5 @@ +KMOD= superpage +SRCS= superpage.c + +.include + diff --git a/KernelModule/Hugepages/build b/KernelModule/Hugepages/build new file mode 100644 index 0000000..e69de29 diff --git a/KernelModule/Hugepages/build.sh b/KernelModule/Hugepages/build.sh new file mode 100644 index 0000000..353a4c0 --- /dev/null +++ b/KernelModule/Hugepages/build.sh @@ -0,0 +1,6 @@ +cc -O2 -pipe -march=morello -Xclang -morello-vararg=new -Xclang -morello-bounded-memargs=caller-only -mabi=purecap-benchmark -D__LP64__=1 -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc -include /usr/home/akilan/Alloc-Test/CHERI-Allocator/KernelModule/Hugepages/opt_global.h -I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include -fno-common -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fPIC -fdebug-prefix-map=./machine=/usr/src/sys/arm64/include -MD -MF.depend.superpage.o -MTsuperpage.o -mgeneral-regs-only -ffixed-x18 -march=morello -Xclang -morello-vararg=new -Xclang -morello-bounded-memargs=caller-only -mabi=purecap -ffreestanding -fwrapv -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error=tautological-compare -Wno-error=empty-body -Wno-error=parentheses-equality -Wno-error=unused-function -Wno-error=pointer-sign -Wno-error=shift-negative-value -Wno-address-of-packed-member -Wno-format-zero-length -Werror=implicit-function-declaration -std=gnu99 -c superpage.c -o superpage.o + +ld -m aarch64elf_cheri -d -warn-common --build-id=sha1 --no-relax --morello-c64-plt -r -o superpage.kld superpage.o +:> export_syms + +objcopy --strip-debug superpage.ko \ No newline at end of file diff --git a/KernelModule/Hugepages/meson.build b/KernelModule/Hugepages/meson.build new file mode 100644 index 0000000..7dd80ba --- /dev/null +++ b/KernelModule/Hugepages/meson.build @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2017 Intel Corporation + +sources = files('superpage.c') diff --git a/KernelModule/Hugepages/superpage.c b/KernelModule/Hugepages/superpage.c new file mode 100644 index 0000000..f473eff --- /dev/null +++ b/KernelModule/Hugepages/superpage.c @@ -0,0 +1,59 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define HUGE_PAGE_SIZE (2 * 1024 * 1024) // 2MB Huge Page + +static void *hugepage_ptr = NULL; + +// Load function - allocate memory +static int load_handler(module_t mod, int event, void *arg) { + switch (event) { + case MOD_LOAD: + printf("Loading Huge Page Kernel Module...\n"); + + // Allocate contiguous memory + hugepage_ptr = kmem_alloc_contig(HUGE_PAGE_SIZE, M_NOWAIT, + VM_MIN_KERNEL_ADDRESS, VM_MAX_KERNEL_ADDRESS, + HUGE_PAGE_SIZE, 0, + VM_MEMATTR_DEFAULT); + + if (hugepage_ptr == NULL) { + printf("Failed to allocate a huge page!\n"); + return ENOMEM; + } + + printf("Huge page allocated at %p\n", hugepage_ptr); + break; + + case MOD_UNLOAD: + printf("Unloading Huge Page Kernel Module...\n"); + + // Free memory if allocated + if (hugepage_ptr) { + kmem_free(hugepage_ptr, HUGE_PAGE_SIZE); + printf("Huge page freed.\n"); + } + break; + + default: + return EOPNOTSUPP; + } + return 0; +} + +// Register module +static moduledata_t superpage_mod = { + "superpage", // Module name + load_handler, + NULL +}; + +DECLARE_MODULE(superpage, superpage_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE); + diff --git a/KernelModule/meson.build b/KernelModule/meson.build new file mode 100644 index 0000000..64e8660 --- /dev/null +++ b/KernelModule/meson.build @@ -0,0 +1,39 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2018 Intel Corporation + +kmods = ['Hugepages'] + +# for building kernel modules, we use kernel build system using make, as +# with Linux. We have a skeleton BSDmakefile, which pulls many of its +# values from the environment. Each module only has a single source file +# right now, which allows us to simplify things. We pull in the sourcer +# files from the individual meson.build files, and then use a custom +# target to call make, passing in the values as env parameters. +kmod_cflags = ['-I' + dpdk_build_root, + '-I' + join_paths(dpdk_source_root, 'config'), + '-include rte_config.h'] + +kmod_arch = 'MACHINE_ARCH_NULL=' +kmod_arch = 'MACHINE_ARCH=aarch64' + +# to avoid warnings due to race conditions with creating the dev_if.h, etc. +# files, serialize the kernel module builds. Each module will depend on +# previous ones +built_kmods = [] +foreach k:kmods + subdir(k) + built_kmods += custom_target(k, + input: [files('BSDmakefile.meson'), sources], + output: k + '.ko', + command: ['make', '-f', '@INPUT0@', + 'KMOD_OBJDIR=@OUTDIR@', + 'KMOD_SRC=@INPUT1@', + 'KMOD=' + k, + 'KMOD_CFLAGS=' + ' '.join(kmod_cflags), + 'CC=clang', + kmod_arch], + depends: built_kmods, # make each module depend on prev + build_by_default: get_option('enable_kmods'), + install: get_option('enable_kmods'), + install_dir: '/boot/modules/') +endforeach \ No newline at end of file diff --git a/allocator/.DS_Store b/allocator/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..422445ec018317719cf668c820858a3fda785789 GIT binary patch literal 6148 zcmeHKy-ve05I)lgRb?p)LY=|`AkmR6R6$}Z5)umokd{9wQA&R#Ho^qYz|Oz~8w(p! z2i}7hKs*57*%pnPmTm~pU1Wcbedqi9NwH%hQjI~oPE;kLG76(tK{dg6oJ+yxY|kQ4 z={XLm)9$t6C{5#nw{(aCqQGxcfWO^&is+2`l+f7s>kPyv^_^Clbj%8xALD^Z8irAv zM(8hJ4x8Tj%W$LU)1K+mInC$M=_(*N0KE?FgJO&)rIyR5c7a?I{qnq??pC*62b$Lu z-x0rAzAn#gq{l9KOkFy{6GPA*^<9oDx08JG{NAo^p6?C6!dyu@;`W`N%WI8!m7rah zdJdc2_4a5a&*Az#sVzNdjci;#b8*zkxA(~T#QuZ=IJ4Qx3kIbY1w;W+;7bACAAA(X zz+z@lZyl)g6#(d=TN~O{ZUB9YfyK-qMqtW>0!^s0R}5vs(eGQoz+z_5gp;zD4`nke zdqYt=JLdPbJE_2+)S`eW;3`luuT?((H>cnK-5_}r1w?^=rGWCnov?u=*|W8^PPm*t(AFkdRWy&i;Y^#6G6`rrq{riKcB* z*lCO+f&3gnbCpk}iqQ$cHu z0b{@z*fYT22M=Y;6oX*=bfAe>0N@1XDCqNDf@8d5rWgb<0&x-wlu)Nv3@72Rd-cl{ zgP??yiz{OuUD@dk#l_WO_tBkPCTOiOU<@2HFqX#|*Z=$T_y6M{dol)$fs10mP4XgN z;FYwt_Fj%_t%p8CS=cWK?nBUtr5L_kis#TMuzT(RGsPeX3&ef|A`R9U1AofE4=0UK AcmMzZ literal 0 HcmV?d00001 diff --git a/benchmarks/.DS_Store b/benchmarks/.DS_Store index a68ebb26d2e8bee9c3db2751dd0c668cdd4ebb35..fd13145a54b5fe8a90a0a3e119636d8f2974d3d4 100644 GIT binary patch literal 6148 zcmeHKu}Z{15S`T&@hrSj5h1+@-VaDTVyOuC1DZrUH8JPKE9_GF2mXRTB3KDlD%_V? zSomgl@e-1#m8i@dJ1^Ot*?se1v$sT~`jfav)FmPpjnV1AH5iX`tJ$3GSpq6OM?{Bo zNg0jfycR7TqJSvy+Z5ovyMSGr;FnQp|3*oeWeK)*({OU!8$?+;GS#fDH%Fye5QIq< zV$^+lKE2tyzTa+(jK3K<8kSeyWCAYepX(B?D5n$3<9tTGHdv*;dfPNXnfS`v>(+Fl ziPz>zvl;Er;;N*5Cf%WsjzBx2A*CQcrn4FG)_@B6hsWKviOK~`H};*2J6%BIqU9pK zimep#a=<*r{;UGLxnb_2LGhx1C?E=aD8Szb4~@~cSQylw4mf=U06OT_hG)J@aE@ou zw^$g&2uzt&ph;EsilIz8`aK)xTPzHkbW-;6q3p`a-cXcY9rJrSoRn`+yeJ?FR27&v zuU$U>ciQj&)g*Zn1w?^=rGRpRLC{A@_H3;c$7ijFc7VplafLyh0%wn7{lG`@GMYAw YdHewMEfxmR1Cu`jS_W~Vz>g~M4#2UK7ytkO delta 95 zcmZoMXfc=|#>CJzu~2NHo}wrt0|NsP3otNbFyt~MG88dnGZarORA*$IypUC5@(fm< u&7vGaEE^kKnK!d@@N)olZWiSD&ODi4M3)n!`2Y|zOt#^X-W(&cgc$(tIVq-S)9oID*ffZ@7=bfKeaPyN)mXNibmkN|a|+^~gLsD$Nbj%9G;Jy0@-Agaf3eD*Kdvnn#2eq_DGpg05=c8%Vl+WJ(%K4@J-#nV7RWG2m zILoI6o4v{G9i=In$0q`!U9?IKU|V&k3Y&T#e2M-t^)$B1<;f4vzAV^sblV7f=~|o@ z(LD{*G>|US0wXl|g7uBgdX206?fM_TzAm^-8_lSVCr`)V7^pCgA@FnvIHqXEpcq(x z$ku8M=iYd7;^YazpzJk*Yz@ra?wezn!h6v7J1a#CJw}8eMlygO6l#4bu^7g0m?^ zkc}Vu>`x#w^%~Rhm61IkeG1aoz$=5P?O209l9l$duvx;Zea}rlPelEJ^QW)uh$zoO-_vA`4t_AwjzVv5l z{Bz@eBSw7+QMn8+kHNnt9filM__YXm-0)8?Jq+J^SZKfAZzX>9v}$LY;#St5bsn$V zy88nUXE--uHa75m72a~jtXn^~e17#UY5%`?HSzx{ap|%C@2y$BLgs4_;|xZu|BwIB zuF?KnT1)(i?KHl0t?jSH{SDI+IB(#S$}@jG(pj(je(RQ7w?6S+oM%)U8bO|p!4b$h zag#(m#{tjlIZ!QS#g0}6M(66oW)6MT; zc(x=t4DT++pYbdA2;Zt+<8J-<+UC2IX+!g!r(%al{z-#+{#7+FRXt<_lK7~g;ZM08&E|(f> zvl2H2?AkHYkDc+0zUOh;CVud0uz>dzUJrP6z?`uD)bH%3tNl1VaAGr#a@*FUQbgb4 zmb^boFCwCNCUb_5B(Hb8r`PWT=1e_}_m`as-W=UF*S&Nt&Qs_f{2midd+aIh+SyH4 zYSzM~zDEMLpu z8CqjJ{<^*x7 -#include -#include -#include -#include -#include -#include - - -#include -#include -#include -#include -#include - -#include -#include - -#include -#include - -// #include "bitmap.h" -#include "simple.h" - -#define MAXPAGESIZES 2 - - -// init_malloc(void) { -// // Init malloc implementation -// INITREGULARALLOC(); - -// // init_alloc(100,100000); -// // brm_init(); -// //alloc_init(104857632); -// } - -// void* MALLOC(size_t sz) { -// // malloc implementation -// return MALLOCCHERI(sz); -// // return malloc_buddy(sz); -// // return alloc(sz); -// // return (void *)alloc_chunk(); -// } - -// void FREE(void *ptr) { -// // free implementation -// FREECHERI(ptr); -// // free_chunk(ptr); -// //free_mem(ptr); -// } - - -//#define TIMING - -/* Debug printf */ -#define dprintf(...) fprintf(stdout, __VA_ARGS__) - -/* Wrapper to check for errors */ -#define CHECK_ERROR(a) \ - if (a) \ - { \ - perror("Error at line\n\t" #a "\nSystem Msg"); \ - assert ((a) == 0); \ - } - -// static inline void *MALLOC(size_t size) -// { -// void * temp = malloc(size); -// assert(temp); -// return temp; -// } - -static inline void *CALLOC(size_t num, size_t size) -{ - void * temp = calloc(num, size); - assert(temp); - return temp; -} - -static inline void *REALLOC(void *ptr, size_t size) -{ - void * temp = realloc(ptr, size); - assert(temp); - return temp; -} - -static inline char *GETENV(char *envstr) -{ - char *env = getenv(envstr); - if (!env) return "0"; - else return env; -} - -#define GET_TIME(start, end, duration) \ - duration.tv_sec = (end.tv_sec - start.tv_sec); \ - if (end.tv_nsec >= start.tv_nsec) { \ - duration.tv_nsec = (end.tv_nsec - start.tv_nsec); \ - } \ - else { \ - duration.tv_nsec = (1000000000L - (start.tv_nsec - end.tv_nsec)); \ - duration.tv_sec--; \ - } \ - if (duration.tv_nsec >= 1000000000L) { \ - duration.tv_sec++; \ - duration.tv_nsec -= 1000000000L; \ - } - -static inline unsigned int time_diff ( - struct timeval *end, struct timeval *begin) -{ -#ifdef TIMING - uint64_t result; - - result = end->tv_sec - begin->tv_sec; - result *= 1000000; /* usec */ - result += end->tv_usec - begin->tv_usec; - - return result; -#else - return 0; -#endif -} - -static inline void get_time (struct timeval *t) -{ -#ifdef TIMING - gettimeofday (t, NULL); -#endif -} - -// Expirement work - -#define FILENAME "/dev/contigmem" - -static char *heap_start; -static char *heap; -static size_t HEAP_SIZE = 1024 * 1024 * 1024; - -void *ptr; -int MallocCounter; - -size_t sizeUsed; - -// INITAlloc(void) { - -// size_t sz; -// // Pre Allocate 600 MB -// sz = 100000000; - -// int fd = open(FILENAME, O_RDWR, 0600); - -// if (fd < 0) { -// perror("open"); -// exit(EXIT_FAILURE); -// } - -// off_t offset = 0; // offset to seek to. - -// if (ftruncate(fd, sz) < 0) { -// perror("ftruncate"); -// close(fd); -// exit(EXIT_FAILURE); -// } - -// // ptr = mmap(NULL, sz, -// // PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON,-1,0); - -// ptr = mmap(NULL, sz, -// PROT_READ|PROT_WRITE, MAP_SHARED,fd,0); - -// // Added error handling -// if(ptr == MAP_FAILED) -// { -// perror("mmap"); -// exit(EXIT_FAILURE); -// } - -// MallocCounter = (int)sz; - -// } - -// Quick malloc implementation with mmap -void* my_malloc(size_t sz) -{ - sz = __builtin_align_up(sz, _Alignof(max_align_t)); - - // printf("%d \n", sz); - // printf("%d Malloc counter\n", MallocCounter); - - MallocCounter -= sz; - void *ptrLink = &ptr[MallocCounter]; - ptrLink = cheri_setbounds(ptrLink, sz); - - return ptrLink; - -// if (heap + sz > heap_start + HEAP_SIZE) return NULL; -// heap += sz; -// return heap - sz; - -} - -// Quick cheri free implementation -void my_free(void *ptr) { - - // printf("free called \n"); - - // get bounds from - int len = cheri_getlen(ptr); - - // printf("free len %d \n", len); - - munmap(ptr, len); -} - -static int -pagesizes(size_t ps[MAXPAGESIZES]) -{ - int pscnt; - - pscnt = getpagesizes(ps, MAXPAGESIZES); - // ATF_REQUIRE_MSG(pscnt != -1, "getpagesizes failed; errno=%d", errno); - // ATF_REQUIRE_MSG(ps[0] != 0, "psind 0 is %zu", ps[0]); - // ATF_REQUIRE_MSG(pscnt <= MAXPAGESIZES, "invalid pscnt %d", pscnt); - // if (pscnt == 1){ - // printf("pscnt is 1"); - // } - - // atf_tc_skip("no large page support"); - return (pscnt); -} - -INITREGULARALLOC(void) { - size_t sz; - // Pre Allocate 400 MB - sz = 1073741824; - - int error, fd, pscnt, pn; - - size_t ps[MAXPAGESIZES]; - - size_t size[3]; - - pn = getpagesizes(size, 3); - printf("page size is [%d]", size[2]); - - pscnt = pagesizes(ps); - - fd = shm_create_largepage(SHM_ANON, O_CREAT | O_RDWR, 1, SHM_LARGEPAGE_ALLOC_DEFAULT, 0); - - if (fd < 0 && errno == ENOTTY) { - perror("sh_create_largepages"); - close(fd); - exit(EXIT_FAILURE); - } - // if (fd < 0) - // perror("no large page supported"); - // exit(EXIT_FAILURE); - // if (fd < 0 && errno == ENOTTY) - // atf_tc_skip("no large page support"); - // ATF_REQUIRE_MSG(fd >= 0, "shm_create_largepage failed; errno=%d", errno); - - if (ftruncate(fd, sz) < 0) { - perror("ftruncate"); - close(fd); - exit(EXIT_FAILURE); - } - // if (error != 0 && errno == ENOMEM) - // /* - // * The test system might not have enough memory to accommodate - // * the request. - // */ - // atf_tc_skip("failed to allocate %zu-byte superpage", sz); - // ATF_REQUIRE_MSG(error == 0, "ftruncate failed; errno=%d", errno); - - ptr = mmap(NULL, sz, - PROT_READ|PROT_WRITE, MAP_SHARED,fd,0); - - // Added error handling - if(ptr == MAP_FAILED) - { - perror("mmap"); - exit(EXIT_FAILURE); - } - - MallocCounter = (int)sz; -} - - -// ------------------------------ bitmap allocator ---------------------------- - -#define BITS_PER_BYTE 8 - -char *buffer = NULL; /* allocation buffer */ -unsigned char *bitmap = NULL; /* bitmap for the buffer */ - -int buffer_size = 0; /* size of buffer (in bytes) */ -int bitmap_size = 0; /* size of bitmap (in bytes) */ -int bytes_per_chunk = 0; /* size of single chunk (in bytes) */ - -void init_alloc(int num_chunks, int chunk_size) -{ - int i = 0; - - /* we need to increase the num_chunks - * so every bit in bitmap will be used - */ - int adjusted_num_chunks = (num_chunks % BITS_PER_BYTE == 0) - ? num_chunks - : (num_chunks + (BITS_PER_BYTE - (num_chunks % BITS_PER_BYTE))); - - /* we need to increase the chunk_size - * so chunks will be CHERI aligned - * (i.e. 16 bytes for RISC-V 64-bit arch) - */ - int adjusted_chunk_size = - (chunk_size % (sizeof(void *)) == 0) - ? chunk_size - : (chunk_size + (sizeof(void *)) - (chunk_size % (sizeof(void *)))); - - /* check this chunk size is small enough so we can represent - * bounds precisely with CHERI compressed representation - */ - adjusted_chunk_size = cheri_representable_length(adjusted_chunk_size); - - /* request memory for our allocation buffer */ - char *res = mmap(NULL, adjusted_num_chunks * adjusted_chunk_size, PROT_READ | PROT_WRITE, - MAP_ANON | MAP_PRIVATE, -1, 0); - /* request memory for our bitmap */ - bitmap = (void *) mmap(NULL, adjusted_num_chunks / BITS_PER_BYTE, - PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0); - - if (res == MAP_FAILED || bitmap == MAP_FAILED) - { - perror("error in initial mem allocation"); - exit(-1); - } - - /* NB mmap min bounds for capability is 1 page (4K) */ - buffer = res; - /* check buffer is aligned */ - assert((uintptr_t) buffer % sizeof(void *) == 0); - /* check bitmap is aligned */ - assert((uintptr_t) bitmap % sizeof(void *) == 0); - - bytes_per_chunk = adjusted_chunk_size; - buffer_size = adjusted_num_chunks * adjusted_chunk_size; - bitmap_size = adjusted_num_chunks / BITS_PER_BYTE; - - /* zero bitmap, since all chunks are free initially */ - for (i = 0; i < bitmap_size; i++) - { - bitmap[i] = 0; - } - - // set exact bounds for buffer and bitmap? - buffer = cheri_setbounds(buffer, buffer_size); - bitmap = cheri_setbounds(bitmap, bitmap_size); - return; -} - -/* - * allocate fixed size chunk with bitmap allocator - * this is our simplistic `malloc` function - */ -char *alloc_chunk() -{ - unsigned char updated_byte = 0; - int chunk_index = 0; - char *chunk = NULL; - // iterate over all bits in bitmap, looking for a 0 - // when we find a 0, set it to 1 and - // return the corresponding chunk - // (setting its capability bounds) - int i = 0; - while (bitmap[i] == (unsigned char) 0xff) - { - i++; - if (i >= bitmap_size) +#include +#include +#include +#include +#include +#include + +#include // ✅ Defines vm_size_t, vm_offset_t +#include // ✅ Extra VM-related macros +#include +#include // ✅ Must be included AFTER + +#define HUGE_PAGE_SIZE (2 * 1024 * 1024) // 2MB Large Page + +static void *hugepage_ptr = NULL; + +static int load_handler(module_t mod, int event, void *arg) { + switch (event) { + case MOD_LOAD: + printf("Loading Huge Page Kernel Module...\n"); + + hugepage_ptr = kmem_alloc_contig(HUGE_PAGE_SIZE, M_WAITOK, + 0, BUS_SPACE_MAXADDR, + HUGE_PAGE_SIZE, 0, + VM_MEMATTR_DEFAULT); + + if (!hugepage_ptr) { + printf("Failed to allocate a huge page!\n"); + return ENOMEM; + } + printf("Huge page allocated at %p\n", hugepage_ptr); break; - } - // do we have a 0? - if (i < bitmap_size && bitmap[i] != (unsigned char) 0xff) - { - // find the lowest 0 ... - int j = 0; - // right shift until bottom bit is 0 - for (j = 0; j < BITS_PER_BYTE; j++) - { - int bit = (bitmap[i] >> j) & 1; - if (bit == 0) - { - break; + + case MOD_UNLOAD: + if (hugepage_ptr) { + kmem_free(hugepage_ptr, HUGE_PAGE_SIZE); + printf("Huge page freed.\n"); } - } - // now i is the word index, j is the bit index - // set this bit to 1 ... - // and work out the chunk to allocate - updated_byte = bitmap[i] + (unsigned char) (1 << j); - bitmap[i] = updated_byte; + printf("Unloading module...\n"); + break; - chunk_index = i * BITS_PER_BYTE + j; - chunk = buffer + (chunk_index * bytes_per_chunk); - - /* restrict capability range before returning ptr */ - chunk = cheri_setbounds(chunk, bytes_per_chunk); + default: + return EOPNOTSUPP; } - - return chunk; + return 0; } -void free_chunk(void *chunk) -{ - vaddr_t base = cheri_getbase(chunk); - vaddr_t buff_base = cheri_getbase(buffer); - /* calculate chunk index in buffer */ - int chunk_index = (base - buff_base) / bytes_per_chunk; - assert(chunk_index >= 0); - /* calculate corresponding bitmap index */ - int bitmap_index = chunk_index / BITS_PER_BYTE; - assert(bitmap_index < bitmap_size); - int bitmap_offset = chunk_index % BITS_PER_BYTE; - /* set this bitmap entry to 0 */ - unsigned char updated_byte = bitmap[bitmap_index] & (unsigned char) (~(1 << bitmap_offset)); - bitmap[bitmap_index] = updated_byte; - return; -} +static moduledata_t superpage_mod = { + "superpage", + load_handler, + NULL +}; -int num_used_chunks() -{ - int i = 0; - int used_chunks = 0; - - while (i < bitmap_size) - { - unsigned char x = bitmap[i]; - if (x != 0) - { - /* some used chunks here */ - unsigned char j; - for (j = 1; j <= x; j = j << 1) - { - if (x & j) - { - used_chunks++; - } - } - } - i++; - } - return used_chunks; -} - -#endif // STDDEFINES_H_ \ No newline at end of file +DECLARE_MODULE(superpage, superpage_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE); diff --git a/docs/.DS_Store b/docs/.DS_Store index 16d35d8c7dc701035ba03ea6ee5f3c137e8dc2c6..6bf58a1ce034b5ee07dcc90a0bb68f9fa00566e4 100644 GIT binary patch delta 1825 zcmd5-O=uHQ5T5)jyG^3IvB6E!76Y!eY66WH>kry$Vo?u9Bi;m?q_o8(o1eB?Jfy|q zJ-mPi4@DHklZN0y@en9fkKQUG61+?6#fyT@Cbc^+O-^1syti-Pe9X)@^UdyZY&jPI z0L$6AR2X0wj}k89skm^v4-jyb0|y6e_+r6z0vDbYfC)&$9PYC)Q_k;a!6PYB$7z$3A~Wj-^J|t)wMCnDcy)q>$j`@O~0!+d+WL$(>P-I8cMfOpNvQ5=q>R|tyqfwJCE@CguwW#kp(Ll_1pe)T#k!ul>Fb^R}fsUu*HeW17M*!Df>)j{a zaJ0L7m%cA$a9B9(IEhMo+YwB#TxYExfIahvN&hDt%^Xzfhs=olZjnx^cgBZF7GiseCX6L-}8 zRw!+2j`D(kkrYu0<=9zKepB?6Dg57(`Xu-SqZ9Z$bK(}IzqD$8!^UJS)MI?d>bQWN Ua`myBnkbAk-*Q^HruK@qKTN5>=l}o! delta 187 zcmZoEXbF&DU|?W$DortDU{C-uIe-{M3-C-V6q~3gIoZI3MH0wo-~(btpg03VDMKPd z2}34BK11Hdi)QQ-ALMRk=V0MroKE}-w%6nKhCkjY1PWBbzpR6J#x!FrZ zjB&HASQz8v84~=H3naBRUNdGDWCj@ww2vD|xPt85c=0>)WPTG}Muy2IJj#<3OxQU! XKq`P18%)kInYj76+FM4T$zqHExI!qO diff --git a/docs/EuroSys/.DS_Store b/docs/EuroSys/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..3c1ac53e324e8e2ef3069564fa2b06938c9d782a GIT binary patch literal 10244 zcmeHMTWl0n827J$DU@=Ri?rRPSmnNymTQ^a8QOu_neEPO%SB9| z2nL8IDlv-sqy{w@O++P_s6^s}FAyLq#uqg)KKNupj3)Y@bEb7WEmjRi5@(V#|C}@b z_n&jV`Ocop0suA@^aTKM0FWs$tCrJkn2Wtp1|8&reZvn_gsF+{$ zO#1+iiTk#}w|&BLD8&@J2lS!nZ!u87>3y8JlWp*ApRfWBDBys8&FJq?kk?MQIClqZ z5H`Gr41^2}Wq|G7$AJbJ$U^O){ksG6AO|*dwpdOkZ8>T3WP_`b(!AgJMNa@zsU!jG z3B3gj*heW($)<<~l{M2@K%Qc2;8DCZoep?`cy9*cMg7)jgcBGO(t|NrIRYj_XAo`x zb7BOHPPH8jV16C}V^Ti@^+@dGqnMvye{yt2vTtxb()9qQVt|7JwW^DAc!>C9oG=#C z!IqXJ{#Jy{FcIDgL{R-U=wv-gS!#t&ZLp{X`cQm?DXF;M3Se?1)6k&b23um%UH#(h+y1;*fS1Wc#J{-a*oBibUvN4OxLTcyMan%dsi(LRMs@L!Er&$kO_{x$(NA zbK~M^+0w;Fk1Fz{>iH|SbR4jOg`%ELRRNxF{tF2{?YwF}FQ>RUj#e&}bQQ8Y>v%6q=htz6W z7Ijp`?orftKi>ZkG!w@b?#8+%EP0@EB@C(HcHQ8@#x(M`|Eb4oT;#bVo8 zutr@sbn5xk$y3x=D%L8iR|%t4lT<44j6S;T)WYi*OmPz*V>oH{d3G3qQb5@GFkOGL%ul@i+k|;bg4Fxmb(y za5*M0iOskc*I_Ge!*<+`d$1F`a6cZvZaj=f@F+fp$M6Y!5}(4S@dbPZU&XWd8orMo z<0bqAFXI*b5^v&H_#@tuP?Dq)sazT(jgwTVTAC%*O7+r0(SE6apzR#!4}Xx7WQs?W z+vERmNZrGYnabw1(U$*o%zRPKMoGo^2@@yHsGd_>zhp(jfRKdr`qfsfVlLc4a_7S3 zUplBbF`S~6t)y(@;O$10TE;XiUt``?@o1$winK4Xvu0Dalyon$_tjKZsuB%1k)1cc zGOCu)U{W}CVGU)`&n#UQjj9nER^r{tRg?ub(nY?pi6XHQp`HZq(6tr?|!#2 z(tYVNTN4(EHS6djc;vc@CWs~cXSWF7lgitcW3!bM8y=;!vRp&+b&_W2HG#R7t?G*B z+A>;Uvb9Q%&EUbc8M5`Y*WCX9|2tf37%pTWWZ-UM03*p%vWZ&MzZVHMj-9o~ zDea}iF6P%KEQipIAIFpB$MKY5$MJJ0F<*aI&7T|mvOZxsoP0Q(tT@g8*Z&L%_y6Jk J|9`&!{~gJ2#m)c# literal 0 HcmV?d00001 diff --git a/docs/EuroSys/ACM-Reference-Format.bst b/docs/EuroSys/ACM-Reference-Format.bst new file mode 100644 index 0000000..c47cb4c --- /dev/null +++ b/docs/EuroSys/ACM-Reference-Format.bst @@ -0,0 +1,3081 @@ +%%% -*-BibTeX-*- +%%% ==================================================================== +%%% @BibTeX-style-file{ +%%% author = "Nelson H. F. Beebe, Boris Veytsman and Gerald Murray", +%%% version = "2.1", +%%% acmart-version = "1.90", +%%% date = "Mar 26 2023", +%%% filename = "ACM-Reference-Format.bst", +%%% email = "borisv@lk.net, boris@varphi.com", +%%% codetable = "ISO/ASCII", +%%% keywords = "ACM Transactions bibliography style; BibTeX", +%%% license = "public domain", +%%% supported = "yes", +%%% abstract = "", +%%% } +%%% ==================================================================== + +%%% Revision history: see source in git + +ENTRY + { address + advisor + archiveprefix + author + booktitle + chapter + city + date + edition + editor + eprint + eprinttype + eprintclass + howpublished + institution + journal + key + location + month + note + number + organization + pages + primaryclass + publisher + school + series + title + type + volume + year + % New keys recognized + issue % UTAH: used in, e.g., ACM SIGSAM Bulletin and ACM Communications in Computer Algebra + articleno + eid + day % UTAH: needed for newspapers, weeklies, bi-weeklies + doi % UTAH + url % UTAH + bookpages % UTAH + numpages + lastaccessed % UTAH: used only for @Misc{...} + coden % UTAH + isbn % UTAH + isbn-13 % UTAH + issn % UTAH + lccn % UTAH + distinctURL % whether to print url if doi is present + } + {} + { label.year extra.label sort.year sort.label basic.label.year} + +INTEGERS { output.state before.all mid.sentence after.sentence after.block } + +INTEGERS { show-isbn-10-and-13 } % initialized below in begin.bib + +INTEGERS { nameptr namesleft numnames } + +INTEGERS { multiresult } + +INTEGERS { len } + +INTEGERS { last.extra.num } + +STRINGS { s t t.org u } + +STRINGS { last.label next.extra } + +STRINGS { p1 p2 p3 page.count } + + +FUNCTION { not } +{ + { #0 } + { #1 } + if$ +} + +FUNCTION { and } +{ + 'skip$ + { pop$ #0 } + if$ +} + +FUNCTION { or } +{ + { pop$ #1 } + 'skip$ + if$ +} + + +FUNCTION { dump.stack.1 } +{ + duplicate$ "STACK[top] = [" swap$ * "]" * warning$ +} + +FUNCTION { dump.stack.2 } +{ + duplicate$ "STACK[top ] = [" swap$ * "]" * warning$ + swap$ + duplicate$ "STACK[top-1] = [" swap$ * "]" * warning$ + swap$ +} + +FUNCTION { empty.or.unknown } +{ + %% Examine the top stack entry, and push 1 if it is empty, or + %% consists only of whitespace, or is a string beginning with two + %% queries (??), and otherwise, push 0. + %% + %% This function provides a replacement for empty$, with the + %% convenient feature that unknown values marked by two leading + %% queries are treated the same as missing values, and thus, do not + %% appear in the output .bbl file, and yet, their presence in .bib + %% file(s) serves to mark values which are temporarily missing, but + %% are expected to be filled in eventually once more data is + %% obtained. The TeX User Group and BibNet bibliography archives + %% make extensive use of this practice. + %% + %% An empty string cannot serve the same purpose, because just as in + %% statistics data processing, an unknown value is not the same as an + %% empty value. + %% + %% At entry: stack = ... top:[string] + %% At exit: stack = ... top:[0 or 1] + + duplicate$ empty$ + { pop$ #1 } + { #1 #2 substring$ "??" = } + if$ +} + +FUNCTION { empty.or.zero } +{ + %% Examine the top entry and push 1 if it is empty, or is zero + duplicate$ empty$ + { pop$ #1 } + { "0" = } + if$ +} + + +FUNCTION { writeln } +{ + %% In BibTeX style files, the sequences + %% + %% ... "one" "two" output + %% ... "one" "two" output.xxx + %% + %% ship "one" to the output file, possibly following by punctuation, + %% leaving the stack with + %% + %% ... "two" + %% + %% There is thus a one-string lag in output processing that must be + %% carefully handled to avoid duplicating a string in the output + %% file. Unless otherwise noted, all output.xxx functions leave + %% just one new string on the stack, and that model should be born + %% in mind when reading or writing function code. + %% + %% BibTeX's asynchronous buffering of output from strings from the + %% stack is confusing because newline$ bypasses the buffer. It + %% would have been so much easier for newline to be a character + %% rather than a state of the output-in-progress. + %% + %% The documentation in btxhak.dvi is WRONG: it says + %% + %% newline$ Writes onto the bbl file what's accumulated in the + %% output buffer. It writes a blank line if and only + %% if the output buffer is empty. Since write$ does + %% reasonable line breaking, you should use this + %% function only when you want a blank line or an + %% explicit line break. + %% + %% write$ Pops the top (string) literal and writes it on the + %% output buffer (which will result in stuff being + %% written onto the bbl file when the buffer fills + %% up). + %% + %% Examination of the BibTeX source code shows that write$ does + %% indeed behave as claimed, but newline$ sends a newline character + %% directly to the output file, leaving the stack unchanged. The + %% first line "Writes onto ... buffer." is therefore wrong. + %% + %% The original BibTeX style files almost always use "write$ newline$" + %% in that order, so it makes sense to hide that pair in a private + %% function like this one, named after a statement in Pascal, + %% the programming language embedded in the BibTeX Web program. + + write$ % output top-of-stack string + newline$ % immediate write of newline (not via stack) +} + +FUNCTION { init.state.consts } +{ + #0 'before.all := + #1 'mid.sentence := + #2 'after.sentence := + #3 'after.block := +} + +FUNCTION { output.nonnull } +{ % Stack in: ... R S T Stack out: ... R T File out: S + 's := + output.state mid.sentence = + { + ", " * write$ + } + { + output.state after.block = + { + add.period$ writeln + "\newblock " write$ + } + { + output.state before.all = + { + write$ + } + { + add.period$ " " * write$ + } + if$ + } + if$ + mid.sentence 'output.state := + } + if$ + s +} + +FUNCTION { output.nonnull.dot.space } +{ % Stack in: ... R S T Stack out: ... R T File out: S + 's := + output.state mid.sentence = % { ". " * write$ } + { + ". " * write$ + } + { + output.state after.block = + { + add.period$ writeln "\newblock " write$ + } + { + output.state before.all = + { + write$ + } + { + add.period$ " " * write$ + } + if$ + } + if$ + mid.sentence 'output.state := + } + if$ + s +} + +FUNCTION { output.nonnull.remove } +{ % Stack in: ... R S T Stack out: ... R T File out: S + 's := + output.state mid.sentence = + { + " " * write$ + } + { + output.state after.block = + { + add.period$ writeln "\newblock " write$ + } + { + output.state before.all = + { + write$ + } + { + add.period$ " " * write$ + } + if$ + } + if$ + mid.sentence 'output.state := + } + if$ + s +} + +FUNCTION { output.nonnull.removenospace } +{ % Stack in: ... R S T Stack out: ... R T File out: S + 's := + output.state mid.sentence = + { + "" * write$ + } + { + output.state after.block = + { + add.period$ writeln "\newblock " write$ + } + { + output.state before.all = + { + write$ + } + { + add.period$ " " * write$ + } + if$ + } + if$ + mid.sentence 'output.state := + } + if$ + s +} + +FUNCTION { output } +{ % discard top token if empty, else like output.nonnull + duplicate$ empty.or.unknown + 'pop$ + 'output.nonnull + if$ +} + +FUNCTION { output.dot.space } +{ % discard top token if empty, else like output.nonnull.dot.space + duplicate$ empty.or.unknown + 'pop$ + 'output.nonnull.dot.space + if$ +} + +FUNCTION { output.removenospace } +{ % discard top token if empty, else like output.nonnull.removenospace + duplicate$ empty.or.unknown + 'pop$ + 'output.nonnull.removenospace + if$ +} + +FUNCTION { output.check } +{ % like output, but warn if key name on top-of-stack is not set + 't := + duplicate$ empty.or.unknown + { pop$ "empty " t * " in " * cite$ * warning$ } + 'output.nonnull + if$ +} + +FUNCTION { bibinfo.output.check } +{ % like output.check, adding bibinfo field + 't := + duplicate$ empty.or.unknown + { pop$ "empty " t * " in " * cite$ * warning$ } + { "\bibinfo{" t "}{" * * swap$ * "}" * + output.nonnull } + if$ +} + +FUNCTION { output.check.dot.space } +{ % like output.dot.space, but warn if key name on top-of-stack is not set + 't := + duplicate$ empty.or.unknown + { pop$ "empty " t * " in " * cite$ * warning$ } + 'output.nonnull.dot.space + if$ +} + +FUNCTION { fin.block } +{ % functionally, but not logically, identical to fin.entry + add.period$ + writeln +} + +FUNCTION { fin.entry } +{ + add.period$ + writeln +} + +FUNCTION { new.sentence } +{ % update sentence state, with neither output nor stack change + output.state after.block = + 'skip$ + { + output.state before.all = + 'skip$ + { after.sentence 'output.state := } + if$ + } + if$ +} + +FUNCTION { fin.sentence } +{ + add.period$ + write$ + new.sentence + "" +} + +FUNCTION { new.block } +{ + output.state before.all = + 'skip$ + { after.block 'output.state := } + if$ +} + +FUNCTION { output.coden } % UTAH +{ % output non-empty CODEN as one-line sentence (stack untouched) + coden empty.or.unknown + { } + { "\showCODEN{" coden * "}" * writeln } + if$ +} + +% +% Sometimes articleno starts with the word 'Article' or 'Paper. +% (this is a bug of acmdl, sigh) +% We strip them. We assume eid or articleno is already on stack +% + +FUNCTION { strip.articleno.or.eid } +{ + 't := + t #1 #7 substring$ "Article" = + {t #8 t text.length$ substring$ 't :=} + { } + if$ + t #1 #7 substring$ "article" = + {t #8 t text.length$ substring$ 't :=} + { } + if$ + t #1 #5 substring$ "Paper" = + {t #6 t text.length$ substring$ 't :=} + { } + if$ + t #1 #5 substring$ "paper" = + {t #6 t text.length$ substring$ 't :=} + { } + if$ + % Strip any left trailing space or ~ + t #1 #1 substring$ " " = + {t #2 t text.length$ substring$ 't :=} + { } + if$ + t #1 #1 substring$ "~" = + {t #2 t text.length$ substring$ 't :=} + { } + if$ + t +} + + +FUNCTION { format.articleno } +{ + articleno empty.or.unknown not eid empty.or.unknown not and + { "Both articleno and eid are defined for " cite$ * warning$ } + 'skip$ + if$ + articleno empty.or.unknown eid empty.or.unknown and + { "" } + { + numpages empty.or.unknown + { "articleno or eid field, but no numpages field, in " + cite$ * warning$ } + { } + if$ + eid empty.or.unknown + { "Article \bibinfo{articleno}{" articleno strip.articleno.or.eid * "}" * } + { "Article \bibinfo{articleno}{" eid strip.articleno.or.eid * "}" * } + if$ + } + if$ +} + +FUNCTION { format.year } +{ % push year string or "[n.\,d.]" onto output stack + %% Because year is a mandatory field, we always force SOMETHING + %% to be output + "\bibinfo{year}{" + year empty.or.unknown + { "[n.\,d.]" } + { year } + if$ + * "}" * +} + +FUNCTION { format.day.month } +{ % push "day month " or "month " or "" onto output stack + day empty.or.unknown + { + month empty.or.unknown + { "" } + { "\bibinfo{date}{" month * "} " *} + if$ + } + { + month empty.or.unknown + { "" } + { "\bibinfo{date}{" day * " " * month * "} " *} + if$ + } + if$ +} + +FUNCTION { format.day.month.year } % UTAH +{ % if month is empty, push "" else push "(MON.)" or "(DD MON.)" + % Needed for frequent periodicals: 2008. ... New York Times C-1, C-2, C-17 (23 Oct.) + % acm-*.bst addition: prefix parenthesized date string with + % ", Article nnn " + articleno empty.or.unknown eid empty.or.unknown and + { "" } + { output.state after.block = + {", " format.articleno * } + { format.articleno } + if$ + } + if$ + " (" * format.day.month * format.year * ")" * +} + +FUNCTION { output.day.month.year } % UTAH +{ % if month is empty value, do nothing; else output stack top and + % leave with new top string "(MON.)" or "(DD MON.)" + % Needed for frequent periodicals: 2008. ... New York Times C-1, C-2, C-17 (23 Oct.) + format.day.month.year + output.nonnull.remove +} + +FUNCTION { strip.doi } % UTAH +{ % Strip any Web address prefix to recover the bare DOI, leaving the + % result on the output stack, as recommended by CrossRef DOI + % documentation. + % For example, reduce "http://doi.acm.org/10.1145/1534530.1534545" to + % "10.1145/1534530.1534545". A suitable URL is later typeset and + % displayed as the LAST item in the reference list entry. Publisher Web + % sites wrap this with a suitable link to a real URL to resolve the DOI, + % and the master https://doi.org/ address is preferred, since publisher- + % specific URLs can disappear in response to economic events. All + % journals are encouraged by the DOI authorities to use that typeset + % format and link procedures for uniformity across all publications that + % include DOIs in reference lists. + % The numeric prefix is guaranteed to start with "10.", so we use + % that as a test. + % 2017-02-04 Added stripping of https:// (Boris) + doi #1 #3 substring$ "10." = + { doi } + { + doi 't := % get modifiable copy of DOI + + % Change https:// to http:// to strip both prefixes (BV) + + t #1 #8 substring$ "https://" = + { "http://" t #9 t text.length$ #8 - substring$ * 't := } + { } + if$ + + t #1 #7 substring$ "http://" = + { + t #8 t text.length$ #7 - substring$ 't := + + "INTERNAL STYLE-FILE ERROR" 's := + + % search for next "/" and assign its suffix to s + + { t text.length$ } + { + t #1 #1 substring$ "/" = + { + % save rest of string as true DOI (should be 10.xxxx/yyyy) + t #2 t text.length$ #1 - substring$ 's := + "" 't := % empty string t terminates the loop + } + { + % discard first character and continue loop: t <= substring(t,2,last) + t #2 t text.length$ #1 - substring$ 't := + } + if$ + } + while$ + + % check for valid DOI (should be 10.xxxx/yyyy) + s #1 #3 substring$ "10." = + { } + { "unrecognized DOI substring " s * " in DOI value [" * doi * "]" * warning$ } + if$ + + s % push the stripped DOI on the output stack + + } + { + "unrecognized DOI value [" doi * "]" * warning$ + doi % push the unrecognized original DOI on the output stack + } + if$ + } + if$ +} + +% +% Change by BV: added standard prefix to URL +% +FUNCTION { output.doi } % UTAH +{ % output non-empty DOI as one-line sentence (stack untouched) + doi empty.or.unknown + { } + { + %% Use \urldef here for the same reason it is used in output.url, + %% see output.url for further discussion. + "\urldef\tempurl%" writeln + "\url{https://doi.org/" strip.doi * "}" * writeln + "\showDOI{\tempurl}" writeln + } + if$ +} + +FUNCTION { output.isbn } % UTAH +{ % output non-empty ISBN-10 and/or ISBN-13 as one-line sentences (stack untouched) + show-isbn-10-and-13 + { + %% show both 10- and 13-digit ISBNs + isbn empty.or.unknown + { } + { + "\showISBNx{" isbn * "}" * writeln + } + if$ + isbn-13 empty.or.unknown + { } + { + "\showISBNxiii{" isbn-13 * "}" * writeln + } + if$ + } + { + %% show 10-digit ISBNs only if 13-digit ISBNs not available + isbn-13 empty.or.unknown + { + isbn empty.or.unknown + { } + { + "\showISBNx{" isbn * "}" * writeln + } + if$ + } + { + "\showISBNxiii{" isbn-13 * "}" * writeln + } + if$ + } + if$ +} + +FUNCTION { output.issn } % UTAH +{ % output non-empty ISSN as one-line sentence (stack untouched) + issn empty.or.unknown + { } + { "\showISSN{" issn * "}" * writeln } + if$ +} + +FUNCTION { output.issue } +{ % output non-empty issue number as a one-line sentence (stack untouched) + issue empty.or.unknown + { } + { "Issue " issue * "." * writeln } + if$ +} + +FUNCTION { output.lccn } % UTAH +{ % return with stack untouched + lccn empty.or.unknown + { } + { "\showLCCN{" lccn * "}" * writeln } + if$ +} + +FUNCTION { output.note } % UTAH +{ % return with stack empty + note empty.or.unknown + { } + { "\shownote{" note * "}" add.period$ * writeln } + if$ +} + +FUNCTION { output.note.check } % UTAH +{ % return with stack empty + note empty.or.unknown + { "empty note in " cite$ * warning$ } + { "\shownote{" note * "}" add.period$ * writeln } + if$ +} + +FUNCTION { output.eprint } % +{ % return with stack empty + eprint empty.or.unknown + { } + { "\showeprint" + archiveprefix empty.or.unknown + { eprinttype empty.or.unknown + { } + { "[" eprinttype "]" * * * } + if$ + } + { "[" archiveprefix "l" change.case$ "]" * * * } + if$ + "{" eprint "}" * * * + primaryclass empty.or.unknown + { eprintclass empty.or.unknown + { } + { "~[" eprintclass "]" * * * } + if$ + } + { "~[" primaryclass "]" * * * } + if$ + writeln + } + if$ +} + + +% +% Changes by BV 2011/04/15. Do not output +% url if doi is defined +% +% +% Changes by BV 2021/11/26. Output url even if doi is defined +% if distinctURL is not zero. +% +FUNCTION { output.url } % UTAH +{ % return with stack untouched + % output URL and associated lastaccessed fields + doi empty.or.unknown distinctURL empty.or.zero not or + { + url empty.or.unknown + { } + { + %% Use \urldef, outside \showURL, so that %nn, #, etc in URLs work + %% correctly. Put the actual URL on its own line to reduce the + %% likelihood of BibTeX's nasty line wrapping after column 79. + %% \url{} can undo this, but if that doesn't work for some reason + %% the .bbl file would have to be repaired manually. + "\urldef\tempurl%" writeln + "\url{" url * "}" * writeln + + "\showURL{%" writeln + lastaccessed empty.or.unknown + { "" } + { "Retrieved " lastaccessed * " from " * } + if$ + "\tempurl}" * writeln + } + if$ + } + { } + if$ +} + +FUNCTION { output.year.check } +{ % warn if year empty, output top string and leave " YEAR