Add ARM support. (#85)
parent
1d001802f7
commit
1ec76bd410
|
@ -55,22 +55,8 @@ func init() {
|
||||||
// Reset resets m so that it's ready to be used again. Afterward, the contents
|
// Reset resets m so that it's ready to be used again. Afterward, the contents
|
||||||
// are solely a zeroed fusekernel.OutHeader struct.
|
// are solely a zeroed fusekernel.OutHeader struct.
|
||||||
func (m *OutMessage) Reset() {
|
func (m *OutMessage) Reset() {
|
||||||
// Ideally we'd like to write:
|
m.payloadOffset = 0
|
||||||
//
|
m.header = fusekernel.OutHeader{}
|
||||||
// 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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// OutHeader returns a pointer to the header at the start of the message.
|
// OutHeader returns a pointer to the header at the start of the message.
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
// +build amd64 arm64 ppc64 ppc64le
|
// +build amd64 arm64 ppc64 ppc64le arm
|
||||||
// +build go1.8
|
// +build go1.8
|
||||||
|
|
||||||
// Assembly code isn't subject to visibility restrictions, so we can jump
|
// Assembly code isn't subject to visibility restrictions, so we can jump
|
||||||
|
@ -23,6 +23,9 @@
|
||||||
|
|
||||||
#include "textflag.h"
|
#include "textflag.h"
|
||||||
|
|
||||||
|
#ifdef GOARCH_arm
|
||||||
|
#define JMP B
|
||||||
|
#endif
|
||||||
#ifdef GOARCH_ppc64
|
#ifdef GOARCH_ppc64
|
||||||
#define JMP BR
|
#define JMP BR
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
// +build amd64 arm64 ppc64 ppc64le
|
// +build amd64 arm64 ppc64 ppc64le arm
|
||||||
// +build !go1.8
|
// +build !go1.8
|
||||||
|
|
||||||
// Assembly code isn't subject to visibility restrictions, so we can jump
|
// Assembly code isn't subject to visibility restrictions, so we can jump
|
||||||
|
@ -23,6 +23,9 @@
|
||||||
|
|
||||||
#include "textflag.h"
|
#include "textflag.h"
|
||||||
|
|
||||||
|
#ifdef GOARCH_arm
|
||||||
|
#define JMP B
|
||||||
|
#endif
|
||||||
#ifdef GOARCH_ppc64
|
#ifdef GOARCH_ppc64
|
||||||
#define JMP BR
|
#define JMP BR
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue