Merge m-c to m-i

This commit is contained in:
Phil Ringnalda 2012-11-12 21:08:17 -08:00
commit 45529e865f
107 changed files with 1288 additions and 4526 deletions

View File

@ -301,6 +301,10 @@ var Output = {
} }
}, },
Haptic: function Haptic(aDetails, aBrowser) {
this.chromeWin.navigator.vibrate(aDetails.pattern);
},
_adjustBounds: function(aJsonBounds, aBrowser) { _adjustBounds: function(aJsonBounds, aBrowser) {
let bounds = new Rect(aJsonBounds.left, aJsonBounds.top, let bounds = new Rect(aJsonBounds.left, aJsonBounds.top,
aJsonBounds.right - aJsonBounds.left, aJsonBounds.right - aJsonBounds.left,

View File

@ -26,6 +26,7 @@ this.EventManager = {
if (Utils.MozBuildApp == 'b2g') { if (Utils.MozBuildApp == 'b2g') {
this.presenters.push(new SpeechPresenter()); this.presenters.push(new SpeechPresenter());
this.presenters.push(new HapticPresenter());
} else if (Utils.MozBuildApp == 'mobile/android') { } else if (Utils.MozBuildApp == 'mobile/android') {
this.presenters.push(new AndroidPresenter()); this.presenters.push(new AndroidPresenter());
} }

View File

@ -17,6 +17,7 @@ this.EXPORTED_SYMBOLS = ['VisualPresenter',
'AndroidPresenter', 'AndroidPresenter',
'DummyAndroidPresenter', 'DummyAndroidPresenter',
'SpeechPresenter', 'SpeechPresenter',
'HapticPresenter',
'PresenterContext']; 'PresenterContext'];
/** /**
@ -111,7 +112,7 @@ Presenter.prototype = {
* Visual presenter. Draws a box around the virtual cursor's position. * Visual presenter. Draws a box around the virtual cursor's position.
*/ */
this.VisualPresenter = function VisualPresenter() {} this.VisualPresenter = function VisualPresenter() {};
VisualPresenter.prototype = { VisualPresenter.prototype = {
__proto__: Presenter.prototype, __proto__: Presenter.prototype,
@ -179,7 +180,7 @@ VisualPresenter.prototype = {
* Android presenter. Fires Android a11y events. * Android presenter. Fires Android a11y events.
*/ */
this.AndroidPresenter = function AndroidPresenter() {} this.AndroidPresenter = function AndroidPresenter() {};
AndroidPresenter.prototype = { AndroidPresenter.prototype = {
__proto__: Presenter.prototype, __proto__: Presenter.prototype,
@ -332,7 +333,7 @@ AndroidPresenter.prototype = {
* A speech presenter for direct TTS output * A speech presenter for direct TTS output
*/ */
this.SpeechPresenter = function SpeechPresenter() {} this.SpeechPresenter = function SpeechPresenter() {};
SpeechPresenter.prototype = { SpeechPresenter.prototype = {
__proto__: Presenter.prototype, __proto__: Presenter.prototype,
@ -372,6 +373,24 @@ SpeechPresenter.prototype = {
} }
}; };
/**
* A haptic presenter
*/
this.HapticPresenter = function HapticPresenter() {};
HapticPresenter.prototype = {
__proto__: Presenter.prototype,
type: 'Haptic',
PIVOT_CHANGE_PATTHERN: [20],
pivotChanged: function HapticPresenter_pivotChanged(aContext, aReason) {
return { type: this.type, details: { pattern: this.PIVOT_CHANGE_PATTHERN } };
}
};
/** /**
* PresenterContext: An object that generates and caches context information * PresenterContext: An object that generates and caches context information
* for a given accessible and its relationship with another accessible. * for a given accessible and its relationship with another accessible.

View File

@ -207,8 +207,8 @@ this.TouchAdapter = {
* of one single touch. * of one single touch.
*/ */
function TouchPoint(aTouch, aTime, aDPI) { function TouchPoint(aTouch, aTime, aDPI) {
this.startX = aTouch.screenX; this.startX = this.x = aTouch.screenX;
this.startY = aTouch.screenY; this.startY = this.y = aTouch.screenY;
this.startTime = aTime; this.startTime = aTime;
this.distanceTraveled = 0; this.distanceTraveled = 0;
this.dpi = aDPI; this.dpi = aDPI;
@ -223,8 +223,7 @@ TouchPoint.prototype = {
this.y = aTouch.screenY; this.y = aTouch.screenY;
this.time = aTime; this.time = aTime;
if (lastX != undefined && lastY != undefined) this.distanceTraveled += this.getDistanceToCoord(lastX, lastY);
this.distanceTraveled += this.getDistanceToCoord(lastX, lastY);
}, },
getDistanceToCoord: function TouchPoint_getDistanceToCoord(aX, aY) { getDistanceToCoord: function TouchPoint_getDistanceToCoord(aX, aY) {

View File

@ -247,6 +247,15 @@ this.UtteranceGenerator = {
utterance.push(name); utterance.push(name);
return utterance; return utterance;
},
application: function application(aAccessible, aRoleStr, aStates, aFlags) {
// Don't utter location of applications, it gets tiring.
if (aAccessible.name != aAccessible.DOMNode.location)
return this.objectUtteranceFunctions.defaultFunc(
aAccessible, aRoleStr, aStates, aFlags);
return [];
} }
}, },

View File

@ -24,6 +24,7 @@ XPCOMUtils.defineLazyGetter(this, "domWindowUtils", function () {
}); });
const FOCUS_CHANGE_DELAY = 20; const FOCUS_CHANGE_DELAY = 20;
const RESIZE_SCROLL_DELAY = 20;
let HTMLInputElement = Ci.nsIDOMHTMLInputElement; let HTMLInputElement = Ci.nsIDOMHTMLInputElement;
let HTMLTextAreaElement = Ci.nsIDOMHTMLTextAreaElement; let HTMLTextAreaElement = Ci.nsIDOMHTMLTextAreaElement;
@ -50,7 +51,8 @@ let FormAssistant = {
isKeyboardOpened: false, isKeyboardOpened: false,
selectionStart: 0, selectionStart: 0,
selectionEnd: 0, selectionEnd: 0,
blurTimeout: null,
scrollIntoViewTimeout: null,
_focusedElement: null, _focusedElement: null,
get focusedElement() { get focusedElement() {
@ -133,8 +135,20 @@ let FormAssistant = {
if (!this.isKeyboardOpened) if (!this.isKeyboardOpened)
return; return;
if (this.scrollIntoViewTimeout) {
content.clearTimeout(this.scrollIntoViewTimeout);
this.scrollIntoViewTimeout = null;
}
// We may receive multiple resize events in quick succession, so wait
// a bit before scrolling the input element into view.
if (this.focusedElement) { if (this.focusedElement) {
this.focusedElement.scrollIntoView(false); this.scrollIntoViewTimeout = content.setTimeout(function () {
this.scrollIntoViewTimeout = null;
if (this.focusedElement) {
this.focusedElement.scrollIntoView(false);
}
}.bind(this), RESIZE_SCROLL_DELAY);
} }
break; break;
} }

View File

@ -22,6 +22,10 @@ Cu.import('resource://gre/modules/Keyboard.jsm');
Cu.import('resource://gre/modules/NetworkStatsService.jsm'); Cu.import('resource://gre/modules/NetworkStatsService.jsm');
#endif #endif
// identity
Cu.import('resource://gre/modules/SignInToWebsite.jsm');
SignInToWebsiteController.init();
XPCOMUtils.defineLazyServiceGetter(Services, 'env', XPCOMUtils.defineLazyServiceGetter(Services, 'env',
'@mozilla.org/process/environment;1', '@mozilla.org/process/environment;1',
'nsIEnvironment'); 'nsIEnvironment');

View File

@ -22,6 +22,7 @@ chrome.jar:
content/touchcontrols.css (content/touchcontrols.css) content/touchcontrols.css (content/touchcontrols.css)
content/payment.js (content/payment.js) content/payment.js (content/payment.js)
content/identity.js (content/identity.js)
% override chrome://global/content/netError.xhtml chrome://browser/content/netError.xhtml % override chrome://global/content/netError.xhtml chrome://browser/content/netError.xhtml
% override chrome://global/skin/netError.css chrome://browser/content/netError.css % override chrome://global/skin/netError.css chrome://browser/content/netError.css

View File

@ -36,6 +36,7 @@ EXTRA_PP_COMPONENTS = \
EXTRA_JS_MODULES = \ EXTRA_JS_MODULES = \
Keyboard.jsm \ Keyboard.jsm \
TelURIParser.jsm \ TelURIParser.jsm \
SignInToWebsite.jsm \
$(NULL) $(NULL)
TEST_DIRS = \ TEST_DIRS = \

View File

@ -20,7 +20,10 @@ let SocialUI = {
gBrowser.addEventListener("ActivateSocialFeature", this._activationEventHandler, true, true); gBrowser.addEventListener("ActivateSocialFeature", this._activationEventHandler, true, true);
// Called when we enter DOM full-screen mode. // Called when we enter DOM full-screen mode.
window.addEventListener("mozfullscreenchange", function () SocialSidebar.updateSidebar()); window.addEventListener("mozfullscreenchange", function () {
SocialSidebar.update();
SocialChatBar.update();
});
Social.init(this._providerReady.bind(this)); Social.init(this._providerReady.bind(this));
}, },
@ -54,7 +57,7 @@ let SocialUI = {
this.updateToggleCommand(); this.updateToggleCommand();
SocialShareButton.updateButtonHiddenState(); SocialShareButton.updateButtonHiddenState();
SocialToolbar.updateButtonHiddenState(); SocialToolbar.updateButtonHiddenState();
SocialSidebar.updateSidebar(); SocialSidebar.update();
SocialChatBar.update(); SocialChatBar.update();
SocialFlyout.unload(); SocialFlyout.unload();
} catch (e) { } catch (e) {
@ -78,7 +81,7 @@ let SocialUI = {
} }
break; break;
case "nsPref:changed": case "nsPref:changed":
SocialSidebar.updateSidebar(); SocialSidebar.update();
SocialToolbar.updateButton(); SocialToolbar.updateButton();
SocialMenu.populate(); SocialMenu.populate();
break; break;
@ -229,22 +232,26 @@ let SocialChatBar = {
get chatbar() { get chatbar() {
return document.getElementById("pinnedchats"); return document.getElementById("pinnedchats");
}, },
// Whether the chats can be shown for this window. // Whether the chatbar is available for this window. Note that in full-screen
get canShow() { // mode chats are available, but not shown.
get isAvailable() {
if (!SocialUI.haveLoggedInUser()) if (!SocialUI.haveLoggedInUser())
return false; return false;
let docElem = document.documentElement; let docElem = document.documentElement;
let chromeless = docElem.getAttribute("disablechrome") || let chromeless = docElem.getAttribute("disablechrome") ||
docElem.getAttribute("chromehidden").indexOf("extrachrome") >= 0; docElem.getAttribute("chromehidden").indexOf("extrachrome") >= 0;
return Social.uiVisible && !chromeless && !document.mozFullScreen; return Social.uiVisible && !chromeless;
}, },
openChat: function(aProvider, aURL, aCallback, aMode) { openChat: function(aProvider, aURL, aCallback, aMode) {
if (this.canShow) if (this.isAvailable)
this.chatbar.openChat(aProvider, aURL, aCallback, aMode); this.chatbar.openChat(aProvider, aURL, aCallback, aMode);
}, },
update: function() { update: function() {
if (!this.canShow) if (!this.isAvailable)
this.chatbar.removeAll(); this.chatbar.removeAll();
else {
this.chatbar.hidden = document.mozFullScreen;
}
}, },
focus: function SocialChatBar_focus() { focus: function SocialChatBar_focus() {
let commandDispatcher = gBrowser.ownerDocument.commandDispatcher; let commandDispatcher = gBrowser.ownerDocument.commandDispatcher;
@ -943,7 +950,7 @@ var SocialSidebar = {
let sbrowser = document.getElementById("social-sidebar-browser"); let sbrowser = document.getElementById("social-sidebar-browser");
this.errorListener = new SocialErrorListener("sidebar"); this.errorListener = new SocialErrorListener("sidebar");
this.configureSidebarDocShell(sbrowser.docShell); this.configureSidebarDocShell(sbrowser.docShell);
this.updateSidebar(); this.update();
}, },
configureSidebarDocShell: function SocialSidebar_configureDocShell(aDocShell) { configureSidebarDocShell: function SocialSidebar_configureDocShell(aDocShell) {
@ -981,7 +988,7 @@ var SocialSidebar = {
sbrowser.contentDocument.documentElement.dispatchEvent(evt); sbrowser.contentDocument.documentElement.dispatchEvent(evt);
}, },
updateSidebar: function SocialSidebar_updateSidebar() { update: function SocialSidebar_update() {
clearTimeout(this._unloadTimeoutId); clearTimeout(this._unloadTimeoutId);
// Hide the toggle menu item if the sidebar cannot appear // Hide the toggle menu item if the sidebar cannot appear
let command = document.getElementById("Social:ToggleSidebar"); let command = document.getElementById("Social:ToggleSidebar");

View File

@ -50,17 +50,6 @@
</setter> </setter>
</property> </property>
<method name="init">
<parameter name="aProvider"/>
<parameter name="aURL"/>
<parameter name="aCallback"/>
<body><![CDATA[
this._callback = aCallback;
this.setAttribute("origin", aProvider.origin);
this.setAttribute("src", aURL);
]]></body>
</method>
<method name="close"> <method name="close">
<body><![CDATA[ <body><![CDATA[
this.parentNode.remove(this); this.parentNode.remove(this);
@ -376,7 +365,9 @@
cb.setAttribute("minimized", "true"); cb.setAttribute("minimized", "true");
this.selectedChat = cb; this.selectedChat = cb;
this.insertBefore(cb, this.firstChild); this.insertBefore(cb, this.firstChild);
cb.init(aProvider, aURL, aCallback); cb._callback = aCallback;
cb.setAttribute("origin", aProvider.origin);
cb.setAttribute("src", aURL);
this.chatboxForURL.set(aURL, Cu.getWeakReference(cb)); this.chatboxForURL.set(aURL, Cu.getWeakReference(cb));
this.resize(); this.resize();
]]></body> ]]></body>

View File

@ -5441,6 +5441,7 @@ class CGProxyIndexedPresenceChecker(CGProxyIndexedGetter):
""" """
def __init__(self, descriptor): def __init__(self, descriptor):
CGProxyIndexedGetter.__init__(self, descriptor) CGProxyIndexedGetter.__init__(self, descriptor)
self.cgRoot.append(CGGeneric("(void)result;"))
class CGProxyIndexedSetter(CGProxyIndexedOperation): class CGProxyIndexedSetter(CGProxyIndexedOperation):
""" """
@ -5494,6 +5495,7 @@ class CGProxyNamedPresenceChecker(CGProxyNamedGetter):
""" """
def __init__(self, descriptor): def __init__(self, descriptor):
CGProxyNamedGetter.__init__(self, descriptor) CGProxyNamedGetter.__init__(self, descriptor)
self.cgRoot.append(CGGeneric("(void)result;"))
class CGProxyNamedSetter(CGProxyNamedOperation): class CGProxyNamedSetter(CGProxyNamedOperation):
""" """

View File

@ -54,6 +54,7 @@ EXPORTS = \
gfxSharedQuartzSurface.h \ gfxSharedQuartzSurface.h \
gfxReusableSurfaceWrapper.h \ gfxReusableSurfaceWrapper.h \
gfxSVGGlyphs.h \ gfxSVGGlyphs.h \
RoundedRect.h \
$(NULL) $(NULL)
# gfxSVGGlyphs needs nsDOMParser.h # gfxSVGGlyphs needs nsDOMParser.h

40
gfx/thebes/RoundedRect.h Normal file
View File

@ -0,0 +1,40 @@
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "gfxRect.h"
namespace mozilla {
/* A rounded rectangle abstraction.
*
* This can represent a rectangle with a different pair of radii on each corner.
*
* Note: CoreGraphics and Direct2D only support rounded rectangle with the same
* radii on all corners. However, supporting CSS's border-radius requires the extra flexibility. */
struct RoundedRect {
RoundedRect(gfxRect &aRect, gfxCornerSizes &aCorners) : rect(aRect), corners(aCorners) { }
void Deflate(gfxFloat aTopWidth, gfxFloat aBottomWidth, gfxFloat aLeftWidth, gfxFloat aRightWidth) {
// deflate the internal rect
rect.x += aLeftWidth;
rect.y += aTopWidth;
rect.width = gfx::gfx_max(0., rect.width - aLeftWidth - aRightWidth);
rect.height = gfx::gfx_max(0., rect.height - aTopWidth - aBottomWidth);
corners.sizes[NS_CORNER_TOP_LEFT].width = gfx::gfx_max(0., corners.sizes[NS_CORNER_TOP_LEFT].width - aLeftWidth);
corners.sizes[NS_CORNER_TOP_LEFT].height = gfx::gfx_max(0., corners.sizes[NS_CORNER_TOP_LEFT].height - aTopWidth);
corners.sizes[NS_CORNER_TOP_RIGHT].width = gfx::gfx_max(0., corners.sizes[NS_CORNER_TOP_RIGHT].width - aRightWidth);
corners.sizes[NS_CORNER_TOP_RIGHT].height = gfx::gfx_max(0., corners.sizes[NS_CORNER_TOP_RIGHT].height - aTopWidth);
corners.sizes[NS_CORNER_BOTTOM_LEFT].width = gfx::gfx_max(0., corners.sizes[NS_CORNER_BOTTOM_LEFT].width - aLeftWidth);
corners.sizes[NS_CORNER_BOTTOM_LEFT].height = gfx::gfx_max(0., corners.sizes[NS_CORNER_BOTTOM_LEFT].height - aBottomWidth);
corners.sizes[NS_CORNER_BOTTOM_RIGHT].width = gfx::gfx_max(0., corners.sizes[NS_CORNER_BOTTOM_RIGHT].width - aRightWidth);
corners.sizes[NS_CORNER_BOTTOM_RIGHT].height = gfx::gfx_max(0., corners.sizes[NS_CORNER_BOTTOM_RIGHT].height - aBottomWidth);
}
gfxRect rect;
gfxCornerSizes corners;
};
} // namespace mozilla

File diff suppressed because it is too large Load Diff

View File

@ -512,6 +512,9 @@ template <class T, size_t N, class AllocPolicy>
JS_ALWAYS_INLINE JS_ALWAYS_INLINE
Vector<T, N, AllocPolicy>::Vector(MoveRef<Vector> rhs) Vector<T, N, AllocPolicy>::Vector(MoveRef<Vector> rhs)
: AllocPolicy(rhs) : AllocPolicy(rhs)
#ifdef DEBUG
, entered(false)
#endif
{ {
mLength = rhs->mLength; mLength = rhs->mLength;
mCapacity = rhs->mCapacity; mCapacity = rhs->mCapacity;

View File

@ -722,6 +722,10 @@ Compiler.$(OBJ_SUFFIX): CXXFLAGS += -GL-
# Ditto (Bug 772303) # Ditto (Bug 772303)
RegExp.$(OBJ_SUFFIX): CXXFLAGS += -GL- RegExp.$(OBJ_SUFFIX): CXXFLAGS += -GL-
endif endif
# Ditto (Bug 810661)
ifeq ($(CPU_ARCH),x86_64)
CTypes.$(OBJ_SUFFIX): CXXFLAGS += -GL-
endif
endif # _MSC_VER endif # _MSC_VER
ifeq ($(OS_ARCH),FreeBSD) ifeq ($(OS_ARCH),FreeBSD)

View File

@ -4020,17 +4020,27 @@ CodeGenerator::emitInstanceOf(LInstruction *ins, Register rhs)
Register rhsFlags = ToRegister(ins->getTemp(0)); Register rhsFlags = ToRegister(ins->getTemp(0));
Register lhsTmp = ToRegister(ins->getTemp(0)); Register lhsTmp = ToRegister(ins->getTemp(0));
Label callHasInstance;
Label boundFunctionCheck; Label boundFunctionCheck;
Label boundFunctionDone; Label boundFunctionDone;
Label done; Label done;
Label loopPrototypeChain; Label loopPrototypeChain;
JS_ASSERT(ins->isInstanceOfO() || ins->isInstanceOfV());
bool lhsIsValue = ins->isInstanceOfV();
typedef bool (*pf)(JSContext *, HandleObject, HandleValue, JSBool *); typedef bool (*pf)(JSContext *, HandleObject, HandleValue, JSBool *);
static const VMFunction HasInstanceInfo = FunctionInfo<pf>(js::HasInstance); static const VMFunction HasInstanceInfo = FunctionInfo<pf>(js::HasInstance);
OutOfLineCode *call = oolCallVM(HasInstanceInfo, ins, (ArgList(), rhs, ToValue(ins, 0)), // If the lhs is an object, then the ValueOperand that gets sent to
StoreRegisterTo(output)); // HasInstance must be boxed first. If the lhs is a value, it can
// be sent directly. Hence the choice between ToValue and ToTempValue
// below. Note that the same check is done below in the generated code
// and explicit boxing instructions emitted before calling the OOL code
// if we're handling a LInstanceOfO.
OutOfLineCode *call = oolCallVM(HasInstanceInfo, ins,
(ArgList(), rhs, lhsIsValue ? ToValue(ins, 0) : ToTempValue(ins, 0)),
StoreRegisterTo(output));
if (!call) if (!call)
return false; return false;
@ -4052,7 +4062,18 @@ CodeGenerator::emitInstanceOf(LInstruction *ins, Register rhs)
masm.loadBaseShape(rhsTmp, output); masm.loadBaseShape(rhsTmp, output);
masm.cmpPtr(Address(output, BaseShape::offsetOfClass()), ImmWord(&js::FunctionClass)); masm.cmpPtr(Address(output, BaseShape::offsetOfClass()), ImmWord(&js::FunctionClass));
masm.j(Assembler::NotEqual, call->entry()); if (lhsIsValue) {
// If the input LHS is a value, no boxing necessary.
masm.j(Assembler::NotEqual, call->entry());
} else {
// If the input LHS is raw object pointer, it must be boxed before
// calling into js::HasInstance.
Label dontCallHasInstance;
masm.j(Assembler::Equal, &dontCallHasInstance);
masm.boxNonDouble(JSVAL_TYPE_OBJECT, ToRegister(ins->getOperand(0)), ToTempValue(ins, 0));
masm.jump(call->entry());
masm.bind(&dontCallHasInstance);
}
// Check Bound Function // Check Bound Function
masm.loadPtr(Address(output, BaseShape::offsetOfFlags()), rhsFlags); masm.loadPtr(Address(output, BaseShape::offsetOfFlags()), rhsFlags);
@ -4086,7 +4107,7 @@ CodeGenerator::emitInstanceOf(LInstruction *ins, Register rhs)
// When lhs is a value: The HasInstance for function objects always // When lhs is a value: The HasInstance for function objects always
// return false when lhs isn't an object. So check if // return false when lhs isn't an object. So check if
// lhs is an object and otherwise return false // lhs is an object and otherwise return false
if (ins->isInstanceOfV()) { if (lhsIsValue) {
Label isObject; Label isObject;
ValueOperand lhsValue = ToValue(ins, LInstanceOfV::LHS); ValueOperand lhsValue = ToValue(ins, LInstanceOfV::LHS);
masm.branchTestObject(Assembler::Equal, lhsValue, &isObject); masm.branchTestObject(Assembler::Equal, lhsValue, &isObject);
@ -4125,7 +4146,17 @@ CodeGenerator::emitInstanceOf(LInstruction *ins, Register rhs)
masm.loadPtr(Address(lhsTmp, offsetof(types::TypeObject, proto)), lhsTmp); masm.loadPtr(Address(lhsTmp, offsetof(types::TypeObject, proto)), lhsTmp);
// Bail out if we hit a lazy proto // Bail out if we hit a lazy proto
masm.branch32(Assembler::Equal, lhsTmp, Imm32(1), call->entry()); if (lhsIsValue) {
masm.branch32(Assembler::Equal, lhsTmp, Imm32(1), call->entry());
} else {
// If the input LHS is raw object pointer, it must be boxed before
// calling into js::HasInstance.
Label dontCallHasInstance;
masm.branch32(Assembler::NotEqual, lhsTmp, Imm32(1), &dontCallHasInstance);
masm.boxNonDouble(JSVAL_TYPE_OBJECT, ToRegister(ins->getOperand(0)), ToTempValue(ins, 0));
masm.jump(call->entry());
masm.bind(&dontCallHasInstance);
}
masm.testPtr(lhsTmp, lhsTmp); masm.testPtr(lhsTmp, lhsTmp);
masm.j(Assembler::Zero, &done); masm.j(Assembler::Zero, &done);

View File

@ -94,6 +94,11 @@ class IonAllocPolicy
void *malloc_(size_t bytes) { void *malloc_(size_t bytes) {
return GetIonContext()->temp->allocate(bytes); return GetIonContext()->temp->allocate(bytes);
} }
void *calloc_(size_t bytes) {
void *p = GetIonContext()->temp->allocate(bytes);
memset(p, 0, bytes);
return p;
}
void *realloc_(void *p, size_t oldBytes, size_t bytes) { void *realloc_(void *p, size_t oldBytes, size_t bytes) {
void *n = malloc_(bytes); void *n = malloc_(bytes);
if (!n) if (!n)

View File

@ -1029,6 +1029,14 @@ CodeGeneratorARM::ToOutValue(LInstruction *ins)
return ValueOperand(typeReg, payloadReg); return ValueOperand(typeReg, payloadReg);
} }
ValueOperand
CodeGeneratorARM::ToTempValue(LInstruction *ins, size_t pos)
{
Register typeReg = ToRegister(ins->getTemp(pos + TYPE_INDEX));
Register payloadReg = ToRegister(ins->getTemp(pos + PAYLOAD_INDEX));
return ValueOperand(typeReg, payloadReg);
}
bool bool
CodeGeneratorARM::visitValue(LValue *value) CodeGeneratorARM::visitValue(LValue *value)
{ {

View File

@ -110,6 +110,7 @@ class CodeGeneratorARM : public CodeGeneratorShared
protected: protected:
ValueOperand ToValue(LInstruction *ins, size_t pos); ValueOperand ToValue(LInstruction *ins, size_t pos);
ValueOperand ToOutValue(LInstruction *ins); ValueOperand ToOutValue(LInstruction *ins);
ValueOperand ToTempValue(LInstruction *ins, size_t pos);
// Functions for LTestVAndBranch. // Functions for LTestVAndBranch.
Register splitTagForTest(const ValueOperand &value); Register splitTagForTest(const ValueOperand &value);

View File

@ -2228,6 +2228,12 @@ MacroAssemblerARMCompat::boxDouble(const FloatRegister &src, const ValueOperand
as_vxfer(dest.payloadReg(), dest.typeReg(), VFPRegister(src), FloatToCore); as_vxfer(dest.payloadReg(), dest.typeReg(), VFPRegister(src), FloatToCore);
} }
void
MacroAssemblerARMCompat::boxNonDouble(JSValueType type, const Register &src, const ValueOperand &dest) {
if (src != dest.payloadReg())
ma_mov(src, dest.payloadReg());
ma_mov(ImmType(type), dest.typeReg());
}
void void
MacroAssemblerARMCompat::boolValueToDouble(const ValueOperand &operand, const FloatRegister &dest) MacroAssemblerARMCompat::boolValueToDouble(const ValueOperand &operand, const FloatRegister &dest)

View File

@ -551,6 +551,7 @@ class MacroAssemblerARMCompat : public MacroAssemblerARM
// boxing code // boxing code
void boxDouble(const FloatRegister &src, const ValueOperand &dest); void boxDouble(const FloatRegister &src, const ValueOperand &dest);
void boxNonDouble(JSValueType type, const Register &src, const ValueOperand &dest);
// Extended unboxing API. If the payload is already in a register, returns // Extended unboxing API. If the payload is already in a register, returns
// that register. Otherwise, provides a move to the given scratch register, // that register. Otherwise, provides a move to the given scratch register,

View File

@ -33,6 +33,12 @@ CodeGeneratorX64::ToOutValue(LInstruction *ins)
return ValueOperand(ToRegister(ins->getDef(0))); return ValueOperand(ToRegister(ins->getDef(0)));
} }
ValueOperand
CodeGeneratorX64::ToTempValue(LInstruction *ins, size_t pos)
{
return ValueOperand(ToRegister(ins->getTemp(pos)));
}
bool bool
CodeGeneratorX64::visitDouble(LDouble *ins) CodeGeneratorX64::visitDouble(LDouble *ins)
{ {

View File

@ -23,6 +23,7 @@ class CodeGeneratorX64 : public CodeGeneratorX86Shared
protected: protected:
ValueOperand ToValue(LInstruction *ins, size_t pos); ValueOperand ToValue(LInstruction *ins, size_t pos);
ValueOperand ToOutValue(LInstruction *ins); ValueOperand ToOutValue(LInstruction *ins);
ValueOperand ToTempValue(LInstruction *ins, size_t pos);
void loadUnboxedValue(Operand source, MIRType type, const LDefinition *dest); void loadUnboxedValue(Operand source, MIRType type, const LDefinition *dest);

View File

@ -647,6 +647,10 @@ class MacroAssemblerX64 : public MacroAssemblerX86Shared
void boxDouble(const FloatRegister &src, const ValueOperand &dest) { void boxDouble(const FloatRegister &src, const ValueOperand &dest) {
movqsd(src, dest.valueReg()); movqsd(src, dest.valueReg());
} }
void boxNonDouble(JSValueType type, const Register &src, const ValueOperand &dest) {
JS_ASSERT(src != dest.valueReg());
boxValue(type, src, dest.valueReg());
}
// Note that the |dest| register here may be ScratchReg, so we shouldn't // Note that the |dest| register here may be ScratchReg, so we shouldn't
// use it. // use it.

View File

@ -70,6 +70,14 @@ CodeGeneratorX86::ToOutValue(LInstruction *ins)
return ValueOperand(typeReg, payloadReg); return ValueOperand(typeReg, payloadReg);
} }
ValueOperand
CodeGeneratorX86::ToTempValue(LInstruction *ins, size_t pos)
{
Register typeReg = ToRegister(ins->getTemp(pos + TYPE_INDEX));
Register payloadReg = ToRegister(ins->getTemp(pos + PAYLOAD_INDEX));
return ValueOperand(typeReg, payloadReg);
}
bool bool
CodeGeneratorX86::visitValue(LValue *value) CodeGeneratorX86::visitValue(LValue *value)
{ {

View File

@ -43,6 +43,7 @@ class CodeGeneratorX86 : public CodeGeneratorX86Shared
protected: protected:
ValueOperand ToValue(LInstruction *ins, size_t pos); ValueOperand ToValue(LInstruction *ins, size_t pos);
ValueOperand ToOutValue(LInstruction *ins); ValueOperand ToOutValue(LInstruction *ins);
ValueOperand ToTempValue(LInstruction *ins, size_t pos);
void storeElementTyped(const LAllocation *value, MIRType valueType, MIRType elementType, void storeElementTyped(const LAllocation *value, MIRType valueType, MIRType elementType,
const Register &elements, const LAllocation *index); const Register &elements, const LAllocation *index);

View File

@ -533,6 +533,11 @@ class MacroAssemblerX86 : public MacroAssemblerX86Shared
psrldq(Imm32(4), src); psrldq(Imm32(4), src);
movd(src, dest.typeReg()); movd(src, dest.typeReg());
} }
void boxNonDouble(JSValueType type, const Register &src, const ValueOperand &dest) {
if (src != dest.payloadReg())
movl(src, dest.payloadReg());
movl(ImmType(type), dest.typeReg());
}
void unboxInt32(const ValueOperand &src, const Register &dest) { void unboxInt32(const ValueOperand &src, const Register &dest) {
movl(src.payloadReg(), dest); movl(src.payloadReg(), dest);
} }

View File

@ -18,6 +18,8 @@ namespace js {
* - public copy constructor, assignment, destructor * - public copy constructor, assignment, destructor
* - void *malloc_(size_t) * - void *malloc_(size_t)
* Responsible for OOM reporting on NULL return value. * Responsible for OOM reporting on NULL return value.
* - void *calloc_(size_t)
* Responsible for OOM reporting on NULL return value.
* - void *realloc_(size_t) * - void *realloc_(size_t)
* Responsible for OOM reporting on NULL return value. * Responsible for OOM reporting on NULL return value.
* The *used* bytes of the previous buffer is passed in * The *used* bytes of the previous buffer is passed in
@ -33,6 +35,7 @@ class SystemAllocPolicy
{ {
public: public:
void *malloc_(size_t bytes) { return js_malloc(bytes); } void *malloc_(size_t bytes) { return js_malloc(bytes); }
void *calloc_(size_t bytes) { return js_calloc(bytes); }
void *realloc_(void *p, size_t oldBytes, size_t bytes) { return js_realloc(p, bytes); } void *realloc_(void *p, size_t oldBytes, size_t bytes) { return js_realloc(p, bytes); }
void free_(void *p) { js_free(p); } void free_(void *p) { js_free(p); }
void reportAllocOverflow() const {} void reportAllocOverflow() const {}
@ -71,6 +74,13 @@ class TempAllocPolicy
return p; return p;
} }
void *calloc_(size_t bytes) {
void *p = js_calloc(bytes);
if (JS_UNLIKELY(!p))
p = onOutOfMemory(NULL, bytes);
return p;
}
void *realloc_(void *p, size_t oldBytes, size_t bytes) { void *realloc_(void *p, size_t oldBytes, size_t bytes) {
void *p2 = js_realloc(p, bytes); void *p2 = js_realloc(p, bytes);
if (JS_UNLIKELY(!p2)) if (JS_UNLIKELY(!p2))

View File

@ -804,7 +804,7 @@ JSRuntime::JSRuntime(JSUseHelperThreads useHelperThreads)
gcSliceBudget(SliceBudget::Unlimited), gcSliceBudget(SliceBudget::Unlimited),
gcIncrementalEnabled(true), gcIncrementalEnabled(true),
gcExactScanningEnabled(true), gcExactScanningEnabled(true),
gcInTransplant(false), gcManipulatingDeadCompartments(false),
gcObjectsMarkedInDeadCompartments(0), gcObjectsMarkedInDeadCompartments(0),
gcPoke(false), gcPoke(false),
heapState(Idle), heapState(Idle),
@ -1558,7 +1558,7 @@ JS_TransplantObject(JSContext *cx, JSObject *origobjArg, JSObject *targetArg)
JS_ASSERT(!IsCrossCompartmentWrapper(origobj)); JS_ASSERT(!IsCrossCompartmentWrapper(origobj));
JS_ASSERT(!IsCrossCompartmentWrapper(target)); JS_ASSERT(!IsCrossCompartmentWrapper(target));
AutoTransplantGC agc(cx); AutoMaybeTouchDeadCompartments agc(cx);
JSCompartment *destination = target->compartment(); JSCompartment *destination = target->compartment();
WrapperMap &map = destination->crossCompartmentWrappers; WrapperMap &map = destination->crossCompartmentWrappers;
@ -1632,7 +1632,7 @@ js_TransplantObjectWithWrapper(JSContext *cx,
RootedObject targetobj(cx, targetobjArg); RootedObject targetobj(cx, targetobjArg);
RootedObject targetwrapper(cx, targetwrapperArg); RootedObject targetwrapper(cx, targetwrapperArg);
AutoTransplantGC agc(cx); AutoMaybeTouchDeadCompartments agc(cx);
AssertHeapIsIdle(cx); AssertHeapIsIdle(cx);
JS_ASSERT(!IsCrossCompartmentWrapper(origobj)); JS_ASSERT(!IsCrossCompartmentWrapper(origobj));

View File

@ -38,8 +38,7 @@ HashId(jsid id)
return mozilla::HashGeneric(JSID_BITS(id)); return mozilla::HashGeneric(JSID_BITS(id));
} }
template<> struct JsidHasher
struct DefaultHasher<jsid>
{ {
typedef jsid Lookup; typedef jsid Lookup;
static HashNumber hash(const Lookup &l) { static HashNumber hash(const Lookup &l) {

View File

@ -719,9 +719,10 @@ struct JSRuntime : js::RuntimeFriendFields
/* /*
* This is true if we are in the middle of a brain transplant (e.g., * This is true if we are in the middle of a brain transplant (e.g.,
* JS_TransplantObject). * JS_TransplantObject) or some other operation that can manipulate
* dead compartments.
*/ */
bool gcInTransplant; bool gcManipulatingDeadCompartments;
/* /*
* This field is incremented each time we mark an object inside a * This field is incremented each time we mark an object inside a
@ -2193,6 +2194,7 @@ class RuntimeAllocPolicy
RuntimeAllocPolicy(JSRuntime *rt) : runtime(rt) {} RuntimeAllocPolicy(JSRuntime *rt) : runtime(rt) {}
RuntimeAllocPolicy(JSContext *cx) : runtime(cx->runtime) {} RuntimeAllocPolicy(JSContext *cx) : runtime(cx->runtime) {}
void *malloc_(size_t bytes) { return runtime->malloc_(bytes); } void *malloc_(size_t bytes) { return runtime->malloc_(bytes); }
void *calloc_(size_t bytes) { return runtime->calloc_(bytes); }
void *realloc_(void *p, size_t bytes) { return runtime->realloc_(p, bytes); } void *realloc_(void *p, size_t bytes) { return runtime->realloc_(p, bytes); }
void free_(void *p) { js_free(p); } void free_(void *p) { js_free(p); }
void reportAllocOverflow() const {} void reportAllocOverflow() const {}
@ -2209,6 +2211,7 @@ class ContextAllocPolicy
ContextAllocPolicy(JSContext *cx) : cx(cx) {} ContextAllocPolicy(JSContext *cx) : cx(cx) {}
JSContext *context() const { return cx; } JSContext *context() const { return cx; }
void *malloc_(size_t bytes) { return cx->malloc_(bytes); } void *malloc_(size_t bytes) { return cx->malloc_(bytes); }
void *calloc_(size_t bytes) { return cx->calloc_(bytes); }
void *realloc_(void *p, size_t oldBytes, size_t bytes) { return cx->realloc_(p, oldBytes, bytes); } void *realloc_(void *p, size_t oldBytes, size_t bytes) { return cx->realloc_(p, oldBytes, bytes); }
void free_(void *p) { js_free(p); } void free_(void *p) { js_free(p); }
void reportAllocOverflow() const { js_ReportAllocationOverflow(cx); } void reportAllocOverflow() const { js_ReportAllocationOverflow(cx); }

View File

@ -3249,9 +3249,10 @@ InCrossCompartmentMap(JSObject *src, Cell *dst, JSGCTraceKind dstKind)
if (dstKind == JSTRACE_OBJECT) { if (dstKind == JSTRACE_OBJECT) {
Value key = ObjectValue(*static_cast<JSObject *>(dst)); Value key = ObjectValue(*static_cast<JSObject *>(dst));
WrapperMap::Ptr p = srccomp->crossCompartmentWrappers.lookup(key); if (WrapperMap::Ptr p = srccomp->crossCompartmentWrappers.lookup(key)) {
if (*p->value.unsafeGet() == ObjectValue(*src)) if (*p->value.unsafeGet() == ObjectValue(*src))
return true; return true;
}
} }
/* /*
@ -3425,7 +3426,7 @@ BeginMarkPhase(JSRuntime *rt)
* gcObjectsMarkedInDeadCompartment counter) and redo any ongoing GCs after * gcObjectsMarkedInDeadCompartment counter) and redo any ongoing GCs after
* the JS_TransplantObject function has finished. This ensures that the dead * the JS_TransplantObject function has finished. This ensures that the dead
* compartments will be cleaned up. See AutoMarkInDeadCompartment and * compartments will be cleaned up. See AutoMarkInDeadCompartment and
* AutoTransplantGC for details. * AutoMaybeTouchDeadCompartments for details.
*/ */
/* Set the maybeAlive flag based on cross-compartment edges. */ /* Set the maybeAlive flag based on cross-compartment edges. */
@ -5883,23 +5884,32 @@ PurgeJITCaches(JSCompartment *c)
#endif #endif
} }
AutoTransplantGC::AutoTransplantGC(JSContext *cx) AutoMaybeTouchDeadCompartments::AutoMaybeTouchDeadCompartments(JSContext *cx)
: runtime(cx->runtime), : runtime(cx->runtime),
markCount(runtime->gcObjectsMarkedInDeadCompartments), markCount(runtime->gcObjectsMarkedInDeadCompartments),
inIncremental(IsIncrementalGCInProgress(runtime)), inIncremental(IsIncrementalGCInProgress(runtime)),
inTransplant(runtime->gcInTransplant) manipulatingDeadCompartments(runtime->gcManipulatingDeadCompartments)
{ {
runtime->gcInTransplant = true; runtime->gcManipulatingDeadCompartments = true;
} }
AutoTransplantGC::~AutoTransplantGC() AutoMaybeTouchDeadCompartments::AutoMaybeTouchDeadCompartments(JSObject *obj)
: runtime(obj->compartment()->rt),
markCount(runtime->gcObjectsMarkedInDeadCompartments),
inIncremental(IsIncrementalGCInProgress(runtime)),
manipulatingDeadCompartments(runtime->gcManipulatingDeadCompartments)
{
runtime->gcManipulatingDeadCompartments = true;
}
AutoMaybeTouchDeadCompartments::~AutoMaybeTouchDeadCompartments()
{ {
if (inIncremental && runtime->gcObjectsMarkedInDeadCompartments != markCount) { if (inIncremental && runtime->gcObjectsMarkedInDeadCompartments != markCount) {
PrepareForFullGC(runtime); PrepareForFullGC(runtime);
js::GC(runtime, GC_NORMAL, gcreason::TRANSPLANT); js::GC(runtime, GC_NORMAL, gcreason::TRANSPLANT);
} }
runtime->gcInTransplant = inTransplant; runtime->gcManipulatingDeadCompartments = manipulatingDeadCompartments;
} }
} /* namespace js */ } /* namespace js */

View File

@ -1173,30 +1173,6 @@ MaybeVerifyBarriers(JSContext *cx, bool always = false)
void void
PurgeJITCaches(JSCompartment *c); PurgeJITCaches(JSCompartment *c);
/*
* This auto class should be used around any code that does brain
* transplants. Brain transplants can cause problems because they operate on all
* compartments, whether live or dead. A brain transplant can cause a formerly
* dead object to be "reanimated" by causing a read or write barrier to be
* invoked on it during the transplant.
*
* To work around this issue, we observe when mark bits are set on objects in
* dead compartments. If this happens during a brain transplant, we do a full,
* non-incremental GC at the end of the brain transplant. This will clean up any
* objects that were improperly marked.
*/
struct AutoTransplantGC
{
AutoTransplantGC(JSContext *cx);
~AutoTransplantGC();
private:
JSRuntime *runtime;
unsigned markCount;
bool inIncremental;
bool inTransplant;
};
} /* namespace js */ } /* namespace js */
#endif /* jsgc_h___ */ #endif /* jsgc_h___ */

View File

@ -26,8 +26,8 @@ struct Shape;
/* /*
* This auto class should be used around any code that might cause a mark bit to * This auto class should be used around any code that might cause a mark bit to
* be set on an object in a dead compartment. See AutoTransplantGC for more * be set on an object in a dead compartment. See AutoMaybeTouchDeadCompartments
* details. * for more details.
*/ */
struct AutoMarkInDeadCompartment struct AutoMarkInDeadCompartment
{ {
@ -35,7 +35,7 @@ struct AutoMarkInDeadCompartment
: compartment(comp), : compartment(comp),
scheduled(comp->scheduledForDestruction) scheduled(comp->scheduledForDestruction)
{ {
if (comp->rt->gcInTransplant && comp->scheduledForDestruction) { if (comp->rt->gcManipulatingDeadCompartments && comp->scheduledForDestruction) {
comp->rt->gcObjectsMarkedInDeadCompartments++; comp->rt->gcObjectsMarkedInDeadCompartments++;
comp->scheduledForDestruction = false; comp->scheduledForDestruction = false;
} }

View File

@ -630,7 +630,7 @@ js_Stringify(JSContext *cx, MutableHandleValue vp, JSObject *replacer_, Value sp
if (replacer->isDenseArray()) if (replacer->isDenseArray())
len = Min(len, replacer->getDenseArrayCapacity()); len = Min(len, replacer->getDenseArrayCapacity());
HashSet<jsid> idSet(cx); HashSet<jsid, JsidHasher> idSet(cx);
if (!idSet.init(len)) if (!idSet.init(len))
return false; return false;
@ -667,7 +667,7 @@ js_Stringify(JSContext *cx, MutableHandleValue vp, JSObject *replacer_, Value sp
} }
/* Step 4b(iv)(6). */ /* Step 4b(iv)(6). */
HashSet<jsid>::AddPtr p = idSet.lookupForAdd(id); HashSet<jsid, JsidHasher>::AddPtr p = idSet.lookupForAdd(id);
if (!p) { if (!p) {
/* Step 4b(iv)(6)(a). */ /* Step 4b(iv)(6)(a). */
if (!idSet.add(p, id) || !propertyList.append(id)) if (!idSet.add(p, id) || !propertyList.append(id))

View File

@ -148,7 +148,8 @@ PropertyTree::getChild(JSContext *cx, Shape *parent_, uint32_t nfixed, const Sta
if (kid->matches(child)) if (kid->matches(child))
shape = kid; shape = kid;
} else if (kidp->isHash()) { } else if (kidp->isHash()) {
shape = *kidp->toHash()->lookup(child); if (KidsHash::Ptr p = kidp->toHash()->lookup(child))
shape = *p;
} else { } else {
/* If kidp->isNull(), we always insert. */ /* If kidp->isNull(), we always insert. */
} }

View File

@ -1164,7 +1164,7 @@ JS_FRIEND_API(bool)
js::RecomputeWrappers(JSContext *cx, const CompartmentFilter &sourceFilter, js::RecomputeWrappers(JSContext *cx, const CompartmentFilter &sourceFilter,
const CompartmentFilter &targetFilter) const CompartmentFilter &targetFilter)
{ {
AutoTransplantGC agc(cx); AutoMaybeTouchDeadCompartments agc(cx);
AutoWrapperVector toRecompute(cx); AutoWrapperVector toRecompute(cx);

View File

@ -295,6 +295,34 @@ JS_FRIEND_API(bool)
RecomputeWrappers(JSContext *cx, const CompartmentFilter &sourceFilter, RecomputeWrappers(JSContext *cx, const CompartmentFilter &sourceFilter,
const CompartmentFilter &targetFilter); const CompartmentFilter &targetFilter);
/*
* This auto class should be used around any code, such as brain transplants,
* that may touch dead compartments. Brain transplants can cause problems
* because they operate on all compartments, whether live or dead. A brain
* transplant can cause a formerly dead object to be "reanimated" by causing a
* read or write barrier to be invoked on it during the transplant. In this way,
* a compartment becomes a zombie, kept alive by repeatedly consuming
* (transplanted) brains.
*
* To work around this issue, we observe when mark bits are set on objects in
* dead compartments. If this happens during a brain transplant, we do a full,
* non-incremental GC at the end of the brain transplant. This will clean up any
* objects that were improperly marked.
*/
struct JS_FRIEND_API(AutoMaybeTouchDeadCompartments)
{
// The version that takes an object just uses it for its runtime.
AutoMaybeTouchDeadCompartments(JSContext *cx);
AutoMaybeTouchDeadCompartments(JSObject *obj);
~AutoMaybeTouchDeadCompartments();
private:
JSRuntime *runtime;
unsigned markCount;
bool inIncremental;
bool manipulatingDeadCompartments;
};
} /* namespace js */ } /* namespace js */
#endif #endif

View File

@ -1113,7 +1113,7 @@ nsXPCWrappedJSClass::CheckForException(XPCCallContext & ccx,
NS_IMETHODIMP NS_IMETHODIMP
nsXPCWrappedJSClass::CallMethod(nsXPCWrappedJS* wrapper, uint16_t methodIndex, nsXPCWrappedJSClass::CallMethod(nsXPCWrappedJS* wrapper, uint16_t methodIndex,
const XPTMethodDescriptor* info, const XPTMethodDescriptor* info_,
nsXPTCMiniVariant* nativeParams) nsXPTCMiniVariant* nativeParams)
{ {
jsval* sp = nullptr; jsval* sp = nullptr;
@ -1124,6 +1124,7 @@ nsXPCWrappedJSClass::CallMethod(nsXPCWrappedJS* wrapper, uint16_t methodIndex,
JSBool success; JSBool success;
JSBool readyToDoTheCall = false; JSBool readyToDoTheCall = false;
nsID param_iid; nsID param_iid;
const nsXPTMethodInfo* info = static_cast<const nsXPTMethodInfo*>(info_);
const char* name = info->name; const char* name = info->name;
jsval fval; jsval fval;
JSBool foundDependentParam; JSBool foundDependentParam;
@ -1143,6 +1144,17 @@ nsXPCWrappedJSClass::CallMethod(nsXPCWrappedJS* wrapper, uint16_t methodIndex,
if (!cx || !xpcc || !IsReflectable(methodIndex)) if (!cx || !xpcc || !IsReflectable(methodIndex))
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
// [implicit_jscontext] and [optional_argc] have a different calling
// convention, which we don't support for JS-implemented components.
if (info->WantsOptArgc() || info->WantsContext()) {
const char *str = "IDL methods marked with [implicit_jscontext] "
"or [optional_argc] may not be implemented in JS";
// Throw and warn for good measure.
JS_ReportError(cx, str);
NS_WARNING(str);
return NS_ERROR_FAILURE;
}
JSObject *obj = wrapper->GetJSObject(); JSObject *obj = wrapper->GetJSObject();
JSObject *thisObj = obj; JSObject *thisObj = obj;

View File

@ -510,6 +510,9 @@ XPCWrappedNative::GetNewOrUsed(XPCCallContext& ccx,
mozilla::Maybe<JSAutoCompartment> ac; mozilla::Maybe<JSAutoCompartment> ac;
if (sciWrapper.GetFlags().WantPreCreate()) { if (sciWrapper.GetFlags().WantPreCreate()) {
// PreCreate may touch dead compartments.
js::AutoMaybeTouchDeadCompartments agc(parent);
JSObject* plannedParent = parent; JSObject* plannedParent = parent;
nsresult rv = sciWrapper.GetCallback()->PreCreate(identity, ccx, nsresult rv = sciWrapper.GetCallback()->PreCreate(identity, ccx,
parent, &parent); parent, &parent);
@ -1753,6 +1756,9 @@ XPCWrappedNative::RescueOrphans(XPCCallContext& ccx)
return NS_OK; // Global object. We're done. return NS_OK; // Global object. We're done.
parentObj = js::UnwrapObject(parentObj, /* stopAtOuter = */ false); parentObj = js::UnwrapObject(parentObj, /* stopAtOuter = */ false);
// PreCreate may touch dead compartments.
js::AutoMaybeTouchDeadCompartments agc(parentObj);
// There's one little nasty twist here. For reasons described in bug 752764, // There's one little nasty twist here. For reasons described in bug 752764,
// we nuke SOW-ed objects after transplanting them. This means that nodes // we nuke SOW-ed objects after transplanting them. This means that nodes
// parented to an element (such as XUL elements), can end up with a nuked proxy // parented to an element (such as XUL elements), can end up with a nuked proxy
@ -2468,12 +2474,12 @@ CallMethodHelper::Call()
mCallContext.GetXPCContext()->SetLastResult(invokeResult); mCallContext.GetXPCContext()->SetLastResult(invokeResult);
if (NS_FAILED(invokeResult)) { if (JS_IsExceptionPending(mCallContext)) {
ThrowBadResult(invokeResult, mCallContext);
return false; return false;
} }
if (JS_IsExceptionPending(mCallContext)) { if (NS_FAILED(invokeResult)) {
ThrowBadResult(invokeResult, mCallContext);
return false; return false;
} }
@ -3810,6 +3816,9 @@ ConstructSlimWrapper(XPCCallContext &ccx,
return false; return false;
} }
// PreCreate may touch dead compartments.
js::AutoMaybeTouchDeadCompartments agc(parent);
JSObject* plannedParent = parent; JSObject* plannedParent = parent;
nsresult rv = classInfoHelper->PreCreate(identityObj, ccx, parent, &parent); nsresult rv = classInfoHelper->PreCreate(identityObj, ccx, parent, &parent);
if (rv != NS_SUCCESS_ALLOW_SLIM_WRAPPERS) { if (rv != NS_SUCCESS_ALLOW_SLIM_WRAPPERS) {

View File

@ -27,6 +27,7 @@
#include "nsBlockFrame.h" #include "nsBlockFrame.h"
#include "sampler.h" #include "sampler.h"
#include "nsExpirationTracker.h" #include "nsExpirationTracker.h"
#include "RoundedRect.h"
#include "gfxContext.h" #include "gfxContext.h"
@ -1801,7 +1802,6 @@ nsCSSBorderRenderer::DrawBorders()
} }
bool allBordersSolid; bool allBordersSolid;
bool noCornerOutsideCenter = true;
// First there's a couple of 'special cases' that have specifically optimized // First there's a couple of 'special cases' that have specifically optimized
// drawing paths, when none of these can be used we move on to the generalized // drawing paths, when none of these can be used we move on to the generalized
@ -1848,40 +1848,34 @@ nsCSSBorderRenderer::DrawBorders()
if (allBordersSame && if (allBordersSame &&
allBordersSameWidth &&
mCompositeColors[0] == NULL && mCompositeColors[0] == NULL &&
mBorderStyles[0] == NS_STYLE_BORDER_STYLE_SOLID && mBorderStyles[0] == NS_STYLE_BORDER_STYLE_SOLID &&
!mAvoidStroke) !mAvoidStroke &&
!mNoBorderRadius)
{ {
NS_FOR_CSS_CORNERS(i) { // Relatively simple case.
if (mBorderRadii[i].width <= mBorderWidths[0]) { SetupStrokeStyle(NS_SIDE_TOP);
noCornerOutsideCenter = false;
}
if (mBorderRadii[i].height <= mBorderWidths[0]) {
noCornerOutsideCenter = false;
}
}
// We can only do a stroke here if all border radii centers are inside the RoundedRect borderInnerRect(mOuterRect, mBorderRadii);
// inner rect, otherwise we get rendering artifacts. borderInnerRect.Deflate(mBorderWidths[NS_SIDE_TOP],
mBorderWidths[NS_SIDE_BOTTOM],
mBorderWidths[NS_SIDE_LEFT],
mBorderWidths[NS_SIDE_RIGHT]);
if (noCornerOutsideCenter) { // Instead of stroking we just use two paths: an inner and an outer.
// Relatively simple case. // This allows us to draw borders that we couldn't when stroking. For example,
SetupStrokeStyle(NS_SIDE_TOP); // borders with a border width >= the border radius. (i.e. when there are
mOuterRect.Deflate(mBorderWidths[0] / 2.0); // square corners on the inside)
NS_FOR_CSS_CORNERS(corner) { //
if (mBorderRadii.sizes[corner].height == 0 || mBorderRadii.sizes[corner].width == 0) { // Further, this approach can be more efficient because the backend
continue; // doesn't need to compute an offset curve to stroke the path. We know that
} // the rounded parts are elipses we can offset exactly and can just compute
mBorderRadii.sizes[corner].width -= mBorderWidths[0] / 2; // a new cubic approximation.
mBorderRadii.sizes[corner].height -= mBorderWidths[0] / 2; mContext->NewPath();
} mContext->RoundedRectangle(mOuterRect, mBorderRadii, true);
mContext->RoundedRectangle(borderInnerRect.rect, borderInnerRect.corners, false);
mContext->NewPath(); mContext->Fill();
mContext->RoundedRectangle(mOuterRect, mBorderRadii); return;
mContext->Stroke();
return;
}
} }
bool hasCompositeColors; bool hasCompositeColors;

View File

@ -55,6 +55,7 @@ private:
class SystemAllocPolicy { class SystemAllocPolicy {
public: public:
void *malloc_(size_t bytes) { return ::malloc(bytes); } void *malloc_(size_t bytes) { return ::malloc(bytes); }
void *calloc_(size_t bytes) { return ::calloc(bytes, 1); }
void *realloc_(void *p, size_t bytes) { return ::realloc(p, bytes); } void *realloc_(void *p, size_t bytes) { return ::realloc(p, bytes); }
void free_(void *p) { ::free(p); } void free_(void *p) { ::free(p); }
void reportAllocOverflow() const {} void reportAllocOverflow() const {}

View File

@ -265,24 +265,29 @@ public class GeckoEvent {
} }
public static GeckoEvent createNativeGestureEvent(int action, PointF pt, double size) { public static GeckoEvent createNativeGestureEvent(int action, PointF pt, double size) {
GeckoEvent event = new GeckoEvent(NATIVE_GESTURE_EVENT); try {
event.mAction = action; GeckoEvent event = new GeckoEvent(NATIVE_GESTURE_EVENT);
event.mCount = 1; event.mAction = action;
event.mPoints = new Point[1]; event.mCount = 1;
event.mPoints = new Point[1];
PointF geckoPoint = new PointF(pt.x, pt.y); PointF geckoPoint = new PointF(pt.x, pt.y);
geckoPoint = GeckoApp.mAppContext.getLayerView().convertViewPointToLayerPoint(geckoPoint); geckoPoint = GeckoApp.mAppContext.getLayerView().convertViewPointToLayerPoint(geckoPoint);
if (geckoPoint == null) { if (geckoPoint == null) {
// This could happen if Gecko isn't ready yet. // This could happen if Gecko isn't ready yet.
return null;
}
event.mPoints[0] = new Point(Math.round(geckoPoint.x), Math.round(geckoPoint.y));
event.mX = size;
event.mTime = System.currentTimeMillis();
return event;
} catch (Exception e) {
// This can happen if Gecko isn't ready yet
return null; return null;
} }
event.mPoints[0] = new Point(Math.round(geckoPoint.x), Math.round(geckoPoint.y));
event.mX = size;
event.mTime = System.currentTimeMillis();
return event;
} }
public static GeckoEvent createMotionEvent(MotionEvent m) { public static GeckoEvent createMotionEvent(MotionEvent m) {
@ -370,7 +375,7 @@ public class GeckoEvent {
mOrientations[index] = 0; mOrientations[index] = 0;
} }
mPressures[index] = event.getPressure(eventIndex); mPressures[index] = event.getPressure(eventIndex);
} catch(Exception ex) { } catch (Exception ex) {
Log.e(LOGTAG, "Error creating motion point " + index, ex); Log.e(LOGTAG, "Error creating motion point " + index, ex);
mPointRadii[index] = new Point(0, 0); mPointRadii[index] = new Point(0, 0);
mPoints[index] = new Point(0, 0); mPoints[index] = new Point(0, 0);

View File

@ -1 +1 @@
NSPR_4_9_3_RTM NSPR_4_9_4_BETA1

View File

@ -32,10 +32,10 @@
# #
# ------------------------------------------------------------------ # ------------------------------------------------------------------
FROMTOP=/share/builds/components/nspr20/v4.9.3 FROMTOP=/share/builds/components/nspr20/v4.9.4
TOTOP=./v4.9.3 TOTOP=./v4.9.4
NSPRDIR=nspr-4.9.3 NSPRDIR=nspr-4.9.4
SOURCETAG=NSPR_4_9_3_RTM SOURCETAG=NSPR_4_9_4_RTM
# #
# enumerate Unix object directories on /s/b/c # enumerate Unix object directories on /s/b/c

View File

@ -13,10 +13,6 @@
#include <limits.h> #include <limits.h>
#include <sys/types.h> #include <sys/types.h>
#if SUNOS4
#include "../pr/include/md/sunos4.h"
#endif
#ifndef PATH_MAX #ifndef PATH_MAX
#define PATH_MAX 1024 #define PATH_MAX 1024
#endif #endif

View File

@ -10,4 +10,3 @@
*/ */
#error "Do not include this header file." #error "Do not include this header file."

275
nsprpub/configure vendored
View File

@ -736,7 +736,7 @@ test "$host_alias" != "$target_alias" &&
MOD_MAJOR_VERSION=4 MOD_MAJOR_VERSION=4
MOD_MINOR_VERSION=9 MOD_MINOR_VERSION=9
MOD_PATCH_VERSION=3 MOD_PATCH_VERSION=4
NSPR_MODNAME=nspr20 NSPR_MODNAME=nspr20
_HAVE_PTHREADS= _HAVE_PTHREADS=
USE_PTHREADS= USE_PTHREADS=
@ -4777,80 +4777,6 @@ EOF
_OPTIMIZE_FLAGS=-O2 _OPTIMIZE_FLAGS=-O2
;; ;;
*-ncr-sysv*)
cat >> confdefs.h <<\EOF
#define XP_UNIX 1
EOF
cat >> confdefs.h <<\EOF
#define SVR4 1
EOF
cat >> confdefs.h <<\EOF
#define SYSV 1
EOF
cat >> confdefs.h <<\EOF
#define NCR 1
EOF
USE_NSPR_THREADS=1
if test "$OS_RELEASE" = "2.03"; then
cat >> confdefs.h <<\EOF
#define _PR_STAT_HAS_ST_ATIM 1
EOF
else
cat >> confdefs.h <<\EOF
#define _PR_STAT_HAS_ST_ATIM_UNION 1
EOF
fi
if test -z "$GNU_CC"; then
CFLAGS="$CFLAGS -Hnocopyr"
CXXFLAGS="$CXXFLAGS -Hnocopyr"
else
CFLAGS="$CFLAGS -fPIC -Wall"
CXXFLAGS="$CXXFLAGS -fPIC -Wall"
DSO_LDOPTS=-G
fi
MDCPUCFG_H=_ncr.cfg
PR_MD_CSRCS=ncr.c
;;
mips-nec-sysv*)
cat >> confdefs.h <<\EOF
#define XP_UNIX 1
EOF
cat >> confdefs.h <<\EOF
#define SVR4 1
EOF
cat >> confdefs.h <<\EOF
#define __SVR4 1
EOF
cat >> confdefs.h <<\EOF
#define NEC 1
EOF
cat >> confdefs.h <<\EOF
#define nec_ews 1
EOF
USE_NSPR_THREADS=1
if test -z "$GNU_CC"; then
CC='$(NSDEPTH)/build/hcc cc -Xa -KGnum=0 -KOlimit=4000'
CXX=g++
fi
OS_LIBS="$OS_LIBS -lsocket -lnsl -ldl"
DSO_LDOPTS=-G
MDCPUCFG_H=_nec.cfg
PR_MD_CSRCS=nec.c
;;
*-netbsd*) *-netbsd*)
cat >> confdefs.h <<\EOF cat >> confdefs.h <<\EOF
#define XP_UNIX 1 #define XP_UNIX 1
@ -4892,69 +4818,6 @@ EOF
fi fi
;; ;;
mips-sony-newsos*)
cat >> confdefs.h <<\EOF
#define XP_UNIX 1
EOF
cat >> confdefs.h <<\EOF
#define SONY 1
EOF
cat >> confdefs.h <<\EOF
#define SYSV 1
EOF
cat >> confdefs.h <<\EOF
#define SVR4 1
EOF
cat >> confdefs.h <<\EOF
#define __svr4 1
EOF
cat >> confdefs.h <<\EOF
#define __svr4__ 1
EOF
cat >> confdefs.h <<\EOF
#define HAVE_SVID_GETTOD 1
EOF
USE_NSPR_THREADS=1
CFLAGS="$CFLAGS -Xa -fullwarn"
CXXFLAGS="$CXXFLAGS -Xa -fullwarn"
DSO_LDOPTS=-G
MDCPUCFG_H=_sony.cfg
PR_MD_CSRCS=sony.c
;;
*-nextstep*|*-openstep*)
cat >> confdefs.h <<\EOF
#define XP_UNIX 1
EOF
cat >> confdefs.h <<\EOF
#define NEXTSTEP 1
EOF
cat >> confdefs.h <<\EOF
#define HAVE_BSD_FLOCK 1
EOF
cat >> confdefs.h <<\EOF
#define _POSIX_SOURCE 1
EOF
CFLAGS="$CFLAGS -Wall -fno-common -traditional-cpp -posix"
CXXFLAGS="$CXXFLAGS -Wall -fno-common -traditional-cpp -posix"
USE_NSPR_THREADS=1
DLL_SUFFIX=dylib
MDCPUCFG_H=_nextstep.cfg
PR_MD_CSRCS=nextstep.c
;;
*-nto*) *-nto*)
cat >> confdefs.h <<\EOF cat >> confdefs.h <<\EOF
#define XP_UNIX 1 #define XP_UNIX 1
@ -5048,17 +4911,17 @@ EOF
_OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Olimit 4000" _OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Olimit 4000"
ac_safe=`echo "machine/builtins.h" | sed 'y%./+-%__p_%'` ac_safe=`echo "machine/builtins.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for machine/builtins.h""... $ac_c" 1>&6 echo $ac_n "checking for machine/builtins.h""... $ac_c" 1>&6
echo "configure:5052: checking for machine/builtins.h" >&5 echo "configure:4915: checking for machine/builtins.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 5057 "configure" #line 4920 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <machine/builtins.h> #include <machine/builtins.h>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:5062: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:4925: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
@ -5186,96 +5049,6 @@ EOF
PR_MD_SRCS=scoos.c PR_MD_SRCS=scoos.c
;; ;;
*-sinix*)
cat >> confdefs.h <<\EOF
#define XP_UNIX 1
EOF
cat >> confdefs.h <<\EOF
#define SVR4 1
EOF
cat >> confdefs.h <<\EOF
#define SNI 1
EOF
cat >> confdefs.h <<\EOF
#define RELIANTUNIX 1
EOF
cat >> confdefs.h <<\EOF
#define sinix 1
EOF
cat >> confdefs.h <<\EOF
#define HAVE_SVID_GETTOD 1
EOF
if echo "$OS_TEST" | grep -c 86 2>/dev/null; then
cat >> confdefs.h <<\EOF
#define i386 1
EOF
CPU_ARCH=x86
else
CPU_ARCH=mips
fi
if test "$GNU_CC"; then
AS='$(CC) -x assembler-with-cpp'
if test "$CPU_ARCH" = "mips"; then
LD=gld
fi
CFLAGS="$CFLAGS -Wall -Wno-format"
else
AS='/usr/bin/cc'
_OPTIMIZE_FLAGS='-O -F Olimit,4000'
fi
DSO_LDOPTS='-G -z defs -h $(@:$(OBJDIR)/%.so=%.so)'
if test "$OS_RELEASE" = "5.43"; then
cat >> confdefs.h <<\EOF
#define IP_MULTICAST 1
EOF
fi
OS_LIBS="$OS_LIBS -lsocket -lnsl -lresolv -ldl -lc"
USE_NSPR_THREADS=1
MDCPUCFG_H=_reliantunix.cfg
PR_MD_CSRCS=reliantunix.c
if test "${OS_ARCH}" = "mips"; then
PR_MD_ASFILES=os_ReliantUNIX.s
fi
;;
*-sunos*)
cat >> confdefs.h <<\EOF
#define XP_UNIX 1
EOF
cat >> confdefs.h <<\EOF
#define SUNOS4 1
EOF
CFLAGS="$CFLAGS -Wall -Wno-format"
if test "$USE_MDUPDATE"; then
CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)"
fi
CPU_ARCH=sparc
DLL_SUFFIX=so.1.0
DSO_LDOPTS=
DSO_CFLAGS=-fPIC
USE_NSPR_THREADS=1
if test "$OS_RELEASE" = "4.1.3_U1"; then
_OPTIMIZE_FLAGS=
OS_LIBS="$OS_LIBS -lm"
fi
MDCPUCFG_H=_sunos4.cfg
PR_MD_CSRCS=sunos4.c
;;
*-solaris*) *-solaris*)
if test -z "$USE_NSPR_THREADS"; then if test -z "$USE_NSPR_THREADS"; then
USE_PTHREADS=1 USE_PTHREADS=1
@ -5707,7 +5480,7 @@ case $target in
;; ;;
*) *)
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
echo "configure:5711: checking for dlopen in -ldl" >&5 echo "configure:5484: checking for dlopen in -ldl" >&5
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
@ -5715,7 +5488,7 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS" LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 5719 "configure" #line 5492 "configure"
#include "confdefs.h" #include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
@ -5726,7 +5499,7 @@ int main() {
dlopen() dlopen()
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:5730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:5503: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
@ -5743,17 +5516,17 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6 echo "$ac_t""yes" 1>&6
ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'` ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6 echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6
echo "configure:5747: checking for dlfcn.h" >&5 echo "configure:5520: checking for dlfcn.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 5752 "configure" #line 5525 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <dlfcn.h> #include <dlfcn.h>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:5757: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:5530: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
@ -5786,13 +5559,13 @@ esac
if test $ac_cv_prog_gcc = yes; then if test $ac_cv_prog_gcc = yes; then
echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
echo "configure:5790: checking whether ${CC-cc} needs -traditional" >&5 echo "configure:5563: checking whether ${CC-cc} needs -traditional" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
ac_pattern="Autoconf.*'x'" ac_pattern="Autoconf.*'x'"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 5796 "configure" #line 5569 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <sgtty.h> #include <sgtty.h>
Autoconf TIOCGETP Autoconf TIOCGETP
@ -5810,7 +5583,7 @@ rm -f conftest*
if test $ac_cv_prog_gcc_traditional = no; then if test $ac_cv_prog_gcc_traditional = no; then
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 5814 "configure" #line 5587 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <termio.h> #include <termio.h>
Autoconf TCGETA Autoconf TCGETA
@ -5836,12 +5609,12 @@ LIBS="$LIBS $OS_LIBS"
for ac_func in lchown strerror dladdr for ac_func in lchown strerror dladdr
do do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:5840: checking for $ac_func" >&5 echo "configure:5613: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 5845 "configure" #line 5618 "configure"
#include "confdefs.h" #include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes, /* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */ which can conflict with char $ac_func(); below. */
@ -5864,7 +5637,7 @@ $ac_func();
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:5868: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:5641: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_func_$ac_func=yes" eval "ac_cv_func_$ac_func=yes"
else else
@ -5916,7 +5689,7 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args. # Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2 set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:5920: checking for $ac_word" >&5 echo "configure:5693: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_CCACHE'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_path_CCACHE'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
@ -5975,7 +5748,7 @@ hpux*)
if test -z "$GNU_CC"; then if test -z "$GNU_CC"; then
echo $ac_n "checking for +Olit support""... $ac_c" 1>&6 echo $ac_n "checking for +Olit support""... $ac_c" 1>&6
echo "configure:5979: checking for +Olit support" >&5 echo "configure:5752: checking for +Olit support" >&5
if eval "test \"`echo '$''{'ac_cv_hpux_usable_olit_option'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_hpux_usable_olit_option'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
@ -6017,7 +5790,7 @@ wince*)
*) *)
echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6 echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6
echo "configure:6021: checking for pthread_create in -lpthreads" >&5 echo "configure:5794: checking for pthread_create in -lpthreads" >&5
echo " echo "
#include <pthread.h> #include <pthread.h>
void *foo(void *v) { return v; } void *foo(void *v) { return v; }
@ -6039,7 +5812,7 @@ echo "
echo "$ac_t""no" 1>&6 echo "$ac_t""no" 1>&6
echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
echo "configure:6043: checking for pthread_create in -lpthread" >&5 echo "configure:5816: checking for pthread_create in -lpthread" >&5
echo " echo "
#include <pthread.h> #include <pthread.h>
void *foo(void *v) { return v; } void *foo(void *v) { return v; }
@ -6061,7 +5834,7 @@ echo "
echo "$ac_t""no" 1>&6 echo "$ac_t""no" 1>&6
echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6 echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
echo "configure:6065: checking for pthread_create in -lc_r" >&5 echo "configure:5838: checking for pthread_create in -lc_r" >&5
echo " echo "
#include <pthread.h> #include <pthread.h>
void *foo(void *v) { return v; } void *foo(void *v) { return v; }
@ -6083,7 +5856,7 @@ echo "
echo "$ac_t""no" 1>&6 echo "$ac_t""no" 1>&6
echo $ac_n "checking for pthread_create in -lc""... $ac_c" 1>&6 echo $ac_n "checking for pthread_create in -lc""... $ac_c" 1>&6
echo "configure:6087: checking for pthread_create in -lc" >&5 echo "configure:5860: checking for pthread_create in -lc" >&5
echo " echo "
#include <pthread.h> #include <pthread.h>
void *foo(void *v) { return v; } void *foo(void *v) { return v; }
@ -6201,7 +5974,7 @@ if test -n "$USE_PTHREADS"; then
rm -f conftest* rm -f conftest*
ac_cv_have_dash_pthread=no ac_cv_have_dash_pthread=no
echo $ac_n "checking whether ${CC-cc} accepts -pthread""... $ac_c" 1>&6 echo $ac_n "checking whether ${CC-cc} accepts -pthread""... $ac_c" 1>&6
echo "configure:6205: checking whether ${CC-cc} accepts -pthread" >&5 echo "configure:5978: checking whether ${CC-cc} accepts -pthread" >&5
echo 'int main() { return 0; }' | cat > conftest.c echo 'int main() { return 0; }' | cat > conftest.c
${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1 ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
if test $? -eq 0; then if test $? -eq 0; then
@ -6224,7 +5997,7 @@ echo "configure:6205: checking whether ${CC-cc} accepts -pthread" >&5
ac_cv_have_dash_pthreads=no ac_cv_have_dash_pthreads=no
if test "$ac_cv_have_dash_pthread" = "no"; then if test "$ac_cv_have_dash_pthread" = "no"; then
echo $ac_n "checking whether ${CC-cc} accepts -pthreads""... $ac_c" 1>&6 echo $ac_n "checking whether ${CC-cc} accepts -pthreads""... $ac_c" 1>&6
echo "configure:6228: checking whether ${CC-cc} accepts -pthreads" >&5 echo "configure:6001: checking whether ${CC-cc} accepts -pthreads" >&5
echo 'int main() { return 0; }' | cat > conftest.c echo 'int main() { return 0; }' | cat > conftest.c
${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1 ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
if test $? -eq 0; then if test $? -eq 0; then

View File

@ -15,7 +15,7 @@ dnl = Defaults
dnl ======================================================== dnl ========================================================
MOD_MAJOR_VERSION=4 MOD_MAJOR_VERSION=4
MOD_MINOR_VERSION=9 MOD_MINOR_VERSION=9
MOD_PATCH_VERSION=3 MOD_PATCH_VERSION=4
NSPR_MODNAME=nspr20 NSPR_MODNAME=nspr20
_HAVE_PTHREADS= _HAVE_PTHREADS=
USE_PTHREADS= USE_PTHREADS=
@ -2065,47 +2065,6 @@ tools are selected during the Xcode/Developer Tools installation.])
_OPTIMIZE_FLAGS=-O2 _OPTIMIZE_FLAGS=-O2
;; ;;
*-ncr-sysv*)
AC_DEFINE(XP_UNIX)
AC_DEFINE(SVR4)
AC_DEFINE(SYSV)
AC_DEFINE(NCR)
USE_NSPR_THREADS=1
if test "$OS_RELEASE" = "2.03"; then
AC_DEFINE(_PR_STAT_HAS_ST_ATIM)
else
AC_DEFINE(_PR_STAT_HAS_ST_ATIM_UNION)
fi
if test -z "$GNU_CC"; then
CFLAGS="$CFLAGS -Hnocopyr"
CXXFLAGS="$CXXFLAGS -Hnocopyr"
else
CFLAGS="$CFLAGS -fPIC -Wall"
CXXFLAGS="$CXXFLAGS -fPIC -Wall"
DSO_LDOPTS=-G
fi
MDCPUCFG_H=_ncr.cfg
PR_MD_CSRCS=ncr.c
;;
mips-nec-sysv*)
AC_DEFINE(XP_UNIX)
AC_DEFINE(SVR4)
AC_DEFINE(__SVR4)
AC_DEFINE(NEC)
AC_DEFINE(nec_ews)
USE_NSPR_THREADS=1
if test -z "$GNU_CC"; then
CC='$(NSDEPTH)/build/hcc cc -Xa -KGnum=0 -KOlimit=4000'
CXX=g++
fi
OS_LIBS="$OS_LIBS -lsocket -lnsl -ldl"
DSO_LDOPTS=-G
MDCPUCFG_H=_nec.cfg
PR_MD_CSRCS=nec.c
;;
*-netbsd*) *-netbsd*)
AC_DEFINE(XP_UNIX) AC_DEFINE(XP_UNIX)
AC_DEFINE(NETBSD) AC_DEFINE(NETBSD)
@ -2138,36 +2097,6 @@ mips-nec-sysv*)
fi fi
;; ;;
mips-sony-newsos*)
AC_DEFINE(XP_UNIX)
AC_DEFINE(SONY)
AC_DEFINE(SYSV)
AC_DEFINE(SVR4)
AC_DEFINE(__svr4)
AC_DEFINE(__svr4__)
AC_DEFINE(HAVE_SVID_GETTOD)
USE_NSPR_THREADS=1
CFLAGS="$CFLAGS -Xa -fullwarn"
CXXFLAGS="$CXXFLAGS -Xa -fullwarn"
DSO_LDOPTS=-G
MDCPUCFG_H=_sony.cfg
PR_MD_CSRCS=sony.c
;;
*-nextstep*|*-openstep*)
AC_DEFINE(XP_UNIX)
AC_DEFINE(NEXTSTEP)
AC_DEFINE(HAVE_BSD_FLOCK)
AC_DEFINE(_POSIX_SOURCE)
CFLAGS="$CFLAGS -Wall -fno-common -traditional-cpp -posix"
CXXFLAGS="$CXXFLAGS -Wall -fno-common -traditional-cpp -posix"
USE_NSPR_THREADS=1
DLL_SUFFIX=dylib
MDCPUCFG_H=_nextstep.cfg
PR_MD_CSRCS=nextstep.c
;;
*-nto*) *-nto*)
AC_DEFINE(XP_UNIX) AC_DEFINE(XP_UNIX)
AC_DEFINE(NTO) AC_DEFINE(NTO)
@ -2280,66 +2209,6 @@ mips-sony-newsos*)
PR_MD_SRCS=scoos.c PR_MD_SRCS=scoos.c
;; ;;
*-sinix*)
AC_DEFINE(XP_UNIX)
AC_DEFINE(SVR4)
AC_DEFINE(SNI)
AC_DEFINE(RELIANTUNIX)
AC_DEFINE(sinix)
AC_DEFINE(HAVE_SVID_GETTOD)
if echo "$OS_TEST" | grep -c 86 2>/dev/null; then
AC_DEFINE(i386)
CPU_ARCH=x86
else
CPU_ARCH=mips
fi
if test "$GNU_CC"; then
AS='$(CC) -x assembler-with-cpp'
if test "$CPU_ARCH" = "mips"; then
LD=gld
fi
CFLAGS="$CFLAGS -Wall -Wno-format"
else
AS='/usr/bin/cc'
_OPTIMIZE_FLAGS='-O -F Olimit,4000'
fi
DSO_LDOPTS='-G -z defs -h $(@:$(OBJDIR)/%.so=%.so)'
if test "$OS_RELEASE" = "5.43"; then
AC_DEFINE(IP_MULTICAST)
fi
OS_LIBS="$OS_LIBS -lsocket -lnsl -lresolv -ldl -lc"
USE_NSPR_THREADS=1
MDCPUCFG_H=_reliantunix.cfg
PR_MD_CSRCS=reliantunix.c
if test "${OS_ARCH}" = "mips"; then
PR_MD_ASFILES=os_ReliantUNIX.s
fi
;;
*-sunos*)
AC_DEFINE(XP_UNIX)
AC_DEFINE(SUNOS4)
CFLAGS="$CFLAGS -Wall -Wno-format"
if test "$USE_MDUPDATE"; then
CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)"
fi
CPU_ARCH=sparc
DLL_SUFFIX=so.1.0
DSO_LDOPTS=
DSO_CFLAGS=-fPIC
USE_NSPR_THREADS=1
if test "$OS_RELEASE" = "4.1.3_U1"; then
_OPTIMIZE_FLAGS=
OS_LIBS="$OS_LIBS -lm"
fi
MDCPUCFG_H=_sunos4.cfg
PR_MD_CSRCS=sunos4.c
;;
*-solaris*) *-solaris*)
if test -z "$USE_NSPR_THREADS"; then if test -z "$USE_NSPR_THREADS"; then
USE_PTHREADS=1 USE_PTHREADS=1

View File

@ -55,6 +55,8 @@
/* Timer operations */ /* Timer operations */
#if defined(AIX_TIMERS) #if defined(AIX_TIMERS)
#define _MD_INTERVAL_INIT()
extern PRIntervalTime _MD_AixGetInterval(void); extern PRIntervalTime _MD_AixGetInterval(void);
#define _MD_GET_INTERVAL _MD_AixGetInterval #define _MD_GET_INTERVAL _MD_AixGetInterval
@ -62,8 +64,7 @@ extern PRIntervalTime _MD_AixIntervalPerSec(void);
#define _MD_INTERVAL_PER_SEC _MD_AixIntervalPerSec #define _MD_INTERVAL_PER_SEC _MD_AixIntervalPerSec
#else /* defined(AIX_TIMERS) */ #else /* defined(AIX_TIMERS) */
#define _MD_GET_INTERVAL _PR_UNIX_GetInterval #define _MD_INTERVAL_USE_GTOD
#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond
#endif /* defined(AIX_TIMERS) */ #endif /* defined(AIX_TIMERS) */
#ifdef AIX_HAVE_ATOMIC_OP_H #ifdef AIX_HAVE_ATOMIC_OP_H

View File

@ -176,7 +176,6 @@ struct _MDCPU {
#include <sys/syscall.h> #include <sys/syscall.h>
#define _MD_SELECT(nfds,r,w,e,tv) syscall(SYS_select,nfds,r,w,e,tv) #define _MD_SELECT(nfds,r,w,e,tv) syscall(SYS_select,nfds,r,w,e,tv)
#define _MD_GET_INTERVAL _PR_UNIX_GetInterval #define _MD_INTERVAL_USE_GTOD
#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond
#endif /* nspr_bsdi_defs_h___ */ #endif /* nspr_bsdi_defs_h___ */

View File

@ -280,12 +280,14 @@ extern void _MD_YIELD(void);
#define _MD_EARLY_INIT _MD_EarlyInit #define _MD_EARLY_INIT _MD_EarlyInit
#define _MD_FINAL_INIT _PR_UnixInit #define _MD_FINAL_INIT _PR_UnixInit
#define _MD_GET_INTERVAL _PR_UNIX_GetInterval #define _MD_INTERVAL_INIT _PR_Mach_IntervalInit
#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond #define _MD_GET_INTERVAL _PR_Mach_GetInterval
#define _MD_INTERVAL_PER_SEC _PR_Mach_TicksPerSecond
extern void _MD_EarlyInit(void); extern void _MD_EarlyInit(void);
extern PRIntervalTime _PR_UNIX_GetInterval(void); extern void _PR_Mach_IntervalInit(void);
extern PRIntervalTime _PR_UNIX_TicksPerSecond(void); extern PRIntervalTime _PR_Mach_GetInterval(void);
extern PRIntervalTime _PR_Mach_TicksPerSecond(void);
/* /*
* We wrapped the select() call. _MD_SELECT refers to the built-in, * We wrapped the select() call. _MD_SELECT refers to the built-in,

View File

@ -158,8 +158,7 @@ struct _MDCPU {
* some of them should probably be moved into _unixos.h. But * some of them should probably be moved into _unixos.h. But
* _irix.h seems to be quite different in regard to these macros. * _irix.h seems to be quite different in regard to these macros.
*/ */
#define _MD_GET_INTERVAL _PR_UNIX_GetInterval #define _MD_INTERVAL_USE_GTOD
#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond
#define _MD_EARLY_INIT _MD_EarlyInit #define _MD_EARLY_INIT _MD_EarlyInit
#define _MD_FINAL_INIT _PR_UnixInit #define _MD_FINAL_INIT _PR_UnixInit

View File

@ -215,13 +215,10 @@ extern void _MD_YIELD(void);
#endif /* ! _PR_PTHREADS */ #endif /* ! _PR_PTHREADS */
extern void _MD_EarlyInit(void); extern void _MD_EarlyInit(void);
extern PRIntervalTime _PR_UNIX_GetInterval(void);
extern PRIntervalTime _PR_UNIX_TicksPerSecond(void);
#define _MD_EARLY_INIT _MD_EarlyInit #define _MD_EARLY_INIT _MD_EarlyInit
#define _MD_FINAL_INIT _PR_UnixInit #define _MD_FINAL_INIT _PR_UnixInit
#define _MD_GET_INTERVAL _PR_UNIX_GetInterval #define _MD_INTERVAL_USE_GTOD
#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond
/* /*
* We wrapped the select() call. _MD_SELECT refers to the built-in, * We wrapped the select() call. _MD_SELECT refers to the built-in,

View File

@ -269,8 +269,7 @@ extern PRIntervalTime _PR_HPUX_LW_GetInterval(void);
#define _MD_GET_INTERVAL _PR_HPUX_LW_GetInterval #define _MD_GET_INTERVAL _PR_HPUX_LW_GetInterval
#define _MD_INTERVAL_PER_SEC() 1000 #define _MD_INTERVAL_PER_SEC() 1000
#else #else
#define _MD_GET_INTERVAL _PR_UNIX_GetInterval #define _MD_INTERVAL_USE_GTOD
#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond
#endif #endif
/* /*

View File

@ -626,13 +626,10 @@ extern void _MD_YIELD(void);
#endif /* ! _PR_PTHREADS */ #endif /* ! _PR_PTHREADS */
extern void _MD_EarlyInit(void); extern void _MD_EarlyInit(void);
extern PRIntervalTime _PR_UNIX_GetInterval(void);
extern PRIntervalTime _PR_UNIX_TicksPerSecond(void);
#define _MD_EARLY_INIT _MD_EarlyInit #define _MD_EARLY_INIT _MD_EarlyInit
#define _MD_FINAL_INIT _PR_UnixInit #define _MD_FINAL_INIT _PR_UnixInit
#define _MD_GET_INTERVAL _PR_UNIX_GetInterval #define HAVE_CLOCK_MONOTONIC
#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond
/* /*
* We wrapped the select() call. _MD_SELECT refers to the built-in, * We wrapped the select() call. _MD_SELECT refers to the built-in,

View File

@ -1,108 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nspr_cpucfg___
#define nspr_cpucfg___
#ifndef XP_UNIX
#define XP_UNIX
#endif
#ifndef NCR
#define NCR
#endif
#define IS_LITTLE_ENDIAN 1
#undef IS_BIG_ENDIAN
#undef HAVE_LONG_LONG
#undef HAVE_ALIGNED_DOUBLES
#undef HAVE_ALIGNED_LONGLONGS
#define PR_BYTES_PER_BYTE 1
#define PR_BYTES_PER_SHORT 2
#define PR_BYTES_PER_INT 4
#define PR_BYTES_PER_INT64 8
#define PR_BYTES_PER_LONG 4
#define PR_BYTES_PER_FLOAT 4
#define PR_BYTES_PER_DOUBLE 8
#define PR_BYTES_PER_WORD 4
#define PR_BYTES_PER_DWORD 8
#define PR_BYTES_PER_WORD_LOG2 2
#define PR_BYTES_PER_DWORD_LOG2 3
#define PR_BITS_PER_BYTE 8
#define PR_BITS_PER_SHORT 16
#define PR_BITS_PER_INT 32
#define PR_BITS_PER_INT64 64
#define PR_BITS_PER_LONG 32
#define PR_BITS_PER_FLOAT 32
#define PR_BITS_PER_DOUBLE 64
#define PR_BITS_PER_WORD 32
#define PR_BITS_PER_BYTE_LOG2 3
#define PR_BITS_PER_SHORT_LOG2 4
#define PR_BITS_PER_INT_LOG2 5
#define PR_BITS_PER_INT64_LOG2 6
#define PR_BITS_PER_LONG_LOG2 5
#define PR_BITS_PER_FLOAT_LOG2 5
#define PR_BITS_PER_DOUBLE_LOG2 6
#define PR_BITS_PER_WORD_LOG2 5
#define PR_ALIGN_OF_SHORT 2
#define PR_ALIGN_OF_INT 4
#define PR_ALIGN_OF_LONG 4
#define PR_ALIGN_OF_INT64 4
#define PR_ALIGN_OF_FLOAT 4
#define PR_ALIGN_OF_DOUBLE 4
#define PR_ALIGN_OF_POINTER 4
#define _PR_POLL_BACKCOMPAT
#ifndef NO_NSPR_10_SUPPORT
#define BYTES_PER_BYTE PR_BYTES_PER_BYTE
#define BYTES_PER_SHORT PR_BYTES_PER_SHORT
#define BYTES_PER_INT PR_BYTES_PER_INT
#define BYTES_PER_INT64 PR_BYTES_PER_INT64
#define BYTES_PER_LONG PR_BYTES_PER_LONG
#define BYTES_PER_FLOAT PR_BYTES_PER_FLOAT
#define BYTES_PER_DOUBLE PR_BYTES_PER_DOUBLE
#define BYTES_PER_WORD PR_BYTES_PER_WORD
#define BYTES_PER_DWORD PR_BYTES_PER_DWORD
#define BITS_PER_BYTE PR_BITS_PER_BYTE
#define BITS_PER_SHORT PR_BITS_PER_SHORT
#define BITS_PER_INT PR_BITS_PER_INT
#define BITS_PER_INT64 PR_BITS_PER_INT64
#define BITS_PER_LONG PR_BITS_PER_LONG
#define BITS_PER_FLOAT PR_BITS_PER_FLOAT
#define BITS_PER_DOUBLE PR_BITS_PER_DOUBLE
#define BITS_PER_WORD PR_BITS_PER_WORD
#define BITS_PER_BYTE_LOG2 PR_BITS_PER_BYTE_LOG2
#define BITS_PER_SHORT_LOG2 PR_BITS_PER_SHORT_LOG2
#define BITS_PER_INT_LOG2 PR_BITS_PER_INT_LOG2
#define BITS_PER_INT64_LOG2 PR_BITS_PER_INT64_LOG2
#define BITS_PER_LONG_LOG2 PR_BITS_PER_LONG_LOG2
#define BITS_PER_FLOAT_LOG2 PR_BITS_PER_FLOAT_LOG2
#define BITS_PER_DOUBLE_LOG2 PR_BITS_PER_DOUBLE_LOG2
#define BITS_PER_WORD_LOG2 PR_BITS_PER_WORD_LOG2
#define ALIGN_OF_SHORT PR_ALIGN_OF_SHORT
#define ALIGN_OF_INT PR_ALIGN_OF_INT
#define ALIGN_OF_LONG PR_ALIGN_OF_LONG
#define ALIGN_OF_INT64 PR_ALIGN_OF_INT64
#define ALIGN_OF_FLOAT PR_ALIGN_OF_FLOAT
#define ALIGN_OF_DOUBLE PR_ALIGN_OF_DOUBLE
#define ALIGN_OF_POINTER PR_ALIGN_OF_POINTER
#define ALIGN_OF_WORD PR_ALIGN_OF_WORD
#define BYTES_PER_WORD_LOG2 PR_BYTES_PER_WORD_LOG2
#define BYTES_PER_DWORD_LOG2 PR_BYTES_PER_DWORD_LOG2
#define WORDS_PER_DWORD_LOG2 PR_WORDS_PER_DWORD_LOG2
#endif /* NO_NSPR_10_SUPPORT */
#endif /* nspr_cpucfg___ */

View File

@ -1,198 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nspr_unixware_defs_h___
#define nspr_unixware_defs_h___
/*
* Internal configuration macros
*/
#define PR_LINKER_ARCH "ncr"
#define _PR_SI_SYSNAME "NCR"
#define _PR_SI_ARCHITECTURE "x86"
#define PR_DLL_SUFFIX ".so"
#define _PR_VMBASE 0x30000000
#define _PR_STACK_VMBASE 0x50000000
#define _MD_DEFAULT_STACK_SIZE 65536L
#define _MD_MMAP_FLAGS MAP_PRIVATE
#define HAVE_DLL
#define USE_DLFCN
#define _PR_RECV_BROKEN /* recv doesn't work on Unix Domain Sockets */
#if !defined (HAVE_STRERROR)
#define HAVE_STRERROR
#endif
#ifndef HAVE_WEAK_IO_SYMBOLS
#define HAVE_WEAK_IO_SYMBOLS
#endif
#define _PR_POLL_AVAILABLE
#define _PR_USE_POLL
#define _PR_NO_LARGE_FILES
#undef HAVE_STACK_GROWING_UP
#define HAVE_NETCONFIG
#define NEED_STRFTIME_LOCK
#define NEED_TIME_R
#define NEED_LOCALTIME_R
#define NEED_GMTIME_R
#define NEED_ASCTIME_R
#define NEED_STRTOK_R
#define NEED_CTIME_R
#define _PR_NEED_STRCASECMP
#define USE_SETJMP
#include <setjmp.h>
#define _SETJMP setjmp
#define _LONGJMP longjmp
#define _PR_CONTEXT_TYPE jmp_buf
#define _MD_GET_SP(_t) (_t)->md.context[4]
#define _PR_NUM_GCREGS _JBLEN
#define CONTEXT(_th) ((_th)->md.context)
/*
** Initialize the thread context preparing it to execute _main.
*/
#define _MD_INIT_CONTEXT(_thread, _sp, _main, status) \
{ \
*status = PR_TRUE; \
if(_SETJMP(CONTEXT(_thread))) (*_main)(); \
_MD_GET_SP(_thread) = (int) ((_sp) - 128); \
}
#define _MD_SWITCH_CONTEXT(_thread) \
if (!_SETJMP(CONTEXT(_thread))) { \
(_thread)->md.errcode = errno; \
_PR_Schedule(); \
}
/*
** Restore a thread context, saved by _MD_SWITCH_CONTEXT
*/
#define _MD_RESTORE_CONTEXT(_thread) \
{ \
errno = (_thread)->md.errcode; \
_MD_SET_CURRENT_THREAD(_thread); \
_LONGJMP(CONTEXT(_thread), 1); \
}
/* Machine-dependent (MD) data structures.
* Don't use SVR4 native threads (yet).
*/
struct _MDThread {
_PR_CONTEXT_TYPE context;
int id;
int errcode;
};
struct _MDThreadStack {
PRInt8 notused;
};
struct _MDLock {
PRInt8 notused;
};
struct _MDSemaphore {
PRInt8 notused;
};
struct _MDCVar {
PRInt8 notused;
};
struct _MDSegment {
PRInt8 notused;
};
/*
* md-specific cpu structure field
*/
#define _PR_MD_MAX_OSFD FD_SETSIZE
struct _MDCPU_Unix {
PRCList ioQ;
PRUint32 ioq_timeout;
PRInt32 ioq_max_osfd;
PRInt32 ioq_osfd_cnt;
#ifndef _PR_USE_POLL
fd_set fd_read_set, fd_write_set, fd_exception_set;
PRInt16 fd_read_cnt[_PR_MD_MAX_OSFD],fd_write_cnt[_PR_MD_MAX_OSFD],
fd_exception_cnt[_PR_MD_MAX_OSFD];
#else
struct pollfd *ioq_pollfds;
int ioq_pollfds_size;
#endif /* _PR_USE_POLL */
};
#define _PR_IOQ(_cpu) ((_cpu)->md.md_unix.ioQ)
#define _PR_ADD_TO_IOQ(_pq, _cpu) PR_APPEND_LINK(&_pq.links, &_PR_IOQ(_cpu))
#define _PR_FD_READ_SET(_cpu) ((_cpu)->md.md_unix.fd_read_set)
#define _PR_FD_READ_CNT(_cpu) ((_cpu)->md.md_unix.fd_read_cnt)
#define _PR_FD_WRITE_SET(_cpu) ((_cpu)->md.md_unix.fd_write_set)
#define _PR_FD_WRITE_CNT(_cpu) ((_cpu)->md.md_unix.fd_write_cnt)
#define _PR_FD_EXCEPTION_SET(_cpu) ((_cpu)->md.md_unix.fd_exception_set)
#define _PR_FD_EXCEPTION_CNT(_cpu) ((_cpu)->md.md_unix.fd_exception_cnt)
#define _PR_IOQ_TIMEOUT(_cpu) ((_cpu)->md.md_unix.ioq_timeout)
#define _PR_IOQ_MAX_OSFD(_cpu) ((_cpu)->md.md_unix.ioq_max_osfd)
#define _PR_IOQ_OSFD_CNT(_cpu) ((_cpu)->md.md_unix.ioq_osfd_cnt)
#define _PR_IOQ_POLLFDS(_cpu) ((_cpu)->md.md_unix.ioq_pollfds)
#define _PR_IOQ_POLLFDS_SIZE(_cpu) ((_cpu)->md.md_unix.ioq_pollfds_size)
#define _PR_IOQ_MIN_POLLFDS_SIZE(_cpu) 32
struct _MDCPU {
struct _MDCPU_Unix md_unix;
};
#define _MD_INIT_LOCKS()
#define _MD_NEW_LOCK(lock) PR_SUCCESS
#define _MD_FREE_LOCK(lock)
#define _MD_LOCK(lock)
#define _MD_UNLOCK(lock)
#define _MD_INIT_IO()
#define _MD_IOQ_LOCK()
#define _MD_IOQ_UNLOCK()
/*
* The following are copied from _sunos.h, _aix.h. This means
* some of them should probably be moved into _unixos.h. But
* _irix.h seems to be quite different in regard to these macros.
*/
#define _MD_GET_INTERVAL _PR_UNIX_GetInterval
#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond
#define _MD_EARLY_INIT _MD_EarlyInit
#define _MD_FINAL_INIT _PR_UnixInit
#define _MD_INIT_RUNNING_CPU(cpu) _MD_unix_init_running_cpu(cpu)
#define _MD_INIT_THREAD _MD_InitializeThread
#define _MD_EXIT_THREAD(thread)
#define _MD_SUSPEND_THREAD(thread)
#define _MD_RESUME_THREAD(thread)
#define _MD_CLEAN_THREAD(_thread)
/*
* We wrapped the select() call. _MD_SELECT refers to the built-in,
* unwrapped version.
*/
#include <sys/time.h>
#include <sys/types.h>
#include <sys/select.h>
extern int _select(int nfds, fd_set *readfds, fd_set *writefds,
fd_set *execptfds, struct timeval *timeout);
#define _MD_SELECT _select
#define _MD_POLL _poll
extern int _poll(struct pollfd *fds, unsigned long nfds, int timeout);
#endif /* nspr_ncr_defs_h */

View File

@ -1,108 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nspr_cpucfg___
#define nspr_cpucfg___
#ifndef XP_UNIX
#define XP_UNIX
#endif
#ifndef NEC
#define NEC
#endif
#undef IS_LITTLE_ENDIAN
#define IS_BIG_ENDIAN 1
#undef HAVE_LONG_LONG
#undef HAVE_ALIGNED_DOUBLES
#undef HAVE_ALIGNED_LONGLONGS
#define PR_BYTES_PER_BYTE 1
#define PR_BYTES_PER_SHORT 2
#define PR_BYTES_PER_INT 4
#define PR_BYTES_PER_INT64 8
#define PR_BYTES_PER_LONG 4
#define PR_BYTES_PER_FLOAT 4
#define PR_BYTES_PER_DOUBLE 8
#define PR_BYTES_PER_WORD 4
#define PR_BYTES_PER_DWORD 8
#define PR_BITS_PER_BYTE 8
#define PR_BITS_PER_SHORT 16
#define PR_BITS_PER_INT 32
#define PR_BITS_PER_INT64 64
#define PR_BITS_PER_LONG 32
#define PR_BITS_PER_FLOAT 32
#define PR_BITS_PER_DOUBLE 64
#define PR_BITS_PER_WORD 32
#define PR_BITS_PER_BYTE_LOG2 3
#define PR_BITS_PER_SHORT_LOG2 4
#define PR_BITS_PER_INT_LOG2 5
#define PR_BITS_PER_INT64_LOG2 6
#define PR_BITS_PER_LONG_LOG2 5
#define PR_BITS_PER_FLOAT_LOG2 5
#define PR_BITS_PER_DOUBLE_LOG2 6
#define PR_BITS_PER_WORD_LOG2 5
#define PR_ALIGN_OF_SHORT 2
#define PR_ALIGN_OF_INT 4
#define PR_ALIGN_OF_LONG 4
#define PR_ALIGN_OF_INT64 4
#define PR_ALIGN_OF_FLOAT 4
#define PR_ALIGN_OF_DOUBLE 8
#define PR_ALIGN_OF_POINTER 4
#define PR_ALIGN_OF_WORD 4
#define PR_BYTES_PER_WORD_LOG2 2
#define PR_BYTES_PER_DWORD_LOG2 3
#ifndef NO_NSPR_10_SUPPORT
#define BYTES_PER_BYTE PR_BYTES_PER_BYTE
#define BYTES_PER_SHORT PR_BYTES_PER_SHORT
#define BYTES_PER_INT PR_BYTES_PER_INT
#define BYTES_PER_INT64 PR_BYTES_PER_INT64
#define BYTES_PER_LONG PR_BYTES_PER_LONG
#define BYTES_PER_FLOAT PR_BYTES_PER_FLOAT
#define BYTES_PER_DOUBLE PR_BYTES_PER_DOUBLE
#define BYTES_PER_WORD PR_BYTES_PER_WORD
#define BYTES_PER_DWORD PR_BYTES_PER_DWORD
#define BITS_PER_BYTE PR_BITS_PER_BYTE
#define BITS_PER_SHORT PR_BITS_PER_SHORT
#define BITS_PER_INT PR_BITS_PER_INT
#define BITS_PER_INT64 PR_BITS_PER_INT64
#define BITS_PER_LONG PR_BITS_PER_LONG
#define BITS_PER_FLOAT PR_BITS_PER_FLOAT
#define BITS_PER_DOUBLE PR_BITS_PER_DOUBLE
#define BITS_PER_WORD PR_BITS_PER_WORD
#define BITS_PER_BYTE_LOG2 PR_BITS_PER_BYTE_LOG2
#define BITS_PER_SHORT_LOG2 PR_BITS_PER_SHORT_LOG2
#define BITS_PER_INT_LOG2 PR_BITS_PER_INT_LOG2
#define BITS_PER_INT64_LOG2 PR_BITS_PER_INT64_LOG2
#define BITS_PER_LONG_LOG2 PR_BITS_PER_LONG_LOG2
#define BITS_PER_FLOAT_LOG2 PR_BITS_PER_FLOAT_LOG2
#define BITS_PER_DOUBLE_LOG2 PR_BITS_PER_DOUBLE_LOG2
#define BITS_PER_WORD_LOG2 PR_BITS_PER_WORD_LOG2
#define ALIGN_OF_SHORT PR_ALIGN_OF_SHORT
#define ALIGN_OF_INT PR_ALIGN_OF_INT
#define ALIGN_OF_LONG PR_ALIGN_OF_LONG
#define ALIGN_OF_INT64 PR_ALIGN_OF_INT64
#define ALIGN_OF_FLOAT PR_ALIGN_OF_FLOAT
#define ALIGN_OF_DOUBLE PR_ALIGN_OF_DOUBLE
#define ALIGN_OF_POINTER PR_ALIGN_OF_POINTER
#define ALIGN_OF_WORD PR_ALIGN_OF_WORD
#define BYTES_PER_WORD_LOG2 PR_BYTES_PER_WORD_LOG2
#define BYTES_PER_DWORD_LOG2 PR_BYTES_PER_DWORD_LOG2
#define WORDS_PER_DWORD_LOG2 PR_WORDS_PER_DWORD_LOG2
#endif /* NO_NSPR_10_SUPPORT */
#endif /* nspr_cpucfg___ */

View File

@ -1,164 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nspr_nec_defs_h___
#define nspr_nec_defs_h___
/*
* Internal configuration macros
*/
#define PR_LINKER_ARCH "nec"
#define _PR_SI_SYSNAME "NEC"
#define _PR_SI_ARCHITECTURE "mips"
#define PR_DLL_SUFFIX ".so"
#define _PR_STACK_VMBASE 0x50000000
#define _MD_DEFAULT_STACK_SIZE 65536L
#define _MD_MMAP_FLAGS MAP_PRIVATE
#undef HAVE_STACK_GROWING_UP
#define HAVE_DLL
#define USE_DLFCN
#define NEED_TIME_R
#define NEED_STRFTIME_LOCK
#define _PR_POLL_AVAILABLE
#define _PR_USE_POLL
#define _PR_NO_LARGE_FILES
#define _PR_STAT_HAS_ST_ATIM_UNION
#include <ucontext.h>
#include <sys/regset.h>
#define PR_NUM_GCREGS NGREG
#define PR_CONTEXT_TYPE ucontext_t
#define CONTEXT(_thread) (&(_thread)->md.context)
#define _MD_GET_SP(_t) (_t)->md.context.uc_mcontext.gregs[CXT_SP]
/*
** Initialize the thread context preparing it to execute "e(o,a)"
*/
#define _MD_INIT_CONTEXT(thread, _sp, _main, status) \
{ \
*status = PR_TRUE; \
getcontext(CONTEXT(thread)); \
CONTEXT(thread)->uc_stack.ss_sp = (char*) (thread)->stack->stackBottom; \
CONTEXT(thread)->uc_stack.ss_size = (thread)->stack->stackSize; \
_MD_GET_SP(thread) = (greg_t) _sp - 64; \
makecontext(CONTEXT(thread), _main, 0); \
}
#define _MD_SWITCH_CONTEXT(_thread) \
if (!getcontext(CONTEXT(_thread))) { \
(_thread)->md.errcode = errno; \
_PR_Schedule(); \
}
/*
** Restore a thread context, saved by _MD_SWITCH_CONTEXT
*/
#define _MD_RESTORE_CONTEXT(_thread) \
{ \
ucontext_t *uc = CONTEXT(_thread); \
uc->uc_mcontext.gregs[CXT_V0] = 1; \
uc->uc_mcontext.gregs[CXT_A3] = 0; \
errno = (_thread)->md.errcode; \
_MD_SET_CURRENT_THREAD(_thread); \
setcontext(uc); \
}
/* Machine-dependent (MD) data structures */
struct _MDThread {
PR_CONTEXT_TYPE context;
int id;
int errcode;
};
struct _MDThreadStack {
PRInt8 notused;
};
struct _MDLock {
PRInt8 notused;
};
struct _MDSemaphore {
PRInt8 notused;
};
struct _MDCVar {
PRInt8 notused;
};
struct _MDSegment {
PRInt8 notused;
};
/*
* md-specific cpu structure field
*/
#define _PR_MD_MAX_OSFD FD_SETSIZE
struct _MDCPU_Unix {
PRCList ioQ;
PRUint32 ioq_timeout;
PRInt32 ioq_max_osfd;
PRInt32 ioq_osfd_cnt;
#ifndef _PR_USE_POLL
fd_set fd_read_set, fd_write_set, fd_exception_set;
PRInt16 fd_read_cnt[_PR_MD_MAX_OSFD],fd_write_cnt[_PR_MD_MAX_OSFD],
fd_exception_cnt[_PR_MD_MAX_OSFD];
#else
struct pollfd *ioq_pollfds;
int ioq_pollfds_size;
#endif /* _PR_USE_POLL */
};
#define _PR_IOQ(_cpu) ((_cpu)->md.md_unix.ioQ)
#define _PR_ADD_TO_IOQ(_pq, _cpu) PR_APPEND_LINK(&_pq.links, &_PR_IOQ(_cpu))
#define _PR_FD_READ_SET(_cpu) ((_cpu)->md.md_unix.fd_read_set)
#define _PR_FD_READ_CNT(_cpu) ((_cpu)->md.md_unix.fd_read_cnt)
#define _PR_FD_WRITE_SET(_cpu) ((_cpu)->md.md_unix.fd_write_set)
#define _PR_FD_WRITE_CNT(_cpu) ((_cpu)->md.md_unix.fd_write_cnt)
#define _PR_FD_EXCEPTION_SET(_cpu) ((_cpu)->md.md_unix.fd_exception_set)
#define _PR_FD_EXCEPTION_CNT(_cpu) ((_cpu)->md.md_unix.fd_exception_cnt)
#define _PR_IOQ_TIMEOUT(_cpu) ((_cpu)->md.md_unix.ioq_timeout)
#define _PR_IOQ_MAX_OSFD(_cpu) ((_cpu)->md.md_unix.ioq_max_osfd)
#define _PR_IOQ_OSFD_CNT(_cpu) ((_cpu)->md.md_unix.ioq_osfd_cnt)
#define _PR_IOQ_POLLFDS(_cpu) ((_cpu)->md.md_unix.ioq_pollfds)
#define _PR_IOQ_POLLFDS_SIZE(_cpu) ((_cpu)->md.md_unix.ioq_pollfds_size)
#define _PR_IOQ_MIN_POLLFDS_SIZE(_cpu) 32
struct _MDCPU {
struct _MDCPU_Unix md_unix;
};
#define _MD_INIT_LOCKS()
#define _MD_NEW_LOCK(lock) PR_SUCCESS
#define _MD_FREE_LOCK(lock)
#define _MD_LOCK(lock)
#define _MD_UNLOCK(lock)
#define _MD_INIT_IO()
#define _MD_IOQ_LOCK()
#define _MD_IOQ_UNLOCK()
#define _MD_EARLY_INIT _MD_EarlyInit
#define _MD_FINAL_INIT _PR_UnixInit
#define _MD_INIT_RUNNING_CPU(cpu) _MD_unix_init_running_cpu(cpu)
#define _MD_INIT_THREAD _MD_InitializeThread
#define _MD_EXIT_THREAD(thread)
#define _MD_CLEAN_THREAD(_thread)
#define _MD_SELECT _select
#define _MD_POLL _poll
#define _MD_GET_INTERVAL _PR_UNIX_GetInterval
#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond
#endif /* nspr_nec_defs_h___ */

View File

@ -208,13 +208,10 @@ struct _MDCPU {
#endif /* ! _PR_PTHREADS */ #endif /* ! _PR_PTHREADS */
extern void _MD_EarlyInit(void); extern void _MD_EarlyInit(void);
extern PRIntervalTime _PR_UNIX_GetInterval(void);
extern PRIntervalTime _PR_UNIX_TicksPerSecond(void);
#define _MD_EARLY_INIT _MD_EarlyInit #define _MD_EARLY_INIT _MD_EarlyInit
#define _MD_FINAL_INIT _PR_UnixInit #define _MD_FINAL_INIT _PR_UnixInit
#define _MD_GET_INTERVAL _PR_UNIX_GetInterval #define _MD_INTERVAL_USE_GTOD
#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond
/* /*
* We wrapped the select() call. _MD_SELECT refers to the built-in, * We wrapped the select() call. _MD_SELECT refers to the built-in,

View File

@ -1,223 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nspr_cpucfg___
#define nspr_cpucfg___
#ifndef XP_UNIX
#define XP_UNIX
#endif
#ifndef NEXTSTEP
#define NEXTSTEP
#endif
/* Platform specific
*/
#if defined(__sparc__)
/* Check these
*/
#undef IS_LITTLE_ENDIAN
#define IS_BIG_ENDIAN 1
#define HAVE_LONG_LONG
#undef HAVE_ALIGNED_DOUBLES
#define HAVE_ALIGNED_LONGLONGS 1
#define PR_BYTES_PER_BYTE 1
#define PR_BYTES_PER_SHORT 2
#define PR_BYTES_PER_INT 4
#define PR_BYTES_PER_INT64 8
#define PR_BYTES_PER_LONG 4
#define PR_BYTES_PER_FLOAT 4
#define PR_BYTES_PER_DOUBLE 8
/* Taken from _solaris.cfg
*/
#define PR_BYTES_PER_WORD 4
#define PR_BYTES_PER_DWORD 8
#define PR_BYTES_PER_WORD_LOG2 2
#define PR_BYTES_PER_DWORD_LOG2 3
#define PR_BITS_PER_BYTE 8
#define PR_BITS_PER_SHORT 16
#define PR_BITS_PER_INT 32
#define PR_BITS_PER_INT64 64
#define PR_BITS_PER_LONG 32
#define PR_BITS_PER_FLOAT 32
#define PR_BITS_PER_DOUBLE 64
/* Taken from _solaris.cfg
*/
#define PR_BITS_PER_WORD 32
#define PR_BITS_PER_BYTE_LOG2 3
#define PR_BITS_PER_SHORT_LOG2 4
#define PR_BITS_PER_INT_LOG2 5
#define PR_BITS_PER_INT64_LOG2 6
#define PR_BITS_PER_LONG_LOG2 5
#define PR_BITS_PER_FLOAT_LOG2 5
#define PR_BITS_PER_DOUBLE_LOG2 6
/* Taken from _solaris.cfg
*/
#define PR_BITS_PER_WORD_LOG2 5
#define PR_ALIGN_OF_SHORT 2
#define PR_ALIGN_OF_INT 4
#define PR_ALIGN_OF_LONG 4
#define PR_ALIGN_OF_INT64 8
#define PR_ALIGN_OF_FLOAT 4
#define PR_ALIGN_OF_DOUBLE 8
#define PR_ALIGN_OF_POINTER 4
#define PR_WORDS_PER_DWORD_LOG2 1
#elif defined(__m68k__)
/* Check these
*/
#undef IS_LITTLE_ENDIAN
#define IS_BIG_ENDIAN 1
#define HAVE_LONG_LONG
#undef HAVE_ALIGNED_DOUBLES
#define HAVE_ALIGNED_LONGLONGS 1
#define PR_BYTES_PER_BYTE 1
#define PR_BYTES_PER_SHORT 2
#define PR_BYTES_PER_INT 4
#define PR_BYTES_PER_INT64 8
#define PR_BYTES_PER_LONG 4
#define PR_BYTES_PER_FLOAT 4
#define PR_BYTES_PER_DOUBLE 8
#define PR_BYTES_PER_WORD 4
#define PR_BYTES_PER_DWORD 8
#define PR_BYTES_PER_WORD_LOG2 2
#define PR_BYTES_PER_DWORD_LOG2 3
#define PR_BITS_PER_BYTE 8
#define PR_BITS_PER_SHORT 16
#define PR_BITS_PER_INT 32
#define PR_BITS_PER_INT64 64
#define PR_BITS_PER_LONG 32
#define PR_BITS_PER_FLOAT 32
#define PR_BITS_PER_DOUBLE 64
#define PR_BITS_PER_WORD 32
#define PR_BITS_PER_BYTE_LOG2 3
#define PR_BITS_PER_SHORT_LOG2 4
#define PR_BITS_PER_INT_LOG2 5
#define PR_BITS_PER_INT64_LOG2 6
#define PR_BITS_PER_LONG_LOG2 5
#define PR_BITS_PER_FLOAT_LOG2 5
#define PR_BITS_PER_DOUBLE_LOG2 6
#define PR_BITS_PER_WORD_LOG2 5
#define PR_ALIGN_OF_SHORT 2
#define PR_ALIGN_OF_INT 2
#define PR_ALIGN_OF_LONG 2
#define PR_ALIGN_OF_INT64 2
#define PR_ALIGN_OF_FLOAT 2
#define PR_ALIGN_OF_DOUBLE 2
#define PR_ALIGN_OF_POINTER 2
#define PR_WORDS_PER_DWORD_LOG2 1
#elif defined(__i386__)
/* Check these
*/
#define IS_LITTLE_ENDIAN 1
#undef IS_BIG_ENDIAN
#define HAVE_LONG_LONG
#undef HAVE_ALIGNED_DOUBLES
#define HAVE_ALIGNED_LONGLONGS 1
#define PR_BYTES_PER_BYTE 1
#define PR_BYTES_PER_SHORT 2
#define PR_BYTES_PER_INT 4
#define PR_BYTES_PER_INT64 8
#define PR_BYTES_PER_LONG 4
#define PR_BYTES_PER_FLOAT 4
#define PR_BYTES_PER_DOUBLE 8
#define PR_BYTES_PER_WORD 4
#define PR_BYTES_PER_DWORD 8
#define PR_BITS_PER_BYTE 8
#define PR_BITS_PER_SHORT 16
#define PR_BITS_PER_INT 32
#define PR_BITS_PER_INT64 64
#define PR_BITS_PER_LONG 32
#define PR_BITS_PER_FLOAT 32
#define PR_BITS_PER_DOUBLE 64
#define PR_BITS_PER_WORD 32
#define PR_BITS_PER_BYTE_LOG2 3
#define PR_BITS_PER_SHORT_LOG2 4
#define PR_BITS_PER_INT_LOG2 5
#define PR_BITS_PER_INT64_LOG2 6
#define PR_BITS_PER_LONG_LOG2 5
#define PR_BITS_PER_FLOAT_LOG2 5
#define PR_BITS_PER_DOUBLE_LOG2 6
#define PR_BITS_PER_WORD_LOG2 5
#define PR_ALIGN_OF_SHORT 2
#define PR_ALIGN_OF_INT 4
#define PR_ALIGN_OF_LONG 4
#define PR_ALIGN_OF_INT64 4
#define PR_ALIGN_OF_FLOAT 4
#define PR_ALIGN_OF_DOUBLE 4
#define PR_ALIGN_OF_POINTER 4
#define PR_ALIGN_OF_WORD 4
#define PR_BYTES_PER_WORD_LOG2 2
#define PR_BYTES_PER_DWORD_LOG2 3
#define PR_WORDS_PER_DWORD_LOG2 1
#endif /* defined(__somearch__) */
#ifndef NO_NSPR_10_SUPPORT
#define BYTES_PER_BYTE PR_BYTES_PER_BYTE
#define BYTES_PER_SHORT PR_BYTES_PER_SHORT
#define BYTES_PER_INT PR_BYTES_PER_INT
#define BYTES_PER_INT64 PR_BYTES_PER_INT64
#define BYTES_PER_LONG PR_BYTES_PER_LONG
#define BYTES_PER_FLOAT PR_BYTES_PER_FLOAT
#define BYTES_PER_DOUBLE PR_BYTES_PER_DOUBLE
#define BYTES_PER_WORD PR_BYTES_PER_WORD
#define BYTES_PER_DWORD PR_BYTES_PER_DWORD
#define BITS_PER_BYTE PR_BITS_PER_BYTE
#define BITS_PER_SHORT PR_BITS_PER_SHORT
#define BITS_PER_INT PR_BITS_PER_INT
#define BITS_PER_INT64 PR_BITS_PER_INT64
#define BITS_PER_LONG PR_BITS_PER_LONG
#define BITS_PER_FLOAT PR_BITS_PER_FLOAT
#define BITS_PER_DOUBLE PR_BITS_PER_DOUBLE
#define BITS_PER_WORD PR_BITS_PER_WORD
#define BITS_PER_BYTE_LOG2 PR_BITS_PER_BYTE_LOG2
#define BITS_PER_SHORT_LOG2 PR_BITS_PER_SHORT_LOG2
#define BITS_PER_INT_LOG2 PR_BITS_PER_INT_LOG2
#define BITS_PER_INT64_LOG2 PR_BITS_PER_INT64_LOG2
#define BITS_PER_LONG_LOG2 PR_BITS_PER_LONG_LOG2
#define BITS_PER_FLOAT_LOG2 PR_BITS_PER_FLOAT_LOG2
#define BITS_PER_DOUBLE_LOG2 PR_BITS_PER_DOUBLE_LOG2
#define BITS_PER_WORD_LOG2 PR_BITS_PER_WORD_LOG2
#define ALIGN_OF_SHORT PR_ALIGN_OF_SHORT
#define ALIGN_OF_INT PR_ALIGN_OF_INT
#define ALIGN_OF_LONG PR_ALIGN_OF_LONG
#define ALIGN_OF_INT64 PR_ALIGN_OF_INT64
#define ALIGN_OF_FLOAT PR_ALIGN_OF_FLOAT
#define ALIGN_OF_DOUBLE PR_ALIGN_OF_DOUBLE
#define ALIGN_OF_POINTER PR_ALIGN_OF_POINTER
#define ALIGN_OF_WORD PR_ALIGN_OF_WORD
#define BYTES_PER_WORD_LOG2 PR_BYTES_PER_WORD_LOG2
#define BYTES_PER_DWORD_LOG2 PR_BYTES_PER_DWORD_LOG2
#define WORDS_PER_DWORD_LOG2 PR_WORDS_PER_DWORD_LOG2
#endif /* NO_NSPR_10_SUPPORT */
#endif /* nspr_cpucfg___ */

View File

@ -1,267 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nspr_nextstep_defs_h___
#define nspr_nextstep_defs_h___
#include "prthread.h"
#include <bsd/libc.h>
#include <bsd/syscall.h>
/* syscall() is not declared in NEXTSTEP's syscall.h ...
*/
extern int syscall(int number, ...);
/*
* Internal configuration macros
*/
#define PR_LINKER_ARCH "nextstep"
#define _PR_SI_SYSNAME "NEXTSTEP"
#if defined(__sparc__)
#define _PR_SI_ARCHITECTURE "sparc"
#elif defined(__m68k__)
#define _PR_SI_ARCHITECTURE "m68k"
#elif defined(__i386__)
#define _PR_SI_ARCHITECTURE "x86"
#else
error Unknown NEXTSTEP architecture
#endif
#define PR_DLL_SUFFIX ".so"
#define _PR_VMBASE 0x30000000
#define _PR_STACK_VMBASE 0x50000000
#define _MD_DEFAULT_STACK_SIZE 65536L
#define _MD_MMAP_FLAGS MAP_PRIVATE
#undef HAVE_STACK_GROWING_UP
#define HAVE_WEAK_MALLOC_SYMBOLS
#define HAVE_DLL
#define USE_MACH_DYLD
#define _PR_STAT_HAS_ONLY_ST_ATIME
#define _PR_NO_LARGE_FILES
#define USE_SETJMP
#ifndef _PR_PTHREADS
#include <setjmp.h>
#define PR_CONTEXT_TYPE jmp_buf
#define CONTEXT(_th) ((_th)->md.context)
/* balazs.pataki@sztaki.hu:
** __sparc__ is checked
** __m68k__ is checked
** __i386__ is a guess (one of the two defines should work)
*/
#if defined(__sparc__)
#define _MD_GET_SP(_th) (_th)->md.context[2]
#elif defined(__m68k__)
#define _MD_GET_SP(_th) (_th)->md.context[2]
#elif defined(__i386__)
/* One of this two must be OK ... try using sc_onstack
*/
#define _MD_GET_SP(_th) (((struct sigcontext *) (_th)->md.context)->sc_onstack)
//#define _MD_GET_SP(_th) (_th)->md.context[0].sc_esp
#else
error Unknown NEXTSTEP architecture
#endif
#define PR_NUM_GCREGS _JBLEN
/*
** Initialize a thread context to run "_main()" when started
*/
#define _MD_INIT_CONTEXT(_thread, _sp, _main, status) \
{ \
*status = PR_TRUE; \
if (setjmp(CONTEXT(_thread))) { \
_main(); \
} \
_MD_GET_SP(_thread) = (int) ((_sp) - 64); \
}
#define _MD_SWITCH_CONTEXT(_thread) \
if (!setjmp(CONTEXT(_thread))) { \
(_thread)->md.errcode = errno; \
_PR_Schedule(); \
}
/*
** Restore a thread context, saved by _MD_SWITCH_CONTEXT
*/
#define _MD_RESTORE_CONTEXT(_thread) \
{ \
errno = (_thread)->md.errcode; \
_MD_SET_CURRENT_THREAD(_thread); \
longjmp(CONTEXT(_thread), 1); \
}
/* Machine-dependent (MD) data structures */
struct _MDThread {
PR_CONTEXT_TYPE context;
int id;
int errcode;
};
struct _MDThreadStack {
PRInt8 notused;
};
struct _MDLock {
PRInt8 notused;
};
struct _MDSemaphore {
PRInt8 notused;
};
struct _MDCVar {
PRInt8 notused;
};
struct _MDSegment {
PRInt8 notused;
};
/*
* md-specific cpu structure field
*/
#define _PR_MD_MAX_OSFD FD_SETSIZE
struct _MDCPU_Unix {
PRCList ioQ;
PRUint32 ioq_timeout;
PRInt32 ioq_max_osfd;
PRInt32 ioq_osfd_cnt;
#ifndef _PR_USE_POLL
fd_set fd_read_set, fd_write_set, fd_exception_set;
PRInt16 fd_read_cnt[_PR_MD_MAX_OSFD],fd_write_cnt[_PR_MD_MAX_OSFD],
fd_exception_cnt[_PR_MD_MAX_OSFD];
#else
struct pollfd *ioq_pollfds;
int ioq_pollfds_size;
#endif /* _PR_USE_POLL */
};
#define _PR_IOQ(_cpu) ((_cpu)->md.md_unix.ioQ)
#define _PR_ADD_TO_IOQ(_pq, _cpu) PR_APPEND_LINK(&_pq.links, &_PR_IOQ(_cpu))
#define _PR_FD_READ_SET(_cpu) ((_cpu)->md.md_unix.fd_read_set)
#define _PR_FD_READ_CNT(_cpu) ((_cpu)->md.md_unix.fd_read_cnt)
#define _PR_FD_WRITE_SET(_cpu) ((_cpu)->md.md_unix.fd_write_set)
#define _PR_FD_WRITE_CNT(_cpu) ((_cpu)->md.md_unix.fd_write_cnt)
#define _PR_FD_EXCEPTION_SET(_cpu) ((_cpu)->md.md_unix.fd_exception_set)
#define _PR_FD_EXCEPTION_CNT(_cpu) ((_cpu)->md.md_unix.fd_exception_cnt)
#define _PR_IOQ_TIMEOUT(_cpu) ((_cpu)->md.md_unix.ioq_timeout)
#define _PR_IOQ_MAX_OSFD(_cpu) ((_cpu)->md.md_unix.ioq_max_osfd)
#define _PR_IOQ_OSFD_CNT(_cpu) ((_cpu)->md.md_unix.ioq_osfd_cnt)
#define _PR_IOQ_POLLFDS(_cpu) ((_cpu)->md.md_unix.ioq_pollfds)
#define _PR_IOQ_POLLFDS_SIZE(_cpu) ((_cpu)->md.md_unix.ioq_pollfds_size)
#define _PR_IOQ_MIN_POLLFDS_SIZE(_cpu) 32
struct _MDCPU {
struct _MDCPU_Unix md_unix;
};
#define _MD_INIT_LOCKS()
#define _MD_NEW_LOCK(lock) PR_SUCCESS
#define _MD_FREE_LOCK(lock)
#define _MD_LOCK(lock)
#define _MD_UNLOCK(lock)
#define _MD_INIT_IO()
#define _MD_IOQ_LOCK()
#define _MD_IOQ_UNLOCK()
extern PRStatus _MD_InitializeThread(PRThread *thread);
#define _MD_INIT_RUNNING_CPU(cpu) _MD_unix_init_running_cpu(cpu)
#define _MD_INIT_THREAD _MD_InitializeThread
#define _MD_EXIT_THREAD(thread)
#define _MD_SUSPEND_THREAD(thread) _MD_suspend_thread
#define _MD_RESUME_THREAD(thread) _MD_resume_thread
#define _MD_CLEAN_THREAD(_thread)
extern PRStatus _MD_CREATE_THREAD(
PRThread *thread,
void (*start) (void *),
PRThreadPriority priority,
PRThreadScope scope,
PRThreadState state,
PRUint32 stackSize);
extern void _MD_SET_PRIORITY(struct _MDThread *thread, PRUintn newPri);
extern PRStatus _MD_WAIT(PRThread *, PRIntervalTime timeout);
extern PRStatus _MD_WAKEUP_WAITER(PRThread *);
extern void _MD_YIELD(void);
#endif /* ! _PR_PTHREADS */
extern void _MD_EarlyInit(void);
extern PRIntervalTime _PR_UNIX_GetInterval(void);
extern PRIntervalTime _PR_UNIX_TicksPerSecond(void);
#define _MD_EARLY_INIT _MD_EarlyInit
#define _MD_FINAL_INIT _PR_UnixInit
#define _MD_GET_INTERVAL _PR_UNIX_GetInterval
#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond
/*
* We wrapped the select() call. _MD_SELECT refers to the built-in,
* unwrapped version.
*/
#define _MD_SELECT(nfds,r,w,e,tv) syscall(SYS_select,nfds,r,w,e,tv)
/* For writev() */
#include <sys/uio.h>
/* signal.h */
/* balazs.pataki@sztaki.hu: this is stolen from sunos4.h. The things is that
** NEXTSTEP doesn't support these flags for `struct sigaction's sa_flags, so
** I have to fake them ...
*/
#define SA_RESTART 0
/* mmap */
/* balazs.pataki@sztaki.hu: NEXTSTEP doesn't have mmap, at least not
** publically. We have sys/mman.h, but it doesn't declare mmap(), and
** PROT_NONE is also missing. syscall.h has entries for mmap, munmap, and
** mprotect so I wrap these in nextstep.c as mmap(), munmap() and mprotect()
** and pray for it to work.
**
*/
caddr_t mmap(caddr_t addr, size_t len, int prot, int flags,
int fildes, off_t off);
int munmap(caddr_t addr, size_t len);
int mprotect(caddr_t addr, size_t len, int prot);
/* my_mmap() is implemented in nextstep.c and is based on map_fd() of mach.
*/
caddr_t my_mmap(caddr_t addr, size_t len, int prot, int flags,
int fildes, off_t off);
int my_munmap(caddr_t addr, size_t len);
/* string.h
*/
/* balazs.pataki@sztaki.hu: this is missing so implemenetd in nextstep.c ...
*/
char *strdup(const char *s1);
/* unistd.h
*/
/* balazs.pataki@sztaki.hu: these functions are hidden, though correctly
** implemented in NEXTSTEP. Here I give the declaration for them to be used
** by prmalloc.c, and I have a wrapped syscall() version of them in nextstep.c
*/
int brk(void *endds);
void *sbrk(int incr);
#endif /* nspr_nextstep_defs_h___ */

View File

@ -167,8 +167,7 @@ struct _MDCPU {
#define _MD_IOQ_LOCK() #define _MD_IOQ_LOCK()
#define _MD_IOQ_UNLOCK() #define _MD_IOQ_UNLOCK()
#define _MD_GET_INTERVAL _PR_UNIX_GetInterval #define _MD_INTERVAL_USE_GTOD
#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond
#define _MD_EARLY_INIT _MD_EarlyInit #define _MD_EARLY_INIT _MD_EarlyInit
#define _MD_FINAL_INIT _PR_UnixInit #define _MD_FINAL_INIT _PR_UnixInit
#define _MD_INIT_RUNNING_CPU(cpu) _MD_unix_init_running_cpu(cpu) #define _MD_INIT_RUNNING_CPU(cpu) _MD_unix_init_running_cpu(cpu)

View File

@ -192,8 +192,7 @@ struct _MDCPU {
#define _MD_EARLY_INIT _MD_EarlyInit #define _MD_EARLY_INIT _MD_EarlyInit
#define _MD_FINAL_INIT _PR_UnixInit #define _MD_FINAL_INIT _PR_UnixInit
#define _MD_GET_INTERVAL _PR_UNIX_GetInterval #define _MD_INTERVAL_USE_GTOD
#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond
/* /*
* We wrapped the select() call. _MD_SELECT refers to the built-in, * We wrapped the select() call. _MD_SELECT refers to the built-in,

View File

@ -186,8 +186,7 @@ struct _MDCPU {
* some of them should probably be moved into _unixos.h. But * some of them should probably be moved into _unixos.h. But
* _irix.h seems to be quite different in regard to these macros. * _irix.h seems to be quite different in regard to these macros.
*/ */
#define _MD_GET_INTERVAL _PR_UNIX_GetInterval #define _MD_INTERVAL_USE_GTOD
#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond
#define _MD_EARLY_INIT _MD_EarlyInit #define _MD_EARLY_INIT _MD_EarlyInit
#define _MD_FINAL_INIT _PR_UnixInit #define _MD_FINAL_INIT _PR_UnixInit

View File

@ -158,8 +158,7 @@ struct _MDCPU {
#define _MD_IOQ_LOCK() #define _MD_IOQ_LOCK()
#define _MD_IOQ_UNLOCK() #define _MD_IOQ_UNLOCK()
#define _MD_GET_INTERVAL _PR_UNIX_GetInterval #define _MD_INTERVAL_USE_GTOD
#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond
#define _MD_EARLY_INIT _MD_EarlyInit #define _MD_EARLY_INIT _MD_EarlyInit
#define _MD_FINAL_INIT _PR_UnixInit #define _MD_FINAL_INIT _PR_UnixInit
#define _MD_INIT_RUNNING_CPU(cpu) _MD_unix_init_running_cpu(cpu) #define _MD_INIT_RUNNING_CPU(cpu) _MD_unix_init_running_cpu(cpu)

View File

@ -1,113 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nspr_cpucfg___
#define nspr_cpucfg___
#ifndef XP_UNIX
#define XP_UNIX
#endif
#ifndef RELIANTUNIX
#define RELIANTUNIX
#endif
#undef IS_LITTLE_ENDIAN
#define IS_BIG_ENDIAN 1
#undef HAVE_LONG_LONG
#undef HAVE_ALIGNED_DOUBLES
#undef HAVE_ALIGNED_LONGLONGS
#define PR_BYTES_PER_BYTE 1
#define PR_BYTES_PER_SHORT 2
#define PR_BYTES_PER_INT 4
#define PR_BYTES_PER_INT64 8
#define PR_BYTES_PER_LONG 4
#define PR_BYTES_PER_FLOAT 4
#define PR_BYTES_PER_WORD 4
#define PR_BYTES_PER_DWORD 8
#define PR_BYTES_PER_DOUBLE 8
#define PR_BITS_PER_BYTE 8
#define PR_BITS_PER_SHORT 16
#define PR_BITS_PER_INT 32
#define PR_BITS_PER_INT64 64
#define PR_BITS_PER_LONG 32
#define PR_BITS_PER_FLOAT 32
#define PR_BITS_PER_WORD 32
#define PR_BITS_PER_DWORD 64
#define PR_BITS_PER_DOUBLE 64
#define PR_BITS_PER_BYTE_LOG2 3
#define PR_BITS_PER_SHORT_LOG2 4
#define PR_BITS_PER_INT_LOG2 5
#define PR_BITS_PER_INT64_LOG2 6
#define PR_BITS_PER_LONG_LOG2 5
#define PR_BITS_PER_FLOAT_LOG2 5
#define PR_BITS_PER_WORD_LOG2 5
#define PR_BITS_PER_DWORD_LOG2 6
#define PR_BITS_PER_DOUBLE_LOG2 6
#define PR_BYTES_PER_WORD_LOG2 2
#define PR_BYTES_PER_DWORD_LOG2 3
#define PR_WORDS_PER_DWORD_LOG2 1
#define PR_ALIGN_OF_SHORT 2
#define PR_ALIGN_OF_INT 4
#define PR_ALIGN_OF_LONG 4
#define PR_ALIGN_OF_INT64 8
#define PR_ALIGN_OF_FLOAT 4
#define PR_ALIGN_OF_WORD 4
#define PR_ALIGN_OF_DOUBLE 8
#define PR_ALIGN_OF_POINTER 4
#define _PR_POLL_BACKCOMPAT
#ifndef NO_NSPR_10_SUPPORT
#define BYTES_PER_BYTE PR_BYTES_PER_BYTE
#define BYTES_PER_SHORT PR_BYTES_PER_SHORT
#define BYTES_PER_INT PR_BYTES_PER_INT
#define BYTES_PER_INT64 PR_BYTES_PER_INT64
#define BYTES_PER_LONG PR_BYTES_PER_LONG
#define BYTES_PER_FLOAT PR_BYTES_PER_FLOAT
#define BYTES_PER_DOUBLE PR_BYTES_PER_DOUBLE
#define BYTES_PER_WORD PR_BYTES_PER_WORD
#define BYTES_PER_DWORD PR_BYTES_PER_DWORD
#define BITS_PER_BYTE PR_BITS_PER_BYTE
#define BITS_PER_SHORT PR_BITS_PER_SHORT
#define BITS_PER_INT PR_BITS_PER_INT
#define BITS_PER_INT64 PR_BITS_PER_INT64
#define BITS_PER_LONG PR_BITS_PER_LONG
#define BITS_PER_FLOAT PR_BITS_PER_FLOAT
#define BITS_PER_DOUBLE PR_BITS_PER_DOUBLE
#define BITS_PER_WORD PR_BITS_PER_WORD
#define BITS_PER_BYTE_LOG2 PR_BITS_PER_BYTE_LOG2
#define BITS_PER_SHORT_LOG2 PR_BITS_PER_SHORT_LOG2
#define BITS_PER_INT_LOG2 PR_BITS_PER_INT_LOG2
#define BITS_PER_INT64_LOG2 PR_BITS_PER_INT64_LOG2
#define BITS_PER_LONG_LOG2 PR_BITS_PER_LONG_LOG2
#define BITS_PER_FLOAT_LOG2 PR_BITS_PER_FLOAT_LOG2
#define BITS_PER_DOUBLE_LOG2 PR_BITS_PER_DOUBLE_LOG2
#define BITS_PER_WORD_LOG2 PR_BITS_PER_WORD_LOG2
#define ALIGN_OF_SHORT PR_ALIGN_OF_SHORT
#define ALIGN_OF_INT PR_ALIGN_OF_INT
#define ALIGN_OF_LONG PR_ALIGN_OF_LONG
#define ALIGN_OF_INT64 PR_ALIGN_OF_INT64
#define ALIGN_OF_FLOAT PR_ALIGN_OF_FLOAT
#define ALIGN_OF_DOUBLE PR_ALIGN_OF_DOUBLE
#define ALIGN_OF_POINTER PR_ALIGN_OF_POINTER
#define ALIGN_OF_WORD PR_ALIGN_OF_WORD
#define BYTES_PER_WORD_LOG2 PR_BYTES_PER_WORD_LOG2
#define BYTES_PER_DWORD_LOG2 PR_BYTES_PER_DWORD_LOG2
#define WORDS_PER_DWORD_LOG2 PR_WORDS_PER_DWORD_LOG2
#endif /* NO_NSPR_10_SUPPORT */
#endif /* nspr_cpucfg___ */

View File

@ -1,238 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/*
* reliantunix.h
* 5/18/96 Taken from nec.h -- chrisk@netscape.com
* 3/14/97 Modified for nspr20 -- chrisk@netscape.com
*/
#ifndef nspr_reliantunix_defs_h___
#define nspr_reliantunix_defs_h___
/*
* Internal configuration macros
*/
#define PR_LINKER_ARCH "sinix"
#define _PR_SI_SYSNAME "SINIX"
#define _PR_SI_ARCHITECTURE "mips"
#define PR_DLL_SUFFIX ".so"
#define _PR_VMBASE 0x30000000
#define _PR_STACK_VMBASE 0x50000000
#define _MD_DEFAULT_STACK_SIZE (2*65536L)
#define _MD_MMAP_FLAGS MAP_PRIVATE|MAP_FIXED
#undef HAVE_STACK_GROWING_UP
#define HAVE_DLL
#define USE_DLFCN
#define NEED_STRFTIME_LOCK
#define NEED_TIME_R
#define HAVE_NETCONFIG
#define HAVE_WEAK_IO_SYMBOLS
#define HAVE_WEAK_MALLOC_SYMBOLS
#define _PR_RECV_BROKEN /* recv doesn't work on Unix Domain Sockets */
#define _PR_POLL_AVAILABLE
#define _PR_USE_POLL
#define _PR_STAT_HAS_ST_ATIM
#define _PR_NO_LARGE_FILES
/*
* Mike Patnode indicated that it is possibly safe now to use context-switching
* calls that do not change the signal mask, like setjmp vs. sigsetjmp.
* So we'll use our homegrown, getcontext/setcontext-compatible stuff which
* will save us the getcontext/setcontext system calls at each context switch.
* It already works in FastTrack 2.01, so it should do it here :-)
* - chrisk 040497
*/
#define USE_SETCXT /* temporarily disabled... */
#include <ucontext.h>
#ifdef USE_SETCXT
/* use non-syscall machine language replacement */
#define _GETCONTEXT getcxt
#define _SETCONTEXT setcxt
/* defined in os_ReliantUNIX.s */
extern int getcxt(ucontext_t *);
extern int setcxt(ucontext_t *);
#else
#define _GETCONTEXT getcontext
#define _SETCONTEXT setcontext
#endif
#define _MD_GET_SP(_t) (_t)->md.context.uc_mcontext.gpregs[CXT_SP]
#define _PR_CONTEXT_TYPE ucontext_t
#define _PR_NUM_GCREGS NGREG
#define CONTEXT(_thread) (&(_thread)->md.context)
#define _PR_IS_NATIVE_THREAD_SUPPORTED() 0
/*
** Machine-dependent (MD) data structures.
*/
struct _MDThread {
_PR_CONTEXT_TYPE context;
int id;
int errcode;
};
struct _MDThreadStack {
PRInt8 notused;
};
struct _MDLock {
PRInt8 notused;
};
struct _MDSemaphore {
PRInt8 notused;
};
struct _MDCVar {
PRInt8 notused;
};
struct _MDSegment {
PRInt8 notused;
};
/*
* md-specific cpu structure field
*/
#define _PR_MD_MAX_OSFD FD_SETSIZE
struct _MDCPU_Unix {
PRCList ioQ;
PRUint32 ioq_timeout;
PRInt32 ioq_max_osfd;
PRInt32 ioq_osfd_cnt;
#ifndef _PR_USE_POLL
fd_set fd_read_set, fd_write_set, fd_exception_set;
PRInt16 fd_read_cnt[_PR_MD_MAX_OSFD],fd_write_cnt[_PR_MD_MAX_OSFD],
fd_exception_cnt[_PR_MD_MAX_OSFD];
#else
struct pollfd *ioq_pollfds;
int ioq_pollfds_size;
#endif /* _PR_USE_POLL */
};
#define _PR_IOQ(_cpu) ((_cpu)->md.md_unix.ioQ)
#define _PR_ADD_TO_IOQ(_pq, _cpu) PR_APPEND_LINK(&_pq.links, &_PR_IOQ(_cpu))
#define _PR_FD_READ_SET(_cpu) ((_cpu)->md.md_unix.fd_read_set)
#define _PR_FD_READ_CNT(_cpu) ((_cpu)->md.md_unix.fd_read_cnt)
#define _PR_FD_WRITE_SET(_cpu) ((_cpu)->md.md_unix.fd_write_set)
#define _PR_FD_WRITE_CNT(_cpu) ((_cpu)->md.md_unix.fd_write_cnt)
#define _PR_FD_EXCEPTION_SET(_cpu) ((_cpu)->md.md_unix.fd_exception_set)
#define _PR_FD_EXCEPTION_CNT(_cpu) ((_cpu)->md.md_unix.fd_exception_cnt)
#define _PR_IOQ_TIMEOUT(_cpu) ((_cpu)->md.md_unix.ioq_timeout)
#define _PR_IOQ_MAX_OSFD(_cpu) ((_cpu)->md.md_unix.ioq_max_osfd)
#define _PR_IOQ_OSFD_CNT(_cpu) ((_cpu)->md.md_unix.ioq_osfd_cnt)
#define _PR_IOQ_POLLFDS(_cpu) ((_cpu)->md.md_unix.ioq_pollfds)
#define _PR_IOQ_POLLFDS_SIZE(_cpu) ((_cpu)->md.md_unix.ioq_pollfds_size)
#define _PR_IOQ_MIN_POLLFDS_SIZE(_cpu) 32
struct _MDCPU {
struct _MDCPU_Unix md_unix;
};
#define _MD_INIT_LOCKS()
#define _MD_NEW_LOCK(lock) PR_SUCCESS
#define _MD_FREE_LOCK(lock)
#define _MD_LOCK(lock)
#define _MD_UNLOCK(lock)
#define _MD_INIT_IO()
#define _MD_IOQ_LOCK()
#define _MD_IOQ_UNLOCK()
/*
** Initialize the thread context preparing it to execute "_main()"
** - get a nice, fresh context
** - set its SP to the stack we allcoated for it
** - set it to start things at "e"
*/
#define _MD_INIT_CONTEXT(thread, _sp, _main, status) \
PR_BEGIN_MACRO \
*status = PR_TRUE; \
_GETCONTEXT(CONTEXT(thread)); \
/* this is supposed to point to the stack BASE, not to SP */ \
CONTEXT(thread)->uc_stack.ss_sp = thread->stack->stackBottom; \
CONTEXT(thread)->uc_stack.ss_size = thread->stack->stackSize; \
CONTEXT(thread)->uc_mcontext.gpregs[CXT_SP] = ((unsigned long)_sp - 128) & 0xfffffff8; \
CONTEXT(thread)->uc_mcontext.gpregs[CXT_T9] = _main; \
CONTEXT(thread)->uc_mcontext.gpregs[CXT_EPC] = _main; \
CONTEXT(thread)->uc_mcontext.gpregs[CXT_RA] = 0; \
thread->no_sched = 0; \
PR_END_MACRO
/*
** Save current context as it is scheduled away
*/
#define _MD_SWITCH_CONTEXT(_thread) \
PR_BEGIN_MACRO \
if (!_GETCONTEXT(CONTEXT(_thread))) { \
_MD_SAVE_ERRNO(_thread); \
_MD_SET_LAST_THREAD(_thread); \
_PR_Schedule(); \
} \
PR_END_MACRO
/*
** Restore a thread context, saved by _MD_SWITCH_CONTEXT or set up
** by _MD_INIT_CONTEXT
** CXT_V0 is the register that holds the return value.
** We must set it to 1 so that we can see if the return from
** getcontext() is the result of calling getcontext() or
** setcontext()...
** setting a context got with getcontext() appears to
** return from getcontext(), too!
** CXT_A3 is the register that holds status when returning
** from a syscall. It is set to 0 to indicate success,
** because we want getcontext() on the other side of the magic
** door to be ok.
*/
#define _MD_RESTORE_CONTEXT(_thread) \
PR_BEGIN_MACRO \
ucontext_t *uc = CONTEXT(_thread); \
uc->uc_mcontext.gpregs[CXT_V0] = 1;\
uc->uc_mcontext.gpregs[CXT_A3] = 0;\
_MD_RESTORE_ERRNO(_thread); \
_MD_SET_CURRENT_THREAD(_thread); \
_SETCONTEXT(uc); \
PR_END_MACRO
#define _MD_SAVE_ERRNO(t) (t)->md.errcode = errno;
#define _MD_RESTORE_ERRNO(t) errno = (t)->md.errcode;
#define _MD_GET_INTERVAL _PR_UNIX_GetInterval
#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond
#define _MD_EARLY_INIT _MD_EarlyInit
#define _MD_FINAL_INIT _PR_UnixInit
#define _MD_INIT_RUNNING_CPU(cpu) _MD_unix_init_running_cpu(cpu)
#define _MD_INIT_THREAD _MD_InitializeThread
#define _MD_EXIT_THREAD(thread)
#define _MD_SUSPEND_THREAD(thread)
#define _MD_RESUME_THREAD(thread)
#define _MD_CLEAN_THREAD(_thread)
#if !defined(S_ISSOCK) && defined(S_IFSOCK)
#define S_ISSOCK(mode) ((mode&0xF000) == 0xC000)
#endif
#if !defined(S_ISLNK) && defined(S_IFLNK)
#define S_ISLNK(mode) ((mode&0xA000) == 0xC000)
#endif
#include <sys/time.h>
#include <sys/types.h>
#include <sys/select.h>
extern int _select(int nfds, fd_set *readfds, fd_set *writefds,
fd_set *execptfds, struct timeval *timeout);
#define _MD_SELECT(nfds,r,w,e,tv) _select(nfds,r,w,e,tv)
#define _MD_POLL _poll
#endif /* nspr_reliantunix_defs_h___ */

View File

@ -154,8 +154,7 @@ struct _MDCPU {
#define _MD_IOQ_LOCK() #define _MD_IOQ_LOCK()
#define _MD_IOQ_UNLOCK() #define _MD_IOQ_UNLOCK()
#define _MD_GET_INTERVAL _PR_UNIX_GetInterval #define _MD_INTERVAL_USE_GTOD
#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond
#define _MD_EARLY_INIT _MD_EarlyInit #define _MD_EARLY_INIT _MD_EarlyInit
#define _MD_FINAL_INIT _PR_UnixInit #define _MD_FINAL_INIT _PR_UnixInit
#define _MD_INIT_RUNNING_CPU(cpu) _MD_unix_init_running_cpu(cpu) #define _MD_INIT_RUNNING_CPU(cpu) _MD_unix_init_running_cpu(cpu)

View File

@ -163,8 +163,7 @@ struct _MDCPU {
#define _MD_RESUME_THREAD(thread) #define _MD_RESUME_THREAD(thread)
#define _MD_CLEAN_THREAD(_thread) #define _MD_CLEAN_THREAD(_thread)
#define _MD_GET_INTERVAL _PR_UNIX_GetInterval #define _MD_INTERVAL_USE_GTOD
#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond
#define _MD_SELECT _select #define _MD_SELECT _select
#define _MD_POLL _poll #define _MD_POLL _poll

View File

@ -110,6 +110,7 @@ struct _md_sockaddr_in6 {
#endif #endif
#include "prinrval.h" #include "prinrval.h"
#define _MD_INTERVAL_INIT()
NSPR_API(PRIntervalTime) _MD_Solaris_GetInterval(void); NSPR_API(PRIntervalTime) _MD_Solaris_GetInterval(void);
#define _MD_GET_INTERVAL _MD_Solaris_GetInterval #define _MD_GET_INTERVAL _MD_Solaris_GetInterval
NSPR_API(PRIntervalTime) _MD_Solaris_TicksPerSecond(void); NSPR_API(PRIntervalTime) _MD_Solaris_TicksPerSecond(void);
@ -439,9 +440,7 @@ struct _MDCPU {
struct _MDCPU_Unix md_unix; struct _MDCPU_Unix md_unix;
}; };
#ifndef _PR_PTHREADS
#define _MD_INIT_LOCKS() #define _MD_INIT_LOCKS()
#endif
#define _MD_NEW_LOCK(lock) PR_SUCCESS #define _MD_NEW_LOCK(lock) PR_SUCCESS
#define _MD_FREE_LOCK(lock) #define _MD_FREE_LOCK(lock)
#define _MD_LOCK(lock) #define _MD_LOCK(lock)
@ -467,11 +466,6 @@ extern PRStatus _MD_CREATE_THREAD(PRThread *thread, void (*start) (void *),
PRThreadPriority priority, PRThreadScope scope, PRThreadState state, PRThreadPriority priority, PRThreadScope scope, PRThreadState state,
PRUint32 stackSize); PRUint32 stackSize);
NSPR_API(PRIntervalTime) _MD_Solaris_GetInterval(void);
#define _MD_GET_INTERVAL _MD_Solaris_GetInterval
NSPR_API(PRIntervalTime) _MD_Solaris_TicksPerSecond(void);
#define _MD_INTERVAL_PER_SEC _MD_Solaris_TicksPerSecond
/* The following defines the unwrapped versions of select() and poll(). */ /* The following defines the unwrapped versions of select() and poll(). */
extern int _select(int nfds, fd_set *readfds, fd_set *writefds, extern int _select(int nfds, fd_set *readfds, fd_set *writefds,
fd_set *exceptfds, struct timeval *timeout); fd_set *exceptfds, struct timeval *timeout);

View File

@ -1,108 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nspr_cpucfg___
#define nspr_cpucfg___
#ifndef XP_UNIX
#define XP_UNIX
#endif
#ifndef SONY
#define SONY
#endif
#undef IS_LITTLE_ENDIAN
#define IS_BIG_ENDIAN 1
#define PR_BYTES_PER_BYTE 1
#define PR_BYTES_PER_SHORT 2
#define PR_BYTES_PER_INT 4
#define PR_BYTES_PER_INT64 8
#define PR_BYTES_PER_LONG 4
#define PR_BYTES_PER_FLOAT 4
#define PR_BYTES_PER_DOUBLE 8
#define PR_BYTES_PER_WORD 4
#define PR_BYTES_PER_DWORD 8
#define PR_BITS_PER_BYTE 8
#define PR_BITS_PER_SHORT 16
#define PR_BITS_PER_INT 32
#define PR_BITS_PER_INT64 64
#define PR_BITS_PER_LONG 32
#define PR_BITS_PER_FLOAT 32
#define PR_BITS_PER_DOUBLE 64
#define PR_BITS_PER_WORD 32
#define PR_BITS_PER_BYTE_LOG2 3
#define PR_BITS_PER_SHORT_LOG2 4
#define PR_BITS_PER_INT_LOG2 5
#define PR_BITS_PER_INT64_LOG2 6
#define PR_BITS_PER_LONG_LOG2 5
#define PR_BITS_PER_FLOAT_LOG2 5
#define PR_BITS_PER_DOUBLE_LOG2 6
#define PR_BITS_PER_WORD_LOG2 5
#define PR_ALIGN_OF_SHORT 2
#define PR_ALIGN_OF_INT 4
#define PR_ALIGN_OF_LONG 4
#define PR_ALIGN_OF_INT64 8
#define PR_ALIGN_OF_FLOAT 4
#define PR_ALIGN_OF_DOUBLE 8
#define PR_ALIGN_OF_POINTER 4
#define PR_BYTES_PER_WORD_LOG2 2
#define PR_BYTES_PER_DWORD_LOG2 3
#undef HAVE_LONG_LONG
#undef HAVE_ALIGNED_DOUBLES
#undef HAVE_ALIGNED_LONGLONGS
#ifndef NO_NSPR_10_SUPPORT
#define BYTES_PER_BYTE PR_BYTES_PER_BYTE
#define BYTES_PER_SHORT PR_BYTES_PER_SHORT
#define BYTES_PER_INT PR_BYTES_PER_INT
#define BYTES_PER_INT64 PR_BYTES_PER_INT64
#define BYTES_PER_LONG PR_BYTES_PER_LONG
#define BYTES_PER_FLOAT PR_BYTES_PER_FLOAT
#define BYTES_PER_DOUBLE PR_BYTES_PER_DOUBLE
#define BYTES_PER_WORD PR_BYTES_PER_WORD
#define BYTES_PER_DWORD PR_BYTES_PER_DWORD
#define BITS_PER_BYTE PR_BITS_PER_BYTE
#define BITS_PER_SHORT PR_BITS_PER_SHORT
#define BITS_PER_INT PR_BITS_PER_INT
#define BITS_PER_INT64 PR_BITS_PER_INT64
#define BITS_PER_LONG PR_BITS_PER_LONG
#define BITS_PER_FLOAT PR_BITS_PER_FLOAT
#define BITS_PER_DOUBLE PR_BITS_PER_DOUBLE
#define BITS_PER_WORD PR_BITS_PER_WORD
#define BITS_PER_BYTE_LOG2 PR_BITS_PER_BYTE_LOG2
#define BITS_PER_SHORT_LOG2 PR_BITS_PER_SHORT_LOG2
#define BITS_PER_INT_LOG2 PR_BITS_PER_INT_LOG2
#define BITS_PER_INT64_LOG2 PR_BITS_PER_INT64_LOG2
#define BITS_PER_LONG_LOG2 PR_BITS_PER_LONG_LOG2
#define BITS_PER_FLOAT_LOG2 PR_BITS_PER_FLOAT_LOG2
#define BITS_PER_DOUBLE_LOG2 PR_BITS_PER_DOUBLE_LOG2
#define BITS_PER_WORD_LOG2 PR_BITS_PER_WORD_LOG2
#define ALIGN_OF_SHORT PR_ALIGN_OF_SHORT
#define ALIGN_OF_INT PR_ALIGN_OF_INT
#define ALIGN_OF_LONG PR_ALIGN_OF_LONG
#define ALIGN_OF_INT64 PR_ALIGN_OF_INT64
#define ALIGN_OF_FLOAT PR_ALIGN_OF_FLOAT
#define ALIGN_OF_DOUBLE PR_ALIGN_OF_DOUBLE
#define ALIGN_OF_POINTER PR_ALIGN_OF_POINTER
#define ALIGN_OF_WORD PR_ALIGN_OF_WORD
#define BYTES_PER_WORD_LOG2 PR_BYTES_PER_WORD_LOG2
#define BYTES_PER_DWORD_LOG2 PR_BYTES_PER_DWORD_LOG2
#define WORDS_PER_DWORD_LOG2 PR_WORDS_PER_DWORD_LOG2
#endif /* NO_NSPR_10_SUPPORT */
#endif /* nspr_cpucfg___ */

View File

@ -1,172 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nspr_sony_defs_h___
#define nspr_sony_defs_h___
#define PR_LINKER_ARCH "sony"
#define _PR_SI_SYSNAME "SONY"
#define _PR_SI_ARCHITECTURE "mips"
#define PR_DLL_SUFFIX ".so"
#define _PR_VMBASE 0x30000000
#define _PR_STACK_VMBASE 0x50000000
#define _MD_DEFAULT_STACK_SIZE 65536L
#define _MD_MMAP_FLAGS MAP_PRIVATE
#define _MD_GET_INTERVAL _PR_UNIX_GetInterval
#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond
#if defined(_PR_LOCAL_THREADS_ONLY)
#include <ucontext.h>
#include <sys/regset.h>
#define PR_NUM_GCREGS NGREG
#define PR_CONTEXT_TYPE ucontext_t
#define CONTEXT(_thread) (&(_thread)->md.context)
#define _MD_GET_SP(_t) (_t)->md.context.uc_mcontext.gregs[CXT_SP]
/*
** Initialize the thread context preparing it to execute _main()
*/
#define _MD_INIT_CONTEXT(_thread, _sp, _main, status) \
{ \
*status = PR_TRUE; \
getcontext(CONTEXT(_thread)); \
CONTEXT(_thread)->uc_stack.ss_sp = (char*) (_thread)->stack->stackBottom; \
CONTEXT(_thread)->uc_stack.ss_size = (_thread)->stack->stackSize; \
_MD_GET_SP(_thread) = (greg_t) (_sp) - 64; \
makecontext(CONTEXT(_thread), _main, 0); \
}
#define _MD_SWITCH_CONTEXT(_thread) \
if (!getcontext(CONTEXT(_thread))) { \
(_thread)->md.errcode = errno; \
_PR_Schedule(); \
}
/*
** Restore a thread context, saved by _MD_SWITCH_CONTEXT
*/
#define _MD_RESTORE_CONTEXT(_thread) \
{ \
ucontext_t *uc = CONTEXT(_thread); \
uc->uc_mcontext.gregs[CXT_V0] = 1; \
uc->uc_mcontext.gregs[CXT_A3] = 0; \
_MD_SET_CURRENT_THREAD(_thread); \
errno = (_thread)->md.errcode; \
setcontext(uc); \
}
/* Machine-dependent (MD) data structures */
struct _MDThread {
PR_CONTEXT_TYPE context;
int id;
int errcode;
};
struct _MDThreadStack {
PRInt8 notused;
};
struct _MDLock {
PRInt8 notused;
};
struct _MDSemaphore {
PRInt8 notused;
};
struct _MDCVar {
PRInt8 notused;
};
struct _MDSegment {
PRInt8 notused;
};
/*
* md-specific cpu structure field
*/
#define _PR_MD_MAX_OSFD FD_SETSIZE
struct _MDCPU_Unix {
PRCList ioQ;
PRUint32 ioq_timeout;
PRInt32 ioq_max_osfd;
PRInt32 ioq_osfd_cnt;
#ifndef _PR_USE_POLL
fd_set fd_read_set, fd_write_set, fd_exception_set;
PRInt16 fd_read_cnt[_PR_MD_MAX_OSFD],fd_write_cnt[_PR_MD_MAX_OSFD],
fd_exception_cnt[_PR_MD_MAX_OSFD];
#else
struct pollfd *ioq_pollfds;
int ioq_pollfds_size;
#endif /* _PR_USE_POLL */
};
#define _PR_IOQ(_cpu) ((_cpu)->md.md_unix.ioQ)
#define _PR_ADD_TO_IOQ(_pq, _cpu) PR_APPEND_LINK(&_pq.links, &_PR_IOQ(_cpu))
#define _PR_FD_READ_SET(_cpu) ((_cpu)->md.md_unix.fd_read_set)
#define _PR_FD_READ_CNT(_cpu) ((_cpu)->md.md_unix.fd_read_cnt)
#define _PR_FD_WRITE_SET(_cpu) ((_cpu)->md.md_unix.fd_write_set)
#define _PR_FD_WRITE_CNT(_cpu) ((_cpu)->md.md_unix.fd_write_cnt)
#define _PR_FD_EXCEPTION_SET(_cpu) ((_cpu)->md.md_unix.fd_exception_set)
#define _PR_FD_EXCEPTION_CNT(_cpu) ((_cpu)->md.md_unix.fd_exception_cnt)
#define _PR_IOQ_TIMEOUT(_cpu) ((_cpu)->md.md_unix.ioq_timeout)
#define _PR_IOQ_MAX_OSFD(_cpu) ((_cpu)->md.md_unix.ioq_max_osfd)
#define _PR_IOQ_OSFD_CNT(_cpu) ((_cpu)->md.md_unix.ioq_osfd_cnt)
#define _PR_IOQ_POLLFDS(_cpu) ((_cpu)->md.md_unix.ioq_pollfds)
#define _PR_IOQ_POLLFDS_SIZE(_cpu) ((_cpu)->md.md_unix.ioq_pollfds_size)
#define _PR_IOQ_MIN_POLLFDS_SIZE(_cpu) 32
struct _MDCPU {
struct _MDCPU_Unix md_unix;
};
#define _MD_INIT_LOCKS()
#define _MD_NEW_LOCK(lock) PR_SUCCESS
#define _MD_FREE_LOCK(lock)
#define _MD_LOCK(lock)
#define _MD_UNLOCK(lock)
#define _MD_INIT_IO()
#define _MD_IOQ_LOCK()
#define _MD_IOQ_UNLOCK()
#define _MD_EARLY_INIT _MD_EarlyInit
#define _MD_FINAL_INIT _PR_UnixInit
#define _MD_INIT_RUNNING_CPU(cpu) _MD_unix_init_running_cpu(cpu)
#define _MD_INIT_THREAD _MD_InitializeThread
#define _MD_EXIT_THREAD(thread)
#define _MD_SUSPEND_THREAD(thread)
#define _MD_RESUME_THREAD(thread)
#define _MD_CLEAN_THREAD(_thread)
/* The following defines unwrapped versions of select() and poll(). */
extern int _select (int, fd_set *, fd_set *, fd_set *, struct timeval *);
#define _MD_SELECT _select
#include <sys/poll.h>
extern int _poll(struct pollfd *fds, unsigned long nfds, int timeout);
#define _MD_POLL _poll
#endif /* _PR_LOCAL_THREADS_ONLY */
#undef HAVE_STACK_GROWING_UP
#define HAVE_DLL
#define USE_DLFCN
#define NEED_TIME_R
#define NEED_STRFTIME_LOCK
/*
** Missing function prototypes
*/
extern int gethostname(char *name, int namelen);
#endif /* nspr_sony_defs_h___ */

View File

@ -1,106 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nspr_cpucfg___
#define nspr_cpucfg___
#ifndef XP_UNIX
#define XP_UNIX
#endif
#ifndef SUNOS4
#define SUNOS4
#endif
#undef IS_LITTLE_ENDIAN
#define IS_BIG_ENDIAN 1
#undef HAVE_LONG_LONG
#define HAVE_ALIGNED_DOUBLES
#undef HAVE_ALIGNED_LONGLONGS
#define PR_BYTES_PER_BYTE 1
#define PR_BYTES_PER_SHORT 2
#define PR_BYTES_PER_INT 4
#define PR_BYTES_PER_INT64 8
#define PR_BYTES_PER_LONG 4
#define PR_BYTES_PER_FLOAT 4
#define PR_BYTES_PER_DOUBLE 8
#define PR_BYTES_PER_WORD 4
#define PR_BYTES_PER_DWORD 8
#define PR_BYTES_PER_WORD_LOG2 2
#define PR_BYTES_PER_DWORD_LOG2 3
#define PR_BITS_PER_BYTE 8
#define PR_BITS_PER_SHORT 16
#define PR_BITS_PER_INT 32
#define PR_BITS_PER_INT64 64
#define PR_BITS_PER_LONG 32
#define PR_BITS_PER_FLOAT 32
#define PR_BITS_PER_DOUBLE 64
#define PR_BITS_PER_WORD 32
#define PR_BITS_PER_BYTE_LOG2 3
#define PR_BITS_PER_SHORT_LOG2 4
#define PR_BITS_PER_INT_LOG2 5
#define PR_BITS_PER_INT64_LOG2 6
#define PR_BITS_PER_LONG_LOG2 5
#define PR_BITS_PER_FLOAT_LOG2 5
#define PR_BITS_PER_DOUBLE_LOG2 6
#define PR_BITS_PER_WORD_LOG2 5
#define PR_ALIGN_OF_SHORT 2
#define PR_ALIGN_OF_INT 4
#define PR_ALIGN_OF_LONG 4
#define PR_ALIGN_OF_INT64 8
#define PR_ALIGN_OF_FLOAT 4
#define PR_ALIGN_OF_DOUBLE 8
#define PR_ALIGN_OF_POINTER 4
#ifndef NO_NSPR_10_SUPPORT
#define BYTES_PER_BYTE PR_BYTES_PER_BYTE
#define BYTES_PER_SHORT PR_BYTES_PER_SHORT
#define BYTES_PER_INT PR_BYTES_PER_INT
#define BYTES_PER_INT64 PR_BYTES_PER_INT64
#define BYTES_PER_LONG PR_BYTES_PER_LONG
#define BYTES_PER_FLOAT PR_BYTES_PER_FLOAT
#define BYTES_PER_DOUBLE PR_BYTES_PER_DOUBLE
#define BYTES_PER_WORD PR_BYTES_PER_WORD
#define BYTES_PER_DWORD PR_BYTES_PER_DWORD
#define BITS_PER_BYTE PR_BITS_PER_BYTE
#define BITS_PER_SHORT PR_BITS_PER_SHORT
#define BITS_PER_INT PR_BITS_PER_INT
#define BITS_PER_INT64 PR_BITS_PER_INT64
#define BITS_PER_LONG PR_BITS_PER_LONG
#define BITS_PER_FLOAT PR_BITS_PER_FLOAT
#define BITS_PER_DOUBLE PR_BITS_PER_DOUBLE
#define BITS_PER_WORD PR_BITS_PER_WORD
#define BITS_PER_BYTE_LOG2 PR_BITS_PER_BYTE_LOG2
#define BITS_PER_SHORT_LOG2 PR_BITS_PER_SHORT_LOG2
#define BITS_PER_INT_LOG2 PR_BITS_PER_INT_LOG2
#define BITS_PER_INT64_LOG2 PR_BITS_PER_INT64_LOG2
#define BITS_PER_LONG_LOG2 PR_BITS_PER_LONG_LOG2
#define BITS_PER_FLOAT_LOG2 PR_BITS_PER_FLOAT_LOG2
#define BITS_PER_DOUBLE_LOG2 PR_BITS_PER_DOUBLE_LOG2
#define BITS_PER_WORD_LOG2 PR_BITS_PER_WORD_LOG2
#define ALIGN_OF_SHORT PR_ALIGN_OF_SHORT
#define ALIGN_OF_INT PR_ALIGN_OF_INT
#define ALIGN_OF_LONG PR_ALIGN_OF_LONG
#define ALIGN_OF_INT64 PR_ALIGN_OF_INT64
#define ALIGN_OF_FLOAT PR_ALIGN_OF_FLOAT
#define ALIGN_OF_DOUBLE PR_ALIGN_OF_DOUBLE
#define ALIGN_OF_POINTER PR_ALIGN_OF_POINTER
#define ALIGN_OF_WORD PR_ALIGN_OF_WORD
#define BYTES_PER_WORD_LOG2 PR_BYTES_PER_WORD_LOG2
#define BYTES_PER_DWORD_LOG2 PR_BYTES_PER_DWORD_LOG2
#define WORDS_PER_DWORD_LOG2 PR_WORDS_PER_DWORD_LOG2
#endif /* NO_NSPR_10_SUPPORT */
#endif /* ifndef nspr_cpucfg___ */

View File

@ -1,204 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nspr_sunos_defs_h___
#define nspr_sunos_defs_h___
#include "md/sunos4.h"
/* On SunOS 4, memset is declared in memory.h */
#include <memory.h>
#include <errno.h>
#include <sys/syscall.h>
/*
* Internal configuration macros
*/
#define PR_LINKER_ARCH "sunos"
#define _PR_SI_SYSNAME "SUNOS"
#define _PR_SI_ARCHITECTURE "sparc"
#define PR_DLL_SUFFIX ".so.1.0"
/*
** For sunos type machines, don't specify an address because the
** NetBSD/SPARC O.S. does the wrong thing.
*/
#define _PR_VMBASE 0x30000000
#define _PR_STACK_VMBASE 0x50000000
#define _MD_DEFAULT_STACK_SIZE 65536L
#define _MD_MMAP_FLAGS MAP_PRIVATE
#undef HAVE_STACK_GROWING_UP
#undef HAVE_WEAK_IO_SYMBOLS
#undef HAVE_WEAK_MALLOC_SYMBOLS
#define HAVE_DLL
#define USE_DLFCN
#define NEED_STRFTIME_LOCK
#define NEED_TIME_R
#define HAVE_BSD_FLOCK
#define _PR_NO_LARGE_FILES
#define _PR_STAT_HAS_ONLY_ST_ATIME
#define _MD_GET_INTERVAL _PR_UNIX_GetInterval
#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond
#define USE_SETJMP
#include <setjmp.h>
#define _MD_GET_SP(_t) (_t)->md.context[2]
#define PR_NUM_GCREGS _JBLEN
#define CONTEXT(_th) ((_th)->md.context)
/*
** Initialize the thread context preparing it to execute _main.
*/
#define _MD_INIT_CONTEXT(_thread, _sp, _main, status) \
PR_BEGIN_MACRO \
int *context = (_thread)->md.context; \
*status = PR_TRUE; \
asm("ta 3"); \
(void) setjmp(context); \
(_thread)->md.context[2] = (int) ((_sp) - 64); \
(_thread)->md.context[2] &= ~7; \
(_thread)->md.context[3] = (int) _main; \
(_thread)->md.context[4] = (int) _main + 4; \
PR_END_MACRO
#define _MD_SWITCH_CONTEXT(_thread) \
asm("ta 3"); \
if (!setjmp(CONTEXT(_thread))) { \
(_thread)->md.errcode = errno; \
_PR_Schedule(); \
}
/*
** Restore a thread context, saved by _MD_SWITCH_CONTEXT
*/
#define _MD_RESTORE_CONTEXT(_thread) \
{ \
errno = (_thread)->md.errcode; \
_MD_SET_CURRENT_THREAD(_thread); \
longjmp(CONTEXT(_thread), 1); \
}
#pragma unknown_control_flow(longjmp)
#pragma unknown_control_flow(setjmp)
#pragma unknown_control_flow(_PR_Schedule)
/*
** Missing function prototypes
*/
extern int socket (int domain, int type, int protocol);
extern int getsockname (int s, struct sockaddr *name, int *namelen);
extern int getpeername (int s, struct sockaddr *name, int *namelen);
extern int getsockopt (int s, int level, int optname, char* optval, int* optlen);
extern int setsockopt (int s, int level, int optname, const char* optval, int optlen);
extern int accept (int s, struct sockaddr *addr, int *addrlen);
extern int listen (int s, int backlog);
extern int brk(void *);
extern void *sbrk(int);
/* Machine-dependent (MD) data structures. SunOS 4 has no native threads. */
struct _MDThread {
jmp_buf context;
int id;
int errcode;
};
struct _MDThreadStack {
PRInt8 notused;
};
struct _MDLock {
PRInt8 notused;
};
struct _MDSemaphore {
PRInt8 notused;
};
struct _MDCVar {
PRInt8 notused;
};
struct _MDSegment {
PRInt8 notused;
};
/*
* md-specific cpu structure field
*/
#define _PR_MD_MAX_OSFD FD_SETSIZE
struct _MDCPU_Unix {
PRCList ioQ;
PRUint32 ioq_timeout;
PRInt32 ioq_max_osfd;
PRInt32 ioq_osfd_cnt;
#ifndef _PR_USE_POLL
fd_set fd_read_set, fd_write_set, fd_exception_set;
PRInt16 fd_read_cnt[_PR_MD_MAX_OSFD],fd_write_cnt[_PR_MD_MAX_OSFD],
fd_exception_cnt[_PR_MD_MAX_OSFD];
#else
struct pollfd *ioq_pollfds;
int ioq_pollfds_size;
#endif /* _PR_USE_POLL */
};
#define _PR_IOQ(_cpu) ((_cpu)->md.md_unix.ioQ)
#define _PR_ADD_TO_IOQ(_pq, _cpu) PR_APPEND_LINK(&_pq.links, &_PR_IOQ(_cpu))
#define _PR_FD_READ_SET(_cpu) ((_cpu)->md.md_unix.fd_read_set)
#define _PR_FD_READ_CNT(_cpu) ((_cpu)->md.md_unix.fd_read_cnt)
#define _PR_FD_WRITE_SET(_cpu) ((_cpu)->md.md_unix.fd_write_set)
#define _PR_FD_WRITE_CNT(_cpu) ((_cpu)->md.md_unix.fd_write_cnt)
#define _PR_FD_EXCEPTION_SET(_cpu) ((_cpu)->md.md_unix.fd_exception_set)
#define _PR_FD_EXCEPTION_CNT(_cpu) ((_cpu)->md.md_unix.fd_exception_cnt)
#define _PR_IOQ_TIMEOUT(_cpu) ((_cpu)->md.md_unix.ioq_timeout)
#define _PR_IOQ_MAX_OSFD(_cpu) ((_cpu)->md.md_unix.ioq_max_osfd)
#define _PR_IOQ_OSFD_CNT(_cpu) ((_cpu)->md.md_unix.ioq_osfd_cnt)
#define _PR_IOQ_POLLFDS(_cpu) ((_cpu)->md.md_unix.ioq_pollfds)
#define _PR_IOQ_POLLFDS_SIZE(_cpu) ((_cpu)->md.md_unix.ioq_pollfds_size)
#define _PR_IOQ_MIN_POLLFDS_SIZE(_cpu) 32
struct _MDCPU {
struct _MDCPU_Unix md_unix;
};
#define _MD_INIT_LOCKS()
#define _MD_NEW_LOCK(lock) PR_SUCCESS
#define _MD_FREE_LOCK(lock)
#define _MD_LOCK(lock)
#define _MD_UNLOCK(lock)
#define _MD_INIT_IO()
#define _MD_IOQ_LOCK()
#define _MD_IOQ_UNLOCK()
/* These are copied from _solaris.h */
#define _MD_EARLY_INIT _MD_EarlyInit
#define _MD_FINAL_INIT _PR_UnixInit
#define _MD_INIT_RUNNING_CPU(cpu) _MD_unix_init_running_cpu(cpu)
#define _MD_INIT_THREAD _MD_InitializeThread
#define _MD_EXIT_THREAD(thread)
#define _MD_SUSPEND_THREAD(thread)
#define _MD_RESUME_THREAD(thread)
#define _MD_CLEAN_THREAD(_thread)
/*
* We wrapped the select() call. _MD_SELECT refers to the built-in,
* unwrapped version.
*/
#define _MD_SELECT(nfds,r,w,e,tv) syscall(SYS_select,nfds,r,w,e,tv)
#define _MD_POLL(fds,nfds,timeout) syscall(SYS_poll,fds,nfds,timeout)
#endif /* nspr_sparc_defs_h___ */

View File

@ -39,13 +39,10 @@
#endif #endif
extern void _MD_EarlyInit(void); extern void _MD_EarlyInit(void);
extern PRIntervalTime _PR_UNIX_GetInterval(void);
extern PRIntervalTime _PR_UNIX_TicksPerSecond(void);
#define _MD_EARLY_INIT _MD_EarlyInit #define _MD_EARLY_INIT _MD_EarlyInit
#define _MD_FINAL_INIT _PR_UnixInit #define _MD_FINAL_INIT _PR_UnixInit
#define _MD_GET_INTERVAL _PR_UNIX_GetInterval #define _MD_INTERVAL_USE_GTOD
#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond
/* For writev() */ /* For writev() */
#include <sys/uio.h> #include <sys/uio.h>

View File

@ -294,9 +294,22 @@ extern void _MD_FreeSegment(PRSegment *seg);
/************************************************************************/ /************************************************************************/
#if !defined(HPUX_LW_TIMER) #ifdef _MD_INTERVAL_USE_GTOD
extern PRIntervalTime _PR_UNIX_GetInterval(void);
extern PRIntervalTime _PR_UNIX_TicksPerSecond(void);
#define _MD_INTERVAL_INIT() #define _MD_INTERVAL_INIT()
#define _MD_GET_INTERVAL _PR_UNIX_GetInterval
#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond
#endif #endif
#ifdef HAVE_CLOCK_MONOTONIC
extern PRIntervalTime _PR_UNIX_GetInterval2(void);
extern PRIntervalTime _PR_UNIX_TicksPerSecond2(void);
#define _MD_INTERVAL_INIT()
#define _MD_GET_INTERVAL _PR_UNIX_GetInterval2
#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond2
#endif
#define _MD_INTERVAL_PER_MILLISEC() (_PR_MD_INTERVAL_PER_SEC() / 1000) #define _MD_INTERVAL_PER_MILLISEC() (_PR_MD_INTERVAL_PER_SEC() / 1000)
#define _MD_INTERVAL_PER_MICROSEC() (_PR_MD_INTERVAL_PER_SEC() / 1000000) #define _MD_INTERVAL_PER_MICROSEC() (_PR_MD_INTERVAL_PER_SEC() / 1000000)

View File

@ -158,8 +158,7 @@ struct _MDCPU {
* some of them should probably be moved into _unixos.h. But * some of them should probably be moved into _unixos.h. But
* _irix.h seems to be quite different in regard to these macros. * _irix.h seems to be quite different in regard to these macros.
*/ */
#define _MD_GET_INTERVAL _PR_UNIX_GetInterval #define _MD_INTERVAL_USE_GTOD
#define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond
#define _MD_EARLY_INIT _MD_EarlyInit #define _MD_EARLY_INIT _MD_EarlyInit
#define _MD_FINAL_INIT _PR_UnixInit #define _MD_FINAL_INIT _PR_UnixInit

View File

@ -61,33 +61,15 @@ PR_BEGIN_EXTERN_C
#elif defined(DARWIN) #elif defined(DARWIN)
#include "md/_darwin.h" #include "md/_darwin.h"
#elif defined(NEXTSTEP)
#include "md/_nextstep.h"
#elif defined(SOLARIS) #elif defined(SOLARIS)
#include "md/_solaris.h" #include "md/_solaris.h"
#elif defined(SUNOS4)
#include "md/_sunos4.h"
#elif defined(SNI)
#include "md/_reliantunix.h"
#elif defined(SONY)
#include "md/_sony.h"
#elif defined(NEC)
#include "md/_nec.h"
#elif defined(SCO) #elif defined(SCO)
#include "md/_scoos.h" #include "md/_scoos.h"
#elif defined(UNIXWARE) #elif defined(UNIXWARE)
#include "md/_unixware.h" #include "md/_unixware.h"
#elif defined(NCR)
#include "md/_ncr.h"
#elif defined(DGUX) #elif defined(DGUX)
#include "md/_dgux.h" #include "md/_dgux.h"

View File

@ -1,132 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef pr_sunos4_h___
#define pr_sunos4_h___
#ifndef SVR4
/*
** Hodge podge of random missing prototypes for the Sunos4 system
*/
#include <stdio.h>
#include <stdarg.h>
#include <time.h>
#include <limits.h>
#include <sys/types.h>
#define PATH_MAX _POSIX_PATH_MAX
struct timeval;
struct timezone;
struct itimerval;
struct sockaddr;
struct stat;
struct tm;
/* ctype.h */
extern int tolower(int);
extern int toupper(int);
/* errno.h */
extern char *sys_errlist[];
extern int sys_nerr;
#define strerror(e) sys_errlist[((unsigned)(e) < sys_nerr) ? e : 0]
extern void perror(const char *);
/* getopt */
extern char *optarg;
extern int optind;
extern int getopt(int argc, char **argv, char *spec);
/* math.h */
extern int srandom(long val);
extern long random(void);
/* memory.h */
#define memmove(to,from,len) bcopy((char*)(from),(char*)(to),len)
extern void bcopy(const char *, char *, int);
/* signal.h */
/*
** SunOS4 sigaction hides interrupts by default, so we can safely define
** SA_RESTART to 0.
*/
#define SA_RESTART 0
/* stdio.h */
extern int printf(const char *, ...);
extern int fprintf(FILE *, const char *, ...);
extern int vprintf(const char *, va_list);
extern int vfprintf(FILE *, const char *, va_list);
extern char *vsprintf(char *, const char *, va_list);
extern int scanf(const char *, ...);
extern int sscanf(const char *, const char *, ...);
extern int fscanf(FILE *, const char *, ...);
extern int fgetc(FILE *);
extern int fputc(int, FILE *);
extern int fputs(const char *, FILE *);
extern int puts(const char *);
extern int fread(void *, size_t, size_t, FILE *);
extern int fwrite(const char *, int, int, FILE *);
extern int fseek(FILE *, long, int);
extern long ftell(FILE *);
extern int rewind(FILE *);
extern int fflush(FILE *);
extern int _flsbuf(unsigned char, FILE *);
extern int fclose(FILE *);
extern int remove(const char *);
extern int setvbuf(FILE *, char *, int, size_t);
extern int system(const char *);
extern FILE *popen(const char *, const char *);
extern int pclose(FILE *);
/* stdlib.h */
#define strtoul strtol
extern int isatty(int fildes);
extern long strtol(const char *, char **, int);
extern int putenv(const char *);
extern void srand48(long);
extern long lrand48(void);
extern double drand48(void);
/* string.h */
extern int strcasecmp(const char *, const char *);
extern int strncasecmp(const char *, const char *, size_t);
extern int strcoll(const char *, const char *);
/* time.h */
extern time_t mktime(struct tm *);
extern size_t strftime(char *, size_t, const char *, const struct tm *);
extern int gettimeofday(struct timeval *, struct timezone *);
extern int setitimer(int, struct itimerval *, struct itimerval *);
extern time_t time(time_t *);
extern time_t timegm(struct tm *);
extern struct tm *localtime(const time_t *);
extern struct tm *gmtime(const time_t *);
/* unistd.h */
extern int rename(const char *, const char *);
extern int ioctl(int, int, int *arg);
extern int connect(int, struct sockaddr *, int);
extern int readlink(const char *, char *, int);
extern int symlink(const char *, const char *);
extern int ftruncate(int, off_t);
extern int fchmod(int, mode_t);
extern int fchown(int, uid_t, gid_t);
extern int lstat(const char *, struct stat *);
extern int fstat(int, struct stat *);
extern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
extern int gethostname(char *, int);
extern char *getwd(char *);
extern int getpagesize(void);
#endif /* SVR4 */
#endif /* pr_sunos4_h___ */

View File

@ -31,11 +31,11 @@ PR_BEGIN_EXTERN_C
** The format of the version string is ** The format of the version string is
** "<major version>.<minor version>[.<patch level>] [<Beta>]" ** "<major version>.<minor version>[.<patch level>] [<Beta>]"
*/ */
#define PR_VERSION "4.9.3" #define PR_VERSION "4.9.4 Beta"
#define PR_VMAJOR 4 #define PR_VMAJOR 4
#define PR_VMINOR 9 #define PR_VMINOR 9
#define PR_VPATCH 3 #define PR_VPATCH 4
#define PR_BETA PR_FALSE #define PR_BETA PR_TRUE
/* /*
** PRVersionCheck ** PRVersionCheck

View File

@ -246,17 +246,6 @@ NSPR_API(PRStatus) PR_ParseTimeString (
PRBool default_to_gmt, PRBool default_to_gmt,
PRTime *result); PRTime *result);
/*
* FIXME: should we also have a formatting function, such as asctime, ctime,
* and strftime in standard C library? But this would involve
* internationalization issues. Might want to provide a US English version.
*/
/**********************************************************************/
/*********************** OLD COMPATIBILITYFUNCTIONS *******************/
/**********************************************************************/
#ifndef NO_NSPR_10_SUPPORT
/* Format a time value into a buffer. Same semantics as strftime() */ /* Format a time value into a buffer. Same semantics as strftime() */
NSPR_API(PRUint32) PR_FormatTime(char *buf, int buflen, const char *fmt, NSPR_API(PRUint32) PR_FormatTime(char *buf, int buflen, const char *fmt,
const PRExplodedTime *tm); const PRExplodedTime *tm);
@ -268,8 +257,6 @@ NSPR_API(PRUint32)
PR_FormatTimeUSEnglish( char* buf, PRUint32 bufSize, PR_FormatTimeUSEnglish( char* buf, PRUint32 bufSize,
const char* format, const PRExplodedTime* tm ); const char* format, const PRExplodedTime* tm );
#endif /* NO_NSPR_10_SUPPORT */
PR_END_EXTERN_C PR_END_EXTERN_C
#endif /* prtime_h___ */ #endif /* prtime_h___ */

View File

@ -133,6 +133,7 @@ endif
else else
OS_LIBS = -ldl OS_LIBS = -ldl
endif endif
OS_LIBS += -lrt
endif endif
ifeq ($(OS_ARCH),HP-UX) ifeq ($(OS_ARCH),HP-UX)

View File

@ -16,9 +16,6 @@
#include <ctype.h> #include <ctype.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef SUNOS4
#include "md/sunos4.h" /* for strtoul */
#endif
#include "prprf.h" #include "prprf.h"
#include "prdtoa.h" #include "prdtoa.h"
#include "prlog.h" #include "prlog.h"

View File

@ -9,9 +9,6 @@
#ifdef XP_UNIX #ifdef XP_UNIX
#include <unistd.h> #include <unistd.h>
#endif #endif
#ifdef SUNOS4
#include "md/sunos4.h"
#endif
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> #include <windows.h>
#endif #endif

View File

@ -5,10 +5,45 @@
#include "primpl.h" #include "primpl.h"
#include <mach/mach_time.h>
void _MD_EarlyInit(void) void _MD_EarlyInit(void)
{ {
} }
/*
* The multiplier (as a fraction) for converting the Mach absolute time
* unit to nanoseconds.
*/
static mach_timebase_info_data_t machTimebaseInfo;
void _PR_Mach_IntervalInit(void)
{
kern_return_t rv;
rv = mach_timebase_info(&machTimebaseInfo);
PR_ASSERT(rv == KERN_SUCCESS);
}
PRIntervalTime _PR_Mach_GetInterval(void)
{
uint64_t time;
/*
* mach_absolute_time returns the time in the Mach absolute time unit.
* Convert it to milliseconds. See Mac Technical Q&A QA1398.
*/
time = mach_absolute_time();
time = time * machTimebaseInfo.numer / machTimebaseInfo.denom /
PR_NSEC_PER_MSEC;
return (PRIntervalTime)time;
} /* _PR_Mach_GetInterval */
PRIntervalTime _PR_Mach_TicksPerSecond(void)
{
return 1000;
}
PRWord *_MD_HomeGCRegisters(PRThread *t, int isCurrent, int *np) PRWord *_MD_HomeGCRegisters(PRThread *t, int isCurrent, int *np)
{ {
#if !defined(_PR_PTHREADS) #if !defined(_PR_PTHREADS)

View File

@ -1,363 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/*
* NCR 3.0 - cloned from UnixWare by ruslan
*/
#include "primpl.h"
#include <setjmp.h>
void _MD_EarlyInit(void)
{
}
PRWord *_MD_HomeGCRegisters(PRThread *t, int isCurrent, int *np)
{
if (isCurrent) {
(void) setjmp(CONTEXT(t));
}
*np = sizeof(CONTEXT(t)) / sizeof(PRWord);
return (PRWord *) CONTEXT(t);
}
#ifdef ALARMS_BREAK_TCP /* I don't think they do */
PRInt32 _MD_connect(PRInt32 osfd, const PRNetAddr *addr, PRInt32 addrlen,
PRIntervalTime timeout)
{
PRInt32 rv;
_MD_BLOCK_CLOCK_INTERRUPTS();
rv = _connect(osfd,addr,addrlen);
_MD_UNBLOCK_CLOCK_INTERRUPTS();
}
PRInt32 _MD_accept(PRInt32 osfd, PRNetAddr *addr, PRInt32 addrlen,
PRIntervalTime timeout)
{
PRInt32 rv;
_MD_BLOCK_CLOCK_INTERRUPTS();
rv = _accept(osfd,addr,addrlen);
_MD_UNBLOCK_CLOCK_INTERRUPTS();
return(rv);
}
#endif
/*
* These are also implemented in pratom.c using NSPR locks. Any reason
* this might be better or worse? If you like this better, define
* _PR_HAVE_ATOMIC_OPS in include/md/unixware.h
*/
#ifdef _PR_HAVE_ATOMIC_OPS
/* Atomic operations */
#include <stdio.h>
static FILE *_uw_semf;
void
_MD_INIT_ATOMIC(void)
{
/* Sigh. Sure wish SYSV semaphores weren't such a pain to use */
if ((_uw_semf = tmpfile()) == NULL)
PR_ASSERT(0);
return;
}
void
_MD_ATOMIC_INCREMENT(PRInt32 *val)
{
flockfile(_uw_semf);
(*val)++;
unflockfile(_uw_semf);
}
void
_MD_ATOMIC_ADD(PRInt32 *ptr, PRInt32 val)
{
flockfile(_uw_semf);
(*ptr) += val;
unflockfile(_uw_semf);
}
void
_MD_ATOMIC_DECREMENT(PRInt32 *val)
{
flockfile(_uw_semf);
(*val)--;
unflockfile(_uw_semf);
}
void
_MD_ATOMIC_SET(PRInt32 *val, PRInt32 newval)
{
flockfile(_uw_semf);
*val = newval;
unflockfile(_uw_semf);
}
#endif
void
_MD_SET_PRIORITY(_MDThread *thread, PRUintn newPri)
{
return;
}
PRStatus
_MD_InitializeThread(PRThread *thread)
{
return PR_SUCCESS;
}
PRStatus
_MD_WAIT(PRThread *thread, PRIntervalTime ticks)
{
PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
_PR_MD_SWITCH_CONTEXT(thread);
return PR_SUCCESS;
}
PRStatus
_MD_WAKEUP_WAITER(PRThread *thread)
{
if (thread) {
PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
}
return PR_SUCCESS;
}
/* These functions should not be called for Unixware */
void
_MD_YIELD(void)
{
PR_NOT_REACHED("_MD_YIELD should not be called for Unixware.");
}
PRStatus
_MD_CREATE_THREAD(
PRThread *thread,
void (*start) (void *),
PRUintn priority,
PRThreadScope scope,
PRThreadState state,
PRUint32 stackSize)
{
PR_NOT_REACHED("_MD_CREATE_THREAD should not be called for Unixware.");
return PR_FAILURE;
}
/*
This is temp. replacement for localtime_r. Normally PR_ExplodeTime should
be used as to my understanding
*/
/*
** $$$$$ THEN WHY ARE WE DOING THIS? - AOF $$$$$
*/
#define NEED_LOCALTIME_R
#define NEED_GMTIME_R
#define NEED_ASCTIME_R
#define NEED_STRTOK_R
#define NEED_CTIME_R
#if defined (NEED_LOCALTIME_R) || defined (NEED_CTIME_R) || defined (NEED_ASCTIME_R) || defined (NEED_GMTIME_R) || defined (NEED_STRTOK_R)
#include "prlock.h"
#endif
#if defined (NEED_LOCALTIME_R)
static PRLock *localtime_r_monitor = NULL;
struct tm *localtime_r (const time_t *clock, struct tm *result)
{
struct tm *tmPtr;
int needLock = PR_Initialized(); /* We need to use a lock to protect
* against NSPR threads only when the
* NSPR thread system is activated. */
if (needLock) {
if (localtime_r_monitor == NULL) {
localtime_r_monitor = PR_NewLock();
}
PR_Lock(localtime_r_monitor);
}
/*
* On Windows, localtime() returns a NULL pointer if 'clock'
* represents a time before midnight January 1, 1970. In
* that case, we also return a NULL pointer and the struct tm
* object pointed to by 'result' is not modified.
*/
tmPtr = localtime(clock);
if (tmPtr) {
*result = *tmPtr;
} else {
result = NULL;
}
if (needLock) PR_Unlock(localtime_r_monitor);
return result;
}
#endif
#if defined (NEED_GMTIME_R)
static PRLock *gmtime_r_monitor = NULL;
struct tm *gmtime_r (const time_t *clock, struct tm *result)
{
struct tm *tmPtr;
int needLock = PR_Initialized(); /* We need to use a lock to protect
* against NSPR threads only when the
* NSPR thread system is activated. */
if (needLock) {
if (gmtime_r_monitor == NULL) {
gmtime_r_monitor = PR_NewLock();
}
PR_Lock(gmtime_r_monitor);
}
tmPtr = gmtime(clock);
if (tmPtr) {
*result = *tmPtr;
} else {
result = NULL;
}
if (needLock) PR_Unlock(gmtime_r_monitor);
return result;
}
#endif
#if defined (NEED_CTIME_R)
static PRLock *ctime_r_monitor = NULL;
char *ctime_r (const time_t *clock, char *buf, int buflen)
{
char *cbuf;
int needLock = PR_Initialized(); /* We need to use a lock to protect
* against NSPR threads only when the
* NSPR thread system is activated. */
if (needLock) {
if (ctime_r_monitor == NULL) {
ctime_r_monitor = PR_NewLock();
}
PR_Lock(ctime_r_monitor);
}
cbuf = ctime (clock);
if (cbuf) {
strncpy (buf, cbuf, buflen - 1);
buf[buflen - 1] = 0;
}
if (needLock) PR_Unlock(ctime_r_monitor);
return cbuf;
}
#endif
#if defined (NEED_ASCTIME_R)
static PRLock *asctime_r_monitor = NULL;
char *asctime_r (const struct tm *tm, char *buf, int buflen)
{
char *cbuf;
int needLock = PR_Initialized(); /* We need to use a lock to protect
* against NSPR threads only when the
* NSPR thread system is activated. */
if (needLock) {
if (asctime_r_monitor == NULL) {
asctime_r_monitor = PR_NewLock();
}
PR_Lock(asctime_r_monitor);
}
cbuf = asctime (tm);
if (cbuf) {
strncpy (buf, cbuf, buflen - 1);
buf[buflen - 1] = 0;
}
if (needLock) PR_Unlock(asctime_r_monitor);
return cbuf;
}
#endif
#if defined (NEED_STRTOK_R)
char *
strtok_r (s, delim, last)
register char *s;
register const char *delim;
register char **last;
{
register char *spanp;
register int c, sc;
char *tok;
if (s == NULL && (s = *last) == NULL)
return (NULL);
/*
* Skip (span) leading delimiters (s += strspn(s, delim), sort of).
*/
cont:
c = *s++;
for (spanp = (char *)delim; (sc = *spanp++) != 0;) {
if (c == sc)
goto cont;
}
if (c == 0) { /* no non-delimiter characters */
*last = NULL;
return (NULL);
}
tok = s - 1;
/*
* Scan token (scan for delimiters: s += strcspn(s, delim), sort of).
* Note that delim must have one NUL; we stop if we see that, too.
*/
for (;;) {
c = *s++;
spanp = (char *)delim;
do {
if ((sc = *spanp++) == c) {
if (c == 0)
s = NULL;
else
s[-1] = 0;
*last = s;
return (tok);
}
} while (sc != 0);
}
/* NOTREACHED */
}
#endif

View File

@ -1,68 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "primpl.h"
void _MD_EarlyInit(void)
{
}
PRWord *_MD_HomeGCRegisters(PRThread *t, int isCurrent, int *np)
{
if (isCurrent) {
(void) setjmp(CONTEXT(t));
}
*np = sizeof(CONTEXT(t)) / sizeof(PRWord);
return (PRWord *) CONTEXT(t);
}
void
_MD_SET_PRIORITY(_MDThread *thread, PRUintn newPri)
{
return;
}
PRStatus
_MD_InitializeThread(PRThread *thread)
{
return PR_SUCCESS;
}
PRStatus
_MD_WAIT(PRThread *thread, PRIntervalTime ticks)
{
PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
_PR_MD_SWITCH_CONTEXT(thread);
return PR_SUCCESS;
}
PRStatus
_MD_WAKEUP_WAITER(PRThread *thread)
{
if (thread) {
PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
}
return PR_SUCCESS;
}
/* These functions should not be called for NEC */
void
_MD_YIELD(void)
{
PR_NOT_REACHED("_MD_YIELD should not be called for NEC.");
}
PRStatus
_MD_CREATE_THREAD(
PRThread *thread,
void (*start) (void *),
PRThreadPriority priority,
PRThreadScope scope,
PRThreadState state,
PRUint32 stackSize)
{
PR_NOT_REACHED("_MD_CREATE_THREAD should not be called for NEC.");
return PR_FAILURE;
}

View File

@ -1,252 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "primpl.h"
#import <mach/mach.h>
#import <mach/mach_error.h>
#import <mach-o/dyld.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <syscall.h>
/* These functions are hidden in NEXTSTEP, but beacuse they have syscall()
** entries I can wrap these into their corresponding missing function.
*/
caddr_t
mmap(caddr_t addr, size_t len, int prot, int flags,
int fildes, off_t off)
{
return (caddr_t) syscall (SYS_mmap, addr, len, prot, flags, fildes, off);
}
int
munmap(caddr_t addr, size_t len)
{
return syscall (SYS_munmap, addr, len);
}
int
mprotect(caddr_t addr, size_t len, int prot)
{
return syscall (SYS_mprotect, addr, len, prot);
}
/* If found the brk() symbol in the sahred libraries but no syscall() entry ...
** I don't know whether it will work ...
int brk(void *endds)
{
return syscall ();
}
*/
void *sbrk(int incr)
{
return (void *) syscall (SYS_sbrk, incr);
}
/* These are my mach based versions, untested and probably bad ...
*/
caddr_t my_mmap(caddr_t addr, size_t len, int prot, int flags,
int fildes, off_t off)
{
kern_return_t ret_val;
/* First map ...
*/
ret_val = map_fd ( fildes, /* fd */
(vm_offset_t) off, /* offset */
(vm_offset_t*)&addr, /* address */
TRUE, /* find_space */
(vm_size_t) len); /* size */
if (ret_val != KERN_SUCCESS) {
mach_error("Error calling map_fd() in mmap", ret_val );
return (caddr_t)0;
}
/* ... then protect (this is probably bad)
*/
ret_val = vm_protect( task_self(), /* target_task */
(vm_address_t)addr, /* address */
(vm_size_t) len, /* size */
FALSE, /* set_maximum */
(vm_prot_t) prot); /* new_protection */
if (ret_val != KERN_SUCCESS) {
mach_error("vm_protect in mmap()", ret_val );
return (caddr_t)0;
}
return addr;
}
int my_munmap(caddr_t addr, size_t len)
{
kern_return_t ret_val;
ret_val = vm_deallocate(task_self(),
(vm_address_t) addr,
(vm_size_t) len);
if (ret_val != KERN_SUCCESS) {
mach_error("vm_deallocate in munmap()", ret_val);
return -1;
}
return 0;
}
int my_mprotect(caddr_t addr, size_t len, int prot)
{
vm_prot_t mach_prot;
kern_return_t ret_val;
switch (prot) {
case PROT_READ: mach_prot = VM_PROT_READ; break;
case PROT_WRITE: mach_prot = VM_PROT_WRITE; break;
case PROT_EXEC: mach_prot = VM_PROT_EXECUTE; break;
case PROT_NONE: mach_prot = VM_PROT_NONE; break;
}
ret_val = vm_protect(task_self(), /* target_task */
(vm_address_t)addr, /* address */
(vm_size_t) len, /* size */
FALSE, /* set_maximum */
(vm_prot_t) prot); /* new_protection */
if (ret_val != KERN_SUCCESS) {
mach_error("vm_protect in mprotect()", ret_val);
return -1;
}
return 0;
}
char *strdup(const char *s1)
{
int len = strlen (s1);
char *copy = (char*) malloc (len+1);
if (copy == (char*)0)
return (char*)0;
strcpy (copy, s1);
return copy;
}
/* Stub rld functions
*/
extern NSObjectFileImageReturnCode NSCreateObjectFileImageFromFile(
const char *pathName,
NSObjectFileImage *objectFileImage)
{
return NSObjectFileImageFailure;
}
extern void * NSAddressOfSymbol(
NSSymbol symbol)
{
return NULL;
}
extern NSModule NSLinkModule(
NSObjectFileImage objectFileImage,
const char *moduleName, /* can be NULL */
enum bool bindNow)
{
return NULL;
}
extern NSSymbol NSLookupAndBindSymbol(
const char *symbolName)
{
return NULL;
}
extern enum bool NSUnLinkModule(
NSModule module,
enum bool keepMemoryMapped)
{
return 0;
}
void _MD_EarlyInit(void)
{
}
PRWord *_MD_HomeGCRegisters(PRThread *t, int isCurrent, int *np)
{
#ifndef _PR_PTHREADS
if (isCurrent) {
(void) sigsetjmp(CONTEXT(t), 1);
}
*np = sizeof(CONTEXT(t)) / sizeof(PRWord);
return (PRWord *) CONTEXT(t);
#else
*np = 0;
return NULL;
#endif
}
#ifndef _PR_PTHREADS
void
_MD_SET_PRIORITY(_MDThread *thread, PRUintn newPri)
{
return;
}
PRStatus
_MD_InitializeThread(PRThread *thread)
{
return PR_SUCCESS;
}
PRStatus
_MD_WAIT(PRThread *thread, PRIntervalTime ticks)
{
PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
_PR_MD_SWITCH_CONTEXT(thread);
return PR_SUCCESS;
}
PRStatus
_MD_WAKEUP_WAITER(PRThread *thread)
{
if (thread) {
PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
}
return PR_SUCCESS;
}
/* These functions should not be called for NEXTSTEP */
void
_MD_YIELD(void)
{
PR_NOT_REACHED("_MD_YIELD should not be called for NEXTSTEP.");
}
PRStatus
_MD_CREATE_THREAD(
PRThread *thread,
void (*start) (void *),
PRThreadPriority priority,
PRThreadScope scope,
PRThreadState state,
PRUint32 stackSize)
{
PR_NOT_REACHED("_MD_CREATE_THREAD should not be called for NEXTSTEP.");
return PR_FAILURE;
}
#endif

View File

@ -1,101 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/*
* SINIX (ReliantUNIX) 5.4 - copied from unixware.c by chrisk 040497
*/
#include "primpl.h"
#include <ucontext.h>
void _MD_EarlyInit(void)
{
}
PRWord *_MD_HomeGCRegisters(PRThread *t, int isCurrent, int *np)
{
if (isCurrent) {
(void) _GETCONTEXT(CONTEXT(t));
}
*np = sizeof(CONTEXT(t)) / sizeof(PRWord);
return (PRWord *) CONTEXT(t);
}
#ifdef ALARMS_BREAK_TCP /* I don't think they do */
PRInt32 _MD_connect(PRInt32 osfd, PRNetAddr *addr, PRInt32 addrlen,
PRIntervalTime timeout)
{
PRInt32 rv;
_MD_BLOCK_CLOCK_INTERRUPTS();
rv = _connect(osfd,addr,addrlen);
_MD_UNBLOCK_CLOCK_INTERRUPTS();
}
PRInt32 _MD_accept(PRInt32 osfd, PRNetAddr *addr, PRInt32 addrlen,
PRIntervalTime timeout)
{
PRInt32 rv;
_MD_BLOCK_CLOCK_INTERRUPTS();
rv = _accept(osfd,addr,addrlen);
_MD_UNBLOCK_CLOCK_INTERRUPTS();
return(rv);
}
#endif
void
_MD_SET_PRIORITY(_MDThread *thread, PRUintn newPri)
{
return;
}
PRStatus
_MD_InitializeThread(PRThread *thread)
{
return PR_SUCCESS;
}
PRStatus
_MD_WAIT(PRThread *thread, PRIntervalTime ticks)
{
PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
_PR_MD_SWITCH_CONTEXT(thread);
return PR_SUCCESS;
}
PRStatus
_MD_WAKEUP_WAITER(PRThread *thread)
{
if (thread) {
PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
}
return PR_SUCCESS;
}
/* These functions should not be called for SINIX */
/* Why? Just copied it from UNIXWARE... flying-by-night, chrisk 040497 */
void
_MD_YIELD(void)
{
PR_NOT_REACHED("_MD_YIELD should not be called for SINIX.");
}
PRStatus
_MD_CREATE_THREAD(
PRThread *thread,
void (*start) (void *),
PRUintn priority,
PRThreadScope scope,
PRThreadState state,
PRUint32 stackSize)
{
PR_NOT_REACHED("_MD_CREATE_THREAD should not be called for SINIX.");
#if defined(SNI) && !defined(__GNUC__)
/* make compiler happy */
return (PRStatus)NULL;
#endif
}

View File

@ -1,77 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "primpl.h"
#include <signal.h>
void _MD_EarlyInit(void)
{
}
PRWord *_MD_HomeGCRegisters(PRThread *t, int isCurrent, int *np)
{
#ifndef _PR_PTHREADS
if (isCurrent) {
(void) setjmp(CONTEXT(t), 1);
}
*np = sizeof(CONTEXT(t)) / sizeof(PRWord);
return (PRWord *) CONTEXT(t);
#else
*np = 0;
return NULL;
#endif
}
#ifndef _PR_PTHREADS
void
_MD_SET_PRIORITY(_MDThread *thread, PRUintn newPri)
{
return;
}
PRStatus
_MD_InitializeThread(PRThread *thread)
{
return PR_SUCCESS;
}
PRStatus
_MD_WAIT(PRThread *thread, PRIntervalTime ticks)
{
PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
_PR_MD_SWITCH_CONTEXT(thread);
return PR_SUCCESS;
}
PRStatus
_MD_WAKEUP_WAITER(PRThread *thread)
{
if (thread) {
PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
}
return PR_SUCCESS;
}
/* These functions should not be called for Sony */
void
_MD_YIELD(void)
{
PR_NOT_REACHED("_MD_YIELD should not be called for SONY.");
}
PRStatus
_MD_CREATE_THREAD(
PRThread *thread,
void (*start) (void *),
PRThreadPriority priority,
PRThreadScope scope,
PRThreadState state,
PRUint32 stackSize)
{
PR_NOT_REACHED("_MD_CREATE_THREAD should not be called for SONY.");
return PR_FAILURE;
}
#endif /* ! _PR_PTHREADS */

View File

@ -1,64 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include <setjmp.h>
#include "primpl.h"
void _MD_EarlyInit(void)
{
}
PRStatus _MD_CREATE_THREAD(PRThread *thread,
void (*start)(void *),
PRThreadPriority priority,
PRThreadScope scope,
PRThreadState state,
PRUint32 stackSize)
{
PR_NOT_REACHED("_MD_CREATE_THREAD should not be called for SunOS 4.1.3.");
return PR_FAILURE;
}
void _MD_SET_PRIORITY(_MDThread *md_thread, PRUintn newPri)
{
PR_NOT_REACHED("_MD_SET_PRIORITY should not be called for user-level threads.");
}
PRStatus
_MD_WAIT(PRThread *thread, PRIntervalTime ticks)
{
PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
_PR_MD_SWITCH_CONTEXT(thread);
return PR_SUCCESS;
}
PRStatus
_MD_WAKEUP_WAITER(PRThread *thread)
{
if (thread) {
PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
}
return PR_SUCCESS;
}
PRStatus _MD_InitializeThread(PRThread *thread)
{
return PR_SUCCESS;
}
void
_MD_YIELD(void)
{
PR_NOT_REACHED("_MD_YIELD should not be called for SunOS 4.1.3.");
}
PRWord *_MD_HomeGCRegisters(PRThread *t, int isCurrent, int *np)
{
if (isCurrent) {
(void) setjmp(CONTEXT(t));
}
*np = sizeof(CONTEXT(t)) / sizeof(PRWord);
return (PRWord *) CONTEXT(t);
}

View File

@ -3017,6 +3017,13 @@ PR_Now(void)
return s; return s;
} }
#if defined(_MD_INTERVAL_USE_GTOD)
/*
* This version of interval times is based on the time of day
* capability offered by the system. This isn't valid for two reasons:
* 1) The time of day is neither linear nor montonically increasing
* 2) The units here are milliseconds. That's not appropriate for our use.
*/
PRIntervalTime _PR_UNIX_GetInterval() PRIntervalTime _PR_UNIX_GetInterval()
{ {
struct timeval time; struct timeval time;
@ -3026,12 +3033,35 @@ PRIntervalTime _PR_UNIX_GetInterval()
ticks = (PRUint32)time.tv_sec * PR_MSEC_PER_SEC; /* that's in milliseconds */ ticks = (PRUint32)time.tv_sec * PR_MSEC_PER_SEC; /* that's in milliseconds */
ticks += (PRUint32)time.tv_usec / PR_USEC_PER_MSEC; /* so's that */ ticks += (PRUint32)time.tv_usec / PR_USEC_PER_MSEC; /* so's that */
return ticks; return ticks;
} /* _PR_SUNOS_GetInterval */ } /* _PR_UNIX_GetInterval */
PRIntervalTime _PR_UNIX_TicksPerSecond() PRIntervalTime _PR_UNIX_TicksPerSecond()
{ {
return 1000; /* this needs some work :) */ return 1000; /* this needs some work :) */
} }
#endif
#if defined(HAVE_CLOCK_MONOTONIC)
PRIntervalTime _PR_UNIX_GetInterval2()
{
struct timespec time;
PRIntervalTime ticks;
if (clock_gettime(CLOCK_MONOTONIC, &time) != 0) {
fprintf(stderr, "clock_gettime failed: %d\n", errno);
abort();
}
ticks = (PRUint32)time.tv_sec * PR_MSEC_PER_SEC;
ticks += (PRUint32)time.tv_nsec / PR_NSEC_PER_MSEC;
return ticks;
}
PRIntervalTime _PR_UNIX_TicksPerSecond2()
{
return 1000;
}
#endif
#if !defined(_PR_PTHREADS) #if !defined(_PR_PTHREADS)
/* /*

View File

@ -25,9 +25,6 @@ provided "as is" without express or implied warranty.
*/ */
#include <string.h> #include <string.h>
#ifdef SUNOS4
#include "md/sunos4.h" /* for strerror */
#endif
#include <assert.h> #include <assert.h>
#include <errno.h> #include <errno.h>
#include "prmem.h" #include "prmem.h"

View File

@ -32,13 +32,6 @@ void _PR_InitClock(void)
#endif /* DEBUG */ #endif /* DEBUG */
} }
/*
* This version of interval times is based on the time of day
* capability offered by system. This isn't valid for two reasons:
* 1) The time of day is neither linear nor montonically increasing
* 2) The units here are milliseconds. That's not appropriate for our use.
*/
PR_IMPLEMENT(PRIntervalTime) PR_IntervalNow(void) PR_IMPLEMENT(PRIntervalTime) PR_IntervalNow(void)
{ {
if (!_pr_initialized) _PR_ImplicitInitialization(); if (!_pr_initialized) _PR_ImplicitInitialization();

View File

@ -20,9 +20,9 @@
#include <stdlib.h> #include <stdlib.h>
/* /*
* This release (4.9.3) is backward compatible with the * This release (4.9.4) is backward compatible with the
* 4.0.x, 4.1.x, 4.2.x, 4.3.x, 4.4.x, 4.5.x, 4.6.x, 4.7.x, * 4.0.x, 4.1.x, 4.2.x, 4.3.x, 4.4.x, 4.5.x, 4.6.x, 4.7.x,
* 4.8.x, 4.9, 4.9.1, and 4.9.2 releases. It, of course, * 4.8.x, 4.9, 4.9.1, 4.9.2, and 4.9.3 releases. It, of course,
* is compatible with itself. * is compatible with itself.
*/ */
static char *compatible_version[] = { static char *compatible_version[] = {
@ -35,7 +35,7 @@ static char *compatible_version[] = {
"4.7.6", "4.7.6",
"4.8", "4.8.1", "4.8.2", "4.8.3", "4.8.4", "4.8.5", "4.8", "4.8.1", "4.8.2", "4.8.3", "4.8.4", "4.8.5",
"4.8.6", "4.8.7", "4.8.8", "4.8.9", "4.8.6", "4.8.7", "4.8.8", "4.8.9",
"4.9", "4.9.1", "4.9.2", PR_VERSION "4.9", "4.9.1", "4.9.2", "4.9.3", PR_VERSION
}; };
/* /*
@ -50,7 +50,7 @@ static char *incompatible_version[] = {
"3.0", "3.0.1", "3.0", "3.0.1",
"3.1", "3.1.1", "3.1.2", "3.1.3", "3.1", "3.1.1", "3.1.2", "3.1.3",
"3.5", "3.5.1", "3.5", "3.5.1",
"4.9.4", "4.9.5",
"4.10", "4.10.1", "4.10", "4.10.1",
"10.0", "11.1", "12.14.20" "10.0", "11.1", "12.14.20"
}; };

View File

@ -17,15 +17,8 @@ import platform
import weakref import weakref
import xml.dom.minidom as dom import xml.dom.minidom as dom
try: from manifestparser import TestManifest
from manifestparser import TestManifest from mozhttpd import iface, MozHttpd
from mozhttpd import iface, MozHttpd
except ImportError:
print "manifestparser or mozhttpd not found! Please install mozbase:\n"
print "\tgit clone git://github.com/mozilla/mozbase.git"
print "\tpython setup_development.py\n"
import sys
sys.exit(1)
from marionette import Marionette from marionette import Marionette
from marionette_test import MarionetteJSTestCase, MarionetteTestCase from marionette_test import MarionetteJSTestCase, MarionetteTestCase

Some files were not shown because too many files have changed in this diff Show More