x86_64.c 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /* tripl/arch/x86_64/do_keyword.c
  2. *
  3. * This file is part of tripl.
  4. *
  5. * tripl is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * tripl is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with tripl. If not, see <https://www.gnu.org/licenses/>
  17. */
  18. /* gas x86_64 assembly, to stdout */
  19. #include <stdio.h>
  20. #include <klist.h>
  21. #include <tripl/tripl.h>
  22. #include <tripl/limits.h>
  23. #include <tripl/arch.h>
  24. int x86_64_init(void);
  25. int x86_64_fin(void);
  26. int x86_64_new_var(char *name, long value, int attr);
  27. struct arch x86_64_arch_fn = {
  28. .arch_init = x86_64_init,
  29. .arch_fin = x86_64_fin,
  30. .arch_new_var = x86_64_new_var,
  31. .arch_stack_dump = NULL,
  32. .arch_import_shared = NULL,
  33. .arch_funcall = NULL,
  34. .arch_set_var = NULL
  35. };
  36. extern int x86_64_init_asm(void);
  37. extern int x86_64_asm_fin(void);
  38. __arch int x86_64_init(void) {
  39. klist_init(&stack);
  40. return x86_64_init_asm();
  41. }
  42. __arch int x86_64_fin(void) {
  43. x86_64_asm_fin();
  44. return 0;
  45. }