Skip to content

Commit

Permalink
runtime/cgo: consolidate freebsd cgo code
Browse files Browse the repository at this point in the history
Most freebsd architectures now use the same code, deduplicate accordingly.

The arm code differs slightly in that it has a compile time check for
ARM_TP_ADDRESS, however this is written in a way that it can be included
for all architectures.

Change-Id: I7f6032b63521d24d0c3b5e0e08d57e32b4f9ddc4
Reviewed-on: https://go-review.googlesource.com/c/go/+/518619
Reviewed-by: Ian Lance Taylor <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
Run-TryBot: Joel Sing <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
  • Loading branch information
4a6f656c committed Aug 15, 2023
1 parent a91931d commit 60506f4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 186 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
// Copyright 2012 The Go Authors. All rights reserved.
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build freebsd && (386 || arm || arm64 || riscv64)

#include <sys/types.h>
#include <machine/sysarch.h>
#include <sys/signalvar.h>
#include <machine/sysarch.h>
#include <pthread.h>
#include <signal.h>
#include <string.h>
Expand All @@ -20,8 +22,7 @@
#endif
#endif

static void *threadentry(void*);

static void* threadentry(void*);
static void (*setg_gcc)(void*);

void
Expand Down Expand Up @@ -65,6 +66,6 @@ threadentry(void *v)
ts = *(ThreadStart*)v;
free(v);

crosscall1(ts.fn, setg_gcc, (void*)ts.g);
crosscall1(ts.fn, setg_gcc, ts.g);
return nil;
}
60 changes: 0 additions & 60 deletions src/runtime/cgo/gcc_freebsd_386.c

This file was deleted.

61 changes: 0 additions & 61 deletions src/runtime/cgo/gcc_freebsd_arm64.c

This file was deleted.

60 changes: 0 additions & 60 deletions src/runtime/cgo/gcc_freebsd_riscv64.c

This file was deleted.

0 comments on commit 60506f4

Please sign in to comment.