diff options
author | Tom McLaughlin <tmclaugh@FreeBSD.org> | 2005-11-10 04:17:26 +0000 |
---|---|---|
committer | Tom McLaughlin <tmclaugh@FreeBSD.org> | 2005-11-10 04:17:26 +0000 |
commit | 29b08baecb50149c66c848ccf531e3152a509696 (patch) | |
tree | 0b0e9e712bd6afb44d9606c1e3991db9aabba0f3 /lang/mono/files/patch-mono_mini_mini-amd64.c | |
parent | - Use gawk instead of awk. This fixes a problem sending email notifications. (diff) |
(Long awaited) update to 1.1.9.2
Mono Changes:
- Series release: http://www.go-mono.com/archive/1.1.9/
- Patch release: http://www.go-mono.com/archive/1.1.9.1_0/
(No 1.1.9.2 release announcement.)
Port Changes:
- Add pkg-message to explain reasons for common build failures and
note the need to possibly increase the number of semaphores from
the default FreeBSD amounts.
- Add preliminary amd64 support [1,2] which has been disabled for
the time being due to lingering stability issues.
- Force the Mono build to only write within ${WRKDIR} and no longer
write to ~/.wapi which leads to...
- Add bsd.mono.mk which is a common makefile all Mono consumers will
depend on. Currently this file sets the location of the .wapi the
build process will write to. Since Mono does not cleanup the
semaphore created for a .wapi when the last Mono process exits
this file also handles the removal of the semaphore created during
port building so we do not exhaust the machine's semaphore limit.
Submitted by: Jean-Michel "tuo" Herve <jm.herve@gameproduction.org> [1]
Joe Lewis <joe@joe-lewis.com> [1]
Lou Kamenov on BSD# mailinglist [2]
Approved by: ahze (mentor)
Project by: BSD# <http://www.mono-project.com/Mono:FreeBSD>
Notes
Notes:
svn path=/head/; revision=147784
Diffstat (limited to 'lang/mono/files/patch-mono_mini_mini-amd64.c')
-rw-r--r-- | lang/mono/files/patch-mono_mini_mini-amd64.c | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/lang/mono/files/patch-mono_mini_mini-amd64.c b/lang/mono/files/patch-mono_mini_mini-amd64.c new file mode 100644 index 000000000000..da728145b023 --- /dev/null +++ b/lang/mono/files/patch-mono_mini_mini-amd64.c @@ -0,0 +1,107 @@ +--- mono/mini/mini-amd64.c.orig Tue Aug 2 17:52:50 2005 ++++ mono/mini/mini-amd64.c Tue Aug 2 17:53:27 2005 +@@ -15,6 +15,9 @@ + #include <math.h> + #include <unistd.h> + #include <sys/mman.h> ++#include <sys/ucontext.h> ++ ++#include <pthread_np.h> + + #include <mono/metadata/appdomain.h> + #include <mono/metadata/debug-helpers.h> +@@ -55,6 +58,10 @@ + #define ARGS_OFFSET 16 + #define GP_SCRATCH_REG AMD64_R11 + ++#ifndef MAP_ANONYMOUS ++#define MAP_ANONYMOUS MAP_ANON ++#endif ++ + /* + * AMD64 register usage: + * - callee saved registers are used for global register allocation +@@ -5683,6 +5690,7 @@ + + #define IS_REX(inst) (((inst) >= 0x40) && ((inst) <= 0x4f)) + ++ + static int reg_to_ucontext_reg [] = { + REG_RAX, REG_RCX, REG_RDX, REG_RBX, REG_RSP, REG_RBP, REG_RSI, REG_RDI, + REG_R8, REG_R9, REG_R10, REG_R11, REG_R12, REG_R13, REG_R14, REG_R15, +@@ -5694,27 +5702,37 @@ + * integer overflow. + */ + gboolean +-mono_arch_is_int_overflow (void *sigctx, void *info) ++mono_arch_is_int_overflow (void *sigctx, void *info) + { +- ucontext_t *ctx = (ucontext_t*)sigctx; +- guint8* rip; +- int reg; +- +- rip = (guint8*)ctx->uc_mcontext.gregs [REG_RIP]; ++ ucontext_t *ctx = (ucontext_t*)sigctx; ++ guint8* rip; ++ int reg; ++ ++#if defined(__FreeBSD__) ++ __register_t *gregs = (__register_t *) &ctx->uc_mcontext; ++ rip = (guint8*) gregs[REG_RIP]; ++#else ++ rip = (guint8*) ctx->uc_mcontext.gregs [REG_RIP]; ++#endif + +- if (IS_REX (rip [0])) { +- reg = amd64_rex_b (rip [0]); +- rip ++; ++ if (IS_REX (rip [0])) { ++ reg = amd64_rex_b (rip [0]); ++ rip ++; + } + else +- reg = 0; ++ reg = 0; + +- if ((rip [0] == 0xf7) && (x86_modrm_mod (rip [1]) == 0x3) && (x86_modrm_reg (rip [1]) == 0x7)) { +- /* idiv REG */ +- reg += x86_modrm_rm (rip [1]); ++ if ((rip [0] == 0xf7) && (x86_modrm_mod (rip [1]) == 0x3) && (x86_modrm_reg (rip [1]) == 0x7)) { ++ /* idiv REG */ ++ reg += x86_modrm_rm (rip [1]); + +- if (ctx->uc_mcontext.gregs [reg_to_ucontext_reg [reg]] == -1) ++#if defined(__FreeBSD__) ++ if (gregs[reg_to_ucontext_reg[reg]] == -1) + return TRUE; ++#else ++ if (ctx->uc_mcontext.gregs [reg_to_ucontext_reg [reg]] == -1) ++ return TRUE; ++#endif + } + + return FALSE; +@@ -5888,10 +5906,10 @@ + #ifdef HAVE_PTHREAD_GETATTR_NP + pthread_getattr_np( self, &attr ); + #else ++ pthread_attr_init( &attr ); + #ifdef HAVE_PTHREAD_ATTR_GET_NP + pthread_attr_get_np( self, &attr ); + #elif defined(sun) +- pthread_attr_init( &attr ); + pthread_attr_getstacksize( &attr, &stsize ); + #else + #error "Not implemented" +@@ -5925,6 +5943,11 @@ + sa.ss_size = SIGNAL_STACK_SIZE; + sa.ss_flags = SS_ONSTACK; + sigaltstack (&sa, NULL); ++ ++#if !defined(HAVE_PTHREAD_GETATTR_NP) ++ pthread_attr_destroy(&attr); ++#endif ++ + } + + #endif |