Add ARM support. (#85)

geesefs-0-30-9
Brendan McMillion 2020-06-25 22:45:43 -07:00 committed by GitHub
parent 1d001802f7
commit 1ec76bd410
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 18 deletions

View File

@ -55,22 +55,8 @@ func init() {
// Reset resets m so that it's ready to be used again. Afterward, the contents
// are solely a zeroed fusekernel.OutHeader struct.
func (m *OutMessage) Reset() {
// Ideally we'd like to write:
//
// m.payloadOffset = 0
// m.header = fusekernel.OutHeader{}
//
// But Go 1.8 beta 2 generates bad code for this
// (https://golang.org/issue/18370). Encourage it to generate the same code
// as Go 1.7.4 did.
if unsafe.Offsetof(m.payload) != 24 {
panic("unexpected OutMessage layout")
}
a := (*[3]uint64)(unsafe.Pointer(m))
a[0] = 0
a[1] = 0
a[2] = 0
m.payloadOffset = 0
m.header = fusekernel.OutHeader{}
}
// OutHeader returns a pointer to the header at the start of the message.

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
// +build amd64 arm64 ppc64 ppc64le
// +build amd64 arm64 ppc64 ppc64le arm
// +build go1.8
// Assembly code isn't subject to visibility restrictions, so we can jump
@ -23,6 +23,9 @@
#include "textflag.h"
#ifdef GOARCH_arm
#define JMP B
#endif
#ifdef GOARCH_ppc64
#define JMP BR
#endif

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
// +build amd64 arm64 ppc64 ppc64le
// +build amd64 arm64 ppc64 ppc64le arm
// +build !go1.8
// Assembly code isn't subject to visibility restrictions, so we can jump
@ -23,6 +23,9 @@
#include "textflag.h"
#ifdef GOARCH_arm
#define JMP B
#endif
#ifdef GOARCH_ppc64
#define JMP BR
#endif